Skip to content

Commit 888c1e8

Browse files
committed
Misc
1 parent 3ddfbb4 commit 888c1e8

10 files changed

+110
-57
lines changed

game/mod_lazuul/cfg/items.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
give item_longjump
2+
give item_kevlar
3+
give item_exojump

game/mod_lazuul/maps/tr_backbone.nav

919 KB
Binary file not shown.

src/game/client/clientmode_shared.cpp

+71
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ extern ConVar replay_rendersetting_renderglow;
7373
#include "clienteffectprecachesystem.h"
7474
#include "materialsystem/imaterialvar.h"
7575
#include "object_motion_blur_effect.h"
76+
#include "viewpostprocess.h"
7677

7778
// memdbgon must be the last include file in a .cpp file!!!
7879
#include "tier0/memdbgon.h"
7980

81+
extern bool g_bDumpRenderTargets;
82+
8083
using namespace vgui;
8184

8285
#define ACHIEVEMENT_ANNOUNCEMENT_MIN_TIME 10
@@ -843,20 +846,75 @@ void ClientModeShared::DoObjectMotionBlur(const CNewViewSetup *pSetup)
843846
pRenderContext->ClearColor4ub(127, 127, 0, 0);
844847
// Clear only color, not depth & stencil
845848
pRenderContext->ClearBuffers(true, false, false);
849+
//pRenderContext->FogMode(MATERIAL_FOG_NONE);
846850

847851
// Save off state
848852
Vector vOrigColor;
849853
render->GetColorModulation(vOrigColor.Base());
854+
float flSavedBlend = render->GetBlend();
850855

851856
// Use a solid-color unlit material to render velocity into the buffer
852857
g_pStudioRender->ForcedMaterialOverride(pGlowColorMaterial);
858+
859+
pRenderContext->SetLightingOrigin(vec3_origin);
860+
pRenderContext->SetAmbientLight(1.0f, 1.0f, 1.0f);
861+
862+
/*static */Vector white[6] =
863+
{
864+
Vector(1.0f, 1.0f, 1.0f),
865+
Vector(1.0f, 1.0f, 1.0f),
866+
Vector(1.0f, 1.0f, 1.0f),
867+
Vector(1.0f, 1.0f, 1.0f),
868+
Vector(1.0f, 1.0f, 1.0f),
869+
Vector(1.0f, 1.0f, 1.0f),
870+
};
871+
872+
g_pStudioRender->SetAmbientLightColors(white);
873+
g_pStudioRender->SetLocalLights(0, NULL);
874+
875+
modelrender->SuppressEngineLighting(true);
876+
render->SetBlend(1.0f);
853877
g_ObjectMotionBlurManager.DrawObjects();
878+
modelrender->SuppressEngineLighting(false);
879+
854880
g_pStudioRender->ForcedMaterialOverride(NULL);
855881

856882
render->SetColorModulation(vOrigColor.Base());
857883

884+
// Optionally write the rendered image to a debug texture
885+
if (g_bDumpRenderTargets)
886+
{
887+
DumpTGAofRenderTarget(pSetup->width, pSetup->height, "ObjectBlurVelocity");
888+
}
889+
858890
pRenderContext->PopRenderTargetAndViewport();
859891

