Cube  Diff

Differences From Artifact [315b2acb14]:

To Artifact [820ea372aa]:


101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

117
118
119


120
121
122

123
124
125
126
127
128
129

	int xs, ys;
	glBindTexture(GL_TEXTURE_2D,
	    tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum);

	int ix = (int)position.x;
	int iy = (int)position.z;
	OFVector3D light = OFMakeVector3D(1, 1, 1);

	if (!OUTBORD(ix, iy)) {
		struct sqr *s = S(ix, iy);
		float ll = 256.0f; // 0.96f;
		float of = 0.0f;   // 0.1f;
		light.x = s->r / ll + of;
		light.y = s->g / ll + of;
		light.z = s->b / ll + of;

	}

	if (teammate) {


		light.x *= 0.6f;
		light.y *= 0.7f;
		light.z *= 1.2f;

	}

	[m renderWithLight:light
	             frame:frame
	             range:range
	          position:position
	               yaw:yaw







|





|
|
|
>



>
>
|
|
|
>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

	int xs, ys;
	glBindTexture(GL_TEXTURE_2D,
	    tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum);

	int ix = (int)position.x;
	int iy = (int)position.z;
	OFColor *light = [OFColor colorWithRed:1 green:1 blue:1 alpha:1];

	if (!OUTBORD(ix, iy)) {
		struct sqr *s = S(ix, iy);
		float ll = 256.0f; // 0.96f;
		float of = 0.0f;   // 0.1f;
		light = [OFColor colorWithRed:s->r / ll + of
		                        green:s->g / ll + of
		                         blue:s->b / ll + of
		                        alpha:1];
	}

	if (teammate) {
		float red, green, blue;
		[light getRed:&red green:&green blue:&blue alpha:NULL];
		light = [OFColor colorWithRed:red * 0.6f
		                        green:green * 0.7f
		                         blue:blue * 1.2f
		                        alpha:1];
	}

	[m renderWithLight:light
	             frame:frame
	             range:range
	          position:position
	               yaw:yaw