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