Commit Graph

1585 Commits

Author SHA1 Message Date
Kevin Shanahan
899ef775bb Merge branch 'master' of git://disenchant.net/tyrquake 2013-10-03 08:03:22 +09:30
Kevin Shanahan
f44e7bb120 changelog: amend entry for bsp2 support to show both bsp2 and 2psb supported
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:56:11 +09:30
Kevin Shanahan
eb1f83d4f8 model: factor out common code from leaf loading functions
GL and/or QW specific hacks to do with setting surface flags for water
warping.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 19:46:34 +09:30
Kevin Shanahan
c3a360096a model: use a common function to load bsp lumps which are simple byte streams
Takes care of lighting, visibility and entities using common code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 19:45:12 +09:30
Kevin Shanahan
ffbc721202 model: don't load an extra edge in Mod_LoadEdges_*
Probably this was added previously due to confusion with edge index
being +1 (no edge 0) but lump->size / sizeof(edge_t) is the correct
number to load.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 13:57:14 +09:30
Kevin Shanahan
f5b93ea06d model: support two types of BSP2 models
Turns out there are two types of "BSP2" format - one that I think was
created by MH and implemented in the RMQ project (this is the one I
implemented previously) and one by LordHavoc which exteneded the
coordinate limits beyond 32k, implemented in Darkplaces.  The
Darkplaces version of BSP2 will get the name BSP2 and the RMQ version,
which is more limited, will get the name BSP2rmq.

Fairly naive implementation which duplicates a bunch of code.  Can be
refactored and tidied up more later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 11:17:45 +09:30
Kevin Shanahan
c927c6e9a6 build: use single call to wildcard for depfiles
Provides a modest speedup on Windows, where this operation is ridiculously
slow.  Reduces time for simple "make" with no rebuilds necessary from ~23s
to ~18s on my test system.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-06 16:26:48 +09:30
Kevin Shanahan
4d46bf3797 cdaudio: document the cd audio console commands
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-03 11:37:01 +09:30
Kevin Shanahan
6ea7f4bb29 input: document mlook and m_freelook
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-01 10:05:08 +09:30
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
5d841e3670 common: add -quoth command line support
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-21 20:28:52 +09:30
Kevin Shanahan
84f68eece3 common: remove MAX_FILES_IN_PACK limit
...and save a bunch of stack space in the process.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 19:00:41 +09:30
Kevin Shanahan
1dce95b477 gl: use a glmode pointer to keep texture mode state
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 15:32:46 +09:30
Kevin Shanahan
3fe645aab6 draw: free cachepics after loading gl texture
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 10:44:26 +09:30
Kevin Shanahan
da3b609e95 draw: constify the gl dot texture data
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 10:35:45 +09:30
Kevin Shanahan
ea13f9928c draw: size the translate pic buffer correctly
The multiplayer translate pic needs to be a particular size, so test for
that and just allocate the appropriate sized buffer.  There are better
ways to handle this, but this is still better than crashing on a bad pic.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 10:33:26 +09:30
Kevin Shanahan
84494d3592 trivial: comment & variable name changes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-19 10:19:41 +09:30
Kevin Shanahan
3263ef3c2f trivial: whitespace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 11:03:57 +09:30
Kevin Shanahan
89d2a57762 vid: don't set alpha in the gl palette
Handle this during the texture conversions explicitly - it is actually
valid to make use of this colour in normal textures.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 10:49:56 +09:30
Kevin Shanahan
a38d0d4c68 vid: get rid of the win32 window_rect in vid_sdl
Was for compatibility with vid_sdl + in_win, but not worth supporting that
configuration I think.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 10:48:28 +09:30
Kevin Shanahan
fdfb4fbd9c qpic: fix alpha colors again after doing mipmap reduction
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 09:16:54 +09:30
Kevin Shanahan
65a03192ae qpic: remove alpha member from qpic8_t
After realising that we have different alpha channels on different qpics,
it didn't really make sense to have a simple boolean for alpha and then it
didn't really fit into qpic8_t any more.

Specify the alpha channel (if any) at upload/conversion time instead.

