Commit Graph

30 Commits

Author SHA1 Message Date
Ozkan Sezer 10ed2c85dc kill annoying warnings. remove commented pakfile/progs.dat testing code from Modlist_Init().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1464 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-04 20:36:59 +00:00
Ozkan Sezer 8d919e5cd0 sys_win.c: properly check the returned value from GetCurrentDirectory()
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1384 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-03-10 20:01:47 +00:00
Ozkan Sezer c0d6f2e736 minor stuff..
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1343 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-09-12 14:03:01 +00:00
Eric Wasylishen dc2218b9c8 SDL2 Game Controller support
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1293 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-01 21:58:08 +00:00
Eric Wasylishen 0e8f1f393b sys_sdl_win.c: fix calling conventions for SetProcessDpiAware[ness]. Was getting a runtime error about that when compiling with VS2015.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-07 20:36:39 +00:00
Eric Wasylishen 4800fbde34 sys_sdl_win.: call timeBeginPeriod(1) to set OS timer resolution to 1ms.
Works around buffer underruns with directsound and SDL2, but also will
make Sleep()/SDL_Dleay() accurate to 1ms which should help framerate
stability.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1200 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-14 18:01:33 +00:00
Ozkan Sezer a4b30a4eed add new numcpus field to the quakeparms structure and detect it during Sys_Init time
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1138 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-03 09:10:18 +00:00
Eric Wasylishen 53288141e7 sys_sdl_win: Sys_SetDPIAware: only call GetProcAddress on a non-NULL library handle
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1121 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-17 00:15:49 +00:00
Eric Wasylishen f244f82c64 sys_sdl_win.c: Sys_SetDPIAware: call SetProcessDPIAwareness / SetProcessDPIAware
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1119 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-16 23:01:43 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Eric Wasylishen 4a28b9ad2e revert r1045 (SetProcessDPIAware).. while it fixed broken fullscreen on one configuration (sdl2/windows 8), it broke another that worked (sdl2/windows 8.1).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1048 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 02:28:50 +00:00
Eric Wasylishen 2e23f6a3b5 sys_sdl_win.c: Call SetProcessDPIAware if available (Vista and above) to opt out of the OS scaling our window on a high-dpi display.
SDL (both 1.x and 2.x) is buggy and can't deal with scaled windows.
But we'd probably want to call this anyway beause it give us full-resolution windows.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1045 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 00:59:24 +00:00
Sander van Dijk b2c3363718 Add some missing SDL2 includes when not using sdl2-config.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1017 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 17:41:34 +00:00
Ozkan Sezer 61775cc8b4 use getcwd() or some equivalent for host_parms->basedir instead of '.' (from uhexen2)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1016 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 09:51:35 +00:00
Ozkan Sezer f784b8a769 Unix (at least Linux) man pages for mkdir(2) document the EEXIST
error: "pathname already exists (not necessarily as a directory).
This includes the case where pathname is a symbolic link, dangling
or not." So, add a check to see if the existing pathname is really
a directory.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@901 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-04-24 08:10:15 +00:00
Ozkan Sezer 50e014d050 Updated support for building the OSX versions using Makefile.darwin. Do
not rely on sdl-config on OSX Framework builds, define new SDL_FRAMEWORK
and NO_SDL_CONFIG preprocessor macros to indicate that and include SDL.h
with the "SDL" subdirectory name included. Add new libmad and ogg/vorbis
headers and static and dynamic libraries for macosx. Xcode project files
need further updating.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@699 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-08-16 04:51:41 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer bb5a1d6e38 sys_sdl_unix.c, sys_sdl_win.c (Sys_Sleep): rely on SDL_Delay() instead
of platform specific usleep() or Sleep() calls.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@532 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-21 10:40:18 +00:00
Ozkan Sezer 9d809a3687 SDL input driver: updated from the uHexen2 project adding native keymap
and dead key support to the console, thanks to Sander van Dijk.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@524 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-16 14:11:37 +00:00
Ozkan Sezer 870b40f7aa sys_sdl_unix.c, sys_sdl_win.c (Sys_ConsoleInput): Moved isDedicated check to...
host.c (Host_GetConsoleCommands): ... here, where it should be.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@520 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 15:51:28 +00:00
Ozkan Sezer 2b919188d6 renamed Sys_FloatTime to Sys_DoubleTime (the thing always returned double
you know..) and adjusted all callers accordingly.  changed Sys_Sleep() to
take a milliseconds argument, added implementations for unix (usleep) and
windows (Sleep).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@512 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 16:01:01 +00:00
Ozkan Sezer cccff603e4 made Sys_ConsoleInput() to return const
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@508 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 12:02:37 +00:00
Ozkan Sezer 36b0f26220 made unix Sys_mkdir() to print strerror in case of failure.
made windows Sys_mkdir() to use windows api functions.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@507 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 10:50:26 +00:00
Ozkan Sezer a85d8dcd6a made global host_parms a pointer, set in main(). adjusted places where
host_parms is used. made COM_Init() and Host_Init() to take no arguments.
made Sys_Init() to set host_parms->userdir: at present, it is set to
host_parms->basedir, to be changed properly when user directories are
implemented.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@443 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 16:41:45 +00:00
Ozkan Sezer c53dd74e4d cvar'ize the game loop throttling by adding the new sys_throttle with
a default value of 0.02.  changing its value to 0 disables throttling.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@427 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-27 07:05:18 +00:00
Ozkan Sezer 3f006ac62f * common.c (COM_FileExists): changed return type to qboolean.
(COM_filelength): new procedure.
(COM_FindFile): adjustments to avoid multiple file open/close operations just a
little.
* common.h (COM_FileExists): adjusted prototype.
* bgmusic.c (BGM_PlayCDtrack): adjusted for COM_FileExists() return type change.
* sys_sdl_win.c, sys_sdl_unix.c (Sys_filelength): changed return type to long.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@408 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 17:25:43 +00:00
Ozkan Sezer 94767a4e6d added windows version detection back from original sources
with extra bits from uhexen2. we may use the information some
day.. (or not..)


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@354 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 17:00:19 +00:00
Ozkan Sezer e08d6cf1e3 replaced all usess of vsprintf by q_vsnprintf
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@320 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 16:57:12 +00:00
Ozkan Sezer 906df3f650 const correctness changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
Ozkan Sezer d098087606 Reorganize files for platform-specific code:
* sys_sdl_win.c: Copied from sys_sdl.c. Windows-only. Remove unix code.
(Sys_Init): New procedure. Call AllocConsole() and get input and output
handles for dedicated servers.
(Sys_ConsoleInput): Add a windows version.
(Sys_Error): Adjust for the allocated console and use windows api.
Adjust message output. Remove the console timeout, doesn't work somehow.
Just display the console for 3 seconds and then exit. Rely on SDL that
it redirects/logs the stdout/stderr to files.
* sys_sdl_unix.c: Rename from sys_sdl.c. Unix-only. Remove windows code.
(Sys_Init): New procedure.
(Sys_Error): Remove Windows-oriented dedicated server specific code.
Adjust message output.
* sys_sdl.c: Delete.
* sys.h (Sys_Init): Add prototype.
* main_sdl.c (main): Call Sys_Init().
* pl_linux.c (PL_ErrorDialog): Remove terminal printing which Sys_Error
already does.
* pl_osx.m (PL_ErrorDialog): Update from uhexen2.
* pl_win.c: Make icon handle static. whitespace and formatting tidy-up.
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Adjust for the
sys_sdl.c name change to sys_sdl_unix.c and sys_sdl_win.c.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@223 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 11:01:24 +00:00