Commit graph

171 commits

Author SHA1 Message Date
Zack Middleton
38a2f4d938 Fix in_restart causing fatal error while video is shutdown
Connecting to a server running a different fs_game and using a
autoexec.cfg containing in_restart would hit a fatal error in IN_Init().

    IN_Init called before SDL_Init( SDL_INIT_VIDEO )

Reported by smokey2k on the ioquake3 forum.
2018-06-10 15:13:10 -05:00
Zack Middleton
92935df37b Enable SDL audio capture for SDL 2.0.5 and newer
The version check is required for supporting macOS PPC with SDL 2.0.1
and Travis-CI (Ubuntu Trusty) with SDL 2.0.2.

The client now requires SDL 2.0.5 runtime if compiled against SDL 2.0.5
or newer.
2018-04-26 11:21:36 -05:00
Zack Middleton
484149573b Allow loading system OpenAL library on macOS again
In May 2017 the library loading was limited to *.dylib but the macOS
system OpenAL framework does not have dylib extension. So allow loading
files from /System/Library/Frameworks/ as libraries even without dylib
extension.

This is checked in Sys_DllExtension() so that QVM filesystem access will
not allow writing files to /System/Library/Frameworks/ even if homepath
is changed to include it. (Admittedly it doesn't fit the function name
but fits the function description and current usage.)
2018-03-22 14:58:44 -05:00
Tom Murphy
af6b1f8edf Remove CON_FlushIn function and where STDIN needs flushing, use tcflush POSIX function 2018-03-14 21:43:56 +00:00
Zack Middleton
df8f657f09 Fix exploit to bypass filename restrictions on Windows
Windows API ignores all trailing spaces and periods which can get around
Quake 3 file system restrictions. QVM opening 'uix86.dll.' actually
opens 'uix86.dll' which allows QVM to write native code.

This is done in the low-level Sys_FOpen() instead of the function
directly used by VMs ( FS_FOpenFileByMode() ) in case there are engine
commands now or in the future that can read or write arbitrary files.

Reported by Noah Metzger (Chomenor).
2018-01-30 07:59:25 -06:00
Edward Betts
fe42b8653d Correct spelling mistakes. 2017-11-22 01:40:20 -06:00
Zack Middleton
b4a4fe98d4 Fix reading crash log when log wraps around buffer 2017-10-08 07:19:07 -05:00
Zack Middleton
5f743bdb22 Disable DPI scaling on Windows
Windows DPI scaling prevents using full monitor resolution in
fullscreen mode.
2017-09-07 21:17:44 -05:00
Zack Middleton
aeaecb4ae5 Add Windows application manifest
- Use common controls 6 so error dialogs use correct visuals on
Windows XP or later!
- Specify running as invoker so Windows doesn't guess if it should
prompt for admin permission on Vista or later.
- Specify compatible with Vista through Windows 10. Tells Windows
not to emulate Vista behavior, not sure if it affects anything.

Makefile automatically runs windres when manifest changes.
2017-09-07 21:04:52 -05:00
Zack Middleton
5993c63c4e Removing input functions from sys_local.h for last commit
It helps to actually save files before making commits.
2017-08-21 22:27:09 -05:00
Zack Middleton
ead54782d0 Improve client input responsiveness
Move sampling input to the other side of framerate limiter.