Fixes sky alpha and removes the charset hack converting all zero indicies
to 255 in the glquake case (maybe someone wants to use the 255 pink in
their charset?)

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 09:13:10 +09:30
Kevin Shanahan
c57e45e261 draw: use stdint types
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-18 09:11:35 +09:30
Kevin Shanahan
2c17b77b27 sky: use stdint types and trivial comment tidy up
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-17 20:10:46 +09:30
Kevin Shanahan
8fa770b1f2 gl: move gl texture functions from gl_draw.c to new file
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-17 19:43:56 +09:30
Kevin Shanahan
2873f2b68a draw: rename gl charset and crosshair texture variables
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-15 14:29:42 +09:30
Kevin Shanahan
2df29af642 vid: recalc refdef after mode change on sdl
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-15 08:02:46 +09:30
Kevin Shanahan
edff70049c draw: constify Draw_CachePic and Draw_PicFromWad returns
Fix missing include of draw.h in gl_draw.c and various const
correctness issues.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 15:39:51 +09:30
Kevin Shanahan
c8f7f3e261 qpic: constify qpic8_t pixels pointer
Generally we don't want to be modifying the texture data, so this
seems like a sensible precaution to help prevent unintended
modifications.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 15:29:22 +09:30
Kevin Shanahan
eedc9aacf4 draw: don't redraw the version into conback every frame
Didn't realise this was happening, but in the software renderer, we
were re-drawing the version number into the console every time we
rendered the console.  Split up the caching function so that we cache
this work.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 15:27:58 +09:30
Kevin Shanahan
f7b897af99 qpic: make GL_LoadTexture take a qpic8
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 14:37:41 +09:30
Kevin Shanahan
4b95f0de20 qpic: pass in a qpic8_t to QPic_8to32
GL_Upload8 also takes the pic8_t directly now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-14 14:19:31 +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
c6bc10afd4 qpic: complete the renaming by moving the file names
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-13 20:46:32 +09:30
Kevin Shanahan
fef9480aa3 textures: rename qtexture32_t to qpic32_t
Fickle man that I am, I decided now that qtexture32 is a poor naming
choice and I'd rather stick with calling these 'pics'. Will have to
rename the files now as well I guess.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-13 20:43:51 +09:30
Kevin Shanahan
d9400af1ae wad: trivial rename dpic_t dpic8_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-13 20:21:56 +09:30
Kevin Shanahan
2cea53a9e4 textures: add missing stdint include to textures.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-12 13:09:38 +09:30
Kevin Shanahan
f539a0b412 textures: fix incorrect NPoT extension string
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-12 13:08:44 +09:30
Kevin Shanahan
b11b840f54 zone: add Cache_CheckLinks for debugging cache memory trashing
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-12 08:49:16 +09:30
Kevin Shanahan
84697dd12e zone: re-work error message for Hunk_Alloc failure
Now that we take consistent command line parameters across platforms,
remove the _WIN32 ifdef.  Try to give a sensible suggestion for increasing
the memory size instead of just saying 'try 16MB' - since the default is
128MB anyway!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-12 08:42:04 +09:30
Kevin Shanahan
693b7530b1 server: fix incorrect pr_strings usage on weaponmodel
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-11 11:18:05 +09:30
Kevin Shanahan
6dd9c848e9 textures: remove old sky alpha blending hack
Use the proper edge alpha fix now built into the 8to32 function.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-05 21:29:24 +09:30
Kevin Shanahan
ed7ba0501e textures: implement blending fix for alpha mask textures
set the colour channels of fully transparent pixels on 32-bit textures to
the average of their non-transparent neighbours, to avoid artifacts when
blending (or creating mipmaps, etc.)

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-05 21:27:50 +09:30
Kevin Shanahan
daafa9200b textures: check for npot extension and use if available
Created the gl_extensions.c file to pull some of the common stuff into
where appropriate.  Non-power of two textures will be allowed by default,
with the option to go back to old behaviour by setting command line option
"-nonpot" or cvar 'gl_npot 0'.  The cvar is a bit of a hack, as existing
textures won't be reloaded at this stage.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-05 20:12:41 +09:30
Kevin Shanahan
c723ebda22 textures: introduce new mipmap code
New mipmap code handles odd textures sizes so that we can start using NPoT
textures where the hardware supports it.  We've also removed some texture
size limitations - the new code is only limited by the available space on
the hunk.

We're still unconditionally stretching to power of two, so this doesn't do
anything noticable yet.  One thing this fixes is generating the lowest
level mipmaps where the texture is only one-pixel wide or tall - the old
code didn't handle this special case properly.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-05 17:39:13 +09:30
Kevin Shanahan
63ad422df3 zone: add missing include for use of size_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-05 17:36:57 +09:30
Kevin Shanahan
e21f7269bc draw: separate on-disk dpic_t type from in-memory qpic_t
Mainly because taking the address of the data pointer and casting to
byte * is something easily confused.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-03 07:06:07 +09:30
Kevin Shanahan
864a032c3b common: fix const_container_of macro for older gcc
Fixes warnings with Apple's gcc 4.0.1 on OS X 10.5.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-02 20:09:32 +09:30