mirror of
https://github.com/celisej567/cool-source-archive.git
synced 2026-01-05 22:10:07 +03:00
somewhat fixed buildcubemaps, make buildnum better
This commit is contained in:
@@ -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 ) );
|
||||
|
||||
|
||||
@@ -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() )
|
||||
|
||||
@@ -124,6 +124,7 @@ const SteamInfVersionInfo_t& GetSteamInfIDVersionInfo()
|
||||
return g_SteamInfIDVersionInfo;
|
||||
}
|
||||
|
||||
// don't use this, it sucks
|
||||
int build_number( void )
|
||||
{
|
||||
return GetSteamInfIDVersionInfo().ServerVersion;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user