Thanks to Alexander "wareya" Nadeau and Juraj "youurayy" Vitko for
pointing this out.
2017-08-21 21:40:54 -05:00
Noah Metzger
fa1549d457 Move CON_Init ahead of Com_Init to avoid Windows dedicated server crash 2017-07-15 10:16:13 +01:00
Zack Middleton
dfce71929a Add con_autochat and con_autoclear cvars 2017-06-08 15:46:19 -05:00
Zachary J. Slater
87eecd7bc1 Merge pull request #290 from rcgordon/autoupdater
Initial shot at writing an ioquake3 autoupdater. Thank you icculus, and everyone who contributed to his patreon! https://www.patreon.com/icculus
2017-06-02 22:46:22 -10:00
Ryan C. Gordon
b33551dfa2 Fixed comment typo: s/until/under 2017-06-02 11:28:33 -04:00
Ryan C. Gordon
063875e89a Fixed linking on things that need -ldl, and compiler warnings. 2017-06-02 01:39:03 -04:00
Ryan C. Gordon
82977da9c8 Working Windows port of the autoupdater! 2017-06-02 00:49:42 -04:00
Ryan C. Gordon
d0da0724e7 Move the autoupdater launcher into its own public domain source file.
So other games can steal this piece if they want.
2017-05-31 01:22:40 -04:00
Ryan C. Gordon
cf5dd87f57 Fix tabs vs spaces. 2017-05-31 01:04:17 -04:00
Ryan C. Gordon
02b116aae0 Initial Windows autoupdater support: the ioq3 internal bits.
This is just the piece that will launch the autoupdater; the autoupdater
itself will be a separate commit.
2017-05-31 01:02:26 -04:00
Zack Middleton
bc2f45508d Fix dllHandle possibly being uninitialized in Sys_LoadDll 2017-05-26 10:50:56 -05:00
Ryan C. Gordon
4729c683fd Initial shot at writing an ioquake3 autoupdater. 2017-05-25 14:13:18 -04:00
Zack Middleton
70af7e673f Check for truncated paths in Sys_LoadDll
Check for truncated paths which could allow loading a library with
a non-standard extension. Also provides a better message for why a
valid library with a long path would fail to load.
2017-05-24 10:28:59 -05:00
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
Zack Middleton
fbada2caf6 Fix compiling when KEY_WOW64_32KEY is missing from system headers 2017-05-24 10:01:19 -05:00
Max Crofts
7ff610db35 Detect GOG install path 2017-04-07 16:26:26 +10:00
Max Crofts
f5143405f1 Add missing RegCloseKey to Sys_SteamPath 2017-04-07 15:18:28 +10: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
SmileTheory
f663104cfc Access 32-bit registry key from 64-bit Windows correctly. 2015-12-02 17:07:26 -08:00
Zack Middleton
1902b6e659 Fix compiling on Windows without Steam path/appid 2015-09-26 19:26:21 -05:00
SmileTheory
2f77a98afe Use Windows uninstall path to find Steam Quake 3 install.
Thanks Pan- and Ensiform for pointing this out.
2015-09-25 04:55:41 -07:00
Zack Middleton
7e96fd9cb6 Make steam path optional at compile time for standalone games 2015-09-22 19:25:16 -05:00
SmileTheory
f860a753e0 Add Steam's Quake 3 Arena dir to game dirs on Windows. 2015-09-17 02:53:19 -07:00
Dion Williams
2917077323 Ensure reads from /dev/urandom are unbuffered
Upstream: JACoders/OpenJK@de6a9dfd40
2015-09-07 11:33:29 +01:00
Zack Middleton
993b838f27 Fix Windows file list extension check
Windows' Sys_ListFiles would add files that contain the extension anywhere,
not only at the end of the file name.

Example: "word.pk3omghacks" use to be loaded as a pk3 file.
2015-07-04 20:46:03 -05:00
Zack Middleton
5d7612ec84 Merge pull request #109 from Pan7/SIGABRT
SIGABRT is in ANSI and POSIX.1, and SIGIOT isn't.
2015-06-18 13:20:54 -05:00
Xycaleth
2742dfad26 Add arrow key support for win32 console 2015-01-26 02:39:59 -06:00
Pan7
9c52d6c2bf SIGABRT is in ANSI and POSIX.1, and SIGIOT isn't. 2015-01-18 18:41:06 +01:00
Zack Middleton
d62dfd87f9 Set float rounding mode on non-Windows platforms
Sys_SetFloatEnv in sys_unix.c existed but was not called. It sets the
rounding mode to "to nearest" which is the default on Linux. Might be
required on other platforms, I don't know.
2015-01-12 17:03:13 -06: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
Tim Angus
621a72e698 Fix a few warnings 2014-08-30 17:29:23 +01: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
107cae63d6 Merge branch 'master' into sdl2
Conflicts:
	.travis.yml
2014-06-03 00:52:49 -05:00
Zack Middleton
347b429fdb Fix potential OOB in Windows Dedicated TTY CON_Show
Found by Coverity.
2014-05-26 23:11:56 -05:00
Zack Middleton
c55df2c9aa Merge branch 'master' into sdl2 2014-03-24 17:53:08 -05:00