somewhat fixed buildcubemaps, make buildnum better

This commit is contained in:
Fisual
2021-09-15 11:42:10 +07:00
parent f2d2ffb91b
commit 7129c99b5d
6 changed files with 16464 additions and 16434 deletions

View File

@@ -1275,7 +1275,7 @@ void CConPanel::PaintBackground()
int wide = GetWide();
char ver[ 100 ];
Q_snprintf(ver, sizeof( ver ), "CoolSource Engine %i (build %d)", PROTOCOL_VERSION, build_number() );
Q_snprintf(ver, sizeof( ver ), "CoolSource Engine %i (%s)", PROTOCOL_VERSION, __TIMESTAMP__ );
wchar_t unicode[ 200 ];
g_pVGuiLocalize->ConvertANSIToUnicode( ver, unicode, sizeof( unicode ) );

View File

@@ -1175,7 +1175,7 @@ void Mod_LoadWorldlights( CMapLoadHelper &lh, bool bIsHDR )
lh.GetMap()->worldlights = NULL;
return;
}
// dworldlight_t fix for previous bsp versions
if (s_MapHeader.version < BSPVERSION)
{
DevMsg("Detected bsp version lower than 21, fixing dworldlight_t struct order for compatibility\n");
@@ -1191,9 +1191,11 @@ void Mod_LoadWorldlights( CMapLoadHelper &lh, bool bIsHDR )
}
else
{
lh.GetMap()->numworldlights = lh.LumpSize() / sizeof(dworldlight_t);
lh.GetMap()->worldlights = (dworldlight_t*)Hunk_AllocName(lh.LumpSize(), va("%s [%s]", lh.GetLoadName(), "worldlights"));
memcpy(lh.GetMap()->worldlights, lh.LumpBase(), lh.LumpSize());
// dworldlight_t fix
int nNumWorldLights = lh.LumpSize() / sizeof(dworldlight_old_t);
lh.GetMap()->numworldlights = nNumWorldLights;
lh.GetMap()->worldlights = (dworldlight_t*)Hunk_AllocName(nNumWorldLights * sizeof(dworldlight_t), va("%s [%s]", lh.GetLoadName(), "worldlights"));
}
#if !defined( SWDS )
if ( r_lightcache_zbuffercache.GetInt() )

View File

@@ -124,6 +124,7 @@ const SteamInfVersionInfo_t& GetSteamInfIDVersionInfo()
return g_SteamInfIDVersionInfo;
}
// don't use this, it sucks
int build_number( void )
{
return GetSteamInfIDVersionInfo().ServerVersion;

View File

@@ -971,6 +971,29 @@ enum emittype_t
// Flags for dworldlight_t::flags
#define DWL_FLAGS_INAMBIENTCUBE 0x0001 // This says that the light was put into the per-leaf ambient cubes.
// Old version of the worldlight struct, used for backward compatibility loading.
struct dworldlight_old_t
{
DECLARE_BYTESWAP_DATADESC();
Vector origin;
Vector intensity;
Vector normal; // for surfaces and spotlights
int cluster;
emittype_t type;
int style;
float stopdot; // start of penumbra for emit_spotlight
float stopdot2; // end of penumbra for emit_spotlight
float exponent; //
float radius; // cutoff distance
// falloff for emit_spotlight + emit_point:
// 1 / (constant_attn + linear_attn * dist + quadratic_attn * dist^2)
float constant_attn;
float linear_attn;
float quadratic_attn;
int flags; // Uses a combination of the DWL_FLAGS_ defines.
int texinfo; //
int owner; // entity that this light it relative to
};
struct dworldlight_t
{

View File

@@ -809,15 +809,19 @@ FileHandle_t SafeOpenRead( const char *filename )
void SafeRead( FileHandle_t f, void *buffer, int count)
{
if (g_pFileSystem->Read(buffer, count, f) != (size_t)count)
{
Error("File read failure");
}
}
void SafeWrite ( FileHandle_t f, void *buffer, int count)
{
if (g_pFileSystem->Write(buffer, count, f) != (size_t)count)
{
Error("File write failure");
}
}
/*