892+
// Render objects to stencil
893+
{
894+
895+
896+
// Set alpha to 0 so we don't touch any color pixels
897+
render->SetBlend(0.0f);
898+
pRenderContext->OverrideDepthEnable(true, false);
899+
pRenderContext->ClearBuffers(false, false, true);
900+
901+
ShaderStencilState_t stencilState;
902+
stencilState.m_bEnable = true;
903+
stencilState.m_nReferenceValue = 1;
904+
stencilState.m_CompareFunc = STENCILCOMPARISONFUNCTION_ALWAYS;
905+
stencilState.m_PassOp = STENCILOPERATION_REPLACE;
906+
stencilState.m_FailOp = STENCILOPERATION_KEEP;
907+
stencilState.m_ZFailOp = STENCILOPERATION_KEEP;
908+
909+
stencilState.SetStencilState(pRenderContext);
910+
911+
g_ObjectMotionBlurManager.DrawObjects();
912+
913+
pRenderContext->OverrideDepthEnable(false, false);
914+
}
915+
916+
render->SetBlend(flSavedBlend);
917+
860918
//
861919
// Render full-screen pass
862920
//
@@ -874,6 +932,17 @@ void ClientModeShared::DoObjectMotionBlur(const CNewViewSetup *pSetup)
874932
pVelocityTextureVariable = pMotionBlurMaterial->FindVar("$velocity_texture", &bFound2, true);
875933
if (bFound1 && bFound2)
876934
{
935+
ShaderStencilState_t stencilState;
936+
stencilState.m_bEnable = true;
937+
stencilState.m_nWriteMask = 0; // We're not changing stencil
938+
stencilState.m_nReferenceValue = 1;
939+
stencilState.m_nTestMask = 1;
940+
stencilState.m_CompareFunc = STENCILCOMPARISONFUNCTION_EQUAL;
941+
stencilState.m_PassOp = STENCILOPERATION_KEEP;
942+
stencilState.m_FailOp = STENCILOPERATION_KEEP;
943+
stencilState.m_ZFailOp = STENCILOPERATION_KEEP;
944+
stencilState.SetStencilState(pRenderContext);
945+
877946
pFBTextureVariable->SetTextureValue(pFullFrameFB);
878947

879948
pVelocityTextureVariable->SetTextureValue(pFullFrameFB1);
@@ -883,6 +952,8 @@ void ClientModeShared::DoObjectMotionBlur(const CNewViewSetup *pSetup)
883952

884953
pRenderContext->DrawScreenSpaceRectangle(pMotionBlurMaterial, 0, 0, nWidth, nHeight, 0.0f, 0.0f, nWidth - 1, nHeight - 1, nWidth, nHeight);
885954
}
955+
956+
pRenderContext->SetStencilEnable(false);
886957
}
887958

888959
//-----------------------------------------------------------------------------

src/game/client/glow_outline_effect.cpp

-35
Original file line numberDiff line numberDiff line change
@@ -55,42 +55,7 @@ CLIENTEFFECT_REGISTER_END_CONDITIONAL(engine->GetDXSupportLevel() >= 90)
5555

5656
CGlowObjectManager g_GlowObjectManager;
5757

58-
struct ShaderStencilState_t
59-
{
60-
bool m_bEnable;
61-
StencilOperation_t m_FailOp;
62-
StencilOperation_t m_ZFailOp;
63-
StencilOperation_t m_PassOp;
64-
StencilComparisonFunction_t m_CompareFunc;
65-
int m_nReferenceValue;
66-
uint32 m_nTestMask;
67-
uint32 m_nWriteMask;
68-
69-
ShaderStencilState_t()
70-
{
71-
m_bEnable = false;
72-
m_PassOp = m_FailOp = m_ZFailOp = STENCILOPERATION_KEEP;
73-
m_CompareFunc = STENCILCOMPARISONFUNCTION_ALWAYS;
74-
m_nReferenceValue = 0;
75-
m_nTestMask = m_nWriteMask = 0xFFFFFFFF;
76-
}
77-
78-
void SetStencilState(CMatRenderContextPtr &pRenderContext)
79-
{
80-
pRenderContext->SetStencilEnable(m_bEnable);
8158

82-
if (m_bEnable)
83-
{
84-
pRenderContext->SetStencilFailOperation(m_FailOp);
85-
pRenderContext->SetStencilZFailOperation(m_ZFailOp);
86-
pRenderContext->SetStencilPassOperation(m_PassOp);
87-
pRenderContext->SetStencilCompareFunction(m_CompareFunc);
88-
pRenderContext->SetStencilReferenceValue(m_nReferenceValue);
89-
pRenderContext->SetStencilTestMask(m_nTestMask);
90-
pRenderContext->SetStencilWriteMask(m_nWriteMask);
91-
}
92-
}
93-
};
9459

9560
void CGlowObjectManager::RenderGlowEffects(const CViewSetup *pSetup, int nSplitScreenSlot)
9661
{

src/game/client/object_motion_blur_effect.cpp

+8-12
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,14 @@ float ScreenRescale(float flIn)
7575
void CObjectMotionBlurManager::ObjectMotionBlurDefinition_t::DrawModel()
7676
{
7777
#if 1
78-
Vector v3DVelocity, vOrigin;
79-
vOrigin = m_pEntity->GetRenderOrigin();
80-
m_pEntity->EstimateAbsVelocity(v3DVelocity);
81-
Vector v3DVelocityProj = vOrigin + v3DVelocity;
82-
Vector v2DStart, v2DEnd;
83-
Vector2D v2DVelocity;
84-
ScreenTransform(vOrigin, v2DStart);
85-
ScreenTransform(v3DVelocityProj, v2DEnd);
86-
v2DVelocity = v2DEnd.AsVector2D() - v2DStart.AsVector2D();
87-
88-
float flR = ( m_flVelocityScale * ScreenRescale(v2DVelocity.x) );
89-
float flG = ( m_flVelocityScale * ScreenRescale(v2DVelocity.y) );
78+
Vector vecSceen, vecDelta;
79+
ScreenTransform(m_pEntity->GetRenderOrigin(), vecSceen);
80+
VectorSubtract(vecSceen, m_vecLastScreen, vecDelta);
81+
m_vecLastScreen = vecSceen;
82+
vecDelta *= gpGlobals->frametime;
83+
84+
float flR = ( ScreenRescale(m_flVelocityScale * vecDelta.x) );
85+
float flG = ( ScreenRescale(m_flVelocityScale * vecDelta.y) );
9086
#else
9187
Vector vVelocity;
9288
m_pEntity->EstimateAbsVelocity(vVelocity);

src/game/client/object_motion_blur_effect.h

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class CObjectMotionBlurManager
5555
C_BaseAnimating *m_pEntity;
5656
float m_flVelocityScale;
5757

58+
Vector m_vecLastScreen;
59+
5860
// Linked list of free slots
5961
int m_nNextFreeSlot;
6062

src/game/server/basecombatcharacter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ CBaseEntity *CBaseCombatCharacter::FindMissTarget( void )
33523352
continue;
33533353

33543354
// New rule for this system. Don't shoot what the player won't see.
3355-
if ( !ThePlayersSystem->IsInViewcone(pEnts[i]) )
3355+
if ( !ThePlayersSystem->IsAbleToSee(pEnts[i]) )
33563356
continue;
33573357

33583358
if ( numMissCandidates >= MAX_MISS_CANDIDATES )

src/game/server/hl2/npc_turret_ceiling.cpp

+22-9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "animation.h"
2020
#include "basehlcombatweapon_shared.h"
2121
#include "iservervehicle.h"
22+
#include "globalstate.h"
2223

2324
// memdbgon must be the last include file in a .cpp file!!!
2425
#include "tier0/memdbgon.h"
@@ -117,14 +118,24 @@ class CNPC_CeilingTurret : public CAI_BaseNPC
117118

118119
int OnTakeDamage( const CTakeDamageInfo &inputInfo );
119120

121+
const char* GetTracerType(void) { return "AR2Tracer"; }
122+
120123
virtual bool CanBeAnEnemyOf( CBaseEntity *pEnemy );
121124

122125
Class_T Classify( void )
123126
{
124-
if( m_bEnabled )
125-
return CLASS_COMBINE;
126-
127-
return CLASS_NONE;
127+
if (!m_bEnabled)
128+
{
129+
// NPC's should disregard me if I'm closed.
130+
return CLASS_NONE;
131+
}
132+
else
133+
{
134+
if (GlobalEntity_GetState("combine_base_hacked") == GLOBAL_ON)
135+
return CLASS_COMBINE_HACKED;
136+
else
137+
return CLASS_COMBINE;
138+
}
128139
}
129140

130141
bool FVisible( CBaseEntity *pEntity, int traceMask = MASK_BLOCKLOS, CBaseEntity **ppBlocker = NULL );
@@ -263,7 +274,7 @@ void CNPC_CeilingTurret::Precache( void )
263274
PrecacheScriptSound( "NPC_CeilingTurret.Move" );
264275
PrecacheScriptSound( "NPC_CeilingTurret.Active" );
265276
PrecacheScriptSound( "NPC_CeilingTurret.Alert" );
266-
PrecacheScriptSound( "NPC_CeilingTurret.ShotSounds" );
277+
PrecacheScriptSound( "NPC_FloorTurret.ShotSounds" );
267278
PrecacheScriptSound( "NPC_CeilingTurret.Ping" );
268279
PrecacheScriptSound( "NPC_CeilingTurret.Die" );
269280

@@ -425,6 +436,9 @@ void CNPC_CeilingTurret::Retire( void )
425436
SetThink( &CNPC_CeilingTurret::SUB_DoNothing );
426437
}
427438
}
439+
440+
//TERO: added by me
441+
StopSound("NPC_CeilingTurret.Alert");
428442
}
429443

430444
//-----------------------------------------------------------------------------
@@ -671,6 +685,7 @@ void CNPC_CeilingTurret::ActiveThink( void )
671685
//Fire the gun
672686
if ( DotProduct( vecDirToEnemy, vecMuzzleDir ) >= 0.9848 ) // 10 degree slop
673687
{
688+
ResetActivity();
674689
if ( m_spawnflags & SF_CEILING_TURRET_OUT_OF_AMMO )
675690
{
676691
SetActivity( (Activity) ACT_CEILING_TURRET_DRYFIRE );
@@ -853,7 +868,7 @@ void CNPC_CeilingTurret::Shoot( const Vector &vecSrc, const Vector &vecDirToEnem
853868
}
854869

855870
FireBullets( info );
856-
EmitSound( "NPC_CeilingTurret.ShotSounds" );
871+
EmitSound( "NPC_FloorTurret.ShotSounds" );
857872
DoMuzzleFlash();
858873
}
859874

@@ -1061,9 +1076,7 @@ void CNPC_CeilingTurret::DeathThink( void )
10611076
Vector pos;
10621077
CollisionProp()->RandomPointInBounds( vec3_origin, Vector( 1, 1, 1 ), &pos );
10631078

1064-
CBroadcastRecipientFilter filter;
1065-
1066-
te->Smoke( filter, 0.0, &pos, g_sModelIndexSmoke, 2.5, 10 );
1079+
g_pEffects->Smoke( pos, g_sModelIndexSmoke, 2.5f, 10.f );
10671080

10681081
g_pEffects->Sparks( pos );
10691082

src/game/server/peter/laz_player.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ void CLaz_Player::Event_Killed(const CTakeDamageInfo & info)
492492

493493
BaseClass::Event_Killed(info);
494494

495+
ClearExpression();
496+
495497
State_Transition(STATE_DYING); // Transition into the dying state.
496498
m_hEnemy.Term();
497499
}

src/game/server/player.h

+1
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ virtual CAI_Senses *GetSenses() {
636636

637637
virtual void SetPlayerUnderwater( bool state );
638638
void UpdateUnderwaterState( void );
639+
//void UpdateWetness();
639640
bool IsPlayerUnderwater( void ) { return m_bPlayerUnderwater; }
640641

641642
virtual bool CanBreatheUnderwater() const { return false; }

0 commit comments

Comments
 (0)