Merge branch 'master' of git@git.magicalgirl.moe:STJr/SRB2Internal.git into hotfix-pltz

Conflicts:
	src/dehacked.c
	src/p_mobj.c
	src/p_mobj.h
This commit is contained in:
Yukita Mayako 2015-06-09 07:17:00 -04:00
commit ba71a7ee6f
48 changed files with 2517 additions and 1727 deletions

433
SRB2.cbp
View file

@ -154,8 +154,8 @@ HW3SOUND for 3D hardware sound support
<Add directory="libs/gme/include" />
</Compiler>
<Linker>
<Add library="SDL" />
<Add library="SDL_mixer" />
<Add library="SDL2" />
<Add library="SDL2_mixer" />
<Add library="advapi32" />
<Add library="kernel32" />
<Add library="msvcrt" />
@ -200,8 +200,8 @@ HW3SOUND for 3D hardware sound support
<Add directory="libs/gme/include" />
</Compiler>
<Linker>
<Add library="SDL" />
<Add library="SDL_mixer" />
<Add library="SDL2" />
<Add library="SDL2_mixer" />
<Add library="advapi32" />
<Add library="kernel32" />
<Add library="msvcrt" />
@ -4141,283 +4141,170 @@ HW3SOUND for 3D hardware sound support
<Option target="Debug Mingw64/DirectX" />
<Option target="Release Mingw64/DirectX" />
</Unit>
<Unit filename="src/sdl/IMG_xpm.c">
<Option compilerVar="CC" />
<Option compile="0" />
<Option link="0" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/dosstr.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/endtxt.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/endtxt.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/filters.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/filters.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/hq2x.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/hq2x.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/interp.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/lq2x.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/lq2x.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/filter/main.c">
<Option compilerVar="CC" />
<Option compile="0" />
<Option link="0" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/hwsym_sdl.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/hwsym_sdl.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/i_cdmus.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/i_main.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/i_net.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/i_system.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/i_video.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/mixer_sound.c">
<Option compilerVar="CC" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/ogl_sdl.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/ogl_sdl.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
</Unit>
<Unit filename="src/sdl/sdl_sound.c">
<Unit filename="src/sdl2/IMG_xpm.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl/sdlmain.h">
<Unit filename="src/sdl2/SDL_icon.xpm">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Any/Dummy" />
<Option target="Release Any/Dummy" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw64/SDL" />
<Option target="Release Mingw64/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/dosstr.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/endtxt.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/endtxt.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/hwsym_sdl.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/hwsym_sdl.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_cdmus.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_main.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_net.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_system.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_ttf.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_ttf.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/i_video.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/mixer_sound.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/ogl_sdl.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/ogl_sdl.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/sdl_sound.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl2/sdlmain.h">
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sounds.c">
<Option compilerVar="CC" />
@ -4590,13 +4477,13 @@ HW3SOUND for 3D hardware sound support
</Unit>
<Unit filename="src/vid_copy.s">
<Option compilerVar="CC" />
<Option compiler="avrgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="ppcgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gnu_gcc_compiler_for_mingw32" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gnu_gcc_compiler_for_mingw64" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="armelfgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="tricoregcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="ppcgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="avrgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gnu_gcc_compiler_for_mingw64" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />

View file

@ -27,7 +27,6 @@ find_library(SDL2_LIBRARY
"/usr/local/lib"
)
# set include dir variables
set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_PROCESS_LIBS SDL2_LIBRARY)

View file

@ -273,11 +273,11 @@ void B_RespawnBot(INT32 playernum)
P_TeleportMove(tails, x, y, z);
if (player->charability == CA_FLY)
{
P_SetPlayerMobjState(tails, S_PLAY_ABL1);
P_SetPlayerMobjState(tails, S_PLAY_FLY);
tails->player->powers[pw_tailsfly] = (UINT16)-1;
}
else
P_SetPlayerMobjState(tails, S_PLAY_FALL1);
P_SetPlayerMobjState(tails, S_PLAY_FALL);
P_SetScale(tails, sonic->scale);
tails->destscale = sonic->destscale;
}

View file

@ -943,9 +943,9 @@ void D_SRB2Main(void)
#endif
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
devparm = !M_CheckParm("-nodebug");
devparm = M_CheckParm("-nodebug") == 0;
#else
devparm = M_CheckParm("-debug");
devparm = M_CheckParm("-debug") != 0;
#endif
// for dedicated server
@ -1118,7 +1118,7 @@ void D_SRB2Main(void)
#endif
D_CleanFile();
#if 1 // md5s last updated 12/14/14
#ifndef DEVELOP // md5s last updated 12/14/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(0, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad

View file

@ -1911,7 +1911,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
}
if (players[suicideplayer].mo)
P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 10000);
P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 1, DMG_INSTAKILL);
}
/** Deals with an ::XD_RANDOMSEED message in a netgame.
@ -2442,7 +2442,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (players[playernum].mo)
{
if (!players[playernum].spectator)
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
P_DamageMobj(players[playernum].mo, NULL, NULL, 1, DMG_INSTAKILL);
else
{
P_RemoveMobj(players[playernum].mo);
@ -3193,7 +3193,27 @@ static void Command_ModDetails_f(void)
//
static void Command_ShowGametype_f(void)
{
CONS_Printf(M_GetText("Current gametype is %d\n"), gametype);
INT32 j;
const char *gametypestr = NULL;
if (!(netgame || multiplayer)) // print "Single player" instead of "Co-op"
{
CONS_Printf(M_GetText("Current gametype is %s\n"), M_GetText("Single player"));
return;
}
// find name string for current gametype
for (j = 0; gametype_cons_t[j].strvalue; j++)
{
if (gametype_cons_t[j].value == gametype)
{
gametypestr = gametype_cons_t[j].strvalue;
break;
}
}
if (gametypestr)
CONS_Printf(M_GetText("Current gametype is %s\n"), gametypestr);
else // string for current gametype was not found above (should never happen)
CONS_Printf(M_GetText("Unknown gametype set (%d)\n"), gametype);
}
/** Plays the intro.

View file

@ -473,6 +473,7 @@ static void readPlayer(MYFILE *f, INT32 num)
if (!slotfound && (slotfound = findFreeSlot(&num)) == false)
goto done;
PlayerMenu[num].status = IT_CALL;
for (i = 0; i < MAXLINELEN-3; i++)
{
@ -545,6 +546,7 @@ static void readPlayer(MYFILE *f, INT32 num)
if (!slotfound && (slotfound = findFreeSlot(&num)) == false)
goto done;
DEH_WriteUndoline(word, &description[num].picname[0], UNDO_NONE);
PlayerMenu[num].status = IT_CALL;
strncpy(description[num].picname, word2, 8);
}
else if (fastcmp(word, "STATUS"))
@ -576,6 +578,8 @@ static void readPlayer(MYFILE *f, INT32 num)
if (!slotfound && (slotfound = findFreeSlot(&num)) == false)
goto done;
DEH_WriteUndoline(word, description[num].skinname, UNDO_NONE);
PlayerMenu[num].status = IT_CALL;
strlcpy(description[num].skinname, word2, sizeof description[num].skinname);
strlwr(description[num].skinname);
}
@ -3736,52 +3740,37 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Thok
"S_THOK",
// Player
"S_PLAY_STND",
"S_PLAY_TAP1",
"S_PLAY_TAP2",
"S_PLAY_RUN1",
"S_PLAY_RUN2",
"S_PLAY_RUN3",
"S_PLAY_RUN4",
"S_PLAY_RUN5",
"S_PLAY_RUN6",
"S_PLAY_RUN7",
"S_PLAY_RUN8",
"S_PLAY_SPD1",
"S_PLAY_SPD2",
"S_PLAY_SPD3",
"S_PLAY_SPD4",
"S_PLAY_ATK1",
"S_PLAY_ATK2",
"S_PLAY_ATK3",
"S_PLAY_ATK4",
"S_PLAY_SPRING",
"S_PLAY_FALL1",
"S_PLAY_FALL2",
"S_PLAY_ABL1",
"S_PLAY_ABL2",
"S_PLAY_SPC1",
"S_PLAY_SPC2",
"S_PLAY_SPC3",
"S_PLAY_SPC4",
"S_PLAY_CLIMB1",
"S_PLAY_CLIMB2",
"S_PLAY_CLIMB3",
"S_PLAY_CLIMB4",
"S_PLAY_CLIMB5",
"S_PLAY_GASP",
"S_PLAY_WAIT",
"S_PLAY_WALK",
"S_PLAY_RUN",
"S_PLAY_PAIN",
"S_PLAY_DIE",
"S_PLAY_TEETER1",
"S_PLAY_TEETER2",
"S_PLAY_CARRY",
"S_PLAY_SUPERSTAND",
"S_PLAY_SUPERWALK1",
"S_PLAY_SUPERWALK2",
"S_PLAY_SUPERFLY1",
"S_PLAY_SUPERFLY2",
"S_PLAY_SUPERTEETER",
"S_PLAY_SUPERHIT",
"S_PLAY_DEAD",
"S_PLAY_SPIN",
"S_PLAY_GASP",
"S_PLAY_JUMP",
"S_PLAY_FALL",
"S_PLAY_EDGE",
"S_PLAY_RIDE",
// CA_FLY
"S_PLAY_FLY",
"S_PLAY_FLY_TIRED",
// CA_GLIDEANDCLIMB
"S_PLAY_GLIDE",
"S_PLAY_CLING",
"S_PLAY_CLIMB",
// SF_SUPERANIMS
"S_PLAY_SUPER_STND",
"S_PLAY_SUPER_WALK",
"S_PLAY_SUPER_RUN",
"S_PLAY_SUPER_EDGE",
"S_PLAY_SUPER_PAIN",
// SF_SUPER
"S_PLAY_SUPERTRANS1",
"S_PLAY_SUPERTRANS2",
"S_PLAY_SUPERTRANS3",
@ -3807,7 +3796,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Blue Crawla
"S_POSS_STND",
"S_POSS_STND2",
"S_POSS_RUN1",
"S_POSS_RUN2",
"S_POSS_RUN3",
@ -3817,7 +3805,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Red Crawla
"S_SPOS_STND",
"S_SPOS_STND2",
"S_SPOS_RUN1",
"S_SPOS_RUN2",
"S_SPOS_RUN3",
@ -4534,7 +4521,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// S_PLAY_TAP1
"S_METALSONIC_WAIT1",
"S_METALSONIC_WAIT2",
// S_PLAY_RUN1
// S_PLAY_WALK
"S_METALSONIC_WALK1",
"S_METALSONIC_WALK2",
"S_METALSONIC_WALK3",
@ -7172,7 +7159,6 @@ static const char *const MOBJFLAG2_LIST[] = {
"EXPLOSION", // Thrown ring has explosive properties
"SCATTER", // Thrown ring has scatter properties
"BEYONDTHEGRAVE",// Source of this missile has died and has since respawned.
"PUSHED", // Mobj was already pushed this tic
"SLIDEPUSH", // MF_PUSHABLE that pushes continuously.
"CLASSICPUSH", // Drops straight down when object has negative Z.
"STANDONME", // While not pushable, stand on me anyway.
@ -7201,7 +7187,10 @@ static const char *const MOBJEFLAG_LIST[] = {
"JUSTSTEPPEDDOWN", // used for ramp sectors
"VERTICALFLIP", // Vertically flip sprite/allow upside-down physics
"GOOWATER", // Goo water
"PUSHED", // Mobj was already pushed this tic
"SPRUNG", // Mobj was already sprung this tic
"APPLYPMOMZ" // Platform movement
NULL
};
static const char *const MAPTHINGFLAG_LIST[4] = {
@ -7303,6 +7292,7 @@ static const char *const ML_LIST[16] = {
};
// This DOES differ from r_draw's Color_Names, unfortunately.
// Also includes Super colors
static const char *COLOR_ENUMS[] = {
"NONE", // SKINCOLOR_NONE
"WHITE", // SKINCOLOR_WHITE
@ -7329,7 +7319,25 @@ static const char *COLOR_ENUMS[] = {
"ZIM", // SKINCOLOR_ZIM
"OLIVE", // SKINCOLOR_OLIVE
"YELLOW", // SKINCOLOR_YELLOW
"GOLD" // SKINCOLOR_GOLD
"GOLD", // SKINCOLOR_GOLD
// Super special awesome Super flashing colors!
"SUPER1", // SKINCOLOR_SUPER1
"SUPER2", // SKINCOLOR_SUPER2,
"SUPER3", // SKINCOLOR_SUPER3,
"SUPER4", // SKINCOLOR_SUPER4,
"SUPER5", // SKINCOLOR_SUPER5,
// Super Tails
"TSUPER1", // SKINCOLOR_TSUPER1,
"TSUPER2", // SKINCOLOR_TSUPER2,
"TSUPER3", // SKINCOLOR_TSUPER3,
"TSUPER4", // SKINCOLOR_TSUPER4,
"TSUPER5", // SKINCOLOR_TSUPER5,
// Super Knuckles
"KSUPER1", // SKINCOLOR_KSUPER1,
"KSUPER2", // SKINCOLOR_KSUPER2,
"KSUPER3", // SKINCOLOR_KSUPER3,
"KSUPER4", // SKINCOLOR_KSUPER4,
"KSUPER5" // SKINCOLOR_KSUPER5,
};
static const char *const POWERS_LIST[] = {
@ -7536,8 +7544,9 @@ struct {
{"EMERALD6",EMERALD6},
{"EMERALD7",EMERALD7},
// SKINCOLOR_ doesn't include this..!
// SKINCOLOR_ doesn't include these..!
{"MAXSKINCOLORS",MAXSKINCOLORS},
{"MAXTRANSLATIONS",MAXTRANSLATIONS},
// Precipitation
{"PRECIP_NONE",PRECIP_NONE},
@ -8158,7 +8167,7 @@ static fixed_t find_const(const char **rword)
}
else if (fastncmp("SKINCOLOR_",word,10)) {
char *p = word+10;
for (i = 0; i < MAXSKINCOLORS; i++)
for (i = 0; i < MAXTRANSLATIONS; i++)
if (fastcmp(p, COLOR_ENUMS[i])) {
free(word);
return i;
@ -8217,8 +8226,8 @@ void DEH_Check(void)
if (dehpowers != NUMPOWERS)
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
if (dehcolors != MAXSKINCOLORS)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", MAXSKINCOLORS, sizeu1(dehcolors));
if (dehcolors != MAXTRANSLATIONS)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", MAXTRANSLATIONS, sizeu1(dehcolors));
#endif
}
@ -8487,6 +8496,27 @@ static inline int lib_getenum(lua_State *L)
if (mathlib) return luaL_error(L, "sprite '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("SPR2_",word,4)) {
p = word+5;
for (i = 0; i < NUMPLAYERSPRITES; i++)
if (!spr2names[i][4])
{
// special 3-char cases, e.g. SPR2_RUN
// the spr2names entry will have "_" on the end, as in "RUN_"
if (spr2names[i][3] == '_' && !p[3]) {
if (fastncmp(p,spr2names[i],3)) {
lua_pushinteger(L, i);
return 1;
}
}
else if (fastncmp(p,spr2names[i],4)) {
lua_pushinteger(L, i);
return 1;
}
}
if (mathlib) return luaL_error(L, "player sprite '%s' could not be found.\n", word);
return 0;
}
else if (!mathlib && fastncmp("sfx_",word,4)) {
p = word+4;
for (i = 0; i < NUMSFX; i++)
@ -8572,7 +8602,7 @@ static inline int lib_getenum(lua_State *L)
}
else if (fastncmp("SKINCOLOR_",word,10)) {
p = word+10;
for (i = 0; i < MAXSKINCOLORS; i++)
for (i = 0; i < MAXTRANSLATIONS; i++)
if (fastcmp(p, COLOR_ENUMS[i])) {
lua_pushinteger(L, i);
return 1;
@ -8697,7 +8727,7 @@ static inline int lib_getenum(lua_State *L)
lua_pushinteger(L, mapmusic);
return 1;
} else if (fastcmp(word,"server")) {
if (!playeringame[serverplayer])
if ((!multiplayer || !netgame) && !playeringame[serverplayer])
return 0;
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
return 1;

View file

@ -138,15 +138,17 @@
extern FILE *logstream;
#endif
#if 0
#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVELOP
#define VERSION 0 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "Trunk"
#define VERSIONSTRINGW L"Trunk"
#else
#define VERSION 201 // Game version
#define SUBVERSION 14 // more precise version number
#define VERSIONSTRING "v2.1.14"
#define VERSIONSTRINGW L"v2.1.14"
#define VERSION 202 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "v2.2"
#define VERSIONSTRINGW L"v2.2"
// Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates!
#endif
@ -193,7 +195,7 @@ extern FILE *logstream;
// and should not be changed unless you have merged changes between versions of SRB2
// (such as 2.0.4 to 2.0.5, etc) into your working copy.
// Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc.
#define CODEBASE 210
#define CODEBASE 220
// The Modification ID; must be obtained from Inuyasha ( http://mb.srb2.org/private.php?do=newpm&u=2604 ).
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
@ -204,7 +206,7 @@ extern FILE *logstream;
// it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously.
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
#define MODVERSION 19
#define MODVERSION 20

View file

@ -2180,8 +2180,7 @@ void G_PlayerReborn(INT32 player)
p->health = 1; // 0 rings
p->panim = PA_IDLE; // standing animation
if ((netgame || multiplayer) && !p->spectator
&& gametype != GT_RACE)
if ((netgame || multiplayer) && !p->spectator)
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
if (p-players == consoleplayer)
@ -3687,6 +3686,7 @@ static ticcmd_t oldcmd;
#define GZT_SPRITE 0x10 // Animation frame
#define GZT_EXTRA 0x20
#define GZT_NIGHTS 0x40 // NiGHTS Mode stuff!
#define GZT_SPR2 0x80 // Player animations
// GZT_EXTRA flags
#define EZT_THOK 0x01 // Spawned a thok object
@ -3890,8 +3890,6 @@ void G_WriteGhostTic(mobj_t *ghost)
char ziptic = 0;
UINT8 *ziptic_p;
UINT32 i;
UINT8 sprite;
UINT8 frame;
if (!demo_p)
return;
@ -3966,19 +3964,25 @@ void G_WriteGhostTic(mobj_t *ghost)
}
// Store the sprite frame.
frame = ghost->frame & 0xFF;
if (frame != oldghost.frame)
if ((ghost->frame & 0xFF) != oldghost.frame)
{
oldghost.frame = frame;
oldghost.frame = (ghost->frame & 0xFF);
ziptic |= GZT_SPRITE;
WRITEUINT8(demo_p,oldghost.frame);
}
// Check for sprite set changes
sprite = ghost->sprite;
if (sprite != oldghost.sprite)
if (ghost->sprite == SPR_PLAY
&& ghost->sprite2 != oldghost.sprite2)
{
oldghost.sprite = sprite;
oldghost.sprite2 = ghost->sprite2;
ziptic |= GZT_SPR2;
WRITEUINT8(demo_p,oldghost.sprite2);
}
// Check for sprite set changes
if (ghost->sprite != oldghost.sprite)
{
oldghost.sprite = ghost->sprite;
ghostext.flags |= EZT_SPRITE;
}
@ -4021,7 +4025,7 @@ void G_WriteGhostTic(mobj_t *ghost)
ghostext.hitlist = NULL;
}
if (ghostext.flags & EZT_SPRITE)
WRITEUINT8(demo_p,sprite);
WRITEUINT8(demo_p,oldghost.sprite);
ghostext.flags = 0;
}
@ -4077,6 +4081,8 @@ void G_ConsGhostTic(void)
demo_p++;
if (ziptic & GZT_SPRITE)
demo_p++;
if (ziptic & GZT_SPR2)
demo_p++;
if(ziptic & GZT_NIGHTS) {
if (!testmo->player || !(testmo->player->pflags & PF_NIGHTSMODE) || !testmo->tracer)
nightsfail = true;
@ -4128,7 +4134,7 @@ void G_ConsGhostTic(void)
if (demosynced)
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
demosynced = false;
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1);
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1, 0);
}
}
}
@ -4208,6 +4214,8 @@ void G_GhostTicker(void)
g->oldmo.angle = READUINT8(g->p)<<24;
if (ziptic & GZT_SPRITE)
g->oldmo.frame = READUINT8(g->p);
if (ziptic & GZT_SPR2)
g->oldmo.sprite2 = READUINT8(g->p);
// Update ghost
P_UnsetThingPosition(g->mo);
@ -4217,6 +4225,7 @@ void G_GhostTicker(void)
P_SetThingPosition(g->mo);
g->mo->angle = g->oldmo.angle;
g->mo->frame = g->oldmo.frame | tr_trans30<<FF_TRANSSHIFT;
g->mo->sprite2 = g->oldmo.sprite2;
if (ziptic & GZT_EXTRA)
{ // But wait, there's more!
@ -4330,20 +4339,10 @@ void G_GhostTicker(void)
switch(g->color)
{
case GHC_SUPER: // Super Sonic (P_DoSuperStuff)
// Yousa yellow now!
g->mo->color = SKINCOLOR_SUPER1 + (leveltime/2) % 5;
if (g->mo->skin)
switch (((skin_t*)g->mo->skin)-skins)
{
case 1: // Golden orange supertails.
g->mo->color = SKINCOLOR_TSUPER1 + (leveltime/2) % 5;
break;
case 2: // Pink superknux.
g->mo->color = SKINCOLOR_KSUPER1 + (leveltime/2) % 5;
break;
default:
break;
}
if (leveltime % 9 < 5)
g->mo->color = SKINCOLOR_SUPER1 + leveltime % 9;
else
g->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9;
break;
case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS);
@ -4401,6 +4400,8 @@ void G_ReadMetalTic(mobj_t *metal)
oldmetal.angle = READUINT8(metal_p)<<24;
if (ziptic & GZT_SPRITE)
metal_p++; // Currently unused. (Metal Sonic figures out what he's doing his own damn self.)
if (ziptic & GZT_SPR2)
metal_p++;
// Set movement, position, and angle
// oldmetal contains where you're supposed to be.

View file

@ -3527,6 +3527,184 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v
return false;
}
static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float this_scale)
{
UINT8 i;
float tr_x, tr_y;
FOutVector *wv;
FOutVector swallVerts[4];
FSurfaceInfo sSurf;
fixed_t floorheight, mobjfloor;
mobjfloor = HWR_OpaqueFloorAtPos(
spr->mobj->x, spr->mobj->y,
spr->mobj->z, spr->mobj->height);
if (cv_shadowoffs.value)
{
angle_t shadowdir;
// Set direction
if (splitscreen && stplyr != &players[displayplayer])
shadowdir = localangle2 + FixedAngle(cv_cam2_rotate.value);
else
shadowdir = localangle + FixedAngle(cv_cam_rotate.value);
// Find floorheight
floorheight = HWR_OpaqueFloorAtPos(
spr->mobj->x + P_ReturnThrustX(spr->mobj, shadowdir, spr->mobj->z - mobjfloor),
spr->mobj->y + P_ReturnThrustY(spr->mobj, shadowdir, spr->mobj->z - mobjfloor),
spr->mobj->z, spr->mobj->height);
// The shadow is falling ABOVE it's mobj?
// Don't draw it, then!
if (spr->mobj->z < floorheight)
return;
else
{
fixed_t floorz;
floorz = HWR_OpaqueFloorAtPos(
spr->mobj->x + P_ReturnThrustX(spr->mobj, shadowdir, spr->mobj->z - floorheight),
spr->mobj->y + P_ReturnThrustY(spr->mobj, shadowdir, spr->mobj->z - floorheight),
spr->mobj->z, spr->mobj->height);
// The shadow would be falling on a wall? Don't draw it, then.
// Would draw midair otherwise.
if (floorz < floorheight)
return;
}
floorheight = FixedInt(spr->mobj->z - floorheight);
}
else
floorheight = FixedInt(spr->mobj->z - mobjfloor);
// create the sprite billboard
//
// 3--2
// | /|
// |/ |
// 0--1
// x1/x2 were already scaled in HWR_ProjectSprite
swallVerts[0].x = swallVerts[3].x = spr->x1;
swallVerts[2].x = swallVerts[1].x = spr->x2;
if (spr->mobj && this_scale != 1.0f)
{
// Always a pixel above the floor, perfectly flat.
swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->ty - gpatch->topoffset * this_scale - (floorheight+3);
swallVerts[0].z = swallVerts[1].z = spr->tz - (gpatch->height-gpatch->topoffset) * this_scale;
swallVerts[2].z = swallVerts[3].z = spr->tz + gpatch->topoffset * this_scale;
}
else
{
// Always a pixel above the floor, perfectly flat.
swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->ty - gpatch->topoffset - (floorheight+3);
// Spread out top away from the camera. (Fixme: Make it always move out in the same direction!... somehow.)
swallVerts[0].z = swallVerts[1].z = spr->tz - (gpatch->height-gpatch->topoffset);
swallVerts[2].z = swallVerts[3].z = spr->tz + gpatch->topoffset;
}
// transform
wv = swallVerts;
for (i = 0; i < 4; i++,wv++)
{
// Offset away from the camera based on height from floor.
if (cv_shadowoffs.value)
wv->z += floorheight;
wv->z += 3;
//look up/down ----TOTAL SUCKS!!!--- do the 2 in one!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
tr_x = wv->z;
tr_y = wv->y;
wv->y = (tr_x * gr_viewludcos) + (tr_y * gr_viewludsin);
wv->z = (tr_x * gr_viewludsin) - (tr_y * gr_viewludcos);
// ---------------------- mega lame test ----------------------------------
//scale y before frustum so that frustum can be scaled to screen height
wv->y *= ORIGINAL_ASPECT * gr_fovlud;
wv->x *= gr_fovlud;
}
if (spr->flip)
{
swallVerts[0].sow = swallVerts[3].sow = gpatch->max_s;
swallVerts[2].sow = swallVerts[1].sow = 0;
}
else
{
swallVerts[0].sow = swallVerts[3].sow = 0;
swallVerts[2].sow = swallVerts[1].sow = gpatch->max_s;
}
// flip the texture coords (look familiar?)
if (spr->vflip)
{
swallVerts[3].tow = swallVerts[2].tow = gpatch->max_t;
swallVerts[0].tow = swallVerts[1].tow = 0;
}
else
{
swallVerts[3].tow = swallVerts[2].tow = 0;
swallVerts[0].tow = swallVerts[1].tow = gpatch->max_t;
}
sSurf.FlatColor.s.red = 0x00;
sSurf.FlatColor.s.blue = 0x00;
sSurf.FlatColor.s.green = 0x00;
/*if (spr->mobj->frame & FF_TRANSMASK || spr->mobj->flags2 & MF2_SHADOW)
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = 255;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
{
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = *sector->lightlist[light].lightlevel;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
}
else
{
lightlevel = sector->lightlevel;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (colormap)
sSurf.FlatColor.rgba = HWR_Lighting(lightlevel/2, colormap->rgba, colormap->fadergba, false, true);
else
sSurf.FlatColor.rgba = HWR_Lighting(lightlevel/2, NORMALFOG, FADEFOG, false, true);
}*/
// shadow is always half as translucent as the sprite itself
if (!cv_translucency.value) // use default translucency (main sprite won't have any translucency)
sSurf.FlatColor.s.alpha = 0x80; // default
else if (spr->mobj->flags2 & MF2_SHADOW)
sSurf.FlatColor.s.alpha = 0x20;
else if (spr->mobj->frame & FF_TRANSMASK)
{
HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &sSurf);
sSurf.FlatColor.s.alpha /= 2; //cut alpha in half!
}
else
sSurf.FlatColor.s.alpha = 0x80; // default
if (sSurf.FlatColor.s.alpha > floorheight/4)
{
sSurf.FlatColor.s.alpha = (UINT8)(sSurf.FlatColor.s.alpha - floorheight/4);
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated|PF_Clip);
}
}
// -----------------+
// HWR_DrawSprite : Draw flat sprites
// : (monsters, bonuses, weapons, lights, ...)
@ -3629,7 +3807,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
// Draw shadow BEFORE sprite
if (cv_shadow.value // Shadows enabled
&& !(spr->mobj->flags & MF_SCENERY && spr->mobj->flags & MF_SPAWNCEILING && spr->mobj->flags & MF_NOGRAVITY) // Ceiling scenery have no shadow.
&& (spr->mobj->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow.
&& !(spr->mobj->flags2 & MF2_DEBRIS) // Debris have no corona or shadow.
#ifdef ALAM_LIGHTING
&& !(t_lspr[spr->mobj->sprite]->type // Things with dynamic lights have no shadow.
@ -3640,187 +3818,9 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
////////////////////
// SHADOW SPRITE! //
////////////////////
FOutVector swallVerts[4];
FSurfaceInfo sSurf;
fixed_t floorheight, mobjfloor;
mobjfloor = HWR_OpaqueFloorAtPos(
spr->mobj->x, spr->mobj->y,
spr->mobj->z, spr->mobj->height);
if (cv_shadowoffs.value)
{
angle_t shadowdir;
// Set direction
if (splitscreen && stplyr != &players[displayplayer])
shadowdir = localangle2 + FixedAngle(cv_cam2_rotate.value);
else
shadowdir = localangle + FixedAngle(cv_cam_rotate.value);
// Find floorheight
floorheight = HWR_OpaqueFloorAtPos(
spr->mobj->x + P_ReturnThrustX(spr->mobj, shadowdir, spr->mobj->z - mobjfloor),
spr->mobj->y + P_ReturnThrustY(spr->mobj, shadowdir, spr->mobj->z - mobjfloor),
spr->mobj->z, spr->mobj->height);
// The shadow is falling ABOVE it's mobj?
// Don't draw it, then!
if (spr->mobj->z < floorheight)
goto noshadow;
else
{
fixed_t floorz;
floorz = HWR_OpaqueFloorAtPos(
spr->mobj->x + P_ReturnThrustX(spr->mobj, shadowdir, spr->mobj->z - floorheight),
spr->mobj->y + P_ReturnThrustY(spr->mobj, shadowdir, spr->mobj->z - floorheight),
spr->mobj->z, spr->mobj->height);
// The shadow would be falling on a wall? Don't draw it, then.
// Would draw midair otherwise.
if (floorz < floorheight)
goto noshadow;
}
floorheight = FixedInt(spr->mobj->z - floorheight);
}
else
floorheight = FixedInt(spr->mobj->z - mobjfloor);
// create the sprite billboard
//
// 3--2
// | /|
// |/ |
// 0--1
// x1/x2 were already scaled in HWR_ProjectSprite
swallVerts[0].x = swallVerts[3].x = spr->x1;
swallVerts[2].x = swallVerts[1].x = spr->x2;
if (spr->mobj && this_scale != 1.0f)
{
// Always a pixel above the floor, perfectly flat.
swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->ty - gpatch->topoffset * this_scale - (floorheight+3);
swallVerts[0].z = swallVerts[1].z = spr->tz - (gpatch->height-gpatch->topoffset) * this_scale;
swallVerts[2].z = swallVerts[3].z = spr->tz + gpatch->topoffset * this_scale;
}
else
{
// Always a pixel above the floor, perfectly flat.
swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->ty - gpatch->topoffset - (floorheight+3);
// Spread out top away from the camera. (Fixme: Make it always move out in the same direction!... somehow.)
swallVerts[0].z = swallVerts[1].z = spr->tz - (gpatch->height-gpatch->topoffset);
swallVerts[2].z = swallVerts[3].z = spr->tz + gpatch->topoffset;
}
// transform
wv = swallVerts;
for (i = 0; i < 4; i++,wv++)
{
// Offset away from the camera based on height from floor.
if (cv_shadowoffs.value)
wv->z += floorheight;
wv->z += 3;
//look up/down ----TOTAL SUCKS!!!--- do the 2 in one!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
tr_x = wv->z;
tr_y = wv->y;
wv->y = (tr_x * gr_viewludcos) + (tr_y * gr_viewludsin);
wv->z = (tr_x * gr_viewludsin) - (tr_y * gr_viewludcos);
// ---------------------- mega lame test ----------------------------------
//scale y before frustum so that frustum can be scaled to screen height
wv->y *= ORIGINAL_ASPECT * gr_fovlud;
wv->x *= gr_fovlud;
}
if (spr->flip)
{
swallVerts[0].sow = swallVerts[3].sow = gpatch->max_s;
swallVerts[2].sow = swallVerts[1].sow = 0;
}
else
{
swallVerts[0].sow = swallVerts[3].sow = 0;
swallVerts[2].sow = swallVerts[1].sow = gpatch->max_s;
}
// flip the texture coords (look familiar?)
if (spr->vflip)
{
swallVerts[3].tow = swallVerts[2].tow = gpatch->max_t;
swallVerts[0].tow = swallVerts[1].tow = 0;
}
else
{
swallVerts[3].tow = swallVerts[2].tow = 0;
swallVerts[0].tow = swallVerts[1].tow = gpatch->max_t;
}
sSurf.FlatColor.s.red = 0x00;
sSurf.FlatColor.s.blue = 0x00;
sSurf.FlatColor.s.green = 0x00;
/*if (spr->mobj->frame & FF_TRANSMASK || spr->mobj->flags2 & MF2_SHADOW)
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = sector->lightlevel;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
{
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
}
else
{
lightlevel = sector->lightlevel;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (colormap)
sSurf.FlatColor.rgba = HWR_Lighting(lightlevel/2, colormap->rgba, colormap->fadergba, false, true);
else
sSurf.FlatColor.rgba = HWR_Lighting(lightlevel/2, NORMALFOG, FADEFOG, false, true);
}*/
// shadow is always half as translucent as the sprite itself
if (!cv_translucency.value)
; // translucency disabled
else if (spr->mobj->flags2 & MF2_SHADOW)
sSurf.FlatColor.s.alpha = 0x20;
else if (spr->mobj->frame & FF_TRANSMASK)
{
HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &sSurf);
sSurf.FlatColor.s.alpha /= 2; //cut alpha in half!
}
else
sSurf.FlatColor.s.alpha = 0x80; // default
/// \todo do the test earlier
if (!cv_grmd2.value || (md2_models[spr->mobj->sprite].scale < 0.0f) || (md2_models[spr->mobj->sprite].notfound = true) || (md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f) || (md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound = true))
{
if (sSurf.FlatColor.s.alpha > floorheight/4)
{
sSurf.FlatColor.s.alpha = (UINT8)(sSurf.FlatColor.s.alpha - floorheight/4);
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated|PF_Clip);
}
}
HWR_DrawSpriteShadow(spr, gpatch, this_scale);
}
noshadow:
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
// sprite lighting by modulating the RGB components
/// \todo coloured
@ -3828,7 +3828,7 @@ noshadow:
// colormap test
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = sector->lightlevel;
UINT8 lightlevel = 255;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@ -3839,8 +3839,6 @@ noshadow:
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@ -3849,27 +3847,25 @@ noshadow:
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = sector->lightlevel;
else
lightlevel = 255;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (spr->mobj->frame & FF_FULLBRIGHT)
lightlevel = 255;
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
else
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
}
/// \todo do the test earlier
if (!cv_grmd2.value || (md2_models[spr->mobj->sprite].scale < 0.0f))
{
FBITFIELD blend = 0;
if (spr->mobj->flags2 & MF2_SHADOW)
if (!cv_translucency.value) // translucency disabled
{
Surf.FlatColor.s.alpha = 0xFF;
blend = PF_Translucent|PF_Occlude;
}
else if (spr->mobj->flags2 & MF2_SHADOW)
{
Surf.FlatColor.s.alpha = 0x40;
blend = PF_Translucent;
@ -4390,10 +4386,10 @@ static void HWR_DrawSprites(void)
#endif
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
if (!cv_grmd2.value || (cv_grmd2.value && md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == true))
if (!cv_grmd2.value || md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f)
HWR_DrawSprite(spr);
}
else if (!cv_grmd2.value || (cv_grmd2.value && md2_models[spr->mobj->sprite].notfound == true))
else if (!cv_grmd2.value || md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr);
}
}
@ -4419,7 +4415,7 @@ static void HWR_DrawMD2S(void)
#endif
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
if ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == false) && (md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale > 0.0f))
if (md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == false && md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale > 0.0f)
HWR_DrawMD2(spr);
}
else if (md2_models[spr->mobj->sprite].notfound == false && md2_models[spr->mobj->sprite].scale > 0.0f)
@ -4461,23 +4457,12 @@ static void HWR_AddSprites(sector_t *sec)
// If a limit exists, handle things a tiny bit different.
if ((limit_dist = (fixed_t)((maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : cv_drawdist.value) << FRACBITS))
{
if (!players[displayplayer].mo)
return; // Draw nothing if no player.
// todo: is this really the best option for this situation?
for (thing = sec->thinglist; thing; thing = thing->snext)
{
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
continue;
approx_dist = P_AproxDistance(
players[displayplayer].mo->x - thing->x,
players[displayplayer].mo->y - thing->y);
if (splitscreen && approx_dist > limit_dist && players[secondarydisplayplayer].mo)
approx_dist = P_AproxDistance(
players[secondarydisplayplayer].mo->x - thing->x,
players[secondarydisplayplayer].mo->y - thing->y);
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
if (approx_dist <= limit_dist)
HWR_ProjectSprite(thing);
@ -4495,23 +4480,12 @@ static void HWR_AddSprites(sector_t *sec)
// Someone seriously wants infinite draw distance for precipitation?
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
{
if (!players[displayplayer].mo)
return; // Draw nothing if no player.
// todo: is this really the best option for this situation?
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
{
if (precipthing->invisible)
if (precipthing->precipflags & PCF_INVISIBLE)
continue;
approx_dist = P_AproxDistance(
players[displayplayer].mo->x - precipthing->x,
players[displayplayer].mo->y - precipthing->y);
if (splitscreen && approx_dist > limit_dist && players[secondarydisplayplayer].mo)
approx_dist = P_AproxDistance(
players[secondarydisplayplayer].mo->x - precipthing->x,
players[secondarydisplayplayer].mo->y - precipthing->y);
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
if (approx_dist <= limit_dist)
HWR_ProjectPrecipitationSprite(precipthing);
@ -4521,7 +4495,7 @@ static void HWR_AddSprites(sector_t *sec)
{
// Draw everything in sector, no checks
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
if (!precipthing->invisible)
if (!(precipthing->precipflags & PCF_INVISIBLE))
HWR_ProjectPrecipitationSprite(precipthing);
}
#endif
@ -4576,16 +4550,17 @@ static void HWR_ProjectSprite(mobj_t *thing)
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
if (thing->skin && thing->sprite == SPR_PLAY)
sprdef = &((skin_t *)thing->skin)->spritedef;
sprdef = &((skin_t *)thing->skin)->sprites[thing->sprite2];
else
sprdef = &sprites[thing->sprite];
if (rot >= sprdef->numframes)
{
CONS_Alert(CONS_ERROR, M_GetText("R_ProjectSprite: invalid sprite frame %s/%s for %s\n"),
CONS_Alert(CONS_ERROR, M_GetText("HWR_ProjectSprite: invalid sprite frame %s/%s for %s\n"),
sizeu1(rot), sizeu2(sprdef->numframes), sprnames[thing->sprite]);
thing->sprite = states[S_UNKNOWN].sprite;
thing->frame = states[S_UNKNOWN].frame;
sprdef = &sprites[thing->sprite];
rot = thing->frame&FF_FRAMEMASK;
thing->state->sprite = thing->sprite;
thing->state->frame = thing->frame;

View file

@ -921,24 +921,25 @@ void HWR_InitMD2(void)
}
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
{
if (stricmp(name, "PLAY") == 0)
{
CONS_Printf("MD2 for sprite PLAY detected in md2.dat, use a player skin instead!\n");
continue;
}
for (i = 0; i < NUMSPRITES; i++)
{
if (stricmp(name, sprnames[i]) == 0)
{
if (stricmp(name, "PLAY") == 0)
continue;
//if (stricmp(name, "PLAY") == 0)
//continue;
//CONS_Debug(DBG_RENDER, " Found: %s %s %f %f\n", name, filename, scale, offset);
md2_models[i].scale = scale;
md2_models[i].offset = offset;
md2_models[i].notfound = false;
strcpy(md2_models[i].filename, filename);
break;
}
if (i == NUMSPRITES)
{
CONS_Printf("MD2 for sprite %s not found\n", name);
md2_models[i].notfound = true;
goto md2found;
}
}
@ -952,15 +953,14 @@ void HWR_InitMD2(void)
md2_playermodels[s].offset = offset;
md2_playermodels[s].notfound = false;
strcpy(md2_playermodels[s].filename, filename);
break;
}
if (s == MAXSKINS-1)
{
CONS_Printf("MD2 for player skin %s not found\n", name);
md2_playermodels[s].notfound = true;
goto md2found;
}
}
// no sprite/player skin name found?!?
CONS_Printf("Unknown sprite/player skin %s detected in md2.dat\n", name);
md2found:
// move on to next line...
continue;
}
fclose(f);
}
@ -996,17 +996,14 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
md2_playermodels[skin].offset = offset;
md2_playermodels[skin].notfound = false;
strcpy(md2_playermodels[skin].filename, filename);
break;
}
if (skin == MAXSKINS-1)
{
CONS_Printf("MD2 for player skin %s not found\n", name);
md2_playermodels[skin].notfound = true;
goto playermd2found;
}
}
//CONS_Printf("MD2 for player skin %s not found\n", skins[skin].name);
md2_playermodels[skin].notfound = true;
playermd2found:
fclose(f);
}
@ -1021,6 +1018,9 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
if (nomd2s)
return;
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
return;
// Read the md2.dat file
f = fopen("md2.dat", "rt");
@ -1034,27 +1034,19 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
// Check for any MD2s that match the names of player skins!
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
{
if (stricmp(name, sprnames[spritenum]) == 0)
{
if (stricmp(name, sprnames[spritenum]) == 0)
{
if (stricmp(name, "PLAY") == 0) // Handled already NEWMD2: Per sprite, per-skin check
continue;
md2_models[spritenum].scale = scale;
md2_models[spritenum].offset = offset;
md2_models[spritenum].notfound = false;
strcpy(md2_models[spritenum].filename, filename);
break;
}
if (spritenum == NUMSPRITES-1)
{
CONS_Printf("MD2 for sprite %s not found\n", name);
md2_models[spritenum].notfound = true;
}
md2_models[spritenum].scale = scale;
md2_models[spritenum].offset = offset;
md2_models[spritenum].notfound = false;
strcpy(md2_models[spritenum].filename, filename);
goto spritemd2found;
}
}
//CONS_Printf("MD2 for sprite %s not found\n", sprnames[spritenum]);
md2_models[spritenum].notfound = true;
spritemd2found:
fclose(f);
}
@ -1090,11 +1082,17 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
md2_t *md2;
UINT8 color[4];
if (!cv_grmd2.value)
return;
if (!spr->precip)
return;
// MD2 colormap fix
// colormap test
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = sector->lightlevel;
UINT8 lightlevel = 255;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@ -1105,8 +1103,6 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@ -1115,24 +1111,18 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = sector->lightlevel;
else
lightlevel = 255;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (spr->mobj->frame & FF_FULLBRIGHT)
lightlevel = 255;
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
else
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
}
// Look at HWR_ProjetctSprite for more
if (cv_grmd2.value && ((md2_models[spr->mobj->sprite].scale > 0.0f) || (md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale > 0.0f)) && !spr->precip)
// Look at HWR_ProjectSprite for more
{
GLPatch_t *gpatch;
INT32 *buff;
@ -1149,15 +1139,11 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
//durs = tics;
if (spr->mobj->flags2 & MF2_SHADOW)
{
Surf.FlatColor.s.alpha = 0x40;
}
else if (spr->mobj->frame & FF_TRANSMASK)
HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
else
{
Surf.FlatColor.s.alpha = 0xFF;
}
// dont forget to enabled the depth test because we can't do this like
// before: polygons models are not sorted
@ -1215,7 +1201,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
curr = &md2->model->frames[frame];
if (cv_grmd2.value == 1
&& spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL
&& !(spr->mobj->player && (spr->mobj->state->nextstate == S_PLAY_TAP1 || spr->mobj->state->nextstate == S_PLAY_TAP2) && spr->mobj->state == &states[S_PLAY_STND]))
&& !(spr->mobj->player && spr->mobj->state->nextstate == S_PLAY_WAIT && spr->mobj->state == &states[S_PLAY_STND]))
{
const INT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames;
next = &md2->model->frames[nextframe];
@ -1231,7 +1217,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
p.z = FIXED_TO_FLOAT(spr->mobj->z);
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
sprdef = &((skin_t *)spr->mobj->skin)->spritedef;
sprdef = &((skin_t *)spr->mobj->skin)->sprites[spr->mobj->sprite2];
else
sprdef = &sprites[spr->mobj->sprite];
@ -1263,8 +1249,6 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
p.flip = false;
HWD.pfnDrawMD2i(buff, curr, durs, tics, next, &p, finalscale, flip, color);
}
}

