Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bishop-333 committed Nov 9, 2024
2 parents 4adf1a3 + f259765 commit b4f9baf
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 23 deletions.
15 changes: 15 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ To compile with Vulkan backend - clean solution, right click on `quake3e` projec

---

### windows/msys2

Install the build dependencies:

`MSYS2 MSYS`

* pacman -Syu
* pacman -S make mingw-w64-x86_64-gcc mingw-w64-i686-gcc

Use `MSYS2 MINGW32` or `MSYS2 MINGW64` depending on your target system, then copy resulting binaries from created `build` directory or use command:

`make install DESTDIR=<path_to_game_files>`

---

### windows/mingw

All build dependencies (libraries, headers) are bundled-in
Expand Down
2 changes: 1 addition & 1 deletion code/client/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ void CL_InitInput( void ) {
cl_anglespeedkey = Cvar_Get( "cl_anglespeedkey", "1.5", 0 );
Cvar_SetDescription( cl_anglespeedkey, "Set the speed that the direction keys (not mouse) change the view angle." );

cl_maxpackets = Cvar_Get ("cl_maxpackets", "60", CVAR_ARCHIVE );
cl_maxpackets = Cvar_Get ("cl_maxpackets", "125", CVAR_ARCHIVE );
Cvar_CheckRange( cl_maxpackets, "15", "125", CV_INTEGER );
Cvar_SetDescription( cl_maxpackets, "Set how many client packets are sent to the server per second, can't exceed \\com_maxFPS." );
cl_packetdup = Cvar_Get( "cl_packetdup", "1", CVAR_ARCHIVE_ND );
Expand Down
7 changes: 4 additions & 3 deletions code/qcommon/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void Cbuf_Execute( void )

if ( cmd_wait > 0 ) {
// delay command buffer execution
cmd_wait--;
return;
}

Expand Down Expand Up @@ -357,9 +356,11 @@ void Cbuf_Execute( void )
Cbuf_Wait
============
*/
qboolean Cbuf_Wait( void )
void Cbuf_Wait( void )
{
return (cmd_wait > 0) ? qtrue : qfalse;
if ( cmd_wait > 0 ) {
--cmd_wait;
}
}


Expand Down
25 changes: 21 additions & 4 deletions code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3770,6 +3770,9 @@ void Com_Init( char *commandLine ) {
const char *s;
int qport;

// get the initial time base
Sys_Milliseconds();

Com_Printf( "%s %s %s\n", SVN_VERSION, PLATFORM_STRING, __DATE__ );

if ( Q_setjmp( abortframe ) ) {
Expand Down Expand Up @@ -4036,7 +4039,8 @@ void Com_Init( char *commandLine ) {
// set com_frameTime so that if a map is started on the
// command line it will still be able to count on com_frameTime
// being random enough for a serverid
lastTime = com_frameTime = Com_Milliseconds();
// lastTime = com_frameTime = Com_Milliseconds();
Com_FrameInit();

if ( !com_errorEntered )
Sys_ShowConsole( com_viewlog->integer, qfalse );
Expand All @@ -4049,6 +4053,10 @@ void Com_Init( char *commandLine ) {
com_fullyInitialized = qtrue;

Com_Printf( "--- Common Initialization Complete ---\n" );

NET_Init();

Com_Printf( "Working directory: %s\n", Sys_Pwd() );
}


Expand Down Expand Up @@ -4211,6 +4219,15 @@ static int Com_TimeVal( int minMsec )
return timeVal;
}

/*
=================
Com_FrameInit
=================
*/
void Com_FrameInit( void )
{
lastTime = com_frameTime = Com_Milliseconds();
}

/*
=================
Expand Down Expand Up @@ -4396,9 +4413,7 @@ void Com_Frame( qboolean noDelay ) {
}
Com_EventLoop();

if ( !Cbuf_Wait() ) {
Cbuf_Execute();
}
Cbuf_Execute();

//
// client side
Expand All @@ -4417,6 +4432,8 @@ void Com_Frame( qboolean noDelay ) {

NET_FlushPacketQueue( 0 );

Cbuf_Wait();

//
// report timing information
//
Expand Down
3 changes: 2 additions & 1 deletion code/qcommon/qcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void Cbuf_Execute( void );
// Normally called once per frame, but may be explicitly invoked.
// Do not call inside a command function, or current args will be destroyed.

qboolean Cbuf_Wait( void );
void Cbuf_Wait( void );
// Checks if wait command timeout remaining

//===========================================================================
Expand Down Expand Up @@ -1136,6 +1136,7 @@ unsigned int Com_TouchMemory( void );

// commandLine should not include the executable name (argv[0])
void Com_Init( char *commandLine );
void Com_FrameInit( void );
void Com_Frame( qboolean noDelay );

/*
Expand Down
2 changes: 1 addition & 1 deletion code/renderer/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ static void R_Register( void )
ri.Cvar_CheckRange( r_mapGreyScale, "-1", "1", CV_FLOAT );
ri.Cvar_SetDescription(r_mapGreyScale, "Desaturate world map textures only, works independently from \\r_greyscale, negative values only desaturate lightmaps.");

r_subdivisions = ri.Cvar_Get( "r_subdivisions", "4", CVAR_ARCHIVE_ND | CVAR_LATCH );
r_subdivisions = ri.Cvar_Get( "r_subdivisions", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
ri.Cvar_SetDescription(r_subdivisions, "Distance to subdivide bezier curved surfaces. Higher values mean less subdivision and less geometric complexity.");

r_maxpolys = ri.Cvar_Get( "r_maxpolys", XSTRING( MAX_POLYS ), CVAR_LATCH );
Expand Down
2 changes: 1 addition & 1 deletion code/renderervk/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ static void R_Register( void )
ri.Cvar_CheckRange( r_mapGreyScale, "-1", "1", CV_FLOAT );
ri.Cvar_SetDescription(r_mapGreyScale, "Desaturate world map textures only, works independently from \\r_greyscale, negative values only desaturate lightmaps.");

r_subdivisions = ri.Cvar_Get( "r_subdivisions", "4", CVAR_ARCHIVE_ND | CVAR_LATCH );
r_subdivisions = ri.Cvar_Get( "r_subdivisions", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
ri.Cvar_SetDescription(r_subdivisions, "Distance to subdivide bezier curved surfaces. Higher values mean less subdivision and less geometric complexity.");

r_maxpolys = ri.Cvar_Get( "r_maxpolys", XSTRING( MAX_POLYS ), CVAR_LATCH );
Expand Down
2 changes: 2 additions & 0 deletions code/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ static void SV_MapRestart_f( void ) {
// run a few frames to allow everything to settle
for ( i = 0; i < 3; i++ )
{
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
}
Expand Down Expand Up @@ -355,6 +356,7 @@ static void SV_MapRestart_f( void ) {
}

// run another frame to allow things to look at all the players
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
svs.time += 100;
Expand Down
5 changes: 5 additions & 0 deletions code/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {

// run a few frames to allow everything to settle
for ( i = 0; i < 3; i++ ) {
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
SV_BotFrame( sv.time );
Expand Down Expand Up @@ -601,6 +602,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
}

// run another frame to allow things to look at all the players
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
SV_BotFrame( sv.time );
Expand Down Expand Up @@ -680,6 +682,9 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
Com_Printf ("-----------------------------------\n");

Sys_SetStatus( "Running map %s", mapname );

// suppress hitch warning
Com_FrameInit();
}


Expand Down
6 changes: 0 additions & 6 deletions code/unix/unix_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,7 @@ int main( int argc, const char* argv[] )
// memset( &eventQue[0], 0, sizeof( eventQue ) );
// memset( &sys_packetReceived[0], 0, sizeof( sys_packetReceived ) );

// get the initial time base
Sys_Milliseconds();

Com_Init( cmdline );
NET_Init();

Com_Printf( "Working directory: %s\n", Sys_Pwd() );

// Sys_ConsoleInputInit() might be called in signal handler
// so modify/init any cvars here
Expand Down
6 changes: 0 additions & 6 deletions code/win32/win_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,13 +807,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin

SetUnhandledExceptionFilter( ExceptionFilter );

// get the initial time base
Sys_Milliseconds();

Com_Init( sys_cmdline );
NET_Init();

Com_Printf( "Working directory: %s\n", Sys_Pwd() );

// hide the early console since we've reached the point where we
// have a working graphics subsystems
Expand Down
37 changes: 37 additions & 0 deletions docs/quake3e-changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
14-Oct-2024:
* Common: improved 'wait' command handling, now it will wait exact amount of client/server frames
* Common: allow src and dest buffers to be overlapped in Q_strncpy() for QVM compatibility reasons
* Common: Use nanosleep(2) instead of usleep(3) - usleep(3) was declared obsolete in POSIX.1-2001 and removed in POSIX.1-2008 and nanosleep(2) was recommended to be used instead.
* Server: cache sv_maxclients value to avoid potential crashes caused by VMs changing it at runtime
* Server: save latched sv_pure state to dedicated variable
* Server: suppress false hitch warning during map load
* Server: reworked/optimized gamestate retransmission/acknowledgment
* Server: don't change serverid during map restart
* Server: don't spawn loading clients during map restart
* Server: fix server resource leaks during client reconnect
* Client: rewrote CL_WritePacket() to allow proper packet duplication - which was intended by multiple function calls before
* Client: Strip cl_aviPipeFormat
* Win32: report actual color bits and correct PFD count
* X11: request alpha bits for >=24 bit color profiles
* Docs: Create quake3e.md, update quake3e.htm
* Vulkan: increase MAX_IMAGE_CHUNKS from 48 to 56
* Vulkan: added missing texture mode setup in GL_SetDefaultState()
* Vulkan: disabled r_ext_alpha_to_coverage for now due to rendering artifacts on beyond4-wfa map
* Vulkan: do not set transient flag for depth/stencil attachment when bloom (and thus - post-bloom pass) is enabled
* Vulkan: fix screenmap image layout transitions
* Vulkan: re-create swapchain on VK_SUBOPTIMAL_KHR as well
* Vulkan: improve flare visibility test code
* Vulkan: fixed various image layout transition synchronization issues
* Vulkan: applied fixes to some "Best Practices" validation layer errors
* Vulkan: add \r_bloom_threshold_mode and \r_bloom_modulate cvars, similar to OpenGL renderer
* OpenGL: allow all static tcGens/tcMods for VBO/environment mapping (assuming that we have all tcMod corrections applied before)
* Renderers: use glConfig.stencilBits instead of dereferencing \r_stencilbits cvar
* Renderers: apply lightmap texcoord correction only if lightmap is actually set
* Renderers: apply additional lightmap texcoord corrections when needed
* Renderers: do not merge single lightmap
* Filesystem: allow multiple basegames in fs_basegame cvar separated by '/'
* Filesystem: reset fs_basegame cvar to last separated item
* Makefile: fix grep warnings in macOS builds
* macOS: app will search for pk3 inside and next to the app bundle
* Use SDL_WINDOW_FULLSCREEN_DESKTOP on macOS

14-Oct-2023:
* Added many CVAR descriptions
* Added "\vid_restart fast" - to perform fast \vid_restart in current gfx context
Expand Down

0 comments on commit b4f9baf

Please sign in to comment.