Commit graph

991 commits

Author SHA1 Message Date
Yamagi Burmeister
ed22ca81c2 Silence a warning with the upcoming Clang 3.2 2012-08-22 14:25:32 +02:00
Jonathan Gray
1f9d6084b6 OpenBSD port 2012-08-18 09:53:03 +02:00
Jonathan Gray
22fa99b713 test SIN6_LEN not __FreeBSD__ for sin6_len 2012-08-12 13:40:43 +10:00
Sander van Dijk
f292c1e22d Fix custom resolution handling in the video menu. 2012-08-06 14:04:12 +02:00
Yamagi Burmeister
602dd1af6f Connect non-base OpenGL function by calling wglGetProcAddress() on Windows
This is necessary since non-base OpenGL functions can't be connected by
calling the standard GetProcAddress() on Windows. To archive this the
old qwglGetProcAdress() is renamed into GetProcAdressGL() and a new
function pointer qwglGetProcAdress is introduced. On unixoid System it's
NULL and on Windows connected to wglGetProcAddress(). If it's NULL the
system wide function is called, if not the function Pointer is used.
2012-08-03 15:14:45 +02:00
Yamagi Burmeister
739590e639 Do not hide library loading errors behind "developer" 2012-08-03 15:13:58 +02:00
Sander van Dijk
3d4bbe6c31 Fix aspect menu options. 2012-08-03 08:05:09 +02:00
Yamagi Burmeister
efd1ddb1c5 Initialze vid_gamma 2012-08-02 15:33:42 +02:00
Yamagi Burmeister
8141380030 Allow to set the aspect ratio via the menu 2012-08-02 15:18:58 +02:00
Yamagi Burmeister
de9dda7432 Restart the refresher when certain values are changed via the menu 2012-08-02 14:59:51 +02:00
Yamagi Burmeister
f1420ffe75 Use correct default mode 2012-08-02 14:47:18 +02:00
Yamagi Burmeister
3ab4e58df5 Cleanup the video menu, remove support for different refresher 2012-08-02 14:39:33 +02:00
Yamagi Burmeister
c6eaf5c876 Mobe LIBGL makro to common.h and replace all hardcoded libGL calls with it 2012-08-02 14:06:32 +02:00
Yamagi Burmeister
751d39fb50 Update the file header comments 2012-08-02 14:00:04 +02:00
Yamagi Burmeister
8d0dfd2c30 Merge vid.c into 1 generic file 2012-08-01 16:54:09 +02:00
Yamagi Burmeister
f89bb3265e Combine qgl.c glwindow.h into one generic file 2012-08-01 15:51:39 +02:00
Yamagi Burmeister
e5f70fcf40 Merge qal.c into one generic file for all platforms
To archive this, 3 new functions Sys_GetProcAddress(), Sys_LoadLibrary()
and Sys_FreeLibrary() were added to abstract the library loading code
into a platform independend API.
2012-08-01 14:54:18 +02:00
Yamagi Burmeister
399c581f06 Move src/windows to src/backends/windows 2012-08-01 14:12:05 +02:00
Yamagi Burmeister
3fb8492398 Move src/unix to src/backends/unix 2012-08-01 13:58:10 +02:00
Yamagi Burmeister
c5bf1e8c93 Move src/sdl to src/backends/sdl 2012-08-01 13:47:32 +02:00
Yamagi Burmeister
3918d3ba34 Change the VERSION number from float to string
Using a float number as version number is a bad idea. Correct this long
standing problem by changing it to a string. If we ever want to compare
version numbers, 2 integer constants "MAJOR_VERSION" and "MINOR_VERSION"
should be added.
2012-07-27 08:57:52 +02:00
Yamagi Burmeister
b52336850f Reformat the client 2012-07-22 15:34:45 +02:00
Yamagi Burmeister
7bbfa01a87 Fix a unlogical statement 2012-07-22 12:51:53 +02:00
Yamagi Burmeister
6f719f4c7b Reformat the refresher 2012-07-21 14:09:45 +02:00
Yamagi Burmeister
b1ddebf552 Update "unzip" to version 1.01h
This update brings some minor bugfixes, especially for big endian
platforms and LLP64 systems like 64 bit Windows. The support for
encrypted ZIP archives was removed. This is a no-op change, since
there was no way to pass the password to uncrypt. Without the
uncrypt code Yamagi Quake II can be distributed in some countries
with special laws for cryptographic software. The LICENSE was
updated to the most recent version of the INFO-ZIP license.
2012-07-21 12:02:39 +02:00
Yamagi Burmeister
9288513e86 Reformat and cleanup of the server 2012-07-21 10:06:07 +02:00
Yamagi Burmeister
dbed2fa053 Clear display buffer before shutting the refresher down 2012-07-10 15:02:42 +02:00
Yamagi Burmeister
de3da4ba70 Check for gamex86.dll if game.dll wasn't found
This change allows the usage of old mods without renaming their game
lib. This is applied to windows only because the few Linux mods out
there are broken since a long time due to incompatible changes in libc
and the kernel. Requested by Victor Sergeevich.
2012-07-09 15:54:20 +02:00
Yamagi Burmeister
7ac71db523 Merge branch 'cleanup'
Conflicts:
	src/common/header/common.h
	src/common/header/shared.h
	src/common/misc.c
	src/unix/main.c
	src/unix/system.c