View file

@ -1910,6 +1910,13 @@ EXPORT void HWRAPI(DrawMD2i) (INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 d
pglRotatef(pos->anglex, -1.0f, 0.0f, 0.0f);
//pglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // alpha = level of transparency
// Remove depth mask when the model is transparent so it doesn't cut thorugh sprites // SRB2CBTODO: For all stuff too?!
if (color[3] < 255)
{
pglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // alpha = level of transparency
pglDepthMask(GL_FALSE);
}
val = *gl_cmd_buffer++;
while (val != 0)

View file

@ -56,6 +56,39 @@ char sprnames[NUMSPRITES + 1][5] =
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
};
char spr2names[NUMPLAYERSPRITES][5] =
{
"STND",
"WAIT",
"WALK",
"RUN_",
"PAIN",
"DEAD",
"SPIN",
"GASP",
"JUMP",
"FALL",
"EDGE",
"RIDE",
"SIGN",
"LIFE",
"FLY_",
"TIRE",
"GLID",
"CLNG",
"CLMB",
"TRNS",
"SSTD",
"SWLK",
"SRUN",
"SEDG",
"SHIT"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
state_t states[NUMSTATES] =
{
@ -81,77 +114,56 @@ state_t states[NUMSTATES] =
{SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK
// Player
{SPR_PLAY, 0, 105, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_STND
{SPR_PLAY, 1, 16, {NULL}, 0, 0, S_PLAY_TAP2}, // S_PLAY_TAP1
{SPR_PLAY, 2, 16, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_TAP2
{SPR_PLAY, 3, 4, {NULL}, 0, 0, S_PLAY_RUN2}, // S_PLAY_RUN1
{SPR_PLAY, 4, 4, {NULL}, 0, 0, S_PLAY_RUN3}, // S_PLAY_RUN2
{SPR_PLAY, 5, 4, {NULL}, 0, 0, S_PLAY_RUN4}, // S_PLAY_RUN3
{SPR_PLAY, 6, 4, {NULL}, 0, 0, S_PLAY_RUN5}, // S_PLAY_RUN4
{SPR_PLAY, 7, 4, {NULL}, 0, 0, S_PLAY_RUN6}, // S_PLAY_RUN5
{SPR_PLAY, 8, 4, {NULL}, 0, 0, S_PLAY_RUN7}, // S_PLAY_RUN6
{SPR_PLAY, 9, 4, {NULL}, 0, 0, S_PLAY_RUN8}, // S_PLAY_RUN7
{SPR_PLAY, 10, 4, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_RUN8
{SPR_PLAY, 16, 2, {NULL}, 0, 0, S_PLAY_SPD2}, // S_PLAY_SPD1
{SPR_PLAY, 17, 2, {NULL}, 0, 0, S_PLAY_SPD3}, // S_PLAY_SPD2
{SPR_PLAY, 18, 2, {NULL}, 0, 0, S_PLAY_SPD4}, // S_PLAY_SPD3
{SPR_PLAY, 19, 2, {NULL}, 0, 0, S_PLAY_SPD1}, // S_PLAY_SPD4
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_PLAY_ATK2}, // S_PLAY_ATK1
{SPR_PLAY, 12, 1, {NULL}, 0, 0, S_PLAY_ATK3}, // S_PLAY_ATK2
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_PLAY_ATK4}, // S_PLAY_ATK3
{SPR_PLAY, 14, 1, {NULL}, 0, 0, S_PLAY_ATK1}, // S_PLAY_ATK4
{SPR_PLAY, 15, -1, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_SPRING
{SPR_PLAY, 31, 2, {NULL}, 0, 0, S_PLAY_FALL2}, // S_PLAY_FALL1
{SPR_PLAY, 32, 2, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_FALL2
{SPR_PLAY, 20, 2, {NULL}, 0, 0, S_PLAY_ABL2}, // S_PLAY_ABL1
{SPR_PLAY, 21, 2, {NULL}, 0, 0, S_PLAY_ABL1}, // S_PLAY_ABL2
{SPR_PLAY, 22, 6, {NULL}, 0, 0, S_PLAY_SPC2}, // S_PLAY_SPC1
{SPR_PLAY, 23, 6, {NULL}, 0, 0, S_PLAY_SPC3}, // S_PLAY_SPC2
{SPR_PLAY, 24, 6, {NULL}, 0, 0, S_PLAY_SPC4}, // S_PLAY_SPC3
{SPR_PLAY, 25, 6, {NULL}, 0, 0, S_PLAY_SPC1}, // S_PLAY_SPC4
{SPR_PLAY, 22, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_CLIMB1
{SPR_PLAY, 23, 5, {NULL}, 0, 0, S_PLAY_CLIMB3}, // S_PLAY_CLIMB2
{SPR_PLAY, 24, 5, {NULL}, 0, 0, S_PLAY_CLIMB4}, // S_PLAY_CLIMB3
{SPR_PLAY, 25, 5, {NULL}, 0, 0, S_PLAY_CLIMB5}, // S_PLAY_CLIMB4
{SPR_PLAY, 24, 5, {NULL}, 0, 0, S_PLAY_CLIMB2}, // S_PLAY_CLIMB5
{SPR_PLAY, 26, 14, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_GASP
{SPR_PLAY, 27, 350, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_PAIN
{SPR_PLAY, 28, -1, {A_Fall}, 0, 0, S_NULL}, // S_PLAY_DIE
{SPR_PLAY, 29, 12, {NULL}, 0, 0, S_PLAY_TEETER2}, // S_PLAY_TEETER1
{SPR_PLAY, 30, 12, {NULL}, 0, 0, S_PLAY_TEETER1}, // S_PLAY_TEETER2
{SPR_PLAY, 33, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_CARRY
{SPR_PLAY, 20, -1, {NULL}, 0, 0, S_PLAY_SUPERSTAND}, // S_PLAY_SUPERSTAND
{SPR_PLAY, 20, 7, {NULL}, 0, 0, S_PLAY_SUPERWALK2}, // S_PLAY_SUPERWALK1
{SPR_PLAY, 21, 7, {NULL}, 0, 0, S_PLAY_SUPERWALK1}, // S_PLAY_SUPERWALK2
{SPR_PLAY, 22, 7, {NULL}, 0, 0, S_PLAY_SUPERFLY2}, // S_PLAY_SUPERFLY1
{SPR_PLAY, 23, 7, {NULL}, 0, 0, S_PLAY_SUPERFLY1}, // S_PLAY_SUPERFLY2
{SPR_PLAY, 24, 12, {NULL}, 0, 0, S_PLAY_SUPERTEETER}, // S_PLAY_SUPERTEETER
{SPR_PLAY, 25, -1, {NULL}, 0, 0, S_PLAY_SUPERSTAND}, // S_PLAY_SUPERHIT
{SPR_PLAY, 36, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS2}, // S_PLAY_SUPERTRANS1
{SPR_PLAY, 37, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS3}, // S_PLAY_SUPERTRANS2
{SPR_PLAY, 32806, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS4}, // S_PLAY_SUPERTRANS3
{SPR_PLAY, 39, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS5}, // S_PLAY_SUPERTRANS4
{SPR_PLAY, 40, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS6}, // S_PLAY_SUPERTRANS5
{SPR_PLAY, 41, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS7}, // S_PLAY_SUPERTRANS6
{SPR_PLAY, 42, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS8}, // S_PLAY_SUPERTRANS7
{SPR_PLAY, 43, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS9}, // S_PLAY_SUPERTRANS8
{SPR_PLAY, 44, 16, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_SUPERTRANS9
{SPR_PLAY, SPR2_STND, 105, {NULL}, 0, 0, S_PLAY_WAIT}, // S_PLAY_STND
{SPR_PLAY, SPR2_WAIT, 16, {NULL}, 0, 0, S_PLAY_WAIT}, // S_PLAY_WAIT
{SPR_PLAY, SPR2_WALK, 4, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_WALK
{SPR_PLAY, SPR2_RUN , 2, {NULL}, 0, 0, S_PLAY_RUN}, // S_PLAY_RUN
{SPR_PLAY, SPR2_PAIN, 350, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_PAIN
{SPR_PLAY, SPR2_DEAD, 4, {A_Fall}, 0, 0, S_PLAY_DEAD}, // S_PLAY_DEAD
{SPR_PLAY, SPR2_SPIN, 1, {NULL}, 0, 0, S_PLAY_SPIN}, // S_PLAY_SPIN
{SPR_PLAY, SPR2_GASP, 14, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_GASP
{SPR_PLAY, SPR2_JUMP, -1, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_JUMP
{SPR_PLAY, SPR2_FALL, 2, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_FALL
{SPR_PLAY, SPR2_EDGE, 12, {NULL}, 0, 0, S_PLAY_EDGE}, // S_PLAY_EDGE
{SPR_PLAY, SPR2_RIDE, 4, {NULL}, 0, 0, S_PLAY_RIDE}, // S_PLAY_RIDE
{SPR_PLAY, SPR2_FLY , 2, {NULL}, 0, 0, S_PLAY_FLY}, // S_PLAY_FLY
{SPR_PLAY, SPR2_TIRE, 12, {NULL}, 0, 0, S_PLAY_FLY_TIRED}, // S_PLAY_FLY_TIRED
{SPR_PLAY, SPR2_GLID, 2, {NULL}, 0, 0, S_PLAY_GLIDE}, // S_PLAY_GLIDE
{SPR_PLAY, SPR2_CLNG, 6, {NULL}, 0, 0, S_PLAY_CLING}, // S_PLAY_CLING
{SPR_PLAY, SPR2_CLMB, 5, {NULL}, 0, 0, S_PLAY_CLIMB}, // S_PLAY_CLIMB
{SPR_PLAY, SPR2_SSTD, 7, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_STND
{SPR_PLAY, SPR2_SWLK, 7, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_WALK
{SPR_PLAY, SPR2_SRUN, 7, {NULL}, 0, 0, S_PLAY_SUPER_RUN}, // S_PLAY_SUPER_RUN
{SPR_PLAY, SPR2_SEDG, 12, {NULL}, 0, 0, S_PLAY_SUPER_EDGE}, // S_PLAY_SUPER_EDGE
{SPR_PLAY, SPR2_SHIT, -1, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_PAIN
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3}, // S_PLAY_SUPER_TRANS2
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS4}, // S_PLAY_SUPER_TRANS3
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS5}, // S_PLAY_SUPER_TRANS4
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS6}, // S_PLAY_SUPER_TRANS5
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS7}, // S_PLAY_SUPER_TRANS6
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS8}, // S_PLAY_SUPER_TRANS7
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS9}, // S_PLAY_SUPER_TRANS8
{SPR_PLAY, SPR2_TRNS, 16, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_SUPER_TRANS9
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY}, //S_OBJPLACE_DUMMY
// 1-Up Box Sprites (uses player sprite)
{SPR_PLAY, 35, 2, {NULL}, 0, 16, S_PLAY_BOX2}, // S_PLAY_BOX1
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_PLAY_BOX1}, // S_PLAY_BOX2
{SPR_PLAY, 35, 4, {NULL}, 0, 4, S_PLAY_ICON2}, // S_PLAY_ICON1
{SPR_NULL, 0, 12, {NULL}, 0, 0, S_PLAY_ICON3}, // S_PLAY_ICON2
{SPR_PLAY, 35, 18, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3
{SPR_PLAY, SPR2_LIFE, 2, {NULL}, 0, 16, S_PLAY_BOX2}, // S_PLAY_BOX1
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_PLAY_BOX1}, // S_PLAY_BOX2
{SPR_PLAY, SPR2_LIFE, 4, {NULL}, 0, 4, S_PLAY_ICON2}, // S_PLAY_ICON1
{SPR_NULL, 0, 12, {NULL}, 0, 0, S_PLAY_ICON3}, // S_PLAY_ICON2
{SPR_PLAY, SPR2_LIFE, 18, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3
// Level end sign (uses player sprite)
{SPR_PLAY, 34, 1, {NULL}, 0, 24, S_PLAY_SIGN}, // S_PLAY_SIGN
{SPR_PLAY, SPR2_SIGN, 1, {NULL}, 0, 24, S_PLAY_SIGN}, // S_PLAY_SIGN
// Blue Crawla
{SPR_POSS, 0, 5, {A_Look}, 0, 0, S_POSS_STND2}, // S_POSS_STND
{SPR_POSS, 0, 5, {A_Look}, 0, 0, S_POSS_STND}, // S_POSS_STND2
{SPR_POSS, 0, 5, {A_Look}, 0, 0, S_POSS_STND}, // S_POSS_STND
{SPR_POSS, 0, 3, {A_Chase}, 0, 0, S_POSS_RUN2}, // S_POSS_RUN1
{SPR_POSS, 1, 3, {A_Chase}, 0, 0, S_POSS_RUN3}, // S_POSS_RUN2
{SPR_POSS, 2, 3, {A_Chase}, 0, 0, S_POSS_RUN4}, // S_POSS_RUN3
@ -160,8 +172,7 @@ state_t states[NUMSTATES] =
{SPR_POSS, 5, 3, {A_Chase}, 0, 0, S_POSS_RUN1}, // S_POSS_RUN6
// Red Crawla
{SPR_SPOS, 0, 5, {A_Look}, 0, 0, S_SPOS_STND2}, // S_SPOS_STND
{SPR_SPOS, 0, 5, {A_Look}, 0, 0, S_SPOS_STND}, // S_SPOS_STND2
{SPR_SPOS, 0, 5, {A_Look}, 0, 0, S_SPOS_STND}, // S_SPOS_STND
{SPR_SPOS, 0, 1, {A_Chase}, 0, 0, S_SPOS_RUN2}, // S_SPOS_RUN1
{SPR_SPOS, 1, 1, {A_Chase}, 0, 0, S_SPOS_RUN3}, // S_SPOS_RUN2
{SPR_SPOS, 2, 1, {A_Chase}, 0, 0, S_SPOS_RUN4}, // S_SPOS_RUN3
@ -3110,7 +3121,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
-1, // doomednum
S_PLAY_STND, // spawnstate
1, // spawnhealth
S_PLAY_RUN1, // seestate
S_PLAY_WALK, // seestate
sfx_None, // seesound
0, // reactiontime
sfx_thok, // attacksound
@ -3118,8 +3129,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MT_THOK, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_PLAY_ATK1, // missilestate
S_PLAY_DIE, // deathstate
S_PLAY_SPIN, // missilestate
S_PLAY_DEAD, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
1, // speed

View file

@ -575,6 +575,41 @@ typedef enum sprite
NUMSPRITES
} spritenum_t;
enum playersprite
{
SPR2_STND = 0,
SPR2_WAIT,
SPR2_WALK,
SPR2_RUN ,
SPR2_PAIN,
SPR2_DEAD,
SPR2_SPIN,
SPR2_GASP,
SPR2_JUMP,
SPR2_FALL,
SPR2_EDGE,
SPR2_RIDE,
SPR2_SIGN,
SPR2_LIFE,
SPR2_FLY ,
SPR2_TIRE,
SPR2_GLID,
SPR2_CLNG,
SPR2_CLMB,
SPR2_TRNS,
SPR2_SSTD,
SPR2_SWLK,
SPR2_SRUN,
SPR2_SEDG,
SPR2_SHIT,
NUMPLAYERSPRITES
};
typedef enum state
{
S_NULL,
@ -592,61 +627,46 @@ typedef enum state
// Thok
S_THOK,
// Player
S_PLAY_STND,
S_PLAY_TAP1,
S_PLAY_TAP2,
S_PLAY_RUN1,
S_PLAY_RUN2,
S_PLAY_RUN3,
S_PLAY_RUN4,
S_PLAY_RUN5,
S_PLAY_RUN6,
S_PLAY_RUN7,
S_PLAY_RUN8,
S_PLAY_SPD1,
S_PLAY_SPD2,
S_PLAY_SPD3,
S_PLAY_SPD4,
S_PLAY_ATK1,
S_PLAY_ATK2,
S_PLAY_ATK3,
S_PLAY_ATK4,
S_PLAY_SPRING,
S_PLAY_FALL1,
S_PLAY_FALL2,
S_PLAY_ABL1,
S_PLAY_ABL2,
S_PLAY_SPC1,
S_PLAY_SPC2,
S_PLAY_SPC3,
S_PLAY_SPC4,
S_PLAY_CLIMB1,
S_PLAY_CLIMB2,
S_PLAY_CLIMB3,
S_PLAY_CLIMB4,
S_PLAY_CLIMB5,
S_PLAY_GASP,
S_PLAY_WAIT,
S_PLAY_WALK,
S_PLAY_RUN,
S_PLAY_PAIN,
S_PLAY_DIE,
S_PLAY_TEETER1,
S_PLAY_TEETER2,
S_PLAY_CARRY,
S_PLAY_SUPERSTAND,
S_PLAY_SUPERWALK1,
S_PLAY_SUPERWALK2,
S_PLAY_SUPERFLY1,
S_PLAY_SUPERFLY2,
S_PLAY_SUPERTEETER,
S_PLAY_SUPERHIT,
S_PLAY_SUPERTRANS1,
S_PLAY_SUPERTRANS2,
S_PLAY_SUPERTRANS3,
S_PLAY_SUPERTRANS4,
S_PLAY_SUPERTRANS5,
S_PLAY_SUPERTRANS6,
S_PLAY_SUPERTRANS7,
S_PLAY_SUPERTRANS8,
S_PLAY_SUPERTRANS9, // This has special significance in the code. If you add more frames, search for it and make the appropriate changes.
S_PLAY_DEAD,
S_PLAY_SPIN,
S_PLAY_GASP,
S_PLAY_JUMP,
S_PLAY_FALL,
S_PLAY_EDGE,
S_PLAY_RIDE,
// CA_FLY
S_PLAY_FLY,
S_PLAY_FLY_TIRED,
// CA_GLIDEANDCLIMB
S_PLAY_GLIDE,
S_PLAY_CLING,
S_PLAY_CLIMB,
// SF_SUPERANIMS
S_PLAY_SUPER_STND,
S_PLAY_SUPER_WALK,
S_PLAY_SUPER_RUN,
S_PLAY_SUPER_EDGE,
S_PLAY_SUPER_PAIN,
// SF_SUPER
S_PLAY_SUPER_TRANS,
S_PLAY_SUPER_TRANS2,
S_PLAY_SUPER_TRANS3,
S_PLAY_SUPER_TRANS4,
S_PLAY_SUPER_TRANS5,
S_PLAY_SUPER_TRANS6,
S_PLAY_SUPER_TRANS7,
S_PLAY_SUPER_TRANS8,
S_PLAY_SUPER_TRANS9,
// technically the player goes here but it's an infinite tic state
S_OBJPLACE_DUMMY,
@ -663,7 +683,6 @@ typedef enum state
// Blue Crawla
S_POSS_STND,
S_POSS_STND2,
S_POSS_RUN1,
S_POSS_RUN2,
S_POSS_RUN3,
@ -673,7 +692,6 @@ typedef enum state
// Red Crawla
S_SPOS_STND,
S_SPOS_STND2,
S_SPOS_RUN1,
S_SPOS_RUN2,
S_SPOS_RUN3,
@ -1390,7 +1408,7 @@ typedef enum state
// S_PLAY_TAP1
S_METALSONIC_WAIT1,
S_METALSONIC_WAIT2,
// S_PLAY_RUN1
// S_PLAY_WALK
S_METALSONIC_WALK1,
S_METALSONIC_WALK2,
S_METALSONIC_WALK3,
@ -3488,6 +3506,7 @@ typedef struct
extern state_t states[NUMSTATES];
extern char sprnames[NUMSPRITES + 1][5];
char spr2names[NUMPLAYERSPRITES][5];
extern state_t *astate;
typedef enum mobj_type

View file

@ -1037,6 +1037,7 @@ static int lib_pDamageMobj(lua_State *L)
{
mobj_t *target = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)), *inflictor = NULL, *source = NULL;
INT32 damage;
UINT8 damagetype;
NOHUD
if (!target)
return LUA_ErrInvalid(L, "mobj_t");
@ -1045,13 +1046,15 @@ static int lib_pDamageMobj(lua_State *L)
if (!lua_isnone(L, 3) && lua_isuserdata(L, 3))
source = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
damage = (INT32)luaL_optinteger(L, 4, 1);
lua_pushboolean(L, P_DamageMobj(target, inflictor, source, damage));
damagetype = (UINT8)luaL_optinteger(L, 5, 0);
lua_pushboolean(L, P_DamageMobj(target, inflictor, source, damage, damagetype));
return 1;
}
static int lib_pKillMobj(lua_State *L)
{
mobj_t *target = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)), *inflictor = NULL, *source = NULL;
UINT8 damagetype;
NOHUD
if (!target)
return LUA_ErrInvalid(L, "mobj_t");
@ -1059,7 +1062,8 @@ static int lib_pKillMobj(lua_State *L)
inflictor = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
if (!lua_isnone(L, 3) && lua_isuserdata(L, 3))
source = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_KillMobj(target, inflictor, source);
damagetype = (UINT8)luaL_optinteger(L, 4, 0);
P_KillMobj(target, inflictor, source, damagetype);
return 0;
}

View file

@ -126,8 +126,6 @@ static const char *const widtht_opt[] = {
enum cameraf {
camera_chase = 0,
camera_aiming,
camera_viewheight,
camera_startangle,
camera_x,
camera_y,
camera_z,
@ -137,7 +135,6 @@ enum cameraf {
camera_ceilingz,
camera_radius,
camera_height,
camera_relativex,
camera_momx,
camera_momy,
camera_momz
@ -147,8 +144,6 @@ enum cameraf {
static const char *const camera_opt[] = {
"chase",
"aiming",
"viewheight",
"startangle",
"x",
"y",
"z",
@ -158,7 +153,6 @@ static const char *const camera_opt[] = {
"ceilingz",
"radius",
"height",
"relativex",
"momx",
"momy",
"momz",
@ -279,12 +273,6 @@ static int camera_get(lua_State *L)
case camera_aiming:
lua_pushinteger(L, cam->aiming);
break;
case camera_viewheight:
lua_pushinteger(L, cam->viewheight);
break;
case camera_startangle:
lua_pushinteger(L, cam->startangle);
break;
case camera_x:
lua_pushinteger(L, cam->x);
break;
@ -312,9 +300,6 @@ static int camera_get(lua_State *L)
case camera_height:
lua_pushinteger(L, cam->height);
break;
case camera_relativex:
lua_pushinteger(L, cam->relativex);
break;
case camera_momx:
lua_pushinteger(L, cam->momx);
break;

View file

@ -91,6 +91,44 @@ static int lib_sprnamelen(lua_State *L)
return 1;
}
//
// Player Sprite Names
//
// push sprite name
static int lib_getSpr2name(lua_State *L)
{
UINT32 i;
lua_remove(L, 1); // don't care about spr2names[] dummy userdata.
if (lua_isnumber(L, 1))
{
i = lua_tonumber(L, 1);
if (i > NUMPLAYERSPRITES)
return 0;
lua_pushlstring(L, spr2names[i], 4);
return 1;
}
else if (lua_isstring(L, 1))
{
const char *name = lua_tostring(L, 1);
for (i = 0; i < NUMPLAYERSPRITES; i++)
if (fastcmp(name, spr2names[i]))
{
lua_pushinteger(L, i);
return 1;
}
}
return 0;
}
static int lib_spr2namelen(lua_State *L)
{
lua_pushinteger(L, NUMPLAYERSPRITES);
return 1;
}
////////////////
// STATE INFO //
////////////////
@ -904,6 +942,16 @@ int LUA_InfoLib(lua_State *L)
lua_setmetatable(L, -2);
lua_setglobal(L, "sprnames");
lua_newuserdata(L, 0);
lua_createtable(L, 0, 2);
lua_pushcfunction(L, lib_getSpr2name);
lua_setfield(L, -2, "__index");
lua_pushcfunction(L, lib_spr2namelen);
lua_setfield(L, -2, "__len");
lua_setmetatable(L, -2);
lua_setglobal(L, "spr2names");
lua_newuserdata(L, 0);
lua_createtable(L, 0, 2);
lua_pushcfunction(L, lib_getState);

View file

@ -60,7 +60,6 @@ enum subsector_e {
subsector_sector,
subsector_numlines,
subsector_firstline,
subsector_validcount
};
static const char *const subsector_opt[] = {
@ -68,7 +67,6 @@ static const char *const subsector_opt[] = {
"sector",
"numlines",
"firstline",
"validcount",
NULL};
enum line_e {
@ -86,7 +84,6 @@ enum line_e {
line_slopetype,
line_frontsector,
line_backsector,
line_validcount,
line_firsttag,
line_nexttag,
line_text,
@ -108,7 +105,6 @@ static const char *const line_opt[] = {
"slopetype",
"frontsector",
"backsector",
"validcount",
"firsttag",
"nexttag",
"text",
@ -476,9 +472,6 @@ static int subsector_get(lua_State *L)
case subsector_firstline:
lua_pushinteger(L, subsector->firstline);
return 1;
case subsector_validcount:
lua_pushinteger(L, subsector->validcount);
return 1;
}
return 0;
}
@ -564,9 +557,6 @@ static int line_get(lua_State *L)
case line_backsector:
LUA_PushUserdata(L, line->backsector, META_SECTOR);
return 1;
case line_validcount:
lua_pushinteger(L, line->validcount);
return 1;
case line_firsttag:
lua_pushinteger(L, line->firsttag);
return 1;

View file

@ -501,7 +501,7 @@ static int mobj_set(lua_State *L)
return luaL_error(L, "mobj.skin '%s' not found!", skin);
}
case mobj_color:
mo->color = ((UINT8)luaL_checkinteger(L, 3)) % MAXSKINCOLORS;
mo->color = ((UINT8)luaL_checkinteger(L, 3)) % MAXTRANSLATIONS;
break;
case mobj_bnext:
return NOSETPOS;

View file

@ -91,6 +91,33 @@ static UINT8 cheatf_warp(void)
return 1;
}
#ifdef DEVELOP
static UINT8 cheatf_devmode(void)
{
UINT8 i;
if (modifiedgame)
return 0;
if (menuactive && currentMenu != &MainDef)
return 0; // Only on the main menu!
S_StartSound(0, sfx_itemup);
// Just unlock all the things and turn on -debug and console devmode.
G_SetGameModified(false);
for (i = 0; i < MAXUNLOCKABLES; i++)
unlockables[i].unlocked = true;
devparm = TRUE;
cv_debug |= 0x8000;
// Refresh secrets menu existing.
M_ClearMenus(true);
M_StartControlPanel();
return 1;
}
#endif
static cheatseq_t cheat_ultimate = {
0, cheatf_ultimate,
{ SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff }
@ -115,6 +142,14 @@ static cheatseq_t cheat_warp_joy = {
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_ENTER), 0xff }
};
#ifdef DEVELOP
static cheatseq_t cheat_devmode = {
0, cheatf_devmode,
{ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff }
};
#endif
// ==========================================================================
// CHEAT SEQUENCE PACKAGE
// ==========================================================================
@ -221,6 +256,9 @@ boolean cht_Responder(event_t *ev)
ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch);
ret += cht_CheckCheat(&cheat_warp, (char)ch);
ret += cht_CheckCheat(&cheat_warp_joy, (char)ch);
#ifdef DEVELOP
ret += cht_CheckCheat(&cheat_devmode, (char)ch);
#endif
return (ret != 0);
}
@ -334,7 +372,7 @@ void Command_Hurtme_f(void)
return;
}
P_DamageMobj(players[consoleplayer].mo, NULL, NULL, atoi(COM_Argv(1)));
P_DamageMobj(players[consoleplayer].mo, NULL, NULL, atoi(COM_Argv(1)), 0);
}
// Moves the NiGHTS player to another axis within the current mare

View file

@ -110,10 +110,10 @@ const char *quitmsg[NUM_QUITMESSAGES];
// Stuff for customizing the player select screen Tails 09-22-2003
description_t description[32] =
{
{"\x82Sonic\x80 is the fastest of the three, but also the hardest to control. Beginners beware, but experts will find Sonic very powerful.\n\n\x82""Ability:\x80 Speed Thok\nDouble jump to zoom forward with a huge burst of speed.\n\n\x82Tip:\x80 Simply letting go of forward does not slow down in SRB2. To slow down, hold the opposite direction.", "", "sonic"},
{"\x82Tails\x80 is the most mobile of the three, but has the slowest speed. Because of his mobility, he's well-\nsuited to beginners.\n\n\x82""Ability:\x80 Fly\nDouble jump to start flying for a limited time. Repetitively hit the jump button to ascend.\n\n\x82Tip:\x80 To quickly descend while flying, hit the spin button.", "", "tails"},
{"\x82Knuckles\x80 is well-\nrounded and can destroy breakable walls simply by touching them, but he can't jump as high as the other two.\n\n\x82""Ability:\x80 Glide & Climb\nDouble jump to glide in the air as long as jump is held. Glide into a wall to climb it.\n\n\x82Tip:\x80 Press spin while climbing to jump off the wall; press jump instead to jump off\nand face away from\nthe wall.", "", "knuckles"},
{"\x82Sonic & Tails\x80 team up to take on Dr. Eggman!\nControl Sonic while Tails desperately struggles to keep up.\n\nPlayer 2 can control Tails directly by setting the controls in the options menu.\nTails's directional controls are relative to Player 1's camera.\n\nTails can pick up Sonic while flying and carry him around.", "CHRS&T", "sonic&tails"},
{"???", "", ""},
{"???", "", ""},
{"???", "", ""},
{"???", "", ""},
{"???", "", ""},
{"???", "", ""},
{"???", "", ""},
@ -827,10 +827,10 @@ static menuitem_t SP_LevelStatsMenu[] =
// And I'm too lazy to go through and rename it everywhere. ARRGH!
menuitem_t PlayerMenu[32] =
{
{IT_CALL, NULL, NULL, M_ChoosePlayer, 0},
{IT_CALL, NULL, NULL, M_ChoosePlayer, 0},
{IT_CALL, NULL, NULL, M_ChoosePlayer, 0},
{IT_CALL, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
{IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0},
@ -6331,8 +6331,8 @@ static void M_HandleConnectIP(INT32 choice)
#define PLBOXW 8
#define PLBOXH 9
static INT32 multi_tics;
static state_t *multi_state;
static UINT8 multi_tics;
static UINT8 multi_frame;
// this is set before entering the MultiPlayer setup menu,
// for either player 1 or 2
@ -6346,11 +6346,10 @@ static INT32 setupm_fakecolor;
static void M_DrawSetupMultiPlayerMenu(void)
{
INT32 mx, my, st, flags = 0;
INT32 mx, my, flags = 0;
spritedef_t *sprdef;
spriteframe_t *sprframe;
patch_t *patch;
UINT8 frame;
mx = MP_PlayerSetupDef.x;
my = MP_PlayerSetupDef.y;
@ -6378,28 +6377,23 @@ static void M_DrawSetupMultiPlayerMenu(void)
// anim the player in the box
if (--multi_tics <= 0)
{
st = multi_state->nextstate;
if (st != S_NULL)
multi_state = &states[st];
multi_tics = multi_state->tics;
if (multi_tics == -1)
multi_tics = 15;
multi_frame++;
multi_tics = 4;
}
// skin 0 is default player sprite
if (R_SkinAvailable(skins[setupm_fakeskin].name) != -1)
sprdef = &skins[R_SkinAvailable(skins[setupm_fakeskin].name)].spritedef;
sprdef = &skins[R_SkinAvailable(skins[setupm_fakeskin].name)].sprites[SPR2_WALK];
else
sprdef = &skins[0].spritedef;
sprdef = &skins[0].sprites[SPR2_WALK];
if (!sprdef->numframes) // No frames ??
return; // Can't render!
frame = multi_state->frame & FF_FRAMEMASK;
if (frame >= sprdef->numframes) // Walking animation missing
frame = 0; // Try to use standing frame
if (multi_frame >= sprdef->numframes)
multi_frame = 0;
sprframe = &sprdef->spriteframes[frame];
sprframe = &sprdef->spriteframes[multi_frame];
patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
if (sprframe->flip & 1) // Only for first sprite
flags |= V_FLIP; // This sprite is left/right flipped!
@ -6533,8 +6527,8 @@ static void M_SetupMultiPlayer(INT32 choice)
{
(void)choice;
multi_state = &states[mobjinfo[MT_PLAYER].seestate];
multi_tics = multi_state->tics;
multi_frame = 0;
multi_tics = 4;
strcpy(setupm_name, cv_playername.string);
// set for player 1
@ -6564,8 +6558,8 @@ static void M_SetupMultiPlayer2(INT32 choice)
{
(void)choice;
multi_state = &states[mobjinfo[MT_PLAYER].seestate];
multi_tics = multi_state->tics;
multi_frame = 0;
multi_tics = 4;
strcpy (setupm_name, cv_playername2.string);
// set for splitscreen secondary player

View file

@ -363,12 +363,12 @@ boolean P_CheckMissileRange(mobj_t *actor)
if (!actor->target)
return false;
if (!P_CheckSight(actor, actor->target))
return false;
if (actor->reactiontime)
return false; // do not attack yet
if (!P_CheckSight(actor, actor->target))
return false;
// OPTIMIZE: get this from a global checksight
dist = P_AproxDistance(actor->x-actor->target->x, actor->y-actor->target->y) - FixedMul(64*FRACUNIT, actor->scale);
@ -652,6 +652,9 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
player = &players[actor->lastlook];
if ((netgame || multiplayer) && player->spectator)
continue;
if (player->health <= 0)
continue; // dead
@ -661,12 +664,6 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
if (!player->mo || P_MobjWasRemoved(player->mo))
continue;
if (!P_CheckSight(actor, player->mo))
continue; // out of sight
if ((netgame || multiplayer) && player->spectator)
continue;
if (dist > 0
&& P_AproxDistance(P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y), player->mo->z - actor->z) > dist)
continue; // Too far away
@ -683,6 +680,9 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
}
}
if (!P_CheckSight(actor, player->mo))
continue; // out of sight
if (tracer)
P_SetTarget(&actor->tracer, player->mo);
else
@ -2513,7 +2513,7 @@ void A_1upThinker(mobj_t *actor)
}
}
if (closestplayer == -1 || skins[players[closestplayer].skin].spritedef.numframes <= states[S_PLAY_BOX1].frame)
if (closestplayer == -1 || skins[players[closestplayer].skin].sprites[SPR2_LIFE].numframes == 0)
{ // Closest player not found (no players in game?? may be empty dedicated server!), or does not have correct sprite.
actor->frame = 0;
if (actor->tracer) {
@ -2658,7 +2658,7 @@ for (i = cvar.value; i; --i) spawnchance[numchoices++] = type
if (actor->tracer) // Remove the old lives icon.
P_RemoveMobj(actor->tracer);
if (!newmobj->target->skin || ((skin_t *)newmobj->target->skin)->spritedef.numframes <= states[S_PLAY_BOX1].frame)
if (!newmobj->target->skin || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0)
newmobj->frame -= 2; // No lives icon for this player, use the default.
else
{ // Spawn the lives icon.
@ -4813,7 +4813,7 @@ void A_UnidusBall(mobj_t *actor)
boolean skull = (actor->target->flags2 & MF2_SKULLFLY) == MF2_SKULLFLY;
if (actor->target->state == &states[actor->target->info->painstate])
{
P_KillMobj(actor, NULL, NULL);
P_KillMobj(actor, NULL, NULL, 0);
return;
}
switch(actor->extravalue2)
@ -5024,7 +5024,7 @@ void A_MaceRotate(mobj_t *actor)
actor->movecount += actor->target->lastlook;
actor->movecount &= FINEMASK;
actor->threshold = FixedMul(FINECOSINE(actor->movecount), actor->target->lastlook);
actor->threshold = FixedMul(FINECOSINE(actor->movecount), actor->target->lastlook << FRACBITS);
v[0] = FRACUNIT;
v[1] = 0;
@ -5032,7 +5032,7 @@ void A_MaceRotate(mobj_t *actor)
v[3] = FRACUNIT;
// Calculate the angle matrixes for the link.
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->threshold << FRACBITS)));
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->threshold)));
M_Memcpy(&v, res, sizeof(v));
res = VectorMatrixMultiply(v, *RotateZMatrix(actor->target->health << ANGLETOFINESHIFT));
M_Memcpy(&v, res, sizeof(v));
@ -5278,7 +5278,7 @@ void A_RingExplode(mobj_t *actor)
if (mo2->flags & MF_SHOOTABLE)
{
actor->flags2 |= MF2_DEBRIS;
P_DamageMobj(mo2, actor, actor->target, 1);
P_DamageMobj(mo2, actor, actor->target, 1, 0);
continue;
}
}
@ -5660,6 +5660,11 @@ void A_RecyclePowers(mobj_t *actor)
if (playeringame[i] && players[i].mo && players[i].mo->health > 0 && players[i].playerstate == PST_LIVE
&& !players[i].exiting && !((netgame || multiplayer) && players[i].spectator))
{
#ifndef WEIGHTEDRECYCLER
if (players[i].powers[pw_super])
continue; // Ignore super players
#endif
numplayers++;
postscramble[j] = playerslist[j] = (UINT8)i;
@ -6378,7 +6383,7 @@ void A_EggmanBox(mobj_t *actor)
return;
}
P_DamageMobj(actor->target, actor, actor, 1); // Ow!
P_DamageMobj(actor->target, actor, actor, 1, 0); // Ow!
}
// Function: A_TurretFire
@ -9363,9 +9368,9 @@ void A_RemoteDamage(mobj_t *actor)
if (locvar2 == 1) // Kill mobj!
{
if (target->player) // players die using P_DamageMobj instead for some reason
P_DamageMobj(target, source, source, 10000);
P_DamageMobj(target, source, source, 1, DMG_INSTAKILL);
else
P_KillMobj(target, source, source);
P_KillMobj(target, source, source, 0);
}
else if (locvar2 == 2) // Remove mobj!
{
@ -9375,7 +9380,7 @@ void A_RemoteDamage(mobj_t *actor)
P_RemoveMobj(target);
}
else // default: Damage mobj!
P_DamageMobj(target, source, source, 1);
P_DamageMobj(target, source, source, 1, 0);
}
// Function: A_HomingChase
@ -9610,7 +9615,7 @@ void A_VileAttack(mobj_t *actor)
return;
S_StartSound(actor, soundtoplay);
P_DamageMobj(actor->target, actor, actor, 1);
P_DamageMobj(actor->target, actor, actor, 1, 0);
//actor->target->momz = 1000*FRACUNIT/actor->target->info->mass; // How id did it
actor->target->momz += FixedMul(10*FRACUNIT, actor->scale)*P_MobjFlip(actor->target); // How we're doing it
if (explosionType != MT_NULL)
@ -9651,7 +9656,7 @@ void A_VileAttack(mobj_t *actor)
continue;
S_StartSound(actor, soundtoplay);
P_DamageMobj(players[i].mo, actor, actor, 1);
P_DamageMobj(players[i].mo, actor, actor, 1, 0);
//actor->target->momz = 1000*FRACUNIT/actor->target->info->mass; // How id did it
players[i].mo->momz += FixedMul(10*FRACUNIT, actor->scale)*P_MobjFlip(players[i].mo); // How we're doing it
if (explosionType != MT_NULL)

View file

@ -1215,9 +1215,7 @@ void T_SpikeSector(levelspecthink_t *spikes)
if (dothepain)
{
mobj_t *killer = P_SpawnMobj(thing->x, thing->y, thing->z, MT_NULL);
killer->threshold = 43; // Special flag that it was spikes which hurt you.
P_DamageMobj(thing, killer, killer, 1);
P_DamageMobj(thing, NULL, NULL, 1, DMG_SPIKE);
break;
}
}
@ -1968,51 +1966,71 @@ void T_NoEnemiesSector(levelspecthink_t *nobaddies)
{
size_t i;
fixed_t upperbound, lowerbound;
INT32 s;
sector_t *checksector;
sector_t *sec = NULL;
sector_t *targetsec = NULL;
INT32 secnum = -1;
msecnode_t *node;
mobj_t *thing;
boolean exists = false;
boolean FOFsector = false;
for (i = 0; i < nobaddies->sector->linecount; i++)
while ((secnum = P_FindSectorFromLineTag(nobaddies->sourceline, secnum)) >= 0)
{
if (nobaddies->sector->lines[i]->special == 223)
sec = &sectors[secnum];
FOFsector = false;
// Check the lines of this sector, to see if it is a FOF control sector.
for (i = 0; i < sec->linecount; i++)
{
INT32 targetsecnum = -1;
upperbound = nobaddies->sector->ceilingheight;
lowerbound = nobaddies->sector->floorheight;
if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300)
continue;
for (s = -1; (s = P_FindSectorFromLineTag(nobaddies->sector->lines[i], s)) >= 0 ;)
FOFsector = true;
while ((targetsecnum = P_FindSectorFromLineTag(sec->lines[i], targetsecnum)) >= 0)
{
checksector = &sectors[s];
targetsec = &sectors[targetsecnum];
node = checksector->touching_thinglist; // things touching this sector
upperbound = targetsec->ceilingheight;
lowerbound = targetsec->floorheight;
node = targetsec->touching_thinglist; // things touching this sector
while (node)
{
thing = node->m_thing;
if ((thing->flags & (MF_ENEMY|MF_BOSS)) && thing->health > 0
&& thing->z < upperbound && thing->z+thing->height > lowerbound)
{
exists = true;
goto foundenemy;
}
&& thing->z < upperbound && thing->z+thing->height > lowerbound)
return;
node = node->m_snext;
}
}
}
if (!FOFsector)
{
upperbound = sec->ceilingheight;
lowerbound = sec->floorheight;
node = sec->touching_thinglist; // things touching this sector
while (node)
{
thing = node->m_thing;
if ((thing->flags & (MF_ENEMY|MF_BOSS)) && thing->health > 0
&& thing->z < upperbound && thing->z+thing->height > lowerbound)
return;
node = node->m_snext;
}
}
}
foundenemy:
if (exists)
return;
s = P_AproxDistance(nobaddies->sourceline->dx, nobaddies->sourceline->dy)>>FRACBITS;
CONS_Debug(DBG_GAMELOGIC, "Running no-more-enemies exec with tag of %d\n", nobaddies->sourceline->tag);
CONS_Debug(DBG_GAMELOGIC, "Running no-more-enemies exec with tag of %d\n", s);
// Otherwise, run the linedef exec and terminate this thinker
P_LinedefExecute((INT16)s, NULL, NULL);
// No enemies found, run the linedef exec and terminate this thinker
P_RunTriggerLinedef(nobaddies->sourceline, NULL, NULL);
P_RemoveThinker(&nobaddies->thinker);
}
@ -2217,7 +2235,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
oldPlayersArea = oldPlayersInArea;
}
if ((affectPlayer = P_HavePlayersEnteredArea(playersArea, oldPlayersArea, inAndOut)) != -1)
while ((affectPlayer = P_HavePlayersEnteredArea(playersArea, oldPlayersArea, inAndOut)) != -1)
{
if (GETSECSPECIAL(sec->special, 2) == 2 || GETSECSPECIAL(sec->special, 2) == 3)
{
@ -2250,6 +2268,8 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
if (!eachtime->sourceline->special) // this happens only for "Trigger on X calls" linedefs
P_RemoveThinker(&eachtime->thinker);
oldPlayersArea[affectPlayer]=playersArea[affectPlayer];
}
}
@ -3105,7 +3125,7 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
thing->momz = FixedMul(6*FRACUNIT, thing->scale);
P_SetThingPosition(thing);
if (thing->flags & MF_SHOOTABLE)
P_DamageMobj(thing, puncher, puncher, 1);
P_DamageMobj(thing, puncher, puncher, 1, 0);
else if (thing->type == MT_RING || thing->type == MT_COIN)
{
thing->momz = FixedMul(3*FRACUNIT, thing->scale);

View file

@ -291,7 +291,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
if (special->type == MT_BLACKEGGMAN)
{
P_DamageMobj(toucher, special, special, 1); // ouch
P_DamageMobj(toucher, special, special, 1, 0); // ouch
return;
}
@ -303,20 +303,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
toucher->momz = -toucher->momz;
toucher->momx = -toucher->momx;
toucher->momy = -toucher->momy;
P_DamageMobj(special, toucher, toucher, 1);
P_DamageMobj(special, toucher, toucher, 1, 0);
}
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP)))
&& player->charability == CA_FLY
&& (player->powers[pw_tailsfly]
|| (toucher->state >= &states[S_PLAY_SPC1] && toucher->state <= &states[S_PLAY_SPC4]))) // Tails can shred stuff with his propeller.
|| toucher->state-states == S_PLAY_FLY_TIRED)) // Tails can shred stuff with his propeller.
{
toucher->momz = -toucher->momz/2;
P_DamageMobj(special, toucher, toucher, 1);
P_DamageMobj(special, toucher, toucher, 1, 0);
}
else
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, 0);
return;
}
@ -330,13 +330,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
{
// Can only hit snapper from above
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, 0);
}
else if (special->type == MT_SHARP
&& ((special->state == &states[special->info->xdeathstate]) || (toucher->z > special->z + special->height/2)))
{
// Cannot hit sharp from above or when red and angry
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, 0);
}
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|| (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
@ -345,27 +345,27 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (P_MobjFlip(toucher)*toucher->momz < 0)
toucher->momz = -toucher->momz;
P_DamageMobj(special, toucher, toucher, 1);
P_DamageMobj(special, toucher, toucher, 1, 0);
}
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE
&& player->charability == CA_FLY
&& (player->powers[pw_tailsfly]
|| (toucher->state >= &states[S_PLAY_SPC1] && toucher->state <= &states[S_PLAY_SPC4]))) // Tails can shred stuff with his propeller.
|| toucher->state-states == S_PLAY_FLY_TIRED)) // Tails can shred stuff with his propeller.
{
if (P_MobjFlip(toucher)*toucher->momz < 0)
toucher->momz = -toucher->momz/2;
P_DamageMobj(special, toucher, toucher, 1);
P_DamageMobj(special, toucher, toucher, 1, 0);
}
else
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, 0);
return;
}
else if (special->flags & MF_FIRE)
{
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, DMG_FIRE);
return;
}
else
@ -743,7 +743,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (mo2->flags & MF_SHOOTABLE)
{
P_DamageMobj(mo2, toucher, toucher, 1);
P_DamageMobj(mo2, toucher, toucher, 1, 0);
continue;
}
@ -875,7 +875,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_ResetPlayer(player);
P_SetPlayerMobjState(toucher, S_PLAY_FALL1);
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
}
}
return;
@ -1212,7 +1212,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING)
{
player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_PLAY_FALL1);
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
}
// Play a bounce sound?
@ -1279,7 +1279,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING)
{
player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_PLAY_FALL1);
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
}
// Play a bounce sound?
@ -1335,7 +1335,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
player->pflags |= PF_MACESPIN;
S_StartSound(toucher, sfx_spin);
P_SetPlayerMobjState(toucher, S_PLAY_ATK1);
P_SetPlayerMobjState(toucher, S_PLAY_SPIN);
}
else
player->pflags |= PF_ITEMHANG;
@ -1351,7 +1351,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
case MT_SPECIALSPIKEBALL:
if (!(!useNightsSS && G_IsSpecialStage(gamemap))) // Only for old special stages
{
P_DamageMobj(toucher, special, special, 1);
P_DamageMobj(toucher, special, special, 1, 0);
return;
}
@ -1382,7 +1382,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Goomba Stomp'd!
if (special->target->momz < 0)
{
P_DamageMobj(toucher, special, special->target, 1);
P_DamageMobj(toucher, special, special->target, 1, 0);
//special->target->momz = -special->target->momz;
special->target->momx = special->target->momy = 0;
special->target->momz = 0;
@ -1446,7 +1446,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
S_StartSound(toucher, special->info->deathsound); // was NULL, but changed to player so you could hear others pick up rings
P_KillMobj(special, NULL, toucher);
P_KillMobj(special, NULL, toucher, 0);
}
#define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : ""
@ -1457,8 +1457,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
* \param player Affected player.
* \param inflictor The attack weapon used, can be NULL.
* \param source The attacker, can be NULL.
* \param damagetype The type of damage dealt to the player. If bit 7 (0x80) is set, this was an instant-kill.
*/
static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *source)
static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
{
const char *str = NULL;
boolean deathonly = false;
@ -1567,22 +1568,6 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
}
else switch (source->type)
{
case MT_NULL:
switch(source->threshold)
{
case 42:
deathonly = true;
str = M_GetText("%s drowned.\n");
break;
case 43:
str = M_GetText("%s was %s by spikes.\n");
break;
case 44:
deathonly = true;
str = M_GetText("%s was crushed.\n");
break;
}
break;
case MT_EGGMANICO:
case MT_EGGMANBOX:
str = M_GetText("%s was %s by Eggman's nefarious TV magic.\n");
@ -1598,30 +1583,52 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
else
{
// null source, environment kills
// TERRIBLE HACK for hit damage because P_DoPlayerPain moves the player...
// I'll put it back, I promise!
player->mo->z -= player->mo->momz+1;
if (P_PlayerTouchingSectorSpecial(player, 1, 2))
str = M_GetText("%s was %s by chemical water.\n");
else if (P_PlayerTouchingSectorSpecial(player, 1, 3))
str = M_GetText("%s was %s by molten lava.\n");
else if (P_PlayerTouchingSectorSpecial(player, 1, 4))
str = M_GetText("%s was %s by electricity.\n");
else if (deadtarget)
switch (damagetype)
{
deathonly = true;
if (P_PlayerTouchingSectorSpecial(player, 1, 6)
|| P_PlayerTouchingSectorSpecial(player, 1, 7))
str = M_GetText("%s fell into a bottomless pit.\n");
else if (P_PlayerTouchingSectorSpecial(player, 1, 12))
str = M_GetText("%s asphyxiated in space.\n");
else
str = M_GetText("%s died.\n");
case DMG_WATER:
str = M_GetText("%s was %s by chemical water.\n");
break;
case DMG_FIRE:
str = M_GetText("%s was %s by molten lava.\n");
break;
case DMG_ELECTRIC:
str = M_GetText("%s was %s by electricity.\n");
break;
case DMG_SPIKE:
str = M_GetText("%s was %s by spikes.\n");
break;
case DMG_DROWNED:
deathonly = true;
str = M_GetText("%s drowned.\n");
break;
case DMG_CRUSHED:
deathonly = true;
str = M_GetText("%s was crushed.\n");
break;
case DMG_DEATHPIT:
if (deadtarget)
{
deathonly = true;
str = M_GetText("%s fell into a bottomless pit.\n");
}
break;
case DMG_SPACEDROWN:
if (deadtarget)
{
deathonly = true;
str = M_GetText("%s asphyxiated in space.\n");
}
break;
default:
if (deadtarget)
{
deathonly = true;
str = M_GetText("%s died.\n");
}
break;
}
if (!str)
str = M_GetText("%s was %s by an environmental hazard.\n");
player->mo->z += player->mo->momz+1;
}
if (!str) // Should not happen! Unless we missed catching something above.
@ -1799,10 +1806,11 @@ boolean P_CheckRacers(void)
* \param target The victim.
* \param inflictor The attack weapon. May be NULL (environmental damage).
* \param source The attacker. May be NULL.
* \param damagetype The type of damage dealt that killed the target. If bit 7 (0x80) was set, this was an instant-death.
* \todo Cleanup, refactor, split up.
* \sa P_DamageMobj
*/
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
{
mobjtype_t item;
mobj_t *mo;
@ -2126,15 +2134,19 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
case MT_PLAYER:
target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player)
target->momx = target->momy = target->momz = 0;
if (!(source && source->type == MT_NULL && source->threshold == 42)) // Don't jump up when drowning
P_SetObjectMomZ(target, 14*FRACUNIT, false);
if (source && source->type == MT_NULL && source->threshold == 42) // drowned
if (damagetype == DMG_DROWNED) // drowned
{
S_StartSound(target, sfx_drown);
else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // Spikes
S_StartSound(target, sfx_spkdth);
// Don't jump up when drowning
}
else
P_PlayDeathSound(target);
{
P_SetObjectMomZ(target, 14*FRACUNIT, false);
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes
S_StartSound(target, sfx_spkdth);
else
P_PlayDeathSound(target);
}
break;
default:
break;
@ -2384,7 +2396,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT))
{
P_AddPlayerScore(source->player, 100); //award points to tagger.
P_HitDeathMessages(player, inflictor, source);
P_HitDeathMessages(player, inflictor, source, 0);
if (gametype == GT_TAG) //survivor
{
@ -2570,7 +2582,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so
P_InstaThrust(player->mo, ang, fallbackspeed);
if (player->charflags & SF_SUPERANIMS)
P_SetPlayerMobjState(player->mo, S_PLAY_SUPERHIT);
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_PAIN);
else
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
@ -2640,7 +2652,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)
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
{
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
{
@ -2648,7 +2660,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes
S_StartSound(player->mo, sfx_spkdth);
}
@ -2677,21 +2689,21 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
/** Damages an object, which may or may not be a player.
* For melee attacks, source and inflictor are the same.
*
* \param target The object being damaged.
* \param inflictor The thing that caused the damage: creature, missile,
* gargoyle, and so forth. Can be NULL in the case of
* environmental damage, such as slime or crushing.
* \param source The creature or person responsible. For example, if a
* player is hit by a ring, the player who shot it. In some
* cases, the target will go after this object after
* receiving damage. This can be NULL.
* \param damage Amount of damage to be dealt. 10000 is instant death.
* \param target The object being damaged.
* \param inflictor The thing that caused the damage: creature, missile,
* gargoyle, and so forth. Can be NULL in the case of
* environmental damage, such as slime or crushing.
* \param source The creature or person responsible. For example, if a
* player is hit by a ring, the player who shot it. In some
* cases, the target will go after this object after
* receiving damage. This can be NULL.
* \param damage Amount of damage to be dealt.
* \param damagetype Type of damage to be dealt. If bit 7 (0x80) is set, this is an instant-kill.
* \return True if the target sustained damage, otherwise false.
* \todo Clean up this mess, split into multiple functions.
* \todo Get rid of the magic number 10000.
* \sa P_KillMobj
*/
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
{
player_t *player;
#ifdef HAVE_BLUA
@ -2709,9 +2721,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Spectator handling
if (netgame)
{
if (damage == 42000 && target->player && target->player->spectator)
damage = 10000;
else if (target->player && target->player->spectator)
if (damagetype != DMG_SPECTATOR && target->player && target->player->spectator)
return false;
if (source && source->player && source->player->spectator)
@ -2819,6 +2829,21 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS))
return false;
switch (damagetype)
{
case DMG_WATER:
case DMG_FIRE:
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
return false; // Invincible to water/fire damage
break;
case DMG_ELECTRIC:
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)
return false; // Invincible to electric damage
break;
default:
break;
}
}
if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling
@ -2840,12 +2865,12 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
return true;
}
if (!force && inflictor && (inflictor->flags & MF_FIRE))
if (!force && inflictor && inflictor->flags & MF_FIRE)
{
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
return false; // Invincible to fire objects
if (G_PlatformGametype() && source && source->player)
if (G_PlatformGametype() && inflictor && source && source->player)
return false; // Don't get hurt by fire generated from friends.
}
@ -2854,7 +2879,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
{
if ((gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) && cv_suddendeath.value
&& !player->powers[pw_flashing] && !player->powers[pw_invulnerability])
damage = 10000;
damagetype = DMG_INSTAKILL;
}
// Player hits another player
@ -2868,7 +2893,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
return false;
// Instant-Death
if (damage == 10000)
if (damagetype & DMG_DEATHMASK)
P_KillPlayer(player, source, damage);
else if (metalrecording)
{
@ -2876,7 +2901,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
inflictor = source;
if (inflictor && inflictor->flags & MF_ENEMY)
{ // Metal Sonic destroy enemy !!
P_KillMobj(inflictor, NULL, target);
P_KillMobj(inflictor, NULL, target, damagetype);
return false;
}
else if (inflictor && inflictor->flags & MF_MISSILE)
@ -2915,7 +2940,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
else if (player->mo->health > 1) // No shield but have rings.
{
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
P_RingDamage(player, inflictor, source, damage, damagetype);
}
else // No shield, no rings, no invincibility.
{
@ -2952,21 +2977,20 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
P_PlayerFlagBurst(player, false);
}
else if (damagetype & DMG_DEATHMASK)
player->health = 0;
else
{
player->health -= damage; // mirror mobj health here
if (damage < 10000)
{
target->player->powers[pw_flashing] = flashingtics;
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
P_PlayerRingBurst(player, damage);
}
target->player->powers[pw_flashing] = flashingtics;
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
P_PlayerRingBurst(player, damage);
}
if (player->health < 0)
player->health = 0;
P_HitDeathMessages(player, inflictor, source);
P_HitDeathMessages(player, inflictor, source, damagetype);
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
}
@ -2974,7 +2998,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Killing dead. Just for kicks.
// Require source and inflictor be player. Don't hurt for firing rings.
if (cv_killingdead.value && (source && source->player) && (inflictor && inflictor->player) && P_Random() < 80)
P_DamageMobj(source, target, target, 1);
P_DamageMobj(source, target, target, 1, 0);
// do the damage
if (player && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player))
@ -2983,6 +3007,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (target->health < 2)
target->health = 2;
}
else if (damagetype & DMG_DEATHMASK)
target->health = 0;
else
target->health -= damage;
@ -2991,7 +3017,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (target->health <= 0)
{
P_KillMobj(target, inflictor, source);
P_KillMobj(target, inflictor, source, damagetype);
return true;
}

