ObjFW  Diff

Differences From Artifact [2f91cc67c5]:

To Artifact [81834eec17]:


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

static const float identityValues[16] = {
	1, 0, 0, 0,
	0, 1, 0, 0,
	0, 0, 1, 0,
	0, 0, 0, 1
};
static OFMatrix4x4 *identityMatrix;

static void
initIdentityMatrix(void)
{
	identityMatrix = [[OFMatrix4x4 alloc] initWithValues: identityValues];
}

@implementation OFMatrix4x4
+ (void)initialize
{
	if (self != [OFMatrix4x4 class])
		return;
}

+ (OFMatrix4x4 *)identityMatrix
{
	static OFOnceControl onceControl = OFOnceControlInitValue;
	OFOnce(&onceControl, initIdentityMatrix);

	return identityMatrix;
}

+ (instancetype)matrixWithValues: (const float [16])values
{
	return [[[self alloc] initWithValues: values] autorelease];
}








<

<
<
<
<
<
<

<
<
<
<
<
<


<
<
|
|







21
22
23
24
25
26
27

28






29






30
31


32
33
34
35
36
37
38
39
40

static const float identityValues[16] = {
	1, 0, 0, 0,
	0, 1, 0, 0,
	0, 0, 1, 0,
	0, 0, 0, 1
};








@implementation OFMatrix4x4






+ (OFMatrix4x4 *)identityMatrix
{


	return [[[OFMatrix4x4 alloc]
	    initWithValues: identityValues] autorelease];
}

+ (instancetype)matrixWithValues: (const float [16])values
{
	return [[[self alloc] initWithValues: values] autorelease];
}