Commit graph

59 commits

Author SHA1 Message Date
Zack Middleton
05858d30e8 Don't load libraries with non-standard file extensions
Also don't allow writting files ending in a library extension such
as ".so.0" or ".dylib.0".
2017-05-24 10:28:46 -05:00
SmileTheory
376267d534 Don't load .pk3s as .dlls, and don't load user config files from .pk3s. 2017-03-13 14:14:00 -07:00
Zack Middleton
755b2f38f0 Offer post-crash safe settings on a per-mod basis
Offer to restore settings when loading a mod that crashed, not the first
mod that gets loaded after a crash. Before the first mod loaded (usually
baseq3) would get the option even if missionpack or some other mod crashed.

- Make pid files separate for each fs_game.
- Remove/write pid every time switching fs_game.
- Create path before writing pid file otherwise it fails on first run.
- Show mod description.txt or fs_game instead of engine name in abnormal
  exit message.
- Check com_fullyInitialized in Com_Error before removing PID,
  otherwise "ioquake3 --version" segfaults when accessing fs_gamevar->string
  (plus not fully initialized isn't really a normal shutdown).
2016-10-09 18:18:08 -05:00
Simon McVittie
9c76b546e3 Pick up date from SOURCE_DATE_EPOCH, for reproducible builds
The goal of reproducible builds is that a rebuild of the same source
code with the same compiler, libraries, etc. should result in the same
binaries. SOURCE_DATE_EPOCH provides a standard way for build systems
to fill in the date of the latest source change, typically from a git
commit or from metadata like the debian/changelog in Debian packages.

This does not change anything if SOURCE_DATE_EPOCH is not defined;
the intention is that a larger build system like a Debian package
will define it.

Please see https://reproducible-builds.org/ for more information about
reproducible builds.
2016-09-22 09:02:20 +01:00
Victor Roemer
398dea397c Fix Makefile for OSX
Bump base SDK from 10.5 -> 10.7
Just use the builtin __APPLE__
2016-06-12 17:17:33 -04:00
Zack Middleton
11668bb1f0 Fix typo of SDL_Has3DNow() in Sys_GetProcessorFeatures() 2016-03-27 12:02:12 -05:00
Ryan C. Gordon
2a3c331ba1 Sys_GetProcessorFeatures() didn't check for 3DNow! or Altivec. 2016-03-27 12:46:38 -04:00
Zack Middleton
39cf21bf54 Fix pid file ignoring user set fs_homepath
Create pid file in fs_homepath instead of (always) default homepath.
If not manually set, fs_homepath is set to Sys_DefaultHomePath().
2014-10-29 00:03:49 -05:00
Zack Middleton
137ddb9dc6 Get clipboard data from SDL
This makes pasting in client console and UI edit fields work on X11 and OS X.

Sys_GetClipboardData is only used by client, so returning NULL in dedicated is fine.
2014-08-27 04:32:05 -05:00
Zack Middleton
c55df2c9aa Merge branch 'master' into sdl2 2014-03-24 17:53:08 -05:00
MAN-AT-ARMS
8661e0509b Release netowrk bindings on shutdown 2014-02-22 21:18:34 -05:00
Zack Middleton
5fdff01d1b Check #ifdef MACOS_X not #if MACOS_X 2013-10-20 13:58:30 -05:00
Zack Middleton
983ebbb4a6 Ignore -psn* arguments on Mac OS X
Mac OS X adds an argument starting with "-psn" when launched using Finder, Dock,
or a terminal using open command and not specifying arguments.

It caused the opening videos to be skipped.

This change mimics SDL 1.2.
2013-10-19 01:10:24 -05:00
Tim Angus
58b8cfa0b3 Various fixes from Fuma 2013-09-15 23:54:52 +01:00
Tim Angus
f478761e07 Use SDL 2 instead of SDL 1.2 2013-01-17 18:20:03 +00:00
Tim Angus
88cbeae0fd * Fix warning 2012-07-07 18:24:20 +00:00
Tim Angus
37f2b4db90 * (bug #5709) Fix crash when invoked with --version 2012-07-07 17:32:19 +00:00
Zachary Slater
b5acc31a4d CVE-2012-3345 2012-06-14 18:28:58 +00:00
Thilo Schulz
d4f8c4716d Force unload of running VMs when quitting through signal handler 2011-10-14 13:52:28 +00:00
Tim Angus
85ae08e800 * Fix some grammar in DLL loading
* s/Sys_LoadQVMDll/Sys_LoadGameDll/
2011-08-03 14:32:49 +00:00
Thilo Schulz
8ab91bde8e - Fix already defined command warnings for minimize
- Fix recursive CL_Shutdown warning and "command already defined" warnings when quitting while playing on a server that changed the gamedir.
2011-08-01 10:16:40 +00:00
Thilo Schulz
404fe4e6e0 Don't search system directories for renderer lib 2011-08-01 09:33:48 +00:00
Thilo Schulz
3752b1d7c4 Change DLL search path order for external libraries that are linked at runtime, like libcurl or libopenal to:
* system library paths
  * executable path
  * fs_basepath
2011-07-29 20:18:37 +00:00
Thilo Schulz
9dc32d55e2 Bug 4812 - GCC __attribute__ annotations for printf, non-returning functions etc., patch by linux@youmustbejoking.demon.co.uk and Zack Middleton 2011-07-18 14:56:57 +00:00
Thilo Schulz
dee3724a13 - Improve game_restart:
* differing screen resolutions and network settings are now honoured when changing fs_game
  * Fix hunk memory leak on game_restart
  * Move cls.state and cls.servername to clc so connection state is fully preserved over game_restart
  * Revert back to previous fs_game after disconnecting from a server that triggered a game_restart
  * Fix error dialog popping up after every game_restart if an error happened previously (reported by Ensiform)
- Fixed that not all commands added by CL_Init() would be removed by CL_Shutdown()
2011-06-21 11:18:35 +00:00
Thilo Schulz
9219cde4e8 - Small change to search path order - local files not in .pk3s take precedence over files in pk3s. Should make life easier for modders/mappers wanting to override textures that are already contained in some older pk3
- Make VM loading more robust, change loading order: when vm_* == 0 first try loading DLL, then QVM in *each* search directory/path
- Fix FS_FileForHandle that would return a FILE pointer to invalid file handle 0
2011-06-15 22:09:26 +00:00
Thilo Schulz
03201aff22 - Add MASM assembler files for MSVC x64 projects to support vm_x86 in x64 mode
- Clean up ftol()/snapvector() mess
- Make use of SSE instructions for ftol()/snapvector() if available
- move ftol/snapvector pure assembler to inline assembler, this will add x86_64 and improve support for different calling conventions
- Set FPU control word at program startup to get consistent behaviour on all platforms
2011-06-13 09:56:39 +00:00
Tim Angus
01a274baf7 * Actually call Sys_PlatformExit 2011-04-09 12:33:56 +00:00
Thilo Schulz
ccd24cd647 - Fix unterminated string errors in Q_vsnprintf() on windows. Thanks to Eugene C. for reporting (#4907)
- Get rid of bigbuffer in Com_sprintf()
- Get rid of Q_snprintf and replace with Com_sprintf()
2011-02-23 16:17:09 +00:00
Thilo Schulz
2b52867b74 Code cleanup patch by devhc 2011-02-08 18:19:31 +00:00
Thilo Schulz
7bb5906599 Patch by Simon McVittie to improve dynamic library loading (#4700) 2011-02-04 17:47:57 +00:00
Thilo Schulz
7471510c8e Shut up compiler error 2011-01-21 20:47:32 +00:00
Tim Angus
005f870ebe * Sys_Dialog for more user friendly error reporting
* (bug #3932) Recovery from bad video settings
2010-02-15 16:20:33 +00:00
Ludwig Nussel
6f9b34ef75 avoid setting cvars by name each frame 2010-01-06 13:47:41 +00:00
Tim Angus
a405637985 * Handle SIGINT 2009-12-24 01:39:30 +00:00
Thilo Schulz
b9ec0e4639 Don't look for DLLs on current working directory anymore, for security reasons. 2009-10-17 22:06:51 +00:00
Tim Angus
083bd1b005 * ...and actually r1626 this time 2009-09-16 09:30:21 +00:00
Ryan C. Gordon
826f05f95f Let a separate libdir be specified for loading libraries.
Partially fixes Bugzilla #4271.
2009-09-15 06:32:05 +00:00
Ryan C. Gordon
62ea802cea Quote commandline args with spaces when building the string for Com_Init(). 2009-09-15 06:12:42 +00:00
Ludwig Nussel
ec846d23b2 define STRING and XSTRING in q_shared.h (#4054) 2009-05-05 18:19:29 +00:00
Tim Angus
1bd63e59e5 * Remove superfluous comments committed with fix to bug #3999 2009-03-02 22:26:36 +00:00
Ludwig Nussel
1072b25ce8 initialize Sys_Milliseconds early (#3999) 2009-03-02 18:08:21 +00:00
Tim Angus
c29417b42a * Always show the mouse cursor when the mouse is disabled
* Rename IN_StartupJoystick to IN_InitJoystick, add IN_ShutdownJoystick
* Add IN_Restart, which avoids calling IN_DeactivateMouse at the wrong time
* Call IN_Restart when changing r_fullscreen
* Add CVAR_ROM r_sdlDriver for easy checking of the SDL driver in use
* Random README tweaks
2008-08-09 13:20:00 +00:00
Tim Angus
d4d5527a89 * Add Sys_GLimpInit for platform specific GLimp initialisation
* Move Unix specific signal handlers to Sys_PlatformInit
* (Windows only) Don't set the SDL video driver if SDL_VIDEODRIVER is already
  set externally
* (Windows only) Use the "windib" SDL video driver if in_mouse is set to -1
2008-08-08 21:35:33 +00:00
Tim Angus
00e790ce00 * Change win32 client Sys_Sleep so it ONLY sleeps since before it was waking on
more or less any input event; fine for the server, not so much use for the
  client
* In the main loop, don't bother sleeping if it's going to be less than 10ms as
  the methods we're using to sleep at the moment aren't very precise
* Add Sys_PlatformInit for platform specific initialisation
* In win32 Sys_PlatformInit force selection of the DirectX SDL backend in order
  to get better fullscreen mouse input (in conjunction with a patched SDL DLL
  http://bugzilla.libsdl.org/show_bug.cgi?id=265)
2008-08-03 19:42:53 +00:00
Tim Angus
0124371c01 * Use Sys_Sleep to limit FPS, which will save CPU
* Add com_maxfpsUnfocused and com_maxfpsMinimized; self explanatory
* Fix reopening of bug 3703, I hope
2008-07-21 22:02:54 +00:00
Thilo Schulz
87fa68fd41 Add gamedirectory in .app to searchpath on MacOSX 2007-12-14 21:53:57 +00:00
Tim Angus
3cde9bf0dc * Add con_log.c to log all console output
* Add con_passive.c to cut down on #ifdef DEDICATED in sys_main.c
* Add Sys_ErrorDialog to report ERR_FATALs to the user
  + On Windows use a MessageBox and offer to copy the console log to the
    clipboard
  + On everything else print to the terminal and save the console log as
    crashlog.txt
2007-11-30 18:32:52 +00:00
Tim Angus
6bd4bb16a0 * Move SDL library version check to sys_main.c as it's proving difficult to
make the Makefile check sufficiently portable
* Remove unnecessary GL PFN... casts from SDL_GL_GetProcAddress calls
* Replace OS X uname workaround with Solaris workaround, as I believe OS X
  uname now behaves the same as GNU name
2007-11-25 23:41:01 +00:00
Tim Angus
b62950ca6e * Fix bug where an extraneous render command can cause a crash when
recording video
* Make S_CodecUtilClose NULL the snd_stream_t pointer
* Fix indentation in runtime SDL check code
2007-11-18 01:06:46 +00:00