View file

@ -38,6 +38,9 @@
#define MAPBMASK (MAPBLOCKSIZE-1)
#define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS)
// Convenience macro to fix issue with collision along bottom/left edges of blockmap -Red
#define BMBOUNDFIX(xl, xh, yl, yh) {if (xl > xh) xl = 0; if (yl > yh) yl = 0;}
// player radius used only in am_map.c
#define PLAYERRADIUS (16*FRACUNIT)
@ -273,7 +276,6 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
extern boolean floatok;
extern fixed_t tmfloorz;
extern fixed_t tmceilingz;
extern boolean tmsprung;
extern mobj_t *tmfloorthing, *tmthing;
extern camera_t *mapcampointer;
@ -343,12 +345,29 @@ typedef struct BasicFF_s
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
} BasicFF_t;
/* Damage/death types, for P_DamageMobj and related */
//// Damage types
//#define DMG_NORMAL 0 (unneeded?)
#define DMG_WATER 1
#define DMG_FIRE 2
#define DMG_ELECTRIC 3
#define DMG_SPIKE 4
//#define DMG_SPECIALSTAGE 5
//// Death types - cannot be combined with damage types
#define DMG_INSTAKILL 0x80
#define DMG_DROWNED 0x80+1
#define DMG_SPACEDROWN 0x80+2
#define DMG_DEATHPIT 0x80+3
#define DMG_CRUSHED 0x80+4
#define DMG_SPECTATOR 0x80+5
#define DMG_DEATHMASK DMG_INSTAKILL // if bit 7 is set, this is a death type instead of a damage type
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period);
void P_ForceConstant(const BasicFF_t *FFInfo);
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End);
void P_RemoveShield(player_t *player);
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage);
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source);
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype);
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
void P_PlayerWeaponPanelBurst(player_t *player);
void P_PlayerWeaponAmmoBurst(player_t *player);

