This commit is contained in:
Christoph Oelckers 2013-11-11 09:58:55 +01:00
commit 0b1ccfb582
5 changed files with 72 additions and 30 deletions

View file

@ -3,6 +3,7 @@ project(GZDoom)
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} )
include( CreateLaunchers )
include( FindPackageHandleStandardArgs )
# Generator expression are available some time in CMake 2.8. Due to
# cmake_minimum_required, we can assume a minor version of > 7 implies major >= 2
@ -72,6 +73,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package( BZip2 )
find_package( JPEG )
find_package( ZLIB )
# GME
find_path( GME_INCLUDE_DIR gme.h )
find_library( GME_LIBRARIES gme )
mark_as_advanced( GME_INCLUDE_DIR GME_LIBRARIES )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GME
REQUIRED_VARS GME_LIBRARIES GME_INCLUDE_DIR
)
if( MSVC )
# Eliminate unreferenced functions and data
@ -126,6 +134,7 @@ set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" )
option(FORCE_INTERNAL_ZLIB "Use internal zlib")
option(FORCE_INTERNAL_JPEG "Use internal jpeg")
option(FORCE_INTERNAL_BZIP2 "Use internal bzip2")
option(FORCE_INTERNAL_GME "Use internal gme" ON)
if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB )
message( STATUS "Using system zlib" )
@ -157,11 +166,19 @@ else( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 )
set( BZIP2_LIBRARY bz2 )
endif( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 )
if( GME_FOUND AND NOT FORCE_INTERNAL_GME )
message( STATUS "Using system gme library ${GME_INCLUDE_DIR}" )
else( GME_FOUND AND NOT FORCE_INTERNAL_GME )
message( STATUS "Using internal gme library" )
add_subdirectory( game-music-emu )
set( GME_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/game-music-emu" )
set( GME_LIBRARIES gme )
endif( GME_FOUND AND NOT FORCE_INTERNAL_GME )
set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lzma/C" )
add_subdirectory( lzma )
add_subdirectory( tools )
add_subdirectory( game-music-emu )
add_subdirectory( dumb )
add_subdirectory( gdtoa )
add_subdirectory( wadsrc )

View file

@ -534,8 +534,8 @@ add_custom_target( revision_check ALL
# Libraries ZDoom needs
message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${FMOD_LIBRARY}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${FMOD_LIBRARY}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" )
if( FLUIDSYNTH_FOUND )
if( NOT DYN_FLUIDSYNTH)
@ -1179,7 +1179,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
set( ZDOOM_LIBS ${ZDOOM_LIBS} nsl socket)
endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
target_link_libraries( zdoom ${ZDOOM_LIBS} gme gdtoa dumb lzma )
target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma )
include_directories( .
g_doom
g_heretic
@ -1193,7 +1193,6 @@ include_directories( .
thingdef
timidity
xlat
../game-music-emu/gme
../gdtoa
../dumb/include
${CMAKE_BINARY_DIR}/gdtoa

View file

@ -705,8 +705,6 @@ void GetPackets (void)
continue; // extra setup packet
}
lastglobalrecvtime = I_GetTime (false); //Update the last time a packet was recieved
netnode = doomcom.remotenode;
netconsole = playerfornode[netnode] & ~PL_DRONE;
@ -1827,30 +1825,39 @@ void TryRunTics (void)
I_Error ("TryRunTics: lowtic < gametic");
// [Ed850] Check to see the last time a packet was recieved.
// If it's longer then 3 seconds, a node has likely stalled. Check which one and re-request its last packet.
// If it's longer then 3 seconds, a node has likely stalled.
if(I_GetTime(false) - lastglobalrecvtime >= TICRATE*3)
{
int latenode = 0; // Node 0 is the local player, and should always be the highest
lastglobalrecvtime = I_GetTime(false); //Bump the count
if(NetMode == NET_PeerToPeer || consoleplayer == Net_Arbitrator)
{
//Keep the local node in the for loop so we can still log any cases where the local node is /somehow/ late.
//However, we don't send a resend request for sanity reasons.
for (i = 0; i < doomcom.numnodes; i++)
if (nodeingame[i] && nettics[i] < nettics[latenode])
latenode = i;
}
else if (nodeingame[nodeforplayer[Net_Arbitrator]] &&
nettics[nodeforplayer[Net_Arbitrator]] < nettics[0])
{ // Likely a packet server game. Only check the packet host.
latenode = Net_Arbitrator;
}
{
if (nodeingame[i] && nettics[i] < gametic + counts)
{
if (debugfile)
fprintf (debugfile, "lost tics from %i (%i to %i)\n",
latenode, nettics[latenode], gametic);
if(latenode != 0) // Send resend request to late node (if not yourself... somehow). Also mark the node as waiting to display it in the hud.
remoteresend[latenode] = players[playerfornode[latenode]].waiting = hadlate = true;
fprintf (debugfile, "%i is slow (%i to %i)\n",
i, nettics[i], gametic+counts);
//Send resend request to the late node. Also mark the node as waiting to display it in the hud.
if(i != 0)
remoteresend[i] = players[playerfornode[i]].waiting = hadlate = true;
}
else
players[playerfornode[i]].waiting = false;
}
}
else
{ //Send a resend request to the Arbitrator, as it's obvious we are stuck here.
if (debugfile)
fprintf (debugfile, "Arbitrator is slow (%i to %i)\n",
Net_Arbitrator, nettics[Net_Arbitrator], gametic+counts);
//Send resend request to the Arbitrator. Also mark the Arbitrator as waiting to display it in the hud.
if(i != 0)
remoteresend[Net_Arbitrator] = players[playerfornode[Net_Arbitrator]].waiting = hadlate = true;
}
}
// don't stay in here forever -- give the menu a chance to work
@ -1862,12 +1869,11 @@ void TryRunTics (void)
}
}
if (hadlate)
{
//Tic lowtic is high enough to process this gametic. Clear all possible waiting info
hadlate = false;
for (i = 0; i < MAXPLAYERS; i++)
players[i].waiting = false;
}
lastglobalrecvtime = I_GetTime (false); //Update the last time the game tic'd over
// run the count tics
if (counts > 0)

View file

@ -422,7 +422,27 @@ void I_SetIWADInfo ()
void I_PrintStr (const char *cp)
{
fputs (cp, stdout);
// Strip out any color escape sequences before writing to the log file
char * copy = new char[strlen(cp)+1];
const char * srcp = cp;
char * dstp = copy;
while (*srcp != 0)
{
if (*srcp!=0x1c && *srcp!=0x1d && *srcp!=0x1e && *srcp!=0x1f)
{
*dstp++=*srcp++;
}
else
{
if (srcp[1]!=0) srcp+=2;
else break;
}
}
*dstp=0;
fputs (copy, stdout);
delete [] copy;
fflush (stdout);
}

View file

@ -40,7 +40,7 @@
#include "i_musicinterns.h"
#include "c_cvars.h"
#include "critsec.h"
#include "gme.h"
#include <gme/gme.h>
#include "v_text.h"
// MACROS ------------------------------------------------------------------