2012-07-09 14:35:37 +02:00
Yamagi Burmeister
ae99562741 Seed the game PRNG at startup 2012-06-26 14:31:01 +02:00
Yamagi Burmeister
fd44d3078f Fix path length limitation (pointed out by Daniel) 2012-06-24 18:11:55 +02:00
Yamagi Burmeister
590baaa3e9 Remove some potential harmfull "long"
While the use of "long" was harmless in this case, it's unnecessary and
we try to keep Quake II free from longs.
2012-06-22 09:44:26 +02:00
Yamagi Burmeister
c80954a65e Remove support for qhost
qhost was a proprietery management application for Quake II dedicated
servers. Since we don't know if the code is still working and most
likely no one uses it anymore, remove it. This war requested by Daniel.
2012-06-22 09:06:27 +02:00
Yamagi Burmeister
0353f6fc42 Remove support for partitial installations
This was requested by Daniel. While partitional installations were
working, they are another distinction between Linux and Windows and
useless. Everyone should have the ~350MiB for a full installation.
And full installations are much faster.
2012-06-22 08:49:12 +02:00
Yamagi Burmeister
b96d247db3 Create homedir before redirecting stdout and stderr 2012-06-21 09:26:37 +02:00
Yamagi Burmeister
2df1f31683 Enable qconsole.log by default 2012-06-20 13:52:47 +02:00
Yamagi Burmeister
4fe877b5f6 Do not print the client build options when starting q2ded 2012-06-20 13:49:06 +02:00
Yamagi Burmeister
b3f09db95c Print build options at startup 2012-06-20 13:40:49 +02:00
Yamagi Burmeister
8558a6af11 DO not redirect the stdout and stderr when running as dedicated server 2012-06-20 13:40:49 +02:00
Yamagi Burmeister
847128cb76 Close stderr and stdout at shutdown 2012-06-20 13:40:49 +02:00
Yamagi Burmeister
5d85a66fed Print console messages and errors to stdout 2012-06-20 13:40:49 +02:00
Yamagi Burmeister
984badffa0 Remove unused function Sys_Warn() 2012-06-20 13:40:48 +02:00
Yamagi Burmeister
74e6993d6f Remove unused function Sys_Printf() 2012-06-20 13:40:29 +02:00
Yamagi Burmeister
1a748adaa5 Remove the "nostdout" cvar
The "nostdout" cvar was only existent on unixoid platform and
disfunctional. Since the stdout putput is very helpfull when
debugging things, just remove it.
2012-06-20 13:40:10 +02:00
Yamagi Burmeister
229e13e6f4 Redirect stdout and stderr into files 2012-06-20 13:39:18 +02:00
Yamagi Burmeister
c0e9a6f045 Make Quake II compatible with unicode directory names
This changes employs a horrible hack to connect the ASCII Quake II to
the UTF-16 WinAPI. The path to "My Documentes" is read in UTF-16, then
converted to a old "DOS style path" with 8.3 characters. This DOS path
has by convention no UTF-16 characters in it and can be converted into
a normal ASCII string. This ASCII string is the path used by Yamagi
Quake II. The conversion logic will fail if the "Windows to DOS
filename transistion" is deactivated in the registry (it's on by
default). In that case no homedir is used and the "Windows Roaming
Mechanism" kicks in.
2012-06-20 13:39:18 +02:00
Yamagi Burmeister
e1f338f59b Reformat the headers 2012-06-18 10:46:31 +02:00
Yamagi Burmeister
e3690bcaab Bump version number to 4.90
This is done to distinguish the upcoming "Yamagi Quake II - Windows Test I"
from the normal 4.21 version.
2012-06-18 09:51:59 +02:00
Yamagi Burmeister
63cdbff0e3 Merge branch 'windows' into cleanup 2012-06-14 12:30:52 +02:00
Yamagi Burmeister
7b54f3d668 Merge branch 'master' into windows
Conflicts:
	src/client/sound/snd_al.c
2012-06-14 12:27:09 +02:00
Yamagi Burmeister
61b10f12da Fix a crash when entering water with s_openal = 0 2012-06-14 12:24:29 +02:00
Yamagi Burmeister
341014eda0 Merge branch 'scanbuild' into windows 2012-06-14 12:18:15 +02:00
Yamagi Burmeister
73e6dc6307 Revert "Convert random() to randk() and crandom() to crandk()"
This reverts commit 12ce981d64.
2012-06-14 12:12:57 +02:00
Yamagi Burmeister
060235e7dd Merge branch 'windows' into cleanup
Conflicts:
	src/common/filesystem.c
	src/sdl/input.c
	src/sdl/refresh.c
	src/unix/system.c