View file

@ -49,9 +49,6 @@ static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector
static mobj_t *tmhitthing; // the solid thing you bumped into (for collisions)
// turned on or off in PIT_CheckThing
boolean tmsprung;
// keep track of the line that lowers the ceiling,
// so missiles don't explode against sky hack walls
line_t *ceilingline;
@ -111,7 +108,9 @@ void P_DoSpring(mobj_t *spring, mobj_t *object)
fixed_t offx, offy;
fixed_t vertispeed = spring->info->mass;
fixed_t horizspeed = spring->info->damage;
fixed_t origvertispeed = vertispeed; // for vertical flipping
if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic
return;
// Spectators don't trigger springs.
if (object->player && object->player->spectator)
@ -122,7 +121,8 @@ void P_DoSpring(mobj_t *spring, mobj_t *object)
/*Someone want to make these work like bumpers?*/
return;
}
object->eflags |= MFE_SPRUNG; // apply this flag asap!
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify
if (horizspeed && vertispeed) // Mimic SA
@ -191,22 +191,22 @@ void P_DoSpring(mobj_t *spring, mobj_t *object)
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
P_ResetPlayer(object->player);
if (origvertispeed > 0)
P_SetPlayerMobjState(object, S_PLAY_SPRING);
else if (origvertispeed < 0)
P_SetPlayerMobjState(object, S_PLAY_FALL1);
if (P_MobjFlip(object)*vertispeed > 0)
P_SetPlayerMobjState(object, S_PLAY_JUMP);
else if (P_MobjFlip(object)*vertispeed < 0)
P_SetPlayerMobjState(object, S_PLAY_FALL);
else // horizontal spring
{
if (pflags & (PF_JUMPED|PF_SPINNING) && object->player->panim == PA_ROLL)
object->player->pflags = pflags;
else
P_SetPlayerMobjState(object, S_PLAY_RUN1);
P_SetPlayerMobjState(object, S_PLAY_WALK);
}
if (spring->info->painchance)
{
object->player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(object, S_PLAY_ATK1);
P_SetPlayerMobjState(object, S_PLAY_SPIN);
}
}
}
@ -255,7 +255,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
{
P_ResetPlayer(p);
if (p->panim != PA_FALL)
P_SetPlayerMobjState(object, S_PLAY_FALL1);
P_SetPlayerMobjState(object, S_PLAY_FALL);
}
break;
case MT_STEAM: // Steam
@ -270,7 +270,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
{
P_ResetPlayer(p);
if (p->panim != PA_FALL)
P_SetPlayerMobjState(object, S_PLAY_FALL1);
P_SetPlayerMobjState(object, S_PLAY_FALL);
}
break;
default:
@ -288,7 +288,7 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails)
if ((sonic->pflags & PF_CARRIED) && sonic->mo->tracer == tails->mo)
return;
if (!tails->powers[pw_tailsfly] && !(tails->charability == CA_FLY && (tails->mo->state >= &states[S_PLAY_SPC1] && tails->mo->state <= &states[S_PLAY_SPC4])))
if (!tails->powers[pw_tailsfly] && !(tails->charability == CA_FLY && tails->mo->state-states == S_PLAY_FLY_TIRED))
return;
if (tails->bot == 1)
@ -367,10 +367,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
fixed_t blockdist;
// don't clip against self
tmsprung = false;
if (thing == tmthing)
return true;
// Ignore... things.
if (!tmthing || !thing)
if (!tmthing || !thing || P_MobjWasRemoved(thing))
return true;
I_Assert(!P_MobjWasRemoved(tmthing));
@ -425,12 +426,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
S_StartSound(tmthing, thing->info->deathsound);
for (thing = thing->subsector->sector->thinglist; thing; thing = thing->snext)
if (thing->type == MT_SPIKE && thing->health > 0 && thing->flags & MF_SOLID && P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y) < FixedMul(56*FRACUNIT, thing->scale))
P_KillMobj(thing, tmthing, tmthing);
P_KillMobj(thing, tmthing, tmthing, 0);
}
else
{
thing->health = 0;
P_KillMobj(thing, tmthing, tmthing);
P_KillMobj(thing, tmthing, tmthing, 0);
}
return true;
}
@ -438,9 +439,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)))
return true;
if (!tmthing || !thing || thing == tmthing || P_MobjWasRemoved(thing))
return true;
// Don't collide with your buddies while NiGHTS-flying.
if (tmthing->player && thing->player && (maptol & TOL_NIGHTS)
&& ((tmthing->player->pflags & PF_NIGHTSMODE) || (thing->player->pflags & PF_NIGHTSMODE)))
@ -485,7 +483,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else
thing->z = tmthing->z + tmthing->height + FixedMul(FRACUNIT, tmthing->scale);
if (thing->flags & MF_SHOOTABLE)
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
return true;
}
@ -497,7 +495,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->z + thing->height < tmthing->z)
return true; // underneath
if (tmthing->player && tmthing->flags & MF_SHOOTABLE)
P_DamageMobj(tmthing, thing, thing, 1);
{
UINT8 damagetype = 0;
if (thing->flags & MF_FIRE) // BURN!
damagetype = DMG_FIRE;
P_DamageMobj(tmthing, thing, thing, 1, damagetype);
}
return true;
}
else if (tmthing->flags & MF_PAIN)
@ -508,7 +511,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (thing->player && thing->flags & MF_SHOOTABLE)
P_DamageMobj(thing, tmthing, tmthing, 1);
{
UINT8 damagetype = 0;
if (tmthing->flags & MF_FIRE) // BURN!
damagetype = DMG_FIRE;
P_DamageMobj(thing, tmthing, tmthing, 1, damagetype);
}
return true;
}
@ -549,7 +557,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
if ((tmznext <= thzh && tmz > thzh) || (tmznext > thzh - sprarea && tmznext < thzh))
{
P_DoSpring(thing, tmthing);
tmsprung = true;
return true;
}
else if (tmz > thzh - sprarea && tmz < thzh) // Don't damage people springing up / down
@ -630,7 +637,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return false;
else // hit shield from behind, shield is destroyed!
{
P_KillMobj(thing, tmthing, tmthing);
P_KillMobj(thing, tmthing, tmthing, 0);
return false;
}
}
@ -639,7 +646,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
&& (thing->player->pflags & PF_JUMPED)
&& !thing->player->powers[pw_flashing]
@ -675,7 +682,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetThingPosition(tmthing);
}
else
P_DamageMobj(thing, tmthing, tmthing->target, 1);
P_DamageMobj(thing, tmthing, tmthing->target, 1, 0);
// don't traverse any more
@ -789,11 +796,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
if (thing->z + thing->height <= tmthing->z + FixedMul(FRACUNIT, tmthing->scale)
&& thing->z + thing->height + thing->momz >= tmthing->z + FixedMul(FRACUNIT, tmthing->scale) + tmthing->momz)
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
}
else if (thing->z >= tmthing->z + tmthing->height - FixedMul(FRACUNIT, tmthing->scale)
&& thing->z + thing->momz <= tmthing->z + tmthing->height - FixedMul(FRACUNIT, tmthing->scale) + tmthing->momz)
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
}
else if (thing->type == MT_SPIKE && thing->flags & MF_SOLID && tmthing->player) // unfortunate player falls into spike?!
{
@ -801,11 +808,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
if (tmthing->z + tmthing->height <= thing->z - FixedMul(FRACUNIT, thing->scale)
&& tmthing->z + tmthing->height + tmthing->momz >= thing->z - FixedMul(FRACUNIT, thing->scale))
P_DamageMobj(tmthing, thing, thing, 1);
P_DamageMobj(tmthing, thing, thing, 1, 0);
}
else if (tmthing->z >= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)
&& tmthing->z + tmthing->momz <= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale))
P_DamageMobj(tmthing, thing, thing, 1);
P_DamageMobj(tmthing, thing, thing, 1, 0);
}
if (thing->flags & MF_PUSHABLE)
@ -818,15 +825,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
if (thing->type == MT_FAN || thing->type == MT_STEAM)
P_DoFanAndGasJet(thing, tmthing);
if ((!(thing->eflags & MFE_VERTICALFLIP) && (tmthing->z <= (thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)) && (tmthing->z + tmthing->height) >= thing->z))
|| ((thing->eflags & MFE_VERTICALFLIP) && (tmthing->z + tmthing->height >= (thing->z - FixedMul(FRACUNIT, thing->scale)) && tmthing->z <= (thing->z + thing->height))))
else if (thing->flags & MF_SPRING)
{
if (thing->flags & MF_SPRING)
{
if ( thing->z <= tmthing->z + tmthing->height
&& tmthing->z <= thing->z + thing->height)
P_DoSpring(thing, tmthing);
tmsprung = true;
}
}
}
@ -839,10 +842,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super])
&& !thing->player->powers[pw_super])
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super])
&& !tmthing->player->powers[pw_super])
P_DamageMobj(tmthing, thing, thing, 1);
P_DamageMobj(tmthing, thing, thing, 1, 0);
}
// If players are using touch tag, seekers damage hiders.
@ -850,9 +853,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
((thing->player->pflags & PF_TAGIT) != (tmthing->player->pflags & PF_TAGIT)))
{
if ((tmthing->player->pflags & PF_TAGIT) && !(thing->player->pflags & PF_TAGIT))
P_DamageMobj(thing, tmthing, tmthing, 1);
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
else if ((thing->player->pflags & PF_TAGIT) && !(tmthing->player->pflags & PF_TAGIT))
P_DamageMobj(tmthing, thing, tmthing, 1);
P_DamageMobj(tmthing, thing, tmthing, 1, 0);
}
}
@ -875,7 +878,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
// Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only
if (tmthing->eflags & MFE_VERTICALFLIP
&& (tmthing->z + tmthing->height + tmthing->momz > thing->z
&& (tmthing->z + tmthing->height + tmthing->momz < thing->z
|| tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height))
;
else if (!(tmthing->eflags & MFE_VERTICALFLIP)
@ -890,7 +893,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
// Objects kill you if it falls from above.
if (thing != tmthing->target)
P_DamageMobj(thing, tmthing, tmthing->target, 10000);
P_DamageMobj(thing, tmthing, tmthing->target, 1, DMG_INSTAKILL);
tmthing->momz = -tmthing->momz/2; // Bounce, just for fun!
// The tmthing->target allows the pusher of the object
@ -909,22 +912,22 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->type == MT_FAN || thing->type == MT_STEAM)
P_DoFanAndGasJet(thing, tmthing);
else if (thing->flags & MF_SPRING)
{
if ( thing->z <= tmthing->z + tmthing->height
&& tmthing->z <= thing->z + thing->height)
P_DoSpring(thing, tmthing);
}
// Are you touching the side of the object you're interacting with?
if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
&& thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z)
{
if (thing->flags & MF_SPRING)
{
P_DoSpring(thing, tmthing);
tmsprung = true;
}
else if (thing->flags & MF_MONITOR
if (thing->flags & MF_MONITOR
&& tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
{
SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed.
fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;;
P_DamageMobj(thing, tmthing, tmthing, 1); // break the monitor
P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor
// Going down? Then bounce back up.
if ((P_MobjWasRemoved(thing) // Monitor was removed
|| !thing->health) // or otherwise popped
@ -932,14 +935,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
return false;
}
/*
else if ((thing->flags & (MF_SOLID|MF_NOCLIP|MF_PUSHABLE)) == MF_SOLID)
return false; // this fixes both monitors and non-pushable solids being walked through on bobbing FOFs... for now!
*/
}
}
if (thing->flags & MF_SPRING && (tmthing->player || tmthing->flags & MF_PUSHABLE));
else
// Monitors are not treated as solid to players who are jumping, spinning or gliding,
// unless it's a CTF team monitor and you're on the wrong team
if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
@ -1303,10 +1304,12 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
// based on their origin point, and can overlap
// into adjacent blocks by up to MAXRADIUS units.
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
#ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
@ -1520,10 +1523,12 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
// based on their origin point, and can overlap
// into adjacent blocks by up to MAXRADIUS units.
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
#ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
@ -1766,7 +1771,6 @@ boolean PIT_PushableMoved(mobj_t *thing)
boolean oldfltok = floatok;
fixed_t oldflrz = tmfloorz;
fixed_t oldceilz = tmceilingz;
boolean oldsprung = tmsprung;
mobj_t *oldflrthing = tmfloorthing;
mobj_t *oldthing = tmthing;
line_t *oldceilline = ceilingline;
@ -1779,7 +1783,6 @@ boolean PIT_PushableMoved(mobj_t *thing)
floatok = oldfltok;
tmfloorz = oldflrz;
tmceilingz = oldceilz;
tmsprung = oldsprung;
tmfloorthing = oldflrthing;
P_SetTarget(&tmthing, oldthing);
ceilingline = oldceilline;
@ -1850,7 +1853,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
// Don't 'step up' while springing,
// Only step up "if needed".
if (thing->state == &states[S_PLAY_SPRING]
if (thing->state-states == S_PLAY_JUMP
&& P_MobjFlip(thing)*thing->momz > FixedMul(FRACUNIT, thing->scale))
maxstep = 0;
}
@ -1949,10 +1952,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
{
INT32 bx, by, xl, xh, yl, yh;
yh = (unsigned)(thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
yh = (thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
yl = (thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
xh = (thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
xl = (thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
stand = thing;
standx = x;
@ -3015,7 +3020,7 @@ static boolean PIT_RadiusAttack(mobj_t *thing)
if (P_CheckSight(thing, bombspot))
{ // must be in direct path
P_DamageMobj(thing, bombspot, bombsource, 1); // Tails 01-11-2001
P_DamageMobj(thing, bombspot, bombsource, 1, 0); // Tails 01-11-2001
}
return true;
@ -3032,10 +3037,12 @@ void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist)
fixed_t dist;
dist = FixedMul(damagedist, spot->scale) + MAXRADIUS;
yh = (unsigned)(spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT;
yh = (spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT;
yl = (spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT;
xh = (spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT;
xl = (spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
bombspot = spot;
bombsource = source;
@ -3148,22 +3155,15 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
{
// Crush the object
if (netgame && thing->player && thing->player->spectator)
P_DamageMobj(thing, NULL, NULL, 42000); // Respawn crushed spectators
P_DamageMobj(thing, NULL, NULL, 1, DMG_SPECTATOR); // Respawn crushed spectators
else
{
if (!killer)
{
//Nobody is responsible for crushing the object, so give a generic crush message
killer = P_SpawnMobj(thing->x, thing->y, thing->z, MT_NULL);
killer->threshold = 44; // Special flag for crushing
}
P_DamageMobj(thing, killer, killer, 10000);
}
P_DamageMobj(thing, killer, killer, 1, DMG_CRUSHED);
return true;
}
}
if (realcrush && crushchange)
P_DamageMobj(thing, NULL, NULL, 1);
P_DamageMobj(thing, NULL, NULL, 1, 0);
// keep checking (crush other things)
return true;
@ -3653,10 +3653,12 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y)
validcount++; // used to make sure we only process a line once
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++)
@ -3730,10 +3732,12 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing,fixed_t x,fixed_t y)
validcount++; // used to make sure we only process a line once
xl = (unsigned)(preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++)

View file

@ -17,6 +17,7 @@
#include "p_local.h"
#include "r_main.h"
#include "r_data.h"
#include "p_maputl.h"
#include "p_polyobj.h"
#include "z_zone.h"
@ -520,6 +521,51 @@ void P_LineOpening(line_t *linedef)
{
fixed_t thingtop = tmthing->z + tmthing->height;
// Check for collision with front side's midtexture if Effect 4 is set
if (linedef->flags & ML_EFFECT4) {
side_t *side = &sides[linedef->sidenum[0]];
fixed_t textop, texbottom, texheight;
fixed_t texmid, delta1, delta2;
// Get the midtexture's height
texheight = textures[texturetranslation[side->midtexture]]->height << FRACBITS;
// Set texbottom and textop to the Z coordinates of the texture's boundaries
#ifdef POLYOBJECTS
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
if (linedef->flags & ML_DONTPEGBOTTOM) {
texbottom = back->floorheight + side->rowoffset;
textop = texbottom + texheight*(side->repeatcnt+1);
} else {
textop = back->ceilingheight - side->rowoffset;
texbottom = textop - texheight*(side->repeatcnt+1);
}
} else
#endif
{
if (linedef->flags & ML_DONTPEGBOTTOM) {
texbottom = openbottom + side->rowoffset;
textop = texbottom + texheight*(side->repeatcnt+1);
} else {
textop = opentop - side->rowoffset;
texbottom = textop - texheight*(side->repeatcnt+1);
}
}
texmid = texbottom+(textop-texbottom)/2;
delta1 = abs(tmthing->z - texmid);
delta2 = abs(thingtop - texmid);
if (delta1 > delta2) { // Below
if (opentop > texbottom)
opentop = texbottom;
} else { // Above
if (openbottom < textop)
openbottom = textop;
}
}
// Check for fake floors in the sector.
if (front->ffloors || back->ffloors
#ifdef POLYOBJECTS
@ -768,8 +814,8 @@ void P_SetThingPosition(mobj_t *thing)
if (!(thing->flags & MF_NOBLOCKMAP))
{
// inert things don't need to be in blockmap
const INT32 blockx = (unsigned)(thing->x - bmaporgx)>>MAPBLOCKSHIFT;
const INT32 blocky = (unsigned)(thing->y - bmaporgy)>>MAPBLOCKSHIFT;
const INT32 blockx = (thing->x - bmaporgx)>>MAPBLOCKSHIFT;
const INT32 blocky = (thing->y - bmaporgy)>>MAPBLOCKSHIFT;
if (blockx >= 0 && blockx < bmapwidth
&& blocky >= 0 && blocky < bmapheight)
{
@ -1271,10 +1317,10 @@ boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
tmbbox[BOXLEFT] = x - radius;
// check lines
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++)

View file

@ -141,42 +141,22 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
switch (state)
{
case S_PLAY_STND:
case S_PLAY_TAP1:
case S_PLAY_TAP2:
case S_PLAY_WAIT:
case S_PLAY_GASP:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERSTAND);
P_SetPlayerMobjState(mobj, S_PLAY_SUPER_STND);
return true;
case S_PLAY_FALL1:
case S_PLAY_SPRING:
case S_PLAY_RUN1:
case S_PLAY_RUN2:
case S_PLAY_RUN3:
case S_PLAY_RUN4:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK1);
case S_PLAY_FALL:
case S_PLAY_JUMP:
case S_PLAY_WALK:
P_SetPlayerMobjState(mobj, S_PLAY_SUPER_WALK);
return true;
case S_PLAY_FALL2:
case S_PLAY_RUN5:
case S_PLAY_RUN6:
case S_PLAY_RUN7:
case S_PLAY_RUN8:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK2);
case S_PLAY_RUN:
P_SetPlayerMobjState(mobj, S_PLAY_SUPER_RUN);
return true;
case S_PLAY_SPD1:
case S_PLAY_SPD2:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY1);
case S_PLAY_EDGE:
P_SetPlayerMobjState(mobj, S_PLAY_SUPER_EDGE);
return true;
case S_PLAY_SPD3:
case S_PLAY_SPD4:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY2);
return true;
case S_PLAY_TEETER1:
case S_PLAY_TEETER2:
P_SetPlayerMobjState(mobj, S_PLAY_SUPERTEETER);
return true;
case S_PLAY_ATK1:
case S_PLAY_ATK2:
case S_PLAY_ATK3:
case S_PLAY_ATK4:
case S_PLAY_SPIN:
if (!(player->charflags & SF_SUPERSPIN))
return true;
break;
@ -194,23 +174,38 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
// Set animation state
// The pflags version of this was just as convoluted.
if ((state >= S_PLAY_STND && state <= S_PLAY_TAP2) || (state >= S_PLAY_TEETER1 && state <= S_PLAY_TEETER2) || state == S_PLAY_CARRY
|| state == S_PLAY_SUPERSTAND || state == S_PLAY_SUPERTEETER)
switch(state)
{
case S_PLAY_STND:
case S_PLAY_WAIT:
case S_PLAY_EDGE:
case S_PLAY_RIDE:
case S_PLAY_SUPER_STND:
case S_PLAY_SUPER_EDGE:
player->panim = PA_IDLE;
else if ((state >= S_PLAY_RUN1 && state <= S_PLAY_RUN8)
|| (state >= S_PLAY_SUPERWALK1 && state <= S_PLAY_SUPERWALK2))
break;
case S_PLAY_WALK:
case S_PLAY_SUPER_WALK:
player->panim = PA_WALK;
else if ((state >= S_PLAY_SPD1 && state <= S_PLAY_SPD4)
|| (state >= S_PLAY_SUPERFLY1 && state <= S_PLAY_SUPERFLY2))
break;
case S_PLAY_RUN:
case S_PLAY_SUPER_RUN:
player->panim = PA_RUN;
else if (state >= S_PLAY_ATK1 && state <= S_PLAY_ATK4)
break;
case S_PLAY_SPIN:
player->panim = PA_ROLL;
else if (state >= S_PLAY_FALL1 && state <= S_PLAY_FALL2)
break;
case S_PLAY_FALL:
player->panim = PA_FALL;
else if (state >= S_PLAY_ABL1 && state <= S_PLAY_ABL2)
break;
case S_PLAY_FLY:
case S_PLAY_GLIDE:
player->panim = PA_ABILITY;
else
break;
default:
player->panim = PA_ETC;
break;
}
if (recursion++) // if recursion detected,
memset(seenstate = tempstate, 0, sizeof tempstate); // clear state table
@ -274,8 +269,29 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
}
}
mobj->sprite = st->sprite;
mobj->frame = st->frame;
// Player animations
if (st->sprite == SPR_PLAY)
{
UINT8 spr2 = st->frame & FF_FRAMEMASK;
UINT16 frame = (mobj->frame & FF_FRAMEMASK)+1;
if (mobj->sprite != SPR_PLAY)
{
mobj->sprite = SPR_PLAY;
frame = 0;
}
else if (mobj->sprite2 != spr2)
frame = 0;
mobj->sprite2 = spr2;
if (!mobj->skin || frame >= ((skin_t *)mobj->skin)->sprites[spr2].numframes)
frame = 0;
mobj->frame = frame|(st->frame&~FF_FRAMEMASK);
}
// Regular sprites
else
{
mobj->sprite = st->sprite;
mobj->frame = st->frame;
}
// Modified handling.
// Call action functions when the state is set
@ -341,8 +357,30 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
st = &states[state];
mobj->state = st;
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame;
// Player animations
if (st->sprite == SPR_PLAY)
{
UINT8 spr2 = st->frame & FF_FRAMEMASK;
UINT16 frame = (mobj->frame & FF_FRAMEMASK)+1;
if (mobj->sprite != SPR_PLAY)
{
mobj->sprite = SPR_PLAY;
frame = 0;
}
else if (mobj->sprite2 != spr2)
frame = 0;
mobj->sprite2 = spr2;
if (!mobj->skin || frame >= ((skin_t *)mobj->skin)->sprites[spr2].numframes)
frame = 0;
mobj->frame = frame|(st->frame&~FF_FRAMEMASK);
}
// Regular sprites
else
{
mobj->sprite = st->sprite;
mobj->frame = st->frame;
}
// Modified handling.
// Call action functions when the state is set
@ -674,7 +712,7 @@ void P_ExplodeMissile(mobj_t *mo)
S_StartSound(explodemo, sfx_cybdth);
// Hack: Release an animal.
P_DamageMobj(mo, NULL, NULL, 10000);
P_DamageMobj(mo, NULL, NULL, 1, DMG_INSTAKILL);
}
mo->flags &= ~MF_MISSILE;
@ -820,7 +858,7 @@ void P_CheckGravity(mobj_t *mo, boolean affect)
if (mo->player)
{
if (mo->player->charability == CA_FLY && (mo->player->powers[pw_tailsfly]
|| (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4])))
|| mo->state-states == S_PLAY_FLY_TIRED))
gravityadd = gravityadd/3; // less gravity while flying
if (mo->player->pflags & PF_GLIDING)
gravityadd = gravityadd/3; // less gravity while gliding
@ -1154,7 +1192,7 @@ void P_XYMovement(mobj_t *mo)
if (CheckForBustableBlocks && mo->flags & MF_PUSHABLE)
P_PushableCheckBustables(mo);
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !tmsprung)
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG))
{
// blocked move
@ -1706,7 +1744,7 @@ static boolean P_ZMovement(mobj_t *mo)
// Kill enemies and bosses that fall into death pits.
if (mo->health)
{
P_KillMobj(mo, NULL, NULL);
P_KillMobj(mo, NULL, NULL, 0);
return false;
}
}
@ -2018,7 +2056,7 @@ static void P_PlayerZMovement(mobj_t *mo)
goto nightsdone;
}
// Get up if you fell.
if (mo->state == &states[mo->info->painstate] || mo->state == &states[S_PLAY_SUPERHIT])
if (mo->state == &states[mo->info->painstate] || mo->state-states == S_PLAY_SUPER_PAIN)
P_SetPlayerMobjState(mo, S_PLAY_STND);
if (P_MobjFlip(mo)*mo->momz < 0) // falling
@ -2115,23 +2153,23 @@ static void P_PlayerZMovement(mobj_t *mo)
mo->tics = -1;
}
else if (mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN)
|| mo->player->powers[pw_tailsfly] || (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4]))
|| mo->player->powers[pw_tailsfly] || mo->state-states == S_PLAY_FLY_TIRED)
{
if (mo->player->cmomx || mo->player->cmomy)
{
if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) && mo->player->panim != PA_RUN)
P_SetPlayerMobjState(mo, S_PLAY_SPD1);
P_SetPlayerMobjState(mo, S_PLAY_RUN);
else if ((mo->player->rmomx || mo->player->rmomy) && mo->player->panim != PA_WALK)
P_SetPlayerMobjState(mo, S_PLAY_RUN1);
P_SetPlayerMobjState(mo, S_PLAY_WALK);
else if (!mo->player->rmomx && !mo->player->rmomy && mo->player->panim != PA_IDLE)
P_SetPlayerMobjState(mo, S_PLAY_STND);
}
else
{
if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) && mo->player->panim != PA_RUN)
P_SetPlayerMobjState(mo, S_PLAY_SPD1);
P_SetPlayerMobjState(mo, S_PLAY_RUN);
else if ((mo->momx || mo->momy) && mo->player->panim != PA_WALK)
P_SetPlayerMobjState(mo, S_PLAY_RUN1);
P_SetPlayerMobjState(mo, S_PLAY_WALK);
else if (!mo->momx && !mo->momy && mo->player->panim != PA_IDLE)
P_SetPlayerMobjState(mo, S_PLAY_STND);
}
@ -2761,7 +2799,7 @@ void P_DestroyRobots(void)
continue;
// Found a target enemy
P_KillMobj(mo, players[consoleplayer].mo, players[consoleplayer].mo);
P_KillMobj(mo, players[consoleplayer].mo, players[consoleplayer].mo, 0);
}
}
@ -3025,7 +3063,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
{
mobj->player->secondjump = 0;
mobj->player->powers[pw_tailsfly] = 0;
P_SetPlayerMobjState(mobj, S_PLAY_RUN1);
P_SetPlayerMobjState(mobj, S_PLAY_WALK);
}
mobj->eflags &= ~MFE_JUSTHITFLOOR;
}
@ -3439,7 +3477,7 @@ static void P_Boss3Thinker(mobj_t *mobj)
continue;
if (players[i].mo->eflags & MFE_UNDERWATER)
P_DamageMobj(players[i].mo, mobj, mobj, 1);
P_DamageMobj(players[i].mo, mobj, mobj, 1, 0);
}
// Make the water flash
@ -3780,7 +3818,7 @@ static void P_Boss4PopSpikeballs(mobj_t *mobj)
P_SetTarget(&base->tracer, NULL);
for (seg = base; seg; seg = seg->hnext)
if (seg->health)
P_KillMobj(seg, NULL, NULL);
P_KillMobj(seg, NULL, NULL, 0);
base = next;
}
}
@ -4080,7 +4118,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
{
INT32 i;
P_KillMobj(mobj, NULL, NULL);
P_KillMobj(mobj, NULL, NULL, 0);
// It was a team effort
for (i = 0; i < MAXPLAYERS; i++)
@ -4131,7 +4169,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
&& players[i].mo->z < mobj->z + mobj->height + 128*FRACUNIT) // You can't be in the vicinity, either...
{
// Punch him!
P_DamageMobj(players[i].mo, mobj, mobj, 1);
P_DamageMobj(players[i].mo, mobj, mobj, 1, 0);
mobj->state->nextstate = mobj->info->spawnstate;
// Laugh
@ -4354,7 +4392,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
if (players[i].mo->z < mobj->z - 64*FRACUNIT)
continue;
P_DamageMobj(players[i].mo, mobj, mobj, 1);
P_DamageMobj(players[i].mo, mobj, mobj, 1, 0);
// Laugh
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
@ -5444,7 +5482,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->tracer && P_MobjWasRemoved(mobj->tracer))
P_SetTarget(&mobj->tracer, NULL);
mobj->flags2 &= ~MF2_PUSHED;
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG);
// 970 allows ANY mobj to trigger a linedef exec
if (mobj->subsector && GETSECSPECIAL(mobj->subsector->sector->special, 2) == 8)
@ -5776,7 +5814,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA && mobj->type != MT_FIREBALL
&& (mobj->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)))
{
P_KillMobj(mobj, NULL, NULL);
P_KillMobj(mobj, NULL, NULL, 0);
return;
}
}
@ -6408,7 +6446,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA && mobj->type != MT_FIREBALL
&& (mobj->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)))
{
P_KillMobj(mobj, NULL, NULL);
P_KillMobj(mobj, NULL, NULL, 0);
return;
}
break;
@ -6646,7 +6684,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
{
P_KillMobj(mobj, NULL, NULL);
P_KillMobj(mobj, NULL, NULL, DMG_DEATHPIT);
return;
}
@ -6660,7 +6698,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
&& !(mobj->flags & MF_NOCLIPHEIGHT)
&& mobj->health > 0)
{
P_KillMobj(mobj, NULL, NULL);
P_KillMobj(mobj, NULL, NULL, DMG_CRUSHED);
return;
}
}

