mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 23:11:38 +00:00
Allow loading textures from textures
directory, as well as from maps.
This commit is contained in:
parent
c4609f5195
commit
b7c2f5efa3
1 changed files with 11 additions and 6 deletions
|
@ -81,18 +81,23 @@ Mod_LoadExternalTextures (model_t *mod)
|
|||
if (!tx)
|
||||
continue;
|
||||
|
||||
// backslash at the end of texture name indicates external texture
|
||||
// if (tx->name[length] != '\\')
|
||||
// continue;
|
||||
|
||||
// replace special flag characters with underscores
|
||||
if (tx->name[0] == '+' || tx->name[0] == '*') {
|
||||
if (tx->name[0] == '*') {
|
||||
filename = va ("maps/_%s.tga", tx->name + 1);
|
||||
} else {
|
||||
filename = va ("maps/%s.tga", tx->name);
|
||||
}
|
||||
|
||||
COM_FOpenFile (filename, &f);
|
||||
|
||||
if (!f) {
|
||||
if (tx->name[0] == '*') {
|
||||
filename = va ("textures/_%s.tga", tx->name + 1);
|
||||
} else {
|
||||
filename = va ("textures/%s.tga", tx->name);
|
||||
}
|
||||
COM_FOpenFile (filename, &f);
|
||||
}
|
||||
|
||||
if (f) {
|
||||
targa = LoadTGA (f);
|
||||
Qclose (f);
|
||||
|
|
Loading…
Reference in a new issue