Commit graph

172 commits

Author SHA1 Message Date
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
76e49b668e Merge branch 'master' into sdl2 2013-09-16 22:34:51 +01:00
Tim Angus
58b8cfa0b3 Various fixes from Fuma 2013-09-15 23:54:52 +01:00
Tim Angus
462694763e Bug #6021 Fix misuse of Sys_Mkdir (Joerg Dietrich) 2013-09-04 17:56:11 +01:00
Thilo Schulz
daf71ca502 Fix recursive crash when home path cannot be created 2013-08-25 12:00:30 +02:00
Tim Angus
bde7665462 Merge branch 'master' into sdl2
Conflicts:
	code/sdl/sdl_input.c
2013-08-16 23:34:08 +01:00
Zack Middleton
43ea1aebb3 Fix Windows server history scrolling
Update history position when CON_HistNext goes to input line, otherwise
when going to previous a line is skipped.
Don't let CON_HistPrev go to unused lines.
2013-07-21 17:32:56 -05:00
/dev/humancontroller
a8ce30163e make the fread() success-check code in Sys_RandomBytes() more secure 2013-05-30 15:41:19 -05:00
Tim Angus
d9d52f0306 Merge branch 'master' into sdl2
Conflicts:
	Makefile
	code/renderercommon/qgl.h
	code/renderergl1/tr_local.h
	code/sdl/sdl_glimp.c
2013-05-08 14:27:15 +01:00
Tim Angus
230af8c9e9 Fix shfolder.dll not getting freed 2013-04-09 21:43:01 +01:00
Zack Middleton
2e45edb550 5717 - Gamecode can open file "" for reading 2013-02-15 21:08:47 -06:00
Tim Angus
b9355c5f12 The in_mouse stuff makes no sense in SDL2 2013-01-28 09:25:38 +00:00
Tim Angus
f478761e07 Use SDL 2 instead of SDL 1.2 2013-01-17 18:20:03 +00:00
Zack Middleton
2d6b68edd8 Fix win32 console partial print being overwritten 2013-01-10 16:29:54 -06:00
Zack Middleton
20cd170993 Make win32 console cursor visible 2013-01-10 15:34:54 -06:00
Zack Middleton
c1ddacf5be Fix win32 input left on buffer and overwritten
The input line on the console screen buffer was moved up a line and
overwritten by CON_Print.

Remove input line when console shutdown as well.
2013-01-10 15:06:59 -06:00
Zack Middleton
daa9619913 Don't look for colors past win32 input line length 2013-01-09 15:42:21 -06:00
Zack Middleton
768083b46f Fix win32 dedicated input line printing to backlog
Use to write win32 input line using WriteConsole then overwrite by
CON_Print, so when CON_Print removes color format characters the end of original input line was visable.

