Commit Graph

555 Commits

Author SHA1 Message Date
sezero 349c4a81c9 some common.c cleanup: Made COM_InitFilesystem() public through common.h,
moved its calling from COM_Init() to Host_Init() just after COM_Init().
Moved registration of registered and cmdline cvars and COM_Path_f command
and the calling of COM_CheckRegistered() to COM_InitFilesystem(). Removed
unused memsearch(). Fixed the stupidity in leading space elimination from
com_cmdline.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@573 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 15:10:18 +00:00
sezero 93fd580b18 more cvar cleanups: Added Cvar_LockVar, Cvar_UnlockVar, Cvar_UnlockAll and
Cvar_FindVarAfter. Don't expose cvar_vars directly and use Cvar_FindVarAfter
instead.  several typo fixes, etc.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@570 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 12:28:21 +00:00
sezero 62cd7643a3 some more cvar work: made Cvar_RegisterVariable() to only link the variable in
and set some basic flags, but then let functions to set it. Added Cvar_SetQuick
and Cvar_SetValueQuick which accept a cvar pointer instead of a var name, but
identical to the non-Quick versions otherwise. Made Cvar_SetValue to print the
value as an integer if the float value is the same when cast to an int; if not,
made it to strip the trailing zeroes in the string.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@569 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 09:37:28 +00:00
sezero 175a348297 dropped CVAR_SERVERINFO flag from the cmdline cvar: sending cmdline upon
CCREQ_RULE_INFO is evil...
while I was there, did some whitespace clean-up in common.c.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@568 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 23:40:27 +00:00
sezero 3d4901410c * gl_screen.c: removed oldscreensize, oldfov, oldsbarscale, oldsbaralpha.
use the callbacks for scr_fov, scr_viewsize, scr_conwidth & scr_conscale
changes by simply setting vid.recalc_refdef to 1: now that Cvar_Set()
doesn't do anything when there is no change, this has the same effect.
* snd_dma.c: removed oldvol, set a callback to sfxvol in order to call
SND_InitScaletable() upon every volume change.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@567 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:40:15 +00:00
sezero 6612180a74 * 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
sezero 7a58f5033c finally nailed the SubdividePolygon() segfault when running as a dedicated
server: R_Init() isn't called for dedicated server therefore gl_subdivide_size
was used without being registered hence divisions by zero when using its value
member. Geez.. Moved its registration to Mod_Init() and we are good.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@565 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 17:37:30 +00:00
sezero 96d60a3f51 cfgfile.c (CFG_ReadCvars): Also check for ferror(). Use FS_rewind()
instead of FS_fseek(). From Sander van Dijk.
cfgfile.c, cfgfile.h: synced with uhexen2 versions.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@564 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:40:14 +00:00
sezero a22c56b5ae common.c (q_vsnprintf): Don't attempt to nul terminate the buffer
if zero size was passed. From Sander van Dijk.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@563 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:32:17 +00:00
sezero f7394ffc06 added COM_ExtractExtension() helper.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@561 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 14:00:33 +00:00
sezero ba15eced3c changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@560 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 13:15:31 +00:00
sezero 1a4b16f741 added strlcat.c and strlcpy.c to build.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@559 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 11:11:24 +00:00
sezero 04eb8ef74d added strlcat.c and strlcpy.c: will use them later.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@558 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 11:03:39 +00:00
sezero f797c71f8b changed many sprintf() calls into q_snprintf().
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@557 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 10:50:42 +00:00
sezero 02c18a64e3 Makefiles update: Passing the libraries to the linker before passing the
object list is a bad idea.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@556 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 10:10:51 +00:00
sezero 3760bbf494 reverted revision 536 which made coop and deathmatch not to be set at
the same time

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@555 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:27:52 +00:00
sezero 6a940110c0 better buffer size safety with COM_StripExtension, COM_FileBase and COM_DefaultExtension
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@554 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:04:02 +00:00
sezero 8fe6e6efb4 bumped version to 0.85.6 in the development tree. documentation tidy-up.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@549 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-25 09:28:30 +00:00
sezero 8f7ced1cf2 changed cvar callback functions to accept a cvar_t pointer arg. I may
have a use for that later.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@545 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:04:01 +00:00
sezero 49e4762ac2 minor correction after last cfgfile patch.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@543 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:35:01 +00:00
sezero 282fac9686 changed cfgfile to use FS_functions. From Sander van Dijk.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@542 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:10:15 +00:00
sezero 7becf71d2f added FS_fgets(). From Sander van Dijk.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@541 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:03:29 +00:00
sezero 60a764f30e tidy up nul termination for strncpy in CFG_ReadCvarOverrides (from Sander.)
update copyright years.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@540 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:02:25 +00:00
sezero fea02186c7 Made sure that deathmatch and coop are not set at the same time
(fix originally from QIP sources of Matthias Buecher, a.k.a. Maddes)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@536 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-23 12:03:49 +00:00
sezero 8dbddbd097 removed support for the -mode argument from gl_vidsdl.c
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@535 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 23:10:25 +00:00
sezero fea1ba3030 gl_vidsdl.c fixes/changes from Sander van Dijk: if (hypothetically) no
fullscreen modes are reported at all fixes bad behaviour of several
options in the video menu, and allows the user to use "-force" to force
a fullscreen mode even if none was reported; this was previously only
possible if there was at least one fullscreen mode reported), makes the
treatment of "-current" more similar to "-width/-height/-bpp" (only
forcing it if the user provides "-force"), gets rid of leavecurrentmode
hack (which didn't do much useful, besides making the code less clear).

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@534 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:55:48 +00:00
sezero 3790bb0ea2 main_sdl.c: added SDL version check at runtime requiring at least SDL-1.2.10
and rejecting SDL >= 1.3.x.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@533 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:20:19 +00:00
sezero 37221269d6 sys_sdl_unix.c, sys_sdl_win.c (Sys_Sleep): rely on SDL_Delay() instead
of platform specific usleep() or Sleep() calls.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@532 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-21 10:40:18 +00:00
sezero 6a36725e1f backport from uhexen2: read video variables early so that a vid_restart
isn't necessary after init. thanks to Sander van Dijk.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@531 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-20 09:22:19 +00:00
sezero 65d248f750 gl_vidsdl.c: comment out the rest of vid_refreshrate usage which isn't supported.
(VID_SetMode): check whether SDL_SetVideoMode() actually succeeded. otherwise we
just segfault. noticed by Sander.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@530 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 16:27:14 +00:00
sezero 5926d9a2e3 * client.h: moved usercmd_t structure to protocol.h
* quakedef.h: moved chase declarations to client.h.
  moved the entity_state_t structure to protocol.h.
  tweaked the order of quake header includes.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@529 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:03:53 +00:00
sezero 25fedde47a net_win.c, net_sdl.c, net_bsd.c, net_defs.h: removed fixed size from net_drivers
and net_landrivers. changed net_numdrivers and net_numlandrivers into const int
and assigned their values using array size macros instead of hardcoded numbers.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@528 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:00:36 +00:00
sezero 13e482e911 sv_main.c: changed a (cls.state != ca_dedicated) condition into (!isDedicated)
so that a server file doesn't use "cls"

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@527 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:55:18 +00:00
sezero 416d68a861 net_loop.h: Tiny whitespace tidy up.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@526 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:51:28 +00:00
sezero d076443923 net_dgrm.c: removed the DEBUG build condition around the "Forged packet received"
message prints. Tiny whitespace tidy up.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@525 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:50:49 +00:00
sezero 7a7fe8f4c9 SDL input driver: updated from the uHexen2 project adding native keymap
and dead key support to the console, thanks to Sander van Dijk.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@524 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-16 14:11:37 +00:00
sezero 94117294f7 keys.c (History_Init): filter out '\r' and skip over to the first non-EOL
character. This allows using a windows-generated history.txt file on unix.
based on a patch from Sander van Dijk.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@523 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 21:41:48 +00:00
sezero c28e767afb keys.c (Key_Event): Allow autorepeats in message (chat) mode; based on a
patch from Sander van Dijk.  Rearrange the autorepeat condition checks a
bit, based on uhexen2.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@522 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 16:33:52 +00:00
sezero d3e28b441e menu.c (M_ToggleMenu_f): Set key_dest to key_game only if the client
is connected. Set it to key_console, otherwise. Patch from and thanks
to Sander van Dijk.
(M_Main_Key): Likewise.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@521 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 16:21:36 +00:00
sezero f5c53deb06 sys_sdl_unix.c, sys_sdl_win.c (Sys_ConsoleInput): Moved isDedicated check to...
host.c (Host_GetConsoleCommands): ... here, where it should be.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@520 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 15:51:28 +00:00
sezero 702afcf27e gl_texmgr.c (TexMgr_LoadPalette): properly point to d_8to24table_fbright
(noticed this in recent RMQ sources.)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@519 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 06:37:12 +00:00
sezero 5c7fdf0366 host_cmd.c (Host_Loadgame_f): Close the file before signalling an error
(noticed this in recent RMQ sources.)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@518 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 06:31:51 +00:00
sezero 88c8265faf gl_model.c (Mod_SetExtraFlags): Fixed r_nolerp_list.string parsing code
of fitzquake: the loop was able to go beyond the null terminator of the
cvar.  (Besides, it would technically yield a false positive because of
strncmp(), but much less likely..)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@517 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-14 14:21:12 +00:00
sezero ba74395b56 CL_ParseUpdate: removed unused bitcounts[] array
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@516 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-13 19:00:25 +00:00
sezero 55512f9385 Cmd_Alias_f: don't append a space at the very end.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@515 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-13 18:40:23 +00:00
sezero e6f6e24cab Cmd_TokenizeString: simplify duplication by using Z_Strdup()
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@514 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-13 18:35:40 +00:00
sezero 338019e9e4 renamed Sys_FloatTime to Sys_DoubleTime (the thing always returned double
you know..) and adjusted all callers accordingly.  changed Sys_Sleep() to
take a milliseconds argument, added implementations for unix (usleep) and
windows (Sleep).

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@512 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 16:01:01 +00:00
sezero f4a3b2c9a2 Made the cmd argument of CL_SendMove() const.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@511 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 14:11:17 +00:00
sezero 08546599cf constified the name arguments of Image_LoadImage() and Image_WriteTGA()
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@510 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 12:56:57 +00:00
sezero 79e1fa29ee made Sys_ConsoleInput() to return const
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@508 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 12:02:37 +00:00
sezero 7ff46cf8d8 made unix Sys_mkdir() to print strerror in case of failure.
made windows Sys_mkdir() to use windows api functions.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@507 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 10:50:26 +00:00
sezero 2503c74cb6 removed privileged member from the client structure
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@506 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 09:50:23 +00:00
sezero d17e6bfa52 pr_exec.c (PR_ExecuteProgram): Implemented some of LordHavoc's
optimizations mostly by removing the temporary eval_t *a,*b and *c
variables and replacing them by OPA, OPB and OPC macros. Removed
the statement index s and used the statement pointer instead,
updating the pr_xstatement global whenever necessary. In OP_STATE,
stored OPA->_float to ed->v.frame without comparing them (I don't
understand the significance to the comparison.)  Casted st->a, b
and c to unsigned short instead of using them signed as they are
as the pr_globals index value. Updated profiling code.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@505 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 09:03:34 +00:00
sezero d7c0fb946a pr_comp.h, pr_edict.c, progs.h, pr_cmds.c, pr_exec.c: made some of the
variables and functions private and did some whitespace tidy-ups.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@504 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 08:56:25 +00:00
stevenaaus 18ad2c4554 Make 'R_DrawSprite' error messages Con_DPrintf.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@503 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-11-19 23:33:54 +00:00
sezero 1c872edebd net_udp.c: Fixed FIONREAD ioctl to take an int* argument instead of
an unsigned long*.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@502 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-11-12 18:03:49 +00:00
sezero af17307829 cd_sdl.c: Reverted the CDAudio_Update() change from 27 Oct: it does
not make things better.  Removed the SDL_CDStatus() check before the
error message in case of SDL_CDPlay() failures: I don't really know
the significance to it and witnessed that it caused the error report
once, so I don't see any merit in its presence.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@500 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-30 16:56:03 +00:00
sezero 6ca9562340 cd_sdl.c: Simplified, making it similar to cd_linux.c or cd_bsd.c by
performing checks every two seconds in CDAudio_Update() and caching
the last check time.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@498 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-27 09:40:46 +00:00
sezero a38d81e23b in Sbar_DrawFace(), don't let the index derived off cl.stats[STAT_HEALTH]
to become negative. (noticed this in rmq some time ago...)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@495 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-19 20:10:49 +00:00
sezero a74fefa51e cl_demo.c: Several tidy-ups and message corrections
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@493 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-09 08:51:29 +00:00
stevenaaus 84028ae47a Typo: scr_crosshaircale -> scr_crosshairscale (from Sander).
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@490 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-21 02:51:56 +00:00
stevenaaus 2a5421cd03 Update sndspeed cvar when it is changed from the command line (from Sander). Note in-game changes of the sound cvars don't change sound playback settings or behaviour.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@489 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-20 22:45:52 +00:00
sezero 7eb20be3fe added IS_LOOP_DRIVER macro and made the confusing loop driver checks
more readable. from uhexen2.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@488 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-20 18:05:51 +00:00
stevenaaus eaafb0906f Make the default fullscreen mode 800x600 (same as window default), from Sander.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@487 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-20 06:41:36 +00:00
sezero 2d275feeeb gl_model.c: Added new external_ents cvar for Mod_LoadEntities()
in parallel to the old QIP code.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@484 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-15 07:51:11 +00:00
sezero c2b863bbce updated makefiles.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@483 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-27 07:11:36 +00:00
sezero 75a0ef543c updated snd_vorbis.c from the uhexen2 project: support for Tremor (libvorbisidec)
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@482 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-27 07:11:02 +00:00
sezero a3a9b37d53 mlook and lookspring fixes by Jacques Krige :
http://www.quake-1.com/docs/quakesrc.org/1.html

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@481 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-25 21:37:34 +00:00
stevenaaus 5a6a9c30d1 z-fighting (flickering gl texture clash most notable in e1m1) bug fix, from Sander.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@480 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-24 07:47:29 +00:00
sezero 2713633423 snd_mp3.c (S_MP3_CodecOpenStream): Don't Z_Free() stream's private
data when not allocating on the zone.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@479 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-21 09:10:52 +00:00
sezero 64ef4147b5 console.c (LOG_Init): Removed the O_APPEND flag when opening the log file.
It was a legacy from Quake who used to open and close the log file on every
write. Commented out the unlink() call and added O_TRUNC to the open flags.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@476 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-03 19:30:37 +00:00
sezero e22611b1e7 removed the LoadBufFile method
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@475 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-03 19:22:29 +00:00
sezero c5b2bf7087 fixed vorbisfile link order for static linkage if one chooses to do so.
deleted unused vorbisenc.h header.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@472 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-21 09:03:35 +00:00
sezero 7920f6af3e snd_mp3.c: leave Z_ alone and allocate libmad decoding buffers (ca. 64kb)
on the system memory.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@471 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-20 09:00:12 +00:00
sezero df4a1685a0 zone.c (Z_Realloc): If expanding size, zero-fill the expanded part
of the memory before returning, which is Z_Malloc() behavior.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@470 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-17 14:00:48 +00:00
sezero 3fcb8030ae progs.h (PR_RunError): Mark the function as noreturn.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@468 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-08 17:27:44 +00:00
sezero 6181c3307a host.c (Host_ClearMemory): Do not check if host_hunklevel is
set before freeing the hunk allocations.  The order in Host_Init()
is clear and Host_ClearMemory must not be hit before host_hunklevel
is set. (otherwise, there _will_ be much trouble...)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@467 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-05 06:50:23 +00:00
sezero b7a03b22f3 host.c (Host_Init): Execute quake.rc _after_ setting host_hunklevel
and host_initialized.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@466 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-05 06:45:31 +00:00
sezero 55cc159297 * Removed some useless memset calls onto newly hunk allocated memory.
Hunk_Alloc() already clears the memory before returning it.
* Some minor cleanups.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@465 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-05 06:28:42 +00:00
sezero b6913f5348 Increased localmodels array size to 8 (better alignment)
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@464 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-28 11:33:23 +00:00
sezero 7e771ad5bb moved Host_Version_f from host_cmd.c to host.c.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@463 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-27 13:20:52 +00:00
sezero 4ac590b037 net_udp.c: check whether the address returned by gethostbyname is an IPv4 address
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@462 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-27 13:10:19 +00:00
sezero fedac5982f minor syncing with uhexen2
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@461 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-13 12:41:00 +00:00
sezero 9800cf9d15 a little syncing with uhexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@460 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-12 12:25:22 +00:00
sezero 2806d26412 updated q_stdinc.h from uhexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@459 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-11 13:20:13 +00:00
sezero 74dc497e5a gl_model.c (Mod_LoadEntities): Added support for loading external entity files.
Adding a cvar to control this option should follow later.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@458 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-11 05:03:04 +00:00
stevenaaus f4853de691 Trial a new Freeze cvar.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@457 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-10 03:04:51 +00:00
sezero 82960be532 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@455 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-05-20 22:20:30 +00:00
sezero 5d43920b02 replaced COM_FileExtension by a slightly better version from uhexen2,
renamed it to COM_FileGetExtension, added a prototype to common.h.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@454 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-05-20 20:38:11 +00:00
sezero e81b03246e small documentation corrections. fixed the borked README.txt file.
changed version to 0.85.5 in the README files. changed version to
0.85.5 in quakedef.h.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@449 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-24 04:27:54 +00:00
stevenaaus b88b2ac7ce Update Makefile.darwin (OSX) and doco.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@448 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-24 03:01:40 +00:00
sezero 88d6f8f1ef check for arguments to several command line options. patch from Sander van Dijk.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@446 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 18:29:41 +00:00
sezero 51134643dd keys.c (History_Init, History_Shutdown): use host_parms->userdir.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@444 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 17:02:41 +00:00
sezero f6b6f49a7e made global host_parms a pointer, set in main(). adjusted places where
host_parms is used. made COM_Init() and Host_Init() to take no arguments.
made Sys_Init() to set host_parms->userdir: at present, it is set to
host_parms->basedir, to be changed properly when user directories are
implemented.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@443 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 16:41:45 +00:00
sezero ccf800306b fixed several gcc-4.6 -Wunused-but-set-variable warnings.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@442 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-12 12:36:04 +00:00
sezero 46f0616a0b cl_parse.c (CL_KeepaliveMessage): fixed big boom in net play in maps with
extended limits. it was a fitzquake-0.85 bug noticed by `mh' as explained
at http://forums.inside3d.com/viewtopic.php?p=35030

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@440 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-08 06:01:39 +00:00
sezero 7851cda724 just properly use (u)intptr_t where necessary and don't do the cheap hack
of using size_t instead of it.  include stdint.h in q_stdinc.h for it.
for Visual Studio earlier than version 2010, use the header provided by
the msinttypes project.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@439 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-01 14:55:45 +00:00
sezero 2f8cc178a9 added native sound code snd_alsa.c, snd_oss.c, snd_win.c and for future
reference and/or probable use.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@434 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-03-28 11:37:44 +00:00
sezero 17df4c702d minor documentation updates, final touches for 0.85.4.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@430 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-03-27 14:00:31 +00:00
stevenaaus e9d05ae12a Trivial doco updates
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@429 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-03-05 10:20:00 +00:00
sezero 49f0fc353a * gl_model.c: relaxed searchpath requirements for external lit file
loading: they are now allowed from the same game directory as the
  map itself as well as from a searchpath with a higher priority.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@428 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-03-01 18:00:30 +00:00
sezero a8c685d391 cvar'ize the game loop throttling by adding the new sys_throttle with
a default value of 0.02.  changing its value to 0 disables throttling.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@427 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-27 07:05:18 +00:00
sezero 50d5076443 snd_mix.c, minor cleanup: eliminated stupid multiple casting in SND_PaintChannelFrom8(),
added braces to the inner for loop in SND_InitScaletable().

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@424 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-21 18:03:35 +00:00
sezero 2130f17bc9 * snd_mpg123.c: Print a message if mpg123_init() fails.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@420 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-17 07:02:47 +00:00
sezero 3f8f259567 * gl_model.c: changed the `ignored' messages from Con_DPrintf
to Con_Printf for external lit files.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@418 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-17 06:38:52 +00:00
sezero ea14bd5b1a bgmusic.c, bgmusic.h: small updates and tidy-ups from uHexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@417 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-16 15:20:20 +00:00
sezero 7972de8af4 bgmusic.c: renamed -nomusic command line switch to -noextmusic. minor update.
updated documentation for the command line option name change.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@416 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-15 21:30:32 +00:00
sezero 81a318c09b * snd_mpg123.c: added new codec for mp3 playback using libmpg123 as
an alternative to the existing one using libmad. requires at least
  mpg123-1.12.0, i.e. api version 25.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@414 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-14 20:02:52 +00:00
sezero 1be80dc881 snd_codec.c (S_CodecUtilOpen): fix again after rev.410.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@411 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 18:23:50 +00:00
sezero ed1958d1ff snd_codec.c (S_CodecUtilOpen): minor cleanup (better type for length.)
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@410 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 18:20:33 +00:00
sezero de3f97016a * 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@408 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 17:25:43 +00:00
sezero cd97cf2507 support for mouse buttons 4 and 5:
* keys.h: add KMOUSE4 and K_MOUSE5 defines after K_MWHEELDOWN
* keys.c: add KMOUSE4 and K_MOUSE5 to the keynames table.
* main_sdl.c: handle SDL_BUTTON_X1 and SDL_BUTTON_X2 for mouse
button events.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@407 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-10 16:10:53 +00:00
sezero c851a07cc6 * common.c (FS_fread): fixed coding style.
* bgmusic.c:  minor updates from uhexen2.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@406 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-08 11:00:29 +00:00
sezero 687eb577cd * snd_mp3.c: removed useless rudimentary info checks.
* updated copyright years for several sound related sources.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@405 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-30 21:34:12 +00:00
sezero d8ffad069b * snd_mp3.c: sync with sox project CVS repo and add mp3_madseek()
as a new private function. make S_MP3_CodecRewindStream() to use
  the new mp3_madseek() function.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@404 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-30 18:23:20 +00:00
sezero 30d44eac5b gl_vidsdl.c (VID_Menu_ChooseNextRate): refresh rates not implemented for SDL.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@403 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-29 07:21:04 +00:00
sezero fde82ec3ac fixed a typo in a comment, noticed by Sander van Dijk.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@402 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-22 20:11:46 +00:00
sezero 26735b7ba9 * snd_mix.c (SND_PaintChannelFrom16): multiplication might cause
integer overflow as observed in the warpspasm mod depending on
  the volume level. so, moved the left shifting to left/right
  volume before the multiplication.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@401 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-18 06:50:35 +00:00
sezero 593463dafd added linux, bsd and windows native cdaudio code from uhexen2.
will integrate to build later.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@400 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-15 09:50:17 +00:00
sezero 2493d3e1f8 * 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@398 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 20:10:34 +00:00
sezero 8be7c0ebad net_sys.h: the new MS SDKs define EWOULDBLOCK and ECONNREFUSED,
so we must undefine them before redefining.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@397 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 12:39:24 +00:00
sezero 0221c58370 removed the cdplayer facility added in 0.85.3
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@394 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 10:02:16 +00:00
sezero 65f2ac04aa 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@392 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 09:32:22 +00:00
stevenaaus 3723fc3935 Make Makefile.darwin consistent with Makefile
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@390 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-11 08:19:22 +00:00
sezero f38b3e66ad 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@388 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:33:12 +00:00
sezero 277fc57891 bgm*: updated copyright years.
bgmnull.c: removed unused file.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@387 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 20:17:15 +00:00
sezero 5acd0431ee 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
sezero 137c598a4d add the new bgm_extmusic cvar to bgmnull.c, too.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@385 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 08:37:18 +00:00
sezero b4843e0e65 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@384 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 08:33:22 +00:00
stevenaaus ef6a6119d9 Doco update
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@383 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 03:09:09 +00:00
stevenaaus c26975fb82 Author name change
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@382 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-06 20:19:37 +00:00
sezero c61463f1ff applied a modified version of heritage & quit message by Sander van Dijk
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@381 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-06 20:05:49 +00:00
sezero 0815188f3b updated the darwin makefile after music streaming changes. it probably needs
further updating, though...

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@380 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 23:05:17 +00:00
sezero e70afa3c4d menu.c: allow proper music volume adjustment for windows.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@378 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:30:37 +00:00
sezero c307083fd1 snd_mp3.c: fixed windows build.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@377 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:29:00 +00:00
sezero b08f283ff5 updated windows makefiles and visual studio project files after streaming
music changes.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@376 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:27:37 +00:00
sezero 2950b5cdf9 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
sezero c243f20067 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@373 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 18:01:15 +00:00
sezero 8af0805ee2 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@372 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 22:02:11 +00:00
sezero e6d0cc36cd 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@371 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:55:26 +00:00
sezero 8dde04f7b5 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:45:16 +00:00
sezero 0323d3d388 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@369 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:42:54 +00:00
sezero 373bf70243 Made CDAudio_Play() to return success (0) or failure (-1) instead of void.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@368 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 18:33:21 +00:00
sezero 96a6a4e28a fixed rest of the strict-aliasing and uninitialized use warnings.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@367 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 14:05:20 +00:00
sezero 0a915708f5 whitespace/formatting tidy-up in quakedef.h.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@366 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:32:16 +00:00
sezero b09efe63af removed the useless msg_suppress_1 thing.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@365 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:27:02 +00:00
sezero c08580f9ca removed all remaining references to id386 and UNALIGNED_OK because
the fitz engine doesn't use them at all.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@364 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:24:28 +00:00
sezero 883fcf0184 changed MAX_OSPATH from 128 to 256 for better compatibility everywhere.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@363 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 12:20:15 +00:00
sezero 49708d88bd W_LoadWadFile: Just use COM_LoadMallocFile(). Some minor cleanup.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@362 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 10:47:29 +00:00
sezero 82c069c4d3 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@361 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 10:29:38 +00:00