]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CTRGouraud2.cpp
Merging r6075 through r6106 from trunk to ogl-es branch.
[irrlicht.git] / source / Irrlicht / CTRGouraud2.cpp
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #include "IrrCompileConfig.h"\r
6 #include "IBurningShader.h"\r
7 \r
8 #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_\r
9 \r
10 // compile flag for this file\r
11 #undef USE_ZBUFFER\r
12 #undef IPOL_Z\r
13 #undef CMP_Z\r
14 #undef WRITE_Z\r
15 \r
16 #undef IPOL_W\r
17 #undef CMP_W\r
18 #undef WRITE_W\r
19 \r
20 #undef SUBTEXEL\r
21 #undef INVERSE_W\r
22 \r
23 #undef IPOL_C0\r
24 #undef IPOL_T0\r
25 #undef IPOL_T1\r
26 \r
27 // define render case\r
28 #define SUBTEXEL\r
29 #define INVERSE_W\r
30 \r
31 #define USE_ZBUFFER\r
32 #define IPOL_W\r
33 #define CMP_W\r
34 #define WRITE_W\r
35 \r
36 #define IPOL_C0\r
37 //#define IPOL_T0\r
38 //#define IPOL_T1\r
39 \r
40 // apply global override\r
41 #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT\r
42         #undef INVERSE_W\r
43 #endif\r
44 \r
45 #ifndef SOFTWARE_DRIVER_2_SUBTEXEL\r
46         #undef SUBTEXEL\r
47 #endif\r
48 \r
49 #if BURNING_MATERIAL_MAX_COLORS < 1\r
50         #undef IPOL_C0\r
51 #endif\r
52 \r
53 #if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER )\r
54         #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT\r
55                 #undef IPOL_W\r
56         #endif\r
57         #define IPOL_Z\r
58 \r
59         #ifdef CMP_W\r
60                 #undef CMP_W\r
61                 #define CMP_Z\r
62         #endif\r
63 \r
64         #ifdef WRITE_W\r
65                 #undef WRITE_W\r
66                 #define WRITE_Z\r
67         #endif\r
68 \r
69 #endif\r
70 \r
71 \r
72 namespace irr\r
73 {\r
74 \r
75 namespace video\r
76 {\r
77 \r
78 class CTRGouraud2 : public IBurningShader\r
79 {\r
80 public:\r
81 \r
82         //! constructor\r
83         CTRGouraud2(CBurningVideoDriver* driver);\r
84 \r
85         //! draws an indexed triangle list\r
86         virtual void drawTriangle (const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_;\r
87         //virtual bool canWireFrame () { return true; }\r
88 \r
89 protected:\r
90         virtual void scanline_bilinear ();\r
91 \r
92 };\r
93 \r
94 //! constructor\r
95 CTRGouraud2::CTRGouraud2(CBurningVideoDriver* driver)\r
96 : IBurningShader(driver)\r
97 {\r
98         #ifdef _DEBUG\r
99         setDebugName("CTRGouraud2");\r
100         #endif\r
101 }\r
102 \r
103 \r
104 \r
105 /*!\r
106 */\r
107 void CTRGouraud2::scanline_bilinear ()\r
108 {\r
109         tVideoSample *dst;\r
110 \r
111 #ifdef USE_ZBUFFER\r
112         fp24 *z;\r
113 #endif\r
114 \r
115         s32 xStart;\r
116         s32 xEnd;\r
117         s32 dx;\r
118 \r
119 #ifdef SUBTEXEL\r
120         f32 subPixel;\r
121 #endif\r
122 \r
123 #ifdef IPOL_Z\r
124         f32 slopeZ;\r
125 #endif\r
126 #ifdef IPOL_W\r
127         fp24 slopeW;\r
128 #endif\r
129 #ifdef IPOL_C0\r
130         sVec4 slopeC;\r
131 #endif\r
132 #ifdef IPOL_T0\r
133         sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES];\r
134 #endif\r
135 \r
136         // apply top-left fill-convention, left\r
137         xStart = fill_convention_left( line.x[0] );\r
138         xEnd = fill_convention_right( line.x[1] );\r
139 \r
140         dx = xEnd - xStart;\r
141 \r
142         if ( dx < 0 )\r
143                 return;\r
144 \r
145         // slopes\r
146         const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );\r
147 \r
148 #ifdef IPOL_Z\r
149         slopeZ = (line.z[1] - line.z[0]) * invDeltaX;\r
150 #endif\r
151 #ifdef IPOL_W\r
152         slopeW = (line.w[1] - line.w[0]) * invDeltaX;\r
153 #endif\r
154 #ifdef IPOL_C0\r
155         slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX;\r
156 #endif\r
157 #ifdef IPOL_T0\r
158         slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX;\r
159 #endif\r
160 #ifdef IPOL_T1\r
161         slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX;\r
162 #endif\r
163 \r
164 #ifdef SUBTEXEL\r
165         subPixel = ( (f32) xStart ) - line.x[0];\r
166 #ifdef IPOL_Z\r
167         line.z[0] += slopeZ * subPixel;\r
168 #endif\r
169 #ifdef IPOL_W\r
170         line.w[0] += slopeW * subPixel;\r
171 #endif\r
172 #ifdef IPOL_C0\r
173         line.c[0][0] += slopeC * subPixel;\r
174 #endif\r
175 #ifdef IPOL_T0\r
176         line.t[0][0] += slopeT[0] * subPixel;\r
177 #endif\r
178 #ifdef IPOL_T1\r
179         line.t[1][0] += slopeT[1] * subPixel;\r
180 #endif\r
181 #endif\r
182 \r
183         SOFTWARE_DRIVER_2_CLIPCHECK;\r
184         dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart;\r
185 \r
186 #ifdef USE_ZBUFFER\r
187         z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart;\r
188 #endif\r
189 \r
190 \r
191 \r
192 #ifdef IPOL_C0\r
193         tFixPoint r0, g0, b0;\r
194 \r
195         f32 inversew = FIX_POINT_F32_MUL * COLOR_MAX;\r
196 \r
197 #endif\r
198 \r
199         for ( s32 i = 0; i <= dx; ++i )\r
200         {\r
201                 //if test active only first pixel\r
202                 if ( (0 == EdgeTestPass) & i ) break;\r
203 #ifdef CMP_Z\r
204                 if ( line.z[0] < z[i] )\r
205 #endif\r
206 #ifdef CMP_W\r
207                 if (line.w[0] >= z[i] )\r
208 #endif\r
209 \r
210                 {\r
211 #ifdef IPOL_C0\r
212 \r
213 #ifdef INVERSE_W\r
214                         inversew = fix_inverse32_color(line.w[0]);\r
215 #endif\r
216                         vec4_to_fix( r0, g0, b0, line.c[0][0],inversew );\r
217                         dst[i] = fix_to_sample( r0, g0, b0 );\r
218 #else\r
219                         dst[i] = PrimitiveColor;\r
220 #endif\r
221 \r
222 #ifdef WRITE_Z\r
223                         z[i] = line.z[0];\r
224 #endif\r
225 #ifdef WRITE_W\r
226                         z[i] = line.w[0];\r
227 #endif\r
228 \r
229                 }\r
230 \r
231 #ifdef IPOL_Z\r
232                 line.z[0] += slopeZ;\r
233 #endif\r
234 #ifdef IPOL_W\r
235                 line.w[0] += slopeW;\r
236 #endif\r
237 #ifdef IPOL_C0\r
238                 line.c[0][0] += slopeC;\r
239 #endif\r
240 #ifdef IPOL_T0\r
241                 line.t[0][0] += slopeT[0];\r
242 #endif\r
243 #ifdef IPOL_T1\r
244                 line.t[1][0] += slopeT[1];\r
245 #endif\r
246         }\r
247 \r
248 }\r
249 \r
250 void CTRGouraud2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c)\r
251 {\r
252         // sort on height, y\r
253         if ( a->Pos.y > b->Pos.y ) swapVertexPointer(&a, &b);\r
254         if ( a->Pos.y > c->Pos.y ) swapVertexPointer(&a, &c);\r
255         if ( b->Pos.y > c->Pos.y ) swapVertexPointer(&b, &c);\r
256 \r
257         const f32 ca = c->Pos.y - a->Pos.y;\r
258         const f32 ba = b->Pos.y - a->Pos.y;\r
259         const f32 cb = c->Pos.y - b->Pos.y;\r
260         // calculate delta y of the edges\r
261 \r
262         scan.invDeltaY[0] = reciprocal_edge( ca );\r
263         scan.invDeltaY[1] = reciprocal_edge( ba );\r
264         scan.invDeltaY[2] = reciprocal_edge( cb );\r
265         if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )\r
266                 return;\r
267 \r
268         // find if the major edge is left or right aligned\r
269         f32 temp[4];\r
270 \r
271         temp[0] = a->Pos.x - c->Pos.x;\r
272         temp[1] = -ca;\r
273         temp[2] = b->Pos.x - a->Pos.x;\r
274         temp[3] = ba;\r
275 \r
276         scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1;\r
277         scan.right = 1 - scan.left;\r
278 \r
279         // calculate slopes for the major edge\r
280         scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0];\r
281         scan.x[0] = a->Pos.x;\r
282 \r
283 #ifdef IPOL_Z\r
284         scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0];\r
285         scan.z[0] = a->Pos.z;\r
286 #endif\r
287 \r
288 #ifdef IPOL_W\r
289         scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0];\r
290         scan.w[0] = a->Pos.w;\r
291 #endif\r
292 \r
293 #ifdef IPOL_C0\r
294         scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0];\r
295         scan.c[0][0] = a->Color[0];\r
296 #endif\r
297 \r
298 #ifdef IPOL_T0\r
299         scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0];\r
300         scan.t[0][0] = a->Tex[0];\r
301 #endif\r
302 \r
303 #ifdef IPOL_T1\r
304         scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0];\r
305         scan.t[1][0] = a->Tex[1];\r
306 #endif\r
307 \r
308         // top left fill convention y run\r
309         s32 yStart;\r
310         s32 yEnd;\r
311 \r
312 #ifdef SUBTEXEL\r
313         f32 subPixel;\r
314 #endif\r
315 \r
316 \r
317         // rasterize upper sub-triangle\r
318         if ( (f32) 0.0 != scan.invDeltaY[1]  )\r
319         {\r
320                 // calculate slopes for top edge\r
321                 scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1];\r
322                 scan.x[1] = a->Pos.x;\r
323 \r
324 #ifdef IPOL_Z\r
325                 scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1];\r
326                 scan.z[1] = a->Pos.z;\r
327 #endif\r
328 \r
329 #ifdef IPOL_W\r
330                 scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1];\r
331                 scan.w[1] = a->Pos.w;\r
332 #endif\r
333 \r
334 #ifdef IPOL_C0\r
335                 scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1];\r
336                 scan.c[0][1] = a->Color[0];\r
337 #endif\r
338 \r
339 #ifdef IPOL_T0\r
340                 scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1];\r
341                 scan.t[0][1] = a->Tex[0];\r
342 #endif\r
343 \r
344 #ifdef IPOL_T1\r
345                 scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1];\r
346                 scan.t[1][1] = a->Tex[1];\r
347 #endif\r
348 \r
349                 // apply top-left fill convention, top part\r
350                 yStart = fill_convention_left( a->Pos.y );\r
351                 yEnd = fill_convention_right( b->Pos.y );\r
352 \r
353 #ifdef SUBTEXEL\r
354                 subPixel = ( (f32) yStart ) - a->Pos.y;\r
355 \r
356                 // correct to pixel center\r
357                 scan.x[0] += scan.slopeX[0] * subPixel;\r
358                 scan.x[1] += scan.slopeX[1] * subPixel;\r
359 \r
360 #ifdef IPOL_Z\r
361                 scan.z[0] += scan.slopeZ[0] * subPixel;\r
362                 scan.z[1] += scan.slopeZ[1] * subPixel;\r
363 #endif\r
364 \r
365 #ifdef IPOL_W\r
366                 scan.w[0] += scan.slopeW[0] * subPixel;\r
367                 scan.w[1] += scan.slopeW[1] * subPixel;\r
368 #endif\r
369 \r
370 #ifdef IPOL_C0\r
371                 scan.c[0][0] += scan.slopeC[0][0] * subPixel;\r
372                 scan.c[0][1] += scan.slopeC[0][1] * subPixel;\r
373 #endif\r
374 \r
375 #ifdef IPOL_T0\r
376                 scan.t[0][0] += scan.slopeT[0][0] * subPixel;\r
377                 scan.t[0][1] += scan.slopeT[0][1] * subPixel;\r
378 #endif\r
379 \r
380 #ifdef IPOL_T1\r
381                 scan.t[1][0] += scan.slopeT[1][0] * subPixel;\r
382                 scan.t[1][1] += scan.slopeT[1][1] * subPixel;\r
383 #endif\r
384 \r
385 #endif\r
386 \r
387                 // rasterize the edge scanlines\r
388                 for( line.y = yStart; line.y <= yEnd; ++line.y)\r
389                 {\r
390                         line.x[scan.left] = scan.x[0];\r
391                         line.x[scan.right] = scan.x[1];\r
392 \r
393 #ifdef IPOL_Z\r
394                         line.z[scan.left] = scan.z[0];\r
395                         line.z[scan.right] = scan.z[1];\r
396 #endif\r
397 \r
398 #ifdef IPOL_W\r
399                         line.w[scan.left] = scan.w[0];\r
400                         line.w[scan.right] = scan.w[1];\r
401 #endif\r
402 \r
403 #ifdef IPOL_C0\r
404                         line.c[0][scan.left] = scan.c[0][0];\r
405                         line.c[0][scan.right] = scan.c[0][1];\r
406 #endif\r
407 \r
408 #ifdef IPOL_T0\r
409                         line.t[0][scan.left] = scan.t[0][0];\r
410                         line.t[0][scan.right] = scan.t[0][1];\r
411 #endif\r
412 \r
413 #ifdef IPOL_T1\r
414                         line.t[1][scan.left] = scan.t[1][0];\r
415                         line.t[1][scan.right] = scan.t[1][1];\r
416 #endif\r
417 \r
418                         // render a scanline\r
419                         scanline_bilinear ();\r
420                         if ( EdgeTestPass & edge_test_first_line ) break;\r
421 \r
422                         scan.x[0] += scan.slopeX[0];\r
423                         scan.x[1] += scan.slopeX[1];\r
424 \r
425 #ifdef IPOL_Z\r
426                         scan.z[0] += scan.slopeZ[0];\r
427                         scan.z[1] += scan.slopeZ[1];\r
428 #endif\r
429 \r
430 #ifdef IPOL_W\r
431                         scan.w[0] += scan.slopeW[0];\r
432                         scan.w[1] += scan.slopeW[1];\r
433 #endif\r
434 \r
435 #ifdef IPOL_C0\r
436                         scan.c[0][0] += scan.slopeC[0][0];\r
437                         scan.c[0][1] += scan.slopeC[0][1];\r
438 #endif\r
439 \r
440 #ifdef IPOL_T0\r
441                         scan.t[0][0] += scan.slopeT[0][0];\r
442                         scan.t[0][1] += scan.slopeT[0][1];\r
443 #endif\r
444 \r
445 #ifdef IPOL_T1\r
446                         scan.t[1][0] += scan.slopeT[1][0];\r
447                         scan.t[1][1] += scan.slopeT[1][1];\r
448 #endif\r
449 \r
450                 }\r
451         }\r
452 \r
453         // rasterize lower sub-triangle\r
454         if (  (f32) 0.0 != scan.invDeltaY[2] )\r
455         {\r
456                 // advance to middle point\r
457                 if( (f32) 0.0 != scan.invDeltaY[1] )\r
458                 {\r
459                         temp[0] = b->Pos.y - a->Pos.y;  // dy\r
460 \r
461                         scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0];\r
462 #ifdef IPOL_Z\r
463                         scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0];\r
464 #endif\r
465 #ifdef IPOL_W\r
466                         scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0];\r
467 #endif\r
468 #ifdef IPOL_C0\r
469                         scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0];\r
470 #endif\r
471 #ifdef IPOL_T0\r
472                         scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0];\r
473 #endif\r
474 #ifdef IPOL_T1\r
475                         scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0];\r
476 #endif\r
477 \r
478                 }\r
479 \r
480                 // calculate slopes for bottom edge\r
481                 scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2];\r
482                 scan.x[1] = b->Pos.x;\r
483 \r
484 #ifdef IPOL_Z\r
485                 scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2];\r
486                 scan.z[1] = b->Pos.z;\r
487 #endif\r
488 \r
489 #ifdef IPOL_W\r
490                 scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2];\r
491                 scan.w[1] = b->Pos.w;\r
492 #endif\r
493 \r
494 #ifdef IPOL_C0\r
495                 scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2];\r
496                 scan.c[0][1] = b->Color[0];\r
497 #endif\r
498 \r
499 #ifdef IPOL_T0\r
500                 scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2];\r
501                 scan.t[0][1] = b->Tex[0];\r
502 #endif\r
503 \r
504 #ifdef IPOL_T1\r
505                 scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2];\r
506                 scan.t[1][1] = b->Tex[1];\r
507 #endif\r
508 \r
509                 // apply top-left fill convention, top part\r
510                 yStart = fill_convention_left( b->Pos.y );\r
511                 yEnd = fill_convention_right( c->Pos.y );\r
512 \r
513 #ifdef SUBTEXEL\r
514 \r
515                 subPixel = ( (f32) yStart ) - b->Pos.y;\r
516 \r
517                 // correct to pixel center\r
518                 scan.x[0] += scan.slopeX[0] * subPixel;\r
519                 scan.x[1] += scan.slopeX[1] * subPixel;\r
520 \r
521 #ifdef IPOL_Z\r
522                 scan.z[0] += scan.slopeZ[0] * subPixel;\r
523                 scan.z[1] += scan.slopeZ[1] * subPixel;\r
524 #endif\r
525 \r
526 #ifdef IPOL_W\r
527                 scan.w[0] += scan.slopeW[0] * subPixel;\r
528                 scan.w[1] += scan.slopeW[1] * subPixel;\r
529 #endif\r
530 \r
531 #ifdef IPOL_C0\r
532                 scan.c[0][0] += scan.slopeC[0][0] * subPixel;\r
533                 scan.c[0][1] += scan.slopeC[0][1] * subPixel;\r
534 #endif\r
535 \r
536 #ifdef IPOL_T0\r
537                 scan.t[0][0] += scan.slopeT[0][0] * subPixel;\r
538                 scan.t[0][1] += scan.slopeT[0][1] * subPixel;\r
539 #endif\r
540 \r
541 #ifdef IPOL_T1\r
542                 scan.t[1][0] += scan.slopeT[1][0] * subPixel;\r
543                 scan.t[1][1] += scan.slopeT[1][1] * subPixel;\r
544 #endif\r
545 \r
546 #endif\r
547 \r
548                 // rasterize the edge scanlines\r
549                 for( line.y = yStart; line.y <= yEnd; ++line.y)\r
550                 {\r
551                         line.x[scan.left] = scan.x[0];\r
552                         line.x[scan.right] = scan.x[1];\r
553 \r
554 #ifdef IPOL_Z\r
555                         line.z[scan.left] = scan.z[0];\r
556                         line.z[scan.right] = scan.z[1];\r
557 #endif\r
558 \r
559 #ifdef IPOL_W\r
560                         line.w[scan.left] = scan.w[0];\r
561                         line.w[scan.right] = scan.w[1];\r
562 #endif\r
563 \r
564 #ifdef IPOL_C0\r
565                         line.c[0][scan.left] = scan.c[0][0];\r
566                         line.c[0][scan.right] = scan.c[0][1];\r
567 #endif\r
568 \r
569 #ifdef IPOL_T0\r
570                         line.t[0][scan.left] = scan.t[0][0];\r
571                         line.t[0][scan.right] = scan.t[0][1];\r
572 #endif\r
573 \r
574 #ifdef IPOL_T1\r
575                         line.t[1][scan.left] = scan.t[1][0];\r
576                         line.t[1][scan.right] = scan.t[1][1];\r
577 #endif\r
578 \r
579                         // render a scanline\r
580                         scanline_bilinear ();\r
581                         if ( EdgeTestPass & edge_test_first_line ) break;\r
582 \r
583                         scan.x[0] += scan.slopeX[0];\r
584                         scan.x[1] += scan.slopeX[1];\r
585 \r
586 #ifdef IPOL_Z\r
587                         scan.z[0] += scan.slopeZ[0];\r
588                         scan.z[1] += scan.slopeZ[1];\r
589 #endif\r
590 \r
591 #ifdef IPOL_W\r
592                         scan.w[0] += scan.slopeW[0];\r
593                         scan.w[1] += scan.slopeW[1];\r
594 #endif\r
595 \r
596 #ifdef IPOL_C0\r
597                         scan.c[0][0] += scan.slopeC[0][0];\r
598                         scan.c[0][1] += scan.slopeC[0][1];\r
599 #endif\r
600 \r
601 #ifdef IPOL_T0\r
602                         scan.t[0][0] += scan.slopeT[0][0];\r
603                         scan.t[0][1] += scan.slopeT[0][1];\r
604 #endif\r
605 \r
606 #ifdef IPOL_T1\r
607                         scan.t[1][0] += scan.slopeT[1][0];\r
608                         scan.t[1][1] += scan.slopeT[1][1];\r
609 #endif\r
610 \r
611                 }\r
612         }\r
613 \r
614 \r
615 }\r
616 \r
617 \r
618 } // end namespace video\r
619 } // end namespace irr\r
620 \r
621 #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_\r
622 \r
623 namespace irr\r
624 {\r
625 namespace video\r
626 {\r
627 \r
628 //! creates a flat triangle renderer\r
629 IBurningShader* createTriangleRendererGouraud2(CBurningVideoDriver* driver)\r
630 {\r
631         // ETR_GOURAUD . no texture\r
632         #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_\r
633         return new CTRGouraud2(driver);\r
634         #else\r
635         return 0;\r
636         #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_\r
637 }\r
638 \r
639 \r
640 } // end namespace video\r
641 } // end namespace irr\r
642 \r
643 \r
644 \r