Ticket #1986: terrain.diff
File terrain.diff, 651 bytes (added by , 11 years ago) |
---|
-
source/graphics/Terrain.cpp
133 133 ssize_t hj = clamp(j, (ssize_t)0, m_MapSize-1); 134 134 u16 height = m_Heightmap[hj*m_MapSize + hi]; 135 135 pos.X = fixed::FromInt(i) * (int)TERRAIN_TILE_SIZE; 136 pos.Y = fixed::FromInt(height) / (int)HEIGHT_UNITS_PER_METRE; 136 // divide height by 2 to avoid overflows when height is between 2^15 and 2^16. 137 pos.Y = fixed::FromInt(height >> 1) / ((int)HEIGHT_UNITS_PER_METRE >> 1); 137 138 pos.Z = fixed::FromInt(j) * (int)TERRAIN_TILE_SIZE; 138 139 } 139 140