Commit Graph

15 Commits

Author SHA1 Message Date
Ozkan Sezer c5a45e7e58 move DEG2RAD macro to mathlib.h.
From a patch by Andrei Drexler
2022-03-11 23:55:10 +03:00
Ozkan Sezer d5e9d1270c more parentheses around vector macro arguments. 2021-12-04 11:11:10 +03:00
Andrei Drexler 9c78f028f6 Add parentheses around vector macro arguments
(taken from quakespasm-gl4 fork.)
2021-12-04 11:11:10 +03:00
Eric Wasylishen ebd73d2a3c world.c: use DoublePrecisionDotProduct to fix items falling out of the world
on oms3.bsp on SSE builds.

Thanks to ParuBaru for reporting the issue.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1289 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-01 22:41:15 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Ozkan Sezer 8d997767e7 * mathlib.h (IS_NAN): Fixed strict aliasing violation by providing
an inline function using a float/int union instead of the original
  macro.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@650 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-03-24 06:24:56 +00:00
Ozkan Sezer 945262b863 min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
Ozkan Sezer 3a6e17e627 added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
Ozkan Sezer 2fc9631eff mathlib.h, mathlib.c: changed nanmask from being a global to being
a macro.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@275 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:10:20 +00:00
Ozkan Sezer a7d57b4b51 * 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-01 19:22:46 +00:00
Ozkan Sezer 12e4aa6caa mathlib.h (max, min): The min and max were declared as inline but
were never defined. Moved them from mathlib.c to here as static
inline functions q_min and q_max. Define min and max as q_min and
q_max.
mathlib.c (max, min): Moved to mathlib.h as q_max and q_min static
inlines.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@175 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 10:56:27 +00:00
Ozkan Sezer 04f7b1589a mathlib.h (VectorNormalizeFast): Use a float/int union instead of type
punning to avoid strict aliasing violations. the compiler used to emit
a warning from rsprite.c:R_DrawSpriteModel() where the macro is used.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@153 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 14:11:48 +00:00
Ozkan Sezer 16b9fd13ea bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
Ozkan Sezer 9e861e3102 64 bit compatibility effort, 1/nn: type correctness work in common.c,
common.h, gl_vidsdl.c, mathlib.h, zone.c, zone.h. added Z_Realloc as a
new function (will be used later.) next step will be type correctness
work in opengl stuff.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@33 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 21:22:20 +00:00
Ozkan Sezer db613ab35d initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00