Set aside a texture for use This function returns a valid texture handle
| 321 | // Set aside a texture for use |
| 322 | // This function returns a valid texture handle |
| 323 | int 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 |
no outgoing calls
no test coverage detected