Commit Graph

139 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Kevin Shanahan
db9f66ed5b progs: merge progs.h headers and move to include dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 09:22:48 +10:30
Kevin Shanahan
d269f32cc6 progs: merge progdefs.h header and move to include directory
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-12 09:13:27 +10:30
Kevin Shanahan
726e4365c1 fix strict aliasing issue with mathlib.h IS_NAN() macro
I assume the memcpy will be nicely optimised away, but not really critical
anyway.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-02 18:40:42 +10:30
Kevin Shanahan
6cb119d17d model: roll maliasgroupframedesc_t into maliasgroup_t
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 17:22:26 +10:30
Kevin Shanahan
dbb0437a14 model: remove never referenced bbox data from aliasgroup frames
No need to keep a copy of the bbox info for every aliasgroup frame as it
is never referenced by the engine.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 16:52:38 +10:30
Kevin Shanahan
e88216be62 model: remove unused structures from gl_model.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 16:41:56 +10:30
Kevin Shanahan
d5d9c82ced model: make intervals part of daliasgroup_t struct
The frame intervals always follow the daliasgroup_t structure on disk, so
attach them to the structure as a variable sized array. Pass the correct
types in to Mod_LoadAliasGroup and avoid passing around (void *) pointers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 13:37:03 +10:30
Kevin Shanahan
f1ac2404a2 model: constify Mod_LoadAliasFrame input argument
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 11:10:21 +10:30
Kevin Shanahan
7169309cc2 model: make verticies part of daliasframe_t struct
Verticies always follow the daliasframe_t structure on disk, so attach
them to the structure as a variable sized array. Pass the correct types in
to Mod_LoadAliasFrame and avoid passing around (void *) pointers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 11:05:32 +10:30
Kevin Shanahan
ff39b5fe78 trivial: modelgen.h whitespace cleanup
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 10:13:41 +10:30
Kevin Shanahan
3c3bada1c3 trivial: re-order defintions in model.h to match gl_model.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 10:13:05 +10:30
Kevin Shanahan
079b86b228 model: use zero sized arrays for variable sized structs
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 08:01:49 +10:30
Kevin Shanahan
6fab3eb423 model: merge modelgen.h files and fix #include fallout
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 16:47:27 +10:30
Kevin Shanahan
30711a9657 model: use floats to store node/leaf bounding boxes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 14:09:19 +10:30
Kevin Shanahan
7adfaad559 model: remove unused mspriteframe_t member pcachespot
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 14:07:41 +10:30
Kevin Shanahan
83ea48f941 model: re-order sw msurface_t members more like gl
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 14:05:56 +10:30
Kevin Shanahan
d8885d88ba model: pass poseverts down to GL_MakeAliasModelDisplayLists
Make globals "poseverts" and "posenum" local to gl_model.c

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:44:47 +10:30
Kevin Shanahan
2abce220c1 model: pass tris and verts down to GL_MakeAliasModelDisplayLists
Make globals "triangles" and "stverts" local to gl_model.c

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:32:18 +10:30
Kevin Shanahan
77f2154ece gl: expose gl_subdivide_size in glquake.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:05:10 +10:30
Kevin Shanahan
41b71e27a5 model: pass loadmodel down into GL_SubdivideSurface
Last external user of loadmodel, so can mark it static

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 11:59:02 +10:30
Kevin Shanahan
845f993b2b sys: remove now unused Sys_File* functions
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 07:34:14 +10:30
Kevin Shanahan
9ac39cae20 build: make use of xf86dga optional for x11
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 20:53:56 +10:30
Kevin Shanahan
23331b9456 console: Add argument completion support for cvars
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-24 18:50:38 +10:30
Kevin Shanahan
d2c2c6059c Implement a type-checking clamp macro
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-23 14:27:57 +10:30
Kevin Shanahan
a3892ec40d render: Remove global currententity
Finally we can see that currententity is only ever written and not
read so it is safe to remove.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 13:40:58 +10:30
Kevin Shanahan
ca73186348 render: pass currententity down to R_DrawSprite
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 12:24:43 +10:30
Kevin Shanahan
c7c7061c26 render: pass currententity down to R_RenderBrushPoly
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 12:00:57 +10:30
Kevin Shanahan
a3417f1295 render: pass currententity down to R_DrawSubmodelPolygons
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:47:24 +10:30
Kevin Shanahan
e828ea33e1 render: pass currententity down to R_DrawSolidClippedSubmodelPolygons
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:44:21 +10:30
Kevin Shanahan
103c394fb6 render: pass currententity down to R_RotateBmodel
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:36:29 +10:30
Kevin Shanahan
dd796af5e4 render: pass currententity down to R_ZDrawSubmodelPolys
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:31:58 +10:30
Kevin Shanahan
ac32c7c3f2 render: pass currententity down to R_RenderPoly
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:25:43 +10:30
Kevin Shanahan
ab23ab9ad8 render: pass currententity down to R_RenderBmodelFace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:18:47 +10:30
Kevin Shanahan
4fe87926ef render: pass currententity down to R_RenderFace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 11:14:17 +10:30
Kevin Shanahan
3f159b8285 render: pass currententity down to D_CacheSurface
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 10:57:06 +10:30
Kevin Shanahan
f22338ea60 render: pass currententity down to R_AliasDrawModel
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 10:33:22 +10:30