2012-06-11 11:21:16 +02:00
Yamagi Burmeister
2c0148bab5 Enlargen MAX_OSPATH to 256 on Windows
This is necessary due to the extrem long homedir-pathes in some Windows
localizations. While it would be nice to have the same value on all
platform it would break existing savegames and don't think that it's
worth that.
2012-06-11 10:25:12 +02:00
Yamagi Burmeister
47707a728e Use Windows headers on Windows 2012-06-11 10:18:44 +02:00
Yamagi Burmeister
e70067ceba Refactor the "home"-path finding logic into own functions
With this change the homedir is no longer selected in the filesystem,
but in platform dependend functions. This allows us to use WINABI calls
for selection, resulting using the apropriate diretory on localized
versions of Windows XP.
2012-06-11 09:55:54 +02:00
Yamagi Burmeister
e8eea857e4 Fix another buffer overflow, this time when writing the config.cfg
This overflow is a problem on all platforms but manifested itself
especially on a german Windows XP due to it's long profile path.
2012-06-10 18:45:14 +02:00
Yamagi Burmeister
6c2f97927e Add a missing brace twisting the logic of the Windows XP check 2012-06-09 11:42:35 +02:00
Yamagi Burmeister
87e62a3724 Reformat 2012-06-08 13:01:56 +02:00
Yamagi Burmeister
26b15dbe07 Reformat 2012-06-08 12:23:01 +02:00
Yamagi Burmeister
9ad40b2a17 Cleanup and reformat. 2012-06-07 15:40:58 +02:00
Yamagi Burmeister
ac6748e7d2 Merge the collision model back into one file 2012-06-07 15:04:45 +02:00
Yamagi Burmeister
d12f0c642f Recombine the message handling back into one file 2012-06-07 14:33:09 +02:00
Yamagi Burmeister
e0faf784a6 Move stuff from common/common/ to common/ 2012-06-07 13:54:08 +02:00
Yamagi Burmeister
56aff1dc89 Recombine the command parser in one file
Spliting it into several files seemed logical but in retrospect it was
a bad idea, unnecessary complicating the code.
2012-06-07 13:35:33 +02:00
Yamagi Burmeister
16e57ede33 Fix some indention issues 2012-06-06 18:06:08 +02:00
Yamagi Burmeister
39677c1b0f Fix a potential buffer overflow 2012-06-06 17:55:37 +02:00
Yamagi Burmeister
d8e35b82c7 Reformat the sound system code
caedes and some other people will probably kill me for this, but I'm the
idiot who has to maintain the code. And that's much easier if it's in a
readable und writeable state.
2012-06-06 11:13:07 +02:00
Yamagi Burmeister
51cc3369b1 Provide an optimized case for mixing 16 bit / 2 chan sound
With sound quality "high" nearly all sound is provided as 16 bit PCM
with 2 channels. Since most players use this setting, provide an optimed
case for it. This should also solve the cracking due to overshot
soundbuffers, which was especially noticeable on Windows. This changes
only effects the old SDL soundbackend and not OpenAL.
2012-06-06 10:34:36 +02:00
Yamagi Burmeister
15400b2133 Use memset() instead of array magic 2012-06-06 10:02:55 +02:00
Yamagi Burmeister
272b897919 Reformat snd_mix.c 2012-06-06 09:58:06 +02:00
Yamagi Burmeister
f5233db0b2 Add IPv6 support for Windows
This is essentially a port of unix/network.c to windows.
2012-06-06 09:48:48 +02:00
Yamagi Burmeister
0c74a1af75 Create profile in Documents instead of AppData 2012-06-05 14:28:34 +02:00
Yamagi Burmeister
d17d996dc5 Import Sys_Mkdir() into the refresher 2012-06-05 14:19:29 +02:00
Yamagi Burmeister
7715592aaa Write config data in AppData
Under Windows all config data is written to %USERPROFILE%\AppData\
Local\YamagiQ2. To archive this code was added that translates Windows
pathes with backslashes into Unix pathes with normal slashes.
2012-06-05 12:52:44 +02:00
Yamagi Burmeister
0b9ec45eb7 Remove leftovers from the softrenderer 2012-06-05 10:54:47 +02:00
Yamagi Burmeister
de3e53069f Remove Alt-Tab handling. It's done by SDL 2012-06-05 10:50:24 +02:00
Yamagi Burmeister
a55d717a80 Replace atoi() with strtol() in Windows code 2012-06-05 10:46:15 +02:00
Yamagi Burmeister
af83f80dff Add header guards to new headers 2012-06-05 10:42:30 +02:00
Yamagi Burmeister
28be8cda8e Work around the missing _controlfp prototypes in MinGW 2012-06-05 10:29:20 +02:00
Yamagi Burmeister
58c3b22c8a Add platform defines for Windows 2012-06-05 10:17:01 +02:00
Yamagi Burmeister
ca18af254e Remove Sys_AppActivate()
This code is unnecessary because SDL handles all activation events,
brings the Window into foreground, etc.
2012-06-05 10:11:29 +02:00
Yamagi Burmeister
21ab0de692 Remove support for the Windows clipboard
This was just broken and rewriting it is not worth the efford
2012-06-05 10:09:24 +02:00
Yamagi Burmeister
d1008a564d Port OpenAL to Windows and enable it by default 2012-06-05 09:57:30 +02:00
Yamagi Burmeister
4021087a38 Make the SDL sounddriver selectable via s_sdldriver
This is necessary since the default "waveout" driver on windows is
incompatible to Quake II (due to too big output buffers) and "dsound"
can't be forced since it's not available on some installations. The
default driver is choosen by platform:

