Commit Graph

175 Commits

Author SHA1 Message Date
sezero a369e60679 * input.h: Removed the SDL_MAJOR_VERSION guards around BuildKeyMaps() and
Key_Map() prototypes. Made Key_Map() to accept void* argument instead of
SDL_KeyboardEvent* so that the code can compile even without SDL.
* in_sdl.c (Key_Map): Adjusted for argument type change with proper cast
to SDL_KeyboardEvent*. The assembler output is the same as before.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@194 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 22:45:18 +00:00
sezero 7030aaf38c Makefiles: Removed an obsoleted comment. Added objects for platform-specific
network drivers in commented out form.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@193 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:15:21 +00:00
sezero 97fa260661 * net_wipx.c, net_wipx.h: added from Fitzquake-0.85 source.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@192 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:07:04 +00:00
sezero e98269bbf5 net_udp.h: Renamed all function argument names as socket to socketid.
net_udp.c: Renamed all function argument names as socket to socketid.
Replaced the inet_addr("127.0.0.1") call with htonl(INADDR_LOOPBACK).
Replaced qboolean _true with int _true.
net.h: Renamed the OpenSocket and CloseSocket function pointers to
Open_Socket and Close_Socket.
net_dgrm.c: Adjusted for Open_Socket and Close_Socket change.
net_sdlnet.c: Made some functions static.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@191 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 18:20:22 +00:00
sezero 200602bbf3 * net_udp.c: more minor fixes and tidy-ups.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@190 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 17:04:04 +00:00
sezero 47ec80a33a * sys_sdl.c: Added a Sys_ConsoleInput implementation from uhexen2.
Only for unix for the time being.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@189 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:50:15 +00:00
sezero 4ca09587ec * net_bsd.c: minor whitespace tidy-up.
* net_sdl.c (net_drivers[]): removed duplicated Datagram entry.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@188 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:45:38 +00:00
sezero 1e984d7809 * net_udp.c: Some cleanups & tidy-ups.
* net_bsd.c: Added from original Quake source.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@187 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:37:28 +00:00
sezero 0f6c0a0c55 * main_sdl.c: better dedicated server loop.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@186 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:50:48 +00:00
sezero 257ad7e38d * gl_model.c (Mod_LoadFaces): Do not call GL_SubdivideSurface() in dedicated
servers, otherwise we segfault in SubdividePolygon() at the BoundPoly() call.
This is a workaround, the actual problem is yet to be looked into.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@185 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:16:05 +00:00
sezero 3e996b3050 * main_sdl.c: Skip the SDL_Event stuff in dedicated servers.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@184 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:10:19 +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 367886b460 -Wshadow fixes:
sv_user.c (SV_WaterMove): use the global wishspeed.
(SV_ReadClientMessage): rename cmd to ccmd.
view.c (forward, right, up): make them local to V_CalcRoll() and not global.
net.h (playername, playercolor): remove externs for the non-existant globals.
r_sprite.c (R_GetSpriteFrame): rename the function's argument to currentent.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@182 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 19:03:31 +00:00
sezero 29b96547ed renamed the global channels to snd_channels. removed the global variable
sound_nominal_clip_dist and made it into a macro in snd_dma.c.
snd_dma.c: general whitespace and formatting cleanup.
(S_StaticSound): Explicitly cast vol to int when assigning it to ss->master_vol.
(S_UpdateAmbientSounds): changed the type of vol from float to int. used int
casts in its calculations. added explicit int casts when assigning values to
chan->master_vol.
(S_Update_): added explicit unsigned int casts in endtime calculations.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@181 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 17:25:24 +00:00
sezero 89b16b1ccd renamed cvar variable volume to sfxvolume in order to avoid shadowing.
(console name is still volume, no changes to that.)


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@180 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 16:38:22 +00:00
sezero d2fba0d4de snd_mix.c: General whitespace and formatting tidy up.
(DWORD): Deleted macro.
(S_TransferStereo16): Removed unnecessary pbuf pointer and used shm-> buffer
directly.
(S_TransferPaintBuffer): Removed unnecessary pbuf pointer and used shm-> buffer
directly. Removed the shadowing instance of snd_vol and used the global var.
(S_PaintChannels): Replaced Q_memset with memset.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@179 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 16:28:30 +00:00
sezero f60f04ac0a gl_model.c (Mod_LoadTextures): Don't use "min" or "max" as a var name.
net_dgrm.c (Net_Test_f): Likewise.
pr_cmds.c (SetMinMaxSize, PF_setsize): Likewise.
pr_exec.c (PR_Profile_f): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@178 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 12:10:49 +00:00
sezero de3a15b24b gl_rmain.c, gl_rmisc.c, cl_tent.c, quakedef.h: removed leftovers from GLTEST.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@177 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 10:55:40 +00:00
sezero 94d3702026 common.h: tweak the qboolean and NULL definitions for __cplusplus. from uhexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@176 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 12:10:25 +00:00
sezero 56fedf11a2 mathlib.h (max, min): The min and max were declared as inline but
were never defined. Moved them from mathlib.c to here as static
inline functions q_min and q_max. Define min and max as q_min and
q_max.
mathlib.c (max, min): Moved to mathlib.h as q_max and q_min static
inlines.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@175 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:56:27 +00:00
sezero aa07bc5c41 quakedef.h: Define inline as __inline if !__cplusplus && _MSC_VER
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@174 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:55:59 +00:00
sezero 3c1ba05bc0 menu.c (m_return_state, m_quit_prevstate): fixed typo.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@173 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:12:00 +00:00
sezero f325240397 menu.c (m_return_state): changed type to m_state_e
(m_quit_prevstate): Likewise.
menu.h (m_return_state): added extern declaration.
net_dgrm.c (m_return_state): removed extern declaration.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@172 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 09:15:50 +00:00
sezero 1c8a86d6b9 cvar.c (Cvar_RegisterVariable): change the callback function argument type
to cvarcallback_t.
cvar.h (Cvar_RegisterVariable): adjust prototype.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@171 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 08:01:29 +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 f5986fba56 keys.c (Key_SetBinding): Avoid the C++ keyword "new".
pr_cmds.c (PF_normalize, PF_vlen): Likewise.
zone.c (Z_TagMalloc, Cache_Move, Cache_TryAlloc): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@169 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 06:39:09 +00:00
sezero e883bf3b47 gl_mesh.c: Change the type of used[] array from qboolean to int, because
it is assigned not just true or false values but other integers like "2"
as well, and it would cause a mess if compiled as a C++ source.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@168 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 06:27:56 +00:00
sezero d0d9176e86 sys_sdl.c (Sys_Error): Call Host_Shutdown().
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@166 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-18 14:15:19 +00:00
sezero 2f54c5cef0 quakedef.h: bumped QuakeSpasm version to 3 (0.85.3) for further development
and future releases.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@165 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-03 15:28:18 +00:00
stevenaaus b8741a6e99 Fix mouse release issue after toggling fullscreen
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@163 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-02 02:22:24 +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 4265cbc294 gl_vidnt.c, gl_vidsdl.c: if 0'ed out unused CheckArrayExtensions().
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@161 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-27 12:40:19 +00:00
sezero 749ef3b9f2 sys.h, sys_sdl.c: Removed unused Sys_MakeCodeWriteable and Sys_DebugLog.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@160 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-27 12:37:20 +00:00
sezero 31991cd33e console.c: Added LOG_Init() and LOG_Close() as two new procedures, adapted
from uhexen2. Moved debug log initialization from Con_Init() to LOG_Init().
Made Con_DebugLog() to operate without varargs stuff. Log file is written
into host_parms->basedir now, not into a gamedir.
console.h: Added prototypes for LOG_Init() and LOG_Close().
host.c (Host_Init): Added LOG_Init().
(Host_Shutdown): Added LOG_Close().
quakedef.h (quakeparms_t): Moved the typedef to an earlier place before
any of the other quake headers are included.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@159 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-27 08:24:13 +00:00
sezero 71a0e9e6c1 main_sdl.c (main): Remove leading linefeed from the init message.
common.c (COM_InitArgv): Move the leading linefeed to the end of message.

