Skip to content

Commit 3600a73

Browse files
committed
Try to load texture from bsp if external wad load fails
Fixes the missing SKYG texture in Q64 start.bsp for e.g. See Novum/vkQuake#830 Issue was a side effect of Valve BSP, WAD, and external texture support addition, as of commit 4efddb4: Quake64 bsp wrongly advise in their data that some textures are to be loaded from a separate external wad, but that wad does not exist or is invalid: the existing 'Quake64.wad' does not work. Port of vkQuake patch authored by Vincent Sonnier.
1 parent c2a40e0 commit 3600a73

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Quake/gl_model.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static texture_t *Mod_LoadWadTexture (qmodel_t *mod, wad_t *wads, const char *na
483483
// ensure we're dealing with a miptex
484484
if (!info || (info->type != TYP_MIPTEX && (wad->id != WADID_VALVE || info->type != TYP_MIPTEX_PALETTE)))
485485
{
486-
Con_Warning ("Missing texture %s in %s!\n", name, mod->name);
486+
Con_Warning ("Missing texture %s in WAD, using BSP.\n", name);
487487
return NULL;
488488
}
489489

@@ -709,10 +709,13 @@ static void Mod_LoadTextures (lump_t *l)
709709
if (from_wad)
710710
{
711711
tx = (texture_t *)Mod_LoadWadTexture (loadmodel, wads, mt->name, &pal, &pixels);
712-
if (!tx)
713-
continue;
714-
loadmodel->textures[i] = tx;
715-
goto _load_texture;
712+
if (tx)
713+
{
714+
loadmodel->textures[i] = tx;
715+
goto _load_texture;
716+
}
717+
// Mod_LoadWadTexture trust the .wad name in bsp, but its loading may
718+
// fail anyway, so try with regular internal .bsp texture loading as fallback:
716719
}
717720

718721
#ifdef BSP29_VALVE

0 commit comments

Comments
 (0)