Windows -> dsound
FreeBSD -> dsp
Linux   -> alsa
2012-06-05 09:03:46 +02:00
Yamagi Burmeister
2629f908ae Initialize randk() and startup 2012-06-04 16:24:37 +02:00
Yamagi Burmeister
ea02b14ca7 Poke the input subsystem at every frame to process events 2012-06-04 13:51:46 +02:00
Yamagi Burmeister
6b650e9ea7 Initialize the input backend 2012-06-04 13:40:23 +02:00
Yamagi Burmeister
6b7bc06074 opengl32.dll is the default gldriver on Windows 2012-06-04 13:13:14 +02:00
Yamagi Burmeister
27de5f3a6f Fall back to opengl32.dll if the gldriver couldn't be loaded 2012-06-04 13:10:12 +02:00
Yamagi Burmeister
5523cc8de2 Use correct name to query the refresher 2012-06-04 12:52:54 +02:00
Yamagi Burmeister
51869fbc9d Add qgl.c for Windows
This file was taken from ioQuake2 and altered for inclusion in Yamagi
Quake II.
2012-06-04 12:42:55 +02:00
Yamagi Burmeister
0d46fed529 Add Windows stuff
This code was taken from ioQuake2 and altered for inclusion in Yamagi
Quake II
2012-06-04 12:41:29 +02:00
Yamagi Burmeister
d0146dc4d5 Hide native JPEG and TGA loading functions behind RETEXTURE 2012-06-04 12:40:58 +02:00
Yamagi Burmeister
b42f208fd0 Include windows.h in refresh/header/local.h 2012-06-04 12:26:49 +02:00
Yamagi Burmeister
0365c93138 Add glwindow.h for Windows
This file was taken from ioQuake2 and altered to work with Yamagi Quake
II
2012-06-04 12:08:18 +02:00
Yamagi Burmeister
b8792c7fc0 Use correct SDL include path under Windows and hide X11 stuff 2012-06-04 11:52:07 +02:00
Yamagi Burmeister
51ca0ca673 Define missing OpenGL extensions for Windows
While this is not the 100% correct way, it's much cleaner than just
importing th whole header files.
2012-06-04 11:46:08 +02:00
Yamagi Burmeister
86f89fce22 Implement vid.c for Windows
This file was taken from ioQuake2 and modified to work with Yamagi Quake
II. It may not be perfect yet, but should be good enough to the client
up and running.
2012-06-04 11:09:43 +02:00
Yamagi Burmeister
5d272eeab8 strsep() is a FreeBSDism. Switch over to strtok(). 2012-06-04 10:53:55 +02:00
Yamagi Burmeister
a4609fc42b Use correct include pathes to SDL under Windows 2012-06-04 10:02:01 +02:00
Yamagi Burmeister
7d3b9a5c00 Ignore errors of AllocConsole()
This errors are harmless and thrown when the process is already attached
to a console. Since the dedicated server is a console application the
console is created by Windows at startup...
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
4e37958b63 Stub Sys_Init() for Unix and call it while initializing 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
32dc525124 Stub NET_Init() for Unix and call it while initializing 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
d2177bb618 Open binary files in mode "rb" instead of "r"
This subtile bug didn't show on unixoid platforms, but led to problems
on Windows.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
991ff17f1b Implement Sys_GetCurrentDirectory() 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
1a3b54b27e Move glob.c and glob.h to common
We need glob_match() for Windows
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
280a432161 Comment Sys_AppActivate() since cl_hwnd will be ported later 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
f3bead4f6b Add Windows network functions in network.c
This file was taken from ioQuake2 and refactored to match Yamagi Quake
II. It would be nice to have IPv6 support and to remove the old IPX
cruft, but that happen now.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
0b226ce838 Include ctype.h and silence some warnings 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
263156bda7 Implement system depended file handling
Those functions were taken from ioQuake2 and refactored to match Yamagi
Quake II.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
bd1070eff2 Remove FS_DeletePath() and Sys_Rmdir()
Thise functions where added with the filesystem rewrite but never used.
Removing them saves us from implementing Sys_Rmdir() for Windows.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
a6f22f0f5a Implement Sys_Milliseconds
This function was taken from ioQuakeII and refactored to match Yamagi
Quake II
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
05f7e37c77 Add memory handling functions in mem.c
This code was taken from ioQuake2, refactored into an own file and
altered for the inclusion in Yamagi Quake II.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
e8d44459a4 Use correct types and remove unused variables 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
d9560b4020 Hide calls to CL_Shutdown() behind !DEDICATED_ONLY 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
8ca30adf46 Do not set the FPU state
This is a workaround for a MinGW bug and should be resolved before the
first CFT is released. A TODO item was added in a preceding commit.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
39ae083340 Remove DirectX variables 2012-06-04 09:13:30 +02:00
Yamagi Burmeister
1782c5ab30 Add winquake.h
This header containts Windows specific stuff. It was taken from ioQuake2
and cleaned up for inclusion in Yamagi Quake II.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
f0e23f199d Add resource.h
This is the "Windows resource file", required by every Windows
application
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
0eb042555b Add conproc.c and the coresponding header
conproc.c implements support functions for the console windows used by
the dedicated server. It was taken from ioQuake2 and cleaned up for the
inclusion in Yamagi Quake II.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
4adc6a2ca2 Add windows/system.c
This files contains most support functions for windows and the main
loop. It was taken from Icculus Quake II and cleaned up. This early
version may still have bugs.
2012-06-04 09:13:30 +02:00
Yamagi Burmeister
ce3d61ef61 Remove unused Sys_CopyProtect stup 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
cac409b116 Remove old setuid() magic 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
66c6122bbb Back out if Quake II is run as root or if eUID != rUID
This is a sanity check to prevent stupid users from running Quake II as
root or as a setuid binary. Quake II is such a mess that running it as
root or setuid is just reckless.
2012-06-04 09:13:29 +02:00
Yamagi Burmeister
83e069feb2 Abort if the clipplane is NULL. 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
e11a15308b Use Com_Error instead of Sys_Error 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
9823a23a91 Initialize sounds[] to avoid garbage branch conditions down below 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
1deb069085 Remove dead assignments 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
afd2f4538c Return in case of possible overflow 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
41a704a13e Do not turn stack address into a global variable 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
36a41f9746 Prevent a divion by zero 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
b1dfcb7aff Convert random() to randk() and crandom() to crandk() 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
9f45bd38f2 Ensure that pseudo random numbers are always >0 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
35e5bbb48b Convert rand(), crand() and frand() to randk(), crandk() and frandk() 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
99520d1331 Implemented the new random generator in shared.h instead of common.h 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
28c200a2e8 Implement crandk() and frandk() and remove old functions 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
253373dbda Seed the new PRNG at startup 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
056f4d287b Add rand.c, an implementation of G. Marsaglia KISS PRNG 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
edae2b0473 Change atof() to strtod() 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
e9c90e16a9 Change atoi() to strtol() 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
0aa75f8704 Explicit cast 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
9ec98a79d2 Fix a potential buffer overflow 2012-06-04 09:12:59 +02:00
Yamagi Burmeister
60dfaee439 Remove old setuid() magic 2012-06-02 16:46:25 +02:00
Yamagi Burmeister
f28e005e1e Back out if Quake II is run as root or if eUID != rUID
This is a sanity check to prevent stupid users from running Quake II as
root or as a setuid binary. Quake II is such a mess that running it as
root or setuid is just reckless.
2012-06-02 16:33:12 +02:00
Yamagi Burmeister
deaeac42b7 Abort if the clipplane is NULL. 2012-06-02 13:40:49 +02:00
Yamagi Burmeister
6cafb22a9c Use Com_Error instead of Sys_Error 2012-06-02 13:31:20 +02:00
Yamagi Burmeister
42da811355 Initialize sounds[] to avoid garbage branch conditions down below 2012-06-02 13:29:08 +02:00
Yamagi Burmeister
6befae2ffd Remove dead assignments 2012-06-02 13:21:22 +02:00
Yamagi Burmeister
bf02575b1e Return in case of possible overflow 2012-06-02 13:18:33 +02:00
Yamagi Burmeister
ef3c9bf620 Do not turn stack address into a global variable 2012-06-02 13:06:12 +02:00
Yamagi Burmeister
4ece3714aa Prevent a divion by zero 2012-06-02 12:56:07 +02:00
Yamagi Burmeister
12ce981d64 Convert random() to randk() and crandom() to crandk() 2012-06-02 12:30:20 +02:00
Yamagi Burmeister
fc2d67bac1 Ensure that pseudo random numbers are always >0 2012-06-02 12:11:14 +02:00
Yamagi Burmeister
40ff7a6b09 Convert rand(), crand() and frand() to randk(), crandk() and frandk() 2012-06-02 11:55:12 +02:00
Yamagi Burmeister
a0ccf86660 Implemented the new random generator in shared.h instead of common.h 2012-06-02 11:32:45 +02:00
Yamagi Burmeister
effc7b3c35 Implement crandk() and frandk() and remove old functions 2012-06-02 11:22:54 +02:00
Yamagi Burmeister
7bd1392a5a Seed the new PRNG at startup 2012-06-02 10:59:43 +02:00
Yamagi Burmeister
97f7ba0610 Add rand.c, an implementation of G. Marsaglia KISS PRNG 2012-06-02 10:56:40 +02:00
Yamagi Burmeister
881b935b65 Change atof() to strtod() 2012-06-02 10:33:28 +02:00
Yamagi Burmeister
67dbe816c9 Change atoi() to strtol() 2012-06-02 10:24:52 +02:00
Yamagi Burmeister
fc679896f5 Explicit cast 2012-06-02 09:07:20 +02:00
Yamagi Burmeister
32fe0ba21f Prevent a buffer overflow. 2012-06-01 18:13:30 +02:00
Yamagi Burmeister
f9837b9130 Initialize variables (they may be used uninitialzed further down below) 2012-06-01 17:59:00 +02:00
Yamagi Burmeister
0d8f990d14 Ensure that variables that point to data on the stack are cleared 2012-06-01 17:20:05 +02:00
Yamagi Burmeister
0e1520d29a Remove dead code and assignments 2012-06-01 17:05:40 +02:00
Yamagi Burmeister
e9605e8a8b Use AL_BUFFERS_QUEUED at stream shutdown. 2012-05-26 12:03:01 +02:00
Yamagi Burmeister
492b7c1a2b Convert whitespace indentation to tabs 2012-05-26 12:00:48 +02:00
Yamagi Burmeister
28c4edfd69 Clear buffers before deleting the sources
This fixes a very long lasting shutdown procedure which made it look
like Quake II freezed. Especially on slow machines it was a problem.
2012-05-26 11:37:47 +02:00
Yamagi Burmeister
37132d8ac9 Bump version number to 4.21 2012-05-26 09:45:57 +02:00
Daniel Gibson
cf41d61d72 Add OpenAL to printed Client build options 2012-05-17 15:06:45 +02:00
Daniel Gibson
62d76b3d40 Fix segfault when s_openal=0 but USE_OPENAL=1
If the game was compiled with openal support (USE_OPENAL is defined),
but it's disabled via cvar (set s_openal 0) there could be segfaults
when calls to openal where done anyway, because the check
if(sound_started == SS_OAL) was forgotten.
This is fixed now.
2012-05-17 14:47:05 +02:00
Yamagi Burmeister
5bf1ee670d Fix s_show when OpenAL is used 2012-05-12 15:11:17 +02:00
Yamagi Burmeister
aff51633d0 Add a sanity check against buffer overflows to S_BuildSoundList 2012-05-12 14:46:13 +02:00
Yamagi Burmeister
4a414b588e Fix a buffer overflow in AL_AddLoopSounds
This fixes a crash in mine4.bsp and most likely some other problems.
The bug was reported by "mxmvasilyev0 [at] gmail [dot] com" and tracked
as Github issue #1.
2012-05-12 14:42:15 +02:00
Yamagi Burmeister
b6325d7858 Remove unused variables and dead code (patch submitted by Christoph
Mallon)
2012-04-30 10:02:58 +02:00
Christoph Mallon
ab034114b4 Whitespace fixes. 2012-04-30 08:25:59 +02:00
Daniel Gibson
ebccfc63df Remove need to link against libopenal
libopenal is loaded with dlopen() and for all used alBla and alcBla functions
there are function pointers (just like thee qgl stuff for OpenGL).
Thus there's no need to link against libopenal on compile-time.

