Commit graph

759 commits

Author SHA1 Message Date
sezero
60648cbd31 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@569 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 09:37:28 +00:00
sezero
70e852bdb5 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@568 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 23:40:27 +00:00
sezero
6a3e4e8439 * 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@567 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:40:15 +00:00
sezero
4e485d16fa * 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
sezero
abb1e1a2cb 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@565 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 17:37:30 +00:00
sezero
9a89e593f0 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@564 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:40:14 +00:00
sezero
fadfa30b3f 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@563 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 19:32:17 +00:00
kristianduske
5fe1cd97dc 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@562 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 17:18:28 +00:00
sezero
8ea0fd037b added COM_ExtractExtension() helper.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@561 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 14:00:33 +00:00
sezero
f4824185c9 changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

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

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

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@555 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:27:52 +00:00
sezero
8494877f84 better buffer size safety with COM_StripExtension, COM_FileBase and COM_DefaultExtension
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@554 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:04:02 +00:00
kristianduske
77235ac94c Changed version strings.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@553 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 22:42:21 +00:00
kristianduske
42ab95d35e Cleaned up some build settings and fixed a minor glitch in OS X launcher UI.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@552 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 22:27:18 +00:00
kristianduske
78b676d9be Added building instructions for Mac OS X.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@551 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 18:36:10 +00:00
kristianduske
27c8e4d5e0 Updated schemes for cross compilation from XCode 4.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@550 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-26 18:08:21 +00:00
sezero
5f97e37e45 bumped version to 0.85.6 in the development tree. documentation tidy-up.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@549 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-25 09:28:30 +00:00
sezero
432d77fe70 reverted parts of rev. 544 where an unintended Xcode update was performed
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@547 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:11:08 +00:00
sezero
637bfbdc4c deleted unnecessary Xcode user files.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@546 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:05:16 +00:00
sezero
bbc1197ed0 changed cvar callback functions to accept a cvar_t pointer arg. I may
have a use for that later.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@545 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:04:01 +00:00
stevenaaus
8ea6f7b566 Add cfgfile.[hc] to xcode.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@544 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:42:19 +00:00
sezero
69a9a01293 minor correction after last cfgfile patch.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@543 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:35:01 +00:00
sezero
7d8b89ec84 changed cfgfile to use FS_functions. From Sander van Dijk.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@542 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:10:15 +00:00
sezero
0a38cc3dc3 added FS_fgets(). From Sander van Dijk.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@541 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 12:03:29 +00:00
sezero
977a6e700f tidy up nul termination for strncpy in CFG_ReadCvarOverrides (from Sander.)
update copyright years.

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

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@538 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 09:41:41 +00:00
sezero
395d18e9ba updated visual studio project file for newly added files
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@537 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 09:10:49 +00:00
sezero
9a0d6c7328 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@536 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-23 12:03:49 +00:00
sezero
359e770d65 removed support for the -mode argument from gl_vidsdl.c
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@535 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 23:10:25 +00:00
sezero
1089ae52a2 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@534 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:55:48 +00:00
sezero
b7ee9177d0 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@533 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:20:19 +00:00
sezero
201c4c6dc0 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@532 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-21 10:40:18 +00:00
sezero
1303651a7b 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@531 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-20 09:22:19 +00:00
sezero
9039243d5f 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@530 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 16:27:14 +00:00
sezero
2e09ec39c5 * 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@529 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:03:53 +00:00
sezero
e6c2601492 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@528 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 10:00:36 +00:00
sezero
bd7b39c6dd 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@527 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:55:18 +00:00
sezero
51ed74811e net_loop.h: Tiny whitespace tidy up.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@526 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:51:28 +00:00
sezero
10b8dd954a net_dgrm.c: removed the DEBUG build condition around the "Forged packet received"
message prints. Tiny whitespace tidy up.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@525 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:50:49 +00:00
sezero
893487a136 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@524 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-16 14:11:37 +00:00
sezero
a6a1fb15e7 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@523 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 21:41:48 +00:00
sezero
13fedad011 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@522 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 16:33:52 +00:00
sezero
28140a132a 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@521 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 16:21:36 +00:00
sezero
bd8cc29f4e 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@520 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 15:51:28 +00:00
sezero
68ed435145 gl_texmgr.c (TexMgr_LoadPalette): properly point to d_8to24table_fbright
(noticed this in recent RMQ sources.)

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@519 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-15 06:37:12 +00:00