From 65bcf419d4b612b7d626447924fa0fe2079c18c2 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Thu, 18 Jun 2015 14:21:05 +0200 Subject: implement support for creating cgame&ui modules using the 1.1 interfaces --- src/cgame/cg_local.h | 135 +++++++++++++++++++++++++++++++++++++++++++ src/cgame/cg_main.c | 24 ++++++++ src/cgame/cg_public.h | 11 ++++ src/cgame/cg_servercmds.c | 28 +++++++++ src/cgame/cg_snapshot.c | 53 +++++++++++++++++ src/cgame/cg_syscalls.c | 10 ++++ src/cgame/cg_syscalls_11.asm | 114 ++++++++++++++++++++++++++++++++++++ src/ui/ui_main.c | 29 ++++++++++ src/ui/ui_public.h | 13 +++++ src/ui/ui_syscalls.c | 4 ++ src/ui/ui_syscalls_11.asm | 97 +++++++++++++++++++++++++++++++ 11 files changed, 518 insertions(+) create mode 100644 src/cgame/cg_syscalls_11.asm create mode 100644 src/ui/ui_syscalls_11.asm (limited to 'src') diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 0d73474a..f7568a3d 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -2089,9 +2089,144 @@ 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 0adcb549..01df3af7 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -85,8 +85,10 @@ 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 ); @@ -2099,3 +2101,25 @@ qboolean CG_GetRangeMarkerPreferences( qboolean *drawSurface, qboolean *drawInte return qfalse; } +#ifdef MODULE_INTERFACE_11 +int trap_S_SoundDuration( sfxHandle_t handle ) +{ + return 1; +} + +void trap_R_SetClipRegion( const float *region ) +{ +} + +static qboolean keyOverstrikeMode = qfalse; + +void trap_Key_SetOverstrikeMode( qboolean state ) +{ + keyOverstrikeMode = state; +} + +qboolean trap_Key_GetOverstrikeMode( void ) +{ + return keyOverstrikeMode; +} +#endif diff --git a/src/cgame/cg_public.h b/src/cgame/cg_public.h index c7b1931b..1d1c34b9 100644 --- a/src/cgame/cg_public.h +++ b/src/cgame/cg_public.h @@ -120,7 +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, @@ -139,6 +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, @@ -173,6 +182,7 @@ 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, @@ -183,6 +193,7 @@ typedef enum CG_KEY_GETOVERSTRIKEMODE, CG_S_SOUNDDURATION, +#endif CG_MEMSET = 200, CG_MEMCPY, diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index f4fb1d54..c05a9705 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -943,30 +943,58 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) if( cg_teamChatsOnly.integer ) ignore = "[skipnotify]"; +#ifdef MODULE_INTERFACE_11 + CG_Printf( "%s%s%s" S_COLOR_WHITE "%s " S_COLOR_GREEN "%s\n", + ignore, prefix, name, maybeColon, text ); +#else CG_Printf( "%s%s%s" S_COLOR_WHITE "%s %c" S_COLOR_GREEN "%s\n", ignore, prefix, name, maybeColon, INDENT_MARKER, text ); +#endif break; case SAY_TEAM: +#ifdef MODULE_INTERFACE_11 + CG_Printf( "%s%s(%s" S_COLOR_WHITE ")%s%s " S_COLOR_CYAN "%s\n", + ignore, prefix, name, location, maybeColon, text ); +#else CG_Printf( "%s%s(%s" S_COLOR_WHITE ")%s%s %c" S_COLOR_CYAN "%s\n", ignore, prefix, name, location, maybeColon, INDENT_MARKER, text ); +#endif break; case SAY_ADMINS: case SAY_ADMINS_PUBLIC: +#ifdef MODULE_INTERFACE_11 + CG_Printf( "%s%s%s%s" S_COLOR_WHITE "%s " S_COLOR_MAGENTA "%s\n", + ignore, prefix, + ( mode == SAY_ADMINS ) ? "[ADMIN]" : "[PLAYER]", + name, maybeColon, text ); +#else CG_Printf( "%s%s%s%s" S_COLOR_WHITE "%s %c" S_COLOR_MAGENTA "%s\n", ignore, prefix, ( mode == SAY_ADMINS ) ? "[ADMIN]" : "[PLAYER]", name, maybeColon, INDENT_MARKER, text ); +#endif break; case SAY_AREA: +#ifdef MODULE_INTERFACE_11 + CG_Printf( "%s%s<%s" S_COLOR_WHITE ">%s%s " S_COLOR_BLUE "%s\n", + ignore, prefix, name, location, maybeColon, text ); +#else CG_Printf( "%s%s<%s" S_COLOR_WHITE ">%s%s %c" S_COLOR_BLUE "%s\n", ignore, prefix, name, location, maybeColon, INDENT_MARKER, text ); +#endif break; case SAY_PRIVMSG: case SAY_TPRIVMSG: color = ( mode == SAY_TPRIVMSG ) ? S_COLOR_CYAN : S_COLOR_GREEN; +#ifdef MODULE_INTERFACE_11 + CG_Printf( "%s%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %s%s\n", + ignore, prefix, name, cgs.clientinfo[ cg.clientNum ].name, + maybeColon, color, text ); +#else CG_Printf( "%s%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %c%s%s\n", ignore, prefix, name, cgs.clientinfo[ cg.clientNum ].name, maybeColon, INDENT_MARKER, color, text ); +#endif if( !ignore[0] ) { CG_CenterPrint( va( "%sPrivate message from: " S_COLOR_WHITE "%s", diff --git a/src/cgame/cg_snapshot.c b/src/cgame/cg_snapshot.c index 5567884b..1fba0003 100644 --- a/src/cgame/cg_snapshot.c +++ b/src/cgame/cg_snapshot.c @@ -242,6 +242,55 @@ static void CG_SetNextSnap( snapshot_t *snap ) } +#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 + /* ======================== CG_ReadNextSnapshot @@ -273,7 +322,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.c b/src/cgame/cg_syscalls.c index 16e01b8f..023fc3d9 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -292,10 +292,12 @@ sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed ) return syscall( CG_S_REGISTERSOUND, sample, compressed ); } +#ifndef MODULE_INTERFACE_11 int trap_S_SoundDuration( sfxHandle_t handle ) { return syscall( CG_S_SOUNDDURATION, handle ); } +#endif void trap_S_StartBackgroundTrack( const char *intro, const char *loop ) { @@ -382,10 +384,12 @@ void trap_R_SetColor( const float *rgba ) syscall( CG_R_SETCOLOR, rgba ); } +#ifndef MODULE_INTERFACE_11 void trap_R_SetClipRegion( const float *region ) { syscall( CG_R_SETCLIPREGION, region ); } +#endif void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) @@ -424,7 +428,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 ); } @@ -585,6 +593,7 @@ void trap_Key_SetBinding( int keynum, const char *binding ) { syscall( CG_KEY_SETBINDING, keynum, binding ); } +#ifndef MODULE_INTERFACE_11 void trap_Key_SetOverstrikeMode( qboolean state ) { syscall( CG_KEY_SETOVERSTRIKEMODE, state ); } @@ -592,3 +601,4 @@ void trap_Key_SetOverstrikeMode( qboolean state ) { qboolean trap_Key_GetOverstrikeMode( void ) { return syscall( CG_KEY_GETOVERSTRIKEMODE ); } +#endif diff --git a/src/cgame/cg_syscalls_11.asm b/src/cgame/cg_syscalls_11.asm new file mode 100644 index 00000000..13c262cb --- /dev/null +++ b/src/cgame/cg_syscalls_11.asm @@ -0,0 +1,114 @@ +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_VariableStringBuffer -7 +equ trap_Argc -8 +equ trap_Argv -9 +equ trap_Args -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_AddCommand -16 +equ trap_SendClientCommand -17 +equ trap_UpdateScreen -18 +equ trap_CM_LoadMap -19 +equ trap_CM_NumInlineModels -20 +equ trap_CM_InlineModel -21 +equ trap_CM_LoadModel -22 +equ trap_CM_TempBoxModel -23 +equ trap_CM_PointContents -24 +equ trap_CM_TransformedPointContents -25 +equ trap_CM_BoxTrace -26 +equ trap_CM_TransformedBoxTrace -27 +equ trap_CM_MarkFragments -28 +equ trap_S_StartSound -29 +equ trap_S_StartLocalSound -30 +equ trap_S_ClearLoopingSounds -31 +equ trap_S_AddLoopingSound -32 +equ trap_S_UpdateEntityPosition -33 +equ trap_S_Respatialize -34 +equ trap_S_RegisterSound -35 +equ trap_S_StartBackgroundTrack -36 +equ trap_R_LoadWorldMap -37 +equ trap_R_RegisterModel -38 +equ trap_R_RegisterSkin -39 +equ trap_R_RegisterShader -40 +equ trap_R_ClearScene -41 +equ trap_R_AddRefEntityToScene -42 +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 memset -201 +equ memcpy -202 +equ strncpy -203 +equ sin -204 +equ cos -205 +equ atan2 -206 +equ sqrt -207 +equ floor -208 +equ ceil -209 +equ testPrintInt -210 +equ testPrintFloat -211 diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index a542e642..a5b9879e 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 ); @@ -1113,7 +1128,11 @@ static void UI_StartServerRefresh( qboolean full ) { qboolean global = ui_netSource.integer == AS_GLOBAL; +#ifdef MODULE_INTERFACE_11 + trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d 69 full empty\n", +#else trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d 70 full empty\n", +#endif global ? 0 : 1 ) ); } } @@ -4630,3 +4649,13 @@ void UI_UpdateNews( qboolean begin ) uiInfo.newsInfo.refreshActive = qfalse; } +#ifdef MODULE_INTERFACE_11 +void trap_R_SetClipRegion( const float *region ) +{ +} + +qboolean trap_GetNews( qboolean force ) +{ + return qtrue; +} +#endif diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index f1f55c2f..489b2b08 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -66,7 +66,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, @@ -95,6 +97,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, @@ -122,12 +131,14 @@ 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, @@ -175,11 +186,13 @@ 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 ); diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c index 3163322c..b3967867 100644 --- a/src/ui/ui_syscalls.c +++ b/src/ui/ui_syscalls.c @@ -199,10 +199,12 @@ void trap_R_SetColor( const float *rgba ) syscall( UI_R_SETCOLOR, rgba ); } +#ifndef MODULE_INTERFACE_11 void trap_R_SetClipRegion( const float *region ) { syscall( UI_R_SETCLIPREGION, region ); } +#endif void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) { @@ -329,10 +331,12 @@ int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int ma return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen ); } +#ifndef MODULE_INTERFACE_11 qboolean trap_GetNews( qboolean force ) { return syscall( UI_GETNEWS, force ); } +#endif void trap_LAN_SaveCachedServers( void ) { diff --git a/src/ui/ui_syscalls_11.asm b/src/ui/ui_syscalls_11.asm new file mode 100644 index 00000000..cb80264b --- /dev/null +++ b/src/ui/ui_syscalls_11.asm @@ -0,0 +1,97 @@ +code + +equ trap_Error -1 +equ trap_Print -2 +equ trap_Milliseconds -3 +equ trap_Cvar_Set -4 +equ trap_Cvar_VariableValue -5 +equ trap_Cvar_VariableStringBuffer -6 +equ trap_Cvar_SetValue -7 +equ trap_Cvar_Reset -8 +equ trap_Cvar_Create -9 +equ trap_Cvar_InfoStringBuffer -10 +equ trap_Argc -11 +equ trap_Argv -12 +equ trap_Cmd_ExecuteText -13 +equ trap_FS_FOpenFile -14 +equ trap_FS_Read -15 +equ trap_FS_Write -16 +equ trap_FS_FCloseFile -17 +equ trap_FS_GetFileList -18 +equ trap_R_RegisterModel -19 +equ trap_R_RegisterSkin -20 +equ trap_R_RegisterShaderNoMip -21 +equ trap_R_ClearScene -22 +equ trap_R_AddRefEntityToScene -23 +equ trap_R_AddPolyToScene -24 +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 memset -101 +equ memcpy -102 +equ strncpy -103 +equ sin -104 +equ cos -105 +equ atan2 -106 +equ sqrt -107 +equ floor -108 +equ ceil -109 -- cgit