ioq3 updates

This commit is contained in:
OM 2023-05-26 20:53:00 +02:00
parent f013e82b98
commit dc45c33c79
65 changed files with 1660 additions and 301 deletions

View file

@ -89,11 +89,12 @@ file(GLOB_RECURSE SOURCES_BG "code/game/bg_*.cpp")
### Platform-specific code
if(WIN32)
set(SOURCES_PLATFORM_SPECIFIC
WIN32
#WIN32
"code/sys/con_log.c"
"code/sys/sys_autoupdater.c"
"code/sys/sys_main.c"
"code/sys/new/sys_main_new.c"
"code/sys/new/sys_win32_new.c"
"code/sys/con_win32.c"
"code/sys/sys_win32.c"
"code/sys/win_resource.rc"
@ -109,6 +110,7 @@ else()
"code/sys/sys_autoupdater.c"
"code/sys/sys_main.c"
"code/sys/new/sys_main_new.c"
"code/sys/new/sys_unix_new.c"
"code/sys/con_tty.c"
"code/sys/sys_unix.c"
# These are still used even they're prefixed 'win'
@ -235,7 +237,7 @@ if (WITH_CLIENT)
file(GLOB_RECURSE SOURCES_CLIENT "code/client/*.c" "code/client/*.cpp" "code/qcommon/puff.c")
file(GLOB_RECURSE SOURCES_UILIB "code/uilib/*.c" "code/uilib/*.cpp")
file(GLOB_RECURSE SOURCES_RENDERER "code/renderer/*.c" "code/renderer/*.cpp")
file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderer/*.c" "code/renderer/*.cpp")
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
set(SOURCES_CLIENT_APP ${SOURCES_APP} ${SOURCES_SERVER} ${SOURCES_CLIENT} ${SOURCES_UILIB} ${SOURCES_LIBS} ${SOURCES_RENDERER})
@ -256,22 +258,40 @@ if (WITH_CLIENT)
if (MSVC)
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
#add_library(sdl2 SHARED IMPORTED)
#set_target_properties(sdl2 PROPERTIES
# IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/SDL2.lib"
#)
#
#add_library(sdl2main SHARED IMPORTED)
#set_target_properties(sdl2main PROPERTIES
# IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/SDL2main.lib"
#)
#
#add_library(glew32 SHARED IMPORTED)
#set_target_properties(glew32 PROPERTIES
# IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/glew32.lib"
#)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
add_library(sdl2 SHARED IMPORTED)
set_target_properties(sdl2 PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win64/SDL2.lib"
)
target_link_libraries(openmohaa PRIVATE opengl32)
add_library(sdl2main SHARED IMPORTED)
set_target_properties(sdl2main PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win64/SDL2main.lib"
)
add_library(glew32 SHARED IMPORTED)
set_target_properties(glew32 PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/glew32.lib"
)
else()
add_library(sdl2 SHARED IMPORTED)
set_target_properties(sdl2 PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/SDL2.lib"
)
add_library(sdl2main SHARED IMPORTED)
set_target_properties(sdl2main PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win32/SDL2main.lib"
)
add_library(glew32 SHARED IMPORTED)
set_target_properties(glew32 PROPERTIES
IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/code/libs/win64/glew32.lib"
)
endif()
#target_link_libraries(openmohaa PRIVATE opengl32)
target_link_libraries(openmohaa PRIVATE sdl2 sdl2main glew32)
endif()
target_link_libraries(openmohaa PRIVATE wsock32 ws2_32)

View file

@ -828,7 +828,7 @@ void CL_InitCGame( void ) {
S_BeginRegistration();
CL_ShutdownCGame();
CL_InitCGameDLL( &cgi, &cge );
cls.state = CA_LOADING;
clc.state = CA_LOADING;
if( !com_sv_running->integer && !cls.vid_restart )
{
@ -852,7 +852,7 @@ void CL_InitCGame( void ) {
// we will send a usercmd this frame, which
// will cause the server to send us the first snapshot
cls.state = CA_PRIMED;
clc.state = CA_PRIMED;
CL_EndRegistration();
@ -995,7 +995,7 @@ void CL_FirstSnapshot( void ) {
if ( cl.snap.snapFlags & SNAPFLAG_NOT_ACTIVE ) {
return;
}
cls.state = CA_ACTIVE;
clc.state = CA_ACTIVE;
// notify the UI
UI_ServerLoaded();
@ -1033,8 +1033,8 @@ CL_SetCGameTime
*/
void CL_SetCGameTime( void ) {
// getting a valid frame message ends the connection process
if ( cls.state != CA_ACTIVE ) {
if ( cls.state != CA_PRIMED ) {
if ( clc.state != CA_ACTIVE ) {
if ( clc.state != CA_PRIMED ) {
return;
}
if ( clc.demoplaying ) {
@ -1050,7 +1050,7 @@ void CL_SetCGameTime( void ) {
cl.newSnapshots = qfalse;
CL_FirstSnapshot();
}
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
return;
}
}
@ -1172,7 +1172,7 @@ void CL_SetCGameTime( void ) {
// feed another messag, which should change
// the contents of cl.snap
CL_ReadDemoMessage();
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
return; // end of demo
}
}

View file

@ -1274,7 +1274,7 @@ static void RoQShutdown( void ) {
}
if (cinTable[currentHandle].alterGameState) {
cls.state = CA_DISCONNECTED;
clc.state = CA_DISCONNECTED;
// we can't just do a vstr nextmap, because
// if we are aborting the intro cinematic with
// a devmap command, nextmap would be valid by
@ -1307,7 +1307,7 @@ e_status CIN_StopCinematic(int handle) {
}
if (cinTable[currentHandle].alterGameState) {
if ( cls.state != CA_CINEMATIC ) {
if ( clc.state != CA_CINEMATIC ) {
return cinTable[currentHandle].status;
}
}
@ -1348,7 +1348,7 @@ e_status CIN_RunCinematic (int handle)
currentHandle = handle;
if (cinTable[currentHandle].alterGameState) {
if ( cls.state != CA_CINEMATIC ) {
if ( clc.state != CA_CINEMATIC ) {
return cinTable[currentHandle].status;
}
}
@ -1465,7 +1465,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
Com_DPrintf("trFMV::play(), playing %s\n", arg);
if (cinTable[currentHandle].alterGameState) {
cls.state = CA_CINEMATIC;
clc.state = CA_CINEMATIC;
}
if (!cinTable[currentHandle].silent) {
@ -1598,7 +1598,7 @@ void CL_PlayCinematic_f(void) {
int bits = CIN_system;
Com_DPrintf("CL_PlayCinematic_f\n");
if (cls.state == CA_CINEMATIC) {
if (clc.state == CA_CINEMATIC) {
SCR_StopCinematic();
}

View file

@ -675,7 +675,7 @@ void CL_CreateNewCommands( void ) {
int cmdNum;
// no need to create usercmds until we have a gamestate
if ( cls.state < CA_PRIMED ) {
if ( clc.state < CA_PRIMED ) {
return;
}
@ -751,7 +751,7 @@ qboolean CL_ReadyToSendPacket( void ) {
int delta;
// don't send anything if playing back a demo
if ( clc.demoplaying || cls.state == CA_CINEMATIC ) {
if ( clc.demoplaying || clc.state == CA_CINEMATIC ) {
return qfalse;
}
@ -763,8 +763,8 @@ qboolean CL_ReadyToSendPacket( void ) {
// if we don't have a valid gamestate yet, only send
// one packet a second
if ( cls.state != CA_ACTIVE &&
cls.state != CA_PRIMED &&
if ( clc.state != CA_ACTIVE &&
clc.state != CA_PRIMED &&
!*clc.downloadTempName &&
cls.realtime - clc.lastPacketSentTime < 1000 ) {
return qfalse;
@ -829,7 +829,7 @@ void CL_WritePacket( void ) {
usereyes_t eyeInfo;
// don't send anything if playing back a demo
if ( clc.demoplaying || cls.state == CA_CINEMATIC ) {
if ( clc.demoplaying || clc.state == CA_CINEMATIC ) {
return;
}
@ -949,7 +949,7 @@ Called every frame to builds and sends a command packet to the server.
*/
void CL_SendCmd( void ) {
// don't send any message if not connected
if ( cls.state < CA_CONNECTED ) {
if ( clc.state < CA_CONNECTED ) {
return;
}

View file

@ -41,11 +41,11 @@ int chat_playerNum;
qboolean key_overstrikeMode;
int anykeydown;
qkey_t keys[K_LASTKEY];
qkey_t altkeys[K_LASTKEY];
qkey_t ctrlkeys[K_LASTKEY];
qkey_t keys[MAX_KEYS];
qkey_t altkeys[MAX_KEYS];
qkey_t ctrlkeys[MAX_KEYS];
qboolean menubound[K_LASTKEY];
qboolean menubound[MAX_KEYS];
qboolean alt_down;
qboolean ctrl_down;
@ -55,7 +55,6 @@ typedef struct {
int keynum;
} keyname_t;
// names not in this list can either be lowercase ascii, or '0xnn' hex sequences
keyname_t keynames[] =
{
@ -69,22 +68,15 @@ keyname_t keynames[] =
{"LEFTARROW", K_LEFTARROW},
{"RIGHTARROW", K_RIGHTARROW},
{"LALT", K_LALT},
{"ALT", K_LALT},
// wombat: mohaa knows LCTRL and RCTRL, LSHIFT, RSHIFT
{"LCTRL", K_LCTRL},
{"CTRL", K_LCTRL},
{"LSHIFT", K_LSHIFT},
{"SHIFT", K_LSHIFT},
{"RALT", K_RALT},
{"RCTRL", K_RCTRL},
{"RSHIFT", K_RSHIFT},
{"ALT", K_ALT},
{"CTRL", K_CTRL},
{"SHIFT", K_SHIFT},
{"COMMAND", K_COMMAND},
{"CAPSLOCK", K_CAPSLOCK},
{"F1", K_F1},
{"F2", K_F2},
{"F3", K_F3},
@ -187,12 +179,152 @@ keyname_t keynames[] =
{"KP_EQUALS", K_KP_EQUALS },
{"PAUSE", K_PAUSE},
{"SEMICOLON", ';'}, // because a raw semicolon separates commands
{"SEMICOLON", ';'}, // because a raw semicolon seperates commands
{"WORLD_0", K_WORLD_0},
{"WORLD_1", K_WORLD_1},
{"WORLD_2", K_WORLD_2},
{"WORLD_3", K_WORLD_3},
{"WORLD_4", K_WORLD_4},
{"WORLD_5", K_WORLD_5},
{"WORLD_6", K_WORLD_6},
{"WORLD_7", K_WORLD_7},
{"WORLD_8", K_WORLD_8},
{"WORLD_9", K_WORLD_9},
{"WORLD_10", K_WORLD_10},
{"WORLD_11", K_WORLD_11},
{"WORLD_12", K_WORLD_12},
{"WORLD_13", K_WORLD_13},
{"WORLD_14", K_WORLD_14},
{"WORLD_15", K_WORLD_15},
{"WORLD_16", K_WORLD_16},
{"WORLD_17", K_WORLD_17},
{"WORLD_18", K_WORLD_18},
{"WORLD_19", K_WORLD_19},
{"WORLD_20", K_WORLD_20},
{"WORLD_21", K_WORLD_21},
{"WORLD_22", K_WORLD_22},
{"WORLD_23", K_WORLD_23},
{"WORLD_24", K_WORLD_24},
{"WORLD_25", K_WORLD_25},
{"WORLD_26", K_WORLD_26},
{"WORLD_27", K_WORLD_27},
{"WORLD_28", K_WORLD_28},
{"WORLD_29", K_WORLD_29},
{"WORLD_30", K_WORLD_30},
{"WORLD_31", K_WORLD_31},
{"WORLD_32", K_WORLD_32},
{"WORLD_33", K_WORLD_33},
{"WORLD_34", K_WORLD_34},
{"WORLD_35", K_WORLD_35},
{"WORLD_36", K_WORLD_36},
{"WORLD_37", K_WORLD_37},
{"WORLD_38", K_WORLD_38},
{"WORLD_39", K_WORLD_39},
{"WORLD_40", K_WORLD_40},
{"WORLD_41", K_WORLD_41},
{"WORLD_42", K_WORLD_42},
{"WORLD_43", K_WORLD_43},
{"WORLD_44", K_WORLD_44},
{"WORLD_45", K_WORLD_45},
{"WORLD_46", K_WORLD_46},
{"WORLD_47", K_WORLD_47},
{"WORLD_48", K_WORLD_48},
{"WORLD_49", K_WORLD_49},
{"WORLD_50", K_WORLD_50},
{"WORLD_51", K_WORLD_51},
{"WORLD_52", K_WORLD_52},
{"WORLD_53", K_WORLD_53},
{"WORLD_54", K_WORLD_54},
{"WORLD_55", K_WORLD_55},
{"WORLD_56", K_WORLD_56},
{"WORLD_57", K_WORLD_57},
{"WORLD_58", K_WORLD_58},
{"WORLD_59", K_WORLD_59},
{"WORLD_60", K_WORLD_60},
{"WORLD_61", K_WORLD_61},
{"WORLD_62", K_WORLD_62},
{"WORLD_63", K_WORLD_63},
{"WORLD_64", K_WORLD_64},
{"WORLD_65", K_WORLD_65},
{"WORLD_66", K_WORLD_66},
{"WORLD_67", K_WORLD_67},
{"WORLD_68", K_WORLD_68},
{"WORLD_69", K_WORLD_69},
{"WORLD_70", K_WORLD_70},
{"WORLD_71", K_WORLD_71},
{"WORLD_72", K_WORLD_72},
{"WORLD_73", K_WORLD_73},
{"WORLD_74", K_WORLD_74},
{"WORLD_75", K_WORLD_75},
{"WORLD_76", K_WORLD_76},
{"WORLD_77", K_WORLD_77},
{"WORLD_78", K_WORLD_78},
{"WORLD_79", K_WORLD_79},
{"WORLD_80", K_WORLD_80},
{"WORLD_81", K_WORLD_81},
{"WORLD_82", K_WORLD_82},
{"WORLD_83", K_WORLD_83},
{"WORLD_84", K_WORLD_84},
{"WORLD_85", K_WORLD_85},
{"WORLD_86", K_WORLD_86},
{"WORLD_87", K_WORLD_87},
{"WORLD_88", K_WORLD_88},
{"WORLD_89", K_WORLD_89},
{"WORLD_90", K_WORLD_90},
{"WORLD_91", K_WORLD_91},
{"WORLD_92", K_WORLD_92},
{"WORLD_93", K_WORLD_93},
{"WORLD_94", K_WORLD_94},
{"WORLD_95", K_WORLD_95},
{ "LWINKEY", K_LWINKEY },
{ "RWINKEY", K_RWINKEY },
{ "MENUKEY", K_MENUKEY },
{"WINDOWS", K_SUPER},
{"COMPOSE", K_COMPOSE},
{"MODE", K_MODE},
{"HELP", K_HELP},
{"PRINT", K_PRINT},
{"SYSREQ", K_SYSREQ},
{"SCROLLOCK", K_SCROLLOCK },
{"BREAK", K_BREAK},
{"MENU", K_MENU},
{"POWER", K_POWER},
{"EURO", K_EURO},
{"UNDO", K_UNDO},
{"PAD0_A", K_PAD0_A },
{"PAD0_B", K_PAD0_B },
{"PAD0_X", K_PAD0_X },
{"PAD0_Y", K_PAD0_Y },
{"PAD0_BACK", K_PAD0_BACK },
{"PAD0_GUIDE", K_PAD0_GUIDE },
{"PAD0_START", K_PAD0_START },
{"PAD0_LEFTSTICK_CLICK", K_PAD0_LEFTSTICK_CLICK },
{"PAD0_RIGHTSTICK_CLICK", K_PAD0_RIGHTSTICK_CLICK },
{"PAD0_LEFTSHOULDER", K_PAD0_LEFTSHOULDER },
{"PAD0_RIGHTSHOULDER", K_PAD0_RIGHTSHOULDER },
{"PAD0_DPAD_UP", K_PAD0_DPAD_UP },
{"PAD0_DPAD_DOWN", K_PAD0_DPAD_DOWN },
{"PAD0_DPAD_LEFT", K_PAD0_DPAD_LEFT },
{"PAD0_DPAD_RIGHT", K_PAD0_DPAD_RIGHT },
{"PAD0_LEFTSTICK_LEFT", K_PAD0_LEFTSTICK_LEFT },
{"PAD0_LEFTSTICK_RIGHT", K_PAD0_LEFTSTICK_RIGHT },
{"PAD0_LEFTSTICK_UP", K_PAD0_LEFTSTICK_UP },
{"PAD0_LEFTSTICK_DOWN", K_PAD0_LEFTSTICK_DOWN },
{"PAD0_RIGHTSTICK_LEFT", K_PAD0_RIGHTSTICK_LEFT },
{"PAD0_RIGHTSTICK_RIGHT", K_PAD0_RIGHTSTICK_RIGHT },
{"PAD0_RIGHTSTICK_UP", K_PAD0_RIGHTSTICK_UP },
{"PAD0_RIGHTSTICK_DOWN", K_PAD0_RIGHTSTICK_DOWN },
{"PAD0_LEFTTRIGGER", K_PAD0_LEFTTRIGGER },
{"PAD0_RIGHTTRIGGER", K_PAD0_RIGHTTRIGGER },
{"PAD0_MISC1", K_PAD0_MISC1 },
{"PAD0_PADDLE1", K_PAD0_PADDLE1 },
{"PAD0_PADDLE2", K_PAD0_PADDLE2 },
{"PAD0_PADDLE3", K_PAD0_PADDLE3 },
{"PAD0_PADDLE4", K_PAD0_PADDLE4 },
{"PAD0_TOUCHPAD", K_PAD0_TOUCHPAD },
{NULL,0}
};
@ -240,7 +372,7 @@ Key_IsDown
===================
*/
qboolean Key_IsDown( int keynum ) {
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return qfalse;
}
@ -322,7 +454,7 @@ const char *Key_KeynumToString( int keynum ) {
return "<KEY NOT FOUND>";
}
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return "<OUT OF RANGE>";
}
@ -369,7 +501,7 @@ const char *Key_KeynumToBindString( int keynum ) {
return "Not Bound";
}
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return "Out of Range";
}
@ -397,7 +529,7 @@ Key_SetBinding
===================
*/
void Key_SetBinding( int keynum, const char *binding ) {
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return;
}
@ -420,7 +552,7 @@ Key_SetAltBinding
===================
*/
void Key_SetAltBinding( int keynum, const char *binding ) {
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return;
}
@ -443,7 +575,7 @@ Key_SetCtrlBinding
===================
*/
void Key_SetCtrlBinding( int keynum, const char *binding ) {
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return;
}
@ -467,7 +599,7 @@ Key_GetBinding
===================
*/
const char *Key_GetBinding( int keynum ) {
if ( keynum < 0 || keynum >= K_LASTKEY ) {
if ( keynum < 0 || keynum >= MAX_KEYS ) {
return "";
}
@ -484,7 +616,7 @@ int Key_GetKey(const char *binding) {
int i;
if (binding) {
for (i=0 ; i < K_LASTKEY ; i++) {
for (i=0 ; i < MAX_KEYS ; i++) {
if (keys[i].binding && Q_stricmp(binding, keys[i].binding) == 0) {
return i;
}
@ -501,7 +633,7 @@ Key_GetKeynameForCommand
const char *Key_GetKeynameForCommand( const char *command ) {
int i;
for( i = 0; i < K_LASTKEY; i++ ) {
for( i = 0; i < MAX_KEYS; i++ ) {
if( !keys[ i ].binding ) {
continue;
}
@ -523,7 +655,7 @@ void Key_GetKeysForCommand( const char *command, int *key1, int *key2 ) {
*key1 = *key2 = -1;
for( i = 0; i < K_LASTKEY; i++ ) {
for( i = 0; i < MAX_KEYS; i++ ) {
if( !keys[ i ].binding ) {
continue;
}
@ -622,7 +754,7 @@ void Key_Unbindall_f (void)
{
int i;
for (i=0 ; i < K_LASTKEY; i++)
for (i=0 ; i < MAX_KEYS; i++)
if (keys[i].binding)
Key_SetBinding (i, "");
}
@ -775,7 +907,7 @@ void Key_WriteBindings( fileHandle_t f ) {
FS_Printf (f, "unbindall\n" );
for (i=0 ; i<K_LASTKEY ; i++) {
for (i=0 ; i<MAX_KEYS ; i++) {
if (keys[i].binding && keys[i].binding[0] ) {
FS_Printf (f, "bind %s \"%s\"\n", Key_KeynumToString(i), keys[i].binding);
@ -794,7 +926,7 @@ Key_Bindlist_f
void Key_Bindlist_f( void ) {
int i;
for ( i = 0 ; i < K_LASTKEY ; i++ ) {
for ( i = 0 ; i < MAX_KEYS ; i++ ) {
if ( keys[i].binding && keys[i].binding[0] ) {
Com_Printf( "%s \"%s\"\n", Key_KeynumToString(i), keys[i].binding );
}
@ -810,7 +942,7 @@ Key_AltBindlist_f
void Key_AltBindlist_f( void ) {
int i;
for ( i = 0 ; i < K_LASTKEY ; i++ ) {
for ( i = 0 ; i < MAX_KEYS ; i++ ) {
if ( altkeys[i].binding && altkeys[i].binding[0] ) {
Com_Printf( "%s \"%s\"\n", Key_KeynumToString(i), altkeys[i].binding );
}
@ -826,7 +958,7 @@ Key_CtrlBindlist_f
void Key_CtrlBindlist_f( void ) {
int i;
for ( i = 0 ; i < K_LASTKEY ; i++ ) {
for ( i = 0 ; i < MAX_KEYS ; i++ ) {
if ( ctrlkeys[i].binding && ctrlkeys[i].binding[0] ) {
Com_Printf( "%s \"%s\"\n", Key_KeynumToString(i), ctrlkeys[i].binding );
}
@ -939,11 +1071,11 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
}
}
if( ( key == K_LALT || key == K_INS ) && cl_altbindings->integer ) {
if( ( key == K_ALT || key == K_INS ) && cl_altbindings->integer ) {
alt_down = down;
}
if( ( key == K_LCTRL || key == K_DEL ) && cl_ctrlbindings->integer ) {
if( ( key == K_CTRL || key == K_DEL ) && cl_ctrlbindings->integer ) {
ctrl_down = down;
}
@ -953,7 +1085,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
return;
}
if( cls.state > CA_DISCONNECTED && cge && !Key_GetCatcher() && cge->CG_CheckCaptureKey( key, down, time ) && key != K_ESCAPE )
if( clc.state > CA_DISCONNECTED && cge && !Key_GetCatcher() && cge->CG_CheckCaptureKey( key, down, time ) && key != K_ESCAPE )
{
if( key != '`' && key != '~' )
return;
@ -969,7 +1101,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
{
UI_ToggleConsole();
}
else if( cls.state == CA_ACTIVE )
else if( clc.state == CA_ACTIVE )
{
if( cg_gametype->integer ) {
UI_ToggleDMConsole( 300 );
@ -980,10 +1112,10 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
if( down )
{
if( alt_down && key != K_LALT && key != K_INS ) {
if( alt_down && key != K_ALT && key != K_INS ) {
altkeys[ key ].down = down;
}
if( down && ctrl_down && key != K_LCTRL ) {
if( down && ctrl_down && key != K_CTRL ) {
ctrlkeys[ key ].down = down;
}
}
@ -996,7 +1128,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
{
if (down)
{
if (keys[K_LALT].down)
if (keys[K_ALT].down)
{
Key_ClearStates();
Cvar_SetValue( "r_fullscreen",
@ -1022,7 +1154,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
{
// keys can still be used for bound actions
if (down && (key <= K_BACKSPACE || key == K_MOUSE4) &&
( clc.demoplaying || cls.state == CA_CINEMATIC ) && Key_GetCatcher() == 0 ) {
( clc.demoplaying || clc.state == CA_CINEMATIC ) && Key_GetCatcher() == 0 ) {
Cvar_Set( "nextdemo", "" );
key = K_ESCAPE;
}
@ -1033,7 +1165,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
qboolean wasup = UI_MenuUp();
UI_DeactiveFloatingWindows();
if( cls.state == CA_CINEMATIC )
if( clc.state == CA_CINEMATIC )
{
SCR_StopCinematic();
return;
@ -1049,12 +1181,12 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
return;
}
if( cl.snap.ps.stats[ STAT_CINEMATIC ] & 1 && cls.state == CA_ACTIVE ) {
if( cl.snap.ps.stats[ STAT_CINEMATIC ] & 1 && clc.state == CA_ACTIVE ) {
Cbuf_AddText( "skipcinematic\n" );
return;
}
if( cls.state <= CA_DISCONNECTED || cls.state == CA_ACTIVE ) {
if( clc.state <= CA_DISCONNECTED || clc.state == CA_ACTIVE ) {
UI_MenuEscape( "main" );
}
return;
@ -1064,7 +1196,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
UI_KeyEvent( key, time );
} else if( cls.loading & KEYCATCH_MESSAGE ) {
Message_Key( key );
} else if( cls.state != CA_DISCONNECTED || menubound[key]) {
} else if( clc.state != CA_DISCONNECTED || menubound[key]) {
// send the bound action
kb = altkeys[ key ].binding;
if( !kb || !altkeys[ key ].down ) {
@ -1172,7 +1304,7 @@ void Key_ClearStates (void)
anykeydown = 0;
for ( i=0 ; i < K_LASTKEY ; i++ ) {
for ( i=0 ; i < MAX_KEYS ; i++ ) {
if ( keys[i].down ) {
CL_KeyEvent( i, qfalse, 0 );

View file

@ -345,7 +345,7 @@ void CL_Record_f( void ) {
return;
}
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
Com_Printf ("You must be in a level to record.\n");
return;
}
@ -693,12 +693,12 @@ void CL_PlayDemo_f( void ) {
UI_CloseConsole();
cls.state = CA_CONNECTED;
clc.state = CA_CONNECTED;
clc.demoplaying = qtrue;
Q_strncpyz( cls.servername, Cmd_Argv(1), sizeof( cls.servername ) );
// read demo messages until connected
while ( cls.state >= CA_CONNECTED && cls.state < CA_PRIMED ) {
while ( clc.state >= CA_CONNECTED && clc.state < CA_PRIMED ) {
CL_ReadDemoMessage();
}
// don't get the first snapshot this frame, to prevent the long
@ -814,8 +814,8 @@ void CL_MapLoading( qboolean flush, const char *pszMapName ) {
if (pszMapName) {
// if we are already connected to the local host, stay connected
if (cls.state >= CA_CONNECTED && !Q_stricmp(cls.servername, "localhost")) {
cls.state = CA_CONNECTED; // so the connect screen is drawn
if (clc.state >= CA_CONNECTED && !Q_stricmp(cls.servername, "localhost")) {
clc.state = CA_CONNECTED; // so the connect screen is drawn
Com_Memset(cls.updateInfoString, 0, sizeof(cls.updateInfoString));
Com_Memset(clc.serverMessage, 0, sizeof(clc.serverMessage));
Com_Memset(&cl.gameState, 0, sizeof(cl.gameState));
@ -826,7 +826,7 @@ void CL_MapLoading( qboolean flush, const char *pszMapName ) {
Cvar_Set("nextmap", "");
CL_Disconnect(qtrue);
Q_strncpyz(cls.servername, "localhost", sizeof(cls.servername));
cls.state = CA_CHALLENGING; // so the connect screen is drawn
clc.state = CA_CHALLENGING; // so the connect screen is drawn
clc.connectStartTime = cls.realtime;
clc.connectTime = -RETRANSMIT_TIMEOUT;
NET_StringToAdr(cls.servername, &clc.serverAddress);
@ -922,7 +922,7 @@ void CL_Disconnect( qboolean showMainMenu ) {
// send a disconnect message to the server
// send it a few times in case one is dropped
if ( cls.state >= CA_CONNECTED ) {
if ( clc.state >= CA_CONNECTED ) {
CL_AddReliableCommand( "disconnect" );
CL_WritePacket();
CL_WritePacket();
@ -934,7 +934,7 @@ void CL_Disconnect( qboolean showMainMenu ) {
// wipe the client connection
Com_Memset( &clc, 0, sizeof( clientConnection_t ) );
cls.state = CA_DISCONNECTED;
clc.state = CA_DISCONNECTED;
// allow cheats locally
Cvar_Set( "sv_cheats", "1" );
@ -971,7 +971,7 @@ void CL_ForwardCommandToServer( const char *string ) {
return;
}
if ( clc.demoplaying || cls.state < CA_CONNECTED || cmd[0] == '+' ) {
if ( clc.demoplaying || clc.state < CA_CONNECTED || cmd[0] == '+' ) {
Com_Printf ("Unknown command \"%s" S_COLOR_WHITE "\"\n", cmd);
return;
}
@ -1118,7 +1118,7 @@ CL_ForwardToServer_f
==================
*/
void CL_ForwardToServer_f( void ) {
if ( cls.state != CA_ACTIVE || clc.demoplaying ) {
if ( clc.state != CA_ACTIVE || clc.demoplaying ) {
Com_Printf ("Not connected to a server.\n");
return;
}
@ -1172,7 +1172,7 @@ CL_Disconnect_f
void CL_Disconnect_f( void ) {
SCR_StopCinematic();
Cvar_Set("ui_singlePlayerActive", "0");
if ( cls.state != CA_DISCONNECTED && cls.state != CA_CINEMATIC ) {
if ( clc.state != CA_DISCONNECTED && clc.state != CA_CINEMATIC ) {
Com_Error (ERR_DISCONNECT, "Disconnected from server");
}
}
@ -1230,7 +1230,7 @@ void CL_Connect( const char *server ) {
if( !NET_StringToAdr( cls.servername, &clc.serverAddress ) ) {
Com_Printf( "Bad server address\n" );
cls.state = CA_DISCONNECTED;
clc.state = CA_DISCONNECTED;
return;
}
if( clc.serverAddress.port == 0 ) {
@ -1247,10 +1247,10 @@ void CL_Connect( const char *server ) {
// with the cd key
// wombat: no authorization in mohaa. need to send challenge to server though
if( NET_IsLocalAddress( clc.serverAddress ) ) {
cls.state = CA_CHALLENGING;
clc.state = CA_CHALLENGING;
}
else {
cls.state = CA_CONNECTING;
clc.state = CA_CONNECTING;
}
clc.connectTime = -99999; // CL_CheckForResend() will fire immediately
@ -1373,7 +1373,7 @@ void CL_Rcon_f( void ) {
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=543
Q_strcat (message, MAX_RCON_MESSAGE, Cmd_Cmd()+5);
if ( cls.state >= CA_CONNECTED ) {
if ( clc.state >= CA_CONNECTED ) {
to = clc.netchan.remoteAddress;
} else {
if (!strlen(rconAddress->string)) {
@ -1426,7 +1426,7 @@ void CL_ResetPureClientAtServer( void ) {
}
qboolean CL_Allowed_Vid_Restart() {
return cls.state == CA_DISCONNECTED || cls.state == CA_ACTIVE;
return clc.state == CA_DISCONNECTED || clc.state == CA_ACTIVE;
}
/*
@ -1534,7 +1534,7 @@ void CL_Configstrings_f( void ) {
int i;
int ofs;
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
Com_Printf( "Not connected to a server.\n");
return;
}
@ -1555,7 +1555,7 @@ CL_Clientinfo_f
*/
void CL_Clientinfo_f( void ) {
Com_Printf( "--------- Client Information ---------\n" );
Com_Printf( "state: %i\n", cls.state );
Com_Printf( "state: %i\n", clc.state );
Com_Printf( "Server: %s\n", cls.servername );
Com_Printf ("User info settings:\n");
Info_Print( Cvar_InfoString( CVAR_USERINFO ) );
@ -1606,7 +1606,7 @@ void CL_DownloadsComplete( void ) {
}
// let the client game init and load data
cls.state = CA_LOADING;
clc.state = CA_LOADING;
CL_StartHunkUsers();
// Pump the loop, this may change gamestate!
@ -1762,7 +1762,7 @@ void CL_InitDownloads(void) {
if ( *clc.downloadList ) {
// if autodownloading is not enabled on the server
cls.state = CA_CONNECTED;
clc.state = CA_CONNECTED;
CL_NextDownload();
return;
}
@ -1790,7 +1790,7 @@ void CL_CheckForResend( void ) {
}
// resend if we haven't gotten a reply yet
if ( cls.state != CA_CONNECTING && cls.state != CA_CHALLENGING ) {
if ( clc.state != CA_CONNECTING && clc.state != CA_CHALLENGING ) {
return;
}
@ -1802,7 +1802,7 @@ void CL_CheckForResend( void ) {
clc.connectPacketCount++;
switch ( cls.state ) {
switch ( clc.state ) {
case CA_CONNECTING:
// requesting a challenge
//wombat: not authorization in mohaa
@ -1853,7 +1853,7 @@ wombat: sending conect here: an example connect string from MOHAA looks like thi
break;
default:
Com_Error( ERR_FATAL, "CL_CheckForResend: bad cls.state" );
Com_Error( ERR_FATAL, "CL_CheckForResend: bad clc.state" );
}
}
@ -1868,7 +1868,7 @@ to the client so it doesn't have to wait for the full timeout period.
===================
*/
void CL_DisconnectPacket( netadr_t from ) {
if ( cls.state < CA_AUTHORIZING ) {
if ( clc.state < CA_AUTHORIZING ) {
return;
}
@ -2091,12 +2091,12 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
// challenge from the server we are connecting to
if ( !Q_stricmp(c, "challengeResponse") ) {
if ( cls.state != CA_CONNECTING && cls.state != CA_AUTHORIZING ) {
if ( clc.state != CA_CONNECTING && clc.state != CA_AUTHORIZING ) {
Com_Printf( "Unwanted challenge response received. Ignored.\n" );
} else {
// start sending challenge repsonse instead of challenge request packets
clc.challenge = atoi(Cmd_Argv(1));
cls.state = CA_CHALLENGING;
clc.state = CA_CHALLENGING;
clc.connectPacketCount = 0;
clc.connectTime = -99999;
@ -2110,11 +2110,11 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
// server connection
if ( !Q_stricmp(c, "connectResponse") ) {
if ( cls.state >= CA_CONNECTED ) {
if ( clc.state >= CA_CONNECTED ) {
Com_Printf ("Dup connect received. Ignored.\n");
return;
}
if ( cls.state != CA_CHALLENGING ) {
if ( clc.state != CA_CHALLENGING ) {
Com_Printf ("connectResponse packet while not connecting. Ignored.\n");
return;
}
@ -2125,7 +2125,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
return;
}
Netchan_Setup (NS_CLIENT, &clc.netchan, from, Cvar_VariableValue( "net_qport" ) );
cls.state = CA_CONNECTED;
clc.state = CA_CONNECTED;
clc.lastPacketSentTime = -9999; // send first packet immediately
return;
}
@ -2157,7 +2157,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
// cd check
if ( !Q_stricmp(c, "getKey") ) {
cls.state = CA_AUTHORIZING;
clc.state = CA_AUTHORIZING;
gcd_compute_response(cl_cdkey, Cmd_Argv(1), cls.gcdResponse, CDResponseMethod_NEWAUTH);
NET_OutOfBandPrint(NS_CLIENT, from, "authorizeThis %s", cls.gcdResponse);
return;
@ -2213,7 +2213,7 @@ void CL_PacketEvent( netadr_t from, msg_t *msg ) {
return;
}
if ( cls.state < CA_CONNECTED ) {
if ( clc.state < CA_CONNECTED ) {
return; // can't be a valid sequenced packet
}
@ -2267,7 +2267,7 @@ void CL_CheckTimeout( void ) {
// check timeout
//
if ( ( !CL_CheckPaused() || !paused->integer )
&& cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC
&& clc.state >= CA_CONNECTED && clc.state != CA_CINEMATIC
&& cls.realtime - clc.lastPacketTime > cl_timeout->value*1000) {
if (++cl.timeoutcount > 5) { // timeoutcount saves debugger
Com_Printf ("\nServer connection timed out.\n");
@ -2309,7 +2309,7 @@ void CL_CheckUserinfo( void ) {
char szSanitizedName[MAX_NAME_LENGTH];
// don't add reliable commands when not yet connected
if(cls.state < CA_CHALLENGING)
if(clc.state < CA_CHALLENGING)
return;
// don't overflow the reliable command buffer when paused
@ -2348,7 +2348,7 @@ void CL_Frame ( int msec ) {
if(clc.downloadCURLM) {
CL_cURL_PerformDownload();
// we can't process frames normally when in disconnected
// download mode since the ui vm expects cls.state to be
// download mode since the ui vm expects clc.state to be
// CA_CONNECTED
if(clc.cURLDisconnected) {
cls.realFrametime = msec;
@ -2362,7 +2362,7 @@ void CL_Frame ( int msec ) {
}
#endif
if ( cls.state == CA_DISCONNECTED && !UI_MenuActive()
if ( clc.state == CA_DISCONNECTED && !UI_MenuActive()
&& !com_sv_running->integer ) {
// if disconnected, bring up the menu
S_StopAllSounds( qtrue );
@ -2372,7 +2372,7 @@ void CL_Frame ( int msec ) {
// if recording an avi, lock to a fixed fps
if ( CL_VideoRecording( ) && cl_aviFrameRate->integer && msec) {
// save the current screen
if ( cls.state == CA_ACTIVE || cl_forceavidemo->integer) {
if ( clc.state == CA_ACTIVE || cl_forceavidemo->integer) {
CL_TakeVideoFrame( );
// fixed time for next frame'
@ -2384,7 +2384,7 @@ void CL_Frame ( int msec ) {
}
if( cl_autoRecordDemo->integer ) {
if( cls.state == CA_ACTIVE && !clc.demorecording && !clc.demoplaying ) {
if( clc.state == CA_ACTIVE && !clc.demorecording && !clc.demoplaying ) {
// If not recording a demo, and we should be, start one
qtime_t now;
const char *nowString;
@ -2415,7 +2415,7 @@ void CL_Frame ( int msec ) {
Cbuf_ExecuteText( EXEC_NOW,
va( "record %s-%s-%s", nowString, serverName, mapName ) );
}
else if( cls.state != CA_ACTIVE && clc.demorecording ) {
else if( clc.state != CA_ACTIVE && clc.demorecording ) {
// Recording, but not CA_ACTIVE, so stop recording
CL_StopRecord_f( );
}
@ -2560,7 +2560,7 @@ void CL_StartHunkUsers( void ) {
}
if( !cls.cgameStarted ) {
if( cls.state >= CA_LOADING && cls.state != CA_CINEMATIC ) {
if( clc.state >= CA_LOADING && clc.state != CA_CINEMATIC ) {
CL_InitCGame();
}
}
@ -2590,17 +2590,37 @@ void CL_RefClear( void )
Z_FreeTags( TAG_RENDERER );
}
/*
============
CL_RefStaticMallocDebug
============
*/
void* CL_RefStaticMallocDebug(size_t size, const char* label, const char* file, int line) {
void* ptr = Z_TagMalloc(size, TAG_STATIC_RENDERER);
Com_Memset(ptr, 0, size);
return ptr;
}
/*
============
CL_RefStaticMalloc
============
*/
void *CL_RefStaticMalloc( size_t size ) {
void *CL_RefStaticMalloc(size_t size ) {
void *ptr = Z_TagMalloc( size, TAG_STATIC_RENDERER );
Com_Memset( ptr, 0, size );
return ptr;
}
/*
============
CL_RefStaticMallocTemp
============
*/
void* CL_RefStaticMallocTemp(size_t size) {
return Hunk_AllocateTempMemory(size);
}
/*
============
CL_RefStaticClear
@ -2710,11 +2730,11 @@ void CL_InitRef( void ) {
ri.Clear = CL_RefClear;
ri.Hunk_Clear = CL_RefStaticClear;
#ifdef HUNK_DEBUG
ri.Hunk_AllocDebug = Hunk_AllocDebug;
ri.Hunk_AllocDebug = CL_RefStaticMallocDebug;
#else
ri.Hunk_Alloc = CL_RefStaticMalloc;
#endif
ri.Hunk_AllocateTempMemory = Hunk_AllocateTempMemory;
ri.Hunk_AllocateTempMemory = CL_RefStaticMallocTemp;
ri.Hunk_FreeTempMemory = Hunk_FreeTempMemory;
ri.CM_DrawDebugSurface = CM_DrawDebugSurface;
@ -3014,7 +3034,7 @@ void CL_Init( void ) {
CL_ClearState ();
S_StopAllSounds( qtrue );
cls.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED
clc.state = CA_DISCONNECTED; // no longer CA_UNINITIALIZED
Key_SetCatcher(KEYCATCH_UI);
cls.realtime = 0;
@ -4234,7 +4254,7 @@ void CL_ServerStatus_f(void) {
Com_Memset( &to, 0, sizeof(netadr_t) );
if ( Cmd_Argc() != 2 ) {
if ( cls.state != CA_ACTIVE || clc.demoplaying ) {
if ( clc.state != CA_ACTIVE || clc.demoplaying ) {
Com_Printf ("Not connected to a server.\n");
Com_Printf( "Usage: serverstatus [server]\n");
return;

View file

@ -548,7 +548,7 @@ void CL_ParseGamestate( msg_t *msg ) {
// reinitialize the filesystem if the game directory has changed
FS_ConditionalRestart( clc.checksumFeed );
cls.state = CA_LOADING;
clc.state = CA_LOADING;
if (!com_sv_running->integer)
{
const char *info = cl.gameState.stringData + cl.gameState.stringOffsets[CS_SERVERINFO];

View file

@ -435,7 +435,7 @@ This will be called twice if rendering in stereo mode
void SCR_DrawScreenField( void ) {
// wide aspect ratio screens need to have the sides cleared
// unless they are displaying game renderings
if ( cls.state != CA_ACTIVE && cls.state != CA_CINEMATIC ) {
if ( clc.state != CA_ACTIVE && clc.state != CA_CINEMATIC ) {
if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) {
re.SetColor( g_color_table[0] );
//re.DrawStretchPic( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, 0, 0, 0, cls.whiteShader );
@ -444,9 +444,9 @@ void SCR_DrawScreenField( void ) {
}
}
switch( cls.state ) {
switch( clc.state ) {
case CA_UNINITIALIZED:
Com_Error( ERR_FATAL, "SCR_DrawScreenField: cls.state == CA_UNINITIALIZED" );
Com_Error( ERR_FATAL, "SCR_DrawScreenField: clc.state == CA_UNINITIALIZED" );
break;
case CA_LOADING:
case CA_PRIMED:
@ -482,7 +482,7 @@ UpdateStereoSide
void UpdateStereoSide( stereoFrame_t s ) {
s_scr_stereoFrame = s;
re.BeginFrame( s );
if( cls.state == CA_CINEMATIC ) {
if( clc.state == CA_CINEMATIC ) {
SCR_DrawCinematic();
}
UI_Update();
@ -535,7 +535,7 @@ void SCR_UpdateScreen( void ) {
SCR_SimpleUpdateScreen();
// set the fps value
if( fps->integer && cls.state == CA_ACTIVE ) {
if( fps->integer && clc.state == CA_ACTIVE ) {
static int belowlastplaytime = 0;
static qboolean belowframerate = qfalse;

View file

@ -260,7 +260,7 @@ GetClientState
*/
static void GetClientState( uiClientState_t *state ) {
state->connectPacketCount = clc.connectPacketCount;
state->connState = cls.state;
state->connState = clc.state;
Q_strncpyz( state->servername, cls.servername, sizeof( state->servername ) );
Q_strncpyz( state->updateInfoString, cls.updateInfoString, sizeof( state->updateInfoString ) );
Q_strncpyz( state->messageString, clc.serverMessage, sizeof( state->messageString ) );
@ -1664,7 +1664,7 @@ UI_DrawIntro
====================
*/
void UI_DrawIntro( void ) {
if( cls.state == CA_CINEMATIC )
if( clc.state == CA_CINEMATIC )
{
view3d->setShow( true );
return;
@ -1719,7 +1719,7 @@ void UI_Update(void) {
//
// draw the base HUD when in-game
//
if (cls.no_menus && cls.state == CA_ACTIVE)
if (cls.no_menus && clc.state == CA_ACTIVE)
{
view3d->setShow(true);
frame = uWinMan.getFrame();
@ -1792,7 +1792,7 @@ void UI_Update(void) {
}
*/
if (!server_loading && (cls.state == CA_CONNECTING || cls.state == CA_CHALLENGING) && ui_pConnectingMenu)
if (!server_loading && (clc.state == CA_CONNECTING || clc.state == CA_CHALLENGING) && ui_pConnectingMenu)
{
view3d->setShow(false);
UI_ClearBackground();
@ -1833,7 +1833,7 @@ void UI_Update(void) {
{
if (currentMenu && currentMenu->isFullscreen() && (!server_loading || !ui_pLoadingMenu))
{
if (com_sv_running->integer && cls.state == CA_ACTIVE) {
if (com_sv_running->integer && clc.state == CA_ACTIVE) {
Com_FakePause();
}
@ -1841,12 +1841,12 @@ void UI_Update(void) {
}
else if (!server_loading)
{
if (cls.state <= CA_PRIMED)
if (clc.state <= CA_PRIMED)
{
view3d->setShow(false);
UI_ClearBackground();
}
else if (cls.state == CA_PRIMED || cls.state == CA_ACTIVE)
else if (clc.state == CA_PRIMED || clc.state == CA_ACTIVE)
{
Com_FakeUnpause();
view3d->setShow(true);
@ -1899,7 +1899,7 @@ void UI_Update(void) {
}
// Hide the HUD when necessary
if (!ui_hud || cls.state != CA_ACTIVE || view3d->LetterboxActive()
if (!ui_hud || clc.state != CA_ACTIVE || view3d->LetterboxActive()
|| (currentMenu && currentMenu->isFullscreen())
|| server_loading
|| ((cl.snap.ps.pm_flags & PMF_NO_HUD) || (cl.snap.ps.pm_flags & PMF_SPECTATE_FOLLOW)))
@ -2476,7 +2476,7 @@ void UI_MultiplayerMenuWidgetsUpdate( void ) {
event = new Event( EV_Widget_Disable );
menuManager.PassEventToWidget( "startnew", event );
if( cls.state > CA_PRIMED && !cg_gametype->integer )
if( clc.state > CA_PRIMED && !cg_gametype->integer )
{
event = new Event( EV_Widget_Disable );
menuManager.PassEventToWidget( "changemap", event );
@ -2497,7 +2497,7 @@ void UI_MultiplayerMenuWidgetsUpdate( void ) {
}
// allow the disconnect widget when in-game
if( cls.state > CA_PRIMED )
if( clc.state > CA_PRIMED )
{
event = new Event( EV_Widget_Enable );
menuManager.PassEventToWidget( "disconnect", event );
@ -2509,7 +2509,7 @@ void UI_MultiplayerMenuWidgetsUpdate( void ) {
}
// allow the join widget when in-game
if( com_sv_running->integer || cls.state > CA_PRIMED )
if( com_sv_running->integer || clc.state > CA_PRIMED )
{
event = new Event( EV_Widget_Disable );
menuManager.PassEventToWidget( "joinlan", event );
@ -2533,7 +2533,7 @@ UI_MainMenuWidgetsUpdate
====================
*/
void UI_MainMenuWidgetsUpdate( void ) {
if( cls.state > CA_PRIMED )
if( clc.state > CA_PRIMED )
{
Event *event = new Event( EV_Widget_Enable );
menuManager.PassEventToWidget( "backtogame", event );
@ -2754,7 +2754,7 @@ void UI_PushMenuSP_f( void ) {
}
if( ( !com_cl_running || !com_cl_running->integer
|| cls.state == CA_DISCONNECTED || !cg_gametype->integer )
|| clc.state == CA_DISCONNECTED || !cg_gametype->integer )
&& ( !com_sv_running || !com_sv_running->integer || !g_gametype->integer ) )
{
UI_PushMenu( Cmd_Argv( 1 ) );
@ -2775,7 +2775,7 @@ void UI_PushMenuMP_f( void ) {
}
if( com_cl_running && com_cl_running->integer
&& cls.state != CA_DISCONNECTED && cg_gametype->integer
&& clc.state != CA_DISCONNECTED && cg_gametype->integer
&& com_sv_running && com_sv_running->integer && g_gametype->integer )
{
cmd = Cmd_Argv( 1 );
@ -3022,7 +3022,7 @@ void UI_MenuEscape( const char *name ) {
{
UI_KeyEvent( K_ESCAPE, qfalse );
}
else if( menuManager.CurrentMenu() != mainmenu || cls.state != CA_DISCONNECTED )
else if( menuManager.CurrentMenu() != mainmenu || clc.state != CA_DISCONNECTED )
{
if( uWinMan.DialogExists() )
{
@ -3034,7 +3034,7 @@ void UI_MenuEscape( const char *name ) {
{
menuManager.PopMenu( qtrue );
}
else if( !Q_stricmp( name, "main" ) && cls.state > CA_PRIMED && cg_gametype->integer > 0 )
else if( !Q_stricmp( name, "main" ) && clc.state > CA_PRIMED && cg_gametype->integer > 0 )
{
UI_PushMenu( "dm_main" );
}
@ -3497,7 +3497,7 @@ void UI_EditScript_f( void ) {
str mappath;
// editscript only works in-game
if( cls.state != CA_ACTIVE )
if( clc.state != CA_ACTIVE )
{
Com_Printf( "You need to load a map to edit its script\n" );
return;

View file

@ -49,7 +49,7 @@ void View3D::Draw
)
{
if (cls.state != CA_DISCONNECTED) {
if (clc.state != CA_DISCONNECTED) {
SCR_DrawScreenField();
}

View file

@ -169,6 +169,7 @@ demo through a file.
typedef struct {
connstate_t state; // connection status
int clientNum;
int lastPacketSentTime; // for retransmits during connection
int lastPacketTime; // for timeouts
@ -286,7 +287,6 @@ typedef struct {
typedef struct {
int startStage;
connstate_t state; // connection status
int loading;
int keyCatchers;
qboolean vid_restart;

View file

@ -47,12 +47,9 @@ typedef enum {
K_LEFTARROW,
K_RIGHTARROW,
K_LALT,
K_LCTRL,
K_LSHIFT,
K_RALT,
K_RCTRL,
K_RSHIFT,
K_ALT,
K_CTRL,
K_SHIFT,
K_INS,
K_DEL,
K_PGDN,
@ -154,11 +151,156 @@ typedef enum {
K_AUX15,
K_AUX16,
K_LWINKEY,
K_RWINKEY,
K_MENUKEY,
K_WORLD_0,
K_WORLD_1,
K_WORLD_2,
K_WORLD_3,
K_WORLD_4,
K_WORLD_5,
K_WORLD_6,
K_WORLD_7,
K_WORLD_8,
K_WORLD_9,
K_WORLD_10,
K_WORLD_11,
K_WORLD_12,
K_WORLD_13,
K_WORLD_14,
K_WORLD_15,
K_WORLD_16,
K_WORLD_17,
K_WORLD_18,
K_WORLD_19,
K_WORLD_20,
K_WORLD_21,
K_WORLD_22,
K_WORLD_23,
K_WORLD_24,
K_WORLD_25,
K_WORLD_26,
K_WORLD_27,
K_WORLD_28,
K_WORLD_29,
K_WORLD_30,
K_WORLD_31,
K_WORLD_32,
K_WORLD_33,
K_WORLD_34,
K_WORLD_35,
K_WORLD_36,
K_WORLD_37,
K_WORLD_38,
K_WORLD_39,
K_WORLD_40,
K_WORLD_41,
K_WORLD_42,
K_WORLD_43,
K_WORLD_44,
K_WORLD_45,
K_WORLD_46,
K_WORLD_47,
K_WORLD_48,
K_WORLD_49,
K_WORLD_50,
K_WORLD_51,
K_WORLD_52,
K_WORLD_53,
K_WORLD_54,
K_WORLD_55,
K_WORLD_56,
K_WORLD_57,
K_WORLD_58,
K_WORLD_59,
K_WORLD_60,
K_WORLD_61,
K_WORLD_62,
K_WORLD_63,
K_WORLD_64,
K_WORLD_65,
K_WORLD_66,
K_WORLD_67,
K_WORLD_68,
K_WORLD_69,
K_WORLD_70,
K_WORLD_71,
K_WORLD_72,
K_WORLD_73,
K_WORLD_74,
K_WORLD_75,
K_WORLD_76,
K_WORLD_77,
K_WORLD_78,
K_WORLD_79,
K_WORLD_80,
K_WORLD_81,
K_WORLD_82,
K_WORLD_83,
K_WORLD_84,
K_WORLD_85,
K_WORLD_86,
K_WORLD_87,
K_WORLD_88,
K_WORLD_89,
K_WORLD_90,
K_WORLD_91,
K_WORLD_92,
K_WORLD_93,
K_WORLD_94,
K_WORLD_95,
K_LASTKEY
K_SUPER,
K_COMPOSE,
K_MODE,
K_HELP,
K_PRINT,
K_SYSREQ,
K_SCROLLOCK,
K_BREAK,
K_MENU,
K_EURO,
K_UNDO,
// Gamepad controls
// Ordered to match SDL2 game controller buttons and axes
// Do not change this order without also changing IN_GamepadMove() in SDL_input.c
K_PAD0_A,
K_PAD0_B,
K_PAD0_X,
K_PAD0_Y,
K_PAD0_BACK,
K_PAD0_GUIDE,
K_PAD0_START,
K_PAD0_LEFTSTICK_CLICK,
K_PAD0_RIGHTSTICK_CLICK,
K_PAD0_LEFTSHOULDER,
K_PAD0_RIGHTSHOULDER,
K_PAD0_DPAD_UP,
K_PAD0_DPAD_DOWN,
K_PAD0_DPAD_LEFT,
K_PAD0_DPAD_RIGHT,
K_PAD0_LEFTSTICK_LEFT,
K_PAD0_LEFTSTICK_RIGHT,
K_PAD0_LEFTSTICK_UP,
K_PAD0_LEFTSTICK_DOWN,
K_PAD0_RIGHTSTICK_LEFT,
K_PAD0_RIGHTSTICK_RIGHT,
K_PAD0_RIGHTSTICK_UP,
K_PAD0_RIGHTSTICK_DOWN,
K_PAD0_LEFTTRIGGER,
K_PAD0_RIGHTTRIGGER,
K_PAD0_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
K_PAD0_PADDLE1, /* Xbox Elite paddle P1 */
K_PAD0_PADDLE2, /* Xbox Elite paddle P3 */
K_PAD0_PADDLE3, /* Xbox Elite paddle P2 */
K_PAD0_PADDLE4, /* Xbox Elite paddle P4 */
K_PAD0_TOUCHPAD, /* PS4/PS5 touchpad button */
// Pseudo-key that brings the console down
K_CONSOLE,
MAX_KEYS
} keyNum_t;
// MAX_KEYS replaces K_LAST_KEY, however some mods may have used K_LAST_KEY

View file

@ -32,7 +32,7 @@ typedef struct {
} qkey_t;
extern qboolean key_overstrikeMode;
extern qkey_t keys[K_LASTKEY];
extern qkey_t keys[MAX_KEYS];
extern int anykeydown;
extern qboolean chat_team;

View file

@ -0,0 +1,683 @@
As required by the libjpeg license, additions, deletions and changes to
the original files are listed here. Files noted as "Only in jpeg-8c"
were deleted; files noted as "Only in ioquake3/code/jpeg-8c" were added.
To regenerate this file, replace everything after "------" with the output
of this command: diff -ru jpeg-8c ioquake3/code/jpeg-8c
------
Only in jpeg-8c: aclocal.m4
Only in jpeg-8c: ansi2knr.1
Only in jpeg-8c: ansi2knr.c
Only in jpeg-8c: cderror.h
Only in jpeg-8c: cdjpeg.c
Only in jpeg-8c: cdjpeg.h
Only in jpeg-8c: change.log
Only in jpeg-8c: cjpeg.1
Only in jpeg-8c: cjpeg.c
Only in jpeg-8c: ckconfig.c
Only in jpeg-8c: coderules.txt
Only in jpeg-8c: config.guess
Only in jpeg-8c: config.sub
Only in jpeg-8c: configure
Only in jpeg-8c: configure.ac
Only in jpeg-8c: depcomp
Only in jpeg-8c: djpeg.1
Only in jpeg-8c: djpeg.c
Only in jpeg-8c: example.c
Only in jpeg-8c: filelist.txt
Only in jpeg-8c: install-sh
Only in jpeg-8c: install.txt
diff -ru jpeg-8c/jcmainct.c ioquake3/code/jpeg-8c/jcmainct.c
--- jpeg-8c/jcmainct.c 2003-10-19 18:55:34.000000000 +0100
+++ ioquake3/code/jpeg-8c/jcmainct.c 2011-11-25 11:24:52.000000000 +0000
@@ -68,32 +68,32 @@
METHODDEF(void)
start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
/* Do nothing in raw-data mode. */
if (cinfo->raw_data_in)
return;
- main->cur_iMCU_row = 0; /* initialize counters */
- main->rowgroup_ctr = 0;
- main->suspended = FALSE;
- main->pass_mode = pass_mode; /* save mode for use by process_data */
+ main_ptr->cur_iMCU_row = 0; /* initialize counters */
+ main_ptr->rowgroup_ctr = 0;
+ main_ptr->suspended = FALSE;
+ main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
switch (pass_mode) {
case JBUF_PASS_THRU:
#ifdef FULL_MAIN_BUFFER_SUPPORTED
- if (main->whole_image[0] != NULL)
+ if (main_ptr->whole_image[0] != NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
- main->pub.process_data = process_data_simple_main;
+ main_ptr->pub.process_data = process_data_simple_main;
break;
#ifdef FULL_MAIN_BUFFER_SUPPORTED
case JBUF_SAVE_SOURCE:
case JBUF_CRANK_DEST:
case JBUF_SAVE_AND_PASS:
- if (main->whole_image[0] == NULL)
+ if (main_ptr->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- main->pub.process_data = process_data_buffer_main;
+ main_ptr->pub.process_data = process_data_buffer_main;
break;
#endif
default:
@@ -114,46 +114,46 @@
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
- while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+ while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main buffer yet */
- if (main->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)
+ if (main_ptr->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)
(*cinfo->prep->pre_process_data) (cinfo,
input_buf, in_row_ctr, in_rows_avail,
- main->buffer, &main->rowgroup_ctr,
+ main_ptr->buffer, &main_ptr->rowgroup_ctr,
(JDIMENSION) cinfo->min_DCT_v_scaled_size);
/* If we don't have a full iMCU row buffered, return to application for
* more data. Note that preprocessor will always pad to fill the iMCU row
* at the bottom of the image.
*/
- if (main->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size)
+ if (main_ptr->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size)
return;
/* Send the completed row to the compressor */
- if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+ if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
- if (! main->suspended) {
+ if (! main_ptr->suspended) {
(*in_row_ctr)--;
- main->suspended = TRUE;
+ main_ptr->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main buffer empty.
*/
- if (main->suspended) {
+ if (main_ptr->suspended) {
(*in_row_ctr)++;
- main->suspended = FALSE;
+ main_ptr->suspended = FALSE;
}
- main->rowgroup_ctr = 0;
- main->cur_iMCU_row++;
+ main_ptr->rowgroup_ctr = 0;
+ main_ptr->cur_iMCU_row++;
}
}
@@ -170,25 +170,25 @@
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci;
jpeg_component_info *compptr;
- boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
+ boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST);
- while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+ while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Realign the virtual buffers if at the start of an iMCU row. */
- if (main->rowgroup_ctr == 0) {
+ if (main_ptr->rowgroup_ctr == 0) {
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
- main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
- ((j_common_ptr) cinfo, main->whole_image[ci],
- main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
+ main_ptr->buffer[ci] = (*cinfo->mem->access_virt_sarray)
+ ((j_common_ptr) cinfo, main_ptr->whole_image[ci],
+ main_ptr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
}
/* In a read pass, pretend we just read some source data. */
if (! writing) {
*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
- main->rowgroup_ctr = DCTSIZE;
+ main_ptr->rowgroup_ctr = DCTSIZE;
}
}
@@ -197,40 +197,40 @@
if (writing) {
(*cinfo->prep->pre_process_data) (cinfo,
input_buf, in_row_ctr, in_rows_avail,
- main->buffer, &main->rowgroup_ctr,
+ main_ptr->buffer, &main_ptr->rowgroup_ctr,
(JDIMENSION) DCTSIZE);
/* Return to application if we need more data to fill the iMCU row. */
- if (main->rowgroup_ctr < DCTSIZE)
+ if (main_ptr->rowgroup_ctr < DCTSIZE)
return;
}
/* Emit data, unless this is a sink-only pass. */
- if (main->pass_mode != JBUF_SAVE_SOURCE) {
- if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+ if (main_ptr->pass_mode != JBUF_SAVE_SOURCE) {
+ if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
- if (! main->suspended) {
+ if (! main_ptr->suspended) {
(*in_row_ctr)--;
- main->suspended = TRUE;
+ main_ptr->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main buffer empty.
*/
- if (main->suspended) {
+ if (main_ptr->suspended) {
(*in_row_ctr)++;
- main->suspended = FALSE;
+ main_ptr->suspended = FALSE;
}
}
/* If get here, we are done with this iMCU row. Mark buffer empty. */
- main->rowgroup_ctr = 0;
- main->cur_iMCU_row++;
+ main_ptr->rowgroup_ctr = 0;
+ main_ptr->cur_iMCU_row++;
}
}
@@ -244,15 +244,15 @@
GLOBAL(void)
jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
{
- my_main_ptr main;
+ my_main_ptr main_ptr;
int ci;
jpeg_component_info *compptr;
- main = (my_main_ptr)
+ main_ptr = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
- cinfo->main = (struct jpeg_c_main_controller *) main;
- main->pub.start_pass = start_pass_main;
+ cinfo->main = (struct jpeg_c_main_controller *) main_ptr;
+ main_ptr->pub.start_pass = start_pass_main;
/* We don't need to create a buffer in raw-data mode. */
if (cinfo->raw_data_in)
@@ -267,7 +267,7 @@
/* Note we pad the bottom to a multiple of the iMCU height */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
- main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
+ main_ptr->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
compptr->width_in_blocks * compptr->DCT_h_scaled_size,
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
@@ -279,12 +279,12 @@
#endif
} else {
#ifdef FULL_MAIN_BUFFER_SUPPORTED
- main->whole_image[0] = NULL; /* flag for no virtual arrays */
+ main_ptr->whole_image[0] = NULL; /* flag for no virtual arrays */
#endif
/* Allocate a strip buffer for each component */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
- main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+ main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_blocks * compptr->DCT_h_scaled_size,
(JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));
Only in jpeg-8c: jconfig.bcc
Only in jpeg-8c: jconfig.cfg
Only in jpeg-8c: jconfig.dj
Only in ioquake3/code/jpeg-8c: jconfig.h
Only in jpeg-8c: jconfig.mac
Only in jpeg-8c: jconfig.manx
Only in jpeg-8c: jconfig.mc6
Only in jpeg-8c: jconfig.sas
Only in jpeg-8c: jconfig.st
Only in jpeg-8c: jconfig.txt
Only in jpeg-8c: jconfig.vc
Only in jpeg-8c: jconfig.vms
Only in jpeg-8c: jconfig.wat
diff -ru jpeg-8c/jdmainct.c ioquake3/code/jpeg-8c/jdmainct.c
--- jpeg-8c/jdmainct.c 2002-02-24 19:07:28.000000000 +0000
+++ ioquake3/code/jpeg-8c/jdmainct.c 2011-11-25 11:24:52.000000000 +0000
@@ -159,7 +159,7 @@
* This is done only once, not once per pass.
*/
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci, rgroup;
int M = cinfo->min_DCT_v_scaled_size;
jpeg_component_info *compptr;
@@ -168,10 +168,10 @@
/* Get top-level space for component array pointers.
* We alloc both arrays with one call to save a few cycles.
*/
- main->xbuffer[0] = (JSAMPIMAGE)
+ main_ptr->xbuffer[0] = (JSAMPIMAGE)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
- main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
+ main_ptr->xbuffer[1] = main_ptr->xbuffer[0] + cinfo->num_components;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
@@ -184,9 +184,9 @@
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
xbuf += rgroup; /* want one row group at negative offsets */
- main->xbuffer[0][ci] = xbuf;
+ main_ptr->xbuffer[0][ci] = xbuf;
xbuf += rgroup * (M + 4);
- main->xbuffer[1][ci] = xbuf;
+ main_ptr->xbuffer[1][ci] = xbuf;
}
}
@@ -194,13 +194,13 @@
LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above.
- * The actual workspace is already allocated (in main->buffer),
+ * The actual workspace is already allocated (in main_ptr->buffer),
* and the space for the pointer lists is allocated too.
* This routine just fills in the curiously ordered lists.
* This will be repeated at the beginning of each pass.
*/
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci, i, rgroup;
int M = cinfo->min_DCT_v_scaled_size;
jpeg_component_info *compptr;
@@ -210,10 +210,10 @@
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
- xbuf0 = main->xbuffer[0][ci];
- xbuf1 = main->xbuffer[1][ci];
+ xbuf0 = main_ptr->xbuffer[0][ci];
+ xbuf1 = main_ptr->xbuffer[1][ci];
/* First copy the workspace pointers as-is */
- buf = main->buffer[ci];
+ buf = main_ptr->buffer[ci];
for (i = 0; i < rgroup * (M + 2); i++) {
xbuf0[i] = xbuf1[i] = buf[i];
}
@@ -240,7 +240,7 @@
* This changes the pointer list state from top-of-image to the normal state.
*/
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci, i, rgroup;
int M = cinfo->min_DCT_v_scaled_size;
jpeg_component_info *compptr;
@@ -250,8 +250,8 @@
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
- xbuf0 = main->xbuffer[0][ci];
- xbuf1 = main->xbuffer[1][ci];
+ xbuf0 = main_ptr->xbuffer[0][ci];
+ xbuf1 = main_ptr->xbuffer[1][ci];
for (i = 0; i < rgroup; i++) {
xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
@@ -269,7 +269,7 @@
* Also sets rowgroups_avail to indicate number of nondummy row groups in row.
*/
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci, i, rgroup, iMCUheight, rows_left;
jpeg_component_info *compptr;
JSAMPARRAY xbuf;
@@ -286,12 +286,12 @@
* so we need only do it once.
*/
if (ci == 0) {
- main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
+ main_ptr->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
}
/* Duplicate the last real sample row rgroup*2 times; this pads out the
* last partial rowgroup and ensures at least one full rowgroup of context.
*/
- xbuf = main->xbuffer[main->whichptr][ci];
+ xbuf = main_ptr->xbuffer[main_ptr->whichptr][ci];
for (i = 0; i < rgroup * 2; i++) {
xbuf[rows_left + i] = xbuf[rows_left-1];
}
@@ -306,27 +306,27 @@
METHODDEF(void)
start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
switch (pass_mode) {
case JBUF_PASS_THRU:
if (cinfo->upsample->need_context_rows) {
- main->pub.process_data = process_data_context_main;
+ main_ptr->pub.process_data = process_data_context_main;
make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
- main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
- main->context_state = CTX_PREPARE_FOR_IMCU;
- main->iMCU_row_ctr = 0;
+ main_ptr->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
+ main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
+ main_ptr->iMCU_row_ctr = 0;
} else {
/* Simple case with no context needed */
- main->pub.process_data = process_data_simple_main;
+ main_ptr->pub.process_data = process_data_simple_main;
}
- main->buffer_full = FALSE; /* Mark buffer empty */
- main->rowgroup_ctr = 0;
+ main_ptr->buffer_full = FALSE; /* Mark buffer empty */
+ main_ptr->rowgroup_ctr = 0;
break;
#ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST:
/* For last pass of 2-pass quantization, just crank the postprocessor */
- main->pub.process_data = process_data_crank_post;
+ main_ptr->pub.process_data = process_data_crank_post;
break;
#endif
default:
@@ -346,14 +346,14 @@
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
JDIMENSION rowgroups_avail;
/* Read input data if we haven't filled the main buffer yet */
- if (! main->buffer_full) {
- if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
+ if (! main_ptr->buffer_full) {
+ if (! (*cinfo->coef->decompress_data) (cinfo, main_ptr->buffer))
return; /* suspension forced, can do nothing more */
- main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
+ main_ptr->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
}
/* There are always min_DCT_scaled_size row groups in an iMCU row. */
@@ -364,14 +364,14 @@
*/
/* Feed the postprocessor */
- (*cinfo->post->post_process_data) (cinfo, main->buffer,
- &main->rowgroup_ctr, rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, main_ptr->buffer,
+ &main_ptr->rowgroup_ctr, rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
- if (main->rowgroup_ctr >= rowgroups_avail) {
- main->buffer_full = FALSE;
- main->rowgroup_ctr = 0;
+ if (main_ptr->rowgroup_ctr >= rowgroups_avail) {
+ main_ptr->buffer_full = FALSE;
+ main_ptr->rowgroup_ctr = 0;
}
}
@@ -386,15 +386,15 @@
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
- my_main_ptr main = (my_main_ptr) cinfo->main;
+ my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
/* Read input data if we haven't filled the main buffer yet */
- if (! main->buffer_full) {
+ if (! main_ptr->buffer_full) {
if (! (*cinfo->coef->decompress_data) (cinfo,
- main->xbuffer[main->whichptr]))
+ main_ptr->xbuffer[main_ptr->whichptr]))
return; /* suspension forced, can do nothing more */
- main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
- main->iMCU_row_ctr++; /* count rows received */
+ main_ptr->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
+ main_ptr->iMCU_row_ctr++; /* count rows received */
}
/* Postprocessor typically will not swallow all the input data it is handed
@@ -402,47 +402,47 @@
* to exit and restart. This switch lets us keep track of how far we got.
* Note that each case falls through to the next on successful completion.
*/
- switch (main->context_state) {
+ switch (main_ptr->context_state) {
case CTX_POSTPONED_ROW:
/* Call postprocessor using previously set pointers for postponed row */
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],
+ &main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
- if (main->rowgroup_ctr < main->rowgroups_avail)
+ if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
return; /* Need to suspend */
- main->context_state = CTX_PREPARE_FOR_IMCU;
+ main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
if (*out_row_ctr >= out_rows_avail)
return; /* Postprocessor exactly filled output buf */
/*FALLTHROUGH*/
case CTX_PREPARE_FOR_IMCU:
/* Prepare to process first M-1 row groups of this iMCU row */
- main->rowgroup_ctr = 0;
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1);
+ main_ptr->rowgroup_ctr = 0;
+ main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1);
/* Check for bottom of image: if so, tweak pointers to "duplicate"
* the last sample row, and adjust rowgroups_avail to ignore padding rows.
*/
- if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
+ if (main_ptr->iMCU_row_ctr == cinfo->total_iMCU_rows)
set_bottom_pointers(cinfo);
- main->context_state = CTX_PROCESS_IMCU;
+ main_ptr->context_state = CTX_PROCESS_IMCU;
/*FALLTHROUGH*/
case CTX_PROCESS_IMCU:
/* Call postprocessor using previously set pointers */
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],
+ &main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
- if (main->rowgroup_ctr < main->rowgroups_avail)
+ if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
return; /* Need to suspend */
/* After the first iMCU, change wraparound pointers to normal state */
- if (main->iMCU_row_ctr == 1)
+ if (main_ptr->iMCU_row_ctr == 1)
set_wraparound_pointers(cinfo);
/* Prepare to load new iMCU row using other xbuffer list */
- main->whichptr ^= 1; /* 0=>1 or 1=>0 */
- main->buffer_full = FALSE;
+ main_ptr->whichptr ^= 1; /* 0=>1 or 1=>0 */
+ main_ptr->buffer_full = FALSE;
/* Still need to process last row group of this iMCU row, */
/* which is saved at index M+1 of the other xbuffer */
- main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1);
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2);
- main->context_state = CTX_POSTPONED_ROW;
+ main_ptr->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1);
+ main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2);
+ main_ptr->context_state = CTX_POSTPONED_ROW;
}
}
@@ -475,15 +475,15 @@
GLOBAL(void)
jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
{
- my_main_ptr main;
+ my_main_ptr main_ptr;
int ci, rgroup, ngroups;
jpeg_component_info *compptr;
- main = (my_main_ptr)
+ main_ptr = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
- cinfo->main = (struct jpeg_d_main_controller *) main;
- main->pub.start_pass = start_pass_main;
+ cinfo->main = (struct jpeg_d_main_controller *) main_ptr;
+ main_ptr->pub.start_pass = start_pass_main;
if (need_full_buffer) /* shouldn't happen */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
@@ -504,7 +504,7 @@
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
- main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+ main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_blocks * compptr->DCT_h_scaled_size,
(JDIMENSION) (rgroup * ngroups));
diff -ru jpeg-8c/jerror.c ioquake3/code/jpeg-8c/jerror.c
--- jpeg-8c/jerror.c 1998-02-21 19:03:16.000000000 +0000
+++ ioquake3/code/jpeg-8c/jerror.c 2011-11-25 11:24:52.000000000 +0000
@@ -24,6 +24,8 @@
#include "jversion.h"
#include "jerror.h"
+#include <stdlib.h>
+
#ifdef USE_WINDOWS_MESSAGEBOX
#include <windows.h>
#endif
Only in jpeg-8c: jmemansi.c
Only in jpeg-8c: jmemdosa.asm
Only in jpeg-8c: jmemdos.c
Only in jpeg-8c: jmemmac.c
Only in jpeg-8c: jmemname.c
Only in jpeg-8c: jpegtran.1
Only in jpeg-8c: jpegtran.c
Only in jpeg-8c: libjpeg.map
Only in jpeg-8c: libjpeg.txt
Only in jpeg-8c: ltmain.sh
Only in jpeg-8c: makcjpeg.st
Only in jpeg-8c: makdjpeg.st
Only in jpeg-8c: makeadsw.vc6
Only in jpeg-8c: makeasln.v10
Only in jpeg-8c: makecdep.vc6
Only in jpeg-8c: makecdsp.vc6
Only in jpeg-8c: makecfil.v10
Only in jpeg-8c: makecmak.vc6
Only in jpeg-8c: makecvcx.v10
Only in jpeg-8c: makeddep.vc6
Only in jpeg-8c: makeddsp.vc6
Only in jpeg-8c: makedfil.v10
Only in jpeg-8c: makedmak.vc6
Only in jpeg-8c: makedvcx.v10
Only in jpeg-8c: Makefile.am
Only in jpeg-8c: makefile.ansi
Only in jpeg-8c: makefile.bcc
Only in jpeg-8c: makefile.dj
Only in jpeg-8c: Makefile.in
Only in jpeg-8c: makefile.manx
Only in jpeg-8c: makefile.mc6
Only in jpeg-8c: makefile.mms
Only in jpeg-8c: makefile.sas
Only in jpeg-8c: makefile.unix
Only in jpeg-8c: makefile.vc
Only in jpeg-8c: makefile.vms
Only in jpeg-8c: makefile.wat
Only in jpeg-8c: makejdep.vc6
Only in jpeg-8c: makejdsp.vc6
Only in jpeg-8c: makejdsw.vc6
Only in jpeg-8c: makejfil.v10
Only in jpeg-8c: makejmak.vc6
Only in jpeg-8c: makejsln.v10
Only in jpeg-8c: makejvcx.v10
Only in jpeg-8c: makeproj.mac
Only in jpeg-8c: makerdep.vc6
Only in jpeg-8c: makerdsp.vc6
Only in jpeg-8c: makerfil.v10
Only in jpeg-8c: makermak.vc6
Only in jpeg-8c: makervcx.v10
Only in jpeg-8c: maketdep.vc6
Only in jpeg-8c: maketdsp.vc6
Only in jpeg-8c: maketfil.v10
Only in jpeg-8c: maketmak.vc6
Only in jpeg-8c: maketvcx.v10
Only in jpeg-8c: makewdep.vc6
Only in jpeg-8c: makewdsp.vc6
Only in jpeg-8c: makewfil.v10
Only in jpeg-8c: makewmak.vc6
Only in jpeg-8c: makewvcx.v10
Only in jpeg-8c: makljpeg.st
Only in jpeg-8c: maktjpeg.st
Only in jpeg-8c: makvms.opt
Only in jpeg-8c: missing
Only in jpeg-8c: rdbmp.c
Only in jpeg-8c: rdcolmap.c
Only in jpeg-8c: rdgif.c
Only in jpeg-8c: rdjpgcom.1
Only in jpeg-8c: rdjpgcom.c
Only in jpeg-8c: rdppm.c
Only in jpeg-8c: rdrle.c
Only in jpeg-8c: rdswitch.c
Only in jpeg-8c: rdtarga.c
Only in jpeg-8c: structure.txt
Only in jpeg-8c: testimg.bmp
Only in jpeg-8c: testimg.jpg
Only in jpeg-8c: testimgp.jpg
Only in jpeg-8c: testimg.ppm
Only in jpeg-8c: testorig.jpg
Only in jpeg-8c: testprog.jpg
Only in jpeg-8c: transupp.c
Only in jpeg-8c: transupp.h
Only in jpeg-8c: usage.txt
Only in jpeg-8c: wizard.txt
Only in jpeg-8c: wrbmp.c
Only in jpeg-8c: wrgif.c
Only in jpeg-8c: wrjpgcom.1
Only in jpeg-8c: wrjpgcom.c
Only in jpeg-8c: wrppm.c
Only in jpeg-8c: wrrle.c
Only in jpeg-8c: wrtarga.c

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
code/libs/win32/SDL2.dll Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
code/libs/win64/SDL264.dll Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
code/opus-1.2.1/celt/arm/arm2gnu.pl Normal file → Executable file
View file

View file

@ -304,12 +304,12 @@ qboolean CM_LoadFCM( const char *szName, cfencemask_t **pMask )
return qfalse;
}
m = ( cfencemask_t * )Hunk_Alloc( sizeof( cfencemask_t ) );
m = (cfencemask_t*)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
*pMask = m;
strcpy( m->name, szName );
m->iWidth = header.iWidth;
m->iHeight = header.iHeight;
m->pData = ( byte * )Hunk_Alloc( iDataSize );
m->iHeight = header.iHeight;
m->pData = (byte*)Hunk_Alloc(iDataSize, h_dontcare);
FS_Read( m->pData, iDataSize, h );
FS_FCloseFile( h );
@ -401,7 +401,7 @@ cfencemask_t *CM_GenerateDummyFenceMask( const char *szName, qboolean bOpaque )
{
cfencemask_t *pMask;
pMask = Hunk_Alloc( sizeof( cfencemask_t ) + sizeof( byte ) );
pMask = Hunk_Alloc(sizeof(cfencemask_t) + sizeof(byte), h_dontcare);
pMask->iWidth = 2;
pMask->iHeight = 2;
pMask->pData = ( byte * )( ( char * )pMask + sizeof( cfencemask_t ) );
@ -482,8 +482,8 @@ qboolean CM_GenerateFenceMask( const char *szName, cfencemask_t **pMask )
// load the mask if it has transparence and is opaque
if( bHasOpaque && bHasTrans )
{
*pMask = Hunk_Alloc( ( iMaskSize >> 3 ) + sizeof( cfencemask_t ) );
{
*pMask = Hunk_Alloc((iMaskSize >> 3) + sizeof(cfencemask_t), h_dontcare);
strcpy( ( *pMask )->name, szName );
( *pMask )->iWidth = iWidth;
( *pMask )->iHeight = iHeight;
@ -571,8 +571,8 @@ cfencemask_t *CM_GetFenceMask( const char *szMaskName )
if( save || !CM_LoadFCM( szMaskName, &pMask ) )
{
if( !CM_GenerateFenceMask( szMaskName, &pMask ) )
{
pMask = ( cfencemask_t * )Hunk_Alloc( sizeof( cfencemask_t ) );
{
pMask = (cfencemask_t*)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
strcpy( pMask->name, szMaskName );
pMask->pData = NULL;
pMask->pNext = cm.fencemasks;

View file

@ -111,7 +111,7 @@ void CMod_LoadShaders( gamelump_t *l, int **shaderSubdivisions ) {
Com_Error (ERR_DROP, "Map with no shaders");
}
cm.shaders = Hunk_Alloc( count * sizeof( *cm.shaders ) );
cm.shaders = Hunk_Alloc( count * sizeof( *cm.shaders ), h_dontcare);
cm.numShaders = count;
cm.fencemasks = NULL;
@ -146,7 +146,7 @@ void CMod_LoadSubmodels( gamelump_t *l ) {
if (count < 1)
Com_Error (ERR_DROP, "Map with no models");
cm.cmodels = Hunk_Alloc( count * sizeof( *cm.cmodels ) );
cm.cmodels = Hunk_Alloc( count * sizeof( *cm.cmodels ), h_dontcare);
cm.numSubModels = count;
if ( count > MAX_SUBMODELS ) {
@ -171,7 +171,7 @@ void CMod_LoadSubmodels( gamelump_t *l ) {
out->leaf.numLeafBrushes = LittleLong( in->numBrushes );
if( out->leaf.numLeafBrushes )
{
indexes = Hunk_Alloc( out->leaf.numLeafBrushes * 4 );
indexes = Hunk_Alloc( out->leaf.numLeafBrushes * 4, h_dontcare);
out->leaf.firstLeafBrush = indexes - cm.leafbrushes;
for( j = 0; j < out->leaf.numLeafBrushes; j++ ) {
indexes[ j ] = LittleLong( in->firstBrush ) + j;
@ -185,7 +185,7 @@ void CMod_LoadSubmodels( gamelump_t *l ) {
out->leaf.numLeafSurfaces = LittleLong( in->numSurfaces );
if( out->leaf.numLeafSurfaces )
{
indexes = Hunk_Alloc( out->leaf.numLeafSurfaces * 4 );
indexes = Hunk_Alloc( out->leaf.numLeafSurfaces * 4, h_dontcare);
out->leaf.firstLeafSurface = indexes - cm.leafsurfaces;
for( j = 0; j < out->leaf.numLeafSurfaces; j++ ) {
indexes[ j ] = LittleLong( in->firstSurface ) + j;
@ -218,7 +218,7 @@ void CMod_LoadNodes( gamelump_t *l ) {
if (count < 1)
Com_Error (ERR_DROP, "Map has no nodes");
cm.nodes = Hunk_Alloc( count * sizeof( *cm.nodes ) );
cm.nodes = Hunk_Alloc( count * sizeof( *cm.nodes ), h_dontcare);
cm.numNodes = count;
out = cm.nodes;
@ -269,7 +269,7 @@ void CMod_LoadBrushes( gamelump_t *l ) {
}
count = l->length / sizeof(*in);
cm.brushes = Hunk_Alloc( ( BOX_BRUSHES + count ) * sizeof( *cm.brushes ) );
cm.brushes = Hunk_Alloc( ( BOX_BRUSHES + count ) * sizeof( *cm.brushes ), h_dontcare);
cm.numBrushes = count;
out = cm.brushes;
@ -309,7 +309,7 @@ void CMod_LoadLeafs( gamelump_t *l )
if (count < 1)
Com_Error (ERR_DROP, "Map with no leafs");
cm.leafs = Hunk_Alloc( ( BOX_LEAFS + count ) * sizeof( *cm.leafs ) );
cm.leafs = Hunk_Alloc( ( BOX_LEAFS + count ) * sizeof( *cm.leafs ), h_dontcare);
cm.numLeafs = count;
out = cm.leafs;
@ -330,8 +330,8 @@ void CMod_LoadLeafs( gamelump_t *l )
cm.numAreas = out->area + 1;
}
cm.areas = Hunk_Alloc( cm.numAreas * sizeof( *cm.areas ) );
cm.areaPortals = Hunk_Alloc( cm.numAreas * cm.numAreas * sizeof( *cm.areaPortals ) );
cm.areas = Hunk_Alloc( cm.numAreas * sizeof( *cm.areas ), h_dontcare);
cm.areaPortals = Hunk_Alloc( cm.numAreas * cm.numAreas * sizeof( *cm.areaPortals ), h_dontcare);
}
/*
@ -354,7 +354,7 @@ void CMod_LoadLeafsOld( gamelump_t *l )
if( count < 1 )
Com_Error( ERR_DROP, "Map with no leafs" );
cm.leafs = Hunk_Alloc( ( BOX_LEAFS + count ) * sizeof( *cm.leafs ) );
cm.leafs = Hunk_Alloc( ( BOX_LEAFS + count ) * sizeof( *cm.leafs ), h_dontcare);
cm.numLeafs = count;
out = cm.leafs;
@ -373,8 +373,8 @@ void CMod_LoadLeafsOld( gamelump_t *l )
cm.numAreas = out->area + 1;
}
cm.areas = Hunk_Alloc( cm.numAreas * sizeof( *cm.areas ) );
cm.areaPortals = Hunk_Alloc( cm.numAreas * cm.numAreas * sizeof( *cm.areaPortals ) );
cm.areas = Hunk_Alloc( cm.numAreas * sizeof( *cm.areas ), h_dontcare);
cm.areaPortals = Hunk_Alloc( cm.numAreas * cm.numAreas * sizeof( *cm.areaPortals ), h_dontcare);
}
/*
@ -397,7 +397,7 @@ void CMod_LoadPlanes( gamelump_t *l )
if (count < 1)
Com_Error (ERR_DROP, "Map with no planes");
cm.planes = Hunk_Alloc( ( BOX_PLANES + count ) * sizeof( *cm.planes ) );
cm.planes = Hunk_Alloc( ( BOX_PLANES + count ) * sizeof( *cm.planes ), h_dontcare);
cm.numPlanes = count;
out = cm.planes;
@ -435,7 +435,7 @@ void CMod_LoadLeafBrushes( gamelump_t *l )
Com_Error( ERR_DROP, "CM_LoadMap: funny lump size in %s", cm.name );
count = l->length / sizeof(*in);
cm.leafbrushes = Hunk_Alloc( (count + BOX_BRUSHES) * sizeof( *cm.leafbrushes ) );
cm.leafbrushes = Hunk_Alloc( (count + BOX_BRUSHES) * sizeof( *cm.leafbrushes ), h_dontcare);
cm.numLeafBrushes = count;
out = cm.leafbrushes;
@ -462,7 +462,7 @@ void CMod_LoadLeafSurfaces( gamelump_t *l )
Com_Error( ERR_DROP, "CM_LoadMap: funny lump size in %s", cm.name );
count = l->length / sizeof(*in);
cm.leafsurfaces = Hunk_Alloc( count * sizeof( *cm.leafsurfaces ) );
cm.leafsurfaces = Hunk_Alloc( count * sizeof( *cm.leafsurfaces ), h_dontcare);
cm.numLeafSurfaces = count;
out = cm.leafsurfaces;
@ -497,7 +497,7 @@ void CMod_LoadSideEquations( gamelump_t *l )
return;
}
cm.sideequations = Hunk_Alloc( count * sizeof( *cm.sideequations ) );
cm.sideequations = Hunk_Alloc( count * sizeof( *cm.sideequations ), h_dontcare);
cm.numSideEquations = count;
out = cm.sideequations;
@ -529,7 +529,7 @@ void CMod_LoadBrushSides( gamelump_t *l )
}
count = l->length / sizeof(*in);
cm.brushsides = Hunk_Alloc( ( BOX_SIDES + count ) * sizeof( *cm.brushsides ) );
cm.brushsides = Hunk_Alloc( ( BOX_SIDES + count ) * sizeof( *cm.brushsides ), h_dontcare);
cm.numBrushSides = count;
out = cm.brushsides;
@ -559,7 +559,7 @@ CMod_LoadEntityString
=================
*/
void CMod_LoadEntityString( gamelump_t *l ) {
cm.entityString = Hunk_Alloc( l->length );
cm.entityString = Hunk_Alloc( l->length, h_dontcare);
cm.numEntityChars = l->length;
Com_Memcpy( cm.entityString, l->buffer, l->length );
}
@ -577,14 +577,14 @@ void CMod_LoadVisibility( gamelump_t *l ) {
len = l->length;
if ( !len ) {
cm.clusterBytes = ( cm.numClusters + 31 ) & ~31;
cm.visibility = Hunk_Alloc( cm.clusterBytes );
cm.visibility = Hunk_Alloc( cm.clusterBytes, h_dontcare);
Com_Memset( cm.visibility, 255, cm.clusterBytes );
return;
}
buf = ( byte * )l->buffer;
cm.vised = qtrue;
cm.visibility = Hunk_Alloc( len );
cm.visibility = Hunk_Alloc( len, h_dontcare);
cm.numClusters = LittleLong( ( ( int * )buf )[ 0 ] );
cm.clusterBytes = LittleLong( ( ( int * )buf )[ 1 ] );
Com_Memcpy( cm.visibility, buf + VIS_HEADER, len - VIS_HEADER );
@ -615,7 +615,7 @@ void CMod_LoadPatches( gamelump_t *surfs, gamelump_t *verts, int *shaderSubdivis
if( surfs->length % sizeof( *in ) )
Com_Error( ERR_DROP, "CM_LoadMap: funny lump size in %s", cm.name );
cm.numSurfaces = count = surfs->length / sizeof(*in);
cm.surfaces = Hunk_Alloc( cm.numSurfaces * sizeof( cm.surfaces[0] ) );
cm.surfaces = Hunk_Alloc( cm.numSurfaces * sizeof( cm.surfaces[0] ), h_dontcare);
memset( cm.surfaces, 0, cm.numSurfaces * sizeof( cm.surfaces[ 0 ] ) );
dv = ( drawVert_t * )verts->buffer;
@ -638,7 +638,7 @@ void CMod_LoadPatches( gamelump_t *surfs, gamelump_t *verts, int *shaderSubdivis
continue;
}
cm.surfaces[ i ] = patch = Hunk_Alloc( sizeof( *patch ) );
cm.surfaces[ i ] = patch = Hunk_Alloc( sizeof( *patch ), h_dontcare);
assert( cm.surfaces[ i ] != ( cPatch_t * )0 );
assert( cm.surfaces[ i ] != ( cPatch_t * )0x4 );
@ -695,7 +695,7 @@ void CMod_LoadTerrain( gamelump_t *lump ) {
Com_Error( ERR_DROP, "CM_LoadMap: funny lump size in %s", cm.name );
numTerraPatches = lump->length / sizeof( *terraPatches );
cm.numTerrain = numTerraPatches;
cm.terrain = ( cTerrain_t * )Hunk_Alloc( cm.numTerrain * sizeof( cm.terrain[ 0 ] ) );
cm.terrain = ( cTerrain_t * )Hunk_Alloc( cm.numTerrain * sizeof( cm.terrain[ 0 ] ), h_dontcare);
// Prepare collision
CM_PrepareGenerateTerrainCollide();
@ -729,7 +729,7 @@ void CMod_LoadTerrainIndexes( gamelump_t *lump ) {
}
cm.numLeafTerrains = lump->length / sizeof( short );
cm.leafterrains = ( cTerrain_t ** )Hunk_Alloc( cm.numLeafTerrains * sizeof( cTerrain_t * ) );
cm.leafterrains = ( cTerrain_t ** )Hunk_Alloc( cm.numLeafTerrains * sizeof( cTerrain_t * ), h_dontcare);
in = ( short * )lump->buffer;
@ -852,7 +852,7 @@ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) {
cm.numLeafs = 1;
cm.numClusters = 1;
cm.numAreas = 1;
cm.cmodels = Hunk_Alloc( sizeof( *cm.cmodels ) );
cm.cmodels = Hunk_Alloc( sizeof( *cm.cmodels ), h_dontcare);
*checksum = 0;
return;
}

View file

@ -1130,11 +1130,11 @@ static void CM_PatchCollideFromGrid( cGrid_t *grid, patchCollide_t *pf ) {
// copy the results out
pf->numPlanes = numPlanes;
pf->numFacets = numFacets;
pf->facets = Hunk_Alloc( numFacets * sizeof( *pf->facets ) );
Com_Memcpy( pf->facets, facets, numFacets * sizeof( *pf->facets ) );
pf->planes = Hunk_Alloc( numPlanes * sizeof( *pf->planes ) );
Com_Memcpy( pf->planes, planes, numPlanes * sizeof( *pf->planes ) );
pf->numFacets = numFacets;
pf->facets = Hunk_Alloc(numFacets * sizeof(*pf->facets), h_dontcare);
Com_Memcpy(pf->facets, facets, numFacets * sizeof(*pf->facets));
pf->planes = Hunk_Alloc(numPlanes * sizeof(*pf->planes), h_dontcare);
Com_Memcpy(pf->planes, planes, numPlanes * sizeof(*pf->planes), h_dontcare);
}
@ -1191,7 +1191,7 @@ patchCollide_t *CM_GeneratePatchCollide( int width, int height, vec3_t *points,
// we now have a grid of points exactly on the curve
// the aproximate surface defined by these points will be
// collided against
pf = Hunk_Alloc( sizeof( *pf ) );
pf = Hunk_Alloc( sizeof( *pf ), h_dontcare );
ClearBounds( pf->bounds[0], pf->bounds[1] );
for ( i = 0 ; i < grid.width ; i++ ) {
for ( j = 0 ; j < grid.height ; j++ ) {

View file

@ -253,27 +253,34 @@ Cmd_Exec_f
===============
*/
void Cmd_Exec_f( void ) {
char *f;
int len;
qboolean quiet;
union {
char *c;
void *v;
} f;
char filename[MAX_QPATH];
quiet = !Q_stricmp(Cmd_Argv(0), "execq");
if (Cmd_Argc () != 2) {
Com_Printf ("exec <filename> : execute a script file\n");
Com_Printf ("exec%s <filename> : execute a script file%s\n",
quiet ? "q" : "", quiet ? " without notification" : "");
return;
}
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
len = FS_ReadFile( filename, (void **)&f );
if (!f) {
Com_Printf ("couldn't exec %s\n",Cmd_Argv(1));
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
FS_ReadFile( filename, &f.v);
if (!f.c) {
Com_Printf ("couldn't exec %s\n", filename);
return;
}
Com_Printf ("execing %s\n",Cmd_Argv(1));
if (!quiet)
Com_Printf ("execing %s\n", filename);
Cbuf_InsertText (f);
Cbuf_InsertText (f.c);
FS_FreeFile (f);
FS_FreeFile (f.v);
}
@ -446,7 +453,7 @@ void Cmd_WriteAliases( fileHandle_t f )
/*
=============================================================================
COMMAND EXECUTION
COMMAND EXECUTION
=============================================================================
*/
@ -456,6 +463,7 @@ typedef struct cmd_function_s
struct cmd_function_s *next;
const char *name;
xcommand_t function;
completionFunc_t complete;
} cmd_function_t;
@ -572,13 +580,38 @@ char *Cmd_Cmd(void)
return cmd_cmd;
}
/*
Replace command separators with space to prevent interpretation
This is a hack to protect buggy qvms
https://bugzilla.icculus.org/show_bug.cgi?id=3593
https://bugzilla.icculus.org/show_bug.cgi?id=4769
*/
void Cmd_Args_Sanitize(void)
{
int i;
for(i = 1; i < cmd_argc; i++)
{
char *c = cmd_argv[i];
if(strlen(c) > MAX_CVAR_VALUE_STRING - 1)
c[MAX_CVAR_VALUE_STRING - 1] = '\0';
while ((c = strpbrk(c, "\n\r;"))) {
*c = ' ';
++c;
}
}
}
/*
============
Cmd_TokenizeString
Parses the given string into command line tokens.
The text is copied to a seperate buffer and 0 characters
are inserted in the apropriate place, The argv array
The text is copied to a separate buffer and 0 characters
are inserted in the appropriate place, The argv array
will point into this temporary buffer.
============
*/
@ -600,7 +633,7 @@ static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) {
return;
}
Q_strncpyz( cmd_cmd, text_in, sizeof( cmd_cmd ) );
Q_strncpyz( cmd_cmd, text_in, sizeof(cmd_cmd) );
text = text_in;
textOut = cmd_tokenized;
@ -644,7 +677,7 @@ static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) {
cmd_argv[cmd_argc] = textOut;
cmd_argc++;
text++;
while( *text && *text != '"' ) {
while ( *text && *text != '"' ) {
*textOut++ = *text++;
}
*textOut++ = 0;
@ -704,6 +737,20 @@ void Cmd_TokenizeStringIgnoreQuotes( const char *text_in ) {
Cmd_TokenizeString2( text_in, qtrue );
}
/*
============
Cmd_FindCommand
============
*/
cmd_function_t *Cmd_FindCommand( const char *cmd_name )
{
cmd_function_t *cmd;
for( cmd = cmd_functions; cmd; cmd = cmd->next )
if( !Q_stricmp( cmd_name, cmd->name ) )
return cmd;
return NULL;
}
/*
============
Cmd_AddCommand
@ -713,24 +760,39 @@ void Cmd_AddCommand( const char *cmd_name, xcommand_t function ) {
cmd_function_t *cmd;
// fail if the command already exists
for ( cmd = cmd_functions ; cmd ; cmd=cmd->next ) {
if ( !strcmp( cmd_name, cmd->name ) ) {
// allow completion-only commands to be silently doubled
if ( function != NULL ) {
Com_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
}
return;
}
if( Cmd_FindCommand( cmd_name ) )
{
// allow completion-only commands to be silently doubled
if( function != NULL )
Com_Printf( "Cmd_AddCommand: %s already defined\n", cmd_name );
return;
}
// use a small malloc to avoid zone fragmentation
cmd = Z_TagMalloc( sizeof( cmd_function_t ), TAG_STRINGS_AND_COMMANDS );
cmd->name = CopyString( cmd_name );
cmd->function = function;
cmd->complete = NULL;
cmd->next = cmd_functions;
cmd_functions = cmd;
}
/*
============
Cmd_SetCommandCompletionFunc
============
*/
void Cmd_SetCommandCompletionFunc( const char *command, completionFunc_t complete ) {
cmd_function_t *cmd;
for( cmd = cmd_functions; cmd; cmd = cmd->next ) {
if( !Q_stricmp( command, cmd->name ) ) {
cmd->complete = complete;
return;
}
}
}
/*
============
Cmd_RemoveCommand
@ -758,6 +820,28 @@ void Cmd_RemoveCommand( const char *cmd_name ) {
}
}
/*
============
Cmd_RemoveCommandSafe
Only remove commands with no associated function
============
*/
void Cmd_RemoveCommandSafe( const char *cmd_name )
{
cmd_function_t *cmd = Cmd_FindCommand( cmd_name );
if( !cmd )
return;
if( cmd->function )
{
Com_Error( ERR_DROP, "Restricted source tried to remove "
"system command \"%s\"", cmd_name );
return;
}
Cmd_RemoveCommand( cmd_name );
}
/*
============
@ -772,6 +856,25 @@ void Cmd_CommandCompletion( void(*callback)(const char *s) ) {
}
}
/*
============
Cmd_CompleteArgument
============
*/
void Cmd_CompleteArgument( const char *command, char *args, int argNum ) {
cmd_function_t *cmd;
for( cmd = cmd_functions; cmd; cmd = cmd->next ) {
if( !Q_stricmp( command, cmd->name ) ) {
if ( cmd->complete ) {
cmd->complete( args, argNum );
}
return;
}
}
}
/*
============
Cmd_CompleteCommand
@ -952,6 +1055,17 @@ void Cmd_List_f (void)
Com_Printf ("%i commands\n", i);
}
/*
==================
Cmd_CompleteCfgName
==================
*/
void Cmd_CompleteCfgName( char *args, int argNum ) {
if( argNum == 2 ) {
Field_CompleteFilename( "", "cfg", qfalse, qtrue );
}
}
/*
============
Cmd_Init

View file

@ -894,60 +894,43 @@ Com_GetSystemEvent
================
*/
sysEvent_t Com_GetSystemEvent( void )
sysEvent_t Com_GetSystemEvent(void)
{
sysEvent_t ev;
char *s;
msg_t netmsg;
netadr_t adr;
sysEvent_t ev;
char* s;
// return if we have data
if ( eventHead > eventTail )
{
eventTail++;
return eventQueue[ ( eventTail - 1 ) & MASK_QUEUED_EVENTS ];
}
// return if we have data
if (eventHead > eventTail)
{
eventTail++;
return eventQueue[(eventTail - 1) & MASK_QUEUED_EVENTS];
}
// check for console commands
s = Sys_ConsoleInput();
if ( s )
{
char *b;
size_t len;
// check for console commands
s = Sys_ConsoleInput();
if (s)
{
char* b;
int len;
len = strlen( s ) + 1;
b = ( char * )Z_Malloc( len );
strcpy( b, s );
Com_QueueEvent( 0, SE_CONSOLE, 0, 0, len, b );
}
len = strlen(s) + 1;
b = (char*)Z_Malloc(len);
strcpy(b, s);
Com_QueueEvent(0, SE_CONSOLE, 0, 0, len, b);
}
// check for network packets
MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) );
if ( Sys_GetPacket ( &adr, &netmsg ) )
{
netadr_t *buf;
size_t len;
// return if we have data
if (eventHead > eventTail)
{
eventTail++;
return eventQueue[(eventTail - 1) & MASK_QUEUED_EVENTS];
}
// copy out to a seperate buffer for qeueing
len = sizeof( netadr_t ) + netmsg.cursize;
buf = ( netadr_t * )Z_Malloc( len );
*buf = adr;
memcpy( buf+1, netmsg.data, netmsg.cursize );
Com_QueueEvent( 0, SE_PACKET, 0, 0, len, buf );
}
// create an empty event to return
memset(&ev, 0, sizeof(ev));
ev.evTime = Sys_Milliseconds();
// return if we have data
if ( eventHead > eventTail )
{
eventTail++;
return eventQueue[ ( eventTail - 1 ) & MASK_QUEUED_EVENTS ];
}
// create an empty event to return
memset( &ev, 0, sizeof( ev ) );
ev.evTime = Sys_Milliseconds();
return ev;
return ev;
}
/*
@ -973,7 +956,7 @@ sysEvent_t Com_GetRealEvent( void ) {
}
}
} else {
ev = Sys_GetEvent();
ev = Com_GetSystemEvent();
// write the journal value out if needed
if ( com_journal->integer == 1 ) {

View file

@ -3766,13 +3766,14 @@ void FS_Flush( fileHandle_t f ) {
}
void FS_FilenameCompletion( const char *dir, const char *ext,
qboolean stripExt, void(*callback)(const char *s) ) {
qboolean stripExt, void(*callback)(const char *s), qboolean allowNonPureFilesOnDisk ) {
char **filenames;
int nfiles;
int i;
char filename[ MAX_STRING_CHARS ];
filenames = FS_ListFilteredFiles( dir, ext, NULL, qfalse, &nfiles );
// FIXME: allowNonPureFilesOnDisk
filenames = FS_ListFilteredFiles( dir, ext, NULL, qtrue, &nfiles );
FS_SortFileList( filenames, nfiles );

View file

@ -393,7 +393,7 @@ Hunk_Alloc
Allocate permanent (until the hunk is cleared) memory
=================
*/
void* Hunk_AllocDebug(size_t size, const char* label, const char* file, int line) {
void* Hunk_AllocDebug(int size, ha_pref preference, const char* label, const char* file, int line) {
void* ptr;
ptr = Z_TagMalloc(size, TAG_STATIC);
@ -402,7 +402,7 @@ void* Hunk_AllocDebug(size_t size, const char* label, const char* file, int line
return ptr;
}
#endif
#else
/*
=================
@ -411,7 +411,7 @@ Hunk_Alloc
Allocate permanent (until the hunk is cleared) memory
=================
*/
void *Hunk_Alloc( size_t size ) {
void *Hunk_Alloc( int size, ha_pref preference) {
void *ptr;
ptr = Z_TagMalloc( size, TAG_STATIC );
@ -420,6 +420,8 @@ void *Hunk_Alloc( size_t size ) {
return ptr;
}
#endif
/*
=================
Hunk_Clear
@ -440,7 +442,7 @@ Multiple files can be loaded in temporary memory.
When the files-in-use count reaches zero, all temp memory will be deleted
=================
*/
void *Hunk_AllocateTempMemory( size_t size ) {
void *Hunk_AllocateTempMemory(int size ) {
return Z_TagMalloc( size, TAG_TEMP );
}

View file

@ -371,6 +371,19 @@ typedef enum {
#define UI_INVERSE 0x00002000
#define UI_PULSE 0x00004000
typedef enum {
h_high,
h_low,
h_dontcare
} ha_pref;
#ifdef HUNK_DEBUG
#define Hunk_Alloc( size, preference ) Hunk_AllocDebug(size, preference, #size, __FILE__, __LINE__)
void *Hunk_AllocDebug( int size, ha_pref preference, const char *label, const char *file, int line );
#else
void *Hunk_Alloc( int size, ha_pref preference );
#endif
#define Com_Memset memset
#define Com_Memcpy memcpy

View file

@ -385,6 +385,8 @@ typedef enum {
TRAP_TESTPRINTFLOAT
} sharedTraps_t;
typedef intptr_t (QDECL *vmMainProc)(int callNum, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11);
void VM_Init( void );
vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret );
@ -392,7 +394,9 @@ vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
void VM_Free( vm_t *vm );
void VM_Clear(void);
vm_t *VM_Restart( vm_t *vm );
void VM_Forced_Unload_Start(void);
void VM_Forced_Unload_Done(void);
vm_t *VM_Restart(vm_t *vm, qboolean unpure);
intptr_t QDECL VM_Call( vm_t *vm, int callNum, ... );
@ -404,12 +408,9 @@ void *VM_ExplicitArgPtr( vm_t *vm, intptr_t intValue );
#define VMA(x) VM_ArgPtr(args[x])
static ID_INLINE float _vmf(intptr_t x)
{
union {
intptr_t l;
float f;
} t;
t.l = x;
return t.f;
floatint_t fi;
fi.i = (int)x;
return fi.f;
}
#define VMF(x) _vmf(args[x])
@ -483,6 +484,7 @@ void Cmd_SetCommandCompletionFunc( const char *command,
void Cmd_CompleteArgument( const char *command, char *args, int argNum );
void Cmd_CompleteCfgName( char *args, int argNum );
void Cmd_CommandCompletion( void(*callback)(const char *s) );
const char* Cmd_CompleteCommandByNumber(const char* partial, int number);
// callback with each valid string
int Cmd_Argc (void);
@ -795,6 +797,30 @@ extern cvar_t *fs_basepath;
/*
==============================================================
Edit fields and command line history/completion
==============================================================
*/
#define MAX_EDIT_LINE 256
typedef struct {
int cursor;
int scroll;
int widthInChars;
char buffer[MAX_EDIT_LINE];
} field_t;
void Field_Clear( field_t *edit );
void Field_AutoComplete( field_t *edit );
void Field_CompleteKeyname( void );
void Field_CompleteFilename( const char *dir,
const char *ext, qboolean stripExt, qboolean allowNonPureFilesOnDisk );
void Field_CompleteCommand( char *cmd,
qboolean doCommands, qboolean doCvars );
void Field_CompletePlayerName( const char **names, int count );
/*
==============================================================
MISC
==============================================================
@ -911,6 +937,15 @@ extern cvar_t *sv_paused;
extern cvar_t *cl_packetdelay;
extern cvar_t *sv_packetdelay;
extern cvar_t* com_gamename;
extern cvar_t* com_protocol;
#ifdef LEGACY_PROTOCOL
extern cvar_t* com_legacyprotocol;
#endif
#ifndef DEDICATED
extern cvar_t* con_autochat;
#endif
// com_speeds times
extern int time_game;
extern int time_frontend;
@ -972,8 +1007,8 @@ const char *Z_EmptyStringPointer( void );
const char *Z_NumberStringPointer( int iNum );
#ifndef _DEBUG_MEM
void *Z_TagMalloc( size_t size, int tag );
void *Z_Malloc( size_t size );
void *Z_TagMalloc(int size, int tag );
void *Z_Malloc(int size );
void Z_Free( void *ptr );
#endif
@ -985,11 +1020,7 @@ int Z_AvailableMemory( void );
void Z_LogHeap( void );
void Z_Meminfo_f( void );
#ifdef HUNK_DEBUG
void* Hunk_AllocDebug(size_t size, const char* label, const char* file, int line);
#endif
void *Hunk_Alloc( size_t size );
void *Hunk_AllocateTempMemory(size_t size );
void *Hunk_AllocateTempMemory(int size );
void Hunk_FreeTempMemory( void *buf );
void Hunk_Clear( void );
@ -1208,10 +1239,10 @@ qboolean Sys_StringToAdr( const char *s, netadr_t *a );
qboolean Sys_IsLANAddress (netadr_t adr);
void Sys_ShowIP(void);
void Sys_Mkdir( const char *path );
char *Sys_Cwd( void );
void Sys_SetDefaultInstallPath(const char *path);
char *Sys_DefaultInstallPath( void );
qboolean Sys_Mkdir( const char *path );
char *Sys_Cwd( void );
void Sys_SetDefaultInstallPath(const char *path);
char *Sys_DefaultInstallPath( void );
#ifdef MACOS_X
char *Sys_DefaultAppPath(void);

View file

@ -1253,7 +1253,7 @@ void SV_Loadgame_f( void )
if( com_cl_running && com_cl_running->integer &&
#ifdef CLIENT
cls.state != CA_DISCONNECTED && cg_gametype->integer ||
clc.state != CA_DISCONNECTED && cg_gametype->integer ||
#endif
com_sv_running && com_sv_running->integer && g_gametype->integer )
{
@ -1374,7 +1374,7 @@ qboolean SV_AllowSaveGame( void )
Com_DPrintf( "You must be in game to save.\n" );
}
#ifdef CLIENT
else if( cls.state != CA_DISCONNECTED && cg_gametype->integer )
else if( clc.state != CA_DISCONNECTED && cg_gametype->integer )
{
Com_DPrintf( "Can't savegame in a multiplayer game\n" );
}

View file

@ -635,7 +635,7 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
SV_InitGameProgs();
// allocate the snapshot entities on the hunk
svs.snapshotEntities = Hunk_Alloc( sizeof( entityState_t )*svs.numSnapshotEntities );
svs.snapshotEntities = Hunk_Alloc( sizeof( entityState_t )*svs.numSnapshotEntities, h_dontcare);
svs.nextSnapshotEntities = 0;
// wipe the entire per-level structure

View file

@ -27,6 +27,109 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
static void* game_library = NULL;
static void* cgame_library = NULL;
/*
==============
SaveRegistryInfo
==============
*/
qboolean SaveRegistryInfo(qboolean user, const char* pszName, void* pvBuf, long lSize)
{
STUB_DESC("not implemented");
return qfalse;
}
/*
==============
LoadRegistryInfo
==============
*/
qboolean LoadRegistryInfo(qboolean user, const char* pszName, void* pvBuf, long* plSize)
{
STUB_DESC("not implemented");
return qfalse;
}
/*
==============
IsFirstRun
==============
*/
qboolean IsFirstRun(void)
{
STUB_DESC("wtf");
return qfalse;
}
/*
==============
IsNewConfig
==============
*/
qboolean IsNewConfig(void)
{
STUB_DESC("wtf");
return qfalse;
}
/*
==============
IsSafeMode
==============
*/
qboolean IsSafeMode(void)
{
STUB_DESC("wtf");
return qfalse;
}
/*
==============
ClearNewConfigFlag
==============
*/
void ClearNewConfigFlag(void)
{
}
/*
==============
Sys_GetWholeClipboard
==============
*/
const char* Sys_GetWholeClipboard(void)
{
return NULL;
}
/*
==============
Sys_SetClipboard
==============
*/
void Sys_SetClipboard(const char* contents)
{
}
/*
================
RecoverLostAutodialData
================
*/
void RecoverLostAutodialData(void)
{
// FIXME: stub
}
/*
==============
Sys_CloseMutex
==============
*/
void Sys_CloseMutex(void)
{
// FIXME: stub
}
/*
=================
Sys_UnloadGame

View file

@ -0,0 +1,50 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "../sys_local.h"
/*
==============
Sys_PumpMessageLoop
==============
*/
void Sys_PumpMessageLoop(void)
{
}
/*
==================
SetNormalThreadPriority
==================
*/
void SetNormalThreadPriority(void)
{
}
/*
==================
SetBelowNormalThreadPriority
==================
*/
void SetBelowNormalThreadPriority(void)
{
}

View file

@ -0,0 +1,65 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "../sys_local.h"
#include <Windows.h>
/*
==============
Sys_PumpMessageLoop
==============
*/
void Sys_PumpMessageLoop(void)
{
MSG msg;
while (PeekMessageA(&msg, 0, 0, 0, 0))
{
if (!GetMessageA(&msg, 0, 0, 0)) {
Com_Quit_f();
}
TranslateMessage(&msg);
DispatchMessageA(&msg);
}
}
/*
==================
SetNormalThreadPriority
==================
*/
void SetNormalThreadPriority(void)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
}
/*
==================
SetBelowNormalThreadPriority
==================
*/
void SetBelowNormalThreadPriority(void)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
}

View file

@ -661,7 +661,7 @@ qboolean UIWindowManager::KeyEvent
{
UIWidget *selwidget = NULL;
if( key == K_TAB && ( uii.Sys_IsKeyDown( K_LCTRL ) || uii.Sys_IsKeyDown( K_DEL ) ) )
if( key == K_TAB && ( uii.Sys_IsKeyDown( K_CTRL ) || uii.Sys_IsKeyDown( K_DEL ) ) )
{
UIWidget *wid;