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