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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
Made COM_FindFile() static to common.c. Removed COM_CopyFile(), no
callers at the moment.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@369 af15c1b1-3010-417e-b628-4374ebc0bcbd
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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@361 af15c1b1-3010-417e-b628-4374ebc0bcbd
Fixes "whiteroom" (http://www.quaddicted.com/reviews/whiteroom.html) completely
locking the engine. fix from the quakeforge sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@359 af15c1b1-3010-417e-b628-4374ebc0bcbd
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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@356 af15c1b1-3010-417e-b628-4374ebc0bcbd
* 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@355 af15c1b1-3010-417e-b628-4374ebc0bcbd
with extra bits from uhexen2. we may use the information some
day.. (or not..)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@354 af15c1b1-3010-417e-b628-4374ebc0bcbd
* 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@353 af15c1b1-3010-417e-b628-4374ebc0bcbd
handling. If volume is 0, don't bother advancing and pause.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@351 af15c1b1-3010-417e-b628-4374ebc0bcbd
* 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@350 af15c1b1-3010-417e-b628-4374ebc0bcbd
removed the old unused CheckArrayExtensions.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@348 af15c1b1-3010-417e-b628-4374ebc0bcbd
Remove unused global cache_full_cycle. Comment out unused function
DumpChunks().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@341 af15c1b1-3010-417e-b628-4374ebc0bcbd
Removed Sparkle Framework to sort out SVN problems, will re-add with next commit.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@331 af15c1b1-3010-417e-b628-4374ebc0bcbd