Commit graph

263 commits

Author SHA1 Message Date
sezero
7a36701fa8 * Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
sezero
291a531b44 * arch_def.h, net_sys.h, wsaerror.h: New headers, adapted from uhexen2.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@214 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:55:21 +00:00
sezero
7239a9a679 net_defs.h (net_driver_t): Removed the controlSock member. It is not used
for any purpose in either of Loop, Datagram or Serial drivers. It used to
be assigned the value returned by the Init() procedure of the relevant
driver which is either 0 for success or -1 for failure, therefore there is
no purpose to it at all.
net_main.c (NET_Init): Removed the controlSocket var and adjusted for the
net_driver_t change.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@213 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:50:21 +00:00
sezero
b4cb4368a4 net_main.c: made static variables and functions static. formatting tidy-ups.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@212 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:41:34 +00:00
sezero
4e508de0e6 net_dgrm.c: made the statistic counter variables static. same for the
testPollProcedure and test2PollProcedure varibles and StrAddr, NET_Ban_f,
SendMessageNext, ReSendMessage, PrintStats and NET_Stats_f functions.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@211 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:16:58 +00:00
sezero
b963f776e5 net_dgrm.c: made the packetBuffer struct static.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@210 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:03:10 +00:00
sezero
31e63fecf0 * common.c: Renamed the empty Test_f function of johnfitz to FitzTezt_f.
Renamed its associated console command to fitztest.
* net_dgrm.c: Renamed back Net_Test_f to Test_f. Added back the test,
test2 and ban console commands.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@209 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:58:12 +00:00
sezero
e98d1efcc3 * net_dgrm.c: changed the types of banAddr and banMask to struct in_addr.
changed the type of testAddr in _Datagram_CheckNewConnections() to in_addr_t.
a little formatting tidy-up.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@208 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:45:24 +00:00
sezero
dcd4743a2b * net_defs.h, net_udp.c, net_wins.c, net_wipx.c, net_sdlnet.c: prefixed
the members of qsockaddr structure with a "q".


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@207 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:20:32 +00:00
sezero
b95bf1ae87 * net_udp.c: Changed broadcastaddr type to struct sockaddr_in.
* net_wins.c: Likewise.
* net_wipx.c: Changed broadcastaddr type to struct sockaddr_ipx.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@206 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:00:56 +00:00
sezero
eb45598f39 * net_win.c, net_wins.c, net_wipx.c: warning and compilation fixes.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@205 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 20:50:27 +00:00
sezero
2cbdc2f756 * 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 17:21:10 +00:00
sezero
45ce066ee5 from uhexen2:
* net_dgrm.c (Datagram_Init): Datagram_Init() must return -1 if it couldn't
initialize any drivers.
* net_main.c (): dedicated servers must error out if no network drivers are
available.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@203 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:33:45 +00:00
sezero
b2bb022eb5 * net_main.c: added commentary on the driver checks in the code.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@202 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:19:58 +00:00
sezero
1fc6e7c34c net_main.c (NET_SendToAll): Really change all occurances of state2 to msg_sent.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@201 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:06:26 +00:00
sezero
0f948f8231 * net_main.c: Fix NET_SendToAll() so that it really skips non-connected
clients. While we're at it, change the type of the blocktime argument
to double (the comparison is against a double.) Rename the cryptic
state1 and state2 variables to something more indicative of thei
purpose, ie. msg_init and msg_sent. from uhexen2.
* net.h, host.c, sv_main.c: Adjust for the NET_SendToAll() argument type
change.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@200 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:00:57 +00:00
sezero
2b569dc06b * net_udp.c: Changed myAddr type to in_addr_t.
* net_wins.c: Changed myAddr type to u_long.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@199 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 13:10:52 +00:00
sezero
e789fcaed0 * net_sdlnet.c: Pass "localhost" instead of NULL to SDLNet_ResolveHost().
added some remarks about missing functionality in SDL_net.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@198 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 12:50:51 +00:00
sezero
9a09a1ee08 * net_sdlnet.c: Added ASSERT_SOCKETID for paranoid debugging purposes,
disabled by default. Made socket_id() to work in two passes, once for
looking for a match and the next for looking for an empty slot in the
net_sockets[] array. Made it to Sys_Error if there are no empty slots.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@197 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 11:05:28 +00:00
sezero
013a3ad1db Some more tidy-up and minor fixing in net stuff. Largely trivial. Also
added winquake.h.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@196 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 10:03:05 +00:00
sezero
719ba437b7 * gl_vidsdl.c, in_sdl.c, main_sdl.c, net_sdlnet.c, pl_linux.c, pl_osx.m,
pl_win.c, sys_sdl.c: Explicitly include SDL.h in the SDL source files. At
present, quakedef.h already includes SDL.h you may never know what would
happen in the future.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@195 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 22:50:48 +00:00
sezero
858fea3461 * 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@194 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 22:45:18 +00:00
sezero
288edb93a0 Makefiles: Removed an obsoleted comment. Added objects for platform-specific
network drivers in commented out form.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@193 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:15:21 +00:00
sezero
0e7d3d7009 * net_wipx.c, net_wipx.h: added from Fitzquake-0.85 source.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@192 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:07:04 +00:00
sezero
59574dd7a3 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@191 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 18:20:22 +00:00
sezero
c5f6ed0763 * net_udp.c: more minor fixes and tidy-ups.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@190 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 17:04:04 +00:00
sezero
44608bb902 * sys_sdl.c: Added a Sys_ConsoleInput implementation from uhexen2.
Only for unix for the time being.


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


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


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@187 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:37:28 +00:00
sezero
6ee0b477b2 * main_sdl.c: better dedicated server loop.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@186 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:50:48 +00:00
sezero
e05ac1be84 * 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@185 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:16:05 +00:00
sezero
6b05365aa3 * main_sdl.c: Skip the SDL_Event stuff in dedicated servers.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@184 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:10:19 +00:00
sezero
6667ab7afb * host_cmd.c (Host_Map_f): Do not call IN_Activate() for dedicated servers.
(Host_Changelevel_f): Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@183 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 09:00:22 +00:00
sezero
e909c83a9c -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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@182 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 19:03:31 +00:00
sezero
546eb4ff15 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@181 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 17:25:24 +00:00
sezero
e5953b445c renamed cvar variable volume to sfxvolume in order to avoid shadowing.
(console name is still volume, no changes to that.)


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@180 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 16:38:22 +00:00
sezero
48ecd3b74b 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@179 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-03 16:28:30 +00:00
sezero
ad73b2d75a 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@178 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 12:10:49 +00:00
sezero
da11e5c84f gl_rmain.c, gl_rmisc.c, cl_tent.c, quakedef.h: removed leftovers from GLTEST.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@177 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 10:55:40 +00:00
sezero
a9c3e4d9e4 common.h: tweak the qboolean and NULL definitions for __cplusplus. from uhexen2.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@176 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 12:10:25 +00:00
sezero
4da670cd2c 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@175 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:56:27 +00:00
sezero
3c237ac3d7 quakedef.h: Define inline as __inline if !__cplusplus && _MSC_VER
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@174 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:55:59 +00:00
sezero
fbffcfa3b9 menu.c (m_return_state, m_quit_prevstate): fixed typo.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@173 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:12:00 +00:00
sezero
faef222404 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@172 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 09:15:50 +00:00
sezero
cff54a63a6 cvar.c (Cvar_RegisterVariable): change the callback function argument type
to cvarcallback_t.
cvar.h (Cvar_RegisterVariable): adjust prototype.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@171 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 08:01:29 +00:00
sezero
6d3f3f2081 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@170 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 07:42:36 +00:00
sezero
cc80c805b4 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@169 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 06:39:09 +00:00
sezero
73c8c176f0 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@168 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 06:27:56 +00:00
sezero
562e37c468 MacOSX/QuakeSpasm.xcodeproj/
Updated XCode project files from Levent Yavas.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@167 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-21 19:03:17 +00:00
sezero
2bb4a6625e sys_sdl.c (Sys_Error): Call Host_Shutdown().
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@166 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-18 14:15:19 +00:00