"hi ^1guys" use to be shown as "hi guysys" in the console backlog.
2013-01-09 15:21:44 -06:00
Zack Middleton
c501c1ad8a Colorize text on win32 console
Text input line color based on code by "spior"
Main colorize function based on Sys_AnsiColorPrint in sys_main.c
2013-01-08 17:20:01 -06:00
Thilo Schulz
ded2b11959 Fix this for real now. 2012-07-23 21:27:17 +00:00
Tim Angus
88cbeae0fd * Fix warning 2012-07-07 18:24:20 +00:00
Thilo Schulz
053aa8ead7 Fix windows as well 2012-07-07 18:22:19 +00:00
Tim Angus
37f2b4db90 * (bug #5709) Fix crash when invoked with --version 2012-07-07 17:32:19 +00:00
Zack Middleton
6067cadc72 Removed 0xAD character, from /dev/humancontroller. 2012-06-19 14:47:30 +00:00
Zachary Slater
b5acc31a4d CVE-2012-3345 2012-06-14 18:28:58 +00:00
Zack Middleton
c84377854a Unix clients can now enter commands from tty console. Patch by Rambetter with some edits by me. (#4799) 2012-02-06 21:05:57 +00:00
Tim Angus
fd986dae06 * Fix various warnings with GCC and clang 2011-10-27 21:32:28 +00:00
Thilo Schulz
d4f8c4716d Force unload of running VMs when quitting through signal handler 2011-10-14 13:52:28 +00:00
Thilo Schulz
8a500d71da Set default rounding mode to FE_NEAREST again. Thanks to Matthias Bentrup for providing some explanations. 2011-09-27 14:43:20 +00:00
Zack Middleton
0866b667e0 Fixed win32 dedicated server console output. It use to write input line and then write output over the top of it. Reported by Ensiform. 2011-09-12 20:14:36 +00:00
Zack Middleton
06231971ed Use STDOUT_FILENO instead of 1 in con_tty.c 2011-08-05 16:19:01 +00:00
Thilo Schulz
52aed503b5 Bug 5146 - Remove last of warnings under gcc 4.6.1 for Linux, patch by q3urt.undead@gmail.com 2011-08-05 13:33:15 +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
23f6fd1633 Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings 2011-07-29 12:27:00 +00:00
Tim Angus
22552c7bab * Replace usage of system with fork/exec 2011-07-24 22:01:50 +00:00
Tim Angus
b248479376 * Fix various issues with unix Sys_Dialog 2011-07-18 19:32:25 +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
Tim Angus
ea6cf5fda9 * Use specific exit code for xmessage 2011-07-18 10:14:04 +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
055bd3b464 Bug 5047 - Win32 dedicated server console title should use define, patch by Zack Middleton 2011-06-18 14:30:20 +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
a447aa82af Fix #if macros for idx64 and id386 2011-06-15 14:10:20 +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
Thilo Schulz
876fd7dcb9 - Add HOMEPATH default name define to q_shared.c, patch by uZu (#4973)
- Reverted change from (#4972) and implemented the other suggestion to be consistent with cl_cgame.c and cl_ui.c
2011-05-04 15:39:35 +00:00
Thilo Schulz
5769bed4a3 Make Sys_SetEnv behave alike on Windows and Linux 2011-04-18 00:39:15 +00:00
Tim Angus
01a274baf7 * Actually call Sys_PlatformExit 2011-04-09 12:33:56 +00:00
Tim Angus
52ead6fa36 * Crash recovery for com_pipeFile (Lakitu7) 2011-03-30 21:58:31 +00:00
Thilo Schulz
3bf8ec2dab (#4925) - com_pipefile to create a named pipe for sending commands from other processes, patch by Chris Schwarz 2011-03-10 01:01:27 +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
f03ee4b61c Oops typo. 2011-02-06 18:59:39 +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
3148416c04 - Change runtime standalone detection:
* com_standalone now read-only
  * add new cvars com_basegame, com_homepath
  * standalone now automatically detected when com_basegame is set to something different than baseq3 and no id pak pk3s are found
  * This fixes https://bugzilla.icculus.org/show_bug.cgi?id=4699
- Replace a few hardcoded string literals with macros
- Add checks for Team Arena PK3s to FS_CheckPak0()
2011-02-04 12:04:56 +00:00
Thilo Schulz
fa8201c9b6 Delete unused variable 2011-01-31 22:09:47 +00:00
Thilo Schulz
5cd116d3ad Only adjust timer resolution for clients 2011-01-31 20:32:00 +00:00
Thilo Schulz
e0a85521c9 Explicitly set timer resolution on windows 2011-01-31 20:23:05 +00:00
Ludwig Nussel
14c5a82c14 cvar is called fs_game (bug 4866) 2011-01-30 13:34:54 +00:00
Thilo Schulz
7471510c8e Shut up compiler error 2011-01-21 20:47:32 +00:00
Tim Angus
7000b9a315 * (bug #4853) Fix comment that refers to old code 2010-12-19 17:45:03 +00:00
Ludwig Nussel
368a3be2a6 64bit Windows fix (patch by Marcus Meissner) 2010-04-16 09:29:34 +00:00
Ludwig Nussel
760f4a1949 64bit Windows support (patch by Michael Menegakis) 2010-02-28 09:00:02 +00:00
Tim Angus
3ebe048968 * Fix a memory leak in OS X Sys_Dialog
* Fix compilation on Snow Leopard
2010-02-26 16:32:49 +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
Tim Angus
78df7a1de4 * (bug #4346) Dedicated server uses 100% CPU when stdin is not a TTY
* com_speeds reports misleading values on dedicated server (Guillaume Bougard)
2009-12-24 00:40:39 +00:00
Thilo Schulz
04c5efd739 Fix possible buffer overflow in console, thanks to John Ellis for the patch. 2009-11-10 02:17:32 +00:00
Tim Angus
108705d31f * Rewrite win32 Sys_Mkdir to use CreateDirectory
* Make FS_ReplaceSeparators filter out runs of multiple separators
* Make FS_CreatePath skip creation of the root directory
2009-11-07 16:43:02 +00:00
Tim Angus
eee9770fbf * Reimplement r1597-1598 in a better way (Oopss)
* Fix Sys_SetEnv warning
2009-11-05 20:20:23 +00:00
Thilo Schulz
d574e10bc4 Ugh. Forgotten ) 2009-11-03 20:44:16 +00:00
Thilo Schulz
bd2ab9bffd - implement r_noborder, inspired by patch from ensiform (#4289)
- Add Sys_SetEnv for portable setting of environment variables
 - Default ioquake3 to appear on the center of the screen if running in windowed mode.
2009-11-03 20:29:43 +00:00
Tim Angus
9f6cee30d3 * Remove disabling of stdout/err redirection on windows as it doesn't work
(since the environment variable is acted upon by the SDL_main stuff, which
  happens before our main)
2009-10-27 11:48:18 +00:00
Tim Angus
968892c61b * Bump the minimum SDL version up to 1.2.10, and remove workarounds for earlier versions 2009-10-25 22:36:32 +00:00
Thilo Schulz
c312449422 Add SIGCONT signal handler to reinitialize console after doing CTRL+Z / fg, as under Linux/bash stdin seems to lose O_NONBLOCK flag as well as all tcsetattr() attributes after foregrounding 2009-10-24 12:01:29 +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
504bd58b90 * Disable stdout/stderr redirection on Windows 2009-10-16 22:36:57 +00:00
Ryan C. Gordon
5ffb45c79f Cleanups for the Mac error dialog, after a code review from tma.
- Don't expose the function in sys_local.h (it would be static if we could).
- Don't call it Sys_Cocoa_*; it'd be nonsense with q3a's naming conventions.
2009-09-16 12:54:12 +00:00
Tim Angus
083bd1b005 * ...and actually r1626 this time 2009-09-16 09:30:21 +00:00
Tim Angus
f89092fda6 * Revert r1624 and r1626-r1628 2009-09-15 09:48:11 +00:00
Ryan C. Gordon
9fd5e15b97 Added support for hardcoded HOMEPATH.
Partially fixes Bugzilla #4271.
2009-09-15 06:40:55 +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
Ryan C. Gordon
f8604a64f4 Added a real GUI message box to Sys_ErrorDialog() on Mac OS X.
Fixes Bugzilla #3654.
2009-09-15 05:38:27 +00:00
Ryan C. Gordon
5079343ecd Fixed infinite recursion of writing crashlog because we're out of file handles.
Fixes Bugzilla #3772.
2009-09-15 00:19:22 +00:00
Ryan C. Gordon
cf1bb85183 Make newly-created prefpath permissions more sane. 2009-09-14 23:46:44 +00:00
Ryan C. Gordon
a5980d56d9 Create "~/Library/Application Support" on Mac OS X if it doesn't exist.
Apparently this can happen on freshly-installed Xserves? Also, a moron user
 could have dragged it to the trash anyhow.

  Fixes Bugzilla #4052.
2009-09-14 23:45:00 +00:00
Tim Angus
64a0a078d2 * Fix warning in cl_main.c
* Fix bug #4026 (SDL dx backend doesn't work on some machines)
2009-09-14 12:34:31 +00:00
Ludwig Nussel
ec846d23b2 define STRING and XSTRING in q_shared.h (#4054) 2009-05-05 18:19:29 +00:00
Ludwig Nussel
799150ffc1 fix dedicated server stdin console (#4009) 2009-05-03 20:05:16 +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
72dea0a184 * Fix some new GCC 4.3 warnings
* Fix many many strict aliasing warnings, now that it's re-enabled
2008-11-10 23:55:22 +00:00
Tim Angus
a6382d2d9b * Fix unused variable warning
* Add USE_LOCAL_HEADERS guards to sys_loadlib.h
2008-08-23 22:45:30 +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