diff --git a/CMakeLists.txt b/CMakeLists.txt index f95fc93..6192cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 2.8...3.22 FATAL_ERROR) project(dhewm3sdk) option(BASE "Build the base (game/) game code" ON) -set(BASE_NAME "base" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)") +set(BASE_NAME "desolated" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)") set(BASE_DEFS "GAME_DLL" CACHE STRING "Compiler definitions for the mod built from game/") -option(D3XP "Build the d3xp/ game code" ON) +option(D3XP "Build the d3xp/ game code" OFF) set(D3XP_NAME "d3xp" CACHE STRING "Name of the mod built from d3xp/ (will result in \${D3XP_NAME}.dll)") set(D3XP_DEFS "GAME_DLL;_D3XP;CTF" CACHE STRING "Compiler definitions for the mod built from d3xp/") @@ -20,6 +20,10 @@ set(src_game_mod # add additional .cpp files of your mod in game/ # (that you added to the ones already existant in the SDK/in dhewm3) # like "game/MyFile.cpp" (without quotes, one file per line) + game/Liquid.h + game/Liquid.cpp + game/physics/Physics_Liquid.h + game/physics/Physics_Liquid.cpp ) set(src_d3xp_mod diff --git a/game/Game_local.h b/game/Game_local.h index d5bf25e..df7456d 100644 --- a/game/Game_local.h +++ b/game/Game_local.h @@ -656,19 +656,4 @@ extern const float DEFAULT_GRAVITY; extern const idVec3 DEFAULT_GRAVITY_VEC3; extern const int CINEMATIC_SKIP_DELAY; -#include "physics/Physics_Parametric.h" -#include "physics/Physics_RigidBody.h" -#include "physics/Physics_AF.h" -#include "physics/Physics_Liquid.h" - -#include "SmokeParticles.h" - -#include "AF.h" -#include "IK.h" -#include "AFEntity.h" -#include "Liquid.h" -#include "Misc.h" -#include "Actor.h" -#include "Projectile.h" - #endif /* !__GAME_LOCAL_H__ */ diff --git a/game/Liquid.cpp b/game/Liquid.cpp index 459c1fd..771935c 100644 --- a/game/Liquid.cpp +++ b/game/Liquid.cpp @@ -1,7 +1,7 @@ -#include "../idlib/precompiled.h" -#pragma hdrstop -#include "Game_local.h" +#include "Liquid.h" +#include "SmokeParticles.h" +#include "physics/Physics_Actor.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?) @@ -223,4 +223,4 @@ bool idLiquid::Collide( const trace_t &collision, const idVec3 &velocity ) { // spawn the particle gameLocal.smokeParticles->EmitSmoke(splash,gameLocal.time,gameLocal.random.RandomFloat(),splashSpot,mat3_identity); return true; -} \ No newline at end of file +} diff --git a/game/Liquid.h b/game/Liquid.h index 14f1305..93a8a22 100644 --- a/game/Liquid.h +++ b/game/Liquid.h @@ -1,6 +1,9 @@ #ifndef __LIQUID_H__ #define __LIQUID_H__ +#include "Entity.h" +#include "physics/Physics_Liquid.h" + /* =============================================================================== @@ -40,4 +43,4 @@ private: idStr soundName; }; -#endif // __LIQUID_H__ \ No newline at end of file +#endif // __LIQUID_H__ diff --git a/game/Trigger.cpp b/game/Trigger.cpp index 15a8fc7..1a1c62c 100644 --- a/game/Trigger.cpp +++ b/game/Trigger.cpp @@ -30,6 +30,9 @@ If you have questions concerning this license or the applicable additional terms #include "script/Script_Thread.h" #include "Player.h" +#include "idlib/LangDict.h" +#include "gamesys/SysCvar.h" + #include "Trigger.h" /* diff --git a/game/ai/AI.cpp b/game/ai/AI.cpp index e74674b..af7734c 100644 --- a/game/ai/AI.cpp +++ b/game/ai/AI.cpp @@ -35,6 +35,8 @@ If you have questions concerning this license or the applicable additional terms #include "ai/AI.h" +#include + static const char *moveCommandString[ NUM_MOVE_COMMANDS ] = { "MOVE_NONE", "MOVE_FACE_ENEMY", diff --git a/game/physics/Physics_AF.cpp b/game/physics/Physics_AF.cpp index b851efd..528ef09 100644 --- a/game/physics/Physics_AF.cpp +++ b/game/physics/Physics_AF.cpp @@ -37,6 +37,8 @@ If you have questions concerning this license or the applicable additional terms #include "physics/Physics_AF.h" +#include "Physics_Liquid.h" + CLASS_DECLARATION( idPhysics_Base, idPhysics_AF ) END_CLASS @@ -8314,4 +8316,4 @@ idPhysics_AF::GetFixedDensityBuoyancy bool idPhysics_AF::GetFixedDensityBuoyancy() const { return this->fixedDensityBuoyancy; -} \ No newline at end of file +} diff --git a/game/physics/Physics_Base.cpp b/game/physics/Physics_Base.cpp index 8d80745..63d3762 100644 --- a/game/physics/Physics_Base.cpp +++ b/game/physics/Physics_Base.cpp @@ -31,6 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "Entity.h" #include "physics/Physics_Base.h" +#include "Physics_Liquid.h" CLASS_DECLARATION( idPhysics, idPhysics_Base ) END_CLASS @@ -909,4 +910,4 @@ float idPhysics_Base::GetWaterLevelf() const { return 0.0f; else return 1.0f; -} \ No newline at end of file +} diff --git a/game/physics/Physics_Liquid.cpp b/game/physics/Physics_Liquid.cpp index c009c79..009a228 100644 --- a/game/physics/Physics_Liquid.cpp +++ b/game/physics/Physics_Liquid.cpp @@ -1,9 +1,7 @@ -#include "../../idlib/precompiled.h" -#pragma hdrstop - -#include "../Game_local.h" - +#include "Physics_Liquid.h" +#include "gamesys/SaveGame.h" +#include "Entity.h" CLASS_DECLARATION( idPhysics_Static, idPhysics_Liquid ) END_CLASS @@ -112,7 +110,7 @@ idPhysics_Liquid::GetPressure */ idVec3 idPhysics_Liquid::GetPressure( const idVec3 &point ) const { idVec3 pressure; - idVec3 &depth = this->GetDepth(point); + idVec3 depth = this->GetDepth(point); pressure = depth * this->density; @@ -191,4 +189,4 @@ idPhysics_Liquid::SetMinWaveVelocity */ void idPhysics_Liquid::SetMinWaveVelocity( const idVec3 &w ) { this->minWaveVelocity = w; -} \ No newline at end of file +} diff --git a/game/physics/Physics_Liquid.h b/game/physics/Physics_Liquid.h index 9c2b1fc..405f724 100644 --- a/game/physics/Physics_Liquid.h +++ b/game/physics/Physics_Liquid.h @@ -18,6 +18,11 @@ =============================================================================== */ +#ifndef _GAME_PHYSICS_LIQUID_H_ +#define _GAME_PHYSICS_LIQUID_H_ + +#include "Physics_Static.h" + class idPhysics_Liquid : public idPhysics_Static { public: CLASS_PROTOTYPE( idPhysics_Liquid ); @@ -57,4 +62,6 @@ private: idVec3 minWaveVelocity; idVec3 minSplashVelocity; -}; \ No newline at end of file +}; + +#endif // _GAME_PHYSICS_LIQUID_H_ diff --git a/game/physics/Physics_RigidBody.cpp b/game/physics/Physics_RigidBody.cpp index 5ec8191..aefb791 100644 --- a/game/physics/Physics_RigidBody.cpp +++ b/game/physics/Physics_RigidBody.cpp @@ -34,6 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "Player.h" #include "physics/Physics_RigidBody.h" +#include "Physics_Liquid.h" CLASS_DECLARATION( idPhysics_Base, idPhysics_RigidBody ) END_CLASS diff --git a/game/script/Script_Thread.cpp b/game/script/Script_Thread.cpp index ef84fc1..ebca613 100644 --- a/game/script/Script_Thread.cpp +++ b/game/script/Script_Thread.cpp @@ -34,6 +34,8 @@ If you have questions concerning this license or the applicable additional terms #include "script/Script_Thread.h" +#include + const idEventDef EV_Thread_Execute( "", NULL ); const idEventDef EV_Thread_SetCallback( "", NULL ); @@ -2108,7 +2110,7 @@ void idThread::Event_SetTestVarGui1( float value ) { player->inventory.testVarGui1 = value; if( player->inventory.testVarGui1 < 0 || - player->inventory.testVarGui1 > INT_MAX ) { + player->inventory.testVarGui1 > INT_MAX ) { // DG: FIXME: this check will never be true.. player->inventory.testVarGui1 = 0; } diff --git a/idlib/LangDict.cpp b/idlib/LangDict.cpp index 63b477a..938d42e 100644 --- a/idlib/LangDict.cpp +++ b/idlib/LangDict.cpp @@ -304,7 +304,8 @@ idLangDict::GetHashKey int idLangDict::GetHashKey( const char *str ) const { int hashKey = 0; for ( str += STRTABLE_ID_LENGTH; str[0] != '\0'; str++ ) { - assert( str[0] >= '0' && str[0] <= '9' ); + // DG: desolated uses string ids like #str_quest_4 or similar, so get rid of the assertion + //assert( str[0] >= '0' && str[0] <= '9' ); hashKey = hashKey * 10 + str[0] - '0'; } return hashKey;