improved include order to fix some compile errors using mingw g++ git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10384 d7cf8633-e32d-0410-b094-e92efae38249
Detect appended data to the DP executable. If it's a pk3, it is added FIRST (TODO: should this be LAST) into the search path. If it contains a darkplaces.opt text file, its contents are parsed and used as extra command line arguments. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10034 d7cf8633-e32d-0410-b094-e92efae38249
fix another win32 time typo git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10018 d7cf8633-e32d-0410-b094-e92efae38249
refactor timing, so that timing code is in sys_shared.c. Changes in behaviour: Win32 now prefers select() (PLEASE TEST), SDL timers can be overridden by sys_usequeryperformancecounter or sys_useclockgettime, new cvar sys_debugtime git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10013 d7cf8633-e32d-0410-b094-e92efae38249
fix more C++ warnings/errors in MSVC git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9204 d7cf8633-e32d-0410-b094-e92efae38249
disabled main in sys_win.c at O.Sezer's recommendation (vid_wgl.c provides WinMain in the same build target - making this pointless) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8691 d7cf8633-e32d-0410-b094-e92efae38249
fix whitespace handling: treat ONLY the following characters as whitespace: NUL, TAB, LF, CR, SPC Alternatively, there is commented out macro code in quakedef.h to accept any chars in 0..32 as whitespace. Previously: 0..32 and 128..255 (due to signed char) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8606 d7cf8633-e32d-0410-b094-e92efae38249
also reject time stepping > 30 minutes (this threshold is < 1 hour to reject daylight saving time changes, but > any "typical" load time of a map) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8355 d7cf8633-e32d-0410-b094-e92efae38249
disabled QHOST by default (can be enabled with an edit to sys_win.c and the re-addition of conproc.c), I don't think anyone ever uses it git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8240 d7cf8633-e32d-0410-b094-e92efae38249
fixed Sys_Error popups in -dedicated console setup code so that they actually do appear (by forcing cls.state to ca_disconnected) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8239 d7cf8633-e32d-0410-b094-e92efae38249
comment out a line to make the darkplaces.exe -dedicated console show up, apparently the initial houtput is never 0 or invalid on Windows XP, which causes it to never open a console - but then error out because the hinput is invalid git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8238 d7cf8633-e32d-0410-b094-e92efae38249
added #ifdef SUPPORTDIRECTX checks around all the dinput and dsound code - this means that dinput and dsound is not removed but is disabled, making it easier to compile with Dev-C++ and stock MSVS, this may have bad consequences (some people swear by -dinput, and dsound was used by default unless -wavonly was specified, so this is a behavior change) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8118 d7cf8633-e32d-0410-b094-e92efae38249
added experimental cl_alwayssleep cvar which calls Sys_Sleep(0) at the end of each frame fixed a bug in the main loop that made Sys_Sleep be called with milliseconds when it takes microseconds git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8087 d7cf8633-e32d-0410-b094-e92efae38249
Changed Win32 console logic to only allocate a console when a dedicated server. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7776 d7cf8633-e32d-0410-b094-e92efae38249
Changed Win32 code to also support compilation of the executable for the console subsystem. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7764 d7cf8633-e32d-0410-b094-e92efae38249
changed Sys_Sleep functions to take microseconds instead of milliseconds (this may mildly improve sleep accuracy on Linux dedicated servers) modified the host main loop to check for server packets each iteration of the loop rather than at the server framerate (this doesn't accomplish much yet but has potential) added sv_checkforpacketsduringsleep cvar to enable use of select() instead of Sys_Sleep() git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7020 d7cf8633-e32d-0410-b094-e92efae38249
Removed all calls to strcpy; most of them are now calls to strlcpy or memcpy. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6544 d7cf8633-e32d-0410-b094-e92efae38249
- the Linux sound modules (ALSA and OSS) are now write-based, instead of mmap-based. It should fix the problems with inboard sound cards - added 3 cvars controlling the sound output format: snd_speed, snd_channels, and snd_width (default values: 48000, 2, and 2 respectively). They're saved in the config file. - the checks for command line options and environment variables modifying the sound output format are now common to all modules. The command line options supported are: -sndmono, -sndstereo, -sndquad, -sndspeed, and -sndbits. The environment variables supported are: QUAKE_SOUND_CHANNELS, QUAKE_SOUND_SPEED, and QUAKE_SOUND_SAMPLEBITS. - added a (still dumb) function to figure out a better sound format when the initialization of the sound card failed - sound modules can now suggest a sound format if the initialization of the sound card failed - you can now do a "snd_restart" while having modified snd_width and/or snd_channel. Doing a snd_restart with a modified snd_speed isn't yet supported, it will fall back to the previous speed - The WGL video module was blocking the sound output when the application window lost the focus. Now, this code is shared and the AGL, GLX and SDL video modules implement such a mecanism - A lot of minor fixes, changes, factorizations and rewrites all over the sound engine code and its modules - added CeilPowerOf2() in the math library - fixed BSDmakefile for NetBSD git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6415 d7cf8633-e32d-0410-b094-e92efae38249
rewrote timing code, now a much better and very different sleeping method, no longer wastes any cpu time changed timing code to have independent sleeping for client and server frames in a listen server changed console execution to occur in sync with server frames if a server is running, this fixes frikbot loading of .way files eliminated several host_* variables, replaced host_realframetime with cl.realframetime (which is how long since the last client frame) removed the clamping of sys_ticrate to >= 0.1, so now sys_ticrate 0 is allowed (run as fast as possible), as well as silly values like 0.001 removed serverprofile cvar as it was not easy to preserve it in the rewritten timing merged Host_FilterTime, Host_ServerFrame, Host_Frame, _Host_Frame into Host_Main (which also calls Host_Init), this eliminates some duplicate code in all the sys_ modules git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6300 d7cf8633-e32d-0410-b094-e92efae38249
made darkplaces able to compile as C++ again, and fixed all conversion warnings when doing so changed several malloc and free calls to Z_Malloc and Z_Free git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6260 d7cf8633-e32d-0410-b094-e92efae38249