Commit Graph

484 Commits

Author SHA1 Message Date
svdijk
60a70671f0 input: new cvar m_freelook for mouse looking
When set to 1 mouse look key stops mouse looking

Signed-off-by: svdijk <svdijk@users.sourceforge.net>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-01 09:37:42 +09:30
svdijk
4bf4b4fc6d input: handle cl_run in CL_AdjustAngles() as well
Signed-off-by: svdijk <svdijk@users.sourceforge.net>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-27 08:56:10 +09:30
svdijk
95c56f9a01 input: new cvar cl_run for auto-running
When set to 1 speedkey acts as slowkey

Signed-off-by: svdijk <svdijk@users.sourceforge.net>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-26 13:00:33 +09:30
Kevin Shanahan
cee4b1e31c qpic: introduce the qpic8_t type to replace qpic_t
We allow for a "stride" parameter so that sub-pics can be used and a
simple boolean to indicate if alpha is enabled or not for palette
index 255.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 13:47:29 +09:30
Kevin Shanahan
62a20b1574 skin: rename local variables sc -> player
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-29 16:07:57 +09:30
Kevin Shanahan
034da76617 skin: make the skin cache private to skin.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-29 16:07:57 +09:30
Kevin Shanahan
f41d286162 trivial: typos, allways->always, allready->already
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-28 19:07:13 +09:30
Kevin Shanahan
6b33e31240 sbar: random cleanups to Sbar_MiniDeathmatchOverlay
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-27 10:06:31 +09:30
Kevin Shanahan
7f61754841 menu: move menu.c to the common directory 2013-04-25 12:06:03 +09:30
Kevin Shanahan
5466fde4ca menu: prepare menu files for merging
A lot of the churn is just re-ordering functions in the NQ file so that
the NQ specific menus are grouped together at the end of the file.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 12:04:16 +09:30
Kevin Shanahan
00bae5b830 menu: move header to shared include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 10:43:52 +09:30
Kevin Shanahan
4f5e9d2faf menu: prepare header for merging
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 10:43:25 +09:30
Kevin Shanahan
4e4ff70ef6 menu: more knum_t vs. int changes
Mostly this is just being pedantic, but there were also some -1 vs.
K_UNKNOWN issues in the key bindings menu.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 22:24:31 +09:30
Kevin Shanahan
e25336f02a client: work around NULL worldmodel in CL_SetSolidEntities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-18 14:07:23 +09:30
Kevin Shanahan
c7d9756e63 pmove: use a const brushmodel pointer for physents
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-18 12:35:39 +09:30
Kevin Shanahan
7f544afefc pmove: check model type before dereferencing brushmodel
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-18 12:33:59 +09:30
Kevin Shanahan
81ee58ae41 model: separate brush model data from model_t
Create a new structure "brushmodel_t" which contains all the brush
model specific parts of model_t and shrink model_t down to size.

This makes the alias cache nice and small, so we can afford to have
lots of slots by default.  I expect I'll do something similar for
separating alias and sprite model data too, but (hopefully!) the
changes will be far less wide ranging.

Lightly tested on a few maps, but there could still be bugs lurking...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-16 20:45:33 +09:30
Kevin Shanahan
7932e2ffc6 model: move mod_known onto the hunk, split model cache
Well, the only caching that is actually done is for the alias models.
Sprites and BSP models get forgotten as soon as the next map loads.
So allocate some space (currently hard coded to 512) for alias model
caching below host_hunkelevel and put bsp and sprite model structs
onto the hunk with the rest of the level data.

This structure still needs some work, but at least we should no longer
run out of space for models as long has we have some space on the
hunk.

The alias model overflow thing is probably a bit of overkill or the
wrong way to handle it - we should be doing some kind of LRU and
throwing away things we no longer need as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-15 15:43:21 +09:30
Kevin Shanahan
376f9a7de5 common: make COM_StripExtension and COM_DefaultExtension check buffers
Pass an input and output buffer in (can be the same pointer) and
ensure that no more is written to the output buffer than will fit.
COM_DefaultExtension now returns an error if it ran out of space
adding the extension.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-15 13:11:14 +09:30
Kevin Shanahan
fa3acf7707 client: set cl.intermission = 0 on disconnect
Fixes a kind-of-hard-to-trigger problem with SCR_UpdateScreen. Good
explanation from Baker here:
  http://forums.inside3d.com/viewtopic.php?t=4944

Thanks Ozkan for pointing this one out for me.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-14 10:47:56 +09:30
Kevin Shanahan
9aab9c08b3 sys: remove sys_unix from QW/server directory
Requires 'make clean' to re-build from common.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-10 11:49:43 +09:30
Kevin Shanahan
b19f9b97bb sys: hack sys_unix.c for merging qwsv version with clients
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-10 11:47:13 +09:30
Kevin Shanahan
52745ec8bb sys: whitespace/ordering changes for sys_unix.c consistency
No code changes apart from making Sys_MakeCodeWritable a no-op when
not using the x86 asm.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-10 10:57:44 +09:30
Kevin Shanahan
31b60fd4b7 sys: include net header in sys_unix.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-10 10:28:07 +09:30
Kevin Shanahan
1eef379c97 server: add paranoid check for MULTICAST_PHS messages
Mod_PointInLeaf shouldn't return the zero leaf (node), but let's not
crash if I'm wrong...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-08 12:20:11 +09:30
Kevin Shanahan
a3ca0a8c4a server: properly allocate the extra PVS row in QWSV
Also fixed a bug where we were picking the wrong PHS leaf (off by one)
for multicast client messages.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-08 12:01:40 +09:30
Kevin Shanahan
fa3580ffb9 wad: update wad API to take a wad_t structure
Instead of single global variables to access the one currently loaded wad,
pass in a wad_t to access a specific wad.  Currently this is only gfx.wad,
so the global for this is held by NQ/host.c and QW/client/cl_main.c.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-07 15:43:37 +09:30
svdijk
0dc82b6d60 input: mlook/lookspring fix
Call V_StartPitchDrift only if lookspring has been turned on, then make
sure to call V_StopPitchDrift if mlook is on and the mouse is moved.

