Commit Graph

246 Commits

Author SHA1 Message Date
sezero da8996a8f5 * renamed Length() to VectorLength() for consistency with its friends.
* 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-01 19:22:46 +00:00
stevenaaus b9ab6be4f8 Add a statusbar alpha slider, and change default scr_sbaralpha to 0.95
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@247 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-29 06:48:25 +00:00
stevenaaus b63d812769 Link the status bar size to the scale slider, though it's size only increases half as fast
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@246 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-29 01:52:04 +00:00
stevenaaus f0ee5581c0 History fixed - Ozkan's newline fix seems ok.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@245 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-28 07:50:27 +00:00
stevenaaus 10b21499a2 Make some fixes for command line history now that history is persistent
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@244 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-28 07:08:16 +00:00
stevenaaus 977e81c8c1 There seems bugs in the command-line code. Revert this "blank newline" fix first, then look for more
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@243 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-27 21:45:33 +00:00
stevenaaus 6ffcbdc338 -bgvolume switch stays... Allows CD music/ambient music to play while minimized
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@242 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-26 08:47:11 +00:00
sezero ab217aaf82 Under windows, run the game (windowed), go into a saved game,
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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@241 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-25 12:20:17 +00:00
sezero 23a767e4b2 made MAXCMDLINE definition public through keys.h.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@240 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-25 10:36:14 +00:00
sezero e1c4c0d973 Windows/dirent.c: include stddef.h for MSVC to get intptr_t.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@239 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-25 08:28:27 +00:00
stevenaaus 8ca2bc684b (Some?) Win32/64 does not re-enable sound after app is minimized and restored, so (temporarily?) add a -bgsound switch to disable sound being muted
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-23 20:58:04 +00:00
stevenaaus 57c129aa17 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@237 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-23 20:55:11 +00:00
sezero 4087928d2b * Windows/dirent.c: For 64 bit compatibility, changed the handle member
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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@236 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-07-15 09:15:42 +00:00
sezero 43e872d1d1 keys.c (History_Shutdown): Don't let it write an empty string to history.txt
if no console commands were used.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@235 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 10:50:40 +00:00
sezero 72f4ccebb2 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: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@234 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 08:45:40 +00:00
sezero 4f5dd899fd host.c (Host_Init): Don't call V_Init, Chase_Init, Key_Init, Con_Init, M_Init,
ExtraMaps_Init and Modlist_Init for dedicated servers either.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@233 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 08:16:58 +00:00
sezero 406ed513d4 * keys.c (HISTORY_FILE_NAME): define simply as history.txt without
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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@232 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 07:56:28 +00:00
sezero 53b780c9a2 host.c (Host_Shutdown): Write the console command history file only if
not a dedicated server. Same for shutting down the CDAudio and sound
subsystems.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@231 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 00:31:12 +00:00
sezero b33ac1c08a keys.c (History_Init): Made global again.
(History_Shutdown): Likewise.
keys.h: Added prototypes for History_Init and History_Shutdown.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@230 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 00:15:22 +00:00
sezero 5739389db5 * keys.c (History_Init): Make it static. Tidy-up its formatting.
(History_Shutdown): Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@229 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-25 23:55:41 +00:00
stevenaaus 5d8098f1a5 Add Bakers/Ezquakes persistent history feature
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@228 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-25 13:32:49 +00:00
sezero 7f884a951b net_udp.c, net_wins.c, net_wipx.c: Add more informative debug messages.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@227 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:11:00 +00:00
sezero 94387b68a2 net_wins.c (WINS_GetLocalAddress): Make sure buff is null terminated.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@226 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:09:02 +00:00
sezero dde3458f13 net_wins.c (WINS_Init): Fix error return value as INVALID_SOCKET.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@225 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:05:43 +00:00
sezero 50cea5662f * console.h (Con_DebugLog): Add prototype.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@224 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 11:02:13 +00:00
sezero b2aba1c07d Reorganize files for platform-specific code:
* 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@223 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 11:01:24 +00:00
sezero 4c86b544f5 * net_udp.c (UDP_Read): Remove the get_qsockaddr() helper which came from the
old fitzsdl port, and use the struct qsockaddr *addr argument with typecasting
as in original quake.
(get_qsockaddr): Remove.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@222 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:23:06 +00:00
sezero 850ef74acf * net_udp.c (UDP_Init): Fix Con_SafePrintf() call.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@221 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:17:17 +00:00
sezero bb11a66451 net_udp, net_wins, net_wipx network drivers update:
- 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@220 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 15:24:40 +00:00
sezero 94a056abcf net_sdlnet.c: reverted parts of rev. 197/198.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@219 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 13:27:30 +00:00
sezero 4a202dad3d net_main.c: more trivialities.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@218 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 12:27:30 +00:00
sezero c8bdc511d8 net_bsd.c, net_dgrm.h, net_loop.c, net_loop.h, net_sdl.c, net_win.c: more trivialities.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@217 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 12:20:25 +00:00
sezero 63c98a9576 * host_cmd.c, menu.c, sv_main.c: Include net_sys.h (for net_defs.h).
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@216 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:50:21 +00:00
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