mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-05 19:45:33 +03:00
Merge pull request #169 from WPMGPRoSToTeMa/autoprecachemapstxtoverviewsandskys
Set skyname to default if it is not exists or is empty
This commit is contained in:
commit
73af53506f
@ -5019,29 +5019,41 @@ void EXT_FUNC SV_AddResource(resourcetype_t type, const char *name, int size, un
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REHLDS_FIXES
|
#ifdef REHLDS_FIXES
|
||||||
|
bool PrecacheSky()
|
||||||
|
{
|
||||||
|
// TODO: what to do if these files only on fastdl? add cvar onlytga?
|
||||||
|
if (FS_FileExists(va("gfx/env/%sbk.tga", sv_skyname.string)))
|
||||||
|
{
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sbk.tga", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sdn.tga", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sft.tga", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%slf.tga", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%srt.tga", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sup.tga", sv_skyname.string));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (FS_FileExists(va("gfx/env/%sbk.bmp", sv_skyname.string)))
|
||||||
|
{
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sbk.bmp", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sdn.bmp", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sft.bmp", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%slf.bmp", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%srt.bmp", sv_skyname.string));
|
||||||
|
PF_precache_generic_I(va("gfx/env/%sup.bmp", sv_skyname.string));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void PrecacheMapSpecifiedResources()
|
void PrecacheMapSpecifiedResources()
|
||||||
{
|
{
|
||||||
if (sv_skyname.string[0])
|
if (sv_skyname.string[0] == '\0' || !PrecacheSky())
|
||||||
{
|
{
|
||||||
// TODO: what to do if these files only on fastdl? add cvar onlytga?
|
Cvar_Set(sv_skyname.name, "desert");
|
||||||
if (FS_FileExists(va("gfx/env/%sbk.tga", sv_skyname.string)))
|
PrecacheSky();
|
||||||
{
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sbk.tga", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sdn.tga", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sft.tga", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%slf.tga", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%srt.tga", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sup.tga", sv_skyname.string));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sbk.bmp", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sdn.bmp", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sft.bmp", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%slf.bmp", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%srt.bmp", sv_skyname.string));
|
|
||||||
PF_precache_generic_I(va("gfx/env/%sup.bmp", sv_skyname.string));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: or this is not-engine and this better do by gamedll or .res?
|
// TODO: or this is not-engine and this better do by gamedll or .res?
|
||||||
|
Loading…
Reference in New Issue
Block a user