Commit graph

440 commits

Author SHA1 Message Date
sezero
710ac79d7b * net_sys.h: revert previous commit undefining EWOULDBLOCK and
ECONNREFUSED for windows.  define new macros NET_EWOULDBLOCK and
  NET_ECONNREFUSED for both unix and for windows and change the
  users accordingly.
* net_udp.c, net_wins.c, net_wipx.c:
  adjust for the new NET_EWOULDBLOCK and NET_ECONNREFUSED macros.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@398 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 20:10:34 +00:00
sezero
ca7d52def6 net_sys.h: the new MS SDKs define EWOULDBLOCK and ECONNREFUSED,
so we must undefine them before redefining.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@397 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 12:39:24 +00:00
sezero
00265101c5 removed references to Misc/Todo.txt and Misc/Changelog.txt from the Xcode
project files.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@396 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 10:20:24 +00:00
sezero
8c9dc9ebc9 removed Misc/Todo.txt and Misc/Changelog.txt. Appended old Misc/Changelog.txt
content to Misc/fitzquake080sdl.txt for future reference.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@395 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 10:12:33 +00:00
sezero
42dc385737 removed the cdplayer facility added in 0.85.3
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@394 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 10:02:16 +00:00
stevenaaus
724459d6ba Update Todo list
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@393 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 09:55:01 +00:00
sezero
7670e73aa5 changed makefiles to use 1/0 instead of yes/no for the codec options.
made quakespasm custom conback embedding optional, still defaulting to 1.
the code requires USE_QS_CONBACK preprocessor definition.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@392 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 09:32:22 +00:00
sezero
82ed644070 updated the user directories patch to apply and function properly after
the latset changes.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@391 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-11 20:05:12 +00:00
stevenaaus
e0ad53f907 Make Makefile.darwin consistent with Makefile
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@390 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-11 08:19:22 +00:00
stevenaaus
0f7233c21a Documentation typos
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@389 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-11 08:06:03 +00:00
sezero
1a2f871517 bgmusic.c: remove some unnecessary comments.
(BGM_Play): call BGM_Stop() before anything else. don't do anything
if there are no music handlers.
(BGM_PlayCDtrack): remove commented out code. if CDAudio_Play() call
failed and there are no music handlers, don't do anything else.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@388 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:33:12 +00:00
sezero
3d0026615c bgm*: updated copyright years.
bgmnull.c: removed unused file.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@387 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:17:15 +00:00
sezero
c7074d2202 min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
sezero
8c615fb596 add the new bgm_extmusic cvar to bgmnull.c, too.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@385 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 08:37:18 +00:00
sezero
f7be45e71e added -nomusic command line switch to turn off playing external music files.
added new cvar bgm_extmusic to enable/disable playing of external music files.
added a new menu entry to control bgm_extmusic.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@384 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 08:33:22 +00:00
stevenaaus
ff60c5ae71 Doco update
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@383 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 03:09:09 +00:00
stevenaaus
80647553aa Author name change
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@382 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-06 20:19:37 +00:00
sezero
23abed6c82 applied a modified version of heritage & quit message by Sander van Dijk
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@381 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-06 20:05:49 +00:00
sezero
8d1c1c413e updated the darwin makefile after music streaming changes. it probably needs
further updating, though...

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@380 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 23:05:17 +00:00
sezero
ea8130cdc5 updated codeblocks project files after the streaming music changes.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@379 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 22:27:33 +00:00
sezero
91d0279653 menu.c: allow proper music volume adjustment for windows.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@378 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:30:37 +00:00
sezero
1e795f4640 snd_mp3.c: fixed windows build.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@377 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:29:00 +00:00
sezero
90034fc593 updated windows makefiles and visual studio project files after streaming
music changes.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@376 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:27:37 +00:00
sezero
f43a9efc38 added libmad, libogg and libvorbis headers and x86 and x64 import
libraries for windows builds.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@375 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:55:57 +00:00
sezero
54c9377fb1 Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
  Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
  sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
  CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
  changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
  and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
  which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
  in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
  calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
  shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
  S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
  music as raw samples. Adapted from quake2 and ioquake3 with changes.
  Individual codecs are responsible for handling any necessary byte swap
  operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
  from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
  Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
  USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
  codecs.
