MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / InitTerrainRenderSpeedups

Function InitTerrainRenderSpeedups

Descent3/terrainrender.cpp:861–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859bool Rendering_main_view = true;
860#endif
861void InitTerrainRenderSpeedups() {
862 // Figure out a table of values for rotated uv points
863 for (int y = 0; y <= MAX_LOD_SIZE; y++) {
864 for (int x = 0; x <= MAX_LOD_SIZE; x++) {
865 TerrainUSpeedup[0][(y * LOD_ROW_SIZE) + x] = (float)x / (float)MAX_LOD_SIZE;
866 TerrainVSpeedup[0][(y * LOD_ROW_SIZE) + x] = (float)y / (float)MAX_LOD_SIZE;
867 TerrainUSpeedup[1][(y * LOD_ROW_SIZE) + x] = 1.0 - ((float)y / (float)MAX_LOD_SIZE);
868 TerrainVSpeedup[1][(y * LOD_ROW_SIZE) + x] = (float)x / (float)MAX_LOD_SIZE;
869 TerrainUSpeedup[2][(y * LOD_ROW_SIZE) + x] = 1.0 - ((float)x / (float)MAX_LOD_SIZE);
870 TerrainVSpeedup[2][(y * LOD_ROW_SIZE) + x] = 1.0 - ((float)y / (float)MAX_LOD_SIZE);
871 TerrainUSpeedup[3][(y * LOD_ROW_SIZE) + x] = ((float)y / (float)MAX_LOD_SIZE);
872 TerrainVSpeedup[3][(y * LOD_ROW_SIZE) + x] = 1.0 - ((float)x / (float)MAX_LOD_SIZE);
873 }
874 }
875}
876// codes a point for visibility in the window passed to RenderTerrain()
877uint8_t CodeTerrainPoint(g3Point *p) {
878 uint8_t cc = 0;

Callers 1

RenderTerrainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected