mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart.git into namefix
This commit is contained in:
commit
4108d5acb0
39 changed files with 858 additions and 413 deletions
|
|
@ -1916,6 +1916,8 @@ void CON_SetLoadingProgress(con_loadprogress_t newStep)
|
|||
if (con_startup_loadprogress < LOADED_ISTARTUPGRAPHICS) // rendering not possible?
|
||||
return;
|
||||
CON_DrawLoadBar(); // here we display the console text
|
||||
I_OsPolling();
|
||||
I_UpdateNoBlit();
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
}
|
||||
|
||||
|
|
|
|||
16
src/d_main.c
16
src/d_main.c
|
|
@ -774,7 +774,7 @@ void D_SRB2Loop(void)
|
|||
// process tics (but maybe not if realtic == 0)
|
||||
TryRunTics(realtics);
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
if (cv_frameinterpolation.value == 1 && !(paused || P_AutoPause() || hu_stopped))
|
||||
{
|
||||
fixed_t entertimefrac = I_GetTimeFrac();
|
||||
// renderdeltatics is a bit awkard to evaluate, since the system time interface is whole tic-based
|
||||
|
|
@ -813,20 +813,6 @@ void D_SRB2Loop(void)
|
|||
}
|
||||
else if (rendertimeout < entertic) // in case the server hang or netsplit
|
||||
{
|
||||
#if 0
|
||||
// Lagless camera! Yay!
|
||||
if (gamestate == GS_LEVEL && netgame)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
if (camera[i].chase)
|
||||
P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// (Only display if not already done for frame interp)
|
||||
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -766,15 +766,21 @@ void D_RegisterClientCommands(void)
|
|||
|
||||
for (i = 0; i < MAXSKINCOLORS; i++)
|
||||
{
|
||||
Color_cons_t[i].value = Followercolor_cons_t[i].value = i;
|
||||
Color_cons_t[i].strvalue = Followercolor_cons_t[i].strvalue = skincolors[i].name;
|
||||
Color_cons_t[i].value = i;
|
||||
Color_cons_t[i].strvalue = skincolors[i].name;
|
||||
}
|
||||
|
||||
Followercolor_cons_t[MAXSKINCOLORS].value = MAXSKINCOLORS;
|
||||
Followercolor_cons_t[MAXSKINCOLORS].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
||||
for (i = 2; i < MAXSKINCOLORS; i++)
|
||||
{
|
||||
Followercolor_cons_t[i].value = i-2;
|
||||
Followercolor_cons_t[i].strvalue = skincolors[i-2].name;
|
||||
}
|
||||
|
||||
Followercolor_cons_t[MAXSKINCOLORS+1].value = MAXSKINCOLORS+1;
|
||||
Followercolor_cons_t[MAXSKINCOLORS+1].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
||||
Followercolor_cons_t[1].value = -1;
|
||||
Followercolor_cons_t[1].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
||||
|
||||
Followercolor_cons_t[0].value = -2;
|
||||
Followercolor_cons_t[0].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
||||
|
||||
Color_cons_t[MAXSKINCOLORS].value = Followercolor_cons_t[MAXSKINCOLORS+2].value = 0;
|
||||
Color_cons_t[MAXSKINCOLORS].strvalue = Followercolor_cons_t[MAXSKINCOLORS+2].strvalue = NULL;
|
||||
|
|
@ -1409,7 +1415,9 @@ static void SendNameAndColor(UINT8 n)
|
|||
|
||||
if (!strcmp(cv_playername[n].string, player_names[playernum])
|
||||
&& cv_playercolor[n].value == player->skincolor
|
||||
&& !strcmp(cv_skin[n].string, skins[player->skin].name))
|
||||
&& !strcmp(cv_skin[n].string, skins[player->skin].name)
|
||||
&& cv_follower[n].value == player->followerskin
|
||||
&& cv_followercolor[n].value == player->followercolor)
|
||||
return;
|
||||
|
||||
player->availabilities = R_GetSkinAvailabilities();
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ typedef enum
|
|||
{
|
||||
// Unsynced, HUD or clientsided effects
|
||||
// Item box
|
||||
khud_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
|
||||
khud_itemblink, // Item flashing after roulette, serves as a mashing indicator
|
||||
khud_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
|
||||
|
||||
// Rings
|
||||
|
|
@ -312,6 +312,7 @@ typedef struct player_s
|
|||
fixed_t bob;
|
||||
|
||||
angle_t viewrollangle;
|
||||
angle_t old_viewrollangle;
|
||||
// camera tilt
|
||||
// TODO: expose to lua
|
||||
angle_t tilt;
|
||||
|
|
@ -325,6 +326,7 @@ typedef struct player_s
|
|||
|
||||
// fun thing for player sprite
|
||||
angle_t drawangle;
|
||||
angle_t old_drawangle; // interp
|
||||
|
||||
// Bit flags.
|
||||
// See pflags_t, above.
|
||||
|
|
@ -394,6 +396,8 @@ typedef struct player_s
|
|||
INT32 aizdrifttilt;
|
||||
INT32 aizdriftturn;
|
||||
|
||||
INT32 underwatertilt;
|
||||
|
||||
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
||||
UINT8 waterskip; // Water skipping counter
|
||||
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@ actionpointer_t actionpointers[] =
|
|||
{{A_SPBChase}, "A_SPBCHASE"},
|
||||
{{A_SSMineSearch}, "A_SSMINESEARCH"},
|
||||
{{A_SSMineExplode}, "A_SSMINEEXPLODE"},
|
||||
{{A_LandMineExplode}, "A_LANDMINEEXPLODE"},
|
||||
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"},
|
||||
{{A_LightningFollowPlayer}, "A_LIGHTNINGFOLLOWPLAYER"},
|
||||
{{A_FZBoomFlash}, "A_FZBOOMFLASH"},
|
||||
|
|
@ -334,7 +335,6 @@ actionpointer_t actionpointers[] =
|
|||
{{A_ReaperThinker}, "A_REAPERTHINKER"},
|
||||
{{A_FlameShieldPaper}, "A_FLAMESHIELDPAPER"},
|
||||
{{A_InvincSparkleRotate}, "A_INVINCSPARKLEROTATE"},
|
||||
{{A_SpawnItemCapsuleParts}, "A_SPAWNITEMCAPSULEPARTS"},
|
||||
|
||||
{{NULL}, "NONE"},
|
||||
|
||||
|
|
@ -3490,9 +3490,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_ITEMCAPSULE_TOP_SIDE",
|
||||
"S_ITEMCAPSULE_BOTTOM_SIDE_AIR",
|
||||
"S_ITEMCAPSULE_BOTTOM_SIDE_GROUND",
|
||||
"S_ITEMCAPSULE_TOP",
|
||||
"S_ITEMCAPSULE_BOTTOM",
|
||||
"S_ITEMCAPSULE_INSIDE",
|
||||
//"S_ITEMCAPSULE_TOP",
|
||||
//"S_ITEMCAPSULE_BOTTOM",
|
||||
//"S_ITEMCAPSULE_INSIDE",
|
||||
|
||||
// Signpost sparkles
|
||||
"S_SIGNSPARK1",
|
||||
|
|
|
|||
|
|
@ -108,8 +108,12 @@ static patch_t *ttcheckers; // *vroom* KART
|
|||
static patch_t *ttkflash; // flash screen
|
||||
*/
|
||||
|
||||
#define NOWAY
|
||||
|
||||
#ifdef NOWAY
|
||||
static patch_t *driver[2]; // Driving character on the waiting screen
|
||||
static UINT8 *waitcolormap; // colormap for the spinning character
|
||||
#endif
|
||||
|
||||
// ttmode user
|
||||
static patch_t *ttuser[TTMAX_USER];
|
||||
|
|
@ -2188,14 +2192,17 @@ void F_TitleDemoTicker(void)
|
|||
|
||||
void F_StartWaitingPlayers(void)
|
||||
{
|
||||
#ifdef NOWAY
|
||||
INT32 i;
|
||||
INT32 randskin;
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
#endif
|
||||
|
||||
wipegamestate = GS_TITLESCREEN; // technically wiping from title screen
|
||||
finalecount = 0;
|
||||
|
||||
#ifdef NOWAY
|
||||
randskin = M_RandomKey(numskins);
|
||||
|
||||
if (waitcolormap)
|
||||
|
|
@ -2208,8 +2215,9 @@ void F_StartWaitingPlayers(void)
|
|||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
sprframe = &sprdef->spriteframes[i];
|
||||
driver[i] = W_CachePatchNum(sprframe->lumppat[0], PU_LEVEL);
|
||||
driver[i] = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void F_WaitingPlayersTicker(void)
|
||||
|
|
@ -2226,14 +2234,17 @@ void F_WaitingPlayersTicker(void)
|
|||
|
||||
void F_WaitingPlayersDrawer(void)
|
||||
{
|
||||
#ifdef NOWAY
|
||||
UINT32 frame = (finalecount % 8) / 4; // The game only tics every other frame while waitingplayers
|
||||
INT32 flags = V_FLIP;
|
||||
#endif
|
||||
const char *waittext1 = "You will join";
|
||||
const char *waittext2 = "the next race...";
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
|
||||
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
|
||||
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
|
||||
#ifdef NOWAY
|
||||
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, V_FLIP, driver[frame], waitcolormap);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ==================
|
||||
|
|
|
|||
13
src/f_wipe.c
13
src/f_wipe.c
|
|
@ -299,16 +299,23 @@ static void F_DoWipe(fademask_t *fademask, lighttable_t *fadecolormap, boolean r
|
|||
e = e_base + relativepos;
|
||||
draw_rowstogo = draw_rowend - draw_rowstart;
|
||||
|
||||
while (draw_rowstogo--)
|
||||
if (fadecolormap)
|
||||
{
|
||||
if (fadecolormap != NULL)
|
||||
if (reverse)
|
||||
s = e;
|
||||
while (draw_rowstogo--)
|
||||
*w++ = fadecolormap[ ( m << 8 ) + *s++ ];
|
||||
}
|
||||
else while (draw_rowstogo--)
|
||||
{
|
||||
/*if (fadecolormap != NULL)
|
||||
{
|
||||
if (reverse)
|
||||
*w++ = fadecolormap[ ( m << 8 ) + *e++ ];
|
||||
else
|
||||
*w++ = fadecolormap[ ( m << 8 ) + *s++ ];
|
||||
}
|
||||
else
|
||||
else*/
|
||||
*w++ = transtbl[ ( *e++ << 8 ) + *s++ ];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,9 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex)
|
|||
UINT8 *pdata;
|
||||
INT32 blockwidth, blockheight, blocksize;
|
||||
|
||||
#ifdef GLENCORE
|
||||
UINT8 *colormap = colormaps;
|
||||
#endif
|
||||
|
||||
INT32 i;
|
||||
boolean skyspecial = false; //poor hack for Legacy large skies..
|
||||
|
|
@ -477,12 +479,14 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex)
|
|||
grtex->mipmap.height = (UINT16)texture->height;
|
||||
grtex->mipmap.format = textureformat;
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (encoremap)
|
||||
colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
grtex->mipmap.colormap = Z_Calloc(sizeof(*grtex->mipmap.colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
grtex->mipmap.colormap->source = colormap;
|
||||
M_Memcpy(grtex->mipmap.colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
#endif
|
||||
|
||||
blockwidth = texture->width;
|
||||
blockheight = texture->height;
|
||||
|
|
@ -891,7 +895,9 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
|||
GLMipmap_t *grmip;
|
||||
patch_t *patch;
|
||||
|
||||
#ifdef GLENCORE
|
||||
UINT8 *colormap = colormaps;
|
||||
#endif
|
||||
|
||||
if (flatlumpnum == LUMPERROR)
|
||||
return;
|
||||
|
|
@ -899,12 +905,16 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
|||
patch = HWR_GetCachedGLPatch(flatlumpnum);
|
||||
grmip = ((GLPatch_t *)Patch_AllocateHardwarePatch(patch))->mipmap;
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (!noencoremap && encoremap)
|
||||
colormap += COLORMAP_REMAPOFFSET;
|
||||
|
||||
grmip->colormap = Z_Calloc(sizeof(*grmip->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
grmip->colormap->source = colormap;
|
||||
M_Memcpy(grmip->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
#else
|
||||
(void)noencoremap;
|
||||
#endif
|
||||
|
||||
if (!grmip->downloaded && !grmip->data)
|
||||
HWR_CacheFlat(grmip, flatlumpnum);
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ struct FSurfaceInfo
|
|||
typedef struct FSurfaceInfo FSurfaceInfo;
|
||||
|
||||
#define GL_DEFAULTMIX 0x00000000
|
||||
#define GL_DEFAULTFOG 0xFF000000
|
||||
#define GL_DEFAULTFOG 0x19000000
|
||||
|
||||
//Hurdler: added for backward compatibility
|
||||
enum hwdsetspecialstate
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
//#define HWR_LOADING_SCREEN
|
||||
|
||||
// SRB2Kart
|
||||
#define GLENCORE
|
||||
//#define GLENCORE
|
||||
|
||||
// -----------
|
||||
// structures
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "../r_things.h" // R_GetShadowZ
|
||||
#include "../d_main.h"
|
||||
#include "../p_slopes.h"
|
||||
#include "../k_kart.h" // HITLAGJITTERS
|
||||
#include "hw_md2.h"
|
||||
|
||||
#ifdef NEWCLIP
|
||||
|
|
@ -3645,7 +3646,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
|||
fixed_t interpz = thing->z;
|
||||
|
||||
// do interpolation
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||
|
|
@ -3655,7 +3656,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
|||
// hitlag vibrating (todo: interp somehow?)
|
||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
||||
|
||||
if (leveltime & 1)
|
||||
{
|
||||
|
|
@ -5055,7 +5056,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
INT32 heightsec, phs;
|
||||
const boolean splat = R_ThingIsFloorSprite(thing);
|
||||
const boolean papersprite = (R_ThingIsPaperSprite(thing) && !splat);
|
||||
angle_t mobjangle = (thing->player ? thing->player->drawangle : thing->angle);
|
||||
float z1, z2;
|
||||
|
||||
fixed_t spr_width, spr_height;
|
||||
|
|
@ -5083,20 +5083,28 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
interpx = thing->x;
|
||||
interpy = thing->y;
|
||||
interpz = thing->z;
|
||||
interpangle = mobjangle;
|
||||
interpangle = (thing->player ? thing->player->drawangle : thing->angle);
|
||||
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||
interpz = thing->old_z + FixedMul(rendertimefrac, thing->z - thing->old_z);
|
||||
interpangle = mobjangle;
|
||||
|
||||
if (thing->player)
|
||||
{
|
||||
interpangle = thing->player->old_drawangle + FixedMul(rendertimefrac, thing->player->drawangle - thing->player->old_drawangle);
|
||||
}
|
||||
else
|
||||
{
|
||||
interpangle = thing->old_angle + FixedMul(rendertimefrac, thing->angle - thing->old_angle);
|
||||
}
|
||||
}
|
||||
|
||||
// hitlag vibrating (todo: interp somehow?)
|
||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
||||
|
||||
if (leveltime & 1)
|
||||
{
|
||||
|
|
@ -5276,8 +5284,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
if (papersprite)
|
||||
{
|
||||
rightsin = FIXED_TO_FLOAT(FINESINE((mobjangle)>>ANGLETOFINESHIFT));
|
||||
rightcos = FIXED_TO_FLOAT(FINECOSINE((mobjangle)>>ANGLETOFINESHIFT));
|
||||
rightsin = FIXED_TO_FLOAT(FINESINE((interpangle)>>ANGLETOFINESHIFT));
|
||||
rightcos = FIXED_TO_FLOAT(FINECOSINE((interpangle)>>ANGLETOFINESHIFT));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -5470,8 +5478,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
{
|
||||
vis->colormap = colormaps;
|
||||
|
||||
#ifdef GLENCORE
|
||||
if (encoremap && (thing->flags & (MF_SCENERY|MF_NOTHINK)) && !(thing->flags & MF_DONTENCOREMAP))
|
||||
vis->colormap += COLORMAP_REMAPOFFSET;
|
||||
#endif
|
||||
}
|
||||
|
||||
// set top/bottom coords
|
||||
|
|
@ -5515,7 +5525,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
interpz = thing->z;
|
||||
|
||||
// do interpolation
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||
|
|
@ -5803,8 +5813,7 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
dometransform.scalez = 1;
|
||||
dometransform.fovxangle = fpov; // Tails
|
||||
dometransform.fovyangle = fpov; // Tails
|
||||
HWR_RollTransform(&dometransform,
|
||||
R_ViewRollAngle(player));
|
||||
HWR_RollTransform(&dometransform, viewroll);
|
||||
dometransform.splitscreen = r_splitscreen;
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture]);
|
||||
|
|
@ -6096,7 +6105,7 @@ void HWR_RenderSkyboxView(player_t *player)
|
|||
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
HWR_RollTransform(&atransform, R_ViewRollAngle(player));
|
||||
HWR_RollTransform(&atransform, viewroll);
|
||||
atransform.splitscreen = r_splitscreen;
|
||||
|
||||
gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
|
@ -6308,7 +6317,7 @@ void HWR_RenderPlayerView(void)
|
|||
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
HWR_RollTransform(&atransform, R_ViewRollAngle(player));
|
||||
HWR_RollTransform(&atransform, viewroll);
|
||||
atransform.splitscreen = r_splitscreen;
|
||||
|
||||
gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
// SRB2Kart
|
||||
#include "../k_color.h"
|
||||
#include "../k_kart.h" // HITLAGJITTERS
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
|
||||
|
|
@ -1372,7 +1373,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
fixed_t interpz = spr->mobj->z;
|
||||
|
||||
// do interpolation
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = spr->mobj->old_x + FixedMul(rendertimefrac, spr->mobj->x - spr->mobj->old_x);
|
||||
interpy = spr->mobj->old_y + FixedMul(rendertimefrac, spr->mobj->y - spr->mobj->old_y);
|
||||
|
|
@ -1382,7 +1383,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
// hitlag vibrating
|
||||
if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
fixed_t mul = spr->mobj->hitlag * (FRACUNIT / 10);
|
||||
fixed_t mul = spr->mobj->hitlag * HITLAGJITTERS;
|
||||
|
||||
if (leveltime & 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -715,14 +715,15 @@ static GLRGBAFloat shader_defaultcolor = {1.0f, 1.0f, 1.0f, 1.0f};
|
|||
"float colorBrightness = sqrt((final_color.r * final_color.r) + (final_color.g * final_color.g) + (final_color.b * final_color.b));\n" \
|
||||
"float fogBrightness = sqrt((fade_color.r * fade_color.r) + (fade_color.g * fade_color.g) + (fade_color.b * fade_color.b));\n" \
|
||||
"float colorIntensity = 0.0;\n" \
|
||||
"if (fogBrightness > colorBrightness) {\n" \
|
||||
"if (colorBrightness < fogBrightness) {\n" \
|
||||
"colorIntensity = 1.0 - min(final_color.r, min(final_color.g, final_color.b));\n" \
|
||||
"colorIntensity = abs(colorIntensity - (1.0 - fogBrightness));\n" \
|
||||
"colorIntensity = abs(colorIntensity - (1.0 - max(fade_color.r, max(fade_color.g, fade_color.b))));\n" \
|
||||
"} else {\n" \
|
||||
"colorIntensity = max(final_color.r, max(final_color.g, final_color.b));\n" \
|
||||
"colorIntensity = abs(colorIntensity - (fogBrightness));\n" \
|
||||
"colorIntensity = abs(colorIntensity - min(fade_color.r, min(fade_color.g, fade_color.b)));\n" \
|
||||
"}\n" \
|
||||
"colorIntensity *= darkness;\n" \
|
||||
"colorIntensity *= fade_color.a * 10.0;\n" \
|
||||
"if (abs(final_color.r - fade_color.r) <= colorIntensity) {\n" \
|
||||
"final_color.r = fade_color.r;\n" \
|
||||
"} else if (final_color.r < fade_color.r) {\n" \
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ precise_t I_GetPreciseTime(void);
|
|||
|
||||
/** \brief Returns the difference between precise times as microseconds.
|
||||
*/
|
||||
int I_PreciseToMicros(precise_t);
|
||||
int I_PreciseToMicros(precise_t d);
|
||||
|
||||
/** \brief The I_Sleep function
|
||||
|
||||
|
|
|
|||
12
src/info.c
12
src/info.c
|
|
@ -4068,13 +4068,13 @@ state_t states[NUMSTATES] =
|
|||
|
||||
{SPR_NULL, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMICON
|
||||
|
||||
{SPR_ICAP, FF_ADD|0, -1, {A_SpawnItemCapsuleParts}, 0, 0, S_NULL}, // S_ITEMCAPSULE
|
||||
{SPR_ICAP, FF_ADD|0, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE
|
||||
{SPR_ICAP, FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP_SIDE
|
||||
{SPR_ICAP, FF_VERTICALFLIP|FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_AIR
|
||||
{SPR_ICAP, FF_PAPERSPRITE|2, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_GROUND
|
||||
{SPR_ICAP, FF_FLOORSPRITE|3, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP
|
||||
{SPR_ICAP, FF_FLOORSPRITE|4, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM
|
||||
{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE
|
||||
//{SPR_ICAP, FF_FLOORSPRITE|3, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP
|
||||
//{SPR_ICAP, FF_FLOORSPRITE|4, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM
|
||||
//{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE
|
||||
|
||||
{SPR_SGNS, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1
|
||||
{SPR_SGNS, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2
|
||||
|
|
@ -4358,7 +4358,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10
|
||||
|
||||
{SPR_LNDM, 0, -1, {NULL}, 0, 0, S_LANDMINE}, // S_LANDMINE
|
||||
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE
|
||||
{SPR_NULL, 0, 1, {A_LandMineExplode}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE
|
||||
|
||||
{SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1
|
||||
{SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2
|
||||
|
|
@ -23094,7 +23094,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SLIDEME|MF_SPECIAL|MF_RUNSPAWNFUNC|MF_DONTENCOREMAP, // flags
|
||||
MF_SLIDEME|MF_SPECIAL|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
|||
11
src/info.h
11
src/info.h
|
|
@ -276,6 +276,7 @@ enum actionnum
|
|||
A_SPBCHASE,
|
||||
A_SSMINESEARCH,
|
||||
A_SSMINEEXPLODE,
|
||||
A_LANDMINEEXPLODE,
|
||||
A_BALLHOGEXPLODE,
|
||||
A_LIGHTNINGFOLLOWPLAYER,
|
||||
A_FZBOOMFLASH,
|
||||
|
|
@ -287,7 +288,6 @@ enum actionnum
|
|||
A_REAPERTHINKER,
|
||||
A_FLAMESHIELDPAPER,
|
||||
A_INVINCSPARKLEROTATE,
|
||||
A_SPAWNITEMCAPSULEPARTS,
|
||||
NUMACTIONS
|
||||
};
|
||||
|
||||
|
|
@ -547,6 +547,8 @@ void A_JawzExplode();
|
|||
void A_SPBChase();
|
||||
void A_SSMineSearch();
|
||||
void A_SSMineExplode();
|
||||
void A_LandMineExplode();
|
||||
void A_LandMineExplode();
|
||||
void A_BallhogExplode();
|
||||
void A_LightningFollowPlayer();
|
||||
void A_FZBoomFlash();
|
||||
|
|
@ -558,7 +560,6 @@ void A_ReaperThinker();
|
|||
void A_MementosTPParticles();
|
||||
void A_FlameShieldPaper();
|
||||
void A_InvincSparkleRotate();
|
||||
void A_SpawnItemCapsuleParts();
|
||||
|
||||
extern boolean actionsoverridden[NUMACTIONS];
|
||||
|
||||
|
|
@ -4466,9 +4467,9 @@ typedef enum state
|
|||
S_ITEMCAPSULE_TOP_SIDE,
|
||||
S_ITEMCAPSULE_BOTTOM_SIDE_AIR,
|
||||
S_ITEMCAPSULE_BOTTOM_SIDE_GROUND,
|
||||
S_ITEMCAPSULE_TOP,
|
||||
S_ITEMCAPSULE_BOTTOM,
|
||||
S_ITEMCAPSULE_INSIDE,
|
||||
//S_ITEMCAPSULE_TOP,
|
||||
//S_ITEMCAPSULE_BOTTOM,
|
||||
//S_ITEMCAPSULE_INSIDE,
|
||||
|
||||
// Signpost sparkles
|
||||
S_SIGNSPARK1,
|
||||
|
|
|
|||
98
src/k_hud.c
98
src/k_hud.c
|
|
@ -801,7 +801,7 @@ void K_ObjectTracking(trackingResult_t *result, vector3_t *point, UINT8 cameraNu
|
|||
player_t *player;
|
||||
|
||||
fixed_t viewpointX, viewpointY, viewpointZ;
|
||||
angle_t viewpointAngle, viewpointAiming;
|
||||
angle_t viewpointAngle, viewpointAiming, viewpointRoll;
|
||||
|
||||
INT32 screenWidth, screenHeight;
|
||||
fixed_t screenHalfW, screenHalfH;
|
||||
|
|
@ -829,12 +829,13 @@ void K_ObjectTracking(trackingResult_t *result, vector3_t *point, UINT8 cameraNu
|
|||
cam = &camera[cameraNum];
|
||||
player = &players[displayplayers[cameraNum]];
|
||||
|
||||
if (cam == NULL || player == NULL)
|
||||
if (cam == NULL || player == NULL || player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
||||
{
|
||||
// Shouldn't be possible?
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: needs da interp
|
||||
if (cam->chase == true && !player->spectator)
|
||||
{
|
||||
// Use the camera's properties.
|
||||
|
|
@ -843,26 +844,45 @@ void K_ObjectTracking(trackingResult_t *result, vector3_t *point, UINT8 cameraNu
|
|||
viewpointZ = cam->z - point->z;
|
||||
viewpointAngle = (INT32)cam->angle;
|
||||
viewpointAiming = (INT32)cam->aiming;
|
||||
viewpointRoll = (INT32)player->viewrollangle;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
viewpointX = cam->old_x + FixedMul(rendertimefrac, cam->x - cam->old_x);
|
||||
viewpointY = cam->old_y + FixedMul(rendertimefrac, cam->y - cam->old_y);
|
||||
viewpointZ = (cam->old_z + FixedMul(rendertimefrac, cam->z - cam->old_z)) - point->z;
|
||||
|
||||
viewpointAngle = (INT32)(cam->old_angle + FixedMul(rendertimefrac, cam->angle - cam->old_angle));
|
||||
viewpointAiming = (INT32)(cam->old_aiming + FixedMul(rendertimefrac, cam->aiming - cam->old_aiming));
|
||||
viewpointRoll = (INT32)(player->old_viewrollangle + FixedMul(rendertimefrac, player->viewrollangle - player->old_viewrollangle));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use player properties.
|
||||
|
||||
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
||||
{
|
||||
// This shouldn't happen.
|
||||
return;
|
||||
}
|
||||
|
||||
viewpointX = player->mo->x;
|
||||
viewpointY = player->mo->y;
|
||||
viewpointZ = player->viewz - point->z;
|
||||
viewpointAngle = (INT32)player->mo->angle;
|
||||
viewpointAiming = (INT32)player->aiming;
|
||||
viewpointRoll = (INT32)player->viewrollangle;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
viewpointX = player->mo->old_x + FixedMul(rendertimefrac, player->mo->x - player->mo->old_x);
|
||||
viewpointY = player->mo->old_y + FixedMul(rendertimefrac, player->mo->y - player->mo->old_y);
|
||||
viewpointZ = (player->mo->old_z + FixedMul(rendertimefrac, player->viewz - player->mo->old_z)) - point->z; //player->old_viewz
|
||||
|
||||
viewpointAngle = (INT32)(player->mo->old_angle + FixedMul(rendertimefrac, player->mo->angle - player->mo->old_angle));
|
||||
//viewpointAiming = (INT32)(player->mo->old_aiming + FixedMul(rendertimefrac, player->mo->aiming - player->mo->old_aiming));
|
||||
viewpointRoll = (INT32)(player->old_viewrollangle + FixedMul(rendertimefrac, player->viewrollangle - player->old_viewrollangle));
|
||||
}
|
||||
}
|
||||
|
||||
viewpointAngle += (INT32)angleOffset;
|
||||
|
||||
(void)viewpointRoll; // will be used later...
|
||||
|
||||
// Calculate screen size adjustments.
|
||||
// TODO: Anyone want to make this support non-green resolutions somehow? :V
|
||||
screenWidth = BASEVIDWIDTH;
|
||||
|
|
@ -2590,6 +2610,7 @@ static void K_drawKartPlayerCheck(void)
|
|||
UINT8 *colormap = NULL;
|
||||
UINT8 pnum = 0;
|
||||
vector3_t v;
|
||||
vector3_t pPos;
|
||||
trackingResult_t result;
|
||||
|
||||
if (!playeringame[i] || checkplayer->spectator)
|
||||
|
|
@ -2614,7 +2635,22 @@ static void K_drawKartPlayerCheck(void)
|
|||
v.y = checkplayer->mo->y;
|
||||
v.z = checkplayer->mo->z;
|
||||
|
||||
distance = R_PointToDist2(stplyr->mo->x, stplyr->mo->y, v.x, v.y);
|
||||
pPos.x = stplyr->mo->x;
|
||||
pPos.y = stplyr->mo->y;
|
||||
pPos.z = stplyr->mo->z;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
v.x = checkplayer->mo->old_x + FixedMul(rendertimefrac, checkplayer->mo->x - checkplayer->mo->old_x);
|
||||
v.y = checkplayer->mo->old_y + FixedMul(rendertimefrac, checkplayer->mo->y - checkplayer->mo->old_y);
|
||||
v.z = checkplayer->mo->old_z + FixedMul(rendertimefrac, checkplayer->mo->z - checkplayer->mo->old_z);
|
||||
|
||||
pPos.x = stplyr->mo->old_x + FixedMul(rendertimefrac, stplyr->mo->x - stplyr->mo->old_x);
|
||||
pPos.y = stplyr->mo->old_y + FixedMul(rendertimefrac, stplyr->mo->y - stplyr->mo->old_y);
|
||||
pPos.z = stplyr->mo->old_z + FixedMul(rendertimefrac, stplyr->mo->z - stplyr->mo->old_z);
|
||||
}
|
||||
|
||||
distance = R_PointToDist2(pPos.x, pPos.y, v.x, v.y);
|
||||
|
||||
if (distance > maxdistance)
|
||||
{
|
||||
|
|
@ -2801,12 +2837,26 @@ static void K_drawKartNameTags(void)
|
|||
c.x = thiscam->x;
|
||||
c.y = thiscam->y;
|
||||
c.z = thiscam->z;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
c.x = thiscam->old_x + FixedMul(rendertimefrac, thiscam->x - thiscam->old_x);
|
||||
c.y = thiscam->old_y + FixedMul(rendertimefrac, thiscam->y - thiscam->old_y);
|
||||
c.z = thiscam->old_z + FixedMul(rendertimefrac, thiscam->z - thiscam->old_z);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
c.x = stplyr->mo->x;
|
||||
c.y = stplyr->mo->y;
|
||||
c.z = stplyr->mo->z;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
c.x = stplyr->mo->old_x + FixedMul(rendertimefrac, stplyr->mo->x - stplyr->mo->old_x);
|
||||
c.y = stplyr->mo->old_y + FixedMul(rendertimefrac, stplyr->mo->y - stplyr->mo->old_y);
|
||||
c.z = stplyr->mo->old_z + FixedMul(rendertimefrac, stplyr->mo->z - stplyr->mo->old_z);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
|
@ -2849,6 +2899,13 @@ static void K_drawKartNameTags(void)
|
|||
v.y = ntplayer->mo->y;
|
||||
v.z = ntplayer->mo->z;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
v.x = ntplayer->mo->old_x + FixedMul(rendertimefrac, ntplayer->mo->x - ntplayer->mo->old_x);
|
||||
v.y = ntplayer->mo->old_y + FixedMul(rendertimefrac, ntplayer->mo->y - ntplayer->mo->old_y);
|
||||
v.z = ntplayer->mo->old_z + FixedMul(rendertimefrac, ntplayer->mo->z - ntplayer->mo->old_z);
|
||||
}
|
||||
|
||||
if (!(ntplayer->mo->eflags & MFE_VERTICALFLIP))
|
||||
{
|
||||
v.z += ntplayer->mo->height;
|
||||
|
|
@ -2904,7 +2961,16 @@ static void K_drawKartNameTags(void)
|
|||
|
||||
v.x = ntplayer->mo->x;
|
||||
v.y = ntplayer->mo->y;
|
||||
v.z = ntplayer->mo->z + (ntplayer->mo->height / 2);
|
||||
v.z = ntplayer->mo->z;
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
v.x = ntplayer->mo->old_x + FixedMul(rendertimefrac, ntplayer->mo->x - ntplayer->mo->old_x);
|
||||
v.y = ntplayer->mo->old_y + FixedMul(rendertimefrac, ntplayer->mo->y - ntplayer->mo->old_y);
|
||||
v.z = ntplayer->mo->old_z + FixedMul(rendertimefrac, ntplayer->mo->z - ntplayer->mo->old_z);
|
||||
}
|
||||
|
||||
v.z += (ntplayer->mo->height / 2);
|
||||
|
||||
if (stplyr->mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
|
|
@ -3145,7 +3211,7 @@ static void K_drawKartMinimap(void)
|
|||
interpx = g->mo->x;
|
||||
interpy = g->mo->y;
|
||||
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = g->mo->old_x + FixedMul(rendertimefrac, g->mo->x - g->mo->old_x);
|
||||
interpy = g->mo->old_y + FixedMul(rendertimefrac, g->mo->y - g->mo->old_y);
|
||||
|
|
@ -3210,7 +3276,7 @@ static void K_drawKartMinimap(void)
|
|||
interpx = players[i].mo->x;
|
||||
interpy = players[i].mo->y;
|
||||
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = players[i].mo->old_x + FixedMul(rendertimefrac, players[i].mo->x - players[i].mo->old_x);
|
||||
interpy = players[i].mo->old_y + FixedMul(rendertimefrac, players[i].mo->y - players[i].mo->old_y);
|
||||
|
|
@ -3245,7 +3311,7 @@ static void K_drawKartMinimap(void)
|
|||
interpx = mobj->x;
|
||||
interpy = mobj->y;
|
||||
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = mobj->old_x + FixedMul(rendertimefrac, mobj->x - mobj->old_x);
|
||||
interpy = mobj->old_y + FixedMul(rendertimefrac, mobj->y - mobj->old_y);
|
||||
|
|
@ -3282,7 +3348,7 @@ static void K_drawKartMinimap(void)
|
|||
interpx = players[localplayers[i]].mo->x;
|
||||
interpy = players[localplayers[i]].mo->y;
|
||||
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = players[localplayers[i]].mo->old_x + FixedMul(rendertimefrac, players[localplayers[i]].mo->x - players[localplayers[i]].mo->old_x);
|
||||
interpy = players[localplayers[i]].mo->old_y + FixedMul(rendertimefrac, players[localplayers[i]].mo->y - players[localplayers[i]].mo->old_y);
|
||||
|
|
@ -3795,7 +3861,7 @@ static void K_drawKartFirstPerson(void)
|
|||
// hitlag vibrating
|
||||
if (stplyr->mo->hitlag > 0 && (stplyr->mo->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
fixed_t mul = stplyr->mo->hitlag * (FRACUNIT / 10);
|
||||
fixed_t mul = stplyr->mo->hitlag * HITLAGJITTERS;
|
||||
if (r_splitscreen && mul > FRACUNIT)
|
||||
mul = FRACUNIT;
|
||||
|
||||
|
|
|
|||
84
src/k_kart.c
84
src/k_kart.c
|
|
@ -2700,6 +2700,19 @@ boolean K_TripwirePass(player_t *player)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean K_WaterRun(player_t *player)
|
||||
{
|
||||
if (
|
||||
player->invincibilitytimer ||
|
||||
player->sneakertimer ||
|
||||
player->tiregrease ||
|
||||
player->flamedash ||
|
||||
player->speed > 2 * K_GetKartSpeed(player, false)
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static fixed_t K_FlameShieldDashVar(INT32 val)
|
||||
{
|
||||
// 1 second = 75% + 50% top speed
|
||||
|
|
@ -3623,14 +3636,9 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
|||
|
||||
#define MINEQUAKEDIST 4096
|
||||
|
||||
// Spawns the purely visual explosion
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
// Does the proximity screen flash and quake for explosions
|
||||
void K_MineFlashScreen(mobj_t *source)
|
||||
{
|
||||
INT32 i, radius, height;
|
||||
mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING);
|
||||
mobj_t *dust;
|
||||
mobj_t *truc;
|
||||
INT32 speed, speed2;
|
||||
INT32 pnum;
|
||||
player_t *p;
|
||||
|
||||
|
|
@ -3653,6 +3661,18 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
|||
break; // we can break right now because quakes are global to all split players somehow.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Spawns the purely visual explosion
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
{
|
||||
INT32 i, radius, height;
|
||||
mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING);
|
||||
mobj_t *dust;
|
||||
mobj_t *truc;
|
||||
INT32 speed, speed2;
|
||||
|
||||
K_MineFlashScreen(source);
|
||||
|
||||
K_MatchGenericExtraFlags(smoldering, source);
|
||||
smoldering->tics = TICRATE*3;
|
||||
|
|
@ -4973,8 +4993,7 @@ static void K_DoHyudoroSteal(player_t *player)
|
|||
// Has an item
|
||||
&& (players[i].itemtype
|
||||
&& players[i].itemamount
|
||||
&& !(players[i].pflags & PF_ITEMOUT)
|
||||
&& !players[i].karthud[khud_itemblink]))
|
||||
&& !(players[i].pflags & PF_ITEMOUT)))
|
||||
{
|
||||
playerswappable[numplayers] = i;
|
||||
numplayers++;
|
||||
|
|
@ -6443,6 +6462,12 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
|||
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
|
||||
player->karthud[khud_fault]++;
|
||||
|
||||
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
|
||||
{
|
||||
player->karthud[khud_itemblinkmode] = 0;
|
||||
player->karthud[khud_itemblink] = 0;
|
||||
}
|
||||
|
||||
if (gametype == GT_RACE)
|
||||
{
|
||||
// 0 is the fast spin animation, set at 30 tics of ring boost or higher!
|
||||
|
|
@ -6961,13 +6986,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
K_HandleTumbleBounce(player);
|
||||
}
|
||||
|
||||
// This doesn't go in HUD update because it has potential gameplay ramifications
|
||||
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
|
||||
{
|
||||
player->karthud[khud_itemblinkmode] = 0;
|
||||
player->karthud[khud_itemblink] = 0;
|
||||
}
|
||||
|
||||
K_KartPlayerHUDUpdate(player);
|
||||
|
||||
if (battleovertime.enabled && !(player->pflags & PF_ELIMINATED) && player->bumpers <= 0 && player->karmadelay <= 0)
|
||||
|
|
@ -7567,10 +7585,12 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
|
|||
basedrift += (basedrift / greasetics) * player->tiregrease;
|
||||
}
|
||||
|
||||
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||
#if 0
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
{
|
||||
countersteer = FixedMul(countersteer, 3*FRACUNIT/2);
|
||||
}
|
||||
#endif
|
||||
|
||||
return basedrift + (FixedMul(driftadjust * FRACUNIT, countersteer) / FRACUNIT);
|
||||
}
|
||||
|
|
@ -7674,9 +7694,10 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
|
|||
turnfixed = FixedMul(turnfixed, FRACUNIT + player->handleboost);
|
||||
}
|
||||
|
||||
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||
if ((player->mo->eflags & MFE_UNDERWATER) &&
|
||||
player->speed > 11 * player->mo->scale)
|
||||
{
|
||||
turnfixed = FixedMul(turnfixed, 3*FRACUNIT/2);
|
||||
turnfixed /= 2;
|
||||
}
|
||||
|
||||
// Weight has a small effect on turning
|
||||
|
|
@ -7685,6 +7706,24 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
|
|||
return (turnfixed / FRACUNIT);
|
||||
}
|
||||
|
||||
INT32 K_GetUnderwaterTurnAdjust(player_t *player)
|
||||
{
|
||||
if ((player->mo->eflags & MFE_UNDERWATER) &&
|
||||
player->speed > 11 * player->mo->scale)
|
||||
{
|
||||
INT32 steer = (K_GetKartTurnValue(player,
|
||||
player->steering) << TICCMD_REDUCE);
|
||||
|
||||
if (!player->drift)
|
||||
steer = 9 * steer / 5;
|
||||
|
||||
return FixedMul(steer, 8 * FixedDiv(player->speed,
|
||||
2 * K_GetKartSpeed(player, false) / 3));
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 K_GetKartDriftSparkValue(player_t *player)
|
||||
{
|
||||
return (26*4 + player->kartspeed*2 + (9 - player->kartweight))*8;
|
||||
|
|
@ -8451,10 +8490,15 @@ void K_AdjustPlayerFriction(player_t *player)
|
|||
*/
|
||||
|
||||
// Water gets ice physics too
|
||||
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||
if ((player->mo->eflags & MFE_TOUCHWATER) &&
|
||||
!player->offroad)
|
||||
{
|
||||
player->mo->friction += 614;
|
||||
}
|
||||
else if (player->mo->eflags & MFE_UNDERWATER)
|
||||
{
|
||||
player->mo->friction += 312;
|
||||
}
|
||||
|
||||
// Wipeout slowdown
|
||||
if (player->spinouttimer && player->wipeoutslow)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ Make sure this matches the actual number of states
|
|||
#define KART_NUMINVSPARKLESANIM 12
|
||||
|
||||
#define MAXHITLAGTICS 18 //12
|
||||
#define HITLAGJITTERS (FRACUNIT / 20)
|
||||
|
||||
player_t *K_GetItemBoxPlayer(mobj_t *mobj);
|
||||
angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed);
|
||||
|
|
@ -69,6 +70,7 @@ void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers);
|
|||
void K_DestroyBumpers(player_t *player, UINT8 amount);
|
||||
void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount);
|
||||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
|
||||
void K_MineFlashScreen(mobj_t *source);
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
|
||||
void K_RunFinishLineBeam(void);
|
||||
UINT16 K_DriftSparkColor(player_t *player, INT32 charge);
|
||||
|
|
@ -92,6 +94,7 @@ void K_UpdateDistanceFromFinishLine(player_t *const player);
|
|||
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
|
||||
void K_UpdateSteeringValue(player_t *player, INT16 destSteering);
|
||||
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
|
||||
INT32 K_GetUnderwaterTurnAdjust(player_t *player);
|
||||
INT32 K_GetKartDriftSparkValue(player_t *player);
|
||||
INT32 K_StairJankFlip(INT32 value);
|
||||
INT32 K_GetKartDriftSparkValueForStage(player_t *player, UINT8 stage);
|
||||
|
|
@ -108,6 +111,7 @@ void K_MomentumToFacing(player_t *player);
|
|||
boolean K_ApplyOffroad(player_t *player);
|
||||
boolean K_SlopeResistance(player_t *player);
|
||||
boolean K_TripwirePass(player_t *player);
|
||||
boolean K_WaterRun(player_t *player);
|
||||
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
|
||||
INT16 K_GetSpindashChargeTime(player_t *player);
|
||||
fixed_t K_GetSpindashChargeSpeed(player_t *player);
|
||||
|
|
|
|||
254
src/p_enemy.c
254
src/p_enemy.c
|
|
@ -310,6 +310,7 @@ void A_JawzExplode(mobj_t *actor);
|
|||
void A_SPBChase(mobj_t *actor);
|
||||
void A_SSMineSearch(mobj_t *actor);
|
||||
void A_SSMineExplode(mobj_t *actor);
|
||||
void A_LandMineExplode(mobj_t *actor);
|
||||
void A_BallhogExplode(mobj_t *actor);
|
||||
void A_LightningFollowPlayer(mobj_t *actor);
|
||||
void A_FZBoomFlash(mobj_t *actor);
|
||||
|
|
@ -321,7 +322,6 @@ void A_ReaperThinker(mobj_t *actor);
|
|||
void A_MementosTPParticles(mobj_t *actor);
|
||||
void A_FlameShieldPaper(mobj_t *actor);
|
||||
void A_InvincSparkleRotate(mobj_t *actor);
|
||||
void A_SpawnItemCapsuleParts(mobj_t *actor);
|
||||
|
||||
//for p_enemy.c
|
||||
|
||||
|
|
@ -11195,10 +11195,13 @@ void A_MineExplode(mobj_t *actor)
|
|||
A_Scream(actor);
|
||||
actor->flags = MF_NOGRAVITY|MF_NOCLIP;
|
||||
|
||||
/*
|
||||
quake.epicenter = NULL;
|
||||
quake.radius = 512*FRACUNIT;
|
||||
quake.intensity = 8*FRACUNIT;
|
||||
quake.time = TICRATE/3;
|
||||
*/
|
||||
P_StartQuake(8<<FRACBITS, TICRATE/3);
|
||||
|
||||
P_RadiusAttack(actor, actor->tracer, 192*FRACUNIT, 0, true);
|
||||
P_MobjCheckWater(actor);
|
||||
|
|
@ -12205,9 +12208,9 @@ void A_Boss5BombExplode(mobj_t *actor)
|
|||
|
||||
P_DustRing(locvar1, 4, actor->x, actor->y, actor->z+actor->height, 2*actor->radius, 0, FRACUNIT, actor->scale);
|
||||
P_DustRing(locvar1, 6, actor->x, actor->y, actor->z+actor->height/2, 3*actor->radius, FRACUNIT, FRACUNIT, actor->scale);
|
||||
//P_StartQuake(9*actor->scale, TICRATE/6, {actor->x, actor->y, actor->z}, 20*actor->radius);
|
||||
//P_StartQuake(9*FRACUNIT, TICRATE/6, {actor->x, actor->y, actor->z}, 20*actor->radius);
|
||||
// the above does not exist, so we set the quake values directly instead
|
||||
quake.intensity = 9*actor->scale;
|
||||
quake.intensity = 9*FRACUNIT;
|
||||
quake.time = TICRATE/6;
|
||||
// the following quake values have no effect atm? ah well, may as well set them anyway
|
||||
{
|
||||
|
|
@ -14133,6 +14136,63 @@ void A_SSMineExplode(mobj_t *actor)
|
|||
actor->flags2 |= MF2_DEBRIS; // Set this flag to ensure that the explosion won't be effective more than 1 frame.
|
||||
}
|
||||
|
||||
void A_LandMineExplode(mobj_t *actor)
|
||||
{
|
||||
|
||||
mobj_t *expl;
|
||||
INT32 colour = SKINCOLOR_KETCHUP; // we spell words properly here
|
||||
INT32 i;
|
||||
mobj_t *smoldering;
|
||||
mobj_t *dust;
|
||||
|
||||
if (LUA_CallAction(A_LANDMINEEXPLODE, actor))
|
||||
return;
|
||||
|
||||
// we'll base the explosion "timer" off of some stupid variable like uh... cvmem!
|
||||
// Yeah let's use cvmem since nobody uses that
|
||||
|
||||
if (actor->target && !P_MobjWasRemoved(actor->target))
|
||||
colour = actor->target->color;
|
||||
|
||||
K_MineFlashScreen(actor);
|
||||
|
||||
// Spawn smoke remains:
|
||||
smoldering = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOLDERING);
|
||||
P_SetScale(smoldering, actor->scale);
|
||||
smoldering->tics = TICRATE*3;
|
||||
|
||||
// Spawn a ring:
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
dust = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOKE);
|
||||
P_SetMobjState(dust, S_OPAQUESMOKE1);
|
||||
dust->angle = (ANGLE_180/16) * i;
|
||||
P_SetScale(dust, actor->scale);
|
||||
dust->destscale = actor->scale*4;
|
||||
dust->scalespeed = actor->scale/4;
|
||||
P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, actor->scale));
|
||||
}
|
||||
|
||||
actor->fuse = actor->tics; // disappear when this state ends.
|
||||
|
||||
// spawn a few physics explosions
|
||||
for (i = 0; i < 15; i++)
|
||||
{
|
||||
expl = P_SpawnMobj(actor->x, actor->y, actor->z + actor->scale, MT_BOOMEXPLODE);
|
||||
expl->color = colour;
|
||||
expl->tics = (i+1);
|
||||
|
||||
//K_MatchGenericExtraFlags(expl, actor);
|
||||
P_SetScale(expl, actor->scale*4);
|
||||
|
||||
expl->momx = P_RandomRange(-3, 3)*actor->scale/2;
|
||||
expl->momy = P_RandomRange(-3, 3)*actor->scale/2;
|
||||
|
||||
// 100/45 = 2.22 fu/t
|
||||
expl->momz = ((i+1)*actor->scale*5/2)*P_MobjFlip(expl);
|
||||
}
|
||||
}
|
||||
|
||||
void A_BallhogExplode(mobj_t *actor)
|
||||
{
|
||||
mobj_t *mo2;
|
||||
|
|
@ -14652,191 +14712,3 @@ void A_InvincSparkleRotate(mobj_t *actor)
|
|||
|
||||
actor->angle += ANG1*10*(actor->extravalue2); // Arbitrary value, change this if you want, I suppose.
|
||||
}
|
||||
|
||||
void P_RefreshItemCapsuleParts(mobj_t *mobj)
|
||||
{
|
||||
UINT8 numNumbers = 0;
|
||||
INT32 count = 0;
|
||||
INT32 itemType = mobj->threshold;
|
||||
mobj_t *part;
|
||||
skincolornum_t color;
|
||||
UINT32 newRenderFlags = 0;
|
||||
boolean colorized;
|
||||
|
||||
if (itemType < 1 || itemType >= NUMKARTITEMS)
|
||||
itemType = KITEM_SAD;
|
||||
|
||||
// update invincibility properties
|
||||
if (itemType == KITEM_INVINCIBILITY)
|
||||
{
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_FULLBRIGHT;
|
||||
mobj->colorized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_SEMIBRIGHT;
|
||||
mobj->color = SKINCOLOR_NONE;
|
||||
mobj->colorized = false;
|
||||
}
|
||||
|
||||
// update cap colors
|
||||
if (itemType == KITEM_SUPERRING)
|
||||
{
|
||||
color = SKINCOLOR_GOLD;
|
||||
newRenderFlags |= RF_SEMIBRIGHT;
|
||||
}
|
||||
else if (mobj->spawnpoint && (mobj->spawnpoint->options & MTF_EXTRA))
|
||||
color = SKINCOLOR_SAPPHIRE;
|
||||
else if (itemType == KITEM_SPB)
|
||||
color = SKINCOLOR_JET;
|
||||
else
|
||||
color = SKINCOLOR_NONE;
|
||||
|
||||
colorized = (color != SKINCOLOR_NONE);
|
||||
part = mobj;
|
||||
while (!P_MobjWasRemoved(part->hnext))
|
||||
{
|
||||
part = part->hnext;
|
||||
part->color = color;
|
||||
part->colorized = colorized;
|
||||
part->renderflags = (part->renderflags & ~RF_BRIGHTMASK) | newRenderFlags;
|
||||
}
|
||||
|
||||
// update inside item frame
|
||||
part = mobj->tracer;
|
||||
if (P_MobjWasRemoved(part))
|
||||
return;
|
||||
|
||||
part->threshold = mobj->threshold;
|
||||
part->movecount = mobj->movecount;
|
||||
|
||||
switch (itemType)
|
||||
{
|
||||
case KITEM_ORBINAUT:
|
||||
part->sprite = SPR_ITMO;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetOrbinautItemFrame(mobj->movecount);
|
||||
break;
|
||||
case KITEM_INVINCIBILITY:
|
||||
part->sprite = SPR_ITMI;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetInvincibilityItemFrame();
|
||||
break;
|
||||
case KITEM_SAD:
|
||||
part->sprite = SPR_ITEM;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE;
|
||||
break;
|
||||
default:
|
||||
part->sprite = SPR_ITEM;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|(itemType);
|
||||
break;
|
||||
}
|
||||
|
||||
// update number frame
|
||||
if (K_GetShieldFromItem(itemType) != KSHIELD_NONE) // shields don't stack, so don't show a number
|
||||
;
|
||||
else
|
||||
{
|
||||
switch (itemType)
|
||||
{
|
||||
case KITEM_ORBINAUT: // only display the number when the sprite no longer changes
|
||||
if (mobj->movecount - 1 > K_GetOrbinautItemFrame(mobj->movecount))
|
||||
count = mobj->movecount;
|
||||
break;
|
||||
case KITEM_SUPERRING: // always display the number, and multiply it by 5
|
||||
count = mobj->movecount * 5;
|
||||
break;
|
||||
case KITEM_SAD: // never display the number
|
||||
case KITEM_SPB:
|
||||
break;
|
||||
default:
|
||||
if (mobj->movecount > 1)
|
||||
count = mobj->movecount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
if (P_MobjWasRemoved(part->tracer))
|
||||
{
|
||||
P_SetTarget(&part->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY));
|
||||
P_SetTarget(&part->tracer->target, part);
|
||||
P_SetMobjState(part->tracer, S_INVISIBLE);
|
||||
part->tracer->spriteyoffset = 10*FRACUNIT;
|
||||
part->tracer->spritexoffset = 13*numNumbers*FRACUNIT;
|
||||
}
|
||||
part = part->tracer;
|
||||
part->sprite = SPR_ITMN;
|
||||
part->frame = FF_FULLBRIGHT|(count % 10);
|
||||
count /= 10;
|
||||
numNumbers++;
|
||||
}
|
||||
|
||||
// delete any extra overlays (I guess in case the number changes?)
|
||||
if (part->tracer)
|
||||
{
|
||||
P_RemoveMobj(part->tracer);
|
||||
P_SetTarget(&part->tracer, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#define CAPSULESIDES 5
|
||||
#define ANG_CAPSULE (UINT32_MAX / CAPSULESIDES)
|
||||
#define ROTATIONSPEED (2*ANG2)
|
||||
void A_SpawnItemCapsuleParts(mobj_t *actor)
|
||||
{
|
||||
UINT8 i;
|
||||
mobj_t *part;
|
||||
fixed_t buttScale = 0;
|
||||
statenum_t buttState = S_ITEMCAPSULE_BOTTOM_SIDE_AIR;
|
||||
angle_t spin = ANGLE_MAX - ROTATIONSPEED;
|
||||
|
||||
if (LUA_CallAction(A_SPAWNITEMCAPSULEPARTS, actor))
|
||||
return;
|
||||
|
||||
if (P_IsObjectOnGround(actor))
|
||||
{
|
||||
buttScale = 13*FRACUNIT/10;
|
||||
buttState = S_ITEMCAPSULE_BOTTOM_SIDE_GROUND;
|
||||
spin = 0;
|
||||
}
|
||||
|
||||
// inside item
|
||||
part = P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART);
|
||||
P_SetTarget(&part->target, actor);
|
||||
P_SetMobjState(part, S_ITEMICON);
|
||||
part->movedir = ROTATIONSPEED; // rotation speed
|
||||
part->extravalue1 = 175*FRACUNIT/100; // relative scale
|
||||
part->flags2 |= MF2_CLASSICPUSH; // classicpush = centered horizontally
|
||||
P_SetTarget(&actor->tracer, part); // pointer to this item, so we can modify its sprite/frame
|
||||
|
||||
// capsule caps
|
||||
part = actor;
|
||||
for (i = 0; i < CAPSULESIDES; i++)
|
||||
{
|
||||
// a bottom side
|
||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||
P_SetTarget(&part->hnext->hprev, part);
|
||||
part = part->hnext;
|
||||
P_SetTarget(&part->target, actor);
|
||||
P_SetMobjState(part, buttState);
|
||||
part->angle = i * ANG_CAPSULE;
|
||||
part->movedir = spin; // rotation speed
|
||||
part->movefactor = 0; // z offset
|
||||
part->extravalue1 = buttScale; // relative scale
|
||||
|
||||
// a top side
|
||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||
P_SetTarget(&part->hnext->hprev, part);
|
||||
part = part->hnext;
|
||||
P_SetTarget(&part->target, actor);
|
||||
P_SetMobjState(part, S_ITEMCAPSULE_TOP_SIDE);
|
||||
part->angle = i * ANG_CAPSULE;
|
||||
part->movedir = spin; // rotation speed
|
||||
part->movefactor = actor->info->height - part->info->height; // z offset
|
||||
}
|
||||
|
||||
P_RefreshItemCapsuleParts(actor);
|
||||
}
|
||||
#undef CAPSULESIDES
|
||||
#undef ANG_CAPSULE
|
||||
#undef ROTATIONSPEED
|
||||
|
|
|
|||
|
|
@ -112,6 +112,10 @@ typedef struct camera_s
|
|||
fixed_t pan;
|
||||
// SRB2Kart: camera pitches on slopes
|
||||
angle_t pitch;
|
||||
|
||||
// Interpolation data
|
||||
fixed_t old_x, old_y, old_z;
|
||||
angle_t old_angle, old_aiming;
|
||||
} camera_t;
|
||||
|
||||
// demo freecam or something before i commit die
|
||||
|
|
@ -329,6 +333,7 @@ void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab);
|
|||
mobj_t *P_GetClosestAxis(mobj_t *source);
|
||||
|
||||
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover);
|
||||
boolean P_CheckSolidFFloorSurface(player_t *player, ffloor_t *rover);
|
||||
|
||||
void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot);
|
||||
|
||||
|
|
@ -365,8 +370,6 @@ void P_InternalFlickyBubble(mobj_t *actor);
|
|||
void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez);
|
||||
void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angle);
|
||||
|
||||
void P_RefreshItemCapsuleParts(mobj_t *mobj);
|
||||
|
||||
//
|
||||
// P_MAP
|
||||
//
|
||||
|
|
|
|||
18
src/p_map.c
18
src/p_map.c
|
|
@ -1848,7 +1848,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (thing->player && P_CheckSolidLava(rover))
|
||||
if (thing->player && P_CheckSolidFFloorSurface(thing->player, rover))
|
||||
;
|
||||
else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE))
|
||||
;
|
||||
|
|
@ -2414,6 +2414,20 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
|||
return true;
|
||||
}
|
||||
|
||||
static boolean P_WaterRunning(mobj_t *thing)
|
||||
{
|
||||
ffloor_t *rover = thing->floorrover;
|
||||
return rover && (rover->flags & FF_SWIMMABLE) &&
|
||||
P_IsObjectOnGround(thing);
|
||||
}
|
||||
|
||||
static boolean P_WaterStepUp(mobj_t *thing)
|
||||
{
|
||||
player_t *player = thing->player;
|
||||
return (player && player->waterskip) ||
|
||||
P_WaterRunning(thing);
|
||||
}
|
||||
|
||||
//
|
||||
// P_TryMove
|
||||
// Attempt to move to a new position.
|
||||
|
|
@ -2478,7 +2492,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
|
||||
fixed_t maxstep = maxstepmove;
|
||||
|
||||
if (thing->player && thing->player->waterskip)
|
||||
if (thing->player && P_WaterStepUp(thing))
|
||||
maxstep += maxstepmove; // Add some extra stepmove when waterskipping
|
||||
|
||||
// If using type Section1:13, double the maxstep.
|
||||
|
|
|
|||
|
|
@ -730,7 +730,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && P_CheckSolidLava(rover))
|
||||
if (mobj->player && P_CheckSolidFFloorSurface(mobj->player, rover))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
|
|
@ -772,7 +772,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && P_CheckSolidLava(rover))
|
||||
if (mobj->player && P_CheckSolidFFloorSurface(mobj->player, rover))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
|
|
|
|||
307
src/p_mobj.c
307
src/p_mobj.c
|
|
@ -1879,7 +1879,7 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
|
|||
topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL);
|
||||
|
||||
if (mo->player && P_CheckSolidLava(rover)) // only the player should stand on lava
|
||||
if (mo->player && P_CheckSolidFFloorSurface(mo->player, rover)) // only the player should stand on lava or run on water
|
||||
;
|
||||
else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only
|
||||
continue;
|
||||
|
|
@ -2295,7 +2295,7 @@ boolean P_ZMovement(mobj_t *mo)
|
|||
S_StartSound(mo, sfx_tink);
|
||||
}
|
||||
else
|
||||
mo->flags2 ^= RF_DONTDRAW;
|
||||
mo->renderflags ^= RF_DONTDRAW;
|
||||
}
|
||||
else if (mo->type == MT_DEBTSPIKE)
|
||||
{
|
||||
|
|
@ -2940,6 +2940,33 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
|||
return true;
|
||||
}
|
||||
|
||||
// P_CanRunOnWater
|
||||
//
|
||||
// Returns true if player can waterrun on the 3D floor
|
||||
//
|
||||
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
||||
{
|
||||
boolean flip = player->mo->eflags & MFE_VERTICALFLIP;
|
||||
fixed_t surfaceheight = flip ? player->mo->waterbottom : player->mo->watertop;
|
||||
fixed_t playerbottom = flip ? (player->mo->z + player->mo->height) : player->mo->z;
|
||||
fixed_t clip = flip ? (surfaceheight - playerbottom) : (playerbottom - surfaceheight);
|
||||
fixed_t span = player->mo->watertop - player->mo->waterbottom;
|
||||
|
||||
return
|
||||
clip > -(player->mo->height / 2) &&
|
||||
span > player->mo->height &&
|
||||
player->speed / 5 > abs(player->mo->momz) &&
|
||||
player->speed > K_GetKartSpeed(player, false) &&
|
||||
K_WaterRun(player) &&
|
||||
(rover->flags & FF_SWIMMABLE);
|
||||
}
|
||||
|
||||
boolean P_CheckSolidFFloorSurface(player_t *player, ffloor_t *rover)
|
||||
{
|
||||
return P_CheckSolidLava(rover) ||
|
||||
P_CanRunOnWater(player, rover);
|
||||
}
|
||||
|
||||
//
|
||||
// P_MobjCheckWater
|
||||
//
|
||||
|
|
@ -2955,7 +2982,10 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
ffloor_t *rover;
|
||||
player_t *p = mobj->player; // Will just be null if not a player.
|
||||
fixed_t height = mobj->height;
|
||||
fixed_t halfheight = height / 2;
|
||||
boolean wasgroundpounding = false;
|
||||
fixed_t top2 = P_GetSectorCeilingZAt(sector, mobj->x, mobj->y);
|
||||
fixed_t bot2 = P_GetSectorFloorZAt(sector, mobj->x, mobj->y);
|
||||
|
||||
// Default if no water exists.
|
||||
mobj->watertop = mobj->waterbottom = mobj->z - 1000*FRACUNIT;
|
||||
|
|
@ -2966,24 +2996,31 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE)
|
||||
|| (((rover->flags & FF_BLOCKPLAYER) && mobj->player)
|
||||
|| ((rover->flags & FF_BLOCKOTHERS) && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y);
|
||||
bottomheight = P_GetFFloorBottomZAt(rover, mobj->x, mobj->y);
|
||||
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE)
|
||||
|| (((rover->flags & FF_BLOCKPLAYER) && mobj->player)
|
||||
|| ((rover->flags & FF_BLOCKOTHERS) && !mobj->player)))
|
||||
{
|
||||
if (topheight < top2 && topheight > thingtop)
|
||||
top2 = topheight;
|
||||
if (bottomheight > bot2 && bottomheight < mobj->z)
|
||||
bot2 = bottomheight;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if (topheight < (thingtop - (height>>1))
|
||||
|| bottomheight > thingtop)
|
||||
if (topheight < (thingtop - halfheight)
|
||||
|| bottomheight > (thingtop + halfheight))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (topheight < mobj->z
|
||||
|| bottomheight > (mobj->z + (height>>1)))
|
||||
if (topheight < (mobj->z - halfheight)
|
||||
|| bottomheight > (mobj->z + halfheight))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -3011,6 +3048,12 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
}
|
||||
}
|
||||
|
||||
if (mobj->watertop > top2)
|
||||
mobj->watertop = top2;
|
||||
|
||||
if (mobj->waterbottom < bot2)
|
||||
mobj->waterbottom = bot2;
|
||||
|
||||
// Spectators and dead players don't get to do any of the things after this.
|
||||
if (p && (p->spectator || p->playerstate != PST_LIVE))
|
||||
return;
|
||||
|
|
@ -3661,6 +3704,9 @@ void P_PrecipThinker(precipmobj_t *mobj)
|
|||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
mobj->old_angle = mobj->angle;
|
||||
mobj->old_pitch = mobj->pitch;
|
||||
mobj->old_roll = mobj->roll;
|
||||
|
||||
P_CycleStateAnimation((mobj_t *)mobj);
|
||||
|
||||
|
|
@ -3807,8 +3853,12 @@ static void P_ItemCapsulePartThinker(mobj_t *mobj)
|
|||
P_SetScale(mobj, mobj->destscale = targetScale);
|
||||
|
||||
// find z position
|
||||
if (mobj->flags2 & MF2_CLASSICPUSH) // centered items should not be flipped
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_DONTDRAW) | (target->renderflags & RF_DONTDRAW);
|
||||
else
|
||||
K_GenericExtraFlagsNoZAdjust(mobj, target);
|
||||
if (mobj->flags & MFE_VERTICALFLIP)
|
||||
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
z = target->z + target->height - mobj->height - FixedMul(mobj->scale, mobj->movefactor);
|
||||
else
|
||||
z = target->z + FixedMul(mobj->scale, mobj->movefactor);
|
||||
|
|
@ -3825,6 +3875,193 @@ static void P_ItemCapsulePartThinker(mobj_t *mobj)
|
|||
}
|
||||
}
|
||||
|
||||
static void P_RefreshItemCapsuleParts(mobj_t *mobj)
|
||||
{
|
||||
UINT8 numNumbers = 0;
|
||||
INT32 count = 0;
|
||||
INT32 itemType = mobj->threshold;
|
||||
mobj_t *part;
|
||||
skincolornum_t color;
|
||||
UINT32 newRenderFlags = 0;
|
||||
boolean colorized;
|
||||
|
||||
if (itemType < 1 || itemType >= NUMKARTITEMS)
|
||||
itemType = KITEM_SAD;
|
||||
|
||||
// update invincibility properties
|
||||
if (itemType == KITEM_INVINCIBILITY)
|
||||
{
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_FULLBRIGHT;
|
||||
mobj->colorized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_SEMIBRIGHT;
|
||||
mobj->color = SKINCOLOR_NONE;
|
||||
mobj->colorized = false;
|
||||
}
|
||||
|
||||
// update cap colors
|
||||
if (itemType == KITEM_SUPERRING)
|
||||
{
|
||||
color = SKINCOLOR_GOLD;
|
||||
newRenderFlags |= RF_SEMIBRIGHT;
|
||||
}
|
||||
else if (mobj->spawnpoint && (mobj->spawnpoint->options & MTF_EXTRA))
|
||||
color = SKINCOLOR_SAPPHIRE;
|
||||
else if (itemType == KITEM_SPB)
|
||||
color = SKINCOLOR_JET;
|
||||
else
|
||||
color = SKINCOLOR_NONE;
|
||||
|
||||
colorized = (color != SKINCOLOR_NONE);
|
||||
part = mobj;
|
||||
while (!P_MobjWasRemoved(part->hnext))
|
||||
{
|
||||
part = part->hnext;
|
||||
part->color = color;
|
||||
part->colorized = colorized;
|
||||
part->renderflags = (part->renderflags & ~RF_BRIGHTMASK) | newRenderFlags;
|
||||
}
|
||||
|
||||
// update inside item frame
|
||||
part = mobj->tracer;
|
||||
if (P_MobjWasRemoved(part))
|
||||
return;
|
||||
|
||||
part->threshold = mobj->threshold;
|
||||
part->movecount = mobj->movecount;
|
||||
|
||||
switch (itemType)
|
||||
{
|
||||
case KITEM_ORBINAUT:
|
||||
part->sprite = SPR_ITMO;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetOrbinautItemFrame(mobj->movecount);
|
||||
break;
|
||||
case KITEM_INVINCIBILITY:
|
||||
part->sprite = SPR_ITMI;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetInvincibilityItemFrame();
|
||||
break;
|
||||
case KITEM_SAD:
|
||||
part->sprite = SPR_ITEM;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE;
|
||||
break;
|
||||
default:
|
||||
part->sprite = SPR_ITEM;
|
||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|(itemType);
|
||||
break;
|
||||
}
|
||||
|
||||
// update number frame
|
||||
if (K_GetShieldFromItem(itemType) != KSHIELD_NONE) // shields don't stack, so don't show a number
|
||||
;
|
||||
else
|
||||
{
|
||||
switch (itemType)
|
||||
{
|
||||
case KITEM_ORBINAUT: // only display the number when the sprite no longer changes
|
||||
if (mobj->movecount - 1 > K_GetOrbinautItemFrame(mobj->movecount))
|
||||
count = mobj->movecount;
|
||||
break;
|
||||
case KITEM_SUPERRING: // always display the number, and multiply it by 5
|
||||
count = mobj->movecount * 5;
|
||||
break;
|
||||
case KITEM_SAD: // never display the number
|
||||
case KITEM_SPB:
|
||||
break;
|
||||
default:
|
||||
if (mobj->movecount > 1)
|
||||
count = mobj->movecount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
if (P_MobjWasRemoved(part->tracer))
|
||||
{
|
||||
P_SetTarget(&part->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY));
|
||||
P_SetTarget(&part->tracer->target, part);
|
||||
P_SetMobjState(part->tracer, S_INVISIBLE);
|
||||
part->tracer->spriteyoffset = 10*FRACUNIT;
|
||||
part->tracer->spritexoffset = 13*numNumbers*FRACUNIT;
|
||||
}
|
||||
part = part->tracer;
|
||||
part->sprite = SPR_ITMN;
|
||||
part->frame = FF_FULLBRIGHT|(count % 10);
|
||||
count /= 10;
|
||||
numNumbers++;
|
||||
}
|
||||
|
||||
// delete any extra overlays (I guess in case the number changes?)
|
||||
if (part->tracer)
|
||||
{
|
||||
P_RemoveMobj(part->tracer);
|
||||
P_SetTarget(&part->tracer, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#define CAPSULESIDES 5
|
||||
#define ANG_CAPSULE (UINT32_MAX / CAPSULESIDES)
|
||||
#define ROTATIONSPEED (2*ANG2)
|
||||
static void P_SpawnItemCapsuleParts(mobj_t *mobj)
|
||||
{
|
||||
UINT8 i;
|
||||
mobj_t *part;
|
||||
fixed_t buttScale = 0;
|
||||
statenum_t buttState = S_ITEMCAPSULE_BOTTOM_SIDE_AIR;
|
||||
angle_t spin = ANGLE_MAX - ROTATIONSPEED;
|
||||
|
||||
if (P_IsObjectOnGround(mobj))
|
||||
{
|
||||
buttScale = 13*FRACUNIT/10;
|
||||
buttState = S_ITEMCAPSULE_BOTTOM_SIDE_GROUND;
|
||||
spin = 0;
|
||||
}
|
||||
|
||||
// inside item
|
||||
part = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART);
|
||||
P_SetTarget(&part->target, mobj);
|
||||
P_SetMobjState(part, S_ITEMICON);
|
||||
part->movedir = ROTATIONSPEED; // rotation speed
|
||||
part->extravalue1 = 175*FRACUNIT/100; // relative scale
|
||||
part->flags2 |= MF2_CLASSICPUSH; // classicpush = centered horizontally
|
||||
part->flags2 &= ~MF2_OBJECTFLIP; // centered item should not be flipped
|
||||
part->eflags &= ~MFE_VERTICALFLIP;
|
||||
P_SetTarget(&mobj->tracer, part); // pointer to this item, so we can modify its sprite/frame
|
||||
|
||||
// capsule caps
|
||||
part = mobj;
|
||||
for (i = 0; i < CAPSULESIDES; i++)
|
||||
{
|
||||
// a bottom side
|
||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||
P_SetTarget(&part->hnext->hprev, part);
|
||||
part = part->hnext;
|
||||
P_SetTarget(&part->target, mobj);
|
||||
P_SetMobjState(part, buttState);
|
||||
part->angle = i * ANG_CAPSULE;
|
||||
part->movedir = spin; // rotation speed
|
||||
part->movefactor = 0; // z offset
|
||||
part->extravalue1 = buttScale; // relative scale
|
||||
|
||||
// a top side
|
||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||
P_SetTarget(&part->hnext->hprev, part);
|
||||
part = part->hnext;
|
||||
P_SetTarget(&part->target, mobj);
|
||||
P_SetMobjState(part, S_ITEMCAPSULE_TOP_SIDE);
|
||||
part->angle = i * ANG_CAPSULE;
|
||||
part->movedir = spin; // rotation speed
|
||||
part->movefactor = mobj->info->height - part->info->height; // z offset
|
||||
}
|
||||
|
||||
P_RefreshItemCapsuleParts(mobj);
|
||||
}
|
||||
#undef CAPSULESIDES
|
||||
#undef ANG_CAPSULE
|
||||
#undef ROTATIONSPEED
|
||||
|
||||
//
|
||||
// P_BossTargetPlayer
|
||||
// If closest is true, find the closest player.
|
||||
|
|
@ -6179,6 +6416,14 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
mobj->z -= (mobj->height - oldHeight);
|
||||
}
|
||||
|
||||
// spawn parts if not done yet
|
||||
// (this SHOULD be done when the capsule is spawned, but gravflip isn't set up at that point)
|
||||
if (!(mobj->flags2 & MF2_JUSTATTACKED))
|
||||
{
|
||||
mobj->flags2 |= MF2_JUSTATTACKED;
|
||||
P_SpawnItemCapsuleParts(mobj);
|
||||
}
|
||||
|
||||
// update & animate capsule
|
||||
if (!P_MobjWasRemoved(mobj->tracer))
|
||||
{
|
||||
|
|
@ -8623,6 +8868,9 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
mobj->old_angle = mobj->angle;
|
||||
mobj->old_pitch = mobj->pitch;
|
||||
mobj->old_roll = mobj->roll;
|
||||
|
||||
// Remove dead target/tracer.
|
||||
if (mobj->target && P_MobjWasRemoved(mobj->target))
|
||||
|
|
@ -9513,8 +9761,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
// SRB2Kart
|
||||
case MT_ITEMCAPSULE:
|
||||
{
|
||||
fixed_t oldHeight = mobj->height;
|
||||
|
||||
// set default item & count
|
||||
#if 0 // set to 1 to test capsules with random items, e.g. with objectplace
|
||||
if (P_RandomChance(FRACUNIT/3))
|
||||
|
|
@ -9531,17 +9777,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
mobj->movecount = 1;
|
||||
#endif
|
||||
|
||||
// grounded/aerial properties
|
||||
P_AdjustMobjFloorZ_FFloors(mobj, mobj->subsector->sector, 0);
|
||||
if (!P_IsObjectOnGround(mobj))
|
||||
mobj->flags |= MF_NOGRAVITY;
|
||||
|
||||
// set starting scale
|
||||
mobj->extravalue1 = mobj->scale; // this acts as the capsule's destscale; we're avoiding P_MobjScaleThink because we want aerial capsules not to scale from their center
|
||||
mobj->scalespeed >>= 1;
|
||||
P_SetScale(mobj, mobj->destscale = mapobjectscale >> 4);
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
mobj->z += (oldHeight - mobj->height);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -9740,7 +9979,13 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
}
|
||||
}
|
||||
|
||||
// OK so we kind of need NOTHINK objects to still think
|
||||
// because otherwise they can never update their
|
||||
// interpolation values. They might need some other kind
|
||||
// of system, so consider this temporary...
|
||||
#if 0
|
||||
if (!(mobj->flags & MF_NOTHINK))
|
||||
#endif
|
||||
P_AddThinker(THINK_MOBJ, &mobj->thinker);
|
||||
|
||||
if (mobj->skin) // correct inadequecies above.
|
||||
|
|
@ -9780,6 +10025,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
mobj->old_angle = mobj->angle;
|
||||
mobj->old_pitch = mobj->pitch;
|
||||
mobj->old_roll = mobj->roll;
|
||||
|
||||
return mobj;
|
||||
}
|
||||
|
|
@ -9836,6 +10084,9 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
|
|||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
mobj->old_angle = mobj->angle;
|
||||
mobj->old_pitch = mobj->pitch;
|
||||
mobj->old_roll = mobj->roll;
|
||||
|
||||
return mobj;
|
||||
}
|
||||
|
|
@ -11811,6 +12062,22 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
|||
}
|
||||
case MT_ITEMCAPSULE:
|
||||
{
|
||||
// we have to adjust for reverse gravity early so that the below grounded checks work
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
mobj->z += FixedMul(mobj->extravalue1, mobj->info->height) - mobj->height;
|
||||
}
|
||||
|
||||
// determine whether this capsule is grounded or aerial
|
||||
if (mobj->subsector->sector->ffloors)
|
||||
P_AdjustMobjFloorZ_FFloors(mobj, mobj->subsector->sector, 0);
|
||||
if (mobj->subsector->polyList)
|
||||
P_AdjustMobjFloorZ_PolyObjs(mobj, mobj->subsector);
|
||||
if (!P_IsObjectOnGround(mobj))
|
||||
mobj->flags |= MF_NOGRAVITY;
|
||||
|
||||
// Angle = item type
|
||||
if (mthing->angle > 0 && mthing->angle < NUMKARTITEMS)
|
||||
mobj->threshold = mthing->angle;
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ typedef struct mobj_s
|
|||
|
||||
// More drawing info: to determine current sprite.
|
||||
angle_t angle, pitch, roll; // orientation
|
||||
angle_t old_angle, old_pitch, old_roll; // orientation interpolation
|
||||
angle_t rollangle;
|
||||
spritenum_t sprite; // used to find patch_t and flip value
|
||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||
|
|
@ -424,6 +425,7 @@ typedef struct precipmobj_s
|
|||
|
||||
// More drawing info: to determine current sprite.
|
||||
angle_t angle, pitch, roll; // orientation
|
||||
angle_t old_angle, old_pitch, old_roll; // orientation interpolation
|
||||
angle_t rollangle;
|
||||
spritenum_t sprite; // used to find patch_t and flip value
|
||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||
|
|
|
|||
|
|
@ -239,6 +239,8 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEINT32(save_p, players[i].aizdrifttilt);
|
||||
WRITEINT32(save_p, players[i].aizdriftturn);
|
||||
|
||||
WRITEINT32(save_p, players[i].underwatertilt);
|
||||
|
||||
WRITEFIXED(save_p, players[i].offroad);
|
||||
WRITEUINT8(save_p, players[i].waterskip);
|
||||
|
||||
|
|
@ -495,6 +497,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].aizdrifttilt = READINT32(save_p);
|
||||
players[i].aizdriftturn = READINT32(save_p);
|
||||
|
||||
players[i].underwatertilt = READINT32(save_p);
|
||||
|
||||
players[i].offroad = READFIXED(save_p);
|
||||
players[i].waterskip = READUINT8(save_p);
|
||||
|
||||
|
|
|
|||
|
|
@ -2982,9 +2982,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
|
||||
// reasonable defaults.
|
||||
if (!quake.intensity)
|
||||
quake.intensity = 8<<FRACBITS;
|
||||
quake.intensity = 8*mapobjectscale;
|
||||
if (!quake.radius)
|
||||
quake.radius = 512<<FRACBITS;
|
||||
quake.radius = 512*mapobjectscale;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -8752,6 +8752,6 @@ static void P_SpawnPushers(void)
|
|||
// epicenter and radius are not yet used.
|
||||
void P_StartQuake(fixed_t intensity, tic_t time)
|
||||
{
|
||||
quake.intensity = intensity;
|
||||
quake.intensity = FixedMul(intensity, mapobjectscale);
|
||||
quake.time = time;
|
||||
}
|
||||
|
|
|
|||
87
src/p_user.c
87
src/p_user.c
|
|
@ -1145,6 +1145,9 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
|||
ghost->old_x = mobj->old_x;
|
||||
ghost->old_y = mobj->old_y;
|
||||
ghost->old_z = mobj->old_z;
|
||||
ghost->old_angle = (mobj->player ? mobj->player->old_drawangle : mobj->old_angle);
|
||||
ghost->old_pitch = mobj->old_pitch;
|
||||
ghost->old_roll = mobj->old_roll;
|
||||
|
||||
return ghost;
|
||||
}
|
||||
|
|
@ -1769,6 +1772,55 @@ static void P_3dMovement(player_t *player)
|
|||
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
|
||||
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
|
||||
|
||||
{
|
||||
INT32 a = K_GetUnderwaterTurnAdjust(player);
|
||||
INT32 adj = 0;
|
||||
|
||||
if (a)
|
||||
{
|
||||
const fixed_t maxadj = ANG10/4;
|
||||
|
||||
adj = a / 4;
|
||||
|
||||
if (adj > 0)
|
||||
{
|
||||
if (adj > maxadj)
|
||||
adj = maxadj;
|
||||
}
|
||||
else if (adj < 0)
|
||||
{
|
||||
if (adj < -(maxadj))
|
||||
adj = -(maxadj);
|
||||
}
|
||||
|
||||
if (abs(player->underwatertilt + adj) > abs(a))
|
||||
adj = (a - player->underwatertilt);
|
||||
|
||||
if (abs(a) < abs(player->underwatertilt))
|
||||
adj = 0;
|
||||
|
||||
movepushangle += a;
|
||||
}
|
||||
|
||||
if (adj)
|
||||
{
|
||||
player->underwatertilt += adj;
|
||||
|
||||
if (abs(player->underwatertilt) > ANG30)
|
||||
{
|
||||
player->underwatertilt =
|
||||
player->underwatertilt > 0 ? ANG30
|
||||
: -(ANG30);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->underwatertilt =
|
||||
FixedMul(player->underwatertilt,
|
||||
7*FRACUNIT/8);
|
||||
}
|
||||
}
|
||||
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
|
||||
totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward);
|
||||
}
|
||||
|
|
@ -2055,6 +2107,10 @@ void P_MovePlayer(player_t *player)
|
|||
else if (player->drift != 0)
|
||||
{
|
||||
INT32 a = (ANGLE_45 / 5) * player->drift;
|
||||
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
a /= 2;
|
||||
|
||||
player->drawangle += a;
|
||||
}
|
||||
}
|
||||
|
|
@ -2848,6 +2904,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
subsector_t *newsubsec;
|
||||
#endif
|
||||
|
||||
thiscam->old_x = thiscam->x;
|
||||
thiscam->old_y = thiscam->y;
|
||||
thiscam->old_z = thiscam->z;
|
||||
thiscam->old_angle = thiscam->angle;
|
||||
thiscam->old_aiming = thiscam->aiming;
|
||||
|
||||
democam.soundmobj = NULL; // reset this each frame, we don't want the game crashing for stupid reasons now do we
|
||||
|
||||
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
||||
|
|
@ -3867,13 +3929,12 @@ static void P_HandleFollower(player_t *player)
|
|||
}
|
||||
|
||||
// Set follower colour
|
||||
|
||||
switch (player->followercolor)
|
||||
{
|
||||
case MAXSKINCOLORS: // "Match"
|
||||
case 255: // "Match" (-1)
|
||||
color = player->skincolor;
|
||||
break;
|
||||
case MAXSKINCOLORS+1: // "Opposite"
|
||||
case 254: // "Opposite" (-2)
|
||||
color = skincolors[player->skincolor].invcolor;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -3934,9 +3995,10 @@ static void P_HandleFollower(player_t *player)
|
|||
P_SetFollowerState(player->follower, player->follower->state->nextstate);
|
||||
|
||||
// move the follower next to us (yes, this is really basic maths but it looks pretty damn clean in practice)!
|
||||
player->follower->momx = (sx - player->follower->x)/fl.horzlag;
|
||||
player->follower->momy = (sy - player->follower->y)/fl.horzlag;
|
||||
player->follower->momz = (sz - player->follower->z)/fl.vertlag;
|
||||
// 02/09/2021: cast lag to int32 otherwise funny things happen since it was changed to uint32 in the struct
|
||||
player->follower->momx = (sx - player->follower->x)/ (INT32)fl.horzlag;
|
||||
player->follower->momy = (sy - player->follower->y)/ (INT32)fl.horzlag;
|
||||
player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag;
|
||||
player->follower->angle = player->mo->angle;
|
||||
|
||||
if (player->mo->colorized)
|
||||
|
|
@ -4160,6 +4222,9 @@ void P_PlayerThink(player_t *player)
|
|||
ticcmd_t *cmd;
|
||||
const size_t playeri = (size_t)(player - players);
|
||||
|
||||
player->old_drawangle = player->drawangle;
|
||||
player->old_viewrollangle = player->viewrollangle;
|
||||
|
||||
#ifdef PARANOIA
|
||||
if (!player->mo)
|
||||
I_Error("p_playerthink: players[%s].mo == NULL", sizeu1(playeri));
|
||||
|
|
@ -4172,11 +4237,6 @@ void P_PlayerThink(player_t *player)
|
|||
player->playerstate = PST_DEAD;
|
||||
}
|
||||
|
||||
if (player->mo->hitlag > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->awayviewmobj && P_MobjWasRemoved(player->awayviewmobj))
|
||||
{
|
||||
P_SetTarget(&player->awayviewmobj, NULL); // remove awayviewmobj asap if invalid
|
||||
|
|
@ -4192,6 +4252,11 @@ void P_PlayerThink(player_t *player)
|
|||
if (player->awayviewtics && player->awayviewtics != -1)
|
||||
player->awayviewtics--;
|
||||
|
||||
if (player->mo->hitlag > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Track airtime
|
||||
if (P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
|
|
|
|||
22
src/r_data.c
22
src/r_data.c
|
|
@ -615,6 +615,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
|
|||
{
|
||||
double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb, cdestbright;
|
||||
double maskamt = 0, othermask = 0;
|
||||
double fmaskamt = 0, fothermask = 0;
|
||||
|
||||
UINT8 cr = R_GetRgbaR(extra_colormap->rgba),
|
||||
cg = R_GetRgbaG(extra_colormap->rgba),
|
||||
|
|
@ -622,8 +623,8 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
|
|||
ca = R_GetRgbaA(extra_colormap->rgba),
|
||||
cfr = R_GetRgbaR(extra_colormap->fadergba),
|
||||
cfg = R_GetRgbaG(extra_colormap->fadergba),
|
||||
cfb = R_GetRgbaB(extra_colormap->fadergba);
|
||||
// cfa = R_GetRgbaA(extra_colormap->fadergba); // unused in software
|
||||
cfb = R_GetRgbaB(extra_colormap->fadergba),
|
||||
cfa = R_GetRgbaA(extra_colormap->fadergba);
|
||||
|
||||
UINT8 fadestart = extra_colormap->fadestart,
|
||||
fadedist = extra_colormap->fadeend - extra_colormap->fadestart;
|
||||
|
|
@ -654,14 +655,11 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
|
|||
cdestb = cfb;
|
||||
cdestbright = sqrt((cfr*cfr) + (cfg*cfg) + (cfb*cfb));
|
||||
|
||||
// fade alpha unused in software
|
||||
// maskamt = (double)(cfa/24.0l);
|
||||
// othermask = 1 - maskamt;
|
||||
// maskamt /= 0xff;
|
||||
fmaskamt = (double)(cfa/24.0l);
|
||||
fothermask = 1 - fmaskamt;
|
||||
//fmaskamt /= 0xff;
|
||||
|
||||
// cdestr *= maskamt;
|
||||
// cdestg *= maskamt;
|
||||
// cdestb *= maskamt;
|
||||
(void)fothermask; // unused, but don't feel like commenting it out
|
||||
|
||||
/////////////////////
|
||||
// This code creates the colormap array used by software renderer
|
||||
|
|
@ -701,16 +699,16 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
|
|||
if (cbrightness < cdestbright)
|
||||
{
|
||||
cbest = 255.0l - min(r, min(g, b));
|
||||
cdist = 255.0l - cdestbright;
|
||||
cdist = 255.0l - max(cdestr, max(cdestg, cdestb));
|
||||
}
|
||||
else
|
||||
{
|
||||
cbest = max(r, max(g, b));
|
||||
cdist = cdestbright;
|
||||
cdist = min(cdestr, min(cdestg, cdestb));
|
||||
}
|
||||
|
||||
// Add/subtract this value during fading.
|
||||
brightChange[i] = fabs(cbest - cdist) / (double)fadedist;
|
||||
brightChange[i] = (fabs(cbest - cdist) / (double)fadedist) * fmaskamt;
|
||||
}
|
||||
|
||||
// Now allocate memory for the actual colormap array itself!
|
||||
|
|
|
|||
24
src/r_fps.c
24
src/r_fps.c
|
|
@ -83,10 +83,7 @@ static void R_SetupFreelook(player_t *player, boolean skybox)
|
|||
|
||||
void R_InterpolateView(fixed_t frac)
|
||||
{
|
||||
boolean skybox = false;
|
||||
INT32 i;
|
||||
|
||||
if (FIXED_TO_FLOAT(frac) < 0)
|
||||
if (frac < 0)
|
||||
frac = 0;
|
||||
if (frac > FRACUNIT)
|
||||
frac = FRACUNIT;
|
||||
|
|
@ -97,31 +94,20 @@ void R_InterpolateView(fixed_t frac)
|
|||
|
||||
viewangle = oldview->angle + R_LerpAngle(oldview->angle, newview->angle, frac);
|
||||
aimingangle = oldview->aim + R_LerpAngle(oldview->aim, newview->aim, frac);
|
||||
viewroll = oldview->roll + R_LerpAngle(oldview->roll, newview->roll, frac);
|
||||
|
||||
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
// this is gonna create some interesting visual errors for long distance teleports...
|
||||
// might want to recalculate the view sector every frame instead...
|
||||
viewplayer = newview->player;
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
|
||||
// well, this ain't pretty
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (newview == &skyview_new[i])
|
||||
{
|
||||
skybox = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
R_SetupFreelook(newview->player, skybox);
|
||||
R_SetupFreelook(newview->player, newview->sky);
|
||||
}
|
||||
|
||||
void R_UpdateViewInterpolation(void)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 i;
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
|
|
@ -132,7 +118,7 @@ void R_UpdateViewInterpolation(void)
|
|||
|
||||
void R_SetViewContext(enum viewcontext_e _viewcontext)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 i = 0;
|
||||
|
||||
I_Assert(_viewcontext >= VIEWCONTEXT_PLAYER1
|
||||
&& _viewcontext <= VIEWCONTEXT_SKY4);
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ typedef struct {
|
|||
|
||||
angle_t angle;
|
||||
angle_t aim;
|
||||
angle_t roll;
|
||||
fixed_t cos;
|
||||
fixed_t sin;
|
||||
mobj_t *mobj;
|
||||
|
|
|
|||
34
src/r_main.c
34
src/r_main.c
|
|
@ -71,7 +71,7 @@ size_t framecount;
|
|||
size_t loopcount;
|
||||
|
||||
fixed_t viewx, viewy, viewz;
|
||||
angle_t viewangle, aimingangle;
|
||||
angle_t viewangle, aimingangle, viewroll;
|
||||
UINT8 viewssnum;
|
||||
fixed_t viewcos, viewsin;
|
||||
sector_t *viewsector;
|
||||
|
|
@ -652,7 +652,7 @@ void R_CheckViewMorph(int s)
|
|||
float fisheyemap[MAXVIDWIDTH/2 + 1];
|
||||
#endif
|
||||
|
||||
angle_t rollangle = R_ViewRollAngle(&players[displayplayers[s]]);
|
||||
angle_t rollangle = viewroll;
|
||||
#ifdef WOUGHMP_WOUGHMP
|
||||
fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value
|
||||
#endif
|
||||
|
|
@ -1202,8 +1202,8 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
|||
void R_SetupFrame(player_t *player)
|
||||
{
|
||||
camera_t *thiscam = &camera[0];
|
||||
boolean chasecam = false;
|
||||
UINT8 i;
|
||||
boolean chasecam = (cv_chasecam[0].value != 0);
|
||||
UINT8 i = 0;
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
|
|
@ -1217,12 +1217,17 @@ void R_SetupFrame(player_t *player)
|
|||
}
|
||||
|
||||
if (i > r_splitscreen)
|
||||
return; // shouldn't be possible, but just in case
|
||||
{
|
||||
i = 0; // Shouldn't be possible, but just in case.
|
||||
thiscam = &camera[0];
|
||||
chasecam = (cv_chasecam[0].value != 0);
|
||||
R_SetViewContext(VIEWCONTEXT_PLAYER1);
|
||||
}
|
||||
|
||||
if (player->spectator) // no spectator chasecam
|
||||
chasecam = false; // force chasecam off
|
||||
|
||||
if (chasecam && !thiscam->chase)
|
||||
if (chasecam && (thiscam && !thiscam->chase))
|
||||
{
|
||||
P_ResetCamera(player, thiscam);
|
||||
thiscam->chase = true;
|
||||
|
|
@ -1266,6 +1271,7 @@ void R_SetupFrame(player_t *player)
|
|||
newview->aim = localaiming[i];
|
||||
}
|
||||
}
|
||||
newview->roll = R_ViewRollAngle(player);
|
||||
newview->z += quake.z;
|
||||
|
||||
newview->player = player;
|
||||
|
|
@ -1298,7 +1304,7 @@ void R_SetupFrame(player_t *player)
|
|||
// newview->sin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
// newview->cos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
R_InterpolateView(cv_frameinterpolation.value == 1 ? rendertimefrac : FRACUNIT);
|
||||
R_InterpolateView(rendertimefrac);
|
||||
}
|
||||
|
||||
void R_SkyboxFrame(player_t *player)
|
||||
|
|
@ -1306,9 +1312,7 @@ void R_SkyboxFrame(player_t *player)
|
|||
camera_t *thiscam = &camera[0];
|
||||
UINT8 i = 0;
|
||||
|
||||
if (r_splitscreen)
|
||||
{
|
||||
for (i = 1; i <= r_splitscreen; i++)
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]])
|
||||
{
|
||||
|
|
@ -1320,8 +1324,9 @@ void R_SkyboxFrame(player_t *player)
|
|||
|
||||
if (i > r_splitscreen)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
i = 0; // Shouldn't be possible, but just in case.
|
||||
thiscam = &camera[0];
|
||||
R_SetViewContext(VIEWCONTEXT_SKY1);
|
||||
}
|
||||
|
||||
// cut-away view stuff
|
||||
|
|
@ -1339,7 +1344,7 @@ void R_SkyboxFrame(player_t *player)
|
|||
newview->aim = player->awayviewaiming;
|
||||
newview->angle = player->awayviewmobj->angle;
|
||||
}
|
||||
else if (thiscam->chase)
|
||||
else if (thiscam && thiscam->chase)
|
||||
{
|
||||
newview->aim = thiscam->aiming;
|
||||
newview->angle = thiscam->angle;
|
||||
|
|
@ -1355,6 +1360,7 @@ void R_SkyboxFrame(player_t *player)
|
|||
}
|
||||
}
|
||||
newview->angle += r_viewmobj->angle;
|
||||
newview->roll = R_ViewRollAngle(player);
|
||||
|
||||
newview->player = player;
|
||||
|
||||
|
|
@ -1441,7 +1447,7 @@ void R_SkyboxFrame(player_t *player)
|
|||
// newview->sin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
// newview->cos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
R_InterpolateView(cv_frameinterpolation.value == 1 ? rendertimefrac : FRACUNIT);
|
||||
R_InterpolateView(rendertimefrac);
|
||||
}
|
||||
|
||||
boolean R_ViewpointHasChasecam(player_t *player)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ static angle_t R_PlayerSpriteRotation(player_t *player, player_t *viewPlayer)
|
|||
|
||||
angle_t rollAngle = 0;
|
||||
|
||||
if (sliptideLift)
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
{
|
||||
rollAngle -= player->underwatertilt;
|
||||
}
|
||||
else if (sliptideLift)
|
||||
{
|
||||
/* (from side) tilt downward if turning
|
||||
toward camera, upward if away. */
|
||||
|
|
|
|||
|
|
@ -883,12 +883,12 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
{
|
||||
INT32 top, bottom;
|
||||
|
||||
planeripple.active = true;
|
||||
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
spanfunctype = SPANDRAWFUNC_WATER;
|
||||
planeripple.active = true;
|
||||
|
||||
// Copy the current scene, ugh
|
||||
top = pl->high-8;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ extern side_t *spawnsides;
|
|||
// POV data.
|
||||
//
|
||||
extern fixed_t viewx, viewy, viewz;
|
||||
extern angle_t viewangle, aimingangle;
|
||||
extern angle_t viewangle, aimingangle, viewroll;
|
||||
extern UINT8 viewssnum; // splitscreen view number
|
||||
extern boolean viewsky, skyVisible;
|
||||
extern boolean skyVisiblePerPlayer[MAXSPLITSCREENPLAYERS]; // saved values of skyVisible of each splitscreen player
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include "p_slopes.h"
|
||||
#include "d_netfil.h" // blargh. for nameonly().
|
||||
#include "m_cheat.h" // objectplace
|
||||
#include "k_color.h" // SRB2kart
|
||||
#include "p_local.h" // stplyr
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_md2.h"
|
||||
|
|
@ -44,6 +43,10 @@
|
|||
#include "hardware/hw_drv.h"
|
||||
#endif
|
||||
|
||||
// SRB2kart
|
||||
#include "k_color.h"
|
||||
#include "k_kart.h" // HITLAGJITTERS
|
||||
|
||||
#define MINZ (FRACUNIT*4)
|
||||
#define BASEYCENTER (BASEVIDHEIGHT/2)
|
||||
|
||||
|
|
@ -1431,31 +1434,29 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
fixed_t interpx = thing->x;
|
||||
fixed_t interpy = thing->y;
|
||||
fixed_t interpz = thing->z;
|
||||
angle_t interpangle = thing->angle;
|
||||
|
||||
// use player drawangle if player
|
||||
if (thing->player) interpangle = thing->player->drawangle;
|
||||
angle_t interpangle = (thing->player ? thing->player->drawangle : thing->angle);
|
||||
|
||||
// do interpolation
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||
interpz = thing->old_z + FixedMul(rendertimefrac, thing->z - thing->old_z);
|
||||
|
||||
if (thing->player)
|
||||
{
|
||||
interpangle = thing->player->drawangle;
|
||||
interpangle = thing->player->old_drawangle + FixedMul(rendertimefrac, thing->player->drawangle - thing->player->old_drawangle);
|
||||
}
|
||||
else
|
||||
{
|
||||
interpangle = thing->angle;
|
||||
interpangle = thing->old_angle + FixedMul(rendertimefrac, thing->angle - thing->old_angle);
|
||||
}
|
||||
}
|
||||
|
||||
// hitlag vibrating (todo: interp somehow?)
|
||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
||||
|
||||
if (leveltime & 1)
|
||||
{
|
||||
|
|
@ -1777,7 +1778,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
fixed_t linkscale;
|
||||
|
||||
thing = thing->tracer;
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(thing->x - thing->old_x, rendertimefrac);
|
||||
interpy = thing->old_y + FixedMul(thing->y - thing->old_y, rendertimefrac);
|
||||
|
|
@ -2126,7 +2127,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
fixed_t interpz = thing->z;
|
||||
|
||||
// do interpolation
|
||||
if (cv_frameinterpolation.value == 1 && !paused)
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||
|
|
|
|||
77
src/screen.c
77
src/screen.c
|
|
@ -453,9 +453,46 @@ boolean SCR_IsAspectCorrect(INT32 width, INT32 height)
|
|||
|
||||
// XMOD FPS display
|
||||
// moved out of os-specific code for consistency
|
||||
static boolean fpsgraph[TICRATE];
|
||||
static boolean ticsgraph[TICRATE];
|
||||
static tic_t lasttic;
|
||||
|
||||
static UINT32 fpstime = 0;
|
||||
static UINT32 lastupdatetime = 0;
|
||||
|
||||
#define FPSUPDATERATE 1/20 // What fraction of a second to update at. The fraction will not simplify to 0, trust me.
|
||||
#define FPSMAXSAMPLES 16
|
||||
|
||||
static UINT32 fpssamples[FPSMAXSAMPLES];
|
||||
static UINT32 fpssampleslen = 0;
|
||||
static UINT32 fpssum = 0;
|
||||
double aproxfps = 0.0f;
|
||||
|
||||
void SCR_CalcAproxFps(void)
|
||||
{
|
||||
tic_t i = 0;
|
||||
if (I_PreciseToMicros(fpstime - lastupdatetime) > 1000000 * FPSUPDATERATE)
|
||||
{
|
||||
if (fpssampleslen == FPSMAXSAMPLES)
|
||||
{
|
||||
fpssum -= fpssamples[0];
|
||||
|
||||
for (i = 1; i < fpssampleslen; i++)
|
||||
fpssamples[i-1] = fpssamples[i];
|
||||
}
|
||||
else
|
||||
fpssampleslen++;
|
||||
|
||||
fpssamples[fpssampleslen-1] = I_GetPreciseTime() - fpstime;
|
||||
fpssum += fpssamples[fpssampleslen-1];
|
||||
|
||||
aproxfps = 1000000 / (I_PreciseToMicros(fpssum) / (double)fpssampleslen);
|
||||
|
||||
lastupdatetime = I_GetPreciseTime();
|
||||
}
|
||||
|
||||
fpstime = I_GetPreciseTime();
|
||||
}
|
||||
|
||||
void SCR_DisplayTicRate(void)
|
||||
{
|
||||
tic_t i;
|
||||
|
|
@ -464,25 +501,51 @@ void SCR_DisplayTicRate(void)
|
|||
const UINT8 *ticcntcolor = NULL;
|
||||
|
||||
for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i)
|
||||
fpsgraph[i % TICRATE] = false;
|
||||
ticsgraph[i % TICRATE] = false;
|
||||
|
||||
fpsgraph[ontic % TICRATE] = true;
|
||||
ticsgraph[ontic % TICRATE] = true;
|
||||
|
||||
for (i = 0;i < TICRATE;++i)
|
||||
if (fpsgraph[i])
|
||||
if (ticsgraph[i])
|
||||
++totaltics;
|
||||
|
||||
if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
|
||||
else if (totaltics == TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
|
||||
|
||||
// draw "FPS"
|
||||
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
|
||||
|
||||
if (cv_frameinterpolation.value == 1)
|
||||
{
|
||||
if (aproxfps <= 15.0f) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
|
||||
else if (aproxfps >= 60.0f) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
|
||||
|
||||
/*
|
||||
if (cv_fpscap.value != 0)
|
||||
{
|
||||
// draw total frame:
|
||||
//V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, cv_fpscap.value, ticcntcolor);
|
||||
// draw "/"
|
||||
//V_DrawFixedPatch(306<<FRACBITS, 190<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, frameslash, ticcntcolor);
|
||||
// draw our actual framerate
|
||||
V_DrawPingNum(306, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, aproxfps, ticcntcolor);
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
// draw our actual framerate
|
||||
V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, aproxfps, ticcntcolor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totaltics <= 15) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
|
||||
else if (totaltics >= TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
|
||||
|
||||
// draw total frame:
|
||||
V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, TICRATE, ticcntcolor);
|
||||
// draw "/"
|
||||
V_DrawFixedPatch(306<<FRACBITS, 190<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, frameslash, ticcntcolor);
|
||||
// draw our actual framerate
|
||||
V_DrawPingNum(306, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, totaltics, ticcntcolor);
|
||||
}
|
||||
|
||||
|
||||
lasttic = ontic;
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ extern boolean R_SSE2;
|
|||
extern viddef_t vid;
|
||||
extern INT32 setmodeneeded; // mode number to set if needed, or 0
|
||||
extern UINT8 setrenderneeded;
|
||||
extern double aproxfps;
|
||||
|
||||
void SCR_ChangeRenderer(void);
|
||||
|
||||
|
|
@ -213,6 +214,8 @@ void SCR_CheckDefaultMode(void);
|
|||
// Set the mode number which is saved in the config
|
||||
void SCR_SetDefaultMode(void);
|
||||
|
||||
void SCR_CalcAproxFps(void);
|
||||
|
||||
FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height);
|
||||
|
||||
// move out to main code for consistency
|
||||
|
|
|
|||
|
|
@ -1292,6 +1292,8 @@ void I_FinishUpdate(void)
|
|||
if (I_SkipFrame())
|
||||
return;
|
||||
|
||||
SCR_CalcAproxFps();
|
||||
|
||||
if (st_overlay)
|
||||
{
|
||||
if (cv_ticrate.value)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue