Commit Graph

21 Commits

Author SHA1 Message Date
Ozkan Sezer 4dbd07fb9a bgmusic.c: mark *.opus files as cdrip types.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1579 af15c1b1-3010-417e-b628-4374ebc0bcbd
2018-04-27 17:30:38 +00:00
Ozkan Sezer 623f8c6698 bgmusic.c (BGM_UpdateStream): avoid a possible endless loop.
(just a paranoid safeguard, shouldn't happen in real life.)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1311 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-23 08:03:43 +00:00
Ozkan Sezer 6ddd983eb8 snd_flac.c, snd_mpg123.c: fix incorrect usage of decoder function
return value in RewindStream procedures.
bgmusic.c (BGM_UpdateStream): print msg if stream rewinding fails.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1169 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-19 08:37:13 +00:00
Ozkan Sezer 5e4849c61f replace all ctype.h functions/macros and strcasecmp/strncasecmp()
by locale-insensitive versions, new header q_ctype.h.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@868 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-09-25 17:01:40 +00:00
Ozkan Sezer ffa3bf4413 Merge several FS_* and snd_codec* layer updates from uhexen2 tree:
tidy-ups in FS* stdio replacement functions. add new FS_filelength.
snd codec layer updates: changed codec_open() to operate only on a
stream pointer and moved all file open/close stuff to snd_codec.c.
codec_open now only returns true or false upon success or failure
instead of a stream pointer. added new snd_codec.c toplevel helper
S_CodecForwardStream(), which allows one codec to hand over its
stream from its codec_open() to another codec. Support for tracker
(mod) music, including support for Unreal umx containers. (might
be useful if we ever make a Nehahra version of the engine some day.
edit the makefiles to enable when compiling.)


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@867 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-09-25 11:01:12 +00:00
Ozkan Sezer 21258e595c merged the opus codec support patch
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@856 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-07-18 07:03:11 +00:00
Ozkan Sezer 8bfd0fe0e8 some codec stuff syncing with uhexen2
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@823 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-27 16:50:25 +00:00
Ozkan Sezer eb09523d00 changed some of the Cvar_Set[Value] calls to their *Quick variants in the
source files where the vars are defined.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@576 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 21:21:11 +00:00
Ozkan Sezer 19953bd399 silenced -Wsign-compare warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 19:06:08 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer e5a5e89f53 minor syncing with uhexen2
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@461 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-13 12:41:00 +00:00
Ozkan Sezer 8a1b526e5d Sync music stuff with uHexen2: Removed S_FileExtension, replaced its use
by COM_FileGetExtension.  Adjusted all users because COM_FileGetExtension
doesn't include the leading dot for the extension, nor does it ever return
NULL.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@455 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-05-20 22:20:30 +00:00
Ozkan Sezer f6683583c2 bgmusic.c, bgmusic.h: small updates and tidy-ups from uHexen2.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@417 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-16 15:20:20 +00:00
Ozkan Sezer fe70ba99ab bgmusic.c: renamed -nomusic command line switch to -noextmusic. minor update.
updated documentation for the command line option name change.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@416 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-15 21:30:32 +00:00
Ozkan Sezer 3f006ac62f * common.c (COM_FileExists): changed return type to qboolean.
(COM_filelength): new procedure.
(COM_FindFile): adjustments to avoid multiple file open/close operations just a
little.
* common.h (COM_FileExists): adjusted prototype.
* bgmusic.c (BGM_PlayCDtrack): adjusted for COM_FileExists() return type change.
* sys_sdl_win.c, sys_sdl_unix.c (Sys_filelength): changed return type to long.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@408 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 17:25:43 +00:00
Ozkan Sezer f707439e86 * common.c (FS_fread): fixed coding style.
* bgmusic.c:  minor updates from uhexen2.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@406 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-08 11:00:29 +00:00
Ozkan Sezer 0bbb9a3619 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@388 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:33:12 +00:00
Ozkan Sezer 00545bbbed bgm*: updated copyright years.
bgmnull.c: removed unused file.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@387 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:17:15 +00:00
Ozkan Sezer c443de78cc 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@384 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 08:33:22 +00:00
Steven 64e52ea80c Doco update
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@383 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 03:09:09 +00:00
Ozkan Sezer cbb7eb0428 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00