From b86cbd75d8ff0e1606c041b5ed77c340cb802715 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Nov 2015 19:58:18 +0100 Subject: Port cgame and game to 1.1 ABI. --- src/cgame/cg_main.c | 18 ++++++-- src/cgame/cg_public.h | 21 ++------- src/cgame/cg_syscalls.asm | 114 ++++++++++++++++++++++------------------------ src/cgame/cg_syscalls.c | 18 -------- 4 files changed, 74 insertions(+), 97 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 2761922..11ea540 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -85,9 +85,6 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, CG_EventHandling( arg0 ); return 0; - case CG_VOIP_STRING: - return (intptr_t)CG_VoIPString( ); - default: CG_Error( "vmMain: unknown command %i", command ); break; @@ -2055,3 +2052,18 @@ static char *CG_VoIPString( void ) return voipString; } +// missing syscalls + +void trap_R_SetClipRegion( const float *region ) +{ +} + +void trap_Key_SetOverstrikeMode( qboolean state ) +{ +} + +qboolean trap_Key_GetOverstrikeMode( void ) +{ + return qfalse; +} + diff --git a/src/cgame/cg_public.h b/src/cgame/cg_public.h index 9d197ff..75b4b48 100644 --- a/src/cgame/cg_public.h +++ b/src/cgame/cg_public.h @@ -120,7 +120,6 @@ typedef enum CG_R_ADDLIGHTTOSCENE, CG_R_RENDERSCENE, CG_R_SETCOLOR, - CG_R_SETCLIPREGION, CG_R_DRAWSTRETCHPIC, CG_R_MODELBOUNDS, CG_R_LERPTAG, @@ -139,6 +138,11 @@ typedef enum CG_KEY_GETCATCHER, CG_KEY_SETCATCHER, CG_KEY_GETKEY, + CG_PARSE_ADD_GLOBAL_DEFINE, + CG_PARSE_LOAD_SOURCE, + CG_PARSE_FREE_SOURCE, + CG_PARSE_READ_TOKEN, + CG_PARSE_SOURCE_FILE_AND_LINE, CG_S_STOPBACKGROUNDTRACK, CG_REAL_TIME, CG_SNAPVECTOR, @@ -173,17 +177,6 @@ typedef enum CG_KEY_GETBINDINGBUF, CG_KEY_SETBINDING, - CG_PARSE_ADD_GLOBAL_DEFINE, - CG_PARSE_LOAD_SOURCE, - CG_PARSE_FREE_SOURCE, - CG_PARSE_READ_TOKEN, - CG_PARSE_SOURCE_FILE_AND_LINE, - - CG_KEY_SETOVERSTRIKEMODE, - CG_KEY_GETOVERSTRIKEMODE, - - CG_S_SOUNDDURATION, - CG_MEMSET = 200, CG_MEMCPY, CG_STRNCPY, @@ -253,10 +246,6 @@ typedef enum // void (*CG_ConsoleText)( void ); // pass text that has been printed to the console to cgame // use Cmd_Argc() / Cmd_Argv() to read it - - CG_VOIP_STRING - // char *(*CG_VoIPString)( void ); - // returns a string of comma-delimited clientnums based on cl_voipSendTarget } cgameExport_t; //---------------------------------------------- diff --git a/src/cgame/cg_syscalls.asm b/src/cgame/cg_syscalls.asm index 2537c91..0893ebc 100644 --- a/src/cgame/cg_syscalls.asm +++ b/src/cgame/cg_syscalls.asm @@ -46,66 +46,60 @@ equ trap_R_AddPolyToScene -43 equ trap_R_AddLightToScene -44 equ trap_R_RenderScene -45 equ trap_R_SetColor -46 -equ trap_R_SetClipRegion -47 -equ trap_R_DrawStretchPic -48 -equ trap_R_ModelBounds -49 -equ trap_R_LerpTag -50 -equ trap_GetGlconfig -51 -equ trap_GetGameState -52 -equ trap_GetCurrentSnapshotNumber -53 -equ trap_GetSnapshot -54 -equ trap_GetServerCommand -55 -equ trap_GetCurrentCmdNumber -56 -equ trap_GetUserCmd -57 -equ trap_SetUserCmdValue -58 -equ trap_R_RegisterShaderNoMip -59 -equ trap_MemoryRemaining -60 -equ trap_R_RegisterFont -61 -equ trap_Key_IsDown -62 -equ trap_Key_GetCatcher -63 -equ trap_Key_SetCatcher -64 -equ trap_Key_GetKey -65 -equ trap_S_StopBackgroundTrack -66 -equ trap_RealTime -67 -equ trap_SnapVector -68 -equ trap_RemoveCommand -69 -equ trap_R_LightForPoint -70 -equ trap_CIN_PlayCinematic -71 -equ trap_CIN_StopCinematic -72 -equ trap_CIN_RunCinematic -73 -equ trap_CIN_DrawCinematic -74 -equ trap_CIN_SetExtents -75 -equ trap_R_RemapShader -76 -equ trap_S_AddRealLoopingSound -77 -equ trap_S_StopLoopingSound -78 -equ trap_CM_TempCapsuleModel -79 -equ trap_CM_CapsuleTrace -80 -equ trap_CM_TransformedCapsuleTrace -81 -equ trap_R_AddAdditiveLightToScene -82 -equ trap_GetEntityToken -83 -equ trap_R_AddPolysToScene -84 -equ trap_R_inPVS -85 -equ trap_FS_Seek -86 -equ trap_FS_GetFileList -87 -equ trap_LiteralArgs -88 -equ trap_CM_BiSphereTrace -89 -equ trap_CM_TransformedBiSphereTrace -90 -equ trap_GetDemoState -91 -equ trap_GetDemoPos -92 -equ trap_GetDemoName -93 -equ trap_Key_KeynumToStringBuf -94 -equ trap_Key_GetBindingBuf -95 -equ trap_Key_SetBinding -96 - -equ trap_Parse_AddGlobalDefine -97 -equ trap_Parse_LoadSource -98 -equ trap_Parse_FreeSource -99 -equ trap_Parse_ReadToken -100 -equ trap_Parse_SourceFileAndLine -101 -equ trap_Key_SetOverstrikeMode -102 -equ trap_Key_GetOverstrikeMode -103 - -equ trap_S_SoundDuration -104 +equ trap_R_DrawStretchPic -47 +equ trap_R_ModelBounds -48 +equ trap_R_LerpTag -49 +equ trap_GetGlconfig -50 +equ trap_GetGameState -51 +equ trap_GetCurrentSnapshotNumber -52 +equ trap_GetSnapshot -53 +equ trap_GetServerCommand -54 +equ trap_GetCurrentCmdNumber -55 +equ trap_GetUserCmd -56 +equ trap_SetUserCmdValue -57 +equ trap_R_RegisterShaderNoMip -58 +equ trap_MemoryRemaining -59 +equ trap_R_RegisterFont -60 +equ trap_Key_IsDown -61 +equ trap_Key_GetCatcher -62 +equ trap_Key_SetCatcher -63 +equ trap_Key_GetKey -64 +equ trap_Parse_AddGlobalDefine -65 +equ trap_Parse_LoadSource -66 +equ trap_Parse_FreeSource -67 +equ trap_Parse_ReadToken -68 +equ trap_Parse_SourceFileAndLine -69 +equ trap_S_StopBackgroundTrack -70 +equ trap_RealTime -71 +equ trap_SnapVector -72 +equ trap_RemoveCommand -73 +equ trap_R_LightForPoint -74 +equ trap_CIN_PlayCinematic -75 +equ trap_CIN_StopCinematic -76 +equ trap_CIN_RunCinematic -77 +equ trap_CIN_DrawCinematic -78 +equ trap_CIN_SetExtents -79 +equ trap_R_RemapShader -80 +equ trap_S_AddRealLoopingSound -81 +equ trap_S_StopLoopingSound -82 +equ trap_CM_TempCapsuleModel -83 +equ trap_CM_CapsuleTrace -84 +equ trap_CM_TransformedCapsuleTrace -85 +equ trap_R_AddAdditiveLightToScene -86 +equ trap_GetEntityToken -87 +equ trap_R_AddPolysToScene -88 +equ trap_R_inPVS -89 +equ trap_FS_Seek -90 +equ trap_FS_GetFileList -91 +equ trap_LiteralArgs -92 +equ trap_CM_BiSphereTrace -93 +equ trap_CM_TransformedBiSphereTrace -94 +equ trap_GetDemoState -95 +equ trap_GetDemoPos -96 +equ trap_GetDemoName -97 +equ trap_Key_KeynumToStringBuf -98 +equ trap_Key_GetBindingBuf -99 +equ trap_Key_SetBinding -100 equ memset -201 equ memcpy -202 diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c index 0c0b722..321783a 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -290,11 +290,6 @@ sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed ) return syscall( CG_S_REGISTERSOUND, sample, compressed ); } -int trap_S_SoundDuration( sfxHandle_t handle ) -{ - return syscall( CG_S_SOUNDDURATION, handle ); -} - void trap_S_StartBackgroundTrack( const char *intro, const char *loop ) { syscall( CG_S_STARTBACKGROUNDTRACK, intro, loop ); @@ -380,11 +375,6 @@ void trap_R_SetColor( const float *rgba ) syscall( CG_R_SETCOLOR, rgba ); } -void trap_R_SetClipRegion( const float *region ) -{ - syscall( CG_R_SETCLIPREGION, region ); -} - void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) { @@ -582,11 +572,3 @@ void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) { void trap_Key_SetBinding( int keynum, const char *binding ) { syscall( CG_KEY_SETBINDING, keynum, binding ); } - -void trap_Key_SetOverstrikeMode( qboolean state ) { - syscall( CG_KEY_SETOVERSTRIKEMODE, state ); -} - -qboolean trap_Key_GetOverstrikeMode( void ) { - return syscall( CG_KEY_GETOVERSTRIKEMODE ); -} -- cgit From 3108bde4738357e3fec209e1deb7f20cf6663c6d Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Nov 2015 20:29:30 +0100 Subject: Port to 1.1 network protocol. --- src/cgame/cg_buildable.c | 6 +++--- src/cgame/cg_draw.c | 2 +- src/cgame/cg_ents.c | 3 ++- src/cgame/cg_local.h | 2 -- src/cgame/cg_weapons.c | 23 ----------------------- 5 files changed, 6 insertions(+), 30 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 5b2582c..e2e33f8 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -709,7 +709,7 @@ static void CG_BuildableParticleEffects( centity_t *cent ) { entityState_t *es = ¢->currentState; team_t team = BG_Buildable( es->modelindex )->team; - int health = es->generic1; + int health = es->constantLight; float healthFrac = (float)health / BG_Buildable( es->modelindex )->health; if( !( es->eFlags & EF_B_SPAWNED ) ) @@ -1055,7 +1055,7 @@ static void CG_BuildableStatusDisplay( centity_t *cent ) return; } - health = es->generic1; + health = es->constantLight; healthScale = (float)health / BG_Buildable( es->modelindex )->health; if( health > 0 && healthScale < 0.01f ) @@ -1535,7 +1535,7 @@ void CG_Buildable( centity_t *cent ) trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, weapon->readySound ); } - health = es->generic1; + health = es->constantLight; if( health < cent->lastBuildableHealth && ( es->eFlags & EF_B_SPAWNED ) ) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 4e2ba77..1d18023 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -4072,7 +4072,7 @@ static void CG_DrawHealthBars( void ) if( CG_PlayerIsBuilder( es->modelindex ) ) continue; - bar->value = es->generic1; + bar->value = es->constantLight; bar->max = BG_Buildable( es->modelindex )->health; BG_BuildableBoundingBox( es->modelindex, mins, maxs ); break; diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index a9663ad..13e0470 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -236,7 +236,8 @@ static void CG_EntityEffects( centity_t *cent ) // constant light glow - if ( cent->currentState.constantLight ) + if ( cent->currentState.eType == ET_MOVER && + cent->currentState.constantLight ) { int cl; int i, r, g, b; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 7721e45..b405cc6 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1072,8 +1072,6 @@ typedef struct int itemPickupBlendTime; // the pulse around the crosshair is timed seperately int weaponSelectTime; - int weaponAnimation; - int weaponAnimationTime; // blend blobs float damageTime; diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 7fb68c9..f57eb41 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -745,27 +745,6 @@ static void CG_SetWeaponLerpFrameAnimation( weapon_t weapon, lerpFrame_t *lf, in CG_Printf( "Anim: %i\n", newAnimation ); } -/* -=============== -CG_WeaponAnimation -=============== -*/ -static void CG_WeaponAnimation( centity_t *cent, int *old, int *now, float *backLerp ) -{ - lerpFrame_t *lf = ¢->pe.weapon; - entityState_t *es = ¢->currentState; - - // see if the animation sequence is switching - if( es->weaponAnim != lf->animationNumber || !lf->animation ) - CG_SetWeaponLerpFrameAnimation( es->weapon, lf, es->weaponAnim ); - - CG_RunLerpFrame( lf, 1.0f ); - - *old = lf->oldFrame; - *now = lf->frame; - *backLerp = lf->backlerp; -} - /* ================= CG_MapTorsoToWeaponFrame @@ -1073,8 +1052,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent gun.customShader = cgs.media.invisibleShaderTeam; } - CG_WeaponAnimation( cent, &gun.oldframe, &gun.frame, &gun.backlerp ); - trap_R_AddRefEntityToScene( &gun ); if( !ps ) -- cgit From a52341666bfb66192cad23c0719447a1776ac207 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 5 Dec 2015 20:57:04 +0100 Subject: Fix menu backgrounds and get rid of chat garbage. --- src/cgame/cg_servercmds.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index c2be336..e59cf8a 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -1012,12 +1012,12 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) switch( mode ) { case SAY_ALL: - CG_Printf( "%s%s" S_COLOR_WHITE "%s %c" S_COLOR_GREEN "%s\n", - prefix, name, maybeColon, INDENT_MARKER, text ); + CG_Printf( "%s%s" S_COLOR_WHITE "%s " S_COLOR_GREEN "%s\n", + prefix, name, maybeColon, text ); break; case SAY_TEAM: - CG_Printf( "%s(%s" S_COLOR_WHITE ")%s%s %c" S_COLOR_CYAN "%s\n", - prefix, name, location, maybeColon, INDENT_MARKER, text ); + CG_Printf( "%s(%s" S_COLOR_WHITE ")%s%s " S_COLOR_CYAN "%s\n", + prefix, name, location, maybeColon, text ); break; case SAY_ADMINS: case SAY_ADMINS_PUBLIC: @@ -1027,15 +1027,15 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) name, maybeColon, INDENT_MARKER, text ); break; case SAY_AREA: - CG_Printf( "%s<%s" S_COLOR_WHITE ">%s%s %c" S_COLOR_BLUE "%s\n", - prefix, name, location, maybeColon, INDENT_MARKER, text ); + CG_Printf( "%s<%s" S_COLOR_WHITE ">%s%s " S_COLOR_BLUE "%s\n", + prefix, name, location, maybeColon, text ); break; case SAY_PRIVMSG: case SAY_TPRIVMSG: color = ( mode == SAY_TPRIVMSG ) ? S_COLOR_CYAN : S_COLOR_GREEN; - CG_Printf( "%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %c%s%s\n", + CG_Printf( "%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %s%s\n", prefix, name, cgs.clientinfo[ cg.clientNum ].name, - maybeColon, INDENT_MARKER, color, text ); + maybeColon, color, text ); CG_CenterPrint( va( "%sPrivate message from: " S_COLOR_WHITE "%s", color, name ), 200, GIANTCHAR_WIDTH * 4 ); break; -- cgit