Index: main_sdl.c
===================================================================
--- main_sdl.c	(revision 157)
+++ main_sdl.c	(working copy)
@@ -58,7 +58,7 @@
 	if (!parms.membase)
 		Sys_Error ("Not enough memory free; check disk space\n");
 
-	Con_Printf("\nFitzQuake %1.2f (c) John Fitzgibbons\n", FITZQUAKE_VERSION);
+	Con_Printf("FitzQuake %1.2f (c) John Fitzgibbons\n", FITZQUAKE_VERSION);
 	Con_Printf("SDL port (c) Sleepwalkr, Baker\n");
 	Con_Printf("QuakeSpasm %1.2f.%d (c) Ozkan Sezer, Stevenaaus\n", FITZQUAKE_VERSION, QUAKESPASM_VER_PATCH);
 
Index: common.c
===================================================================
--- common.c	(revision 157)
+++ common.c	(working copy)
@@ -1150,7 +1150,7 @@
 	if (n > 0 && com_cmdline[n-1] == ' ')
 		com_cmdline[n-1] = 0; //johnfitz -- kill the trailing space
 
-	Con_Printf("\nCommand line: %s",com_cmdline);
+	Con_Printf("Command line: %s\n", com_cmdline);
 
 	safe = false;
 


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@158 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-27 07:15:19 +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 dbcc18293b zone.c: A little whitespace tidy-up here and there.
(hunk_t): Increased name array length to 24. Fixed the strncpy() calls
into that field so that it will be null terminated.
(cache_system_t): Increased name array length to 32.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@156 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 20:40:18 +00:00
sezero 5879f113e0 sys_sdl.c (Sys_Error): made text3, text4 and text5 into const char arrays.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@155 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 16:55:14 +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
sezero 4c0ab421c6 mathlib.h (VectorNormalizeFast): Use a float/int union instead of type
punning to avoid strict aliasing violations. the compiler used to emit
a warning from rsprite.c:R_DrawSpriteModel() where the macro is used.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@153 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 14:11:48 +00:00
sezero d5179bc560 r_alias.c (GL_DrawAliasFrame): Initialize vert2 to vert1 when not lerping,
which avoids a bogus compiler warning.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@152 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 14:02:37 +00:00
sezero d0808e3a96 gl_model.c (Mod_LoadTextures): If lump->filelen == 0, initialize m to NULL
in order to avoid a bogus compiler warning.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:47:19 +00:00
sezero 35795de3d6 r_alias.c (GL_DrawAliasFrame): Initialize blend and iblend to 0 when not
lerping, which avoids a bogus compiler warning.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@150 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:44:24 +00:00
sezero ad452580db gl_vidnt.c (VID_SetMode): Initialize stat to false to avoid a compiler warning.
Some whitespace tidy-ups all over.
gl_vidsdl.c (VID_SetMode): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@149 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:41:39 +00:00
sezero 1593b023a8 gl_vidsdl.c (VID_Init): If -height is not specified on the command line,
initialize height to width*3/4 which avoids a compiler warning.
gl_vidnt.c (VID_Init): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@148 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:37:56 +00:00
sezero 107d7e932e gl_vidsdl.c (VID_SetMode): If mode setting failed, error out before doing
anything else unnecessary in between.
gl_vidnt.c (VID_SetMode): Likewise.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@147 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:33:07 +00:00
sezero 526ebf2017 changed SDL conditional in input.h to SDL_MAJOR_VERSION
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@145 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-24 16:54:55 +00:00
sezero 04ad6afa99 moved BuildKeyMaps(), Key_Map() and key_map[] from keys.c to in_sdl.c.
made key_map[] static to in_sdl.c. moved the relevant prototypes to
input.h for SDL builds only.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@144 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-24 16:25:08 +00:00
sezero 8fb859d55c Makefiles: tweaked+tidied the objects (based on uhexen2 makefile.)
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@143 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-24 15:55:02 +00:00
sezero fb8a9ad688 renamed main.c to main_sdl.c.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@142 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-24 15:21:59 +00:00