mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-21 11:01:36 +00:00
- make weapon sprite offsets floats.
This commit is contained in:
parent
1ff4bb419c
commit
2d2eeb49f0
9 changed files with 23 additions and 25 deletions
|
@ -125,8 +125,7 @@ void P_UpdateBeak (AActor *self)
|
||||||
{
|
{
|
||||||
if (self->player != NULL)
|
if (self->player != NULL)
|
||||||
{
|
{
|
||||||
self->player->psprites[ps_weapon].sy = WEAPONTOP +
|
self->player->psprites[ps_weapon].sy = WEAPONTOP + self->player->chickenPeck / 2;
|
||||||
(self->player->chickenPeck << (FRACBITS-1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
|
||||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2) * FRACUNIT;
|
player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2);
|
||||||
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3) * FRACUNIT;
|
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3);
|
||||||
Angle = self->Angles.Yaw;
|
Angle = self->Angles.Yaw;
|
||||||
if (power)
|
if (power)
|
||||||
{
|
{
|
||||||
|
@ -441,8 +441,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
|
||||||
if (!weapon->DepleteAmmo(weapon->bAltFire))
|
if (!weapon->DepleteAmmo(weapon->bAltFire))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
player->psprites[ps_weapon].sx = ((pr_maceatk() & 3) - 2)*FRACUNIT;
|
player->psprites[ps_weapon].sx = ((pr_maceatk() & 3) - 2);
|
||||||
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_maceatk() & 3)*FRACUNIT;
|
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_maceatk() & 3);
|
||||||
ball = P_SpawnPlayerMissile(self, PClass::FindActor("MaceFX1"), self->Angles.Yaw + (((pr_maceatk() & 7) - 4) * (360. / 256)));
|
ball = P_SpawnPlayerMissile(self, PClass::FindActor("MaceFX1"), self->Angles.Yaw + (((pr_maceatk() & 7) - 4) * (360. / 256)));
|
||||||
if (ball)
|
if (ball)
|
||||||
{
|
{
|
||||||
|
@ -1065,7 +1065,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (self->bouncecount >= 0 && (unsigned)self->bouncecount < self->Sector->e->XFloor.ffloors.Size())
|
if (self->bouncecount >= 0 && (unsigned)self->bouncecount < self->Sector->e->XFloor.ffloors.Size())
|
||||||
pos.Z = self->Sector->e->XFloor.ffloors[self->bouncecount]->bottom.plane->ZatPointF(mo);// - 40 * FRACUNIT;
|
pos.Z = self->Sector->e->XFloor.ffloors[self->bouncecount]->bottom.plane->ZatPointF(mo);
|
||||||
else
|
else
|
||||||
pos.Z = self->Sector->ceilingplane.ZatPointF(mo);
|
pos.Z = self->Sector->ceilingplane.ZatPointF(mo);
|
||||||
int moceiling = P_Find3DFloor(NULL, pos, false, false, pos.Z);
|
int moceiling = P_Find3DFloor(NULL, pos, false, false, pos.Z);
|
||||||
|
|
|
@ -73,7 +73,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
|
||||||
int randAttack;
|
int randAttack;
|
||||||
static const int atkResolve1[] = { 50, 150 };
|
static const int atkResolve1[] = { 50, 150 };
|
||||||
static const int atkResolve2[] = { 150, 200 };
|
static const int atkResolve2[] = { 150, 200 };
|
||||||
int dist;
|
|
||||||
|
|
||||||
// Ice ball (close 20% : far 60%)
|
// Ice ball (close 20% : far 60%)
|
||||||
// Fire column (close 40% : far 20%)
|
// Fire column (close 40% : far 20%)
|
||||||
|
@ -93,7 +92,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
|
||||||
P_TraceBleed (newdam > 0 ? newdam : damage, target, self);
|
P_TraceBleed (newdam > 0 ? newdam : damage, target, self);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
dist = self->AproxDistance (target) > 8*64*FRACUNIT;
|
int dist = self->Distance2D(target) > 8 * 64;
|
||||||
randAttack = pr_atk ();
|
randAttack = pr_atk ();
|
||||||
if (randAttack < atkResolve1[dist])
|
if (randAttack < atkResolve1[dist])
|
||||||
{ // Ice ball
|
{ // Ice ball
|
||||||
|
|
|
@ -1316,10 +1316,10 @@ void APowerTargeter::InitEffect ()
|
||||||
P_SetPsprite (player, ps_targetright, state + 2);
|
P_SetPsprite (player, ps_targetright, state + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->psprites[ps_targetcenter].sx = (160-3)*FRACUNIT;
|
player->psprites[ps_targetcenter].sx = (160-3);
|
||||||
player->psprites[ps_targetcenter].sy =
|
player->psprites[ps_targetcenter].sy =
|
||||||
player->psprites[ps_targetleft].sy =
|
player->psprites[ps_targetleft].sy =
|
||||||
player->psprites[ps_targetright].sy = (100-3)*FRACUNIT;
|
player->psprites[ps_targetright].sy = (100-3);
|
||||||
PositionAccuracy ();
|
PositionAccuracy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1382,8 +1382,8 @@ void APowerTargeter::PositionAccuracy ()
|
||||||
|
|
||||||
if (player != NULL)
|
if (player != NULL)
|
||||||
{
|
{
|
||||||
player->psprites[ps_targetleft].sx = (160-3)*FRACUNIT - ((100 - player->mo->accuracy) << FRACBITS);
|
player->psprites[ps_targetleft].sx = (160-3) - ((100 - player->mo->accuracy));
|
||||||
player->psprites[ps_targetright].sx = (160-3)*FRACUNIT + ((100 - player->mo->accuracy) << FRACBITS);
|
player->psprites[ps_targetright].sx = (160-3)+ ((100 - player->mo->accuracy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower)
|
||||||
if (self->player != NULL)
|
if (self->player != NULL)
|
||||||
{
|
{
|
||||||
pspdef_t *psp = &self->player->psprites[ps_weapon];
|
pspdef_t *psp = &self->player->psprites[ps_weapon];
|
||||||
psp->sy += FRACUNIT*9;
|
psp->sy += 9;
|
||||||
if (psp->sy > WEAPONBOTTOM*2)
|
if (psp->sy > WEAPONBOTTOM*2)
|
||||||
{
|
{
|
||||||
P_SetPsprite (self->player, ps_weapon, NULL);
|
P_SetPsprite (self->player, ps_weapon, NULL);
|
||||||
|
|
|
@ -500,8 +500,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
|
||||||
|
|
||||||
if (self->player != NULL)
|
if (self->player != NULL)
|
||||||
{
|
{
|
||||||
self->player->psprites[ps_weapon].sx += pr_mauler2.Random2() << 10;
|
self->player->psprites[ps_weapon].sx += pr_mauler2.Random2() / 64.;
|
||||||
self->player->psprites[ps_weapon].sy += pr_mauler2.Random2() << 10;
|
self->player->psprites[ps_weapon].sy += pr_mauler2.Random2() / 64.;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
// MACROS ------------------------------------------------------------------
|
// MACROS ------------------------------------------------------------------
|
||||||
|
|
||||||
#define LOWERSPEED FRACUNIT*6
|
#define LOWERSPEED 6.
|
||||||
#define RAISESPEED FRACUNIT*6
|
#define RAISESPEED 6.
|
||||||
|
|
||||||
// TYPES -------------------------------------------------------------------
|
// TYPES -------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -169,11 +169,11 @@ void P_SetPsprite (player_t *player, int position, FState *state, bool nofunctio
|
||||||
|
|
||||||
if (state->GetMisc1())
|
if (state->GetMisc1())
|
||||||
{ // Set coordinates.
|
{ // Set coordinates.
|
||||||
psp->sx = state->GetMisc1()<<FRACBITS;
|
psp->sx = state->GetMisc1();
|
||||||
}
|
}
|
||||||
if (state->GetMisc2())
|
if (state->GetMisc2())
|
||||||
{
|
{
|
||||||
psp->sy = state->GetMisc2()<<FRACBITS;
|
psp->sy = state->GetMisc2();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nofunction && player->mo != NULL)
|
if (!nofunction && player->mo != NULL)
|
||||||
|
|
|
@ -28,12 +28,12 @@
|
||||||
#include "tables.h"
|
#include "tables.h"
|
||||||
#include "thingdef/thingdef.h"
|
#include "thingdef/thingdef.h"
|
||||||
|
|
||||||
#define WEAPONBOTTOM 128*FRACUNIT
|
#define WEAPONBOTTOM 128.
|
||||||
|
|
||||||
// [RH] +0x6000 helps it meet the screen bottom
|
// [RH] +0x6000 helps it meet the screen bottom
|
||||||
// at higher resolutions while still being in
|
// at higher resolutions while still being in
|
||||||
// the right spot at 320x200.
|
// the right spot at 320x200.
|
||||||
#define WEAPONTOP (32*FRACUNIT+0x6000)
|
#define WEAPONTOP (32+6./16)
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -66,8 +66,8 @@ struct pspdef_t
|
||||||
{
|
{
|
||||||
FState* state; // a NULL state means not active
|
FState* state; // a NULL state means not active
|
||||||
int tics;
|
int tics;
|
||||||
fixed_t sx;
|
double sx;
|
||||||
fixed_t sy;
|
double sy;
|
||||||
int sprite;
|
int sprite;
|
||||||
int frame;
|
int frame;
|
||||||
bool processPending; // true: waiting for periodic processing on this tick
|
bool processPending; // true: waiting for periodic processing on this tick
|
||||||
|
|
|
@ -1590,7 +1590,7 @@ void R_DrawPlayerSprites ()
|
||||||
// [RH] Don't draw the targeter's crosshair if the player already has a crosshair set.
|
// [RH] Don't draw the targeter's crosshair if the player already has a crosshair set.
|
||||||
if (psp->state && (i != ps_targetcenter || CrosshairImage == NULL))
|
if (psp->state && (i != ps_targetcenter || CrosshairImage == NULL))
|
||||||
{
|
{
|
||||||
R_DrawPSprite (psp, i, camera, psp->sx + ofsx, psp->sy + ofsy);
|
R_DrawPSprite (psp, i, camera, FLOAT2FIXED(psp->sx) + ofsx, FLOAT2FIXED(psp->sy) + ofsy);
|
||||||
}
|
}
|
||||||
// [RH] Don't bob the targeter.
|
// [RH] Don't bob the targeter.
|
||||||
if (i == ps_flash)
|
if (i == ps_flash)
|
||||||
|
|
Loading…
Reference in a new issue