Cube  Diff

Differences From Artifact [bb9341fd13]:

To Artifact [3909c7f58d]:


99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113







-
+







	vertcheck();
	if (showm) {
		l3 = l1 = &sbright;
		l4 = l2 = &sdark;
	};

	int sx, sy;
	int gltex = lookuptexture(wtex, sx, sy);
	int gltex = lookuptexture(wtex, &sx, &sy);
	float xf = TEXTURESCALE / sx;
	float yf = TEXTURESCALE / sy;
	float xs = size * xf;
	float ys = size * yf;
	float xo = xf * x;
	float yo = yf * y;

180
181
182
183
184
185
186
187

188
189
190
191
192
193
194
180
181
182
183
184
185
186

187
188
189
190
191
192
193
194







-
+







	vertcheck();
	if (showm) {
		l3 = l1 = &sbright;
		l4 = l2 = &sdark;
	};

	int sx, sy;
	int gltex = lookuptexture(wtex, sx, sy);
	int gltex = lookuptexture(wtex, &sx, &sy);
	float xf = TEXTURESCALE / sx;
	float yf = TEXTURESCALE / sy;
	float xs = size * xf;
	float ys = size * yf;
	float xo = xf * x;
	float yo = yf * y;

234
235
236
237
238
239
240
241

242
243
244
245
246
247
248
249
250

251
252
253
254
255
256
257
234
235
236
237
238
239
240

241
242
243
244
245
246
247
248
249

250
251
252
253
254
255
256
257







-
+








-
+







render_2tris(sqr *h, sqr *s, int x1, int y1, int x2, int y2, int x3, int y3,
    sqr *l1, sqr *l2, sqr *l3) // floor/ceil tris on a corner cube
{
	stripend();
	vertcheck();

	int sx, sy;
	int gltex = lookuptexture(h->ftex, sx, sy);
	int gltex = lookuptexture(h->ftex, &sx, &sy);
	float xf = TEXTURESCALE / sx;
	float yf = TEXTURESCALE / sy;

	vertf((float)x1, h->floor, (float)y1, l1, xf * x1, yf * y1);
	vertf((float)x2, h->floor, (float)y2, l2, xf * x2, yf * y2);
	vertf((float)x3, h->floor, (float)y3, l3, xf * x3, yf * y3);
	addstrip(gltex, curvert - 3, 3);

	gltex = lookuptexture(h->ctex, sx, sy);
	gltex = lookuptexture(h->ctex, &sx, &sy);
	xf = TEXTURESCALE / sx;
	yf = TEXTURESCALE / sy;

	vertf((float)x3, h->ceil, (float)y3, l3, xf * x3, yf * y3);
	vertf((float)x2, h->ceil, (float)y2, l2, xf * x2, yf * y2);
	vertf((float)x1, h->ceil, (float)y1, l1, xf * x1, yf * y1);
	addstrip(gltex, curvert - 3, 3);
288
289
290
291
292
293
294
295

296
297
298
299
300
301
302
288
289
290
291
292
293
294

295
296
297
298
299
300
301
302







-
+







	vertcheck();
	if (showm) {
		l1 = &sbright;
		l2 = &sdark;
	};

	int sx, sy;
	int gltex = lookuptexture(wtex, sx, sy);
	int gltex = lookuptexture(wtex, &sx, &sy);
	float xf = TEXTURESCALE / sx;
	float yf = TEXTURESCALE / sy;
	float xs = size * xf;
	float xo = xf * (x1 == x2 ? min(y1, y2) : min(x1, x2));

	if (!flip) {
		vertf((float)x2, ceil2, (float)y2, l2, xo + xs, -yf * ceil2);
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
348
349
350
351
352
353
354

355
356
357
358
359
360
361
362







-
+







	if (wx1 < 0)
		return nquads;

	glDepthMask(GL_FALSE);
	glEnable(GL_BLEND);
	glBlendFunc(GL_ONE, GL_SRC_COLOR);
	int sx, sy;
	glBindTexture(GL_TEXTURE_2D, lookuptexture(DEFAULT_LIQUID, sx, sy));
	glBindTexture(GL_TEXTURE_2D, lookuptexture(DEFAULT_LIQUID, &sx, &sy));

	wx1 &= ~(watersubdiv - 1);
	wy1 &= ~(watersubdiv - 1);

	float xf = TEXTURESCALE / sx;
	float yf = TEXTURESCALE / sy;
	float xs = watersubdiv * xf;