Fixed some texture splatting issues with loading empty terrain cells

This commit is contained in:
Jacob Essex 2012-02-29 23:33:54 +00:00
parent 1d0ae9c8d1
commit 6924348696
2 changed files with 3 additions and 2 deletions

View file

@ -263,8 +263,7 @@ namespace MWRender
if ( it == indexes.end() ) if ( it == indexes.end() )
{ {
//NB: All vtex ids are +1 compared to the ltex ids //NB: All vtex ids are +1 compared to the ltex ids
assert((int)ltexIndex >= 0 && assert( (int)store->landTextures->ltex.size() >= (int)ltexIndex - 1 &&
(int)store->landTextures->ltex.size() >= (int)ltexIndex - 1 &&
"LAND.VTEX must be within the bounds of the LTEX array"); "LAND.VTEX must be within the bounds of the LTEX array");
std::string texture; std::string texture;

View file

@ -111,6 +111,8 @@ void Land::loadData(ESMReader &esm)
} }
else else
{ {
landData->usingColours = false;
memset(&landData->textures, 0, 512 * sizeof(uint16_t));
for (int i = 0; i < LAND_NUM_VERTS; i++) for (int i = 0; i < LAND_NUM_VERTS; i++)
{ {
landData->heights[i] = -256.0f * HEIGHT_SCALE; landData->heights[i] = -256.0f * HEIGHT_SCALE;