mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-17 01:11:18 +00:00
fix sin/cos table macros
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3824 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9d87fd127c
commit
c3573173ef
1 changed files with 7 additions and 7 deletions
|
@ -68,16 +68,16 @@ static int pe_size2 = P_INVALID;
|
||||||
static int pe_size3 = P_INVALID;
|
static int pe_size3 = P_INVALID;
|
||||||
static int pe_defaulttrail = P_INVALID;
|
static int pe_defaulttrail = P_INVALID;
|
||||||
|
|
||||||
static float psintable[64];
|
static float psintable[256];
|
||||||
|
|
||||||
static void buildsintable(void)
|
static void buildsintable(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 64; i++)
|
for (i = 0; i < 256; i++)
|
||||||
psintable[i] = sin((i*M_PI)/32);
|
psintable[i] = sin((i*M_PI)/128);
|
||||||
}
|
}
|
||||||
#define sin(x) (psintable[(int)(x*(64/M_PI)) & 63])
|
#define sin(x) (psintable[(int)((x)*(128/M_PI)) & 255])
|
||||||
#define cos(x) (psintable[((int)(x*(64/M_PI)) + 16) & 63])
|
#define cos(x) (psintable[((int)((x)*(128/M_PI)) + 64) & 255])
|
||||||
|
|
||||||
typedef struct particle_s
|
typedef struct particle_s
|
||||||
{
|
{
|
||||||
|
@ -3155,7 +3155,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
|
||||||
float randvelvert = ptype->randomvelvert;
|
float randvelvert = ptype->randomvelvert;
|
||||||
float step;
|
float step;
|
||||||
float stop;
|
float stop;
|
||||||
float tdegree = 2*M_PI/256; /* MSVC whine */
|
float tdegree = 2.0*M_PI/256; /* MSVC whine */
|
||||||
float sdegree = 0;
|
float sdegree = 0;
|
||||||
float nrfirst, nrlast;
|
float nrfirst, nrlast;
|
||||||
|
|
||||||
|
@ -3246,7 +3246,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
|
||||||
|
|
||||||
// precalculate degree of rotation
|
// precalculate degree of rotation
|
||||||
if (ptype->spawnparam1)
|
if (ptype->spawnparam1)
|
||||||
tdegree = 2*M_PI/ptype->spawnparam1; /* distance per rotation inversed */
|
tdegree = 2.0*M_PI/ptype->spawnparam1; /* distance per rotation inversed */
|
||||||
sdegree = ptype->spawnparam2*(M_PI/180);
|
sdegree = ptype->spawnparam2*(M_PI/180);
|
||||||
}
|
}
|
||||||
else if (ptype->spawnmode == SM_CIRCLE)
|
else if (ptype->spawnmode == SM_CIRCLE)
|
||||||
|
|
Loading…
Reference in a new issue