View file

@ -175,24 +175,23 @@ typedef enum
MF2_EXPLOSION = 1<<7, // Thrown ring has explosive properties
MF2_SCATTER = 1<<8, // Thrown ring has scatter properties
MF2_BEYONDTHEGRAVE = 1<<9, // Source of this missile has died and has since respawned.
MF2_PUSHED = 1<<10, // Mobj was already pushed this tic
MF2_SLIDEPUSH = 1<<11, // MF_PUSHABLE that pushes continuously.
MF2_CLASSICPUSH = 1<<12, // Drops straight down when object has negative Z.
MF2_STANDONME = 1<<13, // While not pushable, stand on me anyway.
MF2_INFLOAT = 1<<14, // Floating to a height for a move, don't auto float to target's height.
MF2_DEBRIS = 1<<15, // Splash ring from explosion ring
MF2_NIGHTSPULL = 1<<16, // Attracted from a paraloop
MF2_JUSTATTACKED = 1<<17, // can be pushed by other moving mobjs
MF2_FIRING = 1<<18, // turret fire
MF2_SUPERFIRE = 1<<19, // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it.
MF2_SHADOW = 1<<20, // Fuzzy draw, makes targeting harder.
MF2_STRONGBOX = 1<<21, // Flag used for "strong" random monitors.
MF2_OBJECTFLIP = 1<<22, // Flag for objects that always have flipped gravity.
MF2_SKULLFLY = 1<<23, // Special handling: skull in flight.
MF2_FRET = 1<<24, // Flashing from a previous hit
MF2_BOSSNOTRAP = 1<<25, // No Egg Trap after boss
MF2_BOSSFLEE = 1<<26, // Boss is fleeing!
MF2_BOSSDEAD = 1<<27, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
MF2_SLIDEPUSH = 1<<10, // MF_PUSHABLE that pushes continuously.
MF2_CLASSICPUSH = 1<<11, // Drops straight down when object has negative Z.
MF2_STANDONME = 1<<12, // While not pushable, stand on me anyway.
MF2_INFLOAT = 1<<13, // Floating to a height for a move, don't auto float to target's height.
MF2_DEBRIS = 1<<14, // Splash ring from explosion ring
MF2_NIGHTSPULL = 1<<15, // Attracted from a paraloop
MF2_JUSTATTACKED = 1<<16, // can be pushed by other moving mobjs
MF2_FIRING = 1<<17, // turret fire
MF2_SUPERFIRE = 1<<18, // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it.
MF2_SHADOW = 1<<19, // Fuzzy draw, makes targeting harder.
MF2_STRONGBOX = 1<<20, // Flag used for "strong" random monitors.
MF2_OBJECTFLIP = 1<<21, // Flag for objects that always have flipped gravity.
MF2_SKULLFLY = 1<<22, // Special handling: skull in flight.
MF2_FRET = 1<<23, // Flashing from a previous hit
MF2_BOSSNOTRAP = 1<<24, // No Egg Trap after boss
MF2_BOSSFLEE = 1<<25, // Boss is fleeing!
MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
// free: to and including 1<<31
} mobjflag2_t;
@ -232,8 +231,13 @@ typedef enum
MFE_VERTICALFLIP = 1<<5,
// Goo water
MFE_GOOWATER = 1<<6,
// Mobj was already pushed this tic
MFE_PUSHED = 1<<7,
// Mobj was already sprung this tic
MFE_SPRUNG = 1<<8,
// Platform movement
MFE_APPLYPMOMZ = 1<<7
MFE_APPLYPMOMZ = 1<<9,
// free: to and including 1<<15
} mobjeflag_t;
//
@ -266,6 +270,7 @@ typedef struct mobj_s
angle_t angle; // orientation
spritenum_t sprite; // used to find patch_t and flip value
UINT32 frame; // frame number, plus bits see p_pspr.h
UINT8 sprite2; // player sprites
struct msecnode_s *touching_sectorlist; // a linked list of sectors where this object appears
@ -287,7 +292,7 @@ typedef struct mobj_s
state_t *state;
UINT32 flags; // flags from mobjinfo tables
UINT32 flags2; // MF2_ flags
UINT8 eflags; // extra flags
UINT16 eflags; // extra flags
void *skin; // overrides 'sprite' when non-NULL (for player bodies to 'remember' the skin)
// Player and mobj sprites in multiplayer modes are modified

View file

@ -239,24 +239,39 @@ boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox)
//
// Polyobj_GetInfo
//
// Finds the 'polyobject settings' linedef that shares the same tag
// as the polyobj linedef to get the settings for it.
// Finds the 'polyobject settings' linedef for a polyobject
// the polyobject's id should be set as its tag
//
void Polyobj_GetInfo(INT16 tag, INT32 *polyID, INT32 *mirrorID, UINT16 *exparg)
void Polyobj_GetInfo(INT16 poid, INT32 *poflags, INT32 *parentID, INT32 *potrans)
{
INT32 i = P_FindSpecialLineFromTag(POLYINFO_SPECIALNUM, tag, -1);
INT32 i = P_FindSpecialLineFromTag(POLYINFO_SPECIALNUM, poid, -1);
if (i == -1)
I_Error("Polyobject (tag: %d) needs line %d for information.\n", tag, POLYINFO_SPECIALNUM);
return; // no extra settings to apply, let's leave it
if (polyID)
*polyID = lines[i].frontsector->floorheight>>FRACBITS;
if (parentID)
*parentID = lines[i].frontsector->special;
if (mirrorID)
*mirrorID = lines[i].frontsector->special;
if (potrans)
*potrans = (lines[i].frontsector->floorheight>>FRACBITS) / 100;
if (exparg)
*exparg = (UINT16)lines[i].frontsector->lightlevel;
if (lines[i].flags & ML_EFFECT1)
*poflags |= POF_ONESIDE;
if (lines[i].flags & ML_EFFECT2)
*poflags &= ~POF_SOLID;
if (lines[i].flags & ML_EFFECT3)
*poflags |= POF_PUSHABLESTOP;
if (lines[i].flags & ML_EFFECT4)
*poflags |= POF_RENDERPLANES;
/*if (lines[i].flags & ML_EFFECT5)
*poflags &= ~POF_CLIPPLANES;*/
if (lines[i].flags & ML_NOCLIMB) // Has a linedef executor
*poflags |= POF_LDEXEC;
}
// Reallocating array maintenance
@ -478,6 +493,7 @@ newseg:
CONS_Debug(DBG_POLYOBJ, "Polyobject %d is not closed\n", po->id);
}
/*
// structure used to store segs during explicit search process
typedef struct segitem_s
{
@ -553,7 +569,7 @@ static void Polyobj_findExplicit(polyobj_t *po)
// free the temporary array
Z_Free(segitems);
}
}*/
// Setup functions
@ -591,47 +607,27 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
for (i = 0; i < numsegs; ++i)
{
seg_t *seg = &segs[i];
INT32 polyID, parentID;
INT32 poflags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES;
INT32 parentID = 0, potrans = 0;
if (seg->linedef->special != POLYOBJ_START_LINE)
continue;
if (seg->linedef->tag != po->id)
continue;
Polyobj_GetInfo(seg->linedef->tag, &polyID, &parentID, NULL);
Polyobj_GetInfo(po->id, &poflags, &parentID, &potrans); // apply extra settings if they exist!
// save original flags and translucency to reference later for netgames!
po->spawnflags = po->flags = poflags;
po->spawntrans = po->translucency = potrans;
// is it a START line with this polyobject's id?
if (polyID == po->id)
{
po->flags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES;
if (seg->linedef->flags & ML_EFFECT1)
po->flags |= POF_ONESIDE;
if (seg->linedef->flags & ML_EFFECT2)
po->flags &= ~POF_SOLID;
if (seg->linedef->flags & ML_EFFECT3)
po->flags |= POF_PUSHABLESTOP;
if (seg->linedef->flags & ML_EFFECT4)
po->flags |= POF_RENDERPLANES;
// TODO: Use a different linedef flag for this if we really need it!!
// This clashes with texture tiling, also done by Effect 5 flag
/*if (seg->linedef->flags & ML_EFFECT5)
po->flags &= ~POF_CLIPPLANES;*/
if (seg->linedef->flags & ML_NOCLIMB) // Has a linedef executor
po->flags |= POF_LDEXEC;
po->spawnflags = po->flags; // save original flags to reference later for netgames!
Polyobj_findSegs(po, seg);
po->parent = parentID;
if (po->parent == po->id) // do not allow a self-reference
po->parent = -1;
// TODO: sound sequence is in args[2]
break;
}
Polyobj_findSegs(po, seg);
po->parent = parentID;
if (po->parent == po->id) // do not allow a self-reference
po->parent = -1;
// TODO: sound sequence is in args[2]
break;
}
CONS_Debug(DBG_POLYOBJ, "PO ID: %d; Num verts: %s\n", po->id, sizeu1(po->numVertices));
@ -640,6 +636,7 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
if (po->isBad)
return;
/*
// 2. If no such line existed in the first step, look for a seg with the
// "explicit" special with tag matching this polyobject's id number. If
// found, continue to search for all such lines, storing them in a
@ -658,7 +655,7 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
if (po->parent == po->id) // do not allow a self-reference
po->parent = -1;
// TODO: sound sequence is in args[3]
}
}*/
// set the polyobject's spawn spot
@ -851,10 +848,10 @@ static void Polyobj_linkToBlockmap(polyobj_t *po)
M_AddToBox(blockbox, po->vertices[i]->x, po->vertices[i]->y);
// adjust bounding box relative to blockmap
blockbox[BOXRIGHT] = (unsigned)(blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXLEFT] = (unsigned)(blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXTOP] = (unsigned)(blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT;
blockbox[BOXBOTTOM] = (unsigned)(blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT;
blockbox[BOXRIGHT] = (blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXLEFT] = (blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXTOP] = (blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT;
blockbox[BOXBOTTOM] = (blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT;
// link polyobject to every block its bounding box intersects
for (y = blockbox[BOXBOTTOM]; y <= blockbox[BOXTOP]; ++y)
@ -1043,9 +1040,10 @@ static void Polyobj_carryThings(polyobj_t *po, fixed_t dx, fixed_t dy)
mo->lastlook = pomovecount;
// always push players even if not solid
if (!((mo->flags & MF_SOLID) || mo->player))
// Don't scroll objects that aren't affected by gravity
if (mo->flags & MF_NOGRAVITY)
continue;
// (The above check used to only move MF_SOLID objects, but that's inconsistent with conveyor behavior. -Red)
if (mo->flags & MF_NOCLIP)
continue;
@ -1081,10 +1079,10 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
return hitflags;
// adjust linedef bounding box to blockmap, extend by MAXRADIUS
linebox[BOXLEFT] = (unsigned)(line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXRIGHT] = (unsigned)(line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXBOTTOM] = (unsigned)(line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXTOP] = (unsigned)(line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXLEFT] = (line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXRIGHT] = (line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXBOTTOM] = (line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXTOP] = (line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT;
// check all mobj blockmap cells the line contacts
for (y = linebox[BOXBOTTOM]; y <= linebox[BOXTOP]; ++y)
@ -1097,9 +1095,11 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
for (; mo; mo = mo->bnext)
{
// always push players even if not solid
if (!((mo->flags & MF_SOLID) || mo->player))
// Don't scroll objects that aren't affected by gravity
if (mo->flags & MF_NOGRAVITY)
continue;
// (The above check used to only move MF_SOLID objects, but that's inconsistent with conveyor behavior. -Red)
if (mo->flags & MF_NOCLIP)
continue;
@ -1259,6 +1259,7 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
{
static INT32 pomovecount = 10000;
INT32 x, y;
angle_t deltafine = delta >> ANGLETOFINESHIFT;
pomovecount++;
@ -1283,9 +1284,10 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
mo->lastlook = pomovecount;
// always push players even if not solid
if (!((mo->flags & MF_SOLID) || mo->player))
// Don't scroll objects that aren't affected by gravity
if (mo->flags & MF_NOGRAVITY)
continue;
// (The above check used to only move MF_SOLID objects, but that's inconsistent with conveyor behavior. -Red)
if (mo->flags & MF_NOCLIP)
continue;
@ -1300,21 +1302,28 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
continue;
{
fixed_t newxoff, newyoff;
angle_t angletoobj = R_PointToAngle2(origin.x, origin.y, mo->x, mo->y);
fixed_t disttoobj = R_PointToDist2(origin.x, origin.y, mo->x, mo->y);
fixed_t oldxoff, oldyoff, newxoff, newyoff;
fixed_t c, s;
c = FINECOSINE(deltafine);
s = FINESINE(deltafine);
oldxoff = mo->x-origin.x;
oldyoff = mo->y-origin.y;
if (mo->player) // Hack to fix players sliding off of spinning polys -Red
{
disttoobj = FixedMul(disttoobj, 0xfe40);
fixed_t temp;
temp = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
oldyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
oldxoff = temp;
}
angletoobj += delta;
angletoobj >>= ANGLETOFINESHIFT;
newxoff = FixedMul(FINECOSINE(angletoobj), disttoobj);
newyoff = FixedMul(FINESINE(angletoobj), disttoobj);
newxoff = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
newyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
Polyobj_slideThing(mo, origin.x+newxoff-mo->x, origin.y+newyoff-mo->y);
Polyobj_slideThing(mo, newxoff-oldxoff, newyoff-oldyoff);
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
mo->angle += delta;
@ -2491,6 +2500,10 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
return 0;
}
// Hotfix to not crash on single-waypoint sequences -Red
if (!last)
last = first;
// Set diffx, diffy, diffz
// Put these at 0 for now...might not be needed after all.
th->diffx = 0;//first->x - po->centerPt.x;

View file

@ -28,7 +28,7 @@
#define POLYOBJ_ANCHOR_DOOMEDNUM 760
#define POLYOBJ_SPAWN_DOOMEDNUM 761
#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762
#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762 // todo: REMOVE
#define POLYOBJ_START_LINE 20
#define POLYOBJ_EXPLICIT_LINE 21
@ -100,8 +100,11 @@ typedef struct polyobj_s
UINT8 isBad; // a bad polyobject: should not be rendered/manipulated
INT32 translucency; // index to translucency tables
struct visplane_s *visplane; // polyobject's visplane, for ease of putting into the list later
// these are saved for netgames, so do not let Lua touch these!
INT32 spawnflags; // Flags the polyobject originally spawned with
INT32 spawntrans; // Translucency the polyobject originally spawned with
} polyobj_t;
//
@ -274,7 +277,7 @@ boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y);
boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo);
boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo);
boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox);
void Polyobj_GetInfo(INT16 tag, INT32 *polyID, INT32 *parentID, UINT16 *exparg);
void Polyobj_GetInfo(INT16 poid, INT32 *poflags, INT32 *parentID, INT32 *potrans);
// thinkers (needed in p_saveg.c)
void T_PolyObjRotate(polyrotate_t *);

View file

@ -1052,6 +1052,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
diff |= MD_TICS;
if (mobj->sprite != mobj->state->sprite)
diff |= MD_SPRITE;
if (mobj->sprite == SPR_PLAY && mobj->sprite2 != 0)
diff |= MD_SPRITE;
if (mobj->frame != mobj->state->frame)
diff |= MD_FRAME;
if (mobj->eflags)
@ -1169,12 +1171,15 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
WRITEUINT16(save_p, mobj->state-states);
if (diff & MD_TICS)
WRITEINT32(save_p, mobj->tics);
if (diff & MD_SPRITE)
if (diff & MD_SPRITE) {
WRITEUINT16(save_p, mobj->sprite);
if (mobj->sprite == SPR_PLAY)
WRITEUINT8(save_p, mobj->sprite2);
}
if (diff & MD_FRAME)
WRITEUINT32(save_p, mobj->frame);
if (diff & MD_EFLAGS)
WRITEUINT8(save_p, mobj->eflags);
WRITEUINT16(save_p, mobj->eflags);
if (diff & MD_PLAYER)
WRITEUINT8(save_p, mobj->player-players);
if (diff & MD_MOVEDIR)
@ -1991,16 +1996,22 @@ static void LoadMobjThinker(actionf_p1 thinker)
mobj->tics = READINT32(save_p);
else
mobj->tics = mobj->state->tics;
if (diff & MD_SPRITE)
if (diff & MD_SPRITE) {
mobj->sprite = READUINT16(save_p);
else
if (mobj->sprite == SPR_PLAY)
mobj->sprite2 = READUINT8(save_p);
}
else {
mobj->sprite = mobj->state->sprite;
if (mobj->sprite == SPR_PLAY)
mobj->sprite2 = mobj->state->frame&FF_FRAMEMASK;
}
if (diff & MD_FRAME)
mobj->frame = READUINT32(save_p);
else
mobj->frame = mobj->state->frame;
if (diff & MD_EFLAGS)
mobj->eflags = READUINT8(save_p);
mobj->eflags = READUINT16(save_p);
if (diff & MD_PLAYER)
{
i = READUINT8(save_p);
@ -2789,7 +2800,7 @@ static inline void P_ArchivePolyObj(polyobj_t *po)
if (po->flags != po->spawnflags)
diff |= PD_FLAGS;
if (po->translucency != 0)
if (po->translucency != po->spawntrans)
diff |= PD_TRANS;
WRITEUINT8(save_p, diff);

View file

@ -1890,6 +1890,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|| specialtype == 304 // Ring count - Once
|| specialtype == 307 // Character ability - Once
|| specialtype == 308 // Race only - Once
|| specialtype == 313 // No More Enemies - Once
|| specialtype == 315 // No of pushables - Once
|| specialtype == 318 // Unlockable trigger - Once
|| specialtype == 320 // Unlockable - Once
@ -3471,19 +3472,19 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
{
case 1: // Damage (Generic)
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
P_DamageMobj(player->mo, NULL, NULL, 1);
P_DamageMobj(player->mo, NULL, NULL, 1, 0);
break;
case 2: // Damage (Water)
if ((roversector || P_MobjReadyToTrigger(player->mo, sector)) && (player->powers[pw_underwater] || player->pflags & PF_NIGHTSMODE) && (player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL)
P_DamageMobj(player->mo, NULL, NULL, 1);
if ((roversector || P_MobjReadyToTrigger(player->mo, sector)) && (player->powers[pw_underwater] || player->pflags & PF_NIGHTSMODE))
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_WATER);
break;
case 3: // Damage (Fire)
if ((roversector || P_MobjReadyToTrigger(player->mo, sector)) && (player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL)
P_DamageMobj(player->mo, NULL, NULL, 1);
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_FIRE);
break;
case 4: // Damage (Electrical)
if ((roversector || P_MobjReadyToTrigger(player->mo, sector)) && (player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT)
P_DamageMobj(player->mo, NULL, NULL, 1);
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_ELECTRIC);
break;
case 5: // Spikes
// Don't do anything. In Soviet Russia, spikes find you.
@ -3491,10 +3492,10 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
case 6: // Death Pit (Camera Mod)
case 7: // Death Pit (No Camera Mod)
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_DEATHPIT);
break;
case 8: // Instant Kill
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
break;
case 9: // Ring Drainer (Floor Touch)
case 10: // Ring Drainer (No Floor Touch)
@ -3598,7 +3599,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
mo2 = (mobj_t *)th;
if (mo2->type == MT_EGGTRAP)
P_KillMobj(mo2, NULL, player->mo);
P_KillMobj(mo2, NULL, player->mo, 0);
}
// clear the special so you can't push the button twice.
@ -3684,7 +3685,7 @@ DoneSection2:
if (!(player->pflags & PF_SPINNING))
player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
player->powers[pw_flashing] = TICRATE/3;
@ -3826,7 +3827,7 @@ DoneSection2:
P_ResetPlayer(player);
if (player->panim != PA_FALL)
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
break;
case 6: // Super Sonic transformer
@ -3838,7 +3839,7 @@ DoneSection2:
if (!(player->pflags & PF_SPINNING) && P_IsObjectOnGround(player->mo) && (player->charability2 == CA2_SPINDASH))
{
player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
S_StartAttackSound(player->mo, sfx_spin);
if (abs(player->rmomx) < FixedMul(5*FRACUNIT, player->mo->scale)
@ -3912,9 +3913,9 @@ DoneSection2:
player->pflags &= ~PF_GLIDING;
player->climbing = 0;
if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4]))
if (player->mo->state-states != S_PLAY_SPIN)
{
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
S_StartSound(player->mo, sfx_spin);
}
}
@ -3984,9 +3985,9 @@ DoneSection2:
player->pflags |= PF_SPINNING;
player->pflags &= ~PF_JUMPED;
if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4]))
if (player->mo->state-states != S_PLAY_SPIN)
{
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
S_StartSound(player->mo, sfx_spin);
}
}
@ -4289,7 +4290,7 @@ DoneSection2:
player->pflags &= ~PF_SLIDING;
player->climbing = 0;
P_SetThingPosition(player->mo);
P_SetPlayerMobjState(player->mo, S_PLAY_CARRY);
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
}
break;
case 12: // Camera noclip
@ -5354,9 +5355,9 @@ void T_LaserFlash(laserthink_t *flash)
continue;
if (thing->flags & MF_SHOOTABLE)
P_DamageMobj(thing, NULL, NULL, 1);
P_DamageMobj(thing, NULL, NULL, 1, 0);
else if (thing->type == MT_EGGSHIELD)
P_KillMobj(thing, NULL, NULL);
P_KillMobj(thing, NULL, NULL, 0);
}
}
@ -6526,7 +6527,7 @@ static void P_DoScrollMove(mobj_t *thing, fixed_t dx, fixed_t dy, INT32 exclusiv
thing->momy += dy;
if (exclusive)
thing->flags2 |= MF2_PUSHED;
thing->eflags |= MFE_PUSHED;
}
/** Processes an active scroller.
@ -6630,7 +6631,7 @@ void T_Scroll(scroll_t *s)
{
thing = node->m_thing;
if (thing->flags2 & MF2_PUSHED) // Already pushed this tic by an exclusive pusher.
if (thing->eflags & MFE_PUSHED) // Already pushed this tic by an exclusive pusher.
continue;
if (!(thing->flags & MF_NOCLIP)) // Thing must be clipped
@ -6650,7 +6651,7 @@ void T_Scroll(scroll_t *s)
{
thing = node->m_thing;
if (thing->flags2 & MF2_PUSHED)
if (thing->eflags & MFE_PUSHED)
continue;
if (!(thing->flags & MF_NOCLIP) &&
@ -6689,7 +6690,7 @@ void T_Scroll(scroll_t *s)
{
thing = node->m_thing;
if (thing->flags2 & MF2_PUSHED)
if (thing->eflags & MFE_PUSHED)
continue;
if (!(thing->flags & MF_NOCLIP)) // Thing must be clipped
@ -6709,7 +6710,7 @@ void T_Scroll(scroll_t *s)
{
thing = node->m_thing;
if (thing->flags2 & MF2_PUSHED)
if (thing->eflags & MFE_PUSHED)
continue;
if (!(thing->flags & MF_NOCLIP) &&
@ -7192,7 +7193,7 @@ static pusher_t *tmpusher; // pusher structure for blockmap searches
*/
static inline boolean PIT_PushThing(mobj_t *thing)
{
if (thing->flags2 & MF2_PUSHED)
if (thing->eflags & MFE_PUSHED)
return false;
if (thing->player && thing->player->pflags & PF_ROPEHANG)
@ -7322,7 +7323,7 @@ static inline boolean PIT_PushThing(mobj_t *thing)
}
if (tmpusher->exclusive)
thing->flags2 |= MF2_PUSHED;
thing->eflags |= MFE_PUSHED;
return true;
}
@ -7400,10 +7401,10 @@ void T_Pusher(pusher_t *p)
tmbbox[BOXRIGHT] = p->x + radius;
tmbbox[BOXLEFT] = p->x - radius;
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++)
P_BlockThingsIterator(bx,by, PIT_PushThing);
@ -7429,7 +7430,7 @@ void T_Pusher(pusher_t *p)
|| thing->type == MT_BIGTUMBLEWEED))
continue;
if (thing->flags2 & MF2_PUSHED)
if (thing->eflags & MFE_PUSHED)
continue;
if (thing->player && thing->player->pflags & PF_ROPEHANG)
@ -7599,7 +7600,7 @@ void T_Pusher(pusher_t *p)
}
if (p->exclusive)
thing->flags2 |= MF2_PUSHED;
thing->eflags |= MFE_PUSHED;
}
}
}

View file

@ -662,7 +662,7 @@ void P_Ticker(boolean run)
if (!players[i].mo)
continue;
P_DamageMobj(players[i].mo, NULL, NULL, 10000);
P_DamageMobj(players[i].mo, NULL, NULL, 1, DMG_INSTAKILL);
}
}

View file

@ -607,7 +607,7 @@ static void P_DeNightserizePlayer(player_t *player)
if (player->mo->tracer)
P_RemoveMobj(player->mo->tracer);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
player->pflags |= PF_NIGHTSFALL;
// If in a special stage, add some preliminary exit time.
@ -632,7 +632,7 @@ static void P_DeNightserizePlayer(player_t *player)
continue;
if (mo2->flags & MF_AMBUSH)
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
break;
}
@ -970,7 +970,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings)
S_StartSound(NULL, sfx_supert); //let all players hear it -mattw_cfi
// Transformation animation
P_SetPlayerMobjState(player->mo, S_PLAY_SUPERTRANS1);
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_TRANS);
player->mo->momx = player->mo->momy = player->mo->momz = 0;
@ -1444,6 +1444,7 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
ghost->angle = mobj->angle;
ghost->sprite = mobj->sprite;
ghost->sprite2 = mobj->sprite2;
ghost->frame = mobj->frame;
ghost->tics = -1;
ghost->frame &= ~FF_TRANSMASK;
@ -1596,7 +1597,7 @@ void P_DoPlayerExit(player_t *player)
{
player->climbing = 0;
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
player->powers[pw_underwater] = 0;
player->powers[pw_spacetime] = 0;
@ -1997,21 +1998,15 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player)
// Underwater timer runs out
else if (player->powers[pw_underwater] == 1)
{
mobj_t *killer;
if ((netgame || multiplayer) && P_IsLocalPlayer(player))
S_ChangeMusic(mapmusic, true);
killer = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_NULL);
killer->threshold = 42; // Special flag that it was drowning which killed you.
P_DamageMobj(player->mo, killer, killer, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_DROWNED);
}
else if (player->powers[pw_spacetime] == 1)
{
if ((netgame || multiplayer) && P_IsLocalPlayer(player))
S_ChangeMusic(mapmusic, true);
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPACEDROWN);
}
if (numbermobj)
@ -2596,10 +2591,10 @@ static void P_DoClimbing(player_t *player)
climb = false;
if (player->climbing && climb && (player->mo->momx || player->mo->momy || player->mo->momz)
&& !(player->mo->state >= &states[S_PLAY_CLIMB2] && player->mo->state <= &states[S_PLAY_CLIMB5]))
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB2);
else if ((!(player->mo->momx || player->mo->momy || player->mo->momz) || !climb) && player->mo->state != &states[S_PLAY_CLIMB1])
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB1);
&& player->mo->state-states != S_PLAY_CLIMB)
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB);
else if ((!(player->mo->momx || player->mo->momy || player->mo->momz) || !climb) && player->mo->state-states != S_PLAY_CLING)
P_SetPlayerMobjState(player->mo, S_PLAY_CLING);
if (!floorclimb)
{
@ -2610,21 +2605,21 @@ static void P_DoClimbing(player_t *player)
player->climbing = 0;
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
if (skyclimber)
{
player->climbing = 0;
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
}
else
{
player->climbing = 0;
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
if (cmd->sidemove != 0 || cmd->forwardmove != 0)
@ -2633,16 +2628,16 @@ static void P_DoClimbing(player_t *player)
climb = false;
if (player->climbing && climb && (player->mo->momx || player->mo->momy || player->mo->momz)
&& !(player->mo->state >= &states[S_PLAY_CLIMB2] && player->mo->state <= &states[S_PLAY_CLIMB5]))
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB2);
else if ((!(player->mo->momx || player->mo->momy || player->mo->momz) || !climb) && player->mo->state != &states[S_PLAY_CLIMB1])
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB1);
&& player->mo->state-states != S_PLAY_CLIMB)
P_SetPlayerMobjState(player->mo, S_PLAY_CLIMB);
else if ((!(player->mo->momx || player->mo->momy || player->mo->momz) || !climb) && player->mo->state-states != S_PLAY_CLING)
P_SetPlayerMobjState(player->mo, S_PLAY_CLING);
if (cmd->buttons & BT_USE && !(player->pflags & PF_JUMPSTASIS))
{
player->climbing = 0;
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
P_SetObjectMomZ(player->mo, 4*FRACUNIT, false);
P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale));
}
@ -2653,7 +2648,7 @@ static void P_DoClimbing(player_t *player)
localangle2 = player->mo->angle;
if (player->climbing == 0)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
if (player->climbing && P_IsObjectOnGround(player->mo))
{
@ -2958,10 +2953,12 @@ static void P_DoTeeter(player_t *player)
{
INT32 bx, by, xl, xh, yl, yh;
yh = (unsigned)(player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
yh = (player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
yl = (player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
xh = (player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
xl = (player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
// Polyobjects
#ifdef POLYOBJECTS
@ -3081,10 +3078,10 @@ teeterdone:
}
if (teeter)
{
if ((player->mo->state == &states[S_PLAY_STND] || player->mo->state == &states[S_PLAY_TAP1] || player->mo->state == &states[S_PLAY_TAP2] || player->mo->state == &states[S_PLAY_SUPERSTAND]))
P_SetPlayerMobjState(player->mo, S_PLAY_TEETER1);
if (player->panim == PA_IDLE && player->mo->state-states != S_PLAY_EDGE)
P_SetPlayerMobjState(player->mo, S_PLAY_EDGE);
}
else if (checkedforteeter && (player->mo->state == &states[S_PLAY_TEETER1] || player->mo->state == &states[S_PLAY_TEETER2] || player->mo->state == &states[S_PLAY_SUPERTEETER]))
else if (checkedforteeter && (player->mo->state-states == S_PLAY_EDGE || player->mo->state-states == S_PLAY_SUPER_EDGE))
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
}
@ -3330,8 +3327,9 @@ firenormal:
//
static void P_DoSuperStuff(player_t *player)
{
mobj_t *spark;
ticcmd_t *cmd = &player->cmd;
if (player->mo->state >= &states[S_PLAY_SUPERTRANS1] && player->mo->state <= &states[S_PLAY_SUPERTRANS9])
if (player->mo->state >= &states[S_PLAY_SUPER_TRANS] && player->mo->state <= &states[S_PLAY_SUPER_TRANS9])
return; // don't do anything right now, we're in the middle of transforming!
if (player->pflags & PF_NIGHTSMODE)
@ -3384,19 +3382,32 @@ static void P_DoSuperStuff(player_t *player)
switch (player->skin)
{
case 1: // Golden orange supertails.
player->mo->color = SKINCOLOR_TSUPER1 + (leveltime/2) % 5;
if (leveltime % 9 < 5)
player->mo->color = SKINCOLOR_TSUPER1 + leveltime % 9;
else
player->mo->color = SKINCOLOR_TSUPER1 + 9 - leveltime % 9;
break;
case 2: // Pink superknux.
player->mo->color = SKINCOLOR_KSUPER1 + (leveltime/2) % 5;
if (leveltime % 9 < 5)
player->mo->color = SKINCOLOR_KSUPER1 + leveltime % 9;
else
player->mo->color = SKINCOLOR_KSUPER1 + 9 - leveltime % 9;
break;
default: // Yousa yellow now!
player->mo->color = SKINCOLOR_SUPER1 + (leveltime/2) % 5;
if (leveltime % 9 < 5)
player->mo->color = SKINCOLOR_SUPER1 + leveltime % 9;
else
player->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9;
break;
}
if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN))
&& !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy))
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SUPERSPARK);
{
spark = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SUPERSPARK);
spark->destscale = player->mo->scale;
P_SetScale(spark, player->mo->scale);
}
G_GhostAddColor(GHC_SUPER);
@ -3426,11 +3437,11 @@ static void P_DoSuperStuff(player_t *player)
if (player->mo->health > 0)
{
if ((player->pflags & PF_JUMPED) || (player->pflags & PF_SPINNING))
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
else if (player->panim == PA_RUN)
P_SetPlayerMobjState(player->mo, S_PLAY_SPD1);
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
else if (player->panim == PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
@ -3644,9 +3655,9 @@ void P_DoJump(player_t *player, boolean soundandstate)
S_StartSound(player->mo, sfx_jump); // Play jump sound!
if (!(player->charability2 == CA2_SPINDASH))
P_SetPlayerMobjState(player->mo, S_PLAY_SPRING);
P_SetPlayerMobjState(player->mo, S_PLAY_JUMP);
else
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
}
@ -3679,7 +3690,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd)
player->pflags |= PF_STARTDASH|PF_SPINNING;
player->dashspeed = FixedMul(FRACUNIT, player->mo->scale);
player->dashtime = 0;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
player->pflags |= PF_USEDOWN;
}
else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH))
@ -3704,7 +3715,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd)
&& !player->climbing && !player->mo->momz && onground && player->speed > FixedMul(5<<FRACBITS, player->mo->scale) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING))
{
player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
if (!player->spectator)
S_StartSound(player->mo, sfx_spin);
player->pflags |= PF_USEDOWN;
@ -3744,7 +3755,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd)
}
if (onground && (player->pflags & PF_SPINNING) && !(player->panim == PA_ROLL))
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
//
@ -3764,7 +3775,7 @@ void P_DoJumpShield(player_t *player)
player->jumping = 0;
player->pflags |= PF_THOKKED;
player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
S_StartSound(player->mo, sfx_wdjump);
}
@ -3991,7 +4002,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
; // Can't do anything if you're a fish out of water!
else if (!(player->pflags & PF_THOKKED) && !(player->powers[pw_tailsfly]))
{
P_SetPlayerMobjState(player->mo, S_PLAY_ABL1); // Change to the flying animation
P_SetPlayerMobjState(player->mo, S_PLAY_FLY); // Change to the flying animation
player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer
@ -4017,7 +4028,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->pflags &= ~PF_THOKKED;
}
P_SetPlayerMobjState(player->mo, S_PLAY_ABL1);
P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE);
P_InstaThrust(player->mo, player->mo->angle, FixedMul(glidespeed, player->mo->scale));
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
}
@ -4251,7 +4262,7 @@ static void P_2dMovement(player_t *player)
else if (player->exiting)
{
player->pflags &= ~PF_GLIDING;
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
player->skidtime = 0;
}
}
@ -4438,7 +4449,7 @@ static void P_3dMovement(player_t *player)
else if (player->exiting)
{
player->pflags &= ~PF_GLIDING;
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
player->skidtime = 0;
}
}
@ -6017,7 +6028,7 @@ static void P_NiGHTSMovement(player_t *player)
if (player->powers[pw_flashing] == 1)
player->powers[pw_flashing] = 3;
else
P_DamageMobj(player->mo, NULL, NULL, 1);
P_DamageMobj(player->mo, NULL, NULL, 1, 0);
}
if (movingangle >= ANGLE_90 && movingangle <= ANGLE_180)
@ -6176,7 +6187,7 @@ static void P_SkidStuff(player_t *player)
{
player->skidtime = 0;
player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
}
// Get up and brush yourself off, idiot.
else if (player->glidetime > 15)
@ -6242,7 +6253,7 @@ static void P_SkidStuff(player_t *player)
player->skidtime = TICRATE/2;
S_StartSound(player->mo, sfx_skid);
if (player->panim != PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN4); // this switches to S_PLAY_SUPERWALK1 for superanims
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
player->mo->tics = player->skidtime;
}
}
@ -6267,7 +6278,7 @@ static void P_MovePlayer(player_t *player)
if (countdowntimeup)
return;
if (player->mo->state >= &states[S_PLAY_SUPERTRANS1] && player->mo->state <= &states[S_PLAY_SUPERTRANS9])
if (player->mo->state >= &states[S_PLAY_SUPER_TRANS] && player->mo->state <= &states[S_PLAY_SUPER_TRANS9])
{
player->mo->momx = player->mo->momy = player->mo->momz = 0;
return;
@ -6379,7 +6390,7 @@ static void P_MovePlayer(player_t *player)
players[i].exiting = (14*TICRATE)/5 + 1;
}
else if (player->health > 1)
P_DamageMobj(player->mo, NULL, NULL, 1);
P_DamageMobj(player->mo, NULL, NULL, 1, 0);
player->pflags &= ~PF_NIGHTSFALL;
}
}
@ -6416,23 +6427,23 @@ static void P_MovePlayer(player_t *player)
// If the player is moving fast enough,
// break into a run!
if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
P_SetPlayerMobjState (player->mo, S_PLAY_SPD1);
P_SetPlayerMobjState (player->mo, S_PLAY_RUN);
// Otherwise, just walk.
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
P_SetPlayerMobjState (player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState (player->mo, S_PLAY_WALK);
}
// If your running animation is playing, and you're
// going too slow, switch back to the walking frames.
if (player->panim == PA_RUN && player->speed < runspd)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
// If Springing, but travelling DOWNWARD, change back!
if (player->mo->state == &states[S_PLAY_SPRING] && P_MobjFlip(player->mo)*player->mo->momz < 0)
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
if (player->mo->state == &states[S_PLAY_JUMP] && P_MobjFlip(player->mo)*player->mo->momz < 0)
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
// If Springing but on the ground, change back!
else if (onground && (player->mo->state == &states[S_PLAY_SPRING] || player->panim == PA_FALL || player->mo->state == &states[S_PLAY_CARRY]) && !player->mo->momz)
else if (onground && (player->mo->state == &states[S_PLAY_JUMP] || player->panim == PA_FALL || player->mo->state == &states[S_PLAY_RIDE]) && !player->mo->momz)
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
// If you are stopped and are still walking, stand still!
@ -6467,11 +6478,11 @@ static void P_MovePlayer(player_t *player)
if (player->pflags & PF_GLIDING || player->climbing)
{
if (onground)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else
{
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
}
player->pflags &= ~PF_GLIDING;
@ -6524,19 +6535,19 @@ static void P_MovePlayer(player_t *player)
{
P_ResetPlayer(player); // down, stop gliding.
if (onground)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else if ((player->charability2 == CA2_MULTIABILITY)
|| (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB))
{
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
else
{
player->pflags |= PF_THOKKED;
player->mo->momx >>= 1;
player->mo->momy >>= 1;
P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
}
}
}
@ -6592,14 +6603,14 @@ static void P_MovePlayer(player_t *player)
if (!(player->charability == CA_FLY || player->charability == CA_SWIM)) // why are you flying when you cannot fly?!
{
if (player->powers[pw_tailsfly]
|| (player->mo->state >= &states[S_PLAY_SPC1] && player->mo->state <= &states[S_PLAY_SPC4]))
|| player->mo->state-states == S_PLAY_FLY_TIRED)
{
if (onground)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else
{
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
}
player->powers[pw_tailsfly] = 0;
@ -6651,11 +6662,10 @@ static void P_MovePlayer(player_t *player)
{
// Tails-gets-tired Stuff
if (player->panim == PA_ABILITY)
P_SetPlayerMobjState(player->mo, S_PLAY_SPC4);
P_SetPlayerMobjState(player->mo, S_PLAY_FLY_TIRED);
if (player->charability == CA_FLY && (leveltime % 10 == 0)
&& player->mo->state >= &states[S_PLAY_SPC1]
&& player->mo->state <= &states[S_PLAY_SPC4]
&& player->mo->state-states == S_PLAY_FLY_TIRED
&& !player->spectator)
S_StartSound(player->mo, sfx_pudpud);
}
@ -6750,7 +6760,7 @@ static void P_MovePlayer(player_t *player)
}
// Otherwise, face the direction you're travelling.
else if (player->panim == PA_WALK || player->panim == PA_RUN || player->panim == PA_ROLL
|| ((player->mo->state >= &states[S_PLAY_ABL1] && player->mo->state <= &states[S_PLAY_SPC4]) && player->charability == CA_FLY))
|| (player->mo->state-states == S_PLAY_FLY || player->mo->state-states == S_PLAY_FLY_TIRED))
player->mo->angle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy);
// Update the local angle control.
@ -6798,8 +6808,8 @@ static void P_MovePlayer(player_t *player)
if (player->charflags & SF_SUPER && player->powers[pw_super] && player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
&& P_MobjFlip(player->mo)*player->mo->momz <= 0)
{
if (player->panim == PA_ROLL || player->mo->state == &states[S_PLAY_PAIN])
P_SetPlayerMobjState(player->mo, S_PLAY_SUPERWALK1);
if (player->panim == PA_ROLL || player->mo->state-states == S_PLAY_PAIN)
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_WALK);
player->mo->momz = 0;
player->pflags &= ~PF_SPINNING;
@ -6858,7 +6868,7 @@ static void P_MovePlayer(player_t *player)
}
// Make sure you're not teetering when you shouldn't be.
if ((player->mo->state == &states[S_PLAY_TEETER1] || player->mo->state == &states[S_PLAY_TEETER2] || player->mo->state == &states[S_PLAY_SUPERTEETER])
if ((player->mo->state-states == S_PLAY_EDGE || player->mo->state-states == S_PLAY_SUPER_EDGE)
&& (player->mo->momx || player->mo->momy || player->mo->momz))
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
@ -6884,10 +6894,10 @@ static void P_MovePlayer(player_t *player)
fixed_t oldheight = player->mo->height;
// Less height while spinning. Good for spinning under things...?
if ((player->mo->state == &states[player->mo->info->painstate] || player->mo->state == &states[S_PLAY_SUPERHIT])
if ((player->mo->state == &states[player->mo->info->painstate] || player->mo->state == &states[S_PLAY_SUPER_PAIN])
|| (player->charability2 == CA2_SPINDASH && (player->pflags & (PF_SPINNING|PF_JUMPED)))
|| player->powers[pw_tailsfly] || player->pflags & PF_GLIDING
|| (player->charability == CA_FLY && (player->mo->state >= &states[S_PLAY_SPC1] && player->mo->state <= &states[S_PLAY_SPC4])))
|| (player->charability == CA_FLY && player->mo->state-states == S_PLAY_FLY_TIRED))
player->mo->height = P_GetPlayerSpinHeight(player);
else
player->mo->height = P_GetPlayerHeight(player);
@ -6903,18 +6913,14 @@ static void P_MovePlayer(player_t *player)
if ((player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_SPINNING))
{
player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
else if (player->mo->ceilingz - player->mo->floorz < player->mo->height)
{
if ((netgame || multiplayer) && player->spectator)
P_DamageMobj(player->mo, NULL, NULL, 42000); // Respawn crushed spectators
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPECTATOR); // Respawn crushed spectators
else
{
mobj_t *killer = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_NULL);
killer->threshold = 44; // Special flag that it was crushing which killed you.
P_DamageMobj(player->mo, killer, killer, 10000);
}
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_CRUSHED);
if (player->playerstate == PST_DEAD)
return;
@ -7184,7 +7190,7 @@ static void P_DoRopeHang(player_t *player)
if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED)
&& !(player->panim == PA_ROLL) && player->charability2 == CA2_SPINDASH)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
return;
}
@ -7301,7 +7307,7 @@ static void P_DoRopeHang(player_t *player)
if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED)
&& !(player->panim == PA_ROLL) && player->charability2 == CA2_SPINDASH)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
P_SetTarget(&player->mo->tracer, NULL);
@ -7345,7 +7351,7 @@ static void P_NukeAllPlayers(player_t *player)
if (mo == player->mo)
continue;
P_DamageMobj(mo, player->mo, player->mo, 1);
P_DamageMobj(mo, player->mo, player->mo, 1, 0);
}
CONS_Printf(M_GetText("%s caused a world of pain.\n"), player_names[player-players]);
@ -7403,12 +7409,12 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
mo->flags |= MF_SPECIAL|MF_SHOOTABLE;
if (mo->type == MT_EGGGUARD && mo->tracer) //nuke Egg Guard's shield!
P_KillMobj(mo->tracer, inflictor, source);
P_KillMobj(mo->tracer, inflictor, source, 0);
if (mo->flags & MF_BOSS || mo->type == MT_PLAYER) //don't OHKO bosses nor players!
P_DamageMobj(mo, inflictor, source, 1);
P_DamageMobj(mo, inflictor, source, 1, 0);
else
P_DamageMobj(mo, inflictor, source, 1000);
P_DamageMobj(mo, inflictor, source, 1000, 0);
}
}
@ -7780,24 +7786,24 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
angle_t angle = 0, focusangle = 0, focusaiming = 0;
fixed_t x, y, z, dist, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
INT32 camrotate;
boolean camstill, forceon = false, cameranoclip;
boolean camstill, cameranoclip;
mobj_t *mo;
subsector_t *newsubsec;
fixed_t f1, f2;
cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)
forceon = true;
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD))
{
if (player->spectator) // force cam off for spectators
return true;
if (!forceon && player->spectator) // force cam off for spectators
return true;
if (!cv_chasecam.value && thiscam == &camera)
return true;
if (!forceon && !cv_chasecam.value && thiscam == &camera)
return true;
if (!forceon && !cv_chasecam2.value && thiscam == &camera2)
return true;
if (!cv_chasecam2.value && thiscam == &camera2)
return true;
}
if (!thiscam->chase && !resetcalled)
{
@ -8091,10 +8097,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
INT32 xl, xh, yl, yh, bx, by;
validcount++;
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
BMBOUNDFIX(xl, xh, yl, yh);
for (by = yl; by <= yh; by++)
for (bx = xl; bx <= xh; bx++)
@ -8612,10 +8620,10 @@ void P_PlayerThink(player_t *player)
if (player->pflags & PF_GLIDING)
{
if (player->panim != PA_ABILITY)
P_SetPlayerMobjState(player->mo, S_PLAY_ABL1);
P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE);
}
else if ((player->pflags & PF_JUMPED) && !player->powers[pw_super] && player->panim != PA_ROLL && player->charability2 == CA2_SPINDASH)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
if (player->flashcount)
player->flashcount--;
@ -8681,7 +8689,7 @@ void P_PlayerThink(player_t *player)
}
player->lives = 2; // Don't start the game over music!
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
player->lives = 0;
if (player->playerstate == PST_DEAD)
@ -8855,14 +8863,14 @@ void P_PlayerThink(player_t *player)
ticmiss++;
P_DoRopeHang(player);
P_SetPlayerMobjState(player->mo, S_PLAY_CARRY);
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
P_DoJumpStuff(player, &player->cmd);
}
else
{
P_DoZoomTube(player);
if (!(player->panim == PA_ROLL) && player->charability2 == CA2_SPINDASH)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
}
player->rmomx = player->rmomy = 0; // no actual momentum from your controls
P_ResetScore(player);
@ -9087,7 +9095,7 @@ void P_PlayerAfterThink(player_t *player)
{
ticcmd_t *cmd;
INT32 oldweapon = player->currentweapon;
camera_t *thiscam;
camera_t *thiscam = NULL; // if not one of the displayed players, just don't bother
#ifdef PARANOIA
if (!player->mo)
@ -9101,7 +9109,7 @@ void P_PlayerAfterThink(player_t *player)
if (splitscreen && player == &players[secondarydisplayplayer])
thiscam = &camera2;
else
else if (player == &players[displayplayer])
thiscam = &camera;
if (player->playerstate == PST_DEAD)
@ -9109,7 +9117,7 @@ void P_PlayerAfterThink(player_t *player)
// camera may still move when guy is dead
//if (!netgame)
{
if (((splitscreen && player == &players[secondarydisplayplayer]) || player == &players[displayplayer]) && thiscam->chase)
if (thiscam && thiscam->chase)
P_MoveChaseCamera(player, thiscam, false);
}
return;
@ -9235,7 +9243,7 @@ void P_PlayerAfterThink(player_t *player)
if (player->pflags & PF_GLIDING)
{
if (player->panim != PA_ABILITY)
P_SetPlayerMobjState(player->mo, S_PLAY_ABL1);
P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE);
}
else if (player->pflags & PF_SLIDING)
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
@ -9243,17 +9251,15 @@ void P_PlayerAfterThink(player_t *player)
&& ((!player->powers[pw_super] && player->panim != PA_ROLL)
|| player->mo->state == &states[player->mo->info->painstate])
&& player->charability2 == CA2_SPINDASH)
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
if (player->pflags & PF_CARRIED && player->mo->tracer)
{
player->mo->height = FixedDiv(P_GetPlayerHeight(player), FixedDiv(14*FRACUNIT,10*FRACUNIT));
// State check for the carrier - Flame
// You are an IDIOT, those aren't even the right frames! >_> - JTE
if (player->mo->tracer->player
&& !(player->mo->tracer->state >= &states[S_PLAY_ABL1]
&& player->mo->tracer->state <= &states[S_PLAY_SPC4]))
&& player->mo->tracer->state-states != S_PLAY_FLY
&& player->mo->tracer->state-states != S_PLAY_FLY_TIRED)
player->pflags &= ~PF_CARRIED;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -9296,7 +9302,7 @@ void P_PlayerAfterThink(player_t *player)
if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius)
player->pflags &= ~PF_CARRIED;
P_SetPlayerMobjState(player->mo, S_PLAY_CARRY);
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
if (player-players == consoleplayer && botingame)
CV_SetValue(&cv_analog2, !(player->pflags & PF_CARRIED));
@ -9313,7 +9319,7 @@ void P_PlayerAfterThink(player_t *player)
player->mo->z = player->mo->tracer->z - FixedDiv(player->mo->height, 3*FRACUNIT/2);
player->mo->momx = player->mo->momy = player->mo->momz = 0;
P_SetThingPosition(player->mo);
P_SetPlayerMobjState(player->mo, S_PLAY_CARRY);
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
// Controllable missile
if (player->mo->tracer->type == MT_BLACKEGGMAN_MISSILE)
@ -9364,7 +9370,7 @@ void P_PlayerAfterThink(player_t *player)
}
}
if ((splitscreen && player == &players[secondarydisplayplayer]) || player == &players[displayplayer])
if (thiscam)
{
if (!thiscam->chase) // bob view only if looking through the player's eyes
{

View file

@ -978,11 +978,12 @@ static void R_Subsector(size_t num)
polysec->floorpic_angle-po->angle,
NULL,
NULL);
ffloor[numffloors].plane->polyobj = po;
//ffloor[numffloors].plane->polyobj = po;
ffloor[numffloors].height = polysec->floorheight;
ffloor[numffloors].polyobj = po;
// ffloor[numffloors].ffloor = rover;
po->visplane = ffloor[numffloors].plane;
numffloors++;
}
@ -1014,11 +1015,12 @@ static void R_Subsector(size_t num)
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle,
NULL, NULL);
ffloor[numffloors].plane->polyobj = po;
//ffloor[numffloors].plane->polyobj = po;
ffloor[numffloors].polyobj = po;
ffloor[numffloors].height = polysec->ceilingheight;
// ffloor[numffloors].ffloor = rover;
po->visplane = ffloor[numffloors].plane;
numffloors++;
}

View file

@ -1026,34 +1026,31 @@ void R_SetupFrame(player_t *player, boolean skybox)
{
INT32 dy = 0;
camera_t *thiscam;
boolean forcechase = false;
boolean chasecam = false;
if (splitscreen && player == &players[secondarydisplayplayer]
&& player != &players[consoleplayer])
{
thiscam = &camera2;
chasecam = (cv_chasecam2.value != 0);
}
else
{
thiscam = &camera;
chasecam = (cv_chasecam.value != 0);
}
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)
forcechase = true;
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off
if (!forcechase && player->spectator) // no spectator chasecam
thiscam->chase = false;
else if ((cv_chasecam.value || forcechase) && !player->spectator && thiscam == &camera && !thiscam->chase)
if (chasecam && !thiscam->chase)
{
P_ResetCamera(player, &camera);
P_ResetCamera(player, thiscam);
thiscam->chase = true;
}
else if ((cv_chasecam2.value || forcechase) && !player->spectator && thiscam == &camera2 && !thiscam->chase)
{
P_ResetCamera(player, &camera2);
thiscam->chase = true;
}
else if (!(cv_chasecam.value || forcechase) && thiscam == &camera)
thiscam->chase = false;
else if (!(cv_chasecam2.value || forcechase) && thiscam == &camera2)
else if (!chasecam)
thiscam->chase = false;
viewsky = !skybox;
@ -1066,9 +1063,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
aimingangle = player->awayviewaiming;
viewangle = viewmobj->angle;
}
else if (!player->spectator && (forcechase
|| (cv_chasecam.value && thiscam == &camera)
|| (cv_chasecam2.value && thiscam == &camera2)))
else if (!player->spectator && chasecam)
// use outside cam view
{
viewmobj = NULL;
@ -1105,8 +1100,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
viewplayer = player;
if ((forcechase || (cv_chasecam.value && thiscam == &camera) || (cv_chasecam2.value && thiscam == &camera2))
&& !player->awayviewtics && !player->spectator)
if (chasecam && !player->awayviewtics && !player->spectator)
{
viewx = thiscam->x;
viewy = thiscam->y;

View file

@ -338,6 +338,10 @@ void R_AddSpriteDefs(UINT16 wadnum)
else
start++; // just after S_START
// ignore skin wads (we don't want skin sprites interfering with vanilla sprites)
if (start == 0 && W_CheckNumForNamePwad("S_SKIN", wadnum, 0) != INT16_MAX)
return;
end = W_CheckNumForNamePwad("S_END",wadnum,start);
if (end == INT16_MAX)
end = W_CheckNumForNamePwad("SS_END",wadnum,start); //deutex compatib.
@ -1088,9 +1092,14 @@ static void R_ProjectSprite(mobj_t *thing)
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
if (thing->skin && thing->sprite == SPR_PLAY)
{
sprdef = &((skin_t *)thing->skin)->spritedef;
if (rot >= sprdef->numframes)
sprdef = &((skin_t *)thing->skin)->sprites[thing->sprite2];
if (rot >= sprdef->numframes) {
CONS_Alert(CONS_ERROR, M_GetText("R_ProjectSprite: invalid skins[\"%s\"].sprites[SPR2_%s] frame %d\n"), ((skin_t *)thing->skin)->name, spr2names[thing->sprite2], rot);
thing->sprite = states[S_UNKNOWN].sprite;
thing->frame = states[S_UNKNOWN].frame;
sprdef = &sprites[thing->sprite];
rot = thing->frame&FF_FRAMEMASK;
}
}
else
sprdef = &sprites[thing->sprite];
@ -1546,23 +1555,12 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
// If a limit exists, handle things a tiny bit different.
if ((limit_dist = (fixed_t)((maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : cv_drawdist.value) << FRACBITS))
{
if (!players[displayplayer].mo)
return; // Draw nothing if no player.
// todo: is this really the best option for this situation?
for (thing = sec->thinglist; thing; thing = thing->snext)
{
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
continue;
approx_dist = P_AproxDistance(
players[displayplayer].mo->x - thing->x,
players[displayplayer].mo->y - thing->y);
if (splitscreen && approx_dist > limit_dist && players[secondarydisplayplayer].mo)
approx_dist = P_AproxDistance(
players[secondarydisplayplayer].mo->x - thing->x,
players[secondarydisplayplayer].mo->y - thing->y);
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
if (approx_dist <= limit_dist)
R_ProjectSprite(thing);
@ -1579,23 +1577,12 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
// Someone seriously wants infinite draw distance for precipitation?
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
{
if (!players[displayplayer].mo)
return; // Draw nothing if no player.
// todo: is this really the best option for this situation?
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
{
if (precipthing->precipflags & PCF_INVISIBLE)
continue;
approx_dist = P_AproxDistance(
players[displayplayer].mo->x - precipthing->x,
players[displayplayer].mo->y - precipthing->y);
if (splitscreen && approx_dist > limit_dist && players[secondarydisplayplayer].mo)
approx_dist = P_AproxDistance(
players[secondarydisplayplayer].mo->x - precipthing->x,
players[secondarydisplayplayer].mo->y - precipthing->y);
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
if (approx_dist <= limit_dist)
R_ProjectPrecipitationSprite(precipthing);
@ -1704,6 +1691,19 @@ static void R_CreateDrawNodes(void)
}
if (ds->maskedtexturecol)
{
#ifdef POLYOBJECTS_PLANES
// Check for a polyobject plane, but only if this is a front line
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
// Put it in!
entry = R_CreateDrawNode(&nodehead);
entry->plane = ds->curline->polyseg->visplane;
entry->seg = ds;
ds->curline->polyseg->visplane->polyobj = ds->curline->polyseg;
ds->curline->polyseg->visplane = NULL;
}
#endif
entry = R_CreateDrawNode(&nodehead);
entry->seg = ds;
}
@ -1720,7 +1720,7 @@ static void R_CreateDrawNodes(void)
plane = ds->ffloorplanes[p];
R_PlaneBounds(plane);
if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low)
if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low || plane->polyobj)
{
ds->ffloorplanes[p] = NULL;
continue;
@ -1831,7 +1831,7 @@ static void R_CreateDrawNodes(void)
}
else if (r2->seg)
{
#ifdef POLYOBJECTS_PLANES
#if 0 //#ifdef POLYOBJECTS_PLANES
if (r2->seg->curline->polyseg && rover->mobj && P_MobjInsidePolyobj(r2->seg->curline->polyseg, rover->mobj)) {
// Determine if we need to sort in front of the polyobj, based on the planes. This fixes the issue where
// polyobject planes render above the object standing on them. (A bit hacky... but it works.) -Red
@ -2225,7 +2225,6 @@ static void Sk_SetDefaultValue(skin_t *skin)
sizeof skin->name, "skin %u", (UINT32)(skin-skins));
skin->name[sizeof skin->name - 1] = '\0';
skin->wadnum = INT16_MAX;
strcpy(skin->sprite, "");
skin->flags = 0;
@ -2267,7 +2266,6 @@ static void Sk_SetDefaultValue(skin_t *skin)
//
void R_InitSkins(void)
{
skin_t *skin;
#ifdef SKINVALUES
INT32 i;
@ -2278,43 +2276,8 @@ void R_InitSkins(void)
}
#endif
// skin[0] = Sonic skin
skin = &skins[0];
numskins = 1;
Sk_SetDefaultValue(skin);
// Hardcoded S_SKIN customizations for Sonic.
strcpy(skin->name, DEFAULTSKIN);
#ifdef SKINVALUES
skin_cons_t[0].strvalue = skins[0].name;
#endif
skin->flags = SF_SUPER|SF_SUPERANIMS|SF_SUPERSPIN;
strcpy(skin->realname, "Sonic");
strcpy(skin->hudname, "SONIC");
strncpy(skin->charsel, "CHRSONIC", 8);
strncpy(skin->face, "LIVSONIC", 8);
strncpy(skin->superface, "LIVSUPER", 8);
skin->prefcolor = SKINCOLOR_BLUE;
skin->ability = CA_THOK;
skin->actionspd = 60<<FRACBITS;
skin->normalspeed = 36<<FRACBITS;
skin->runspeed = 28<<FRACBITS;
skin->thrustfactor = 5;
skin->accelstart = 96;
skin->acceleration = 40;
skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
ST_LoadFaceGraphics(skin->face, skin->superface, 0);
//MD2 for sonic doesn't want to load in Linux.
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_AddPlayerMD2(0);
#endif
// no default skin!
numskins = 0;
}
// returns true if the skin name is found (loaded from pwad)
@ -2559,11 +2522,6 @@ void R_AddSkins(UINT16 wadnum)
STRBUFCPY(skin->realname, skin->hudname);
}
else if (!stricmp(stoken, "sprite"))
{
strupr(value);
strncpy(skin->sprite, value, sizeof skin->sprite);
}
else if (!stricmp(stoken, "charsel"))
{
strupr(value);
@ -2645,71 +2603,25 @@ next_token:
}
free(buf2);
// Not in vanilla, you don't.
skin->flags &= ~SF_SUPER;
if (skin != &skins[0])
skin->flags &= ~SF_SUPER;
lump++; // if no sprite defined use spirte just after this one
if (skin->sprite[0] == '\0')
// Add sprites
{
const char *csprname = W_CheckNameForNumPwad(wadnum, lump);
UINT16 z;
UINT8 sprite2;
// skip to end of this skin's frames
lastlump = lump;
while (W_CheckNameForNumPwad(wadnum,lastlump) && memcmp(W_CheckNameForNumPwad(wadnum, lastlump),csprname,4)==0)
lastlump++;
// allocate (or replace) sprite frames, and set spritedef
R_AddSingleSpriteDef(csprname, &skin->spritedef, wadnum, lump, lastlump);
}
else
{
// search in the normal sprite tables
size_t name;
boolean found = false;
const char *sprname = skin->sprite;
for (name = 0;sprnames[name][0] != '\0';name++)
if (strncmp(sprnames[name], sprname, 4) == 0)
{
found = true;
skin->spritedef = sprites[name];
}
lump++; // start after S_SKIN
lastlump = W_CheckNumForNamePwad("S_END",wadnum,lump); // stop at S_END
// old wadding practices die hard -- stop at S_SKIN or S_START if they come before S_END.
z = W_CheckNumForNamePwad("S_SKIN",wadnum,lump);
if (z < lastlump) lastlump = z;
z = W_CheckNumForNamePwad("S_START",wadnum,lump);
if (z < lastlump) lastlump = z;
// not found so make a new one
// go through the entire current wad looking for our sprite
// don't just mass add anything beginning with our four letters.
// "HOODFACE" is not a sprite name.
if (!found)
{
UINT16 localllump = 0, lstart = UINT16_MAX, lend = UINT16_MAX;
const char *lname;
while ((lname = W_CheckNameForNumPwad(wadnum,localllump)))
{
// If this is a valid sprite...
if (!memcmp(lname,sprname,4) && lname[4] && lname[5] && lname[5] >= '0' && lname[5] <= '8')
{
if (lstart == UINT16_MAX)
lstart = localllump;
// If already set do nothing
}
else
{
if (lstart != UINT16_MAX)
{
lend = localllump;
break;
}
// If not already set do nothing
}
++localllump;
}
R_AddSingleSpriteDef(sprname, &skin->spritedef, wadnum, lstart, lend);
}
// I don't particularly care about skipping to the end of the used frames.
// We could be using frames from ANYWHERE in the current WAD file, including
// right before us, which is a terrible idea.
// So just let the function in the while loop take care of it for us.
// load all sprite sets we are aware of.
for (sprite2 = 0; sprite2 < NUMPLAYERSPRITES; sprite2++)
R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, lump, lastlump);
}
R_FlushTranslationColormapCache();

View file

@ -68,9 +68,7 @@ void R_DrawMasked(void);
typedef struct
{
char name[SKINNAMESIZE+1]; // INT16 descriptive name of the skin
spritedef_t spritedef;
UINT16 wadnum;
char sprite[4]; // Sprite name, if seperated from S_SKIN.
skinflags_t flags;
char realname[SKINNAMESIZE+1]; // Display name for level completion.
@ -102,6 +100,8 @@ typedef struct
// specific sounds per skin
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
spritedef_t sprites[NUMPLAYERSPRITES];
} skin_t;
// -----------

View file

@ -1,80 +1,425 @@
/* XPM */
static const char * SDL_icon_xpm[] = {
"32 32 45 1",
" c None",
". c #6B6BFF",
"+ c #3D00B9",
"@ c #4848FF",
"# c #2525FF",
"$ c #310096",
"% c #003196",
"& c #003DB9",
"* c #620096",
"= c #6E6E6E",
"- c #966200",
"; c #250073",
"> c #626262",
", c #FF8F6B",
"' c #FFC66B",
") c #FFAB8E",
"! c #000080",
"~ c #B6B6B6",
"{ c #929292",
"] c #FFD48E",
"^ c #0000B9",
"/ c #565656",
"( c #868686",
"_ c #808080",
": c #C0C0C0",
"< c #DADADA",
"[ c #F2F2F2",
"} c #FFFFFF",
"| c #CECECE",
"1 c #AAAAAA",
"2 c #E6E6E6",
"3 c #000096",
"4 c #AB8EFF",
"5 c #190050",
"6 c #000000",
"7 c #8E8EFF",
"8 c #3E3E3E",
"9 c #7A7A7A",
"0 c #0E0E0E",
"a c #9E9E9E",
"b c #001950",
"c c #C2C2C2",
"d c #323232",
"e c #002573",
"f c #A0A0A4",
" ",
" ",
" ",
" .+@##@. ",
" @@.@#######@ ",
" @@....######### ",
" .. .@.....@+##$%%%&&% ",
" ..@# @@....@+#*=-;%%%%% ",
" ..@#@......@>,')!%%%$ ",
" ~..$#.........{])^#+%/ ",
" +##@.........()^@@@@@_ ",
" $####@........#=#######+ ",
" +######....@@##^#########_ ",
" +#####=:<<:+##############/ ",
"[<=####{<}}}}|###############= ",
" }1###=2}}}}}}.############### ",
" }<3#3~}}}}}}}4################ ",
" }<5#6:}}}}}}}7################/",
" }:6861}}}}}}}.########$$ 9 .@$",
" }:0a6~}}}}}}}@######5b ",
"22cd262}}}}}}2######5b$ ",
" 2>1a}}}}}}}{(*###%be## ",
" 860)1<[22c1)]]+##be### ",
" ~)]]]))))]]]]]=#bb#### ",
" )]]]]]]]]](]]=eb$#### ",
" :]]]]]]]]]'9bbb$##### ",
" ),'''''( >db+### ",
" =##f ",
" { ",
" ",
" ",
" "};
static char * C:\Repo\srb2\src\sdl\SDL_icon_xpm[] = {
"32 32 390 2",
" c None",
". c #4F4F70",
"+ c #4D4D87",
"@ c #4D4D84",
"# c #4E4E6C",
"$ c #6C6C95",
"% c #5E5EB2",
"& c #6B6BE7",
"* c #7373F9",
"= c #7C7CFF",
"- c #6F70E7",
"; c #494BB2",
"> c #4F4FA3",
", c #6464D4",
"' c #7979F5",
") c #5F5FCA",
"! c #5D5D93",
"~ c #3A3A9F",
"{ c #6060AC",
"] c #777793",
"^ c #5C5CB3",
"/ c #7373EA",
"( c #7A7AFF",
"_ c #7575FF",
": c #7979FF",
"< c #6264DD",
"[ c #47478C",
"} c #564567",
"| c #4647D0",
"1 c #5C5CAE",
"2 c #5E5EFF",
"3 c #2929FF",
"4 c #1D1DFF",
"5 c #1919D1",
"6 c #4F4F90",
"7 c #1E1ECE",
"8 c #5858FF",
"9 c #6767A8",
"0 c #4949A0",
"a c #7070FB",
"b c #7D7DFF",
"c c #7777FF",
"d c #7373FF",
"e c #7272FF",
"f c #7878FF",
"g c #6465D8",
"h c #363886",
"i c #9F7655",
"j c #C89B5C",
"k c #1D1CB7",
"l c #3031B1",
"m c #1919F4",
"n c #1111FF",
"o c #1818FF",
"p c #1B1BFF",
"q c #1C1CFF",
"r c #2626B3",
"s c #1E1EC8",
"t c #1A1AE8",
"u c #24249F",
"v c #2F2FD2",
"w c #7676FF",
"x c #6869E2",
"y c #414290",
"z c #8C6751",
"A c #FCBA68",
"B c #E9BD7D",
"C c #201EB8",
"D c #090AB8",
"E c #1616EB",
"F c #1818FD",
"G c #1414EE",
"H c #1010E1",
"I c #0E0EE2",
"J c #0E0EF4",
"K c #0606B2",
"L c #7A7A89",
"M c #0C0C9A",
"N c #0A0AA7",
"O c #2424E4",
"P c #6669E6",
"Q c #4F4A8F",
"R c #BF853B",
"S c #FFD98D",
"T c #CDAB76",
"U c #1717C4",
"V c #0F10BA",
"W c #0909B6",
"X c #0505C3",
"Y c #0000B6",
"Z c #0000BE",
"` c #0000AD",
" . c #1D1D83",
".. c #63638E",
"+. c #090975",
"@. c #1414F3",
"#. c #5B5BFF",
"$. c #7B7BFF",
"%. c #7070FF",
"&. c #6E6EFF",
"*. c #7172F6",
"=. c #625DAF",
"-. c #BA9E6C",
";. c #887167",
">. c #090DF2",
",. c #1313BE",
"'. c #000085",
"). c #0000AC",
"!. c #0202AA",
"~. c #242488",
"{. c #1414C7",
"]. c #1717FF",
"^. c #5959FF",
"/. c #7F7FFF",
"(. c #7474FF",
"_. c #7171FF",
":. c #8686FF",
"<. c #7574FF",
"[. c #797CFF",
"}. c #5756B8",
"|. c #1C19A4",
"1. c #1617FF",
"2. c #1212BD",
"3. c #040485",
"4. c #0707A4",
"5. c #1B1B71",
"6. c #373797",
"7. c #1616FF",
"8. c #5050FF",
"9. c #8080FF",
"0. c #AAAAFF",
"a. c #AEAEF6",
"b. c #8A8AEF",
"c. c #6969FB",
"d. c #2728FF",
"e. c #1314FF",
"f. c #1919FF",
"g. c #1313E8",
"h. c #1F1FF4",
"i. c #5454FF",
"j. c #6D6DF0",
"k. c #6868B5",
"l. c #0B0BB8",
"m. c #1212C5",
"n. c #1616FC",
"o. c #1515FF",
"p. c #1212FF",
"q. c #2323FF",
"r. c #3636FF",
"s. c #4040FF",
"t. c #4343F9",
"u. c #5D5DB8",
"v. c #7F7F92",
"w. c #878793",
"x. c #4B4B94",
"y. c #0B0CE2",
"z. c #1313FF",
"A. c #4C4CFF",
"B. c #8282FF",
"C. c #7171ED",
"D. c #636394",
"E. c #575785",
"F. c #A9A99C",
"G. c #1414BC",
"H. c #1414FF",
"I. c #0707FD",
"J. c #2525AA",
"K. c #A8A8A4",
"L. c #EBEBE2",
"M. c #F9F9F2",
"N. c #E1E1CC",
"O. c #4D4D9F",
"P. c #0B0BF7",
"Q. c #2121FF",
"R. c #3232FF",
"S. c #5555FF",
"T. c #6161B4",
"U. c #B5B5B2",
"V. c #FFFFF8",
"W. c #4F4F9A",
"X. c #0B0BF5",
"Y. c #1616C5",
"Z. c #A8A8A1",
"`. c #FFFFFC",
" + c #FFFFFF",
".+ c #C0C0C4",
"++ c #1212D4",
"@+ c #4444FF",
"#+ c #6464FF",
"$+ c #8383FF",
"%+ c #6767C3",
"&+ c #E4E4E4",
"*+ c #9494AE",
"=+ c #0808DF",
"-+ c #0D0DF2",
";+ c #61619A",
">+ c #F1F1E0",
",+ c #E8E8DD",
"'+ c #2424BB",
")+ c #1010FF",
"!+ c #3434FF",
"~+ c #6161FF",
"{+ c #6969D2",
"]+ c #EFEFF0",
"^+ c #C2C2BA",
"/+ c #1010B6",
"(+ c #0909AC",
"_+ c #A4A49A",
":+ c #EAEADE",
"<+ c #2525B8",
"[+ c #2F2FFF",
"}+ c #3C3CB5",
"|+ c #EEEEEE",
"1+ c #BBBBAD",
"2+ c #0B0B56",
"3+ c #0B0BFC",
"4+ c #1212EF",
"5+ c #0C0C3E",
"6+ c #919187",
"7+ c #DEDED6",
"8+ c #1F1FC0",
"9+ c #1A1AFF",
"0+ c #1717FA",
"a+ c #1515F8",
"b+ c #1111FC",
"c+ c #494992",
"d+ c #999998",
"e+ c #3E3E3B",
"f+ c #3C3C99",
"g+ c #535397",
"h+ c #5A5A4D",
"i+ c #6F6F70",
"j+ c #BFBFC9",
"k+ c #1111D6",
"l+ c #1515F1",
"m+ c #0F0FE2",
"n+ c #0D0DD9",
"o+ c #0909CD",
"p+ c #0808C7",
"q+ c #0505C7",
"r+ c #0303CB",
"s+ c #0101C0",
"t+ c #0202AF",
"u+ c #0606AC",
"v+ c #121283",
"w+ c #BBBBBB",
"x+ c #BEBEBE",
"y+ c #2F2F2E",
"z+ c #C7C8BB",
"A+ c #D8DAD1",
"B+ c #272828",
"C+ c #929292",
"D+ c #8688C7",
"E+ c #0506F6",
"F+ c #1616F5",
"G+ c #0B0BD3",
"H+ c #0202B6",
"I+ c #0000AF",
"J+ c #0000B4",
"K+ c #0000BD",
"L+ c #0000BB",
"M+ c #00009E",
"N+ c #2C2C7E",
"O+ c #6A6A8B",
"P+ c #959595",
"Q+ c #F0F0F1",
"R+ c #E1E1E1",
"S+ c #8C8E90",
"T+ c #BEBEBF",
"U+ c #C9C7C5",
"V+ c #939699",
"W+ c #E7EAED",
"X+ c #CBCBC7",
"Y+ c #413B9B",
"Z+ c #0607DD",
"`+ c #0C0CE2",
" @ c #0303B9",
".@ c #0000A8",
"+@ c #181888",
"@@ c #6A6A6A",
"#@ c #626263",
"$@ c #4B4B4C",
"%@ c #3E3B36",
"&@ c #9B805C",
"*@ c #D9B07D",
"=@ c #C9AE89",
"-@ c #B9AF9E",
";@ c #C7C5C4",
">@ c #CBCCCF",
",@ c #C7C6C6",
"'@ c #AEA59A",
")@ c #B69974",
"!@ c #D8B87F",
"~@ c #9B8272",
"{@ c #0E0B9B",
"]@ c #0000B7",
"^@ c #0000B8",
"/@ c #000082",
"(@ c #00007A",
"_@ c #636379",
":@ c #62533E",
"<@ c #B59B6C",
"[@ c #DEB07B",
"}@ c #FECC90",
"|@ c #FFCE92",
"1@ c #FEC98C",
"2@ c #F1BD82",
"3@ c #D1A979",
"4@ c #BC9E73",
"5@ c #CCA777",
"6@ c #EAB980",
"7@ c #FFCD90",
"8@ c #FFD595",
"9@ c #FDD782",
"0@ c #413678",
"a@ c #0000AE",
"b@ c #000077",
"c@ c #010193",
"d@ c #0C0CE4",
"e@ c #38389E",
"f@ c #EEC585",
"g@ c #FFDA9D",
"h@ c #FFC992",
"i@ c #FFC88F",
"j@ c #FFC990",
"k@ c #FFCE93",
"l@ c #FFD094",
"m@ c #FFCC92",
"n@ c #C9A174",
"o@ c #EDBD88",
"p@ c #FAD287",
"q@ c #3A2F7F",
"r@ c #0000BA",
"s@ c #0000B0",
"t@ c #0101B2",
"u@ c #1111ED",
"v@ c #1919C1",
"w@ c #95887C",
"x@ c #DCAC6E",
"y@ c #FFD393",
"z@ c #FFCD94",
"A@ c #FFCA93",
"B@ c #FFC991",
"C@ c #FFC78E",
"D@ c #FFCB91",
"E@ c #E0B581",
"F@ c #BB9A6F",
"G@ c #FFDC97",
"H@ c #C1A173",
"I@ c #0E0B9A",
"J@ c #0000B5",
"K@ c #0101B6",
"L@ c #1010E0",
"M@ c #1616EC",
"N@ c #A68156",
"O@ c #E7AC6B",
"P@ c #FFC582",
"Q@ c #FFCF8F",
"R@ c #FFD195",
"S@ c #FFD296",
"T@ c #FFD396",
"U@ c #FFD193",
"V@ c #FFD28F",
"W@ c #D2A96B",
"X@ c #2F2482",
"Y@ c #0000C1",
"Z@ c #0000C0",
"`@ c #0000BF",
" # c #0101BF",
".# c #1212F0",
"+# c #767698",
"@# c #9C866E",
"## c #A9865D",
"$# c #C0915D",
"%# c #C89760",
"&# c #C29360",
"*# c #AD8A61",
"=# c #9D8971",
"-# c #7F7A7A",
";# c #70708F",
"># c #6F6F91",
",# c #575788",
"'# c #464687",
")# c #2F2F87",
"!# c #15158F",
"~# c #0101A8",
"{# c #1313FB",
"]# c #57579F",
"^# c #343487",
"/# c #434388",
" ",
" ",
" ",
" . + @ # ",
" $ % & * = - ; > , ' ) ! ",
" ~ { ] ^ / = ( _ : < [ } | 1 2 3 4 5 6 ",
" 7 8 9 0 a b c d e f g h i j k l m n o p q r ",
" s t u v _ f d d d w x y z A B C D E F G H I J K L ",
" M N O _ c e d d d _ P Q R S T U V W X Y Z ` ... ",
" +.@.#.$.d d d d %.&._ *.=.-.;.>.,.'.).!.~. ",
" {.].^./.(.d d _.$.:._ <.[.}.|.1.2.3.4.5. ",
" 6.7.7.4 8.e : w 9.0.a.b.c.2 d.e.f.g.h.i.j.k. ",
" l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.o o z.A.B./.b C.D. ",
" E.F.G.].o H.z.I.J.K.L.M.N.O.P.o o o Q.R.S._.b B.T. ",
" U.V.W.X.f.f.7.Y.Z.`. + + +.+++].o o o.n z.q.@+#+$+%+ ",
" &+ +*+=+].o -+;+>+ + + + +,+'+H.o o o o o H.)+o !+~+{+ ",
" ]+ +^+/+H.o.(+_+ + + + + +:+<+z.o o o o o o o 7.n H.[+}+ ",
" |+ +1+2+3+4+5+6+ + + + + +7+8+H.o o f.9+f.9+f.F 0+a+b+o.c+ ",
" &+ +d+e+f+g+h+i+ + + + + +j+k+].f.9+l+m+n+o+p+q+r+s+t+u+v+ ",
" w+ +x+y+z+A+B+C+ + + + + +D+E+9+F+G+H+I+J+K+L+M+N+O+ ",
" P+Q+R+S+T+U+V+W+ + + + +X+Y+Z+`+ @I+J+Z .@+@E. ",
" @@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@I+/@(@_@ ",
" :@<@[@}@|@1@2@3@4@5@6@7@8@9@0@L+a@b@c@d@e@ ",
" f@g@h@i@i@j@k@l@|@m@n@o@p@q@r@s@t@u@p v@ ",
" w@x@y@z@A@B@i@C@D@E@F@G@H@I@L+J@K@L@p M@ ",
" N@O@P@Q@R@S@T@U@V@W@X@Y@Z@Y@`@ #.#p +# ",
" @###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]# ",
" ^#/# ",
" ",
" ",
" ",
" "};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View file

@ -2759,8 +2759,8 @@ static const char *locateWad(void)
if (isWadPathOk(returnWadPath))
return NULL;
#endif
#ifdef CMAKECONFIG
#ifndef NDEBUG
I_OutputMsg(","CMAKE_ASSETS_DIR);
@ -2771,7 +2771,7 @@ static const char *locateWad(void)
}
#endif
#endif
#ifdef __APPLE__
OSX_GetResourcesPath(returnWadPath);
I_OutputMsg(",%s", returnWadPath);
@ -2779,7 +2779,7 @@ static const char *locateWad(void)
{
return returnWadPath;
}
#endif
// examine default dirs

View file

@ -1,80 +1,425 @@
/* XPM */
static const char * SDL_icon_xpm[] = {
"32 32 45 1",
" c None",
". c #6B6BFF",
"+ c #3D00B9",
"@ c #4848FF",
"# c #2525FF",
"$ c #310096",
"% c #003196",
"& c #003DB9",
"* c #620096",
"= c #6E6E6E",
"- c #966200",
"; c #250073",
"> c #626262",
", c #FF8F6B",
"' c #FFC66B",
") c #FFAB8E",
"! c #000080",
"~ c #B6B6B6",
"{ c #929292",
"] c #FFD48E",
"^ c #0000B9",
"/ c #565656",
"( c #868686",
"_ c #808080",
": c #C0C0C0",
"< c #DADADA",
"[ c #F2F2F2",
"} c #FFFFFF",
"| c #CECECE",
"1 c #AAAAAA",
"2 c #E6E6E6",
"3 c #000096",
"4 c #AB8EFF",
"5 c #190050",
"6 c #000000",
"7 c #8E8EFF",
"8 c #3E3E3E",
"9 c #7A7A7A",
"0 c #0E0E0E",
"a c #9E9E9E",
"b c #001950",
"c c #C2C2C2",
"d c #323232",
"e c #002573",
"f c #A0A0A4",
" ",
" ",
" ",
" .+@##@. ",
" @@.@#######@ ",
" @@....######### ",
" .. .@.....@+##$%%%&&% ",
" ..@# @@....@+#*=-;%%%%% ",
" ..@#@......@>,')!%%%$ ",
" ~..$#.........{])^#+%/ ",
" +##@.........()^@@@@@_ ",
" $####@........#=#######+ ",
" +######....@@##^#########_ ",
" +#####=:<<:+##############/ ",
"[<=####{<}}}}|###############= ",
" }1###=2}}}}}}.############### ",
" }<3#3~}}}}}}}4################ ",
" }<5#6:}}}}}}}7################/",
" }:6861}}}}}}}.########$$ 9 .@$",
" }:0a6~}}}}}}}@######5b ",
"22cd262}}}}}}2######5b$ ",
" 2>1a}}}}}}}{(*###%be## ",
" 860)1<[22c1)]]+##be### ",
" ~)]]]))))]]]]]=#bb#### ",
" )]]]]]]]]](]]=eb$#### ",
" :]]]]]]]]]'9bbb$##### ",
" ),'''''( >db+### ",
" =##f ",
" { ",
" ",
" ",
" "};
static char * C:\Repo\srb2\src\sdl\SDL_icon_xpm[] = {
"32 32 390 2",
" c None",
". c #4F4F70",
"+ c #4D4D87",
"@ c #4D4D84",
"# c #4E4E6C",
"$ c #6C6C95",
"% c #5E5EB2",
"& c #6B6BE7",
"* c #7373F9",
"= c #7C7CFF",
"- c #6F70E7",
"; c #494BB2",
"> c #4F4FA3",
", c #6464D4",
"' c #7979F5",
") c #5F5FCA",
"! c #5D5D93",
"~ c #3A3A9F",
"{ c #6060AC",
"] c #777793",
"^ c #5C5CB3",
"/ c #7373EA",
"( c #7A7AFF",
"_ c #7575FF",
": c #7979FF",
"< c #6264DD",
"[ c #47478C",
"} c #564567",
"| c #4647D0",
"1 c #5C5CAE",
"2 c #5E5EFF",
"3 c #2929FF",
"4 c #1D1DFF",
"5 c #1919D1",
"6 c #4F4F90",
"7 c #1E1ECE",
"8 c #5858FF",
"9 c #6767A8",
"0 c #4949A0",
"a c #7070FB",
"b c #7D7DFF",
"c c #7777FF",
"d c #7373FF",
"e c #7272FF",
"f c #7878FF",
"g c #6465D8",
"h c #363886",
"i c #9F7655",
"j c #C89B5C",
"k c #1D1CB7",
"l c #3031B1",
"m c #1919F4",
"n c #1111FF",
"o c #1818FF",
"p c #1B1BFF",
"q c #1C1CFF",
"r c #2626B3",
"s c #1E1EC8",
"t c #1A1AE8",
"u c #24249F",
"v c #2F2FD2",
"w c #7676FF",
"x c #6869E2",
"y c #414290",
"z c #8C6751",
"A c #FCBA68",
"B c #E9BD7D",
"C c #201EB8",
"D c #090AB8",
"E c #1616EB",
"F c #1818FD",
"G c #1414EE",
"H c #1010E1",
"I c #0E0EE2",
"J c #0E0EF4",
"K c #0606B2",
"L c #7A7A89",
"M c #0C0C9A",
"N c #0A0AA7",
"O c #2424E4",
"P c #6669E6",
"Q c #4F4A8F",
"R c #BF853B",
"S c #FFD98D",
"T c #CDAB76",
"U c #1717C4",
"V c #0F10BA",
"W c #0909B6",
"X c #0505C3",
"Y c #0000B6",
"Z c #0000BE",
"` c #0000AD",
" . c #1D1D83",
".. c #63638E",
"+. c #090975",
"@. c #1414F3",
"#. c #5B5BFF",
"$. c #7B7BFF",
"%. c #7070FF",
"&. c #6E6EFF",
"*. c #7172F6",
"=. c #625DAF",
"-. c #BA9E6C",
";. c #887167",
">. c #090DF2",
",. c #1313BE",
"'. c #000085",
"). c #0000AC",
"!. c #0202AA",
"~. c #242488",
"{. c #1414C7",
"]. c #1717FF",
"^. c #5959FF",
"/. c #7F7FFF",
"(. c #7474FF",
"_. c #7171FF",
":. c #8686FF",
"<. c #7574FF",
"[. c #797CFF",
"}. c #5756B8",
"|. c #1C19A4",
"1. c #1617FF",
"2. c #1212BD",
"3. c #040485",
"4. c #0707A4",
"5. c #1B1B71",
"6. c #373797",
"7. c #1616FF",
"8. c #5050FF",
"9. c #8080FF",
"0. c #AAAAFF",
"a. c #AEAEF6",
"b. c #8A8AEF",
"c. c #6969FB",
"d. c #2728FF",
"e. c #1314FF",
"f. c #1919FF",
"g. c #1313E8",
"h. c #1F1FF4",
"i. c #5454FF",
"j. c #6D6DF0",
"k. c #6868B5",
"l. c #0B0BB8",
"m. c #1212C5",
"n. c #1616FC",
"o. c #1515FF",
"p. c #1212FF",
"q. c #2323FF",
"r. c #3636FF",
"s. c #4040FF",
"t. c #4343F9",
"u. c #5D5DB8",
"v. c #7F7F92",
"w. c #878793",
"x. c #4B4B94",
"y. c #0B0CE2",
"z. c #1313FF",
"A. c #4C4CFF",
"B. c #8282FF",
"C. c #7171ED",
"D. c #636394",
"E. c #575785",
"F. c #A9A99C",
"G. c #1414BC",
"H. c #1414FF",
"I. c #0707FD",
"J. c #2525AA",
"K. c #A8A8A4",
"L. c #EBEBE2",
"M. c #F9F9F2",
"N. c #E1E1CC",
"O. c #4D4D9F",
"P. c #0B0BF7",
"Q. c #2121FF",
"R. c #3232FF",
"S. c #5555FF",
"T. c #6161B4",
"U. c #B5B5B2",
"V. c #FFFFF8",
"W. c #4F4F9A",
"X. c #0B0BF5",
"Y. c #1616C5",
"Z. c #A8A8A1",
"`. c #FFFFFC",
" + c #FFFFFF",
".+ c #C0C0C4",
"++ c #1212D4",
"@+ c #4444FF",
"#+ c #6464FF",
"$+ c #8383FF",
"%+ c #6767C3",
"&+ c #E4E4E4",
"*+ c #9494AE",
"=+ c #0808DF",
"-+ c #0D0DF2",
";+ c #61619A",
">+ c #F1F1E0",
",+ c #E8E8DD",
"'+ c #2424BB",
")+ c #1010FF",
"!+ c #3434FF",
"~+ c #6161FF",
"{+ c #6969D2",
"]+ c #EFEFF0",
"^+ c #C2C2BA",
"/+ c #1010B6",
"(+ c #0909AC",
"_+ c #A4A49A",
":+ c #EAEADE",
"<+ c #2525B8",
"[+ c #2F2FFF",
"}+ c #3C3CB5",
"|+ c #EEEEEE",
"1+ c #BBBBAD",
"2+ c #0B0B56",
"3+ c #0B0BFC",
"4+ c #1212EF",
"5+ c #0C0C3E",
"6+ c #919187",
"7+ c #DEDED6",
"8+ c #1F1FC0",
"9+ c #1A1AFF",
"0+ c #1717FA",
"a+ c #1515F8",
"b+ c #1111FC",
"c+ c #494992",
"d+ c #999998",
"e+ c #3E3E3B",
"f+ c #3C3C99",
"g+ c #535397",
"h+ c #5A5A4D",
"i+ c #6F6F70",
"j+ c #BFBFC9",
"k+ c #1111D6",
"l+ c #1515F1",
"m+ c #0F0FE2",
"n+ c #0D0DD9",
"o+ c #0909CD",
"p+ c #0808C7",
"q+ c #0505C7",
"r+ c #0303CB",
"s+ c #0101C0",
"t+ c #0202AF",
"u+ c #0606AC",
"v+ c #121283",
"w+ c #BBBBBB",
"x+ c #BEBEBE",
"y+ c #2F2F2E",
"z+ c #C7C8BB",
"A+ c #D8DAD1",
"B+ c #272828",
"C+ c #929292",
"D+ c #8688C7",
"E+ c #0506F6",
"F+ c #1616F5",
"G+ c #0B0BD3",
"H+ c #0202B6",
"I+ c #0000AF",
"J+ c #0000B4",
"K+ c #0000BD",
"L+ c #0000BB",
"M+ c #00009E",
"N+ c #2C2C7E",
"O+ c #6A6A8B",
"P+ c #959595",
"Q+ c #F0F0F1",
"R+ c #E1E1E1",
"S+ c #8C8E90",
"T+ c #BEBEBF",
"U+ c #C9C7C5",
"V+ c #939699",
"W+ c #E7EAED",
"X+ c #CBCBC7",
"Y+ c #413B9B",
"Z+ c #0607DD",
"`+ c #0C0CE2",
" @ c #0303B9",
".@ c #0000A8",
"+@ c #181888",
"@@ c #6A6A6A",
"#@ c #626263",
"$@ c #4B4B4C",
"%@ c #3E3B36",
"&@ c #9B805C",
"*@ c #D9B07D",
"=@ c #C9AE89",
"-@ c #B9AF9E",
";@ c #C7C5C4",
">@ c #CBCCCF",
",@ c #C7C6C6",
"'@ c #AEA59A",
")@ c #B69974",
"!@ c #D8B87F",
"~@ c #9B8272",
"{@ c #0E0B9B",
"]@ c #0000B7",
"^@ c #0000B8",
"/@ c #000082",
"(@ c #00007A",
"_@ c #636379",
":@ c #62533E",
"<@ c #B59B6C",
"[@ c #DEB07B",
"}@ c #FECC90",
"|@ c #FFCE92",
"1@ c #FEC98C",
"2@ c #F1BD82",
"3@ c #D1A979",
"4@ c #BC9E73",
"5@ c #CCA777",
"6@ c #EAB980",
"7@ c #FFCD90",
"8@ c #FFD595",
"9@ c #FDD782",
"0@ c #413678",
"a@ c #0000AE",
"b@ c #000077",
"c@ c #010193",
"d@ c #0C0CE4",
"e@ c #38389E",
"f@ c #EEC585",
"g@ c #FFDA9D",
"h@ c #FFC992",
"i@ c #FFC88F",
"j@ c #FFC990",
"k@ c #FFCE93",
"l@ c #FFD094",
"m@ c #FFCC92",
"n@ c #C9A174",
"o@ c #EDBD88",
"p@ c #FAD287",
"q@ c #3A2F7F",
"r@ c #0000BA",
"s@ c #0000B0",
"t@ c #0101B2",
"u@ c #1111ED",
"v@ c #1919C1",
"w@ c #95887C",
"x@ c #DCAC6E",
"y@ c #FFD393",
"z@ c #FFCD94",
"A@ c #FFCA93",
"B@ c #FFC991",
"C@ c #FFC78E",
"D@ c #FFCB91",
"E@ c #E0B581",
"F@ c #BB9A6F",
"G@ c #FFDC97",
"H@ c #C1A173",
"I@ c #0E0B9A",
"J@ c #0000B5",
"K@ c #0101B6",
"L@ c #1010E0",
"M@ c #1616EC",
"N@ c #A68156",
"O@ c #E7AC6B",
"P@ c #FFC582",
"Q@ c #FFCF8F",
"R@ c #FFD195",
"S@ c #FFD296",
"T@ c #FFD396",
"U@ c #FFD193",
"V@ c #FFD28F",
"W@ c #D2A96B",
"X@ c #2F2482",
"Y@ c #0000C1",
"Z@ c #0000C0",
"`@ c #0000BF",
" # c #0101BF",
".# c #1212F0",
"+# c #767698",
"@# c #9C866E",
"## c #A9865D",
"$# c #C0915D",
"%# c #C89760",
"&# c #C29360",
"*# c #AD8A61",
"=# c #9D8971",
"-# c #7F7A7A",
";# c #70708F",
"># c #6F6F91",
",# c #575788",
"'# c #464687",
")# c #2F2F87",
"!# c #15158F",
"~# c #0101A8",
"{# c #1313FB",
"]# c #57579F",
"^# c #343487",
"/# c #434388",
" ",
" ",
" ",
" . + @ # ",
" $ % & * = - ; > , ' ) ! ",
" ~ { ] ^ / = ( _ : < [ } | 1 2 3 4 5 6 ",
" 7 8 9 0 a b c d e f g h i j k l m n o p q r ",
" s t u v _ f d d d w x y z A B C D E F G H I J K L ",
" M N O _ c e d d d _ P Q R S T U V W X Y Z ` ... ",
" +.@.#.$.d d d d %.&._ *.=.-.;.>.,.'.).!.~. ",
" {.].^./.(.d d _.$.:._ <.[.}.|.1.2.3.4.5. ",
" 6.7.7.4 8.e : w 9.0.a.b.c.2 d.e.f.g.h.i.j.k. ",
" l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.o o z.A.B./.b C.D. ",
" E.F.G.].o H.z.I.J.K.L.M.N.O.P.o o o Q.R.S._.b B.T. ",
" U.V.W.X.f.f.7.Y.Z.`. + + +.+++].o o o.n z.q.@+#+$+%+ ",
" &+ +*+=+].o -+;+>+ + + + +,+'+H.o o o o o H.)+o !+~+{+ ",
" ]+ +^+/+H.o.(+_+ + + + + +:+<+z.o o o o o o o 7.n H.[+}+ ",
" |+ +1+2+3+4+5+6+ + + + + +7+8+H.o o f.9+f.9+f.F 0+a+b+o.c+ ",
" &+ +d+e+f+g+h+i+ + + + + +j+k+].f.9+l+m+n+o+p+q+r+s+t+u+v+ ",
" w+ +x+y+z+A+B+C+ + + + + +D+E+9+F+G+H+I+J+K+L+M+N+O+ ",
" P+Q+R+S+T+U+V+W+ + + + +X+Y+Z+`+ @I+J+Z .@+@E. ",
" @@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@I+/@(@_@ ",
" :@<@[@}@|@1@2@3@4@5@6@7@8@9@0@L+a@b@c@d@e@ ",
" f@g@h@i@i@j@k@l@|@m@n@o@p@q@r@s@t@u@p v@ ",
" w@x@y@z@A@B@i@C@D@E@F@G@H@I@L+J@K@L@p M@ ",
" N@O@P@Q@R@S@T@U@V@W@X@Y@Z@Y@`@ #.#p +# ",
" @###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]# ",
" ^#/# ",
" ",
" ",
" ",
" "};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View file

@ -1590,7 +1590,7 @@ static void ST_drawSpecialStageHUD(void)
if (sstimer)
{
V_DrawString(hudinfo[HUD_TIMELEFT].x, STRINGY(hudinfo[HUD_TIMELEFT].y), V_HUDTRANS, M_GetText("TIME LEFT"));
ST_DrawNightsOverlayNum(SCX(hudinfo[HUD_TIMELEFTNUM].x), SCY(hudinfo[HUD_TIMELEFTNUM].y), V_HUDTRANS, sstimer/TICRATE, tallnum, SKINCOLOR_WHITE);
ST_DrawNumFromHud(HUD_TIMELEFTNUM, sstimer/TICRATE);
}
else
ST_DrawPatchFromHud(HUD_TIMEUP, timeup);

View file

@ -635,7 +635,7 @@ void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skin
V_DrawScaledPatch(x - 10, y - 14, flags, W_CachePatchName("CONTINS", PU_CACHE));
else
{
spriteframe_t *sprframe = &skins[skinnum].spritedef.spriteframes[2 & FF_FRAMEMASK];
spriteframe_t *sprframe = &skins[skinnum].sprites[SPR2_WAIT].spriteframes[0];
patch_t *patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
const UINT8 *colormap = R_GetTranslationColormap(skinnum, skincolor, GTC_CACHE);

View file

@ -413,6 +413,7 @@ UINT16 W_LoadWadFile(const char *filename)
lump_p->disksize -= 4;
}
else lump_p->compressed = 0;
memset(lump_p->name, 0x00, 9);
strncpy(lump_p->name, fileinfo->name, 8);
}
free(fileinfov);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 364 KiB