Commit Graph

50 Commits

Author SHA1 Message Date
sezero 2f47c57897 minor tidy-ups
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@829 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 12:03:52 +00:00
svdijk e194235c7a host_cmd.c: fix typo in r827
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@828 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 10:36:28 +00:00
sezero 7aec459b09 host_cmd.c (Host_Changelevel_f, Host_Restart_f): if the serverspawn
fails even with an existing map, issue a Host_Error().

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@827 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 10:29:26 +00:00
sezero 137d3c2141 fixed fitzquake's map existence check in Host_Changelevel_f () leaking
file handles which would end up in a Sys_Error () due to consuming all
free handles if many maps reside not in pak files.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@825 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-01 23:55:12 +00:00
sezero aa4c9ebc40 renamed model_t to qmodel_t in order to avoid conflicts on solaris.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@676 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-05-30 08:56:06 +00:00
sezero 7b5b0b6502 Limited the struct qsocket_s details only to net_*.c sources :
For menu serverlist handling, added new procedures NET_SlistSort,
NET_SlistPrintServer and NET_SlistPrintServerName. Added new
procedure NET_QSocketGetTime for status and spawn commands' print
functionality in host_cmd.c. Added new NET_QSocketGetAddressString
procedure for status and connect commands' print functionality in
host_cmd.c and sv_main.c.  Patch ported over from uhexen2.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@657 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-04-18 20:33:12 +00:00
sezero 9ef1ddb76b silenced -Wsign-compare warnings.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 19:06:08 +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 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 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 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 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 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 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 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 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 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 3e1087164e host_cmd.c: minor tidy up, nothing serious.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@318 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 12:15:38 +00:00
sezero 7271fcb9fe host_cmd.c (Host_Say_f, Host_Tell_f): adjustments, mostly inspired from
the darkplaces engine.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@317 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 11:55:55 +00:00
sezero 12a9aa1004 fixed lazy declaration and cleaned up the .bsp extension removal logic.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@315 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-30 02:51:21 +00:00
sezero 31c71800ae remove the defunct cls.mapstring
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@314 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-30 02:15:22 +00:00
stevenaaus da578286cc Remove any trailing ".bsp" from mapname
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@313 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 23:03:50 +00:00
stevenaaus 8d58b764d6 End of the world commit
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@312 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 21:37:07 +00:00
sezero fb2bae914f added comment in Host_Name_f()
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@301 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 10:22:17 +00:00
sezero 205cabbdc2 const correctness changes.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
sezero 78cbc8cc5f added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
sezero 427d671c24 host_cmd.c, menu.c: sanitize whitespace/formatting.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@252 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-02 19:45:16 +00:00
sezero b4ae05875e made MAXCMDLINE definition public through keys.h.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@240 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-25 10:36:14 +00:00
stevenaaus c31e3d107a Enable messages and says to be 256 chars long, with a scrolling input line across top of screen. Allow tab button in demos.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@237 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-23 20:55:11 +00:00
sezero f7d02fcbbf host.c (Host_Init): Do not exec quake.rc for dedicated servers. Instead,
exec autoexec.cfg and stuffcmds in that case. Also moved running the start
map for dedicated servers here.
host_cmd.c (Host_Startdemos_f): Moved running the start map for dedicated
servers to Host_Init().


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@234 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 08:45:40 +00:00
sezero 7951b78a96 * host_cmd.c, menu.c, sv_main.c: Include net_sys.h (for net_defs.h).
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@216 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:50:21 +00:00
sezero 4710f5ae47 * net.h: separated the functions and data exported through net.h into two:
net.h now holds all public exports and the new net_defs.h holds the exports
only required by the net layer. besides the net_* files, host_cmd.c and
sv_main.c are the only reasonable foreign importers of net_defs.h: they
require accessing the qsocket_s structure members. The only one that does
not fit is menu.c needing some net exports, but it may be properly handled,
later on.
* net_defs.h: New header.
* host_cmd.c: Include net_defs.h.
* menu.c: Likewise.
* net_bsd.c: Likewise.
* net_dgrm.c: Likewise.
* net_loop.c: Likewise.
* net_main.c: Likewise.
* net_sdl.c: Likewise.
* net_sdlnet.c: Likewise.
* net_udp.c: Likewise.
* net_win.c: Likewise.
* net_wins.c: Likewise.
* net_wipx.c: Likewise.
* sv_main.c: Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 17:21:10 +00:00
sezero 243c2a6647 * host_cmd.c (Host_Map_f): Do not call IN_Activate() for dedicated servers.
(Host_Changelevel_f): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@183 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 09:00:22 +00:00
sezero cfc2566217 host_cmd.c, console.c, gl_draw.c, image.c, gl_model.c, r_sprite.c, cl_parse.c,
gl_warp.c, host.c, gl_mesh.c, gl_sky.c, gl_texmgr.c, cvar.c, sv_main.c, cvar.h,
gl_screen.c, r_brush.c, gl_vidsdl.c, zone.c, cl_main.c, cmd.c, snd_dma.c,
snd_mem.c, common.c, sv_phys.c: Added explicit casts to eliminate -Wc++-compat
warnings.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@170 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 07:42:36 +00:00
sezero 36d80efa84 host_cmd.c (Host_Startdemos_f): Add missing linefeed in Cbuf_InsertText() call.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@162 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-28 06:42:09 +00:00
sezero e4623215dd host_cmd.c (Host_Mapname_f): Simplified map name retrieval.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@157 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 21:16:50 +00:00
sezero 414c89ad55 Constified Con_DebugLog, Con_Print, Con_Printf, Con_Warning, Con_DPrintf,
Con_DPrintf2, Con_SafePrintf, Con_CenterPrintf, Con_LogCenterPrint,
Con_NotifyBox, PL_ErrorDialog, PR_RunError, Host_EndGame, Host_Error,
SV_ClientPrintf, SV_BroadcastPrintf, Host_ClientCommands, Sys_DebugLog,
Sys_Error, Sys_Printf, BOPS_Error and va. Added noreturn attribute to
Sys_Error, Sys_Quit, BOPS_Error, PR_RunError, Host_EndGame and Host_Error.
Added format printf attribute to Con_DebugLog, Con_Printf, Con_Warning,
Con_DPrintf, Con_DPrintf2, Con_SafePrintf, Con_CenterPrintf, PL_ErrorDialog,
PR_RunError, Host_EndGame, Host_Error, SV_ClientPrintf, SV_BroadcastPrintf,
Host_ClientCommands, Sys_DebugLog, Sys_Error, Sys_Printf and va. Adjusted
Host_Status_f and NET_Ban_f for the new attributes. Fixed broken format
strings in Con_Dump_f, Mod_LoadTexinfo, PR_AllocStringSlots and FloorDivMod.
Defined __attribute__ macros in quakedef.h so that we don't break non-gcc
compilers.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@154 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 16:30:40 +00:00
stevenaaus 1dc58562cb A few QuakeSpasm name fixes
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@112 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-22 00:25:31 +00:00
sezero 300265142c host_cmd.c (ExtraMaps_Add): Fix the list sorting.
(Modlist_Add): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@90 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-27 09:03:22 +00:00
sezero 4fe4cb3ea1 host_cmd.c (Modlist_Init): fix the return value check for Q_strcasecmp().
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@89 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-27 08:58:54 +00:00
sezero 82aecaa4f5 host_cmd.c (Host_InitCommands): register Host_Mods_f as "games" too, as an
alias to the existing "mods" command. (this was unintentionally applied in
revision 87, sigh...)


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@88 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-27 08:05:36 +00:00
sezero 1fbf28737e common.c (Q_strncasecmp): fix it so that it properly returns negative and
positive values.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@87 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-27 08:00:57 +00:00
sezero 2f4ed3f283 host_cmd.c (Host_Changelevel_f): activate mouse input upon changelevel.
(from Steven.)


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@72 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-20 01:20:45 +00:00
sezero df060bf72b use Steven's patch andallow for the 'demos' command to work in !fitzmod :
host_cmd.c (Host_Startdemos_f): reverted rev.50 change. when not fitzmode,
made it to directly go to the menu instead CL_NetxDemo().
menu.c (M_Main_Key): when not fitzmode, do not CL_NextDemo() for K_ESCAPE
case.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@61 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-19 13:32:21 +00:00
sezero 04dc181de1 Steven's customizations:
host_cmd.c (Host_Startdemos_f): if not running in fitzmode, don't add demos
to the loop and set cls.demonum.to -1.
menu.c (M_Draw): if not running in fitzmode, quit immediately without the
dialog for the m_quit case.
sbar.c (Sbar_SoloScoreboard): restored the original behavior depending on
whether we are running in fitzmode.
Marked the code with /* QuakeSpasm customization: */ in those places.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@50 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-18 12:55:19 +00:00
sezero ec3801107d console.c, gl_vidsdl.c, host_cmd.c, in_sdl.c, main.c, menu.c, net_sdl.c,
net_sdlnet.c, sys_sdl.c: a lot of space-to-tab whitespace tidy-ups in the
files created or touched by the SDL port. no actual code change.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@43 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-17 23:32:04 +00:00
sezero d367a2fe9a 64 bit compatibility effort, 4/nn: x86_64 works just fine now, yey!
the QuakeC interpreter used to use string pointer offsets from pr_strings
even when the pointers lead to engine data which is often well out of
32bit range on a 64bit architecture and they lead to crashes.  they now
go through the new PR_SetEngineString and PR_GetString functions which
turn any address outside the pr_strings area into an index into a table
of engine string addresses, adding new string addresses to the table as
needed. the engine strings table is allocated with 256 entries at first
(see the PR_STRING_ALLOCSLOTS definition in pr_edict.c) and its size is
incremented by 256 as needed and re-allocated on the zone. managing that
allocation and reallocation is accomplished by the recently added Z_Realloc
function. implementation based on the uhexen2 (hexen2: hammer of thyrion)
engine which, in turn, is loosely based on twilight and quakeforge engines.
pr_strings range check is from tyrquake.
pr_edict.c: added the new PR_SetEngineString, PR_GetString, PR_AllocString
public functions and the new private PR_AllocStringSlots function. made
ED_NewString private to pr_edict.c and reworked it to return an index to a
newly allocated string.
progs.h: added prototypes for the new public PR_SetEngineString, PR_GetString
and PR_AllocString functions.
host_cmd.c, pr_cmds.c, pr_edict.c, pr_exec.c, progs.h, sv_main.c, sv_phys.c:
modifed to use the new PR_SetEngineString and PR_GetString functions.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@38 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-17 15:04:50 +00:00
sezero d294f9b8b1 host_cmd.c (Host_Changelevel_f): get rid of console or menu (key_dest = key_game).
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@31 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 15:39:06 +00:00
sezero e2efd2d72f client.h (client_state_t): added mapname[128] as a new member to hold the
current map file name without path and extension.
cl_parse.c (CL_ParseServerInfo): copy the naked name of the map file to
the cl structure.
host_cmd.c (Host_Map_f): print the current map name if no arguments are
given. print help message if not connected.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@16 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 09:47:04 +00:00
sezero c5c4e96d44 initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00