mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-22 20:01:14 +00:00
Intro camera can noclip, fix several compile errors
This commit is contained in:
parent
6b222c4935
commit
7fdc9c8035
9 changed files with 46 additions and 30 deletions
|
@ -540,4 +540,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
|
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
|
||||||
#define SECTORSPECIALSAFTERTHINK
|
#define SECTORSPECIALSAFTERTHINK
|
||||||
|
|
||||||
|
/// SRB2Kart: Camera always has noclip.
|
||||||
|
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
|
||||||
|
//#define NOCLIPCAM
|
||||||
|
|
||||||
#endif // __DOOMDEF__
|
#endif // __DOOMDEF__
|
||||||
|
|
|
@ -409,6 +409,7 @@ extern UINT16 spacetimetics;
|
||||||
extern UINT16 extralifetics;
|
extern UINT16 extralifetics;
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
|
extern tic_t introtime;
|
||||||
extern tic_t starttime;
|
extern tic_t starttime;
|
||||||
extern INT32 hyudorotime;
|
extern INT32 hyudorotime;
|
||||||
extern INT32 stealtime;
|
extern INT32 stealtime;
|
||||||
|
|
|
@ -207,6 +207,7 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2);
|
||||||
UINT16 extralifetics = 4*TICRATE;
|
UINT16 extralifetics = 4*TICRATE;
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
|
tic_t introtime = 108;
|
||||||
tic_t starttime = 6*TICRATE + (3*TICRATE/4);
|
tic_t starttime = 6*TICRATE + (3*TICRATE/4);
|
||||||
INT32 hyudorotime = 7*TICRATE;
|
INT32 hyudorotime = 7*TICRATE;
|
||||||
INT32 stealtime = TICRATE/2;
|
INT32 stealtime = TICRATE/2;
|
||||||
|
@ -2974,6 +2975,8 @@ boolean G_IsSpecialStage(INT32 mapnum)
|
||||||
#if 0
|
#if 0
|
||||||
if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end)
|
if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end)
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
(void)mapnum;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
13
src/k_kart.c
13
src/k_kart.c
|
@ -538,7 +538,7 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem)
|
||||||
\return void
|
\return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean mashed)
|
static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, boolean mashed)
|
||||||
{
|
{
|
||||||
const INT32 distvar = (64*14);
|
const INT32 distvar = (64*14);
|
||||||
INT32 newodds;
|
INT32 newodds;
|
||||||
|
@ -771,7 +771,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
for (j = 0; j < NUMKARTRESULTS; j++)
|
for (j = 0; j < NUMKARTRESULTS; j++)
|
||||||
{
|
{
|
||||||
if (K_KartGetItemOdds(i, j, player, mashed) > 0)
|
if (K_KartGetItemOdds(i, j, mashed) > 0)
|
||||||
{
|
{
|
||||||
available = 1;
|
available = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -810,8 +810,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
|
UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
|
||||||
if (wantedpos > 4)
|
if (wantedpos > 4)
|
||||||
wantedpos = 4;
|
wantedpos = 4;
|
||||||
if (wantedpos < 0)
|
/*if (wantedpos < 0)
|
||||||
wantedpos = 0;
|
wantedpos = 0;*/
|
||||||
useodds = disttable[(wantedpos * distlen) / 5];
|
useodds = disttable[(wantedpos * distlen) / 5];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -853,7 +853,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
//CONS_Printf("Got useodds %d. (position: %d, distance: %d)\n", useodds, player->kartstuff[k_position], pdis);
|
//CONS_Printf("Got useodds %d. (position: %d, distance: %d)\n", useodds, player->kartstuff[k_position], pdis);
|
||||||
|
|
||||||
#define SETITEMRESULT(pos, itemnum) \
|
#define SETITEMRESULT(pos, itemnum) \
|
||||||
for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, player, mashed); chance++) \
|
for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, mashed); chance++) \
|
||||||
spawnchance[numchoices++] = itemnum
|
spawnchance[numchoices++] = itemnum
|
||||||
|
|
||||||
SETITEMRESULT(useodds, KITEM_SNEAKER); // Sneaker
|
SETITEMRESULT(useodds, KITEM_SNEAKER); // Sneaker
|
||||||
|
@ -2438,7 +2438,9 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed)
|
||||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
|
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
|
||||||
{
|
{
|
||||||
if (banana->hnext)
|
if (banana->hnext)
|
||||||
|
{
|
||||||
K_KillBananaChain(banana->hnext, inflictor, source);
|
K_KillBananaChain(banana->hnext, inflictor, source);
|
||||||
|
}
|
||||||
|
|
||||||
if (banana->health)
|
if (banana->health)
|
||||||
{
|
{
|
||||||
|
@ -3715,7 +3717,6 @@ void K_LoadKartHUDGraphics(void)
|
||||||
{
|
{
|
||||||
for (j = 0; j < NUMPOSFRAMES; j++)
|
for (j = 0; j < NUMPOSFRAMES; j++)
|
||||||
{
|
{
|
||||||
//if (i > 4 && j < 4 && j != 0) continue; // We don't need blue numbers for ranks past 4th
|
|
||||||
sprintf(buffer, "K_POSN%d%d", i, j);
|
sprintf(buffer, "K_POSN%d%d", i, j);
|
||||||
kp_positionnum[i][j] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
kp_positionnum[i][j] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4332,14 +4332,15 @@ static char *M_GetConditionString(condition_t cond)
|
||||||
case UC_EXTRAEMBLEM:
|
case UC_EXTRAEMBLEM:
|
||||||
return va("Get \"%s\" emblem", extraemblems[cond.requirement-1].name);
|
return va("Get \"%s\" emblem", extraemblems[cond.requirement-1].name);
|
||||||
default:
|
default:
|
||||||
return "";
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUMCHECKLIST 23
|
#define NUMCHECKLIST 23
|
||||||
static void M_DrawChecklist(void)
|
static void M_DrawChecklist(void)
|
||||||
{
|
{
|
||||||
INT32 i, line = 0, c, lastid;
|
UINT32 i, line = 0, c;
|
||||||
|
INT32 lastid;
|
||||||
|
|
||||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||||
{
|
{
|
||||||
|
@ -4366,7 +4367,7 @@ static void M_DrawChecklist(void)
|
||||||
|
|
||||||
++line;
|
++line;
|
||||||
|
|
||||||
if (cond.id != lastid)
|
if (lastid == -1 || cond.id != (UINT32)lastid)
|
||||||
{
|
{
|
||||||
V_DrawString(16, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), "*");
|
V_DrawString(16, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), "*");
|
||||||
V_DrawString(32, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), str);
|
V_DrawString(32, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), str);
|
||||||
|
|
|
@ -338,6 +338,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
|
||||||
boolean P_Move(mobj_t *actor, fixed_t speed);
|
boolean P_Move(mobj_t *actor, fixed_t speed);
|
||||||
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
||||||
void P_SlideMove(mobj_t *mo, boolean forceslide);
|
void P_SlideMove(mobj_t *mo, boolean forceslide);
|
||||||
|
void P_BouncePlayerMove(mobj_t *mo);
|
||||||
void P_BounceMove(mobj_t *mo);
|
void P_BounceMove(mobj_t *mo);
|
||||||
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
|
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
|
||||||
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);
|
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);
|
||||||
|
|
11
src/p_map.c
11
src/p_map.c
|
@ -2516,10 +2516,13 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||||
fixed_t tryx = thiscam->x;
|
fixed_t tryx = thiscam->x;
|
||||||
fixed_t tryy = thiscam->y;
|
fixed_t tryy = thiscam->y;
|
||||||
|
|
||||||
|
#ifndef NOCLIPCAM
|
||||||
if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP))
|
if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP))
|
||||||
|| (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP))
|
|| (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP))
|
||||||
|| (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP))
|
|| (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP))
|
||||||
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)))
|
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP))
|
||||||
|
|| (leveltime < introtime))
|
||||||
|
#endif
|
||||||
{ // Noclipping player camera noclips too!!
|
{ // Noclipping player camera noclips too!!
|
||||||
floatok = true;
|
floatok = true;
|
||||||
thiscam->floorz = thiscam->z;
|
thiscam->floorz = thiscam->z;
|
||||||
|
@ -3823,12 +3826,12 @@ stairstep:
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_PlayerBounceMove
|
// P_BouncePlayerMove
|
||||||
//
|
//
|
||||||
// Bounce move, for players.
|
// Bounce move, for players.
|
||||||
//
|
//
|
||||||
|
|
||||||
void P_PlayerBounceMove(mobj_t *mo)
|
void P_BouncePlayerMove(mobj_t *mo)
|
||||||
{
|
{
|
||||||
fixed_t leadx, leady;
|
fixed_t leadx, leady;
|
||||||
fixed_t trailx, traily;
|
fixed_t trailx, traily;
|
||||||
|
@ -3944,7 +3947,7 @@ void P_BounceMove(mobj_t *mo)
|
||||||
|
|
||||||
if (mo->player)
|
if (mo->player)
|
||||||
{
|
{
|
||||||
P_PlayerBounceMove(mo);
|
P_BouncePlayerMove(mo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
src/p_mobj.c
20
src/p_mobj.c
|
@ -3678,7 +3678,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
dummy.y = thiscam->y;
|
dummy.y = thiscam->y;
|
||||||
dummy.z = thiscam->z;
|
dummy.z = thiscam->z;
|
||||||
dummy.height = thiscam->height;
|
dummy.height = thiscam->height;
|
||||||
if (!resetcalled && !(player->pflags & PF_NOCLIP) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
|
if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
|
||||||
P_ResetCamera(player, thiscam);
|
P_ResetCamera(player, thiscam);
|
||||||
else
|
else
|
||||||
P_SlideCameraMove(thiscam);
|
P_SlideCameraMove(thiscam);
|
||||||
|
@ -3699,7 +3699,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
// adjust height
|
// adjust height
|
||||||
thiscam->z += thiscam->momz + player->mo->pmomz;
|
thiscam->z += thiscam->momz + player->mo->pmomz;
|
||||||
|
|
||||||
if (!itsatwodlevel && !(player->pflags & PF_NOCLIP))
|
#ifndef NOCLIPCAM
|
||||||
|
if (!itsatwodlevel && !(player->pflags & PF_NOCLIP || leveltime < introtime))
|
||||||
{
|
{
|
||||||
// clip movement
|
// clip movement
|
||||||
if (thiscam->z <= thiscam->floorz) // hit the floor
|
if (thiscam->z <= thiscam->floorz) // hit the floor
|
||||||
|
@ -3739,6 +3740,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itsatwodlevel
|
if (itsatwodlevel
|
||||||
|
@ -9337,13 +9339,7 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||||
iquetail = (iquetail+1)&(ITEMQUESIZE-1);
|
iquetail = (iquetail+1)&(ITEMQUESIZE-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mobj->type == MT_OVERLAY)
|
if (mobj->type == MT_KARMAHITBOX) // Remove linked list objects for certain types
|
||||||
P_RemoveOverlay(mobj);
|
|
||||||
|
|
||||||
if (mobj->type == MT_SHADOW)
|
|
||||||
P_RemoveShadow(mobj);
|
|
||||||
|
|
||||||
if (mobj->type == MT_KARMAHITBOX)
|
|
||||||
{
|
{
|
||||||
mobj_t *cur = mobj->hnext;
|
mobj_t *cur = mobj->hnext;
|
||||||
|
|
||||||
|
@ -9355,6 +9351,12 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mobj->type == MT_OVERLAY)
|
||||||
|
P_RemoveOverlay(mobj);
|
||||||
|
|
||||||
|
if (mobj->type == MT_SHADOW)
|
||||||
|
P_RemoveShadow(mobj);
|
||||||
|
|
||||||
mobj->health = 0; // Just because
|
mobj->health = 0; // Just because
|
||||||
|
|
||||||
// unlink from sector and block lists
|
// unlink from sector and block lists
|
||||||
|
|
16
src/p_user.c
16
src/p_user.c
|
@ -8136,12 +8136,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
subsector_t *newsubsec;
|
subsector_t *newsubsec;
|
||||||
fixed_t f1, f2;
|
fixed_t f1, f2;
|
||||||
|
|
||||||
#if 1
|
#ifdef NOCLIPCAM
|
||||||
cameranoclip = true; // We like camera noclip!
|
cameranoclip = true; // We like camera noclip!
|
||||||
#else
|
#else
|
||||||
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|
||||||
|| (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT))
|
|| (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
||||||
|| (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!!
|
|| (leveltime < introtime)); // Kart intro cam
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD))
|
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD))
|
||||||
|
@ -8276,12 +8276,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
lookback = camspin4;
|
lookback = camspin4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leveltime < 3*TICRATE) // Whoooshy camera!
|
if (leveltime < introtime) // Whoooshy camera!
|
||||||
{
|
{
|
||||||
const INT32 introcam = (3*TICRATE - leveltime) * 3;
|
const INT32 introcam = (introtime - leveltime);
|
||||||
camrotate += 3*introcam/2;
|
camrotate += introcam*5;
|
||||||
camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale);
|
camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*3;
|
||||||
camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale);
|
camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*2;
|
||||||
}
|
}
|
||||||
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
|
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
|
||||||
camstill = true;
|
camstill = true;
|
||||||
|
|
Loading…
Reference in a new issue