- Windows makefiles and project files as well as other CodeBlocks project
  files will be updated shortly.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
sezero
de63f2ea8d made COM_FindFile to accept both file and handle as NULL. Added
COM_FileExists as a new helper procedure which calls COM_FindFile
with both file and handle parameters as NULL.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@373 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 18:01:15 +00:00
sezero
2e38fd78e5 gl_model.c (Mod_LoadLighting): Check the path_id of the lit file and
accept only if it is coming from the same game directory as for the map
itself.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@372 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 22:02:11 +00:00
sezero
20ab747b13 gl_model.h (model_t): Added a path_id member to store the
information about the game directory from where the model is
loaded.
gl_model.c (Mod_LoadModel): Send the path_id member of the
model to FS_Load* function, instead of NULL.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@371 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:55:26 +00:00
sezero
604b4078e9 common.c (searchpath_t): Added new member `path_id', an unsigned
int identifier assigned to the game directory. Remember that main
<install_dir>/game1 and the unix <userdir>/game1 have the same id.
The id starts as 1 for the first data1 directory. For every new
directory, the value is the left-shifted version of the previous
one.  Made COM_FindFile() to accept a path_id pointer argument
and storing the id in it if it isn't NULL. Made COM_OpenFile(),
COM_FOpenFile() and all COM_Load* functions to accept a path_id
pointer argument similarly. Adjusted callers accordingly.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:45:16 +00:00
sezero
ba77e40eca Removed support for -proghack and -path. I think no one misses them.
Made COM_FindFile() static to common.c. Removed COM_CopyFile(), no
callers at the moment.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@369 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:42:54 +00:00
sezero
ec479a3875 Made CDAudio_Play() to return success (0) or failure (-1) instead of void.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@368 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 18:33:21 +00:00
sezero
fbe14fd818 fixed rest of the strict-aliasing and uninitialized use warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@367 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 14:05:20 +00:00
sezero
c77747eaaf whitespace/formatting tidy-up in quakedef.h.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@366 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:32:16 +00:00
sezero
494a9a69be removed the useless msg_suppress_1 thing.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@365 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:27:02 +00:00
sezero
ca81497098 removed all remaining references to id386 and UNALIGNED_OK because
the fitz engine doesn't use them at all.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@364 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:24:28 +00:00
sezero
9a60f94017 changed MAX_OSPATH from 128 to 256 for better compatibility everywhere.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@363 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:20:15 +00:00
sezero
3fed629100 W_LoadWadFile: Just use COM_LoadMallocFile(). Some minor cleanup.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@362 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 10:47:29 +00:00
sezero
703f5441b8 common.c, common.h: Added LOADFILE_* defines for use with COM_LoadFile,
for easier reading. Added COM_LoadZoneFile(), COM_LoadMallocFile() and
COM_LoadBufFile() from uhexen2. Added comments after their prototypes
in common.h.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@361 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 10:29:38 +00:00
sezero
a21c907c86 Mod_LoadLighting: free the allocated hunk memory in case of broken or
unsupported lit file.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@360 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 09:05:44 +00:00
sezero
de2d9c7661 applied a better fix for the infamous "SV_TouchLinks: next != l->next" problem.
Fixes "whiteroom" (http://www.quaddicted.com/reviews/whiteroom.html) completely
locking the engine. fix from the quakeforge sources.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@359 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 07:55:43 +00:00
sezero
82dde7c347 W_LoadWadFile: free wad_base only if it isn't NULL.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@358 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 23:30:42 +00:00
sezero
666482998d killed all references to Draw_BeginDisc
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@357 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 23:28:08 +00:00
sezero
4fe7392307 sync several sound-related files with uhexen2 a little: move
DEFAULT_SOUND_PACKET_VOLUME and DEFAULT_SOUND_PACKET_ATTENUATION
from sound.h to protocol.h. remove unused gamealive, soundalive
and splitbuffer members from the dma_t structure. make SNDDMA_Init()
to take a dma_t* parameter and make sn static to snd_dma.c. copy
over LordHavoc's S_StartSound skip calculation fixes from uhexen2.
make many functions/data static to their respective files. many
whitespace/formatting clean-ups.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@356 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 21:10:26 +00:00
sezero
dd816153ba backports from uhexen2 source, preparing for streaming music support:
* snd_mix.c: Increased PAINTBUFFER_SIZE from 512 to 2048.
* snd_mix.c: snd_vol is static now. it is calculated in S_PaintChannels and
  only used in SND_PaintChannelFrom16. all its other uses are removed from
  Snd_WriteLinearBlastStereo16, S_TransferStereo16, S_TransferPaintBuffer.
  The way it was, the sound volume was applied to the whole final contents
  of the paint buffer, but with this new quake2+ way we can add raw samples
  to the paint buffer with its own volume, such as bgmvolume. However, this
  makes the snd_scaletable to be recalculated everytime the sfxvolume is,
  changed, therefore it is adjusted that way to incorporate sfxvolume.
* snd_mix.c: In S_PaintChannels, check against s_rawend and copy from the
  streaming sound source if necessary.
* snd_dma.c: Added old_volume to detect sfxvolume changes. Made S_Update to
  compare it to sfxvolume.value and call SND_InitScaletable() if it changed.
* snd_dma.c: Add new globals s_rawsamples and s_rawend. Reset s_rawend to 0
  in S_ClearBuffer. Add new function S_RawSamples, adapted from quake2 with
  its 8 bit stereo playback fixed.
* snd_dma.c (S_FileExtension): Add new function which returns the given
  sound file's extension including the dot, or NULL.
* q_sound.h: Add new macro MAX_RAW_SAMPLES, defined as 8192. Add externs
  for new globals s_rawsamples and s_rawend. Add prototype for the new
  S_RawSamples and S_FileExtension functions.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@355 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 17:11:28 +00:00
sezero
1a98434926 added windows version detection back from original sources
with extra bits from uhexen2. we may use the information some
day.. (or not..)


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@354 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 17:00:19 +00:00
sezero
3338df6a52 backports from uHexen2 tree:
* common.c, common.h: Added new structure fshandle_t. Added new procedures
  FS_fread, FS_fseek, FS_ftell, FS_rewind, FS_feof, FS_ferror and FS_fclose.
  The new FS_*() stdio replacements are necessary if one is to perform non-
  sequential reads on files reopened on pak files because bookkeeping about
  file start/end positions is needed. Allocating and filling in the fshandle_t
  structure is the users' responsibility when the file is initially opened.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@353 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 16:50:15 +00:00
sezero
c01c80e271 added file_from_pak as a new flobal, made COM_FindFile() to set it properly.
from quakeworld sources.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@352 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 16:35:16 +00:00
sezero
9622872f74 Minor cd_sdl.c cleanups from uhexen2. Reorganized cdaudio volume
handling. If volume is 0, don't bother advancing and pause.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@351 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 14:55:25 +00:00
sezero
8cdb3fb5a6 snd_mem.c updates from uhexen2 :
* q_sound.h: add WAV_FORMAT_PCM as a new macro, defined as 1.
* snd_mem.c (S_LoadSound): use WAV_FORMAT_PCM. reject wav files which are
  neither 8 nor 16 bit. reject wav files which have zero samples. report
  the wav file name with the error messages so that they mean something.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@350 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 14:39:12 +00:00
sezero
9d80c23b5d renamed sound.h to q_sound.h
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@349 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 14:30:52 +00:00