There were a few occurences of "normal" openal functions (al* instead of qal*)
- they are fixed now.

This allows to use a yquake2 version compield with WITH_OPENAL=yes to be used
on systems that have no libopenal installed (the standard SDL sound backend
will be used then).
2012-04-29 15:24:14 +02:00
Yamagi Burmeister
4203bed129 Bump version number to 4.20 2012-04-29 08:08:21 +00:00
Daniel Gibson
965fedf9ae It's X11GAMMA with 2 "m". 2012-04-28 20:04:24 +00:00
Daniel Gibson
2b7ef996ed Fall back to "libGL.so.1" if gl_driver set in (default) config fails 2012-04-28 20:02:15 +00:00
Daniel Gibson
632bd0a776 Enforce "C" lokale, this time correctly
Now when some braindead alsa/ladspa plugin calls setlocale(LC_ALL, "") the 
locale is (still) set to "C" and not some other locale that may fsck up printf
and scanf formats
2012-04-28 19:39:36 +00:00
Daniel Gibson
669a78de12 Compiletime options in Makefile overwritable from console
And a small fix that shuts up a compiler warning
2012-04-28 19:38:07 +00:00
Daniel Gibson
53d54b1f23 Merge OpenAL branch 2012-04-28 15:58:50 +00:00
Daniel Gibson
31f9af817f Last fixes and cleanups for OpenAL support
* New license header in snd_al.c
* README fixes
* Fix printing of used OpenAL device
* Cleanup in snd_al.c
2012-04-28 15:44:14 +00:00
Yamagi Burmeister
c62e5ac85b - Implement AL_UnqueueRawSamples() and use it to stop the Vorbis playback
imediatly
- Increase Vorbis buffers to 64. 24 were to few
2012-04-27 14:06:08 +00:00
Yamagi Burmeister
2b6389a471 Filter sound samples (not the music) when under water 2012-04-27 13:55:45 +00:00
Yamagi Burmeister
1a0b4ebad5 Do not set / enable / show the s_openal CVAR if the binary is build
without OpenAL support. OpenAL is enabled in the default Makefile and if
it's disabled, it's shown at startup.
2012-04-27 12:00:22 +00:00
Yamagi Burmeister
905b31a918 Integrate OpenAL into the options system 2012-04-25 10:09:30 +00:00
Yamagi Burmeister
a388254252 Fix a missmerge 2012-04-25 10:09:16 +00:00
Yamagi Burmeister
2c3c203097 Merge out new options framework from the trunk 2012-04-25 09:57:17 +00:00
Yamagi Burmeister
38943b3573 Print build options at startup 2012-04-25 09:50:06 +00:00
Yamagi Burmeister
048f680701 Hide ZIP support behind ZIP 2012-04-25 09:12:02 +00:00
Yamagi Burmeister
92da6ed580 Hind retexturing support behind RETEXTURE 2012-04-25 08:59:40 +00:00
Yamagi Burmeister
03015a686b Hide music playback from CD behind CDA 2012-04-25 08:53:25 +00:00
Yamagi Burmeister
9d60a5de6a Hide OGG/Vorbis support under OGG 2012-04-25 08:24:38 +00:00
Yamagi Burmeister
f836cef4c4 Rename qal_api.c to unix/qal.c and qal_api.h to unix/header/qal.h.
Both files are platform dependend and won't work on non unixoid
platforms.
2012-04-24 14:20:01 +00:00
Yamagi Burmeister
bf6d491af3 - Refactor AL_SoundInfo() into the platform dependent
QAL_SoundInfo().
- Use QAL_SoundInfo() to print the OpenAL infos 
  at startup and by the "soundinfo" command.
