diff --git a/CMakeLists.txt b/CMakeLists.txt index f95fc93..a3df144 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 "grimm" 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/Grab.h + game/Grab.cpp + game/physics/Force_Grab.h + game/physics/Force_Grab.cpp ) set(src_d3xp_mod diff --git a/game/Actor.cpp b/game/Actor.cpp index d383425..ba15cf9 100644 --- a/game/Actor.cpp +++ b/game/Actor.cpp @@ -35,6 +35,7 @@ If you have questions concerning this license or the applicable additional terms #include "WorldSpawn.h" #include "Actor.h" +#include "Fx.h" /*********************************************************************** diff --git a/game/Game_local.h b/game/Game_local.h index ff301f8..b7795a7 100644 --- a/game/Game_local.h +++ b/game/Game_local.h @@ -325,8 +325,8 @@ public: // sikk---> Portal Sky Box idEntityPtr portalSkyEnt; bool portalSkyActive; - void idGameLocal::SetPortalSkyEnt( idEntity *ent ) { portalSkyEnt = ent; } - bool idGameLocal::IsPortalSkyAcive( void ) { return portalSkyActive; } + void SetPortalSkyEnt( idEntity *ent ) { portalSkyEnt = ent; } + bool IsPortalSkyAcive( void ) { return portalSkyActive; } pvsHandle_t GetPlayerPVS( void ) { return playerPVS; }; // <---sikk @@ -693,4 +693,6 @@ extern const float DEFAULT_GRAVITY; extern const idVec3 DEFAULT_GRAVITY_VEC3; extern const int CINEMATIC_SKIP_DELAY; +#include "Entity.h" + #endif /* !__GAME_LOCAL_H__ */ diff --git a/game/Grab.cpp b/game/Grab.cpp index bdd86de..2561dbc 100644 --- a/game/Grab.cpp +++ b/game/Grab.cpp @@ -1,10 +1,10 @@ // sikk---> Object Manipulation -#include "../idlib/precompiled.h" -#pragma hdrstop - #include "Game_local.h" +#include "Grab.h" #include "Misc.h" +#include "Player.h" +#include "gamesys/SysCvar.h" #define MAX_DRAG_TRACE_DISTANCE 80.0f #define TRACE_BOUNDS_SIZE 3.0f diff --git a/game/Grab.h b/game/Grab.h index a0837fd..79a838d 100644 --- a/game/Grab.h +++ b/game/Grab.h @@ -1,3 +1,9 @@ +#ifndef _Grab_h_defined +#define _Grab_h_defined + +#include "Entity.h" +#include "physics/Force_Grab.h" + // sikk---> Object Manipulation /* =============================================================================== @@ -23,7 +29,7 @@ public: idEntity * GetGrabEntity( void ) const { return dragEnt.GetEntity(); } int GetThrownTime( void ) const { return lastThrownTime; } - int SetThrownTime( int time ) { lastThrownTime = time; } + void SetThrownTime( int time ) { lastThrownTime = time; } private: idEntityPtr dragEnt; // entity being dragged @@ -41,3 +47,5 @@ private: }; // <---sikk + +#endif // _Grab_h_defined diff --git a/game/Moveable.cpp b/game/Moveable.cpp index 09b6fdc..2e356e8 100644 --- a/game/Moveable.cpp +++ b/game/Moveable.cpp @@ -32,6 +32,7 @@ If you have questions concerning this license or the applicable additional terms #include "Fx.h" #include "Moveable.h" +#include "SmokeParticles.h" /* =============================================================================== @@ -290,7 +291,7 @@ void idMoveable::Hide( void ) { // grimm --> blood spray last_spraytime = 0; - if ( mtr_collide.c_str() != "" && last_spraytime < gameLocal.GetTime() ) { + if ( mtr_collide.c_str()[0] != '\0' && last_spraytime < gameLocal.GetTime() ) { idVec3 org = physicsObj.GetOrigin(); gameLocal.ProjectDecal( org, GetPhysics()->GetGravity(), 128.0f, true, 96.0f, mtr_collide.c_str() ); } diff --git a/game/Player.cpp b/game/Player.cpp index 9c36402..c640046 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -40,6 +40,7 @@ If you have questions concerning this license or the applicable additional terms #include "Camera.h" #include "Fx.h" #include "Misc.h" +#include "Moveable.h" const int ASYNC_PLAYER_INV_AMMO_BITS = idMath::BitsForInteger( 999 ); // 9 bits to cover the range [0, 999] const int ASYNC_PLAYER_INV_CLIP_BITS = -7; // -7 bits to cover the range [-1, 60] @@ -1403,7 +1404,7 @@ void idPlayer::Init( void ) { //grimm --> music_suspense = gameLocal.FindEntity("music_suspense"); music_combat = gameLocal.FindEntity("music_combat"); - use_combat_music = gameLocal.world->spawnArgs.GetBool("use_combat_music", false); + use_combat_music = gameLocal.world->spawnArgs.GetBool("use_combat_music", "0"); combat_musicon = false; music_waittime = 0.0f; @@ -7288,7 +7289,7 @@ void idPlayer::Event_SetSlomoSound( float slomoval ) { idPlayer::SpawnThing( char clname ); ================= */ -void idPlayer::SpawnThing( char *clname ) { +void idPlayer::SpawnThing( const char *clname ) { float yaw; idVec3 org; idDict dict; diff --git a/game/Player.h b/game/Player.h index b76acd1..efd7774 100644 --- a/game/Player.h +++ b/game/Player.h @@ -39,6 +39,8 @@ If you have questions concerning this license or the applicable additional terms #include "PlayerIcon.h" #include "GameEdit.h" +#include "Grab.h" + class idAI; /* @@ -639,7 +641,7 @@ public: void CheckKillAccolade( void ); int lastAccoladeCheck; int nextAccoladeCheck; - void SpawnThing( char *clname ); + void SpawnThing( const char *clname ); // obstacle checking (move cloth etc..) void CheckObstacle( void ); diff --git a/game/Projectile.cpp b/game/Projectile.cpp index f87c61f..c400ffe 100644 --- a/game/Projectile.cpp +++ b/game/Projectile.cpp @@ -37,6 +37,7 @@ If you have questions concerning this license or the applicable additional terms #include "SmokeParticles.h" #include "Projectile.h" +#include "Fx.h" /* =============================================================================== @@ -946,7 +947,7 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) { } // sikk---> Entities hit directly by a projectile will no longer be ignored by splash damage // PostEventSec( &EV_RadiusDamage, delay, ignore ); - PostEventSec( &EV_RadiusDamage, delay, NULL ); + PostEventSec( &EV_RadiusDamage, delay ); } else { // Event_RadiusDamage( ignore ); Event_RadiusDamage( NULL ); diff --git a/game/SmokeParticles.cpp b/game/SmokeParticles.cpp index ffb3dea..f4111af 100644 --- a/game/SmokeParticles.cpp +++ b/game/SmokeParticles.cpp @@ -31,6 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "Game_local.h" #include "SmokeParticles.h" +#include "Entity.h" static const char *smokeParticle_SnapshotName = "_SmokeParticle_Snapshot_"; diff --git a/game/Trigger.cpp b/game/Trigger.cpp index 7c114f2..18c3556 100644 --- a/game/Trigger.cpp +++ b/game/Trigger.cpp @@ -31,6 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "Player.h" #include "Trigger.h" +#include "ai/AI.h" /* =============================================================================== diff --git a/game/physics/Force_Grab.cpp b/game/physics/Force_Grab.cpp index e30c838..510af2f 100644 --- a/game/physics/Force_Grab.cpp +++ b/game/physics/Force_Grab.cpp @@ -1,8 +1,6 @@ // sikk---> Object Manipulation -#include "../../idlib/precompiled.h" -#pragma hdrstop - +#include "Force_Grab.h" #include "../Game_local.h" CLASS_DECLARATION( idForce, idForce_Grab ) diff --git a/game/physics/Force_Grab.h b/game/physics/Force_Grab.h index 82fc952..a7f1100 100644 --- a/game/physics/Force_Grab.h +++ b/game/physics/Force_Grab.h @@ -3,6 +3,8 @@ #ifndef __FORCE_GRAB_H__ #define __FORCE_GRAB_H__ +#include "physics/Force.h" + /* =============================================================================== diff --git a/idlib/Lib.h b/idlib/Lib.h index 5b2e999..5283109 100644 --- a/idlib/Lib.h +++ b/idlib/Lib.h @@ -29,6 +29,8 @@ If you have questions concerning this license or the applicable additional terms #ifndef __LIB_H__ #define __LIB_H__ +#include "sys/platform.h" // dword + /* ===============================================================================