From f324890e9715490c909ca6123948f4157401324c Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Thu, 9 Apr 2020 18:30:35 +0100 Subject: multiprotocol: gamelogic code for 1.1 --- src/cgame/cg_local.h | 136 +++++++++++++++++++++++++++++++++++++++++++ src/cgame/cg_main.c | 5 ++ src/cgame/cg_public.h | 22 +++++++ src/cgame/cg_snapshot.c | 52 +++++++++++++++++ src/cgame/cg_syscalls.asm | 114 +++++++++++++++++++----------------- src/cgame/cg_syscalls.c | 4 ++ src/cgame/cg_syscalls_11.asm | 1 - src/game/g_public.h | 7 ++- src/game/g_syscalls.asm | 121 +++++++++++++++++++------------------- src/qcommon/q_shared.h | 7 ++- src/ui/ui_main.c | 15 +++++ src/ui/ui_public.h | 28 +++++++-- src/ui/ui_syscalls.asm | 118 +++++++++++++++++++------------------ src/ui/ui_syscalls_11.asm | 1 - 14 files changed, 450 insertions(+), 181 deletions(-) (limited to 'src') diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index b405cc6..5f2317d 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -2115,9 +2115,145 @@ void trap_GetGameState( gameState_t *gamestate ); // snapshot latency can be calculated. void trap_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime ); +#ifdef MODULE_INTERFACE_11 +typedef struct { + int commandTime; // cmd->serverTime of last executed command + int pm_type; + int bobCycle; // for view bobbing and footstep generation + int pm_flags; // ducked, jump_held, etc + int pm_time; + + vec3_t origin; + vec3_t velocity; + int weaponTime; + int gravity; + int speed; + int delta_angles[3]; // add to command angles to get view direction + // changed by spawns, rotating objects, and teleporters + + int groundEntityNum;// ENTITYNUM_NONE = in air + + int legsTimer; // don't change low priority animations until this runs out + int legsAnim; // mask off ANIM_TOGGLEBIT + + int torsoTimer; // don't change low priority animations until this runs out + int torsoAnim; // mask off ANIM_TOGGLEBIT + + int movementDir; // a number 0 to 7 that represents the reletive angle + // of movement to the view angle (axial and diagonals) + // when at rest, the value will remain unchanged + // used to twist the legs during strafing + + vec3_t grapplePoint; // location of grapple to pull towards if PMF_GRAPPLE_PULL + + int eFlags; // copied to entityState_t->eFlags + + int eventSequence; // pmove generated events + int events[MAX_PS_EVENTS]; + int eventParms[MAX_PS_EVENTS]; + + int externalEvent; // events set on player from another source + int externalEventParm; + int externalEventTime; + + int clientNum; // ranges from 0 to MAX_CLIENTS-1 + int weapon; // copied to entityState_t->weapon + int weaponstate; + + vec3_t viewangles; // for fixed views + int viewheight; + + // damage feedback + int damageEvent; // when it changes, latch the other parms + int damageYaw; + int damagePitch; + int damageCount; + + int stats[MAX_STATS]; + int persistant[MAX_PERSISTANT]; // stats that aren't cleared on death + int misc[MAX_MISC]; // misc data + int ammo[16]; + + int generic1; + int loopSound; + int otherEntityNum; + + // not communicated over the net at all + int ping; // server to game info for scoreboard + int pmove_framecount; // FIXME: don't transmit over the network + int jumppad_frame; + int entityEventSequence; +} moduleAlternatePlayerState_t; + +typedef struct { + int number; // entity index + int eType; // entityType_t + int eFlags; + + trajectory_t pos; // for calculating position + trajectory_t apos; // for calculating angles + + int time; + int time2; + + vec3_t origin; + vec3_t origin2; + + vec3_t angles; + vec3_t angles2; + + int otherEntityNum; // shotgun sources, etc + int otherEntityNum2; + + int groundEntityNum; // ENTITYNUM_NONE = in air + + int constantLight; // r + (g<<8) + (b<<16) + (intensity<<24) + int loopSound; // constantly loop this sound + + int modelindex; + int modelindex2; + int clientNum; // 0 to (MAX_CLIENTS - 1), for players and corpses + int frame; + + int solid; // for client side prediction, trap_linkentity sets this properly + + int event; // impulse events -- muzzle flashes, footsteps, etc + int eventParm; + + // for players + int misc; // bit flags + int weapon; // determines weapon and flash model, etc + int legsAnim; // mask off ANIM_TOGGLEBIT + int torsoAnim; // mask off ANIM_TOGGLEBIT + + int generic1; +} moduleAlternateEntityState_t; + +typedef struct +{ + int snapFlags; // SNAPFLAG_RATE_DELAYED, etc + int ping; + + int serverTime; // server time the message is valid for (in msec) + + byte areamask[ MAX_MAP_AREA_BYTES ]; // portalarea visibility bits + + moduleAlternatePlayerState_t ps; // complete information about the current player at this time + + int numEntities; // all of the entities that need to be presented + moduleAlternateEntityState_t entities[ MAX_ENTITIES_IN_SNAPSHOT ]; // at the time of this snapshot + + int numServerCommands; // text based server commands to execute when this + int serverCommandSequence; // snapshot becomes current +} moduleAlternateSnapshot_t; + +qboolean trap_GetSnapshot( int snapshotNumber, moduleAlternateSnapshot_t *snapshot ); +#else + // a snapshot get can fail if the snapshot (or the entties it holds) is so // old that it has fallen out of the client system queue qboolean trap_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ); +#endif // retrieve a text command from the server stream // the current snapshot will hold the number of the most recent command diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 11ea540..9af78d1 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -85,6 +85,11 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, CG_EventHandling( arg0 ); return 0; +#ifndef MODULE_INTERFACE_11 + case CG_VOIP_STRING: + return (intptr_t)CG_VoIPString( ); +#endif + default: CG_Error( "vmMain: unknown command %i", command ); break; diff --git a/src/cgame/cg_public.h b/src/cgame/cg_public.h index 75b4b48..f4ef9b6 100644 --- a/src/cgame/cg_public.h +++ b/src/cgame/cg_public.h @@ -120,6 +120,9 @@ typedef enum CG_R_ADDLIGHTTOSCENE, CG_R_RENDERSCENE, CG_R_SETCOLOR, +#ifndef MODULE_INTERFACE_11 + CG_R_SETCLIPREGION, +#endif CG_R_DRAWSTRETCHPIC, CG_R_MODELBOUNDS, CG_R_LERPTAG, @@ -138,11 +141,13 @@ typedef enum CG_KEY_GETCATCHER, CG_KEY_SETCATCHER, CG_KEY_GETKEY, +#ifdef MODULE_INTERFACE_11 CG_PARSE_ADD_GLOBAL_DEFINE, CG_PARSE_LOAD_SOURCE, CG_PARSE_FREE_SOURCE, CG_PARSE_READ_TOKEN, CG_PARSE_SOURCE_FILE_AND_LINE, +#endif CG_S_STOPBACKGROUNDTRACK, CG_REAL_TIME, CG_SNAPVECTOR, @@ -177,6 +182,19 @@ typedef enum CG_KEY_GETBINDINGBUF, CG_KEY_SETBINDING, +#ifndef MODULE_INTERFACE_11 + 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, +#endif + CG_MEMSET = 200, CG_MEMCPY, CG_STRNCPY, @@ -246,6 +264,10 @@ 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_snapshot.c b/src/cgame/cg_snapshot.c index 673558d..d69da95 100644 --- a/src/cgame/cg_snapshot.c +++ b/src/cgame/cg_snapshot.c @@ -241,6 +241,54 @@ static void CG_SetNextSnap( snapshot_t *snap ) CG_BuildSolidList( ); } +#ifdef MODULE_INTERFACE_11 +static moduleAlternateSnapshot_t moduleAlternateSnapshot; + +static qboolean CG_GetModuleAlternateSnapshot( int snapshotNumber, snapshot_t *snap ) +{ + moduleAlternateSnapshot_t *alt = &moduleAlternateSnapshot; + int r = trap_GetSnapshot( snapshotNumber, alt ); + + if( r ) + { + int i; + + snap->snapFlags = alt->snapFlags; + snap->ping = alt->ping; + snap->serverTime = alt->serverTime; + snap->numEntities = alt->numEntities; + snap->numServerCommands = alt->numServerCommands; + snap->serverCommandSequence = alt->serverCommandSequence; + memcpy( &snap->areamask, &alt->areamask, sizeof( snap->areamask ) ); + +#define PSFO(x) ((size_t)&(((playerState_t*)0)->x)) + memcpy( &snap->ps.commandTime, &alt->ps.commandTime, PSFO(tauntTimer) - PSFO(commandTime) ); + memcpy( &snap->ps.movementDir, &alt->ps.movementDir, PSFO(ammo) - PSFO(movementDir) ); + memcpy( &snap->ps.generic1, &alt->ps.generic1, PSFO(entityEventSequence) - PSFO(generic1) ); + + snap->ps.weaponAnim = alt->ps.ammo[0] & 0xFF; + snap->ps.pm_flags |= ( alt->ps.ammo[0] & 0xFF00 ) << 8; + snap->ps.ammo = alt->ps.ammo[1] & 0xFFF; + snap->ps.clips = ( alt->ps.ammo[1] & 0xF000 ) >> 12; + snap->ps.tauntTimer = alt->ps.ammo[2] & 0xFFF; + snap->ps.generic1 |= ( alt->ps.ammo[2] & 0x3000 ) >> 4; + + for( i = 0; i < alt->numEntities; ++i ) + { + entityState_t *s = &snap->entities[ i ]; + const moduleAlternateEntityState_t *a = &alt->entities[ i ]; + +#define ESFO(x) ((size_t)&(((entityState_t*)0)->x)) + memcpy( &s->number, &a->number, ESFO(weaponAnim) - ESFO(number) ); + + s->weaponAnim = 0; + s->generic1 = a->generic1; + } + } + + return r; +} +#endif /* ======================== @@ -273,7 +321,11 @@ static snapshot_t *CG_ReadNextSnapshot( void ) // try to read the snapshot from the client system cgs.processedSnapshotNum++; +#ifdef MODULE_INTERFACE_11 + r = CG_GetModuleAlternateSnapshot( cgs.processedSnapshotNum, dest ); +#else r = trap_GetSnapshot( cgs.processedSnapshotNum, dest ); +#endif // FIXME: why would trap_GetSnapshot return a snapshot with the same server time if( cg.snap && r && dest->serverTime == cg.snap->serverTime ) diff --git a/src/cgame/cg_syscalls.asm b/src/cgame/cg_syscalls.asm index 0893ebc..2537c91 100644 --- a/src/cgame/cg_syscalls.asm +++ b/src/cgame/cg_syscalls.asm @@ -46,60 +46,66 @@ equ trap_R_AddPolyToScene -43 equ trap_R_AddLightToScene -44 equ trap_R_RenderScene -45 equ trap_R_SetColor -46 -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 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 memset -201 equ memcpy -202 diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c index 321783a..c716a81 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -412,7 +412,11 @@ void trap_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime ) syscall( CG_GETCURRENTSNAPSHOTNUMBER, snapshotNumber, serverTime ); } +#ifdef MODULE_INTERFACE_11 +qboolean trap_GetSnapshot( int snapshotNumber, moduleAlternateSnapshot_t *snapshot ) +#else qboolean trap_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) +#endif { return syscall( CG_GETSNAPSHOT, snapshotNumber, snapshot ); } diff --git a/src/cgame/cg_syscalls_11.asm b/src/cgame/cg_syscalls_11.asm index 0893ebc..8876f47 100644 --- a/src/cgame/cg_syscalls_11.asm +++ b/src/cgame/cg_syscalls_11.asm @@ -112,4 +112,3 @@ equ floor -208 equ ceil -209 equ testPrintInt -210 equ testPrintFloat -211 - diff --git a/src/game/g_public.h b/src/game/g_public.h index effbe37..9512574 100644 --- a/src/game/g_public.h +++ b/src/game/g_public.h @@ -159,6 +159,8 @@ typedef enum { G_GET_CONFIGSTRING, // ( int num, char *buffer, int bufferSize ); + G_SET_CONFIGSTRING_RESTRICTIONS, // ( int num, const clientList* clientList ); + G_GET_USERINFO, // ( int num, char *buffer, int bufferSize ); // userinfo strings are maintained by the server system, so they // are persistant across level loads, while all other game visible @@ -224,7 +226,10 @@ typedef enum { G_PARSE_READ_TOKEN, G_PARSE_SOURCE_FILE_AND_LINE, - G_SEND_GAMESTAT + G_SEND_GAMESTAT, + + G_ADDCOMMAND, + G_REMOVECOMMAND } gameImport_t; diff --git a/src/game/g_syscalls.asm b/src/game/g_syscalls.asm index 132ca1e..242c2ad 100644 --- a/src/game/g_syscalls.asm +++ b/src/game/g_syscalls.asm @@ -1,65 +1,68 @@ code -equ trap_Print -1 -equ trap_Error -2 -equ trap_Milliseconds -3 -equ trap_Cvar_Register -4 -equ trap_Cvar_Update -5 -equ trap_Cvar_Set -6 -equ trap_Cvar_VariableIntegerValue -7 -equ trap_Cvar_VariableStringBuffer -8 -equ trap_Argc -9 -equ trap_Argv -10 -equ trap_FS_FOpenFile -11 -equ trap_FS_Read -12 -equ trap_FS_Write -13 -equ trap_FS_FCloseFile -14 -equ trap_SendConsoleCommand -15 -equ trap_LocateGameData -16 -equ trap_DropClient -17 -equ trap_SendServerCommand -18 -equ trap_SetConfigstring -19 -equ trap_GetConfigstring -20 -equ trap_GetUserinfo -21 -equ trap_SetUserinfo -22 -equ trap_GetServerinfo -23 -equ trap_SetBrushModel -24 -equ trap_Trace -25 -equ trap_PointContents -26 -equ trap_InPVS -27 -equ trap_InPVSIgnorePortals -28 -equ trap_AdjustAreaPortalState -29 -equ trap_AreasConnected -30 -equ trap_LinkEntity -31 -equ trap_UnlinkEntity -32 -equ trap_EntitiesInBox -33 -equ trap_EntityContact -34 -equ trap_GetUsercmd -35 -equ trap_GetEntityToken -36 -equ trap_FS_GetFileList -37 -equ trap_RealTime -38 -equ trap_SnapVector -39 -equ trap_TraceCapsule -40 -equ trap_EntityContactCapsule -41 -equ trap_FS_Seek -42 +equ trap_Printf -1 +equ trap_Error -2 +equ trap_Milliseconds -3 +equ trap_Cvar_Register -4 +equ trap_Cvar_Update -5 +equ trap_Cvar_Set -6 +equ trap_Cvar_VariableIntegerValue -7 +equ trap_Cvar_VariableStringBuffer -8 +equ trap_Argc -9 +equ trap_Argv -10 +equ trap_FS_FOpenFile -11 +equ trap_FS_Read -12 +equ trap_FS_Write -13 +equ trap_FS_FCloseFile -14 +equ trap_SendConsoleCommand -15 +equ trap_LocateGameData -16 +equ trap_DropClient -17 +equ trap_SendServerCommand -18 +equ trap_SetConfigstring -19 +equ trap_GetConfigstring -20 +equ trap_SetConfigstringRestrictions -21 +equ trap_GetUserinfo -22 +equ trap_SetUserinfo -23 +equ trap_GetServerinfo -24 +equ trap_SetBrushModel -25 +equ trap_Trace -26 +equ trap_PointContents -27 +equ trap_InPVS -28 +equ trap_InPVSIgnorePortals -29 +equ trap_AdjustAreaPortalState -30 +equ trap_AreasConnected -31 +equ trap_LinkEntity -32 +equ trap_UnlinkEntity -33 +equ trap_EntitiesInBox -34 +equ trap_EntityContact -35 +equ trap_GetUsercmd -36 +equ trap_GetEntityToken -37 +equ trap_FS_GetFileList -38 +equ trap_RealTime -39 +equ trap_SnapVector -40 +equ trap_TraceCapsule -41 +equ trap_EntityContactCapsule -42 +equ trap_FS_Seek -43 -equ trap_Parse_AddGlobalDefine -43 -equ trap_Parse_LoadSource -44 -equ trap_Parse_FreeSource -45 -equ trap_Parse_ReadToken -46 -equ trap_Parse_SourceFileAndLine -47 +equ trap_Parse_AddGlobalDefine -44 +equ trap_Parse_LoadSource -45 +equ trap_Parse_FreeSource -46 +equ trap_Parse_ReadToken -47 +equ trap_Parse_SourceFileAndLine -48 -equ trap_SendGameStat -48 +equ trap_SendGameStat -49 +equ trap_AddCommand -50 +equ trap_RemoveCommand -51 -equ memset -101 -equ memcpy -102 -equ strncpy -103 -equ sin -104 -equ cos -105 -equ atan2 -106 -equ sqrt -107 -equ floor -111 -equ ceil -112 -equ testPrintInt -113 -equ testPrintFloat -114 +equ memset -101 +equ memcpy -102 +equ strncpy -103 +equ sin -104 +equ cos -105 +equ atan2 -106 +equ sqrt -107 +equ floor -111 +equ ceil -112 +equ testPrintInt -113 +equ testPrintFloat -114 diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index 1b5fea7..68742d9 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define CLIENT_WINDOW_TITLE "Tremulous " PRODUCT_VERSION #define CLIENT_WINDOW_MIN_TITLE "Tremulous" -#define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION +#define Q3_VERSION "tremulous gpp" #define GAMENAME_FOR_MASTER "Tremulous" #define HEARTBEAT_FOR_MASTER GAMENAME_FOR_MASTER @@ -1132,6 +1132,10 @@ typedef struct playerState_s { int torsoTimer; // don't change low priority animations until this runs out int torsoAnim; // mask off ANIM_TOGGLEBIT + int tauntTimer; // don't allow another taunt until this runs out + + int weaponAnim; // mask off ANIM_TOGGLEBIT + int movementDir; // a number 0 to 7 that represents the reletive angle // of movement to the view angle (axial and diagonals) // when at rest, the value will remain unchanged @@ -1286,6 +1290,7 @@ typedef struct entityState_s { int weapon; // determines weapon and flash model, etc int legsAnim; // mask off ANIM_TOGGLEBIT int torsoAnim; // mask off ANIM_TOGGLEBIT + int weaponAnim; // mask off ANIM_TOGGLEBIT int generic1; } entityState_t; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 096253a..d694381 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -33,11 +33,24 @@ USER INTERFACE MAIN uiInfo_t uiInfo; +#ifdef MODULE_INTERFACE_11 +#undef AS_GLOBAL +#undef AS_LOCAL +#define AS_GLOBAL 2 +#define AS_LOCAL 0 +#endif + static const char *netSources[ ] = { +#ifdef MODULE_INTERFACE_11 + "LAN", + "Mplayer", + "Internet", +#else "Internet", "Mplayer", "LAN", +#endif "Favorites" }; @@ -163,12 +176,14 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, UI_MouseEvent( arg0, arg1 ); return 0; +#ifndef MODULE_INTERFACE_11 case UI_MOUSE_POSITION: return UI_MousePosition( ); case UI_SET_MOUSE_POSITION: UI_SetMousePosition( arg0, arg1 ); return 0; +#endif case UI_REFRESH: UI_Refresh( arg0 ); diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index a70746b..364adcf 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -65,6 +65,9 @@ typedef enum { UI_R_ADDLIGHTTOSCENE, UI_R_RENDERSCENE, UI_R_SETCOLOR, +#ifndef MODULE_INTERFACE_11 + UI_R_SETCLIPREGION, +#endif UI_R_DRAWSTRETCHPIC, UI_UPDATESCREEN, UI_CM_LERPTAG, @@ -93,11 +96,13 @@ typedef enum { UI_MEMORY_REMAINING, UI_R_REGISTERFONT, UI_R_MODELBOUNDS, +#ifdef MODULE_INTERFACE_11 UI_PARSE_ADD_GLOBAL_DEFINE, UI_PARSE_LOAD_SOURCE, UI_PARSE_FREE_SOURCE, UI_PARSE_READ_TOKEN, UI_PARSE_SOURCE_FILE_AND_LINE, +#endif UI_S_STOPBACKGROUNDTRACK, UI_S_STARTBACKGROUNDTRACK, UI_REAL_TIME, @@ -125,6 +130,15 @@ typedef enum { UI_FS_SEEK, UI_SET_PBCLSTATUS, +#ifndef MODULE_INTERFACE_11 + UI_PARSE_ADD_GLOBAL_DEFINE, + UI_PARSE_LOAD_SOURCE, + UI_PARSE_FREE_SOURCE, + UI_PARSE_READ_TOKEN, + UI_PARSE_SOURCE_FILE_AND_LINE, + UI_GETNEWS, +#endif + UI_MEMSET = 100, UI_MEMCPY, UI_STRNCPY, @@ -171,6 +185,14 @@ typedef enum UI_MOUSE_EVENT, // void UI_MouseEvent( int dx, int dy ); +#ifndef MODULE_INTERFACE_11 + UI_MOUSE_POSITION, +// int UI_MousePosition( void ); + + UI_SET_MOUSE_POSITION, +// void UI_SetMousePosition( int x, int y ); +#endif + UI_REFRESH, // void UI_Refresh( int time ); @@ -189,12 +211,6 @@ typedef enum // if !overlay, the background will be drawn, otherwise it will be // overlayed over whatever the cgame has drawn. // a GetClientState syscall will be made to get the current strings - - UI_MOUSE_POSITION, - // int UI_MousePosition( void ); - - UI_SET_MOUSE_POSITION - // void UI_SetMousePosition( int x, int y ); } uiExport_t; diff --git a/src/ui/ui_syscalls.asm b/src/ui/ui_syscalls.asm index e989ab9..f8ff938 100644 --- a/src/ui/ui_syscalls.asm +++ b/src/ui/ui_syscalls.asm @@ -28,66 +28,68 @@ equ trap_R_AddLightToScene -25 equ trap_R_RenderScene -26 equ trap_R_SetColor -27 -equ trap_R_DrawStretchPic -28 -equ trap_UpdateScreen -29 -equ trap_CM_LerpTag -30 -equ trap_CM_LoadModel -31 -equ trap_S_RegisterSound -32 -equ trap_S_StartLocalSound -33 -equ trap_Key_KeynumToStringBuf -34 -equ trap_Key_GetBindingBuf -35 -equ trap_Key_SetBinding -36 -equ trap_Key_IsDown -37 -equ trap_Key_GetOverstrikeMode -38 -equ trap_Key_SetOverstrikeMode -39 -equ trap_Key_ClearStates -40 -equ trap_Key_GetCatcher -41 -equ trap_Key_SetCatcher -42 -equ trap_GetClipboardData -43 -equ trap_GetGlconfig -44 -equ trap_GetClientState -45 -equ trap_GetConfigString -46 -equ trap_LAN_GetPingQueueCount -47 -equ trap_LAN_ClearPing -48 -equ trap_LAN_GetPing -49 -equ trap_LAN_GetPingInfo -50 -equ trap_Cvar_Register -51 -equ trap_Cvar_Update -52 -equ trap_MemoryRemaining -53 -equ trap_R_RegisterFont -54 -equ trap_R_ModelBounds -55 -equ trap_Parse_AddGlobalDefine -56 -equ trap_Parse_LoadSource -57 -equ trap_Parse_FreeSource -58 -equ trap_Parse_ReadToken -59 -equ trap_Parse_SourceFileAndLine -60 -equ trap_S_StopBackgroundTrack -61 -equ trap_S_StartBackgroundTrack -62 -equ trap_RealTime -63 -equ trap_LAN_GetServerCount -64 -equ trap_LAN_GetServerAddressString -65 -equ trap_LAN_GetServerInfo -66 -equ trap_LAN_MarkServerVisible -67 -equ trap_LAN_UpdateVisiblePings -68 -equ trap_LAN_ResetPings -69 -equ trap_LAN_LoadCachedServers -70 -equ trap_LAN_SaveCachedServers -71 -equ trap_LAN_AddServer -72 -equ trap_LAN_RemoveServer -73 -equ trap_CIN_PlayCinematic -74 -equ trap_CIN_StopCinematic -75 -equ trap_CIN_RunCinematic -76 -equ trap_CIN_DrawCinematic -77 -equ trap_CIN_SetExtents -78 -equ trap_R_RemapShader -79 -equ trap_LAN_ServerStatus -80 -equ trap_LAN_GetServerPing -81 -equ trap_LAN_ServerIsVisible -82 -equ trap_LAN_CompareServers -83 -equ trap_FS_Seek -84 -equ trap_SetPbClStatus -85 +equ trap_R_SetClipRegion -28 +equ trap_R_DrawStretchPic -29 +equ trap_UpdateScreen -30 +equ trap_CM_LerpTag -31 +equ trap_CM_LoadModel -32 +equ trap_S_RegisterSound -33 +equ trap_S_StartLocalSound -34 +equ trap_Key_KeynumToStringBuf -35 +equ trap_Key_GetBindingBuf -36 +equ trap_Key_SetBinding -37 +equ trap_Key_IsDown -38 +equ trap_Key_GetOverstrikeMode -39 +equ trap_Key_SetOverstrikeMode -40 +equ trap_Key_ClearStates -41 +equ trap_Key_GetCatcher -42 +equ trap_Key_SetCatcher -43 +equ trap_GetClipboardData -44 +equ trap_GetGlconfig -45 +equ trap_GetClientState -46 +equ trap_GetConfigString -47 +equ trap_LAN_GetPingQueueCount -48 +equ trap_LAN_ClearPing -49 +equ trap_LAN_GetPing -50 +equ trap_LAN_GetPingInfo -51 +equ trap_Cvar_Register -52 +equ trap_Cvar_Update -53 +equ trap_MemoryRemaining -54 +equ trap_R_RegisterFont -55 +equ trap_R_ModelBounds -56 +equ trap_S_StopBackgroundTrack -57 +equ trap_S_StartBackgroundTrack -58 +equ trap_RealTime -59 +equ trap_LAN_GetServerCount -60 +equ trap_LAN_GetServerAddressString -61 +equ trap_LAN_GetServerInfo -62 +equ trap_LAN_MarkServerVisible -63 +equ trap_LAN_UpdateVisiblePings -64 +equ trap_LAN_ResetPings -65 +equ trap_LAN_LoadCachedServers -66 +equ trap_LAN_SaveCachedServers -67 +equ trap_LAN_AddServer -68 +equ trap_LAN_RemoveServer -69 +equ trap_CIN_PlayCinematic -70 +equ trap_CIN_StopCinematic -71 +equ trap_CIN_RunCinematic -72 +equ trap_CIN_DrawCinematic -73 +equ trap_CIN_SetExtents -74 +equ trap_R_RemapShader -75 +equ trap_LAN_ServerStatus -76 +equ trap_LAN_GetServerPing -77 +equ trap_LAN_ServerIsVisible -78 +equ trap_LAN_CompareServers -79 +equ trap_FS_Seek -80 +equ trap_SetPbClStatus -81 +equ trap_Parse_AddGlobalDefine -82 +equ trap_Parse_LoadSource -83 +equ trap_Parse_FreeSource -84 +equ trap_Parse_ReadToken -85 +equ trap_Parse_SourceFileAndLine -86 +equ trap_GetNews -87 equ memset -101 equ memcpy -102 diff --git a/src/ui/ui_syscalls_11.asm b/src/ui/ui_syscalls_11.asm index 64d2ca3..cb80264 100644 --- a/src/ui/ui_syscalls_11.asm +++ b/src/ui/ui_syscalls_11.asm @@ -95,4 +95,3 @@ equ atan2 -106 equ sqrt -107 equ floor -108 equ ceil -109 - -- cgit