mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
SW: Revert the changes from JFSW commit 7d0deafe81b0ffa30d77cfe242e454f8b4487a1f
related to the definitions of RANDOM_NEG in bunny.cpp, ripper.cpp and ripper2.cpp. Do so in a way that isn't re-introducing compiler warnings. This partially fixes compatibility with demos made for SW 1.2. Additionally, replace the 3 separate definitions of RANDOM_NEG with a common one within game.h. From-SVN: r8798
This commit is contained in:
parent
00daf6295e
commit
c32a8cab29
4 changed files with 15 additions and 13 deletions
|
@ -860,16 +860,13 @@ DoBunnyBeginJumpAttack(short SpriteNum)
|
|||
int CanSeePlayer(short SpriteNum);
|
||||
short tang;
|
||||
|
||||
|
||||
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
|
||||
|
||||
tang = getangle(psp->x - sp->x, psp->y - sp->y);
|
||||
|
||||
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
|
||||
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
|
||||
sp->ang = NORM_ANGLE(sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6);
|
||||
sp->ang = NORM_ANGLE(sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6);
|
||||
else
|
||||
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
|
||||
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
|
||||
|
||||
DoActorSetSpeed(SpriteNum, FAST_SPEED);
|
||||
|
||||
|
|
|
@ -452,6 +452,15 @@ int StdRandomRange(int range);
|
|||
#define STD_RANDOM_RANGE(range) (StdRandomRange(range))
|
||||
#define STD_RANDOM() (rand())
|
||||
|
||||
#if 0
|
||||
// TODO: PedanticMode
|
||||
#define RANDOM_NEG(x,y) (PedanticMode \
|
||||
? ((RANDOM_P2(((x)<<(y))<<1) - (x))<<(y)) \
|
||||
: (RANDOM_P2(((x)<<(y))<<1) - ((x) <<(y))))
|
||||
#else
|
||||
#define RANDOM_NEG(x,y) ((RANDOM_P2(((x)<<(y))<<1) - (x))<<(y))
|
||||
#endif
|
||||
|
||||
#define MOVEx(vel,ang) (((int)(vel) * (int)sintable[NORM_ANGLE((ang) + 512)]) >> 14)
|
||||
#define MOVEy(vel,ang) (((int)(vel) * (int)sintable[NORM_ANGLE((ang))]) >> 14)
|
||||
|
||||
|
|
|
@ -1094,15 +1094,13 @@ DoRipperBeginJumpAttack(short SpriteNum)
|
|||
int CanSeePlayer(short SpriteNum);
|
||||
short tang;
|
||||
|
||||
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
|
||||
|
||||
tang = getangle(psp->x - sp->x, psp->y - sp->y);
|
||||
|
||||
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
|
||||
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
|
||||
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6));
|
||||
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6));
|
||||
else
|
||||
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
|
||||
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
|
||||
|
||||
DoActorSetSpeed(SpriteNum, FAST_SPEED);
|
||||
|
||||
|
|
|
@ -1101,8 +1101,6 @@ DoRipper2BeginJumpAttack(short SpriteNum)
|
|||
int CanSeePlayer(short SpriteNum);
|
||||
short tang;
|
||||
|
||||
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
|
||||
|
||||
tang = getangle(psp->x - sp->x, psp->y - sp->y);
|
||||
|
||||
// Always jump at player if mad.
|
||||
|
@ -1110,10 +1108,10 @@ DoRipper2BeginJumpAttack(short SpriteNum)
|
|||
//{
|
||||
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
|
||||
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
|
||||
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6));
|
||||
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6));
|
||||
else
|
||||
sp->ang = NORM_ANGLE(tang);
|
||||
// sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
|
||||
// sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
|
||||
//} else
|
||||
// sp->ang = NORM_ANGLE(tang);
|
||||
|
||||
|
|
Loading…
Reference in a new issue