From Jacques Krige's tutorial, see http://www.quake-1.com/docs/quakesrc.org/1.html

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-05 21:45:10 +10:30
Kevin Shanahan
4ce6ef5b81 windows: fix startup dialog/splash screens
Fix the missing info in winquake.rc which I commented out long ago when I
didn't understand the build failures. Rip out all the extra "APSTUDIO"
generated stuff (is that an old Visual Studio?) and use the readable names
instead of numbers wherever possible.

For reasons I don't understand yet, this also fixed the audio problems
with the windows sound driver as well... may some graphic resource needs
to be loaded before init of sound?

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-01 18:14:55 +10:30
Kevin Shanahan
ba80171b38 server: silence warning in PM_FlyMove for !SERVERONLY case
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-01 16:19:20 +10:30
Kevin Shanahan
1ba3063a71 client: silence compiler warning in CL_PredictMove
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-01 16:18:36 +10:30
Kevin Shanahan
e136457688 vid: implement replacement video options menu
Replace the current video mode menu with one modelled after the FitzQuake
video options menu.  This changeset is far larger than I usually would
like, but I'll try to summarise the main points below:

* The recent hack for command line mode setting got replaced
* The video driver now dumps all modes into modelist and calls a sort
  function when completed. Modes are sorted by height, width, bpp and
  refresh rate (in that order).
* vid mode 0 is now the only windowed mode and we update the width/height
  when a different resolution is requested.
* vmode_t replaced with qvidmode_t and re-thought. Drivers can stuff a
  small amount of data, currently only used by the SDL driver to save the
  pixel format for each mode.
* Some old command line options removed: -allow360, -noforcevga,
  -noadjustaspect.

While everything currently compiles, unfortunately some features are
currently broken. Here is a bit of a TODO list:

* Mode testing is currently broken (was broken on SDL previously)
* Command line mode setting is inconsistent and somewhat broken
* Sound gets messed up on vid_win.c and vid_wgl.c. The workaround in
  vid_win.c seems effective there, but not in wgl, so it's probably not
  the right fix in the end.
* x11 drivers only have compatiblity glue around the new menus

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-01 14:28:58 +10:30
Kevin Shanahan
450e3d0760 server: pass client into Host_ClientCommands
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-25 08:35:00 +10:30
Kevin Shanahan
2237b21ec7 server: make QW localmodels local to sv_init.c
And make the strings automatically size for MAX_MODELS.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 09:06:49 +10:30
Kevin Shanahan
4502b06f7e server: remove host_client and sv_player from QW completely
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:48:21 +10:30
Kevin Shanahan
5af236fa2f server: host_client cleanups in SV_UpdateToReliableMessages
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:42:28 +10:30
Kevin Shanahan
f5dbf8001c server: host_client cleanups in SV_SaveSpawnparms
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:41:52 +10:30
Kevin Shanahan
b254afaf19 server: pass the client into SV_BeginRedirect for RD_CLIENT
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-23 08:38:39 +10:30
Kevin Shanahan
1cfdfd5cf0 server: cleanup SV_ExecuteClientMessage
Various local variable renames, re-arranging code with overly long
lines and getting rid of references to the global host_client and
sv_player pointers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:39:10 +10:30
Kevin Shanahan
716fe234a9 server: replace instances of sv_player in SV_Begin_f/SV_Kill_f
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:38:38 +10:30
Kevin Shanahan
a5eedded2a server: pass the client pointer into user command functions
Change the spec of user command functions to always take a pointer to
the client struct of the executing client. Gets rid of *lots* of
references to the global host_client pointer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 20:06:06 +10:30
Kevin Shanahan
93d5f53beb server: replace SV_SetPlayer with SV_GetClient and update callers
Make the callers pass in the client id number and for now get them to
also set the global host_client and sv_player variables.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 14:07:47 +10:30
Kevin Shanahan
5b5bfb347b server: make local functions/vars static in sv_ccmds.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 13:01:31 +10:30
Kevin Shanahan
c5068bf779 server: pass current player into SV_AddLinksToPhysents
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 12:50:54 +10:30
Kevin Shanahan
869ac7711a server: do recursive split of long usercmd, same as client
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 12:40:09 +10:30
Kevin Shanahan
163fafc39b pmove: use more appropriate types for pmove/pstate onground member
Make the playermove onground member a pointer to the physent - the
server wants to know which entity (edict) the player is standing
on. Make the onground member of the player_state_t a boolean, since
nobody cares what you're standing on, only if you are air/water bourne
or not (view.c).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 11:53:17 +10:30
Kevin Shanahan
bd1d35f052 pmove: store physent pointers in the touch array
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 11:19:59 +10:30
Kevin Shanahan
acefc149c2 pmove: make embedded usercmd_t a const pointer instead
The usercmd is not modified, so just make it a const pointer
instead. Probably should be passed as a separate argument instead...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-22 08:37:22 +10:30
Kevin Shanahan
b039baa5f3 pmove: update player state with proper button changes 2013-03-22 08:31:27 +10:30
Kevin Shanahan
f5882fce17 pmove: move onground, watertype/level into playermove_t
Get rid of global state and track using playermove_t. Software NQ gets
a little fix by reading the onground state from the view_message
(player_state_t) rather than the global onground value.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-21 20:27:46 +10:30