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
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