mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Change the triangle pattern used for terrain (Fixes #2459)
This commit is contained in:
parent
5cb61fa01c
commit
20af2b67a8
@ -59,13 +59,27 @@ Ogre::HardwareIndexBufferSharedPtr createIndexBuffer(unsigned int flags, unsigne
|
|||||||
{
|
{
|
||||||
for (size_t col = colStart; col < colEnd; col += increment)
|
for (size_t col = colStart; col < colEnd; col += increment)
|
||||||
{
|
{
|
||||||
indices.push_back(verts*col+row);
|
// diamond pattern
|
||||||
indices.push_back(verts*(col+increment)+row+increment);
|
if ((row + col%2) % 2 == 1)
|
||||||
indices.push_back(verts*col+row+increment);
|
{
|
||||||
|
indices.push_back(verts*(col+increment)+row);
|
||||||
|
indices.push_back(verts*(col+increment)+row+increment);
|
||||||
|
indices.push_back(verts*col+row+increment);
|
||||||
|
|
||||||
indices.push_back(verts*col+row);
|
indices.push_back(verts*col+row);
|
||||||
indices.push_back(verts*(col+increment)+row);
|
indices.push_back(verts*(col+increment)+row);
|
||||||
indices.push_back(verts*(col+increment)+row+increment);
|
indices.push_back(verts*(col)+row+increment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
indices.push_back(verts*col+row);
|
||||||
|
indices.push_back(verts*(col+increment)+row+increment);
|
||||||
|
indices.push_back(verts*col+row+increment);
|
||||||
|
|
||||||
|
indices.push_back(verts*col+row);
|
||||||
|
indices.push_back(verts*(col+increment)+row);
|
||||||
|
indices.push_back(verts*(col+increment)+row+increment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user