in BSD variants and the family member is also an unsigned char instead
of (unsigned) short. So we define HAVE_SA_LEN for those BDS variants
and check for the offsetof for the sa_family member and also change
the struct qsockaddr to mirror that. This should matter only when
PLATFORM_UNIX is defined.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@260 af15c1b1-3010-417e-b628-4374ebc0bcbd
* mathlib.c: Removed the unnecessary sqrt() prototype.
(VectorLength): Made it to just return sqrt(DotProduct(arg,arg))
(VectorNormalize): Calculate the length as sqrt(DotProduct(arg,arg)).
* mathlib.h (CLAMP): Renamed the macro arguments from min and max to
_minval and _maxval.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@248 af15c1b1-3010-417e-b628-4374ebc0bcbd
press Esc to get the menu, minimize using the mouse on the
window's minimize icon and then restore and you'll have sound
all the same. HOWEVER: If you minimize by pressing the icon
on the start bar, sound will be lost upon restoring. Or, if
you use alt-tab to get away from the game window the same will
happen. Or, if you run the game fullscreen and use alt-tab to
go to the desktop (alt-tab is the only way I know) you will
lose the sound again. Here, we are probably are hitting an
SDL_APPACTIVE or SDL_APPINPUTFOCUS event more than once and
since the block counter goes > 1 we are not restoring properly.
For now, making snd_blocked to act as a boolean and not as a
counter fixes the issue. Hmmm...
* main_sdl.c: Revert revision 238 change, no longer necessary.
* snd_dma.c: Make snd_blocked act as a boolean and not as a
counter.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@241 af15c1b1-3010-417e-b628-4374ebc0bcbd
of struct DIR from long to intptr_t, which is what _findfirst() returns
and _findnext() and _findclose() accepts, and removed the brain-dead long
casts in the code. This file is probably only used with M$VC, therefore
this doesn't affect gcc/mingw compilations and previous binaries.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@236 af15c1b1-3010-417e-b628-4374ebc0bcbd
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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@234 af15c1b1-3010-417e-b628-4374ebc0bcbd
ExtraMaps_Init and Modlist_Init for dedicated servers either.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@233 af15c1b1-3010-417e-b628-4374ebc0bcbd
prefixing with a game directory, so that the history file would be
written into the basedir and not affected by dynamic game directory
changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@232 af15c1b1-3010-417e-b628-4374ebc0bcbd
not a dedicated server. Same for shutting down the CDAudio and sound
subsystems.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@231 af15c1b1-3010-417e-b628-4374ebc0bcbd
* sys_sdl_win.c: Copied from sys_sdl.c. Windows-only. Remove unix code.
(Sys_Init): New procedure. Call AllocConsole() and get input and output
handles for dedicated servers.
(Sys_ConsoleInput): Add a windows version.
(Sys_Error): Adjust for the allocated console and use windows api.
Adjust message output. Remove the console timeout, doesn't work somehow.
Just display the console for 3 seconds and then exit. Rely on SDL that
it redirects/logs the stdout/stderr to files.
* sys_sdl_unix.c: Rename from sys_sdl.c. Unix-only. Remove windows code.
(Sys_Init): New procedure.
(Sys_Error): Remove Windows-oriented dedicated server specific code.
Adjust message output.
* sys_sdl.c: Delete.
* sys.h (Sys_Init): Add prototype.
* main_sdl.c (main): Call Sys_Init().
* pl_linux.c (PL_ErrorDialog): Remove terminal printing which Sys_Error
already does.
* pl_osx.m (PL_ErrorDialog): Update from uhexen2.
* pl_win.c: Make icon handle static. whitespace and formatting tidy-up.
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Adjust for the
sys_sdl.c name change to sys_sdl_unix.c and sys_sdl_win.c.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@223 af15c1b1-3010-417e-b628-4374ebc0bcbd
old fitzsdl port, and use the struct qsockaddr *addr argument with typecasting
as in original quake.
(get_qsockaddr): Remove.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@222 af15c1b1-3010-417e-b628-4374ebc0bcbd
- do not try to set the quake hostname to the machine name if it isn't set.
- use the newly added unix/windows socket api compatibility macros from
net_sys.h: using just an int as the socketfd wasn't a problem without win64
support: the windows SOCKET type is not only unsigned but may actually be
wider (uintptr_t, which is 8 bytes on win64).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@220 af15c1b1-3010-417e-b628-4374ebc0bcbd
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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@213 af15c1b1-3010-417e-b628-4374ebc0bcbd
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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@209 af15c1b1-3010-417e-b628-4374ebc0bcbd
changed the type of testAddr in _Datagram_CheckNewConnections() to in_addr_t.
a little formatting tidy-up.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@208 af15c1b1-3010-417e-b628-4374ebc0bcbd