- Implement printing of all available OpenAL
  devices at startup and by the "soundinfo"
  command.
2012-04-24 14:07:33 +00:00
Yamagi Burmeister
79c137254a Rework qal_api.c and qal_api.h:
- Reformat to match "our" coding style
- Unroll all unreadable macros
- Remove the use of goto
2012-04-24 13:22:05 +00:00
Yamagi Burmeister
4ff4bf09e9 Merge the trunk back into the openal branch. 2012-04-23 14:09:33 +00:00
Yamagi Burmeister
479aae4a9c *gna* This \n got lost on the way 2012-04-23 13:57:36 +00:00
Yamagi Burmeister
90d0811185 Delete all OpenAL sources at shutdown 2012-04-23 13:55:25 +00:00
Yamagi Burmeister
134878e996 - Some more minor style cleanup
- Much improved startup log messages
2012-04-23 13:44:12 +00:00
Yamagi Burmeister
678e50bf8d Raise the volume of a positioned sample by 384 instead of 255 when using
OpenAL. This makes them much more distinguishable from the background
music.
2012-04-23 13:23:47 +00:00
Yamagi Burmeister
3bce2a212a - Use a better way to calculate the number of buffers
used by OGG/Vorbis. 24 buffers are enough for smooth
  and stutter free playback and ensure, that OGG_Stop()
  is effective nearly immediately.
