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

Function FindTextureBitmapName

Descent3/gametexture.cpp:373–406  ·  view source on GitHub ↗

Searches thru all textures for a bitmap of a specific name, returns -1 if not found or index of texture with name

Source from the content-addressed store, hash-verified

371// Searches thru all textures for a bitmap of a specific name, returns -1 if not found
372// or index of texture with name
373int FindTextureBitmapName(const char *name) {
374 int i;
375
376 ASSERT(name != NULL);
377
378 for (i = 0; i < MAX_TEXTURES; i++) {
379 if (GameTextures[i].used) {
380 if (GameTextures[i].flags & TF_ANIMATED) {
381 int not_res = 0;
382 if (GameVClips[GameTextures[i].bm_handle].flags & VCF_NOT_RESIDENT)
383 not_res = 1;
384
385 PageInVClip(GameTextures[i].bm_handle);
386 vclip *vc = &GameVClips[GameTextures[i].bm_handle];
387 ASSERT(vc->used);
388
389 int t;
390 int retval = -1;
391
392 for (t = 0; t < vc->num_frames && retval == -1; t++)
393 if ((!stricmp(GameBitmaps[vc->frames[t]].name, name)))
394 retval = i;
395
396 if (retval != -1)
397 return retval;
398 } else {
399 if ((!stricmp(GameBitmaps[GameTextures[i].bm_handle].name, name)))
400 return i;
401 }
402 }
403 }
404
405 return -1;
406}
407
408// Allocates memory for a procedural that is attached to a texture
409int AllocateProceduralForTexture(int handle) {

Callers 3

ReloadModelTexturesFunction · 0.85
ReadNewModelFileFunction · 0.85
Parse3DSMaxChunkFunction · 0.85

Calls 1

PageInVClipFunction · 0.85

Tested by

no test coverage detected