@@ -209,7 +209,7 @@ void Sky::render()
209
209
210
210
const f32 t = 1 .0f ;
211
211
const f32 o = 0 .0f ;
212
- static const u16 indices[4 ] = {0 , 1 , 2 , 3 };
212
+ static const u16 indices[6 ] = {0 , 1 , 2 , 0 , 2 , 3 };
213
213
video::S3DVertex vertices[4 ];
214
214
215
215
driver->setMaterial (m_materials[1 ]);
@@ -251,7 +251,7 @@ void Sky::render()
251
251
vertex.Pos .rotateXZBy (180 );
252
252
}
253
253
}
254
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
254
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
255
255
}
256
256
}
257
257
@@ -277,7 +277,7 @@ void Sky::render()
277
277
// Switch from -Z (south) to +Z (north)
278
278
vertex.Pos .rotateXZBy (-180 );
279
279
}
280
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
280
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
281
281
}
282
282
}
283
283
@@ -308,7 +308,7 @@ void Sky::render()
308
308
// Switch from -Z (south) to -X (west)
309
309
vertex.Pos .rotateXZBy (-90 );
310
310
}
311
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
311
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
312
312
}
313
313
314
314
// Draw sun
@@ -344,7 +344,7 @@ void Sky::render()
344
344
// Switch from -Z (south) to +Z (north)
345
345
vertex.Pos .rotateXZBy (-180 );
346
346
}
347
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
347
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
348
348
}
349
349
350
350
// Draw bottom far cloudy fog thing in front of sun, moon and stars
@@ -353,7 +353,7 @@ void Sky::render()
353
353
vertices[1 ] = video::S3DVertex ( 1 , -1.0 , -1 , 0 , 1 , 0 , c, o, t);
354
354
vertices[2 ] = video::S3DVertex ( 1 , -1.0 , 1 , 0 , 1 , 0 , c, o, o);
355
355
vertices[3 ] = video::S3DVertex (-1 , -1.0 , 1 , 0 , 1 , 0 , c, t, o);
356
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
356
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
357
357
}
358
358
}
359
359
}
@@ -597,7 +597,7 @@ void Sky::draw_sun(video::IVideoDriver *driver, float sunsize, const video::SCol
597
597
* wicked_time_of_day: current time of day, to know where should be the sun in the sky
598
598
*/
599
599
{
600
- static const u16 indices[4 ] = {0 , 1 , 2 , 3 };
600
+ static const u16 indices[] = {0 , 1 , 2 , 0 , 2 , 3 };
601
601
std::array<video::S3DVertex, 4 > vertices;
602
602
if (!m_sun_texture) {
603
603
driver->setMaterial (m_materials[1 ]);
@@ -615,7 +615,7 @@ void Sky::draw_sun(video::IVideoDriver *driver, float sunsize, const video::SCol
615
615
for (int i = 0 ; i < 4 ; i++) {
616
616
draw_sky_body (vertices, -sunsizes[i], sunsizes[i], colors[i]);
617
617
place_sky_body (vertices, 90 , wicked_time_of_day * 360 - 90 );
618
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
618
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
619
619
}
620
620
} else {
621
621
driver->setMaterial (m_materials[3 ]);
@@ -627,7 +627,7 @@ void Sky::draw_sun(video::IVideoDriver *driver, float sunsize, const video::SCol
627
627
c = video::SColor (255 , 255 , 255 , 255 );
628
628
draw_sky_body (vertices, -d, d, c);
629
629
place_sky_body (vertices, 90 , wicked_time_of_day * 360 - 90 );
630
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
630
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
631
631
}
632
632
}
633
633
@@ -644,7 +644,7 @@ void Sky::draw_moon(video::IVideoDriver *driver, float moonsize, const video::SC
644
644
* the sky
645
645
*/
646
646
{
647
- static const u16 indices[4 ] = {0 , 1 , 2 , 3 };
647
+ static const u16 indices[] = {0 , 1 , 2 , 0 , 2 , 3 };
648
648
std::array<video::S3DVertex, 4 > vertices;
649
649
if (!m_moon_texture) {
650
650
driver->setMaterial (m_materials[1 ]);
@@ -668,7 +668,7 @@ void Sky::draw_moon(video::IVideoDriver *driver, float moonsize, const video::SC
668
668
for (int i = 0 ; i < 4 ; i++) {
669
669
draw_sky_body (vertices, moonsizes_1[i], moonsizes_2[i], colors[i]);
670
670
place_sky_body (vertices, -90 , wicked_time_of_day * 360 - 90 );
671
- driver->drawIndexedTriangleFan (&vertices[0 ], 4 , indices, 2 );
671
+ driver->drawIndexedTriangleList (&vertices[0 ], 4 , indices, 2 );
672
672
}
673
673
} else {
674
674
driver->setMaterial (m_materials[4 ]);
0 commit comments