- Change C99 comments to C89, since snd_vorbis.c is
  a C89 file. Caedes will beat me for this :/
2012-04-23 07:59:39 +00:00
Daniel Gibson
3d7013e12b Fix: Cvar_Get needs a string as default value, not an int.. 2012-04-22 20:28:41 +00:00
Daniel Gibson
8bfc61b564 Introduce s_openal to enable/disable OpenAL
And fix possible dangling else problem in that code
2012-04-22 20:27:02 +00:00
Daniel Gibson
efd85a76c6 Updated paintedtime in OpenAL mode so shotgun sounds right
probably fixes other issues as well.
2012-04-22 20:14:56 +00:00
Daniel Gibson
65914b342d Allow DMA/SDL sound in OGG_Stream when compiling with USE_OPENAL 2012-04-22 17:59:03 +00:00
Yamagi Burmeister
e388a425b4 Enable OGG/Vorbis playback in OpenAL mode. 2012-04-22 17:50:15 +00:00
Daniel Gibson
04fd7f2cda OpenAL Streaming Sound stuff
from zeq2, but adapted/stripped down for our needs.

Videos work (for me), music does not (yet)
2012-04-22 15:59:18 +00:00
Daniel Gibson
6384b850f1 Remove redundancy 2012-04-22 15:57:59 +00:00
Daniel Gibson
f4d5040a73 Add OpenAL stuff to Makefile, make it compile and work (no streaming sound yet)
It works \o/
It's still hacky so it needs more work.
And streaming sound (OGG music, sound from videos) is still missing.
2012-04-22 00:24:50 +00:00
Yamagi Burmeister
fc32d16d42 Print
- OS
- CPU
- byte ordering
at startup
2012-04-19 13:33:48 +00:00
Yamagi Burmeister
179ec5538e Move strlwr() into shared.c and don't link main.c into the refresher 2012-04-19 13:22:50 +00:00
Yamagi Burmeister
a7aa1e93c0 Rename misc.c to main.c 2012-04-19 13:14:03 +00:00
Yamagi Burmeister
8930dc512f Enforce "C" locale 2012-04-19 13:11:00 +00:00
Yamagi Burmeister
b6bb97e223 - add support for big endian CPUs
- enable the build on SPARC64
- add runtime-requirements for SPARC64
- bump version number to 4.10
2012-04-16 06:54:48 +00:00
Daniel Gibson
7e0a44825e OpenAL support, from Q2Pro
Copied and adapted (hopefully) all relevant code from Q2Pro.
Did some small refactorings when needed.

