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

Function AllocTexture

Descent3/gametexture.cpp:323–350  ·  view source on GitHub ↗

Set aside a texture for use This function returns a valid texture handle

Source from the content-addressed store, hash-verified

321// Set aside a texture for use
322// This function returns a valid texture handle
323int AllocTexture(void) {
324 int i;
325
326 for (i = 0; i < MAX_TEXTURES; i++)
327 if (GameTextures[i].used == 0)
328 break;
329
330 ASSERT(i != MAX_TEXTURES); // we've run out of texture slots
331
332 Num_textures++;
333
334 memset(&GameTextures[i], 0, sizeof(texture));
335
336 GameTextures[i].used = 1;
337
338 GameTextures[i].corona_type = 0;
339 GameTextures[i].bumpmap = -1;
340 GameTextures[i].procedural = NULL;
341 GameTextures[i].name[0] = 0;
342 GameTextures[i].flags = 0; // default to no type
343 GameTextures[i].alpha = 1.0;
344 GameTextures[i].speed = 1.0;
345 GameTextures[i].reflectivity = .6f;
346 GameTextures[i].bm_handle = -1;
347 GameTextures[i].destroy_handle = -1;
348
349 return i;
350}
351
352// Searches thru all textures for a specific name, returns -1 if not found
353// or index of texture with name

Callers 11

mng_SetAndLoadTextureFunction · 0.85
OnWtexdlgAddnewMethod · 0.85
LoadITLFileMethod · 0.85
OnAddNewSmallMethod · 0.85
OnAddNewTinyMethod · 0.85
OnAddNewHugeMethod · 0.85
OnImportTinyMethod · 0.85
OnImportSkyMethod · 0.85
OnImportSkyBandMethod · 0.85
InitTexturesFunction · 0.85
InitPlayersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected