mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 01:31:30 +00:00
Merge branch 'master' of https://git.magicalgirl.moe/STJr/SRB2Internal.git into nights-inufixes
This commit is contained in:
commit
d405bdfd9b
17 changed files with 246 additions and 70 deletions
|
@ -822,6 +822,7 @@ void D_RegisterClientCommands(void)
|
||||||
COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
|
COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
|
||||||
COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
|
COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
|
||||||
COM_AddCommand("setrings", Command_Setrings_f);
|
COM_AddCommand("setrings", Command_Setrings_f);
|
||||||
|
COM_AddCommand("setspheres", Command_Setspheres_f);
|
||||||
COM_AddCommand("setlives", Command_Setlives_f);
|
COM_AddCommand("setlives", Command_Setlives_f);
|
||||||
COM_AddCommand("setcontinues", Command_Setcontinues_f);
|
COM_AddCommand("setcontinues", Command_Setcontinues_f);
|
||||||
COM_AddCommand("devmode", Command_Devmode_f);
|
COM_AddCommand("devmode", Command_Devmode_f);
|
||||||
|
@ -2798,15 +2799,15 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
READMEM(*cp, sentmd5, 16);
|
READMEM(*cp, sentmd5, 16);
|
||||||
|
|
||||||
|
if (client)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!adminpasswordset)
|
if (!adminpasswordset)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
|
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Do the final pass to compare with the sent md5
|
// Do the final pass to compare with the sent md5
|
||||||
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5);
|
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5);
|
||||||
|
|
||||||
|
|
|
@ -462,6 +462,7 @@ typedef struct player_s
|
||||||
tic_t startedtime; // Time which you started this mare with.
|
tic_t startedtime; // Time which you started this mare with.
|
||||||
tic_t finishedtime; // Time it took you to finish the mare (used for display)
|
tic_t finishedtime; // Time it took you to finish the mare (used for display)
|
||||||
INT16 finishedspheres; // The spheres you had left upon finishing the mare
|
INT16 finishedspheres; // The spheres you had left upon finishing the mare
|
||||||
|
INT16 finishedrings; // The rings/stars you had left upon finishing the mare
|
||||||
UINT32 marescore; // score for this nights stage
|
UINT32 marescore; // score for this nights stage
|
||||||
UINT32 lastmarescore; // score for the last mare
|
UINT32 lastmarescore; // score for the last mare
|
||||||
UINT8 lastmare; // previous mare
|
UINT8 lastmare; // previous mare
|
||||||
|
|
|
@ -6372,6 +6372,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_RING",
|
"MT_RING",
|
||||||
"MT_FLINGRING", // Lost ring
|
"MT_FLINGRING", // Lost ring
|
||||||
"MT_BLUESPHERE", // Blue sphere for special stages
|
"MT_BLUESPHERE", // Blue sphere for special stages
|
||||||
|
"MT_FLINGBLUESPHERE", // Lost blue sphere
|
||||||
"MT_BOMBSPHERE",
|
"MT_BOMBSPHERE",
|
||||||
"MT_REDTEAMRING", //Rings collectable by red team.
|
"MT_REDTEAMRING", //Rings collectable by red team.
|
||||||
"MT_BLUETEAMRING", //Rings collectable by blue team.
|
"MT_BLUETEAMRING", //Rings collectable by blue team.
|
||||||
|
@ -6836,6 +6837,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_HOOPCENTER", // Center of a hoop
|
"MT_HOOPCENTER", // Center of a hoop
|
||||||
"MT_NIGHTSCORE",
|
"MT_NIGHTSCORE",
|
||||||
"MT_NIGHTSCHIP", // NiGHTS Chip
|
"MT_NIGHTSCHIP", // NiGHTS Chip
|
||||||
|
"MT_FLINGNIGHTSCHIP", // Lost NiGHTS Chip
|
||||||
"MT_NIGHTSSTAR", // NiGHTS Star
|
"MT_NIGHTSSTAR", // NiGHTS Star
|
||||||
"MT_NIGHTSSUPERLOOP",
|
"MT_NIGHTSSUPERLOOP",
|
||||||
"MT_NIGHTSDRILLREFILL",
|
"MT_NIGHTSDRILLREFILL",
|
||||||
|
|
58
src/info.c
58
src/info.c
|
@ -5783,7 +5783,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
MT_NULL, // reactiontime
|
MT_FLINGBLUESPHERE, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
0, // painchance
|
0, // painchance
|
||||||
|
@ -5804,6 +5804,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_BLUESPHEREBONUS // raisestate
|
S_BLUESPHEREBONUS // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLINGBLUESPHERE
|
||||||
|
-1, // doomednum
|
||||||
|
S_BLUESPHERE, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
MT_FLINGBLUESPHERE, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
MT_BLUESPHERE, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_BLUESPHERESPARK, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_s3k65, // deathsound
|
||||||
|
38*FRACUNIT, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
24*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SLIDEME|MF_SPECIAL, // flags
|
||||||
|
S_BLUESPHEREBONUS // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_BOMBSPHERE
|
{ // MT_BOMBSPHERE
|
||||||
520, // doomednum
|
520, // doomednum
|
||||||
S_BOMBSPHERE1, // spawnstate
|
S_BOMBSPHERE1, // spawnstate
|
||||||
|
@ -16320,7 +16347,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
8, // reactiontime
|
MT_FLINGNIGHTSCHIP, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
0, // painchance
|
0, // painchance
|
||||||
|
@ -16341,6 +16368,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NIGHTSCHIPBONUS // raisestate
|
S_NIGHTSCHIPBONUS // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLINGNIGHTSCHIP
|
||||||
|
-1, // doomednum
|
||||||
|
S_NIGHTSCHIP, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
MT_FLINGNIGHTSCHIP, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
MT_NIGHTSCHIP, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_SPRK1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_ncchip, // deathsound
|
||||||
|
38*FRACUNIT, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
24*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SLIDEME|MF_SPECIAL, // flags
|
||||||
|
S_NIGHTSCHIPBONUS // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_NIGHTSSTAR
|
{ // MT_NIGHTSSTAR
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_NIGHTSSTAR, // spawnstate
|
S_NIGHTSSTAR, // spawnstate
|
||||||
|
|
|
@ -3742,6 +3742,7 @@ typedef enum mobj_type
|
||||||
MT_RING,
|
MT_RING,
|
||||||
MT_FLINGRING, // Lost ring
|
MT_FLINGRING, // Lost ring
|
||||||
MT_BLUESPHERE, // Blue sphere for special stages
|
MT_BLUESPHERE, // Blue sphere for special stages
|
||||||
|
MT_FLINGBLUESPHERE, // Lost blue sphere
|
||||||
MT_BOMBSPHERE,
|
MT_BOMBSPHERE,
|
||||||
MT_REDTEAMRING, //Rings collectable by red team.
|
MT_REDTEAMRING, //Rings collectable by red team.
|
||||||
MT_BLUETEAMRING, //Rings collectable by blue team.
|
MT_BLUETEAMRING, //Rings collectable by blue team.
|
||||||
|
@ -4206,6 +4207,7 @@ typedef enum mobj_type
|
||||||
MT_HOOPCENTER, // Center of a hoop
|
MT_HOOPCENTER, // Center of a hoop
|
||||||
MT_NIGHTSCORE,
|
MT_NIGHTSCORE,
|
||||||
MT_NIGHTSCHIP, // NiGHTS Chip
|
MT_NIGHTSCHIP, // NiGHTS Chip
|
||||||
|
MT_FLINGNIGHTSCHIP, // Lost NiGHTS Chip
|
||||||
MT_NIGHTSSTAR, // NiGHTS Star
|
MT_NIGHTSSTAR, // NiGHTS Star
|
||||||
MT_NIGHTSSUPERLOOP,
|
MT_NIGHTSSUPERLOOP,
|
||||||
MT_NIGHTSDRILLREFILL,
|
MT_NIGHTSDRILLREFILL,
|
||||||
|
|
|
@ -298,6 +298,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushinteger(L, plr->finishedtime);
|
lua_pushinteger(L, plr->finishedtime);
|
||||||
else if (fastcmp(field,"finishedspheres"))
|
else if (fastcmp(field,"finishedspheres"))
|
||||||
lua_pushinteger(L, plr->finishedspheres);
|
lua_pushinteger(L, plr->finishedspheres);
|
||||||
|
else if (fastcmp(field,"finishedrings"))
|
||||||
|
lua_pushinteger(L, plr->finishedrings);
|
||||||
else if (fastcmp(field,"marescore"))
|
else if (fastcmp(field,"marescore"))
|
||||||
lua_pushinteger(L, plr->marescore);
|
lua_pushinteger(L, plr->marescore);
|
||||||
else if (fastcmp(field,"lastmarescore"))
|
else if (fastcmp(field,"lastmarescore"))
|
||||||
|
@ -576,6 +578,8 @@ static int player_set(lua_State *L)
|
||||||
plr->finishedtime = (tic_t)luaL_checkinteger(L, 3);
|
plr->finishedtime = (tic_t)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"finishedspheres"))
|
else if (fastcmp(field,"finishedspheres"))
|
||||||
plr->finishedspheres = (INT16)luaL_checkinteger(L, 3);
|
plr->finishedspheres = (INT16)luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"finishedrings"))
|
||||||
|
plr->finishedrings = (INT16)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"marescore"))
|
else if (fastcmp(field,"marescore"))
|
||||||
plr->marescore = (UINT32)luaL_checkinteger(L, 3);
|
plr->marescore = (UINT32)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"lastmarescore"))
|
else if (fastcmp(field,"lastmarescore"))
|
||||||
|
|
|
@ -572,9 +572,23 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LUA_TSTRING:
|
case LUA_TSTRING:
|
||||||
|
{
|
||||||
|
UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||||
|
const char *s = lua_tostring(gL, myindex);
|
||||||
|
UINT16 i = 0;
|
||||||
WRITEUINT8(save_p, ARCH_STRING);
|
WRITEUINT8(save_p, ARCH_STRING);
|
||||||
WRITESTRING(save_p, lua_tostring(gL, myindex));
|
// if you're wondering why we're writing a string to save_p this way,
|
||||||
|
// it turns out that Lua can have embedded zeros ('\0') in the strings,
|
||||||
|
// so we can't use WRITESTRING as that cuts off when it finds a '\0'.
|
||||||
|
// Saving the size of the string also allows us to get the size of the string on the other end,
|
||||||
|
// fixing the awful crashes previously encountered for reading strings longer than 1024
|
||||||
|
// (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?)
|
||||||
|
// -- Monster Iestyn 05/08/18
|
||||||
|
WRITEUINT16(save_p, len); // save size of string
|
||||||
|
while (i < len)
|
||||||
|
WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case LUA_TTABLE:
|
case LUA_TTABLE:
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
@ -905,9 +919,19 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
||||||
break;
|
break;
|
||||||
case ARCH_STRING:
|
case ARCH_STRING:
|
||||||
{
|
{
|
||||||
char value[1024];
|
UINT16 len = READUINT16(save_p); // length of string, including embedded zeros
|
||||||
READSTRING(save_p, value);
|
char *value;
|
||||||
lua_pushstring(gL, value);
|
UINT16 i = 0;
|
||||||
|
// See my comments in the ArchiveValue function;
|
||||||
|
// it's much the same for reading strings as writing them!
|
||||||
|
// (i.e. we can't use READSTRING either)
|
||||||
|
// -- Monster Iestyn 05/08/18
|
||||||
|
value = malloc(len); // make temp buffer of size len
|
||||||
|
// now read the actual string
|
||||||
|
while (i < len)
|
||||||
|
value[i++] = READCHAR(save_p); // read chars individually, including the embedded zeros
|
||||||
|
lua_pushlstring(gL, value, len); // push the string (note: this function supports embedded zeros)
|
||||||
|
free(value); // free the buffer
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ARCH_TABLE:
|
case ARCH_TABLE:
|
||||||
|
|
|
@ -890,6 +890,23 @@ void Command_Setrings_f(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Command_Setspheres_f(void)
|
||||||
|
{
|
||||||
|
REQUIRE_INLEVEL;
|
||||||
|
REQUIRE_SINGLEPLAYER;
|
||||||
|
REQUIRE_NOULTIMATE;
|
||||||
|
REQUIRE_PANDORA;
|
||||||
|
|
||||||
|
if (COM_Argc() > 1)
|
||||||
|
{
|
||||||
|
// P_GivePlayerRings does value clamping
|
||||||
|
players[consoleplayer].spheres = 0;
|
||||||
|
P_GivePlayerSpheres(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||||
|
|
||||||
|
G_SetGameModified(multiplayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Command_Setlives_f(void)
|
void Command_Setlives_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
|
|
|
@ -51,6 +51,7 @@ void Command_Savecheckpoint_f(void);
|
||||||
void Command_Getallemeralds_f(void);
|
void Command_Getallemeralds_f(void);
|
||||||
void Command_Resetemeralds_f(void);
|
void Command_Resetemeralds_f(void);
|
||||||
void Command_Setrings_f(void);
|
void Command_Setrings_f(void);
|
||||||
|
void Command_Setspheres_f(void);
|
||||||
void Command_Setlives_f(void);
|
void Command_Setlives_f(void);
|
||||||
void Command_Setcontinues_f(void);
|
void Command_Setcontinues_f(void);
|
||||||
void Command_Devmode_f(void);
|
void Command_Devmode_f(void);
|
||||||
|
|
|
@ -5273,6 +5273,9 @@ static void M_HandleAddons(INT32 choice)
|
||||||
static void M_PandorasBox(INT32 choice)
|
static void M_PandorasBox(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)choice;
|
(void)choice;
|
||||||
|
if (maptol & TOL_NIGHTS)
|
||||||
|
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].spheres, 0));
|
||||||
|
else
|
||||||
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
|
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
|
||||||
if (players[consoleplayer].lives == 0x7f)
|
if (players[consoleplayer].lives == 0x7f)
|
||||||
CV_StealthSetValue(&cv_dummylives, -1);
|
CV_StealthSetValue(&cv_dummylives, -1);
|
||||||
|
@ -5291,7 +5294,12 @@ static void M_PandorasBox(INT32 choice)
|
||||||
static boolean M_ExitPandorasBox(void)
|
static boolean M_ExitPandorasBox(void)
|
||||||
{
|
{
|
||||||
if (cv_dummyrings.value != max(players[consoleplayer].rings, 0))
|
if (cv_dummyrings.value != max(players[consoleplayer].rings, 0))
|
||||||
|
{
|
||||||
|
if (maptol & TOL_NIGHTS)
|
||||||
|
COM_ImmedExecute(va("setspheres %d", cv_dummyrings.value));
|
||||||
|
else
|
||||||
COM_ImmedExecute(va("setrings %d", cv_dummyrings.value));
|
COM_ImmedExecute(va("setrings %d", cv_dummyrings.value));
|
||||||
|
}
|
||||||
if (cv_dummylives.value != players[consoleplayer].lives)
|
if (cv_dummylives.value != players[consoleplayer].lives)
|
||||||
COM_ImmedExecute(va("setlives %d", cv_dummylives.value));
|
COM_ImmedExecute(va("setlives %d", cv_dummylives.value));
|
||||||
if (cv_dummycontinues.value != players[consoleplayer].continues)
|
if (cv_dummycontinues.value != players[consoleplayer].continues)
|
||||||
|
|
|
@ -490,7 +490,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
P_DoNightsScore(player);
|
P_DoNightsScore(player);
|
||||||
break;
|
break;
|
||||||
case MT_BLUESPHERE:
|
case MT_BLUESPHERE:
|
||||||
|
case MT_FLINGBLUESPHERE:
|
||||||
case MT_NIGHTSCHIP:
|
case MT_NIGHTSCHIP:
|
||||||
|
case MT_FLINGNIGHTSCHIP:
|
||||||
if (!(P_CanPickupItem(player, false)) && !(special->flags2 & MF2_NIGHTSPULL))
|
if (!(P_CanPickupItem(player, false)) && !(special->flags2 & MF2_NIGHTSPULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2774,18 +2776,26 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->rings > 0) // Ring loss
|
if (player->powers[pw_carry] == CR_NIGHTSFALL)
|
||||||
|
{
|
||||||
|
if (player->spheres > 0)
|
||||||
|
{
|
||||||
|
P_PlayRinglossSound(target);
|
||||||
|
P_PlayerRingBurst(player, player->spheres);
|
||||||
|
player->spheres = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player->rings > 0) // Ring loss
|
||||||
{
|
{
|
||||||
P_PlayRinglossSound(target);
|
P_PlayRinglossSound(target);
|
||||||
P_PlayerRingBurst(player, player->rings);
|
P_PlayerRingBurst(player, player->rings);
|
||||||
|
player->rings = 0;
|
||||||
}
|
}
|
||||||
else // Death
|
else // Death
|
||||||
{
|
{
|
||||||
P_PlayDeathSound(target);
|
P_PlayDeathSound(target);
|
||||||
P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!!
|
P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!!
|
||||||
}
|
}
|
||||||
|
|
||||||
player->rings = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3000,7 +3010,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype, boolean dospheres)
|
||||||
{
|
{
|
||||||
P_DoPlayerPain(player, source, inflictor);
|
P_DoPlayerPain(player, source, inflictor);
|
||||||
|
|
||||||
|
@ -3030,10 +3040,20 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
|
||||||
// Ring loss sound plays despite hitting spikes
|
// Ring loss sound plays despite hitting spikes
|
||||||
P_PlayRinglossSound(player->mo); // Ringledingle!
|
P_PlayRinglossSound(player->mo); // Ringledingle!
|
||||||
P_PlayerRingBurst(player, damage);
|
P_PlayerRingBurst(player, damage);
|
||||||
|
|
||||||
|
if (dospheres)
|
||||||
|
{
|
||||||
|
player->spheres -= damage;
|
||||||
|
if (player->spheres < 0)
|
||||||
|
player->spheres = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
player->rings -= damage;
|
player->rings -= damage;
|
||||||
if (player->rings < 0)
|
if (player->rings < 0)
|
||||||
player->rings = 0;
|
player->rings = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_SpecialStageDamage
|
// P_SpecialStageDamage
|
||||||
|
@ -3249,7 +3269,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
if (damagetype & DMG_DEATHMASK)
|
if (damagetype & DMG_DEATHMASK)
|
||||||
{
|
{
|
||||||
P_KillPlayer(player, source, damage);
|
P_KillPlayer(player, source, damage);
|
||||||
player->rings = 0;
|
player->rings = player->spheres = 0;
|
||||||
}
|
}
|
||||||
else if (metalrecording)
|
else if (metalrecording)
|
||||||
{
|
{
|
||||||
|
@ -3293,10 +3313,19 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
damage = 0;
|
damage = 0;
|
||||||
}
|
}
|
||||||
|
else if (player->powers[pw_carry] == CR_NIGHTSFALL)
|
||||||
|
{
|
||||||
|
if (player->spheres > 0)
|
||||||
|
{
|
||||||
|
damage = player->spheres;
|
||||||
|
P_RingDamage(player, inflictor, source, damage, damagetype, true);
|
||||||
|
damage = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (player->rings > 0) // No shield but have rings.
|
else if (player->rings > 0) // No shield but have rings.
|
||||||
{
|
{
|
||||||
damage = player->rings;
|
damage = player->rings;
|
||||||
P_RingDamage(player, inflictor, source, damage, damagetype);
|
P_RingDamage(player, inflictor, source, damage, damagetype, false);
|
||||||
damage = 0;
|
damage = 0;
|
||||||
}
|
}
|
||||||
// To reduce griefing potential, don't allow players to be killed
|
// To reduce griefing potential, don't allow players to be killed
|
||||||
|
@ -3377,13 +3406,14 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
||||||
angle_t fa;
|
angle_t fa;
|
||||||
fixed_t ns;
|
fixed_t ns;
|
||||||
fixed_t z;
|
fixed_t z;
|
||||||
|
boolean nightsreplace = ((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap));
|
||||||
|
|
||||||
// Better safe than sorry.
|
// Better safe than sorry.
|
||||||
if (!player)
|
if (!player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If no health, don't spawn ring!
|
// If no health, don't spawn ring!
|
||||||
if (player->rings <= 0)
|
if (((maptol & TOL_NIGHTS) && player->spheres <= 0) || (!(maptol & TOL_NIGHTS) && player->rings <= 0))
|
||||||
num_rings = 0;
|
num_rings = 0;
|
||||||
|
|
||||||
if (num_rings > 32 && player->powers[pw_carry] != CR_NIGHTSFALL)
|
if (num_rings > 32 && player->powers[pw_carry] != CR_NIGHTSFALL)
|
||||||
|
@ -3400,6 +3430,8 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
||||||
INT32 objType = mobjinfo[MT_RING].reactiontime;
|
INT32 objType = mobjinfo[MT_RING].reactiontime;
|
||||||
if (mariomode)
|
if (mariomode)
|
||||||
objType = mobjinfo[MT_COIN].reactiontime;
|
objType = mobjinfo[MT_COIN].reactiontime;
|
||||||
|
else if (player->powers[pw_carry] == CR_NIGHTSFALL)
|
||||||
|
objType = mobjinfo[(nightsreplace ? MT_NIGHTSCHIP : MT_BLUESPHERE)].reactiontime;
|
||||||
|
|
||||||
z = player->mo->z;
|
z = player->mo->z;
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
@ -3428,6 +3460,9 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
||||||
|
|
||||||
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
|
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
|
||||||
mo->fuse = 20*TICRATE; // Adjust fuse for NiGHTS
|
mo->fuse = 20*TICRATE; // Adjust fuse for NiGHTS
|
||||||
|
|
||||||
|
// Toggle bonus time colors
|
||||||
|
P_SetMobjState(mo, (player->bonustime ? mo->info->raisestate : mo->info->spawnstate));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1109,14 +1109,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
// not (your direction) xor (stored direction)
|
// not (your direction) xor (stored direction)
|
||||||
// In other words, you can't u-turn and respawn rings near the drone.
|
// In other words, you can't u-turn and respawn rings near the drone.
|
||||||
if (pl->bonustime && (pl->powers[pw_carry] == CR_NIGHTSMODE) && (INT32)leveltime > droneobj->extravalue2 && (
|
if (pl->bonustime && (pl->powers[pw_carry] == CR_NIGHTSMODE) && (INT32)leveltime > droneobj->extravalue2 && (
|
||||||
!(pl->anotherflyangle >= 90 && pl->anotherflyangle <= 270)
|
!(pl->flyangle > 90 && pl->flyangle < 270)
|
||||||
^ (droneobj->extravalue1 >= 90 && droneobj->extravalue1 <= 270)
|
^ (droneobj->extravalue1 > 90 && droneobj->extravalue1 < 270)
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
// Reload all the fancy ring stuff!
|
// Reload all the fancy ring stuff!
|
||||||
P_ReloadRings();
|
P_ReloadRings();
|
||||||
}
|
}
|
||||||
droneobj->extravalue1 = pl->anotherflyangle;
|
droneobj->extravalue1 = pl->flyangle;
|
||||||
droneobj->extravalue2 = (INT32)leveltime + TICRATE;
|
droneobj->extravalue2 = (INT32)leveltime + TICRATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -1539,6 +1539,8 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
{
|
{
|
||||||
case MT_FLINGRING:
|
case MT_FLINGRING:
|
||||||
case MT_FLINGCOIN:
|
case MT_FLINGCOIN:
|
||||||
|
case MT_FLINGBLUESPHERE:
|
||||||
|
case MT_FLINGNIGHTSCHIP:
|
||||||
case MT_FLINGEMERALD:
|
case MT_FLINGEMERALD:
|
||||||
case MT_BOUNCERING:
|
case MT_BOUNCERING:
|
||||||
case MT_RAILRING:
|
case MT_RAILRING:
|
||||||
|
@ -2523,6 +2525,8 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
case MT_BLUETEAMRING:
|
case MT_BLUETEAMRING:
|
||||||
case MT_FLINGRING:
|
case MT_FLINGRING:
|
||||||
case MT_FLINGCOIN:
|
case MT_FLINGCOIN:
|
||||||
|
case MT_FLINGBLUESPHERE:
|
||||||
|
case MT_FLINGNIGHTSCHIP:
|
||||||
case MT_FLINGEMERALD:
|
case MT_FLINGEMERALD:
|
||||||
// Remove flinged stuff from death pits.
|
// Remove flinged stuff from death pits.
|
||||||
if (P_CheckDeathPitCollide(mo))
|
if (P_CheckDeathPitCollide(mo))
|
||||||
|
@ -2709,6 +2713,8 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
// Flingrings bounce
|
// Flingrings bounce
|
||||||
if (mo->type == MT_FLINGRING
|
if (mo->type == MT_FLINGRING
|
||||||
|| mo->type == MT_FLINGCOIN
|
|| mo->type == MT_FLINGCOIN
|
||||||
|
|| mo->type == MT_FLINGBLUESPHERE
|
||||||
|
|| mo->type == MT_FLINGNIGHTSCHIP
|
||||||
|| P_WeaponOrPanel(mo->type)
|
|| P_WeaponOrPanel(mo->type)
|
||||||
|| mo->type == MT_FLINGEMERALD
|
|| mo->type == MT_FLINGEMERALD
|
||||||
|| mo->type == MT_BIGTUMBLEWEED
|
|| mo->type == MT_BIGTUMBLEWEED
|
||||||
|
@ -7965,6 +7971,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
// Flung items
|
// Flung items
|
||||||
case MT_FLINGRING:
|
case MT_FLINGRING:
|
||||||
case MT_FLINGCOIN:
|
case MT_FLINGCOIN:
|
||||||
|
case MT_FLINGBLUESPHERE:
|
||||||
|
case MT_FLINGNIGHTSCHIP:
|
||||||
if (mobj->flags2 & MF2_NIGHTSPULL)
|
if (mobj->flags2 & MF2_NIGHTSPULL)
|
||||||
P_NightsItemChase(mobj);
|
P_NightsItemChase(mobj);
|
||||||
else
|
else
|
||||||
|
@ -8302,6 +8310,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
||||||
#ifdef ESLOPE // Sliding physics for slidey mobjs!
|
#ifdef ESLOPE // Sliding physics for slidey mobjs!
|
||||||
if (mobj->type == MT_FLINGRING
|
if (mobj->type == MT_FLINGRING
|
||||||
|| mobj->type == MT_FLINGCOIN
|
|| mobj->type == MT_FLINGCOIN
|
||||||
|
|| mobj->type == MT_FLINGBLUESPHERE
|
||||||
|
|| mobj->type == MT_FLINGNIGHTSCHIP
|
||||||
|| P_WeaponOrPanel(mobj->type)
|
|| P_WeaponOrPanel(mobj->type)
|
||||||
|| mobj->type == MT_FLINGEMERALD
|
|| mobj->type == MT_FLINGEMERALD
|
||||||
|| mobj->type == MT_BIGTUMBLEWEED
|
|| mobj->type == MT_BIGTUMBLEWEED
|
||||||
|
|
|
@ -203,6 +203,7 @@ static void P_NetArchivePlayers(void)
|
||||||
WRITEUINT32(save_p, players[i].startedtime);
|
WRITEUINT32(save_p, players[i].startedtime);
|
||||||
WRITEUINT32(save_p, players[i].finishedtime);
|
WRITEUINT32(save_p, players[i].finishedtime);
|
||||||
WRITEINT16(save_p, players[i].finishedspheres);
|
WRITEINT16(save_p, players[i].finishedspheres);
|
||||||
|
WRITEINT16(save_p, players[i].finishedrings);
|
||||||
WRITEUINT32(save_p, players[i].marescore);
|
WRITEUINT32(save_p, players[i].marescore);
|
||||||
WRITEUINT32(save_p, players[i].lastmarescore);
|
WRITEUINT32(save_p, players[i].lastmarescore);
|
||||||
WRITEUINT8(save_p, players[i].lastmare);
|
WRITEUINT8(save_p, players[i].lastmare);
|
||||||
|
@ -391,6 +392,7 @@ static void P_NetUnArchivePlayers(void)
|
||||||
players[i].startedtime = READUINT32(save_p);
|
players[i].startedtime = READUINT32(save_p);
|
||||||
players[i].finishedtime = READUINT32(save_p);
|
players[i].finishedtime = READUINT32(save_p);
|
||||||
players[i].finishedspheres = READINT16(save_p);
|
players[i].finishedspheres = READINT16(save_p);
|
||||||
|
players[i].finishedrings = READINT16(save_p);
|
||||||
players[i].marescore = READUINT32(save_p);
|
players[i].marescore = READUINT32(save_p);
|
||||||
players[i].lastmarescore = READUINT32(save_p);
|
players[i].lastmarescore = READUINT32(save_p);
|
||||||
players[i].lastmare = READUINT8(save_p);
|
players[i].lastmare = READUINT8(save_p);
|
||||||
|
|
|
@ -885,7 +885,8 @@ void P_SwitchSpheresBonusMode(boolean bonustime)
|
||||||
|
|
||||||
mo = (mobj_t *)th;
|
mo = (mobj_t *)th;
|
||||||
|
|
||||||
if (mo->type != MT_BLUESPHERE && mo->type != MT_NIGHTSCHIP)
|
if (mo->type != MT_BLUESPHERE && mo->type != MT_NIGHTSCHIP
|
||||||
|
&& mo->type != MT_FLINGBLUESPHERE && mo->type != MT_FLINGNIGHTSCHIP)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!mo->health)
|
if (!mo->health)
|
||||||
|
@ -2379,12 +2380,13 @@ static void P_LevelInitStuff(void)
|
||||||
players[i].marescore = players[i].lastmarescore =\
|
players[i].marescore = players[i].lastmarescore =\
|
||||||
players[i].maxlink = players[i].startedtime =\
|
players[i].maxlink = players[i].startedtime =\
|
||||||
players[i].finishedtime = players[i].finishedspheres =\
|
players[i].finishedtime = players[i].finishedspheres =\
|
||||||
players[i].lastmare = players[i].marebegunat =\
|
players[i].finishedrings = players[i].lastmare =\
|
||||||
players[i].textvar = players[i].texttimer =\
|
players[i].marebegunat = players[i].textvar =\
|
||||||
players[i].linkcount = players[i].linktimer =\
|
players[i].texttimer = players[i].linkcount =\
|
||||||
players[i].flyangle = players[i].anotherflyangle =\
|
players[i].linktimer = players[i].flyangle =\
|
||||||
players[i].nightstime = players[i].mare =\
|
players[i].anotherflyangle = players[i].nightstime =\
|
||||||
players[i].realtime = players[i].exiting = 0;
|
players[i].mare = players[i].realtime =\
|
||||||
|
players[i].exiting = 0;
|
||||||
|
|
||||||
// i guess this could be part of the above but i feel mildly uncomfortable implicitly casting
|
// i guess this could be part of the above but i feel mildly uncomfortable implicitly casting
|
||||||
players[i].gotcontinue = false;
|
players[i].gotcontinue = false;
|
||||||
|
@ -2439,7 +2441,17 @@ void P_LoadThingsOnly(void)
|
||||||
|
|
||||||
P_LevelInitStuff();
|
P_LevelInitStuff();
|
||||||
|
|
||||||
|
if (W_IsLumpWad(lastloadedmaplumpnum)) // welp it's a map wad in a pk3
|
||||||
|
{ // HACK: Open wad file rather quickly so we can use the things lump
|
||||||
|
UINT8 *wadData = W_CacheLumpNum(lastloadedmaplumpnum, PU_STATIC);
|
||||||
|
filelump_t *fileinfo = (filelump_t *)(wadData + ((wadinfo_t *)wadData)->infotableofs);
|
||||||
|
fileinfo += ML_THINGS; // we only need the THINGS lump
|
||||||
|
P_PrepareRawThings(wadData + fileinfo->filepos, fileinfo->size);
|
||||||
|
Z_Free(wadData); // we're done with this now
|
||||||
|
}
|
||||||
|
else // phew it's just a WAD
|
||||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||||
|
|
||||||
P_LoadThings();
|
P_LoadThings();
|
||||||
|
|
||||||
|
|
||||||
|
|
15
src/p_user.c
15
src/p_user.c
|
@ -590,8 +590,9 @@ static void P_DeNightserizePlayer(player_t *player)
|
||||||
else if (player == &players[secondarydisplayplayer])
|
else if (player == &players[secondarydisplayplayer])
|
||||||
localaiming2 = 0;
|
localaiming2 = 0;
|
||||||
|
|
||||||
// If you screwed up, kiss your score goodbye.
|
// If you screwed up, kiss your score and ring bonus goodbye.
|
||||||
player->marescore = 0;
|
player->marescore = 0;
|
||||||
|
player->rings = 0;
|
||||||
|
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
|
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
|
||||||
|
|
||||||
|
@ -684,6 +685,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 total_spheres = 0;
|
INT32 total_spheres = 0;
|
||||||
|
INT32 total_rings = 0;
|
||||||
|
|
||||||
P_SetTarget(&player->mo->target, NULL);
|
P_SetTarget(&player->mo->target, NULL);
|
||||||
|
|
||||||
|
@ -691,7 +693,10 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
{
|
{
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i]/* && players[i].powers[pw_carry] == CR_NIGHTSMODE*/)
|
if (playeringame[i]/* && players[i].powers[pw_carry] == CR_NIGHTSMODE*/)
|
||||||
|
{
|
||||||
total_spheres += players[i].spheres;
|
total_spheres += players[i].spheres;
|
||||||
|
total_rings += players[i].rings;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
@ -705,11 +710,13 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
if (G_IsSpecialStage(gamemap))
|
if (G_IsSpecialStage(gamemap))
|
||||||
{
|
{
|
||||||
players[i].finishedspheres = (INT16)total_spheres;
|
players[i].finishedspheres = (INT16)total_spheres;
|
||||||
|
players[i].finishedrings = (INT16)total_rings;
|
||||||
P_AddPlayerScore(player, total_spheres * 50);
|
P_AddPlayerScore(player, total_spheres * 50);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
players[i].finishedspheres = (INT16)(players[i].spheres);
|
players[i].finishedspheres = (INT16)(players[i].spheres);
|
||||||
|
players[i].finishedrings = (INT16)(players[i].rings);
|
||||||
P_AddPlayerScore(&players[i], (players[i].spheres) * 50);
|
P_AddPlayerScore(&players[i], (players[i].spheres) * 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -721,7 +728,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
players[i].lastmarescore = players[i].marescore;
|
players[i].lastmarescore = players[i].marescore;
|
||||||
players[i].marescore = 0;
|
players[i].marescore = 0;
|
||||||
|
|
||||||
players[i].spheres = 0;
|
players[i].spheres = players[i].rings = 0;
|
||||||
P_DoPlayerExit(&players[i]);
|
P_DoPlayerExit(&players[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -745,7 +752,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
player->marescore = 0;
|
player->marescore = 0;
|
||||||
player->marebegunat = leveltime;
|
player->marebegunat = leveltime;
|
||||||
|
|
||||||
player->spheres = 0;
|
player->spheres = player->rings = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7030,7 +7037,7 @@ static void P_MovePlayer(player_t *player)
|
||||||
if (playeringame[i])
|
if (playeringame[i])
|
||||||
players[i].exiting = (14*TICRATE)/5 + 1;
|
players[i].exiting = (14*TICRATE)/5 + 1;
|
||||||
}
|
}
|
||||||
else if (player->rings > 0)
|
else if (player->spheres > 0)
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, 0);
|
P_DamageMobj(player->mo, NULL, NULL, 1, 0);
|
||||||
player->powers[pw_carry] = CR_NONE;
|
player->powers[pw_carry] = CR_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,7 +394,7 @@ void R_DrawTranslucentColumn_8(void)
|
||||||
// Re-map color indices from wall texture column
|
// Re-map color indices from wall texture column
|
||||||
// using a lighting/special effects LUT.
|
// using a lighting/special effects LUT.
|
||||||
// heightmask is the Tutti-Frutti fix
|
// heightmask is the Tutti-Frutti fix
|
||||||
*dest = colormap[*(transmap + (source[frac>>FRACBITS]<<8) + (*dest))];
|
*dest = *(transmap + (colormap[source[frac>>FRACBITS]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
if ((frac += fracstep) >= heightmask)
|
if ((frac += fracstep) >= heightmask)
|
||||||
frac -= heightmask;
|
frac -= heightmask;
|
||||||
|
@ -405,15 +405,15 @@ void R_DrawTranslucentColumn_8(void)
|
||||||
{
|
{
|
||||||
while ((count -= 2) >= 0) // texture height is a power of 2
|
while ((count -= 2) >= 0) // texture height is a power of 2
|
||||||
{
|
{
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
}
|
}
|
||||||
if (count & 1)
|
if (count & 1)
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,8 +464,7 @@ void R_DrawTranslatedTranslucentColumn_8(void)
|
||||||
// using a lighting/special effects LUT.
|
// using a lighting/special effects LUT.
|
||||||
// heightmask is the Tutti-Frutti fix
|
// heightmask is the Tutti-Frutti fix
|
||||||
|
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
if ((frac += fracstep) >= heightmask)
|
if ((frac += fracstep) >= heightmask)
|
||||||
|
@ -477,17 +476,15 @@ void R_DrawTranslatedTranslucentColumn_8(void)
|
||||||
{
|
{
|
||||||
while ((count -= 2) >= 0) // texture height is a power of 2
|
while ((count -= 2) >= 0) // texture height is a power of 2
|
||||||
{
|
{
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
}
|
}
|
||||||
if (count & 1)
|
if (count & 1)
|
||||||
*dest = dc_colormap[*(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]] <<8) + (*dest))];
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -835,8 +832,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
v = (INT64)(vz*z) + viewy;
|
v = (INT64)(vz*z) + viewy;
|
||||||
|
|
||||||
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
||||||
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
|
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_sz.x;
|
||||||
uz += ds_su.x;
|
uz += ds_su.x;
|
||||||
|
@ -873,7 +869,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
for (i = SPANSIZE-1; i >= 0; i--)
|
for (i = SPANSIZE-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
||||||
dest++;
|
dest++;
|
||||||
u += stepu;
|
u += stepu;
|
||||||
v += stepv;
|
v += stepv;
|
||||||
|
@ -889,7 +885,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
u = (INT64)(startu);
|
u = (INT64)(startu);
|
||||||
v = (INT64)(startv);
|
v = (INT64)(startv);
|
||||||
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -910,7 +906,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
for (; width != 0; width--)
|
for (; width != 0; width--)
|
||||||
{
|
{
|
||||||
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
||||||
dest++;
|
dest++;
|
||||||
u += stepu;
|
u += stepu;
|
||||||
v += stepv;
|
v += stepv;
|
||||||
|
@ -1221,49 +1217,49 @@ void R_DrawTranslucentSplat_8 (void)
|
||||||
// need!
|
// need!
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[0] = colormap[*(ds_transmap + (val << 8) + dest[0])];
|
dest[0] = *(ds_transmap + (colormap[val] << 8) + dest[0]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[1] = colormap[*(ds_transmap + (val << 8) + dest[1])];
|
dest[1] = *(ds_transmap + (colormap[val] << 8) + dest[1]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[2] = colormap[*(ds_transmap + (val << 8) + dest[2])];
|
dest[2] = *(ds_transmap + (colormap[val] << 8) + dest[2]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[3] = colormap[*(ds_transmap + (val << 8) + dest[3])];
|
dest[3] = *(ds_transmap + (colormap[val] << 8) + dest[3]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[4] = colormap[*(ds_transmap + (val << 8) + dest[4])];
|
dest[4] = *(ds_transmap + (colormap[val] << 8) + dest[4]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[5] = colormap[*(ds_transmap + (val << 8) + dest[5])];
|
dest[5] = *(ds_transmap + (colormap[val] << 8) + dest[5]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[6] = colormap[*(ds_transmap + (val << 8) + dest[6])];
|
dest[6] = *(ds_transmap + (colormap[val] << 8) + dest[6]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
dest[7] = colormap[*(ds_transmap + (val << 8) + dest[7])];
|
dest[7] = *(ds_transmap + (colormap[val] << 8) + dest[7]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
|
@ -1274,7 +1270,7 @@ void R_DrawTranslucentSplat_8 (void)
|
||||||
{
|
{
|
||||||
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
|
||||||
if (val != TRANSPARENTPIXEL)
|
if (val != TRANSPARENTPIXEL)
|
||||||
*dest = colormap[*(ds_transmap + (val << 8) + *dest)];
|
*dest = *(ds_transmap + (colormap[val] << 8) + *dest);
|
||||||
|
|
||||||
dest++;
|
dest++;
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
|
@ -1317,35 +1313,35 @@ void R_DrawTranslucentSpan_8 (void)
|
||||||
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
|
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
|
||||||
// have the uber complicated math to calculate it now, so that was a memory write we didn't
|
// have the uber complicated math to calculate it now, so that was a memory write we didn't
|
||||||
// need!
|
// need!
|
||||||
dest[0] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[0])];
|
dest[0] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[0]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[1] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[1])];
|
dest[1] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[1]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[2] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[2])];
|
dest[2] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[2]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[3] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[3])];
|
dest[3] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[3]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[4] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[4])];
|
dest[4] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[4]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[5] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[5])];
|
dest[5] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[5]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[6] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[6])];
|
dest[6] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[6]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[7] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[7])];
|
dest[7] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[7]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
|
@ -1354,7 +1350,7 @@ void R_DrawTranslucentSpan_8 (void)
|
||||||
}
|
}
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
*dest = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + *dest)];
|
*dest = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + *dest);
|
||||||
dest++;
|
dest++;
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
Loading…
Reference in a new issue