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

Function d3d_GetTexClass

legacy/renderer/Direct3D.cpp:520–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520int d3d_GetTexClass(int handle, int map_type) {
521 int w, tex_class;
522
523 if (map_type == MAP_TYPE_LIGHTMAP)
524 w = GameLightmaps[handle].square_res;
525 else if (map_type == MAP_TYPE_BUMPMAP)
526 w = GameBumpmaps[handle].width;
527 else
528 w = bm_w(handle, 0);
529
530 if (w == 256)
531 tex_class = 0;
532 else if (w == 128)
533 tex_class = 1;
534 else if (w == 64)
535 tex_class = 2;
536 else if (w == 32)
537 tex_class = 3;
538 else {
539 mprintf(0, "Bad class for d3d!\n");
540 Int3();
541 }
542
543 return tex_class;
544}
545
546// Given a bitmap handle, a map type, and a destination d3d slot, takes the data
547// from the application and massages it for direct3d's consumption

Callers 1

Calls 1

bm_wFunction · 0.85

Tested by

no test coverage detected