CMake integration of Sikkmod, changes to code to make it compile

no idea if it works, but it builds :-p
This commit is contained in:
Daniel Gibson 2024-06-21 03:37:30 +02:00
parent 2bb7f6ae3d
commit a8e0cda873
16 changed files with 56 additions and 21 deletions

View file

@ -2,11 +2,11 @@ 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 "sikkmod" 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)
set(D3XP_NAME "d3xp" CACHE STRING "Name of the mod built from d3xp/ (will result in \${D3XP_NAME}.dll)")
set(D3XP_NAME "sikkmodd3xp" 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/")
option(ONATIVE "Optimize for the host CPU" OFF)
@ -20,12 +20,18 @@ 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
# add additional .cpp files of your mod in d3xp/
# (that you added to the ones already existant in the SDK/in dhewm3)
# like "d3xp/MyFile.cpp" (without quotes, one file per line)
d3xp/Grab.h
d3xp/Grab.cpp
)

View file

@ -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

View file

@ -8,6 +8,12 @@
===============================================================================
*/
#ifndef _Grab_h_defined
#define _Grab_h_defined
#include "Entity.h"
#include "physics/Force_Grab.h"
class idGrabEntity : public idEntity {
public:
CLASS_PROTOTYPE( idGrabEntity );
@ -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<idEntity> dragEnt; // entity being dragged
@ -41,3 +47,5 @@ private:
};
// <---sikk
#endif // _Grab_h_defined

View file

@ -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]

View file

@ -38,6 +38,7 @@ If you have questions concerning this license or the applicable additional terms
#include "Projectile.h"
#include "PlayerIcon.h"
#include "GameEdit.h"
#include "Grab.h" // for sikkmod
class idAI;
class idFuncMountedObject;

View file

@ -35,6 +35,7 @@ If you have questions concerning this license or the applicable additional terms
#include "Fx.h"
#include "SmokeParticles.h"
#include "Misc.h"
#include "WorldSpawn.h"
#include "ai/AI.h"

View file

@ -317,8 +317,8 @@ public:
// sikk---> Portal Sky Box
idEntityPtr<idEntity> 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
@ -684,6 +684,8 @@ extern const float DEFAULT_GRAVITY;
extern const idVec3 DEFAULT_GRAVITY_VEC3;
extern const int CINEMATIC_SKIP_DELAY;
#include "Entity.h"
#endif /* !__GAME_LOCAL_H__ */
#if 0 // TODO: DG: ???

View file

@ -1,10 +1,11 @@
// 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

View file

@ -8,6 +8,11 @@
===============================================================================
*/
#ifndef _Grab_h_defined
#define _Grab_h_defined
#include "physics/Force_Grab.h"
class idGrabEntity : public idEntity {
public:
CLASS_PROTOTYPE( idGrabEntity );
@ -23,7 +28,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<idEntity> dragEnt; // entity being dragged
@ -41,3 +46,5 @@ private:
};
// <---sikk
#endif // _Grab_h_defined

View file

@ -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]

View file

@ -38,6 +38,7 @@ If you have questions concerning this license or the applicable additional terms
#include "Projectile.h"
#include "PlayerIcon.h"
#include "GameEdit.h"
#include "Grab.h" // for sikkmod
class idAI;

View file

@ -921,7 +921,9 @@ 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, NULL );
// DG: the previous line didn't compile, I hope this is equivalent to the original intention
PostEventSec( &EV_RadiusDamage, delay );
} else {
// Event_RadiusDamage( ignore );
Event_RadiusDamage( NULL );

View file

@ -33,6 +33,8 @@ If you have questions concerning this license or the applicable additional terms
#include "Moveable.h"
#include "SmokeParticles.h"
#include "WorldSpawn.h"
#include "ai/AI.h"
static const char *moveCommandString[ NUM_MOVE_COMMANDS ] = {

View file

@ -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 )

View file

@ -3,6 +3,8 @@
#ifndef __FORCE_GRAB_H__
#define __FORCE_GRAB_H__
#include "physics/Force.h"
/*
===============================================================================

View file

@ -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
/*
===============================================================================