From 1509124dc819fadf68ffc53e2369258bafcda5b5 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Nov 2015 18:55:15 +0100 Subject: Port ui to 1.1 ABI. --- src/ui/ui_main.c | 5 +++ src/ui/ui_public.h | 16 +++---- src/ui/ui_shared.c | 16 +++++++ src/ui/ui_syscalls.asm | 119 ++++++++++++++++++++++++------------------------- src/ui/ui_syscalls.c | 10 ----- 5 files changed, 86 insertions(+), 80 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index dc5bc26..27406b1 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -4211,6 +4211,7 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) // this should be the ONLY way the menu system is brought up // enusure minumum menu data is cached + if( Menu_Count() > 0 ) { vec3_t v; @@ -4667,3 +4668,7 @@ void UI_UpdateNews( qboolean begin ) uiInfo.newsInfo.refreshActive = qfalse; } +void trap_R_SetClipRegion( const float *region ) +{ + // syscall missing in 1.1 +} diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index 0fb2292..f6db76d 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -37,8 +37,7 @@ typedef struct } uiClientState_t; -typedef enum -{ +typedef enum { UI_ERROR, UI_PRINT, UI_MILLISECONDS, @@ -66,7 +65,6 @@ typedef enum UI_R_ADDLIGHTTOSCENE, UI_R_RENDERSCENE, UI_R_SETCOLOR, - UI_R_SETCLIPREGION, UI_R_DRAWSTRETCHPIC, UI_UPDATESCREEN, UI_CM_LERPTAG, @@ -95,6 +93,11 @@ typedef enum UI_MEMORY_REMAINING, UI_R_REGISTERFONT, UI_R_MODELBOUNDS, + UI_PARSE_ADD_GLOBAL_DEFINE, + UI_PARSE_LOAD_SOURCE, + UI_PARSE_FREE_SOURCE, + UI_PARSE_READ_TOKEN, + UI_PARSE_SOURCE_FILE_AND_LINE, UI_S_STOPBACKGROUNDTRACK, UI_S_STARTBACKGROUNDTRACK, UI_REAL_TIME, @@ -122,13 +125,6 @@ typedef enum UI_FS_SEEK, UI_SET_PBCLSTATUS, - 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, - UI_MEMSET = 100, UI_MEMCPY, UI_STRNCPY, diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 7a47413..3b566a7 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -8079,3 +8079,19 @@ static qboolean Menu_OverActiveItem( menuDef_t *menu, float x, float y ) return qfalse; } + + +/* +NOTE: conflicts with the not yet ported cgame + +void trap_R_SetClipRegion( const float *region ) +{ + // syscall missing in 1.1 +} +*/ + +qboolean trap_GetNews( qboolean force ) +{ + // syscall missing in 1.1 + return qfalse; +} diff --git a/src/ui/ui_syscalls.asm b/src/ui/ui_syscalls.asm index 1e797a9..e989ab9 100644 --- a/src/ui/ui_syscalls.asm +++ b/src/ui/ui_syscalls.asm @@ -27,68 +27,67 @@ equ trap_R_AddPolyToScene -24 equ trap_R_AddLightToScene -25 equ trap_R_RenderScene -26 equ trap_R_SetColor -27 -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_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_GetNews -87 equ memset -101 equ memcpy -102 diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c index 2187f18..edfeaf3 100644 --- a/src/ui/ui_syscalls.c +++ b/src/ui/ui_syscalls.c @@ -197,11 +197,6 @@ void trap_R_SetColor( const float *rgba ) syscall( UI_R_SETCOLOR, rgba ); } -void trap_R_SetClipRegion( const float *region ) -{ - syscall( UI_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 ) { syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT( x ), PASSFLOAT( y ), PASSFLOAT( w ), PASSFLOAT( h ), PASSFLOAT( s1 ), PASSFLOAT( t1 ), PASSFLOAT( s2 ), PASSFLOAT( t2 ), hShader ); @@ -327,11 +322,6 @@ int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int ma return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen ); } -qboolean trap_GetNews( qboolean force ) -{ - return syscall( UI_GETNEWS, force ); -} - void trap_LAN_SaveCachedServers( void ) { syscall( UI_LAN_SAVECACHEDSERVERS ); -- cgit 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/ui/ui_main.c | 8 +++++++- src/ui/ui_shared.c | 16 ---------------- src/ui/ui_shared.h | 3 +-- 3 files changed, 8 insertions(+), 19 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 27406b1..0278cca 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -4668,7 +4668,13 @@ void UI_UpdateNews( qboolean begin ) uiInfo.newsInfo.refreshActive = qfalse; } +// missing syscalls + void trap_R_SetClipRegion( const float *region ) { - // syscall missing in 1.1 +} + +qboolean trap_GetNews( qboolean force ) +{ + return qfalse; } diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 3b566a7..7a47413 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -8079,19 +8079,3 @@ static qboolean Menu_OverActiveItem( menuDef_t *menu, float x, float y ) return qfalse; } - - -/* -NOTE: conflicts with the not yet ported cgame - -void trap_R_SetClipRegion( const float *region ) -{ - // syscall missing in 1.1 -} -*/ - -qboolean trap_GetNews( qboolean force ) -{ - // syscall missing in 1.1 - return qfalse; -} diff --git a/src/ui/ui_shared.h b/src/ui/ui_shared.h index 649d51f..6441ce5 100644 --- a/src/ui/ui_shared.h +++ b/src/ui/ui_shared.h @@ -529,8 +529,6 @@ void Controls_GetConfig( void ); void Controls_SetConfig( qboolean restart ); void Controls_SetDefaults( void ); -void trap_R_SetClipRegion( const float *region ); - //for cg_draw.c void Item_Text_Wrapped_Paint( itemDef_t *item ); const char *Item_Text_Wrap( const char *text, float scale, float width ); @@ -556,4 +554,5 @@ int trap_Parse_SourceFileAndLine( int handle, char *filename, int *line ); void BindingFromName( const char *cvar ); extern char g_nameBind1[ 32 ]; extern char g_nameBind2[ 32 ]; + #endif -- cgit From f19c6644a80f8af5c66b8c19eb81a465e4573893 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 5 Dec 2015 18:46:16 +0100 Subject: Fix ui's ABI. --- src/ui/ui_main.c | 10 ++++++++++ src/ui/ui_public.h | 14 +++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 0278cca..424513f 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1366,6 +1366,8 @@ void UI_ParseMenu( const char *menuFile ) handle = trap_Parse_LoadSource( menuFile ); + Com_Printf("^5ui: UI_ParseMenu(%s)\n", menuFile); + if( !handle ) { Com_Printf( S_COLOR_YELLOW "WARNING: Menu file %s not found\n", @@ -1380,6 +1382,8 @@ void UI_ParseMenu( const char *menuFile ) if( !trap_Parse_ReadToken( handle, &token ) ) break; + Com_Printf("^5--- token.string = %s\n", token.string); + //if( Q_stricmp( token, "{" ) ) { // Com_Printf( "Missing { in menu file\n" ); // break; @@ -1395,6 +1399,7 @@ void UI_ParseMenu( const char *menuFile ) if( Q_stricmp( token.string, "assetGlobalDef" ) == 0 ) { + Com_Printf("^5--- assetGlobalDef\n"); if( Asset_Parse( handle ) ) continue; else @@ -1403,6 +1408,7 @@ void UI_ParseMenu( const char *menuFile ) if( Q_stricmp( token.string, "menudef" ) == 0 ) { + Com_Printf("^5--- Menu_New\n"); // start a new menu Menu_New( handle ); } @@ -4211,6 +4217,10 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) // this should be the ONLY way the menu system is brought up // enusure minumum menu data is cached + Com_Printf("^5ui: UI_SetActiveMenu(%i)\n", menu); + Com_Printf("^5--: Menu_Count() = %i\n", Menu_Count()); + + if( Menu_Count() > 0 ) { diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index f6db76d..a70746b 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -171,12 +171,6 @@ typedef enum UI_MOUSE_EVENT, // void UI_MouseEvent( int dx, int dy ); - UI_MOUSE_POSITION, - // int UI_MousePosition( void ); - - UI_SET_MOUSE_POSITION, - // void UI_SetMousePosition( int x, int y ); - UI_REFRESH, // void UI_Refresh( int time ); @@ -189,12 +183,18 @@ typedef enum UI_CONSOLE_COMMAND, // qboolean UI_ConsoleCommand( int realTime ); - UI_DRAW_CONNECT_SCREEN + UI_DRAW_CONNECT_SCREEN, // void UI_DrawConnectScreen( qboolean overlay ); // 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; -- cgit From b084995c8e7392c8f1151b01de21302e1c667a65 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 5 Dec 2015 19:36:05 +0100 Subject: Remove debug messages added in the previous commit. --- src/ui/ui_main.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 424513f..0278cca 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1366,8 +1366,6 @@ void UI_ParseMenu( const char *menuFile ) handle = trap_Parse_LoadSource( menuFile ); - Com_Printf("^5ui: UI_ParseMenu(%s)\n", menuFile); - if( !handle ) { Com_Printf( S_COLOR_YELLOW "WARNING: Menu file %s not found\n", @@ -1382,8 +1380,6 @@ void UI_ParseMenu( const char *menuFile ) if( !trap_Parse_ReadToken( handle, &token ) ) break; - Com_Printf("^5--- token.string = %s\n", token.string); - //if( Q_stricmp( token, "{" ) ) { // Com_Printf( "Missing { in menu file\n" ); // break; @@ -1399,7 +1395,6 @@ void UI_ParseMenu( const char *menuFile ) if( Q_stricmp( token.string, "assetGlobalDef" ) == 0 ) { - Com_Printf("^5--- assetGlobalDef\n"); if( Asset_Parse( handle ) ) continue; else @@ -1408,7 +1403,6 @@ void UI_ParseMenu( const char *menuFile ) if( Q_stricmp( token.string, "menudef" ) == 0 ) { - Com_Printf("^5--- Menu_New\n"); // start a new menu Menu_New( handle ); } @@ -4217,10 +4211,6 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) // this should be the ONLY way the menu system is brought up // enusure minumum menu data is cached - Com_Printf("^5ui: UI_SetActiveMenu(%i)\n", menu); - Com_Printf("^5--: Menu_Count() = %i\n", Menu_Count()); - - if( Menu_Count() > 0 ) { -- cgit