MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / hsStockTextureIndexRemap

Function hsStockTextureIndexRemap

src/Loaders/track_utils.cpp:135–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 int hsStockTextureIndexRemap(int textureIndex) {
136 int remappedIndex = textureIndex;
137
138 int nStockTextures = 30;
139
140 // Remap texture index between 0 and MAX_TEXTURE_ARRAY_SIZE if exceeds
141 if (textureIndex >= 2048) {
142 remappedIndex = MAX_TEXTURE_ARRAY_SIZE - nStockTextures + (textureIndex - 2048);
143 }
144
145 ASSERT(remappedIndex <= MAX_TEXTURE_ARRAY_SIZE, "Texture index still exceeds max texture array size, post-remap");
146
147 return remappedIndex;
148 }
149
150 GLuint MakeTextureArray(std::map<unsigned int, Texture> &textures, bool repeatable) {
151 ASSERT(textures.size() < MAX_TEXTURE_ARRAY_SIZE, "Configured maximum texture array size of " << MAX_TEXTURE_ARRAY_SIZE << " has been exceeded.");

Callers 2

MakeTextureArrayFunction · 0.85
ParseTRKModelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected