diff --git a/game/Actor.cpp b/game/Actor.cpp index 99f734e..cb4b0f3 100644 --- a/game/Actor.cpp +++ b/game/Actor.cpp @@ -36,6 +36,8 @@ If you have questions concerning this license or the applicable additional terms #include "Actor.h" +#include "Fx.h" // DG: for hq2 + /*********************************************************************** @@ -3470,4 +3472,4 @@ void idActor::StopDamageFxs( void ){ } } } -//ivan end \ No newline at end of file +//ivan end diff --git a/game/Fx.cpp b/game/Fx.cpp index e278920..2f5e03f 100644 --- a/game/Fx.cpp +++ b/game/Fx.cpp @@ -36,6 +36,8 @@ If you have questions concerning this license or the applicable additional terms #include "Fx.h" +#include "framework/DeclEntityDef.h" + /* =============================================================================== @@ -1159,7 +1161,7 @@ void idTeleporter::Event_DoAction( idEntity *activator ) { bool forceChangeXpos; //ivan angle = spawnArgs.GetFloat( "angle" ); - idAngles a( 0, spawnArgs.GetFloat( "angle" ), 0 ); + idAngles a( 0, angle, 0 ); //ivan start //was: activator->Teleport( GetPhysics()->GetOrigin(), a, NULL ); @@ -1372,7 +1374,8 @@ idDamagingFx *idDamagingFx::StartDamagingFx( int type, idEntity *victimEnt ) { nfx = static_cast(ent); nfx->dmgfxType = type; //gameLocal.Printf("Spawned %s\n", defName ); - StartFxUtility( nfx, &(victimEnt->GetPhysics()->GetAbsBounds().GetCenter()), &mat3_identity, victimEnt, true, false ); + idVec3 origin = victimEnt->GetPhysics()->GetAbsBounds().GetCenter(); + StartFxUtility( nfx, &origin, &mat3_identity, victimEnt, true, false ); return nfx; }else{ gameLocal.Error( "Could not spawn idDamagingFx" ); diff --git a/game/Game_local.h b/game/Game_local.h index 78430d8..9296f35 100644 --- a/game/Game_local.h +++ b/game/Game_local.h @@ -688,6 +688,7 @@ extern const float DEFAULT_GRAVITY; extern const idVec3 DEFAULT_GRAVITY_VEC3; extern const int CINEMATIC_SKIP_DELAY; +/* DG: having includes here seems to confuse the compiler #ifdef _WATER_PHYSICS //un noted change from original sdk #include "physics/Physics_Liquid.h" #include "Liquid.h" @@ -698,5 +699,6 @@ extern const int CINEMATIC_SKIP_DELAY; #endif #include "ai/AI_bot.h" //ivan +*/ #endif /* !__GAME_LOCAL_H__ */ diff --git a/game/Liquid.cpp b/game/Liquid.cpp index 05a8806..aa7e50a 100644 --- a/game/Liquid.cpp +++ b/game/Liquid.cpp @@ -1,10 +1,13 @@ -#include "../idlib/precompiled.h" -#pragma hdrstop - #ifdef _WATER_PHYSICS #include "Game_local.h" +#include "physics/Physics_Actor.h" +#include "physics/Physics_AF.h" +#include "SmokeParticles.h" + +#include "Liquid.h" + // We do these splashes if the mass of the colliding object is less than these values. // Anything large than MEDIUM_SPLASH does a large splash. (get it?) const int SMALL_SPLASH = 25; @@ -298,4 +301,4 @@ bool idLiquid::Collide( const trace_t &collision, const idVec3 &velocity ) { return true; } -#endif // _WATER_PHYSICS \ No newline at end of file +#endif // _WATER_PHYSICS diff --git a/game/Liquid.h b/game/Liquid.h index f5d0de6..919adb5 100644 --- a/game/Liquid.h +++ b/game/Liquid.h @@ -3,6 +3,9 @@ #ifndef __LIQUID_H__ #define __LIQUID_H__ +#include "Entity.h" +#include "physics/Physics_Liquid.h" + /* =============================================================================== @@ -45,4 +48,4 @@ private: #endif // __LIQUID_H__ -#endif // _WATER_PHYSICS \ No newline at end of file +#endif // _WATER_PHYSICS diff --git a/game/Player.cpp b/game/Player.cpp index fc7e36c..e7a633a 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -7725,6 +7725,8 @@ void idPlayer::AdjustBodyAngles( void ) { float forwardBlend; float downBlend; + upBlend = forwardBlend = downBlend = 0.0f; // DG: just make sure they're initialized + if ( health < 0 ) { return; } @@ -10663,7 +10665,7 @@ void idPlayer::WritePlayerStateToSnapshot( idBitMsgDelta &msg ) const { msg.WriteInt( stepUpTime ); msg.WriteFloat( stepUpDelta ); */ - msg.WriteLong( inventory.weapons );//new + msg.WriteInt( inventory.weapons );//new // msg.WriteShort( inventory.weapons ); msg.WriteByte( inventory.armor ); @@ -10688,7 +10690,7 @@ void idPlayer::ReadPlayerStateFromSnapshot( const idBitMsgDelta &msg ) { stepUpTime = msg.ReadInt(); stepUpDelta = msg.ReadFloat(); */ - inventory.weapons = msg.ReadLong();//new + inventory.weapons = msg.ReadInt();//new // inventory.weapons = msg.ReadShort(); inventory.armor = msg.ReadByte(); diff --git a/game/PlayerView.cpp b/game/PlayerView.cpp index bdba387..6c104e8 100644 --- a/game/PlayerView.cpp +++ b/game/PlayerView.cpp @@ -499,7 +499,7 @@ void idPlayerView::SingleView( idUserInterface *hud, const renderView_t *view ) hackedView.forceUpdate = true; // FIX: for smoke particles not drawing when portalSky present } -#endif _PORTALSKY +#endif // _PORTALSKY gameRenderWorld->RenderScene( &hackedView ); @@ -811,7 +811,7 @@ void idPlayerView::RenderPlayerView( idUserInterface *hud ) { int bloomType = r_bloom.GetInteger(); if (bloomType != 0 && !player->objectiveSystemOpen) { - float blur_str, blur_cut, src_str, src_cut; + float blur_str = 0.0f, blur_cut = 0.0f, src_str = 0.0f, src_cut = 0.0f; renderSystem->CaptureRenderToImage( "_currentRender" ); //------------------------------------------------ diff --git a/game/Projectile.cpp b/game/Projectile.cpp index aee3661..11513dd 100644 --- a/game/Projectile.cpp +++ b/game/Projectile.cpp @@ -38,6 +38,10 @@ If you have questions concerning this license or the applicable additional terms #include "Projectile.h" +#include "framework/DeclEntityDef.h" +#include "BrittleFracture.h" +#include "Moveable.h" + /* =============================================================================== @@ -203,7 +207,7 @@ void idProjectile::Restore( idRestoreGame *savefile ) { //Reinitialize the damage Def--- By Clone JC Denton - damageDef = gameLocal.FindEntityDef( spawnArgs.GetString( "def_damage", false ) ); + damageDef = gameLocal.FindEntityDef( spawnArgs.GetString( "def_damage" ) ); } @@ -432,7 +436,7 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3 // Find and store the damage def only once- --- New //un noted code change from original sdk // place this line before checking the fuse- for beam weapons - damageDef = gameLocal.FindEntityDef( spawnArgs.GetString( "def_damage", false ) ); + damageDef = gameLocal.FindEntityDef( spawnArgs.GetString( "def_damage" ) ); if ( !gameLocal.isClient ) { if ( fuse <= 0 ) { @@ -2222,7 +2226,7 @@ idVec3 idBFGProjectile::GetAimDir( idEntity *aimAtEnt ) { idBFGProjectile::FireSecProjAtTarget ================ */ -idProjectile* idBFGProjectile::FireSecProj( idVec3 &dir ) { +idProjectile* idBFGProjectile::FireSecProj( const idVec3 &dir ) { idProjectile *proj; idEntity *ent; idEntity *ownerEnt; diff --git a/game/Projectile.h b/game/Projectile.h index 877b92d..da7cc43 100644 --- a/game/Projectile.h +++ b/game/Projectile.h @@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "Entity.h" #ifdef _DENTONMOD -//#include "tracer.h" +#include "tracer.h" #ifndef _DENTONMOD_PROJECTILE_CPP #define _DENTONMOD_PROJECTILE_CPP #endif @@ -265,7 +265,7 @@ private: idStr secProjName; idVec3 GetAimDir( idEntity *aimAtEnt ); - idProjectile* FireSecProj( idVec3 &dir ); + idProjectile* FireSecProj( const idVec3 &dir ); //ivan end void FreeBeams(); diff --git a/game/Target.cpp b/game/Target.cpp index bf3aa8d..77e84f1 100644 --- a/game/Target.cpp +++ b/game/Target.cpp @@ -38,6 +38,7 @@ If you have questions concerning this license or the applicable additional terms #include "Misc.h" #include "WorldSpawn.h" #include "Sound.h" +#include "Trigger.h" #include "Target.h" diff --git a/game/Weapon.cpp b/game/Weapon.cpp index 8f23d89..5b30e47 100644 --- a/game/Weapon.cpp +++ b/game/Weapon.cpp @@ -37,6 +37,8 @@ If you have questions concerning this license or the applicable additional terms #include "SmokeParticles.h" #include "WorldSpawn.h" +#include "renderer/ModelManager.h" + #include "Weapon.h" /*********************************************************************** @@ -3533,7 +3535,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float idVec3 muzzle_pos; float muzzleDistFromView; - float traceDist, muzzleToTargetDist; + float traceDist = 0.0f, muzzleToTargetDist = 0.0f; idVec3 muzzleDir; beam = projectileDict.GetFloat( "fuse" ) <= 0 || projectileDict.GetBool( "rail_beam"); diff --git a/game/ai/AI.cpp b/game/ai/AI.cpp index 1634d66..af973e5 100644 --- a/game/ai/AI.cpp +++ b/game/ai/AI.cpp @@ -4516,7 +4516,7 @@ idProjectile *idAI::LaunchProjectile( const char *jointname, idEntity *target, b float attack_cone; float projectile_spread; float diff; - float angle; + float angle = 0.0f; float spin; idAngles ang; int num_projectiles; @@ -4623,6 +4623,8 @@ idProjectile *idAI::LaunchProjectile( const char *jointname, idEntity *target, b spin = (float)DEG2RAD( 360.0f ) * gameLocal.random.RandomFloat(); dir = axis[ 0 ] + axis[ 2 ] * ( angle * idMath::Sin( spin ) ) - axis[ 1 ] * ( angle * idMath::Cos( spin ) ); }else if( fireMode == AI_FIREMODE_2D_STEP_SPREAD){ + // FIXME: DG: if num_projectiles == 1, angle is not properly initialized + // (I initialized it to 0 above, but not sure that's the appropriate value) dir = (axis[ 0 ] * (1-angle*firemodeCounterPos) ) + ( axis[ 2 ] * angle*firemodeCounter ); //upd counter if(firemodeCounter >= 0){ diff --git a/game/ai/AI_bot.cpp b/game/ai/AI_bot.cpp index 7464489..542ee4b 100644 --- a/game/ai/AI_bot.cpp +++ b/game/ai/AI_bot.cpp @@ -1,10 +1,13 @@ // Created by Ivan_the_B // -#include "../../idlib/precompiled.h" -#pragma hdrstop #include "../Game_local.h" +#include "AI_bot.h" +#include "Moveable.h" +#include "gamesys/SysCvar.h" +#include "script/Script_Thread.h" + /* =============================================================================== @@ -1061,9 +1064,9 @@ void idAI_Bot::ShowOnlyCurrentWeapon( void ) { for( i = 0; i < weapons.Num(); i++ ) { ent = weapons[ i ].ent.GetEntity(); if (i == currentWeapon ) { - weapons[ i ].ent.GetEntity()->Show(); + ent->Show(); }else{ - weapons[ i ].ent.GetEntity()->Hide(); + ent->Hide(); } } } @@ -1302,7 +1305,7 @@ idProjectile *idAI_Bot::LaunchProjectile( const char *jointname, idEntity *targe float attack_cone; float projectile_spread; float diff; - float angle; + float angle = 0.0f; float spin; idAngles ang; int num_projectiles; @@ -1416,6 +1419,7 @@ idProjectile *idAI_Bot::LaunchProjectile( const char *jointname, idEntity *targe spin = (float)DEG2RAD( 360.0f ) * gameLocal.random.RandomFloat(); dir = axis[ 0 ] + axis[ 2 ] * ( angle * idMath::Sin( spin ) ) - axis[ 1 ] * ( angle * idMath::Cos( spin ) ); }else if( fireMode == AI_FIREMODE_2D_STEP_SPREAD){ + // FIXME: DG: angle might not be properly initialized (if num_projectiles == 1); I added the angle = 0 to the variable definition dir = (axis[ 0 ] * (1-angle*firemodeCounterPos) ) + ( axis[ 2 ] * angle*firemodeCounter ); //upd counter if(firemodeCounter >= 0){ diff --git a/game/anim/Anim_Blend.cpp b/game/anim/Anim_Blend.cpp index 2a4cdd5..d20ef8a 100644 --- a/game/anim/Anim_Blend.cpp +++ b/game/anim/Anim_Blend.cpp @@ -34,6 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "gamesys/SysCvar.h" #include "ai/AI.h" +#include "ai/AI_bot.h" #include "Entity.h" #include "Fx.h" #include "Game_local.h" diff --git a/game/physics/Force_Spring.cpp b/game/physics/Force_Spring.cpp index 5d4fc03..d43acb2 100644 --- a/game/physics/Force_Spring.cpp +++ b/game/physics/Force_Spring.cpp @@ -28,6 +28,7 @@ If you have questions concerning this license or the applicable additional terms #include "sys/platform.h" #include "physics/Physics.h" +#include "gamesys/SaveGame.h" #include "physics/Force_Spring.h" diff --git a/game/physics/Physics_AF.cpp b/game/physics/Physics_AF.cpp index 657b794..00838c6 100644 --- a/game/physics/Physics_AF.cpp +++ b/game/physics/Physics_AF.cpp @@ -35,6 +35,8 @@ If you have questions concerning this license or the applicable additional terms #include "Player.h" #include "WorldSpawn.h" +#include "physics/Physics_Liquid.h" + #include "physics/Physics_AF.h" CLASS_DECLARATION( idPhysics_Base, idPhysics_AF ) @@ -6015,8 +6017,8 @@ void idPhysics_AF::AddGravity( void ) { #ifdef _WATER_PHYSICS // un credited changes from original sdk idVec3 grav( this->liquidDensity * this->gravityVector ); - float waterLevel,wDensity; - bool inWater,bodyBuoyancy; + float waterLevel, wDensity = 0.0f; // DG: make sure to init this + bool inWater, bodyBuoyancy = false; // DG: make sure to init this if( this->SetWaterLevelf() == 1.0f ) { wDensity = this->water->GetDensity(); diff --git a/game/physics/Physics_Base.cpp b/game/physics/Physics_Base.cpp index 85f4631..f31b13e 100644 --- a/game/physics/Physics_Base.cpp +++ b/game/physics/Physics_Base.cpp @@ -30,6 +30,7 @@ If you have questions concerning this license or the applicable additional terms #include "physics/Force.h" #include "Entity.h" +#include "physics/Physics_Liquid.h" #include "physics/Physics_Base.h" CLASS_DECLARATION( idPhysics, idPhysics_Base ) @@ -913,4 +914,4 @@ float idPhysics_Base::GetWaterLevelf() const { return 1.0f; } -#endif \ No newline at end of file +#endif diff --git a/game/physics/Physics_Liquid.cpp b/game/physics/Physics_Liquid.cpp index 335b35b..01fa320 100644 --- a/game/physics/Physics_Liquid.cpp +++ b/game/physics/Physics_Liquid.cpp @@ -1,11 +1,11 @@ -#include "../../idlib/precompiled.h" -#pragma hdrstop - #ifdef _WATER_PHYSICS #include "../Game_local.h" +#include "Entity.h" + +#include "Physics_Liquid.h" CLASS_DECLARATION( idPhysics_Static, idPhysics_Liquid ) END_CLASS @@ -114,7 +114,7 @@ idPhysics_Liquid::GetPressure */ idVec3 idPhysics_Liquid::GetPressure( const idVec3 &point ) const { idVec3 pressure; - idVec3 &depth = this->GetDepth(point); + const idVec3 &depth = this->GetDepth(point); pressure = depth * this->density; @@ -195,4 +195,4 @@ void idPhysics_Liquid::SetMinWaveVelocity( const idVec3 &w ) { this->minWaveVelocity = w; } -#endif // _WATER_PHYSICS \ No newline at end of file +#endif // _WATER_PHYSICS diff --git a/game/physics/Physics_Liquid.h b/game/physics/Physics_Liquid.h index 5a4246b..6feba35 100644 --- a/game/physics/Physics_Liquid.h +++ b/game/physics/Physics_Liquid.h @@ -1,5 +1,7 @@ #ifdef _WATER_PHYSICS +#include "physics/Physics_Static.h" + /* =============================================================================== @@ -60,4 +62,4 @@ private: idVec3 minSplashVelocity; }; -#endif // _WATER_PHYSICS \ No newline at end of file +#endif // _WATER_PHYSICS diff --git a/game/physics/Physics_Player.cpp b/game/physics/Physics_Player.cpp index 2ace691..ccaf0be 100644 --- a/game/physics/Physics_Player.cpp +++ b/game/physics/Physics_Player.cpp @@ -29,6 +29,10 @@ If you have questions concerning this license or the applicable additional terms #include "sys/platform.h" #include "gamesys/SysCvar.h" #include "Entity.h" +#include "Actor.h" +#include "Item.h" +#include "physics/Physics_Liquid.h" +#include "Moveable.h" #include "physics/Physics_Player.h" @@ -1320,7 +1324,7 @@ void idPhysics_Player::CheckDuck( void ) { maxZ = pm_deadheight.GetFloat(); } else { // stand up when up against a ladder - if ( command.upmove < 0 && !ladder || current.movementType == PM_ANIM_CROUCH ) { // un credited changes from original sdk + if ( (command.upmove < 0 && !ladder) || current.movementType == PM_ANIM_CROUCH ) { // un credited changes from original sdk // duck current.movementFlags |= PMF_DUCKED; } else { diff --git a/game/physics/Physics_Player.h b/game/physics/Physics_Player.h index a688db1..1fbed8b 100644 --- a/game/physics/Physics_Player.h +++ b/game/physics/Physics_Player.h @@ -30,6 +30,7 @@ If you have questions concerning this license or the applicable additional terms #define __PHYSICS_PLAYER_H__ #include "physics/Physics_Actor.h" +#include "physics/Physics_Monster.h" // DG: for monsterMoveResult_t, used by hq2 code below /* =================================================================================== diff --git a/game/physics/Physics_RigidBody.cpp b/game/physics/Physics_RigidBody.cpp index 231f77c..ae32403 100644 --- a/game/physics/Physics_RigidBody.cpp +++ b/game/physics/Physics_RigidBody.cpp @@ -32,6 +32,9 @@ If you have questions concerning this license or the applicable additional terms #include "gamesys/SysCvar.h" #include "Entity.h" #include "Player.h" +#include "Moveable.h" + +#include "physics/Physics_Liquid.h" #include "physics/Physics_RigidBody.h" @@ -165,7 +168,7 @@ bool idPhysics_RigidBody::GetBuoyancy( const idVec3 &pos, const idMat3 &rotation // return true if the body is in water, false otherwise idVec3 tbCenter(pos); - idBounds bounds = this->GetBounds(); + //idBounds bounds = this->GetBounds(); idTraceModel tm = *this->GetClipModel()->GetTraceModel(); int i,count; diff --git a/game/tracer.cpp b/game/tracer.cpp index 24d1401..23a6684 100644 --- a/game/tracer.cpp +++ b/game/tracer.cpp @@ -1,10 +1,11 @@ - -#include "../idlib/precompiled.h" -#pragma hdrstop - #ifdef _DENTONMOD #include "Game_local.h" +#include "Entity.h" +#include "renderer/ModelManager.h" +#include "SmokeParticles.h" + +#include "tracer.h" /* =============================================================================== @@ -582,4 +583,4 @@ void dnRailBeam::Think( void ) { } -#endif /* !_DENTONMOD */ \ No newline at end of file +#endif /* !_DENTONMOD */