Still TODO:
* Adapt Makefile
* OGG support when using OpenAL
* A cvar that switches between OpenAL and DMA/SDL
* Actually compiling and testing this stuff ;)
2012-04-15 02:58:01 +00:00
Yamagi Burmeister
bedb5fb573 Reenable gamma via SDL. The upstream bug was fixed with SDL 1.2.15 2012-03-30 09:11:32 +00:00
Yamagi Burmeister
9339d89bdf Provide backward compatiblity with libjpeg v6 2012-03-12 10:15:22 +00:00
Yamagi Burmeister
bb9126ae43 Convert GetPCXInfo and GetWalInfo into void functions 2012-03-12 10:00:07 +00:00
Yamagi Burmeister
643cb93e5f Reformat pcx.c 2012-03-12 09:56:27 +00:00
Yamagi Burmeister
57b06a8bcf Implement retexturing for PCX files 2012-03-12 09:54:04 +00:00
Yamagi Burmeister
d0133509e1 Provide the gl_retexturing CVAR to switch retexturing off. Default is
"1", retexturing enabled.
2012-03-12 09:31:33 +00:00
Yamagi Burmeister
48a0d6a50d - Reformat wal.c
- Add a file header to wal.c
2012-03-12 09:23:44 +00:00
Yamagi Burmeister
1cc06e2841 Reformat the JPEG loader 2012-03-12 09:21:19 +00:00
Yamagi Burmeister
7db2d76833 Import the Quake III Arena TGA loader and replace out implementation
with it. The Q3A is about ~40% faster and supports more types of TGA
files, including bottom to top encoded images.
2012-03-12 09:16:59 +00:00
Yamagi Burmeister
43fcc8eb99 Scale the replacement textures to the size of the original texture 2012-03-12 08:53:22 +00:00
Yamagi Burmeister
9edf27f103 Reactor yesterdays work 2012-03-12 08:11:22 +00:00
Daniel Gibson
1d8109cbbc Work in progress version of the retexterung support. The next step is to alter
r_LoadPic, so that it accepts realwidth and realheight as additional arguments 
and uses them to manipualte image after uploading it into the vram.
2012-03-11 19:01:49 +00:00
Daniel Gibson
441c988b31 - Add JPEG support
- Refactor call to LoadTGA so it returns image_t * directly
2012-03-11 16:50:57 +00:00
Yamagi Burmeister
2b2e996dda Make windowed_mouse CVAR_USERINFO 2012-03-08 11:33:58 +00:00
Yamagi Burmeister
042ec93bfe Rename r_lefthand to gl_lefthand to match the other renderer cvar. This
is a noop, since this is an internal cvar to exposed to the user.
2012-03-08 11:30:30 +00:00
Yamagi Burmeister
1f3ce73a75 Add gl_farsee (by Richard Allen) 2012-03-08 11:24:45 +00:00
Yamagi Burmeister
3dbd925c34 Remove a unnecessary \n 2012-02-29 20:58:37 +00:00
Yamagi Burmeister
8ff3880457 But our head even deeper into the users anus 2012-02-29 20:56:51 +00:00
Yamagi Burmeister
75df000d27 Flesh the message printed by the signal handler more out and print the
compiler used to create the binary.
2012-02-29 20:54:31 +00:00
Yamagi Burmeister
c7eac16467 Tell the user to include the executable image 2012-02-28 20:24:33 +00:00
Yamagi Burmeister
d87328293c Add a CHANGELOG entry 2012-02-27 11:33:32 +00:00
Daniel Gibson
b70dc11672 - Fix memory leaks in the server start menu by not
creating the maplist each time it's called, but
  preserve it across several calls.

- Fix M_PushMenu a second time by taking a corner
  case into account when the requested menu is 
  opened and on the stack but not on top.
2012-02-26 20:21:40 +00:00
Daniel Gibson
32377a6b57 Fix crash when opening menu twice via hotkeys
Now this closes the menu again, faking toggling behaviour
2012-02-26 18:58:48 +00:00
Yamagi Burmeister
04f5ff9523 Bump version number to 4.03 2012-02-17 08:18:25 +00:00
Yamagi Burmeister
6b2ef052ef Add a comment about GL_POINT_SMOOTH on Mesa3D 2012-02-12 16:53:41 +00:00
Yamagi Burmeister
35493a49b4 Print the version number in the window title 2012-02-09 16:56:24 +00:00
Yamagi Burmeister
f8a9f6ead4 - Define the values for point parameters in qgl.h. They should be
set by the OpenGL implementation somewhere in gl.h but apperently
  the values are sometimes wrong...
- AND the particle color with 0xFF. This is a no-op with most
  OpenGL implementations but may help Mesa3D. Suggest by
  "hukaru" on IRC.
2012-02-09 16:30:17 +00:00
Yamagi Burmeister
0f7b422ded - Switch multitexturing by default to 1
- Switch paletted textures (8 bit textures) to 0
2012-02-09 15:13:51 +00:00
Yamagi Burmeister
cf7d2645cc Fix gl_ext_multitexturing set to 1 2012-02-09 15:11:35 +00:00
Yamagi Burmeister
4b1c43e98a Do not call the low level function to create a directory, but the
filesystem internal high level API function. While here remove a
debug printf().
2012-02-07 12:25:32 +00:00