Commit graph

562 commits

Author SHA1 Message Date
Ozkan Sezer
c96c275334 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@573 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 15:10:18 +00:00
Ozkan Sezer
0fd7786162 fixed typo
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@572 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 12:50:25 +00:00
Ozkan Sezer
41e497a88f documentation update
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@571 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 12:30:32 +00:00
Ozkan Sezer
b09ee296a7 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@570 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 12:28:21 +00:00
Ozkan Sezer
5938fe8c3e 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@569 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 09:37:28 +00:00
Ozkan Sezer
338da9a4c8 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@568 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 23:40:27 +00:00
Ozkan Sezer
e2a17c9bcf * 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@567 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:40:15 +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
5f0d6b07d1 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@565 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 17:37:30 +00:00
Ozkan Sezer
456e77d036 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@564 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:40:14 +00:00
Ozkan Sezer
d0093d0b80 common.c (q_vsnprintf): Don't attempt to nul terminate the buffer
if zero size was passed. From Sander van Dijk.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@563 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:32:17 +00:00
Kristian Duske
533ae210a4 Updated version numbers to 0.85.6, updated sparkle files for 0.85.5, added some source files to Xcode project.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@562 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 17:18:28 +00:00
Ozkan Sezer
ef0062741c added COM_ExtractExtension() helper.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@561 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 14:00:33 +00:00
Ozkan Sezer
fb2f45126e changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

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

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

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@555 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:27:52 +00:00
Ozkan Sezer
07b572b642 better buffer size safety with COM_StripExtension, COM_FileBase and COM_DefaultExtension
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@554 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:04:02 +00:00
Kristian Duske
ba2326a070 Changed version strings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@553 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 22:42:21 +00:00
Kristian Duske
cf197953a7 Cleaned up some build settings and fixed a minor glitch in OS X launcher UI.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@552 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 22:27:18 +00:00
Kristian Duske
18cec13bd1 Added building instructions for Mac OS X.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@551 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 18:36:10 +00:00
Kristian Duske
86c56dc882 Updated schemes for cross compilation from XCode 4.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@550 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 18:08:21 +00:00
Ozkan Sezer
ac0c5871ec bumped version to 0.85.6 in the development tree. documentation tidy-up.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@549 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-25 09:28:30 +00:00
Ozkan Sezer
321043d1f2 reverted parts of rev. 544 where an unintended Xcode update was performed
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@547 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:11:08 +00:00
Ozkan Sezer
2629bbb0af deleted unnecessary Xcode user files.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@546 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:05:16 +00:00
Ozkan Sezer
42e55b3377 changed cvar callback functions to accept a cvar_t pointer arg. I may
have a use for that later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@545 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:04:01 +00:00
Steven
9af55c7482 Add cfgfile.[hc] to xcode.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@544 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:42:19 +00:00
Ozkan Sezer
2205c3de20 minor correction after last cfgfile patch.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@543 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:35:01 +00:00
Ozkan Sezer
f45abcc954 changed cfgfile to use FS_functions. From Sander van Dijk.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@542 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:10:15 +00:00
Ozkan Sezer
573f49d920 added FS_fgets(). From Sander van Dijk.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@541 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:03:29 +00:00
Ozkan Sezer
9a2c2170fa tidy up nul termination for strncpy in CFG_ReadCvarOverrides (from Sander.)
update copyright years.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@540 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:02:25 +00:00
Ozkan Sezer
e4997ce660 updated CodeBlocks project files for newly added files.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@539 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:01:07 +00:00
Ozkan Sezer
226407ead3 documentation: removed the remark of `unreleased' from 0.85.5. changed
the download links for 0.85.5.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@538 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 09:41:41 +00:00
Ozkan Sezer
cdf1f6eef0 updated visual studio project file for newly added files
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@537 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 09:10:49 +00:00
Ozkan Sezer
ec9b77878b 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@536 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-23 12:03:49 +00:00
Ozkan Sezer
0953ac6751 removed support for the -mode argument from gl_vidsdl.c
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@535 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 23:10:25 +00:00
Ozkan Sezer
1befaa5a49 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@534 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:55:48 +00:00
Ozkan Sezer
88c0c09e88 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@533 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:20:19 +00:00
Ozkan Sezer
bb5a1d6e38 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@532 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-21 10:40:18 +00:00
Ozkan Sezer
6c4ad9c240 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@531 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-20 09:22:19 +00:00
Ozkan Sezer
968b469872 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@530 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 16:27:14 +00:00
Ozkan Sezer
fcb75d2597 * 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@529 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:03:53 +00:00
Ozkan Sezer
e6cf670066 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@528 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:00:36 +00:00
Ozkan Sezer
5b9d317733 sv_main.c: changed a (cls.state != ca_dedicated) condition into (!isDedicated)
so that a server file doesn't use "cls"

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

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@525 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:50:49 +00:00
Ozkan Sezer
9d809a3687 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@524 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-16 14:11:37 +00:00
Ozkan Sezer
a02adcf4c1 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@523 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 21:41:48 +00:00