Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	code/CMakeLists.txt
#	code/cgame/FxPrimitives.cpp
#	code/cgame/FxScheduler.cpp
#	code/cgame/FxScheduler.h
#	code/cgame/FxSystem.h
#	code/cgame/FxUtil.cpp
#	code/cgame/cg_effects.cpp
#	code/cgame/cg_main.cpp
#	code/cgame/cg_players.cpp
#	code/client/cl_input.cpp
#	code/client/cl_main.cpp
#	code/game/CMakeLists.txt
#	code/game/G_Timer.cpp
#	code/game/NPC_spawn.cpp
#	code/game/Q3_Interface.cpp
#	code/game/Q3_Interface.h
#	code/game/ai.h
#	code/game/b_public.h
#	code/game/bg_public.h
#	code/game/g_local.h
#	code/game/g_main.cpp
#	code/game/g_objectives.cpp
#	code/game/g_public.h
#	code/game/g_roff.cpp
#	code/game/g_savegame.cpp
#	code/game/g_shared.h
#	code/game/g_vehicles.h
#	code/game/g_weapon.cpp
#	code/game/ghoul2_shared.h
#	code/icarus/IcarusImplementation.cpp
#	code/icarus/IcarusInterface.h
#	code/qcommon/cm_load.cpp
#	code/qcommon/md4.cpp
#	code/qcommon/msg.cpp
#	code/qcommon/q_shared.cpp
#	code/qcommon/q_shared.h
#	code/qcommon/qcommon.h
#	code/rd-common/mdx_format.h
#	code/rd-common/tr_common.h
#	code/rd-common/tr_image_jpg.cpp
#	code/rd-common/tr_public.h
#	code/rd-vanilla/CMakeLists.txt
#	code/rd-vanilla/G2_API.cpp
#	code/rd-vanilla/G2_bones.cpp
#	code/rd-vanilla/G2_misc.cpp
#	code/rd-vanilla/tr_ghoul2.cpp
#	code/rd-vanilla/tr_surface.cpp
#	code/server/sv_game.cpp
#	code/server/sv_savegame.cpp
#	code/server/sv_snapshot.cpp
#	code/ui/ui_main.cpp
#	codeJK2/cgame/FxPrimitives.cpp
#	codeJK2/cgame/FxSystem.h
#	codeJK2/cgame/FxUtil.cpp
#	codeJK2/cgame/cg_effects.cpp
#	codeJK2/cgame/cg_main.cpp
#	codeJK2/cgame/cg_players.cpp
#	codeJK2/game/CMakeLists.txt
#	codeJK2/game/G_Timer.cpp
#	codeJK2/game/NPC_spawn.cpp
#	codeJK2/game/Q3_Interface.cpp
#	codeJK2/game/Q3_Registers.cpp
#	codeJK2/game/ai.h
#	codeJK2/game/anims.h
#	codeJK2/game/b_public.h
#	codeJK2/game/bg_public.h
#	codeJK2/game/g_ICARUS.cpp
#	codeJK2/game/g_local.h
#	codeJK2/game/g_main.cpp
#	codeJK2/game/g_objectives.cpp
#	codeJK2/game/g_public.h
#	codeJK2/game/g_roff.cpp
#	codeJK2/game/g_savegame.cpp
#	codeJK2/game/g_shared.h
#	codeJK2/game/ghoul2_shared.h
#	codeJK2/icarus/Instance.cpp
#	codeJK2/icarus/Sequence.cpp
#	codeJK2/icarus/Sequencer.cpp
#	codeJK2/icarus/TaskManager.cpp
#	codeJK2/icarus/interface.h
  • Loading branch information
eternalcodes committed Oct 15, 2016
2 parents d41a30f + 9d3e4fe commit 42affd0
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 52 deletions.
2 changes: 2 additions & 0 deletions codemp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ if(BuildMPEngine OR BuildMPDed)
"${MPDir}/qcommon/timing.h"
"${MPDir}/qcommon/vm.cpp"
"${MPDir}/qcommon/z_memman_pc.cpp"

${SharedCommonFiles}
)
if(WIN32)
set(MPEngineAndDedCommonFiles ${MPEngineAndDedCommonFiles})
Expand Down
14 changes: 4 additions & 10 deletions codemp/cgame/cg_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,6 @@ void CG_InitGlass( void )
}
}

void Vector2Set(vec2_t a,float b,float c)
{
a[0] = b;
a[1] = c;
}

#define TIME_DECAY_SLOW 0.1f
#define TIME_DECAY_MED 0.04f
#define TIME_DECAY_FAST 0.009f
Expand Down Expand Up @@ -538,7 +532,7 @@ void CG_DoGlass( vec3_t verts[4], vec3_t normal, vec3_t dmgPt, vec3_t dmgDir, fl
zz = z;
}

Vector2Set( biPoints[0], xx, zz );
VectorSet2( biPoints[0], xx, zz );

