Makes it to kart files

This commit is contained in:
Sally Coolatta 2021-03-01 01:02:23 -05:00
parent 4139e67ddb
commit 885b7673eb
4 changed files with 25 additions and 27 deletions

View file

@ -39,6 +39,7 @@ patch_t *Patch_GetRotatedSprite(
boolean flip, boolean adjustfeet, boolean flip, boolean adjustfeet,
void *info, INT32 rotationangle); void *info, INT32 rotationangle);
INT32 R_GetRollAngle(angle_t rollangle); INT32 R_GetRollAngle(angle_t rollangle);
angle_t R_SpriteRotationAngle(mobj_t *mobj);
#endif #endif
#endif // __R_PATCH__ #endif // __R_PATCH__

View file

@ -18,6 +18,22 @@
fixed_t rollcosang[ROTANGLES]; fixed_t rollcosang[ROTANGLES];
fixed_t rollsinang[ROTANGLES]; fixed_t rollsinang[ROTANGLES];
angle_t R_SpriteRotationAngle(mobj_t *mobj)
{
#if 0
angle_t viewingAngle = R_PointToAngle(mobj->x, mobj->y);
fixed_t pitchMul = -FINESINE(viewingAngle >> ANGLETOFINESHIFT);
fixed_t rollMul = FINECOSINE(viewingAngle >> ANGLETOFINESHIFT);
angle_t rollOrPitch = FixedMul(mobj->pitch, pitchMul) + FixedMul(mobj->roll, rollMul);
return (rollOrPitch + mobj->rollangle);
#else
return mobj->rollangle;
#endif
}
INT32 R_GetRollAngle(angle_t rollangle) INT32 R_GetRollAngle(angle_t rollangle)
{ {
INT32 ra = AngleFixed(rollangle)>>FRACBITS; INT32 ra = AngleFixed(rollangle)>>FRACBITS;

View file

@ -1293,7 +1293,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
shadowskew = 0; shadowskew = 0;
if (groundslope) if (groundslope)
R_SkewShadowSprite(thing, groundslope, groundz, patch->height, scalemul, &shadowyscale, &shadowskew); R_SkewShadowSprite(thing, groundslope, groundz, patch->height, FRACUNIT, &shadowyscale, &shadowskew);
tx -= patch->width * shadowxscale/2; tx -= patch->width * shadowxscale/2;
x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS; x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
@ -1799,7 +1799,7 @@ static void R_ProjectSprite(mobj_t *thing)
tr_x = (thingxpos + sort_x) - viewx; tr_x = (thingxpos + sort_x) - viewx;
tr_y = (thingypos + sort_y) - viewy; tr_y = (thingypos + sort_y) - viewy;
sort_z = FixedMul(tr_x, viewcos) + FixedMul(tr_y, viewsin); sort_z = FixedMul(tr_x, viewcos) + FixedMul(tr_y, viewsin);
sortscale = FixedDiv(projectiony, sort_z); sortscale = FixedDiv(projectiony[viewssnum], sort_z);
} }
// Calculate the splat's sortscale // Calculate the splat's sortscale
@ -1808,7 +1808,7 @@ static void R_ProjectSprite(mobj_t *thing)
tr_x = (thing->x - sort_x) - viewx; tr_x = (thing->x - sort_x) - viewx;
tr_y = (thing->y - sort_y) - viewy; tr_y = (thing->y - sort_y) - viewy;
sort_z = FixedMul(tr_x, viewcos) + FixedMul(tr_y, viewsin); sort_z = FixedMul(tr_x, viewcos) + FixedMul(tr_y, viewsin);
sortsplat = FixedDiv(projectiony, sort_z); sortsplat = FixedDiv(projectiony[viewssnum], sort_z);
} }
// PORTAL SPRITE CLIPPING // PORTAL SPRITE CLIPPING
@ -1843,26 +1843,7 @@ static void R_ProjectSprite(mobj_t *thing)
if (shadoweffects) if (shadoweffects)
{ {
mobj_t *caster = thing->target; ; // KART TODO: do additive/subtractive styles here
if (caster && !P_MobjWasRemoved(caster))
{
fixed_t floordiff;
if (abs(groundz-viewz)/tz > 4)
return; // Prevent stretchy shadows and possible crashes
floordiff = abs((isflipped ? caster->height : 0) + caster->z - groundz);
trans += ((floordiff / (100*FRACUNIT)) + 3);
shadowscale = FixedMul(FRACUNIT - floordiff/640, caster->scale);
}
else
trans += 3;
if (trans >= NUMTRANSMAPS)
return;
trans--;
} }
if (shadowdraw) if (shadowdraw)
@ -2032,7 +2013,7 @@ static void R_ProjectSprite(mobj_t *thing)
vis->scale += FixedMul(scalestep, spriteyscale) * (vis->x1 - x1); vis->scale += FixedMul(scalestep, spriteyscale) * (vis->x1 - x1);
} }
if ((oldthing->blendmode != AST_COPY) && cv_translucency.value) if (oldthing->blendmode != AST_COPY)
vis->transmap = R_GetBlendTable(oldthing->blendmode, trans); vis->transmap = R_GetBlendTable(oldthing->blendmode, trans);
else else
vis->transmap = NULL; vis->transmap = NULL;

View file

@ -53,7 +53,7 @@
#include "i_video.h" // rendermode #include "i_video.h" // rendermode
#include "d_netfil.h" #include "d_netfil.h"
#include "dehacked.h" #include "deh_soc.h"
#include "d_clisrv.h" #include "d_clisrv.h"
#include "r_defs.h" #include "r_defs.h"
#include "r_data.h" #include "r_data.h"
@ -801,7 +801,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
} }
if (important && !mainfile) if (important && !mainfile)
G_SetGameModified(true); G_SetGameModified(true, false);
// //
// link wad file to search files // link wad file to search files
@ -886,7 +886,7 @@ INT32 W_InitMultipleFiles(char **filenames, boolean addons)
// will be realloced as lumps are added // will be realloced as lumps are added
for (; *filenames; filenames++) for (; *filenames; filenames++)
{ {
if (addons && !W_VerifyNMUSlumps(*filenames)) if (addons && !W_VerifyNMUSlumps(*filenames, !addons))
G_SetGameModified(true, false); G_SetGameModified(true, false);
//CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames); //CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames);