1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +00:00

fix IBO generation...oops

This commit is contained in:
fgenesis 2023-08-25 14:07:25 +02:00
parent 71f9120c30
commit 2f7dd87d8b

View file

@ -327,8 +327,7 @@ size_t DynamicGPUBuffer::initGridIndices_Triangles(size_t w, size_t h, bool inve
// top to bottom // top to bottom
for(size_t y = 0; y < quadsy; ++y) for(size_t y = 0; y < quadsy; ++y)
{ {
size_t i = y * w; for(size_t x = 0, i = y * w; x < quadsx; ++x, ++i)
for(size_t x = 0; x < quadsx; ++x)
{ {
*p++ = (unsigned short)(i); // 0 *p++ = (unsigned short)(i); // 0
*p++ = (unsigned short)(i + 1); // 1 *p++ = (unsigned short)(i + 1); // 1
@ -345,8 +344,7 @@ size_t DynamicGPUBuffer::initGridIndices_Triangles(size_t w, size_t h, bool inve
// bottom to top // bottom to top
for(size_t y = quadsy; y --> 0; ) for(size_t y = quadsy; y --> 0; )
{ {
size_t i = y * w; for(size_t x = 0, i = y * w; x < quadsx; ++x, ++i)
for(size_t x = 0; x < quadsx; ++x)
{ {
*p++ = (unsigned short)(i); // 0 *p++ = (unsigned short)(i); // 0
*p++ = (unsigned short)(i + 1); // 1 *p++ = (unsigned short)(i + 1); // 1