if ( t + 1 > 0 && t + 1 < mxWidth )
{
Expand All @@ -558,7 +552,7 @@ void CG_DoGlass( vec3_t verts[4], vec3_t normal, vec3_t dmgPt, vec3_t dmgDir, fl
zz = z;
}

Vector2Set( biPoints[1], xx + stepWidth, zz );
VectorSet2( biPoints[1], xx + stepWidth, zz );

if ( t + 1 > 0 && t + 1 < mxWidth )
{
Expand All @@ -578,7 +572,7 @@ void CG_DoGlass( vec3_t verts[4], vec3_t normal, vec3_t dmgPt, vec3_t dmgDir, fl
zz = z;
}

Vector2Set( biPoints[2], xx + stepWidth, zz + stepHeight);
VectorSet2( biPoints[2], xx + stepWidth, zz + stepHeight);

if ( t > 0 && t < mxWidth )
{
Expand All @@ -598,7 +592,7 @@ void CG_DoGlass( vec3_t verts[4], vec3_t normal, vec3_t dmgPt, vec3_t dmgDir, fl
zz = z;
}

Vector2Set( biPoints[3], xx, zz + stepHeight );
VectorSet2( biPoints[3], xx, zz + stepHeight );

CG_CalcBiLerp( verts, subVerts, biPoints );

Expand Down
2 changes: 1 addition & 1 deletion codemp/client/FxPrimitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ void CPoly::Draw(void)
verts[i].modulate[k] = mRefEnt.shaderRGBA[k];

// Copy the ST coords
Vector2Copy( mST[i], verts[i].st );
VectorCopy2( mST[i], verts[i].st );
}

// Add this poly
Expand Down
2 changes: 1 addition & 1 deletion codemp/client/FxScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ void CFxScheduler::PlayEffect( int id, vec3_t origin, matrix3_t axis, const int

if ( sfx == NULL )
{
Com_Error (ERR_DROP, "ERROR: Failed to allocate EFX from memory pool.\n");
Com_Error (ERR_DROP, "ERROR: Failed to allocate EFX from memory pool.");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion codemp/client/FxSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cvar_t *fx_nearCull;

// Stuff for the FxHelper
//------------------------------------------------------
SFxHelper::SFxHelper(void) :
SFxHelper::SFxHelper() :
mTime(0),
mOldTime(0),
mFrameTime(0),
Expand Down
32 changes: 1 addition & 31 deletions codemp/client/FxSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,6 @@ extern cvar_t *fx_freeze;
extern cvar_t *fx_countScale;
extern cvar_t *fx_nearCull;

inline void Vector2Clear(vec2_t a)
{
a[0] = 0.0f;
a[1] = 0.0f;
}

inline void Vector2Set(vec2_t a,float b,float c)
{
a[0] = b;
a[1] = c;
}

inline void Vector2Copy(vec2_t src,vec2_t dst)
{
dst[0] = src[0];
dst[1] = src[1];
}

inline void Vector2MA(vec2_t src, float m, vec2_t v, vec2_t dst)
{
dst[0] = src[0] + (m*v[0]);
dst[1] = src[1] + (m*v[1]);
}

inline void Vector2Scale(vec2_t src,float b,vec2_t dst)
{
dst[0] = src[0] * b;
dst[1] = src[1] * b;
}

class SFxHelper
{
public:
Expand All @@ -79,7 +49,7 @@ class SFxHelper
#endif

public:
SFxHelper(void);
SFxHelper();

inline int GetTime(void) { return mTime; }
inline int GetFrameTime(void) { return mFrameTime; }
Expand Down
2 changes: 1 addition & 1 deletion codemp/client/FxUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ CPoly *FX_AddPoly( vec3_t *verts, vec2_t *st, int numVerts,
for ( int i = 0; i < numVerts; i++ )
{
VectorCopy( verts[i], fx->mOrg[i] );
Vector2Copy( st[i], fx->mST[i] );
VectorCopy2( st[i], fx->mST[i] );
}

fx->SetVel( vel );
Expand Down
2 changes: 1 addition & 1 deletion codemp/icarus/GameInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ICARUS_Instance *iICARUS;
bufferlist_t ICARUS_BufferList;
entlist_t ICARUS_EntList;

extern unsigned Com_BlockChecksum (const void *buffer, int length);
extern uint32_t Com_BlockChecksum (const void *buffer, int length);
extern void Q3_DebugPrint( int level, const char *format, ... );

int ICARUS_entFilter = -1;
Expand Down
2 changes: 1 addition & 1 deletion codemp/icarus/Q3_Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void CGCam_Anything( void )
}

//These are useless for MP. Just taking it for now since I don't want to remove all calls to this in ICARUS.
int AppendToSaveGame(unsigned long chid, void *data, int length)
int AppendToSaveGame(unsigned long chid, const void *data, int length)
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion codemp/icarus/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ typedef struct interface_export_s

//Save / Load functions

int (*I_WriteSaveData)( unsigned long chid, void *data, int length );
int (*I_WriteSaveData)( unsigned long chid, const void *data, int length );
// Below changed by BTO (VV). Visual C++ 7.1 compiler no longer allows default args on function pointers. Ack.
int (*I_ReadSaveData)( unsigned long chid, void *address, int length /* , void **addressptr = NULL */ );
int (*I_LinkEntity)( int entID, CSequencer *sequencer, CTaskManager *taskManager );
Expand Down
4 changes: 2 additions & 2 deletions codemp/qcommon/md4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ static void mdfour(byte *out, byte *in, int n)

//===================================================================

unsigned Com_BlockChecksum (const void *buffer, int length)
uint32_t Com_BlockChecksum (const void *buffer, int length)
{
int digest[4];
unsigned val;
uint32_t val;

mdfour( (byte *)digest, (byte *)buffer, length );

Expand Down
2 changes: 1 addition & 1 deletion codemp/qcommon/qcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ void NORETURN QDECL Com_Error( int code, const char *fmt, ... );
void NORETURN Com_Quit_f( void );
int Com_EventLoop( void );
int Com_Milliseconds( void ); // will be journaled properly
unsigned Com_BlockChecksum( const void *buffer, int length );
uint32_t Com_BlockChecksum( const void *buffer, int length );
char *Com_MD5File(const char *filename, int length, const char *prefix, int prefix_len);
int Com_HashKey(char *string, int maxlen);
int Com_Filter(char *filter, char *name, int casesensitive);
Expand Down
48 changes: 48 additions & 0 deletions shared/qcommon/q_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,54 @@ void AnglesToAxis( const vec3_t angles, matrix3_t axis ) {
}


///////////////////////////////////////////////////////////////////////////
//
// VEC2
//
///////////////////////////////////////////////////////////////////////////
vec2_t vec2_zero = {0,0};

void VectorAdd2( const vec2_t vec1, const vec2_t vec2, vec2_t vecOut )
{
vecOut[0] = vec1[0]+vec2[0];
vecOut[1] = vec1[1]+vec2[1];
}

void VectorSubtract2( const vec2_t vec1, const vec2_t vec2, vec2_t vecOut )
{
vecOut[0] = vec1[0]-vec2[0];
vecOut[1] = vec1[1]-vec2[1];
}

void VectorScale2( const vec2_t vecIn, float scale, vec2_t vecOut )
{
vecOut[0] = vecIn[0]*scale;
vecOut[1] = vecIn[1]*scale;
}

void VectorMA2( const vec2_t vec1, float scale, const vec2_t vec2, vec2_t vecOut )
{
vecOut[0] = vec1[0] + scale*vec2[0];
vecOut[1] = vec1[1] + scale*vec2[1];
}

void VectorSet2( vec2_t vec, float x, float y )
{
vec[0]=x; vec[1]=y;
}

void VectorClear2( vec2_t vec )
{
vec[0] = vec[1] = 0.0f;
}

void VectorCopy2( const vec2_t vecIn, vec2_t vecOut )
{
vecOut[0] = vecIn[0];
vecOut[1] = vecIn[1];
}


///////////////////////////////////////////////////////////////////////////
//
// VEC3
Expand Down
26 changes: 26 additions & 0 deletions shared/qcommon/q_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.

#include "q_platform.h"


#if defined(__cplusplus)
extern "C" {
#endif
Expand Down Expand Up @@ -199,6 +200,31 @@ void AxisCopy( matrix3_t in, matrix3_t out );
void AnglesToAxis( const vec3_t angles, matrix3_t axis );


///////////////////////////////////////////////////////////////////////////
//
// VEC2
//
///////////////////////////////////////////////////////////////////////////
extern vec2_t vec3_zero;

#define VectorScale2M(v, factor, dst) \
(dst)[0] = (v[0]) * (factor), \
(dst)[1] = (v[1]) * (factor)
#define VectorCopy2M(src, dst) \
(dst)[0] = (src[0]), \
(dst)[1] = (src[1])
#define VectorClear2M(dst) \
memset((dst), 0, sizeof((dst)[0]) * 2)

void VectorAdd2( const vec2_t vec1, const vec2_t vec2, vec2_t vecOut );
void VectorSubtract2( const vec2_t vec1, const vec2_t vec2, vec2_t vec2_t );
void VectorScale2( const vec2_t vecIn, float scale, vec2_t vecOut );
void VectorMA2( const vec2_t vec1, float scale, const vec2_t vec2, vec2_t vecOut );
void VectorSet2( vec2_t vec, float x, float y );
void VectorClear2( vec2_t vec );
void VectorCopy2( const vec2_t vecIn, vec2_t vecOut );


///////////////////////////////////////////////////////////////////////////
//
// VEC3
Expand Down
2 changes: 1 addition & 1 deletion shared/sys/sys_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ char *Sys_DefaultHomePath( void )
if( !SUCCEEDED( SHGetFolderPath( NULL, CSIDL_PERSONAL, NULL, 0, homeDirectory ) ) )
{
Com_Printf( "Unable to determine your home directory.\n" );
return false;
return NULL;
}

Com_sprintf( homePath, sizeof( homePath ), "%s%cMy Games%c", homeDirectory, PATH_SEP, PATH_SEP );
Expand Down

0 comments on commit 42affd0

Please sign in to comment.