mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'public_flatsprite' of git@git.magicalgirl.moe:STJr/SRB2.git
# Conflicts: # src/hardware/hw_main.c
This commit is contained in:
commit
f1a4042d55
2 changed files with 30 additions and 24 deletions
|
|
@ -68,7 +68,6 @@ typedef struct gr_vissprite_s
|
||||||
struct gr_vissprite_s *prev;
|
struct gr_vissprite_s *prev;
|
||||||
struct gr_vissprite_s *next;
|
struct gr_vissprite_s *next;
|
||||||
float x1, x2;
|
float x1, x2;
|
||||||
float z1, z2;
|
|
||||||
float tz, ty;
|
float tz, ty;
|
||||||
lumpnum_t patchlumpnum;
|
lumpnum_t patchlumpnum;
|
||||||
boolean flip;
|
boolean flip;
|
||||||
|
|
@ -79,6 +78,7 @@ typedef struct gr_vissprite_s
|
||||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||||
UINT8 *colormap;
|
UINT8 *colormap;
|
||||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||||
|
float z1, z2;
|
||||||
} gr_vissprite_t;
|
} gr_vissprite_t;
|
||||||
|
|
||||||
// --------
|
// --------
|
||||||
|
|
|
||||||
|
|
@ -5190,7 +5190,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
float tr_x, tr_y;
|
float tr_x, tr_y;
|
||||||
float tz;
|
float tz;
|
||||||
float x1, x2;
|
float x1, x2;
|
||||||
float z1, z2;
|
|
||||||
float rightsin, rightcos;
|
float rightsin, rightcos;
|
||||||
float this_scale;
|
float this_scale;
|
||||||
float gz, gzt;
|
float gz, gzt;
|
||||||
|
|
@ -5202,7 +5201,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
angle_t ang;
|
angle_t ang;
|
||||||
INT32 heightsec, phs;
|
INT32 heightsec, phs;
|
||||||
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||||
float ang_scale = 1.0f, ang_scalez = 0.0f;
|
float z1, z2;
|
||||||
|
|
||||||
if (!thing)
|
if (!thing)
|
||||||
return;
|
return;
|
||||||
|
|
@ -5257,25 +5256,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (papersprite)
|
if (sprframe->rotate != SRF_SINGLE)
|
||||||
{
|
|
||||||
// Use the actual view angle, rather than the angle formed
|
|
||||||
// between the view point and the thing
|
|
||||||
// this makes sure paper sprites always appear at the right angle!
|
|
||||||
// Note: DO NOT do this in software mode version, it actually
|
|
||||||
// makes papersprites look WORSE there (I know, I've tried)
|
|
||||||
// Monster Iestyn - 13/05/17
|
|
||||||
ang = dup_viewangle - thing->angle;
|
|
||||||
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
|
||||||
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
|
||||||
|
|
||||||
if (ang_scale < 0)
|
|
||||||
{
|
|
||||||
ang_scale = -ang_scale;
|
|
||||||
ang_scalez = -ang_scalez;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (sprframe->rotate != SRF_SINGLE)
|
|
||||||
{
|
{
|
||||||
if (thing->player)
|
if (thing->player)
|
||||||
ang = R_PointToAngle (thing->x, thing->y) - thing->player->frameangle;
|
ang = R_PointToAngle (thing->x, thing->y) - thing->player->frameangle;
|
||||||
|
|
@ -5289,6 +5270,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
rot = 0; //Fab: for vis->patch below
|
rot = 0; //Fab: for vis->patch below
|
||||||
lumpoff = sprframe->lumpid[0]; //Fab: see note above
|
lumpoff = sprframe->lumpid[0]; //Fab: see note above
|
||||||
flip = sprframe->flip; // Will only be 0x00 or 0xFF
|
flip = sprframe->flip; // Will only be 0x00 or 0xFF
|
||||||
|
|
||||||
|
if (papersprite && (R_PointToAngle (thing->x, thing->y) - thing->angle < ANGLE_180))
|
||||||
|
{
|
||||||
|
if (flip)
|
||||||
|
flip = 0;
|
||||||
|
else
|
||||||
|
flip = 255;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -5308,8 +5297,25 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||||
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)thing->skin)->highresscale);
|
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)thing->skin)->highresscale);
|
||||||
|
|
||||||
rightsin = FIXED_TO_FLOAT(FINESINE((viewangle + ANGLE_90)>>ANGLETOFINESHIFT));
|
if (papersprite)
|
||||||
rightcos = FIXED_TO_FLOAT(FINECOSINE((viewangle + ANGLE_90)>>ANGLETOFINESHIFT));
|
{
|
||||||
|
if (flip && sprframe->rotate != SRF_SINGLE)
|
||||||
|
{
|
||||||
|
rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle+ANGLE_180)>>ANGLETOFINESHIFT));
|
||||||
|
rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle+ANGLE_180)>>ANGLETOFINESHIFT));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle)>>ANGLETOFINESHIFT));
|
||||||
|
rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle)>>ANGLETOFINESHIFT));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rightsin = FIXED_TO_FLOAT(FINESINE((viewangle + ANGLE_90)>>ANGLETOFINESHIFT));
|
||||||
|
rightcos = FIXED_TO_FLOAT(FINECOSINE((viewangle + ANGLE_90)>>ANGLETOFINESHIFT));
|
||||||
|
}
|
||||||
|
|
||||||
if (flip)
|
if (flip)
|
||||||
{
|
{
|
||||||
x1 = (FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale);
|
x1 = (FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue