Searches thru all textures for a bitmap of a specific name, returns -1 if not found or index of texture with name
| 371 | // Searches thru all textures for a bitmap of a specific name, returns -1 if not found |
| 372 | // or index of texture with name |
| 373 | int 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 |
| 409 | int AllocateProceduralForTexture(int handle) { |
no test coverage detected