Last active
May 4, 2021 12:40
-
-
Save Fohlen/884eeadd6a59e50f94ea44714d5b59d6 to your computer and use it in GitHub Desktop.
List textures patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static hashtable<int, int> *listtextures; | |
static int maxlisted; | |
void listtexcube(cube &c) | |
{ | |
if (!c.children) | |
loopi(6) | |
{ | |
int t = c.texture[i]; | |
(*listtextures)[t] = 1; | |
maxlisted = max(maxlisted, t); | |
} | |
else | |
loopi(8) listtexcube(c.children[i]); | |
} | |
//! List the textures actually used | |
void listtex() | |
{ | |
listtextures = new hashtable<int, int>; | |
maxlisted = -1; | |
loopi(8) listtexcube(worldroot[i]); | |
loopi(maxlisted+1) | |
if (listtextures->access(i) && slots.inrange(i)) | |
loopj(slots[i]->sts.length()) | |
printf("%s\r\n", slots[i]->sts[j].name); | |
delete listtextures; | |
} | |
COMMAND(listtex, ""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment