Skip to content

Commit 878c01b

Browse files
committed
Merge branch 'tc2-mod' of https://github.com/mastercomfig/tc2 into tc2-mod
2 parents d733b7f + 9896e08 commit 878c01b

2 files changed

Lines changed: 36 additions & 7 deletions

File tree

src/game/client/tf/c_tf_player.cpp

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
#include "netadr.h"
7777
#include "input.h"
7878

79+
// for rescue ranger
80+
#include "materialsystem/imaterialproxy.h"
81+
7982
#include "gcsdk/gcclientsdk.h"
8083
#include "econ_gcmessages.h"
8184
#include "rtime.h"
@@ -2342,12 +2345,31 @@ class CProxyBenefactorLevel : public CResultProxy
23422345
EXPOSE_INTERFACE( CProxyBenefactorLevel, IMaterialProxy, "BenefactorLevel" IMATERIAL_PROXY_INTERFACE_VERSION );
23432346

23442347
//-----------------------------------------------------------------------------
2345-
// Purpose: Used for scaling the oscilloscope on the Building Rescue Gun
2346-
// Flattens the Wave when the player has no energy
2348+
// Purpose: Used for scaling the oscilloscope on the Rescue Ranger
2349+
// Flattens the Wave when the player has insufficent energy to rescue buildings
2350+
// Wave has horizontal scrolling whose speed and direction can be controlled from material proxy
23472351
//-----------------------------------------------------------------------------
2352+
23482353
class CProxyBuildingRescueLevel : public CResultProxy
23492354
{
23502355
public:
2356+
// Add this member (default to something safe)
2357+
float m_flScrollSpeed = -0.1f;
2358+
2359+
virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues )
2360+
{
2361+
// Call base init first if needed
2362+
if ( !CResultProxy::Init( pMaterial, pKeyValues ) )
2363+
return false;
2364+
2365+
// pKeyValues points to the { "screenScrollRate" "#" ... } subkey
2366+
if ( pKeyValues )
2367+
{
2368+
m_flScrollSpeed = pKeyValues->GetFloat( "screenScrollRate", -0.1f ); // fallback if missing
2369+
}
2370+
2371+
return true;
2372+
}
23512373
void OnBind( void *pC_BaseEntity )
23522374
{
23532375
Assert( m_pResult );
@@ -2391,6 +2413,17 @@ class CProxyBuildingRescueLevel : public CResultProxy
23912413
MatrixBuildTranslation( temp, center.x, center.y, 0.0f );
23922414
MatrixMultiply( temp, mat, mat );
23932415

2416+
2417+
float flScrollSpeed = m_flScrollSpeed;
2418+
2419+
float scrollOffset = fmodf( gpGlobals->curtime * flScrollSpeed, 1.0f );
2420+
if ( scrollOffset < 0.0f )
2421+
scrollOffset += 1.0f; // [0,1) range for seamless loop
2422+
2423+
// Apply horizontal scroll AFTER the existing scale/center operations
2424+
MatrixBuildTranslation( temp, scrollOffset, 0.0f, 0.0f );
2425+
MatrixMultiply( temp, mat, mat );
2426+
23942427
m_pResult->SetMatrixValue( mat );
23952428

23962429
if ( ToolsEnabled() )
@@ -2400,7 +2433,7 @@ class CProxyBuildingRescueLevel : public CResultProxy
24002433
}
24012434
};
24022435

2403-
EXPOSE_INTERFACE( CProxyBuildingRescueLevel, IMaterialProxy, "BuildingRescueLevel" IMATERIAL_PROXY_INTERFACE_VERSION );
2436+
EXPOSE_INTERFACE(CProxyBuildingRescueLevel, IMaterialProxy, "BuildingRescueLevel" IMATERIAL_PROXY_INTERFACE_VERSION);
24042437

24052438

24062439
//-----------------------------------------------------------------------------

src/tier1/utlsymbol.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,7 @@ FileNameHandle_t CUtlFilenameSymbolTable::FindOrAddFileName( const char *pFileNa
327327
char fn[ MAX_PATH ];
328328
Q_strncpy( fn, pFileName, sizeof( fn ) );
329329
Q_RemoveDotSlashes( fn );
330-
#ifdef _WIN32
331330
Q_strlower( fn );
332-
#endif
333331

334332
// Split the filename into constituent parts
335333
char basepath[ MAX_PATH ];
@@ -370,9 +368,7 @@ FileNameHandle_t CUtlFilenameSymbolTable::FindFileName( const char *pFileName )
370368
char fn[ MAX_PATH ];
371369
Q_strncpy( fn, pFileName, sizeof( fn ) );
372370
Q_RemoveDotSlashes( fn );
373-
#ifdef _WIN32
374371
Q_strlower( fn );
375-
#endif
376372

377373
// Split the filename into constituent parts
378374
char basepath[ MAX_PATH ];

0 commit comments

Comments
 (0)