Commit Graph

684 Commits

Author SHA1 Message Date
Kevin Shanahan
11ca153c54 draw: remove unused zpoint interface
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 18:52:58 +10:30
Kevin Shanahan
0e6d968d82 draw: fix nonsense sentinel value on edge list
This sentinel is probably not needed, as per the comment, but I'm not familiar
enough yet to confirm. However, the value given (2000 << 24) would evaluate to
-805306368 due to the integer overflow.

The comment would indicate that the value is supposed to be large and positive
as the sorting is done in ascending ->u order. In any case the code still works
like this, but at least the sentinal value makes more sense.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 18:30:42 +10:30
Kevin Shanahan
c1984fc72f trivial: remove unused struct definition for evert_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 18:20:24 +10:30
Kevin Shanahan
77f4bb3da3 build: allow qwsv to use x86 optimised assembly routines
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 17:57:19 +10:30
Kevin Shanahan
d3c4dff990 trivial: remove unaligned defs since not used anymore
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 16:09:17 +10:30
Kevin Shanahan
7bbe82dc4c draw: make local cvars static in d_init.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 16:08:39 +10:30
Kevin Shanahan
b0fa4474bf draw: capitalise D_DrawSpans and call it like a function
Use normal function call notation in d_edge.c and capitalise it to match common
calling convention. Move the declaration next to D_DrawSpans{8,16} since those
are the two options it can point to.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 15:47:18 +10:30
Kevin Shanahan
c62496f9e8 trivial: remove 'UNUSED' macro
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 15:40:06 +10:30
Kevin Shanahan
034eeb2e0b model: move alias clipping function prototypes to header
Make R_Alias_clip_z and R_Alias_Clip static functions, but the others need to
be extern for the case where ASM is used.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 15:31:41 +10:30
Kevin Shanahan
550e188cc9 model: make a few more alias model globals local
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 15:20:27 +10:30
Kevin Shanahan
e5bf230af4 model: move global pfinalverts inside functions that need it
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 15:04:40 +10:30
Kevin Shanahan
76fadf6fe4 create helper macros for cache aligning pointers/arrays
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 14:45:31 +10:30
Kevin Shanahan
4b5c4b50a0 model: remove paliashdr global from gl_mesh.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 13:33:32 +10:30
Kevin Shanahan
9e4d726824 model: R_GetSpriteFrame becomes Mod_GetSpriteFrame
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 13:04:00 +10:30
Kevin Shanahan
8cfe7ae2bf model: make R_GetSpriteFrame consistent between sw/gl
Logic here is not renderer dependent, just picking the right frame at
the right time for the given entity. Pass in both the sprite pointer
and the current time.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 12:54:19 +10:30
Kevin Shanahan
db62dee528 build: check that the library directories exist
The build warnings on mac were annoying me. Check that the library
dir actually exists before we add it to the linker's command line.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 12:10:40 +10:30
Kevin Shanahan
abfcd14de1 model: use zero sized arrays for variable sized sprite structs
Also fixes an incorrect use of sizeof which was previously papered
over by the padded size of the struct.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 11:57:24 +10:30
Kevin Shanahan
dc561715a1 model: trivial whitespace removal
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 09:26:00 +10:30
Kevin Shanahan
c3bf4003f2 model: use the shared sprite model code in GL
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 09:25:30 +10:30
Kevin Shanahan
fcb46ae327 model: abstract renderer specific parts of sprite model loading
The differences between the software and GL renderers for sprite models boils
down to a) how much memory is allocated on the end of the mspriteframe_t struct
and b) how it processes the raw pixel data. Abstract these parts away so the
common parts can be shared.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 09:15:49 +10:30
Kevin Shanahan
357e7a35ed model: pass frame number into sprite group/frame loading functions
Not used by the software renderer, but to make the API compatible with glquake.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 08:51:55 +10:30
Kevin Shanahan
948bb57f87 model: zero spritemodel flags in gl too
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 08:49:02 +10:30
Kevin Shanahan
5b34a72066 model: pass loadname into gl version of Mod_LoadSpriteModel
Same as the software renderer's version, remove dependence on the global
loadname variable in the file.  Note this also changes the use of
loadmodel->name to loadname; doesn't really make much difference - just the
name given the the hunk allocation for the GL texture.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-14 08:47:05 +10:30
Kevin Shanahan
09d0542f3b model: remove the qwsv specific model.c file
Update comment in the Makefile - one aspect fixed... now to tackle the
duplication between model.c and gl_model.c...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 13:18:27 +10:30
Kevin Shanahan
7ff23f9704 model: hack around remaining client/server differences
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 13:14:21 +10:30
Kevin Shanahan
205bcef939 model: add leaf overflow check to QWSV
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 12:53:52 +10:30
Kevin Shanahan
e4612389d0 model: move client-only functions together
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 12:50:19 +10:30
Kevin Shanahan
24c5172ade model: fake SV_Error so we can share NQ/QWSV code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 12:48:40 +10:30
Kevin Shanahan
b1e14a37e6 model: move sprite model loading code to separate file
Moving stuff that qwsv doesn't care about out into separate compilation
units so I can look at sharing the main BSP loading code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 12:17:01 +10:30
Kevin Shanahan
cc48642b50 model: move alias model loading code to separate file
Moving stuff that qwsv doesn't care about out into separate compilation
units so I can look at sharing the main BSP loading code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 10:35:30 +10:30
Kevin Shanahan
b4989d267c zone: constify name arguments to alloc functions
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 10:33:40 +10:30
Kevin Shanahan
e74e08e909 world: move world.c to common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:27:45 +10:30
Kevin Shanahan
55d20d27b5 world: hack around remaining world.c differences
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:27:12 +10:30
Kevin Shanahan
ffd6dd4590 world: copy paranoid check into QWSV code
Update the comment while I still remember what that was (probably) about.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:17:26 +10:30
Kevin Shanahan
d33296695c world: re-order header includes for merging
Also include the correct model file for SW vs. GL.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 09:14:05 +10:30
Kevin Shanahan
79a44f2fd3 world: fake SV_Error so we can share NQ/QWSV code
Also update one error string on the QWSV side - makes all error messages
identical.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-13 08:53:04 +10:30
Kevin Shanahan
e63df56984 progs: move pr_edict.c to the common directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 16:31:21 +10:30
Kevin Shanahan
4afe9347b6 progs: hack around the remaining differences in pr_edict.c
PR_LoadProgs got a bit messy, but there's still plenty of common code to
make this worthwhile.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 16:30:01 +10:30
Kevin Shanahan
c139514d85 progs: carry over NQ fix for keynames with trailing spaces
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:51:05 +10:30
Kevin Shanahan
c41d98ca6e progs: fix arg check in ED_PrintEdict_f
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:48:15 +10:30
Kevin Shanahan
2e5c67ec08 progs: reorder some declarations
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:37:58 +10:30
Kevin Shanahan
c0d8595212 progs: cleanup QWSV edict print debug code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:36:42 +10:30
Kevin Shanahan
3bf5cb3661 progs: fake SV_Error so we can share NQ/QWSV code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:30:27 +10:30
Kevin Shanahan
8667c0e907 progs: reorder includes in pr_edict.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:29:23 +10:30
Kevin Shanahan
6158521300 progs: normalise error strings in pr_edict.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:10:12 +10:30
Kevin Shanahan
02795c7686 progs: update an old comment about type_size
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 14:02:17 +10:30
Kevin Shanahan
6fc65c506e progs: NUM_FOR_EDICT's argument can be const
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 13:58:32 +10:30
Kevin Shanahan
49ffa951e0 world: remove some #if 0'd debugging code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 12:00:11 +10:30
Kevin Shanahan
b29d95b927 world: check for overflow of sv_areanodes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:51:45 +10:30
Kevin Shanahan
8585d004ad world: move world.h to shared include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 11:46:38 +10:30