From af9164f336a65634f6908e677b47773d88f583af Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sat, 22 Feb 2020 02:17:21 +0100 Subject: [PATCH 01/47] Improve join refusal handling --- src/d_clisrv.c | 81 ++++++++++++++++++++++++++++++-------------------- src/d_clisrv.h | 3 +- src/m_menu.c | 2 +- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 77118110e..ef0c0c33e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1289,6 +1289,37 @@ static boolean CL_SendJoin(void) return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak)); } +static INT32 FindRejoinerNum(SINT8 node) +{ + char strippednodeaddress[64]; + const char *nodeaddress; + char *port; + INT32 i; + + // Make sure there is no dead dress before proceeding to the stripping + if (!I_GetNodeAddress) + return -1; + nodeaddress = I_GetNodeAddress(node); + if (!nodeaddress) + return -1; + + // Strip the address of its port + strcpy(strippednodeaddress, nodeaddress); + port = strchr(strippednodeaddress, ':'); + if (port) + *port = '\0'; + + // Check if any player matches the stripped address + for (i = 0; i < MAXPLAYERS; i++) + { + if (playeringame[i] && playeraddress[i][0] && playernode[i] == UINT8_MAX + && !strcmp(playeraddress[i], strippednodeaddress)) + return i; + } + + return -1; +} + static void SV_SendServerInfo(INT32 node, tic_t servertime) { UINT8 *p; @@ -1306,6 +1337,16 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers(); netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value; + + if (FindRejoinerNum(node) != -1) + netbuffer->u.serverinfo.refusereason = 0; + else if (!cv_allownewplayer.value) + netbuffer->u.serverinfo.refusereason = 1; + else if (D_NumPlayers() >= cv_maxplayers.value) + netbuffer->u.serverinfo.refusereason = 2; + else + netbuffer->u.serverinfo.refusereason = 0; + strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype], sizeof netbuffer->u.serverinfo.gametypename); netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame; @@ -1863,12 +1904,17 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) } // Quit here rather than downloading files and being refused later. - if (serverlist[i].info.numberofplayer >= serverlist[i].info.maxplayer) + if (serverlist[i].info.refusereason) { D_QuitNetGame(); CL_Reset(); D_StartTitle(); - M_StartMessage(va(M_GetText("Maximum players reached: %d\n\nPress ESC\n"), serverlist[i].info.maxplayer), NULL, MM_NOTHING); + if (serverlist[i].info.refusereason == 1) + M_StartMessage(M_GetText("The server is not accepting\njoins for the moment.\n\nPress ESC\n"), NULL, MM_NOTHING); + else if (serverlist[i].info.refusereason == 2) + M_StartMessage(va(M_GetText("Maximum players reached: %d\n\nPress ESC\n"), serverlist[i].info.maxplayer), NULL, MM_NOTHING); + else + M_StartMessage(M_GetText("You can't join.\nI don't know why,\nbut you can't join.\n\nPress ESC\n"), NULL, MM_NOTHING); return false; } @@ -3230,37 +3276,6 @@ void D_QuitNetGame(void) #endif } -static INT32 FindRejoinerNum(SINT8 node) -{ - char strippednodeaddress[64]; - const char *nodeaddress; - char *port; - INT32 i; - - // Make sure there is no dead dress before proceeding to the stripping - if (!I_GetNodeAddress) - return -1; - nodeaddress = I_GetNodeAddress(node); - if (!nodeaddress) - return -1; - - // Strip the address of its port - strcpy(strippednodeaddress, nodeaddress); - port = strchr(strippednodeaddress, ':'); - if (port) - *port = '\0'; - - // Check if any player matches the stripped address - for (i = 0; i < MAXPLAYERS; i++) - { - if (playeringame[i] && playeraddress[i][0] && playernode[i] == UINT8_MAX - && !strcmp(playeraddress[i], strippednodeaddress)) - return i; - } - - return -1; -} - // Adds a node to the game (player will follow at map change or at savegame....) static inline void SV_AddNode(INT32 node) { diff --git a/src/d_clisrv.h b/src/d_clisrv.h index df93fe31d..8cea2f00a 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -27,7 +27,7 @@ This version is independent of the mod name, and standard version and subversion. It should only account for the basic fields of the packet, and change infrequently. */ -#define PACKETVERSION 2 +#define PACKETVERSION 3 // Network play related stuff. // There is a data struct that stores network @@ -361,6 +361,7 @@ typedef struct UINT8 subversion; UINT8 numberofplayer; UINT8 maxplayer; + UINT8 refusereason; // 0: joinable, 1: joins disabled, 2: full char gametypename[24]; UINT8 modifiedgame; UINT8 cheatsenabled; diff --git a/src/m_menu.c b/src/m_menu.c index 8b564e068..d48714c35 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10366,7 +10366,7 @@ static void M_DrawConnectMenu(void) for (i = 0; i < min(serverlistcount - serverlistpage * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++) { INT32 slindex = i + serverlistpage * SERVERS_PER_PAGE; - UINT32 globalflags = ((serverlist[slindex].info.numberofplayer >= serverlist[slindex].info.maxplayer) ? V_TRANSLUCENT : 0) + UINT32 globalflags = (serverlist[slindex].info.refusereason ? V_TRANSLUCENT : 0) |((itemOn == FIRSTSERVERLINE+i) ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE; V_DrawString(currentMenu->x, S_LINEY(i), globalflags, serverlist[slindex].info.servername); From 778715f6111a1bbf7d2ae874e5490e1b2ae0dbc1 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sat, 22 Feb 2020 02:21:27 +0100 Subject: [PATCH 02/47] Cleanup code a little --- src/d_clisrv.c | 4 ++-- src/d_netcmd.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ef0c0c33e..98eff1cd5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3606,7 +3606,7 @@ static void HandleConnect(SINT8 node) rejoinernum = FindRejoinerNum(node); if (bannednode && bannednode[node]) - SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server")); + SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server.")); else if (netbuffer->u.clientcfg._255 != 255 || netbuffer->u.clientcfg.packetversion != PACKETVERSION) SV_SendRefuse(node, "Incompatible packet formats."); @@ -3617,7 +3617,7 @@ static void HandleConnect(SINT8 node) || netbuffer->u.clientcfg.subversion != SUBVERSION) SV_SendRefuse(node, va(M_GetText("Different SRB2 versions cannot\nplay a netgame!\n(server version %d.%d.%d)"), VERSION/100, VERSION%100, SUBVERSION)); else if (!cv_allownewplayer.value && node && rejoinernum == -1) - SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment")); + SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment.")); else if (D_NumPlayers() >= cv_maxplayers.value && rejoinernum == -1) SV_SendRefuse(node, va(M_GetText("Maximum players reached: %d"), cv_maxplayers.value)); else if (netgame && netbuffer->u.clientcfg.localplayers > 1) // Hacked client? diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 623a83c47..b619621c6 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3342,10 +3342,6 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) boolean kick = false; boolean toomany = false; INT32 i,j; - serverinfo_pak *dummycheck = NULL; - - // Shut the compiler up. - (void)dummycheck; READSTRINGN(*cp, filename, 240); READMEM(*cp, md5sum, 16); From d19fe295e0556a49c3f5c37df1e2b379a961611e Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sat, 22 Feb 2020 15:08:17 +0100 Subject: [PATCH 03/47] Fix buffer overrun with nodeless players --- src/d_clisrv.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 98eff1cd5..eda6f9c67 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2485,14 +2485,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason) if (!playeringame[playernum]) return; - if (server && !demoplayback) + if (server && !demoplayback && playernode[playernum] != UINT8_MAX) { INT32 node = playernode[playernum]; playerpernode[node]--; if (playerpernode[node] <= 0) { - nodeingame[playernode[playernum]] = false; - Net_CloseConnection(playernode[playernum]); + nodeingame[node] = false; + Net_CloseConnection(node); ResetNode(node); } } @@ -2838,16 +2838,13 @@ static void Command_Kick(void) if (pn == -1 || pn == 0) return; - if (server) + // Special case if we are trying to kick a player who is downloading the game state: + // trigger a timeout instead of kicking them, because a kick would only + // take effect after they have finished downloading + if (server && playernode[pn] != UINT8_MAX && sendingsavegame[playernode[pn]]) { - // Special case if we are trying to kick a player who is downloading the game state: - // trigger a timeout instead of kicking them, because a kick would only - // take effect after they have finished downloading - if (sendingsavegame[playernode[pn]]) - { - Net_ConnectionTimeout(playernode[pn]); - return; - } + Net_ConnectionTimeout(playernode[pn]); + return; } WRITESINT8(p, pn); @@ -2905,7 +2902,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) // Is playernum authorized to make this kick? if (playernum != serverplayer && !IsPlayerAdmin(playernum) - && !(playerpernode[playernode[playernum]] == 2 + && !(playernode[playernum] != UINT8_MAX && playerpernode[playernode[playernum]] == 2 && nodetoplayer2[playernode[playernum]] == pnum)) { // We received a kick command from someone who isn't the @@ -3064,7 +3061,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) } else if (keepbody) { - if (server && !demoplayback) + if (server && !demoplayback && playernode[pnum] != UINT8_MAX) { INT32 node = playernode[pnum]; playerpernode[node]--; @@ -4956,7 +4953,7 @@ void NetUpdate(void) PingUpdate(); // update node latency values so we can take an average later. for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]) + if (playeringame[i] && playernode[i] != UINT8_MAX) realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i])); pingmeasurecount++; } From 0362f53e9b9561a6cfb7408301ab80f88de9dcc8 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 23 Feb 2020 12:14:52 -0300 Subject: [PATCH 04/47] Fix incorrect newdisplayplayer in forced ViewpointSwitch --- src/d_clisrv.c | 2 +- src/d_netcmd.c | 6 +++--- src/g_game.c | 2 +- src/p_user.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f5fea366f..a4e1ba423 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2513,7 +2513,7 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason) #ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. - LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], true); + LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); #endif displayplayer = consoleplayer; } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c25929929..95cb9291f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2843,7 +2843,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal. - LUAh_ViewpointSwitch(&players[playernum], &players[displayplayer], true); + LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); #endif displayplayer = consoleplayer; } @@ -3753,11 +3753,11 @@ static void ExitMove_OnChange(void) { if (players[i].mo->target && players[i].mo->target->type == MT_SIGN) P_SetTarget(&players[i].mo->target, NULL); - + if (players[i].pflags & PF_FINISHED) P_GiveFinishFlags(&players[i]); } - + CONS_Printf(M_GetText("Players can now move after completing the level.\n")); } else diff --git a/src/g_game.c b/src/g_game.c index 08192bfb8..3eeb2fa2b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1718,7 +1718,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) #ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. - LUAh_ViewpointSwitch(player, &players[displayplayer], true); + LUAh_ViewpointSwitch(player, &players[consoleplayer], true); #endif displayplayer = consoleplayer; } diff --git a/src/p_user.c b/src/p_user.c index 880d932af..9b0be6e53 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -392,7 +392,7 @@ void P_GiveFinishFlags(player_t *player) mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); flag->angle = angle; angle += FixedAngle(120*FRACUNIT); - + P_SetTarget(&flag->target, player->mo); } } @@ -10650,7 +10650,7 @@ boolean P_SpectatorJoinGame(player_t *player) #ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. - LUAh_ViewpointSwitch(player, &players[displayplayer], true); + LUAh_ViewpointSwitch(player, &players[consoleplayer], true); #endif displayplayer = consoleplayer; } @@ -10699,7 +10699,7 @@ boolean P_SpectatorJoinGame(player_t *player) #ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. - LUAh_ViewpointSwitch(player, &players[displayplayer], true); + LUAh_ViewpointSwitch(player, &players[consoleplayer], true); #endif displayplayer = consoleplayer; } From 283bb52e7d381a85bd8026a9fabf8e7daf150bdf Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 23 Feb 2020 12:45:43 -0600 Subject: [PATCH 05/47] Disable NOHUD/INLEVEL checks on Lua sound functions None of these are implicitly sync-safe anyway, and most have no need to be walled off from HUD code or intermission thinkers. --- src/lua_baselib.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 03f142446..e41f81674 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1675,8 +1675,8 @@ static int lib_pPlayVictorySound(lua_State *L) static int lib_pPlayLivesJingle(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - NOHUD - INLEVEL + //NOHUD + //INLEVEL if (!player) return LUA_ErrInvalid(L, "player_t"); P_PlayLivesJingle(player); @@ -2342,7 +2342,7 @@ static int lib_sStartSound(lua_State *L) const void *origin = NULL; sfxenum_t sound_id = luaL_checkinteger(L, 2); player_t *player = NULL; - //NOHUD // kys @whoever did this. + //NOHUD if (sound_id >= NUMSFX) return luaL_error(L, "sfx %d out of range (0 - %d)", sound_id, NUMSFX-1); if (!lua_isnil(L, 1)) @@ -2373,7 +2373,7 @@ static int lib_sStartSoundAtVolume(lua_State *L) sfxenum_t sound_id = luaL_checkinteger(L, 2); INT32 volume = (INT32)luaL_checkinteger(L, 3); player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnil(L, 1)) { @@ -2397,7 +2397,7 @@ static int lib_sStartSoundAtVolume(lua_State *L) static int lib_sStopSound(lua_State *L) { void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); - NOHUD + //NOHUD if (!origin) return LUA_ErrInvalid(L, "mobj_t"); S_StopSound(origin); @@ -2414,7 +2414,7 @@ static int lib_sChangeMusic(lua_State *L) boolean looping; player_t *player = NULL; UINT16 music_flags = 0; - NOHUD + //NOHUD if (lua_isnumber(L, 1)) { @@ -2443,7 +2443,7 @@ static int lib_sChangeMusic(lua_State *L) boolean looping = (boolean)lua_opttrueboolean(L, 2); player_t *player = NULL; UINT16 music_flags = 0; - NOHUD + //NOHUD #endif if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) @@ -2474,7 +2474,7 @@ static int lib_sSpeedMusic(lua_State *L) fixed_t fixedspeed = luaL_checkfixed(L, 1); float speed = FIXED_TO_FLOAT(fixedspeed); player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 2) && lua_isuserdata(L, 2)) { player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); @@ -2489,7 +2489,7 @@ static int lib_sSpeedMusic(lua_State *L) static int lib_sStopMusic(lua_State *L) { player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) { player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2505,7 +2505,7 @@ static int lib_sSetInternalMusicVolume(lua_State *L) { UINT32 volume = (UINT32)luaL_checkinteger(L, 1); player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 2) && lua_isuserdata(L, 2)) { player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); @@ -2525,7 +2525,7 @@ static int lib_sSetInternalMusicVolume(lua_State *L) static int lib_sStopFadingMusic(lua_State *L) { player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) { player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2548,7 +2548,7 @@ static int lib_sFadeMusic(lua_State *L) UINT32 ms; INT32 source_volume; player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) { player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER)); @@ -2576,8 +2576,6 @@ static int lib_sFadeMusic(lua_State *L) ms = (UINT32)luaL_checkinteger(L, 3); } - NOHUD - if (!player || P_IsLocalPlayer(player)) lua_pushboolean(L, S_FadeMusicFromVolume(target_volume, source_volume, ms)); else @@ -2589,7 +2587,7 @@ static int lib_sFadeOutStopMusic(lua_State *L) { UINT32 ms = (UINT32)luaL_checkinteger(L, 1); player_t *player = NULL; - NOHUD + //NOHUD if (!lua_isnone(L, 2) && lua_isuserdata(L, 2)) { player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); @@ -2608,7 +2606,7 @@ static int lib_sFadeOutStopMusic(lua_State *L) static int lib_sOriginPlaying(lua_State *L) { void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); - NOHUD + //NOHUD INLEVEL if (!origin) return LUA_ErrInvalid(L, "mobj_t"); @@ -2619,7 +2617,7 @@ static int lib_sOriginPlaying(lua_State *L) static int lib_sIdPlaying(lua_State *L) { sfxenum_t id = luaL_checkinteger(L, 1); - NOHUD + //NOHUD if (id >= NUMSFX) return luaL_error(L, "sfx %d out of range (0 - %d)", id, NUMSFX-1); lua_pushboolean(L, S_IdPlaying(id)); @@ -2630,7 +2628,7 @@ static int lib_sSoundPlaying(lua_State *L) { void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); sfxenum_t id = luaL_checkinteger(L, 2); - NOHUD + //NOHUD INLEVEL if (!origin) return LUA_ErrInvalid(L, "mobj_t"); @@ -2648,7 +2646,7 @@ static int lib_sStartMusicCaption(lua_State *L) const char *caption = luaL_checkstring(L, 1); UINT16 lifespan = (UINT16)luaL_checkinteger(L, 2); //HUDSAFE - INLEVEL + //INLEVEL if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) { From 40488096c014153680d00a11d2707381930c9b2d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 23 Feb 2020 15:40:59 -0600 Subject: [PATCH 06/47] Make P_PlayLivesJingle player optional in Lua --- src/lua_baselib.c | 10 +++++++--- src/p_user.c | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index e41f81674..8344fca91 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1674,11 +1674,15 @@ static int lib_pPlayVictorySound(lua_State *L) static int lib_pPlayLivesJingle(lua_State *L) { - player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + player_t *player = NULL; //NOHUD //INLEVEL - if (!player) - return LUA_ErrInvalid(L, "player_t"); + if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) + { + player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } P_PlayLivesJingle(player); return 0; } diff --git a/src/p_user.c b/src/p_user.c index 880d932af..2dcfd872c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -392,7 +392,7 @@ void P_GiveFinishFlags(player_t *player) mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); flag->angle = angle; angle += FixedAngle(120*FRACUNIT); - + P_SetTarget(&flag->target, player->mo); } } @@ -1533,7 +1533,7 @@ void P_PlayJingle(player_t *player, jingletype_t jingletype) void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, boolean looping, UINT16 status) { // If gamestate != GS_LEVEL, always play the jingle (1-up intermission) - if (gamestate == GS_LEVEL && !P_IsLocalPlayer(player)) + if (gamestate == GS_LEVEL && player && !P_IsLocalPlayer(player)) return; S_RetainMusic(musname, musflags, looping, 0, status); From c5f386881988c51b6e7f752516ac55cc1706a815 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 23 Feb 2020 17:19:18 -0600 Subject: [PATCH 07/47] Expose P_PlayJingle/Music() to Lua --- src/lua_baselib.c | 55 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 8344fca91..c360007de 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1040,11 +1040,60 @@ static int lib_pSetObjectMomZ(lua_State *L) return 0; } +static int lib_pPlayJingle(lua_State *L) +{ + player_t *player = NULL; + jingletype_t jingletype = (jingletype_t)luaL_checkinteger(L, 2); + //NOHUD + //INLEVEL + if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) + { + player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } + if (jingletype >= NUMJINGLES) + return luaL_error(L, "jingletype %d out of range (0 - %d)", jingletype, NUMJINGLES-1); + P_PlayJingle(player, jingletype); + return 0; +} + +static int lib_pPlayJingleMusic(lua_State *L) +{ + player_t *player = NULL; + const char *musnamearg = luaL_checkstring(L, 2); + char musname[7], *p = musname; + UINT16 musflags = luaL_optinteger(L, 3, 0); + boolean looping = lua_opttrueboolean(L, 4); + jingletype_t jingletype = (jingletype_t)luaL_optinteger(L, 5, JT_OTHER); + //NOHUD + //INLEVEL + if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) + { + player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } + if (jingletype >= NUMJINGLES) + return luaL_error(L, "jingletype %d out of range (0 - %d)", jingletype, NUMJINGLES-1); + + musname[6] = '\0'; + strncpy(musname, musnamearg, 6); + + while (*p) { + *p = tolower(*p); + ++p; + } + + P_PlayJingleMusic(player, musname, musflags, looping, jingletype); + return 0; +} + static int lib_pRestoreMusic(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - NOHUD - INLEVEL + //NOHUD + //INLEVEL if (!player) return LUA_ErrInvalid(L, "player_t"); if (P_IsLocalPlayer(player)) @@ -3071,6 +3120,8 @@ static luaL_Reg lib[] = { {"P_InSpaceSector",lib_pInSpaceSector}, {"P_InQuicksand",lib_pInQuicksand}, {"P_SetObjectMomZ",lib_pSetObjectMomZ}, + {"P_PlayJingle",lib_pPlayJingle}, + {"P_PlayJingleMusic",lib_pPlayJingleMusic}, {"P_RestoreMusic",lib_pRestoreMusic}, {"P_SpawnShieldOrb",lib_pSpawnShieldOrb}, {"P_SpawnGhostMobj",lib_pSpawnGhostMobj}, From f2c968dea84ee76db8e8e38327427675c07fd8e9 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 23 Feb 2020 17:20:44 -0600 Subject: [PATCH 08/47] Add JingleStatus hook for carrying custom jingle tunes The extra argument is the music name, as passed into P_PlayJingleMusic(player, musname), to run the hook for, optional. Arguments are (player, musname) - the latter to allow global hooks that still differentiate between different tracks. --- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++- src/p_local.h | 2 +- src/p_user.c | 7 +++++-- src/s_sound.c | 2 +- 5 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/lua_hook.h b/src/lua_hook.h index 265700e4f..ea11d0236 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -58,6 +58,7 @@ enum hook { hook_ViewpointSwitch, hook_SeenPlayer, hook_PlayerThink, + hook_JingleStatus, hook_MAX // last hook }; @@ -110,5 +111,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_NAMECHECK #endif #define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink +boolean LUAh_JingleStatus(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index efed9adb7..c56336fca 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -69,6 +69,7 @@ const char *const hookNames[hook_MAX+1] = { "ViewpointSwitch", "SeenPlayer", "PlayerThink", + "JingleStatus", NULL }; @@ -80,7 +81,7 @@ struct hook_s UINT16 id; union { mobjtype_t mt; - char *skinname; + char *skinname; // also used as musname for JingleStatus... I'm lazy char *funcname; } s; boolean error; @@ -148,6 +149,7 @@ static int lib_addHook(lua_State *L) luaL_argcheck(L, hook.s.mt < NUMMOBJTYPES, 2, "invalid mobjtype_t"); break; case hook_BotAI: + case hook_JingleStatus: hook.s.skinname = NULL; if (lua_isstring(L, 2)) { // lowercase copy @@ -1632,4 +1634,49 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend) } #endif // SEENAMES +boolean LUAh_JingleStatus(player_t *player, const char *musname) +{ + hook_p hookp; + boolean keepplaying = false; + if (!gL || !(hooksAvailable[hook_JingleStatus/8] & (1<<(hook_JingleStatus%8)))) + return true; + + lua_settop(gL, 0); + hud_running = true; // local hook + + for (hookp = roothook; hookp; hookp = hookp->next) + { + if (hookp->type == hook_JingleStatus) CONS_Printf("jingle status hook for %s vs %s\n", hookp->s.skinname, musname); + + if (hookp->type != hook_JingleStatus + || (hookp->s.skinname && strcmp(hookp->s.skinname, musname))) + continue; + + if (lua_gettop(gL) == 0) + { + LUA_PushUserdata(gL, player, META_PLAYER); + lua_pushstring(gL, musname); + } + lua_pushfstring(gL, FMT_HOOKID, hookp->id); + lua_gettable(gL, LUA_REGISTRYINDEX); + lua_pushvalue(gL, -3); + lua_pushvalue(gL, -3); + if (lua_pcall(gL, 2, 1, 0)) { + if (!hookp->error || cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + hookp->error = true; + continue; + } + if (!lua_isnil(gL, -1) && lua_toboolean(gL, -1)) + keepplaying = true; // Keep playing this boolean + lua_pop(gL, 1); + } + + lua_settop(gL, 0); + hud_running = false; + + return keepplaying; +} + #endif diff --git a/src/p_local.h b/src/p_local.h index 5e27379a7..99c465f9b 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -250,7 +250,7 @@ extern jingle_t jingleinfo[NUMJINGLES]; #define JINGLEPOSTFADE 1000 void P_PlayJingle(player_t *player, jingletype_t jingletype); -boolean P_EvaluateMusicStatus(UINT16 status); +boolean P_EvaluateMusicStatus(UINT16 status, const char *musname); void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, boolean looping, UINT16 status); // diff --git a/src/p_user.c b/src/p_user.c index 2dcfd872c..ab85897a5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1541,7 +1541,7 @@ void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, b S_ChangeMusicInternal(musname, looping); } -boolean P_EvaluateMusicStatus(UINT16 status) +boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) { // \todo lua hook int i; @@ -1598,8 +1598,11 @@ boolean P_EvaluateMusicStatus(UINT16 status) result = (players[i].nightstime && players[i].nightstime <= 10*TICRATE); break; - case JT_NONE: // Null state case JT_OTHER: // Other state + result = LUAh_JingleStatus(&players[i], musname); + break; + + case JT_NONE: // Null state case JT_MASTER: // Main level music default: result = true; diff --git a/src/s_sound.c b/src/s_sound.c index 8193fdb9b..6507ffc02 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2045,7 +2045,7 @@ static musicstack_t *S_GetMusicStackEntry(UINT16 status, boolean fromfirst, INT1 if (!status || mst->status == status) { - if (P_EvaluateMusicStatus(mst->status)) + if (P_EvaluateMusicStatus(mst->status, mst->musname)) { if (!S_MusicExists(mst->musname, !midi_disabled, !digital_disabled)) // paranoia S_RemoveMusicStackEntry(mst); // then continue From 352029fd76805029e9f8bea5d92fc307cc5e6d68 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 23 Feb 2020 17:58:32 -0600 Subject: [PATCH 09/47] Add music position functions to Lua --- src/lua_baselib.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index c360007de..b6fa1b7aa 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2656,6 +2656,25 @@ static int lib_sFadeOutStopMusic(lua_State *L) return 1; } +static int lib_sGetMusicLength(lua_State *L) +{ + lua_pushinteger(L, S_GetMusicLength()); + return 1; +} + +static int lib_sGetMusicPosition(lua_State *L) +{ + lua_pushinteger(L, S_GetMusicPosition()); + return 1; +} + +static int lib_sSetMusicPosition(lua_State *L) +{ + UINT32 pos = (UINT32)luaL_checkinteger(L, 1); + lua_pushboolean(L, S_SetMusicPosition(pos)); + return 1; +} + static int lib_sOriginPlaying(lua_State *L) { void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -3242,6 +3261,9 @@ static luaL_Reg lib[] = { {"S_StopFadingMusic",lib_sStopFadingMusic}, {"S_FadeMusic",lib_sFadeMusic}, {"S_FadeOutStopMusic",lib_sFadeOutStopMusic}, + {"S_GetMusicLength",lib_sGetMusicLength}, + {"S_GetMusicPosition",lib_sGetMusicPosition}, + {"S_SetMusicPosition",lib_sSetMusicPosition}, {"S_OriginPlaying",lib_sOriginPlaying}, {"S_IdPlaying",lib_sIdPlaying}, {"S_SoundPlaying",lib_sSoundPlaying}, From 1848ce4b9785ba044496c92fb8f1f8594804c369 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 24 Feb 2020 10:02:36 -0600 Subject: [PATCH 10/47] Skip empty gametypes in level select menu --- src/m_menu.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 945ce3de0..b39fcc2bf 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5045,6 +5045,17 @@ static boolean M_SetNextMapOnPlatter(void) } #endif +static boolean M_GametypeHasLevels(INT32 gt) +{ + INT32 mapnum; + + for (mapnum = 0; mapnum < NUMMAPS; mapnum++) + if (M_CanShowLevelOnPlatter(mapnum, gt)) + return true; + + return false; +} + static INT32 M_CountRowsToShowOnPlatter(INT32 gt) { INT32 mapnum = 0, prevmapnum = 0, col = 0, rows = 0; @@ -5362,7 +5373,9 @@ static void M_HandleLevelPlatter(INT32 choice) case KEY_RIGHTARROW: if (levellistmode == LLM_CREATESERVER && !lsrow) { - CV_AddValue(&cv_newgametype, 1); + do + CV_AddValue(&cv_newgametype, 1); + while (!M_GametypeHasLevels(cv_newgametype.value)); S_StartSound(NULL,sfx_menu1); lscol = 0; @@ -5391,7 +5404,9 @@ static void M_HandleLevelPlatter(INT32 choice) case KEY_LEFTARROW: if (levellistmode == LLM_CREATESERVER && !lsrow) { - CV_AddValue(&cv_newgametype, -1); + do + CV_AddValue(&cv_newgametype, -1); + while (!M_GametypeHasLevels(cv_newgametype.value)); S_StartSound(NULL,sfx_menu1); lscol = 0; From c671097c04e784d4a0e1009ea766cde8af492c51 Mon Sep 17 00:00:00 2001 From: sphere Date: Mon, 2 Mar 2020 13:23:54 +0100 Subject: [PATCH 11/47] Actually use the "SCREENSHOT OPTIONS" header for its menu. --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 403d3a036..fd710ff10 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2179,7 +2179,7 @@ menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE( menu_t OP_ScreenshotOptionsDef = { MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_SCREENSHOTS << 12), - "M_DATA", + "M_SCREEN", sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t), &OP_DataOptionsDef, OP_ScreenshotOptionsMenu, From 04a1f479be653e8def68ead20e489ab735bd0ac6 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 2 Mar 2020 15:36:28 +0100 Subject: [PATCH 12/47] Increase the length of the player input buffer --- src/d_clisrv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 42da89670..7cdff8ef0 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -36,7 +36,7 @@ basic fields of the packet, and change infrequently. // be transmitted. // Networking and tick handling related. -#define BACKUPTICS 32 +#define BACKUPTICS 96 #define MAXTEXTCMD 256 // // Packet structure From 776951c6a897ac0a55e952aeb2963bea79504df3 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Tue, 3 Mar 2020 11:40:35 -0300 Subject: [PATCH 13/47] Never forget who your enemy is --- src/p_mobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index faee245d3..31abeb780 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9393,8 +9393,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (mobj->tracer && mobj->tracer->player && mobj->tracer->health > 0 && P_AproxDistance(P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y), mobj->tracer->z - mobj->z) <= mobj->radius*16) { + var1 = mobj->info->speed; + var2 = 1; + // Home in on the target. - P_HomingAttack(mobj, mobj->tracer); + A_HomingChase(mobj); if (mobj->z < mobj->floorz) mobj->z = mobj->floorz; From 27e084a827f9b8a1d3f5e913694db2268acf0079 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Wed, 4 Mar 2020 17:31:52 +0100 Subject: [PATCH 14/47] Fix division-by-0 crash with gamepad deadzones Fix division-by-0 crash with gamepad deadzones The problem was that it checked if A was more than B, then lowered A to a max value, then subtracted B from A, then divided something by that, without checking if A minus B was 0, allowing division by 0 if B was the same as that max value This fixes that by making sure that A is less than the max value --- src/g_game.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 08192bfb8..4db55329e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1045,17 +1045,14 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone) const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT; INT32 deadzoneAppliedValue = 0; - if (jdeadzone > 0) + if (jdeadzone > 0 && magnitude > jdeadzone && deadZone < FRACUNIT) { - if (magnitude > jdeadzone) - { - INT32 adjustedMagnitude = abs(magnitude); - adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); + INT32 adjustedMagnitude = abs(magnitude); + adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); - adjustedMagnitude -= jdeadzone; + adjustedMagnitude -= jdeadzone; - deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); - } + deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); } return deadzoneAppliedValue; From df220aa2c2d209f7b253e958abc2cf0d63a8bca9 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Wed, 4 Mar 2020 21:11:55 +0100 Subject: [PATCH 15/47] Hotfix for 100% deadzone returning 0 input It makes more sense for 100% deadzone to just make it so that you have to push the axis all the way to trigger it, rather than 100% deadzone resulting in no axis input ever happening... So, let's make it be the former way instead --- src/g_game.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 4db55329e..2cddaf8b8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1045,14 +1045,19 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone) const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT; INT32 deadzoneAppliedValue = 0; - if (jdeadzone > 0 && magnitude > jdeadzone && deadZone < FRACUNIT) + if (jdeadzone > 0 && magnitude > jdeadzone) { - INT32 adjustedMagnitude = abs(magnitude); - adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); + if (deadZone >= FRACUNIT) // If the deadzone value is at 100%... + return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0 + else + { + INT32 adjustedMagnitude = abs(magnitude); + adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); - adjustedMagnitude -= jdeadzone; + adjustedMagnitude -= jdeadzone; - deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); + deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); + } } return deadzoneAppliedValue; From bce6349b1d09e24fd6a4deada395bc628452d38f Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Wed, 4 Mar 2020 21:44:57 +0100 Subject: [PATCH 16/47] More gamepad deadzone tweakage --- src/g_game.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 2cddaf8b8..818cb38c2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1044,20 +1044,17 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone) { const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT; INT32 deadzoneAppliedValue = 0; + INT32 adjustedMagnitude = abs(magnitude); - if (jdeadzone > 0 && magnitude > jdeadzone) + if (jdeadzone >= JOYAXISRANGE && adjustedMagnitude >= JOYAXISRANGE) // If the deadzone and magnitude are both 100%... + return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0 + else if (adjustedMagnitude > jdeadzone) // Otherwise, calculate how much the magnitude exceeds the deadzone { - if (deadZone >= FRACUNIT) // If the deadzone value is at 100%... - return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0 - else - { - INT32 adjustedMagnitude = abs(magnitude); - adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); + adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE); - adjustedMagnitude -= jdeadzone; + adjustedMagnitude -= jdeadzone; - deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); - } + deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); } return deadzoneAppliedValue; From a3f3dd649f5a177d4e42bc4f443a3a127574dd45 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 8 Mar 2020 00:02:43 -0500 Subject: [PATCH 17/47] Fix guest deletion confirmation returning to Record Attack menu from Nights Mode menu --- src/m_menu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 72e2d57e0..712fd2cd7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10103,10 +10103,7 @@ static void M_EraseGuest(INT32 choice) (void)choice; if (FIL_FileExists(rguest)) remove(rguest); - if (currentMenu == &SP_NightsGuestReplayDef) - M_SetupNextMenu(&SP_NightsAttackDef); - else - M_SetupNextMenu(&SP_TimeAttackDef); + M_SetupNextMenu(currentMenu->prevMenu->prevMenu); Nextmap_OnChange(); M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING); } From e5270ad9c71a79b0bc95561b2d8cd55306d3d5f7 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 8 Mar 2020 00:34:15 -0500 Subject: [PATCH 18/47] Fix guest data being deleted regardless of choice --- src/m_menu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 712fd2cd7..75774c74c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10100,9 +10100,12 @@ static void M_ReplayTimeAttack(INT32 choice) static void M_EraseGuest(INT32 choice) { const char *rguest = va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)); - (void)choice; - if (FIL_FileExists(rguest)) - remove(rguest); + + if (choice == 'y' || choice == KEY_ENTER) + { + if (FIL_FileExists(rguest)) + remove(rguest); + } M_SetupNextMenu(currentMenu->prevMenu->prevMenu); Nextmap_OnChange(); M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING); From be338da3f695f94cce07a9aa4ae2e0e85701d8af Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 8 Mar 2020 14:06:18 -0300 Subject: [PATCH 19/47] I guess --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 9167d5345..1715224ae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9422,7 +9422,7 @@ boolean P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target if (enemy->health <= 0) // dead return false; - if (!((enemy->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR) && (enemy->flags & MF_SHOOTABLE)) || (enemy->flags & MF_SPRING)) == !(enemy->flags2 & MF2_INVERTAIMABLE)) // allows if it has the flags desired XOR it has the invert aimable flag + if (source->player && (!((enemy->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR) && (enemy->flags & MF_SHOOTABLE)) || (enemy->flags & MF_SPRING)) == !(enemy->flags2 & MF2_INVERTAIMABLE))) // allows if it has the flags desired XOR it has the invert aimable flag return false; if (enemy->flags2 & MF2_FRET) From a67dbfff549ec6d9e330d9c83b4df8cce2d327f9 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 8 Mar 2020 19:32:07 +0000 Subject: [PATCH 20/47] Create r_skins.c/.h, to contain skins code formerly in r_things.c/h --- src/r_skins.c | 825 +++++++++++++++++++++++++++++++++++++++++++++++++ src/r_skins.h | 102 ++++++ src/r_things.c | 799 +---------------------------------------------- src/r_things.h | 81 +---- 4 files changed, 936 insertions(+), 871 deletions(-) create mode 100644 src/r_skins.c create mode 100644 src/r_skins.h diff --git a/src/r_skins.c b/src/r_skins.c new file mode 100644 index 000000000..48764ff75 --- /dev/null +++ b/src/r_skins.c @@ -0,0 +1,825 @@ +// SONIC ROBO BLAST 2 +//----------------------------------------------------------------------------- +// Copyright (C) 1993-1996 by id Software, Inc. +// Copyright (C) 1998-2000 by DooM Legacy Team. +// Copyright (C) 1999-2020 by Sonic Team Junior. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file r_skins.c +/// \brief Loading skins + +#include "doomdef.h" +#include "console.h" +#include "g_game.h" +#include "r_local.h" +#include "st_stuff.h" +#include "w_wad.h" +#include "z_zone.h" +#include "m_misc.h" +#include "info.h" // spr2names +#include "i_video.h" // rendermode +#include "i_system.h" +#include "r_things.h" +#include "r_skins.h" +#include "p_local.h" +#include "dehacked.h" // get_number (for thok) +#include "m_cond.h" +#ifdef HWRENDER +#include "hardware/hw_md2.h" +#endif + +#ifdef PC_DOS +#include // for snprintf +int snprintf(char *str, size_t n, const char *fmt, ...); +//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap); +#endif + +INT32 numskins = 0; +skin_t skins[MAXSKINS]; + +// FIXTHIS: don't work because it must be inistilised before the config load +//#define SKINVALUES +#ifdef SKINVALUES +CV_PossibleValue_t skin_cons_t[MAXSKINS+1]; +#endif + +// +// P_GetSkinSprite2 +// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing. +// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version. +// + +UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player) +{ + UINT8 super = 0, i = 0; + + if (!skin) + return 0; + + if ((playersprite_t)(spr2 & ~FF_SPR2SUPER) >= free_spr2) + return 0; + + while (!skin->sprites[spr2].numframes + && spr2 != SPR2_STND + && ++i < 32) // recursion limiter + { + if (spr2 & FF_SPR2SUPER) + { + super = FF_SPR2SUPER; + spr2 &= ~FF_SPR2SUPER; + continue; + } + + switch(spr2) + { + // Normal special cases. + case SPR2_JUMP: + spr2 = ((player + ? player->charflags + : skin->flags) + & SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL; + break; + case SPR2_TIRE: + spr2 = ((player + ? player->charability + : skin->ability) + == CA_SWIM) ? SPR2_SWIM : SPR2_FLY; + break; + // Use the handy list, that's what it's there for! + default: + spr2 = spr2defaults[spr2]; + break; + } + + spr2 |= super; + } + + if (i >= 32) // probably an infinite loop... + return 0; + + return spr2; +} + +static void Sk_SetDefaultValue(skin_t *skin) +{ + INT32 i; + // + // set default skin values + // + memset(skin, 0, sizeof (skin_t)); + snprintf(skin->name, + sizeof skin->name, "skin %u", (UINT32)(skin-skins)); + skin->name[sizeof skin->name - 1] = '\0'; + skin->wadnum = INT16_MAX; + + skin->flags = 0; + + strcpy(skin->realname, "Someone"); + strcpy(skin->hudname, "???"); + + skin->starttranscolor = 96; + skin->prefcolor = SKINCOLOR_GREEN; + skin->supercolor = SKINCOLOR_SUPERGOLD1; + skin->prefoppositecolor = 0; // use tables + + skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; + skin->accelstart = 96; + skin->acceleration = 40; + + skin->ability = CA_NONE; + skin->ability2 = CA2_SPINDASH; + skin->jumpfactor = FRACUNIT; + skin->actionspd = 30<mindash = 15<maxdash = 70<radius = mobjinfo[MT_PLAYER].radius; + skin->height = mobjinfo[MT_PLAYER].height; + skin->spinheight = FixedMul(skin->height, 2*FRACUNIT/3); + + skin->shieldscale = FRACUNIT; + skin->camerascale = FRACUNIT; + + skin->thokitem = -1; + skin->spinitem = -1; + skin->revitem = -1; + skin->followitem = 0; + + skin->highresscale = FRACUNIT; + skin->contspeed = 17; + skin->contangle = 0; + + skin->availability = 0; + + for (i = 0; i < sfx_skinsoundslot0; i++) + if (S_sfx[i].skinsound != -1) + skin->soundsid[S_sfx[i].skinsound] = i; +} + +// +// Initialize the basic skins +// +void R_InitSkins(void) +{ +#ifdef SKINVALUES + INT32 i; + + for (i = 0; i <= MAXSKINS; i++) + { + skin_cons_t[i].value = 0; + skin_cons_t[i].strvalue = NULL; + } +#endif + + // no default skin! + numskins = 0; +} + +UINT32 R_GetSkinAvailabilities(void) +{ + INT32 s; + UINT32 response = 0; + + for (s = 0; s < MAXSKINS; s++) + { + if (skins[s].availability && unlockables[skins[s].availability - 1].unlocked) + response |= (1 << s); + } + return response; +} + +// returns true if available in circumstances, otherwise nope +// warning don't use with an invalid skinnum other than -1 which always returns true +boolean R_SkinUsable(INT32 playernum, INT32 skinnum) +{ + return ((skinnum == -1) // Simplifies things elsewhere, since there's already plenty of checks for less-than-0... + || (!skins[skinnum].availability) + || (((netgame || multiplayer) && playernum != -1) ? (players[playernum].availabilities & (1 << skinnum)) : (unlockables[skins[skinnum].availability - 1].unlocked)) + || (modeattacking) // If you have someone else's run you might as well take a look + || (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) // Force 1. + || (netgame && (cv_forceskin.value == skinnum)) // Force 2. + || (metalrecording && skinnum == 5) // Force 3. + ); +} + +// returns true if the skin name is found (loaded from pwad) +// warning return -1 if not found +INT32 R_SkinAvailable(const char *name) +{ + INT32 i; + + for (i = 0; i < numskins; i++) + { + // search in the skin list + if (stricmp(skins[i].name,name)==0) + return i; + } + return -1; +} + +// network code calls this when a 'skin change' is received +void SetPlayerSkin(INT32 playernum, const char *skinname) +{ + INT32 i = R_SkinAvailable(skinname); + player_t *player = &players[playernum]; + + if ((i != -1) && R_SkinUsable(playernum, i)) + { + SetPlayerSkinByNum(playernum, i); + return; + } + + if (P_IsLocalPlayer(player)) + CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname); + else if(server || IsPlayerAdmin(consoleplayer)) + CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname); + + SetPlayerSkinByNum(playernum, 0); +} + +// Same as SetPlayerSkin, but uses the skin #. +// network code calls this when a 'skin change' is received +void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) +{ + player_t *player = &players[playernum]; + skin_t *skin = &skins[skinnum]; + UINT8 newcolor = 0; + + if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists! + { + player->skin = skinnum; + + player->camerascale = skin->camerascale; + player->shieldscale = skin->shieldscale; + + player->charability = (UINT8)skin->ability; + player->charability2 = (UINT8)skin->ability2; + + player->charflags = (UINT32)skin->flags; + + player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + player->followitem = skin->followitem; + + if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff. + player->powers[pw_shield] &= SH_STACK; + + player->actionspd = skin->actionspd; + player->mindash = skin->mindash; + player->maxdash = skin->maxdash; + + player->normalspeed = skin->normalspeed; + player->runspeed = skin->runspeed; + player->thrustfactor = skin->thrustfactor; + player->accelstart = skin->accelstart; + player->acceleration = skin->acceleration; + + player->jumpfactor = skin->jumpfactor; + + player->height = skin->height; + player->spinheight = skin->spinheight; + + if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback)) + { + if (playernum == consoleplayer) + CV_StealthSetValue(&cv_playercolor, skin->prefcolor); + else if (playernum == secondarydisplayplayer) + CV_StealthSetValue(&cv_playercolor2, skin->prefcolor); + player->skincolor = newcolor = skin->prefcolor; + } + + if (player->followmobj) + { + P_RemoveMobj(player->followmobj); + P_SetTarget(&player->followmobj, NULL); + } + + if (player->mo) + { + fixed_t radius = FixedMul(skin->radius, player->mo->scale); + if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin. + { + skin = &skins[DEFAULTNIGHTSSKIN]; + player->followitem = skin->followitem; + if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback)) + newcolor = skin->prefcolor; // will be updated in thinker to flashing + } + player->mo->skin = skin; + if (newcolor) + player->mo->color = newcolor; + P_SetScale(player->mo, player->mo->scale); + player->mo->radius = radius; + + P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames + } + return; + } + + if (P_IsLocalPlayer(player)) + CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum); + else if(server || IsPlayerAdmin(consoleplayer)) + CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum); + SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin +} + +// +// Add skins from a pwad, each skin preceded by 'S_SKIN' marker +// + +// Does the same is in w_wad, but check only for +// the first 6 characters (this is so we can have S_SKIN1, S_SKIN2.. +// for wad editors that don't like multiple resources of the same name) +// +static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) +{ + UINT16 i; + const char *S_SKIN = "S_SKIN"; + lumpinfo_t *lump_p; + + // scan forward, start at + if (startlump < wadfiles[wadid]->numlumps) + { + lump_p = wadfiles[wadid]->lumpinfo + startlump; + for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++) + if (memcmp(lump_p->name,S_SKIN,6)==0) + return i; + } + return INT16_MAX; // not found +} + +#define HUDNAMEWRITE(value) STRBUFCPY(skin->hudname, value) + +// turn _ into spaces and . into katana dot +#define SYMBOLCONVERT(name) for (value = name; *value; value++)\ + {\ + if (*value == '_') *value = ' ';\ + else if (*value == '.') *value = '\x1E';\ + } + +// +// Patch skins from a pwad, each skin preceded by 'P_SKIN' marker +// + +// Does the same is in w_wad, but check only for +// the first 6 characters (this is so we can have P_SKIN1, P_SKIN2.. +// for wad editors that don't like multiple resources of the same name) +// +static UINT16 W_CheckForPatchSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) +{ + UINT16 i; + const char *P_SKIN = "P_SKIN"; + lumpinfo_t *lump_p; + + // scan forward, start at + if (startlump < wadfiles[wadid]->numlumps) + { + lump_p = wadfiles[wadid]->lumpinfo + startlump; + for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++) + if (memcmp(lump_p->name,P_SKIN,6)==0) + return i; + } + return INT16_MAX; // not found +} + +static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin) +{ + UINT16 newlastlump; + UINT8 sprite2; + + *lump += 1; // 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 P_SKIN) or S_START if they come before S_END. + newlastlump = W_CheckForSkinMarkerInPwad(wadnum,*lump); + if (newlastlump < *lastlump) *lastlump = newlastlump; + newlastlump = W_CheckForPatchSkinMarkerInPwad(wadnum,*lump); + if (newlastlump < *lastlump) *lastlump = newlastlump; + newlastlump = W_CheckNumForNamePwad("S_START",wadnum,*lump); + if (newlastlump < *lastlump) *lastlump = newlastlump; + + // ...and let's handle super, too + newlastlump = W_CheckNumForNamePwad("S_SUPER",wadnum,*lump); + if (newlastlump < *lastlump) + { + newlastlump++; + // load all sprite sets we are aware of... for super! + for (sprite2 = 0; sprite2 < free_spr2; sprite2++) + R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump); + + newlastlump--; + *lastlump = newlastlump; // okay, make the normal sprite set loading end there + } + + // load all sprite sets we are aware of... for normal stuff. + for (sprite2 = 0; sprite2 < free_spr2; sprite2++) + R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[sprite2], wadnum, *lump, *lastlump); + + if (skin->sprites[0].numframes == 0) + I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]); +} + +// returns whether found appropriate property +static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value) +{ + // custom translation table + if (!stricmp(stoken, "startcolor")) + skin->starttranscolor = atoi(value); + +#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value); + // character type identification + FULLPROCESS(flags) + FULLPROCESS(ability) + FULLPROCESS(ability2) + + FULLPROCESS(thokitem) + FULLPROCESS(spinitem) + FULLPROCESS(revitem) + FULLPROCESS(followitem) +#undef FULLPROCESS + +#define GETFRACBITS(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<field = atoi(value); + GETINT(thrustfactor) + GETINT(accelstart) + GETINT(acceleration) + GETINT(contspeed) + GETINT(contangle) +#undef GETINT + +#define GETSKINCOLOR(field) else if (!stricmp(stoken, #field)) skin->field = R_GetColorByName(value); + GETSKINCOLOR(prefcolor) + GETSKINCOLOR(prefoppositecolor) +#undef GETSKINCOLOR + else if (!stricmp(stoken, "supercolor")) + skin->supercolor = R_GetSuperColorByName(value); + +#define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value)); + GETFLOAT(jumpfactor) + GETFLOAT(highresscale) + GETFLOAT(shieldscale) + GETFLOAT(camerascale) +#undef GETFLOAT + +#define GETFLAG(field) else if (!stricmp(stoken, #field)) { \ + strupr(value); \ + if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \ + skin->flags |= (SF_##field); \ + else \ + skin->flags &= ~(SF_##field); \ +} + // parameters for individual character flags + // these are uppercase so they can be concatenated with SF_ + // 1, true, yes are all valid values + GETFLAG(SUPER) + GETFLAG(NOSUPERSPIN) + GETFLAG(NOSPINDASHDUST) + GETFLAG(HIRES) + GETFLAG(NOSKID) + GETFLAG(NOSPEEDADJUST) + GETFLAG(RUNONWATER) + GETFLAG(NOJUMPSPIN) + GETFLAG(NOJUMPDAMAGE) + GETFLAG(STOMPDAMAGE) + GETFLAG(MARIODAMAGE) + GETFLAG(MACHINE) + GETFLAG(DASHMODE) + GETFLAG(FASTEDGE) + GETFLAG(MULTIABILITY) + GETFLAG(NONIGHTSROTATION) +#undef GETFLAG + + else // let's check if it's a sound, otherwise error out + { + boolean found = false; + sfxenum_t i; + size_t stokenadjust; + + // Remove the prefix. (We need to affect an adjusting variable so that we can print error messages if it's not actually a sound.) + if ((stoken[0] == 'D' || stoken[0] == 'd') && (stoken[1] == 'S' || stoken[1] == 's')) // DS* + stokenadjust = 2; + else // sfx_* + stokenadjust = 4; + + // Remove the prefix. (We can affect this directly since we're not going to use it again.) + if ((value[0] == 'D' || value[0] == 'd') && (value[1] == 'S' || value[1] == 's')) // DS* + value += 2; + else // sfx_* + value += 4; + + // copy name of sounds that are remapped + // for this skin + for (i = 0; i < sfx_skinsoundslot0; i++) + { + if (!S_sfx[i].name) + continue; + if (S_sfx[i].skinsound != -1 + && !stricmp(S_sfx[i].name, + stoken + stokenadjust)) + { + skin->soundsid[S_sfx[i].skinsound] = + S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].pitch, true); + found = true; + } + } + return found; + } + return true; +} + +// +// Find skin sprites, sounds & optional status bar face, & add them +// +void R_AddSkins(UINT16 wadnum) +{ + UINT16 lump, lastlump = 0; + char *buf; + char *buf2; + char *stoken; + char *value; + size_t size; + skin_t *skin; + boolean hudname, realname; + + // + // search for all skin markers in pwad + // + + while ((lump = W_CheckForSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX) + { + // advance by default + lastlump = lump + 1; + + if (numskins >= MAXSKINS) + { + CONS_Debug(DBG_RENDER, "ignored skin (%d skins maximum)\n", MAXSKINS); + continue; // so we know how many skins couldn't be added + } + buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); + size = W_LumpLengthPwad(wadnum, lump); + + // for strtok + buf2 = malloc(size+1); + if (!buf2) + I_Error("R_AddSkins: No more free memory\n"); + M_Memcpy(buf2,buf,size); + buf2[size] = '\0'; + + // set defaults + skin = &skins[numskins]; + Sk_SetDefaultValue(skin); + skin->wadnum = wadnum; + hudname = realname = false; + // parse + stoken = strtok (buf2, "\r\n= "); + while (stoken) + { + if ((stoken[0] == '/' && stoken[1] == '/') + || (stoken[0] == '#'))// skip comments + { + stoken = strtok(NULL, "\r\n"); // skip end of line + goto next_token; // find the real next token + } + + value = strtok(NULL, "\r\n= "); + + if (!value) + I_Error("R_AddSkins: syntax error in S_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); + + // Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines. + // Others can't go in there because we don't want them to be patchable. + if (!stricmp(stoken, "name")) + { + INT32 skinnum = R_SkinAvailable(value); + strlwr(value); + if (skinnum == -1) + STRBUFCPY(skin->name, value); + // the skin name must uniquely identify a single skin + // if the name is already used I make the name 'namex' + // using the default skin name's number set above + else + { + const size_t stringspace = + strlen(value) + sizeof (numskins) + 1; + char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL); + snprintf(value2, stringspace, + "%s%d", value, numskins); + value2[stringspace - 1] = '\0'; + if (R_SkinAvailable(value2) == -1) + // I'm lazy so if NEW name is already used I leave the 'skin x' + // default skin name set in Sk_SetDefaultValue + STRBUFCPY(skin->name, value2); + Z_Free(value2); + } + + // copy to hudname and fullname as a default. + if (!realname) + { + STRBUFCPY(skin->realname, skin->name); + for (value = skin->realname; *value; value++) + { + if (*value == '_') *value = ' '; // turn _ into spaces. + else if (*value == '.') *value = '\x1E'; // turn . into katana dot. + } + } + if (!hudname) + { + HUDNAMEWRITE(skin->name); + strupr(skin->hudname); + SYMBOLCONVERT(skin->hudname) + } + } + else if (!stricmp(stoken, "realname")) + { // Display name (eg. "Knuckles") + realname = true; + STRBUFCPY(skin->realname, value); + SYMBOLCONVERT(skin->realname) + if (!hudname) + HUDNAMEWRITE(skin->realname); + } + else if (!stricmp(stoken, "hudname")) + { // Life icon name (eg. "K.T.E") + hudname = true; + HUDNAMEWRITE(value); + SYMBOLCONVERT(skin->hudname) + if (!realname) + STRBUFCPY(skin->realname, skin->hudname); + } + else if (!stricmp(stoken, "availability")) + { + skin->availability = atoi(value); + if (skin->availability >= MAXUNLOCKABLES) + skin->availability = 0; + } + else if (!R_ProcessPatchableFields(skin, stoken, value)) + CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename); + +next_token: + stoken = strtok(NULL, "\r\n= "); + } + free(buf2); + + // Add sprites + R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); + //ST_LoadFaceGraphics(numskins); -- nah let's do this elsewhere + + R_FlushTranslationColormapCache(); + + if (!skin->availability) // Safe to print... + CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name); +#ifdef SKINVALUES + skin_cons_t[numskins].value = numskins; + skin_cons_t[numskins].strvalue = skin->name; +#endif + +#ifdef HWRENDER + if (rendermode == render_opengl) + HWR_AddPlayerModel(numskins); +#endif + + numskins++; + } + return; +} + +// +// Patch skin sprites +// +void R_PatchSkins(UINT16 wadnum) +{ + UINT16 lump, lastlump = 0; + char *buf; + char *buf2; + char *stoken; + char *value; + size_t size; + skin_t *skin; + boolean noskincomplain, realname, hudname; + + // + // search for all skin patch markers in pwad + // + + while ((lump = W_CheckForPatchSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX) + { + INT32 skinnum = 0; + + // advance by default + lastlump = lump + 1; + + buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); + size = W_LumpLengthPwad(wadnum, lump); + + // for strtok + buf2 = malloc(size+1); + if (!buf2) + I_Error("R_PatchSkins: No more free memory\n"); + M_Memcpy(buf2,buf,size); + buf2[size] = '\0'; + + skin = NULL; + noskincomplain = realname = hudname = false; + + /* + Parse. Has more phases than the parser in R_AddSkins because it needs to have the patching name first (no default skin name is acceptible for patching, unlike skin creation) + */ + + stoken = strtok(buf2, "\r\n= "); + while (stoken) + { + if ((stoken[0] == '/' && stoken[1] == '/') + || (stoken[0] == '#'))// skip comments + { + stoken = strtok(NULL, "\r\n"); // skip end of line + goto next_token; // find the real next token + } + + value = strtok(NULL, "\r\n= "); + + if (!value) + I_Error("R_PatchSkins: syntax error in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); + + if (!skin) // Get the name! + { + if (!stricmp(stoken, "name")) + { + strlwr(value); + skinnum = R_SkinAvailable(value); + if (skinnum != -1) + skin = &skins[skinnum]; + else + { + CONS_Debug(DBG_SETUP, "R_PatchSkins: unknown skin name in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); + noskincomplain = true; + } + } + } + else // Get the properties! + { + // Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines. + if (!stricmp(stoken, "realname")) + { // Display name (eg. "Knuckles") + realname = true; + STRBUFCPY(skin->realname, value); + SYMBOLCONVERT(skin->realname) + if (!hudname) + HUDNAMEWRITE(skin->realname); + } + else if (!stricmp(stoken, "hudname")) + { // Life icon name (eg. "K.T.E") + hudname = true; + HUDNAMEWRITE(value); + SYMBOLCONVERT(skin->hudname) + if (!realname) + STRBUFCPY(skin->realname, skin->hudname); + } + else if (!R_ProcessPatchableFields(skin, stoken, value)) + CONS_Debug(DBG_SETUP, "R_PatchSkins: Unknown keyword '%s' in P_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename); + } + + if (!skin) + break; + +next_token: + stoken = strtok(NULL, "\r\n= "); + } + free(buf2); + + if (!skin) // Didn't include a name parameter? What a waste. + { + if (!noskincomplain) + CONS_Debug(DBG_SETUP, "R_PatchSkins: no skin name given in P_SKIN lump #%d (WAD %s)\n", lump, wadfiles[wadnum]->filename); + continue; + } + + // Patch sprites + R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); + //ST_LoadFaceGraphics(skinnum); -- nah let's do this elsewhere + + R_FlushTranslationColormapCache(); + + if (!skin->availability) // Safe to print... + CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name); + } + return; +} + +#undef HUDNAMEWRITE +#undef SYMBOLCONVERT diff --git a/src/r_skins.h b/src/r_skins.h new file mode 100644 index 000000000..4b83966ac --- /dev/null +++ b/src/r_skins.h @@ -0,0 +1,102 @@ +// SONIC ROBO BLAST 2 +//----------------------------------------------------------------------------- +// Copyright (C) 1993-1996 by id Software, Inc. +// Copyright (C) 1998-2000 by DooM Legacy Team. +// Copyright (C) 1999-2020 by Sonic Team Junior. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file r_skins.h +/// \brief Skins stuff + +#ifndef __R_SKINS__ +#define __R_SKINS__ + +#include "info.h" +#include "sounds.h" +#include "r_patch.h" // spriteinfo_t +#include "r_defs.h" // spritedef_t + +/// Defaults +#define SKINNAMESIZE 16 +// should be all lowercase!! S_SKIN processing does a strlwr +#define DEFAULTSKIN "sonic" +#define DEFAULTSKIN2 "tails" // secondary player +#define DEFAULTNIGHTSSKIN 0 + +/// The skin_t struct +typedef struct +{ + char name[SKINNAMESIZE+1]; // INT16 descriptive name of the skin + UINT16 wadnum; + skinflags_t flags; + + char realname[SKINNAMESIZE+1]; // Display name for level completion. + char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long) + + UINT8 ability; // ability definition + UINT8 ability2; // secondary ability definition + INT32 thokitem; + INT32 spinitem; + INT32 revitem; + INT32 followitem; + fixed_t actionspd; + fixed_t mindash; + fixed_t maxdash; + + fixed_t normalspeed; // Normal ground + fixed_t runspeed; // Speed that you break into your run animation + + UINT8 thrustfactor; // Thrust = thrustfactor * acceleration + UINT8 accelstart; // Acceleration if speed = 0 + UINT8 acceleration; // Acceleration + + fixed_t jumpfactor; // multiple of standard jump height + + fixed_t radius; // Bounding box changes. + fixed_t height; + fixed_t spinheight; + + fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size + fixed_t camerascale; + + // Definable color translation table + UINT8 starttranscolor; + UINT8 prefcolor; + UINT8 supercolor; + UINT8 prefoppositecolor; // if 0 use tables instead + + fixed_t highresscale; // scale of highres, default is 0.5 + UINT8 contspeed; // continue screen animation speed + UINT8 contangle; // initial angle on continue screen + + // specific sounds per skin + sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table + + // contains super versions too + spritedef_t sprites[NUMPLAYERSPRITES*2]; + spriteinfo_t sprinfo[NUMPLAYERSPRITES*2]; + + UINT8 availability; // lock? +} skin_t; + +/// Externs +extern INT32 numskins; +extern skin_t skins[MAXSKINS]; + +/// Function prototypes +void R_InitSkins(void); + +void SetPlayerSkin(INT32 playernum,const char *skinname); +void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002 +boolean R_SkinUsable(INT32 playernum, INT32 skinnum); +UINT32 R_GetSkinAvailabilities(void); +INT32 R_SkinAvailable(const char *name); +void R_PatchSkins(UINT16 wadnum); +void R_AddSkins(UINT16 wadnum); + +UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player); + +#endif //__R_SKINS__ diff --git a/src/r_things.c b/src/r_things.c index 953825d0f..17a5f0809 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -30,11 +30,8 @@ #include "p_tick.h" #include "p_local.h" #include "p_slopes.h" -#include "dehacked.h" // get_number (for thok) #include "d_netfil.h" // blargh. for nameonly(). #include "m_cheat.h" // objectplace -#include "m_cond.h" -#include "fastcmp.h" #ifdef HWRENDER #include "hardware/hw_md2.h" #include "hardware/hw_glob.h" @@ -42,14 +39,6 @@ #include "hardware/hw_drv.h" #endif -#ifdef PC_DOS -#include // for snprintf -int snprintf(char *str, size_t n, const char *fmt, ...); -//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap); -#endif - -static void R_InitSkins(void); - #define MINZ (FRACUNIT*4) #define BASEYCENTER (BASEVIDHEIGHT/2) @@ -233,7 +222,7 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch // // Returns true if the sprite was succesfully added // -static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump) +boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump) { UINT16 l; UINT8 frame; @@ -2971,788 +2960,4 @@ void R_DrawMasked(maskcount_t* masks, UINT8 nummasks) // // ========================================================================== -INT32 numskins = 0; -skin_t skins[MAXSKINS]; -// FIXTHIS: don't work because it must be inistilised before the config load -//#define SKINVALUES -#ifdef SKINVALUES -CV_PossibleValue_t skin_cons_t[MAXSKINS+1]; -#endif - -// -// P_GetSkinSprite2 -// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing. -// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version. -// - -UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player) -{ - UINT8 super = 0, i = 0; - - if (!skin) - return 0; - - if ((playersprite_t)(spr2 & ~FF_SPR2SUPER) >= free_spr2) - return 0; - - while (!skin->sprites[spr2].numframes - && spr2 != SPR2_STND - && ++i < 32) // recursion limiter - { - if (spr2 & FF_SPR2SUPER) - { - super = FF_SPR2SUPER; - spr2 &= ~FF_SPR2SUPER; - continue; - } - - switch(spr2) - { - // Normal special cases. - case SPR2_JUMP: - spr2 = ((player - ? player->charflags - : skin->flags) - & SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL; - break; - case SPR2_TIRE: - spr2 = ((player - ? player->charability - : skin->ability) - == CA_SWIM) ? SPR2_SWIM : SPR2_FLY; - break; - // Use the handy list, that's what it's there for! - default: - spr2 = spr2defaults[spr2]; - break; - } - - spr2 |= super; - } - - if (i >= 32) // probably an infinite loop... - return 0; - - return spr2; -} - -static void Sk_SetDefaultValue(skin_t *skin) -{ - INT32 i; - // - // set default skin values - // - memset(skin, 0, sizeof (skin_t)); - snprintf(skin->name, - sizeof skin->name, "skin %u", (UINT32)(skin-skins)); - skin->name[sizeof skin->name - 1] = '\0'; - skin->wadnum = INT16_MAX; - - skin->flags = 0; - - strcpy(skin->realname, "Someone"); - strcpy(skin->hudname, "???"); - - skin->starttranscolor = 96; - skin->prefcolor = SKINCOLOR_GREEN; - skin->supercolor = SKINCOLOR_SUPERGOLD1; - skin->prefoppositecolor = 0; // use tables - - skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; - skin->accelstart = 96; - skin->acceleration = 40; - - skin->ability = CA_NONE; - skin->ability2 = CA2_SPINDASH; - skin->jumpfactor = FRACUNIT; - skin->actionspd = 30<mindash = 15<maxdash = 70<radius = mobjinfo[MT_PLAYER].radius; - skin->height = mobjinfo[MT_PLAYER].height; - skin->spinheight = FixedMul(skin->height, 2*FRACUNIT/3); - - skin->shieldscale = FRACUNIT; - skin->camerascale = FRACUNIT; - - skin->thokitem = -1; - skin->spinitem = -1; - skin->revitem = -1; - skin->followitem = 0; - - skin->highresscale = FRACUNIT; - skin->contspeed = 17; - skin->contangle = 0; - - skin->availability = 0; - - for (i = 0; i < sfx_skinsoundslot0; i++) - if (S_sfx[i].skinsound != -1) - skin->soundsid[S_sfx[i].skinsound] = i; -} - -// -// Initialize the basic skins -// -void R_InitSkins(void) -{ -#ifdef SKINVALUES - INT32 i; - - for (i = 0; i <= MAXSKINS; i++) - { - skin_cons_t[i].value = 0; - skin_cons_t[i].strvalue = NULL; - } -#endif - - // no default skin! - numskins = 0; -} - -UINT32 R_GetSkinAvailabilities(void) -{ - INT32 s; - UINT32 response = 0; - - for (s = 0; s < MAXSKINS; s++) - { - if (skins[s].availability && unlockables[skins[s].availability - 1].unlocked) - response |= (1 << s); - } - return response; -} - -// returns true if available in circumstances, otherwise nope -// warning don't use with an invalid skinnum other than -1 which always returns true -boolean R_SkinUsable(INT32 playernum, INT32 skinnum) -{ - return ((skinnum == -1) // Simplifies things elsewhere, since there's already plenty of checks for less-than-0... - || (!skins[skinnum].availability) - || (((netgame || multiplayer) && playernum != -1) ? (players[playernum].availabilities & (1 << skinnum)) : (unlockables[skins[skinnum].availability - 1].unlocked)) - || (modeattacking) // If you have someone else's run you might as well take a look - || (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) // Force 1. - || (netgame && (cv_forceskin.value == skinnum)) // Force 2. - || (metalrecording && skinnum == 5) // Force 3. - ); -} - -// returns true if the skin name is found (loaded from pwad) -// warning return -1 if not found -INT32 R_SkinAvailable(const char *name) -{ - INT32 i; - - for (i = 0; i < numskins; i++) - { - // search in the skin list - if (stricmp(skins[i].name,name)==0) - return i; - } - return -1; -} - -// network code calls this when a 'skin change' is received -void SetPlayerSkin(INT32 playernum, const char *skinname) -{ - INT32 i = R_SkinAvailable(skinname); - player_t *player = &players[playernum]; - - if ((i != -1) && R_SkinUsable(playernum, i)) - { - SetPlayerSkinByNum(playernum, i); - return; - } - - if (P_IsLocalPlayer(player)) - CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname); - else if(server || IsPlayerAdmin(consoleplayer)) - CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname); - - SetPlayerSkinByNum(playernum, 0); -} - -// Same as SetPlayerSkin, but uses the skin #. -// network code calls this when a 'skin change' is received -void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) -{ - player_t *player = &players[playernum]; - skin_t *skin = &skins[skinnum]; - UINT8 newcolor = 0; - - if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists! - { - player->skin = skinnum; - - player->camerascale = skin->camerascale; - player->shieldscale = skin->shieldscale; - - player->charability = (UINT8)skin->ability; - player->charability2 = (UINT8)skin->ability2; - - player->charflags = (UINT32)skin->flags; - - player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; - player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; - player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; - player->followitem = skin->followitem; - - if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff. - player->powers[pw_shield] &= SH_STACK; - - player->actionspd = skin->actionspd; - player->mindash = skin->mindash; - player->maxdash = skin->maxdash; - - player->normalspeed = skin->normalspeed; - player->runspeed = skin->runspeed; - player->thrustfactor = skin->thrustfactor; - player->accelstart = skin->accelstart; - player->acceleration = skin->acceleration; - - player->jumpfactor = skin->jumpfactor; - - player->height = skin->height; - player->spinheight = skin->spinheight; - - if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback)) - { - if (playernum == consoleplayer) - CV_StealthSetValue(&cv_playercolor, skin->prefcolor); - else if (playernum == secondarydisplayplayer) - CV_StealthSetValue(&cv_playercolor2, skin->prefcolor); - player->skincolor = newcolor = skin->prefcolor; - } - - if (player->followmobj) - { - P_RemoveMobj(player->followmobj); - P_SetTarget(&player->followmobj, NULL); - } - - if (player->mo) - { - fixed_t radius = FixedMul(skin->radius, player->mo->scale); - if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin. - { - skin = &skins[DEFAULTNIGHTSSKIN]; - player->followitem = skin->followitem; - if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback)) - newcolor = skin->prefcolor; // will be updated in thinker to flashing - } - player->mo->skin = skin; - if (newcolor) - player->mo->color = newcolor; - P_SetScale(player->mo, player->mo->scale); - player->mo->radius = radius; - - P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames - } - return; - } - - if (P_IsLocalPlayer(player)) - CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum); - else if(server || IsPlayerAdmin(consoleplayer)) - CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum); - SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin -} - -// -// Add skins from a pwad, each skin preceded by 'S_SKIN' marker -// - -// Does the same is in w_wad, but check only for -// the first 6 characters (this is so we can have S_SKIN1, S_SKIN2.. -// for wad editors that don't like multiple resources of the same name) -// -static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) -{ - UINT16 i; - const char *S_SKIN = "S_SKIN"; - lumpinfo_t *lump_p; - - // scan forward, start at - if (startlump < wadfiles[wadid]->numlumps) - { - lump_p = wadfiles[wadid]->lumpinfo + startlump; - for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++) - if (memcmp(lump_p->name,S_SKIN,6)==0) - return i; - } - return INT16_MAX; // not found -} - -#define HUDNAMEWRITE(value) STRBUFCPY(skin->hudname, value) - -// turn _ into spaces and . into katana dot -#define SYMBOLCONVERT(name) for (value = name; *value; value++)\ - {\ - if (*value == '_') *value = ' ';\ - else if (*value == '.') *value = '\x1E';\ - } - -// -// Patch skins from a pwad, each skin preceded by 'P_SKIN' marker -// - -// Does the same is in w_wad, but check only for -// the first 6 characters (this is so we can have P_SKIN1, P_SKIN2.. -// for wad editors that don't like multiple resources of the same name) -// -static UINT16 W_CheckForPatchSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) -{ - UINT16 i; - const char *P_SKIN = "P_SKIN"; - lumpinfo_t *lump_p; - - // scan forward, start at - if (startlump < wadfiles[wadid]->numlumps) - { - lump_p = wadfiles[wadid]->lumpinfo + startlump; - for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++) - if (memcmp(lump_p->name,P_SKIN,6)==0) - return i; - } - return INT16_MAX; // not found -} - -static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin) -{ - UINT16 newlastlump; - UINT8 sprite2; - - *lump += 1; // 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 P_SKIN) or S_START if they come before S_END. - newlastlump = W_CheckForSkinMarkerInPwad(wadnum,*lump); - if (newlastlump < *lastlump) *lastlump = newlastlump; - newlastlump = W_CheckForPatchSkinMarkerInPwad(wadnum,*lump); - if (newlastlump < *lastlump) *lastlump = newlastlump; - newlastlump = W_CheckNumForNamePwad("S_START",wadnum,*lump); - if (newlastlump < *lastlump) *lastlump = newlastlump; - - // ...and let's handle super, too - newlastlump = W_CheckNumForNamePwad("S_SUPER",wadnum,*lump); - if (newlastlump < *lastlump) - { - newlastlump++; - // load all sprite sets we are aware of... for super! - for (sprite2 = 0; sprite2 < free_spr2; sprite2++) - R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump); - - newlastlump--; - *lastlump = newlastlump; // okay, make the normal sprite set loading end there - } - - // load all sprite sets we are aware of... for normal stuff. - for (sprite2 = 0; sprite2 < free_spr2; sprite2++) - R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[sprite2], wadnum, *lump, *lastlump); - - if (skin->sprites[0].numframes == 0) - I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]); -} - -// returns whether found appropriate property -static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value) -{ - // custom translation table - if (!stricmp(stoken, "startcolor")) - skin->starttranscolor = atoi(value); - -#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value); - // character type identification - FULLPROCESS(flags) - FULLPROCESS(ability) - FULLPROCESS(ability2) - - FULLPROCESS(thokitem) - FULLPROCESS(spinitem) - FULLPROCESS(revitem) - FULLPROCESS(followitem) -#undef FULLPROCESS - -#define GETFRACBITS(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<field = atoi(value); - GETINT(thrustfactor) - GETINT(accelstart) - GETINT(acceleration) - GETINT(contspeed) - GETINT(contangle) -#undef GETINT - -#define GETSKINCOLOR(field) else if (!stricmp(stoken, #field)) skin->field = R_GetColorByName(value); - GETSKINCOLOR(prefcolor) - GETSKINCOLOR(prefoppositecolor) -#undef GETSKINCOLOR - else if (!stricmp(stoken, "supercolor")) - skin->supercolor = R_GetSuperColorByName(value); - -#define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value)); - GETFLOAT(jumpfactor) - GETFLOAT(highresscale) - GETFLOAT(shieldscale) - GETFLOAT(camerascale) -#undef GETFLOAT - -#define GETFLAG(field) else if (!stricmp(stoken, #field)) { \ - strupr(value); \ - if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \ - skin->flags |= (SF_##field); \ - else \ - skin->flags &= ~(SF_##field); \ -} - // parameters for individual character flags - // these are uppercase so they can be concatenated with SF_ - // 1, true, yes are all valid values - GETFLAG(SUPER) - GETFLAG(NOSUPERSPIN) - GETFLAG(NOSPINDASHDUST) - GETFLAG(HIRES) - GETFLAG(NOSKID) - GETFLAG(NOSPEEDADJUST) - GETFLAG(RUNONWATER) - GETFLAG(NOJUMPSPIN) - GETFLAG(NOJUMPDAMAGE) - GETFLAG(STOMPDAMAGE) - GETFLAG(MARIODAMAGE) - GETFLAG(MACHINE) - GETFLAG(DASHMODE) - GETFLAG(FASTEDGE) - GETFLAG(MULTIABILITY) - GETFLAG(NONIGHTSROTATION) -#undef GETFLAG - - else // let's check if it's a sound, otherwise error out - { - boolean found = false; - sfxenum_t i; - size_t stokenadjust; - - // Remove the prefix. (We need to affect an adjusting variable so that we can print error messages if it's not actually a sound.) - if ((stoken[0] == 'D' || stoken[0] == 'd') && (stoken[1] == 'S' || stoken[1] == 's')) // DS* - stokenadjust = 2; - else // sfx_* - stokenadjust = 4; - - // Remove the prefix. (We can affect this directly since we're not going to use it again.) - if ((value[0] == 'D' || value[0] == 'd') && (value[1] == 'S' || value[1] == 's')) // DS* - value += 2; - else // sfx_* - value += 4; - - // copy name of sounds that are remapped - // for this skin - for (i = 0; i < sfx_skinsoundslot0; i++) - { - if (!S_sfx[i].name) - continue; - if (S_sfx[i].skinsound != -1 - && !stricmp(S_sfx[i].name, - stoken + stokenadjust)) - { - skin->soundsid[S_sfx[i].skinsound] = - S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].pitch, true); - found = true; - } - } - return found; - } - return true; -} - -// -// Find skin sprites, sounds & optional status bar face, & add them -// -void R_AddSkins(UINT16 wadnum) -{ - UINT16 lump, lastlump = 0; - char *buf; - char *buf2; - char *stoken; - char *value; - size_t size; - skin_t *skin; - boolean hudname, realname; - - // - // search for all skin markers in pwad - // - - while ((lump = W_CheckForSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX) - { - // advance by default - lastlump = lump + 1; - - if (numskins >= MAXSKINS) - { - CONS_Debug(DBG_RENDER, "ignored skin (%d skins maximum)\n", MAXSKINS); - continue; // so we know how many skins couldn't be added - } - buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); - size = W_LumpLengthPwad(wadnum, lump); - - // for strtok - buf2 = malloc(size+1); - if (!buf2) - I_Error("R_AddSkins: No more free memory\n"); - M_Memcpy(buf2,buf,size); - buf2[size] = '\0'; - - // set defaults - skin = &skins[numskins]; - Sk_SetDefaultValue(skin); - skin->wadnum = wadnum; - hudname = realname = false; - // parse - stoken = strtok (buf2, "\r\n= "); - while (stoken) - { - if ((stoken[0] == '/' && stoken[1] == '/') - || (stoken[0] == '#'))// skip comments - { - stoken = strtok(NULL, "\r\n"); // skip end of line - goto next_token; // find the real next token - } - - value = strtok(NULL, "\r\n= "); - - if (!value) - I_Error("R_AddSkins: syntax error in S_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); - - // Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines. - // Others can't go in there because we don't want them to be patchable. - if (!stricmp(stoken, "name")) - { - INT32 skinnum = R_SkinAvailable(value); - strlwr(value); - if (skinnum == -1) - STRBUFCPY(skin->name, value); - // the skin name must uniquely identify a single skin - // if the name is already used I make the name 'namex' - // using the default skin name's number set above - else - { - const size_t stringspace = - strlen(value) + sizeof (numskins) + 1; - char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL); - snprintf(value2, stringspace, - "%s%d", value, numskins); - value2[stringspace - 1] = '\0'; - if (R_SkinAvailable(value2) == -1) - // I'm lazy so if NEW name is already used I leave the 'skin x' - // default skin name set in Sk_SetDefaultValue - STRBUFCPY(skin->name, value2); - Z_Free(value2); - } - - // copy to hudname and fullname as a default. - if (!realname) - { - STRBUFCPY(skin->realname, skin->name); - for (value = skin->realname; *value; value++) - { - if (*value == '_') *value = ' '; // turn _ into spaces. - else if (*value == '.') *value = '\x1E'; // turn . into katana dot. - } - } - if (!hudname) - { - HUDNAMEWRITE(skin->name); - strupr(skin->hudname); - SYMBOLCONVERT(skin->hudname) - } - } - else if (!stricmp(stoken, "realname")) - { // Display name (eg. "Knuckles") - realname = true; - STRBUFCPY(skin->realname, value); - SYMBOLCONVERT(skin->realname) - if (!hudname) - HUDNAMEWRITE(skin->realname); - } - else if (!stricmp(stoken, "hudname")) - { // Life icon name (eg. "K.T.E") - hudname = true; - HUDNAMEWRITE(value); - SYMBOLCONVERT(skin->hudname) - if (!realname) - STRBUFCPY(skin->realname, skin->hudname); - } - else if (!stricmp(stoken, "availability")) - { - skin->availability = atoi(value); - if (skin->availability >= MAXUNLOCKABLES) - skin->availability = 0; - } - else if (!R_ProcessPatchableFields(skin, stoken, value)) - CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename); - -next_token: - stoken = strtok(NULL, "\r\n= "); - } - free(buf2); - - // Add sprites - R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); - //ST_LoadFaceGraphics(numskins); -- nah let's do this elsewhere - - R_FlushTranslationColormapCache(); - - if (!skin->availability) // Safe to print... - CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name); -#ifdef SKINVALUES - skin_cons_t[numskins].value = numskins; - skin_cons_t[numskins].strvalue = skin->name; -#endif - -#ifdef HWRENDER - if (rendermode == render_opengl) - HWR_AddPlayerModel(numskins); -#endif - - numskins++; - } - return; -} - -// -// Patch skin sprites -// -void R_PatchSkins(UINT16 wadnum) -{ - UINT16 lump, lastlump = 0; - char *buf; - char *buf2; - char *stoken; - char *value; - size_t size; - skin_t *skin; - boolean noskincomplain, realname, hudname; - - // - // search for all skin patch markers in pwad - // - - while ((lump = W_CheckForPatchSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX) - { - INT32 skinnum = 0; - - // advance by default - lastlump = lump + 1; - - buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); - size = W_LumpLengthPwad(wadnum, lump); - - // for strtok - buf2 = malloc(size+1); - if (!buf2) - I_Error("R_PatchSkins: No more free memory\n"); - M_Memcpy(buf2,buf,size); - buf2[size] = '\0'; - - skin = NULL; - noskincomplain = realname = hudname = false; - - /* - Parse. Has more phases than the parser in R_AddSkins because it needs to have the patching name first (no default skin name is acceptible for patching, unlike skin creation) - */ - - stoken = strtok(buf2, "\r\n= "); - while (stoken) - { - if ((stoken[0] == '/' && stoken[1] == '/') - || (stoken[0] == '#'))// skip comments - { - stoken = strtok(NULL, "\r\n"); // skip end of line - goto next_token; // find the real next token - } - - value = strtok(NULL, "\r\n= "); - - if (!value) - I_Error("R_PatchSkins: syntax error in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); - - if (!skin) // Get the name! - { - if (!stricmp(stoken, "name")) - { - strlwr(value); - skinnum = R_SkinAvailable(value); - if (skinnum != -1) - skin = &skins[skinnum]; - else - { - CONS_Debug(DBG_SETUP, "R_PatchSkins: unknown skin name in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); - noskincomplain = true; - } - } - } - else // Get the properties! - { - // Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines. - if (!stricmp(stoken, "realname")) - { // Display name (eg. "Knuckles") - realname = true; - STRBUFCPY(skin->realname, value); - SYMBOLCONVERT(skin->realname) - if (!hudname) - HUDNAMEWRITE(skin->realname); - } - else if (!stricmp(stoken, "hudname")) - { // Life icon name (eg. "K.T.E") - hudname = true; - HUDNAMEWRITE(value); - SYMBOLCONVERT(skin->hudname) - if (!realname) - STRBUFCPY(skin->realname, skin->hudname); - } - else if (!R_ProcessPatchableFields(skin, stoken, value)) - CONS_Debug(DBG_SETUP, "R_PatchSkins: Unknown keyword '%s' in P_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename); - } - - if (!skin) - break; - -next_token: - stoken = strtok(NULL, "\r\n= "); - } - free(buf2); - - if (!skin) // Didn't include a name parameter? What a waste. - { - if (!noskincomplain) - CONS_Debug(DBG_SETUP, "R_PatchSkins: no skin name given in P_SKIN lump #%d (WAD %s)\n", lump, wadfiles[wadnum]->filename); - continue; - } - - // Patch sprites - R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); - //ST_LoadFaceGraphics(skinnum); -- nah let's do this elsewhere - - R_FlushTranslationColormapCache(); - - if (!skin->availability) // Safe to print... - CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name); - } - return; -} - -#undef HUDNAMEWRITE -#undef SYMBOLCONVERT +#include "r_skins.c" diff --git a/src/r_things.h b/src/r_things.h index bd6271b60..dd9b227f8 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -14,7 +14,6 @@ #ifndef __R_THINGS__ #define __R_THINGS__ -#include "sounds.h" #include "r_plane.h" #include "r_patch.h" #include "r_portal.h" @@ -82,69 +81,17 @@ typedef struct void R_DrawMasked(maskcount_t* masks, UINT8 nummasks); +// -------------- +// SPRITE LOADING +// -------------- + +boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump); + // ----------- // SKINS STUFF // ----------- -#define SKINNAMESIZE 16 -// should be all lowercase!! S_SKIN processing does a strlwr -#define DEFAULTSKIN "sonic" -#define DEFAULTSKIN2 "tails" // secondary player -#define DEFAULTNIGHTSSKIN 0 -typedef struct -{ - char name[SKINNAMESIZE+1]; // INT16 descriptive name of the skin - UINT16 wadnum; - skinflags_t flags; - - char realname[SKINNAMESIZE+1]; // Display name for level completion. - char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long) - - UINT8 ability; // ability definition - UINT8 ability2; // secondary ability definition - INT32 thokitem; - INT32 spinitem; - INT32 revitem; - INT32 followitem; - fixed_t actionspd; - fixed_t mindash; - fixed_t maxdash; - - fixed_t normalspeed; // Normal ground - fixed_t runspeed; // Speed that you break into your run animation - - UINT8 thrustfactor; // Thrust = thrustfactor * acceleration - UINT8 accelstart; // Acceleration if speed = 0 - UINT8 acceleration; // Acceleration - - fixed_t jumpfactor; // multiple of standard jump height - - fixed_t radius; // Bounding box changes. - fixed_t height; - fixed_t spinheight; - - fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size - fixed_t camerascale; - - // Definable color translation table - UINT8 starttranscolor; - UINT8 prefcolor; - UINT8 supercolor; - UINT8 prefoppositecolor; // if 0 use tables instead - - fixed_t highresscale; // scale of highres, default is 0.5 - UINT8 contspeed; // continue screen animation speed - UINT8 contangle; // initial angle on continue screen - - // specific sounds per skin - sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table - - // contains super versions too - spritedef_t sprites[NUMPLAYERSPRITES*2]; - spriteinfo_t sprinfo[NUMPLAYERSPRITES*2]; - - UINT8 availability; // lock? -} skin_t; +#include "r_skins.h" // ----------- // NOT SKINS STUFF ! @@ -241,24 +188,10 @@ typedef struct drawnode_s struct drawnode_s *prev; } drawnode_t; -extern INT32 numskins; -extern skin_t skins[MAXSKINS]; extern UINT32 visspritecount; -void SetPlayerSkin(INT32 playernum,const char *skinname); -void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002 -boolean R_SkinUsable(INT32 playernum, INT32 skinnum); -UINT32 R_GetSkinAvailabilities(void); -INT32 R_SkinAvailable(const char *name); -void R_PatchSkins(UINT16 wadnum); -void R_AddSkins(UINT16 wadnum); - -UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player); - void R_InitDrawNodes(void); -char *GetPlayerFacePic(INT32 skinnum); - // Functions to go from sprite character ID to frame number // for 2.1 compatibility this still uses the old 'A' + frame code // The use of symbols tends to be painful for wad editors though From b2d9697e070c8d7742fcb9b4a49592517141d256 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 8 Mar 2020 19:36:56 +0000 Subject: [PATCH 21/47] remove r_skins.c include in r_things.c, on second thoughts --- src/r_things.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 17a5f0809..77418e066 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2953,11 +2953,3 @@ void R_DrawMasked(maskcount_t* masks, UINT8 nummasks) free(heads); } - -// ========================================================================== -// -// SKINS CODE -// -// ========================================================================== - -#include "r_skins.c" From 37ecb47436854ece31d049da326bd8e622cd4586 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 8 Mar 2020 19:48:23 +0000 Subject: [PATCH 22/47] update Makefile, CMakeLists.txt and MSVC project files --- src/CMakeLists.txt | 2 ++ src/Makefile | 1 + src/sdl/Srb2SDL-vc10.vcxproj | 2 ++ src/sdl/Srb2SDL-vc10.vcxproj.filters | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8c9c3182..bc4a6114e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,6 +120,7 @@ set(SRB2_CORE_RENDER_SOURCES r_main.c r_plane.c r_segs.c + r_skins.c r_sky.c r_splats.c r_things.c @@ -134,6 +135,7 @@ set(SRB2_CORE_RENDER_SOURCES r_main.h r_plane.h r_segs.h + r_skins.h r_sky.h r_splats.h r_state.h diff --git a/src/Makefile b/src/Makefile index 9f368217c..701f2cfda 100644 --- a/src/Makefile +++ b/src/Makefile @@ -468,6 +468,7 @@ OBJS:=$(i_main_o) \ $(OBJDIR)/r_main.o \ $(OBJDIR)/r_plane.o \ $(OBJDIR)/r_segs.o \ + $(OBJDIR)/r_skins.o \ $(OBJDIR)/r_sky.o \ $(OBJDIR)/r_splats.o \ $(OBJDIR)/r_things.o \ diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index b334f6313..7e260f4c0 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -284,6 +284,7 @@ + @@ -446,6 +447,7 @@ + diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index 3f61e8709..21820551a 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -417,6 +417,9 @@ R_Rend + + R_Rend + R_Rend @@ -849,6 +852,9 @@ R_Rend + + R_Rend + R_Rend From e81ef824d6db33e06a83cd2deedd2ed6547f441a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 8 Mar 2020 19:51:18 +0000 Subject: [PATCH 23/47] Set the "spritename" variable within R_AddSingleSpriteDef rather than externally to it, since R_InstallSpriteLump is the only place it gets used anyway This way we don't have to make it some extern in order for r_skins.c to use it --- src/r_skins.c | 4 ++-- src/r_things.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/r_skins.c b/src/r_skins.c index 48764ff75..2e9548bd7 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -410,7 +410,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski newlastlump++; // load all sprite sets we are aware of... for super! for (sprite2 = 0; sprite2 < free_spr2; sprite2++) - R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump); + R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump); newlastlump--; *lastlump = newlastlump; // okay, make the normal sprite set loading end there @@ -418,7 +418,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski // load all sprite sets we are aware of... for normal stuff. for (sprite2 = 0; sprite2 < free_spr2; sprite2++) - R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[sprite2], wadnum, *lump, *lastlump); + R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, *lump, *lastlump); if (skin->sprites[0].numframes == 0) I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]); diff --git a/src/r_things.c b/src/r_things.c index 77418e066..2fc44faf8 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -234,6 +234,8 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 memset(sprtemp,0xFF, sizeof (sprtemp)); maxframe = (size_t)-1; + spritename = sprname; + // are we 'patching' a sprite already loaded ? // if so, it might patch only certain frames, not all if (spritedef->numframes) // (then spriteframes is not null) @@ -465,11 +467,10 @@ void R_AddSpriteDefs(UINT16 wadnum) // for (i = 0; i < numsprites; i++) { - spritename = sprnames[i]; - if (spritename[4] && wadnum >= (UINT16)spritename[4]) + if (sprnames[i][4] && wadnum >= (UINT16)sprnames[i][4]) continue; - if (R_AddSingleSpriteDef(spritename, &sprites[i], wadnum, start, end)) + if (R_AddSingleSpriteDef(sprnames[i], &sprites[i], wadnum, start, end)) { #ifdef HWRENDER if (rendermode == render_opengl) @@ -478,7 +479,7 @@ void R_AddSpriteDefs(UINT16 wadnum) // if a new sprite was added (not just replaced) addsprites++; #ifndef ZDEBUG - CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", spritename, wadnum); + CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", sprnames[i], wadnum); #endif } } From 1dd4ed4afaa71401fad875e7e702ee8c7535eaa8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 8 Mar 2020 21:17:30 +0000 Subject: [PATCH 24/47] Reorganise r_things.h --- src/r_things.h | 71 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/src/r_things.h b/src/r_things.h index dd9b227f8..05d6fb27b 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -18,21 +18,23 @@ #include "r_patch.h" #include "r_portal.h" #include "r_defs.h" +#include "r_skins.h" -// number of sprite lumps for spritewidth,offset,topoffset lookup tables -// Fab: this is a hack : should allocate the lookup tables per sprite -#define MAXVISSPRITES 2048 // added 2-2-98 was 128 - -#define VISSPRITECHUNKBITS 6 // 2^6 = 64 sprites per chunk -#define VISSPRITESPERCHUNK (1 << VISSPRITECHUNKBITS) -#define VISSPRITEINDEXMASK (VISSPRITESPERCHUNK - 1) +// -------------- +// SPRITE LOADING +// -------------- #define FEETADJUST (4<dispoffset, affects ordering but not drawing } vissprite_t; +extern UINT32 visspritecount; + +// ---------- +// DRAW NODES +// ---------- + // A drawnode is something that points to a 3D floor, 3D side, or masked // middle texture. This is used for sorting with sprites. typedef struct drawnode_s @@ -188,10 +201,12 @@ typedef struct drawnode_s struct drawnode_s *prev; } drawnode_t; -extern UINT32 visspritecount; - void R_InitDrawNodes(void); +// ----------------------- +// SPRITE FRAME CHARACTERS +// ----------------------- + // Functions to go from sprite character ID to frame number // for 2.1 compatibility this still uses the old 'A' + frame code // The use of symbols tends to be painful for wad editors though From f4cb6e1f5ed149bd6484960d2329f24a50bd7e65 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 9 Mar 2020 13:54:56 +0000 Subject: [PATCH 25/47] Include r_skins.h instead of r_things.h in many files where all they wanted from it was skins stuff (oddly enough, this actually revealed some secret file dependencies previously included via r_things.h! I also needed to include d_player.h in r_skins.h itself it seems) --- src/d_netcmd.c | 2 +- src/dehacked.c | 1 + src/f_wipe.c | 1 + src/g_game.c | 2 +- src/hardware/hw3sound.c | 2 +- src/lua_baselib.c | 2 +- src/lua_hooklib.c | 2 +- src/lua_mobjlib.c | 2 +- src/lua_skinlib.c | 2 +- src/m_cond.c | 2 +- src/m_menu.h | 3 ++- src/p_enemy.c | 2 +- src/p_mobj.c | 2 +- src/p_saveg.c | 2 +- src/p_setup.c | 2 +- src/p_spec.c | 2 +- src/p_user.c | 2 +- src/r_skins.h | 1 + src/s_sound.c | 2 +- src/sounds.c | 2 +- src/y_inter.c | 2 +- 21 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c25929929..a55e70287 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -22,7 +22,7 @@ #include "g_input.h" #include "m_menu.h" #include "r_local.h" -#include "r_things.h" +#include "r_skins.h" #include "p_local.h" #include "p_setup.h" #include "s_sound.h" diff --git a/src/dehacked.c b/src/dehacked.c index dea0289b9..e6466f792 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -31,6 +31,7 @@ #include "r_data.h" #include "r_draw.h" #include "r_patch.h" +#include "r_things.h" // R_Char2Frame #include "r_sky.h" #include "fastcmp.h" #include "lua_script.h" diff --git a/src/f_wipe.c b/src/f_wipe.c index 8d12262ef..0fd6c1431 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -16,6 +16,7 @@ #include "i_video.h" #include "v_video.h" +#include "r_state.h" // fadecolormap #include "r_draw.h" // transtable #include "p_pspr.h" // tr_transxxx #include "p_local.h" diff --git a/src/g_game.c b/src/g_game.c index 08192bfb8..1bf76f33f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -38,7 +38,7 @@ #include "byteptr.h" #include "i_joy.h" #include "r_local.h" -#include "r_things.h" +#include "r_skins.h" #include "y_inter.h" #include "v_video.h" #include "dehacked.h" // get_number (for ghost thok) diff --git a/src/hardware/hw3sound.c b/src/hardware/hw3sound.c index f7c6e1da0..7858640c0 100644 --- a/src/hardware/hw3sound.c +++ b/src/hardware/hw3sound.c @@ -28,7 +28,7 @@ #include "../tables.h" #include "../sounds.h" #include "../r_main.h" -#include "../r_things.h" +#include "../r_skins.h" #include "../m_random.h" #include "../p_local.h" #include "hw3dsdrv.h" diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 03f142446..d001408be 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -21,7 +21,7 @@ #include "z_zone.h" #include "r_main.h" #include "r_draw.h" -#include "r_things.h" +#include "r_things.h" // R_Frame2Char etc #include "m_random.h" #include "s_sound.h" #include "g_game.h" diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index efed9adb7..92080e8ed 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -15,7 +15,7 @@ #include "doomstat.h" #include "p_mobj.h" #include "g_game.h" -#include "r_things.h" +#include "r_skins.h" #include "b_bot.h" #include "z_zone.h" diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index a7bd8da94..9e46344cf 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -13,7 +13,7 @@ #include "doomdef.h" #ifdef HAVE_BLUA #include "fastcmp.h" -#include "r_things.h" +#include "r_skins.h" #include "p_local.h" #include "g_game.h" #include "p_setup.h" diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index 3ade06042..f26aed2f0 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -13,7 +13,7 @@ #include "doomdef.h" #ifdef HAVE_BLUA #include "fastcmp.h" -#include "r_things.h" +#include "r_skins.h" #include "sounds.h" #include "lua_script.h" diff --git a/src/m_cond.c b/src/m_cond.c index 89058a488..0abc7adf8 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -18,7 +18,7 @@ #include "v_video.h" // video flags #include "g_game.h" // record info -#include "r_things.h" // numskins +#include "r_skins.h" // numskins #include "r_draw.h" // R_GetColorByName // Map triggers for linedef executors diff --git a/src/m_menu.h b/src/m_menu.h index 18b681ff0..e7270380d 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -15,9 +15,10 @@ #ifndef __X_MENU__ #define __X_MENU__ +#include "doomstat.h" // for NUMGAMETYPES #include "d_event.h" #include "command.h" -#include "r_things.h" // for SKINNAMESIZE +#include "r_skins.h" // for SKINNAMESIZE #include "f_finale.h" // for ttmode_enum // diff --git a/src/p_enemy.c b/src/p_enemy.c index 5d067ebc3..14e5c4d3e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -21,7 +21,7 @@ #include "s_sound.h" #include "m_random.h" #include "m_misc.h" -#include "r_things.h" +#include "r_skins.h" #include "i_video.h" #include "z_zone.h" #include "lua_hook.h" diff --git a/src/p_mobj.c b/src/p_mobj.c index faee245d3..9194cf9f7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -19,7 +19,7 @@ #include "p_local.h" #include "p_setup.h" #include "r_main.h" -#include "r_things.h" +#include "r_skins.h" #include "r_sky.h" #include "r_splats.h" #include "s_sound.h" diff --git a/src/p_saveg.c b/src/p_saveg.c index e8c6c7a84..2cd4bbbef 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -22,7 +22,7 @@ #include "p_setup.h" #include "p_saveg.h" #include "r_data.h" -#include "r_things.h" +#include "r_skins.h" #include "r_state.h" #include "w_wad.h" #include "y_inter.h" diff --git a/src/p_setup.c b/src/p_setup.c index 7b4c6773b..857bb1d43 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -27,7 +27,7 @@ #include "i_system.h" #include "r_data.h" -#include "r_things.h" +#include "r_things.h" // for R_AddSpriteDefs #include "r_patch.h" #include "r_sky.h" #include "r_draw.h" diff --git a/src/p_spec.c b/src/p_spec.c index d9bbab246..aecdb3b98 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -36,7 +36,7 @@ #include "m_cond.h" //unlock triggers #include "lua_hook.h" // LUAh_LinedefExecute #include "f_finale.h" // control text prompt -#include "r_things.h" // skins +#include "r_skins.h" // skins #ifdef HW3SOUND #include "hardware/hw3sound.h" diff --git a/src/p_user.c b/src/p_user.c index 9167d5345..c34d37264 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -22,7 +22,7 @@ #include "p_local.h" #include "r_main.h" #include "s_sound.h" -#include "r_things.h" +#include "r_skins.h" #include "d_think.h" #include "r_sky.h" #include "p_setup.h" diff --git a/src/r_skins.h b/src/r_skins.h index 4b83966ac..96697b422 100644 --- a/src/r_skins.h +++ b/src/r_skins.h @@ -16,6 +16,7 @@ #include "info.h" #include "sounds.h" +#include "d_player.h" // skinflags #include "r_patch.h" // spriteinfo_t #include "r_defs.h" // spritedef_t diff --git a/src/s_sound.c b/src/s_sound.c index 8193fdb9b..8e9461d78 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -27,7 +27,7 @@ extern INT32 msg_id; #include "g_game.h" #include "m_argv.h" #include "r_main.h" // R_PointToAngle2() used to calc stereo sep. -#include "r_things.h" // for skins +#include "r_skins.h" // for skins #include "i_system.h" #include "i_sound.h" #include "s_sound.h" diff --git a/src/sounds.c b/src/sounds.c index a9d720d5c..ca943c2d0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -15,7 +15,7 @@ #include "i_sound.h" #include "sounds.h" #include "r_defs.h" -#include "r_things.h" +#include "r_skins.h" #include "z_zone.h" #include "w_wad.h" #include "lua_script.h" diff --git a/src/y_inter.c b/src/y_inter.c index 36cb64d06..6f23ef1b1 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -19,7 +19,7 @@ #include "i_video.h" #include "p_tick.h" #include "r_defs.h" -#include "r_things.h" +#include "r_skins.h" #include "s_sound.h" #include "st_stuff.h" #include "v_video.h" From e0badd1e5b7dfb89d19a04be82a9543ceb60820e Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:35:21 -0500 Subject: [PATCH 26/47] Rename hook to ShouldJingleContinue --- src/lua_hook.h | 4 ++-- src/lua_hooklib.c | 14 +++++++------- src/p_user.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lua_hook.h b/src/lua_hook.h index ea11d0236..dde8d4c41 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -58,7 +58,7 @@ enum hook { hook_ViewpointSwitch, hook_SeenPlayer, hook_PlayerThink, - hook_JingleStatus, + hook_ShouldJingleContinue, hook_MAX // last hook }; @@ -111,6 +111,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_NAMECHECK #endif #define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink -boolean LUAh_JingleStatus(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing +boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index c56336fca..3a4d67492 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -69,7 +69,7 @@ const char *const hookNames[hook_MAX+1] = { "ViewpointSwitch", "SeenPlayer", "PlayerThink", - "JingleStatus", + "ShouldJingleContinue", NULL }; @@ -81,7 +81,7 @@ struct hook_s UINT16 id; union { mobjtype_t mt; - char *skinname; // also used as musname for JingleStatus... I'm lazy + char *skinname; // also used as musname for ShouldJingleContinue... I'm lazy char *funcname; } s; boolean error; @@ -149,7 +149,7 @@ static int lib_addHook(lua_State *L) luaL_argcheck(L, hook.s.mt < NUMMOBJTYPES, 2, "invalid mobjtype_t"); break; case hook_BotAI: - case hook_JingleStatus: + case hook_ShouldJingleContinue: hook.s.skinname = NULL; if (lua_isstring(L, 2)) { // lowercase copy @@ -1634,11 +1634,11 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend) } #endif // SEENAMES -boolean LUAh_JingleStatus(player_t *player, const char *musname) +boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname) { hook_p hookp; boolean keepplaying = false; - if (!gL || !(hooksAvailable[hook_JingleStatus/8] & (1<<(hook_JingleStatus%8)))) + if (!gL || !(hooksAvailable[hook_ShouldJingleContinue/8] & (1<<(hook_ShouldJingleContinue%8)))) return true; lua_settop(gL, 0); @@ -1646,9 +1646,9 @@ boolean LUAh_JingleStatus(player_t *player, const char *musname) for (hookp = roothook; hookp; hookp = hookp->next) { - if (hookp->type == hook_JingleStatus) CONS_Printf("jingle status hook for %s vs %s\n", hookp->s.skinname, musname); + if (hookp->type == hook_ShouldJingleContinue) CONS_Printf("jingle status hook for %s vs %s\n", hookp->s.skinname, musname); - if (hookp->type != hook_JingleStatus + if (hookp->type != hook_ShouldJingleContinue || (hookp->s.skinname && strcmp(hookp->s.skinname, musname))) continue; diff --git a/src/p_user.c b/src/p_user.c index ab85897a5..b7b95f9f0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1599,7 +1599,7 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) break; case JT_OTHER: // Other state - result = LUAh_JingleStatus(&players[i], musname); + result = LUAh_ShouldJingleContinue(&players[i], musname); break; case JT_NONE: // Null state From dd0d86120b09c2a2f7d2a06c34f9abbf82d5111c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:38:18 -0500 Subject: [PATCH 27/47] > building SRB2 without Lua in 2020 --- src/p_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index b7b95f9f0..3694a1a3b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1599,8 +1599,10 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) break; case JT_OTHER: // Other state +#ifdef HAVE_BLUA result = LUAh_ShouldJingleContinue(&players[i], musname); break; +#endif case JT_NONE: // Null state case JT_MASTER: // Main level music From 647f73c8f26d66370de86723b80428efbfb1f7f3 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:38:51 -0500 Subject: [PATCH 28/47] Clean up after myself --- src/lua_hooklib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 3a4d67492..4f873dd99 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -1646,8 +1646,6 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname) for (hookp = roothook; hookp; hookp = hookp->next) { - if (hookp->type == hook_ShouldJingleContinue) CONS_Printf("jingle status hook for %s vs %s\n", hookp->s.skinname, musname); - if (hookp->type != hook_ShouldJingleContinue || (hookp->s.skinname && strcmp(hookp->s.skinname, musname))) continue; From 520e3c5dc32e1970c339be3b2fc9eee80ab168bb Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:40:11 -0500 Subject: [PATCH 29/47] Are these casts unnecessary...?? --- src/lua_baselib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index b6fa1b7aa..4694b56ba 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1043,7 +1043,7 @@ static int lib_pSetObjectMomZ(lua_State *L) static int lib_pPlayJingle(lua_State *L) { player_t *player = NULL; - jingletype_t jingletype = (jingletype_t)luaL_checkinteger(L, 2); + jingletype_t jingletype = luaL_checkinteger(L, 2); //NOHUD //INLEVEL if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) @@ -1065,7 +1065,7 @@ static int lib_pPlayJingleMusic(lua_State *L) char musname[7], *p = musname; UINT16 musflags = luaL_optinteger(L, 3, 0); boolean looping = lua_opttrueboolean(L, 4); - jingletype_t jingletype = (jingletype_t)luaL_optinteger(L, 5, JT_OTHER); + jingletype_t jingletype = luaL_optinteger(L, 5, JT_OTHER); //NOHUD //INLEVEL if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) From 9c86cd0bc2e7895d9c46b79cb5e368e74dece2b0 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:42:31 -0500 Subject: [PATCH 30/47] More union types for the union type god --- src/lua_hooklib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 4f873dd99..2843b0228 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -81,7 +81,8 @@ struct hook_s UINT16 id; union { mobjtype_t mt; - char *skinname; // also used as musname for ShouldJingleContinue... I'm lazy + char *skinname; + char *musname; char *funcname; } s; boolean error; @@ -1647,7 +1648,7 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname) for (hookp = roothook; hookp; hookp = hookp->next) { if (hookp->type != hook_ShouldJingleContinue - || (hookp->s.skinname && strcmp(hookp->s.skinname, musname))) + || (hookp->s.musname && strcmp(hookp->s.musname, musname))) continue; if (lua_gettop(gL) == 0) From 725826a64b6d56a04b7fd17e1e1ef4c20243047d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 18 Mar 2020 22:56:20 -0500 Subject: [PATCH 31/47] Avoid infinite loops if no maps are selectable (y tho) --- src/m_menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index b39fcc2bf..3ebaedca2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5373,9 +5373,10 @@ static void M_HandleLevelPlatter(INT32 choice) case KEY_RIGHTARROW: if (levellistmode == LLM_CREATESERVER && !lsrow) { + INT32 startinggametype = cv_newgametype.value; do CV_AddValue(&cv_newgametype, 1); - while (!M_GametypeHasLevels(cv_newgametype.value)); + while (cv_newgametype.value != startinggametype && !M_GametypeHasLevels(cv_newgametype.value)); S_StartSound(NULL,sfx_menu1); lscol = 0; From e3cbdf8fabd34ff8c5cf7fc98fde2d377c6eedff Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 19 Mar 2020 18:36:14 +0100 Subject: [PATCH 32/47] Use HAVE_BLUA as fuel for my fireplace --- src/CMakeLists.txt | 163 ++-- src/Makefile | 6 +- src/b_bot.c | 4 - src/blua/Makefile.cfg | 2 - src/command.c | 6 - src/d_clisrv.c | 20 - src/d_clisrv.h | 2 - src/d_main.c | 8 - src/d_net.c | 4 - src/d_netcmd.c | 20 +- src/d_netcmd.h | 2 - src/d_netfil.c | 8 - src/d_netfil.h | 2 - src/dehacked.c | 65 +- src/dehacked.h | 2 - src/doomstat.h | 1 - src/f_finale.c | 8 - src/f_wipe.c | 2 - src/filesrch.h | 2 +- src/g_game.c | 16 +- src/hu_stuff.c | 31 +- src/lua_baselib.c | 3 - src/lua_blockmaplib.c | 3 - src/lua_consolelib.c | 3 - src/lua_hook.h | 4 - src/lua_hooklib.c | 3 - src/lua_hudlib.c | 3 - src/lua_infolib.c | 3 - src/lua_libs.h | 4 - src/lua_maplib.c | 3 - src/lua_mathlib.c | 3 - src/lua_mobjlib.c | 3 - src/lua_playerlib.c | 3 - src/lua_script.c | 3 - src/lua_script.h | 4 - src/lua_skinlib.c | 3 - src/lua_thinkerlib.c | 3 - src/m_cheat.c | 4 +- src/m_cheat.h | 2 +- src/m_menu.c | 6 - src/p_enemy.c | 765 +++++------------- src/p_inter.c | 20 - src/p_map.c | 11 +- src/p_mobj.c | 225 +++--- src/p_saveg.c | 6 - src/p_setup.c | 8 - src/p_spec.c | 4 - src/p_tick.c | 15 +- src/p_user.c | 171 ++-- src/s_sound.c | 4 +- src/sdl/Srb2SDL-vc9.vcproj | 8 +- .../macosx/Srb2mac.xcodeproj/project.pbxproj | 2 - src/st_stuff.c | 126 +-- src/w_wad.c | 15 +- src/win32/Srb2win-vc9.vcproj | 8 +- src/y_inter.c | 10 - src/z_zone.c | 2 - 57 files changed, 513 insertions(+), 1324 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b95fdd9e7..372341291 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -216,8 +216,6 @@ source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES}) ### Configuration -set(SRB2_CONFIG_HAVE_BLUA ON CACHE BOOL - "Enable Lua interpreter support") set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL "Enable PNG support. Depends on zlib, so will be disabled if you don't enable that too.") set(SRB2_CONFIG_HAVE_ZLIB ON CACHE BOOL @@ -241,93 +239,90 @@ if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only "Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT).") endif() -if(${SRB2_CONFIG_HAVE_BLUA}) - add_definitions(-DHAVE_BLUA) - set(SRB2_LUA_SOURCES - lua_baselib.c - lua_blockmaplib.c - lua_consolelib.c - lua_hooklib.c - lua_hudlib.c - lua_infolib.c - lua_maplib.c - lua_mathlib.c - lua_mobjlib.c - lua_playerlib.c - lua_script.c - lua_skinlib.c - lua_thinkerlib.c - ) - set(SRB2_LUA_HEADERS - lua_hook.h - lua_hud.h - lua_libs.h - lua_script.h - ) +set(SRB2_LUA_SOURCES + lua_baselib.c + lua_blockmaplib.c + lua_consolelib.c + lua_hooklib.c + lua_hudlib.c + lua_infolib.c + lua_maplib.c + lua_mathlib.c + lua_mobjlib.c + lua_playerlib.c + lua_script.c + lua_skinlib.c + lua_thinkerlib.c +) +set(SRB2_LUA_HEADERS + lua_hook.h + lua_hud.h + lua_libs.h + lua_script.h +) - prepend_sources(SRB2_LUA_SOURCES) - prepend_sources(SRB2_LUA_HEADERS) +prepend_sources(SRB2_LUA_SOURCES) +prepend_sources(SRB2_LUA_HEADERS) - source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS}) +source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS}) - set(SRB2_BLUA_SOURCES - blua/lapi.c - blua/lauxlib.c - blua/lbaselib.c - blua/lcode.c - blua/ldebug.c - blua/ldo.c - blua/ldump.c - blua/lfunc.c - blua/lgc.c - blua/linit.c - blua/liolib.c - blua/llex.c - blua/lmem.c - blua/lobject.c - blua/lopcodes.c - blua/lparser.c - blua/lstate.c - blua/lstring.c - blua/lstrlib.c - blua/ltable.c - blua/ltablib.c - blua/ltm.c - blua/lundump.c - blua/lvm.c - blua/lzio.c - ) - set(SRB2_BLUA_HEADERS - blua/lapi.h - blua/lauxlib.h - blua/lcode.h - blua/ldebug.h - blua/ldo.h - blua/lfunc.h - blua/lgc.h - blua/llex.h - blua/llimits.h - blua/lmem.h - blua/lobject.h - blua/lopcodes.h - blua/lparser.h - blua/lstate.h - blua/lstring.h - blua/ltable.h - blua/ltm.h - blua/lua.h - blua/luaconf.h - blua/lualib.h - blua/lundump.h - blua/lvm.h - blua/lzio.h - ) +set(SRB2_BLUA_SOURCES + blua/lapi.c + blua/lauxlib.c + blua/lbaselib.c + blua/lcode.c + blua/ldebug.c + blua/ldo.c + blua/ldump.c + blua/lfunc.c + blua/lgc.c + blua/linit.c + blua/liolib.c + blua/llex.c + blua/lmem.c + blua/lobject.c + blua/lopcodes.c + blua/lparser.c + blua/lstate.c + blua/lstring.c + blua/lstrlib.c + blua/ltable.c + blua/ltablib.c + blua/ltm.c + blua/lundump.c + blua/lvm.c + blua/lzio.c +) +set(SRB2_BLUA_HEADERS + blua/lapi.h + blua/lauxlib.h + blua/lcode.h + blua/ldebug.h + blua/ldo.h + blua/lfunc.h + blua/lgc.h + blua/llex.h + blua/llimits.h + blua/lmem.h + blua/lobject.h + blua/lopcodes.h + blua/lparser.h + blua/lstate.h + blua/lstring.h + blua/ltable.h + blua/ltm.h + blua/lua.h + blua/luaconf.h + blua/lualib.h + blua/lundump.h + blua/lvm.h + blua/lzio.h +) - prepend_sources(SRB2_BLUA_SOURCES) - prepend_sources(SRB2_BLUA_HEADERS) +prepend_sources(SRB2_BLUA_SOURCES) +prepend_sources(SRB2_BLUA_HEADERS) - source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS}) -endif() +source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS}) if(${SRB2_CONFIG_HAVE_GME}) if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) diff --git a/src/Makefile b/src/Makefile index 701f2cfda..1ebd39ac4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -340,9 +340,7 @@ CFLAGS+=-DHAVE_MINIUPNPC endif endif -ifndef NO_LUA - include blua/Makefile.cfg -endif +include blua/Makefile.cfg ifdef NOMD5 OPTS+=-DNOMD5 @@ -683,9 +681,7 @@ $(OBJDIR)/depend.dep: ifndef NOHW $(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped endif -ifndef NO_LUA $(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped -endif @sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep $(REMOVE) $(OBJDIR)/depend.ped @echo "Created dependency file, depend.dep" diff --git a/src/b_bot.c b/src/b_bot.c index 4f904b672..4fefbdcb6 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -74,11 +74,9 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) if (!sonic || sonic->health <= 0) return; -#ifdef HAVE_BLUA // Lua can handle it! if (LUAh_BotAI(sonic, tails, cmd)) return; -#endif if (tails->player->powers[pw_carry] == CR_MACESPIN || tails->player->powers[pw_carry] == CR_GENERIC) { @@ -364,11 +362,9 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd) // Bot AI isn't programmed in analog. CV_SetValue(&cv_analog[1], false); -#ifdef HAVE_BLUA // Let Lua scripts build ticcmds if (LUAh_BotTiccmd(player, cmd)) return; -#endif // We don't have any main character AI, sorry. D: if (player-players == consoleplayer) diff --git a/src/blua/Makefile.cfg b/src/blua/Makefile.cfg index 659faf3c8..12ea064b4 100644 --- a/src/blua/Makefile.cfg +++ b/src/blua/Makefile.cfg @@ -10,8 +10,6 @@ WFLAGS+=-Wno-logical-op endif endif -OPTS+=-DHAVE_BLUA - OBJS:=$(OBJS) \ $(OBJDIR)/lapi.o \ $(OBJDIR)/lbaselib.o \ diff --git a/src/command.c b/src/command.c index d1eea6052..72dc9f769 100644 --- a/src/command.c +++ b/src/command.c @@ -481,13 +481,11 @@ void COM_AddCommand(const char *name, com_func_t func) { if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase! { -#ifdef HAVE_BLUA // don't I_Error for Lua commands // Lua commands can replace game commands, and they have priority. // BUT, if for some reason we screwed up and made two console commands with the same name, // it's good to have this here so we find out. if (cmd->function != COM_Lua_f) -#endif I_Error("Command %s already exists\n", name); return; @@ -501,7 +499,6 @@ void COM_AddCommand(const char *name, com_func_t func) com_commands = cmd; } -#ifdef HAVE_BLUA /** Adds a console command for Lua. * No I_Errors allowed; return a negative code instead. * @@ -534,7 +531,6 @@ int COM_AddLuaCommand(const char *name) com_commands = cmd; return 0; } -#endif /** Tests if a command exists. * @@ -1427,9 +1423,7 @@ finish: } var->flags |= CV_MODIFIED; // raise 'on change' code -#ifdef HAVE_BLUA LUA_CVarChanged(var->name); // let consolelib know what cvar this is. -#endif if (var->flags & CV_CALL && !stealth) var->func(); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index b706b5467..aa5d4cb9a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2547,20 +2547,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason) } } -#ifdef HAVE_BLUA LUAh_PlayerQuit(&players[playernum], reason); // Lua hook for player quitting -#else - (void)reason; -#endif // don't look through someone's view who isn't there if (playernum == displayplayer) { -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); -#endif displayplayer = consoleplayer; } @@ -2581,9 +2575,7 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason) RemoveAdminPlayer(playernum); // don't stay admin after you're gone } -#ifdef HAVE_BLUA LUA_InvalidatePlayer(&players[playernum]); -#endif if (G_TagGametype()) //Check if you still have a game. Location flexible. =P P_CheckSurvivors(); @@ -3177,9 +3169,7 @@ void SV_ResetServer(void) for (i = 0; i < MAXPLAYERS; i++) { -#ifdef HAVE_BLUA LUA_InvalidatePlayer(&players[i]); -#endif playeringame[i] = false; playernode[i] = UINT8_MAX; memset(playeraddress[i], 0, sizeof(*playeraddress)); @@ -3240,10 +3230,8 @@ void D_QuitNetGame(void) // abort send/receive of files CloseNetFile(); -#ifdef HAVE_BLUA RemoveAllLuaFileTransfers(); waitingforluafiletransfer = false; -#endif if (server) { @@ -3414,10 +3402,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) if (server && multiplayer && motd[0] != '\0') COM_BufAddText(va("sayto %d %s\n", newplayernum, motd)); -#ifdef HAVE_BLUA if (!rejoined) LUAh_PlayerJoin(newplayernum); -#endif } static boolean SV_AddWaitingPlayers(const char *name, const char *name2) @@ -3625,10 +3611,8 @@ static void HandleConnect(SINT8 node) SV_SendRefuse(node, M_GetText("Too many players from\nthis node.")); else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join? SV_SendRefuse(node, M_GetText("No players from\nthis node.")); -#ifdef HAVE_BLUA else if (luafiletransfers) SV_SendRefuse(node, M_GetText("The server is broadcasting a file\nrequested by a Lua script.\nPlease wait a bit and then\ntry rejoining.")); -#endif else { #ifndef NONET @@ -4215,7 +4199,6 @@ static void HandlePacketFromPlayer(SINT8 node) Net_CloseConnection(node); nodeingame[node] = false; break; -#ifdef HAVE_BLUA case PT_ASKLUAFILE: if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_ASKED) { @@ -4228,7 +4211,6 @@ static void HandlePacketFromPlayer(SINT8 node) if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_SENDING) SV_HandleLuaFileSent(node); break; -#endif // -------------------------------------------- CLIENT RECEIVE ---------- case PT_RESYNCHEND: // Only accept PT_RESYNCHEND from the server. @@ -4356,12 +4338,10 @@ static void HandlePacketFromPlayer(SINT8 node) if (client) Got_Filetxpak(); break; -#ifdef HAVE_BLUA case PT_SENDINGLUAFILE: if (client) CL_PrepareDownloadLuaFile(); break; -#endif default: DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n", netbuffer->packettype, node)); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index b5cc00152..30d562bed 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -67,11 +67,9 @@ typedef enum PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic PT_RESYNCHGET, // Player got resynch packet -#ifdef HAVE_BLUA PT_SENDINGLUAFILE, // Server telling a client Lua needs to open a file PT_ASKLUAFILE, // Client telling the server they don't have the file PT_HASLUAFILE, // Client telling the server they have the file -#endif // Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility. diff --git a/src/d_main.c b/src/d_main.c index 9cbcdc0c6..40e7af22a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -91,9 +91,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...); #include "hardware/hw3sound.h" #endif -#ifdef HAVE_BLUA #include "lua_script.h" -#endif // platform independant focus loss UINT8 window_notinfocus = false; @@ -746,9 +744,7 @@ void D_SRB2Loop(void) HW3S_EndFrameUpdate(); #endif -#ifdef HAVE_BLUA LUA_Step(); -#endif } } @@ -1124,9 +1120,7 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, srb2home, PATHSEP); -#ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home); -#endif #else // DEFAULTDIR snprintf(srb2home, sizeof srb2home, "%s", userhome); snprintf(downloaddir, sizeof downloaddir, "%s", userhome); @@ -1138,9 +1132,7 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, userhome, PATHSEP); -#ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome); -#endif #endif // DEFAULTDIR } diff --git a/src/d_net.c b/src/d_net.c index 77a58e9bd..1db75f3da 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -715,10 +715,8 @@ void Net_CloseConnection(INT32 node) InitNode(&nodes[node]); SV_AbortSendFiles(node); -#ifdef HAVE_BLUA if (server) SV_AbortLuaFileTransfer(node); -#endif I_NetFreeNodenum(node); #endif } @@ -803,11 +801,9 @@ static const char *packettypename[NUMPACKETTYPE] = "RESYNCHEND", "RESYNCHGET", -#ifdef HAVE_BLUA "SENDINGLUAFILE", "ASKLUAFILE", "HASLUAFILE", -#endif "FILEFRAGMENT", "TEXTCMD", diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5ad972b29..aaa01c57f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -157,10 +157,8 @@ static void Command_Isgamemodified_f(void); static void Command_Cheats_f(void); #ifdef _DEBUG static void Command_Togglemodified_f(void); -#ifdef HAVE_BLUA static void Command_Archivetest_f(void); #endif -#endif // ========================================================================= // CLIENT VARIABLES @@ -415,11 +413,9 @@ const char *netxcmdnames[MAXNETXCMD - 1] = "DELFILE", // replace next time we add an XD "SETMOTD", "SUICIDE", -#ifdef HAVE_BLUA "LUACMD", "LUAVAR", "LUAFILE" -#endif }; // ========================================================================= @@ -452,10 +448,8 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_PAUSE, Got_Pause); RegisterNetXCmd(XD_SUICIDE, Got_Suicide); RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd); -#ifdef HAVE_BLUA RegisterNetXCmd(XD_LUACMD, Got_Luacmd); RegisterNetXCmd(XD_LUAFILE, Got_LuaFile); -#endif // Remote Administration COM_AddCommand("password", Command_Changepassword_f); @@ -504,9 +498,7 @@ void D_RegisterServerCommands(void) COM_AddCommand("cheats", Command_Cheats_f); // test #ifdef _DEBUG COM_AddCommand("togglemodified", Command_Togglemodified_f); -#ifdef HAVE_BLUA COM_AddCommand("archivetest", Command_Archivetest_f); -#endif #endif // for master server connection @@ -915,7 +907,7 @@ void D_RegisterClientCommands(void) #ifdef _DEBUG COM_AddCommand("causecfail", Command_CauseCfail_f); #endif -#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) +#ifdef LUA_ALLOW_BYTECODE COM_AddCommand("dumplua", Command_Dumplua_f); #endif } @@ -2029,9 +2021,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) UINT8 flags; INT32 resetplayer = 1, lastgametype; UINT8 skipprecutscene, FLS; -#ifdef HAVE_BLUA INT16 mapnumber; -#endif if (playernum != serverplayer && !IsPlayerAdmin(playernum)) { @@ -2093,10 +2083,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) CV_StealthSetValue(&cv_playercolor, players[0].skincolor); } -#ifdef HAVE_BLUA mapnumber = M_MapNumber(mapname[3], mapname[4]); LUAh_MapChange(mapnumber); -#endif G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS); if (demoplayback && !timingdemo) @@ -2680,11 +2668,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) return; } -#ifdef HAVE_BLUA // Don't switch team, just go away, please, go awaayyyy, aaauuauugghhhghgh if (!LUAh_TeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled)) return; -#endif //no status changes after hidetime if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE))) @@ -2841,12 +2827,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) //reset view if you are changed, or viewing someone who was changed. if (playernum == consoleplayer || displayplayer == playernum) { -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal. LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); -#endif displayplayer = consoleplayer; } @@ -4332,7 +4316,6 @@ static void Command_Togglemodified_f(void) modifiedgame = !modifiedgame; } -#ifdef HAVE_BLUA extern UINT8 *save_p; static void Command_Archivetest_f(void) { @@ -4377,7 +4360,6 @@ static void Command_Archivetest_f(void) CONS_Printf("Done. No crash.\n"); } #endif -#endif /** Makes a change to ::cv_forceskin take effect immediately. * diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 6e6ae0c0a..897c28968 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -142,11 +142,9 @@ typedef enum XD_SETMOTD, // 19 XD_SUICIDE, // 20 XD_DEMOTED, // 21 -#ifdef HAVE_BLUA XD_LUACMD, // 22 XD_LUAVAR, // 23 XD_LUAFILE, // 24 -#endif MAXNETXCMD } netxcmd_t; diff --git a/src/d_netfil.c b/src/d_netfil.c index 9ce423cd4..6d3ac7f9d 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -95,11 +95,9 @@ char downloaddir[512] = "DOWNLOAD"; INT32 lastfilenum = -1; #endif -#ifdef HAVE_BLUA luafiletransfer_t *luafiletransfers = NULL; boolean waitingforluafiletransfer = false; char luafiledir[256 + 16] = "luafiles"; -#endif /** Fills a serverinfo packet with information about wad files loaded. @@ -458,7 +456,6 @@ void CL_LoadServerFiles(void) } } -#ifdef HAVE_BLUA void AddLuaFileTransfer(const char *filename, const char *mode) { luafiletransfer_t **prevnext; // A pointer to the "next" field of the last transfer in the list @@ -614,7 +611,6 @@ void CL_PrepareDownloadLuaFile(void) // Make sure all directories in the file path exist MakePathDirs(fileneeded[0].filename); } -#endif // Number of files to send // Little optimization to quickly test if there is a file in the queue @@ -749,7 +745,6 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI filestosend++; } -#ifdef HAVE_BLUA /** Adds a file requested by Lua to the file list for a node * * \param node The node to send the file to @@ -798,7 +793,6 @@ boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode) filestosend++; return true; } -#endif /** Stops sending a file for a node, and removes the file request from the list, * either because the file has been fully sent or because the node was disconnected @@ -1035,14 +1029,12 @@ void Got_Filetxpak(void) file->status = FS_FOUND; CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename); -#ifdef HAVE_BLUA if (luafiletransfers) { // Tell the server we have received the file netbuffer->packettype = PT_HASLUAFILE; HSendPacket(servernode, true, 0, 0); } -#endif } } else diff --git a/src/d_netfil.h b/src/d_netfil.h index f0a7cf8cc..7d6efada0 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -72,7 +72,6 @@ boolean CL_CheckDownloadable(void); boolean CL_SendRequestFile(void); boolean Got_RequestFilePak(INT32 node); -#ifdef HAVE_BLUA typedef enum { LFTNS_WAITING, // This node is waiting for the server to send the file @@ -108,7 +107,6 @@ void Got_LuaFile(UINT8 **cp, INT32 playernum); void StoreLuaFileCallback(INT32 id); void RemoveLuaFileCallback(INT32 id); void MakePathDirs(char *path); -#endif void SV_AbortSendFiles(INT32 node); void CloseNetFile(void); diff --git a/src/dehacked.c b/src/dehacked.c index ab9bd136b..588b78142 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -40,9 +40,7 @@ #include "m_cond.h" -#ifdef HAVE_BLUA #include "v_video.h" // video flags (for lua) -#endif #ifdef HWRENDER #include "hardware/hw_light.h" @@ -77,10 +75,8 @@ static UINT16 get_mus(const char *word, UINT8 dehacked_mode); #endif static hudnum_t get_huditem(const char *word); static menutype_t get_menutype(const char *word); -#ifndef HAVE_BLUA -static INT16 get_gametype(const char *word); -static powertype_t get_power(const char *word); -#endif +//static INT16 get_gametype(const char *word); +//static powertype_t get_power(const char *word); boolean deh_loaded = false; static int dbg_line; @@ -1416,7 +1412,6 @@ static void readlevelheader(MYFILE *f, INT32 num) // Lua custom options also go above, contents may be case sensitive. if (fastncmp(word, "LUA.", 4)) { -#ifdef HAVE_BLUA UINT8 j; customoption_t *modoption; @@ -1450,9 +1445,6 @@ static void readlevelheader(MYFILE *f, INT32 num) modoption->option[31] = '\0'; strncpy(modoption->value, word2, 255); modoption->value[255] = '\0'; -#else - // Silently ignore. -#endif continue; } @@ -3124,22 +3116,20 @@ static void readframe(MYFILE *f, INT32 num) } z = 0; -#ifdef HAVE_BLUA found = LUA_SetLuaAction(&states[num], actiontocompare); if (!found) -#endif - while (actionpointers[z].name) - { - if (fastcmp(actiontocompare, actionpointers[z].name)) + while (actionpointers[z].name) { - states[num].action = actionpointers[z].action; - states[num].action.acv = actionpointers[z].action.acv; // assign - states[num].action.acp1 = actionpointers[z].action.acp1; - found = true; - break; + if (fastcmp(actiontocompare, actionpointers[z].name)) + { + states[num].action = actionpointers[z].action; + states[num].action.acv = actionpointers[z].action.acv; // assign + states[num].action.acp1 = actionpointers[z].action.acp1; + found = true; + break; + } + z++; } - z++; - } if (!found) deh_warning("Unknown action %s", actiontocompare); @@ -8849,14 +8839,12 @@ static const char *const MOBJEFLAG_LIST[] = { NULL }; -#ifdef HAVE_BLUA static const char *const MAPTHINGFLAG_LIST[4] = { "EXTRA", // Extra flag for objects. "OBJECTFLIP", // Reverse gravity flag for objects. "OBJECTSPECIAL", // Special flag used with certain objects. "AMBUSH" // Deaf monsters/do not react to sound. }; -#endif static const char *const PLAYERFLAG_LIST[] = { @@ -8953,7 +8941,6 @@ static const char *const GAMETYPERULE_LIST[] = { NULL }; -#ifdef HAVE_BLUA // Linedef flags static const char *const ML_LIST[16] = { "IMPASSIBLE", @@ -8973,7 +8960,6 @@ static const char *const ML_LIST[16] = { "BOUNCY", "TFERLINE" }; -#endif // This DOES differ from r_draw's Color_Names, unfortunately. // Also includes Super colors @@ -9272,11 +9258,7 @@ static const char *const MENUTYPES_LIST[] = { struct { const char *n; // has to be able to hold both fixed_t and angle_t, so drastic measure!! -#ifdef HAVE_BLUA lua_Integer v; -#else - INT64 v; -#endif } const INT_CONST[] = { // If a mod removes some variables here, // please leave the names in-tact and just set @@ -9532,7 +9514,6 @@ struct { {"ME_ULTIMATE",ME_ULTIMATE}, {"ME_PERFECT",ME_PERFECT}, -#ifdef HAVE_BLUA // p_local.h constants {"FLOATSPEED",FLOATSPEED}, {"MAXSTEPMOVE",MAXSTEPMOVE}, @@ -9865,7 +9846,6 @@ struct { {"TC_RAINBOW",TC_RAINBOW}, {"TC_BLINK",TC_BLINK}, {"TC_DASHMODE",TC_DASHMODE}, -#endif {NULL,0} }; @@ -10022,8 +10002,7 @@ static menutype_t get_menutype(const char *word) return MN_NONE; } -#ifndef HAVE_BLUA -static INT16 get_gametype(const char *word) +/*static INT16 get_gametype(const char *word) { // Returns the value of GT_ enumerations INT16 i; if (*word >= '0' && *word <= '9') @@ -10049,7 +10028,7 @@ static powertype_t get_power(const char *word) return i; deh_warning("Couldn't find power named 'pw_%s'",word); return pw_invulnerability; -} +}*/ /// \todo Make ANY of this completely over-the-top math craziness obey the order of operations. static fixed_t op_mul(fixed_t a, fixed_t b) { return a*b; } @@ -10077,7 +10056,7 @@ struct { }; // Returns the full word, cut at the first symbol or whitespace -static char *read_word(const char *line) +/*static char *read_word(const char *line) { // Part 1: You got the start of the word, now find the end. const char *p; @@ -10307,16 +10286,14 @@ static fixed_t find_const(const char **rword) const_warning("constant",word); free(word); return 0; -} -#endif +}*/ // Loops through every constant and operation in word and performs its calculations, returning the final value. fixed_t get_number(const char *word) { -#ifdef HAVE_BLUA return LUA_EvalMath(word); -#else - // DESPERATELY NEEDED: Order of operations support! :x + + /*// DESPERATELY NEEDED: Order of operations support! :x fixed_t i = find_const(&word); INT32 o; while(*word) { @@ -10326,8 +10303,7 @@ fixed_t get_number(const char *word) else break; } - return i; -#endif + return i;*/ } void DEH_Check(void) @@ -10352,7 +10328,6 @@ void DEH_Check(void) #endif } -#ifdef HAVE_BLUA #include "lua_script.h" #include "lua_libs.h" @@ -10978,5 +10953,3 @@ void LUA_SetActionByName(void *state, const char *actiontocompare) } } } - -#endif // HAVE_BLUA diff --git a/src/dehacked.h b/src/dehacked.h index 80c31f3de..54225f36e 100644 --- a/src/dehacked.h +++ b/src/dehacked.h @@ -34,11 +34,9 @@ void DEH_Check(void); fixed_t get_number(const char *word); -#ifdef HAVE_BLUA boolean LUA_SetLuaAction(void *state, const char *actiontocompare); const char *LUA_GetActionName(void *action); void LUA_SetActionByName(void *state, const char *actiontocompare); -#endif extern boolean deh_loaded; diff --git a/src/doomstat.h b/src/doomstat.h index b7388fd96..893514b32 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -493,7 +493,6 @@ extern UINT16 emeralds; #define EMERALD7 64 #define ALL7EMERALDS(v) ((v & (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) == (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) -// yes, even in non HAVE_BLUA #define NUM_LUABANKS 16 // please only make this number go up between versions, never down. you'll break saves otherwise. also, must fit in UINT8 extern INT32 luabanks[NUM_LUABANKS]; diff --git a/src/f_finale.c b/src/f_finale.c index c98d49842..95535a7ea 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -39,9 +39,7 @@ #include "fastcmp.h" #include "console.h" -#ifdef HAVE_BLUA #include "lua_hud.h" -#endif // Stage of animation: // 0 = text, 1 = art screen @@ -2762,11 +2760,7 @@ void F_TitleScreenDrawer(void) // rei|miru: use title pics? hidepics = curhidepics; if (hidepics) -#ifdef HAVE_BLUA goto luahook; -#else - return; -#endif switch(curttmode) { @@ -3488,10 +3482,8 @@ void F_TitleScreenDrawer(void) break; } -#ifdef HAVE_BLUA luahook: LUAh_TitleHUD(); -#endif } // separate animation timer for backgrounds, since we also count diff --git a/src/f_wipe.c b/src/f_wipe.c index 0fd6c1431..08d7ed991 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -33,9 +33,7 @@ #include "doomstat.h" -#ifdef HAVE_BLUA #include "lua_hud.h" // level title -#endif #ifdef HWRENDER #include "hardware/hw_main.h" diff --git a/src/filesrch.h b/src/filesrch.h index 4186271b0..dfea8979e 100644 --- a/src/filesrch.h +++ b/src/filesrch.h @@ -60,7 +60,7 @@ typedef enum #endif EXT_PK3, EXT_SOC, - EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt + EXT_LUA, NUM_EXT, NUM_EXT_TABLE = NUM_EXT-EXT_START, EXT_LOADED = 0x80 diff --git a/src/g_game.c b/src/g_game.c index 030892223..bf73f6ce2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -47,9 +47,7 @@ #include "m_cond.h" // condition sets #include "md5.h" // demo checksums -#ifdef HAVE_BLUA #include "lua_hud.h" -#endif gameaction_t gameaction; gamestate_t gamestate = GS_NULL; @@ -177,7 +175,7 @@ static boolean retryingmodeattack = false; UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage. UINT16 emeralds; -INT32 luabanks[NUM_LUABANKS]; // yes, even in non HAVE_BLUA +INT32 luabanks[NUM_LUABANKS]; UINT32 token; // Number of tokens collected in a level UINT32 tokenlist; // List of tokens collected boolean gottoken; // Did you get a token? Used for end of act @@ -1714,11 +1712,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) if (ssplayer == 1 && (cmd->forwardmove || cmd->sidemove || cmd->buttons) && displayplayer != consoleplayer) { -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. LUAh_ViewpointSwitch(player, &players[consoleplayer], true); -#endif displayplayer = consoleplayer; } } @@ -2048,9 +2044,7 @@ boolean G_Responder(event_t *ev) && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1])) { // ViewpointSwitch Lua hook. -#ifdef HAVE_BLUA UINT8 canSwitchView = 0; -#endif if (splitscreen || !netgame) displayplayer = consoleplayer; @@ -2066,14 +2060,12 @@ boolean G_Responder(event_t *ev) if (!playeringame[displayplayer]) continue; -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. canSwitchView = LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], false); if (canSwitchView == 1) // Set viewpoint to this player break; else if (canSwitchView == 2) // Skip this player continue; -#endif if (players[displayplayer].spectator) continue; @@ -2673,9 +2665,7 @@ void G_SpawnPlayer(INT32 playernum) P_SpawnPlayer(playernum); G_MovePlayerToSpawnOrStarpost(playernum); -#ifdef HAVE_BLUA LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :) -#endif } void G_MovePlayerToSpawnOrStarpost(INT32 playernum) @@ -3029,9 +3019,7 @@ void G_DoReborn(INT32 playernum) } else { -#ifdef HAVE_BLUA LUAh_MapChange(gamemap); -#endif titlecardforreload = true; G_DoLoadLevel(true); titlecardforreload = false; @@ -6803,9 +6791,7 @@ void G_DoPlayDemo(char *defdemoname) // Set skin SetPlayerSkin(0, skin); -#ifdef HAVE_BLUA LUAh_MapChange(gamemap); -#endif displayplayer = consoleplayer = 0; memset(playeringame,0,sizeof(playeringame)); playeringame[0] = true; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 98f3ca5a9..6aa5a4510 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -47,10 +47,8 @@ #include "hardware/hw_main.h" #endif -#ifdef HAVE_BLUA #include "lua_hud.h" #include "lua_hook.h" -#endif // coords are scaled #define HU_INPUTX 0 @@ -688,10 +686,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // run the lua hook even if we were supposed to eat the msg, netgame consistency goes first. -#ifdef HAVE_BLUA if (LUAh_PlayerMsg(playernum, target, flags, msg)) return; -#endif if (spam_eatmsg) return; // don't proceed if we were supposed to eat the message. @@ -2177,18 +2173,14 @@ void HU_Drawer(void) { if (netgame || multiplayer) { -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_rankings)) -#endif - HU_DrawRankings(); + HU_DrawRankings(); if (gametype == GT_COOP) HU_DrawNetplayCoopOverlay(); } else HU_DrawCoopOverlay(); -#ifdef HAVE_BLUA LUAh_ScoresHUD(); -#endif } if (gamestate != GS_LEVEL) @@ -3171,29 +3163,20 @@ static void HU_DrawRankings(void) static void HU_DrawCoopOverlay(void) { - if (token -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_tokens) -#endif - ) + if (token && LUA_HudEnabled(hud_tokens)) { V_DrawString(168, 176, 0, va("- %d", token)); V_DrawSmallScaledPatch(148, 172, 0, tokenicon); } -#ifdef HAVE_BLUA - if (LUA_HudEnabled(hud_tabemblems)) -#endif - if (!modifiedgame || savemoddata) + if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata)) { V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems)); V_DrawScaledPatch(128, 144 - SHORT(emblemicon->height)/4, 0, emblemicon); } -#ifdef HAVE_BLUA if (!LUA_HudEnabled(hud_coopemeralds)) return; -#endif if (emeralds & EMERALD1) V_DrawScaledPatch((BASEVIDWIDTH/2)-8 , (BASEVIDHEIGHT/3)-32, 0, emeraldpics[0][0]); @@ -3215,20 +3198,14 @@ static void HU_DrawNetplayCoopOverlay(void) { int i; - if (token -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_tokens) -#endif - ) + if (token && LUA_HudEnabled(hud_tokens)) { V_DrawString(168, 10, 0, va("- %d", token)); V_DrawSmallScaledPatch(148, 6, 0, tokenicon); } -#ifdef HAVE_BLUA if (!LUA_HudEnabled(hud_coopemeralds)) return; -#endif for (i = 0; i < 7; ++i) { diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 26887da25..4f924aa18 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -11,7 +11,6 @@ /// \brief basic functions for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "p_local.h" #include "p_setup.h" // So we can have P_SetupLevelSky @@ -3312,5 +3311,3 @@ int LUA_BaseLib(lua_State *L) luaL_register(L, NULL, lib); return 0; } - -#endif diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c index 78a9e75a1..bc8d20e8e 100644 --- a/src/lua_blockmaplib.c +++ b/src/lua_blockmaplib.c @@ -11,7 +11,6 @@ /// \brief blockmap library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "p_local.h" #include "r_main.h" // validcount #include "lua_script.h" @@ -264,5 +263,3 @@ int LUA_BlockmapLib(lua_State *L) lua_register(L, "searchBlockmap", lib_searchBlockmap); return 0; } - -#endif diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 923722eb8..a9fbad65f 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -11,7 +11,6 @@ /// \brief console modifying/etc library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "p_local.h" #include "g_game.h" @@ -551,5 +550,3 @@ int LUA_ConsoleLib(lua_State *L) luaL_register(L, NULL, lib); return 0; } - -#endif diff --git a/src/lua_hook.h b/src/lua_hook.h index dde8d4c41..244b1bbb8 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -10,8 +10,6 @@ /// \file lua_hook.h /// \brief hooks for Lua scripting -#ifdef HAVE_BLUA - #include "r_defs.h" #include "d_player.h" @@ -112,5 +110,3 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_ #endif #define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing - -#endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 20a7738e7..522be8c32 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -11,7 +11,6 @@ /// \brief hooks for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "doomstat.h" #include "p_mobj.h" #include "g_game.h" @@ -1705,5 +1704,3 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname) return keepplaying; } - -#endif diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 7d5f9325e..818e760c9 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -11,7 +11,6 @@ /// \brief custom HUD rendering library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "r_defs.h" #include "r_local.h" @@ -1466,5 +1465,3 @@ void LUAh_IntermissionHUD(void) lua_pop(gL, -1); hud_running = false; } - -#endif diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 6760b4203..25870d0b1 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -11,7 +11,6 @@ /// \brief infotable editing library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "info.h" #include "dehacked.h" @@ -1651,5 +1650,3 @@ int LUA_InfoLib(lua_State *L) return 0; } - -#endif diff --git a/src/lua_libs.h b/src/lua_libs.h index f217d4b2a..bf1e28b5d 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -10,8 +10,6 @@ /// \file lua_libs.h /// \brief libraries for Lua scripting -#ifdef HAVE_BLUA - extern lua_State *gL; #define LREG_VALID "VALID_USERDATA" @@ -88,5 +86,3 @@ int LUA_ThinkerLib(lua_State *L); int LUA_MapLib(lua_State *L); int LUA_BlockmapLib(lua_State *L); int LUA_HudLib(lua_State *L); - -#endif diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0344fd5bb..32150a4bc 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -11,7 +11,6 @@ /// \brief game map library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "r_state.h" #include "p_local.h" #include "p_setup.h" @@ -2337,5 +2336,3 @@ int LUA_MapLib(lua_State *L) lua_setglobal(L, "mapheaderinfo"); return 0; } - -#endif diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index d2a959dde..215903278 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -11,7 +11,6 @@ /// \brief basic math library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA //#include "fastcmp.h" #include "tables.h" #include "p_local.h" @@ -217,5 +216,3 @@ int LUA_MathLib(lua_State *L) luaL_register(L, NULL, lib); return 0; } - -#endif diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 9e46344cf..4b580a2fe 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -11,7 +11,6 @@ /// \brief mobj/thing library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "r_skins.h" #include "p_local.h" @@ -915,5 +914,3 @@ int LUA_MobjLib(lua_State *L) lua_setglobal(L, "mapthings"); return 0; } - -#endif diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index a33ecb7e0..cdece1fb7 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -11,7 +11,6 @@ /// \brief player object library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "p_mobj.h" #include "d_player.h" @@ -878,5 +877,3 @@ int LUA_PlayerLib(lua_State *L) lua_setglobal(L, "players"); return 0; } - -#endif diff --git a/src/lua_script.c b/src/lua_script.c index e7ce35ff1..6fa6cf57d 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -11,7 +11,6 @@ /// \brief Lua scripting basics #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "dehacked.h" #include "z_zone.h" @@ -1423,5 +1422,3 @@ int Lua_optoption(lua_State *L, int narg, return i; return -1; } - -#endif // HAVE_BLUA diff --git a/src/lua_script.h b/src/lua_script.h index 6caccd69b..7bdf7685b 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -10,8 +10,6 @@ /// \file lua_script.h /// \brief Lua scripting basics -#ifdef HAVE_BLUA - #include "m_fixed.h" #include "doomtype.h" #include "d_player.h" @@ -102,5 +100,3 @@ void COM_Lua_f(void); #define INLEVEL if (gamestate != GS_LEVEL && !titlemapinaction)\ return luaL_error(L, "This can only be used in a level!"); - -#endif diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index f26aed2f0..3e4ddb9f0 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -11,7 +11,6 @@ /// \brief player skin structure library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "fastcmp.h" #include "r_skins.h" #include "sounds.h" @@ -358,5 +357,3 @@ int LUA_SkinLib(lua_State *L) return 0; } - -#endif diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c index ddb5abf72..82baa6469 100644 --- a/src/lua_thinkerlib.c +++ b/src/lua_thinkerlib.c @@ -11,7 +11,6 @@ /// \brief thinker library for Lua scripting #include "doomdef.h" -#ifdef HAVE_BLUA #include "p_local.h" #include "lua_script.h" #include "lua_libs.h" @@ -139,5 +138,3 @@ int LUA_ThinkerLib(lua_State *L) lua_setglobal(L, "mobjs"); return 0; } - -#endif diff --git a/src/m_cheat.c b/src/m_cheat.c index 1431e8873..93e8f2911 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -788,7 +788,7 @@ void Command_CauseCfail_f(void) } #endif -#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) +#ifdef LUA_ALLOW_BYTECODE void Command_Dumplua_f(void) { if (modifiedgame) @@ -1062,9 +1062,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c mapthing_t *mt = mapthings; sector_t *sec = player->mo->subsector->sector; -#ifdef HAVE_BLUA LUA_InvalidateMapthings(); -#endif mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL); diff --git a/src/m_cheat.h b/src/m_cheat.h index 092e51756..ac2540408 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -68,7 +68,7 @@ void Command_Toggletwod_f(void); #ifdef _DEBUG void Command_CauseCfail_f(void); #endif -#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) +#ifdef LUA_ALLOW_BYTECODE void Command_Dumplua_f(void); #endif diff --git a/src/m_menu.c b/src/m_menu.c index e8915f91f..84ee898d6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6657,12 +6657,6 @@ static void M_HandleAddons(INT32 choice) M_AddonExec(KEY_ENTER); break; case EXT_LUA: -#ifndef HAVE_BLUA - S_StartSound(NULL, sfx_lose); - M_StartMessage(va("%c%s\x80\nThis copy of SRB2 was compiled\nwithout support for .lua files.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING); - break; -#endif - /* FALLTHRU */ case EXT_SOC: case EXT_WAD: #ifdef USE_KART diff --git a/src/p_enemy.c b/src/p_enemy.c index 14e5c4d3e..9dea0ecc5 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -30,9 +30,7 @@ #include "hardware/hw3sound.h" #endif -#ifdef HAVE_BLUA boolean LUA_CallAction(const char *action, mobj_t *actor); -#endif player_t *stplyr; INT32 var1; @@ -981,10 +979,8 @@ void A_Look(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Look", actor)) return; -#endif if (!P_LookForPlayers(actor, locvar1 & 65535, false , FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale))) return; @@ -1016,10 +1012,8 @@ void A_Chase(mobj_t *actor) INT32 delta; INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Chase", actor)) return; -#endif I_Assert(actor != NULL); I_Assert(!P_MobjWasRemoved(actor)); @@ -1109,10 +1103,8 @@ void A_FaceStabChase(mobj_t *actor) { INT32 delta; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceStabChase", actor)) return; -#endif if (actor->reactiontime) actor->reactiontime--; @@ -1233,10 +1225,8 @@ void A_FaceStabRev(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceStabRev", actor)) return; -#endif if (!actor->target) { @@ -1278,10 +1268,8 @@ void A_FaceStabHurl(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceStabHurl", actor)) return; -#endif if (actor->target) { @@ -1368,13 +1356,10 @@ void A_FaceStabHurl(mobj_t *actor) // void A_FaceStabMiss(mobj_t *actor) { - //INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceStabMiss", actor)) return; -#endif if (++actor->extravalue1 >= 3) { @@ -1408,10 +1393,8 @@ void A_StatueBurst(mobj_t *actor) mobjtype_t chunktype = (mobjtype_t)actor->info->raisestate; mobj_t *new; -#ifdef HAVE_BLUA if (LUA_CallAction("A_StatueBurst", actor)) return; -#endif if (!locvar1 || !(new = P_SpawnMobjFromMobj(actor, 0, 0, 0, locvar1))) return; @@ -1460,10 +1443,9 @@ void A_StatueBurst(mobj_t *actor) // void A_JetJawRoam(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_JetJawRoam", actor)) return; -#endif + if (actor->reactiontime) { actor->reactiontime--; @@ -1489,10 +1471,9 @@ void A_JetJawRoam(mobj_t *actor) void A_JetJawChomp(mobj_t *actor) { INT32 delta; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_JetJawChomp", actor)) return; -#endif // turn towards movement direction if not there yet if (actor->movedir < NUMDIRS) @@ -1538,10 +1519,9 @@ void A_PointyThink(mobj_t *actor) boolean firsttime = true; INT32 sign; -#ifdef HAVE_BLUA if (LUA_CallAction("A_PointyThink", actor)) return; -#endif + actor->momx = actor->momy = actor->momz = 0; // Find nearest player @@ -1637,10 +1617,9 @@ void A_CheckBuddy(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_CheckBuddy", actor)) return; -#endif + if (locvar1 && (!actor->tracer || actor->tracer->health <= 0)) P_RemoveMobj(actor); else if (!locvar1 && (!actor->target || actor->target->health <= 0)) @@ -1680,11 +1659,9 @@ void A_HoodFire(mobj_t *actor) { mobj_t *arrow; INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_HoodFire", actor)) return; -#endif // Check target first. if (!actor->target) @@ -1714,10 +1691,9 @@ void A_HoodThink(mobj_t *actor) { fixed_t dx, dy, dz, dm; boolean checksight; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_HoodThink", actor)) return; -#endif // Check target first. if (!actor->target) @@ -1783,10 +1759,8 @@ void A_HoodThink(mobj_t *actor) // void A_HoodFall(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_HoodFall", actor)) return; -#endif if (!P_IsObjectOnGround(actor)) return; @@ -1805,10 +1779,8 @@ void A_HoodFall(mobj_t *actor) // void A_ArrowBonks(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_ArrowBonks", actor)) return; -#endif if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz) || (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz)) @@ -1830,10 +1802,8 @@ void A_ArrowBonks(mobj_t *actor) // void A_SnailerThink(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SnailerThink", actor)) return; -#endif if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) { @@ -1905,10 +1875,8 @@ void A_SnailerThink(mobj_t *actor) // void A_SharpChase(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SharpChase", actor)) return; -#endif if (actor->reactiontime) { @@ -1963,10 +1931,8 @@ void A_SharpSpin(mobj_t *actor) INT32 locvar2 = var2; angle_t oldang = actor->angle; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SharpSpin", actor)) return; -#endif if (actor->threshold && actor->target) { @@ -1998,10 +1964,8 @@ void A_SharpSpin(mobj_t *actor) // void A_SharpDecel(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SharpDecel", actor)) return; -#endif if (actor->momx > 2 || actor->momy > 2) { @@ -2024,10 +1988,9 @@ void A_CrushstaceanWalk(mobj_t *actor) INT32 locvar1 = (var1 ? var1 : (INT32)actor->info->speed); INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate); angle_t ang = actor->angle + ((actor->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CrushstaceanWalk", actor)) return; -#endif actor->reactiontime--; @@ -2053,12 +2016,10 @@ void A_CrushstaceanWalk(mobj_t *actor) // void A_CrushstaceanPunch(mobj_t *actor) { - //INT32 locvar1 = var1; INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CrushstaceanPunch", actor)) return; -#endif if (!actor->tracer) return; @@ -2088,10 +2049,9 @@ void A_CrushclawAim(mobj_t *actor) INT32 locvar2 = var2; mobj_t *crab = actor->tracer; angle_t ang; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CrushclawAim", actor)) return; -#endif if (!crab) { @@ -2150,10 +2110,9 @@ void A_CrushclawLaunch(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *crab = actor->tracer; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CrushclawLaunch", actor)) return; -#endif if (!crab) { @@ -2283,10 +2242,8 @@ void A_CrushclawLaunch(mobj_t *actor) // void A_VultureVtol(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_VultureVtol", actor)) return; -#endif if (!actor->target) return; @@ -2320,10 +2277,8 @@ void A_VultureVtol(mobj_t *actor) // void A_VultureCheck(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_VultureCheck", actor)) return; -#endif if (actor->momx || actor->momy) return; @@ -2378,10 +2333,8 @@ void A_VultureHover(mobj_t *actor) fixed_t memz = actor->z; SINT8 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VultureHover", actor)) return; -#endif if (!actor->target || P_MobjWasRemoved(actor->target)) { @@ -2442,10 +2395,8 @@ void A_VultureBlast(mobj_t *actor) angle_t faa; fixed_t faacos, faasin; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VultureBlast", actor)) return; -#endif S_StartSound(actor, actor->info->attacksound); @@ -2483,10 +2434,8 @@ void A_VultureFly(mobj_t *actor) mobj_t *dust; fixed_t momm; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VultureFly", actor)) return; -#endif if (!actor->target || P_MobjWasRemoved(actor->target)) { @@ -2577,10 +2526,9 @@ void A_SkimChase(mobj_t *actor) { INT32 delta; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SkimChase", actor)) return; -#endif + if (actor->reactiontime) actor->reactiontime--; @@ -2664,10 +2612,9 @@ nomissile: // void A_FaceTarget(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceTarget", actor)) return; -#endif + if (!actor->target) return; @@ -2683,10 +2630,9 @@ void A_FaceTarget(mobj_t *actor) // void A_FaceTracer(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_FaceTracer", actor)) return; -#endif + if (!actor->tracer) return; @@ -2713,10 +2659,9 @@ void A_LobShot(mobj_t *actor) fixed_t vertical, horizontal; fixed_t airtime = var2 & 65535; -#ifdef HAVE_BLUA if (LUA_CallAction("A_LobShot", actor)) return; -#endif + if (!actor->target) return; @@ -2814,10 +2759,9 @@ void A_FireShot(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FireShot", actor)) return; -#endif + if (!actor->target) return; @@ -2853,10 +2797,9 @@ void A_SuperFireShot(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SuperFireShot", actor)) return; -#endif + if (!actor->target) return; @@ -2901,10 +2844,9 @@ void A_BossFireShot(mobj_t *actor) INT32 locvar2 = var2; mobj_t *missile; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BossFireShot", actor)) return; -#endif + if (!actor->target) return; @@ -2986,10 +2928,8 @@ void A_Boss7FireMissiles(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss7FireMissiles", actor)) return; -#endif if (!actor->target) { @@ -3050,10 +2990,9 @@ void A_Boss1Laser(mobj_t *actor) mobj_t *point; tic_t dur; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss1Laser", actor)) return; -#endif + if (!actor->target) return; @@ -3175,10 +3114,9 @@ void A_FocusTarget(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FocusTarget", actor)) return; -#endif if (actor->target) { @@ -3227,10 +3165,10 @@ void A_Boss4Reverse(mobj_t *actor) { sfxenum_t locvar1 = (sfxenum_t)var1; sfxenum_t locvar2 = (sfxenum_t)var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss4Reverse", actor)) return; -#endif + actor->reactiontime = 0; if (actor->movedir < 3) { @@ -3262,10 +3200,10 @@ void A_Boss4Reverse(mobj_t *actor) void A_Boss4SpeedUp(mobj_t *actor) { sfxenum_t locvar1 = (sfxenum_t)var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss4SpeedUp", actor)) return; -#endif + S_StartSound(NULL, locvar1); actor->reactiontime = 2; } @@ -3280,10 +3218,10 @@ void A_Boss4SpeedUp(mobj_t *actor) void A_Boss4Raise(mobj_t *actor) { sfxenum_t locvar1 = (sfxenum_t)var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss4Raise", actor)) return; -#endif + S_StartSound(NULL, locvar1); actor->reactiontime = 1; } @@ -3312,10 +3250,9 @@ void A_SkullAttack(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SkullAttack", actor)) return; -#endif + if (!actor->target) return; @@ -3431,10 +3368,9 @@ void A_BossZoom(mobj_t *actor) angle_t an; INT32 dist; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BossZoom", actor)) return; -#endif + if (!actor->target) return; @@ -3472,10 +3408,9 @@ void A_BossScream(mobj_t *actor) INT32 locvar2 = var2; mobjtype_t explodetype; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BossScream", actor)) return; -#endif + if (locvar1 & 1) fa = (FixedAngle(P_RandomKey(360)*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; else @@ -3518,10 +3453,9 @@ void A_BossScream(mobj_t *actor) // void A_Scream(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Scream", actor)) return; -#endif + if (actor->tracer && (actor->tracer->type == MT_SHELL || actor->tracer->type == MT_FIREBALL)) S_StartScreamSound(actor, sfx_mario2); else if (actor->info->deathsound) @@ -3537,10 +3471,9 @@ void A_Scream(mobj_t *actor) // void A_Pain(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Pain", actor)) return; -#endif + if (actor->info->painsound) S_StartSound(actor, actor->info->painsound); @@ -3559,10 +3492,9 @@ void A_Fall(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Fall", actor)) return; -#endif + // actor is on ground, it can be walked over actor->flags &= ~MF_SOLID; @@ -3592,10 +3524,9 @@ void A_1upThinker(mobj_t *actor) fixed_t temp; INT32 closestplayer = -1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_1upThinker", actor)) return; -#endif + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].bot || players[i].spectator) @@ -3659,10 +3590,8 @@ void A_MonitorPop(mobj_t *actor) mobjtype_t item = 0; mobj_t *newmobj; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MonitorPop", actor)) return; -#endif // Spawn the "pop" explosion. if (actor->info->deathsound) @@ -3742,10 +3671,8 @@ void A_GoldMonitorPop(mobj_t *actor) mobjtype_t item = 0; mobj_t *newmobj; -#ifdef HAVE_BLUA if (LUA_CallAction("A_GoldMonitorPop", actor)) return; -#endif // Don't spawn the "pop" explosion, because the monitor isn't broken. if (actor->info->deathsound) @@ -3827,10 +3754,8 @@ void A_GoldMonitorPop(mobj_t *actor) // void A_GoldMonitorRestore(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_GoldMonitorRestore", actor)) return; -#endif actor->flags |= MF_MONITOR|MF_SHOOTABLE; actor->health = 1; // Just in case. @@ -3847,10 +3772,8 @@ void A_GoldMonitorSparkle(mobj_t *actor) { fixed_t i, ngangle, xofs, yofs; -#ifdef HAVE_BLUA if (LUA_CallAction("A_GoldMonitorSparkle", actor)) return; -#endif ngangle = FixedAngle(((leveltime * 21) % 360) << FRACBITS); xofs = FINESINE((ngangle>>ANGLETOFINESHIFT) & FINEMASK) * (actor->radius>>FRACBITS); @@ -3870,10 +3793,10 @@ void A_GoldMonitorSparkle(mobj_t *actor) void A_Explode(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Explode", actor)) return; -#endif + P_RadiusAttack(actor, actor->target, actor->info->damage, locvar1); } @@ -3890,10 +3813,9 @@ void A_BossDeath(mobj_t *mo) mobj_t *mo2; line_t junk; INT32 i; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_BossDeath", mo)) return; -#endif if (mo->spawnpoint && mo->spawnpoint->extrainfo) P_LinedefExecute(LE_BOSSDEAD+(mo->spawnpoint->extrainfo*LE_PARAMWIDTH), mo, NULL); @@ -3973,12 +3895,10 @@ void A_BossDeath(mobj_t *mo) } bossjustdie: -#ifdef HAVE_BLUA if (LUAh_BossDeath(mo)) return; else if (P_MobjWasRemoved(mo)) return; -#endif // Spawn your junk switch (mo->type) @@ -4202,10 +4122,9 @@ void A_CustomPower(mobj_t *actor) INT32 locvar2 = var2; boolean spawnshield = false; -#ifdef HAVE_BLUA if (LUA_CallAction("A_CustomPower", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4243,10 +4162,9 @@ void A_GiveWeapon(mobj_t *actor) player_t *player; INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_GiveWeapon", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4277,10 +4195,9 @@ void A_RingBox(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_RingBox", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4305,10 +4222,9 @@ void A_Invincibility(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Invincibility", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4339,10 +4255,9 @@ void A_SuperSneakers(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SuperSneakers", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4375,10 +4290,9 @@ void A_AwardScore(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_AwardScore", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4403,10 +4317,9 @@ void A_ExtraLife(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_ExtraLife", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4442,10 +4355,9 @@ void A_GiveShield(mobj_t *actor) player_t *player; UINT16 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_GiveShield", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4469,10 +4381,9 @@ void A_GravityBox(mobj_t *actor) { player_t *player; -#ifdef HAVE_BLUA if (LUA_CallAction("A_GravityBox", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -4495,10 +4406,9 @@ void A_GravityBox(mobj_t *actor) // void A_ScoreRise(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_ScoreRise", actor)) return; -#endif + // make logo rise! P_SetObjectMomZ(actor, actor->info->speed, false); } @@ -4515,10 +4425,9 @@ void A_BunnyHop(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BunnyHop", actor)) return; -#endif + if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz) || (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz)) { @@ -4539,10 +4448,10 @@ void A_BubbleSpawn(mobj_t *actor) INT32 i, locvar1 = var1; UINT8 prandom; mobj_t *bubble = NULL; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_BubbleSpawn", actor)) return; -#endif + if (!(actor->eflags & MFE_UNDERWATER)) { // Don't draw or spawn bubbles above water @@ -4592,10 +4501,10 @@ void A_FanBubbleSpawn(mobj_t *actor) UINT8 prandom; mobj_t *bubble = NULL; fixed_t hz = actor->z + (4*actor->height)/5; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FanBubbleSpawn", actor)) return; -#endif + if (!(actor->eflags & MFE_UNDERWATER)) return; @@ -4639,10 +4548,9 @@ void A_BubbleRise(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BubbleRise", actor)) return; -#endif + if (actor->type == MT_EXTRALARGEBUBBLE) P_SetObjectMomZ(actor, FixedDiv(6*FRACUNIT,5*FRACUNIT), false); // make bubbles rise! else @@ -4676,10 +4584,9 @@ void A_BubbleRise(mobj_t *actor) // void A_BubbleCheck(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_BubbleCheck", actor)) return; -#endif + if (actor->eflags & MFE_UNDERWATER) actor->flags2 &= ~MF2_DONTDRAW; // underwater so draw else @@ -4695,10 +4602,9 @@ void A_BubbleCheck(mobj_t *actor) // void A_AttractChase(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_AttractChase", actor)) return; -#endif + if (actor->flags2 & MF2_NIGHTSPULL || !actor->health) return; @@ -4766,10 +4672,9 @@ void A_DropMine(mobj_t *actor) INT32 locvar2 = var2; fixed_t z; mobj_t *mine; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_DropMine", actor)) return; -#endif if (locvar2 & 65535) { @@ -4815,10 +4720,9 @@ void A_FishJump(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FishJump", actor)) return; -#endif if (locvar2) { @@ -4867,10 +4771,9 @@ void A_ThrownRing(mobj_t *actor) INT32 stop; player_t *player; fixed_t dist; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ThrownRing", actor)) return; -#endif if (leveltime % (TICRATE/7) == 0) { @@ -5025,10 +4928,9 @@ void A_ThrownRing(mobj_t *actor) // void A_SetSolidSteam(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SetSolidSteam", actor)) return; -#endif + actor->flags &= ~MF_NOCLIP; actor->flags |= MF_SOLID; if (!(actor->flags2 & MF2_AMBUSH)) @@ -5057,10 +4959,9 @@ void A_SetSolidSteam(mobj_t *actor) // void A_UnsetSolidSteam(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_UnsetSolidSteam", actor)) return; -#endif + actor->flags &= ~MF_SOLID; actor->flags |= MF_NOCLIP; } @@ -5078,10 +4979,8 @@ void A_SignSpin(mobj_t *actor) INT16 i; angle_t rotateangle = FixedAngle(locvar1 << FRACBITS); -#ifdef HAVE_BLUA if (LUA_CallAction("A_SignSpin", actor)) return; -#endif if (P_IsObjectOnGround(actor) && P_MobjFlip(actor) * actor->momz <= 0) { @@ -5149,10 +5048,8 @@ void A_SignPlayer(mobj_t *actor) UINT8 facecolor, signcolor = (UINT8)locvar2; UINT32 signframe = states[actor->info->raisestate].frame; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SignPlayer", actor)) return; -#endif if (actor->tracer == NULL || locvar1 < -3 || locvar1 >= numskins || signcolor >= MAXTRANSLATIONS) return; @@ -5280,10 +5177,10 @@ void A_SignPlayer(mobj_t *actor) void A_OverlayThink(mobj_t *actor) { fixed_t destx, desty; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_OverlayThink", actor)) return; -#endif + if (!actor->target) return; @@ -5332,10 +5229,9 @@ void A_OverlayThink(mobj_t *actor) void A_JetChase(mobj_t *actor) { fixed_t thefloor; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_JetChase", actor)) return; -#endif if (actor->flags2 & MF2_AMBUSH) return; @@ -5429,10 +5325,9 @@ void A_JetbThink(mobj_t *actor) { sector_t *nextsector; fixed_t thefloor; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_JetbThink", actor)) return; -#endif if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz && actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale)) @@ -5495,10 +5390,9 @@ void A_JetbThink(mobj_t *actor) void A_JetgShoot(mobj_t *actor) { fixed_t dist; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_JetgShoot", actor)) return; -#endif if (!actor->target) return; @@ -5536,10 +5430,9 @@ void A_JetgShoot(mobj_t *actor) void A_ShootBullet(mobj_t *actor) { fixed_t dist; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ShootBullet", actor)) return; -#endif if (!actor->target) return; @@ -5598,10 +5491,8 @@ void A_MinusDigging(mobj_t *actor) fixed_t mz = (actor->eflags & MFE_VERTICALFLIP) ? actor->ceilingz : actor->floorz; mobj_t *par; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MinusDigging", actor)) return; -#endif if (!actor->target) { @@ -5681,10 +5572,8 @@ void A_MinusPopup(mobj_t *actor) angle_t ani = FixedAngle(FRACUNIT*360/num); INT32 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MinusPopup", actor)) return; -#endif if (actor->eflags & MFE_VERTICALFLIP) actor->momz = -10*FRACUNIT; @@ -5718,10 +5607,8 @@ void A_MinusCheck(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MinusCheck", actor)) return; -#endif if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz) || (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz)) { @@ -5751,10 +5638,9 @@ void A_MinusCheck(mobj_t *actor) // void A_ChickenCheck(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_ChickenCheck", actor)) return; -#endif + if ((!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz) || (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height >= actor->ceilingz)) { @@ -5782,10 +5668,9 @@ void A_JetgThink(mobj_t *actor) sector_t *nextsector; fixed_t thefloor; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_JetgThink", actor)) return; -#endif if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz && actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale)) @@ -5834,10 +5719,8 @@ void A_JetgThink(mobj_t *actor) // void A_MouseThink(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_MouseThink", actor)) return; -#endif if (actor->reactiontime) actor->reactiontime--; @@ -5872,10 +5755,9 @@ void A_DetonChase(mobj_t *actor) { angle_t exact; fixed_t xydist, dist; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_DetonChase", actor)) return; -#endif // modify tracer threshold if (!actor->tracer || actor->tracer->health <= 0) @@ -6020,10 +5902,9 @@ void A_CapeChase(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; angle_t angle; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CapeChase", actor)) return; -#endif CONS_Debug(DBG_GAMELOGIC, "A_CapeChase called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); @@ -6081,10 +5962,9 @@ void A_RotateSpikeBall(mobj_t *actor) { INT32 locvar1 = var1; const fixed_t radius = FixedMul(12*actor->info->speed, actor->scale); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RotateSpikeBall", actor)) return; -#endif if (!((!locvar1 && (actor->target)) || (locvar1 && (actor->tracer))))// This should NEVER happen. { @@ -6134,10 +6014,8 @@ void A_UnidusBall(mobj_t *actor) INT32 locvar1 = var1; boolean canthrow = false; -#ifdef HAVE_BLUA if (LUA_CallAction("A_UnidusBall", actor)) return; -#endif actor->angle += ANGLE_11hh; @@ -6232,10 +6110,9 @@ void A_RockSpawn(mobj_t *actor) line_t *line; fixed_t dist; fixed_t randomoomph; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RockSpawn", actor)) return; -#endif if (i == -1) { @@ -6286,10 +6163,9 @@ void A_SlingAppear(mobj_t *actor) { UINT8 mlength = 4; mobj_t *spawnee, *hprev; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SlingAppear", actor)) return; -#endif P_UnsetThingPosition(actor); actor->flags &= ~(MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT); @@ -6337,10 +6213,9 @@ void A_SetFuse(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetFuse", actor)) return; -#endif if ((!actor->fuse || (locvar2 >> 16)) && (locvar2 >> 16) != 2) // set the actor's fuse value actor->fuse = locvar1; @@ -6367,10 +6242,9 @@ void A_CrawlaCommanderThink(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; boolean hovermode = (actor->health > 1 || actor->fuse); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CrawlaCommanderThink", actor)) return; -#endif if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz && actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale)) @@ -6526,10 +6400,9 @@ void A_RingExplode(mobj_t *actor) mobj_t *mo2; thinker_t *th; angle_t d; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RingExplode", actor)) return; -#endif for (d = 0; d < 16; d++) P_SpawnParaloop(actor->x, actor->y, actor->z + actor->height, FixedMul(actor->info->painchance, actor->scale), 16, MT_NIGHTSPARKLE, S_NULL, d*(ANGLE_22h), true); @@ -6571,12 +6444,10 @@ void A_OldRingExplode(mobj_t *actor) { mobj_t *mo; const fixed_t ns = FixedMul(20 * FRACUNIT, actor->scale); INT32 locvar1 = var1; - //INT32 locvar2 = var2; boolean changecolor = (actor->target && actor->target->player); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_OldRingExplode", actor)) return; -#endif for (i = 0; i < 32; i++) { @@ -6650,12 +6521,9 @@ void A_MixUp(mobj_t *actor) { boolean teleported[MAXPLAYERS]; INT32 i, numplayers = 0, prandom = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MixUp", actor)) return; -#else - (void)actor; -#endif if (!multiplayer) return; @@ -6934,15 +6802,8 @@ void A_RecyclePowers(mobj_t *actor) INT32 weapons[MAXPLAYERS]; INT32 weaponheld[MAXPLAYERS]; -#ifdef HAVE_BLUA if (LUA_CallAction("A_RecyclePowers", actor)) return; -#endif - -#if !defined(WEIGHTEDRECYCLER) && !defined(HAVE_BLUA) - // actor is used in all scenarios but this one, funny enough - (void)actor; -#endif if (!multiplayer) { @@ -7069,10 +6930,9 @@ void A_RecyclePowers(mobj_t *actor) void A_Boss1Chase(mobj_t *actor) { INT32 delta; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss1Chase", actor)) return; -#endif if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) { @@ -7193,10 +7053,9 @@ void A_Boss2Chase(mobj_t *actor) fixed_t radius; boolean reverse = false; INT32 speedvar; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss2Chase", actor)) return; -#endif if (actor->health <= 0) return; @@ -7321,10 +7180,9 @@ void A_Boss2Chase(mobj_t *actor) // void A_Boss2Pogo(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss2Pogo", actor)) return; -#endif + if (actor->z <= actor->floorz + FixedMul(8*FRACUNIT, actor->scale) && actor->momz <= 0) { if (actor->state != &states[actor->info->raisestate]) @@ -7369,10 +7227,10 @@ void A_Boss2Pogo(mobj_t *actor) void A_Boss2TakeDamage(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss2TakeDamage", actor)) return; -#endif + A_Pain(actor); actor->reactiontime = 1; // turn around if (locvar1 == 0) // old A_Invincibilerize behavior @@ -7392,10 +7250,9 @@ void A_Boss7Chase(mobj_t *actor) { INT32 delta; INT32 i; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss7Chase", actor)) return; -#endif if (actor->z != actor->floorz) return; @@ -7524,10 +7381,9 @@ void A_Boss7Chase(mobj_t *actor) // void A_GoopSplat(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_GoopSplat", actor)) return; -#endif + P_UnsetThingPosition(actor); if (sector_list) { @@ -7549,10 +7405,9 @@ void A_Boss2PogoSFX(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss2PogoSFX", actor)) return; -#endif if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) { @@ -7593,10 +7448,8 @@ void A_Boss2PogoTarget(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss2PogoTarget", actor)) return; -#endif if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || (actor->target->player && actor->target->player->powers[pw_flashing]) || P_AproxDistance(actor->x-actor->target->x, actor->y-actor->target->y) >= FixedMul(512*FRACUNIT, actor->scale)) @@ -7680,10 +7533,9 @@ void A_Boss2PogoTarget(mobj_t *actor) // void A_EggmanBox(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_EggmanBox", actor)) return; -#endif + if (!actor->target || !actor->target->player) { CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); @@ -7706,10 +7558,9 @@ void A_TurretFire(mobj_t *actor) fixed_t dist; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_TurretFire", actor)) return; -#endif if (locvar2) dist = FixedMul(locvar2*FRACUNIT, actor->scale); @@ -7745,10 +7596,9 @@ void A_SuperTurretFire(mobj_t *actor) fixed_t dist; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SuperTurretFire", actor)) return; -#endif if (locvar2) dist = FixedMul(locvar2*FRACUNIT, actor->scale); @@ -7782,10 +7632,9 @@ void A_SuperTurretFire(mobj_t *actor) void A_TurretStop(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_TurretStop", actor)) return; -#endif actor->flags2 &= ~MF2_FIRING; actor->flags2 &= ~MF2_SUPERFIRE; @@ -7803,10 +7652,8 @@ void A_TurretStop(mobj_t *actor) // void A_SparkFollow(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SparkFollow", actor)) return; -#endif if ((!actor->target || (actor->target->health <= 0)) || (actor->target->player && !actor->target->player->powers[pw_super])) @@ -7840,10 +7687,10 @@ void A_BuzzFly(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_BuzzFly", actor)) return; -#endif + if (actor->flags2 & MF2_AMBUSH) return; @@ -7939,10 +7786,9 @@ void A_BuzzFly(mobj_t *actor) void A_GuardChase(mobj_t *actor) { INT32 delta; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_GuardChase", actor)) return; -#endif if (actor->reactiontime) actor->reactiontime--; @@ -8045,10 +7891,9 @@ void A_EggShield(mobj_t *actor) fixed_t newx, newy; fixed_t movex, movey; angle_t angle; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_EggShield", actor)) return; -#endif if (!actor->target || !actor->target->health) { @@ -8129,10 +7974,9 @@ void A_EggShield(mobj_t *actor) // void A_SetReactionTime(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_SetReactionTime", actor)) return; -#endif + if (var1) actor->reactiontime = var2; else @@ -8152,10 +7996,8 @@ void A_Boss1Spikeballs(mobj_t *actor) INT32 locvar2 = var2; mobj_t *ball; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss1Spikeballs", actor)) return; -#endif ball = P_SpawnMobj(actor->x, actor->y, actor->z, MT_EGGMOBILE_BALL); P_SetTarget(&ball->target, actor); @@ -8176,10 +8018,9 @@ void A_Boss1Spikeballs(mobj_t *actor) // void A_Boss3TakeDamage(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss3TakeDamage", actor)) return; -#endif + actor->movecount = var1; actor->movefactor = -512*FRACUNIT; @@ -8197,10 +8038,8 @@ void A_Boss3TakeDamage(mobj_t *actor) // void A_Boss3Path(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss3Path", actor)) return; -#endif if (actor->tracer && actor->tracer->health && actor->tracer->movecount) actor->movecount |= 1; @@ -8326,10 +8165,8 @@ void A_Boss3Path(mobj_t *actor) // void A_Boss3ShockThink(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss3ShockThink", actor)) return; -#endif if (actor->momx || actor->momy) actor->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy) + ANGLE_90; @@ -8380,10 +8217,9 @@ void A_LinedefExecute(mobj_t *actor) INT32 tagnum; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_LinedefExecute", actor)) return; -#endif tagnum = locvar1; // state numbers option is no more, custom states cannot be guaranteed to stay the same number anymore, now that they can be defined by names instead @@ -8408,10 +8244,9 @@ void A_LinedefExecute(mobj_t *actor) // void A_PlaySeeSound(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_PlaySeeSound", actor)) return; -#endif + if (actor->info->seesound) S_StartScreamSound(actor, actor->info->seesound); } @@ -8425,10 +8260,9 @@ void A_PlaySeeSound(mobj_t *actor) // void A_PlayAttackSound(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_PlayAttackSound", actor)) return; -#endif + if (actor->info->attacksound) S_StartAttackSound(actor, actor->info->attacksound); } @@ -8442,10 +8276,9 @@ void A_PlayAttackSound(mobj_t *actor) // void A_PlayActiveSound(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_PlayActiveSound", actor)) return; -#endif + if (actor->info->activesound) S_StartSound(actor, actor->info->activesound); } @@ -8461,10 +8294,9 @@ void A_SmokeTrailer(mobj_t *actor) { mobj_t *th; INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SmokeTrailer", actor)) return; -#endif if (leveltime % 4) return; @@ -8503,10 +8335,9 @@ void A_SpawnObjectAbsolute(mobj_t *actor) mobj_t *mo; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SpawnObjectAbsolute", actor)) return; -#endif x = (INT16)(locvar1>>16); y = (INT16)(locvar1&65535); @@ -8540,10 +8371,9 @@ void A_SpawnObjectRelative(mobj_t *actor) mobj_t *mo; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SpawnObjectRelative", actor)) return; -#endif CONS_Debug(DBG_GAMELOGIC, "A_SpawnObjectRelative called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); @@ -8585,10 +8415,9 @@ void A_ChangeAngleRelative(mobj_t *actor) const fixed_t amax = locvar2*FRACUNIT; //const angle_t amin = FixedAngle(locvar1*FRACUNIT); //const angle_t amax = FixedAngle(locvar2*FRACUNIT); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeAngleRelative", actor)) return; -#endif #ifdef PARANOIA if (amin > amax) @@ -8619,10 +8448,9 @@ void A_ChangeAngleAbsolute(mobj_t *actor) const fixed_t amax = locvar2*FRACUNIT; //const angle_t amin = FixedAngle(locvar1*FRACUNIT); //const angle_t amax = FixedAngle(locvar2*FRACUNIT); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeAngleAbsolute", actor)) return; -#endif #ifdef PARANOIA if (amin > amax) @@ -8650,10 +8478,8 @@ void A_RollAngle(mobj_t *actor) INT32 locvar2 = var2; const angle_t angle = FixedAngle(locvar1*FRACUNIT); -#ifdef HAVE_BLUA if (LUA_CallAction("A_RollAngle", actor)) return; -#endif // relative (default) if (!locvar2) @@ -8676,10 +8502,9 @@ void A_ChangeRollAngleRelative(mobj_t *actor) INT32 locvar2 = var2; const fixed_t amin = locvar1*FRACUNIT; const fixed_t amax = locvar2*FRACUNIT; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeRollAngleRelative", actor)) return; -#endif #ifdef PARANOIA if (amin > amax) @@ -8702,10 +8527,9 @@ void A_ChangeRollAngleAbsolute(mobj_t *actor) INT32 locvar2 = var2; const fixed_t amin = locvar1*FRACUNIT; const fixed_t amax = locvar2*FRACUNIT; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeRollAngleAbsolute", actor)) return; -#endif #ifdef PARANOIA if (amin > amax) @@ -8728,10 +8552,9 @@ void A_PlaySound(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_PlaySound", actor)) return; -#endif if (leveltime < 2 && (locvar2 >> 16)) return; @@ -8754,10 +8577,9 @@ void A_FindTarget(mobj_t *actor) thinker_t *th; mobj_t *mo2; fixed_t dist1 = 0, dist2 = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FindTarget", actor)) return; -#endif CONS_Debug(DBG_GAMELOGIC, "A_FindTarget called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); @@ -8819,10 +8641,9 @@ void A_FindTracer(mobj_t *actor) thinker_t *th; mobj_t *mo2; fixed_t dist1 = 0, dist2 = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FindTracer", actor)) return; -#endif CONS_Debug(DBG_GAMELOGIC, "A_FindTracer called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); @@ -8880,10 +8701,9 @@ void A_SetTics(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetTics", actor)) return; -#endif if (locvar1) actor->tics = locvar1; @@ -8902,10 +8722,9 @@ void A_SetRandomTics(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetRandomTics", actor)) return; -#endif actor->tics = P_RandomRange(locvar1, locvar2); } @@ -8921,10 +8740,9 @@ void A_ChangeColorRelative(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeColorRelative", actor)) return; -#endif if (locvar1) { @@ -8947,10 +8765,9 @@ void A_ChangeColorAbsolute(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ChangeColorAbsolute", actor)) return; -#endif if (locvar1) { @@ -8972,10 +8789,9 @@ void A_MoveRelative(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MoveRelative", actor)) return; -#endif P_Thrust(actor, actor->angle+FixedAngle(locvar1*FRACUNIT), FixedMul(locvar2*FRACUNIT, actor->scale)); } @@ -8991,10 +8807,9 @@ void A_MoveAbsolute(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MoveAbsolute", actor)) return; -#endif P_InstaThrust(actor, FixedAngle(locvar1*FRACUNIT), FixedMul(locvar2*FRACUNIT, actor->scale)); } @@ -9010,10 +8825,9 @@ void A_Thrust(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Thrust", actor)) return; -#endif if (!locvar1) CONS_Debug(DBG_GAMELOGIC, "A_Thrust: Var1 not specified!\n"); @@ -9037,10 +8851,9 @@ void A_ZThrust(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ZThrust", actor)) return; -#endif if (!locvar1) CONS_Debug(DBG_GAMELOGIC, "A_ZThrust: Var1 not specified!\n"); @@ -9072,10 +8885,9 @@ void A_SetTargetsTarget(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *oldtarg = NULL, *newtarg = NULL; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetTargetsTarget", actor)) return; -#endif // actor's target if (locvar1) // or tracer @@ -9117,10 +8929,9 @@ void A_SetObjectFlags(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; boolean unlinkthings = false; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetObjectFlags", actor)) return; -#endif if (locvar2 == 2) locvar1 = actor->flags | locvar1; @@ -9159,10 +8970,9 @@ void A_SetObjectFlags2(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetObjectFlags2", actor)) return; -#endif if (locvar2 == 2) actor->flags2 |= locvar1; @@ -9187,10 +8997,9 @@ void A_BossJetFume(mobj_t *actor) { mobj_t *filler; INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_BossJetFume", actor)) return; -#endif if (locvar1 == 0) // Boss1 jet fumes { @@ -9323,10 +9132,9 @@ void A_RandomState(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RandomState", actor)) return; -#endif P_SetMobjState(actor, P_RandomChance(FRACUNIT/2) ? locvar1 : locvar2); } @@ -9343,10 +9151,8 @@ void A_RandomStateRange(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_RandomStateRange", actor)) return; -#endif P_SetMobjState(actor, P_RandomRange(locvar1, locvar2)); } @@ -9362,27 +9168,22 @@ void A_DualAction(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_DualAction", actor)) return; -#endif CONS_Debug(DBG_GAMELOGIC, "A_DualAction called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); var1 = states[locvar1].var1; var2 = states[locvar1].var2; -#ifdef HAVE_BLUA astate = &states[locvar1]; -#endif CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling First Action (state %d)...\n", locvar1); states[locvar1].action.acp1(actor); var1 = states[locvar2].var1; var2 = states[locvar2].var2; -#ifdef HAVE_BLUA astate = &states[locvar2]; -#endif CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling Second Action (state %d)...\n", locvar2); states[locvar2].action.acp1(actor); @@ -9400,10 +9201,9 @@ void A_RemoteAction(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *originaltarget = actor->target; // Hold on to the target for later. -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RemoteAction", actor)) return; -#endif // If >=0, find the closest target. if (locvar1 >= 0) @@ -9465,9 +9265,7 @@ void A_RemoteAction(mobj_t *actor) // Steal the var1 and var2 from "locvar2" var1 = states[locvar2].var1; var2 = states[locvar2].var2; -#ifdef HAVE_BLUA astate = &states[locvar2]; -#endif CONS_Debug(DBG_GAMELOGIC, "A_RemoteAction: Calling action on %p\n" "var1 is %d\nvar2 is %d\n", actor->target, var1, var2); @@ -9486,10 +9284,9 @@ void A_RemoteAction(mobj_t *actor) // void A_ToggleFlameJet(mobj_t* actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_ToggleFlameJet", actor)) return; -#endif + // threshold - off delay // movecount - on timer @@ -9533,10 +9330,9 @@ void A_OrbitNights(mobj_t* actor) boolean ishelper = (var2 & 0x10000); boolean donotrescale = (var2 & 0x40000); INT32 xfactor = 32, yfactor = 32, zfactor = 20; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_OrbitNights", actor)) return; -#endif if (actor->flags & MF_GRENADEBOUNCE) { @@ -9607,10 +9403,10 @@ void A_GhostMe(mobj_t *actor) { INT32 locvar1 = var1; mobj_t *ghost; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_GhostMe", actor)) return; -#endif + ghost = P_SpawnGhostMobj(actor); if (ghost && locvar1 > 0) ghost->fuse = locvar1; @@ -9630,10 +9426,9 @@ void A_SetObjectState(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetObjectState", actor)) return; -#endif if ((!locvar2 && !actor->target) || (locvar2 && !actor->tracer)) { @@ -9676,10 +9471,8 @@ void A_SetObjectTypeState(mobj_t *actor) mobj_t *mo2; fixed_t dist = 0; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SetObjectTypeState", actor)) return; -#endif for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { @@ -9719,10 +9512,9 @@ void A_KnockBack(mobj_t *actor) { INT32 locvar1 = var1; mobj_t *target; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_KnockBack", actor)) return; -#endif if (!locvar1) target = actor->target; @@ -9755,10 +9547,9 @@ void A_PushAway(mobj_t *actor) INT32 locvar2 = var2; mobj_t *target; // target angle_t an; // actor to target angle -#ifdef HAVE_BLUA + if (LUA_CallAction("A_PushAway", actor)) return; -#endif if ((!(locvar2 >> 16) && !actor->target) || ((locvar2 >> 16) && !actor->tracer)) return; @@ -9790,10 +9581,9 @@ void A_RingDrain(mobj_t *actor) { INT32 locvar1 = var1; player_t *player; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RingDrain", actor)) return; -#endif if (!actor->target || !actor->target->player) { @@ -9823,10 +9613,9 @@ void A_SplitShot(mobj_t *actor) const UINT16 loc2up = (UINT16)(locvar2 >> 16); const fixed_t offs = (fixed_t)(locvar1*FRACUNIT); const fixed_t hoffs = (fixed_t)(loc2up*FRACUNIT); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SplitShot", actor)) return; -#endif A_FaceTarget(actor); { @@ -9858,10 +9647,10 @@ void A_MissileSplit(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MissileSplit", actor)) return; -#endif + if (actor->eflags & MFE_VERTICALFLIP) P_SpawnAlteredDirectionMissile(actor, locvar1, actor->x, actor->y, actor->z+actor->height, locvar2); else @@ -9886,10 +9675,9 @@ void A_MultiShot(mobj_t *actor) const UINT16 loc1up = (UINT16)(locvar1 >> 16); INT32 count = 0; fixed_t ad; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MultiShot", actor)) return; -#endif if (actor->target) A_FaceTarget(actor); @@ -9948,10 +9736,9 @@ void A_InstaLoop(mobj_t *actor) const angle_t fa = FixedAngleC(loc1lw*FRACUNIT*360, loc1up*FRACUNIT)>>ANGLETOFINESHIFT; const fixed_t ac = FINECOSINE(fa); const fixed_t as = FINESINE(fa); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_InstaLoop", actor)) return; -#endif P_InstaThrust(actor, actor->angle, FixedMul(ac, FixedMul(force, actor->scale))); P_SetObjectMomZ(actor, FixedMul(as, force), false); @@ -9982,10 +9769,9 @@ void A_Custom3DRotate(mobj_t *actor) const fixed_t hOff = FixedMul(loc1up*FRACUNIT, actor->scale); const fixed_t hspeed = FixedMul(loc2up*FRACUNIT/10, actor->scale); const fixed_t vspeed = FixedMul(loc2lw*FRACUNIT/10, actor->scale); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Custom3DRotate", actor)) return; -#endif if (actor->target->health == 0) { @@ -10042,10 +9828,9 @@ void A_SearchForPlayers(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SearchForPlayers", actor)) return; -#endif if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) { @@ -10076,10 +9861,9 @@ void A_CheckRandom(mobj_t *actor) INT32 locvar2 = var2; fixed_t chance = FRACUNIT; -#ifdef HAVE_BLUA if (LUA_CallAction("A_CheckRandom", actor)) return; -#endif + if ((locvar1 & 0xFFFF) == 0) return; @@ -10103,10 +9887,9 @@ void A_CheckTargetRings(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckTargetRings", actor)) return; -#endif if (!(actor->target) || !(actor->target->player)) return; @@ -10127,10 +9910,9 @@ void A_CheckRings(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; INT32 i, cntr = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckRings", actor)) return; -#endif for (i = 0; i < MAXPLAYERS; i++) cntr += players[i].rings; @@ -10152,10 +9934,9 @@ void A_CheckTotalRings(mobj_t *actor) INT32 locvar2 = var2; INT32 i, cntr = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckTotalRings", actor)) return; -#endif for (i = 0; i < MAXPLAYERS; i++) cntr += players[i].totalring; @@ -10175,10 +9956,9 @@ void A_CheckHealth(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckHealth", actor)) return; -#endif if (actor->health <= locvar1) P_SetMobjState(actor, locvar2); @@ -10198,10 +9978,9 @@ void A_CheckRange(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t dist; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckRange", actor)) return; -#endif if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer)) return; @@ -10229,10 +10008,9 @@ void A_CheckHeight(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t height; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckHeight", actor)) return; -#endif if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer)) return; @@ -10262,10 +10040,9 @@ void A_CheckTrueRange(mobj_t *actor) fixed_t height; // vertical range fixed_t dist; // horizontal range fixed_t l; // true range -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckTrueRange", actor)) return; -#endif if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer)) return; @@ -10314,10 +10091,9 @@ void A_CheckThingCount(mobj_t *actor) thinker_t *th; mobj_t *mo2; fixed_t dist = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckThingCount", actor)) return; -#endif for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { @@ -10361,10 +10137,8 @@ void A_CheckAmbush(mobj_t *actor) angle_t atp; // actor to target angle angle_t an; // angle between at and atp -#ifdef HAVE_BLUA if (LUA_CallAction("A_CheckAmbush", actor)) return; -#endif if ((!locvar1 && !actor->target) || (locvar1 && !actor->tracer)) return; @@ -10400,10 +10174,9 @@ void A_CheckCustomValue(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckCustomValue", actor)) return; -#endif if (actor->cusval >= locvar1) P_SetMobjState(actor, locvar2); @@ -10420,10 +10193,9 @@ void A_CheckCusValMemo(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckCusValMemo", actor)) return; -#endif if (actor->cvmem >= locvar1) P_SetMobjState(actor, locvar2); @@ -10446,10 +10218,9 @@ void A_SetCustomValue(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetCustomValue", actor)) return; -#endif if (cv_debug) CONS_Printf("Init custom value is %d\n", actor->cusval); @@ -10497,10 +10268,9 @@ void A_UseCusValMemo(mobj_t *actor) INT32 temp = actor->cusval; // value being manipulated INT32 tempM = actor->cvmem; // value used to manipulate temp with -#ifdef HAVE_BLUA + if (LUA_CallAction("A_UseCusValMemo", actor)) return; -#endif if (locvar1 == 1) // cvmem being changed using cusval { @@ -10561,10 +10331,9 @@ void A_RelayCustomValue(mobj_t *actor) INT32 temp; // reference value - var1 lower 16 bits changes this INT32 tempT; // target's value - changed to tracer if var1 upper 16 bits set, then modified to become final value -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RelayCustomValue", actor)) return; -#endif if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer)) return; @@ -10621,10 +10390,9 @@ void A_CusValAction(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CusValAction", actor)) return; -#endif if (locvar2 == 5) { @@ -10657,9 +10425,7 @@ void A_CusValAction(mobj_t *actor) var2 = states[locvar1].var2; } -#ifdef HAVE_BLUA astate = &states[locvar1]; -#endif states[locvar1].action.acp1(actor); } @@ -10675,10 +10441,9 @@ void A_CusValAction(mobj_t *actor) void A_ForceStop(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ForceStop", actor)) return; -#endif actor->momx = actor->momy = 0; if (locvar1 == 0) @@ -10696,12 +10461,8 @@ void A_ForceWin(mobj_t *actor) { INT32 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_ForceWin", actor)) return; -#else - (void)actor; -#endif for (i = 0; i < MAXPLAYERS; i++) { @@ -10733,10 +10494,9 @@ void A_ForceWin(mobj_t *actor) void A_SpikeRetract(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SpikeRetract", actor)) return; -#endif if (actor->flags & MF_NOBLOCKMAP) return; @@ -10818,10 +10578,9 @@ void A_Repeat(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Repeat", actor)) return; -#endif if (locvar1 && (!actor->extravalue2 || actor->extravalue2 > locvar1)) actor->extravalue2 = locvar1; @@ -10844,10 +10603,9 @@ void A_SetScale(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SetScale", actor)) return; -#endif if (locvar1 <= 0) { @@ -10888,10 +10646,10 @@ void A_RemoteDamage(mobj_t *actor) INT32 locvar2 = var2; mobj_t *target; // we MUST have a target mobj_t *source = NULL; // on the other hand we don't necessarily need a source -#ifdef HAVE_BLUA + if (LUA_CallAction("A_RemoteDamage", actor)) return; -#endif + if (locvar1 == 1) target = actor->target; else if (locvar1 == 2) @@ -10941,10 +10699,9 @@ void A_HomingChase(mobj_t *actor) mobj_t *dest; fixed_t dist; fixed_t speedmul; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_HomingChase", actor)) return; -#endif if (locvar2 == 1) dest = actor->tracer; @@ -10995,10 +10752,9 @@ void A_TrapShot(mobj_t *actor) INT16 vertoff = (INT16)(locvar2 >> 16); fixed_t x, y, z; fixed_t speed; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_TrapShot", actor)) return; -#endif x = actor->x + P_ReturnThrustX(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale)); y = actor->y + P_ReturnThrustY(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale)); @@ -11062,10 +10818,8 @@ void A_VileTarget(mobj_t *actor) mobjtype_t fogtype; INT32 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VileTarget", actor)) return; -#endif if (!actor->target) return; @@ -11151,10 +10905,8 @@ void A_VileAttack(mobj_t *actor) mobj_t *fire; INT32 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VileAttack", actor)) return; -#endif if (!actor->target) return; @@ -11265,10 +11017,8 @@ void A_VileFire(mobj_t *actor) INT32 locvar2 = var2; mobj_t *dest; -#ifdef HAVE_BLUA if (LUA_CallAction("A_VileFire", actor)) return; -#endif dest = actor->tracer; if (!dest) @@ -11353,10 +11103,8 @@ void A_BrakChase(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BrakChase", actor)) return; -#endif // Set new tics NOW, in case the state changes while we're doing this and we try applying this to the painstate or something silly if (actor->tics > 1 && locvar1 < actor->tics) // Not much point, otherwise @@ -11475,10 +11223,9 @@ void A_BrakFireShot(mobj_t *actor) fixed_t x, y, z; INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BrakFireShot", actor)) return; -#endif + if (!actor->target) return; @@ -11539,10 +11286,8 @@ void A_BrakLobShot(mobj_t *actor) INT32 locvar2 = var2 & 0x0000FFFF; INT32 aimDirect = var2 & 0xFFFF0000; -#ifdef HAVE_BLUA if (LUA_CallAction("A_BrakLobShot", actor)) return; -#endif if (!actor->target) return; // Don't even bother if we've got nothing to aim at. @@ -11647,10 +11392,8 @@ void A_NapalmScatter(mobj_t *actor) INT32 i; // for-loop cursor mobj_t *mo; // each and every spawned napalm burst -#ifdef HAVE_BLUA if (LUA_CallAction("A_NapalmScatter", actor)) return; -#endif // Some quick sanity-checking if (typeOfShot >= NUMMOBJTYPES) // I'd add a <0 check, too, but 0x0000FFFF isn't negative in this case @@ -11701,10 +11444,8 @@ void A_SpawnFreshCopy(mobj_t *actor) { mobj_t *newObject; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SpawnFreshCopy", actor)) return; -#endif newObject = P_SpawnMobjFromMobj(actor, 0, 0, 0, actor->type); newObject->flags2 = actor->flags2 & MF2_AMBUSH; @@ -11778,10 +11519,9 @@ void A_FlickySpawn(mobj_t *actor) INT32 locvar2 = var2; INT32 test = (var1 >> 16); SINT8 moveforward = 0; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickySpawn", actor)) return; -#endif if (test & 1) A_Scream(actor); // A shortcut for the truly lazy. @@ -11847,10 +11587,9 @@ void A_FlickyCenter(mobj_t *actor) UINT16 flickytype = (locvar1 & 0xFFFF); UINT8 flickycolor = ((locvar1 >> 16) & 0xFF); UINT8 flickyflags = ((locvar1 >> 20) & 0xF); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyCenter", actor)) return; -#endif if (!actor->tracer) { @@ -11969,10 +11708,8 @@ void A_FlickyAim(mobj_t *actor) INT32 locvar2 = var2; boolean flickyhitwall = false; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FlickyAim", actor)) return; -#endif if ((actor->momx == actor->momy && actor->momy == 0) || (actor->target && P_IsFlickyCenter(actor->target->type) @@ -12070,10 +11807,10 @@ void A_FlickyFly(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyFly", actor)) return; -#endif + P_InternalFlickyFly(actor, locvar1, locvar2, FINECOSINE((((actor->fuse % 36) * ANG10) >> ANGLETOFINESHIFT) & FINEMASK) ); @@ -12090,10 +11827,10 @@ void A_FlickySoar(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickySoar", actor)) return; -#endif + P_InternalFlickyFly(actor, locvar1, locvar2, 2*(FRACUNIT/2 - abs(FINECOSINE((((actor->fuse % 144) * 5*ANG1/2) >> ANGLETOFINESHIFT) & FINEMASK))) ); @@ -12114,10 +11851,10 @@ void A_FlickyCoast(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyCoast", actor)) return; -#endif + if (actor->eflags & MFE_UNDERWATER) { actor->momx = (11*actor->momx)/12; @@ -12161,10 +11898,10 @@ void A_FlickyHop(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyHop", actor)) return; -#endif + P_InternalFlickyHop(actor, locvar1, locvar2, actor->angle); } @@ -12180,10 +11917,10 @@ void A_FlickyFlounder(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; angle_t hopangle; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyFlounder", actor)) return; -#endif + locvar1 *= (P_RandomKey(2) + 1); locvar2 *= (P_RandomKey(2) + 1); hopangle = (actor->angle + (P_RandomKey(9) - 4)*ANG2); @@ -12202,10 +11939,10 @@ void A_FlickyCheck(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyCheck", actor)) return; -#endif + if (actor->target && P_IsFlickyCenter(actor->target->type) && (actor->target->flags & MF_GRENADEBOUNCE)) @@ -12239,10 +11976,10 @@ void A_FlickyHeightCheck(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyHeightCheck", actor)) return; -#endif + if (actor->target && P_IsFlickyCenter(actor->target->type) && (actor->target->flags & MF_GRENADEBOUNCE)) @@ -12274,10 +12011,10 @@ void A_FlickyFlutter(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlickyFlutter", actor)) return; -#endif + var1 = locvar1; var2 = locvar2; A_FlickyCheck(actor); @@ -12305,13 +12042,9 @@ void A_FlameParticle(mobj_t *actor) mobjtype_t type = (mobjtype_t)(mobjinfo[actor->type].painchance); fixed_t rad, hei; mobj_t *particle; - //INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FlameParticle", actor)) return; -#endif if (!type) return; @@ -12337,12 +12070,9 @@ void A_FadeOverlay(mobj_t *actor) { mobj_t *fade; INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FadeOverlay", actor)) return; -#endif fade = P_SpawnGhostMobj(actor); fade->frame = actor->frame; @@ -12382,10 +12112,8 @@ void A_Boss5Jump(mobj_t *actor) // INT32 locvar1 = var1; // INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss5Jump", actor)) return; -#endif if (!actor->tracer) return; // Don't even bother if we've got nothing to aim at. @@ -12461,10 +12189,8 @@ void A_LightBeamReset(mobj_t *actor) // INT32 locvar1 = var1; // INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_LightBeamReset", actor)) return; -#endif actor->destscale = FRACUNIT + P_SignedRandom()*FRACUNIT/256; P_SetScale(actor, actor->destscale); @@ -12493,10 +12219,8 @@ void A_MineExplode(mobj_t *actor) // INT32 locvar1 = var1; // INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MineExplode", actor)) return; -#endif A_Scream(actor); actor->flags = MF_NOGRAVITY|MF_NOCLIP; @@ -12548,10 +12272,8 @@ void A_MineRange(mobj_t *actor) INT32 locvar1 = var1; // INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MineRange", actor)) return; -#endif if (!actor->target) return; @@ -12576,10 +12298,8 @@ void A_ConnectToGround(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_ConnectToGround", actor)) return; -#endif if (actor->subsector->sector->ffloors) P_AdjustMobjFloorZ_FFloors(actor, actor->subsector->sector, 2); @@ -12636,10 +12356,10 @@ void A_SpawnParticleRelative(mobj_t *actor) mobj_t *mo; INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_SpawnParticleRelative", actor)) return; -#endif + CONS_Debug(DBG_GAMELOGIC, "A_SpawnParticleRelative called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); @@ -12674,10 +12394,9 @@ void A_MultiShotDist(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_MultiShotDist", actor)) return; -#endif { UINT8 i; @@ -12714,10 +12433,9 @@ void A_WhoCaresIfYourSonIsABee(mobj_t *actor) fixed_t foffsetx; fixed_t foffsety; mobj_t *son; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_WhoCaresIfYourSonIsABee", actor)) return; -#endif A_FaceTarget(actor); @@ -12749,11 +12467,9 @@ void A_WhoCaresIfYourSonIsABee(mobj_t *actor) void A_ParentTriesToSleep(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ParentTriesToSleep", actor)) return; -#endif if (actor->extravalue1) { @@ -12780,12 +12496,8 @@ void A_ParentTriesToSleep(mobj_t *actor) // void A_CryingToMomma(mobj_t *actor) { - //INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_CryingToMomma", actor)) return; -#endif if (actor->tracer) actor->tracer->extravalue1++; @@ -12813,10 +12525,9 @@ void A_CheckFlags2(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_CheckFlags2", actor)) return; -#endif if (actor->flags2 & locvar1) P_SetMobjState(actor, (statenum_t)locvar2); @@ -12832,14 +12543,12 @@ void A_CheckFlags2(mobj_t *actor) void A_Boss5FindWaypoint(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; boolean avoidcenter; UINT32 i; UINT8 extrainfo = (actor->spawnpoint ? actor->spawnpoint->extrainfo : 0); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5FindWaypoint", actor)) return; -#endif avoidcenter = !actor->tracer || (actor->health == actor->info->damage+1); @@ -13054,10 +12763,9 @@ void A_DoNPCSkid(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t x, y, z; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_DoNPCSkid", actor)) return; -#endif x = actor->x; y = actor->y; @@ -13111,10 +12819,9 @@ void A_DoNPCPain(mobj_t *actor) INT32 locvar2 = var2; fixed_t vspeed = 0; fixed_t hspeed = FixedMul(4*FRACUNIT, actor->scale); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_DoNPCPain", actor)) return; -#endif actor->flags &= ~(MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT); @@ -13160,11 +12867,9 @@ void A_DoNPCPain(mobj_t *actor) void A_PrepareRepeat(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_PrepareRepeat", actor)) return; -#endif actor->extravalue2 = locvar1; } @@ -13183,10 +12888,9 @@ void A_Boss5ExtraRepeat(mobj_t *actor) INT32 calc; INT32 locspawn; INT32 lochealth; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5ExtraRepeat", actor)) return; -#endif if (actor->extravalue2 > 0 && !(actor->flags2 & MF2_FRET)) return; @@ -13217,10 +12921,9 @@ void A_Boss5ExtraRepeat(mobj_t *actor) // void A_Boss5Calm(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_Boss5Calm", actor)) return; -#endif + actor->flags |= MF_SHOOTABLE; actor->flags2 &= ~MF2_FRET; } @@ -13236,10 +12939,9 @@ void A_Boss5CheckOnGround(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5CheckOnGround", actor)) return; -#endif if ((!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz) || (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height >= actor->ceilingz)) @@ -13268,10 +12970,9 @@ void A_Boss5CheckFalling(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5CheckFalling", actor)) return; -#endif if (actor->health && actor->extravalue2 > 1) { @@ -13298,10 +12999,9 @@ void A_Boss5PinchShot(mobj_t *actor) INT32 locvar2 = var2; fixed_t zoffset; mobj_t *missile; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5PinchShot", actor)) return; -#endif if (actor->health > actor->info->damage) return; @@ -13334,10 +13034,9 @@ void A_Boss5MakeItRain(mobj_t *actor) INT32 locvar2 = var2; INT32 offset = (48 + locvar2)<<16; // upper 16 bits, not fixed_t! INT32 i; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5MakeItRain", actor)) return; -#endif actor->flags2 |= MF2_STRONGBOX; @@ -13371,10 +13070,9 @@ void A_Boss5MakeJunk(mobj_t *actor) mobj_t *broked = NULL; angle_t ang; INT32 i = ((locvar2 & 1) ? 8 : 1); -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5MakeJunk", actor)) return; -#endif if (locvar1 < 0 && (actor->flags2 & MF2_SLIDEPUSH)) // this entire action is a hack, don't judge me { @@ -13462,11 +13160,9 @@ void A_Boss5MakeJunk(mobj_t *actor) void A_LookForBetter(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_LookForBetter", actor)) return; -#endif P_LookForPlayers(actor, (locvar1 & 65535), false, FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale)); A_FaceTarget(actor); @@ -13524,11 +13220,9 @@ static void P_DustRing(mobjtype_t mobjtype, UINT32 div, fixed_t x, fixed_t y, fi void A_Boss5BombExplode(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_Boss5BombExplode", actor)) return; -#endif // The original Lua script did not use |= to add flags but just set these flags exactly apparently? // (I may modify this later) @@ -13631,10 +13325,8 @@ void A_DustDevilThink(mobj_t *actor) INT32 bx, by, xl, xh, yl, yh; fixed_t radius = actor->radius; -#ifdef HAVE_BLUA if (LUA_CallAction("A_DustDevilThink", actor)) return; -#endif //Chained thinker for the spiralling dust column. while (layer && !P_MobjWasRemoved(layer)) { @@ -13771,15 +13463,12 @@ static boolean PIT_TNTExplode(mobj_t *nearby) void A_TNTExplode(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; INT32 x, y; INT32 xl, xh, yl, yh; static mappoint_t epicenter = {0,0,0}; -#ifdef HAVE_BLUA if (LUA_CallAction("A_TNTExplode", actor)) return; -#endif if (actor->tracer) { @@ -13843,12 +13532,9 @@ void A_TNTExplode(mobj_t *actor) void A_DebrisRandom(mobj_t *actor) { INT32 locvar1 = var1; - //INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_DebrisRandom", actor)) return; -#endif actor->frame |= P_RandomRange(0, locvar1); var1 = 0; @@ -13888,10 +13574,8 @@ void A_TrainCameo(mobj_t *actor) fixed_t span = locvar1*FRACUNIT; fixed_t len = locvar2*FRACUNIT; -#ifdef HAVE_BLUA if (LUA_CallAction("A_TrainCameo", actor)) return; -#endif //Spawn sides. P_TrainSeg(actor, x, y + span, z, ang, spr, 0); @@ -13928,10 +13612,8 @@ void A_TrainCameo2(mobj_t *actor) fixed_t span = locvar1*FRACUNIT; fixed_t len = locvar2*FRACUNIT; -#ifdef HAVE_BLUA if (LUA_CallAction("A_TrainCameo2", actor)) return; -#endif //Spawn sides. P_TrainSeg(actor, x, y + span, z, ang, spr, 0); @@ -13956,10 +13638,8 @@ void A_CanarivoreGas(mobj_t *actor) { INT32 locvar1 = var1; -#ifdef HAVE_BLUA if (LUA_CallAction("A_CanarivoreGas", actor)) return; -#endif P_DustRing(locvar1, 4, actor->x, actor->y, actor->z + actor->height / 5, 18, 0, FRACUNIT/10, actor->scale); P_DustRing(locvar1, 6, actor->x, actor->y, actor->z + actor->height / 5, 28, FRACUNIT, FRACUNIT/10, actor->scale); @@ -13979,10 +13659,8 @@ void A_KillSegments(mobj_t *actor) mobj_t *seg = actor->tracer; INT32 fuse = locvar1 ? locvar1 : TICRATE/2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_KillSegments", actor)) return; -#endif while (seg) { @@ -14064,10 +13742,8 @@ void A_SnapperSpawn(mobj_t *actor) INT32 i; mobj_t *seg; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SnapperSpawn", actor)) return; -#endif // It spawns 1 head. seg = P_SpawnMobjFromMobj(actor, 0, 0, 0, headtype); @@ -14116,10 +13792,8 @@ void A_SnapperThinker(mobj_t *actor) fixed_t dist; boolean chasing; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SnapperThinker", actor)) return; -#endif // We make a check just in case there's no spawnpoint. if (actor->spawnpoint) @@ -14239,10 +13913,8 @@ void A_SaloonDoorSpawn(mobj_t *actor) mobj_t *door; mobjflag2_t ambush = (actor->flags2 & MF2_AMBUSH); -#ifdef HAVE_BLUA if (LUA_CallAction("A_SaloonDoorSpawn", actor)) return; -#endif if (!locvar1) return; @@ -14278,10 +13950,8 @@ void A_MinecartSparkThink(mobj_t *actor) fixed_t dz, dm; UINT8 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_MinecartSparkThink", actor)) return; -#endif if (actor->momz == 0 && P_IsObjectOnGround(actor)) actor->momz = P_RandomRange(2, 4)*FRACUNIT; @@ -14313,10 +13983,9 @@ void A_ModuloToState(mobj_t *actor) { INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA + if (LUA_CallAction("A_ModuloToState", actor)) return; -#endif if ((modulothing % locvar1 == 0)) P_SetMobjState(actor, (locvar2)); @@ -14334,10 +14003,8 @@ void A_LavafallRocks(mobj_t *actor) { UINT8 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_LavafallRocks", actor)) return; -#endif // Don't spawn rocks unless a player is relatively close by. for (i = 0; i < MAXPLAYERS; ++i) @@ -14367,10 +14034,8 @@ void A_LavafallLava(mobj_t *actor) mobj_t *lavafall; UINT8 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_LavafallLava", actor)) return; -#endif if ((40 - actor->fuse) % (2*(actor->scale >> FRACBITS))) return; @@ -14397,10 +14062,8 @@ void A_LavafallLava(mobj_t *actor) // void A_FallingLavaCheck(mobj_t *actor) { -#ifdef HAVE_BLUA if (LUA_CallAction("A_FallingLavaCheck", actor)) return; -#endif if (actor->eflags & MFE_TOUCHWATER || P_IsObjectOnGround(actor)) { @@ -14424,10 +14087,8 @@ void A_FireShrink(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_FireShrink", actor)) return; -#endif actor->destscale = locvar1; actor->scalespeed = FRACUNIT/locvar2; @@ -14450,10 +14111,8 @@ void A_SpawnPterabytes(mobj_t *actor) UINT8 amount = 1; UINT8 i; -#ifdef HAVE_BLUA if (LUA_CallAction("A_SpawnPterabytes", actor)) return; -#endif if (actor->spawnpoint) amount = actor->spawnpoint->extrainfo + 1; @@ -14487,10 +14146,8 @@ void A_PterabyteHover(mobj_t *actor) { angle_t ang, fa; -#ifdef HAVE_BLUA if (LUA_CallAction("A_PterabyteHover", actor)) return; -#endif P_InstaThrust(actor, actor->angle, actor->info->speed); actor->angle += ANG1; @@ -14511,10 +14168,8 @@ void A_RolloutSpawn(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_RolloutSpawn", actor)) return; -#endif if (!(actor->target) || P_MobjWasRemoved(actor->target) @@ -14549,10 +14204,8 @@ void A_RolloutRock(mobj_t *actor) fixed_t speed = P_AproxDistance(actor->momx, actor->momy), topspeed = FixedMul(actor->info->speed, actor->scale); boolean inwater = actor->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER); -#ifdef HAVE_BLUA if (LUA_CallAction("A_RolloutRock", actor)) return; -#endif actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves @@ -14634,10 +14287,8 @@ void A_DragonbomberSpawn(mobj_t *actor) UINT8 i; mobj_t *mo = actor; - #ifdef HAVE_BLUA - if (LUA_CallAction("A_DragonbomberSpawn", actor)) - return; - #endif + if (LUA_CallAction("A_DragonbomberSpawn", actor)) + return; for (i = 0; i < var1; i++) // spawn tail segments { @@ -14672,10 +14323,8 @@ void A_DragonWing(mobj_t *actor) mobj_t *target = actor->target; fixed_t x, y; - #ifdef HAVE_BLUA - if (LUA_CallAction("A_DragonWing", actor)) - return; - #endif + if (LUA_CallAction("A_DragonWing", actor)) + return; if (target == NULL || !target->health) { @@ -14707,10 +14356,8 @@ void A_DragonSegment(mobj_t *actor) fixed_t ydist; fixed_t zdist; - #ifdef HAVE_BLUA - if (LUA_CallAction("A_DragonSegment", actor)) - return; - #endif + if (LUA_CallAction("A_DragonSegment", actor)) + return; if (target == NULL || !target->health) { diff --git a/src/p_inter.c b/src/p_inter.c index 95f8fba41..67d197375 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -365,10 +365,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->flags & (MF_ENEMY|MF_BOSS) && special->flags2 & MF2_FRET) return; -#ifdef HAVE_BLUA if (LUAh_TouchSpecial(special, toucher) || P_MobjWasRemoved(special)) return; -#endif // 0 = none, 1 = elemental pierce, 2 = bubble bounce elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY) @@ -1919,10 +1917,8 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour if (!netgame) return; // Presumably it's obvious what's happening in splitscreen. -#ifdef HAVE_BLUA if (LUAh_HurtMsg(player, inflictor, source, damagetype)) return; -#endif deadtarget = (player->mo->health <= 0); @@ -2395,10 +2391,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL); target->health = 0; // This makes it easy to check if something's dead elsewhere. -#ifdef HAVE_BLUA if (LUAh_MobjDeath(target, inflictor, source, damagetype) || P_MobjWasRemoved(target)) return; -#endif // Let EVERYONE know what happened to a player! 01-29-2002 Tails if (target->player && !target->player->spectator) @@ -3511,11 +3505,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source) boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { player_t *player; -#ifdef HAVE_BLUA boolean force = false; -#else - static const boolean force = false; -#endif if (objectplacing) return false; @@ -3533,7 +3523,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; } -#ifdef HAVE_BLUA // Everything above here can't be forced. if (!metalrecording) { @@ -3545,7 +3534,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else if (shouldForce == 2) return false; } -#endif if (!force) { @@ -3579,10 +3567,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force && target->flags2 & MF2_FRET) // Currently flashing from being hit return false; -#ifdef HAVE_BLUA if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target)) return true; -#endif if (target->health > 1) target->flags2 |= MF2_FRET; @@ -3631,10 +3617,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da || (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam))) return false; // Don't run eachother over in special stages and team games and such } -#ifdef HAVE_BLUA if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) return true; -#endif P_NiGHTSDamage(target, source); // -5s :( return true; } @@ -3687,18 +3671,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (force || (inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE)) // Super Sonic is stunned! { -#ifdef HAVE_BLUA if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) -#endif P_SuperDamage(player, inflictor, source, damage); return true; } return false; } -#ifdef HAVE_BLUA else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) return true; -#endif else if (player->powers[pw_shield] || (player->bot && !ultimatemode)) //If One-Hit Shield { P_ShieldDamage(player, inflictor, source, damage, damagetype); diff --git a/src/p_map.c b/src/p_map.c index 966684818..988089989 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -756,11 +756,9 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->z + tmthing->height < thing->z) return true; // underneath -#ifdef HAVE_BLUA // REX HAS SEEN YOU if (!LUAh_SeenPlayer(tmthing->target->player, thing->player)) return false; -#endif seenplayer = thing->player; return false; @@ -948,7 +946,6 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // the line doesn't cross between either pair of opposite corners } -#ifdef HAVE_BLUA { UINT8 shouldCollide = LUAh_MobjCollide(thing, tmthing); // checks hook for thing's type if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing)) @@ -957,9 +954,8 @@ static boolean PIT_CheckThing(mobj_t *thing) return false; // force collide else if (shouldCollide == 2) return true; // force no collide - } - { - UINT8 shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type + + shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing)) return true; // one of them was removed??? if (shouldCollide == 1) @@ -967,7 +963,6 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (shouldCollide == 2) return true; // force no collide } -#endif if (tmthing->type == MT_LAVAFALL_LAVA && (thing->type == MT_RING || thing->type == MT_REDTEAMRING || thing->type == MT_BLUETEAMRING || thing->type == MT_FLINGRING)) { @@ -1946,7 +1941,6 @@ static boolean PIT_CheckLine(line_t *ld) // this line is out of the if so upper and lower textures can be hit by a splat blockingline = ld; -#ifdef HAVE_BLUA { UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, blockingline); // checks hook for thing's type if (P_MobjWasRemoved(tmthing)) @@ -1956,7 +1950,6 @@ static boolean PIT_CheckLine(line_t *ld) else if (shouldCollide == 2) return true; // force no collide } -#endif if (!ld->backsector) // one sided line { diff --git a/src/p_mobj.c b/src/p_mobj.c index 9194cf9f7..8ba1adc73 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -62,9 +62,7 @@ void P_RunCachedActions(void) { var1 = states[ac->statenum].var1; var2 = states[ac->statenum].var2; -#ifdef HAVE_BLUA astate = &states[ac->statenum]; -#endif if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case... states[ac->statenum].action.acp1(ac->mobj); next = ac->next; @@ -459,9 +457,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) { var1 = st->var1; var2 = st->var2; -#ifdef HAVE_BLUA astate = st; -#endif st->action.acp1(mobj); // woah. a player was removed by an action. @@ -585,9 +581,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) { var1 = st->var1; var2 = st->var2; -#ifdef HAVE_BLUA astate = st; -#endif st->action.acp1(mobj); if (P_MobjWasRemoved(mobj)) return false; @@ -1906,15 +1900,12 @@ void P_XYMovement(mobj_t *mo) B_MoveBlocked(player); } -#ifdef HAVE_BLUA if (LUAh_MobjMoveBlocked(mo)) { if (P_MobjWasRemoved(mo)) return; } - else -#endif - if (P_MobjWasRemoved(mo)) + else if (P_MobjWasRemoved(mo)) return; else if (mo->flags & MF_BOUNCE) { @@ -7643,12 +7634,10 @@ static void P_RosySceneryThink(mobj_t *mobj) static void P_MobjSceneryThink(mobj_t *mobj) { -#ifdef HAVE_BLUA if (LUAh_MobjThinker(mobj)) return; if (P_MobjWasRemoved(mobj)) return; -#endif if ((mobj->flags2 & MF2_SHIELD) && !P_AddShield(mobj)) return; @@ -7993,9 +7982,7 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (!mobj->fuse) { -#ifdef HAVE_BLUA if (!LUAh_MobjFuse(mobj)) -#endif P_RemoveMobj(mobj); return; } @@ -8054,9 +8041,7 @@ static void P_MobjSceneryThink(mobj_t *mobj) mobj->fuse--; if (!mobj->fuse) { -#ifdef HAVE_BLUA if (!LUAh_MobjFuse(mobj)) -#endif P_RemoveMobj(mobj); return; } @@ -8085,7 +8070,6 @@ static boolean P_MobjPushableThink(mobj_t *mobj) static boolean P_MobjBossThink(mobj_t *mobj) { -#ifdef HAVE_BLUA if (LUAh_BossThinker(mobj)) { if (P_MobjWasRemoved(mobj)) @@ -8094,7 +8078,6 @@ static boolean P_MobjBossThink(mobj_t *mobj) else if (P_MobjWasRemoved(mobj)) return false; else -#endif switch (mobj->type) { case MT_EGGMOBILE: @@ -10004,113 +9987,110 @@ static boolean P_FuseThink(mobj_t *mobj) if (mobj->fuse) return true; -#ifdef HAVE_BLUA if (LUAh_MobjFuse(mobj) || P_MobjWasRemoved(mobj)) ; - else -#endif - if (mobj->info->flags & MF_MONITOR) + else if (mobj->info->flags & MF_MONITOR) + { + P_MonitorFuseThink(mobj); + return false; + } + else switch (mobj->type) + { + // gargoyle and snowman handled in P_PushableThinker, not here + case MT_THROWNGRENADE: + case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE: + P_SetMobjState(mobj, mobj->info->deathstate); + break; + case MT_LHRT: + P_KillMobj(mobj, NULL, NULL, 0); + break; + case MT_BLUEFLAG: + case MT_REDFLAG: + P_FlagFuseThink(mobj); + P_RemoveMobj(mobj); + return false; + case MT_FANG: + if (mobj->flags2 & MF2_SLIDEPUSH) { - P_MonitorFuseThink(mobj); + var1 = 0; + var2 = 0; + A_BossDeath(mobj); return false; } - else switch (mobj->type) + P_SetMobjState(mobj, mobj->state->nextstate); + if (P_MobjWasRemoved(mobj)) + return false; + break; + case MT_METALSONIC_BATTLE: + break; // don't remove + case MT_SPIKE: + P_SetMobjState(mobj, mobj->state->nextstate); + mobj->fuse = mobj->info->speed; + if (mobj->spawnpoint) + mobj->fuse += mobj->spawnpoint->angle; + break; + case MT_WALLSPIKE: + P_SetMobjState(mobj, mobj->state->nextstate); + mobj->fuse = mobj->info->speed; + if (mobj->spawnpoint) + mobj->fuse += (mobj->spawnpoint->angle / 360); + break; + case MT_NIGHTSCORE: + P_RemoveMobj(mobj); + return false; + case MT_LAVAFALL: + if (mobj->state - states == S_LAVAFALL_DORMANT) { - // gargoyle and snowman handled in P_PushableThinker, not here - case MT_THROWNGRENADE: - case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE: - P_SetMobjState(mobj, mobj->info->deathstate); + mobj->fuse = 30; + P_SetMobjState(mobj, S_LAVAFALL_TELL); + S_StartSound(mobj, mobj->info->seesound); + } + else if (mobj->state - states == S_LAVAFALL_TELL) + { + mobj->fuse = 40; + P_SetMobjState(mobj, S_LAVAFALL_SHOOT); + S_StopSound(mobj); + S_StartSound(mobj, mobj->info->attacksound); + } + else + { + mobj->fuse = 30; + P_SetMobjState(mobj, S_LAVAFALL_DORMANT); + S_StopSound(mobj); + } + return false; + case MT_PYREFLY: + if (mobj->health <= 0) break; - case MT_LHRT: - P_KillMobj(mobj, NULL, NULL, 0); - break; - case MT_BLUEFLAG: - case MT_REDFLAG: - P_FlagFuseThink(mobj); - P_RemoveMobj(mobj); - return false; - case MT_FANG: - if (mobj->flags2 & MF2_SLIDEPUSH) - { - var1 = 0; - var2 = 0; - A_BossDeath(mobj); - return false; - } - P_SetMobjState(mobj, mobj->state->nextstate); - if (P_MobjWasRemoved(mobj)) - return false; - break; - case MT_METALSONIC_BATTLE: - break; // don't remove - case MT_SPIKE: - P_SetMobjState(mobj, mobj->state->nextstate); - mobj->fuse = mobj->info->speed; - if (mobj->spawnpoint) - mobj->fuse += mobj->spawnpoint->angle; - break; - case MT_WALLSPIKE: - P_SetMobjState(mobj, mobj->state->nextstate); - mobj->fuse = mobj->info->speed; - if (mobj->spawnpoint) - mobj->fuse += (mobj->spawnpoint->angle / 360); - break; - case MT_NIGHTSCORE: - P_RemoveMobj(mobj); - return false; - case MT_LAVAFALL: - if (mobj->state - states == S_LAVAFALL_DORMANT) - { - mobj->fuse = 30; - P_SetMobjState(mobj, S_LAVAFALL_TELL); - S_StartSound(mobj, mobj->info->seesound); - } - else if (mobj->state - states == S_LAVAFALL_TELL) - { - mobj->fuse = 40; - P_SetMobjState(mobj, S_LAVAFALL_SHOOT); - S_StopSound(mobj); - S_StartSound(mobj, mobj->info->attacksound); - } - else - { - mobj->fuse = 30; - P_SetMobjState(mobj, S_LAVAFALL_DORMANT); - S_StopSound(mobj); - } - return false; - case MT_PYREFLY: - if (mobj->health <= 0) - break; - mobj->extravalue2 = (mobj->extravalue2 + 1) % 3; - if (mobj->extravalue2 == 0) - { - P_SetMobjState(mobj, mobj->info->spawnstate); - mobj->fuse = 100; - S_StopSound(mobj); - S_StartSound(mobj, sfx_s3k8c); - } - else if (mobj->extravalue2 == 1) - { - mobj->fuse = 50; - S_StartSound(mobj, sfx_s3ka3); - } - else - { - P_SetMobjState(mobj, mobj->info->meleestate); - mobj->fuse = 100; - S_StopSound(mobj); - S_StartSound(mobj, sfx_s3kc2l); - } - return false; - case MT_PLAYER: - break; // don't remove - default: - P_SetMobjState(mobj, mobj->info->xdeathstate); // will remove the mobj if S_NULL. - break; - // Looking for monitors? They moved to a special condition above. + mobj->extravalue2 = (mobj->extravalue2 + 1) % 3; + if (mobj->extravalue2 == 0) + { + P_SetMobjState(mobj, mobj->info->spawnstate); + mobj->fuse = 100; + S_StopSound(mobj); + S_StartSound(mobj, sfx_s3k8c); } + else if (mobj->extravalue2 == 1) + { + mobj->fuse = 50; + S_StartSound(mobj, sfx_s3ka3); + } + else + { + P_SetMobjState(mobj, mobj->info->meleestate); + mobj->fuse = 100; + S_StopSound(mobj); + S_StartSound(mobj, sfx_s3kc2l); + } + return false; + case MT_PLAYER: + break; // don't remove + default: + P_SetMobjState(mobj, mobj->info->xdeathstate); // will remove the mobj if S_NULL. + break; + // Looking for monitors? They moved to a special condition above. + } return !P_MobjWasRemoved(mobj); } @@ -10179,7 +10159,6 @@ void P_MobjThinker(mobj_t *mobj) return; } -#ifdef HAVE_BLUA // Check for a Lua thinker first if (!mobj->player) { @@ -10193,7 +10172,7 @@ void P_MobjThinker(mobj_t *mobj) if (P_MobjWasRemoved(mobj)) return; } -#endif + // if it's pushable, or if it would be pushable other than temporary disablement, use the // separate thinker if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse)) @@ -10656,7 +10635,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Set shadowscale here, before spawn hook so that Lua can change it mobj->shadowscale = P_DefaultMobjShadowScale(mobj); -#ifdef HAVE_BLUA // DANGER! This can cause P_SpawnMobj to return NULL! // Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks! if (LUAh_MobjSpawn(mobj)) @@ -10667,7 +10645,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) else if (P_MobjWasRemoved(mobj)) return NULL; else -#endif switch (mobj->type) { case MT_ALTVIEWMAN: @@ -10937,9 +10914,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) { var1 = st->var1; var2 = st->var2; -#ifdef HAVE_BLUA astate = st; -#endif st->action.acp1(mobj); // DANGER! This can cause P_SpawnMobj to return NULL! // Avoid using MF_RUNSPAWNFUNC on mobjs whose spawn state expects target or tracer to already be set! @@ -11037,16 +11012,12 @@ size_t iquehead, iquetail; void P_RemoveMobj(mobj_t *mobj) { I_Assert(mobj != NULL); -#ifdef HAVE_BLUA if (P_MobjWasRemoved(mobj)) return; // something already removing this mobj. mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing. LUAh_MobjRemoved(mobj); mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work. -#else - I_Assert(!P_MobjWasRemoved(mobj)); -#endif // Rings only, please! if (mobj->spawnpoint && @@ -12710,7 +12681,6 @@ static boolean P_SetupBooster(mapthing_t* mthing, mobj_t* mobj, boolean strong) static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean *doangle) { -#ifdef HAVE_BLUA boolean override = LUAh_MapThingSpawn(mobj, mthing); if (P_MobjWasRemoved(mobj)) @@ -12718,7 +12688,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean if (override) return true; -#endif switch (mobj->type) { diff --git a/src/p_saveg.c b/src/p_saveg.c index e6c7d07fd..37d5f99ba 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4183,8 +4183,6 @@ void P_SaveGame(void) { P_ArchiveMisc(); P_ArchivePlayer(); - - // yes, even in non HAVE_BLUA P_ArchiveLuabanksAndConsistency(); } @@ -4220,9 +4218,7 @@ void P_SaveNetGame(void) P_NetArchiveSpecials(); P_NetArchiveColormaps(); } -#ifdef HAVE_BLUA LUA_Archive(); -#endif P_ArchiveLuabanksAndConsistency(); } @@ -4264,9 +4260,7 @@ boolean P_LoadNetGame(void) P_RelinkPointers(); P_FinishMobjs(); } -#ifdef HAVE_BLUA LUA_UnArchive(); -#endif // This is stupid and hacky, but maybe it'll work! P_SetRandSeed(P_GetInitSeed()); diff --git a/src/p_setup.c b/src/p_setup.c index 766e82ca0..b3b86886f 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -57,9 +57,7 @@ #include "filesrch.h" // refreshdirmenu -#ifdef HAVE_BLUA #include "lua_hud.h" // level title -#endif #include "f_finale.h" // wipes @@ -3526,9 +3524,7 @@ boolean P_LoadLevel(boolean fromnetsave) // Close text prompt before freeing the old level F_EndTextPrompt(false, true); -#ifdef HAVE_BLUA LUA_InvalidateLevel(); -#endif for (ss = sectors; sectors+numsectors != ss; ss++) { @@ -3665,9 +3661,7 @@ boolean P_LoadLevel(boolean fromnetsave) G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1); } P_PreTicker(2); -#ifdef HAVE_BLUA LUAh_MapLoad(); -#endif } // No render mode, stop here. @@ -3859,10 +3853,8 @@ boolean P_AddWadFile(const char *wadfilename) // Update the detected resources. // Note: ALWAYS load Lua scripts first, SOCs right after, and the remaining resources afterwards. -#ifdef HAVE_BLUA // if (luaNum) // Lua scripts. // P_LoadLuaScrRange(wadnum, luaPos, luaNum); -#endif // if (socNum) // SOCs. // P_LoadDehackRange(wadnum, socPos, socNum); if (sfxNum) // Sounds. TODO: Function currently only updates already existing sounds, the rest is handled somewhere else. diff --git a/src/p_spec.c b/src/p_spec.c index aecdb3b98..8938a51b6 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3366,14 +3366,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } case 443: // Calls a named Lua function -#ifdef HAVE_BLUA if (line->text) LUAh_LinedefExecute(line, mo, callsec); else CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in the front texture fields)\n", sizeu1(line-lines)); -#else - CONS_Alert(CONS_ERROR, "The map is trying to run a Lua script, but this exe was not compiled with Lua support!\n"); -#endif break; case 444: // Earthquake camera diff --git a/src/p_tick.c b/src/p_tick.c index 1d421ad37..7ea6edb2d 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -269,9 +269,7 @@ void P_RemoveThinkerDelayed(thinker_t *thinker) // void P_RemoveThinker(thinker_t *thinker) { -#ifdef HAVE_BLUA LUA_InvalidateUserdata(thinker); -#endif thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; } @@ -643,9 +641,7 @@ void P_Ticker(boolean run) if (demoplayback) G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0); - #ifdef HAVE_BLUA LUAh_PreThinkFrame(); - #endif for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) @@ -671,9 +667,7 @@ void P_Ticker(boolean run) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) P_PlayerAfterThink(&players[i]); -#ifdef HAVE_BLUA LUAh_ThinkFrame(); -#endif } // Run shield positioning @@ -745,9 +739,7 @@ void P_Ticker(boolean run) if (modeattacking) G_GhostTicker(); -#ifdef HAVE_BLUA LUAh_PostThinkFrame(); -#endif } P_MapEnd(); @@ -767,9 +759,8 @@ void P_PreTicker(INT32 frames) { P_MapStart(); -#ifdef HAVE_BLUA LUAh_PreThinkFrame(); -#endif + for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) { @@ -793,9 +784,7 @@ void P_PreTicker(INT32 frames) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) P_PlayerAfterThink(&players[i]); -#ifdef HAVE_BLUA LUAh_ThinkFrame(); -#endif // Run shield positioning P_RunShields(); @@ -804,9 +793,7 @@ void P_PreTicker(INT32 frames) P_UpdateSpecials(); P_RespawnSpecials(); -#ifdef HAVE_BLUA LUAh_PostThinkFrame(); -#endif P_MapEnd(); } diff --git a/src/p_user.c b/src/p_user.c index 345da85ef..19b53e16f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1109,7 +1109,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing) if (!player->mo || player->spectator || !thing || P_MobjWasRemoved(thing)) return false; -#ifdef HAVE_BLUA { UINT8 shouldCollide = LUAh_PlayerCanDamage(player, thing); if (P_MobjWasRemoved(thing)) @@ -1119,7 +1118,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing) else if (shouldCollide == 2) return false; // force no } -#endif // Invinc/super. Not for Monitors. if (!(thing->flags & MF_MONITOR) && (player->powers[pw_invulnerability] || player->powers[pw_super])) @@ -1521,7 +1519,7 @@ void P_PlayJingle(player_t *player, jingletype_t jingletype) char newmusic[7]; strncpy(newmusic, musname, 7); -#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) +#ifdef HAVE_LUA_MUSICPLUS if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping)) return; #endif @@ -1602,10 +1600,8 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) break; case JT_OTHER: // Other state -#ifdef HAVE_BLUA result = LUAh_ShouldJingleContinue(&players[i], musname); break; -#endif case JT_NONE: // Null state case JT_MASTER: // Main level music @@ -1870,10 +1866,8 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif -#ifdef HAVE_BLUA if (LUAh_ShieldSpawn(player)) return; -#endif if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_FORCE_ORB; @@ -4638,13 +4632,11 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) && (player->pflags & PF_JUMPSTASIS || player->mo->state-states != S_PLAY_GLIDE_LANDING)) return; -#ifdef HAVE_BLUA if (cmd->buttons & BT_USE) { if (LUAh_SpinSpecial(player)) return; } -#endif #ifdef ESLOPE canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2); @@ -5130,11 +5122,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) } } } - if (cmd->buttons & BT_USE // Spin button effects - #ifdef HAVE_BLUA - && !LUAh_ShieldSpecial(player) - #endif - ) + if (cmd->buttons & BT_USE && !LUAh_ShieldSpecial(player)) // Spin button effects { // Force stop if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) @@ -5212,51 +5200,48 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) // and you don't have a shield, do it! P_DoSuperTransformation(player, false); } - else -#ifdef HAVE_BLUA - if (!LUAh_JumpSpinSpecial(player)) -#endif - switch (player->charability) - { - case CA_THOK: - if (player->powers[pw_super]) // Super Sonic float - { - if ((player->speed > 5*player->mo->scale) // FixedMul(5<mo->scale), but scale is FRACUNIT-based - && (P_MobjFlip(player->mo)*player->mo->momz <= 0)) + else if (!LUAh_JumpSpinSpecial(player)) + switch (player->charability) + { + case CA_THOK: + if (player->powers[pw_super]) // Super Sonic float { - if (player->panim != PA_RUN && player->panim != PA_WALK) + if ((player->speed > 5*player->mo->scale) // FixedMul(5<mo->scale), but scale is FRACUNIT-based + && (P_MobjFlip(player->mo)*player->mo->momz <= 0)) { - if (player->speed >= FixedMul(player->runspeed, player->mo->scale)) - P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN); - else - P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT); - } + if (player->panim != PA_RUN && player->panim != PA_WALK) + { + if (player->speed >= FixedMul(player->runspeed, player->mo->scale)) + P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN); + else + P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT); + } - player->mo->momz = 0; - player->pflags &= ~(PF_STARTJUMP|PF_SPINNING); + player->mo->momz = 0; + player->pflags &= ~(PF_STARTJUMP|PF_SPINNING); + } } - } - break; - case CA_TELEKINESIS: - if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY)) - { - P_Telekinesis(player, - -FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player) - FixedMul(384*FRACUNIT, player->mo->scale)); - } - break; - case CA_TWINSPIN: - if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY)) - { - player->pflags |= PF_THOKKED; - S_StartSound(player->mo, sfx_s3k42); - player->mo->frame = 0; - P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN); - } - break; - default: - break; - } + break; + case CA_TELEKINESIS: + if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY)) + { + P_Telekinesis(player, + -FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player) + FixedMul(384*FRACUNIT, player->mo->scale)); + } + break; + case CA_TWINSPIN: + if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY)) + { + player->pflags |= PF_THOKKED; + S_StartSound(player->mo, sfx_s3k42); + player->mo->frame = 0; + P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN); + } + break; + default: + break; + } } } @@ -5292,16 +5277,13 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_JUMP && !player->exiting && !P_PlayerInPain(player)) { -#ifdef HAVE_BLUA if (LUAh_JumpSpecial(player)) ; - else -#endif - if (player->pflags & PF_JUMPDOWN) // all situations below this require jump button not to be pressed already + // all situations below this require jump button not to be pressed already + else if (player->pflags & PF_JUMPDOWN) ; - else // Jump S3&K style while in quicksand. - if (P_InQuicksand(player->mo)) + else if (P_InQuicksand(player->mo)) { P_DoJump(player, true); player->secondjump = 0; @@ -5313,9 +5295,8 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) P_SetTarget(&player->mo->tracer, NULL); player->powers[pw_flashing] = TICRATE/4; } - else // can't jump while in air, can't jump while jumping - if (onground || player->climbing || player->powers[pw_carry]) + else if (onground || player->climbing || player->powers[pw_carry]) { P_DoJump(player, true); player->secondjump = 0; @@ -5331,9 +5312,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) }*/ else if (player->pflags & PF_JUMPED) { -#ifdef HAVE_BLUA if (!LUAh_AbilitySpecial(player)) -#endif switch (player->charability) { case CA_THOK: @@ -5528,30 +5507,28 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) } else if (player->pflags & PF_THOKKED) { -#ifdef HAVE_BLUA if (!LUAh_AbilitySpecial(player)) -#endif - switch (player->charability) - { - case CA_FLY: - case CA_SWIM: // Swim - if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER)) - ; // Can't do anything if you're a fish out of water! - else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost. - { - player->fly1 = 20; + switch (player->charability) + { + case CA_FLY: + case CA_SWIM: // Swim + if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER)) + ; // Can't do anything if you're a fish out of water! + else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost. + { + player->fly1 = 20; - if (player->charability == CA_SWIM) - player->fly1 /= 2; + if (player->charability == CA_SWIM) + player->fly1 /= 2; - // Slow down! - if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale)) - P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale)); - } - break; - default: - break; - } + // Slow down! + if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale)) + P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale)); + } + break; + default: + break; + } } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super]) P_DoJumpShield(player); @@ -10638,10 +10615,8 @@ boolean P_SpectatorJoinGame(player_t *player) else changeto = (P_RandomFixed() & 1) + 1; -#ifdef HAVE_BLUA if (!LUAh_TeamSwitch(player, changeto, true, false, false)) return false; -#endif if (player->mo) { @@ -10655,11 +10630,9 @@ boolean P_SpectatorJoinGame(player_t *player) //Reset away view if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) { -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. LUAh_ViewpointSwitch(player, &players[consoleplayer], true); -#endif displayplayer = consoleplayer; } @@ -10677,10 +10650,8 @@ boolean P_SpectatorJoinGame(player_t *player) // respawn in place and sit there for the rest of the round. if (!((gametyperules & GTR_HIDEFROZEN) && leveltime > (hidetime * TICRATE))) { -#ifdef HAVE_BLUA if (!LUAh_TeamSwitch(player, 3, true, false, false)) return false; -#endif if (player->mo) { P_RemoveMobj(player->mo); @@ -10704,11 +10675,9 @@ boolean P_SpectatorJoinGame(player_t *player) //Reset away view if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) { -#ifdef HAVE_BLUA // Call ViewpointSwitch hooks here. // The viewpoint was forcibly changed. LUAh_ViewpointSwitch(player, &players[consoleplayer], true); -#endif displayplayer = consoleplayer; } @@ -11631,9 +11600,7 @@ void P_PlayerThink(player_t *player) } if (player->playerstate == PST_REBORN) { -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif return; } } @@ -11737,9 +11704,7 @@ void P_PlayerThink(player_t *player) if (player->playerstate == PST_DEAD) { -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif return; } } @@ -11862,9 +11827,7 @@ void P_PlayerThink(player_t *player) { player->mo->flags2 &= ~MF2_SHADOW; P_DeathThink(player); -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif return; } @@ -11906,9 +11869,7 @@ void P_PlayerThink(player_t *player) { if (P_SpectatorJoinGame(player)) { -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif return; // player->mo was removed. } } @@ -12013,9 +11974,7 @@ void P_PlayerThink(player_t *player) if (!player->mo) { -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif return; // P_MovePlayer removed player->mo. } @@ -12457,9 +12416,7 @@ void P_PlayerThink(player_t *player) } #undef dashmode -#ifdef HAVE_BLUA LUAh_PlayerThink(player); -#endif /* // Colormap verification @@ -13009,11 +12966,9 @@ void P_PlayerAfterThink(player_t *player) if (player->followmobj) { -#ifdef HAVE_BLUA if (LUAh_FollowMobj(player, player->followmobj) || P_MobjWasRemoved(player->followmobj)) {;} else -#endif { switch (player->followmobj->type) { diff --git a/src/s_sound.c b/src/s_sound.c index 91345b3a2..0cc40a9ce 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -40,7 +40,7 @@ extern INT32 msg_id; #include "m_misc.h" // for tunes command #include "m_cond.h" // for conditionsets -#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) +#ifdef HAVE_LUA_MUSICPLUS #include "lua_hook.h" // MusicChange hook #endif @@ -2314,7 +2314,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 return; strncpy(newmusic, mmusic, 7); -#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) +#ifdef HAVE_LUA_MUSICPLUS if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms)) return; #endif diff --git a/src/sdl/Srb2SDL-vc9.vcproj b/src/sdl/Srb2SDL-vc9.vcproj index 3898aeba4..9ef4301cc 100644 --- a/src/sdl/Srb2SDL-vc9.vcproj +++ b/src/sdl/Srb2SDL-vc9.vcproj @@ -50,7 +50,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -145,7 +145,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -248,7 +248,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="0" PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch" @@ -350,7 +350,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="0" PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch" diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index b615bc1df..182220265 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1272,7 +1272,6 @@ HAVE_SDL, HAVE_MIXER, HAVE_PNG, - HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, HWRENDER, @@ -1395,7 +1394,6 @@ HAVE_SDL, HAVE_MIXER, HAVE_PNG, - HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, HWRENDER, diff --git a/src/st_stuff.c b/src/st_stuff.c index 4864f2af6..ee7fc3f21 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -42,9 +42,7 @@ #include "hardware/hw_main.h" #endif -#ifdef HAVE_BLUA #include "lua_hud.h" -#endif UINT16 objectsdrawn = 0; @@ -969,11 +967,7 @@ static void ST_drawLivesArea(void) V_DrawThinString(hudinfo[HUD_LIVES].x+18, hudinfo[HUD_LIVES].y, v_colmap, skins[stplyr->skin].hudname); // Power Stones collected - if (G_RingSlingerGametype() -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_powerstones) -#endif - ) + if (G_RingSlingerGametype() && LUA_HudEnabled(hud_powerstones)) { INT32 workx = hudinfo[HUD_LIVES].x+1, j; if ((leveltime & 1) && stplyr->powers[pw_invulnerability] && (stplyr->powers[pw_sneakers] == stplyr->powers[pw_invulnerability])) // hack; extremely unlikely to be activated unintentionally @@ -1341,17 +1335,11 @@ void ST_drawTitleCard(void) if (!G_IsTitleCardAvailable()) return; -#ifdef HAVE_BLUA if (!LUA_HudEnabled(hud_stagetitle)) goto luahook; -#endif if (lt_ticker >= (lt_endtime + TICRATE)) -#ifdef HAVE_BLUA goto luahook; -#else - return; -#endif if ((lt_ticker-lt_lasttic) > 1) lt_ticker = lt_lasttic+1; @@ -1396,10 +1384,8 @@ void ST_drawTitleCard(void) lt_lasttic = lt_ticker; -#ifdef HAVE_BLUA luahook: LUAh_TitleCardHUD(stplyr); -#endif } // @@ -1444,7 +1430,7 @@ static void ST_drawPowerupHUD(void) if (stplyr->spectator || stplyr->playerstate != PST_LIVE) return; - + // --------- // Finish icon // --------- @@ -1785,11 +1771,7 @@ static void ST_drawNiGHTSHUD(void) const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)); // Drill meter - if ( -#ifdef HAVE_BLUA - LUA_HudEnabled(hud_nightsdrill) && -#endif - stplyr->powers[pw_carry] == CR_NIGHTSMODE) + if (LUA_HudEnabled(hud_nightsdrill) && stplyr->powers[pw_carry] == CR_NIGHTSMODE) { INT32 locx = 16, locy = 180; INT32 dfill; @@ -1831,9 +1813,7 @@ static void ST_drawNiGHTSHUD(void) if (!oldspecialstage // Don't display when the score is showing (it popping up for a split second when exiting a map is intentional) && !(stplyr->texttimer && stplyr->textvar == 4) -#ifdef HAVE_BLUA && LUA_HudEnabled(hud_nightslink) -#endif && ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link". { ST_drawNiGHTSLink(); @@ -1847,10 +1827,8 @@ static void ST_drawNiGHTSHUD(void) } // Begin drawing brackets/chip display -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_nightsspheres)) { -#endif ST_DrawTopLeftOverlayPatch(16, 8, nbracket); if (G_IsSpecialStage(gamemap)) ST_DrawTopLeftOverlayPatch(24, 16, ( @@ -1987,24 +1965,14 @@ static void ST_drawNiGHTSHUD(void) V_DrawTallNum((total_spherecount >= 1000) ? 76 : 72, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount); else V_DrawTallNum(68, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount); -#ifdef HAVE_BLUA } -#endif // Score - if (!stplyr->exiting && !oldspecialstage -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_nightsscore) -#endif - ) + if (!stplyr->exiting && !oldspecialstage && LUA_HudEnabled(hud_nightsscore)) ST_DrawNightsOverlayNum(304<marescore, nightsnum, SKINCOLOR_AZURE); - if (!stplyr->exiting -#ifdef HAVE_BLUA // TODO give this its own section for Lua - && LUA_HudEnabled(hud_nightsscore) -#endif - ) + if (!stplyr->exiting && LUA_HudEnabled(hud_nightsscore)) { if (modeattacking == ATTACKING_NIGHTS) { @@ -2027,11 +1995,7 @@ static void ST_drawNiGHTSHUD(void) } // Ideya time remaining - if (!stplyr->exiting && stplyr->nightstime > 0 -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_nightstime) -#endif - ) + if (!stplyr->exiting && stplyr->nightstime > 0 && LUA_HudEnabled(hud_nightstime)) { INT32 realnightstime = stplyr->nightstime/TICRATE; INT32 numbersize; @@ -2122,10 +2086,8 @@ static void ST_drawNiGHTSHUD(void) } // Records/extra text -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_nightsrecords)) -#endif - ST_drawNightsRecords(); + ST_drawNightsRecords(); } } @@ -2403,20 +2365,16 @@ static void ST_drawTeamHUD(void) else p = bmatcico; -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_teamscores)) -#endif - V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); + V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); if (gametyperules & GTR_TEAMFLAGS) p = rflagico; else p = rmatcico; -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_teamscores)) -#endif - V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); + V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); if (!(gametyperules & GTR_TEAMFLAGS)) goto num; @@ -2427,18 +2385,12 @@ static void ST_drawTeamHUD(void) // Show which flags aren't at base. for (i = 0; i < MAXPLAYERS; i++) { - if (players[i].gotflag & GF_BLUEFLAG // Blue flag isn't at base -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_teamscores) -#endif - ) + // Blue flag isn't at base + if (players[i].gotflag & GF_BLUEFLAG && LUA_HudEnabled(hud_teamscores)) V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(nonicon->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon); - if (players[i].gotflag & GF_REDFLAG // Red flag isn't at base -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_teamscores) -#endif - ) + // Red flag isn't at base + if (players[i].gotflag & GF_REDFLAG && LUA_HudEnabled(hud_teamscores)) V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2); whichflag |= players[i].gotflag; @@ -2449,32 +2401,20 @@ static void ST_drawTeamHUD(void) // Display a countdown timer showing how much time left until the flag returns to base. { - if (blueflag && blueflag->fuse > 1 -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_teamscores) -#endif - ) + if (blueflag && blueflag->fuse > 1 && LUA_HudEnabled(hud_teamscores)) V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (blueflag->fuse / TICRATE))); - if (redflag && redflag->fuse > 1 -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_teamscores) -#endif - ) + if (redflag && redflag->fuse > 1 && LUA_HudEnabled(hud_teamscores)) V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (redflag->fuse / TICRATE))); } } num: -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_teamscores)) -#endif - V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", bluescore)); + V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", bluescore)); -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_teamscores)) -#endif - V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", redscore)); + V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", redscore)); #undef SEP } @@ -2661,24 +2601,14 @@ static void ST_overlayDrawer(void) ST_drawNiGHTSHUD(); else { -#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_score)) -#endif - ST_drawScore(); -#ifdef HAVE_BLUA + ST_drawScore(); if (LUA_HudEnabled(hud_time)) -#endif - ST_drawTime(); -#ifdef HAVE_BLUA + ST_drawTime(); if (LUA_HudEnabled(hud_rings)) -#endif - ST_drawRings(); + ST_drawRings(); - if (!modeattacking -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_lives) -#endif - ) + if (!modeattacking && LUA_HudEnabled(hud_lives)) ST_drawLivesArea(); } } @@ -2753,11 +2683,7 @@ static void ST_overlayDrawer(void) // Draw Match-related stuff //\note Match HUD is drawn no matter what gametype. // ... just not if you're a spectator. - if (!stplyr->spectator -#ifdef HAVE_BLUA - && (LUA_HudEnabled(hud_weaponrings)) -#endif - ) + if (!stplyr->spectator && LUA_HudEnabled(hud_weaponrings)) ST_drawMatchHUD(); // Race HUD Stuff @@ -2798,20 +2724,14 @@ static void ST_overlayDrawer(void) else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2) ST_drawPowerupHUD(); // same as it ever was... -#ifdef HAVE_BLUA if (!(netgame || multiplayer) || !hu_showscores) LUAh_GameHUD(stplyr); -#endif // draw level title Tails if (stagetitle && (!WipeInAction) && (!WipeStageTitle)) ST_drawTitleCard(); - if (!hu_showscores && (netgame || multiplayer) -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_textspectator) -#endif - ) + if (!hu_showscores && (netgame || multiplayer) && LUA_HudEnabled(hud_textspectator)) ST_drawTextHUD(); if (modeattacking && !(demoplayback && hu_showscores)) diff --git a/src/w_wad.c b/src/w_wad.c index e96afd050..f7ccc175b 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -189,7 +189,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors) static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) { UINT16 posStart, posEnd; -#ifdef HAVE_BLUA + posStart = W_CheckNumForFolderStartPK3("Lua/", wadnum, 0); if (posStart != INT16_MAX) { @@ -198,7 +198,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) for (; posStart < posEnd; posStart++) LUA_LoadLump(wadnum, posStart); } -#endif + posStart = W_CheckNumForFolderStartPK3("SOC/", wadnum, 0); if (posStart != INT16_MAX) { @@ -224,7 +224,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) { UINT16 lump; -#ifdef HAVE_BLUA // Find Lua scripts before SOCs to allow new A_Actions in SOC editing. { lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; @@ -232,7 +231,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) if (memcmp(lump_p->name,"LUA_",4)==0) LUA_LoadLump(wadnum, lump); } -#endif { lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; @@ -749,11 +747,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) case RET_SOC: lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG"); break; -#ifdef HAVE_BLUA case RET_LUA: lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT"); break; -#endif case RET_PK3: lumpinfo = ResGetLumpsZip(handle, &numlumps); break; @@ -818,11 +814,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfile->filename); DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0, mainfile); break; -#ifdef HAVE_BLUA case RET_LUA: LUA_LoadLump(numwadfiles - 1, 0); break; -#endif default: break; } @@ -1860,10 +1854,7 @@ static int W_VerifyFile(const char *filename, lumpchecklist_t *checklist, { // detect wad file by the absence of the other supported extensions if (stricmp(&filename[strlen(filename) - 4], ".soc") -#ifdef HAVE_BLUA - && stricmp(&filename[strlen(filename) - 4], ".lua") -#endif - ) + && stricmp(&filename[strlen(filename) - 4], ".lua")) { goodfile = W_VerifyWAD(handle, checklist, status); } diff --git a/src/win32/Srb2win-vc9.vcproj b/src/win32/Srb2win-vc9.vcproj index a64b8638c..4c17bb6f7 100644 --- a/src/win32/Srb2win-vc9.vcproj +++ b/src/win32/Srb2win-vc9.vcproj @@ -55,7 +55,7 @@ Optimization="0" OmitFramePointers="false" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="_DEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" MinimalRebuild="true" RuntimeLibrary="1" EnableFunctionLevelLinking="true" @@ -153,7 +153,7 @@ Optimization="0" OmitFramePointers="false" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" SmallerTypeCheck="true" @@ -256,7 +256,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="NDEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="NDEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -356,7 +356,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib"" - PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" diff --git a/src/y_inter.c b/src/y_inter.c index 6f23ef1b1..94a289817 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -37,9 +37,7 @@ #include "m_cond.h" // condition sets #include "lua_hook.h" // IntermissionThinker hook -#ifdef HAVE_BLUA #include "lua_hud.h" -#endif #ifdef HWRENDER #include "hardware/hw_main.h" @@ -330,9 +328,7 @@ void Y_IntermissionDrawer(void) if (intertype == int_none) { -#ifdef HAVE_BLUA LUAh_IntermissionHUD(); -#endif return; } @@ -384,11 +380,9 @@ void Y_IntermissionDrawer(void) else V_DrawPatchFill(bgtile); -#ifdef HAVE_BLUA LUAh_IntermissionHUD(); if (!LUA_HudEnabled(hud_intermissiontally)) goto skiptallydrawer; -#endif dontdrawbg: if (intertype == int_coop) @@ -944,11 +938,9 @@ dontdrawbg: } } -#ifdef HAVE_BLUA skiptallydrawer: if (!LUA_HudEnabled(hud_intermissionmessages)) return; -#endif if (timer) V_DrawCenteredString(BASEVIDWIDTH/2, 188, V_YELLOWMAP, @@ -973,9 +965,7 @@ void Y_Ticker(void) if (paused || P_AutoPause()) return; -#ifdef HAVE_BLUA LUAh_IntermissionThinker(); -#endif intertic++; diff --git a/src/z_zone.c b/src/z_zone.c index 67bc2b519..96dcd0cba 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -217,11 +217,9 @@ void Z_Free(void *ptr) CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line); #endif -#ifdef HAVE_BLUA // anything that isn't by lua gets passed to lua just in case. if (block->tag != PU_LUA) LUA_InvalidateUserdata(ptr); -#endif // TODO: if zdebugging, make sure no other block has a user // that is about to be freed. From a436ece941b9118565999b86eba97835a41fcc27 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 19 Mar 2020 19:26:46 +0100 Subject: [PATCH 33/47] Update CircleCI config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61e508e4d..8ecee2b19 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,8 +51,8 @@ jobs: - /var/cache/apt/archives - checkout - run: - name: Compile without network support and BLUA - command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1 + name: Compile without network support + command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 - run: name: wipe build command: make -C src LINUX=1 cleandep From dcb4ce8cb99380ff5c474681ceb2de8f8ba8083e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 19 Mar 2020 20:09:55 +0000 Subject: [PATCH 34/47] Created g_demo.c/.h, for the demo recording and playback code that formerly lived in g_game.c --- src/g_demo.c | 2501 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/g_demo.h | 85 ++ src/g_game.c | 2500 +------------------------------------------------ src/g_game.h | 65 +- 4 files changed, 2607 insertions(+), 2544 deletions(-) create mode 100644 src/g_demo.c create mode 100644 src/g_demo.h diff --git a/src/g_demo.c b/src/g_demo.c new file mode 100644 index 000000000..22cd34ad5 --- /dev/null +++ b/src/g_demo.c @@ -0,0 +1,2501 @@ +// SONIC ROBO BLAST 2 +//----------------------------------------------------------------------------- +// Copyright (C) 1993-1996 by id Software, Inc. +// Copyright (C) 1998-2000 by DooM Legacy Team. +// Copyright (C) 1999-2020 by Sonic Team Junior. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file g_demo.c +/// \brief Demo recording and playback + +#include "doomdef.h" +#include "console.h" +#include "d_main.h" +#include "d_player.h" +#include "d_clisrv.h" +//#include "f_finale.h" +#include "p_setup.h" +#include "i_system.h" +#include "m_random.h" +#include "p_local.h" +#include "r_draw.h" +#include "r_main.h" +//#include "s_sound.h" +#include "g_game.h" +#include "g_demo.h" +#include "m_cheat.h" +#include "m_misc.h" +#include "m_menu.h" +#include "m_argv.h" +#include "hu_stuff.h" +#include "z_zone.h" +#include "i_video.h" +#include "byteptr.h" +#include "i_joy.h" +#include "r_local.h" +#include "r_skins.h" +#include "y_inter.h" +#include "v_video.h" +#include "lua_hook.h" +#include "md5.h" // demo checksums + +boolean timingdemo; // if true, exit with report on completion +boolean nodrawers; // for comparative timing purposes +boolean noblit; // for comparative timing purposes +tic_t demostarttime; // for comparative timing purposes + +static char demoname[64]; +boolean demorecording; +boolean demoplayback; +boolean titledemo; // Title Screen demo can be cancelled by any key +static UINT8 *demobuffer = NULL; +static UINT8 *demo_p, *demotime_p; +static UINT8 *demoend; +static UINT8 demoflags; +static UINT16 demoversion; +boolean singledemo; // quit after playing a demo from cmdline +boolean demo_start; // don't start playing demo right away +boolean demosynced = true; // console warning message + +boolean metalrecording; // recording as metal sonic +mobj_t *metalplayback; +static UINT8 *metalbuffer = NULL; +static UINT8 *metal_p; +static UINT16 metalversion; + +// extra data stuff (events registered this frame while recording) +static struct { + UINT8 flags; // EZT flags + + // EZT_COLOR + UINT8 color, lastcolor; + + // EZT_SCALE + fixed_t scale, lastscale; + + // EZT_HIT + UINT16 hits; + mobj_t **hitlist; +} ghostext; + +// Your naming conventions are stupid and useless. +// There is no conflict here. +typedef struct demoghost { + UINT8 checksum[16]; + UINT8 *buffer, *p, color, fadein; + UINT16 version; + mobj_t oldmo, *mo; + struct demoghost *next; +} demoghost; +demoghost *ghosts = NULL; + +// +// DEMO RECORDING +// + +#define DEMOVERSION 0x000c +#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F" + +#define DF_GHOST 0x01 // This demo contains ghost data too! +#define DF_RECORDATTACK 0x02 // This demo is from record attack and contains its final completion time, score, and rings! +#define DF_NIGHTSATTACK 0x04 // This demo is from NiGHTS attack and contains its time left, score, and mares! +#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ??? +#define DF_ATTACKSHIFT 1 + +// For demos +#define ZT_FWD 0x01 +#define ZT_SIDE 0x02 +#define ZT_ANGLE 0x04 +#define ZT_BUTTONS 0x08 +#define ZT_AIMING 0x10 +#define DEMOMARKER 0x80 // demoend +#define METALDEATH 0x44 +#define METALSNICE 0x69 + +static ticcmd_t oldcmd; + +// For Metal Sonic and time attack ghosts +#define GZT_XYZ 0x01 +#define GZT_MOMXY 0x02 +#define GZT_MOMZ 0x04 +#define GZT_ANGLE 0x08 +#define GZT_FRAME 0x10 // Animation frame +#define GZT_SPR2 0x20 // Player animations +#define GZT_EXTRA 0x40 +#define GZT_FOLLOW 0x80 // Followmobj + +// GZT_EXTRA flags +#define EZT_THOK 0x01 // Spawned a thok object +#define EZT_SPIN 0x02 // Because one type of thok object apparently wasn't enough +#define EZT_REV 0x03 // And two types wasn't enough either yet +#define EZT_THOKMASK 0x03 +#define EZT_COLOR 0x04 // Changed color (Super transformation, Mario fireflowers/invulnerability, etc.) +#define EZT_FLIP 0x08 // Reversed gravity +#define EZT_SCALE 0x10 // Changed size +#define EZT_HIT 0x20 // Damaged a mobj +#define EZT_SPRITE 0x40 // Changed sprite set completely out of PLAY (NiGHTS, SOCs, whatever) +#define EZT_HEIGHT 0x80 // Changed height + +// GZT_FOLLOW flags +#define FZT_SPAWNED 0x01 // just been spawned +#define FZT_SKIN 0x02 // has skin +#define FZT_LINKDRAW 0x04 // has linkdraw (combine with spawned only) +#define FZT_COLORIZED 0x08 // colorized (ditto) +#define FZT_SCALE 0x10 // different scale to object +// spare FZT slots 0x20 to 0x80 + +static mobj_t oldmetal, oldghost; + +void G_SaveMetal(UINT8 **buffer) +{ + I_Assert(buffer != NULL && *buffer != NULL); + + WRITEUINT32(*buffer, metal_p - metalbuffer); +} + +void G_LoadMetal(UINT8 **buffer) +{ + I_Assert(buffer != NULL && *buffer != NULL); + + G_DoPlayMetal(); + metal_p = metalbuffer + READUINT32(*buffer); +} + + +void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum) +{ + UINT8 ziptic; + (void)playernum; + + if (!demo_p || !demo_start) + return; + ziptic = READUINT8(demo_p); + + if (ziptic & ZT_FWD) + oldcmd.forwardmove = READSINT8(demo_p); + if (ziptic & ZT_SIDE) + oldcmd.sidemove = READSINT8(demo_p); + if (ziptic & ZT_ANGLE) + oldcmd.angleturn = READINT16(demo_p); + if (ziptic & ZT_BUTTONS) + oldcmd.buttons = (oldcmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) | (READUINT16(demo_p) & ~(BT_CAMLEFT|BT_CAMRIGHT)); + if (ziptic & ZT_AIMING) + oldcmd.aiming = READINT16(demo_p); + + G_CopyTiccmd(cmd, &oldcmd, 1); + + if (!(demoflags & DF_GHOST) && *demo_p == DEMOMARKER) + { + // end of demo data stream + G_CheckDemoStatus(); + return; + } +} + +void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum) +{ + char ziptic = 0; + UINT8 *ziptic_p; + (void)playernum; + + if (!demo_p) + return; + ziptic_p = demo_p++; // the ziptic, written at the end of this function + + if (cmd->forwardmove != oldcmd.forwardmove) + { + WRITEUINT8(demo_p,cmd->forwardmove); + oldcmd.forwardmove = cmd->forwardmove; + ziptic |= ZT_FWD; + } + + if (cmd->sidemove != oldcmd.sidemove) + { + WRITEUINT8(demo_p,cmd->sidemove); + oldcmd.sidemove = cmd->sidemove; + ziptic |= ZT_SIDE; + } + + if (cmd->angleturn != oldcmd.angleturn) + { + WRITEINT16(demo_p,cmd->angleturn); + oldcmd.angleturn = cmd->angleturn; + ziptic |= ZT_ANGLE; + } + + if (cmd->buttons != oldcmd.buttons) + { + WRITEUINT16(demo_p,cmd->buttons); + oldcmd.buttons = cmd->buttons; + ziptic |= ZT_BUTTONS; + } + + if (cmd->aiming != oldcmd.aiming) + { + WRITEINT16(demo_p,cmd->aiming); + oldcmd.aiming = cmd->aiming; + ziptic |= ZT_AIMING; + } + + *ziptic_p = ziptic; + + // attention here for the ticcmd size! + // latest demos with mouse aiming byte in ticcmd + if (!(demoflags & DF_GHOST) && ziptic_p > demoend - 9) + { + G_CheckDemoStatus(); // no more space + return; + } +} + +void G_GhostAddThok(void) +{ + if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) + return; + ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_THOK; +} + +void G_GhostAddSpin(void) +{ + if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) + return; + ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_SPIN; +} + +void G_GhostAddRev(void) +{ + if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) + return; + ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_REV; +} + +void G_GhostAddFlip(void) +{ + if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) + return; + ghostext.flags |= EZT_FLIP; +} + +void G_GhostAddColor(ghostcolor_t color) +{ + if (!demorecording || !(demoflags & DF_GHOST)) + return; + if (ghostext.lastcolor == (UINT8)color) + { + ghostext.flags &= ~EZT_COLOR; + return; + } + ghostext.flags |= EZT_COLOR; + ghostext.color = (UINT8)color; +} + +void G_GhostAddScale(fixed_t scale) +{ + if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) + return; + if (ghostext.lastscale == scale) + { + ghostext.flags &= ~EZT_SCALE; + return; + } + ghostext.flags |= EZT_SCALE; + ghostext.scale = scale; +} + +void G_GhostAddHit(mobj_t *victim) +{ + if (!demorecording || !(demoflags & DF_GHOST)) + return; + ghostext.flags |= EZT_HIT; + ghostext.hits++; + ghostext.hitlist = Z_Realloc(ghostext.hitlist, ghostext.hits * sizeof(mobj_t *), PU_LEVEL, NULL); + ghostext.hitlist[ghostext.hits-1] = victim; +} + +void G_WriteGhostTic(mobj_t *ghost) +{ + char ziptic = 0; + UINT8 *ziptic_p; + UINT32 i; + fixed_t height; + + if (!demo_p) + return; + if (!(demoflags & DF_GHOST)) + return; // No ghost data to write. + + ziptic_p = demo_p++; // the ziptic, written at the end of this function + + #define MAXMOM (0xFFFF<<8) + + // GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic. + if (abs(ghost->x-oldghost.x) > MAXMOM + || abs(ghost->y-oldghost.y) > MAXMOM + || abs(ghost->z-oldghost.z) > MAXMOM) + { + oldghost.x = ghost->x; + oldghost.y = ghost->y; + oldghost.z = ghost->z; + ziptic |= GZT_XYZ; + WRITEFIXED(demo_p,oldghost.x); + WRITEFIXED(demo_p,oldghost.y); + WRITEFIXED(demo_p,oldghost.z); + } + else + { + // For moving normally: + // Store one full byte of movement, plus one byte of fractional movement. + INT16 momx = (INT16)((ghost->x-oldghost.x)>>8); + INT16 momy = (INT16)((ghost->y-oldghost.y)>>8); + if (momx != oldghost.momx + || momy != oldghost.momy) + { + oldghost.momx = momx; + oldghost.momy = momy; + ziptic |= GZT_MOMXY; + WRITEINT16(demo_p,momx); + WRITEINT16(demo_p,momy); + } + momx = (INT16)((ghost->z-oldghost.z)>>8); + if (momx != oldghost.momz) + { + oldghost.momz = momx; + ziptic |= GZT_MOMZ; + WRITEINT16(demo_p,momx); + } + + // This SHOULD set oldghost.x/y/z to match ghost->x/y/z + // but it keeps the fractional loss of one byte, + // so it will hopefully be made up for in future tics. + oldghost.x += oldghost.momx<<8; + oldghost.y += oldghost.momy<<8; + oldghost.z += oldghost.momz<<8; + } + + #undef MAXMOM + + // Only store the 8 most relevant bits of angle + // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites + // and it does not affect this mode of movement at all anyway. + if (ghost->player && ghost->player->drawangle>>24 != oldghost.angle) + { + oldghost.angle = ghost->player->drawangle>>24; + ziptic |= GZT_ANGLE; + WRITEUINT8(demo_p,oldghost.angle); + } + + // Store the sprite frame. + if ((ghost->frame & FF_FRAMEMASK) != oldghost.frame) + { + oldghost.frame = (ghost->frame & FF_FRAMEMASK); + ziptic |= GZT_FRAME; + WRITEUINT8(demo_p,oldghost.frame); + } + + if (ghost->sprite == SPR_PLAY + && ghost->sprite2 != oldghost.sprite2) + { + 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; + } + + if ((height = FixedDiv(ghost->height, ghost->scale)) != oldghost.height) + { + oldghost.height = height; + ghostext.flags |= EZT_HEIGHT; + } + + if (ghostext.flags) + { + ziptic |= GZT_EXTRA; + + if (ghostext.color == ghostext.lastcolor) + ghostext.flags &= ~EZT_COLOR; + if (ghostext.scale == ghostext.lastscale) + ghostext.flags &= ~EZT_SCALE; + + WRITEUINT8(demo_p,ghostext.flags); + if (ghostext.flags & EZT_COLOR) + { + WRITEUINT8(demo_p,ghostext.color); + ghostext.lastcolor = ghostext.color; + } + if (ghostext.flags & EZT_SCALE) + { + WRITEFIXED(demo_p,ghostext.scale); + ghostext.lastscale = ghostext.scale; + } + if (ghostext.flags & EZT_HIT) + { + WRITEUINT16(demo_p,ghostext.hits); + for (i = 0; i < ghostext.hits; i++) + { + mobj_t *mo = ghostext.hitlist[i]; + //WRITEUINT32(demo_p,UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.) + WRITEUINT32(demo_p,mo->type); + WRITEUINT16(demo_p,(UINT16)mo->health); + WRITEFIXED(demo_p,mo->x); + WRITEFIXED(demo_p,mo->y); + WRITEFIXED(demo_p,mo->z); + WRITEANGLE(demo_p,mo->angle); + } + Z_Free(ghostext.hitlist); + ghostext.hits = 0; + ghostext.hitlist = NULL; + } + if (ghostext.flags & EZT_SPRITE) + WRITEUINT16(demo_p,oldghost.sprite); + if (ghostext.flags & EZT_HEIGHT) + { + height >>= FRACBITS; + WRITEINT16(demo_p, height); + } + ghostext.flags = 0; + } + + if (ghost->player && ghost->player->followmobj && !(ghost->player->followmobj->sprite == SPR_NULL || (ghost->player->followmobj->flags2 & MF2_DONTDRAW))) // bloats tails runs but what can ya do + { + INT16 temp; + UINT8 *followtic_p = demo_p++; + UINT8 followtic = 0; + + ziptic |= GZT_FOLLOW; + + if (ghost->player->followmobj->skin) + followtic |= FZT_SKIN; + + if (!(oldghost.flags2 & MF2_AMBUSH)) + { + followtic |= FZT_SPAWNED; + WRITEINT16(demo_p,ghost->player->followmobj->info->height>>FRACBITS); + if (ghost->player->followmobj->flags2 & MF2_LINKDRAW) + followtic |= FZT_LINKDRAW; + if (ghost->player->followmobj->colorized) + followtic |= FZT_COLORIZED; + if (followtic & FZT_SKIN) + WRITEUINT8(demo_p,(UINT8)(((skin_t *)(ghost->player->followmobj->skin))-skins)); + oldghost.flags2 |= MF2_AMBUSH; + } + + if (ghost->player->followmobj->scale != ghost->scale) + { + followtic |= FZT_SCALE; + WRITEFIXED(demo_p,ghost->player->followmobj->scale); + } + + temp = (INT16)((ghost->player->followmobj->x-ghost->x)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((ghost->player->followmobj->y-ghost->y)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((ghost->player->followmobj->z-ghost->z)>>8); + WRITEINT16(demo_p,temp); + if (followtic & FZT_SKIN) + WRITEUINT8(demo_p,ghost->player->followmobj->sprite2); + WRITEUINT16(demo_p,ghost->player->followmobj->sprite); + WRITEUINT8(demo_p,(ghost->player->followmobj->frame & FF_FRAMEMASK)); + WRITEUINT8(demo_p,ghost->player->followmobj->color); + + *followtic_p = followtic; + } + else + oldghost.flags2 &= ~MF2_AMBUSH; + + *ziptic_p = ziptic; + + // attention here for the ticcmd size! + // latest demos with mouse aiming byte in ticcmd + if (demo_p >= demoend - (13 + 9 + 9)) + { + G_CheckDemoStatus(); // no more space + return; + } +} + +// Uses ghost data to do consistency checks on your position. +// This fixes desynchronising demos when fighting eggman. +void G_ConsGhostTic(void) +{ + UINT8 ziptic; + UINT16 px,py,pz,gx,gy,gz; + mobj_t *testmo; + + if (!demo_p || !demo_start) + return; + if (!(demoflags & DF_GHOST)) + return; // No ghost data to use. + + testmo = players[0].mo; + + // Grab ghost data. + ziptic = READUINT8(demo_p); + if (ziptic & GZT_XYZ) + { + oldghost.x = READFIXED(demo_p); + oldghost.y = READFIXED(demo_p); + oldghost.z = READFIXED(demo_p); + } + else + { + if (ziptic & GZT_MOMXY) + { + oldghost.momx = READINT16(demo_p)<<8; + oldghost.momy = READINT16(demo_p)<<8; + } + if (ziptic & GZT_MOMZ) + oldghost.momz = READINT16(demo_p)<<8; + oldghost.x += oldghost.momx; + oldghost.y += oldghost.momy; + oldghost.z += oldghost.momz; + } + if (ziptic & GZT_ANGLE) + demo_p++; + if (ziptic & GZT_FRAME) + demo_p++; + if (ziptic & GZT_SPR2) + demo_p++; + + if (ziptic & GZT_EXTRA) + { // But wait, there's more! + UINT8 xziptic = READUINT8(demo_p); + if (xziptic & EZT_COLOR) + demo_p++; + if (xziptic & EZT_SCALE) + demo_p += sizeof(fixed_t); + if (xziptic & EZT_HIT) + { // Resync mob damage. + UINT16 i, count = READUINT16(demo_p); + thinker_t *th; + mobj_t *mobj; + + UINT32 type; + UINT16 health; + fixed_t x; + fixed_t y; + fixed_t z; + + for (i = 0; i < count; i++) + { + //demo_p += 4; // reserved. + type = READUINT32(demo_p); + health = READUINT16(demo_p); + x = READFIXED(demo_p); + y = READFIXED(demo_p); + z = READFIXED(demo_p); + demo_p += sizeof(angle_t); // angle, unnecessary for cons. + + mobj = NULL; + for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) + { + if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + continue; + mobj = (mobj_t *)th; + if (mobj->type == (mobjtype_t)type && mobj->x == x && mobj->y == y && mobj->z == z) + break; + } + if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it! + { + 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, 0); + } + } + } + if (xziptic & EZT_SPRITE) + demo_p += sizeof(UINT16); + if (xziptic & EZT_HEIGHT) + demo_p += sizeof(INT16); + } + + if (ziptic & GZT_FOLLOW) + { // Even more... + UINT8 followtic = READUINT8(demo_p); + if (followtic & FZT_SPAWNED) + { + demo_p += sizeof(INT16); + if (followtic & FZT_SKIN) + demo_p++; + } + if (followtic & FZT_SCALE) + demo_p += sizeof(fixed_t); + demo_p += sizeof(INT16); + demo_p += sizeof(INT16); + demo_p += sizeof(INT16); + if (followtic & FZT_SKIN) + demo_p++; + demo_p += sizeof(UINT16); + demo_p++; + demo_p++; + } + + // Re-synchronise + px = testmo->x>>FRACBITS; + py = testmo->y>>FRACBITS; + pz = testmo->z>>FRACBITS; + gx = oldghost.x>>FRACBITS; + gy = oldghost.y>>FRACBITS; + gz = oldghost.z>>FRACBITS; + + if (px != gx || py != gy || pz != gz) + { + if (demosynced) + CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); + demosynced = false; + + P_UnsetThingPosition(testmo); + testmo->x = oldghost.x; + testmo->y = oldghost.y; + P_SetThingPosition(testmo); + testmo->z = oldghost.z; + } + + if (*demo_p == DEMOMARKER) + { + // end of demo data stream + G_CheckDemoStatus(); + return; + } +} + +void G_GhostTicker(void) +{ + demoghost *g,*p; + for(g = ghosts, p = NULL; g; g = g->next) + { + // Skip normal demo data. + UINT8 ziptic = READUINT8(g->p); + UINT8 xziptic = 0; + if (ziptic & ZT_FWD) + g->p++; + if (ziptic & ZT_SIDE) + g->p++; + if (ziptic & ZT_ANGLE) + g->p += 2; + if (ziptic & ZT_BUTTONS) + g->p += 2; + if (ziptic & ZT_AIMING) + g->p += 2; + + // Grab ghost data. + ziptic = READUINT8(g->p); + if (ziptic & GZT_XYZ) + { + g->oldmo.x = READFIXED(g->p); + g->oldmo.y = READFIXED(g->p); + g->oldmo.z = READFIXED(g->p); + } + else + { + if (ziptic & GZT_MOMXY) + { + g->oldmo.momx = READINT16(g->p)<<8; + g->oldmo.momy = READINT16(g->p)<<8; + } + if (ziptic & GZT_MOMZ) + g->oldmo.momz = READINT16(g->p)<<8; + g->oldmo.x += g->oldmo.momx; + g->oldmo.y += g->oldmo.momy; + g->oldmo.z += g->oldmo.momz; + } + if (ziptic & GZT_ANGLE) + g->mo->angle = READUINT8(g->p)<<24; + if (ziptic & GZT_FRAME) + g->oldmo.frame = READUINT8(g->p); + if (ziptic & GZT_SPR2) + g->oldmo.sprite2 = READUINT8(g->p); + + // Update ghost + P_UnsetThingPosition(g->mo); + g->mo->x = g->oldmo.x; + g->mo->y = g->oldmo.y; + g->mo->z = g->oldmo.z; + P_SetThingPosition(g->mo); + g->mo->frame = g->oldmo.frame | tr_trans30<fadein) + { + g->mo->frame += (((--g->fadein)/6)<fadein is bad, and it's only set once, so... + g->mo->flags2 &= ~MF2_DONTDRAW; + } + g->mo->sprite2 = g->oldmo.sprite2; + + if (ziptic & GZT_EXTRA) + { // But wait, there's more! + xziptic = READUINT8(g->p); + if (xziptic & EZT_COLOR) + { + g->color = READUINT8(g->p); + switch(g->color) + { + default: + case GHC_RETURNSKIN: + g->mo->skin = g->oldmo.skin; + /* FALLTHRU */ + case GHC_NORMAL: // Go back to skin color + g->mo->color = g->oldmo.color; + break; + // Handled below + case GHC_SUPER: + case GHC_INVINCIBLE: + break; + case GHC_FIREFLOWER: // Fireflower + g->mo->color = SKINCOLOR_WHITE; + break; + case GHC_NIGHTSSKIN: // not actually a colour + g->mo->skin = &skins[DEFAULTNIGHTSSKIN]; + break; + } + } + if (xziptic & EZT_FLIP) + g->mo->eflags ^= MFE_VERTICALFLIP; + if (xziptic & EZT_SCALE) + { + g->mo->destscale = READFIXED(g->p); + if (g->mo->destscale != g->mo->scale) + P_SetScale(g->mo, g->mo->destscale); + } + if (xziptic & EZT_THOKMASK) + { // Let's only spawn ONE of these per frame, thanks. + mobj_t *mobj; + INT32 type = -1; + if (g->mo->skin) + { + skin_t *skin = (skin_t *)g->mo->skin; + switch (xziptic & EZT_THOKMASK) + { + case EZT_THOK: + type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + break; + case EZT_SPIN: + type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + break; + case EZT_REV: + type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + break; + } + } + if (type != MT_NULL) + { + if (type == MT_GHOST) + { + mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us + mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<mo, 0, 0, -FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK); + mobj->sprite = states[mobjinfo[type].spawnstate].sprite; + mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<color = g->mo->color; + mobj->skin = g->mo->skin; + P_SetScale(mobj, (mobj->destscale = g->mo->scale)); + + if (type == MT_THOK) // spintrail-specific modification for MT_THOK + { + mobj->frame = FF_TRANS80; + mobj->fuse = mobj->tics; + } + mobj->tics = -1; // nope. + } + mobj->floorz = mobj->z; + mobj->ceilingz = mobj->z+mobj->height; + P_UnsetThingPosition(mobj); + mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... + P_SetThingPosition(mobj); + if (!mobj->fuse) + mobj->fuse = 8; + P_SetTarget(&mobj->target, g->mo); + } + } + if (xziptic & EZT_HIT) + { // Spawn hit poofs for killing things! + UINT16 i, count = READUINT16(g->p), health; + UINT32 type; + fixed_t x,y,z; + angle_t angle; + mobj_t *poof; + for (i = 0; i < count; i++) + { + //g->p += 4; // reserved + type = READUINT32(g->p); + health = READUINT16(g->p); + x = READFIXED(g->p); + y = READFIXED(g->p); + z = READFIXED(g->p); + angle = READANGLE(g->p); + if (!(mobjinfo[type].flags & MF_SHOOTABLE) + || !(mobjinfo[type].flags & (MF_ENEMY|MF_MONITOR)) + || health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad. + continue; + poof = P_SpawnMobj(x, y, z, MT_GHOST); + poof->angle = angle; + poof->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... + poof->health = 0; + P_SetMobjStateNF(poof, S_XPLD1); + } + } + if (xziptic & EZT_SPRITE) + g->mo->sprite = READUINT16(g->p); + if (xziptic & EZT_HEIGHT) + { + fixed_t temp = READINT16(g->p)<mo->height = FixedMul(temp, g->mo->scale); + } + } + + // Tick ghost colors (Super and Mario Invincibility flashing) + switch(g->color) + { + case GHC_SUPER: // Super (P_DoSuperStuff) + if (g->mo->skin) + { + skin_t *skin = (skin_t *)g->mo->skin; + g->mo->color = skin->supercolor; + } + else + g->mo->color = SKINCOLOR_SUPERGOLD1; + g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); + break; + case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) + g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours + break; + default: + break; + } + +#define follow g->mo->tracer + if (ziptic & GZT_FOLLOW) + { // Even more... + UINT8 followtic = READUINT8(g->p); + fixed_t temp; + if (followtic & FZT_SPAWNED) + { + if (follow) + P_RemoveMobj(follow); + P_SetTarget(&follow, P_SpawnMobjFromMobj(g->mo, 0, 0, 0, MT_GHOST)); + P_SetTarget(&follow->tracer, g->mo); + follow->tics = -1; + temp = READINT16(g->p)<height = FixedMul(follow->scale, temp); + + if (followtic & FZT_LINKDRAW) + follow->flags2 |= MF2_LINKDRAW; + + if (followtic & FZT_COLORIZED) + follow->colorized = true; + + if (followtic & FZT_SKIN) + follow->skin = &skins[READUINT8(g->p)]; + } + if (follow) + { + if (followtic & FZT_SCALE) + follow->destscale = READFIXED(g->p); + else + follow->destscale = g->mo->destscale; + if (follow->destscale != follow->scale) + P_SetScale(follow, follow->destscale); + + P_UnsetThingPosition(follow); + temp = READINT16(g->p)<<8; + follow->x = g->mo->x + temp; + temp = READINT16(g->p)<<8; + follow->y = g->mo->y + temp; + temp = READINT16(g->p)<<8; + follow->z = g->mo->z + temp; + P_SetThingPosition(follow); + if (followtic & FZT_SKIN) + follow->sprite2 = READUINT8(g->p); + else + follow->sprite2 = 0; + follow->sprite = READUINT16(g->p); + follow->frame = (READUINT8(g->p)) | (g->mo->frame & FF_TRANSMASK); + follow->angle = g->mo->angle; + follow->color = READUINT8(g->p); + + if (!(followtic & FZT_SPAWNED)) + { + if (xziptic & EZT_FLIP) + { + follow->flags2 ^= MF2_OBJECTFLIP; + follow->eflags ^= MFE_VERTICALFLIP; + } + } + } + } + else if (follow) + { + P_RemoveMobj(follow); + P_SetTarget(&follow, NULL); + } + // Demo ends after ghost data. + if (*g->p == DEMOMARKER) + { + g->mo->momx = g->mo->momy = g->mo->momz = 0; +#if 1 // freeze frame (maybe more useful for time attackers) + g->mo->colorized = true; + if (follow) + follow->colorized = true; +#else // dissapearing act + g->mo->fuse = TICRATE; + if (follow) + follow->fuse = TICRATE; +#endif + if (p) + p->next = g->next; + else + ghosts = g->next; + Z_Free(g); + continue; + } + p = g; +#undef follow + } +} + +void G_ReadMetalTic(mobj_t *metal) +{ + UINT8 ziptic; + UINT8 xziptic = 0; + + if (!metal_p) + return; + + if (!metal->health) + { + G_StopMetalDemo(); + return; + } + + switch (*metal_p) + { + case METALSNICE: + break; + case METALDEATH: + if (metal->tracer) + P_RemoveMobj(metal->tracer); + P_KillMobj(metal, NULL, NULL, 0); + /* FALLTHRU */ + case DEMOMARKER: + default: + // end of demo data stream + G_StopMetalDemo(); + return; + } + metal_p++; + + ziptic = READUINT8(metal_p); + + // Read changes from the tic + if (ziptic & GZT_XYZ) + { + P_TeleportMove(metal, READFIXED(metal_p), READFIXED(metal_p), READFIXED(metal_p)); + oldmetal.x = metal->x; + oldmetal.y = metal->y; + oldmetal.z = metal->z; + } + else + { + if (ziptic & GZT_MOMXY) + { + oldmetal.momx = READINT16(metal_p)<<8; + oldmetal.momy = READINT16(metal_p)<<8; + } + if (ziptic & GZT_MOMZ) + oldmetal.momz = READINT16(metal_p)<<8; + oldmetal.x += oldmetal.momx; + oldmetal.y += oldmetal.momy; + oldmetal.z += oldmetal.momz; + } + if (ziptic & GZT_ANGLE) + metal->angle = READUINT8(metal_p)<<24; + if (ziptic & GZT_FRAME) + oldmetal.frame = READUINT32(metal_p); + if (ziptic & GZT_SPR2) + oldmetal.sprite2 = READUINT8(metal_p); + + // Set movement, position, and angle + // oldmetal contains where you're supposed to be. + metal->momx = oldmetal.momx; + metal->momy = oldmetal.momy; + metal->momz = oldmetal.momz; + P_UnsetThingPosition(metal); + metal->x = oldmetal.x; + metal->y = oldmetal.y; + metal->z = oldmetal.z; + P_SetThingPosition(metal); + metal->frame = oldmetal.frame; + metal->sprite2 = oldmetal.sprite2; + + if (ziptic & GZT_EXTRA) + { // But wait, there's more! + xziptic = READUINT8(metal_p); + if (xziptic & EZT_FLIP) + { + metal->eflags ^= MFE_VERTICALFLIP; + metal->flags2 ^= MF2_OBJECTFLIP; + } + if (xziptic & EZT_SCALE) + { + metal->destscale = READFIXED(metal_p); + if (metal->destscale != metal->scale) + P_SetScale(metal, metal->destscale); + } + if (xziptic & EZT_THOKMASK) + { // Let's only spawn ONE of these per frame, thanks. + mobj_t *mobj; + INT32 type = -1; + if (metal->skin) + { + skin_t *skin = (skin_t *)metal->skin; + switch (xziptic & EZT_THOKMASK) + { + case EZT_THOK: + type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + break; + case EZT_SPIN: + type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + break; + case EZT_REV: + type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + break; + } + } + if (type != MT_NULL) + { + if (type == MT_GHOST) + { + mobj = P_SpawnGhostMobj(metal); // does a large portion of the work for us + } + else + { + mobj = P_SpawnMobjFromMobj(metal, 0, 0, -FixedDiv(FixedMul(metal->info->height, metal->scale) - metal->height,3*FRACUNIT), MT_THOK); + mobj->sprite = states[mobjinfo[type].spawnstate].sprite; + mobj->frame = states[mobjinfo[type].spawnstate].frame; + mobj->angle = metal->angle; + mobj->color = metal->color; + mobj->skin = metal->skin; + P_SetScale(mobj, (mobj->destscale = metal->scale)); + + if (type == MT_THOK) // spintrail-specific modification for MT_THOK + { + mobj->frame = FF_TRANS70; + mobj->fuse = mobj->tics; + } + mobj->tics = -1; // nope. + } + mobj->floorz = mobj->z; + mobj->ceilingz = mobj->z+mobj->height; + P_UnsetThingPosition(mobj); + mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... + P_SetThingPosition(mobj); + if (!mobj->fuse) + mobj->fuse = 8; + P_SetTarget(&mobj->target, metal); + } + } + if (xziptic & EZT_SPRITE) + metal->sprite = READUINT16(metal_p); + if (xziptic & EZT_HEIGHT) + { + fixed_t temp = READINT16(metal_p)<height = FixedMul(temp, metal->scale); + } + } + +#define follow metal->tracer + if (ziptic & GZT_FOLLOW) + { // Even more... + UINT8 followtic = READUINT8(metal_p); + fixed_t temp; + if (followtic & FZT_SPAWNED) + { + if (follow) + P_RemoveMobj(follow); + P_SetTarget(&follow, P_SpawnMobjFromMobj(metal, 0, 0, 0, MT_GHOST)); + P_SetTarget(&follow->tracer, metal); + follow->tics = -1; + temp = READINT16(metal_p)<height = FixedMul(follow->scale, temp); + + if (followtic & FZT_LINKDRAW) + follow->flags2 |= MF2_LINKDRAW; + + if (followtic & FZT_COLORIZED) + follow->colorized = true; + + if (followtic & FZT_SKIN) + follow->skin = &skins[READUINT8(metal_p)]; + } + if (follow) + { + if (followtic & FZT_SCALE) + follow->destscale = READFIXED(metal_p); + else + follow->destscale = metal->destscale; + if (follow->destscale != follow->scale) + P_SetScale(follow, follow->destscale); + + P_UnsetThingPosition(follow); + temp = READINT16(metal_p)<<8; + follow->x = metal->x + temp; + temp = READINT16(metal_p)<<8; + follow->y = metal->y + temp; + temp = READINT16(metal_p)<<8; + follow->z = metal->z + temp; + P_SetThingPosition(follow); + if (followtic & FZT_SKIN) + follow->sprite2 = READUINT8(metal_p); + else + follow->sprite2 = 0; + follow->sprite = READUINT16(metal_p); + follow->frame = READUINT32(metal_p); // NOT & FF_FRAMEMASK here, so 32 bits + follow->angle = metal->angle; + follow->color = READUINT8(metal_p); + + if (!(followtic & FZT_SPAWNED)) + { + if (xziptic & EZT_FLIP) + { + follow->flags2 ^= MF2_OBJECTFLIP; + follow->eflags ^= MFE_VERTICALFLIP; + } + } + } + } + else if (follow) + { + P_RemoveMobj(follow); + P_SetTarget(&follow, NULL); + } +#undef follow +} + +void G_WriteMetalTic(mobj_t *metal) +{ + UINT8 ziptic = 0; + UINT8 *ziptic_p; + fixed_t height; + + if (!demo_p) // demo_p will be NULL until the race start linedef executor is activated! + return; + + WRITEUINT8(demo_p, METALSNICE); + ziptic_p = demo_p++; // the ziptic, written at the end of this function + + #define MAXMOM (0xFFFF<<8) + + // GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic. + if (abs(metal->x-oldmetal.x) > MAXMOM + || abs(metal->y-oldmetal.y) > MAXMOM + || abs(metal->z-oldmetal.z) > MAXMOM) + { + oldmetal.x = metal->x; + oldmetal.y = metal->y; + oldmetal.z = metal->z; + ziptic |= GZT_XYZ; + WRITEFIXED(demo_p,oldmetal.x); + WRITEFIXED(demo_p,oldmetal.y); + WRITEFIXED(demo_p,oldmetal.z); + } + else + { + // For moving normally: + // Store one full byte of movement, plus one byte of fractional movement. + INT16 momx = (INT16)((metal->x-oldmetal.x)>>8); + INT16 momy = (INT16)((metal->y-oldmetal.y)>>8); + if (momx != oldmetal.momx + || momy != oldmetal.momy) + { + oldmetal.momx = momx; + oldmetal.momy = momy; + ziptic |= GZT_MOMXY; + WRITEINT16(demo_p,momx); + WRITEINT16(demo_p,momy); + } + momx = (INT16)((metal->z-oldmetal.z)>>8); + if (momx != oldmetal.momz) + { + oldmetal.momz = momx; + ziptic |= GZT_MOMZ; + WRITEINT16(demo_p,momx); + } + + // This SHOULD set oldmetal.x/y/z to match metal->x/y/z + // but it keeps the fractional loss of one byte, + // so it will hopefully be made up for in future tics. + oldmetal.x += oldmetal.momx<<8; + oldmetal.y += oldmetal.momy<<8; + oldmetal.z += oldmetal.momz<<8; + } + + #undef MAXMOM + + // Only store the 8 most relevant bits of angle + // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites + // and it does not affect movement at all anyway. + if (metal->player && metal->player->drawangle>>24 != oldmetal.angle) + { + oldmetal.angle = metal->player->drawangle>>24; + ziptic |= GZT_ANGLE; + WRITEUINT8(demo_p,oldmetal.angle); + } + + // Store the sprite frame. + if ((metal->frame & FF_FRAMEMASK) != oldmetal.frame) + { + oldmetal.frame = metal->frame; // NOT & FF_FRAMEMASK here, so 32 bits + ziptic |= GZT_FRAME; + WRITEUINT32(demo_p,oldmetal.frame); + } + + if (metal->sprite == SPR_PLAY + && metal->sprite2 != oldmetal.sprite2) + { + oldmetal.sprite2 = metal->sprite2; + ziptic |= GZT_SPR2; + WRITEUINT8(demo_p,oldmetal.sprite2); + } + + // Check for sprite set changes + if (metal->sprite != oldmetal.sprite) + { + oldmetal.sprite = metal->sprite; + ghostext.flags |= EZT_SPRITE; + } + + if ((height = FixedDiv(metal->height, metal->scale)) != oldmetal.height) + { + oldmetal.height = height; + ghostext.flags |= EZT_HEIGHT; + } + + if (ghostext.flags & ~(EZT_COLOR|EZT_HIT)) // these two aren't handled by metal ever + { + ziptic |= GZT_EXTRA; + + if (ghostext.scale == ghostext.lastscale) + ghostext.flags &= ~EZT_SCALE; + + WRITEUINT8(demo_p,ghostext.flags); + if (ghostext.flags & EZT_SCALE) + { + WRITEFIXED(demo_p,ghostext.scale); + ghostext.lastscale = ghostext.scale; + } + if (ghostext.flags & EZT_SPRITE) + WRITEUINT16(demo_p,oldmetal.sprite); + if (ghostext.flags & EZT_HEIGHT) + { + height >>= FRACBITS; + WRITEINT16(demo_p, height); + } + ghostext.flags = 0; + } + + if (metal->player && metal->player->followmobj && !(metal->player->followmobj->sprite == SPR_NULL || (metal->player->followmobj->flags2 & MF2_DONTDRAW))) + { + INT16 temp; + UINT8 *followtic_p = demo_p++; + UINT8 followtic = 0; + + ziptic |= GZT_FOLLOW; + + if (metal->player->followmobj->skin) + followtic |= FZT_SKIN; + + if (!(oldmetal.flags2 & MF2_AMBUSH)) + { + followtic |= FZT_SPAWNED; + WRITEINT16(demo_p,metal->player->followmobj->info->height>>FRACBITS); + if (metal->player->followmobj->flags2 & MF2_LINKDRAW) + followtic |= FZT_LINKDRAW; + if (metal->player->followmobj->colorized) + followtic |= FZT_COLORIZED; + if (followtic & FZT_SKIN) + WRITEUINT8(demo_p,(UINT8)(((skin_t *)(metal->player->followmobj->skin))-skins)); + oldmetal.flags2 |= MF2_AMBUSH; + } + + if (metal->player->followmobj->scale != metal->scale) + { + followtic |= FZT_SCALE; + WRITEFIXED(demo_p,metal->player->followmobj->scale); + } + + temp = (INT16)((metal->player->followmobj->x-metal->x)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((metal->player->followmobj->y-metal->y)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((metal->player->followmobj->z-metal->z)>>8); + WRITEINT16(demo_p,temp); + if (followtic & FZT_SKIN) + WRITEUINT8(demo_p,metal->player->followmobj->sprite2); + WRITEUINT16(demo_p,metal->player->followmobj->sprite); + WRITEUINT32(demo_p,metal->player->followmobj->frame); // NOT & FF_FRAMEMASK here, so 32 bits + WRITEUINT8(demo_p,metal->player->followmobj->color); + + *followtic_p = followtic; + } + else + oldmetal.flags2 &= ~MF2_AMBUSH; + + *ziptic_p = ziptic; + + // attention here for the ticcmd size! + // latest demos with mouse aiming byte in ticcmd + if (demo_p >= demoend - 32) + { + G_StopMetalRecording(false); // no more space + return; + } +} + +// +// G_RecordDemo +// +void G_RecordDemo(const char *name) +{ + INT32 maxsize; + + strcpy(demoname, name); + strcat(demoname, ".lmp"); + maxsize = 1024*1024; + if (M_CheckParm("-maxdemo") && M_IsNextParm()) + maxsize = atoi(M_GetNextParm()) * 1024; +// if (demobuffer) +// free(demobuffer); + demo_p = NULL; + demobuffer = malloc(maxsize); + demoend = demobuffer + maxsize; + + demorecording = true; +} + +void G_RecordMetal(void) +{ + INT32 maxsize; + maxsize = 1024*1024; + if (M_CheckParm("-maxdemo") && M_IsNextParm()) + maxsize = atoi(M_GetNextParm()) * 1024; + demo_p = NULL; + demobuffer = malloc(maxsize); + demoend = demobuffer + maxsize; + metalrecording = true; +} + +void G_BeginRecording(void) +{ + UINT8 i; + char name[16]; + player_t *player = &players[consoleplayer]; + + if (demo_p) + return; + memset(name,0,sizeof(name)); + + demo_p = demobuffer; + demoflags = DF_GHOST|(modeattacking<>DF_ATTACKSHIFT) + { + case ATTACKING_NONE: // 0 + break; + case ATTACKING_RECORD: // 1 + demotime_p = demo_p; + WRITEUINT32(demo_p,UINT32_MAX); // time + WRITEUINT32(demo_p,0); // score + WRITEUINT16(demo_p,0); // rings + break; + case ATTACKING_NIGHTS: // 2 + demotime_p = demo_p; + WRITEUINT32(demo_p,UINT32_MAX); // time + WRITEUINT32(demo_p,0); // score + break; + default: // 3 + break; + } + + WRITEUINT32(demo_p,P_GetInitSeed()); + + // Name + for (i = 0; i < 16 && cv_playername.string[i]; i++) + name[i] = cv_playername.string[i]; + for (; i < 16; i++) + name[i] = '\0'; + M_Memcpy(demo_p,name,16); + demo_p += 16; + + // Skin + for (i = 0; i < 16 && cv_skin.string[i]; i++) + name[i] = cv_skin.string[i]; + for (; i < 16; i++) + name[i] = '\0'; + M_Memcpy(demo_p,name,16); + demo_p += 16; + + // Color + for (i = 0; i < 16 && cv_playercolor.string[i]; i++) + name[i] = cv_playercolor.string[i]; + for (; i < 16; i++) + name[i] = '\0'; + M_Memcpy(demo_p,name,16); + demo_p += 16; + + // Stats + WRITEUINT8(demo_p,player->charability); + WRITEUINT8(demo_p,player->charability2); + WRITEUINT8(demo_p,player->actionspd>>FRACBITS); + WRITEUINT8(demo_p,player->mindash>>FRACBITS); + WRITEUINT8(demo_p,player->maxdash>>FRACBITS); + WRITEUINT8(demo_p,player->normalspeed>>FRACBITS); + WRITEUINT8(demo_p,player->runspeed>>FRACBITS); + WRITEUINT8(demo_p,player->thrustfactor); + WRITEUINT8(demo_p,player->accelstart); + WRITEUINT8(demo_p,player->acceleration); + WRITEUINT8(demo_p,player->height>>FRACBITS); + WRITEUINT8(demo_p,player->spinheight>>FRACBITS); + WRITEUINT8(demo_p,player->camerascale>>FRACBITS); + WRITEUINT8(demo_p,player->shieldscale>>FRACBITS); + + // Trying to convert it back to % causes demo desync due to precision loss. + // Don't do it. + WRITEFIXED(demo_p, player->jumpfactor); + + // And mobjtype_t is best with UINT32 too... + WRITEUINT32(demo_p, player->followitem); + + // Save pflag data - see SendWeaponPref() + { + UINT8 buf = 0; + pflags_t pflags = 0; + if (cv_flipcam.value) + { + buf |= 0x01; + pflags |= PF_FLIPCAM; + } + if (cv_analog[0].value) + { + buf |= 0x02; + pflags |= PF_ANALOGMODE; + } + if (cv_directionchar[0].value) + { + buf |= 0x04; + pflags |= PF_DIRECTIONCHAR; + } + if (cv_autobrake.value) + { + buf |= 0x08; + pflags |= PF_AUTOBRAKE; + } + if (cv_usejoystick.value) + buf |= 0x10; + CV_SetValue(&cv_showinputjoy, !!(cv_usejoystick.value)); + + WRITEUINT8(demo_p,buf); + player->pflags = pflags; + } + + // Save netvar data + CV_SaveNetVars(&demo_p); + + memset(&oldcmd,0,sizeof(oldcmd)); + memset(&oldghost,0,sizeof(oldghost)); + memset(&ghostext,0,sizeof(ghostext)); + ghostext.lastcolor = ghostext.color = GHC_NORMAL; + ghostext.lastscale = ghostext.scale = FRACUNIT; + + if (player->mo) + { + oldghost.x = player->mo->x; + oldghost.y = player->mo->y; + oldghost.z = player->mo->z; + oldghost.angle = player->mo->angle>>24; + + // preticker started us gravity flipped + if (player->mo->eflags & MFE_VERTICALFLIP) + ghostext.flags |= EZT_FLIP; + } +} + +void G_BeginMetal(void) +{ + mobj_t *mo = players[consoleplayer].mo; + +#if 0 + if (demo_p) + return; +#endif + + demo_p = demobuffer; + + // Write header. + M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12; + WRITEUINT8(demo_p,VERSION); + WRITEUINT8(demo_p,SUBVERSION); + WRITEUINT16(demo_p,DEMOVERSION); + + // demo checksum + demo_p += 16; + + M_Memcpy(demo_p, "METL", 4); demo_p += 4; + + memset(&ghostext,0,sizeof(ghostext)); + ghostext.lastscale = ghostext.scale = FRACUNIT; + + // Set up our memory. + memset(&oldmetal,0,sizeof(oldmetal)); + oldmetal.x = mo->x; + oldmetal.y = mo->y; + oldmetal.z = mo->z; + oldmetal.angle = mo->angle>>24; +} + +void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings) +{ + if (!demorecording || !demotime_p) + return; + if (demoflags & DF_RECORDATTACK) + { + WRITEUINT32(demotime_p, ptime); + WRITEUINT32(demotime_p, pscore); + WRITEUINT16(demotime_p, prings); + demotime_p = NULL; + } + else if (demoflags & DF_NIGHTSATTACK) + { + WRITEUINT32(demotime_p, ptime); + WRITEUINT32(demotime_p, pscore); + demotime_p = NULL; + } +} + +// Returns bitfield: +// 1 == new demo has lower time +// 2 == new demo has higher score +// 4 == new demo has higher rings +UINT8 G_CmpDemoTime(char *oldname, char *newname) +{ + UINT8 *buffer,*p; + UINT8 flags; + UINT32 oldtime, newtime, oldscore, newscore; + UINT16 oldrings, newrings, oldversion; + size_t bufsize ATTRUNUSED; + UINT8 c; + UINT16 s ATTRUNUSED; + UINT8 aflags = 0; + + // load the new file + FIL_DefaultExtension(newname, ".lmp"); + bufsize = FIL_ReadFile(newname, &buffer); + I_Assert(bufsize != 0); + p = buffer; + + // read demo header + I_Assert(!memcmp(p, DEMOHEADER, 12)); + p += 12; // DEMOHEADER + c = READUINT8(p); // VERSION + I_Assert(c == VERSION); + c = READUINT8(p); // SUBVERSION + I_Assert(c == SUBVERSION); + s = READUINT16(p); + I_Assert(s == DEMOVERSION); + p += 16; // demo checksum + I_Assert(!memcmp(p, "PLAY", 4)); + p += 4; // PLAY + p += 2; // gamemap + p += 16; // map md5 + flags = READUINT8(p); // demoflags + + aflags = flags & (DF_RECORDATTACK|DF_NIGHTSATTACK); + I_Assert(aflags); + if (flags & DF_RECORDATTACK) + { + newtime = READUINT32(p); + newscore = READUINT32(p); + newrings = READUINT16(p); + } + else if (flags & DF_NIGHTSATTACK) + { + newtime = READUINT32(p); + newscore = READUINT32(p); + newrings = 0; + } + else // appease compiler + return 0; + + Z_Free(buffer); + + // load old file + FIL_DefaultExtension(oldname, ".lmp"); + if (!FIL_ReadFile(oldname, &buffer)) + { + CONS_Alert(CONS_ERROR, M_GetText("Failed to read file '%s'.\n"), oldname); + return UINT8_MAX; + } + p = buffer; + + // read demo header + if (memcmp(p, DEMOHEADER, 12)) + { + CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); + Z_Free(buffer); + return UINT8_MAX; + } p += 12; // DEMOHEADER + p++; // VERSION + p++; // SUBVERSION + oldversion = READUINT16(p); + switch(oldversion) // demoversion + { + case DEMOVERSION: // latest always supported + break; + // too old, cannot support. + default: + CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); + Z_Free(buffer); + return UINT8_MAX; + } + p += 16; // demo checksum + if (memcmp(p, "PLAY", 4)) + { + CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); + Z_Free(buffer); + return UINT8_MAX; + } p += 4; // "PLAY" + if (oldversion <= 0x0008) + p++; // gamemap + else + p += 2; // gamemap + p += 16; // mapmd5 + flags = READUINT8(p); + if (!(flags & aflags)) + { + CONS_Alert(CONS_NOTICE, M_GetText("File '%s' not from same game mode. It will be overwritten.\n"), oldname); + Z_Free(buffer); + return UINT8_MAX; + } + if (flags & DF_RECORDATTACK) + { + oldtime = READUINT32(p); + oldscore = READUINT32(p); + oldrings = READUINT16(p); + } + else if (flags & DF_NIGHTSATTACK) + { + oldtime = READUINT32(p); + oldscore = READUINT32(p); + oldrings = 0; + } + else // appease compiler + return UINT8_MAX; + + Z_Free(buffer); + + c = 0; + if (newtime < oldtime + || (newtime == oldtime && (newscore > oldscore || newrings > oldrings))) + c |= 1; // Better time + if (newscore > oldscore + || (newscore == oldscore && newtime < oldtime)) + c |= 1<<1; // Better score + if (newrings > oldrings + || (newrings == oldrings && newtime < oldtime)) + c |= 1<<2; // Better rings + return c; +} + +// +// G_PlayDemo +// +void G_DeferedPlayDemo(const char *name) +{ + COM_BufAddText("playdemo \""); + COM_BufAddText(name); + COM_BufAddText("\"\n"); +} + +// +// Start a demo from a .LMP file or from a wad resource +// +void G_DoPlayDemo(char *defdemoname) +{ + UINT8 i; + lumpnum_t l; + char skin[17],color[17],*n,*pdemoname; + UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration; + pflags_t pflags; + UINT32 randseed, followitem; + fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight; + char msg[1024]; + + skin[16] = '\0'; + color[16] = '\0'; + + n = defdemoname+strlen(defdemoname); + while (*n != '/' && *n != '\\' && n != defdemoname) + n--; + if (n != defdemoname) + n++; + pdemoname = ZZ_Alloc(strlen(n)+1); + strcpy(pdemoname,n); + + // Internal if no extension, external if one exists + if (FIL_CheckExtension(defdemoname)) + { + //FIL_DefaultExtension(defdemoname, ".lmp"); + if (!FIL_ReadFile(defdemoname, &demobuffer)) + { + snprintf(msg, 1024, M_GetText("Failed to read file '%s'.\n"), defdemoname); + CONS_Alert(CONS_ERROR, "%s", msg); + gameaction = ga_nothing; + M_StartMessage(msg, NULL, MM_NOTHING); + return; + } + demo_p = demobuffer; + } + // load demo resource from WAD + else if ((l = W_CheckNumForName(defdemoname)) == LUMPERROR) + { + snprintf(msg, 1024, M_GetText("Failed to read lump '%s'.\n"), defdemoname); + CONS_Alert(CONS_ERROR, "%s", msg); + gameaction = ga_nothing; + M_StartMessage(msg, NULL, MM_NOTHING); + return; + } + else // it's an internal demo + demobuffer = demo_p = W_CacheLumpNum(l, PU_STATIC); + + // read demo header + gameaction = ga_nothing; + demoplayback = true; + if (memcmp(demo_p, DEMOHEADER, 12)) + { + snprintf(msg, 1024, M_GetText("%s is not a SRB2 replay file.\n"), pdemoname); + CONS_Alert(CONS_ERROR, "%s", msg); + M_StartMessage(msg, NULL, MM_NOTHING); + Z_Free(pdemoname); + Z_Free(demobuffer); + demoplayback = false; + titledemo = false; + return; + } + demo_p += 12; // DEMOHEADER + + version = READUINT8(demo_p); + subversion = READUINT8(demo_p); + demoversion = READUINT16(demo_p); + switch(demoversion) + { + case DEMOVERSION: // latest always supported + break; + // too old, cannot support. + default: + snprintf(msg, 1024, M_GetText("%s is an incompatible replay format and cannot be played.\n"), pdemoname); + CONS_Alert(CONS_ERROR, "%s", msg); + M_StartMessage(msg, NULL, MM_NOTHING); + Z_Free(pdemoname); + Z_Free(demobuffer); + demoplayback = false; + titledemo = false; + return; + } + demo_p += 16; // demo checksum + if (memcmp(demo_p, "PLAY", 4)) + { + snprintf(msg, 1024, M_GetText("%s is the wrong type of recording and cannot be played.\n"), pdemoname); + CONS_Alert(CONS_ERROR, "%s", msg); + M_StartMessage(msg, NULL, MM_NOTHING); + Z_Free(pdemoname); + Z_Free(demobuffer); + demoplayback = false; + titledemo = false; + return; + } + demo_p += 4; // "PLAY" + gamemap = READINT16(demo_p); + demo_p += 16; // mapmd5 + + demoflags = READUINT8(demo_p); + modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT; + CON_ToggleOff(); + + hu_demoscore = 0; + hu_demotime = UINT32_MAX; + hu_demorings = 0; + + switch (modeattacking) + { + case ATTACKING_NONE: // 0 + break; + case ATTACKING_RECORD: // 1 + hu_demotime = READUINT32(demo_p); + hu_demoscore = READUINT32(demo_p); + hu_demorings = READUINT16(demo_p); + break; + case ATTACKING_NIGHTS: // 2 + hu_demotime = READUINT32(demo_p); + hu_demoscore = READUINT32(demo_p); + break; + default: // 3 + modeattacking = ATTACKING_NONE; + break; + } + + // Random seed + randseed = READUINT32(demo_p); + + // Player name + M_Memcpy(player_names[0],demo_p,16); + demo_p += 16; + + // Skin + M_Memcpy(skin,demo_p,16); + demo_p += 16; + + // Color + M_Memcpy(color,demo_p,16); + demo_p += 16; + + charability = READUINT8(demo_p); + charability2 = READUINT8(demo_p); + actionspd = (fixed_t)READUINT8(demo_p)<color = players[0].skincolor; + oldghost.x = players[0].mo->x; + oldghost.y = players[0].mo->y; + oldghost.z = players[0].mo->z; + } + + // Set saved attribute values + // No cheat checking here, because even if they ARE wrong... + // it would only break the replay if we clipped them. + players[0].camerascale = camerascale; + players[0].shieldscale = shieldscale; + players[0].charability = charability; + players[0].charability2 = charability2; + players[0].actionspd = actionspd; + players[0].mindash = mindash; + players[0].maxdash = maxdash; + players[0].normalspeed = normalspeed; + players[0].runspeed = runspeed; + players[0].thrustfactor = thrustfactor; + players[0].accelstart = accelstart; + players[0].acceleration = acceleration; + players[0].height = height; + players[0].spinheight = spinheight; + players[0].jumpfactor = jumpfactor; + players[0].followitem = followitem; + players[0].pflags = pflags; + + demo_start = true; +} + +void G_AddGhost(char *defdemoname) +{ + INT32 i; + lumpnum_t l; + char name[17],skin[17],color[17],*n,*pdemoname,md5[16]; + demoghost *gh; + UINT8 flags; + UINT8 *buffer,*p; + mapthing_t *mthing; + UINT16 count, ghostversion; + + name[16] = '\0'; + skin[16] = '\0'; + color[16] = '\0'; + + n = defdemoname+strlen(defdemoname); + while (*n != '/' && *n != '\\' && n != defdemoname) + n--; + if (n != defdemoname) + n++; + pdemoname = ZZ_Alloc(strlen(n)+1); + strcpy(pdemoname,n); + + // Internal if no extension, external if one exists + if (FIL_CheckExtension(defdemoname)) + { + //FIL_DefaultExtension(defdemoname, ".lmp"); + if (!FIL_ReadFileTag(defdemoname, &buffer, PU_LEVEL)) + { + CONS_Alert(CONS_ERROR, M_GetText("Failed to read file '%s'.\n"), defdemoname); + Z_Free(pdemoname); + return; + } + p = buffer; + } + // load demo resource from WAD + else if ((l = W_CheckNumForName(defdemoname)) == LUMPERROR) + { + CONS_Alert(CONS_ERROR, M_GetText("Failed to read lump '%s'.\n"), defdemoname); + Z_Free(pdemoname); + return; + } + else // it's an internal demo + buffer = p = W_CacheLumpNum(l, PU_LEVEL); + + // read demo header + if (memcmp(p, DEMOHEADER, 12)) + { + CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Not a SRB2 replay.\n"), pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } p += 12; // DEMOHEADER + p++; // VERSION + p++; // SUBVERSION + ghostversion = READUINT16(p); + switch(ghostversion) + { + case DEMOVERSION: // latest always supported + break; + // too old, cannot support. + default: + CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Demo version incompatible.\n"), pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } + M_Memcpy(md5, p, 16); p += 16; // demo checksum + for (gh = ghosts; gh; gh = gh->next) + if (!memcmp(md5, gh->checksum, 16)) // another ghost in the game already has this checksum? + { // Don't add another one, then! + CONS_Debug(DBG_SETUP, "Rejecting duplicate ghost %s (MD5 was matched)\n", pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } + if (memcmp(p, "PLAY", 4)) + { + CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Demo format unacceptable.\n"), pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } p += 4; // "PLAY" + if (ghostversion <= 0x0008) + p++; // gamemap + else + p += 2; // gamemap + p += 16; // mapmd5 (possibly check for consistency?) + flags = READUINT8(p); + if (!(flags & DF_GHOST)) + { + CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: No ghost data in this demo.\n"), pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } + switch ((flags & DF_ATTACKMASK)>>DF_ATTACKSHIFT) + { + case ATTACKING_NONE: // 0 + break; + case ATTACKING_RECORD: // 1 + p += 10; // demo time, score, and rings + break; + case ATTACKING_NIGHTS: // 2 + p += 8; // demo time left, score + break; + default: // 3 + break; + } + + p += 4; // random seed + + // Player name (TODO: Display this somehow if it doesn't match cv_playername!) + M_Memcpy(name, p,16); + p += 16; + + // Skin + M_Memcpy(skin, p,16); + p += 16; + + // Color + M_Memcpy(color, p,16); + p += 16; + + // Ghosts do not have a player structure to put this in. + p++; // charability + p++; // charability2 + p++; // actionspd + p++; // mindash + p++; // maxdash + p++; // normalspeed + p++; // runspeed + p++; // thrustfactor + p++; // accelstart + p++; // acceleration + p++; // height + p++; // spinheight + p++; // camerascale + p++; // shieldscale + p += 4; // jumpfactor + p += 4; // followitem + + p++; // pflag data + + // net var data + count = READUINT16(p); + while (count--) + { + p += 2; + SKIPSTRING(p); + p++; + } + + if (*p == DEMOMARKER) + { + CONS_Alert(CONS_NOTICE, M_GetText("Failed to add ghost %s: Replay is empty.\n"), pdemoname); + Z_Free(pdemoname); + Z_Free(buffer); + return; + } + + gh = Z_Calloc(sizeof(demoghost), PU_LEVEL, NULL); + gh->next = ghosts; + gh->buffer = buffer; + M_Memcpy(gh->checksum, md5, 16); + gh->p = p; + + ghosts = gh; + + gh->version = ghostversion; + mthing = playerstarts[0]; + I_Assert(mthing); + { // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling. + fixed_t z,f,c; + fixed_t offset = mthing->z << FRACBITS; + gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST); + gh->mo->angle = FixedAngle(mthing->angle << FRACBITS); + f = gh->mo->floorz; + c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height; + if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP)) + { + z = c - offset; + if (z < f) + z = f; + } + else + { + z = f + offset; + if (z > c) + z = c; + } + gh->mo->z = z; + } + + gh->oldmo.x = gh->mo->x; + gh->oldmo.y = gh->mo->y; + gh->oldmo.z = gh->mo->z; + + // Set skin + gh->mo->skin = &skins[0]; + for (i = 0; i < numskins; i++) + if (!stricmp(skins[i].name,skin)) + { + gh->mo->skin = &skins[i]; + break; + } + gh->oldmo.skin = gh->mo->skin; + + // Set color + gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor; + for (i = 0; i < MAXSKINCOLORS; i++) + if (!stricmp(Color_Names[i],color)) + { + gh->mo->color = (UINT8)i; + break; + } + gh->oldmo.color = gh->mo->color; + + gh->mo->state = states+S_PLAY_STND; + gh->mo->sprite = gh->mo->state->sprite; + gh->mo->sprite2 = (gh->mo->state->frame & FF_FRAMEMASK); + //gh->mo->frame = tr_trans30<mo->flags2 |= MF2_DONTDRAW; + gh->fadein = (9-3)*6; // fade from invisible to trans30 over as close to 35 tics as possible + gh->mo->tics = -1; + + CONS_Printf(M_GetText("Added ghost %s from %s\n"), name, pdemoname); + Z_Free(pdemoname); +} + +// +// G_TimeDemo +// NOTE: name is a full filename for external demos +// +static INT32 restorecv_vidwait; + +void G_TimeDemo(const char *name) +{ + nodrawers = M_CheckParm("-nodraw"); + noblit = M_CheckParm("-noblit"); + restorecv_vidwait = cv_vidwait.value; + if (cv_vidwait.value) + CV_Set(&cv_vidwait, "0"); + timingdemo = true; + singletics = true; + framecount = 0; + demostarttime = I_GetTime(); + G_DeferedPlayDemo(name); +} + +void G_DoPlayMetal(void) +{ + lumpnum_t l; + mobj_t *mo = NULL; + thinker_t *th; + + // it's an internal demo + if ((l = W_CheckNumForName(va("%sMS",G_BuildMapName(gamemap)))) == LUMPERROR) + { + CONS_Alert(CONS_WARNING, M_GetText("No bot recording for this map.\n")); + return; + } + else + metalbuffer = metal_p = W_CacheLumpNum(l, PU_STATIC); + + // find metal sonic + for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) + { + if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + continue; + + mo = (mobj_t *)th; + if (mo->type != MT_METALSONIC_RACE) + continue; + + break; + } + if (th == &thlist[THINK_MOBJ]) + { + CONS_Alert(CONS_ERROR, M_GetText("Failed to find bot entity.\n")); + Z_Free(metalbuffer); + return; + } + + // read demo header + metal_p += 12; // DEMOHEADER + metal_p++; // VERSION + metal_p++; // SUBVERSION + metalversion = READUINT16(metal_p); + switch(metalversion) + { + case DEMOVERSION: // latest always supported + break; + // too old, cannot support. + default: + CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, format version incompatible.\n")); + Z_Free(metalbuffer); + return; + } + metal_p += 16; // demo checksum + if (memcmp(metal_p, "METL", 4)) + { + CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, wasn't recorded in Metal format.\n")); + Z_Free(metalbuffer); + return; + } metal_p += 4; // "METL" + + // read initial tic + memset(&oldmetal,0,sizeof(oldmetal)); + oldmetal.x = mo->x; + oldmetal.y = mo->y; + oldmetal.z = mo->z; + metalplayback = mo; +} + +void G_DoneLevelLoad(void) +{ + CONS_Printf(M_GetText("Loaded level in %f sec\n"), (double)(I_GetTime() - demostarttime) / TICRATE); + framecount = 0; + demostarttime = I_GetTime(); +} + +/* +=================== += += G_CheckDemoStatus += += Called after a death or level completion to allow demos to be cleaned up += Returns true if a new demo loop action will take place +=================== +*/ + +// Stops metal sonic's demo. Separate from other functions because metal + replays can coexist +void G_StopMetalDemo(void) +{ + + // Metal Sonic finishing doesn't end the game, dammit. + Z_Free(metalbuffer); + metalbuffer = NULL; + metalplayback = NULL; + metal_p = NULL; +} + +// Stops metal sonic recording. +ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill) +{ + boolean saved = false; + if (demo_p) + { + UINT8 *p = demobuffer+16; // checksum position + if (kill) + WRITEUINT8(demo_p, METALDEATH); // add the metal death marker + else + WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker +#ifdef NOMD5 + { + UINT8 i; + for (i = 0; i < 16; i++, p++) + *p = P_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct. + } +#else + md5_buffer((char *)p+16, demo_p - (p+16), (void *)p); // make a checksum of everything after the checksum in the file. +#endif + saved = FIL_WriteFile(va("%sMS.LMP", G_BuildMapName(gamemap)), demobuffer, demo_p - demobuffer); // finally output the file. + } + free(demobuffer); + metalrecording = false; + if (saved) + I_Error("Saved to %sMS.LMP", G_BuildMapName(gamemap)); + I_Error("Failed to save demo!"); +} + +// reset engine variable set for the demos +// called from stopdemo command, map command, and g_checkdemoStatus. +void G_StopDemo(void) +{ + Z_Free(demobuffer); + demobuffer = NULL; + demoplayback = false; + titledemo = false; + timingdemo = false; + singletics = false; + + if (gamestate == GS_INTERMISSION) + Y_EndIntermission(); // cleanup + + G_SetGamestate(GS_NULL); + wipegamestate = GS_NULL; + SV_StopServer(); + SV_ResetServer(); +} + +boolean G_CheckDemoStatus(void) +{ + boolean saved; + + while (ghosts) + { + demoghost *next = ghosts->next; + Z_Free(ghosts); + ghosts = next; + } + ghosts = NULL; + + + // DO NOT end metal sonic demos here + + if (timingdemo) + { + INT32 demotime; + double f1, f2; + demotime = I_GetTime() - demostarttime; + if (!demotime) + return true; + G_StopDemo(); + timingdemo = false; + f1 = (double)demotime; + f2 = (double)framecount*TICRATE; + + CONS_Printf(M_GetText("timed %u gametics in %d realtics - %u frames\n%f seconds, %f avg fps\n"), + leveltime,demotime,(UINT32)framecount,f1/TICRATE,f2/f1); + + // CSV-readable timedemo results, for external parsing + if (timedemo_csv) + { + FILE *f; + const char *csvpath = va("%s"PATHSEP"%s", srb2home, "timedemo.csv"); + const char *header = "id,demoname,seconds,avgfps,leveltime,demotime,framecount,ticrate,rendermode,vidmode,vidwidth,vidheight,procbits\n"; + const char *rowformat = "\"%s\",\"%s\",%f,%f,%u,%d,%u,%u,%u,%u,%u,%u,%u\n"; + boolean headerrow = !FIL_FileExists(csvpath); + UINT8 procbits = 0; + + // Bitness + if (sizeof(void*) == 4) + procbits = 32; + else if (sizeof(void*) == 8) + procbits = 64; + + f = fopen(csvpath, "a+"); + + if (f) + { + if (headerrow) + fputs(header, f); + fprintf(f, rowformat, + timedemo_csv_id,timedemo_name,f1/TICRATE,f2/f1,leveltime,demotime,(UINT32)framecount,TICRATE,rendermode,vid.modenum,vid.width,vid.height,procbits); + fclose(f); + CONS_Printf("Timedemo results saved to '%s'\n", csvpath); + } + else + { + // Just print the CSV output to console + CON_LogMessage(header); + CONS_Printf(rowformat, + timedemo_csv_id,timedemo_name,f1/TICRATE,f2/f1,leveltime,demotime,(UINT32)framecount,TICRATE,rendermode,vid.modenum,vid.width,vid.height,procbits); + } + } + + if (restorecv_vidwait != cv_vidwait.value) + CV_SetValue(&cv_vidwait, restorecv_vidwait); + D_AdvanceDemo(); + return true; + } + + if (demoplayback) + { + if (singledemo) + I_Quit(); + G_StopDemo(); + + if (modeattacking) + M_EndModeAttackRun(); + else + D_AdvanceDemo(); + + return true; + } + + if (demorecording) + { + UINT8 *p = demobuffer+16; // checksum position +#ifdef NOMD5 + UINT8 i; + WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker + for (i = 0; i < 16; i++, p++) + *p = P_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct. +#else + WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker + md5_buffer((char *)p+16, demo_p - (p+16), p); // make a checksum of everything after the checksum in the file. +#endif + saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file. + free(demobuffer); + demorecording = false; + + if (modeattacking != ATTACKING_RECORD) + { + if (saved) + CONS_Printf(M_GetText("Demo %s recorded\n"), demoname); + else + CONS_Alert(CONS_WARNING, M_GetText("Demo %s not saved\n"), demoname); + } + return true; + } + + return false; +} diff --git a/src/g_demo.h b/src/g_demo.h new file mode 100644 index 000000000..89be6e343 --- /dev/null +++ b/src/g_demo.h @@ -0,0 +1,85 @@ +// SONIC ROBO BLAST 2 +//----------------------------------------------------------------------------- +// Copyright (C) 1993-1996 by id Software, Inc. +// Copyright (C) 1998-2000 by DooM Legacy Team. +// Copyright (C) 1999-2020 by Sonic Team Junior. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file g_demo.h +/// \brief Demo recording and playback + +#ifndef __G_DEMO__ +#define __G_DEMO__ + +#include "doomdef.h" +#include "doomstat.h" +#include "d_event.h" + +// ====================================== +// DEMO playback/recording related stuff. +// ====================================== + +// demoplaying back and demo recording +extern boolean demoplayback, titledemo, demorecording, timingdemo; +extern tic_t demostarttime; + +// Quit after playing a demo from cmdline. +extern boolean singledemo; +extern boolean demo_start; +extern boolean demosynced; + +extern mobj_t *metalplayback; + +// Only called by startup code. +void G_RecordDemo(const char *name); +void G_RecordMetal(void); +void G_BeginRecording(void); +void G_BeginMetal(void); + +// Only called by shutdown code. +void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings); +UINT8 G_CmpDemoTime(char *oldname, char *newname); + +typedef enum +{ + GHC_NORMAL = 0, + GHC_SUPER, + GHC_FIREFLOWER, + GHC_INVINCIBLE, + GHC_NIGHTSSKIN, // not actually a colour + GHC_RETURNSKIN // ditto +} ghostcolor_t; + +// Record/playback tics +void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum); +void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum); +void G_GhostAddThok(void); +void G_GhostAddSpin(void); +void G_GhostAddRev(void); +void G_GhostAddColor(ghostcolor_t color); +void G_GhostAddFlip(void); +void G_GhostAddScale(fixed_t scale); +void G_GhostAddHit(mobj_t *victim); +void G_WriteGhostTic(mobj_t *ghost); +void G_ConsGhostTic(void); +void G_GhostTicker(void); +void G_ReadMetalTic(mobj_t *metal); +void G_WriteMetalTic(mobj_t *metal); +void G_SaveMetal(UINT8 **buffer); +void G_LoadMetal(UINT8 **buffer); + +void G_DeferedPlayDemo(const char *demo); +void G_DoPlayDemo(char *defdemoname); +void G_TimeDemo(const char *name); +void G_AddGhost(char *defdemoname); +void G_DoPlayMetal(void); +void G_DoneLevelLoad(void); +void G_StopMetalDemo(void); +ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill); +void G_StopDemo(void); +boolean G_CheckDemoStatus(void); + +#endif // __G_DEMO__ diff --git a/src/g_game.c b/src/g_game.c index 58f7795b6..fb70e2995 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -27,6 +27,7 @@ #include "r_main.h" #include "s_sound.h" #include "g_game.h" +#include "g_demo.h" #include "m_cheat.h" #include "m_misc.h" #include "m_menu.h" @@ -41,11 +42,9 @@ #include "r_skins.h" #include "y_inter.h" #include "v_video.h" -#include "dehacked.h" // get_number (for ghost thok) #include "lua_hook.h" #include "b_bot.h" #include "m_cond.h" // condition sets -#include "md5.h" // demo checksums #ifdef HAVE_BLUA #include "lua_hud.h" @@ -105,11 +104,6 @@ UINT8 numDemos = 0; UINT32 demoDelayTime = 15*TICRATE; UINT32 demoIdleTime = 3*TICRATE; -boolean timingdemo; // if true, exit with report on completion -boolean nodrawers; // for comparative timing purposes -boolean noblit; // for comparative timing purposes -tic_t demostarttime; // for comparative timing purposes - boolean netgame; // only true if packets are broadcast boolean multiplayer; boolean playeringame[MAXPLAYERS]; @@ -256,57 +250,12 @@ UINT32 timesBeaten; UINT32 timesBeatenWithEmeralds; UINT32 timesBeatenUltimate; -static char demoname[64]; -boolean demorecording; -boolean demoplayback; -boolean titledemo; // Title Screen demo can be cancelled by any key -static UINT8 *demobuffer = NULL; -static UINT8 *demo_p, *demotime_p; -static UINT8 *demoend; -static UINT8 demoflags; -static UINT16 demoversion; -boolean singledemo; // quit after playing a demo from cmdline -boolean demo_start; // don't start playing demo right away -boolean demosynced = true; // console warning message - -boolean metalrecording; // recording as metal sonic -mobj_t *metalplayback; -static UINT8 *metalbuffer = NULL; -static UINT8 *metal_p; -static UINT16 metalversion; - typedef struct joystickvector2_s { INT32 xaxis; INT32 yaxis; } joystickvector2_t; -// extra data stuff (events registered this frame while recording) -static struct { - UINT8 flags; // EZT flags - - // EZT_COLOR - UINT8 color, lastcolor; - - // EZT_SCALE - fixed_t scale, lastscale; - - // EZT_HIT - UINT16 hits; - mobj_t **hitlist; -} ghostext; - -// Your naming conventions are stupid and useless. -// There is no conflict here. -typedef struct demoghost { - UINT8 checksum[16]; - UINT8 *buffer, *p, color, fadein; - UINT16 version; - mobj_t oldmo, *mo; - struct demoghost *next; -} demoghost; -demoghost *ghosts = NULL; - boolean precache = true; // if true, load all graphics at start INT16 prevmap, nextmap; @@ -1102,8 +1051,6 @@ static void G_HandleAxisDeadZone(UINT8 splitnum, joystickvector2_t *joystickvect } } - - // // G_BuildTiccmd // Builds a ticcmd from all of the available inputs @@ -1723,6 +1670,25 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) } } +ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n) +{ + return M_Memcpy(dest, src, n*sizeof(*src)); +} + +ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n) +{ + size_t i; + for (i = 0; i < n; i++) + { + dest[i].forwardmove = src[i].forwardmove; + dest[i].sidemove = src[i].sidemove; + dest[i].angleturn = SHORT(src[i].angleturn); + dest[i].aiming = (INT16)SHORT(src[i].aiming); + dest[i].buttons = (UINT16)SHORT(src[i].buttons); + } + return dest; +} + // User has designated that they want // analog ON, so tell the game to stop // fudging with it. @@ -4933,2432 +4899,6 @@ INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep) return newmapnum; } -// -// DEMO RECORDING -// - -#define DEMOVERSION 0x000c -#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F" - -#define DF_GHOST 0x01 // This demo contains ghost data too! -#define DF_RECORDATTACK 0x02 // This demo is from record attack and contains its final completion time, score, and rings! -#define DF_NIGHTSATTACK 0x04 // This demo is from NiGHTS attack and contains its time left, score, and mares! -#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ??? -#define DF_ATTACKSHIFT 1 - -// For demos -#define ZT_FWD 0x01 -#define ZT_SIDE 0x02 -#define ZT_ANGLE 0x04 -#define ZT_BUTTONS 0x08 -#define ZT_AIMING 0x10 -#define DEMOMARKER 0x80 // demoend -#define METALDEATH 0x44 -#define METALSNICE 0x69 - -static ticcmd_t oldcmd; - -// For Metal Sonic and time attack ghosts -#define GZT_XYZ 0x01 -#define GZT_MOMXY 0x02 -#define GZT_MOMZ 0x04 -#define GZT_ANGLE 0x08 -#define GZT_FRAME 0x10 // Animation frame -#define GZT_SPR2 0x20 // Player animations -#define GZT_EXTRA 0x40 -#define GZT_FOLLOW 0x80 // Followmobj - -// GZT_EXTRA flags -#define EZT_THOK 0x01 // Spawned a thok object -#define EZT_SPIN 0x02 // Because one type of thok object apparently wasn't enough -#define EZT_REV 0x03 // And two types wasn't enough either yet -#define EZT_THOKMASK 0x03 -#define EZT_COLOR 0x04 // Changed color (Super transformation, Mario fireflowers/invulnerability, etc.) -#define EZT_FLIP 0x08 // Reversed gravity -#define EZT_SCALE 0x10 // Changed size -#define EZT_HIT 0x20 // Damaged a mobj -#define EZT_SPRITE 0x40 // Changed sprite set completely out of PLAY (NiGHTS, SOCs, whatever) -#define EZT_HEIGHT 0x80 // Changed height - -// GZT_FOLLOW flags -#define FZT_SPAWNED 0x01 // just been spawned -#define FZT_SKIN 0x02 // has skin -#define FZT_LINKDRAW 0x04 // has linkdraw (combine with spawned only) -#define FZT_COLORIZED 0x08 // colorized (ditto) -#define FZT_SCALE 0x10 // different scale to object -// spare FZT slots 0x20 to 0x80 - -static mobj_t oldmetal, oldghost; - -void G_SaveMetal(UINT8 **buffer) -{ - I_Assert(buffer != NULL && *buffer != NULL); - - WRITEUINT32(*buffer, metal_p - metalbuffer); -} - -void G_LoadMetal(UINT8 **buffer) -{ - I_Assert(buffer != NULL && *buffer != NULL); - - G_DoPlayMetal(); - metal_p = metalbuffer + READUINT32(*buffer); -} - -ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n) -{ - return M_Memcpy(dest, src, n*sizeof(*src)); -} - -ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n) -{ - size_t i; - for (i = 0; i < n; i++) - { - dest[i].forwardmove = src[i].forwardmove; - dest[i].sidemove = src[i].sidemove; - dest[i].angleturn = SHORT(src[i].angleturn); - dest[i].aiming = (INT16)SHORT(src[i].aiming); - dest[i].buttons = (UINT16)SHORT(src[i].buttons); - } - return dest; -} - -void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum) -{ - UINT8 ziptic; - (void)playernum; - - if (!demo_p || !demo_start) - return; - ziptic = READUINT8(demo_p); - - if (ziptic & ZT_FWD) - oldcmd.forwardmove = READSINT8(demo_p); - if (ziptic & ZT_SIDE) - oldcmd.sidemove = READSINT8(demo_p); - if (ziptic & ZT_ANGLE) - oldcmd.angleturn = READINT16(demo_p); - if (ziptic & ZT_BUTTONS) - oldcmd.buttons = (oldcmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) | (READUINT16(demo_p) & ~(BT_CAMLEFT|BT_CAMRIGHT)); - if (ziptic & ZT_AIMING) - oldcmd.aiming = READINT16(demo_p); - - G_CopyTiccmd(cmd, &oldcmd, 1); - - if (!(demoflags & DF_GHOST) && *demo_p == DEMOMARKER) - { - // end of demo data stream - G_CheckDemoStatus(); - return; - } -} - -void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum) -{ - char ziptic = 0; - UINT8 *ziptic_p; - (void)playernum; - - if (!demo_p) - return; - ziptic_p = demo_p++; // the ziptic, written at the end of this function - - if (cmd->forwardmove != oldcmd.forwardmove) - { - WRITEUINT8(demo_p,cmd->forwardmove); - oldcmd.forwardmove = cmd->forwardmove; - ziptic |= ZT_FWD; - } - - if (cmd->sidemove != oldcmd.sidemove) - { - WRITEUINT8(demo_p,cmd->sidemove); - oldcmd.sidemove = cmd->sidemove; - ziptic |= ZT_SIDE; - } - - if (cmd->angleturn != oldcmd.angleturn) - { - WRITEINT16(demo_p,cmd->angleturn); - oldcmd.angleturn = cmd->angleturn; - ziptic |= ZT_ANGLE; - } - - if (cmd->buttons != oldcmd.buttons) - { - WRITEUINT16(demo_p,cmd->buttons); - oldcmd.buttons = cmd->buttons; - ziptic |= ZT_BUTTONS; - } - - if (cmd->aiming != oldcmd.aiming) - { - WRITEINT16(demo_p,cmd->aiming); - oldcmd.aiming = cmd->aiming; - ziptic |= ZT_AIMING; - } - - *ziptic_p = ziptic; - - // attention here for the ticcmd size! - // latest demos with mouse aiming byte in ticcmd - if (!(demoflags & DF_GHOST) && ziptic_p > demoend - 9) - { - G_CheckDemoStatus(); // no more space - return; - } -} - -void G_GhostAddThok(void) -{ - if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) - return; - ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_THOK; -} - -void G_GhostAddSpin(void) -{ - if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) - return; - ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_SPIN; -} - -void G_GhostAddRev(void) -{ - if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) - return; - ghostext.flags = (ghostext.flags & ~EZT_THOKMASK) | EZT_REV; -} - -void G_GhostAddFlip(void) -{ - if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) - return; - ghostext.flags |= EZT_FLIP; -} - -void G_GhostAddColor(ghostcolor_t color) -{ - if (!demorecording || !(demoflags & DF_GHOST)) - return; - if (ghostext.lastcolor == (UINT8)color) - { - ghostext.flags &= ~EZT_COLOR; - return; - } - ghostext.flags |= EZT_COLOR; - ghostext.color = (UINT8)color; -} - -void G_GhostAddScale(fixed_t scale) -{ - if (!metalrecording && (!demorecording || !(demoflags & DF_GHOST))) - return; - if (ghostext.lastscale == scale) - { - ghostext.flags &= ~EZT_SCALE; - return; - } - ghostext.flags |= EZT_SCALE; - ghostext.scale = scale; -} - -void G_GhostAddHit(mobj_t *victim) -{ - if (!demorecording || !(demoflags & DF_GHOST)) - return; - ghostext.flags |= EZT_HIT; - ghostext.hits++; - ghostext.hitlist = Z_Realloc(ghostext.hitlist, ghostext.hits * sizeof(mobj_t *), PU_LEVEL, NULL); - ghostext.hitlist[ghostext.hits-1] = victim; -} - -void G_WriteGhostTic(mobj_t *ghost) -{ - char ziptic = 0; - UINT8 *ziptic_p; - UINT32 i; - fixed_t height; - - if (!demo_p) - return; - if (!(demoflags & DF_GHOST)) - return; // No ghost data to write. - - ziptic_p = demo_p++; // the ziptic, written at the end of this function - - #define MAXMOM (0xFFFF<<8) - - // GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic. - if (abs(ghost->x-oldghost.x) > MAXMOM - || abs(ghost->y-oldghost.y) > MAXMOM - || abs(ghost->z-oldghost.z) > MAXMOM) - { - oldghost.x = ghost->x; - oldghost.y = ghost->y; - oldghost.z = ghost->z; - ziptic |= GZT_XYZ; - WRITEFIXED(demo_p,oldghost.x); - WRITEFIXED(demo_p,oldghost.y); - WRITEFIXED(demo_p,oldghost.z); - } - else - { - // For moving normally: - // Store one full byte of movement, plus one byte of fractional movement. - INT16 momx = (INT16)((ghost->x-oldghost.x)>>8); - INT16 momy = (INT16)((ghost->y-oldghost.y)>>8); - if (momx != oldghost.momx - || momy != oldghost.momy) - { - oldghost.momx = momx; - oldghost.momy = momy; - ziptic |= GZT_MOMXY; - WRITEINT16(demo_p,momx); - WRITEINT16(demo_p,momy); - } - momx = (INT16)((ghost->z-oldghost.z)>>8); - if (momx != oldghost.momz) - { - oldghost.momz = momx; - ziptic |= GZT_MOMZ; - WRITEINT16(demo_p,momx); - } - - // This SHOULD set oldghost.x/y/z to match ghost->x/y/z - // but it keeps the fractional loss of one byte, - // so it will hopefully be made up for in future tics. - oldghost.x += oldghost.momx<<8; - oldghost.y += oldghost.momy<<8; - oldghost.z += oldghost.momz<<8; - } - - #undef MAXMOM - - // Only store the 8 most relevant bits of angle - // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites - // and it does not affect this mode of movement at all anyway. - if (ghost->player && ghost->player->drawangle>>24 != oldghost.angle) - { - oldghost.angle = ghost->player->drawangle>>24; - ziptic |= GZT_ANGLE; - WRITEUINT8(demo_p,oldghost.angle); - } - - // Store the sprite frame. - if ((ghost->frame & FF_FRAMEMASK) != oldghost.frame) - { - oldghost.frame = (ghost->frame & FF_FRAMEMASK); - ziptic |= GZT_FRAME; - WRITEUINT8(demo_p,oldghost.frame); - } - - if (ghost->sprite == SPR_PLAY - && ghost->sprite2 != oldghost.sprite2) - { - 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; - } - - if ((height = FixedDiv(ghost->height, ghost->scale)) != oldghost.height) - { - oldghost.height = height; - ghostext.flags |= EZT_HEIGHT; - } - - if (ghostext.flags) - { - ziptic |= GZT_EXTRA; - - if (ghostext.color == ghostext.lastcolor) - ghostext.flags &= ~EZT_COLOR; - if (ghostext.scale == ghostext.lastscale) - ghostext.flags &= ~EZT_SCALE; - - WRITEUINT8(demo_p,ghostext.flags); - if (ghostext.flags & EZT_COLOR) - { - WRITEUINT8(demo_p,ghostext.color); - ghostext.lastcolor = ghostext.color; - } - if (ghostext.flags & EZT_SCALE) - { - WRITEFIXED(demo_p,ghostext.scale); - ghostext.lastscale = ghostext.scale; - } - if (ghostext.flags & EZT_HIT) - { - WRITEUINT16(demo_p,ghostext.hits); - for (i = 0; i < ghostext.hits; i++) - { - mobj_t *mo = ghostext.hitlist[i]; - //WRITEUINT32(demo_p,UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.) - WRITEUINT32(demo_p,mo->type); - WRITEUINT16(demo_p,(UINT16)mo->health); - WRITEFIXED(demo_p,mo->x); - WRITEFIXED(demo_p,mo->y); - WRITEFIXED(demo_p,mo->z); - WRITEANGLE(demo_p,mo->angle); - } - Z_Free(ghostext.hitlist); - ghostext.hits = 0; - ghostext.hitlist = NULL; - } - if (ghostext.flags & EZT_SPRITE) - WRITEUINT16(demo_p,oldghost.sprite); - if (ghostext.flags & EZT_HEIGHT) - { - height >>= FRACBITS; - WRITEINT16(demo_p, height); - } - ghostext.flags = 0; - } - - if (ghost->player && ghost->player->followmobj && !(ghost->player->followmobj->sprite == SPR_NULL || (ghost->player->followmobj->flags2 & MF2_DONTDRAW))) // bloats tails runs but what can ya do - { - INT16 temp; - UINT8 *followtic_p = demo_p++; - UINT8 followtic = 0; - - ziptic |= GZT_FOLLOW; - - if (ghost->player->followmobj->skin) - followtic |= FZT_SKIN; - - if (!(oldghost.flags2 & MF2_AMBUSH)) - { - followtic |= FZT_SPAWNED; - WRITEINT16(demo_p,ghost->player->followmobj->info->height>>FRACBITS); - if (ghost->player->followmobj->flags2 & MF2_LINKDRAW) - followtic |= FZT_LINKDRAW; - if (ghost->player->followmobj->colorized) - followtic |= FZT_COLORIZED; - if (followtic & FZT_SKIN) - WRITEUINT8(demo_p,(UINT8)(((skin_t *)(ghost->player->followmobj->skin))-skins)); - oldghost.flags2 |= MF2_AMBUSH; - } - - if (ghost->player->followmobj->scale != ghost->scale) - { - followtic |= FZT_SCALE; - WRITEFIXED(demo_p,ghost->player->followmobj->scale); - } - - temp = (INT16)((ghost->player->followmobj->x-ghost->x)>>8); - WRITEINT16(demo_p,temp); - temp = (INT16)((ghost->player->followmobj->y-ghost->y)>>8); - WRITEINT16(demo_p,temp); - temp = (INT16)((ghost->player->followmobj->z-ghost->z)>>8); - WRITEINT16(demo_p,temp); - if (followtic & FZT_SKIN) - WRITEUINT8(demo_p,ghost->player->followmobj->sprite2); - WRITEUINT16(demo_p,ghost->player->followmobj->sprite); - WRITEUINT8(demo_p,(ghost->player->followmobj->frame & FF_FRAMEMASK)); - WRITEUINT8(demo_p,ghost->player->followmobj->color); - - *followtic_p = followtic; - } - else - oldghost.flags2 &= ~MF2_AMBUSH; - - *ziptic_p = ziptic; - - // attention here for the ticcmd size! - // latest demos with mouse aiming byte in ticcmd - if (demo_p >= demoend - (13 + 9 + 9)) - { - G_CheckDemoStatus(); // no more space - return; - } -} - -// Uses ghost data to do consistency checks on your position. -// This fixes desynchronising demos when fighting eggman. -void G_ConsGhostTic(void) -{ - UINT8 ziptic; - UINT16 px,py,pz,gx,gy,gz; - mobj_t *testmo; - - if (!demo_p || !demo_start) - return; - if (!(demoflags & DF_GHOST)) - return; // No ghost data to use. - - testmo = players[0].mo; - - // Grab ghost data. - ziptic = READUINT8(demo_p); - if (ziptic & GZT_XYZ) - { - oldghost.x = READFIXED(demo_p); - oldghost.y = READFIXED(demo_p); - oldghost.z = READFIXED(demo_p); - } - else - { - if (ziptic & GZT_MOMXY) - { - oldghost.momx = READINT16(demo_p)<<8; - oldghost.momy = READINT16(demo_p)<<8; - } - if (ziptic & GZT_MOMZ) - oldghost.momz = READINT16(demo_p)<<8; - oldghost.x += oldghost.momx; - oldghost.y += oldghost.momy; - oldghost.z += oldghost.momz; - } - if (ziptic & GZT_ANGLE) - demo_p++; - if (ziptic & GZT_FRAME) - demo_p++; - if (ziptic & GZT_SPR2) - demo_p++; - - if (ziptic & GZT_EXTRA) - { // But wait, there's more! - UINT8 xziptic = READUINT8(demo_p); - if (xziptic & EZT_COLOR) - demo_p++; - if (xziptic & EZT_SCALE) - demo_p += sizeof(fixed_t); - if (xziptic & EZT_HIT) - { // Resync mob damage. - UINT16 i, count = READUINT16(demo_p); - thinker_t *th; - mobj_t *mobj; - - UINT32 type; - UINT16 health; - fixed_t x; - fixed_t y; - fixed_t z; - - for (i = 0; i < count; i++) - { - //demo_p += 4; // reserved. - type = READUINT32(demo_p); - health = READUINT16(demo_p); - x = READFIXED(demo_p); - y = READFIXED(demo_p); - z = READFIXED(demo_p); - demo_p += sizeof(angle_t); // angle, unnecessary for cons. - - mobj = NULL; - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - mobj = (mobj_t *)th; - if (mobj->type == (mobjtype_t)type && mobj->x == x && mobj->y == y && mobj->z == z) - break; - } - if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it! - { - 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, 0); - } - } - } - if (xziptic & EZT_SPRITE) - demo_p += sizeof(UINT16); - if (xziptic & EZT_HEIGHT) - demo_p += sizeof(INT16); - } - - if (ziptic & GZT_FOLLOW) - { // Even more... - UINT8 followtic = READUINT8(demo_p); - if (followtic & FZT_SPAWNED) - { - demo_p += sizeof(INT16); - if (followtic & FZT_SKIN) - demo_p++; - } - if (followtic & FZT_SCALE) - demo_p += sizeof(fixed_t); - demo_p += sizeof(INT16); - demo_p += sizeof(INT16); - demo_p += sizeof(INT16); - if (followtic & FZT_SKIN) - demo_p++; - demo_p += sizeof(UINT16); - demo_p++; - demo_p++; - } - - // Re-synchronise - px = testmo->x>>FRACBITS; - py = testmo->y>>FRACBITS; - pz = testmo->z>>FRACBITS; - gx = oldghost.x>>FRACBITS; - gy = oldghost.y>>FRACBITS; - gz = oldghost.z>>FRACBITS; - - if (px != gx || py != gy || pz != gz) - { - if (demosynced) - CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); - demosynced = false; - - P_UnsetThingPosition(testmo); - testmo->x = oldghost.x; - testmo->y = oldghost.y; - P_SetThingPosition(testmo); - testmo->z = oldghost.z; - } - - if (*demo_p == DEMOMARKER) - { - // end of demo data stream - G_CheckDemoStatus(); - return; - } -} - -void G_GhostTicker(void) -{ - demoghost *g,*p; - for(g = ghosts, p = NULL; g; g = g->next) - { - // Skip normal demo data. - UINT8 ziptic = READUINT8(g->p); - UINT8 xziptic = 0; - if (ziptic & ZT_FWD) - g->p++; - if (ziptic & ZT_SIDE) - g->p++; - if (ziptic & ZT_ANGLE) - g->p += 2; - if (ziptic & ZT_BUTTONS) - g->p += 2; - if (ziptic & ZT_AIMING) - g->p += 2; - - // Grab ghost data. - ziptic = READUINT8(g->p); - if (ziptic & GZT_XYZ) - { - g->oldmo.x = READFIXED(g->p); - g->oldmo.y = READFIXED(g->p); - g->oldmo.z = READFIXED(g->p); - } - else - { - if (ziptic & GZT_MOMXY) - { - g->oldmo.momx = READINT16(g->p)<<8; - g->oldmo.momy = READINT16(g->p)<<8; - } - if (ziptic & GZT_MOMZ) - g->oldmo.momz = READINT16(g->p)<<8; - g->oldmo.x += g->oldmo.momx; - g->oldmo.y += g->oldmo.momy; - g->oldmo.z += g->oldmo.momz; - } - if (ziptic & GZT_ANGLE) - g->mo->angle = READUINT8(g->p)<<24; - if (ziptic & GZT_FRAME) - g->oldmo.frame = READUINT8(g->p); - if (ziptic & GZT_SPR2) - g->oldmo.sprite2 = READUINT8(g->p); - - // Update ghost - P_UnsetThingPosition(g->mo); - g->mo->x = g->oldmo.x; - g->mo->y = g->oldmo.y; - g->mo->z = g->oldmo.z; - P_SetThingPosition(g->mo); - g->mo->frame = g->oldmo.frame | tr_trans30<fadein) - { - g->mo->frame += (((--g->fadein)/6)<fadein is bad, and it's only set once, so... - g->mo->flags2 &= ~MF2_DONTDRAW; - } - g->mo->sprite2 = g->oldmo.sprite2; - - if (ziptic & GZT_EXTRA) - { // But wait, there's more! - xziptic = READUINT8(g->p); - if (xziptic & EZT_COLOR) - { - g->color = READUINT8(g->p); - switch(g->color) - { - default: - case GHC_RETURNSKIN: - g->mo->skin = g->oldmo.skin; - /* FALLTHRU */ - case GHC_NORMAL: // Go back to skin color - g->mo->color = g->oldmo.color; - break; - // Handled below - case GHC_SUPER: - case GHC_INVINCIBLE: - break; - case GHC_FIREFLOWER: // Fireflower - g->mo->color = SKINCOLOR_WHITE; - break; - case GHC_NIGHTSSKIN: // not actually a colour - g->mo->skin = &skins[DEFAULTNIGHTSSKIN]; - break; - } - } - if (xziptic & EZT_FLIP) - g->mo->eflags ^= MFE_VERTICALFLIP; - if (xziptic & EZT_SCALE) - { - g->mo->destscale = READFIXED(g->p); - if (g->mo->destscale != g->mo->scale) - P_SetScale(g->mo, g->mo->destscale); - } - if (xziptic & EZT_THOKMASK) - { // Let's only spawn ONE of these per frame, thanks. - mobj_t *mobj; - INT32 type = -1; - if (g->mo->skin) - { - skin_t *skin = (skin_t *)g->mo->skin; - switch (xziptic & EZT_THOKMASK) - { - case EZT_THOK: - type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; - break; - case EZT_SPIN: - type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; - break; - case EZT_REV: - type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; - break; - } - } - if (type != MT_NULL) - { - if (type == MT_GHOST) - { - mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us - mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<mo, 0, 0, -FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK); - mobj->sprite = states[mobjinfo[type].spawnstate].sprite; - mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<color = g->mo->color; - mobj->skin = g->mo->skin; - P_SetScale(mobj, (mobj->destscale = g->mo->scale)); - - if (type == MT_THOK) // spintrail-specific modification for MT_THOK - { - mobj->frame = FF_TRANS80; - mobj->fuse = mobj->tics; - } - mobj->tics = -1; // nope. - } - mobj->floorz = mobj->z; - mobj->ceilingz = mobj->z+mobj->height; - P_UnsetThingPosition(mobj); - mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... - P_SetThingPosition(mobj); - if (!mobj->fuse) - mobj->fuse = 8; - P_SetTarget(&mobj->target, g->mo); - } - } - if (xziptic & EZT_HIT) - { // Spawn hit poofs for killing things! - UINT16 i, count = READUINT16(g->p), health; - UINT32 type; - fixed_t x,y,z; - angle_t angle; - mobj_t *poof; - for (i = 0; i < count; i++) - { - //g->p += 4; // reserved - type = READUINT32(g->p); - health = READUINT16(g->p); - x = READFIXED(g->p); - y = READFIXED(g->p); - z = READFIXED(g->p); - angle = READANGLE(g->p); - if (!(mobjinfo[type].flags & MF_SHOOTABLE) - || !(mobjinfo[type].flags & (MF_ENEMY|MF_MONITOR)) - || health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad. - continue; - poof = P_SpawnMobj(x, y, z, MT_GHOST); - poof->angle = angle; - poof->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... - poof->health = 0; - P_SetMobjStateNF(poof, S_XPLD1); - } - } - if (xziptic & EZT_SPRITE) - g->mo->sprite = READUINT16(g->p); - if (xziptic & EZT_HEIGHT) - { - fixed_t temp = READINT16(g->p)<mo->height = FixedMul(temp, g->mo->scale); - } - } - - // Tick ghost colors (Super and Mario Invincibility flashing) - switch(g->color) - { - case GHC_SUPER: // Super (P_DoSuperStuff) - if (g->mo->skin) - { - skin_t *skin = (skin_t *)g->mo->skin; - g->mo->color = skin->supercolor; - } - else - g->mo->color = SKINCOLOR_SUPERGOLD1; - g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); - break; - case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) - g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours - break; - default: - break; - } - -#define follow g->mo->tracer - if (ziptic & GZT_FOLLOW) - { // Even more... - UINT8 followtic = READUINT8(g->p); - fixed_t temp; - if (followtic & FZT_SPAWNED) - { - if (follow) - P_RemoveMobj(follow); - P_SetTarget(&follow, P_SpawnMobjFromMobj(g->mo, 0, 0, 0, MT_GHOST)); - P_SetTarget(&follow->tracer, g->mo); - follow->tics = -1; - temp = READINT16(g->p)<height = FixedMul(follow->scale, temp); - - if (followtic & FZT_LINKDRAW) - follow->flags2 |= MF2_LINKDRAW; - - if (followtic & FZT_COLORIZED) - follow->colorized = true; - - if (followtic & FZT_SKIN) - follow->skin = &skins[READUINT8(g->p)]; - } - if (follow) - { - if (followtic & FZT_SCALE) - follow->destscale = READFIXED(g->p); - else - follow->destscale = g->mo->destscale; - if (follow->destscale != follow->scale) - P_SetScale(follow, follow->destscale); - - P_UnsetThingPosition(follow); - temp = READINT16(g->p)<<8; - follow->x = g->mo->x + temp; - temp = READINT16(g->p)<<8; - follow->y = g->mo->y + temp; - temp = READINT16(g->p)<<8; - follow->z = g->mo->z + temp; - P_SetThingPosition(follow); - if (followtic & FZT_SKIN) - follow->sprite2 = READUINT8(g->p); - else - follow->sprite2 = 0; - follow->sprite = READUINT16(g->p); - follow->frame = (READUINT8(g->p)) | (g->mo->frame & FF_TRANSMASK); - follow->angle = g->mo->angle; - follow->color = READUINT8(g->p); - - if (!(followtic & FZT_SPAWNED)) - { - if (xziptic & EZT_FLIP) - { - follow->flags2 ^= MF2_OBJECTFLIP; - follow->eflags ^= MFE_VERTICALFLIP; - } - } - } - } - else if (follow) - { - P_RemoveMobj(follow); - P_SetTarget(&follow, NULL); - } - // Demo ends after ghost data. - if (*g->p == DEMOMARKER) - { - g->mo->momx = g->mo->momy = g->mo->momz = 0; -#if 1 // freeze frame (maybe more useful for time attackers) - g->mo->colorized = true; - if (follow) - follow->colorized = true; -#else // dissapearing act - g->mo->fuse = TICRATE; - if (follow) - follow->fuse = TICRATE; -#endif - if (p) - p->next = g->next; - else - ghosts = g->next; - Z_Free(g); - continue; - } - p = g; -#undef follow - } -} - -void G_ReadMetalTic(mobj_t *metal) -{ - UINT8 ziptic; - UINT8 xziptic = 0; - - if (!metal_p) - return; - - if (!metal->health) - { - G_StopMetalDemo(); - return; - } - - switch (*metal_p) - { - case METALSNICE: - break; - case METALDEATH: - if (metal->tracer) - P_RemoveMobj(metal->tracer); - P_KillMobj(metal, NULL, NULL, 0); - /* FALLTHRU */ - case DEMOMARKER: - default: - // end of demo data stream - G_StopMetalDemo(); - return; - } - metal_p++; - - ziptic = READUINT8(metal_p); - - // Read changes from the tic - if (ziptic & GZT_XYZ) - { - P_TeleportMove(metal, READFIXED(metal_p), READFIXED(metal_p), READFIXED(metal_p)); - oldmetal.x = metal->x; - oldmetal.y = metal->y; - oldmetal.z = metal->z; - } - else - { - if (ziptic & GZT_MOMXY) - { - oldmetal.momx = READINT16(metal_p)<<8; - oldmetal.momy = READINT16(metal_p)<<8; - } - if (ziptic & GZT_MOMZ) - oldmetal.momz = READINT16(metal_p)<<8; - oldmetal.x += oldmetal.momx; - oldmetal.y += oldmetal.momy; - oldmetal.z += oldmetal.momz; - } - if (ziptic & GZT_ANGLE) - metal->angle = READUINT8(metal_p)<<24; - if (ziptic & GZT_FRAME) - oldmetal.frame = READUINT32(metal_p); - if (ziptic & GZT_SPR2) - oldmetal.sprite2 = READUINT8(metal_p); - - // Set movement, position, and angle - // oldmetal contains where you're supposed to be. - metal->momx = oldmetal.momx; - metal->momy = oldmetal.momy; - metal->momz = oldmetal.momz; - P_UnsetThingPosition(metal); - metal->x = oldmetal.x; - metal->y = oldmetal.y; - metal->z = oldmetal.z; - P_SetThingPosition(metal); - metal->frame = oldmetal.frame; - metal->sprite2 = oldmetal.sprite2; - - if (ziptic & GZT_EXTRA) - { // But wait, there's more! - xziptic = READUINT8(metal_p); - if (xziptic & EZT_FLIP) - { - metal->eflags ^= MFE_VERTICALFLIP; - metal->flags2 ^= MF2_OBJECTFLIP; - } - if (xziptic & EZT_SCALE) - { - metal->destscale = READFIXED(metal_p); - if (metal->destscale != metal->scale) - P_SetScale(metal, metal->destscale); - } - if (xziptic & EZT_THOKMASK) - { // Let's only spawn ONE of these per frame, thanks. - mobj_t *mobj; - INT32 type = -1; - if (metal->skin) - { - skin_t *skin = (skin_t *)metal->skin; - switch (xziptic & EZT_THOKMASK) - { - case EZT_THOK: - type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; - break; - case EZT_SPIN: - type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; - break; - case EZT_REV: - type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; - break; - } - } - if (type != MT_NULL) - { - if (type == MT_GHOST) - { - mobj = P_SpawnGhostMobj(metal); // does a large portion of the work for us - } - else - { - mobj = P_SpawnMobjFromMobj(metal, 0, 0, -FixedDiv(FixedMul(metal->info->height, metal->scale) - metal->height,3*FRACUNIT), MT_THOK); - mobj->sprite = states[mobjinfo[type].spawnstate].sprite; - mobj->frame = states[mobjinfo[type].spawnstate].frame; - mobj->angle = metal->angle; - mobj->color = metal->color; - mobj->skin = metal->skin; - P_SetScale(mobj, (mobj->destscale = metal->scale)); - - if (type == MT_THOK) // spintrail-specific modification for MT_THOK - { - mobj->frame = FF_TRANS70; - mobj->fuse = mobj->tics; - } - mobj->tics = -1; // nope. - } - mobj->floorz = mobj->z; - mobj->ceilingz = mobj->z+mobj->height; - P_UnsetThingPosition(mobj); - mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up... - P_SetThingPosition(mobj); - if (!mobj->fuse) - mobj->fuse = 8; - P_SetTarget(&mobj->target, metal); - } - } - if (xziptic & EZT_SPRITE) - metal->sprite = READUINT16(metal_p); - if (xziptic & EZT_HEIGHT) - { - fixed_t temp = READINT16(metal_p)<height = FixedMul(temp, metal->scale); - } - } - -#define follow metal->tracer - if (ziptic & GZT_FOLLOW) - { // Even more... - UINT8 followtic = READUINT8(metal_p); - fixed_t temp; - if (followtic & FZT_SPAWNED) - { - if (follow) - P_RemoveMobj(follow); - P_SetTarget(&follow, P_SpawnMobjFromMobj(metal, 0, 0, 0, MT_GHOST)); - P_SetTarget(&follow->tracer, metal); - follow->tics = -1; - temp = READINT16(metal_p)<height = FixedMul(follow->scale, temp); - - if (followtic & FZT_LINKDRAW) - follow->flags2 |= MF2_LINKDRAW; - - if (followtic & FZT_COLORIZED) - follow->colorized = true; - - if (followtic & FZT_SKIN) - follow->skin = &skins[READUINT8(metal_p)]; - } - if (follow) - { - if (followtic & FZT_SCALE) - follow->destscale = READFIXED(metal_p); - else - follow->destscale = metal->destscale; - if (follow->destscale != follow->scale) - P_SetScale(follow, follow->destscale); - - P_UnsetThingPosition(follow); - temp = READINT16(metal_p)<<8; - follow->x = metal->x + temp; - temp = READINT16(metal_p)<<8; - follow->y = metal->y + temp; - temp = READINT16(metal_p)<<8; - follow->z = metal->z + temp; - P_SetThingPosition(follow); - if (followtic & FZT_SKIN) - follow->sprite2 = READUINT8(metal_p); - else - follow->sprite2 = 0; - follow->sprite = READUINT16(metal_p); - follow->frame = READUINT32(metal_p); // NOT & FF_FRAMEMASK here, so 32 bits - follow->angle = metal->angle; - follow->color = READUINT8(metal_p); - - if (!(followtic & FZT_SPAWNED)) - { - if (xziptic & EZT_FLIP) - { - follow->flags2 ^= MF2_OBJECTFLIP; - follow->eflags ^= MFE_VERTICALFLIP; - } - } - } - } - else if (follow) - { - P_RemoveMobj(follow); - P_SetTarget(&follow, NULL); - } -#undef follow -} - -void G_WriteMetalTic(mobj_t *metal) -{ - UINT8 ziptic = 0; - UINT8 *ziptic_p; - fixed_t height; - - if (!demo_p) // demo_p will be NULL until the race start linedef executor is activated! - return; - - WRITEUINT8(demo_p, METALSNICE); - ziptic_p = demo_p++; // the ziptic, written at the end of this function - - #define MAXMOM (0xFFFF<<8) - - // GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic. - if (abs(metal->x-oldmetal.x) > MAXMOM - || abs(metal->y-oldmetal.y) > MAXMOM - || abs(metal->z-oldmetal.z) > MAXMOM) - { - oldmetal.x = metal->x; - oldmetal.y = metal->y; - oldmetal.z = metal->z; - ziptic |= GZT_XYZ; - WRITEFIXED(demo_p,oldmetal.x); - WRITEFIXED(demo_p,oldmetal.y); - WRITEFIXED(demo_p,oldmetal.z); - } - else - { - // For moving normally: - // Store one full byte of movement, plus one byte of fractional movement. - INT16 momx = (INT16)((metal->x-oldmetal.x)>>8); - INT16 momy = (INT16)((metal->y-oldmetal.y)>>8); - if (momx != oldmetal.momx - || momy != oldmetal.momy) - { - oldmetal.momx = momx; - oldmetal.momy = momy; - ziptic |= GZT_MOMXY; - WRITEINT16(demo_p,momx); - WRITEINT16(demo_p,momy); - } - momx = (INT16)((metal->z-oldmetal.z)>>8); - if (momx != oldmetal.momz) - { - oldmetal.momz = momx; - ziptic |= GZT_MOMZ; - WRITEINT16(demo_p,momx); - } - - // This SHOULD set oldmetal.x/y/z to match metal->x/y/z - // but it keeps the fractional loss of one byte, - // so it will hopefully be made up for in future tics. - oldmetal.x += oldmetal.momx<<8; - oldmetal.y += oldmetal.momy<<8; - oldmetal.z += oldmetal.momz<<8; - } - - #undef MAXMOM - - // Only store the 8 most relevant bits of angle - // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites - // and it does not affect movement at all anyway. - if (metal->player && metal->player->drawangle>>24 != oldmetal.angle) - { - oldmetal.angle = metal->player->drawangle>>24; - ziptic |= GZT_ANGLE; - WRITEUINT8(demo_p,oldmetal.angle); - } - - // Store the sprite frame. - if ((metal->frame & FF_FRAMEMASK) != oldmetal.frame) - { - oldmetal.frame = metal->frame; // NOT & FF_FRAMEMASK here, so 32 bits - ziptic |= GZT_FRAME; - WRITEUINT32(demo_p,oldmetal.frame); - } - - if (metal->sprite == SPR_PLAY - && metal->sprite2 != oldmetal.sprite2) - { - oldmetal.sprite2 = metal->sprite2; - ziptic |= GZT_SPR2; - WRITEUINT8(demo_p,oldmetal.sprite2); - } - - // Check for sprite set changes - if (metal->sprite != oldmetal.sprite) - { - oldmetal.sprite = metal->sprite; - ghostext.flags |= EZT_SPRITE; - } - - if ((height = FixedDiv(metal->height, metal->scale)) != oldmetal.height) - { - oldmetal.height = height; - ghostext.flags |= EZT_HEIGHT; - } - - if (ghostext.flags & ~(EZT_COLOR|EZT_HIT)) // these two aren't handled by metal ever - { - ziptic |= GZT_EXTRA; - - if (ghostext.scale == ghostext.lastscale) - ghostext.flags &= ~EZT_SCALE; - - WRITEUINT8(demo_p,ghostext.flags); - if (ghostext.flags & EZT_SCALE) - { - WRITEFIXED(demo_p,ghostext.scale); - ghostext.lastscale = ghostext.scale; - } - if (ghostext.flags & EZT_SPRITE) - WRITEUINT16(demo_p,oldmetal.sprite); - if (ghostext.flags & EZT_HEIGHT) - { - height >>= FRACBITS; - WRITEINT16(demo_p, height); - } - ghostext.flags = 0; - } - - if (metal->player && metal->player->followmobj && !(metal->player->followmobj->sprite == SPR_NULL || (metal->player->followmobj->flags2 & MF2_DONTDRAW))) - { - INT16 temp; - UINT8 *followtic_p = demo_p++; - UINT8 followtic = 0; - - ziptic |= GZT_FOLLOW; - - if (metal->player->followmobj->skin) - followtic |= FZT_SKIN; - - if (!(oldmetal.flags2 & MF2_AMBUSH)) - { - followtic |= FZT_SPAWNED; - WRITEINT16(demo_p,metal->player->followmobj->info->height>>FRACBITS); - if (metal->player->followmobj->flags2 & MF2_LINKDRAW) - followtic |= FZT_LINKDRAW; - if (metal->player->followmobj->colorized) - followtic |= FZT_COLORIZED; - if (followtic & FZT_SKIN) - WRITEUINT8(demo_p,(UINT8)(((skin_t *)(metal->player->followmobj->skin))-skins)); - oldmetal.flags2 |= MF2_AMBUSH; - } - - if (metal->player->followmobj->scale != metal->scale) - { - followtic |= FZT_SCALE; - WRITEFIXED(demo_p,metal->player->followmobj->scale); - } - - temp = (INT16)((metal->player->followmobj->x-metal->x)>>8); - WRITEINT16(demo_p,temp); - temp = (INT16)((metal->player->followmobj->y-metal->y)>>8); - WRITEINT16(demo_p,temp); - temp = (INT16)((metal->player->followmobj->z-metal->z)>>8); - WRITEINT16(demo_p,temp); - if (followtic & FZT_SKIN) - WRITEUINT8(demo_p,metal->player->followmobj->sprite2); - WRITEUINT16(demo_p,metal->player->followmobj->sprite); - WRITEUINT32(demo_p,metal->player->followmobj->frame); // NOT & FF_FRAMEMASK here, so 32 bits - WRITEUINT8(demo_p,metal->player->followmobj->color); - - *followtic_p = followtic; - } - else - oldmetal.flags2 &= ~MF2_AMBUSH; - - *ziptic_p = ziptic; - - // attention here for the ticcmd size! - // latest demos with mouse aiming byte in ticcmd - if (demo_p >= demoend - 32) - { - G_StopMetalRecording(false); // no more space - return; - } -} - -// -// G_RecordDemo -// -void G_RecordDemo(const char *name) -{ - INT32 maxsize; - - strcpy(demoname, name); - strcat(demoname, ".lmp"); - maxsize = 1024*1024; - if (M_CheckParm("-maxdemo") && M_IsNextParm()) - maxsize = atoi(M_GetNextParm()) * 1024; -// if (demobuffer) -// free(demobuffer); - demo_p = NULL; - demobuffer = malloc(maxsize); - demoend = demobuffer + maxsize; - - demorecording = true; -} - -void G_RecordMetal(void) -{ - INT32 maxsize; - maxsize = 1024*1024; - if (M_CheckParm("-maxdemo") && M_IsNextParm()) - maxsize = atoi(M_GetNextParm()) * 1024; - demo_p = NULL; - demobuffer = malloc(maxsize); - demoend = demobuffer + maxsize; - metalrecording = true; -} - -void G_BeginRecording(void) -{ - UINT8 i; - char name[16]; - player_t *player = &players[consoleplayer]; - - if (demo_p) - return; - memset(name,0,sizeof(name)); - - demo_p = demobuffer; - demoflags = DF_GHOST|(modeattacking<>DF_ATTACKSHIFT) - { - case ATTACKING_NONE: // 0 - break; - case ATTACKING_RECORD: // 1 - demotime_p = demo_p; - WRITEUINT32(demo_p,UINT32_MAX); // time - WRITEUINT32(demo_p,0); // score - WRITEUINT16(demo_p,0); // rings - break; - case ATTACKING_NIGHTS: // 2 - demotime_p = demo_p; - WRITEUINT32(demo_p,UINT32_MAX); // time - WRITEUINT32(demo_p,0); // score - break; - default: // 3 - break; - } - - WRITEUINT32(demo_p,P_GetInitSeed()); - - // Name - for (i = 0; i < 16 && cv_playername.string[i]; i++) - name[i] = cv_playername.string[i]; - for (; i < 16; i++) - name[i] = '\0'; - M_Memcpy(demo_p,name,16); - demo_p += 16; - - // Skin - for (i = 0; i < 16 && cv_skin.string[i]; i++) - name[i] = cv_skin.string[i]; - for (; i < 16; i++) - name[i] = '\0'; - M_Memcpy(demo_p,name,16); - demo_p += 16; - - // Color - for (i = 0; i < 16 && cv_playercolor.string[i]; i++) - name[i] = cv_playercolor.string[i]; - for (; i < 16; i++) - name[i] = '\0'; - M_Memcpy(demo_p,name,16); - demo_p += 16; - - // Stats - WRITEUINT8(demo_p,player->charability); - WRITEUINT8(demo_p,player->charability2); - WRITEUINT8(demo_p,player->actionspd>>FRACBITS); - WRITEUINT8(demo_p,player->mindash>>FRACBITS); - WRITEUINT8(demo_p,player->maxdash>>FRACBITS); - WRITEUINT8(demo_p,player->normalspeed>>FRACBITS); - WRITEUINT8(demo_p,player->runspeed>>FRACBITS); - WRITEUINT8(demo_p,player->thrustfactor); - WRITEUINT8(demo_p,player->accelstart); - WRITEUINT8(demo_p,player->acceleration); - WRITEUINT8(demo_p,player->height>>FRACBITS); - WRITEUINT8(demo_p,player->spinheight>>FRACBITS); - WRITEUINT8(demo_p,player->camerascale>>FRACBITS); - WRITEUINT8(demo_p,player->shieldscale>>FRACBITS); - - // Trying to convert it back to % causes demo desync due to precision loss. - // Don't do it. - WRITEFIXED(demo_p, player->jumpfactor); - - // And mobjtype_t is best with UINT32 too... - WRITEUINT32(demo_p, player->followitem); - - // Save pflag data - see SendWeaponPref() - { - UINT8 buf = 0; - pflags_t pflags = 0; - if (cv_flipcam.value) - { - buf |= 0x01; - pflags |= PF_FLIPCAM; - } - if (cv_analog[0].value) - { - buf |= 0x02; - pflags |= PF_ANALOGMODE; - } - if (cv_directionchar[0].value) - { - buf |= 0x04; - pflags |= PF_DIRECTIONCHAR; - } - if (cv_autobrake.value) - { - buf |= 0x08; - pflags |= PF_AUTOBRAKE; - } - if (cv_usejoystick.value) - buf |= 0x10; - CV_SetValue(&cv_showinputjoy, !!(cv_usejoystick.value)); - - WRITEUINT8(demo_p,buf); - player->pflags = pflags; - } - - // Save netvar data - CV_SaveNetVars(&demo_p); - - memset(&oldcmd,0,sizeof(oldcmd)); - memset(&oldghost,0,sizeof(oldghost)); - memset(&ghostext,0,sizeof(ghostext)); - ghostext.lastcolor = ghostext.color = GHC_NORMAL; - ghostext.lastscale = ghostext.scale = FRACUNIT; - - if (player->mo) - { - oldghost.x = player->mo->x; - oldghost.y = player->mo->y; - oldghost.z = player->mo->z; - oldghost.angle = player->mo->angle>>24; - - // preticker started us gravity flipped - if (player->mo->eflags & MFE_VERTICALFLIP) - ghostext.flags |= EZT_FLIP; - } -} - -void G_BeginMetal(void) -{ - mobj_t *mo = players[consoleplayer].mo; - -#if 0 - if (demo_p) - return; -#endif - - demo_p = demobuffer; - - // Write header. - M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12; - WRITEUINT8(demo_p,VERSION); - WRITEUINT8(demo_p,SUBVERSION); - WRITEUINT16(demo_p,DEMOVERSION); - - // demo checksum - demo_p += 16; - - M_Memcpy(demo_p, "METL", 4); demo_p += 4; - - memset(&ghostext,0,sizeof(ghostext)); - ghostext.lastscale = ghostext.scale = FRACUNIT; - - // Set up our memory. - memset(&oldmetal,0,sizeof(oldmetal)); - oldmetal.x = mo->x; - oldmetal.y = mo->y; - oldmetal.z = mo->z; - oldmetal.angle = mo->angle>>24; -} - -void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings) -{ - if (!demorecording || !demotime_p) - return; - if (demoflags & DF_RECORDATTACK) - { - WRITEUINT32(demotime_p, ptime); - WRITEUINT32(demotime_p, pscore); - WRITEUINT16(demotime_p, prings); - demotime_p = NULL; - } - else if (demoflags & DF_NIGHTSATTACK) - { - WRITEUINT32(demotime_p, ptime); - WRITEUINT32(demotime_p, pscore); - demotime_p = NULL; - } -} - -// Returns bitfield: -// 1 == new demo has lower time -// 2 == new demo has higher score -// 4 == new demo has higher rings -UINT8 G_CmpDemoTime(char *oldname, char *newname) -{ - UINT8 *buffer,*p; - UINT8 flags; - UINT32 oldtime, newtime, oldscore, newscore; - UINT16 oldrings, newrings, oldversion; - size_t bufsize ATTRUNUSED; - UINT8 c; - UINT16 s ATTRUNUSED; - UINT8 aflags = 0; - - // load the new file - FIL_DefaultExtension(newname, ".lmp"); - bufsize = FIL_ReadFile(newname, &buffer); - I_Assert(bufsize != 0); - p = buffer; - - // read demo header - I_Assert(!memcmp(p, DEMOHEADER, 12)); - p += 12; // DEMOHEADER - c = READUINT8(p); // VERSION - I_Assert(c == VERSION); - c = READUINT8(p); // SUBVERSION - I_Assert(c == SUBVERSION); - s = READUINT16(p); - I_Assert(s == DEMOVERSION); - p += 16; // demo checksum - I_Assert(!memcmp(p, "PLAY", 4)); - p += 4; // PLAY - p += 2; // gamemap - p += 16; // map md5 - flags = READUINT8(p); // demoflags - - aflags = flags & (DF_RECORDATTACK|DF_NIGHTSATTACK); - I_Assert(aflags); - if (flags & DF_RECORDATTACK) - { - newtime = READUINT32(p); - newscore = READUINT32(p); - newrings = READUINT16(p); - } - else if (flags & DF_NIGHTSATTACK) - { - newtime = READUINT32(p); - newscore = READUINT32(p); - newrings = 0; - } - else // appease compiler - return 0; - - Z_Free(buffer); - - // load old file - FIL_DefaultExtension(oldname, ".lmp"); - if (!FIL_ReadFile(oldname, &buffer)) - { - CONS_Alert(CONS_ERROR, M_GetText("Failed to read file '%s'.\n"), oldname); - return UINT8_MAX; - } - p = buffer; - - // read demo header - if (memcmp(p, DEMOHEADER, 12)) - { - CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); - Z_Free(buffer); - return UINT8_MAX; - } p += 12; // DEMOHEADER - p++; // VERSION - p++; // SUBVERSION - oldversion = READUINT16(p); - switch(oldversion) // demoversion - { - case DEMOVERSION: // latest always supported - break; - // too old, cannot support. - default: - CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); - Z_Free(buffer); - return UINT8_MAX; - } - p += 16; // demo checksum - if (memcmp(p, "PLAY", 4)) - { - CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname); - Z_Free(buffer); - return UINT8_MAX; - } p += 4; // "PLAY" - if (oldversion <= 0x0008) - p++; // gamemap - else - p += 2; // gamemap - p += 16; // mapmd5 - flags = READUINT8(p); - if (!(flags & aflags)) - { - CONS_Alert(CONS_NOTICE, M_GetText("File '%s' not from same game mode. It will be overwritten.\n"), oldname); - Z_Free(buffer); - return UINT8_MAX; - } - if (flags & DF_RECORDATTACK) - { - oldtime = READUINT32(p); - oldscore = READUINT32(p); - oldrings = READUINT16(p); - } - else if (flags & DF_NIGHTSATTACK) - { - oldtime = READUINT32(p); - oldscore = READUINT32(p); - oldrings = 0; - } - else // appease compiler - return UINT8_MAX; - - Z_Free(buffer); - - c = 0; - if (newtime < oldtime - || (newtime == oldtime && (newscore > oldscore || newrings > oldrings))) - c |= 1; // Better time - if (newscore > oldscore - || (newscore == oldscore && newtime < oldtime)) - c |= 1<<1; // Better score - if (newrings > oldrings - || (newrings == oldrings && newtime < oldtime)) - c |= 1<<2; // Better rings - return c; -} - -// -// G_PlayDemo -// -void G_DeferedPlayDemo(const char *name) -{ - COM_BufAddText("playdemo \""); - COM_BufAddText(name); - COM_BufAddText("\"\n"); -} - -// -// Start a demo from a .LMP file or from a wad resource -// -void G_DoPlayDemo(char *defdemoname) -{ - UINT8 i; - lumpnum_t l; - char skin[17],color[17],*n,*pdemoname; - UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration; - pflags_t pflags; - UINT32 randseed, followitem; - fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight; - char msg[1024]; - - skin[16] = '\0'; - color[16] = '\0'; - - n = defdemoname+strlen(defdemoname); - while (*n != '/' && *n != '\\' && n != defdemoname) - n--; - if (n != defdemoname) - n++; - pdemoname = ZZ_Alloc(strlen(n)+1); - strcpy(pdemoname,n); - - // Internal if no extension, external if one exists - if (FIL_CheckExtension(defdemoname)) - { - //FIL_DefaultExtension(defdemoname, ".lmp"); - if (!FIL_ReadFile(defdemoname, &demobuffer)) - { - snprintf(msg, 1024, M_GetText("Failed to read file '%s'.\n"), defdemoname); - CONS_Alert(CONS_ERROR, "%s", msg); - gameaction = ga_nothing; - M_StartMessage(msg, NULL, MM_NOTHING); - return; - } - demo_p = demobuffer; - } - // load demo resource from WAD - else if ((l = W_CheckNumForName(defdemoname)) == LUMPERROR) - { - snprintf(msg, 1024, M_GetText("Failed to read lump '%s'.\n"), defdemoname); - CONS_Alert(CONS_ERROR, "%s", msg); - gameaction = ga_nothing; - M_StartMessage(msg, NULL, MM_NOTHING); - return; - } - else // it's an internal demo - demobuffer = demo_p = W_CacheLumpNum(l, PU_STATIC); - - // read demo header - gameaction = ga_nothing; - demoplayback = true; - if (memcmp(demo_p, DEMOHEADER, 12)) - { - snprintf(msg, 1024, M_GetText("%s is not a SRB2 replay file.\n"), pdemoname); - CONS_Alert(CONS_ERROR, "%s", msg); - M_StartMessage(msg, NULL, MM_NOTHING); - Z_Free(pdemoname); - Z_Free(demobuffer); - demoplayback = false; - titledemo = false; - return; - } - demo_p += 12; // DEMOHEADER - - version = READUINT8(demo_p); - subversion = READUINT8(demo_p); - demoversion = READUINT16(demo_p); - switch(demoversion) - { - case DEMOVERSION: // latest always supported - break; - // too old, cannot support. - default: - snprintf(msg, 1024, M_GetText("%s is an incompatible replay format and cannot be played.\n"), pdemoname); - CONS_Alert(CONS_ERROR, "%s", msg); - M_StartMessage(msg, NULL, MM_NOTHING); - Z_Free(pdemoname); - Z_Free(demobuffer); - demoplayback = false; - titledemo = false; - return; - } - demo_p += 16; // demo checksum - if (memcmp(demo_p, "PLAY", 4)) - { - snprintf(msg, 1024, M_GetText("%s is the wrong type of recording and cannot be played.\n"), pdemoname); - CONS_Alert(CONS_ERROR, "%s", msg); - M_StartMessage(msg, NULL, MM_NOTHING); - Z_Free(pdemoname); - Z_Free(demobuffer); - demoplayback = false; - titledemo = false; - return; - } - demo_p += 4; // "PLAY" - gamemap = READINT16(demo_p); - demo_p += 16; // mapmd5 - - demoflags = READUINT8(demo_p); - modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT; - CON_ToggleOff(); - - hu_demoscore = 0; - hu_demotime = UINT32_MAX; - hu_demorings = 0; - - switch (modeattacking) - { - case ATTACKING_NONE: // 0 - break; - case ATTACKING_RECORD: // 1 - hu_demotime = READUINT32(demo_p); - hu_demoscore = READUINT32(demo_p); - hu_demorings = READUINT16(demo_p); - break; - case ATTACKING_NIGHTS: // 2 - hu_demotime = READUINT32(demo_p); - hu_demoscore = READUINT32(demo_p); - break; - default: // 3 - modeattacking = ATTACKING_NONE; - break; - } - - // Random seed - randseed = READUINT32(demo_p); - - // Player name - M_Memcpy(player_names[0],demo_p,16); - demo_p += 16; - - // Skin - M_Memcpy(skin,demo_p,16); - demo_p += 16; - - // Color - M_Memcpy(color,demo_p,16); - demo_p += 16; - - charability = READUINT8(demo_p); - charability2 = READUINT8(demo_p); - actionspd = (fixed_t)READUINT8(demo_p)<color = players[0].skincolor; - oldghost.x = players[0].mo->x; - oldghost.y = players[0].mo->y; - oldghost.z = players[0].mo->z; - } - - // Set saved attribute values - // No cheat checking here, because even if they ARE wrong... - // it would only break the replay if we clipped them. - players[0].camerascale = camerascale; - players[0].shieldscale = shieldscale; - players[0].charability = charability; - players[0].charability2 = charability2; - players[0].actionspd = actionspd; - players[0].mindash = mindash; - players[0].maxdash = maxdash; - players[0].normalspeed = normalspeed; - players[0].runspeed = runspeed; - players[0].thrustfactor = thrustfactor; - players[0].accelstart = accelstart; - players[0].acceleration = acceleration; - players[0].height = height; - players[0].spinheight = spinheight; - players[0].jumpfactor = jumpfactor; - players[0].followitem = followitem; - players[0].pflags = pflags; - - demo_start = true; -} - -void G_AddGhost(char *defdemoname) -{ - INT32 i; - lumpnum_t l; - char name[17],skin[17],color[17],*n,*pdemoname,md5[16]; - demoghost *gh; - UINT8 flags; - UINT8 *buffer,*p; - mapthing_t *mthing; - UINT16 count, ghostversion; - - name[16] = '\0'; - skin[16] = '\0'; - color[16] = '\0'; - - n = defdemoname+strlen(defdemoname); - while (*n != '/' && *n != '\\' && n != defdemoname) - n--; - if (n != defdemoname) - n++; - pdemoname = ZZ_Alloc(strlen(n)+1); - strcpy(pdemoname,n); - - // Internal if no extension, external if one exists - if (FIL_CheckExtension(defdemoname)) - { - //FIL_DefaultExtension(defdemoname, ".lmp"); - if (!FIL_ReadFileTag(defdemoname, &buffer, PU_LEVEL)) - { - CONS_Alert(CONS_ERROR, M_GetText("Failed to read file '%s'.\n"), defdemoname); - Z_Free(pdemoname); - return; - } - p = buffer; - } - // load demo resource from WAD - else if ((l = W_CheckNumForName(defdemoname)) == LUMPERROR) - { - CONS_Alert(CONS_ERROR, M_GetText("Failed to read lump '%s'.\n"), defdemoname); - Z_Free(pdemoname); - return; - } - else // it's an internal demo - buffer = p = W_CacheLumpNum(l, PU_LEVEL); - - // read demo header - if (memcmp(p, DEMOHEADER, 12)) - { - CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Not a SRB2 replay.\n"), pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } p += 12; // DEMOHEADER - p++; // VERSION - p++; // SUBVERSION - ghostversion = READUINT16(p); - switch(ghostversion) - { - case DEMOVERSION: // latest always supported - break; - // too old, cannot support. - default: - CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Demo version incompatible.\n"), pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } - M_Memcpy(md5, p, 16); p += 16; // demo checksum - for (gh = ghosts; gh; gh = gh->next) - if (!memcmp(md5, gh->checksum, 16)) // another ghost in the game already has this checksum? - { // Don't add another one, then! - CONS_Debug(DBG_SETUP, "Rejecting duplicate ghost %s (MD5 was matched)\n", pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } - if (memcmp(p, "PLAY", 4)) - { - CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Demo format unacceptable.\n"), pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } p += 4; // "PLAY" - if (ghostversion <= 0x0008) - p++; // gamemap - else - p += 2; // gamemap - p += 16; // mapmd5 (possibly check for consistency?) - flags = READUINT8(p); - if (!(flags & DF_GHOST)) - { - CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: No ghost data in this demo.\n"), pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } - switch ((flags & DF_ATTACKMASK)>>DF_ATTACKSHIFT) - { - case ATTACKING_NONE: // 0 - break; - case ATTACKING_RECORD: // 1 - p += 10; // demo time, score, and rings - break; - case ATTACKING_NIGHTS: // 2 - p += 8; // demo time left, score - break; - default: // 3 - break; - } - - p += 4; // random seed - - // Player name (TODO: Display this somehow if it doesn't match cv_playername!) - M_Memcpy(name, p,16); - p += 16; - - // Skin - M_Memcpy(skin, p,16); - p += 16; - - // Color - M_Memcpy(color, p,16); - p += 16; - - // Ghosts do not have a player structure to put this in. - p++; // charability - p++; // charability2 - p++; // actionspd - p++; // mindash - p++; // maxdash - p++; // normalspeed - p++; // runspeed - p++; // thrustfactor - p++; // accelstart - p++; // acceleration - p++; // height - p++; // spinheight - p++; // camerascale - p++; // shieldscale - p += 4; // jumpfactor - p += 4; // followitem - - p++; // pflag data - - // net var data - count = READUINT16(p); - while (count--) - { - p += 2; - SKIPSTRING(p); - p++; - } - - if (*p == DEMOMARKER) - { - CONS_Alert(CONS_NOTICE, M_GetText("Failed to add ghost %s: Replay is empty.\n"), pdemoname); - Z_Free(pdemoname); - Z_Free(buffer); - return; - } - - gh = Z_Calloc(sizeof(demoghost), PU_LEVEL, NULL); - gh->next = ghosts; - gh->buffer = buffer; - M_Memcpy(gh->checksum, md5, 16); - gh->p = p; - - ghosts = gh; - - gh->version = ghostversion; - mthing = playerstarts[0]; - I_Assert(mthing); - { // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling. - fixed_t z,f,c; - fixed_t offset = mthing->z << FRACBITS; - gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST); - gh->mo->angle = FixedAngle(mthing->angle << FRACBITS); - f = gh->mo->floorz; - c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height; - if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP)) - { - z = c - offset; - if (z < f) - z = f; - } - else - { - z = f + offset; - if (z > c) - z = c; - } - gh->mo->z = z; - } - - gh->oldmo.x = gh->mo->x; - gh->oldmo.y = gh->mo->y; - gh->oldmo.z = gh->mo->z; - - // Set skin - gh->mo->skin = &skins[0]; - for (i = 0; i < numskins; i++) - if (!stricmp(skins[i].name,skin)) - { - gh->mo->skin = &skins[i]; - break; - } - gh->oldmo.skin = gh->mo->skin; - - // Set color - gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor; - for (i = 0; i < MAXSKINCOLORS; i++) - if (!stricmp(Color_Names[i],color)) - { - gh->mo->color = (UINT8)i; - break; - } - gh->oldmo.color = gh->mo->color; - - gh->mo->state = states+S_PLAY_STND; - gh->mo->sprite = gh->mo->state->sprite; - gh->mo->sprite2 = (gh->mo->state->frame & FF_FRAMEMASK); - //gh->mo->frame = tr_trans30<mo->flags2 |= MF2_DONTDRAW; - gh->fadein = (9-3)*6; // fade from invisible to trans30 over as close to 35 tics as possible - gh->mo->tics = -1; - - CONS_Printf(M_GetText("Added ghost %s from %s\n"), name, pdemoname); - Z_Free(pdemoname); -} - -// -// G_TimeDemo -// NOTE: name is a full filename for external demos -// -static INT32 restorecv_vidwait; - -void G_TimeDemo(const char *name) -{ - nodrawers = M_CheckParm("-nodraw"); - noblit = M_CheckParm("-noblit"); - restorecv_vidwait = cv_vidwait.value; - if (cv_vidwait.value) - CV_Set(&cv_vidwait, "0"); - timingdemo = true; - singletics = true; - framecount = 0; - demostarttime = I_GetTime(); - G_DeferedPlayDemo(name); -} - -void G_DoPlayMetal(void) -{ - lumpnum_t l; - mobj_t *mo = NULL; - thinker_t *th; - - // it's an internal demo - if ((l = W_CheckNumForName(va("%sMS",G_BuildMapName(gamemap)))) == LUMPERROR) - { - CONS_Alert(CONS_WARNING, M_GetText("No bot recording for this map.\n")); - return; - } - else - metalbuffer = metal_p = W_CacheLumpNum(l, PU_STATIC); - - // find metal sonic - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - - mo = (mobj_t *)th; - if (mo->type != MT_METALSONIC_RACE) - continue; - - break; - } - if (th == &thlist[THINK_MOBJ]) - { - CONS_Alert(CONS_ERROR, M_GetText("Failed to find bot entity.\n")); - Z_Free(metalbuffer); - return; - } - - // read demo header - metal_p += 12; // DEMOHEADER - metal_p++; // VERSION - metal_p++; // SUBVERSION - metalversion = READUINT16(metal_p); - switch(metalversion) - { - case DEMOVERSION: // latest always supported - break; - // too old, cannot support. - default: - CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, format version incompatible.\n")); - Z_Free(metalbuffer); - return; - } - metal_p += 16; // demo checksum - if (memcmp(metal_p, "METL", 4)) - { - CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, wasn't recorded in Metal format.\n")); - Z_Free(metalbuffer); - return; - } metal_p += 4; // "METL" - - // read initial tic - memset(&oldmetal,0,sizeof(oldmetal)); - oldmetal.x = mo->x; - oldmetal.y = mo->y; - oldmetal.z = mo->z; - metalplayback = mo; -} - -void G_DoneLevelLoad(void) -{ - CONS_Printf(M_GetText("Loaded level in %f sec\n"), (double)(I_GetTime() - demostarttime) / TICRATE); - framecount = 0; - demostarttime = I_GetTime(); -} - -/* -=================== -= -= G_CheckDemoStatus -= -= Called after a death or level completion to allow demos to be cleaned up -= Returns true if a new demo loop action will take place -=================== -*/ - -// Stops metal sonic's demo. Separate from other functions because metal + replays can coexist -void G_StopMetalDemo(void) -{ - - // Metal Sonic finishing doesn't end the game, dammit. - Z_Free(metalbuffer); - metalbuffer = NULL; - metalplayback = NULL; - metal_p = NULL; -} - -// Stops metal sonic recording. -ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill) -{ - boolean saved = false; - if (demo_p) - { - UINT8 *p = demobuffer+16; // checksum position - if (kill) - WRITEUINT8(demo_p, METALDEATH); // add the metal death marker - else - WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker -#ifdef NOMD5 - { - UINT8 i; - for (i = 0; i < 16; i++, p++) - *p = P_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct. - } -#else - md5_buffer((char *)p+16, demo_p - (p+16), (void *)p); // make a checksum of everything after the checksum in the file. -#endif - saved = FIL_WriteFile(va("%sMS.LMP", G_BuildMapName(gamemap)), demobuffer, demo_p - demobuffer); // finally output the file. - } - free(demobuffer); - metalrecording = false; - if (saved) - I_Error("Saved to %sMS.LMP", G_BuildMapName(gamemap)); - I_Error("Failed to save demo!"); -} - -// reset engine variable set for the demos -// called from stopdemo command, map command, and g_checkdemoStatus. -void G_StopDemo(void) -{ - Z_Free(demobuffer); - demobuffer = NULL; - demoplayback = false; - titledemo = false; - timingdemo = false; - singletics = false; - - if (gamestate == GS_INTERMISSION) - Y_EndIntermission(); // cleanup - - G_SetGamestate(GS_NULL); - wipegamestate = GS_NULL; - SV_StopServer(); - SV_ResetServer(); -} - -boolean G_CheckDemoStatus(void) -{ - boolean saved; - - while (ghosts) - { - demoghost *next = ghosts->next; - Z_Free(ghosts); - ghosts = next; - } - ghosts = NULL; - - - // DO NOT end metal sonic demos here - - if (timingdemo) - { - INT32 demotime; - double f1, f2; - demotime = I_GetTime() - demostarttime; - if (!demotime) - return true; - G_StopDemo(); - timingdemo = false; - f1 = (double)demotime; - f2 = (double)framecount*TICRATE; - - CONS_Printf(M_GetText("timed %u gametics in %d realtics - %u frames\n%f seconds, %f avg fps\n"), - leveltime,demotime,(UINT32)framecount,f1/TICRATE,f2/f1); - - // CSV-readable timedemo results, for external parsing - if (timedemo_csv) - { - FILE *f; - const char *csvpath = va("%s"PATHSEP"%s", srb2home, "timedemo.csv"); - const char *header = "id,demoname,seconds,avgfps,leveltime,demotime,framecount,ticrate,rendermode,vidmode,vidwidth,vidheight,procbits\n"; - const char *rowformat = "\"%s\",\"%s\",%f,%f,%u,%d,%u,%u,%u,%u,%u,%u,%u\n"; - boolean headerrow = !FIL_FileExists(csvpath); - UINT8 procbits = 0; - - // Bitness - if (sizeof(void*) == 4) - procbits = 32; - else if (sizeof(void*) == 8) - procbits = 64; - - f = fopen(csvpath, "a+"); - - if (f) - { - if (headerrow) - fputs(header, f); - fprintf(f, rowformat, - timedemo_csv_id,timedemo_name,f1/TICRATE,f2/f1,leveltime,demotime,(UINT32)framecount,TICRATE,rendermode,vid.modenum,vid.width,vid.height,procbits); - fclose(f); - CONS_Printf("Timedemo results saved to '%s'\n", csvpath); - } - else - { - // Just print the CSV output to console - CON_LogMessage(header); - CONS_Printf(rowformat, - timedemo_csv_id,timedemo_name,f1/TICRATE,f2/f1,leveltime,demotime,(UINT32)framecount,TICRATE,rendermode,vid.modenum,vid.width,vid.height,procbits); - } - } - - if (restorecv_vidwait != cv_vidwait.value) - CV_SetValue(&cv_vidwait, restorecv_vidwait); - D_AdvanceDemo(); - return true; - } - - if (demoplayback) - { - if (singledemo) - I_Quit(); - G_StopDemo(); - - if (modeattacking) - M_EndModeAttackRun(); - else - D_AdvanceDemo(); - - return true; - } - - if (demorecording) - { - UINT8 *p = demobuffer+16; // checksum position -#ifdef NOMD5 - UINT8 i; - WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker - for (i = 0; i < 16; i++, p++) - *p = P_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct. -#else - WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker - md5_buffer((char *)p+16, demo_p - (p+16), p); // make a checksum of everything after the checksum in the file. -#endif - saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file. - free(demobuffer); - demorecording = false; - - if (modeattacking != ATTACKING_RECORD) - { - if (saved) - CONS_Printf(M_GetText("Demo %s recorded\n"), demoname); - else - CONS_Alert(CONS_WARNING, M_GetText("Demo %s not saved\n"), demoname); - } - return true; - } - - return false; -} - // // G_SetGamestate // diff --git a/src/g_game.h b/src/g_game.h index c4c40d84b..b4216a001 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -17,6 +17,7 @@ #include "doomdef.h" #include "doomstat.h" #include "d_event.h" +#include "g_demo.h" extern char gamedatafilename[64]; extern char timeattackfolder[64]; @@ -31,21 +32,6 @@ extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1]; extern player_t players[MAXPLAYERS]; extern boolean playeringame[MAXPLAYERS]; -// ====================================== -// DEMO playback/recording related stuff. -// ====================================== - -// demoplaying back and demo recording -extern boolean demoplayback, titledemo, demorecording, timingdemo; -extern tic_t demostarttime; - -// Quit after playing a demo from cmdline. -extern boolean singledemo; -extern boolean demo_start; -extern boolean demosynced; - -extern mobj_t *metalplayback; - // gametic at level start extern tic_t levelstarttic; @@ -173,7 +159,6 @@ void G_DoLoadLevel(boolean resetplayer); void G_StartTitleCard(void); void G_PreLevelTitleCard(void); boolean G_IsTitleCardAvailable(void); -void G_DeferedPlayDemo(const char *demo); // Can be called by the startup code or M_Responder, calls P_SetupLevel. void G_LoadGame(UINT32 slot, INT16 mapoverride); @@ -184,54 +169,6 @@ void G_SaveGame(UINT32 slot); void G_SaveGameOver(UINT32 slot, boolean modifylives); -// Only called by startup code. -void G_RecordDemo(const char *name); -void G_RecordMetal(void); -void G_BeginRecording(void); -void G_BeginMetal(void); - -// Only called by shutdown code. -void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings); -UINT8 G_CmpDemoTime(char *oldname, char *newname); - -typedef enum -{ - GHC_NORMAL = 0, - GHC_SUPER, - GHC_FIREFLOWER, - GHC_INVINCIBLE, - GHC_NIGHTSSKIN, // not actually a colour - GHC_RETURNSKIN // ditto -} ghostcolor_t; - -// Record/playback tics -void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum); -void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum); -void G_GhostAddThok(void); -void G_GhostAddSpin(void); -void G_GhostAddRev(void); -void G_GhostAddColor(ghostcolor_t color); -void G_GhostAddFlip(void); -void G_GhostAddScale(fixed_t scale); -void G_GhostAddHit(mobj_t *victim); -void G_WriteGhostTic(mobj_t *ghost); -void G_ConsGhostTic(void); -void G_GhostTicker(void); -void G_ReadMetalTic(mobj_t *metal); -void G_WriteMetalTic(mobj_t *metal); -void G_SaveMetal(UINT8 **buffer); -void G_LoadMetal(UINT8 **buffer); - -void G_DoPlayDemo(char *defdemoname); -void G_TimeDemo(const char *name); -void G_AddGhost(char *defdemoname); -void G_DoPlayMetal(void); -void G_DoneLevelLoad(void); -void G_StopMetalDemo(void); -ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill); -void G_StopDemo(void); -boolean G_CheckDemoStatus(void); - extern UINT32 gametypedefaultrules[NUMGAMETYPES]; extern UINT32 gametypetol[NUMGAMETYPES]; extern INT16 gametyperankings[NUMGAMETYPES]; From 1a142340884f9a4216a845c7482e6acd2e0aecf4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 19 Mar 2020 20:13:39 +0000 Subject: [PATCH 35/47] update Makefile, CMakeLists.txt and MSVC project files --- src/CMakeLists.txt | 2 ++ src/Makefile | 1 + src/sdl/Srb2SDL-vc10.vcxproj | 2 ++ src/sdl/Srb2SDL-vc10.vcxproj.filters | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc4a6114e..e1e7689a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,6 +16,7 @@ set(SRB2_CORE_SOURCES f_finale.c f_wipe.c filesrch.c + g_demo.c g_game.c g_input.c hu_stuff.c @@ -71,6 +72,7 @@ set(SRB2_CORE_HEADERS f_finale.h fastcmp.h filesrch.h + g_demo.h g_game.h g_input.h g_state.h diff --git a/src/Makefile b/src/Makefile index 701f2cfda..43cf48905 100644 --- a/src/Makefile +++ b/src/Makefile @@ -424,6 +424,7 @@ OBJS:=$(i_main_o) \ $(OBJDIR)/z_zone.o \ $(OBJDIR)/f_finale.o \ $(OBJDIR)/f_wipe.o \ + $(OBJDIR)/g_demo.o \ $(OBJDIR)/g_game.o \ $(OBJDIR)/g_input.o \ $(OBJDIR)/am_map.o \ diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 7e260f4c0..6335b3028 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -213,6 +213,7 @@ + @@ -364,6 +365,7 @@ + diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index 21820551a..a226e8397 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -180,6 +180,9 @@ F_Frame + + G_Game + G_Game @@ -600,6 +603,9 @@ F_Frame + + G_Game + G_Game From dd76be16cbe6cfe075376fff1b358e1e57d305b2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 19 Mar 2020 20:42:51 +0000 Subject: [PATCH 36/47] Create G_FreeGhosts, for the benefit of G_DeferedInitNew (assuming it actually needs to do `ghosts = NULL;` at all) --- src/g_demo.c | 21 +++++++++++++-------- src/g_demo.h | 1 + src/g_game.c | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 22cd34ad5..9adafae54 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -2223,6 +2223,18 @@ void G_AddGhost(char *defdemoname) Z_Free(pdemoname); } +// Clean up all ghosts +void G_FreeGhosts(void) +{ + while (ghosts) + { + demoghost *next = ghosts->next; + Z_Free(ghosts); + ghosts = next; + } + ghosts = NULL; +} + // // G_TimeDemo // NOTE: name is a full filename for external demos @@ -2389,14 +2401,7 @@ boolean G_CheckDemoStatus(void) { boolean saved; - while (ghosts) - { - demoghost *next = ghosts->next; - Z_Free(ghosts); - ghosts = next; - } - ghosts = NULL; - + G_FreeGhosts(); // DO NOT end metal sonic demos here diff --git a/src/g_demo.h b/src/g_demo.h index 89be6e343..df25042c4 100644 --- a/src/g_demo.h +++ b/src/g_demo.h @@ -75,6 +75,7 @@ void G_DeferedPlayDemo(const char *demo); void G_DoPlayDemo(char *defdemoname); void G_TimeDemo(const char *name); void G_AddGhost(char *defdemoname); +void G_FreeGhosts(void); void G_DoPlayMetal(void); void G_DoneLevelLoad(void); void G_StopMetalDemo(void); diff --git a/src/g_game.c b/src/g_game.c index fb70e2995..e22961b9a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4490,7 +4490,7 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, b if (demoplayback) COM_BufAddText("stopdemo\n"); - ghosts = NULL; + G_FreeGhosts(); // TODO: do we actually need to do this? // this leave the actual game if needed SV_StartSinglePlayerServer(); From 6610150bfeb11796cacad3d6453ab98030f1cd4b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 19 Mar 2020 20:43:56 +0000 Subject: [PATCH 37/47] We definitely don't need these files to compile! --- src/g_demo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 9adafae54..c589482b6 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -16,14 +16,12 @@ #include "d_main.h" #include "d_player.h" #include "d_clisrv.h" -//#include "f_finale.h" #include "p_setup.h" #include "i_system.h" #include "m_random.h" #include "p_local.h" #include "r_draw.h" #include "r_main.h" -//#include "s_sound.h" #include "g_game.h" #include "g_demo.h" #include "m_cheat.h" From 4236ae7c083f388d0c184c165a724ade3560f242 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 19 Mar 2020 21:10:23 +0000 Subject: [PATCH 38/47] We don't need m_cheat.h either in g_demo.c --- src/g_demo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/g_demo.c b/src/g_demo.c index c589482b6..199f7d68e 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -24,7 +24,6 @@ #include "r_main.h" #include "g_game.h" #include "g_demo.h" -#include "m_cheat.h" #include "m_misc.h" #include "m_menu.h" #include "m_argv.h" From 5eaa73b6ac8194a17a6af54f46fd7a2b7be46746 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Thu, 19 Mar 2020 19:09:34 -0300 Subject: [PATCH 39/47] Fix lib_setSpriteInfo indexes being off-by-one --- src/lua_infolib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 6760b4203..d099b24a9 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -389,10 +389,7 @@ static int lib_setSpriteInfo(lua_State *L) lua_Integer i = 0; const char *str = NULL; if (lua_isnumber(L, 2)) - { i = lua_tointeger(L, 2); - i++; // shift index in case of missing rotsprite support - } else str = luaL_checkstring(L, 2); From 78ec210896d2afffccbb17557510923f3ab8723f Mon Sep 17 00:00:00 2001 From: fickleheart Date: Thu, 19 Mar 2020 18:55:10 -0500 Subject: [PATCH 40/47] hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh --- src/m_menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 3ebaedca2..6047bada9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5405,9 +5405,10 @@ static void M_HandleLevelPlatter(INT32 choice) case KEY_LEFTARROW: if (levellistmode == LLM_CREATESERVER && !lsrow) { + INT32 startinggametype = cv_newgametype.value; do CV_AddValue(&cv_newgametype, -1); - while (!M_GametypeHasLevels(cv_newgametype.value)); + while (cv_newgametype.value != startinggametype && !M_GametypeHasLevels(cv_newgametype.value)); S_StartSound(NULL,sfx_menu1); lscol = 0; From 892a8dd6e7832d2f3139b7315946b953d2ce3daf Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 20 Mar 2020 18:55:29 +0100 Subject: [PATCH 41/47] Make SRB2 flat like Earth --- src/am_map.c | 33 +--- src/dehacked.c | 3 +- src/doomdef.h | 5 - src/hardware/hw_main.c | 305 ++---------------------------- src/hardware/hw_trick.c | 4 - src/lua_baselib.c | 6 - src/lua_libs.h | 2 - src/lua_maplib.c | 26 --- src/lua_mobjlib.c | 8 - src/lua_script.c | 10 - src/m_cheat.c | 24 --- src/p_enemy.c | 5 - src/p_floor.c | 4 - src/p_local.h | 4 - src/p_map.c | 85 +-------- src/p_maputl.c | 28 --- src/p_maputl.h | 2 - src/p_mobj.c | 208 +++++--------------- src/p_mobj.h | 2 - src/p_saveg.c | 26 +-- src/p_setup.c | 6 - src/p_sight.c | 24 --- src/p_slopes.c | 5 - src/p_slopes.h | 3 - src/p_spec.c | 10 +- src/p_user.c | 93 +-------- src/r_bsp.c | 136 +++----------- src/r_defs.h | 10 - src/r_draw.c | 2 - src/r_draw.h | 6 - src/r_draw8.c | 2 - src/r_draw8_npo2.c | 5 - src/r_main.c | 2 - src/r_plane.c | 40 +--- src/r_plane.h | 9 +- src/r_segs.c | 407 +++------------------------------------- src/r_things.c | 29 +-- src/screen.c | 4 - src/screen.h | 2 - 39 files changed, 153 insertions(+), 1432 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 234df1abd..cdbaaf80a 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -920,10 +920,8 @@ static inline void AM_drawWalls(void) { size_t i; static mline_t l; -#ifdef ESLOPE fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends -#endif for (i = 0; i < numlines; i++) { @@ -931,7 +929,7 @@ static inline void AM_drawWalls(void) l.a.y = lines[i].v1->y >> FRACTOMAPBITS; l.b.x = lines[i].v2->x >> FRACTOMAPBITS; l.b.y = lines[i].v2->y >> FRACTOMAPBITS; -#ifdef ESLOPE + #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \ @@ -946,7 +944,6 @@ static inline void AM_drawWalls(void) SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight) } #undef SLOPEPARAMS -#endif if (!lines[i].backsector) // 1-sided { @@ -955,19 +952,11 @@ static inline void AM_drawWalls(void) else AM_drawMline(&l, WALLCOLORS); } -#ifdef ESLOPE else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier || (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier { if (backf1 == backc1 && backf2 == backc2 && frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers -#else - else if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight // Back is thok barrier - || lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // Front is thok barrier - { - if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight - && lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // BOTH are thok barriers -#endif { if (lines[i].flags & ML_NOCLIMB) AM_drawMline(&l, NOCLIMBTSWALLCOLORS); @@ -985,20 +974,10 @@ static inline void AM_drawWalls(void) else { if (lines[i].flags & ML_NOCLIMB) { -#ifdef ESLOPE if (backf1 != frontf1 || backf2 != frontf2) { -#else - if (lines[i].backsector->floorheight - != lines[i].frontsector->floorheight) { -#endif AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change } -#ifdef ESLOPE else if (backc1 != frontc1 || backc2 != frontc2) { -#else - else if (lines[i].backsector->ceilingheight - != lines[i].frontsector->ceilingheight) { -#endif AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change } else @@ -1006,20 +985,10 @@ static inline void AM_drawWalls(void) } else { -#ifdef ESLOPE if (backf1 != frontf1 || backf2 != frontf2) { -#else - if (lines[i].backsector->floorheight - != lines[i].frontsector->floorheight) { -#endif AM_drawMline(&l, FDWALLCOLORS); // floor level change } -#ifdef ESLOPE else if (backc1 != frontc1 || backc2 != frontc2) { -#else - else if (lines[i].backsector->ceilingheight - != lines[i].frontsector->ceilingheight) { -#endif AM_drawMline(&l, CDWALLCOLORS); // ceiling level change } else diff --git a/src/dehacked.c b/src/dehacked.c index 588b78142..c6cd0b9e5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9678,11 +9678,10 @@ struct { // Node flags {"NF_SUBSECTOR",NF_SUBSECTOR}, // Indicate a leaf. #endif -#ifdef ESLOPE + // Slope flags {"SL_NOPHYSICS",SL_NOPHYSICS}, {"SL_DYNAMIC",SL_DYNAMIC}, -#endif // Angles {"ANG1",ANG1}, diff --git a/src/doomdef.h b/src/doomdef.h index 71c885019..2ed66aecc 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -562,14 +562,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; // None of these that are disabled in the normal build are guaranteed to work perfectly // Compile them at your own risk! -/// Kalaron/Eternity Engine slope code (SRB2CB ported) -#define ESLOPE - -#ifdef ESLOPE /// Backwards compatibility with SRB2CB's slope linedef types. /// \note A simple shim that prints a warning. #define ESLOPE_TYPESHIM -#endif /// Allows the use of devmode in multiplayer. AKA "fishcake" //#define NETGAME_DEVMODE diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index efed9b602..c56f0ec06 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -42,9 +42,7 @@ #include "../m_cheat.h" #include "../f_finale.h" #include "../r_things.h" // R_GetShadowZ -#ifdef ESLOPE #include "../p_slopes.h" -#endif #include "hw_md2.h" #ifdef NEWCLIP @@ -486,9 +484,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is angle_t angle = 0; FSurfaceInfo Surf; fixed_t tempxsow, tempytow; -#ifdef ESLOPE pslope_t *slope = NULL; -#endif static FOutVector *planeVerts = NULL; static UINT16 numAllocedPlaneVerts = 0; @@ -499,7 +495,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is if (!xsub->planepoly) return; -#ifdef ESLOPE // Get the slope pointer to simplify future code if (FOFsector) { @@ -519,7 +514,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is // Set fixedheight to the slope's height from our viewpoint, if we have a slope if (slope) fixedheight = P_GetZAt(slope, viewx, viewy); -#endif height = FIXED_TO_FLOAT(fixedheight); @@ -669,13 +663,11 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is v3d->y = height; v3d->z = pv->y; -#ifdef ESLOPE if (slope) { fixedheight = P_GetZAt(slope, FLOAT_TO_FIXED(pv->x), FLOAT_TO_FIXED(pv->y)); v3d->y = FIXED_TO_FLOAT(fixedheight); } -#endif } // only useful for flat coloured triangles @@ -693,10 +685,8 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { sector_t *psector = gr_frontsector; -#ifdef ESLOPE if (slope) fixedheight = P_GetZAt(slope, psector->soundorg.x, psector->soundorg.y); -#endif if (psector->ffloors) { @@ -1068,7 +1058,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, float pegt, pegb, pegmul; float height = 0.0f, bheight = 0.0f; -#ifdef ESLOPE float endrealtop, endrealbot, endtop, endbot; float endpegt, endpegb, endpegmul; float endheight = 0.0f, endbheight = 0.0f; @@ -1076,7 +1065,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // use this as a temp var to store P_GetZAt's return value each time fixed_t temp; -#endif fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x); fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo @@ -1095,23 +1083,18 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, pegb = wallVerts[0].t; pegmul = (pegb - pegt) / (top - bot); -#ifdef ESLOPE endrealtop = endtop = wallVerts[2].y; endrealbot = endbot = wallVerts[1].y; endpegt = wallVerts[2].t; endpegb = wallVerts[1].t; endpegmul = (endpegb - endpegt) / (endtop - endbot); -#endif for (i = 0; i < sector->numlights; i++) { -#ifdef ESLOPE - if (endtop < endrealbot) -#endif - if (top < realbot) + if (endtop < endrealbot && top < realbot) return; - // There's a compiler warning here if this comment isn't here because of indentation + // There's a compiler warning here if this comment isn't here because of indentation if (!(list[i].flags & FF_NOSHADE)) { if (pfloor && (pfloor->flags & FF_FOG)) @@ -1143,7 +1126,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, else solid = false; -#ifdef ESLOPE if (list[i].slope) { temp = P_GetZAt(list[i].slope, v1x, v1y); @@ -1165,26 +1147,15 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, else bheight = endbheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight); } -#else - height = FIXED_TO_FLOAT(list[i].height); - if (solid) - bheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight); -#endif -#ifdef ESLOPE - if (endheight >= endtop) -#endif - if (height >= top) + if (endheight >= endtop && height >= top) { if (solid && top > bheight) top = bheight; -#ifdef ESLOPE if (solid && endtop > endbheight) endtop = endbheight; -#endif } -#ifdef ESLOPE if (i + 1 < sector->numlights) { if (list[i+1].slope) @@ -1202,21 +1173,8 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, bheight = realbot; endbheight = endrealbot; } -#else - if (i + 1 < sector->numlights) - { - bheight = FIXED_TO_FLOAT(list[i+1].height); - } - else - { - bheight = realbot; - } -#endif -#ifdef ESLOPE - if (endbheight >= endtop) -#endif - if (bheight >= top) + if (endbheight >= endtop && bheight >= top) continue; //Found a break; @@ -1225,15 +1183,12 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, if (bot < realbot) bot = realbot; -#ifdef ESLOPE endbot = endbheight; if (endbot < endrealbot) endbot = endrealbot; -#endif Surf->FlatColor.s.alpha = alpha; -#ifdef ESLOPE wallVerts[3].t = pegt + ((realtop - top) * pegmul); wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul); wallVerts[0].t = pegt + ((realtop - bot) * pegmul); @@ -1244,14 +1199,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul); - wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul); - - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (cutflag & FF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); @@ -1261,22 +1208,16 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, HWR_ProjectWall(wallVerts, Surf, PF_Masked, lightnum, colormap); top = bot; -#ifdef ESLOPE endtop = endbot; -#endif } bot = realbot; -#ifdef ESLOPE endbot = endrealbot; - if (endtop <= endrealbot) -#endif - if (top <= realbot) + if (endtop <= endrealbot && top <= realbot) return; Surf->FlatColor.s.alpha = alpha; -#ifdef ESLOPE wallVerts[3].t = pegt + ((realtop - top) * pegmul); wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul); wallVerts[0].t = pegt + ((realtop - bot) * pegmul); @@ -1287,14 +1228,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul); - wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul); - - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (cutflag & FF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); @@ -1339,19 +1272,15 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) fixed_t worldtop, worldbottom; fixed_t worldhigh = 0, worldlow = 0; -#ifdef ESLOPE fixed_t worldtopslope, worldbottomslope; fixed_t worldhighslope = 0, worldlowslope = 0; fixed_t v1x, v1y, v2x, v2y; -#endif GLTexture_t *grTex = NULL; float cliplow = 0.0f, cliphigh = 0.0f; INT32 gr_midtexture; fixed_t h, l; // 3D sides and 2s middle textures -#ifdef ESLOPE fixed_t hS, lS; -#endif FUINT lightnum = 0; // shut up compiler extracolormap_t *colormap; @@ -1370,13 +1299,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) ve.x = ((polyvertex_t *)gr_curline->pv2)->x; ve.y = ((polyvertex_t *)gr_curline->pv2)->y; -#ifdef ESLOPE v1x = FLOAT_TO_FIXED(vs.x); v1y = FLOAT_TO_FIXED(vs.y); v2x = FLOAT_TO_FIXED(ve.x); v2y = FLOAT_TO_FIXED(ve.y); -#endif -#ifdef ESLOPE #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ @@ -1387,10 +1313,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) SLOPEPARAMS(gr_frontsector->c_slope, worldtop, worldtopslope, gr_frontsector->ceilingheight) SLOPEPARAMS(gr_frontsector->f_slope, worldbottom, worldbottomslope, gr_frontsector->floorheight) -#else - worldtop = gr_frontsector->ceilingheight; - worldbottom = gr_frontsector->floorheight; -#endif // remember vertices ordering // 3--2 @@ -1440,14 +1362,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) boolean bothceilingssky = false; // turned on if both back and front ceilings are sky boolean bothfloorssky = false; // likewise, but for floors -#ifdef ESLOPE SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight) SLOPEPARAMS(gr_backsector->f_slope, worldlow, worldlowslope, gr_backsector->floorheight) #undef SLOPEPARAMS -#else - worldhigh = gr_backsector->ceilingheight; - worldlow = gr_backsector->floorheight; -#endif // hack to allow height changes in outdoor areas // This is what gets rid of the upper textures if there should be sky @@ -1470,12 +1387,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) gr_bottomtexture = R_GetTextureNum(gr_sidedef->bottomtexture); // check TOP TEXTURE - if (( -#ifdef ESLOPE - worldhighslope < worldtopslope || -#endif - worldhigh < worldtop - ) && gr_toptexture) + if ((worldhighslope < worldtopslope || worldhigh < worldtop) && gr_toptexture) { { fixed_t texturevpegtop; // top @@ -1485,15 +1397,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) // PEGGING if (gr_linedef->flags & ML_DONTPEGTOP) texturevpegtop = 0; -#ifdef ESLOPE else if (gr_linedef->flags & ML_EFFECT1) texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop; else texturevpegtop = gr_backsector->ceilingheight + textureheight[gr_sidedef->toptexture] - gr_frontsector->ceilingheight; -#else - else - texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop; -#endif texturevpegtop += gr_sidedef->rowoffset; @@ -1505,7 +1412,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Adjust t value for sloped walls if (!(gr_linedef->flags & ML_EFFECT1)) { @@ -1528,19 +1434,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[3].t = wallVerts[0].t - (worldtop - worldhigh) * grTex->scaleY; wallVerts[2].t = wallVerts[1].t - (worldtopslope - worldhighslope) * grTex->scaleY; } -#endif } // set top/bottom coords -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldtop); wallVerts[0].y = FIXED_TO_FLOAT(worldhigh); wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope); wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldhigh); -#endif if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_toptexture, &Surf, FF_CUTLEVEL, NULL); @@ -1552,9 +1452,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) // check BOTTOM TEXTURE if (( -#ifdef ESLOPE worldlowslope > worldbottomslope || -#endif worldlow > worldbottom) && gr_bottomtexture) //only if VISIBLE!!! { { @@ -1563,19 +1461,12 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) grTex = HWR_GetTexture(gr_bottomtexture); // PEGGING -#ifdef ESLOPE if (!(gr_linedef->flags & ML_DONTPEGBOTTOM)) texturevpegbottom = 0; else if (gr_linedef->flags & ML_EFFECT1) texturevpegbottom = worldbottom - worldlow; else texturevpegbottom = gr_frontsector->floorheight - gr_backsector->floorheight; -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) - texturevpegbottom = worldbottom - worldlow; - else - texturevpegbottom = 0; -#endif texturevpegbottom += gr_sidedef->rowoffset; @@ -1587,7 +1478,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Adjust t value for sloped walls if (!(gr_linedef->flags & ML_EFFECT1)) { @@ -1610,19 +1500,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY; wallVerts[1].t = (texturevpegbottom + worldlowslope - worldbottomslope) * grTex->scaleY; } -#endif } // set top/bottom coords -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldlow); wallVerts[0].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldlowslope); wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldlow); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom); -#endif if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_bottomtexture, &Surf, FF_CUTLEVEL, NULL); @@ -1692,16 +1576,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) else #endif { -#ifdef ESLOPE popentop = min(worldtop, worldhigh); popenbottom = max(worldbottom, worldlow); -#else - popentop = min(front->ceilingheight, back->ceilingheight); - popenbottom = max(front->floorheight, back->floorheight); -#endif } -#ifdef ESLOPE if (gr_linedef->flags & ML_EFFECT2) { if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) @@ -1716,9 +1594,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) } } else if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) -#endif { polybottom = popenbottom + gr_sidedef->rowoffset; polytop = polybottom + textureheight[gr_midtexture]*repeats; @@ -1750,11 +1625,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { // PEGGING -#ifdef ESLOPE if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) -#endif texturevpeg = textureheight[gr_sidedef->midtexture]*repeats - h + polybottom; else texturevpeg = polytop - h; @@ -1773,7 +1644,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#ifdef ESLOPE // Correct to account for slopes { fixed_t midtextureslant; @@ -1816,7 +1686,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(h); wallVerts[1].y = FIXED_TO_FLOAT(l); } -#endif // set alpha for transparent walls (new boom and legacy linedef types) // ooops ! this do not work at all because render order we should render it in backtofront order @@ -1918,12 +1787,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (gr_backsector->ceilingpic != skyflatnum) // don't cull if back sector is also sky { wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space -#ifdef ESLOPE wallVerts[0].y = FIXED_TO_FLOAT(worldtop); wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope); -#else - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop); -#endif HWR_DrawSkyWall(wallVerts, &Surf); } } @@ -1932,12 +1797,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { if (gr_backsector->floorpic != skyflatnum) // don't cull if back sector is also sky { -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); -#endif wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space HWR_DrawSkyWall(wallVerts, &Surf); } @@ -1954,12 +1815,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { fixed_t texturevpeg; // PEGGING -#ifdef ESLOPE if ((gr_linedef->flags & (ML_DONTPEGBOTTOM|ML_EFFECT2)) == (ML_DONTPEGBOTTOM|ML_EFFECT2)) texturevpeg = gr_frontsector->floorheight + textureheight[gr_sidedef->midtexture] - gr_frontsector->ceilingheight + gr_sidedef->rowoffset; - else -#endif - if (gr_linedef->flags & ML_DONTPEGBOTTOM) + else if (gr_linedef->flags & ML_DONTPEGBOTTOM) texturevpeg = worldbottom + textureheight[gr_sidedef->midtexture] - worldtop + gr_sidedef->rowoffset; else // top of texture at top @@ -1972,7 +1830,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Texture correction for slopes if (gr_linedef->flags & ML_EFFECT2) { wallVerts[3].t += (gr_frontsector->ceilingheight - worldtop) * grTex->scaleY; @@ -1986,19 +1843,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].t = wallVerts[3].t - (worldbottom-worldtop) * grTex->scaleY; wallVerts[1].t = wallVerts[2].t - (worldbottomslope-worldtopslope) * grTex->scaleY; } -#endif } -#ifdef ESLOPE + //Set textures properly on single sided walls that are sloped wallVerts[3].y = FIXED_TO_FLOAT(worldtop); wallVerts[0].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope); wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); -#else - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom); -#endif + // I don't think that solid walls can use translucent linedef types... if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_midtexture, &Surf, FF_CUTLEVEL, NULL); @@ -2016,22 +1868,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (gr_frontsector->ceilingpic == skyflatnum) // It's a single-sided line with sky for its sector { wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space -#ifdef ESLOPE wallVerts[0].y = FIXED_TO_FLOAT(worldtop); wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope); -#else - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop); -#endif HWR_DrawSkyWall(wallVerts, &Surf); } if (gr_frontsector->floorpic == skyflatnum) { -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); -#endif wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space HWR_DrawSkyWall(wallVerts, &Surf); } @@ -2072,7 +1916,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } -#ifdef ESLOPE h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight; hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight; l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight; @@ -2089,19 +1932,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); -#else - h = *rover->topheight; - l = *rover->bottomheight; - if (h > highcut) - h = highcut; - if (l < lowcut) - l = lowcut; - //Hurdler: HW code starts here - //FIXME: check if peging is correct - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#endif if (rover->flags & FF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; @@ -2113,9 +1943,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { fixed_t texturevpeg; boolean attachtobottom = false; -#ifdef ESLOPE boolean slopeskew = false; // skew FOF walls with slopes? -#endif // Wow, how was this missing from OpenGL for so long? // ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software @@ -2124,22 +1952,17 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { texturevpeg = sides[newline->sidenum[0]].rowoffset; attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM); -#ifdef ESLOPE slopeskew = !!(newline->flags & ML_DONTPEGTOP); -#endif } else { texturevpeg = sides[rover->master->sidenum[0]].rowoffset; attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM); -#ifdef ESLOPE slopeskew = !!(rover->master->flags & ML_DONTPEGTOP); -#endif } grTex = HWR_GetTexture(texnum); -#ifdef ESLOPE if (!slopeskew) // no skewing { if (attachtobottom) @@ -2164,12 +1987,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].t = wallVerts[1].t - (hS - lS) * grTex->scaleY; } } -#else - if (attachtobottom) - texturevpeg -= *rover->topheight - *rover->bottomheight; - wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; -#endif wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; @@ -2238,7 +2055,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) newline = rover->master->frontsector->lines[0] + linenum; texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } -#ifdef ESLOPE //backsides h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight; hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight; l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight; @@ -2255,19 +2071,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); -#else - h = *rover->topheight; - l = *rover->bottomheight; - if (h > highcut) - h = highcut; - if (l < lowcut) - l = lowcut; - //Hurdler: HW code starts here - //FIXME: check if peging is correct - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#endif if (rover->flags & FF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; @@ -2365,7 +2168,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks // GZDoom method of sloped line clipping -#ifdef ESLOPE if (afrontsector->f_slope || afrontsector->c_slope || abacksector->f_slope || abacksector->c_slope) { fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t @@ -2387,7 +2189,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks #undef SLOPEPARAMS } else -#endif { frontf1 = frontf2 = afrontsector->floorheight; frontc1 = frontc2 = afrontsector->ceilingheight; @@ -2928,7 +2729,6 @@ static void HWR_AddLine(seg_t * line) goto clippass; // treat like wide open window instead } -#ifdef ESLOPE if (gr_frontsector->f_slope || gr_frontsector->c_slope || gr_backsector->f_slope || gr_backsector->c_slope) { fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends @@ -2973,7 +2773,6 @@ static void HWR_AddLine(seg_t * line) goto clippass; } else -#endif { // if both ceilings are skies, consider it always "open" // same for floors @@ -3511,7 +3310,6 @@ static void HWR_Subsector(size_t num) cullFloorHeight = locFloorHeight = gr_frontsector->floorheight; cullCeilingHeight = locCeilingHeight = gr_frontsector->ceilingheight; -#ifdef ESLOPE if (gr_frontsector->f_slope) { cullFloorHeight = P_GetZAt(gr_frontsector->f_slope, viewx, viewy); @@ -3523,7 +3321,6 @@ static void HWR_Subsector(size_t num) cullCeilingHeight = P_GetZAt(gr_frontsector->c_slope, viewx, viewy); locCeilingHeight = P_GetZAt(gr_frontsector->c_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } -#endif } // ----- end special tricks ----- @@ -3615,15 +3412,13 @@ static void HWR_Subsector(size_t num) fixed_t cullHeight, centerHeight; // bottom plane -#ifdef ESLOPE if (*rover->b_slope) { cullHeight = P_GetZAt(*rover->b_slope, viewx, viewy); centerHeight = P_GetZAt(*rover->b_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } else -#endif - cullHeight = centerHeight = *rover->bottomheight; + cullHeight = centerHeight = *rover->bottomheight; if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) continue; @@ -3683,15 +3478,13 @@ static void HWR_Subsector(size_t num) } // top plane -#ifdef ESLOPE if (*rover->t_slope) { cullHeight = P_GetZAt(*rover->t_slope, viewx, viewy); centerHeight = P_GetZAt(*rover->t_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } else -#endif - cullHeight = centerHeight = *rover->topheight; + cullHeight = centerHeight = *rover->topheight; if (centerHeight >= locFloorHeight && centerHeight <= locCeilingHeight && @@ -4263,13 +4056,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) float realheight, heightmult; const sector_t *sector = spr->mobj->subsector->sector; const lightlist_t *list = sector->lightlist; -#ifdef ESLOPE float endrealtop, endrealbot, endtop, endbot; float endbheight; float endrealheight; fixed_t temp; fixed_t v1x, v1y, v2x, v2y; -#endif this_scale = FIXED_TO_FLOAT(spr->mobj->scale); @@ -4341,10 +4132,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) towbot = baseWallVerts[0].tow; towmult = (towbot - towtop) / (top - bot); -#ifdef ESLOPE endrealtop = endtop = baseWallVerts[2].y; endrealbot = endbot = baseWallVerts[1].y; -#endif // copy the contents of baseWallVerts into the drawn wallVerts array // baseWallVerts is used to know the final shape to easily get the vertex @@ -4384,7 +4173,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) if (spr->mobj->frame & FF_FULLBRIGHT) lightlevel = 255; -#ifdef ESLOPE for (i = 1; i < sector->numlights; i++) { fixed_t h = sector->lightlist[i].slope ? P_GetZAt(sector->lightlist[i].slope, spr->mobj->x, spr->mobj->y) @@ -4397,19 +4185,10 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) break; } } -#else - i = R_GetPlaneLight(sector, temp, false); - if (!(spr->mobj->frame & FF_FULLBRIGHT)) - lightlevel = *list[i].lightlevel; - colormap = *list[i].extra_colormap; -#endif for (i = 0; i < sector->numlights; i++) { -#ifdef ESLOPE - if (endtop < endrealbot) -#endif - if (top < realbot) + if (endtop < endrealbot && top < realbot) return; // even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite @@ -4420,7 +4199,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) colormap = *list[i].extra_colormap; } -#ifdef ESLOPE if (i + 1 < sector->numlights) { if (list[i+1].slope) @@ -4438,21 +4216,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) bheight = realbot; endbheight = endrealbot; } -#else - if (i + 1 < sector->numlights) - { - bheight = FIXED_TO_FLOAT(list[i+1].height); - } - else - { - bheight = realbot; - } -#endif -#ifdef ESLOPE - if (endbheight >= endtop) -#endif - if (bheight >= top) + if (endbheight >= endtop && bheight >= top) continue; bot = bheight; @@ -4460,14 +4225,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) if (bot < realbot) bot = realbot; -#ifdef ESLOPE endbot = endbheight; if (endbot < endrealbot) endbot = endrealbot; -#endif -#ifdef ESLOPE wallVerts[3].tow = towtop + ((realtop - top) * towmult); wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult); wallVerts[0].tow = towtop + ((realtop - bot) * towmult); @@ -4501,32 +4263,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; } -#else - wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult); - wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult); - - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; - - // The x and y only need to be adjusted in the case that it's not a papersprite - if (cv_grspritebillboarding.value - && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)) - { - // Get the x and z of the vertices so billboarding draws correctly - realheight = realbot - realtop; - heightmult = (realtop - top) / realheight; - wallVerts[3].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult; - wallVerts[3].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult; - wallVerts[2].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; - wallVerts[2].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; - - heightmult = (realtop - bot) / realheight; - wallVerts[0].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult; - wallVerts[0].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult; - wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; - wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; - } -#endif if (colormap) Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false); @@ -4538,21 +4274,15 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated|PF_Clip); top = bot; -#ifdef ESLOPE endtop = endbot; -#endif } bot = realbot; -#ifdef ESLOPE endbot = endrealbot; - if (endtop <= endrealbot) -#endif - if (top <= realbot) + if (endtop <= endrealbot && top <= realbot) return; // If we're ever down here, somehow the above loop hasn't draw all the light levels of sprite -#ifdef ESLOPE wallVerts[3].tow = towtop + ((realtop - top) * towmult); wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult); wallVerts[0].tow = towtop + ((realtop - bot) * towmult); @@ -4562,13 +4292,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult); - wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult); - - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (colormap) Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false); diff --git a/src/hardware/hw_trick.c b/src/hardware/hw_trick.c index 97d86b944..82d81b5b2 100644 --- a/src/hardware/hw_trick.c +++ b/src/hardware/hw_trick.c @@ -610,10 +610,8 @@ static boolean isCeilingFloating(sector_t *thisSector) if (!adjSector) // assume floating sectors have surrounding sectors return false; -#ifdef ESLOPE if (adjSector->c_slope) // Don't bother with slopes return false; -#endif if (!refSector) { @@ -663,10 +661,8 @@ static boolean isFloorFloating(sector_t *thisSector) if (!adjSector) // assume floating sectors have surrounding sectors return false; -#ifdef ESLOPE if (adjSector->f_slope) // Don't bother with slopes return false; -#endif if (!refSector) { diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 4f924aa18..3379ad3aa 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -14,9 +14,7 @@ #include "fastcmp.h" #include "p_local.h" #include "p_setup.h" // So we can have P_SetupLevelSky -#ifdef ESLOPE #include "p_slopes.h" // P_GetZAt -#endif #include "z_zone.h" #include "r_main.h" #include "r_draw.h" @@ -2175,7 +2173,6 @@ static int lib_evStartCrumble(lua_State *L) return 0; } -#ifdef ESLOPE // P_SLOPES //////////// @@ -2191,7 +2188,6 @@ static int lib_pGetZAt(lua_State *L) lua_pushfixed(L, P_GetZAt(slope, x, y)); return 1; } -#endif // R_DEFS //////////// @@ -3222,10 +3218,8 @@ static luaL_Reg lib[] = { {"EV_CrumbleChain",lib_evCrumbleChain}, {"EV_StartCrumble",lib_evStartCrumble}, -#ifdef ESLOPE // p_slopes {"P_GetZAt",lib_pGetZAt}, -#endif // r_defs {"R_PointToAngle",lib_rPointToAngle}, diff --git a/src/lua_libs.h b/src/lua_libs.h index bf1e28b5d..d0334d725 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -43,11 +43,9 @@ extern lua_State *gL; #define META_SEG "SEG_T*" #define META_NODE "NODE_T*" #endif -#ifdef ESLOPE #define META_SLOPE "PSLOPE_T*" #define META_VECTOR2 "VECTOR2_T" #define META_VECTOR3 "VECTOR3_T" -#endif #define META_MAPHEADER "MAPHEADER_T*" #define META_CVAR "CONSVAR_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 32150a4bc..d851c820e 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -15,9 +15,7 @@ #include "p_local.h" #include "p_setup.h" #include "z_zone.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "r_main.h" #include "lua_script.h" @@ -41,13 +39,9 @@ enum sector_e { sector_heightsec, sector_camsec, sector_lines, -#ifdef ESLOPE sector_ffloors, sector_fslope, sector_cslope -#else - sector_ffloors -#endif }; static const char *const sector_opt[] = { @@ -64,10 +58,8 @@ static const char *const sector_opt[] = { "camsec", "lines", "ffloors", -#ifdef ESLOPE "f_slope", "c_slope", -#endif NULL}; enum subsector_e { @@ -180,10 +172,8 @@ enum ffloor_e { ffloor_toplightlevel, ffloor_bottomheight, ffloor_bottompic, -#ifdef ESLOPE ffloor_tslope, ffloor_bslope, -#endif ffloor_sector, ffloor_flags, ffloor_master, @@ -200,10 +190,8 @@ static const char *const ffloor_opt[] = { "toplightlevel", "bottomheight", "bottompic", -#ifdef ESLOPE "t_slope", "b_slope", -#endif "sector", // secnum pushed as control sector userdata "flags", "master", // control linedef @@ -289,7 +277,6 @@ static const char *const bbox_opt[] = { "right", NULL}; -#ifdef ESLOPE enum slope_e { slope_valid = 0, slope_o, @@ -324,7 +311,6 @@ static const char *const vector_opt[] = { "y", "z", NULL}; -#endif static const char *const array_opt[] ={"iterate",NULL}; static const char *const valid_opt[] ={"valid",NULL}; @@ -570,14 +556,12 @@ static int sector_get(lua_State *L) LUA_PushUserdata(L, sector->ffloors, META_FFLOOR); lua_pushcclosure(L, sector_iterate, 2); // push lib_iterateFFloors and sector->ffloors as upvalues for the function return 1; -#ifdef ESLOPE case sector_fslope: // f_slope LUA_PushUserdata(L, sector->f_slope, META_SLOPE); return 1; case sector_cslope: // c_slope LUA_PushUserdata(L, sector->c_slope, META_SLOPE); return 1; -#endif } return 0; } @@ -601,10 +585,8 @@ static int sector_set(lua_State *L) case sector_camsec: // camsec case sector_lines: // lines case sector_ffloors: // ffloors -#ifdef ESLOPE case sector_fslope: // f_slope case sector_cslope: // c_slope -#endif default: return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]); case sector_floorheight: { // floorheight @@ -1692,14 +1674,12 @@ static int ffloor_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } -#ifdef ESLOPE case ffloor_tslope: LUA_PushUserdata(L, *ffloor->t_slope, META_SLOPE); return 1; case ffloor_bslope: LUA_PushUserdata(L, *ffloor->b_slope, META_SLOPE); return 1; -#endif case ffloor_sector: LUA_PushUserdata(L, §ors[ffloor->secnum], META_SECTOR); return 1; @@ -1739,10 +1719,8 @@ static int ffloor_set(lua_State *L) switch(field) { case ffloor_valid: // valid -#ifdef ESLOPE case ffloor_tslope: // t_slope case ffloor_bslope: // b_slope -#endif case ffloor_sector: // sector case ffloor_master: // master case ffloor_target: // target @@ -1803,7 +1781,6 @@ static int ffloor_set(lua_State *L) return 0; } -#ifdef ESLOPE ////////////// // pslope_t // ////////////// @@ -1976,7 +1953,6 @@ static int vector3_get(lua_State *L) return 0; } -#endif ///////////////////// // mapheaderinfo[] // @@ -2225,7 +2201,6 @@ int LUA_MapLib(lua_State *L) lua_setfield(L, -2, "__index"); lua_pop(L, 1); -#ifdef ESLOPE luaL_newmetatable(L, META_SLOPE); lua_pushcfunction(L, slope_get); lua_setfield(L, -2, "__index"); @@ -2243,7 +2218,6 @@ int LUA_MapLib(lua_State *L) lua_pushcfunction(L, vector3_get); lua_setfield(L, -2, "__index"); lua_pop(L, 1); -#endif luaL_newmetatable(L, META_MAPHEADER); lua_pushcfunction(L, mapheaderinfo_get); diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 4b580a2fe..81729b788 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -84,9 +84,7 @@ enum mobj_e { mobj_extravalue2, mobj_cusval, mobj_cvmem, -#ifdef ESLOPE mobj_standingslope, -#endif mobj_colorized, mobj_shadowscale }; @@ -152,9 +150,7 @@ static const char *const mobj_opt[] = { "extravalue2", "cusval", "cvmem", -#ifdef ESLOPE "standingslope", -#endif "colorized", "shadowscale", NULL}; @@ -383,11 +379,9 @@ static int mobj_get(lua_State *L) case mobj_cvmem: lua_pushinteger(L, mo->cvmem); break; -#ifdef ESLOPE case mobj_standingslope: LUA_PushUserdata(L, mo->standingslope, META_SLOPE); break; -#endif case mobj_colorized: lua_pushboolean(L, mo->colorized); break; @@ -716,10 +710,8 @@ static int mobj_set(lua_State *L) case mobj_cvmem: mo->cvmem = luaL_checkinteger(L, 3); break; -#ifdef ESLOPE case mobj_standingslope: return NOSET; -#endif case mobj_colorized: mo->colorized = luaL_checkboolean(L, 3); break; diff --git a/src/lua_script.c b/src/lua_script.c index 6fa6cf57d..8c0cd5351 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -23,9 +23,7 @@ #include "byteptr.h" #include "p_saveg.h" #include "p_local.h" -#ifdef ESLOPE #include "p_slopes.h" // for P_SlopeById -#endif #ifdef LUA_ALLOW_BYTECODE #include "d_netfil.h" // for LUA_DumpFile #endif @@ -731,9 +729,7 @@ enum ARCH_NODE, #endif ARCH_FFLOOR, -#ifdef ESLOPE ARCH_SLOPE, -#endif ARCH_MAPHEADER, ARCH_TEND=0xFF, @@ -758,9 +754,7 @@ static const struct { {META_NODE, ARCH_NODE}, #endif {META_FFLOOR, ARCH_FFLOOR}, -#ifdef ESLOPE {META_SLOPE, ARCH_SLOPE}, -#endif {META_MAPHEADER, ARCH_MAPHEADER}, {NULL, ARCH_NULL} }; @@ -1015,7 +1009,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } -#ifdef ESLOPE case ARCH_SLOPE: { pslope_t *slope = *((pslope_t **)lua_touserdata(gL, myindex)); @@ -1027,7 +1020,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } -#endif case ARCH_MAPHEADER: { mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex)); @@ -1249,11 +1241,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX) LUA_PushUserdata(gL, rover, META_FFLOOR); break; } -#ifdef ESLOPE case ARCH_SLOPE: LUA_PushUserdata(gL, P_SlopeById(READUINT16(save_p)), META_SLOPE); break; -#endif case ARCH_MAPHEADER: LUA_PushUserdata(gL, mapheaderinfo[READUINT16(save_p)], META_MAPHEADER); break; diff --git a/src/m_cheat.c b/src/m_cheat.c index 93e8f2911..4a1a4fb58 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1025,13 +1025,9 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling) if (ceiling) { -#ifdef ESLOPE // Truncate position to match where mapthing would be when spawned // (this applies to every further P_GetZAt call as well) fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT))) { @@ -1042,11 +1038,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling) } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif if (((player->mo->z - fheight)>>FRACBITS) >= (1 << (16-ZSHIFT))) { CONS_Printf(M_GetText("Sorry, you're too %s to place this object (max: %d %s).\n"), M_GetText("high"), @@ -1093,20 +1085,12 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c mt->y = (INT16)(player->mo->y>>FRACBITS); if (ceiling) { -#ifdef ESLOPE fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif mt->z = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS); } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif mt->z = (UINT16)((player->mo->z - fheight)>>FRACBITS); } mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle))); @@ -1352,20 +1336,12 @@ void OP_ObjectplaceMovement(player_t *player) if (!!(mobjinfo[op_currentthing].flags & MF_SPAWNCEILING) ^ !!(cv_opflags.value & MTF_OBJECTFLIP)) { -#ifdef ESLOPE fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif op_displayflags = (UINT16)((cheight - player->mo->z - mobjinfo[op_currentthing].height)>>FRACBITS); } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif op_displayflags = (UINT16)((player->mo->z - fheight)>>FRACBITS); } op_displayflags <<= ZSHIFT; diff --git a/src/p_enemy.c b/src/p_enemy.c index 9dea0ecc5..09d33c537 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -6764,13 +6764,8 @@ void A_MixUp(mobj_t *actor) P_SetThingPosition(players[i].mo); -#ifdef ESLOPE players[i].mo->floorz = P_GetFloorZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL); players[i].mo->ceilingz = P_GetCeilingZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL); -#else - players[i].mo->floorz = players[i].mo->subsector->sector->floorheight; - players[i].mo->ceilingz = players[i].mo->subsector->sector->ceilingheight; -#endif P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y); } diff --git a/src/p_floor.c b/src/p_floor.c index 9c5ab9057..b8b40df3c 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -15,9 +15,7 @@ #include "doomstat.h" #include "m_random.h" #include "p_local.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "r_state.h" #include "s_sound.h" #include "z_zone.h" @@ -3178,12 +3176,10 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; -#ifdef ESLOPE if (*rover->t_slope) topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1); if (*rover->b_slope) bottomz = P_GetZAt(*rover->b_slope, a, b); -#endif for (c = topz; c > bottomz; c -= spacing) { diff --git a/src/p_local.h b/src/p_local.h index 99c465f9b..becb045f7 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -66,9 +66,7 @@ typedef enum THINK_POLYOBJ, THINK_MAIN, THINK_MOBJ, -#ifdef ESLOPE THINK_DYNSLOPE, -#endif THINK_PRECIP, NUM_THINKERLISTS } thinklistnum_t; /**< Thinker lists. */ @@ -383,9 +381,7 @@ extern mobj_t *tmfloorthing, *tmhitthing, *tmthing; extern camera_t *mapcampointer; extern fixed_t tmx; extern fixed_t tmy; -#ifdef ESLOPE extern pslope_t *tmfloorslope, *tmceilingslope; -#endif /* cphipps 2004/08/30 */ extern void P_MapStart(void); diff --git a/src/p_map.c b/src/p_map.c index 988089989..accc52836 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -27,9 +27,7 @@ #include "r_splats.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "z_zone.h" @@ -53,9 +51,7 @@ 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 mobj_t *tmhitthing; // the solid thing you bumped into (for collisions) ffloor_t *tmfloorrover, *tmceilingrover; -#ifdef ESLOPE pslope_t *tmfloorslope, *tmceilingslope; -#endif // keep track of the line that lowers the ceiling, // so missiles don't explode against sky hack walls @@ -262,9 +258,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (!vertispeed && !horizspeed) return false; -#ifdef ESLOPE object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you. -#endif if (spring->eflags & MFE_VERTICALFLIP) vertispeed *= -1; @@ -439,9 +433,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_SetPlayerMobjState(object, S_PLAY_FALL); } -#ifdef ESLOPE object->standingslope = NULL; // And again. -#endif final = true; @@ -491,9 +483,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) zdist = object->z - spring->z; } -#ifdef ESLOPE object->standingslope = NULL; // No launching off at silly angles for you. -#endif switch (spring->type) { @@ -1736,9 +1726,7 @@ static boolean PIT_CheckThing(mobj_t *thing) { tmfloorz = thing->z + thing->height; tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif } return true; } @@ -1757,18 +1745,14 @@ static boolean PIT_CheckThing(mobj_t *thing) tmfloorz = tmceilingz = topz; // block while in air tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmfloorthing = thing; // needed for side collision } else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height) { tmceilingz = topz; tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmfloorthing = thing; // thing we may stand on } } @@ -1783,9 +1767,7 @@ static boolean PIT_CheckThing(mobj_t *thing) { tmceilingz = thing->z; tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif } return true; } @@ -1804,18 +1786,14 @@ static boolean PIT_CheckThing(mobj_t *thing) tmfloorz = tmceilingz = topz; // block while in air tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorthing = thing; // needed for side collision } else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z) { tmfloorz = topz; tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorthing = thing; // thing we may stand on } } @@ -1976,18 +1954,14 @@ static boolean PIT_CheckLine(line_t *ld) tmceilingz = opentop; ceilingline = ld; tmceilingrover = openceilingrover; -#ifdef ESLOPE tmceilingslope = opentopslope; -#endif } if (openbottom > tmfloorz) { tmfloorz = openbottom; tmfloorrover = openfloorrover; -#ifdef ESLOPE tmfloorslope = openbottomslope; -#endif } if (highceiling > tmdrpoffceilz) @@ -2068,10 +2042,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight; tmfloorrover = NULL; tmceilingrover = NULL; -#ifdef ESLOPE tmfloorslope = newsubsec->sector->f_slope; tmceilingslope = newsubsec->sector->c_slope; -#endif // Check list of fake floors and see if tmfloorz/tmceilingz need to be altered. if (newsubsec->sector->ffloors) @@ -2112,9 +2084,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmfloorz < topheight - sinklevel) { tmfloorz = topheight - sinklevel; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = *rover->t_slope; -#endif } } else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0) @@ -2122,9 +2092,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmceilingz > bottomheight + sinklevel) { tmceilingz = bottomheight + sinklevel; tmceilingrover = rover; -#ifdef ESLOPE tmceilingslope = *rover->b_slope; -#endif } } } @@ -2147,9 +2115,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmfloorz < thing->z) { tmfloorz = thing->z; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = NULL; -#endif } } // Quicksand blocks never change heights otherwise. @@ -2166,9 +2132,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { tmfloorz = tmdropoffz = topheight; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = *rover->t_slope; -#endif } if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2) && !(rover->flags & FF_PLATFORM) @@ -2176,9 +2140,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { tmceilingz = tmdrpoffceilz = bottomheight; tmceilingrover = rover; -#ifdef ESLOPE tmceilingslope = *rover->b_slope; -#endif } } } @@ -2253,17 +2215,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (polytop > tmfloorz && abs(delta1) < abs(delta2)) { tmfloorz = tmdropoffz = polytop; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorrover = NULL; } if (polybottom < tmceilingz && abs(delta1) >= abs(delta2)) { tmceilingz = tmdrpoffceilz = polybottom; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmceilingrover = NULL; } } @@ -2664,10 +2622,8 @@ boolean PIT_PushableMoved(mobj_t *thing) line_t *oldblockline = blockingline; ffloor_t *oldflrrover = tmfloorrover; ffloor_t *oldceilrover = tmceilingrover; -#ifdef ESLOPE pslope_t *oldfslope = tmfloorslope; pslope_t *oldcslope = tmceilingslope; -#endif // Move the player P_TryMove(thing, thing->x+stand->momx, thing->y+stand->momy, true); @@ -2682,10 +2638,8 @@ boolean PIT_PushableMoved(mobj_t *thing) blockingline = oldblockline; tmfloorrover = oldflrrover; tmceilingrover = oldceilrover; -#ifdef ESLOPE tmfloorslope = oldfslope; tmceilingslope = oldcslope; -#endif thing->momz = stand->momz; } else @@ -2707,9 +2661,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) fixed_t tryy = thing->y; fixed_t radius = thing->radius; fixed_t thingtop = thing->z + thing->height; -#ifdef ESLOPE fixed_t startingonground = P_IsObjectOnGround(thing); -#endif floatok = false; if (radius < MAXRADIUS/2) @@ -2795,14 +2747,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->ceilingrover = tmceilingrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#ifdef ESLOPE else if (tmceilingz < thingtop && thingtop - tmceilingz <= maxstep) { thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; thing->ceilingrover = tmceilingrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#endif } else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep) { @@ -2810,14 +2760,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->floorrover = tmfloorrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#ifdef ESLOPE else if (tmfloorz > thing->z && tmfloorz - thing->z <= maxstep) { thing->z = thing->floorz = tmfloorz; thing->floorrover = tmfloorrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#endif } if (thing->eflags & MFE_VERTICALFLIP) @@ -2881,7 +2829,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->floorrover = tmfloorrover; thing->ceilingrover = tmceilingrover; -#ifdef ESLOPE if (!(thing->flags & MF_NOCLIPHEIGHT)) { // Assign thing's standingslope if needed @@ -2902,7 +2849,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) } else // don't set standingslope if you're not going to clip against it thing->standingslope = NULL; -#endif thing->x = x; thing->y = y; @@ -3268,13 +3214,8 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle) glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy); -#ifdef ESLOPE floorz = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight; ceilingz = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight; -#else - floorz = glidesector->sector->floorheight; - ceilingz = glidesector->sector->ceilingheight; -#endif if (glidesector->sector != player->mo->subsector->sector) { @@ -3292,12 +3233,10 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y); -#endif floorclimb = true; @@ -3453,12 +3392,10 @@ isblocking: topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, slidemo->x, slidemo->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, slidemo->x, slidemo->y); -#endif if (topheight < slidemo->z) continue; @@ -3663,10 +3600,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) if (rover->master->flags & ML_BLOCKMONSTERS) continue; - topheight = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : -#endif + topheight = *rover->t_slope ? + P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; if (mo->eflags & MFE_VERTICALFLIP) @@ -3680,10 +3615,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) continue; } - bottomheight = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : -#endif + bottomheight = *rover->b_slope ? + P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; if (mo->eflags & MFE_VERTICALFLIP) @@ -4271,12 +4204,10 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -/*#ifdef ESLOPE - if (rover->t_slope) + /*if (rover->t_slope) topheight = P_GetZAt(rover->t_slope, thing->x, thing->y); if (rover->b_slope) - bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y); -#endif*/ + bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y);*/ delta1 = thing->z - (bottomheight + topheight)/2; delta2 = thingtop - (bottomheight + topheight)/2; @@ -5057,10 +4988,8 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) sector_t *sec = R_PointInSubsector(x, y)->sector; fixed_t floorz = sec->floorheight; -#ifdef ESLOPE if (sec->f_slope) floorz = P_GetZAt(sec->f_slope, x, y); -#endif // Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002 if (sec->ffloors) @@ -5080,12 +5009,10 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, x, y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, x, y); -#endif if (rover->flags & FF_QUICKSAND) { diff --git a/src/p_maputl.c b/src/p_maputl.c index 69be5a70f..bfca72eda 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -277,9 +277,7 @@ fixed_t P_InterceptVector(divline_t *v2, divline_t *v1) // OPTIMIZE: keep this precalculated // fixed_t opentop, openbottom, openrange, lowfloor, highceiling; -#ifdef ESLOPE pslope_t *opentopslope, *openbottomslope; -#endif ffloor_t *openfloorrover, *openceilingrover; // P_CameraLineOpening @@ -307,24 +305,20 @@ void P_CameraLineOpening(line_t *linedef) { frontfloor = sectors[front->camsec].floorheight; frontceiling = sectors[front->camsec].ceilingheight; -#ifdef ESLOPE if (sectors[front->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera.x, camera.y); if (sectors[front->camsec].c_slope) frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera.x, camera.y); -#endif } else if (front->heightsec >= 0) { frontfloor = sectors[front->heightsec].floorheight; frontceiling = sectors[front->heightsec].ceilingheight; -#ifdef ESLOPE if (sectors[front->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera.x, camera.y); if (sectors[front->heightsec].c_slope) frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera.x, camera.y); -#endif } else { @@ -335,23 +329,19 @@ void P_CameraLineOpening(line_t *linedef) { backfloor = sectors[back->camsec].floorheight; backceiling = sectors[back->camsec].ceilingheight; -#ifdef ESLOPE if (sectors[back->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera.x, camera.y); if (sectors[back->camsec].c_slope) frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera.x, camera.y); -#endif } else if (back->heightsec >= 0) { backfloor = sectors[back->heightsec].floorheight; backceiling = sectors[back->heightsec].ceilingheight; -#ifdef ESLOPE if (sectors[back->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera.x, camera.y); if (sectors[back->heightsec].c_slope) frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera.x, camera.y); -#endif } else { @@ -469,9 +459,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) openbottom = INT32_MIN; highceiling = INT32_MIN; lowfloor = INT32_MAX; -#ifdef ESLOPE opentopslope = openbottomslope = NULL; -#endif } else #endif @@ -485,17 +473,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { opentop = frontheight; highceiling = backheight; -#ifdef ESLOPE opentopslope = front->c_slope; -#endif } else { opentop = backheight; highceiling = frontheight; -#ifdef ESLOPE opentopslope = back->c_slope; -#endif } frontheight = P_GetFloorZ(mobj, front, tmx, tmy, linedef); @@ -505,17 +489,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { openbottom = frontheight; lowfloor = backheight; -#ifdef ESLOPE openbottomslope = front->f_slope; -#endif } else { openbottom = backheight; lowfloor = frontheight; -#ifdef ESLOPE openbottomslope = back->f_slope; -#endif } } @@ -647,9 +627,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (bottomheight < opentop) { opentop = bottomheight; -#ifdef ESLOPE opentopslope = *rover->b_slope; -#endif openceilingrover = rover; } else if (bottomheight < highceiling) @@ -660,9 +638,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (topheight > openbottom) { openbottom = topheight; -#ifdef ESLOPE openbottomslope = *rover->t_slope; -#endif openfloorrover = rover; } else if (topheight > lowfloor) @@ -693,9 +669,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (bottomheight < opentop) { opentop = bottomheight; -#ifdef ESLOPE opentopslope = *rover->b_slope; -#endif openceilingrover = rover; } else if (bottomheight < highceiling) @@ -706,9 +680,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (topheight > openbottom) { openbottom = topheight; -#ifdef ESLOPE openbottomslope = *rover->t_slope; -#endif openfloorrover = rover; } else if (topheight > lowfloor) diff --git a/src/p_maputl.h b/src/p_maputl.h index bb09c3ed1..08b606833 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -55,9 +55,7 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y); boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y); extern fixed_t opentop, openbottom, openrange, lowfloor, highceiling; -#ifdef ESLOPE extern pslope_t *opentopslope, *openbottomslope; -#endif extern ffloor_t *openfloorrover, *openceilingrover; void P_LineOpening(line_t *plinedef, mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index 8ba1adc73..347f5fce7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -31,9 +31,7 @@ #include "i_video.h" #include "lua_hook.h" #include "b_bot.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "f_finale.h" #include "m_cond.h" @@ -931,12 +929,10 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (mobj->z > topheight) return false; @@ -947,7 +943,6 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover) return true; } -#ifdef ESLOPE // P_GetFloorZ (and its ceiling counterpart) // Gets the floor height (or ceiling height) of the mobj's contact point in sector, assuming object's center if moved to [x, y] // If line is supplied, it's a divider line on the sector. Set it to NULL if you're not checking for collision with a line @@ -1051,15 +1046,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line, P_GetZAt(slope, v2.x, v2.y) ); } -#endif fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->f_slope) { fixed_t testx, testy; pslope_t *slope = sector->f_slope; @@ -1129,25 +1121,14 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->floorheight; } fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->c_slope) { fixed_t testx, testy; pslope_t *slope = sector->c_slope; @@ -1217,26 +1198,15 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->ceilingheight; } // Now do the same as all above, but for cameras because apparently cameras are special? fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->f_slope) { fixed_t testx, testy; pslope_t *slope = sector->f_slope; @@ -1306,25 +1276,14 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->floorheight; } fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->c_slope) { fixed_t testx, testy; pslope_t *slope = sector->c_slope; @@ -1394,15 +1353,6 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->ceilingheight; } static void P_PlayerFlip(mobj_t *mo) @@ -1674,10 +1624,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale) && abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale) && (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING)) -#ifdef ESLOPE - && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)) -#endif - ) + && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))) { // if in a walking frame, stop moving if (player->panim == PA_WALK) @@ -1824,11 +1771,9 @@ void P_XYMovement(mobj_t *mo) fixed_t xmove, ymove; fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls boolean moved; -#ifdef ESLOPE pslope_t *oldslope = NULL; vector3_t slopemom; fixed_t predictedz = 0; -#endif I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); @@ -1858,7 +1803,6 @@ void P_XYMovement(mobj_t *mo) oldx = mo->x; oldy = mo->y; -#ifdef ESLOPE if (mo->flags & MF_NOCLIPHEIGHT) mo->standingslope = NULL; @@ -1883,7 +1827,6 @@ void P_XYMovement(mobj_t *mo) } } else if (P_IsObjectOnGround(mo) && !mo->momz) predictedz = mo->z; -#endif // Pushables can break some blocks if (CheckForBustableBlocks && ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse))) @@ -1956,7 +1899,6 @@ void P_XYMovement(mobj_t *mo) } else if (player || mo->flags & (MF_SLIDEME|MF_PUSHABLE)) { // try to slide along it -#ifdef ESLOPE // Wall transfer part 1. pslope_t *transferslope = NULL; fixed_t transfermomz = 0; @@ -1966,14 +1908,12 @@ void P_XYMovement(mobj_t *mo) if (((transferslope->zangle < ANGLE_180) ? transferslope->zangle : InvAngle(transferslope->zangle)) >= ANGLE_45) // Prevent some weird stuff going on on shallow slopes. transfermomz = P_GetWallTransferMomZ(mo, transferslope); } -#endif P_SlideMove(mo); if (player) player->powers[pw_pushing] = 3; xmove = ymove = 0; -#ifdef ESLOPE // Wall transfer part 2. if (transfermomz && transferslope) // Are we "transferring onto the wall" (really just a disguised vertical launch)? { @@ -1996,7 +1936,6 @@ void P_XYMovement(mobj_t *mo) } } } -#endif } else if (mo->type == MT_SPINFIRE) { @@ -2052,7 +1991,6 @@ void P_XYMovement(mobj_t *mo) if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;; return; -#ifdef ESLOPE if (moved && oldslope && !(mo->flags & MF_NOCLIPHEIGHT)) { // Check to see if we ran off if (oldslope != mo->standingslope) { // First, compare different slopes @@ -2098,7 +2036,6 @@ void P_XYMovement(mobj_t *mo) //CONS_Printf("Launched off of flat surface running into downward slope\n"); } } -#endif // Check the gravity status. P_CheckGravity(mo, false); @@ -2149,11 +2086,9 @@ void P_XYMovement(mobj_t *mo) if (player && player->powers[pw_carry] == CR_NIGHTSMODE) return; // no friction for NiGHTS players -#ifdef ESLOPE if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED) && (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes return; -#endif if (((!(mo->eflags & MFE_VERTICALFLIP) && mo->z > mo->floorz) || (mo->eflags & MFE_VERTICALFLIP && mo->z+mo->height < mo->ceilingz)) && !(player && player->pflags & PF_SLIDING)) @@ -2421,7 +2356,6 @@ static boolean P_ZMovement(mobj_t *mo) mo->z += mo->momz; onground = P_IsObjectOnGround(mo); -#ifdef ESLOPE if (mo->standingslope) { if (mo->flags & MF_NOCLIPHEIGHT) @@ -2429,7 +2363,6 @@ static boolean P_ZMovement(mobj_t *mo) else if (!onground) P_SlopeLaunch(mo); } -#endif switch (mo->type) { @@ -2631,7 +2564,6 @@ static boolean P_ZMovement(mobj_t *mo) else mo->z = mo->floorz; -#ifdef ESLOPE if (!(mo->flags & MF_MISSILE) && mo->standingslope) // You're still on the ground; why are we here? { mo->momz = 0; @@ -2644,7 +2576,6 @@ static boolean P_ZMovement(mobj_t *mo) mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope; P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope); } -#endif // hit the floor if (mo->type == MT_FIREBALL) // special case for the fireball @@ -2744,13 +2675,11 @@ static boolean P_ZMovement(mobj_t *mo) else mom.y -= FixedMul(6*FRACUNIT, mo->scale); } -#ifdef ESLOPE else if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) { // Pop the object up a bit to encourage bounciness //mom.z = P_MobjFlip(mo)*mo->scale; } -#endif else { mom.x = mom.y = mom.z = 0; @@ -2790,11 +2719,9 @@ static boolean P_ZMovement(mobj_t *mo) else if (tmfloorthing) mom.z = tmfloorthing->momz; -#ifdef ESLOPE if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above. P_QuantizeMomentumToSlope(&mom, mo->standingslope); } -#endif mo->momx = mom.x; mo->momy = mom.y; @@ -2916,7 +2843,6 @@ static void P_PlayerZMovement(mobj_t *mo) || mo->player->playerstate == PST_REBORN) return; -#ifdef ESLOPE if (mo->standingslope) { if (mo->flags & MF_NOCLIPHEIGHT) @@ -2924,7 +2850,6 @@ static void P_PlayerZMovement(mobj_t *mo) else if (!onground) P_SlopeLaunch(mo); } -#endif // clip movement if (onground && !(mo->flags & MF_NOCLIPHEIGHT)) @@ -2952,12 +2877,10 @@ static void P_PlayerZMovement(mobj_t *mo) if (mo->player->panim == PA_PAIN) P_SetPlayerMobjState(mo, S_PLAY_WALK); -#ifdef ESLOPE if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) { // Handle landing on slope during Z movement P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)); } -#endif if (P_MobjFlip(mo)*mo->momz < 0) // falling { @@ -3290,10 +3213,8 @@ static boolean P_SceneryZMovement(mobj_t *mo) // boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) { - fixed_t topheight = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : -#endif + fixed_t topheight = *rover->t_slope ? + P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; if (!player->powers[pw_carry] && !player->homing @@ -3340,13 +3261,11 @@ void P_MobjCheckWater(mobj_t *mobj) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (mobj->eflags & MFE_VERTICALFLIP) { @@ -3596,13 +3515,11 @@ static void P_SceneryCheckWater(mobj_t *mobj) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (topheight <= mobj->z || bottomheight > (mobj->z + (mobj->height>>1))) @@ -3647,14 +3564,12 @@ static boolean P_CameraCheckHeat(camera_t *thiscam) if (!(rover->flags & FF_EXISTS)) continue; - if (halfheight >= ( -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : -#endif - *rover->topheight) || halfheight <= ( -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : -#endif + if (halfheight >= (*rover->t_slope ? + P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : + *rover->topheight)) + continue; + if (halfheight <= (*rover->b_slope ? + P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : *rover->bottomheight)) continue; @@ -3683,14 +3598,12 @@ static boolean P_CameraCheckWater(camera_t *thiscam) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS) continue; - if (halfheight >= ( -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : -#endif - *rover->topheight) || halfheight <= ( -#ifdef ESLOPE + if (halfheight >= (*rover->t_slope ? + P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : + *rover->topheight)) + continue; + if (halfheight <= ( *rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : -#endif *rover->bottomheight)) continue; @@ -3880,9 +3793,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) P_MobjCheckWater(mobj); -#ifdef ESLOPE P_ButteredSlope(mobj); -#endif // momentum movement mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN; @@ -4041,10 +3952,8 @@ static void CalculatePrecipFloor(precipmobj_t *mobj) mobjsecsubsec = mobj->subsector->sector; else return; - mobj->floorz = -#ifdef ESLOPE - mobjsecsubsec->f_slope ? P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) : -#endif + mobj->floorz = mobjsecsubsec->f_slope ? + P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) : mobjsecsubsec->floorheight; if (mobjsecsubsec->ffloors) { @@ -4060,12 +3969,10 @@ static void CalculatePrecipFloor(precipmobj_t *mobj) if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE)) continue; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); else -#endif - topheight = *rover->topheight; + topheight = *rover->topheight; if (topheight > mobj->floorz) mobj->floorz = topheight; @@ -10241,7 +10148,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->eflags &= ~MFE_JUSTHITFLOOR; } -#ifdef ESLOPE // Sliding physics for slidey mobjs! + // Sliding physics for slidey mobjs! if (mobj->type == MT_FLINGRING || mobj->type == MT_FLINGCOIN || mobj->type == MT_FLINGBLUESPHERE @@ -10256,7 +10163,6 @@ void P_MobjThinker(mobj_t *mobj) //if (mobj->standingslope) CONS_Printf("slope physics on mobj\n"); P_ButteredSlope(mobj); } -#endif if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health && P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz @@ -10590,15 +10496,11 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Make sure scale matches destscale immediately when spawned P_SetScale(mobj, mobj->destscale); - mobj->floorz = -#ifdef ESLOPE - mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) : -#endif + mobj->floorz = mobj->subsector->sector->f_slope ? + P_GetZAt(mobj->subsector->sector->f_slope, x, y) : mobj->subsector->sector->floorheight; - mobj->ceilingz = -#ifdef ESLOPE - mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) : -#endif + mobj->ceilingz = mobj->subsector->sector->c_slope ? + P_GetZAt(mobj->subsector->sector->c_slope, x, y) : mobj->subsector->sector->ceilingheight; mobj->floorrover = NULL; @@ -10952,15 +10854,11 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype // set subsector and/or block links P_SetPrecipitationThingPosition(mobj); - mobj->floorz = starting_floorz = -#ifdef ESLOPE - mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) : -#endif + mobj->floorz = starting_floorz = mobj->subsector->sector->f_slope ? + P_GetZAt(mobj->subsector->sector->f_slope, x, y) : mobj->subsector->sector->floorheight; - mobj->ceilingz = -#ifdef ESLOPE - mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) : -#endif + mobj->ceilingz = mobj->subsector->sector->c_slope ? + P_GetZAt(mobj->subsector->sector->c_slope, x, y) : mobj->subsector->sector->ceilingheight; mobj->floorrover = NULL; @@ -11596,16 +11494,12 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) // set Z height sector = R_PointInSubsector(x, y)->sector; - floor = -#ifdef ESLOPE - sector->f_slope ? P_GetZAt(sector->f_slope, x, y) : -#endif - sector->floorheight; - ceiling = -#ifdef ESLOPE - sector->c_slope ? P_GetZAt(sector->c_slope, x, y) : -#endif - sector->ceilingheight; + floor = sector->f_slope ? + P_GetZAt(sector->f_slope, x, y) : + sector->floorheight; + ceiling = sector->c_slope ? + P_GetZAt(sector->c_slope, x, y) : + sector->ceilingheight; ceilingspawn = ceiling - mobjinfo[MT_PLAYER].height; if (mthing) @@ -11675,16 +11569,12 @@ void P_MovePlayerToStarpost(INT32 playernum) P_SetThingPosition(mobj); sector = R_PointInSubsector(mobj->x, mobj->y)->sector; - floor = -#ifdef ESLOPE - sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) : -#endif - sector->floorheight; - ceiling = -#ifdef ESLOPE - sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) : -#endif - sector->ceilingheight; + floor = sector->f_slope ? + P_GetZAt(sector->f_slope, mobj->x, mobj->y) : + sector->floorheight; + ceiling = sector->c_slope ? + P_GetZAt(sector->c_slope, mobj->x, mobj->y) : + sector->ceilingheight; z = p->starpostz << FRACBITS; @@ -11733,17 +11623,11 @@ static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, // Establish height. if (flip) - return ( -#ifdef ESLOPE - ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : -#endif - ss->sector->ceilingheight) - offset - mobjinfo[mobjtype].height; + return (ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : ss->sector->ceilingheight) + - offset - mobjinfo[mobjtype].height; else - return ( -#ifdef ESLOPE - ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : -#endif - ss->sector->floorheight) + offset; + return (ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : ss->sector->floorheight) + + offset; } static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y) diff --git a/src/p_mobj.h b/src/p_mobj.h index 63c91571b..5deb288e4 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -370,9 +370,7 @@ typedef struct mobj_s INT32 cusval; INT32 cvmem; -#ifdef ESLOPE struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?) -#endif boolean colorized; // Whether the mobj uses the rainbow colormap fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius diff --git a/src/p_saveg.c b/src/p_saveg.c index 37d5f99ba..716904432 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -31,9 +31,7 @@ #include "r_sky.h" #include "p_polyobj.h" #include "lua_script.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif savedata_t savedata; UINT8 *save_p; @@ -1252,9 +1250,7 @@ typedef enum MD2_HPREV = 1<<8, MD2_FLOORROVER = 1<<9, MD2_CEILINGROVER = 1<<10, -#ifdef ESLOPE MD2_SLOPE = 1<<11, -#endif MD2_COLORIZED = 1<<12, MD2_ROLLANGLE = 1<<13, MD2_SHADOWSCALE = 1<<14, @@ -1294,10 +1290,8 @@ typedef enum tc_fade, tc_fadecolormap, tc_planedisplace, -#ifdef ESLOPE tc_dynslopeline, tc_dynslopevert, -#endif // ESLOPE #ifdef POLYOBJECTS tc_polyrotate, // haleyjd 03/26/06: polyobjects tc_polymove, @@ -1336,13 +1330,11 @@ static inline UINT32 SavePlayer(const player_t *player) return 0xFFFFFFFF; } -#ifdef ESLOPE static UINT32 SaveSlope(const pslope_t *slope) { if (slope) return (UINT32)(slope->id); return 0xFFFFFFFF; } -#endif // ESLOPE // // SaveMobjThinker @@ -1471,10 +1463,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff2 |= MD2_FLOORROVER; if (mobj->ceilingrover) diff2 |= MD2_CEILINGROVER; -#ifdef ESLOPE if (mobj->standingslope) diff2 |= MD2_SLOPE; -#endif if (mobj->colorized) diff2 |= MD2_COLORIZED; if (mobj->rollangle) @@ -1639,10 +1629,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) WRITEUINT32(save_p, mobj->hnext->mobjnum); if (diff2 & MD2_HPREV) WRITEUINT32(save_p, mobj->hprev->mobjnum); -#ifdef ESLOPE if (diff2 & MD2_SLOPE) WRITEUINT16(save_p, mobj->standingslope->id); -#endif if (diff2 & MD2_COLORIZED) WRITEUINT8(save_p, mobj->colorized); if (diff2 & MD2_ROLLANGLE) @@ -1993,7 +1981,7 @@ static void SavePlaneDisplaceThinker(const thinker_t *th, const UINT8 type) WRITEFIXED(save_p, ht->speed); WRITEUINT8(save_p, ht->type); } -#ifdef ESLOPE + /// Save a dynamic slope thinker. static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type) { @@ -2008,7 +1996,6 @@ static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type WRITEMEM(save_p, ht->tags, sizeof(ht->tags)); WRITEMEM(save_p, ht->vex, sizeof(ht->vex)); } -#endif // ESLOPE #ifdef POLYOBJECTS @@ -2391,7 +2378,6 @@ static void P_NetArchiveThinkers(void) continue; } #endif -#ifdef ESLOPE else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine) { SaveDynamicSlopeThinker(th, tc_dynslopeline); @@ -2402,7 +2388,6 @@ static void P_NetArchiveThinkers(void) SaveDynamicSlopeThinker(th, tc_dynslopevert); continue; } -#endif // ESLOPE #ifdef PARANOIA else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection I_Error("unknown thinker type %p", th->function.acp1); @@ -2463,7 +2448,6 @@ static inline player_t *LoadPlayer(UINT32 player) return &players[player]; } -#ifdef ESLOPE static inline pslope_t *LoadSlope(UINT32 slopeid) { pslope_t *p = slopelist; @@ -2475,7 +2459,6 @@ static inline pslope_t *LoadSlope(UINT32 slopeid) } while ((p = p->next)); return NULL; } -#endif // ESLOPE // // LoadMobjThinker @@ -2720,10 +2703,8 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker) mobj->hnext = (mobj_t *)(size_t)READUINT32(save_p); if (diff2 & MD2_HPREV) mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p); -#ifdef ESLOPE if (diff2 & MD2_SLOPE) mobj->standingslope = P_SlopeById(READUINT16(save_p)); -#endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); if (diff2 & MD2_ROLLANGLE) @@ -3183,7 +3164,6 @@ static inline thinker_t* LoadPlaneDisplaceThinker(actionf_p1 thinker) return &ht->thinker; } -#ifdef ESLOPE /// Save a dynamic slope thinker. static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker) { @@ -3198,7 +3178,6 @@ static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker) READMEM(save_p, ht->vex, sizeof(ht->vex)); return &ht->thinker; } -#endif // ESLOPE #ifdef POLYOBJECTS @@ -3578,7 +3557,7 @@ static void P_NetUnArchiveThinkers(void) th = LoadPolyfadeThinker((actionf_p1)T_PolyObjFade); break; #endif -#ifdef ESLOPE + case tc_dynslopeline: th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine); break; @@ -3586,7 +3565,6 @@ static void P_NetUnArchiveThinkers(void) case tc_dynslopevert: th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeVert); break; -#endif // ESLOPE case tc_scroll: th = LoadScrollThinker((actionf_p1)T_Scroll); diff --git a/src/p_setup.c b/src/p_setup.c index b3b86886f..cdf867d61 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -77,9 +77,7 @@ #include "hardware/hw_model.h" #endif -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "fastcmp.h" // textmap parsing @@ -909,11 +907,9 @@ static void P_InitializeSector(sector_t *ss) ss->preciplist = NULL; ss->touching_preciplist = NULL; -#ifdef ESLOPE ss->f_slope = NULL; ss->c_slope = NULL; ss->hasslope = false; -#endif ss->spawn_lightlevel = ss->lightlevel; @@ -3580,9 +3576,7 @@ boolean P_LoadLevel(boolean fromnetsave) // anything that P_SpawnSlopes/P_LoadThings needs to know P_InitSpecials(); -#ifdef ESLOPE P_SpawnSlopes(fromnetsave); -#endif P_SpawnMapThings(!fromnetsave); skyboxmo[0] = skyboxviewpnts[0]; diff --git a/src/p_sight.c b/src/p_sight.c index 4ea14cca0..c9083b99b 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -218,9 +218,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) const vertex_t *v1,*v2; fixed_t frac; fixed_t frontf, backf, frontc, backc; -#ifdef ESLOPE fixed_t fracx, fracy; -#endif if (seg->glseg) continue; @@ -263,7 +261,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) front = seg->frontsector; back = seg->backsector; -#ifdef ESLOPE // calculate position at intercept fracx = los->strace.x + FixedMul(los->strace.dx, frac); fracy = los->strace.y + FixedMul(los->strace.dy, frac); @@ -272,12 +269,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) frontc = (front->c_slope) ? P_GetZAt(front->c_slope, fracx, fracy) : front->ceilingheight; backf = (back->f_slope) ? P_GetZAt(back->f_slope, fracx, fracy) : back->floorheight; backc = (back->c_slope) ? P_GetZAt(back->c_slope, fracx, fracy) : back->ceilingheight; -#else - frontf = front->floorheight; - frontc = front->ceilingheight; - backf = back->floorheight; - backc = back->ceilingheight; -#endif // crosses a two sided line // no wall to block sight with? if (frontf == backf && frontc == backc @@ -327,13 +318,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) continue; } -#ifdef ESLOPE topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight; bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight; -#else - topz = *rover->topheight; - bottomz = *rover->bottomheight; -#endif topslope = FixedDiv(topz - los->sightzstart , frac); bottomslope = FixedDiv(bottomz - los->sightzstart , frac); if (topslope >= los->topslope && bottomslope <= los->bottomslope) @@ -348,13 +334,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) continue; } -#ifdef ESLOPE topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight; bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight; -#else - topz = *rover->topheight; - bottomz = *rover->bottomheight; -#endif topslope = FixedDiv(topz - los->sightzstart , frac); bottomslope = FixedDiv(bottomz - los->sightzstart , frac); if (topslope >= los->topslope && bottomslope <= los->bottomslope) @@ -487,7 +468,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) continue; } -#ifdef ESLOPE if (*rover->t_slope) { topz1 = P_GetZAt(*rover->t_slope, t1->x, t1->y); @@ -503,10 +483,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) } else bottomz1 = bottomz2 = *rover->bottomheight; -#else - topz1 = topz2 = *rover->topheight; - bottomz1 = bottomz2 = *rover->bottomheight; -#endif // Check for blocking floors here. if ((los.sightzstart < bottomz1 && t2->z >= topz2) diff --git a/src/p_slopes.c b/src/p_slopes.c index e275964e3..4b5838077 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -23,8 +23,6 @@ #include "p_maputl.h" #include "w_wad.h" -#ifdef ESLOPE - pslope_t *slopelist = NULL; UINT16 slopecount = 0; @@ -844,6 +842,3 @@ void P_ButteredSlope(mobj_t *mo) P_Thrust(mo, mo->standingslope->xydirection, thrust); } - -// EOF -#endif // #ifdef ESLOPE diff --git a/src/p_slopes.h b/src/p_slopes.h index f8159b884..e7c850ab8 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -15,8 +15,6 @@ #include "m_fixed.h" // Vectors -#ifdef ESLOPE - extern pslope_t *slopelist; extern UINT16 slopecount; @@ -74,5 +72,4 @@ typedef struct void T_DynamicSlopeLine (dynplanethink_t* th); void T_DynamicSlopeVert (dynplanethink_t* th); -#endif // #ifdef ESLOPE #endif // #ifndef P_SLOPES_H__ diff --git a/src/p_spec.c b/src/p_spec.c index 8938a51b6..cd26dcf9e 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5788,7 +5788,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f fflr->topyoffs = &sec2->ceiling_yoffs; fflr->topangle = &sec2->ceilingpic_angle; -#ifdef ESLOPE // Add slopes fflr->t_slope = &sec2->c_slope; fflr->b_slope = &sec2->f_slope; @@ -5796,7 +5795,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f // (this fixes FOF slopes glitching initially at level load in software mode) if (sec2->hasslope) sec->hasslope = true; -#endif if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only flags &= ~FF_BLOCKOTHERS; @@ -6274,15 +6272,11 @@ void T_LaserFlash(laserthink_t *flash) sourcesec = fflr->master->frontsector; // Less to type! -#ifdef ESLOPE top = (*fflr->t_slope) ? P_GetZAt(*fflr->t_slope, sector->soundorg.x, sector->soundorg.y) : *fflr->topheight; bottom = (*fflr->b_slope) ? P_GetZAt(*fflr->b_slope, sector->soundorg.x, sector->soundorg.y) : *fflr->bottomheight; sector->soundorg.z = (top + bottom)/2; -#else - sector->soundorg.z = (*fflr->topheight + *fflr->bottomheight)/2; -#endif S_StartSound(§or->soundorg, sfx_laser); // Seek out objects to DESTROY! MUAHAHHAHAHAA!!!*cough* @@ -7927,12 +7921,10 @@ void T_Disappear(disappear_t *d) if (!(lines[d->sourceline].flags & ML_NOCLIMB)) { -#ifdef ESLOPE if (*rover->t_slope) sectors[s].soundorg.z = P_GetZAt(*rover->t_slope, sectors[s].soundorg.x, sectors[s].soundorg.y); else -#endif - sectors[s].soundorg.z = *rover->topheight; + sectors[s].soundorg.z = *rover->topheight; S_StartSound(§ors[s].soundorg, sfx_appear); } } diff --git a/src/p_user.c b/src/p_user.c index 19b53e16f..c12bc0c59 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2274,13 +2274,8 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space if (GETSECSPECIAL(rover->master->frontsector->special, 1) != SPACESPECIAL) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (mo->z + (mo->height/2) > topheight) continue; @@ -2517,13 +2512,8 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand if (!(rover->flags & FF_QUICKSAND)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (mo->z + flipoffset > topheight) continue; @@ -2693,9 +2683,7 @@ static void P_CheckBouncySectors(player_t *player) fixed_t oldx; fixed_t oldy; fixed_t oldz; -#ifdef ESLOPE vector3_t momentum; -#endif oldx = player->mo->x; oldy = player->mo->y; @@ -2750,7 +2738,6 @@ static void P_CheckBouncySectors(player_t *player) { fixed_t newmom; -#ifdef ESLOPE pslope_t *slope; if (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) { // Hit top slope = *rover->t_slope; @@ -2766,9 +2753,6 @@ static void P_CheckBouncySectors(player_t *player) P_ReverseQuantizeMomentumToSlope(&momentum, slope); newmom = momentum.z = -FixedMul(momentum.z,linedist)/2; -#else - newmom = -FixedMul(player->mo->momz,linedist); -#endif if (abs(newmom) < (linedist*2)) { @@ -2791,7 +2775,6 @@ static void P_CheckBouncySectors(player_t *player) else if (newmom < -P_GetPlayerHeight(player)/2) newmom = -P_GetPlayerHeight(player)/2; -#ifdef ESLOPE momentum.z = newmom*2; if (slope) @@ -2800,9 +2783,6 @@ static void P_CheckBouncySectors(player_t *player) player->mo->momx = momentum.x; player->mo->momy = momentum.y; player->mo->momz = momentum.z/2; -#else - player->mo->momz = newmom; -#endif if (player->pflags & PF_SPINNING) { @@ -2859,13 +2839,8 @@ static void P_CheckQuicksand(player_t *player) if (!(rover->flags & FF_QUICKSAND)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) { @@ -3199,26 +3174,21 @@ static void P_DoClimbing(player_t *player) boolean thrust = false; boolean boostup = false; boolean skyclimber = false; - fixed_t floorheight, ceilingheight; // ESLOPE + fixed_t floorheight, ceilingheight; if (!glidesector) floorclimb = true; else { -#ifdef ESLOPE floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight; ceilingheight = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight; -#else - floorheight = glidesector->sector->floorheight; - ceilingheight = glidesector->sector->ceilingheight; -#endif if (glidesector->sector->ffloors) { ffloor_t *rover; - fixed_t topheight, bottomheight; // ESLOPE + fixed_t topheight, bottomheight; for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { @@ -3227,13 +3197,8 @@ static void P_DoClimbing(player_t *player) floorclimb = true; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif // Only supports rovers that are moving like an 'elevator', not just the top or bottom. if (rover->master->frontsector->floorspeed && rover->master->frontsector->ceilspeed == 42) @@ -3274,11 +3239,7 @@ static void P_DoClimbing(player_t *player) if (roverbelow == rover) continue; -#ifdef ESLOPE bottomheight2 = *roverbelow->b_slope ? P_GetZAt(*roverbelow->b_slope, player->mo->x, player->mo->y) : *roverbelow->bottomheight; -#else - bottomheight2 = *roverbelow->bottomheight; -#endif if (bottomheight2 < topheight + FixedMul(16*FRACUNIT, player->mo->scale)) foundfof = true; @@ -3324,11 +3285,7 @@ static void P_DoClimbing(player_t *player) if (roverbelow == rover) continue; -#ifdef ESLOPE topheight2 = *roverbelow->t_slope ? P_GetZAt(*roverbelow->t_slope, player->mo->x, player->mo->y) : *roverbelow->topheight; -#else - topheight2 = *roverbelow->topheight; -#endif if (topheight2 > bottomheight - FixedMul(16*FRACUNIT, player->mo->scale)) foundfof = true; @@ -3383,11 +3340,7 @@ static void P_DoClimbing(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP)) continue; -#ifdef ESLOPE bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - bottomheight = *rover->bottomheight; -#endif if (bottomheight < floorheight + FixedMul(16*FRACUNIT, player->mo->scale)) { @@ -3428,11 +3381,7 @@ static void P_DoClimbing(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; -#else - topheight = *rover->topheight; -#endif if (topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale)) { @@ -3807,12 +3756,10 @@ static void P_DoTeeter(player_t *player) ceilingheight = sec->ceilingheight; floorheight = sec->floorheight; -#ifdef ESLOPE if (sec->c_slope) ceilingheight = P_GetZAt(sec->c_slope, checkx, checky); if (sec->f_slope) floorheight = P_GetZAt(sec->f_slope, checkx, checky); -#endif highestceilingheight = (ceilingheight > highestceilingheight) ? ceilingheight : highestceilingheight; lowestfloorheight = (floorheight < lowestfloorheight) ? floorheight : lowestfloorheight; @@ -3823,13 +3770,8 @@ static void P_DoTeeter(player_t *player) { if (!(rover->flags & FF_EXISTS)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (P_CheckSolidLava(rover)) ; @@ -4638,9 +4580,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) return; } -#ifdef ESLOPE canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2); -#endif /////////////////////////////// // ability-specific behavior // @@ -5903,12 +5843,10 @@ static void P_3dMovement(player_t *player) controlstyle_e controlstyle; boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && (player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH)); fixed_t oldMagnitude, newMagnitude; -#ifdef ESLOPE vector3_t totalthrust; totalthrust.x = totalthrust.y = 0; // I forget if this is needed totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes -#endif // ESLOPE // Get the old momentum; this will be needed at the end of the function! -SH oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); @@ -6109,12 +6047,8 @@ static void P_3dMovement(player_t *player) movepushforward = FixedMul(movepushforward, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); -#else - P_Thrust(player->mo, movepushangle, movepushforward); -#endif } // Sideways movement if (player->climbing) @@ -6157,12 +6091,8 @@ static void P_3dMovement(player_t *player) movepushforward = FixedMul(movepushforward, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, controldirection, movepushforward); -#else - P_Thrust(player->mo, controldirection, movepushforward); -#endif } } else if (cmd->sidemove && !(player->pflags & PF_GLIDING) && !player->exiting && !P_PlayerInPain(player)) @@ -6191,15 +6121,10 @@ static void P_3dMovement(player_t *player) // Finally move the player now that their speed/direction has been decided. movepushside = FixedMul(movepushside, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushsideangle, movepushside); totalthrust.y += P_ReturnThrustY(player->mo, movepushsideangle, movepushside); -#else - P_Thrust(player->mo, movepushsideangle, movepushside); -#endif } -#ifdef ESLOPE if ((totalthrust.x || totalthrust.y) && player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { // Factor thrust to slope, but only for the part pushing up it! @@ -6219,7 +6144,6 @@ static void P_3dMovement(player_t *player) player->mo->momx += totalthrust.x; player->mo->momy += totalthrust.y; -#endif // Time to ask three questions: // 1) Are we over topspeed? @@ -7832,14 +7756,13 @@ void P_ElementalFire(player_t *player, boolean cropcircle) newx = player->mo->x + P_ReturnThrustX(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); newy = player->mo->y + P_ReturnThrustY(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); -#ifdef ESLOPE if (player->mo->standingslope) { ground = P_GetZAt(player->mo->standingslope, newx, newy); if (player->mo->eflags & MFE_VERTICALFLIP) ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); } -#endif + flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); P_SetTarget(&flame->target, player->mo); flame->angle = travelangle; @@ -10740,13 +10663,8 @@ static void P_CalcPostImg(player_t *player) if (!(rover->flags & FF_EXISTS)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (pviewheight >= topheight || pviewheight <= bottomheight) continue; @@ -10768,13 +10686,8 @@ static void P_CalcPostImg(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (pviewheight >= topheight || pviewheight <= bottomheight) continue; diff --git a/src/r_bsp.c b/src/r_bsp.c index c0011f4b9..85113be43 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -359,10 +359,8 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back) #endif back->ceilingpic == front->ceilingpic && back->floorpic == front->floorpic -#ifdef ESLOPE && back->f_slope == front->f_slope && back->c_slope == front->c_slope -#endif && back->lightlevel == front->lightlevel && !line->sidedef->midtexture // Check offsets too! @@ -497,7 +495,6 @@ static void R_AddLine(seg_t *line) } // Closed door. -#ifdef ESLOPE if (frontsector->f_slope || frontsector->c_slope || backsector->f_slope || backsector->c_slope) { fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends @@ -542,7 +539,6 @@ static void R_AddLine(seg_t *line) goto clippass; } else -#endif { // if both ceilings are skies, consider it always "open" // same for floors @@ -863,16 +859,12 @@ static void R_Subsector(size_t num) floorcolormap = ceilingcolormap = frontsector->extra_colormap; - floorcenterz = -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + floorcenterz = frontsector->f_slope ? + P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : frontsector->floorheight; - ceilingcenterz = -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + ceilingcenterz = frontsector->c_slope ? + P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : frontsector->ceilingheight; // Check and prep all 3D floors. Set the sector floor/ceiling light levels and colormaps. @@ -899,34 +891,23 @@ static void R_Subsector(size_t num) sub->sector->extra_colormap = frontsector->extra_colormap; - if ((( -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : -#endif - frontsector->floorheight) < viewz || frontsector->floorpic == skyflatnum - || (frontsector->heightsec != -1 - && sectors[frontsector->heightsec].ceilingpic == skyflatnum))) + if ((frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : frontsector->floorheight) < viewz + || frontsector->floorpic == skyflatnum + || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum)) { floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel, frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , frontsector->f_slope -#endif - ); + , frontsector->f_slope); } else floorplane = NULL; - if ((( -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : -#endif - frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum - || (frontsector->heightsec != -1 - && sectors[frontsector->heightsec].floorpic == skyflatnum))) + if ((frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : frontsector->ceilingheight) > viewz + || frontsector->ceilingpic == skyflatnum + || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].floorpic == skyflatnum)) { ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic, ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle, @@ -934,18 +915,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , frontsector->c_slope -#endif - ); + , frontsector->c_slope); } else ceilingplane = NULL; numffloors = 0; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; if (frontsector->ffloors) @@ -970,16 +946,12 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - heightcheck = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : -#endif + heightcheck = *rover->b_slope ? + P_GetZAt(*rover->b_slope, viewx, viewy) : *rover->bottomheight; - planecenterz = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + planecenterz = *rover->b_slope ? + P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) : *rover->bottomheight; if (planecenterz <= ceilingcenterz && planecenterz >= floorcenterz @@ -995,18 +967,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , *rover->b_slope -#endif - ); + , *rover->b_slope); -#ifdef ESLOPE ffloor[numffloors].slope = *rover->b_slope; // Tell the renderer this sector has slopes in it. if (ffloor[numffloors].slope) frontsector->hasslope = true; -#endif ffloor[numffloors].height = heightcheck; ffloor[numffloors].ffloor = rover; @@ -1017,16 +984,12 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - heightcheck = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) : -#endif + heightcheck = *rover->t_slope ? + P_GetZAt(*rover->t_slope, viewx, viewy) : *rover->topheight; - planecenterz = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + planecenterz = *rover->t_slope ? + P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) : *rover->topheight; if (planecenterz >= floorcenterz && planecenterz <= ceilingcenterz @@ -1041,18 +1004,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , *rover->t_slope -#endif - ); + , *rover->t_slope); -#ifdef ESLOPE ffloor[numffloors].slope = *rover->t_slope; // Tell the renderer this sector has slopes in it. if (ffloor[numffloors].slope) frontsector->hasslope = true; -#endif ffloor[numffloors].height = heightcheck; ffloor[numffloors].ffloor = rover; @@ -1090,18 +1048,13 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs, polysec->floorpic_angle-po->angle, - (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po -#ifdef ESLOPE - , NULL // will ffloors be slopable eventually? -#endif - ); + (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, + NULL); // will ffloors be slopable eventually? ffloor[numffloors].height = polysec->floorheight; ffloor[numffloors].polyobj = po; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif -// ffloor[numffloors].ffloor = rover; + //ffloor[numffloors].ffloor = rover; po->visplane = ffloor[numffloors].plane; numffloors++; } @@ -1118,18 +1071,13 @@ static void R_Subsector(size_t num) light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle, - (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po -#ifdef ESLOPE - , NULL // will ffloors be slopable eventually? -#endif - ); + (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, + NULL); // will ffloors be slopable eventually? ffloor[numffloors].polyobj = po; ffloor[numffloors].height = polysec->ceilingheight; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif -// ffloor[numffloors].ffloor = rover; + //ffloor[numffloors].ffloor = rover; po->visplane = ffloor[numffloors].plane; numffloors++; } @@ -1192,11 +1140,9 @@ void R_Prep3DFloors(sector_t *sector) fixed_t bestheight, maxheight; INT32 count, i; sector_t *sec; -#ifdef ESLOPE pslope_t *bestslope = NULL; fixed_t heighttest; // I think it's better to check the Z height at the sector's center // than assume unsloped heights are accurate indicators of order in sloped sectors. -Red -#endif count = 1; for (rover = sector->ffloors; rover; rover = rover->next) @@ -1219,14 +1165,10 @@ void R_Prep3DFloors(sector_t *sector) else memset(sector->lightlist, 0, sizeof (lightlist_t) * count); -#ifdef ESLOPE heighttest = sector->c_slope ? P_GetZAt(sector->c_slope, sector->soundorg.x, sector->soundorg.y) : sector->ceilingheight; sector->lightlist[0].height = heighttest + 1; sector->lightlist[0].slope = sector->c_slope; -#else - sector->lightlist[0].height = sector->ceilingheight + 1; -#endif sector->lightlist[0].lightlevel = §or->lightlevel; sector->lightlist[0].caster = NULL; sector->lightlist[0].extra_colormap = §or->extra_colormap; @@ -1244,7 +1186,6 @@ void R_Prep3DFloors(sector_t *sector) && !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES))) continue; -#ifdef ESLOPE heighttest = *rover->t_slope ? P_GetZAt(*rover->t_slope, sector->soundorg.x, sector->soundorg.y) : *rover->topheight; if (heighttest > bestheight && heighttest < maxheight) @@ -1266,21 +1207,6 @@ void R_Prep3DFloors(sector_t *sector) continue; } } -#else - if (*rover->topheight > bestheight && *rover->topheight < maxheight) - { - best = rover; - bestheight = *rover->topheight; - continue; - } - if (rover->flags & FF_DOUBLESHADOW && *rover->bottomheight > bestheight - && *rover->bottomheight < maxheight) - { - best = rover; - bestheight = *rover->bottomheight; - continue; - } -#endif } if (!best) { @@ -1291,9 +1217,7 @@ void R_Prep3DFloors(sector_t *sector) sector->lightlist[i].height = maxheight = bestheight; sector->lightlist[i].caster = best; sector->lightlist[i].flags = best->flags; -#ifdef ESLOPE sector->lightlist[i].slope = bestslope; -#endif sec = §ors[best->secnum]; if (best->flags & FF_NOSHADE) @@ -1314,12 +1238,8 @@ void R_Prep3DFloors(sector_t *sector) if (best->flags & FF_DOUBLESHADOW) { -#ifdef ESLOPE heighttest = *best->b_slope ? P_GetZAt(*best->b_slope, sector->soundorg.x, sector->soundorg.y) : *best->bottomheight; if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red -#else - if (bestheight == *best->bottomheight) -#endif { sector->lightlist[i].lightlevel = sector->lightlist[best->lastlight].lightlevel; sector->lightlist[i].extra_colormap = diff --git a/src/r_defs.h b/src/r_defs.h index e6f1e4e7c..0c6ff1d30 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -171,11 +171,9 @@ typedef struct ffloor_s fixed_t *bottomyoffs; angle_t *bottomangle; -#ifdef ESLOPE // Pointers to pointers. Yup. struct pslope_s **t_slope; struct pslope_s **b_slope; -#endif size_t secnum; ffloortype_e flags; @@ -208,9 +206,7 @@ typedef struct lightlist_s extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes INT32 flags; ffloor_t *caster; -#ifdef ESLOPE struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh. -#endif } lightlist_t; @@ -244,7 +240,6 @@ typedef struct linechain_s // Slopes -#ifdef ESLOPE typedef enum { SL_NOPHYSICS = 1, /// This plane will have no physics applied besides the positioning. SL_DYNAMIC = 1<<1, /// This plane slope will be assigned a thinker to make it dynamic. @@ -268,7 +263,6 @@ typedef struct pslope_s UINT8 flags; // Slope options } pslope_t; -#endif typedef enum { @@ -379,12 +373,10 @@ typedef struct sector_s precipmobj_t *preciplist; struct mprecipsecnode_s *touching_preciplist; -#ifdef ESLOPE // Eternity engine slope pslope_t *f_slope; // floor slope pslope_t *c_slope; // ceiling slope boolean hasslope; // The sector, or one of its visible FOFs, contains a slope -#endif // for fade thinker INT16 spawn_lightlevel; @@ -668,11 +660,9 @@ typedef struct drawseg_s UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping -#ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures vertex_t leftpos, rightpos; // Used for rendering FOF walls with slopes -#endif } drawseg_t; typedef enum diff --git a/src/r_draw.c b/src/r_draw.c index f46f4fb13..b983db0aa 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -105,12 +105,10 @@ boolean ds_powersoftwo; UINT8 *ds_source; // start of a 64*64 tile image UINT8 *ds_transmap; // one of the translucency tables -#ifdef ESLOPE pslope_t *ds_slope; // Current slope being used floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff? floatv3_t *ds_sup, *ds_svp, *ds_szp; float focallengthf, zeroheight; -#endif /** \brief Variable flat sizes */ diff --git a/src/r_draw.h b/src/r_draw.h index 870d294c3..4d94f861b 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -62,7 +62,6 @@ extern boolean ds_powersoftwo; extern UINT8 *ds_source; extern UINT8 *ds_transmap; -#ifdef ESLOPE typedef struct { float x, y, z; } floatv3_t; @@ -71,7 +70,6 @@ extern pslope_t *ds_slope; // Current slope being used extern floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff? extern floatv3_t *ds_sup, *ds_svp, *ds_szp; extern float focallengthf, zeroheight; -#endif // Variable flat sizes extern UINT32 nflatxshift; @@ -152,7 +150,6 @@ void R_DrawSpan_8(void); void R_DrawSplat_8(void); void R_DrawTranslucentSpan_8(void); void R_DrawTranslucentSplat_8(void); -#ifdef ESLOPE void R_DrawTiltedSpan_8(void); void R_DrawTiltedTranslucentSpan_8(void); #ifndef NOWATER @@ -161,7 +158,6 @@ void R_DrawTiltedTranslucentWaterSpan_8(void); void R_DrawTiltedSplat_8(void); void R_CalcTiltedLighting(fixed_t start, fixed_t end); extern INT32 tiltlighting[MAXVIDWIDTH]; -#endif #ifndef NOWATER void R_DrawTranslucentWaterSpan_8(void); extern INT32 ds_bgofs; @@ -174,14 +170,12 @@ void R_DrawSpan_NPO2_8(void); void R_DrawTranslucentSpan_NPO2_8(void); void R_DrawSplat_NPO2_8(void); void R_DrawTranslucentSplat_NPO2_8(void); -#ifdef ESLOPE void R_DrawTiltedSpan_NPO2_8(void); void R_DrawTiltedTranslucentSpan_NPO2_8(void); #ifndef NOWATER void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void); #endif void R_DrawTiltedSplat_NPO2_8(void); -#endif #ifndef NOWATER void R_DrawTranslucentWaterSpan_NPO2_8(void); #endif diff --git a/src/r_draw8.c b/src/r_draw8.c index fe0a23770..940ea724b 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -620,7 +620,6 @@ void R_DrawSpan_8 (void) } } -#ifdef ESLOPE // R_CalcTiltedLighting // Exactly what it says on the tin. I wish I wasn't too lazy to explain things properly. INT32 tiltlighting[MAXVIDWIDTH]; @@ -1199,7 +1198,6 @@ void R_DrawTiltedSplat_8(void) } #endif } -#endif // ESLOPE /** \brief The R_DrawSplat_8 function Just like R_DrawSpan_8, but skips transparent pixels. diff --git a/src/r_draw8_npo2.c b/src/r_draw8_npo2.c index b91f492f2..020155694 100644 --- a/src/r_draw8_npo2.c +++ b/src/r_draw8_npo2.c @@ -61,8 +61,6 @@ void R_DrawSpan_NPO2_8 (void) } } -#ifdef ESLOPE - #define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan)) /** \brief The R_DrawTiltedSpan_NPO2_8 function @@ -661,7 +659,6 @@ void R_DrawTiltedSplat_NPO2_8(void) } #endif } -#endif // ESLOPE /** \brief The R_DrawSplat_NPO2_8 function Just like R_DrawSpan_NPO2_8, but skips transparent pixels. @@ -846,7 +843,6 @@ void R_DrawTranslucentWaterSpan_NPO2_8(void) } } -#ifdef ESLOPE /** \brief The R_DrawTiltedTranslucentWaterSpan_NPO2_8 function Like DrawTiltedTranslucentSpan_NPO2, but for water */ @@ -1043,5 +1039,4 @@ void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void) } #endif } -#endif // ESLOPE #endif // NOWATER diff --git a/src/r_main.c b/src/r_main.c index 409a82f28..9a3d98870 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -459,9 +459,7 @@ static void R_InitTextureMapping(void) focallength = FixedDiv(projection, FINETANGENT(FINEANGLES/4+FIELDOFVIEW/2)); -#ifdef ESLOPE focallengthf = FIXED_TO_FLOAT(focallength); -#endif for (i = 0; i < FINEANGLES/2; i++) { diff --git a/src/r_plane.c b/src/r_plane.c index e1e45517a..ca5aa758e 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -202,7 +202,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) // Needed for ds_bgofs R_PlaneRipple(currentplane, y, planeheight); -#ifdef ESLOPE if (currentplane->slope) { ds_sup = &ds_su[y]; @@ -210,7 +209,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) ds_szp = &ds_sz[y]; } else -#endif { ds_xfrac += ripple_xfrac; ds_yfrac += ripple_yfrac; @@ -227,12 +225,10 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) if (pindex >= MAXLIGHTZ) pindex = MAXLIGHTZ - 1; -#ifdef ESLOPE if (currentplane->slope) ds_colormap = colormaps; else -#endif - ds_colormap = planezlight[pindex]; + ds_colormap = planezlight[pindex]; if (currentplane->extra_colormap) ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps); @@ -345,17 +341,12 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef POLYOBJECTS_PLANES , polyobj_t *polyobj #endif -#ifdef ESLOPE - , pslope_t *slope -#endif - ) + , pslope_t *slope) { visplane_t *check; unsigned hash; -#ifdef ESLOPE - if (slope); else // Don't mess with this right now if a slope is involved -#endif + if (!slope) // Don't mess with this right now if a slope is involved { xoff += viewx; yoff -= viewy; @@ -413,10 +404,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewangle == viewangle && check->plangle == plangle -#ifdef ESLOPE - && check->slope == slope -#endif - ) + && check->slope == slope) { return check; } @@ -441,9 +429,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef POLYOBJECTS_PLANES check->polyobj = polyobj; #endif -#ifdef ESLOPE check->slope = slope; -#endif memset(check->top, 0xff, sizeof (check->top)); memset(check->bottom, 0x00, sizeof (check->bottom)); @@ -513,9 +499,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop) #ifdef POLYOBJECTS_PLANES new_pl->polyobj = pl->polyobj; #endif -#ifdef ESLOPE new_pl->slope = pl->slope; -#endif pl = new_pl; pl->minx = start; pl->maxx = stop; @@ -860,7 +844,6 @@ static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boo return flat; } -#ifdef ESLOPE static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) { // Potentially override other stuff for now cus we're mean. :< But draw a slope plane! @@ -951,7 +934,6 @@ d.z = (v1.x * v2.y) - (v1.y * v2.x) } #undef SFMULT } -#endif // ESLOPE void R_DrawSinglePlane(visplane_t *pl) { @@ -1087,10 +1069,8 @@ void R_DrawSinglePlane(visplane_t *pl) } else light = (pl->lightlevel >> LIGHTSEGSHIFT); -#ifdef ESLOPE - if (!pl->slope) // Don't mess with angle on slopes! We'll handle this ourselves later -#endif - if (viewangle != pl->viewangle+pl->plangle) + if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later + && viewangle != pl->viewangle+pl->plangle) { memset(cachedheight, 0, sizeof (cachedheight)); angle = (pl->viewangle+pl->plangle-ANGLE_90)>>ANGLETOFINESHIFT; @@ -1148,7 +1128,6 @@ void R_DrawSinglePlane(visplane_t *pl) if (light < 0) light = 0; -#ifdef ESLOPE if (pl->slope) { float fudgecanyon = 0; @@ -1248,10 +1227,9 @@ void R_DrawSinglePlane(visplane_t *pl) spanfunctype = SPANDRAWFUNC_TILTED; planezlight = scalelight[light]; - } else -#endif // ESLOPE - - planezlight = zlight[light]; + } + else + planezlight = zlight[light]; // Use the correct span drawer depending on the powers-of-twoness if (!ds_powersoftwo) diff --git a/src/r_plane.h b/src/r_plane.h index 405dd9726..a1a5b7a78 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -50,9 +50,7 @@ typedef struct visplane_s #ifdef POLYOBJECTS_PLANES polyobj_t *polyobj; #endif -#ifdef ESLOPE pslope_t *slope; -#endif } visplane_t; extern visplane_t *visplanes[MAXVISPLANES]; @@ -86,10 +84,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t #ifdef POLYOBJECTS_PLANES , polyobj_t *polyobj #endif -#ifdef ESLOPE - , pslope_t *slope -#endif - ); + , pslope_t *slope); visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop); void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop); void R_PlaneBounds(visplane_t *plane); @@ -110,13 +105,11 @@ typedef struct planemgr_s INT16 f_clip[MAXVIDWIDTH]; INT16 c_clip[MAXVIDWIDTH]; -#ifdef ESLOPE // For slope rendering; the height at the other end fixed_t f_pos_slope; fixed_t b_pos_slope; struct pslope_s *slope; -#endif struct ffloor_s *ffloor; #ifdef POLYOBJECTS_PLANES diff --git a/src/r_segs.c b/src/r_segs.c index 0233b1161..d8f1981ee 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -52,20 +52,16 @@ static fixed_t rw_offset2; // for splats static fixed_t rw_scale, rw_scalestep; static fixed_t rw_midtexturemid, rw_toptexturemid, rw_bottomtexturemid; static INT32 worldtop, worldbottom, worldhigh, worldlow; -#ifdef ESLOPE static INT32 worldtopslope, worldbottomslope, worldhighslope, worldlowslope; // worldtop/bottom at end of slope static fixed_t rw_toptextureslide, rw_midtextureslide, rw_bottomtextureslide; // Defines how to adjust Y offsets along the wall for slopes static fixed_t rw_midtextureback, rw_midtexturebackslide; // Values for masked midtexture height calculation -#endif static fixed_t pixhigh, pixlow, pixhighstep, pixlowstep; static fixed_t topfrac, topstep; static fixed_t bottomfrac, bottomstep; static lighttable_t **walllights; static INT16 *maskedtexturecol; -#ifdef ESLOPE static fixed_t *maskedtextureheight = NULL; -#endif // ========================================================================== // R_Splats Wall Splats Drawer @@ -299,9 +295,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) sector_t *front, *back; INT32 times, repeats; INT64 overflow_test; -#ifdef ESLOPE INT32 range; -#endif // Calculate light table. // Use different light tables @@ -349,9 +343,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) colfunc = colfuncs[COLDRAWFUNC_FUZZY]; } -#ifdef ESLOPE range = max(ds->x2-ds->x1, 1); -#endif rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; @@ -389,12 +381,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) for (i = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[i]; -#ifdef ESLOPE if (light->slope) { leftheight = P_GetZAt(light->slope, ds->leftpos.x, ds->leftpos.y); rightheight = P_GetZAt(light->slope, ds->rightpos.x, ds->rightpos.y); @@ -409,10 +398,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) rlight->heightstep = (rlight->heightstep-rlight->height)/(range); //if (x1 > ds->x1) //rlight->height -= (x1 - ds->x1)*rlight->heightstep; -#else - rlight->height = (centeryfrac) - FixedMul((light->height - viewz), spryscale); - rlight->heightstep = -FixedMul(rw_scalestep, (light->height - viewz)); -#endif rlight->startheight = rlight->height; // keep starting value here to reset for each repeat rlight->lightlevel = *light->lightlevel; rlight->extra_colormap = *light->extra_colormap; @@ -513,40 +498,17 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) } } -#ifndef ESLOPE - if (curline->linedef->flags & ML_DONTPEGBOTTOM) - { - dc_texturemid = front->floorheight > back->floorheight - ? front->floorheight : back->floorheight; - dc_texturemid = dc_texturemid + textureheight[texnum] - viewz; - } - else - { - dc_texturemid = front->ceilingheight < back->ceilingheight - ? front->ceilingheight : back->ceilingheight; - dc_texturemid = dc_texturemid - viewz; - } - dc_texturemid += curline->sidedef->rowoffset; - - if (curline->linedef->flags & ML_DONTPEGBOTTOM) - dc_texturemid += (textureheight[texnum])*times; - else - dc_texturemid -= (textureheight[texnum])*times; -#endif - dc_texheight = textureheight[texnum]>>FRACBITS; // draw the columns for (dc_x = x1; dc_x <= x2; dc_x++) { -#ifdef ESLOPE dc_texturemid = ds->maskedtextureheight[dc_x]; if (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3)) dc_texturemid += (textureheight[texnum])*times + textureheight[texnum]; else dc_texturemid -= (textureheight[texnum])*times; -#endif // calculate lighting if (maskedtexturecol[dc_x] != INT16_MAX) { @@ -755,14 +717,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) fixed_t offsetvalue = 0; lightlist_t *light; r_lightlist_t *rlight; -#ifdef ESLOPE INT32 range; -#endif -#ifndef ESLOPE - fixed_t lheight; -#endif line_t *newline = NULL; -#ifdef ESLOPE // Render FOF sides kinda like normal sides, with the frac and step and everything // NOTE: INT64 instead of fixed_t because overflow concerns INT64 top_frac, top_step, bottom_frac, bottom_step; @@ -772,7 +728,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) INT32 oldx = -1; fixed_t left_top, left_bottom; // needed here for slope skewing pslope_t *skewslope = NULL; -#endif void (*colfunc_2s) (column_t *); @@ -829,9 +784,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (pfloor->flags & FF_FOG) colfunc = colfuncs[COLDRAWFUNC_FOG]; -#ifdef ESLOPE range = max(ds->x2-ds->x1, 1); -#endif //SoM: Moved these up here so they are available for my lightlist calculations rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; @@ -848,14 +801,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) for (i = p = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; fixed_t pfloorleft, pfloorright; INT64 overflow_test; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[p]; -#ifdef ESLOPE #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ @@ -896,21 +846,9 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (overflow_test > (INT64)CLAMPMIN) rlight->heightstep = (fixed_t)overflow_test; else rlight->heightstep = CLAMPMIN; rlight->heightstep = (rlight->heightstep-rlight->height)/(range); -#else - if (light->height < *pfloor->bottomheight) - continue; - - if (light->height > *pfloor->topheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > *pfloor->topheight) - continue; - - lheight = light->height;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : light->height; - rlight->heightstep = -FixedMul (rw_scalestep, (lheight - viewz)); - rlight->height = (centeryfrac) - FixedMul((lheight - viewz), spryscale); -#endif rlight->flags = light->flags; if (light->flags & FF_CUTLEVEL) { -#ifdef ESLOPE SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight) #undef SLOPEPARAMS leftheight -= viewz; @@ -927,11 +865,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (overflow_test > (INT64)CLAMPMIN) rlight->botheightstep = (fixed_t)overflow_test; else rlight->botheightstep = CLAMPMIN; rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range); -#else - lheight = *light->caster->bottomheight;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : *light->caster->bottomheight; - rlight->botheightstep = -FixedMul (rw_scalestep, (lheight - viewz)); - rlight->botheight = (centeryfrac) - FixedMul((lheight - viewz), spryscale); -#endif } rlight->lightlevel = *light->lightlevel; @@ -988,7 +921,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) mceilingclip = ds->sprtopclip; dc_texheight = textureheight[texnum]>>FRACBITS; -#ifdef ESLOPE // calculate both left ends if (*pfloor->t_slope) left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; @@ -1011,21 +943,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (slopeskew) dc_texturemid = left_top; else -#endif - dc_texturemid = *pfloor->topheight - viewz; + dc_texturemid = *pfloor->topheight - viewz; if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE skewslope = *pfloor->b_slope; // skew using bottom slope if (slopeskew) dc_texturemid = left_bottom; else -#endif - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; } } else @@ -1033,17 +962,14 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE skewslope = *pfloor->b_slope; // skew using bottom slope if (slopeskew) dc_texturemid = left_bottom; else -#endif - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; } } -#ifdef ESLOPE if (slopeskew) { angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y); @@ -1051,7 +977,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (skewslope) ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT)); } -#endif dc_texturemid += offsetvalue; @@ -1076,7 +1001,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) column2s_length = textures[texnum]->height; } -#ifdef ESLOPE // Set heights according to plane, or slope, whichever { fixed_t right_top, right_bottom; @@ -1104,24 +1028,20 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) top_frac += top_step * (x1 - ds->x1); bottom_frac += bottom_step * (x1 - ds->x1); } -#endif // draw the columns for (dc_x = x1; dc_x <= x2; dc_x++) { if (maskedtexturecol[dc_x] != INT16_MAX) { -#ifdef ESLOPE if (ffloortextureslide) { // skew FOF walls if (oldx != -1) dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])< (INT64)CLAMPMAX) sprtopscreen = windowtop = CLAMPMAX; else if (top_frac > (INT64)CLAMPMIN) sprtopscreen = windowtop = (fixed_t)top_frac; else sprtopscreen = windowtop = CLAMPMIN; @@ -1131,10 +1051,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) top_frac += top_step; bottom_frac += bottom_step; -#else - sprtopscreen = windowtop = (centeryfrac - FixedMul((dc_texturemid - offsetvalue), spryscale)); - sprbotscreen = windowbottom = FixedMul(*pfloor->topheight - *pfloor->bottomheight, spryscale) + sprtopscreen; -#endif // SoM: If column is out of range, why bother with it?? if (windowbottom < topbounds || windowtop > bottombounds) @@ -1344,9 +1260,7 @@ static void R_RenderSegLoop (void) INT32 mid; fixed_t texturecolumn = 0; -#ifdef ESLOPE fixed_t oldtexturecolumn = -1; -#endif INT32 top; INT32 bottom; INT32 i; @@ -1466,7 +1380,6 @@ static void R_RenderSegLoop (void) angle = (rw_centerangle + xtoviewangle[rw_x])>>ANGLETOFINESHIFT; texturecolumn = rw_offset-FixedMul(FINETANGENT(angle),rw_distance); -#ifdef ESLOPE if (oldtexturecolumn != -1) { rw_bottomtexturemid += FixedMul(rw_bottomtextureslide, oldtexturecolumn-texturecolumn); rw_midtexturemid += FixedMul(rw_midtextureslide, oldtexturecolumn-texturecolumn); @@ -1474,7 +1387,6 @@ static void R_RenderSegLoop (void) rw_midtextureback += FixedMul(rw_midtexturebackslide, oldtexturecolumn-texturecolumn); } oldtexturecolumn = texturecolumn; -#endif texturecolumn >>= FRACBITS; @@ -1650,13 +1562,11 @@ static void R_RenderSegLoop (void) // for backdrawing of masked mid texture maskedtexturecol[rw_x] = (INT16)texturecolumn; -#ifdef ESLOPE if (maskedtextureheight != NULL) { maskedtextureheight[rw_x] = (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3) ? max(rw_midtexturemid, rw_midtextureback) : min(rw_midtexturemid, rw_midtextureback)); } -#endif } if (dc_numlights) @@ -1712,26 +1622,19 @@ void R_StoreWallRange(INT32 start, INT32 stop) fixed_t sineval; angle_t distangle, offsetangle; boolean longboi; -#ifndef ESLOPE - fixed_t vtop; -#endif INT32 lightnum; INT32 i, p; lightlist_t *light; r_lightlist_t *rlight; INT32 range; -#ifdef ESLOPE vertex_t segleft, segright; fixed_t ceilingfrontslide, floorfrontslide, ceilingbackslide, floorbackslide; -#endif static size_t maxdrawsegs = 0; -#ifdef ESLOPE maskedtextureheight = NULL; //initialize segleft and segright memset(&segleft, 0x00, sizeof(segleft)); memset(&segright, 0x00, sizeof(segright)); -#endif colfunc = colfuncs[BASEDRAWFUNC]; @@ -1841,7 +1744,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) // calculate texture boundaries // and decide if floor / ceiling marks are needed -#ifdef ESLOPE // Figure out map coordinates of where start and end are mapping to on seg, so we can clip right for slope bullshit if (frontsector->hasslope || (backsector && backsector->hasslope)) // Commenting this out for FOFslop. -Red { @@ -1908,10 +1810,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldtopslope -= viewz; worldbottom -= viewz; worldbottomslope -= viewz; -#else - worldtop = frontsector->ceilingheight - viewz; - worldbottom = frontsector->floorheight - viewz; -#endif midtexture = toptexture = bottomtexture = maskedtexture = 0; ds_p->maskedtexturecol = NULL; @@ -1933,18 +1831,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; #endif -#ifdef ESLOPE if (ffloor[i].slope) { ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz; ffloor[i].f_pos_slope = P_GetZAt(ffloor[i].slope, segright.x, segright.y) - viewz; - } else - ffloor[i].f_pos_slope = -#endif - ffloor[i].f_pos = ffloor[i].height - viewz; + } + else + ffloor[i].f_pos_slope = ffloor[i].f_pos = ffloor[i].height - viewz; } } -#ifdef ESLOPE // Set up texture Y offset slides for sloped walls rw_toptextureslide = rw_midtextureslide = rw_bottomtextureslide = 0; ceilingfrontslide = floorfrontslide = ceilingbackslide = floorbackslide = 0; @@ -1964,7 +1859,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (backsector && backsector->c_slope) ceilingbackslide = FixedMul(backsector->c_slope->zdelta, FINECOSINE((lineangle-backsector->c_slope->xydirection)>>ANGLETOFINESHIFT)); } -#endif if (!backsector) { @@ -1974,33 +1868,22 @@ void R_StoreWallRange(INT32 start, INT32 stop) texheight = textureheight[midtexture]; // a single sided line is terminal, so it must mark ends markfloor = markceiling = true; -#ifdef ESLOPE if (linedef->flags & ML_EFFECT2) { if (linedef->flags & ML_DONTPEGBOTTOM) rw_midtexturemid = frontsector->floorheight + texheight - viewz; else rw_midtexturemid = frontsector->ceilingheight - viewz; } - else -#endif - if (linedef->flags & ML_DONTPEGBOTTOM) + else if (linedef->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE rw_midtexturemid = worldbottom + texheight; rw_midtextureslide = floorfrontslide; -#else - vtop = frontsector->floorheight + texheight; - // bottom of texture at bottom - rw_midtexturemid = vtop - viewz; -#endif } else { // top of texture at top rw_midtexturemid = worldtop; -#ifdef ESLOPE rw_midtextureslide = ceilingfrontslide; -#endif } rw_midtexturemid += sidedef->rowoffset; @@ -2016,17 +1899,12 @@ void R_StoreWallRange(INT32 start, INT32 stop) boolean bothceilingssky = false; // turned on if both back and front ceilings are sky boolean bothfloorssky = false; // likewise, but for floors -#ifdef ESLOPE SLOPEPARAMS(backsector->c_slope, worldhigh, worldhighslope, backsector->ceilingheight) SLOPEPARAMS(backsector->f_slope, worldlow, worldlowslope, backsector->floorheight) worldhigh -= viewz; worldhighslope -= viewz; worldlow -= viewz; worldlowslope -= viewz; -#else - worldhigh = backsector->ceilingheight - viewz; - worldlow = backsector->floorheight - viewz; -#endif // hack to allow height changes in outdoor areas // This is what gets rid of the upper textures if there should be sky @@ -2048,27 +1926,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothfloorssky) { - if ( -#ifdef ESLOPE - worldbottomslope > worldlowslope || -#endif - worldbottom > worldlow) + if (worldbottomslope > worldlowslope || worldbottom > worldlow) { ds_p->silhouette = SIL_BOTTOM; -#ifdef ESLOPE if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz) ds_p->bsilheight = INT32_MAX; else ds_p->bsilheight = (frontsector->f_slope ? INT32_MAX : frontsector->floorheight); -#else - ds_p->bsilheight = frontsector->floorheight; -#endif } -#ifdef ESLOPE else if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz) -#else - else if (backsector->floorheight > viewz) -#endif { ds_p->silhouette = SIL_BOTTOM; ds_p->bsilheight = INT32_MAX; @@ -2078,27 +1944,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky) { - if ( -#ifdef ESLOPE - worldtopslope < worldhighslope || -#endif - worldtop < worldhigh) + if (worldtopslope < worldhighslope || worldtop < worldhigh) { ds_p->silhouette |= SIL_TOP; -#ifdef ESLOPE if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz) ds_p->tsilheight = INT32_MIN; else ds_p->tsilheight = (frontsector->c_slope ? INT32_MIN : frontsector->ceilingheight); -#else - ds_p->tsilheight = frontsector->ceilingheight; -#endif } -#ifdef ESLOPE else if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz) -#else - else if (backsector->ceilingheight < viewz) -#endif { ds_p->silhouette |= SIL_TOP; ds_p->tsilheight = INT32_MIN; @@ -2108,22 +1962,14 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) -#else - if (worldhigh <= worldbottom) -#endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } -#ifdef ESLOPE if (worldlow >= worldtop && worldlowslope >= worldtopslope) -#else - if (worldlow >= worldtop) -#endif { ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; @@ -2136,21 +1982,13 @@ void R_StoreWallRange(INT32 start, INT32 stop) // Without the following code, sprites get displayed behind closed doors. if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) -#else - if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) -#endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } -#ifdef ESLOPE if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) -#else - if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) -#endif { // killough 1/17/98, 2/8/98 ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; @@ -2165,10 +2003,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) markfloor = false; } else if (worldlow != worldbottom -#ifdef ESLOPE || worldlowslope != worldbottomslope || backsector->f_slope != frontsector->f_slope -#endif || backsector->floorpic != frontsector->floorpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. @@ -2198,10 +2034,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) markceiling = false; } else if (worldhigh != worldtop -#ifdef ESLOPE || worldhighslope != worldtopslope || backsector->c_slope != frontsector->c_slope -#endif || backsector->ceilingpic != frontsector->ceilingpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. @@ -2225,13 +2059,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) || (worldlow >= worldtop && worldlowslope >= worldtopslope)) -#else - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) -#endif { // closed door markceiling = markfloor = true; @@ -2240,11 +2069,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // check TOP TEXTURE if (!bothceilingssky // never draw the top texture if on - && (worldhigh < worldtop -#ifdef ESLOPE - || worldhighslope < worldtopslope -#endif - )) + && (worldhigh < worldtop || worldhighslope < worldtopslope)) { fixed_t texheight; // top texture @@ -2264,67 +2089,47 @@ void R_StoreWallRange(INT32 start, INT32 stop) toptexture = R_GetTextureNum(sidedef->toptexture); texheight = textureheight[toptexture]; } -#ifdef ESLOPE if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked if (linedef->flags & ML_DONTPEGTOP) rw_toptexturemid = frontsector->ceilingheight - viewz; else rw_toptexturemid = backsector->ceilingheight - viewz; - } else -#endif - if (linedef->flags & ML_DONTPEGTOP) + } + else if (linedef->flags & ML_DONTPEGTOP) { // top of texture at top rw_toptexturemid = worldtop; -#ifdef ESLOPE rw_toptextureslide = ceilingfrontslide; -#endif } else { -#ifdef ESLOPE rw_toptexturemid = worldhigh + texheight; rw_toptextureslide = ceilingbackslide; -#else - vtop = backsector->ceilingheight + texheight; - // bottom of texture - rw_toptexturemid = vtop - viewz; -#endif } } // check BOTTOM TEXTURE if (!bothfloorssky // never draw the bottom texture if on - && (worldlow > worldbottom -#ifdef ESLOPE - || worldlowslope > worldbottomslope -#endif - )) //seulement si VISIBLE!!! + && (worldlow > worldbottom || worldlowslope > worldbottomslope)) // Only if VISIBLE!!! { // bottom texture bottomtexture = R_GetTextureNum(sidedef->bottomtexture); -#ifdef ESLOPE if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked if (linedef->flags & ML_DONTPEGBOTTOM) rw_bottomtexturemid = frontsector->floorheight - viewz; else rw_bottomtexturemid = backsector->floorheight - viewz; - } else -#endif - if (linedef->flags & ML_DONTPEGBOTTOM) + } + else if (linedef->flags & ML_DONTPEGBOTTOM) { // bottom of texture at bottom // top of texture at top rw_bottomtexturemid = worldbottom; -#ifdef ESLOPE rw_bottomtextureslide = floorfrontslide; -#endif } else { // top of texture at top rw_bottomtexturemid = worldlow; -#ifdef ESLOPE rw_bottomtextureslide = floorbackslide; -#endif } } @@ -2337,12 +2142,10 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor_t *rover; ffloor_t *r2; fixed_t lowcut, highcut; -#ifdef ESLOPE fixed_t lowcutslope, highcutslope; // Used for height comparisons and etc across FOFs and slopes fixed_t high1, highslope1, low1, lowslope1, high2, highslope2, low2, lowslope2; -#endif //markceiling = markfloor = true; maskedtexture = true; @@ -2352,10 +2155,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) lowcut = max(worldbottom, worldlow) + viewz; highcut = min(worldtop, worldhigh) + viewz; -#ifdef ESLOPE lowcutslope = max(worldbottomslope, worldlowslope) + viewz; highcutslope = min(worldtopslope, worldhighslope) + viewz; -#endif if (frontsector->ffloors && backsector->ffloors) { @@ -2370,16 +2171,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight) if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope)) continue; -#else - if (*rover->topheight < lowcut || *rover->bottomheight > highcut) - continue; -#endif for (r2 = frontsector->ffloors; r2; r2 = r2->next) { @@ -2403,7 +2199,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; } -#ifdef ESLOPE SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) @@ -2411,12 +2206,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) continue; -#else - if (*r2->topheight < lowcut || *r2->bottomheight > highcut) - continue; - if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight) - continue; -#endif break; } @@ -2437,16 +2226,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight) if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope)) continue; -#else - if (*rover->topheight < lowcut || *rover->bottomheight > highcut) - continue; -#endif for (r2 = backsector->ffloors; r2; r2 = r2->next) { @@ -2470,7 +2254,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; } -#ifdef ESLOPE SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) #undef SLOPEPARAMS @@ -2478,12 +2261,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) continue; -#else - if (*r2->topheight < lowcut || *r2->bottomheight > highcut) - continue; - if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight) - continue; -#endif break; } @@ -2503,17 +2280,12 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Oy vey. - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldbottom + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldbottomslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope + viewz)) continue; -#else - if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight) - continue; -#endif ds_p->thicksides[i] = rover; i++; @@ -2527,25 +2299,18 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Oy vey. - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldbottom + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldbottomslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope + viewz)) continue; - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldlow+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldlowslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldhigh+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldlow + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldlowslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldhigh + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope + viewz)) continue; -#else - if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight) - continue; - if (*rover->topheight <= backsector->floorheight || *rover->bottomheight >= backsector->ceilingheight) - continue; -#endif ds_p->thicksides[i] = rover; i++; @@ -2565,7 +2330,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) else ds_p->maskedtexturecol = ds_p->thicksidecol; -#ifdef ESLOPE maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0]) #ifdef POLYOBJECTS @@ -2598,7 +2362,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) } rw_midtexturemid += sidedef->rowoffset; rw_midtextureback += sidedef->rowoffset; -#endif maskedtexture = true; } @@ -2662,22 +2425,16 @@ void R_StoreWallRange(INT32 start, INT32 stop) // and doesn't need to be marked. if (frontsector->heightsec == -1) { - if (frontsector->floorpic != skyflatnum - && ( -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : -#endif + if (frontsector->floorpic != skyflatnum && (frontsector->f_slope ? + P_GetZAt(frontsector->f_slope, viewx, viewy) : frontsector->floorheight) >= viewz) { // above view plane markfloor = false; } - if (frontsector->ceilingpic != skyflatnum - && ( -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : -#endif + if (frontsector->ceilingpic != skyflatnum && (frontsector->c_slope ? + P_GetZAt(frontsector->c_slope, viewx, viewy) : frontsector->ceilingheight) <= viewz) { // below view plane @@ -2688,10 +2445,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // calculate incremental stepping values for texture edges worldtop >>= 4; worldbottom >>= 4; -#ifdef ESLOPE worldtopslope >>= 4; worldbottomslope >>= 4; -#endif if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES topstep = bottomstep = 0; @@ -2704,7 +2459,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) bottomstep = -FixedMul (rw_scalestep,worldbottom); bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale); -#ifdef ESLOPE if (frontsector->c_slope) { fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2); topstep = (topfracend-topfrac)/(range); @@ -2713,7 +2467,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2); bottomstep = (bottomfracend-bottomfrac)/(range); } -#endif } dc_numlights = 0; @@ -2729,14 +2482,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) for (i = p = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[p]; -#ifdef ESLOPE if (light->slope) { leftheight = P_GetZAt(light->slope, segleft.x, segleft.y); rightheight = P_GetZAt(light->slope, segright.x, segright.y); @@ -2751,38 +2501,23 @@ void R_StoreWallRange(INT32 start, INT32 stop) leftheight >>= 4; rightheight >>= 4; -#endif if (i != 0) { -#ifdef ESLOPE if (leftheight < worldbottom && rightheight < worldbottomslope) continue; if (leftheight > worldtop && rightheight > worldtopslope && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight) continue; -#else - if (light->height < frontsector->floorheight) - continue; - - if (light->height > frontsector->ceilingheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight) - continue; -#endif } -#ifdef ESLOPE rlight->height = (centeryfrac>>4) - FixedMul(leftheight, rw_scale); rlight->heightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2); rlight->heightstep = (rlight->heightstep-rlight->height)/(range); -#else - rlight->height = (centeryfrac>>4) - FixedMul((light->height - viewz) >> 4, rw_scale); - rlight->heightstep = -FixedMul (rw_scalestep, (light->height - viewz) >> 4); -#endif rlight->flags = light->flags; if (light->caster && light->caster->flags & FF_CUTSOLIDS) { -#ifdef ESLOPE if (*light->caster->b_slope) { leftheight = P_GetZAt(*light->caster->b_slope, segleft.x, segleft.y); rightheight = P_GetZAt(*light->caster->b_slope, segright.x, segright.y); @@ -2802,10 +2537,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) rlight->botheightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2); rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range); -#else - rlight->botheight = (centeryfrac >> 4) - FixedMul((*light->caster->bottomheight - viewz) >> 4, rw_scale); - rlight->botheightstep = -FixedMul (rw_scalestep, (*light->caster->bottomheight - viewz) >> 4); -#endif } rlight->lightlevel = *light->lightlevel; @@ -2821,9 +2552,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) for (i = 0; i < numffloors; i++) { ffloor[i].f_pos >>= 4; -#ifdef ESLOPE ffloor[i].f_pos_slope >>= 4; -#endif if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too. { ffloor[i].f_step = 0; @@ -2832,13 +2561,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) } else { -#ifdef ESLOPE ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale); ffloor[i].f_step = ((centeryfrac>>4) - FixedMul(ffloor[i].f_pos_slope, ds_p->scale2) - ffloor[i].f_frac)/(range); -#else - ffloor[i].f_step = FixedMul(-rw_scalestep, ffloor[i].f_pos); - ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale); -#endif } } } @@ -2847,42 +2571,34 @@ void R_StoreWallRange(INT32 start, INT32 stop) { worldhigh >>= 4; worldlow >>= 4; -#ifdef ESLOPE worldhighslope >>= 4; worldlowslope >>= 4; -#endif if (toptexture) { pixhigh = (centeryfrac>>4) - FixedMul (worldhigh, rw_scale); pixhighstep = -FixedMul (rw_scalestep,worldhigh); -#ifdef ESLOPE if (backsector->c_slope) { fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldhighslope, ds_p->scale2); pixhighstep = (topfracend-pixhigh)/(range); } -#endif } if (bottomtexture) { pixlow = (centeryfrac>>4) - FixedMul (worldlow, rw_scale); pixlowstep = -FixedMul (rw_scalestep,worldlow); -#ifdef ESLOPE if (backsector->f_slope) { fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2); pixlowstep = (bottomfracend-pixlow)/(range); } -#endif } { ffloor_t * rover; -#ifdef ESLOPE fixed_t roverleft, roverright; fixed_t planevistest; -#endif i = 0; if (backsector->ffloors) @@ -2894,7 +2610,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Let the renderer know this sector is sloped. if (*rover->b_slope || *rover->t_slope) backsector->hasslope = true; @@ -2941,34 +2656,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range); i++; } -#else - if (*rover->bottomheight <= backsector->ceilingheight && - *rover->bottomheight >= backsector->floorheight && - ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->bottomheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } - - if (i >= MAXFFLOORS) - break; - - if (*rover->topheight >= backsector->floorheight && - *rover->topheight <= backsector->ceilingheight && - ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->topheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } -#endif } } else if (frontsector && frontsector->ffloors) @@ -2980,8 +2667,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; - -#ifdef ESLOPE // Let the renderer know this sector is sloped. if (*rover->b_slope || *rover->t_slope) frontsector->hasslope = true; @@ -3028,32 +2713,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range); i++; } -#else - if (*rover->bottomheight <= frontsector->ceilingheight && - *rover->bottomheight >= frontsector->floorheight && - ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->bottomheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } - if (i >= MAXFFLOORS) - break; - if (*rover->topheight >= frontsector->floorheight && - *rover->topheight <= frontsector->ceilingheight && - ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->topheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } -#endif } } #ifdef POLYOBJECTS_PLANES @@ -3070,9 +2729,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (ffloor[i].plane->maxx < ds_p->x2) ffloor[i].plane->maxx = ds_p->x2; -#ifdef ESLOPE ffloor[i].slope = NULL; -#endif ffloor[i].b_pos = backsector->floorheight; ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); @@ -3089,9 +2746,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (ffloor[i].plane->maxx < ds_p->x2) ffloor[i].plane->maxx = ds_p->x2; -#ifdef ESLOPE ffloor[i].slope = NULL; -#endif ffloor[i].b_pos = backsector->ceilingheight; ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); diff --git a/src/r_things.c b/src/r_things.c index 2fc44faf8..fc0469f4c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1030,10 +1030,8 @@ static void R_SplitSprite(vissprite_t *sprite) if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES)) continue; -#ifdef ESLOPE if (sector->lightlist[i].slope) testheight = P_GetZAt(sector->lightlist[i].slope, sprite->gx, sprite->gy); -#endif if (testheight >= sprite->gzt) continue; @@ -1321,9 +1319,9 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, if (thing->subsector->sector->numlights) { INT32 lightnum; -#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights! light = thing->subsector->sector->numlights - 1; + // R_GetPlaneLight won't work on sloped lights! for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) { fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y) : thing->subsector->sector->lightlist[lightnum].height; @@ -1332,9 +1330,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, break; } } -#else - light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false); -#endif + //light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false); } if (thing->subsector->sector->numlights) @@ -1730,9 +1726,9 @@ static void R_ProjectSprite(mobj_t *thing) if (thing->subsector->sector->numlights) { INT32 lightnum; -#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights! light = thing->subsector->sector->numlights - 1; + // R_GetPlaneLight won't work on sloped lights! for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) { fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y) : thing->subsector->sector->lightlist[lightnum].height; @@ -1741,9 +1737,7 @@ static void R_ProjectSprite(mobj_t *thing) break; } } -#else - light = R_GetPlaneLight(thing->subsector->sector, gzt, false); -#endif + //light = R_GetPlaneLight(thing->subsector->sector, gzt, false); lightnum = (*thing->subsector->sector->lightlist[light].lightlevel >> LIGHTSEGSHIFT); if (lightnum < 0) @@ -2393,13 +2387,12 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps if (rover->szt > r2->plane->low || rover->sz < r2->plane->high) continue; -#ifdef ESLOPE // Effective height may be different for each comparison in the case of slopes if (r2->plane->slope) { planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy); planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy); - } else -#endif + } + else planeobjectz = planecameraz = r2->plane->height; if (rover->mobjflags & MF_NOCLIPHEIGHT) @@ -2458,20 +2451,18 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps if (scale <= rover->sortscale) continue; -#ifdef ESLOPE if (*r2->ffloor->t_slope) { topplaneobjectz = P_GetZAt(*r2->ffloor->t_slope, rover->gx, rover->gy); topplanecameraz = P_GetZAt(*r2->ffloor->t_slope, viewx, viewy); - } else -#endif + } + else topplaneobjectz = topplanecameraz = *r2->ffloor->topheight; -#ifdef ESLOPE if (*r2->ffloor->b_slope) { botplaneobjectz = P_GetZAt(*r2->ffloor->b_slope, rover->gx, rover->gy); botplanecameraz = P_GetZAt(*r2->ffloor->b_slope, viewx, viewy); - } else -#endif + } + else botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight; if ((topplanecameraz > viewz && botplanecameraz < viewz) || diff --git a/src/screen.c b/src/screen.c index 7ebe34635..6bdf91ed8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -127,14 +127,12 @@ void SCR_SetDrawFuncs(void) #ifndef NOWATER spanfuncs[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_8; #endif -#ifdef ESLOPE spanfuncs[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_8; spanfuncs[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_8; #ifndef NOWATER spanfuncs[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_8; #endif spanfuncs[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_8; -#endif // Lactozilla: Non-powers-of-two spanfuncs_npo2[BASEDRAWFUNC] = R_DrawSpan_NPO2_8; @@ -145,14 +143,12 @@ void SCR_SetDrawFuncs(void) #ifndef NOWATER spanfuncs_npo2[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_NPO2_8; #endif -#ifdef ESLOPE spanfuncs_npo2[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_NPO2_8; spanfuncs_npo2[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_NPO2_8; #ifndef NOWATER spanfuncs_npo2[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_NPO2_8; #endif spanfuncs_npo2[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_NPO2_8; -#endif #ifdef RUSEASM if (R_ASM) diff --git a/src/screen.h b/src/screen.h index 717ce9adc..ddbd499bb 100644 --- a/src/screen.h +++ b/src/screen.h @@ -140,13 +140,11 @@ enum #ifndef NOWATER SPANDRAWFUNC_WATER, #endif -#ifdef ESLOPE SPANDRAWFUNC_TILTED, SPANDRAWFUNC_TILTEDTRANS, SPANDRAWFUNC_TILTEDSPLAT, #ifndef NOWATER SPANDRAWFUNC_TILTEDWATER, -#endif #endif SPANDRAWFUNC_MAX From 2107b89586392e26758ad8da2aa900eb1f51a875 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 21 Mar 2020 09:40:37 +0100 Subject: [PATCH 42/47] Remove the multi-file ZB configs. We're stick with the single-file config for ZB and doing all the UDMF stuff in UDB --- extras/conf/Includes/Game_SRB222.cfg | 77 - extras/conf/Includes/SRB222_common.cfg | 309 -- extras/conf/Includes/SRB222_linedefs.cfg | 2486 ---------------- extras/conf/Includes/SRB222_misc.cfg | 726 ----- extras/conf/Includes/SRB222_sectors.cfg | 109 - extras/conf/Includes/SRB222_things.cfg | 3398 ---------------------- extras/conf/SRB2_22Doom.cfg | 38 - extras/conf/SRB2_22UDMF.cfg | 47 - 8 files changed, 7190 deletions(-) delete mode 100644 extras/conf/Includes/Game_SRB222.cfg delete mode 100644 extras/conf/Includes/SRB222_common.cfg delete mode 100644 extras/conf/Includes/SRB222_linedefs.cfg delete mode 100644 extras/conf/Includes/SRB222_misc.cfg delete mode 100644 extras/conf/Includes/SRB222_sectors.cfg delete mode 100644 extras/conf/Includes/SRB222_things.cfg delete mode 100644 extras/conf/SRB2_22Doom.cfg delete mode 100644 extras/conf/SRB2_22UDMF.cfg diff --git a/extras/conf/Includes/Game_SRB222.cfg b/extras/conf/Includes/Game_SRB222.cfg deleted file mode 100644 index 3c4b11e9f..000000000 --- a/extras/conf/Includes/Game_SRB222.cfg +++ /dev/null @@ -1,77 +0,0 @@ -// Default lump name for new map -defaultlumpname = "MAP01"; -//GZDB specific. Don't try to load lumps that don't exist. -basegame = 0; - -//Sky textures for vanilla maps -defaultskytextures -{ - SKY1 = "MAP01,MAP02,MAP03,MAP33,MAP50,MAP60,MAPF0,MAPM0"; - SKY2 = "MAPM7,MAPMB"; - SKY4 = "MAP04,MAP06,MAP61,MAPF6,MAPM1"; - SKY6 = "MAP05,MAP51,MAPMA"; - SKY7 = "MAPM2,MAPM5"; - SKY8 = "MAP07,MAP08,MAP09,MAP52,MAP62,MAPF1"; - SKY10 = "MAP10,MAP12,MAP53,MAP63,MAPM3"; - SKY11 = "MAP11,MAPF7"; - SKY13 = "MAP13,MAP64"; - SKY14 = "MAP14"; - SKY15 = "MAP15,MAP54"; - SKY17 = "MAP70"; - SKY20 = "MAP32,MAP55,MAP65,MAPF2,MAPF5"; - SKY21 = "MAPM4"; - SKY22 = "MAP22,MAP23,MAP25,MAP26,MAP27,MAP56,MAP66,MAPF4,MAPM6"; - SKY30 = "MAP30"; - SKY31 = "MAP31"; - SKY35 = "MAP42"; - SKY40 = "MAP41,MAP71,MAPM9"; - SKY55 = "MAPF3,MAPM8"; - SKY68 = "MAPF8"; - SKY99 = "MAP57,MAPZ0"; - SKY159 = "MAP16"; - SKY172 = "MAP40"; - SKY300 = "MAP72"; - SKY301 = "MAP73"; -} - -// Skill levels -skills -{ - 1 = "Normal"; -} - -// Skins -skins -{ - Sonic; - Tails; - Knuckles; - Amy; - Fang; - Metalsonic; -} - -// Gametypes -gametypes -{ - -1 = "Single Player"; - 0 = "Co-op"; - 1 = "Competition"; - 2 = "Race"; - 3 = "Match"; - 4 = "Team Match"; - 5 = "Tag"; - 6 = "Hide and Seek"; - 7 = "CTF"; -} - -// Texture loading options -defaultwalltexture = "GFZROCK"; -defaultfloortexture = "GFZFLR01"; -defaultceilingtexture = "F_SKY1"; - -// Default texture sets -// (these are not required, but useful for new users) -texturesets -{ -} \ No newline at end of file diff --git a/extras/conf/Includes/SRB222_common.cfg b/extras/conf/Includes/SRB222_common.cfg deleted file mode 100644 index a832e6cef..000000000 --- a/extras/conf/Includes/SRB222_common.cfg +++ /dev/null @@ -1,309 +0,0 @@ -common -{ - // Some common settings - - - - // Default testing parameters - testparameters = "-file \"%AP\" \"%F\" -warp %L"; - testshortpaths = true; - - // Action special help (mxd) - actionspecialhelp = "https://wiki.srb2.org/wiki/Linedef_type_%K"; - - // Default nodebuilder configurations - defaultsavecompiler = "zennode_normal"; - defaulttestcompiler = "zennode_fast"; - - // Generalized actions - generalizedlinedefs = false; - generalizedsectors = true; - - mixtexturesflats = true; - defaulttexturescale = 1.0f; - defaultflatscale = 1.0f; - scaledtextureoffsets = true; - - // Thing number for start position in 3D Mode - start3dmode = 3328; - - // Texture sources - textures - { - include("SRB222_misc.cfg", "textures"); - } - - // Patch sources - patches - { - include("SRB222_misc.cfg", "patches"); - } - - // Sprite sources - sprites - { - include("SRB222_misc.cfg", "sprites"); - } - - // Flat sources - flats - { - include("SRB222_misc.cfg", "flats"); - } -} - -mapformat_doom -{ - // The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder - formatinterface = "SRB2MapSetIO"; - - /* - GAME DETECT PATTERN - Used to guess the game for which a WAD file is made. - - 1 = One of these lumps must exist - 2 = None of these lumps must exist - 3 = All of these lumps must exist - */ - - gamedetect - { - EXTENDED = 2; - - - BEHAVIOR = 2; - - E#M# = 2; - - MAP?? = 1; - } - - /* - MAP LUMP NAMES - Map lumps are loaded with the map as long as they are right after each other. When the editor - meets a lump which is not defined in this list it will ignore the map if not satisfied. - The order of items defines the order in which lumps will be written to WAD file on save. - To indicate the map header lump, use ~MAP - - Legenda: - required = Lump is required to exist. - blindcopy = Lump will be copied along with the map blindly. (usefull for lumps Doom Builder doesn't use) - nodebuild = The nodebuilder generates this lump. - allowempty = The nodebuilder is allowed to leave this lump empty. - script = This lump is a text-based script. Specify the filename of the script configuration to use. - */ - - maplumpnames - { - include("SRB222_misc.cfg", "doommaplumpnames"); - } - - // When this is set to true, sectors with the same tag will light up when a line is highlighted - linetagindicatesectors = true; - - // Special linedefs - include("SRB222_misc.cfg", "speciallinedefs"); - - // Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1) - defaultthingflags - { - } - - // DEFAULT SECTOR BRIGHTNESS LEVELS - sectorbrightness - { - include("SRB222_misc.cfg", "sectorbrightness"); - } - - // SECTOR TYPES----------------------------------------------------------------- - sectortypes - { - include("SRB222_sectors.cfg", "sectortypes"); - } - - // GENERALISED SECTOR TYPES----------------------------------------------------------------- - gen_sectortypes - { - include("SRB222_sectors.cfg", "gen_sectortypes"); - } - - // LINEDEF FLAGS - linedefflags - { - include("SRB222_misc.cfg", "linedefflags"); - } - - // Linedef flags UDMF translation table - // This is needed for copy/paste and prefabs to work properly - // When the UDMF field name is prefixed with ! it is inverted - linedefflagstranslation - { - include("SRB222_misc.cfg", "linedefflagstranslation"); - } - - // LINEDEF ACTIVATIONS - linedefactivations - { - } - - // LINEDEF TYPES - linedeftypes - { - include("SRB222_linedefs.cfg", "doom"); - } - - // THING FLAGS - thingflags - { - include("SRB222_misc.cfg", "thingflags"); - } - - // Thing flags UDMF translation table - // This is needed for copy/paste and prefabs to work properly - // When the UDMF field name is prefixed with ! it is inverted - thingflagstranslation - { - include("SRB222_misc.cfg", "thingflagstranslation"); - } - - // THING FLAGS ERROR MASK - // Mask for the thing flags which indicates the options - // that make the same thing appear in the same modes - thingflagsmask1 = 7; // 1 + 2 + 4 - thingflagsmask2 = 0; -} - -mapformat_udmf -{ - // The format interface handles the map data format - formatinterface = "UniversalMapSetIO"; - - // Enables support for long (> 8 chars) texture names - // WARNING: this should only be enabled for UDMF game configurations! - // WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3! - longtexturenames = false; - - // Default nodebuilder configurations - defaultsavecompiler = "zdbsp_udmf_normal"; - defaulttestcompiler = "zdbsp_udmf_fast"; - - engine = "srb2"; // override that so that DB2 uses the correct namespace - - maplumpnames - { - include("UDMF_misc.cfg", "udmfmaplumpnames_begin"); - include("SRB222_misc.cfg", "udmfmaplumpnames"); - include("UDMF_misc.cfg", "udmfmaplumpnames_end"); - } - - universalfields - { -// include("SRB222_misc.cfg", "universalfields"); - } - - // When this is set to true, sectors with the same tag will light up when a line is highlighted - linetagindicatesectors = false; - - // Special linedefs - include("SRB222_misc.cfg", "speciallinedefs_udmf"); - - // Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1) - defaultthingflags - { - } - - // Generalized actions - generalizedlinedefs = false; - - // SECTOR FLAGS - sectorflags - { -// include("SRB222_misc.cfg", "sectorflags"); - } - - // DEFAULT SECTOR BRIGHTNESS LEVELS - sectorbrightness - { - include("SRB222_misc.cfg", "sectorbrightness"); - } - - // SECTOR TYPES - sectortypes - { - include("SRB222_sectors.cfg", "sectortypes"); - } - - // SECTOR RENSERSTYLES -/* sectorrenderstyles - { - include("SRB222_misc.cfg", "sectorrenderstyles"); - }*/ - - // LINEDEF FLAGS - linedefflags - { - include("SRB222_misc.cfg", "linedefflags_udmf"); - } - - // LINEDEF ACTIVATIONS - linedefactivations - { - include("SRB222_misc.cfg", "linedefactivations_udmf"); - } - - linedefflagstranslation - { - } - - - // LINEDEF RENSERSTYLES - linedefrenderstyles - { - include("SRB222_misc.cfg", "linedefrenderstyles"); - } - - //SIDEDEF FLAGS -/* sidedefflags - { - include("UDMF_misc.cfg", "sidedefflags"); - }*/ - - // THING FLAGS - thingflags - { - include("SRB222_misc.cfg", "thingflags_udmf"); - } - - // Thing flags UDMF translation table - // This is needed for copy/paste and prefabs to work properly - // When the UDMF field name is prefixed with ! it is inverted - thingflagstranslation - { - include("SRB222_misc.cfg", "thingflagstranslation"); - } - - // THING RENSERSTYLES -/* thingrenderstyles - { - include("SRB222_misc.cfg", "thingrenderstyles"); - }*/ - - // How to compare thing flags (for the stuck things error checker) -/* thingflagscompare - { - include("UDMF_misc.cfg", "thingflagscompare"); - }*/ - - //mxd. Thing flags UDMF translation table - // This is needed for copy/paste and prefabs to work properly - // When the UDMF field name is prefixed with ! it is inverted - thingflagstranslation - { - } - - // LINEDEF TYPES - linedeftypes - { - include("SRB222_linedefs.cfg", "udmf"); - } -} \ No newline at end of file diff --git a/extras/conf/Includes/SRB222_linedefs.cfg b/extras/conf/Includes/SRB222_linedefs.cfg deleted file mode 100644 index fdf191850..000000000 --- a/extras/conf/Includes/SRB222_linedefs.cfg +++ /dev/null @@ -1,2486 +0,0 @@ -doom -{ - misc - { - title = "Miscellaneous"; - - 0 - { - title = "None"; - prefix = "(0)"; - } - - 1 - { - title = "Per-Sector Gravity"; - prefix = "(1)"; - flags64text = "[6] Flip in reverse gravity"; - } - - 5 - { - title = "Camera Scanner"; - prefix = "(5)"; - } - - 7 - { - title = "Sector Flat Alignment"; - prefix = "(7)"; - flags2048text = "[11] Don't align floor"; - flags4096text = "[12] Don't align ceiling"; - flags8192text = "[13] Use texture offsets"; - } - - 10 - { - title = "Culling Plane"; - prefix = "(10)"; - flags64text = "[6] Cull only while in sector"; - } - - 13 - { - title = "Heat Wave Effect"; - prefix = "(13)"; - } - - 40 - { - title = "Visual Portal Between Tagged Linedefs"; - prefix = "(40)"; - } - - 41 - { - title = "Horizon Effect"; - prefix = "(41)"; - } - - 50 - { - title = "Instantly Lower Floor on Level Load"; - prefix = "(50)"; - } - - 51 - { - title = "Instantly Raise Ceiling on Level Load"; - prefix = "(51)"; - } - - 63 - { - title = "Fake Floor/Ceiling Planes"; - prefix = "(63)"; - } - - 540 - { - title = "Floor Friction"; - prefix = "(540)"; - } - } - - parameters - { - title = "Parameters"; - - 2 - { - title = "Custom Exit"; - prefix = "(2)"; - flags2text = "[1] Check emeralds"; - flags64text = "[6] Skip score tally"; - } - - 3 - { - title = "Zoom Tube Parameters"; - prefix = "(3)"; - flags512text = "[9] Ignore player direction"; - } - - 4 - { - title = "Speed Pad Parameters"; - prefix = "(4)"; - flags512text = "[9] No teleport to center"; - flags1024text = "[10] Force spinning frames"; - } - - 8 - { - title = "Special Sector Properties"; - prefix = "(8)"; - flags32text = "[5] Invert precipitation"; - flags64text = "[6] Touch only ceiling"; - flags128text = "[7] Allow opposite gravity"; - flags256text = "[8] Touch sector edge"; - flags512text = "[9] Touch floor or ceiling"; - } - - 9 - { - title = "Chain Parameters"; - prefix = "(9)"; - flags32text = "[5] Swing instead of spin"; - flags64text = "[6] Player-turnable chain"; - flags128text = "[7] Make chain from end item"; - flags256text = "[8] Spawn link at origin"; - flags512text = "[9] Don't clip inside ground"; - flags1024text = "[10] No distance check"; - } - - 11 - { - title = "Rope Hang Parameters"; - prefix = "(11)"; - flags32text = "[5] Don't loop"; - flags64text = "[6] Static"; - } - - 12 - { - title = "Rock Spawner Parameters"; - prefix = "(12)"; - flags64text = "[6] Randomize speed"; - } - - 14 - { - title = "Bustable Block Parameters"; - prefix = "(14)"; - flags32text = "[5] Particles launch from center"; - } - - 15 - { - title = "Fan Particle Spawner Parameters"; - prefix = "(15)"; - } - - 16 - { - title = "Minecart Parameters"; - prefix = "(16)"; - } - - 64 - { - title = "Continuously Appearing/Disappearing FOF"; - prefix = "(64)"; - flags2text = "[1] Use control sector tag"; - flags64text = "[6] No sound effect"; - } - - 65 - { - title = "Bridge Thinker "; - prefix = "(65)"; - } - } - - polyobject - { - title = "PolyObject"; - - 20 - { - title = "First Line"; - prefix = "(20)"; - } - - 21 - { - title = "Explicitly Include Line "; - prefix = "(21)"; - } - - 22 - { - title = "Parameters"; - prefix = "(22)"; - flags64text = "[6] Trigger linedef executor"; - flags128text = "[7] Intangible"; - flags256text = "[8] Stopped by pushables"; - flags512text = "[9] Render flats"; - } - - 30 - { - title = "Waving Flag"; - prefix = "(30)"; - } - - 31 - { - title = "Displacement by Front Sector"; - prefix = "(31)"; - } - - 32 - { - title = "Angular Displacement by Front Sector"; - prefix = "(32)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't turn players"; - flags512text = "[9] Turn all objects"; - } - } - - planemove - { - title = "Plane Movement"; - - 52 - { - title = "Continuously Falling Sector"; - prefix = "(52)"; - flags64text = "[6] Continuously rising"; - } - - 53 - { - title = "Continuous Floor/Ceiling Mover"; - prefix = "(53)"; - } - - 54 - { - title = "Continuous Floor Mover"; - prefix = "(54)"; - } - - 55 - { - title = "Continuous Ceiling Mover"; - prefix = "(55)"; - } - - 56 - { - title = "Continuous Two-Speed Floor/Ceiling Mover"; - prefix = "(56)"; - } - - 57 - { - title = "Continuous Two-Speed Floor Mover"; - prefix = "(57)"; - } - - 58 - { - title = "Continuous Two-Speed Ceiling Mover"; - prefix = "(58)"; - } - - 59 - { - title = "Activate Moving Platform"; - prefix = "(59)"; - flags64text = "[6] Move upwards at start"; - } - - 60 - { - title = "Activate Moving Platform (Adjustable Speed)"; - prefix = "(60)"; - flags64text = "[6] Move upwards at start"; - } - - 61 - { - title = "Crusher (Ceiling to Floor)"; - prefix = "(61)"; - flags512text = "[9] Double, constant speed"; - } - - 62 - { - title = "Crusher (Floor to Ceiling)"; - prefix = "(62)"; - flags512text = "[9] Double, constant speed"; - } - - 66 - { - title = "Move Floor by Displacement"; - prefix = "(66)"; - flags64text = "[6] Inverse movement"; - } - - 67 - { - title = "Move Ceiling by Displacement"; - prefix = "(67)"; - flags64text = "[6] Inverse movement"; - } - - 68 - { - title = "Move Floor and Ceiling by Displacement"; - prefix = "(68)"; - flags64text = "[6] Inverse movement"; - } - } - - fofsolid - { - title = "FOF (solid)"; - - 100 - { - title = "Solid, Opaque"; - prefix = "(100)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 101 - { - title = "Solid, Opaque, No Shadow"; - prefix = "(101)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1DF"; - } - - 102 - { - title = "Solid, Translucent"; - prefix = "(102)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Render insides"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "195F"; - flags643dfloorflagsadd = "7C80"; - } - - 103 - { - title = "Solid, Sides Only"; - prefix = "(103)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1CF"; - } - - 104 - { - title = "Solid, No Sides"; - prefix = "(104)"; - flags32text = "[5] Only block player"; - flags64text = "[6] Cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1D7"; - flags643dfloorflagsremove = "40"; - } - - 105 - { - title = "Solid, Invisible"; - prefix = "(105)"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "47"; - } - - 140 - { - title = "Intangible from Bottom, Opaque"; - prefix = "(140)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "200841F"; - flags643dfloorflagsadd = "40"; - } - - 141 - { - title = "Intangible from Bottom, Translucent"; - prefix = "(141)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Render insides/block non-plr"; - 3dfloor = true; - 3dfloorflags = "200191F"; - flags1283dfloorflagsadd = "7C80"; - flags643dfloorflagsadd = "40"; - } - - 142 - { - title = "Intangible from Bottom, Translucent, No Sides"; - prefix = "(142)"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Render insides/block non-plr"; - 3dfloor = true; - 3dfloorflags = "2001917"; - flags1283dfloorflagsadd = "7C80"; - flags643dfloorflagsadd = "40"; - } - - 143 - { - title = "Intangible from Top, Opaque"; - prefix = "(143)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "400841F"; - flags643dfloorflagsadd = "40"; - } - - 144 - { - title = "Intangible from Top, Translucent"; - prefix = "(144)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Render insides/block non-plr"; - 3dfloor = true; - 3dfloorflags = "400191F"; - flags1283dfloorflagsadd = "7C80"; - flags643dfloorflagsadd = "40"; - } - - 145 - { - title = "Intangible from Top, Translucent, No Sides"; - prefix = "(145)"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Render insides/block non-plr"; - 3dfloor = true; - 3dfloorflags = "4001917"; - flags1283dfloorflagsadd = "7C80"; - flags643dfloorflagsadd = "40"; - } - - 146 - { - title = "Only Tangible from Sides"; - prefix = "(146)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "600800F"; - } - } - - fofintangible - { - title = "FOF (intangible)"; - - 120 - { - title = "Water, Opaque"; - prefix = "(120)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "8F39"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 121 - { - title = "Water, Translucent"; - prefix = "(121)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "9F39"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 122 - { - title = "Water, Opaque, No Sides"; - prefix = "(122)"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "F31"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 123 - { - title = "Water, Translucent, No Sides"; - prefix = "(123)"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "1F31"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 124 - { - title = "Goo Water, Translucent"; - prefix = "(124)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "209F39"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 125 - { - title = "Goo Water, Translucent, No Sides"; - prefix = "(125)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Use two light levels"; - flags512text = "[9] Use target light level"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "201F31"; - flags643dfloorflagsadd = "20000"; - flags5123dfloorflagsadd = "80000000"; - flags10243dfloorflagsadd = "40000000"; - } - - 220 - { - title = "Intangible, Opaque"; - prefix = "(220)"; - flags8text = "[3] Slope skew sides"; - 3dfloor = true; - 3dfloorflags = "8F19"; - } - - 221 - { - title = "Intangible, Translucent"; - prefix = "(221)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Cast shadow"; - 3dfloor = true; - 3dfloorflags = "1B59"; - flags643dfloorflagsremove = "40"; - } - - 222 - { - title = "Intangible, Sides Only"; - prefix = "(222)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Cast shadow"; - 3dfloor = true; - 3dfloorflags = "8249"; - flags643dfloorflagsremove = "240"; - } - - 223 - { - title = "Intangible, Invisible"; - prefix = "(223)"; - 3dfloor = true; - 3dfloorflags = "41"; - } - } - - fofmoving - { - title = "FOF (moving)"; - - 150 - { - title = "Air Bobbing"; - prefix = "(150)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 151 - { - title = "Air Bobbing (Adjustable)"; - prefix = "(151)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 152 - { - title = "Reverse Air Bobbing (Adjustable)"; - prefix = "(152)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 160 - { - title = "Floating, Bobbing"; - prefix = "(160)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "4019F"; - } - - 190 - { - title = "Rising Platform, Solid, Opaque"; - prefix = "(190)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 191 - { - title = "Rising Platform, Solid, Opaque, No Shadow"; - prefix = "(191)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1DF"; - } - - 192 - { - title = "Rising Platform, Solid, Translucent"; - prefix = "(192)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "195F"; - } - - 193 - { - title = "Rising Platform, Solid, Invisible"; - prefix = "(193)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "47"; - } - - 194 - { - title = "Rising Platform, Intangible from Bottom, Opaque"; - prefix = "(194)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash, no shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "200841F"; - flags643dfloorflagsadd = "40"; - } - - 195 - { - title = "Rising Platform, Intangible from Bottom, Translucent"; - prefix = "(195)"; - flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash, no shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "2009D1F"; - flags643dfloorflagsadd = "40"; - } - } - - fofcrumbling - { - title = "FOF (crumbling)"; - - 170 - { - title = "Crumbling, Respawn"; - prefix = "(170)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "10019F"; - } - - 171 - { - title = "Crumbling, No Respawn"; - prefix = "(171)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "80019F"; - } - - 172 - { - title = "Crumbling, Respawn, Intangible from Bottom"; - prefix = "(172)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "210841F"; - flags643dfloorflagsadd = "40"; - } - - 173 - { - title = "Crumbling, No Respawn, Intangible from Bottom"; - prefix = "(173)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "218841F"; - flags643dfloorflagsadd = "40"; - } - - 174 - { - title = "Crumbling, Respawn, Int. from Bottom, Translucent"; - prefix = "(174)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "210959F"; - flags643dfloorflagsadd = "40"; - } - - 175 - { - title = "Crumbling, No Respawn, Int. from Bottom, Translucent"; - prefix = "(175)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Don't cast shadow"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "218959F"; - flags643dfloorflagsadd = "40"; - } - - 176 - { - title = "Crumbling, Respawn, Floating, Bobbing"; - prefix = "(176)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "14019F"; - } - - 177 - { - title = "Crumbling, No Respawn, Floating, Bobbing"; - prefix = "(177)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1C019F"; - } - - 178 - { - title = "Crumbling, Respawn, Floating"; - prefix = "(178)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "14019F"; - } - - 179 - { - title = "Crumbling, No Respawn, Floating"; - prefix = "(179)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "1C019F"; - } - - 180 - { - title = "Crumbling, Respawn, Air Bobbing"; - prefix = "(180)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags64text = "[6] Spindash to move"; - flags128text = "[7] Only block non-players"; - 3dfloor = true; - 3dfloorflags = "10019F"; - } - } - - fofspecial - { - title = "FOF (special)"; - - 200 - { - title = "Light Block"; - prefix = "(200)"; - 3dfloor = true; - 3dfloorflags = "20201"; - } - - 201 - { - title = "Half Light Block"; - prefix = "(201)"; - 3dfloor = true; - 3dfloorflags = "201"; - } - - 202 - { - title = "Fog Block"; - prefix = "(202)"; - 3dfloor = true; - 3dfloorflags = "3EF19"; - } - - 250 - { - title = "Mario Block"; - prefix = "(250)"; - flags32text = "[5] Invisible block"; - flags64text = "[6] Brick block"; - 3dfloor = true; - 3dfloorflags = "40019F"; - } - - 251 - { - title = "Thwomp Block"; - prefix = "(251)"; - flags512text = "[9] Custom crushing sound"; - flags1024text = "[10] Custom speed"; - 3dfloor = true; - 3dfloorflags = "19F"; - } - - 252 - { - title = "Shatter Block"; - prefix = "(252)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Shatter only from below"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorflags = "8800019"; - flags643dfloorflagsadd = "200006"; - } - - 253 - { - title = "Shatter Block, Translucent"; - prefix = "(253)"; - flags8text = "[3] Slope skew sides"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorflags = "8801019"; - } - - 254 - { - title = "Bustable Block"; - prefix = "(254)"; - flags8text = "[3] Slope skew sides"; - flags64text = "[6] Strong characters only"; - flags128text = "[7] Only block non-players"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorflags = "80001F"; - flags643dfloorflagsadd = "20000000"; - } - - 255 - { - title = "Spin-Bustable Block"; - prefix = "(255)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorflags = "1080001F"; - } - - 256 - { - title = "Spin-Bustable Block, Translucent"; - prefix = "(256)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorflags = "1080101F"; - } - - 257 - { - title = "Quicksand"; - prefix = "(257)"; - flags8text = "[3] Slope skew sides"; - flags1024text = "[10] Ripple effect"; - 3dfloor = true; - 3dfloorflags = "1008219"; - flags10243dfloorflagsadd = "40000000"; - } - - 258 - { - title = "Laser"; - prefix = "(258)"; - flags8text = "[3] Slope skew sides"; - flags32text = "[5] Don't damage bosses"; - 3dfloor = true; - 3dfloorflags = "959"; - } - - 259 - { - title = "Custom FOF"; - prefix = "(259)"; - flags32text = "[5] Only block player"; - flags128text = "[7] Only block non-players"; - flags512text = "[9] Shattered by pushables"; - flags1024text = "[10] Trigger linedef executor"; - 3dfloor = true; - 3dfloorcustom = true; - } - } - - linedeftrigger - { - title = "Linedef Executor Trigger"; - - 300 - { - title = "Continuous"; - prefix = "(300)"; - } - - 301 - { - title = "Each Time"; - prefix = "(301)"; - flags16384text = "[14] Also trigger on exit"; - } - - 302 - { - title = "Once"; - prefix = "(302)"; - } - - 303 - { - title = "Ring Count - Continuous"; - prefix = "(303)"; - flags2text = "[1] Rings greater or equal"; - flags64text = "[6] Rings less or equal"; - flags512text = "[9] Consider all players"; - } - - 304 - { - title = "Ring Count - Once"; - prefix = "(304)"; - flags2text = "[1] Rings greater or equal"; - flags64text = "[6] Rings less or equal"; - flags512text = "[9] Consider all players"; - } - - 305 - { - title = "Character Ability - Continuous"; - prefix = "(305)"; - } - - 306 - { - title = "Character Ability - Each Time"; - prefix = "(306)"; - flags16384text = "[14] Also trigger on exit"; - } - - 307 - { - title = "Character Ability - Once"; - prefix = "(307)"; - } - - 308 - { - title = "Race Only - Once"; - prefix = "(308)"; - } - - 309 - { - title = "CTF Red Team - Continuous"; - prefix = "(309)"; - } - - 310 - { - title = "CTF Red Team - Each Time"; - prefix = "(310)"; - flags16384text = "[14] Also trigger on exit"; - } - - 311 - { - title = "CTF Blue Team - Continuous"; - prefix = "(311)"; - } - - 312 - { - title = "CTF Blue Team - Each Time"; - prefix = "(312)"; - flags16384text = "[14] Also trigger on exit"; - } - - 313 - { - title = "No More Enemies - Once"; - prefix = "(313)"; - } - - 314 - { - title = "Number of Pushables - Continuous"; - prefix = "(314)"; - flags64text = "[6] Number greater or equal"; - flags512text = "[9] Number less"; - } - - 315 - { - title = "Number of Pushables - Once"; - prefix = "(315)"; - flags64text = "[6] Number greater or equal"; - flags512text = "[9] Number less"; - } - - 317 - { - title = "Condition Set Trigger - Continuous"; - prefix = "(317)"; - } - - 318 - { - title = "Condition Set Trigger - Once"; - prefix = "(318)"; - } - - 319 - { - title = "Unlockable - Continuous"; - prefix = "(319)"; - } - - 320 - { - title = "Unlockable - Once"; - prefix = "(320)"; - } - - 321 - { - title = "Trigger After X Calls - Continuous"; - prefix = "(321)"; - flags64text = "[6] Trigger more than once"; - - } - - 322 - { - title = "Trigger After X Calls - Each Time"; - prefix = "(322)"; - flags64text = "[6] Trigger more than once"; - } - - 323 - { - title = "NiGHTSerize - Each Time"; - prefix = "(323)"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run only if player is NiGHTS"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags16384text = "[14] Run if no more mares"; - flags32768text = "[15] Run if player is not NiGHTS"; - } - - 324 - { - title = "NiGHTSerize - Once"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run only if player is NiGHTS"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags16384text = "[14] Run if no more mares"; - flags32768text = "[15] Run if player is not NiGHTS"; - prefix = "(324)"; - } - - 325 - { - title = "De-NiGHTSerize - Each Time"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run if anyone is NiGHTS"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags32768text = "[15] Run if no one is NiGHTS"; - prefix = "(325)"; - } - - 326 - { - title = "De-NiGHTSerize - Once"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run if anyone is NiGHTS"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags32768text = "[15] Run if no one is NiGHTS"; - prefix = "(326)"; - } - - 327 - { - title = "NiGHTS Lap - Each Time"; - flags2text = "[1] Mare >= Front X Offset"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - prefix = "(327)"; - } - - 328 - { - title = "NiGHTS Lap - Once"; - flags2text = "[1] Mare >= Front X Offset"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - prefix = "(328)"; - } - - 329 - { - title = "Ideya Capture Touch - Each Time"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run regardless of spheres"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags16384text = "[14] Only if not enough spheres"; - flags32768text = "[15] Run when entering Capture"; - prefix = "(329)"; - } - - 330 - { - title = "Ideya Capture Touch - Once"; - flags2text = "[1] Mare >= Front X Offset"; - flags8text = "[3] Run regardless of spheres"; - flags16text = "[4] Count from lowest of players"; - flags32text = "[5] Lap <= Front Y Offset"; - flags64text = "[6] Mare <= Front X Offset"; - flags128text = "[7] Lap >= Front Y Offset"; - flags256text = "[8] Count laps from Bonus Time"; - flags512text = "[9] Count from triggering player"; - flags16384text = "[14] Only if not enough spheres"; - flags32768text = "[15] Run when entering Capture"; - prefix = "(330)"; - } - - 331 - { - title = "Player Skin - Continuous"; - flags64text = "[6] Disable for this skin"; - prefix = "(331)"; - } - - 332 - { - title = "Player Skin - Each Time"; - flags64text = "[6] Disable for this skin"; - prefix = "(332)"; - } - - 333 - { - title = "Player Skin - Once"; - flags64text = "[6] Disable for this skin"; - prefix = "(333)"; - } - - 399 - { - title = "Level Load"; - prefix = "(399)"; - } - } - - linedefexecsector - { - title = "Linedef Executor (sector)"; - - 400 - { - title = "Set Tagged Sector's Floor Height/Texture"; - prefix = "(400)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Keep floor flat"; - } - - 401 - { - title = "Set Tagged Sector's Ceiling Height/Texture"; - prefix = "(401)"; - flags8text = "[3] Set delay by backside sector"; - } - - 402 - { - title = "Set Tagged Sector's Light Level"; - prefix = "(402)"; - flags8text = "[3] Set delay by backside sector"; - } - - 409 - { - title = "Change Tagged Sector's Tag"; - prefix = "(409)"; - flags8text = "[3] Set delay by backside sector"; - } - - 410 - { - title = "Change Front Sector's Tag"; - prefix = "(410)"; - flags8text = "[3] Set delay by backside sector"; - } - - 416 - { - title = "Start Adjustable Flickering Light"; - prefix = "(416)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Second level from back"; - } - - 417 - { - title = "Start Adjustable Pulsating Light"; - prefix = "(417)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Second level from back"; - } - - 418 - { - title = "Start Adjustable Blinking Light (unsynchronized)"; - prefix = "(418)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Second level from back"; - } - - 419 - { - title = "Start Adjustable Blinking Light (synchronized)"; - prefix = "(419)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Second level from back"; - } - - 420 - { - title = "Fade Light Level"; - prefix = "(420)"; - flags8text = "[3] Set delay by backside sector"; - flags16text = "[4] Set params by X/Y offsets"; - flags512text = "[9] Speed = Tic Duration"; - flags1024text = "[10] Override existing fade"; - } - - 421 - { - title = "Stop Lighting Effect"; - prefix = "(421)"; - flags8text = "[3] Set delay by backside sector"; - } - - 435 - { - title = "Change Plane Scroller Direction"; - prefix = "(435)"; - flags8text = "[3] Set delay by backside sector"; - } - } - - linedefexecplane - { - title = "Linedef Executor (plane movement)"; - - 403 - { - title = "Move Tagged Sector's Floor"; - prefix = "(403)"; - flags2text = "[1] Trigger linedef executor"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Change floor flat"; - } - - 404 - { - title = "Move Tagged Sector's Ceiling"; - prefix = "(404)"; - flags2text = "[1] Trigger linedef executor"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Change ceiling flat"; - } - - 405 - { - title = "Move Floor According to Front Texture Offsets"; - prefix = "(405)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Move instantly"; - } - - 407 - { - title = "Move Ceiling According to Front Texture Offsets"; - prefix = "(407)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Move instantly"; - } - - 411 - { - title = "Stop Plane Movement"; - prefix = "(411)"; - flags8text = "[3] Set delay by backside sector"; - } - - 428 - { - title = "Start Platform Movement"; - prefix = "(428)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Move upwards at start"; - } - - 429 - { - title = "Crush Ceiling Once"; - prefix = "(429)"; - flags8text = "[3] Set delay by backside sector"; - flags512text = "[9] Double, constant speed"; - } - - 430 - { - title = "Crush Floor Once"; - prefix = "(430)"; - flags8text = "[3] Set delay by backside sector"; - } - - 431 - { - title = "Crush Floor and Ceiling Once"; - prefix = "(431)"; - flags8text = "[3] Set delay by backside sector"; - flags512text = "[9] Double, constant speed"; - } - } - - linedefexecplayer - { - title = "Linedef Executor (player/object)"; - - 412 - { - title = "Teleporter"; - prefix = "(412)"; - flags2text = "[1] Silent"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Retain angle"; - flags256text = "[8] Relative, silent"; - flags512text = "[9] Retain momentum"; - } - - 425 - { - title = "Change Object State"; - prefix = "(425)"; - flags8text = "[3] Set delay by backside sector"; - } - - 426 - { - title = "Stop Object"; - prefix = "(426)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Teleport to sector center"; - } - - 427 - { - title = "Award Score"; - prefix = "(427)"; - flags8text = "[3] Set delay by backside sector"; - } - - 432 - { - title = "Enable/Disable 2D Mode"; - prefix = "(432)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Return to 3D"; - } - - 433 - { - title = "Enable/Disable Gravity Flip"; - prefix = "(433)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Return to normal"; - } - - 434 - { - title = "Award Power-Up"; - prefix = "(434)"; - flags2text = "[1] Use back upper texture"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] No time limit"; - } - - 437 - { - title = "Disable Player Control"; - prefix = "(437)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Allow jumping"; - } - - 438 - { - title = "Change Object Size"; - prefix = "(438)"; - flags8text = "[3] Set delay by backside sector"; - } - - 442 - { - title = "Change Object Type State"; - prefix = "(442)"; - flags8text = "[3] Set delay by backside sector"; - } - - 457 - { - title = "Track Object's Angle"; - prefix = "(457)"; - flags8text = "[3] Set delay by backside sector"; - flags128text = "[7] Don't stop after first fail"; - } - - 458 - { - title = "Stop Tracking Object's Angle"; - prefix = "(458)"; - flags8text = "[3] Set delay by backside sector"; - } - - 460 - { - title = "Award Rings"; - prefix = "(460)"; - } - - 461 - { - title = "Spawn Object"; - prefix = "(461)"; - flags64text = "[6] Spawn inside a range"; - } - - 462 - { - title = "Stop Timer/Exit Stage in Record Attack"; - prefix = "(462)"; - } - } - - linedefexecmisc - { - title = "Linedef Executor (misc.)"; - - 413 - { - title = "Change Music"; - prefix = "(413)"; - flags2text = "[1] Keep after death"; - flags8text = "[3] Set delay by backside sector"; - flags32text = "[5] Seek to current song position"; - flags64text = "[6] For everyone"; - flags128text = "[7] Fade to custom volume"; - flags512text = "[9] Don't loop"; - flags16384text = "[14] Force music reload"; - } - - 414 - { - title = "Play Sound Effect"; - prefix = "(414)"; - flags2text = "[1] From calling sector"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] From nowhere for triggerer"; - flags512text = "[9] For everyone"; - flags1024text = "[10] From tagged sectors"; - } - - 415 - { - title = "Run Script"; - prefix = "(415)"; - flags8text = "[3] Set delay by backside sector"; - } - - 422 - { - title = "Switch to Cut-Away View"; - prefix = "(422)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Adjust pitch"; - } - - 423 - { - title = "Change Sky"; - prefix = "(423)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] For everyone"; - } - - 424 - { - title = "Change Weather"; - prefix = "(424)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] For everyone"; - } - - 436 - { - title = "Shatter FOF"; - prefix = "(436)"; - flags8text = "[3] Set delay by backside sector"; - } - - 439 - { - title = "Change Tagged Linedef's Textures"; - prefix = "(439)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Only existing"; - } - - 440 - { - title = "Start Metal Sonic Race"; - prefix = "(440)"; - flags8text = "[3] Set delay by backside sector"; - } - - 441 - { - title = "Condition Set Trigger"; - prefix = "(441)"; - flags8text = "[3] Set delay by backside sector"; - } - - 443 - { - title = "Call Lua Function"; - prefix = "(443)"; - flags8text = "[3] Set delay by backside sector"; - } - - 444 - { - title = "Earthquake"; - prefix = "(444)"; - flags8text = "[3] Set delay by backside sector"; - } - - - 445 - { - title = "Make FOF Disappear/Reappear"; - prefix = "(445)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Reappear"; - } - - 446 - { - title = "Make FOF Crumble"; - prefix = "(446)"; - flags2text = "[1] Flags determine respawn"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't respawn"; - } - - 447 - { - title = "Change Tagged Sector's Colormap"; - prefix = "(447)"; - flags8text = "[3] Set delay by backside sector"; - flags16text = "[4] Front X/Y = Alpha"; - flags32text = "[5] Subtract Red value"; - flags64text = "[6] Subtract Green value"; - flags128text = "[7] Subtract Blue value"; - flags256text = "[8] Calc relative values"; - flags32768text = "[15] Use back side colormap"; - } - - 448 - { - title = "Change Skybox"; - prefix = "(448)"; - flags2text = "[1] Change centerpoint"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] For everyone"; - flags512text = "[9] Don't change viewpoint"; - } - - 450 - { - title = "Execute Linedef Executor (specific tag)"; - prefix = "(450)"; - flags8text = "[3] Set delay by backside sector"; - } - - 451 - { - title = "Execute Linedef Executor (random tag in range)"; - prefix = "(451)"; - flags8text = "[3] Set delay by backside sector"; - } - - 452 - { - title = "Set FOF Translucency"; - prefix = "(452)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Do not handle FF_TRANS"; - flags256text = "[8] Set relative to current val"; - } - - 453 - { - title = "Fade FOF"; - prefix = "(453)"; - flags2text = "[1] Do not handle FF_EXISTS"; - flags8text = "[3] Set delay by backside sector"; - flags32text = "[5] No collision during fade"; - flags64text = "[6] Do not handle FF_TRANS"; - flags128text = "[7] Do not handle lighting"; - flags256text = "[8] Set relative to current val"; - flags512text = "[9] Speed = Tic Duration"; - flags1024text = "[10] Override existing fade"; - flags16384text = "[14] Do not handle collision"; - flags32768text = "[15] Use exact alpha in OGL"; - } - - 454 - { - title = "Stop Fading FOF"; - prefix = "(454)"; - flags2text = "[1] Do not finalize collision"; - flags8text = "[3] Set delay by backside sector"; - } - - 455 - { - title = "Fade Tagged Sector's Colormap"; - prefix = "(455)"; - flags8text = "[3] Set delay by backside sector"; - flags16text = "[4] Front X/Y = Alpha"; - flags32text = "[5] Subtract Red value"; - flags64text = "[6] Subtract Green value"; - flags128text = "[7] Subtract Blue value"; - flags256text = "[8] Calc relative values"; - flags512text = "[9] Speed = Tic Duration"; - flags1024text = "[10] Override existing fade"; - flags16384text = "[14] Fade from invisible black"; - flags32768text = "[15] Use back side colormap"; - } - - 456 - { - title = "Stop Fading Tagged Sector's Colormap"; - prefix = "(456)"; - flags8text = "[3] Set delay by backside sector"; - } - - 459 - { - title = "Control Text Prompt"; - prefix = "(459)"; - flags2text = "[1] Close text prompt"; - flags8text = "[3] Set delay by backside sector"; - flags32text = "[5] Run executor tag on close"; - flags64text = "[6] For everyone"; - flags128text = "[7] Do not block controls"; - flags256text = "[8] Do not freeze time"; - flags32768text = "[15] Find prompt by name"; - } - } - - linedefexecpoly - { - title = "Linedef Executor (polyobject)"; - - 480 - { - title = "Door Slide"; - prefix = "(480)"; - flags8text = "[3] Set delay by backside sector"; - } - - 481 - { - title = "Door Swing"; - prefix = "(481)"; - flags8text = "[3] Set delay by backside sector"; - } - - 482 - { - title = "Move"; - prefix = "(482)"; - flags8text = "[3] Set delay by backside sector"; - } - - 483 - { - title = "Move, Override"; - prefix = "(483)"; - flags8text = "[3] Set delay by backside sector"; - } - - 484 - { - title = "Rotate Right"; - prefix = "(484)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't turn players"; - flags512text = "[9] Turn all objects"; - } - - 485 - { - title = "Rotate Right, Override"; - prefix = "(485)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't turn players"; - flags512text = "[9] Turn all objects"; - } - - 486 - { - title = "Rotate Left"; - prefix = "(486)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't turn players"; - flags512text = "[9] Turn all objects"; - } - - 487 - { - title = "Rotate Left, Override"; - prefix = "(487)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Don't turn players"; - flags512text = "[9] Turn all objects"; - } - - 488 - { - title = "Move by Waypoints"; - prefix = "(488)"; - flags8text = "[3] Set delay by backside sector"; - flags32text = "[5] Reverse order"; - flags128text = "[7] There and back"; - flags256text = "[8] Return when done"; - flags512text = "[9] Loop movement"; - } - - 489 - { - title = "Turn Invisible, Intangible"; - prefix = "(489)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Only invisible"; - } - - 490 - { - title = "Turn Visible, Tangible"; - prefix = "(490)"; - flags8text = "[3] Set delay by backside sector"; - flags64text = "[6] Only visible"; - } - - 491 - { - title = "Set Translucency"; - prefix = "(491)"; - flags8text = "[3] Set delay by backside sector"; - flags16text = "[4] Set raw alpha by Front X"; - flags256text = "[8] Calc relative values"; - } - - 492 - { - title = "Fade Translucency"; - prefix = "(492)"; - flags8text = "[3] Set delay by backside sector"; - flags16text = "[4] Set raw alpha by Front X"; - flags32text = "[5] No collision during fade"; - flags256text = "[8] Calc relative values"; - flags512text = "[9] Speed = Tic Duration"; - flags1024text = "[10] Override existing fade"; - flags16384text = "[14] Do not handle collision"; - } - } - - wallscroll - { - title = "Wall Scrolling"; - - 500 - { - title = "Scroll Wall Front Side Left"; - prefix = "(500)"; - } - - 501 - { - title = "Scroll Wall Front Side Right"; - prefix = "(501)"; - } - - 502 - { - title = "Scroll Wall According to Linedef"; - prefix = "(502)"; - } - - 503 - { - title = "Scroll Wall According to Linedef (Accelerative)"; - prefix = "(503)"; - } - - 504 - { - title = "Scroll Wall According to Linedef (Displacement)"; - prefix = "(504)"; - } - - 505 - { - title = "Scroll Texture by Front Side Offsets"; - prefix = "(505)"; - } - - 506 - { - title = "Scroll Texture by Back Side Offsets"; - prefix = "(506)"; - } - } - - planescroll - { - title = "Plane Scrolling"; - - 510 - { - title = "Scroll Floor Texture"; - prefix = "(510)"; - } - - 511 - { - title = "Scroll Floor Texture (Accelerative)"; - prefix = "(511)"; - } - - 512 - { - title = "Scroll Floor Texture (Displacement)"; - prefix = "(512)"; - } - - 513 - { - title = "Scroll Ceiling Texture"; - prefix = "(513)"; - } - - 514 - { - title = "Scroll Ceiling Texture (Accelerative)"; - prefix = "(514)"; - } - - 515 - { - title = "Scroll Ceiling Texture (Displacement)"; - prefix = "(515)"; - } - - 520 - { - title = "Carry Objects on Floor"; - prefix = "(520)"; - } - - 521 - { - title = "Carry Objects on Floor (Accelerative)"; - prefix = "(521)"; - flags64text = "[6] Even across edges"; - } - - 522 - { - title = "Carry Objects on Floor (Displacement)"; - prefix = "(522)"; - } - - 523 - { - title = "Carry Objects on Ceiling"; - prefix = "(523)"; - flags64text = "[6] Even across edges"; - } - - 524 - { - title = "Carry Objects on Ceiling (Accelerative)"; - prefix = "(524)"; - } - - 525 - { - title = "Carry Objects on Ceiling (Displacement)"; - prefix = "(525)"; - } - - 530 - { - title = "Scroll Floor Texture and Carry Objects"; - prefix = "(530)"; - flags64text = "[6] Even across edges"; - } - - 531 - { - title = "Scroll Floor Texture and Carry Objects (Accelerative)"; - prefix = "(531)"; - } - - 532 - { - title = "Scroll Floor Texture and Carry Objects (Displacement)"; - prefix = "(532)"; - } - - 533 - { - title = "Scroll Ceiling Texture and Carry Objects"; - prefix = "(533)"; - flags64text = "[6] Even across edges"; - } - - 534 - { - title = "Scroll Ceiling Texture and Carry Objects (Accelerative)"; - prefix = "(534)"; - } - - 535 - { - title = "Scroll Ceiling Texture and Carry Objects (Displacement)"; - prefix = "(535)"; - } - } - - pusher - { - title = "Pusher"; - - 541 - { - title = "Wind"; - prefix = "(541)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 542 - { - title = "Upwards Wind"; - prefix = "(542)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 543 - { - title = "Downwards Wind"; - prefix = "(543)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 544 - { - title = "Current"; - prefix = "(544)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 545 - { - title = "Upwards Current"; - prefix = "(545)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 546 - { - title = "Downwards Current"; - prefix = "(546)"; - flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; - } - - 547 - { - title = "Push/Pull"; - prefix = "(547)"; - } - } - - light - { - title = "Lighting"; - - 600 - { - title = "Floor Lighting"; - prefix = "(600)"; - } - - 601 - { - title = "Ceiling Lighting"; - prefix = "(601)"; - } - - 602 - { - title = "Adjustable Pulsating Light"; - prefix = "(602)"; - } - - 603 - { - title = "Adjustable Flickering Light"; - prefix = "(603)"; - } - - 604 - { - title = "Adjustable Blinking Light (unsynchronized)"; - prefix = "(604)"; - } - - 605 - { - title = "Adjustable Blinking Light (synchronized)"; - prefix = "(605)"; - } - - 606 - { - title = "Colormap"; - prefix = "(606)"; - } - } - - slope - { - title = "Slope"; - - 700 - { - title = "Slope Frontside Floor"; - prefix = "(700)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 1; - } - - 701 - { - title = "Slope Frontside Ceiling"; - prefix = "(701)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 2; - } - - 702 - { - title = "Slope Frontside Floor and Ceiling"; - prefix = "(702)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 3; - } - - 703 - { - title = "Slope Frontside Floor and Backside Ceiling"; - prefix = "(703)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 9; - } - - 704 - { - title = "Slope Frontside Floor by 3 Tagged Vertex Things"; - prefix = "(704)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - flags8192text = "[13] Use tag and offsets"; - slope = "vertex"; - slopeargs = 0; - } - - 705 - { - title = "Slope Frontside Ceiling by 3 Tagged Vertex Things"; - prefix = "(705)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - flags8192text = "[13] Use tag and offsets"; - slope = "vertex"; - slopeargs = 1; - } - - 710 - { - title = "Slope Backside Floor"; - prefix = "(710)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 4; - } - - 711 - { - title = "Slope Backside Ceiling"; - prefix = "(711)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 8; - } - - 712 - { - title = "Slope Backside Floor and Ceiling"; - prefix = "(712)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 12; - } - - 713 - { - title = "Slope Backside Floor and Frontside Ceiling"; - prefix = "(713)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - slope = "regular"; - slopeargs = 6; - } - - 714 - { - title = "Slope Backside Floor by 3 Tagged Vertex Things"; - prefix = "(714)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - flags8192text = "[13] Use tag and offsets"; - slope = "vertex"; - slopeargs = 2; - } - - 715 - { - title = "Slope Backside Ceiling by 3 Tagged Vertex Things"; - prefix = "(715)"; - flags2048text = "[11] No physics"; - flags4096text = "[12] Dynamic"; - flags8192text = "[13] Use tag and offsets"; - slope = "vertex"; - slopeargs = 3; - } - - 720 - { - title = "Copy Frontside Floor Slope from Line Tag"; - prefix = "(720)"; - slope = "copy"; - slopeargs = 1; - } - - 721 - { - title = "Copy Frontside Ceiling Slope from Line Tag"; - prefix = "(721)"; - slope = "copy"; - slopeargs = 2; - } - - 722 - { - title = "Copy Frontside Floor and Ceiling Slope from Line Tag"; - prefix = "(722)"; - slope = "copy"; - slopeargs = 3; - } - - 799 - { - title = "Set Tagged Dynamic Slope Vertex to Front Sector Height"; - prefix = "(799)"; - } - } - - transwall - { - title = "Translucent Wall"; - - 900 - { - title = "90% Opaque"; - prefix = "(900)"; - } - - 901 - { - title = "80% Opaque"; - prefix = "(901)"; - } - - 902 - { - title = "70% Opaque"; - prefix = "(902)"; - } - - 903 - { - title = "60% Opaque"; - prefix = "(903)"; - } - - 904 - { - title = "50% Opaque"; - prefix = "(904)"; - } - - 905 - { - title = "40% Opaque"; - prefix = "(905)"; - } - - 906 - { - title = "30% Opaque"; - prefix = "(906)"; - } - - 907 - { - title = "20% Opaque"; - prefix = "(907)"; - } - - 908 - { - title = "10% Opaque"; - prefix = "(908)"; - } - - 909 - { - title = "Fog Wall"; - prefix = "(909)"; - } - } -} - -udmf -{ - misc - { - title = "Miscellaneous"; - - 0 - { - title = "None"; - prefix = "(0)"; - } - } -} \ No newline at end of file diff --git a/extras/conf/Includes/SRB222_misc.cfg b/extras/conf/Includes/SRB222_misc.cfg deleted file mode 100644 index ce23388b2..000000000 --- a/extras/conf/Includes/SRB222_misc.cfg +++ /dev/null @@ -1,726 +0,0 @@ -linedefflags -{ - 1 = "[0] Impassable"; - 2 = "[1] Block Enemies"; - 4 = "[2] Double-Sided"; - 8 = "[3] Upper Unpegged"; - 16 = "[4] Lower Unpegged"; - 32 = "[5] Slope Skew (E1)"; - 64 = "[6] Not Climbable"; - 128 = "[7] No Midtexture Skew (E2)"; - 256 = "[8] Peg Midtexture (E3)"; - 512 = "[9] Solid Midtexture (E4)"; - 1024 = "[10] Repeat Midtexture (E5)"; - 2048 = "[11] Netgame Only"; - 4096 = "[12] No Netgame"; - 8192 = "[13] Effect 6"; - 16384 = "[14] Bouncy Wall"; - 32768 = "[15] Transfer Line"; -} - - -// LINEDEF ACTIVATIONS -// Make sure these are in order from lowest value to highest value -linedefactivations -{ -} - - -// Linedef flags UDMF translation table -// This is needed for copy/paste and prefabs to work properly -// When the UDMF field name is prefixed with ! it is inverted -linedefflagstranslation -{ - 1 = "blocking"; - 2 = "blockmonsters"; - 4 = "twosided"; - 8 = "dontpegtop"; - 16 = "dontpegbottom"; - 32 = "skewtd"; - 64 = "noclimb"; - 128 = "noskew"; - 256 = "midpeg"; - 512 = "midsolid"; - 1024 = "wrapmidtex"; - 2048 = "netonly"; - 4096 = "nonet"; - 8192 = "effect6"; - 16384 = "bouncy"; - 32768 = "transfer"; -} - - -linedefflags_udmf -{ - blocking = "Impassable"; - blockmonsters = "Block Enemies"; - twosided = "Double-Sided"; - dontpegtop = "Upper Unpegged"; - dontpegbottom = "Lower Unpegged"; - skewtd = "Slope Skew"; - noclimb = "Not Climbable"; - noskew = "No Midtexture Skew"; - midpeg = "Peg Midtexture"; - midsolid = "Solid Midtexture"; - wrapmidtex = "Repeat Midtexture"; -// netonly = "Netgame-Only special"; -// nonet = "No netgame special"; -// effect6 = "Effect 6"; - bouncy = "Bouncy Wall"; -// transfer = "Transfer Line"; -} - - -linedefactivations_udmf -{ - notriggerorder = "Out of Order"; - netonly = "Netgame-Only"; - nonet = "No netgame"; -} - -sidedefflags -{ - clipmidtex = "Clip middle texture"; - wrapmidtex = "Wrap middle texture"; - smoothlighting = "Smooth lighting"; - nofakecontrast = "Even lighting"; - nodecals = "No decals"; - lightfog = "Use sidedef brightness on fogged walls"; -} - -//RENDER STYLES -thingrenderstyles -{ -} - -linedefrenderstyles -{ - translucent = "Translucent"; - fog = "Fog"; -} - -sectorrenderstyles -{ -} - -thingflags -{ - 1 = "[1] Extra"; - 2 = "[2] Flip"; - 4 = "[4] Special"; - 8 = "[8] Ambush"; -} - -// THING FLAGS -thingflags_udmf -{ - extra = "Extra"; - flip = "Flip"; - special = "Special"; - ambush = "Ambush"; -} - - -// Thing flags UDMF translation table -// This is needed for copy/paste and prefabs to work properly -// When the UDMF field name is prefixed with ! it is inverted -thingflagstranslation -{ - 1 = "extra"; - 2 = "flip"; - 4 = "special"; - 8 = "ambush"; -} - - -// DEFAULT SECTOR BRIGHTNESS LEVELS -sectorbrightness -{ - 255; - 248; - 240; - 232; - 224; - 216; - 208; - 200; - 192; - 184; - 176; - 168; - 160; - 152; - 144; - 136; - 128; - 120; - 112; - 104; - 96; - 88; - 80; - 72; - 64; - 56; - 48; - 40; - 32; - 24; - 16; - 8; - 0; -} - -/* -TEXTURES AND FLAT SOURCES -This tells Doom Builder where to find the information for textures -and flats in the IWAD file, Addition WAD file and Map WAD file. - -Start and end lumps must be given in a structure (of which the -key name doesnt matter) and any textures or flats in between them -are loaded in either the textures category or flats category. - -For textures: PNAMES, TEXTURE1 and TEXTURE2 are loaded by default. -*/ -textures -{ - zdoom1 - { - start = "TX_START"; - end = "TX_END"; - } -} - -/* -ADDITIONAL UNIVERSAL DOOM MAP FORMAT FIELD DEFINITIONS -Only add fields here that Doom Builder does not edit with its own user-interface! -The "default" field must match the UDMF specifications! - -Field data types: -0 = integer * -1 = float -2 = string -3 = bool -4 = linedef action (integer) * -5 = sector effect (integer) * -6 = texture (string) -7 = flat (string) -8 = angle in degrees (integer) -9 = angle in radians (float) -10 = XXRRGGBB color (integer) -11 = enum option (integer) * -12 = enum bits (integer) * -13 = sector tag (integer) * -14 = thing tag (integer) * -15 = linedef tag (integer) * -16 = enum option (string) -17 = angle in degrees (float) -22 = byte angle (integer) -*/ -universalfields -{ - sector - { - friction - { - name = "Friction"; - type = 1; - default = 1; - } - - specialeffectplanes - { - type = 11; - enum = "floorceiling"; - default = 0; - } - - colormapbegin - { - type = 0; - default = 0; - } - - colormapend - { - type = 0; - default = 33; - } - - foglighting - { - type = 3; - default = false; - } - - teambase - { - type = 11; - enum = "ctfteam"; - default = 0; - } - - triggersector - { - type = 3; - default = false; - } - - triggerobject - { - type = 11; - enum = "triggerobjects"; - default = 0; - } - - triggersurface - { - type = 11; - enum = "triggersurfaces"; - default = 0; - } - - ringdrain - { - type = 1; - default = 0; - } - } - - linedef - { - executordelay - { - type = 0; - default = 0; - } - midtexrepetitions - { - type = 0; - default = 0; - } - arg5 - { - type = 0; - default = 0; - } - arg1str - { - type = 2; - default = ""; - } - } - - thing - { - } -} - -/* -MAP LUMP NAMES -Map lumps are loaded with the map as long as they are right after each other. When the editor -meets a lump which is not defined in this list it will ignore the map if not satisfied. -The order of items defines the order in which lumps will be written to WAD file on save. -To indicate the map header lump, use ~MAP - -Legenda: -required = Lump is required to exist. -blindcopy = Lump will be copied along with the map blindly. (useful for lumps Doom Builder doesn't use) -nodebuild = The nodebuilder generates this lump. -allowempty = The nodebuilder is allowed to leave this lump empty. -scriptbuild = This lump is a text-based script, which should be compiled using current script compiler; -script = This lump is a text-based script. Specify the filename of the script configuration to use. -*/ - -doommaplumpnames -{ - ~MAP - { - required = true; - blindcopy = true; - nodebuild = false; - } - - THINGS - { - required = true; - nodebuild = true; - allowempty = true; - } - - LINEDEFS - { - required = true; - nodebuild = true; - allowempty = false; - } - - SIDEDEFS - { - required = true; - nodebuild = true; - allowempty = false; - } - - VERTEXES - { - required = true; - nodebuild = true; - allowempty = false; - } - - SEGS - { - required = false; - nodebuild = true; - allowempty = false; - } - - SSECTORS - { - required = false; - nodebuild = true; - allowempty = false; - } - - NODES - { - required = false; - nodebuild = true; - allowempty = false; - } - - SECTORS - { - required = true; - nodebuild = true; - allowempty = false; - } - - REJECT - { - required = false; - nodebuild = true; - allowempty = false; - } - - BLOCKMAP - { - required = false; - nodebuild = true; - allowempty = true; - } -} - -udmfmaplumpnames -{ - ZNODES - { - required = false; - nodebuild = true; - allowempty = false; - } - - REJECT - { - required = false; - nodebuild = true; - allowempty = false; - } - - BLOCKMAP - { - required = false; - nodebuild = true; - allowempty = true; - } -} - -// ENUMERATIONS -// These are enumerated lists for linedef types and UDMF fields. -// Reserved names are: angledeg, anglerad, color, texture, flat -enums -{ - falsetrue - { - 0 = "False"; - 1 = "True"; - } - - yesno - { - 0 = "Yes"; - 1 = "No"; - } - - noyes - { - 0 = "No"; - 1 = "Yes"; - } - - onoff - { - 0 = "On"; - 1 = "Off"; - } - - offon - { - 0 = "Off"; - 1 = "On"; - } - - updown - { - 0 = "Up"; - 1 = "Down"; - } - - downup - { - 0 = "Down"; - 1 = "Up"; - } - - addset - { - 0 = "Add"; - 1 = "Set"; - } - - floorceiling - { - 0 = "Floor"; - 1 = "Ceiling"; - 2 = "Floor and ceiling"; - } - - triggertype - { - 0 = "Continuous"; - 1 = "Each Time (Enter)"; - 2 = "Each Time (Enter and leave)"; - 3 = "Once"; - } - - frontback - { - 0 = "None"; - 1 = "Front"; - 2 = "Back"; - } - - ctfteam - { - 0 = "None"; - 1 = "Red"; - 2 = "Blue"; - } - - triggerobjects - { - 0 = "Any player"; - 1 = "All players"; - 2 = "Pushable object"; - 3 = "Any object with thinker"; - } - - triggersurfaces - { - 0 = "Floor touch"; - 1 = "Ceiling touch"; - 2 = "Floor or ceiling touch"; - 3 = "Anywhere in sector"; - } - - tangibility - { - 1 = "Intangible from top"; - 2 = "Intangible from bottom"; - 4 = "Don't block players"; - 8 = "Don't block non-players"; - } -} - -//Default things filters -thingsfilters -{ - - filter0 - { - name = "Player starts"; - category = "starts"; - type = -1; - } - - - filter1 - { - name = "Enemies"; - category = "enemies"; - type = -1; - - } - - - filter2 - { - name = "NiGHTS Track"; - category = "nightstrk"; - type = -1; - - } - - - filter3 - { - name = "Normal Gravity"; - category = ""; - type = -1; - - fields - { - 2 = false; - } - - } - - - filter4 - { - name = "Reverse Gravity"; - category = ""; - type = -1; - - fields - { - 2 = true; - } - - } -} - -thingsfilters_udmf -{ -} - -// Special linedefs -speciallinedefs -{ - soundlinedefflag = 64; // See linedefflags - singlesidedflag = 1; // See linedefflags - doublesidedflag = 4; // See linedefflags - impassableflag = 1; - upperunpeggedflag = 8; - lowerunpeggedflag = 16; - repeatmidtextureflag = 1024; - pegmidtextureflag = 256; -} - -speciallinedefs_udmf -{ - soundlinedefflag = "noclimb"; - singlesidedflag = "blocking"; - doublesidedflag = "twosided"; - impassableflag = "blocking"; - upperunpeggedflag = "dontpegtop"; - lowerunpeggedflag = "dontpegbottom"; - repeatmidtextureflag = "wrapmidtex"; - pegmidtextureflag = "midpeg"; -} - -scriptlumpnames -{ - MAINCFG - { - script = "SOC.cfg"; - } - - OBJCTCFG - { - script = "SOC.cfg"; - } - - SOC_ - { - script = "SOC.cfg"; - isprefix = true; - } - - LUA_ - { - script = "Lua.cfg"; - isprefix = true; - } -} - -// Texture sources -textures -{ - zdoom1 - { - start = "TX_START"; - end = "TX_END"; - } -} - -// Patch sources -patches -{ - standard1 - { - start = "P_START"; - end = "P_END"; - } - - standard2 - { - start = "PP_START"; - end = "PP_END"; - } -} - -// Sprite sources -sprites -{ - standard1 - { - start = "S_START"; - end = "S_END"; - } - - standard2 - { - start = "SS_START"; - end = "SS_END"; - } -} - -// Flat sources -flats -{ - standard1 - { - start = "F_START"; - end = "F_END"; - } - - standard2 - { - start = "FF_START"; - end = "FF_END"; - } - - standard3 - { - start = "FF_START"; - end = "F_END"; - } - - standard4 - { - start = "F_START"; - end = "FF_END"; - } -} \ No newline at end of file diff --git a/extras/conf/Includes/SRB222_sectors.cfg b/extras/conf/Includes/SRB222_sectors.cfg deleted file mode 100644 index 3bcbeb1b1..000000000 --- a/extras/conf/Includes/SRB222_sectors.cfg +++ /dev/null @@ -1,109 +0,0 @@ -sectortypes -{ - 0 = "Normal"; - 1 = "Damage"; - 2 = "Damage (Water)"; - 3 = "Damage (Fire)"; - 4 = "Damage (Electrical)"; - 5 = "Spikes"; - 6 = "Death Pit (Camera Tilt)"; - 7 = "Death Pit (No Camera Tilt)"; - 8 = "Instant Kill"; - 9 = "Ring Drainer (Floor Touch)"; - 10 = "Ring Drainer (Anywhere in Sector)"; - 11 = "Special Stage Damage"; - 12 = "Space Countdown"; - 13 = "Ramp Sector (double step-up/down)"; - 14 = "Non-Ramp Sector (no step-down)"; - 15 = "Bouncy FOF"; - 16 = "Trigger Line Ex. (Pushable Objects)"; - 32 = "Trigger Line Ex. (Anywhere, All Players)"; - 48 = "Trigger Line Ex. (Floor Touch, All Players)"; - 64 = "Trigger Line Ex. (Anywhere in Sector)"; - 80 = "Trigger Line Ex. (Floor Touch)"; - 96 = "Trigger Line Ex. (Emerald Check)"; - 112 = "Trigger Line Ex. (NiGHTS Mare)"; - 128 = "Check for Linedef Executor on FOFs"; - 144 = "Egg Capsule"; - 160 = "Special Stage Time/Rings Parameters"; - 176 = "Custom Global Gravity"; - 512 = "Wind/Current"; - 1024 = "Conveyor Belt"; - 1280 = "Speed Pad"; - 4096 = "Star Post Activator"; - 8192 = "Exit/Special Stage Pit/Return Flag"; - 12288 = "CTF Red Team Base"; - 16384 = "CTF Blue Team Base"; - 20480 = "Fan Sector"; - 24576 = "Super Sonic Transform"; - 28672 = "Force Spin"; - 32768 = "Zoom Tube Start"; - 36864 = "Zoom Tube End"; - 40960 = "Circuit Finish Line"; - 45056 = "Rope Hang"; - 49152 = "Intangible to the Camera"; -} - -gen_sectortypes -{ - first - { - 0 = "Normal"; - 1 = "Damage"; - 2 = "Damage (Water)"; - 3 = "Damage (Fire)"; - 4 = "Damage (Electrical)"; - 5 = "Spikes"; - 6 = "Death Pit (Camera Tilt)"; - 7 = "Death Pit (No Camera Tilt)"; - 8 = "Instant Kill"; - 9 = "Ring Drainer (Floor Touch)"; - 10 = "Ring Drainer (Anywhere in Sector)"; - 11 = "Special Stage Damage"; - 12 = "Space Countdown"; - 13 = "Ramp Sector (double step-up/down)"; - 14 = "Non-Ramp Sector (no step-down)"; - 15 = "Bouncy FOF"; - } - - second - { - 0 = "Normal"; - 16 = "Trigger Line Ex. (Pushable Objects)"; - 32 = "Trigger Line Ex. (Anywhere, All Players)"; - 48 = "Trigger Line Ex. (Floor Touch, All Players)"; - 64 = "Trigger Line Ex. (Anywhere in Sector)"; - 80 = "Trigger Line Ex. (Floor Touch)"; - 96 = "Trigger Line Ex. (Emerald Check)"; - 112 = "Trigger Line Ex. (NiGHTS Mare)"; - 128 = "Check for Linedef Executor on FOFs"; - 144 = "Egg Capsule"; - 160 = "Special Stage Time/Rings Parameters"; - 176 = "Custom Global Gravity"; - } - - third - { - 0 = "Normal"; - 512 = "Wind/Current"; - 1024 = "Conveyor Belt"; - 1280 = "Speed Pad"; - } - - fourth - { - 0 = "Normal"; - 4096 = "Star Post Activator"; - 8192 = "Exit/Special Stage Pit/Return Flag"; - 12288 = "CTF Red Team Base"; - 16384 = "CTF Blue Team Base"; - 20480 = "Fan Sector"; - 24576 = "Super Sonic Transform"; - 28672 = "Force Spin"; - 32768 = "Zoom Tube Start"; - 36864 = "Zoom Tube End"; - 40960 = "Circuit Finish Line"; - 45056 = "Rope Hang"; - 49152 = "Intangible to the Camera"; - } -} \ No newline at end of file diff --git a/extras/conf/Includes/SRB222_things.cfg b/extras/conf/Includes/SRB222_things.cfg deleted file mode 100644 index 194e43630..000000000 --- a/extras/conf/Includes/SRB222_things.cfg +++ /dev/null @@ -1,3398 +0,0 @@ -// THING TYPES------------------------------------------------------------------ -// Color values: 1-Dark_Blue 2-Dark_Green 3-Turqoise 4-Dark_Red 5-Purple 6-Brown 7-Gray -// 8-Dark_Gray 9-Blue 10-Green 11-Cyan 12-Red 13-Magenta -// 14-Yellow 15-White 16-Pink 17-Orange 18-Gold 19-Cream - -editor -{ - color = 15; // White - arrow = 1; - title = ""; - error = -1; - width = 8; - height = 16; - sort = 1; - - 3328 = "3D Mode Start"; -} - -starts -{ - color = 1; // Blue - arrow = 1; - title = "Player Starts"; - width = 16; - height = 48; - flags8text = "[8] Spawn on ceiling"; - sprite = "PLAYA0"; - - 1 - { - title = "Player 01 Start"; - sprite = "PLAYA0"; - } - 2 - { - title = "Player 02 Start"; - sprite = "PLAYA0"; - } - 3 - { - title = "Player 03 Start"; - sprite = "PLAYA0"; - } - 4 - { - title = "Player 04 Start"; - sprite = "PLAYA0"; - } - 5 - { - title = "Player 05 Start"; - sprite = "PLAYA0"; - } - 6 - { - title = "Player 06 Start"; - sprite = "PLAYA0"; - } - 7 - { - title = "Player 07 Start"; - sprite = "PLAYA0"; - } - 8 - { - title = "Player 08 Start"; - sprite = "PLAYA0"; - } - 9 - { - title = "Player 09 Start"; - sprite = "PLAYA0"; - } - 10 - { - title = "Player 10 Start"; - sprite = "PLAYA0"; - } - 11 - { - title = "Player 11 Start"; - sprite = "PLAYA0"; - } - 12 - { - title = "Player 12 Start"; - sprite = "PLAYA0"; - } - 13 - { - title = "Player 13 Start"; - sprite = "PLAYA0"; - } - 14 - { - title = "Player 14 Start"; - sprite = "PLAYA0"; - } - 15 - { - title = "Player 15 Start"; - sprite = "PLAYA0"; - } - 16 - { - title = "Player 16 Start"; - sprite = "PLAYA0"; - } - 17 - { - title = "Player 17 Start"; - sprite = "PLAYA0"; - } - 18 - { - title = "Player 18 Start"; - sprite = "PLAYA0"; - } - 19 - { - title = "Player 19 Start"; - sprite = "PLAYA0"; - } - 20 - { - title = "Player 20 Start"; - sprite = "PLAYA0"; - } - 21 - { - title = "Player 21 Start"; - sprite = "PLAYA0"; - } - 22 - { - title = "Player 22 Start"; - sprite = "PLAYA0"; - } - 23 - { - title = "Player 23 Start"; - sprite = "PLAYA0"; - } - 24 - { - title = "Player 24 Start"; - sprite = "PLAYA0"; - } - 25 - { - title = "Player 25 Start"; - sprite = "PLAYA0"; - } - 26 - { - title = "Player 26 Start"; - sprite = "PLAYA0"; - } - 27 - { - title = "Player 27 Start"; - sprite = "PLAYA0"; - } - 28 - { - title = "Player 28 Start"; - sprite = "PLAYA0"; - } - 29 - { - title = "Player 29 Start"; - sprite = "PLAYA0"; - } - 30 - { - title = "Player 30 Start"; - sprite = "PLAYA0"; - } - 31 - { - title = "Player 31 Start"; - sprite = "PLAYA0"; - } - 32 - { - title = "Player 32 Start"; - sprite = "PLAYA0"; - } - 33 - { - title = "Match Start"; - sprite = "NDRNA2A8"; - } - 34 - { - title = "CTF Red Team Start"; - sprite = "SIGNG0"; - } - 35 - { - title = "CTF Blue Team Start"; - sprite = "SIGNE0"; - } -} - -enemies -{ - color = 9; // Light_Blue - arrow = 1; - title = "Enemies"; - - 100 - { - title = "Crawla (Blue)"; - sprite = "POSSA1"; - width = 24; - height = 32; - } - 101 - { - title = "Crawla (Red)"; - sprite = "SPOSA1"; - width = 24; - height = 32; - } - 102 - { - title = "Stupid Dumb Unnamed RoboFish"; - sprite = "FISHA0"; - width = 8; - height = 28; - angletext = "Jump strength"; - } - 103 - { - title = "Buzz (Gold)"; - sprite = "BUZZA1"; - width = 28; - height = 40; - flags8text = "[8] Cannot move"; - } - 104 - { - title = "Buzz (Red)"; - sprite = "RBUZA1"; - width = 28; - height = 40; - flags8text = "[8] Cannot move"; - } - 108 - { - title = "Deton"; - sprite = "DETNA1"; - width = 20; - height = 32; - } - 110 - { - title = "Turret"; - sprite = "TRETA1"; - width = 16; - height = 32; - } - 111 - { - title = "Pop-up Turret"; - sprite = "TURRI1"; - width = 12; - height = 64; - angletext = "Firing delay"; - } - 122 - { - title = "Spring Shell (Green)"; - sprite = "SSHLA1"; - width = 24; - height = 40; - } - 125 - { - title = "Spring Shell (Yellow)"; - sprite = "SSHLI1"; - width = 24; - height = 40; - } - 109 - { - title = "Skim"; - sprite = "SKIMA1"; - width = 16; - height = 24; - } - 113 - { - title = "Jet Jaw"; - sprite = "JJAWA3A7"; - width = 12; - height = 20; - } - 126 - { - title = "Crushstacean"; - sprite = "CRABA0"; - width = 24; - height = 32; - flags8text = "[8] Move left from spawn"; - } - 138 - { - title = "Banpyura"; - sprite = "CR2BA0"; - width = 24; - height = 32; - flags8text = "[8] Move left from spawn"; - } - 117 - { - title = "Robo-Hood"; - sprite = "ARCHA1"; - width = 24; - height = 32; - } - 118 - { - title = "Lance-a-Bot"; - sprite = "CBFSA1"; - width = 32; - height = 72; - } - 1113 - { - title = "Suspicious Lance-a-Bot Statue"; - sprite = "CBBSA1"; - width = 32; - height = 72; - } - 119 - { - title = "Egg Guard"; - sprite = "ESHIA1"; - width = 16; - height = 48; - flags1text = "[1] 90 degrees counter-clockwise"; - flags4text = "[4] 90 degrees clockwise"; - flags8text = "[8] Double speed"; - } - 115 - { - title = "Bird Aircraft Strike Hazard"; - sprite = "VLTRF1"; - width = 12; - height = 24; - } - 120 - { - title = "Green Snapper"; - sprite = "GSNPA1"; - width = 24; - height = 24; - } - 121 - { - title = "Minus"; - sprite = "MNUSA0"; - width = 24; - height = 32; - } - 134 - { - title = "Canarivore"; - sprite = "CANAA0"; - width = 12; - height = 80; - hangs = 1; - } - 123 - { - title = "Unidus"; - sprite = "UNIDA1"; - width = 18; - height = 36; - } - 135 - { - title = "Pterabyte Spawner"; - sprite = "PTERA2A8"; - width = 16; - height = 16; - parametertext = "No. Pterabytes"; - } - 136 - { - title = "Pyre Fly"; - sprite = "PYREA0"; - width = 24; - height = 34; - flags8text = "[8] Start on fire"; - } - 137 - { - title = "Dragonbomber"; - sprite = "DRABA1"; - width = 28; - height = 48; - } - 105 - { - title = "Jetty-Syn Bomber"; - sprite = "JETBB1"; - width = 20; - height = 50; - flags8text = "[8] Cannot move"; - } - 106 - { - title = "Jetty-Syn Gunner"; - sprite = "JETGB1"; - width = 20; - height = 48; - flags8text = "[8] Cannot move"; - } - 112 - { - title = "Spincushion"; - sprite = "SHRPA1"; - width = 16; - height = 24; - } - 114 - { - title = "Snailer"; - sprite = "SNLRA3A7"; - width = 24; - height = 48; - } - 129 - { - title = "Penguinator"; - sprite = "PENGA1"; - width = 24; - height = 32; - } - 130 - { - title = "Pophat"; - sprite = "POPHA1"; - width = 24; - height = 32; - } - 107 - { - title = "Crawla Commander"; - sprite = "CCOMA1"; - width = 16; - height = 32; - } - 131 - { - title = "Spinbobert"; - sprite = "SBOBB0"; - width = 32; - height = 32; - } - 132 - { - title = "Cacolantern"; - sprite = "CACOA0"; - width = 32; - height = 32; - flags8text = "[8] Cannot move"; - } - 133 - { - title = "Hangster"; - sprite = "HBATC1"; - width = 24; - height = 24; - hangs = 1; - } - 127 - { - title = "Hive Elemental"; - sprite = "HIVEA0"; - width = 32; - height = 80; - parametertext = "No. bees"; - } - 128 - { - title = "Bumblebore"; - sprite = "BUMBA1"; - width = 16; - height = 32; - } - 124 - { - title = "Buggle"; - sprite = "BBUZA1"; - width = 20; - height = 24; - } - 116 - { - title = "Pointy"; - sprite = "PNTYA1"; - width = 8; - height = 16; - } -} - -bosses -{ - color = 8; // Dark_Gray - arrow = 1; - title = "Bosses"; - - 200 - { - title = "Egg Mobile"; - sprite = "EGGMA1"; - width = 24; - height = 76; - flags4text = "[4] End level on death"; - flags8text = "[8] Alternate laser attack"; - } - 201 - { - title = "Egg Slimer"; - sprite = "EGGNA1"; - width = 24; - height = 76; - flags4text = "[4] End level on death"; - flags8text = "[8] Speed up when hit"; - } - 202 - { - title = "Sea Egg"; - sprite = "EGGOA1"; - width = 32; - height = 116; - flags4text = "[4] End level on death"; - } - 203 - { - title = "Egg Colosseum"; - sprite = "EGGPA1"; - width = 24; - height = 76; - flags4text = "[4] End level on death"; - } - 204 - { - title = "Fang"; - sprite = "FANGA1"; - width = 24; - height = 60; - flags1text = "[1] Grayscale mode"; - flags4text = "[4] End level on death"; - } - 206 - { - title = "Brak Eggman (Old)"; - sprite = "BRAKB1"; - width = 48; - height = 160; - flags4text = "[4] End level on death"; - } - 207 - { - title = "Metal Sonic (Race)"; - sprite = "METLI1"; - width = 16; - height = 48; - flags1text = "[1] Grayscale mode"; - } - 208 - { - title = "Metal Sonic (Battle)"; - sprite = "METLC1"; - width = 16; - height = 48; - flags1text = "[1] Grayscale mode"; - flags4text = "[4] End level on death"; - } - 209 - { - title = "Brak Eggman"; - sprite = "BRAK01"; - width = 48; - height = 160; - flags1text = "[1] No origin-fling death"; - flags4text = "[4] End level on death"; - flags8text = "[8] Electric barrier"; - } - 290 - { - arrow = 0; - title = "Boss Escape Point"; - width = 8; - height = 16; - sprite = "internal:eggmanend"; - } - 291 - { - arrow = 0; - title = "Egg Capsule Center"; - width = 8; - height = 16; - sprite = "internal:capsule"; - } - 292 - { - arrow = 0; - title = "Boss Waypoint"; - width = 8; - height = 16; - flags8text = "[8] Sea Egg shooting point"; - sprite = "internal:eggmanway"; - angletext = "No. (Sea Egg)"; - flagsvaluetext = "No. (Brak)"; - parametertext = "Next"; - } - 293 - { - title = "Metal Sonic Gather Point"; - sprite = "internal:metal"; - width = 8; - height = 16; - } - 294 - { - title = "Fang Waypoint"; - flags8text = "[8] Center waypoint"; - sprite = "internal:eggmanway"; - width = 8; - height = 16; - } -} - -rings -{ - color = 14; // Yellow - title = "Rings and Weapon Panels"; - width = 24; - height = 24; - flags8height = 24; - flags8text = "[8] Float"; - sprite = "RINGA0"; - - 300 - { - title = "Ring"; - sprite = "RINGA0"; - width = 16; - } - 301 - { - title = "Bounce Ring"; - sprite = "internal:RNGBA0"; - } - 302 - { - title = "Rail Ring"; - sprite = "internal:RNGRA0"; - } - 303 - { - title = "Infinity Ring"; - sprite = "internal:RNGIA0"; - } - 304 - { - title = "Automatic Ring"; - sprite = "internal:RNGAA0"; - } - 305 - { - title = "Explosion Ring"; - sprite = "internal:RNGEA0"; - } - 306 - { - title = "Scatter Ring"; - sprite = "internal:RNGSA0"; - } - 307 - { - title = "Grenade Ring"; - sprite = "internal:RNGGA0"; - } - 308 - { - title = "CTF Team Ring (Red)"; - sprite = "internal:RRNGA0"; - width = 16; - } - 309 - { - title = "CTF Team Ring (Blue)"; - sprite = "internal:BRNGA0"; - width = 16; - } - 330 - { - title = "Bounce Ring Panel"; - sprite = "internal:PIKBA0"; - } - 331 - { - title = "Rail Ring Panel"; - sprite = "internal:PIKRA0"; - } - 332 - { - title = "Automatic Ring Panel"; - sprite = "internal:PIKAA0"; - } - 333 - { - title = "Explosion Ring Panel"; - sprite = "internal:PIKEA0"; - } - 334 - { - title = "Scatter Ring Panel"; - sprite = "internal:PIKSA0"; - } - 335 - { - title = "Grenade Ring Panel"; - sprite = "internal:PIKGA0"; - } -} - -collectibles -{ - color = 10; // Light_Green - title = "Other Collectibles"; - width = 16; - height = 32; - sort = 1; - sprite = "CEMGA0"; - - 310 - { - title = "CTF Red Flag"; - sprite = "RFLGA0"; - width = 24; - height = 64; - } - 311 - { - title = "CTF Blue Flag"; - sprite = "BFLGA0"; - width = 24; - height = 64; - } - 312 - { - title = "Emerald Token"; - sprite = "TOKEA0"; - width = 16; - height = 32; - flags8height = 24; - flags8text = "[8] Float"; - } - 313 - { - title = "Chaos Emerald 1 (Green)"; - sprite = "CEMGA0"; - } - 314 - { - title = "Chaos Emerald 2 (Purple)"; - sprite = "CEMGB0"; - } - 315 - { - title = "Chaos Emerald 3 (Blue)"; - sprite = "CEMGC0"; - } - 316 - { - title = "Chaos Emerald 4 (Cyan)"; - sprite = "CEMGD0"; - } - 317 - { - title = "Chaos Emerald 5 (Orange)"; - sprite = "CEMGE0"; - } - 318 - { - title = "Chaos Emerald 6 (Red)"; - sprite = "CEMGF0"; - } - 319 - { - title = "Chaos Emerald 7 (Gray)"; - sprite = "CEMGG0"; - } - 320 - { - title = "Emerald Hunt Location"; - sprite = "SHRDA0"; - } - 321 - { - title = "Match Chaos Emerald Spawn"; - sprite = "CEMGA0"; - flags8height = 24; - flags8text = "[8] Float"; - } - 322 - { - title = "Emblem"; - sprite = "EMBMA0"; - width = 16; - height = 30; - flags8height = 24; - flags8text = "[8] Float"; - angletext = "Tag"; - } -} - -boxes -{ - color = 7; // Gray - blocking = 2; - title = "Monitors"; - width = 18; - height = 40; - flags1text = "[1] Run Linedef Executor on pop"; - flags4text = "[4] Random (Strong)"; - flags8text = "[8] Random (Weak)"; - - 400 - { - title = "Super Ring (10 Rings)"; - sprite = "TVRIA0"; - } - 401 - { - title = "Pity Shield"; - sprite = "TVPIA0"; - } - 402 - { - title = "Attraction Shield"; - sprite = "TVATA0"; - } - 403 - { - title = "Force Shield"; - sprite = "TVFOA0"; - } - 404 - { - title = "Armageddon Shield"; - sprite = "TVARA0"; - } - 405 - { - title = "Whirlwind Shield"; - sprite = "TVWWA0"; - } - 406 - { - title = "Elemental Shield"; - sprite = "TVELA0"; - } - 407 - { - title = "Super Sneakers"; - sprite = "TVSSA0"; - } - 408 - { - title = "Invincibility"; - sprite = "TVIVA0"; - } - 409 - { - title = "Extra Life"; - sprite = "TV1UA0"; - flags4text = "[4] Random (Strong) / 10k points"; - flags8text = "[8] Random (Weak) / 10k points"; - } - 410 - { - title = "Eggman"; - sprite = "TVEGA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 411 - { - title = "Teleporter"; - sprite = "TVMXA0"; - } - 413 - { - title = "Gravity Boots"; - sprite = "TVGVA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 414 - { - title = "CTF Team Ring Monitor (Red)"; - sprite = "TRRIA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 415 - { - title = "CTF Team Ring Monitor (Blue)"; - sprite = "TBRIA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 416 - { - title = "Recycler"; - sprite = "TVRCA0"; - } - 418 - { - title = "Score (1,000 Points)"; - sprite = "TV1KA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 419 - { - title = "Score (10,000 Points)"; - sprite = "TVTKA0"; - flags4text = "[4] Special"; - flags8text = "[8] Ambush"; - } - 420 - { - title = "Flame Shield"; - sprite = "TVFLA0"; - } - 421 - { - title = "Water Shield"; - sprite = "TVBBA0"; - } - 422 - { - title = "Lightning Shield"; - sprite = "TVZPA0"; - } -} - -boxes2 -{ - color = 18; // Gold - blocking = 2; - title = "Monitors (Respawning)"; - width = 20; - height = 44; - flags1text = "[1] Run Linedef Executor on pop"; - - 431 - { - title = "Pity Shield (Respawn)"; - sprite = "TVPIB0"; - } - 432 - { - title = "Attraction Shield (Respawn)"; - sprite = "TVATB0"; - } - 433 - { - title = "Force Shield (Respawn)"; - sprite = "TVFOB0"; - } - 434 - { - title = "Armageddon Shield (Respawn)"; - sprite = "TVARB0"; - } - 435 - { - title = "Whirlwind Shield (Respawn)"; - sprite = "TVWWB0"; - } - 436 - { - title = "Elemental Shield (Respawn)"; - sprite = "TVELB0"; - } - 437 - { - title = "Super Sneakers (Respawn)"; - sprite = "TVSSB0"; - } - 438 - { - title = "Invincibility (Respawn)"; - sprite = "TVIVB0"; - } - 440 - { - title = "Eggman (Respawn)"; - sprite = "TVEGB0"; - } - 443 - { - title = "Gravity Boots (Respawn)"; - sprite = "TVGVB0"; - } - 450 - { - title = "Flame Shield (Respawn)"; - sprite = "TVFLB0"; - } - 451 - { - title = "Water Shield (Respawn)"; - sprite = "TVBBB0"; - } - 452 - { - title = "Lightning Shield (Respawn)"; - sprite = "TVZPB0"; - } -} - -generic -{ - color = 11; // Light_Cyan - title = "Generic Items & Hazards"; - - 500 - { - title = "Air Bubble Patch"; - sprite = "BUBLE0"; - width = 8; - height = 16; - flags8text = "[8] No distance check"; - } - 501 - { - title = "Signpost"; - sprite = "SIGND0"; - width = 8; - height = 32; - } - 502 - { - arrow = 1; - title = "Star Post"; - sprite = "STPTA0M0"; - width = 64; - height = 128; - angletext = "Angle/Order"; - } - 520 - { - title = "Bomb Sphere"; - sprite = "SPHRD0"; - width = 16; - height = 24; - flags8height = 24; - flags8text = "[8] Float"; - unflippable = true; - } - 521 - { - title = "Spikeball"; - sprite = "SPIKA0"; - width = 12; - height = 8; - flags8height = 24; - flags8text = "[8] Float"; - } - 522 - { - title = "Wall Spike"; - sprite = "WSPKALAR"; - width = 16; - height = 14; - flags1text = "[1] Start retracted"; - flags4text = "[4] Retractable"; - flags8text = "[8] Intangible"; - parametertext = "Initial delay"; - } - 523 - { - title = "Spike"; - sprite = "USPKA0"; - width = 8; - height = 32; - flags1text = "[1] Start retracted"; - flags4text = "[4] Retractable"; - flags8text = "[8] Intangible"; - angletext = "Retraction interval"; - parametertext = "Initial delay"; - } - 1130 - { - title = "Small Mace"; - sprite = "SMCEA0"; - width = 17; - height = 34; - } - 1131 - { - title = "Big Mace"; - sprite = "BMCEA0"; - width = 34; - height = 68; - } - 1136 - { - title = "Small Fireball"; - sprite = "SFBRA0"; - width = 17; - height = 34; - } - 1137 - { - title = "Large Fireball"; - sprite = "BFBRA0"; - width = 34; - height = 68; - } -} - -springs -{ - color = 12; // Light_Red - title = "Springs and Fans"; - width = 20; - height = 16; - sprite = "RSPRD2"; - - 540 - { - title = "Fan"; - sprite = "FANSA0D0"; - width = 16; - height = 8; - flags4text = "[4] Invisible"; - flags8text = "[8] No distance check"; - angletext = "Lift height"; - } - 541 - { - title = "Gas Jet"; - sprite = "STEMD0"; - flags8text = "[8] No sounds"; - width = 32; - } - 542 - { - title = "Bumper"; - sprite = "BUMPA0"; - width = 32; - height = 64; - angletext = "Strength"; - } - 543 - { - title = "Balloon"; - sprite = "BLONA0"; - width = 32; - height = 64; - flags8text = "[8] Respawn"; - angletext = "Color"; - } - 550 - { - title = "Yellow Spring"; - sprite = "SPRYA0"; - } - 551 - { - title = "Red Spring"; - sprite = "SPRRA0"; - } - 552 - { - title = "Blue Spring"; - sprite = "SPRBA0"; - } - 555 - { - arrow = 1; - title = "Diagonal Yellow Spring"; - sprite = "YSPRD2"; - width = 16; - flags4text = "[4] Ignore gravity"; - flags8text = "[8] Rotate 22.5° CCW"; - } - 556 - { - arrow = 1; - title = "Diagonal Red Spring"; - sprite = "RSPRD2"; - width = 16; - flags4text = "[4] Ignore gravity"; - flags8text = "[8] Rotate 22.5° CCW"; - } - 557 - { - arrow = 1; - title = "Diagonal Blue Spring"; - sprite = "BSPRD2"; - width = 16; - flags4text = "[4] Ignore gravity"; - flags8text = "[8] Rotate 22.5° CCW"; - } - 558 - { - arrow = 1; - title = "Horizontal Yellow Spring"; - sprite = "SSWYD2D8"; - flags8height = 16; - flags8text = "[8] Float"; - width = 16; - height = 32; - } - 559 - { - arrow = 1; - title = "Horizontal Red Spring"; - sprite = "SSWRD2D8"; - flags8height = 16; - flags8text = "[8] Float"; - width = 16; - height = 32; - } - 560 - { - arrow = 1; - title = "Horizontal Blue Spring"; - sprite = "SSWBD2D8"; - flags8height = 16; - flags8text = "[8] Float"; - width = 16; - height = 32; - } - 1134 - { - title = "Yellow Spring Ball"; - sprite = "YSPBA0"; - width = 17; - height = 34; - } - 1135 - { - title = "Red Spring Ball"; - sprite = "RSPBA0"; - width = 17; - height = 34; - } - 544 - { - arrow = 1; - title = "Yellow Boost Panel"; - sprite = "BSTYA0"; - flags8text = "[8] Force spin"; - width = 28; - height = 2; - } - 545 - { - arrow = 1; - title = "Red Boost Panel"; - sprite = "BSTRA0"; - flags8text = "[8] Force spin"; - width = 28; - height = 2; - } -} - -patterns -{ - color = 5; // Magenta - arrow = 1; - title = "Special Placement Patterns"; - width = 16; - height = 384; - sprite = "RINGA0"; - - 600 - { - arrow = 0; - title = "5 Vertical Rings (Yellow Spring)"; - sprite = "RINGA0"; - } - 601 - { - arrow = 0; - title = "5 Vertical Rings (Red Spring)"; - sprite = "RINGA0"; - height = 1024; - } - 602 - { - title = "5 Diagonal Rings (Yellow Spring)"; - sprite = "RINGA0"; - height = 32; - } - 603 - { - title = "10 Diagonal Rings (Red Spring)"; - sprite = "RINGA0"; - height = 32; - } - 604 - { - title = "Circle of Rings"; - sprite = "RINGA0"; - width = 96; - height = 192; - unflippable = true; - centerHitbox = true; - } - 605 - { - title = "Circle of Rings (Big)"; - sprite = "RINGA0"; - width = 192; - unflippable = true; - centerHitbox = true; - } - 606 - { - title = "Circle of Blue Spheres"; - sprite = "SPHRA0"; - width = 96; - height = 192; - unflippable = true; - centerHitbox = true; - } - 607 - { - title = "Circle of Blue Spheres (Big)"; - sprite = "SPHRA0"; - width = 192; - unflippable = true; - centerHitbox = true; - } - 608 - { - title = "Circle of Rings and Spheres"; - sprite = "SPHRA0"; - width = 96; - height = 192; - unflippable = true; - centerHitbox = true; - } - 609 - { - title = "Circle of Rings and Spheres (Big)"; - sprite = "SPHRA0"; - width = 192; - unflippable = true; - centerHitbox = true; - } -} - -invisible -{ - color = 15; // White - title = "Misc. Invisible"; - width = 0; - height = 0; - sprite = "UNKNA0"; - sort = 1; - fixedsize = true; - blocking = 0; - - 700 - { - title = "Water Ambience A (Large)"; - sprite = "internal:ambiance"; - } - - 701 - { - title = "Water Ambience B (Large)"; - sprite = "internal:ambiance"; - } - - 702 - { - title = "Water Ambience C (Medium)"; - sprite = "internal:ambiance"; - } - - 703 - { - title = "Water Ambience D (Medium)"; - sprite = "internal:ambiance"; - } - - 704 - { - title = "Water Ambience E (Small)"; - sprite = "internal:ambiance"; - } - - 705 - { - title = "Water Ambience F (Small)"; - sprite = "internal:ambiance"; - } - - 706 - { - title = "Water Ambience G (Extra Large)"; - sprite = "internal:ambiance"; - } - - 707 - { - title = "Water Ambience H (Extra Large)"; - sprite = "internal:ambiance"; - } - - 708 - { - title = "Disco Ambience"; - sprite = "internal:ambiance"; - } - - 709 - { - title = "Volcano Ambience"; - sprite = "internal:ambiance"; - } - - 710 - { - title = "Machine Ambience"; - sprite = "internal:ambiance"; - } - - 750 - { - title = "Slope Vertex"; - sprite = "internal:vertexslope"; - angletext = "Tag"; - } - - 751 - { - arrow = 1; - title = "Teleport Destination"; - sprite = "internal:tele"; - } - - 752 - { - arrow = 1; - title = "Alternate View Point"; - sprite = "internal:view"; - } - - 753 - { - title = "Zoom Tube Waypoint"; - sprite = "internal:zoom"; - angletext = "Order"; - } - - 754 - { - title = "Push Point"; - flags4text = "[4] Fades using XY"; - flags8text = "[8] Push using XYZ"; - sprite = "GWLGA0"; - angletext = "Radius"; - } - 755 - { - title = "Pull Point"; - flags4text = "[4] Fades using XY"; - flags8text = "[8] Pull using XYZ"; - sprite = "GWLRA0"; - angletext = "Radius"; - } - 756 - { - title = "Blast Linedef Executor"; - sprite = "TOADA0"; - width = 32; - height = 16; - } - 757 - { - title = "Fan Particle Generator"; - sprite = "PRTLA0"; - width = 8; - height = 16; - angletext = "Tag"; - } - 758 - { - title = "Object Angle Anchor"; - sprite = "internal:view"; - } - 760 - { - title = "PolyObject Anchor"; - sprite = "internal:polyanchor"; - angletext = "ID"; - } - - 761 - { - title = "PolyObject Spawn Point"; - sprite = "internal:polycenter"; - angletext = "ID"; - } - - 762 - { - title = "PolyObject Spawn Point (Crush)"; - sprite = "internal:polycentercrush"; - angletext = "ID"; - } - 780 - { - title = "Skybox View Point"; - sprite = "internal:skyb"; - flags4text = "[4] In-map centerpoint"; - parametertext = "ID"; - } -} - -greenflower -{ - color = 10; // Green - title = "Greenflower"; - - 800 - { - title = "GFZ Flower"; - sprite = "FWR1A0"; - width = 16; - height = 40; - } - 801 - { - title = "Sunflower"; - sprite = "FWR2A0"; - width = 16; - height = 96; - } - 802 - { - title = "Budding Flower"; - sprite = "FWR3A0"; - width = 8; - height = 32; - } - 803 - { - title = "Blueberry Bush"; - sprite = "BUS3A0"; - width = 16; - height = 32; - } - 804 - { - title = "Berry Bush"; - sprite = "BUS1A0"; - width = 16; - height = 32; - } - 805 - { - title = "Bush"; - sprite = "BUS2A0"; - width = 16; - height = 32; - } - 806 - { - title = "GFZ Tree"; - sprite = "TRE1A0"; - width = 20; - height = 128; - } - 807 - { - title = "GFZ Berry Tree"; - sprite = "TRE1B0"; - width = 20; - height = 128; - } - 808 - { - title = "GFZ Cherry Tree"; - sprite = "TRE1C0"; - width = 20; - height = 128; - } - 809 - { - title = "Checkered Tree"; - sprite = "TRE2A0"; - width = 20; - height = 200; - } - 810 - { - title = "Checkered Tree (Sunset)"; - sprite = "TRE2B0"; - width = 20; - height = 200; - } - 811 - { - title = "Polygon Tree"; - sprite = "TRE4A0"; - width = 20; - height = 200; - } - 812 - { - title = "Bush Tree"; - sprite = "TRE5A0"; - width = 20; - height = 200; - } - 813 - { - title = "Red Bush Tree"; - sprite = "TRE5B0"; - width = 20; - height = 200; - } -} - -technohill -{ - color = 10; // Green - title = "Techno Hill"; - - 900 - { - title = "THZ Steam Flower"; - sprite = "THZPA0"; - width = 8; - height = 32; - } - 901 - { - title = "Alarm"; - sprite = "ALRMA0"; - width = 8; - height = 16; - hangs = 1; - } - 902 - { - title = "THZ Spin Flower (Red)"; - sprite = "FWR5A0"; - width = 16; - height = 64; - } - 903 - { - title = "THZ Spin Flower (Yellow)"; - sprite = "FWR6A0"; - width = 16; - height = 64; - } - 904 - { - arrow = 1; - title = "Whistlebush"; - sprite = "THZTA0"; - width = 16; - height = 64; - } -} - -deepsea -{ - color = 10; // Green - title = "Deep Sea"; - - 1000 - { - arrow = 1; - blocking = 2; - title = "Gargoyle"; - sprite = "GARGA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1009 - { - arrow = 1; - blocking = 2; - title = "Gargoyle (Big)"; - sprite = "GARGB1"; - width = 32; - height = 80; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1001 - { - title = "Seaweed"; - sprite = "SEWEA0"; - width = 24; - height = 56; - } - 1002 - { - title = "Dripping Water"; - sprite = "DRIPD0"; - width = 8; - height = 16; - hangs = 1; - angletext = "Dripping interval"; - } - 1003 - { - title = "Coral (Green)"; - sprite = "CORLA0"; - width = 29; - height = 40; - } - 1004 - { - title = "Coral (Red)"; - sprite = "CORLB0"; - width = 30; - height = 53; - } - 1005 - { - title = "Coral (Orange)"; - sprite = "CORLC0"; - width = 28; - height = 41; - } - 1006 - { - title = "Blue Crystal"; - sprite = "BCRYA1"; - width = 8; - height = 16; - } - 1007 - { - title = "Kelp"; - sprite = "KELPA0"; - width = 16; - height = 292; - flags4text = "[4] Double size"; - } - 1008 - { - title = "Stalagmite (DSZ1)"; - sprite = "DSTGA0"; - width = 8; - height = 116; - flags4text = "[4] Double size"; - } - 1010 - { - arrow = 1; - title = "Light Beam"; - sprite = "LIBEARAL"; - width = 16; - height = 16; - } - 1011 - { - title = "Stalagmite (DSZ2)"; - sprite = "DSTGA0"; - width = 8; - height = 116; - flags4text = "[4] Double size"; - } - 1012 - { - arrow = 1; - title = "Big Floating Mine"; - width = 28; - height = 56; - sprite = "BMNEA1"; - } - 1013 - { - title = "Animated Kelp"; - sprite = "ALGAA0"; - width = 48; - height = 120; - } - 1014 - { - title = "Large Coral (Brown)"; - sprite = "CORLD0"; - width = 56; - height = 112; - } - 1015 - { - title = "Large Coral (Beige)"; - sprite = "CORLE0"; - width = 56; - height = 112; - } -} - -castleeggman -{ - color = 10; // Green - title = "Castle Eggman"; - - 1100 - { - title = "Chain (Decorative)"; - sprite = "CHANA0"; - width = 4; - height = 128; - hangs = 1; - } - 1101 - { - title = "Torch"; - sprite = "FLAMA0E0"; - width = 8; - height = 32; - flags1text = "[1] Add corona"; - } - 1102 - { - arrow = 1; - blocking = 2; - title = "Eggman Statue"; - sprite = "ESTAA1"; - width = 32; - height = 240; - flags1text = "[1] Solid gold"; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1103 - { - title = "CEZ Flower"; - sprite = "FWR4A0"; - width = 16; - height = 40; - } - 1104 - { - title = "Mace Spawnpoint"; - sprite = "SMCEA0"; - width = 17; - height = 34; - flags4text = "[4] No sounds"; - flags8text = "[8] Double size"; - angletext = "Tag"; - } - 1105 - { - title = "Chain with Maces Spawnpoint"; - sprite = "SMCEA0"; - width = 17; - height = 34; - flags4text = "[4] No sounds"; - flags8text = "[8] Double size"; - angletext = "Tag"; - } - 1106 - { - title = "Chained Spring Spawnpoint"; - sprite = "YSPBA0"; - width = 17; - height = 34; - flags4text = "[4] No sounds"; - flags8text = "[8] Red spring"; - angletext = "Tag"; - } - 1107 - { - title = "Chain Spawnpoint"; - sprite = "BMCHA0"; - width = 17; - height = 34; - flags8text = "[8] Double size"; - angletext = "Tag"; - } - 1108 - { - arrow = 1; - title = "Hidden Chain Spawnpoint"; - sprite = "internal:chain3"; - width = 17; - height = 34; - flags8text = "[8] Double size"; - } - 1109 - { - title = "Firebar Spawnpoint"; - sprite = "BFBRA0"; - width = 17; - height = 34; - flags4text = "[4] No sounds"; - flags8text = "[8] Double size"; - angletext = "Tag"; - } - 1110 - { - title = "Custom Mace Spawnpoint"; - sprite = "SMCEA0"; - width = 17; - height = 34; - flags4text = "[4] No sounds"; - angletext = "Tag"; - } - 1111 - { - arrow = 1; - blocking = 2; - title = "Crawla Statue"; - sprite = "CSTAA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1112 - { - arrow = 1; - blocking = 2; - title = "Lance-a-Bot Statue"; - sprite = "CBBSA1"; - width = 32; - height = 72; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1114 - { - title = "Pine Tree"; - sprite = "PINEA0"; - width = 16; - height = 628; - } - 1115 - { - title = "CEZ Shrub (Small)"; - sprite = "CEZBA0"; - width = 16; - height = 24; - } - 1116 - { - title = "CEZ Shrub (Large)"; - sprite = "CEZBB0"; - width = 32; - height = 48; - } - 1117 - { - arrow = 1; - title = "Pole Banner (Red)"; - sprite = "BANRA0"; - width = 40; - height = 224; - } - 1118 - { - arrow = 1; - title = "Pole Banner (Blue)"; - sprite = "BANRA0"; - width = 40; - height = 224; - } - 1119 - { - title = "Candle"; - sprite = "CNDLA0"; - width = 8; - height = 48; - flags1text = "[1] Add corona"; - } - 1120 - { - title = "Candle Pricket"; - sprite = "CNDLB0"; - width = 8; - height = 176; - flags1text = "[1] Add corona"; - } - 1121 - { - title = "Flame Holder"; - sprite = "FLMHA0"; - width = 24; - height = 80; - flags1text = "[1] Add corona"; - flags4text = "[4] No flame"; - } - 1122 - { - title = "Fire Torch"; - sprite = "CTRCA0"; - width = 16; - height = 80; - } - 1123 - { - title = "Cannonball Launcher"; - sprite = "internal:cannonball"; - width = 8; - height = 16; - } - 1124 - { - blocking = 2; - title = "Cannonball"; - sprite = "CBLLA0"; - width = 20; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1125 - { - title = "Brambles"; - sprite = "CABRALAR"; - width = 48; - height = 32; - } - 1126 - { - title = "Invisible Lockon Object"; - sprite = "LCKNC0"; - width = 16; - height = 32; - } - 1127 - { - title = "Spectator Eggrobo"; - sprite = "EGR1A1"; - width = 20; - height = 72; - } - 1128 - { - arrow = 1; - title = "Waving Flag (Red)"; - sprite = "CFLGA0"; - width = 8; - height = 208; - } - 1129 - { - arrow = 1; - title = "Waving Flag (Blue)"; - sprite = "CFLGA0"; - width = 8; - height = 208; - } -} - -aridcanyon -{ - color = 10; // Green - title = "Arid Canyon"; - - 1200 - { - title = "Tumbleweed (Big)"; - sprite = "BTBLA0"; - width = 24; - height = 48; - flags8text = "[8] Moves perpetually"; - } - 1201 - { - title = "Tumbleweed (Small)"; - sprite = "STBLA0"; - width = 12; - height = 24; - flags8text = "[8] Moves perpetually"; - } - 1202 - { - arrow = 1; - title = "Rock Spawner"; - sprite = "ROIAA0"; - width = 8; - height = 16; - angletext = "Tag"; - } - 1203 - { - title = "Tiny Red Flower Cactus"; - sprite = "CACTA0"; - width = 13; - height = 24; - } - 1204 - { - title = "Small Red Flower Cactus"; - sprite = "CACTB0"; - width = 15; - height = 52; - } - 1205 - { - title = "Tiny Blue Flower Cactus"; - sprite = "CACTC0"; - width = 13; - height = 24; - } - 1206 - { - title = "Small Blue Flower Cactus"; - sprite = "CACTD0"; - width = 15; - height = 52; - } - 1207 - { - title = "Prickly Pear"; - sprite = "CACTE0"; - width = 32; - height = 96; - } - 1208 - { - title = "Barrel Cactus"; - sprite = "CACTF0"; - width = 20; - height = 128; - } - 1209 - { - title = "Tall Barrel Cactus"; - sprite = "CACTG0"; - width = 24; - height = 224; - } - 1210 - { - title = "Armed Cactus"; - sprite = "CACTH0"; - width = 24; - height = 256; - } - 1211 - { - title = "Ball Cactus"; - sprite = "CACTI0"; - width = 48; - height = 96; - } - 1212 - { - title = "Caution Sign"; - sprite = "WWSGAR"; - width = 22; - height = 64; - } - 1213 - { - title = "Cacti Sign"; - sprite = "WWS2AR"; - width = 22; - height = 64; - } - 1214 - { - title = "Sharp Turn Sign"; - sprite = "WWS3ALAR"; - width = 16; - height = 192; - } - 1215 - { - title = "Mine Oil Lamp"; - sprite = "OILLA0"; - width = 22; - height = 64; - hangs = 1; - } - 1216 - { - title = "TNT Barrel"; - sprite = "BARRA1"; - width = 24; - height = 63; - } - 1217 - { - title = "TNT Proximity Shell"; - sprite = "REMTA0"; - width = 64; - height = 40; - } - 1218 - { - title = "Dust Devil"; - sprite = "TAZDCR"; - width = 80; - height = 416; - } - 1219 - { - title = "Minecart Spawner"; - sprite = "MCRTCLFR"; - width = 22; - height = 32; - } - 1220 - { - title = "Minecart Stopper"; - sprite = "MCRTIR"; - width = 32; - height = 32; - } - 1221 - { - title = "Minecart Saloon Door"; - sprite = "SALDARAL"; - width = 96; - height = 160; - flags8text = "[8] Allow non-minecart players"; - } - 1222 - { - title = "Train Cameo Spawner"; - sprite = "TRAEBRBL"; - width = 28; - height = 32; - } - 1223 - { - title = "Train Dust Spawner"; - sprite = "ADSTA0"; - width = 4; - height = 4; - } - 1224 - { - title = "Train Steam Spawner"; - sprite = "STEAA0"; - width = 4; - height = 4; - } - 1229 - { - title = "Minecart Switch Point"; - sprite = "internal:zoom"; - width = 8; - height = 16; - flags8text = "[8] Enable switching"; - } - 1230 - { - title = "Tiny Cactus"; - sprite = "CACTJ0"; - width = 13; - height = 28; - } - 1231 - { - title = "Small Cactus"; - sprite = "CACTK0"; - width = 15; - height = 60; - } -} - -redvolcano -{ - color = 10; // Green - title = "Red Volcano"; - - 1300 - { - arrow = 1; - title = "Flame Jet (Horizontal)"; - sprite = "internal:flameh"; - width = 16; - height = 40; - flags8text = "[8] Waves vertically"; - angletext = "On/Off time"; - parametertext = "Strength"; - } - 1301 - { - title = "Flame Jet (Vertical)"; - sprite = "internal:flamev"; - width = 16; - height = 40; - flags8text = "[8] Shoot downwards"; - angletext = "On/Off time"; - parametertext = "Strength"; - } - 1302 - { - title = "Spinning Flame Jet (Counter-Clockwise)"; - sprite = "internal:flame2"; - width = 16; - height = 24; - } - 1303 - { - title = "Spinning Flame Jet (Clockwise)"; - sprite = "internal:flame1"; - width = 16; - height = 24; - } - 1304 - { - title = "Lavafall"; - sprite = "LFALF0"; - width = 30; - height = 32; - angletext = "Initial delay"; - flags8text = "[8] Double size"; - } - 1305 - { - title = "Rollout Rock"; - sprite = "PUMIA1A5"; - width = 30; - height = 60; - flags8text = "[8] Non-buoyant"; - } - 1306 - { - title = "Big Fern"; - sprite = "JPLAB0"; - width = 32; - height = 48; - } - 1307 - { - title = "Jungle Palm"; - sprite = "JPLAC0"; - width = 32; - height = 48; - } - 1308 - { - title = "Torch Flower"; - sprite = "TFLOA0"; - width = 14; - height = 110; - } - 1309 - { - title = "RVZ1 Wall Vine (Long)"; - sprite = "WVINALAR"; - width = 1; - height = 288; - } - 1310 - { - title = "RVZ1 Wall Vine (Short)"; - sprite = "WVINBLBR"; - width = 1; - height = 288; - } -} - -botanicserenity -{ - color = 10; // Green - title = "Botanic Serenity"; - width = 16; - height = 32; - sprite = "BSZ1A0"; - 1400 - { - title = "Tall Flower (Red)"; - sprite = "BSZ1A0"; - } - 1401 - { - title = "Tall Flower (Purple)"; - sprite = "BSZ1B0"; - } - 1402 - { - title = "Tall Flower (Blue)"; - sprite = "BSZ1C0"; - } - 1403 - { - title = "Tall Flower (Cyan)"; - sprite = "BSZ1D0"; - } - 1404 - { - title = "Tall Flower (Yellow)"; - sprite = "BSZ1E0"; - } - 1405 - { - title = "Tall Flower (Orange)"; - sprite = "BSZ1F0"; - } - 1410 - { - title = "Medium Flower (Red)"; - sprite = "BSZ2A0"; - } - 1411 - { - title = "Medium Flower (Purple)"; - sprite = "BSZ2B0"; - } - 1412 - { - title = "Medium Flower (Blue)"; - sprite = "BSZ2C0"; - } - 1413 - { - title = "Medium Flower (Cyan)"; - sprite = "BSZ2D0"; - } - 1414 - { - title = "Medium Flower (Yellow)"; - sprite = "BSZ2E0"; - } - 1415 - { - title = "Medium Flower (Orange)"; - sprite = "BSZ2F0"; - } - 1420 - { - title = "Short Flower (Red)"; - sprite = "BSZ3A0"; - } - 1421 - { - title = "Short Flower (Purple)"; - sprite = "BSZ3B0"; - } - 1422 - { - title = "Short Flower (Blue)"; - sprite = "BSZ3C0"; - } - 1423 - { - title = "Short Flower (Cyan)"; - sprite = "BSZ3D0"; - } - 1424 - { - title = "Short Flower (Yellow)"; - sprite = "BSZ3E0"; - } - 1425 - { - title = "Short Flower (Orange)"; - sprite = "BSZ3F0"; - } - 1430 - { - title = "Tulip (Red)"; - sprite = "BST1A0"; - } - 1431 - { - title = "Tulip (Purple)"; - sprite = "BST2A0"; - } - 1432 - { - title = "Tulip (Blue)"; - sprite = "BST3A0"; - } - 1433 - { - title = "Tulip (Cyan)"; - sprite = "BST4A0"; - } - 1434 - { - title = "Tulip (Yellow)"; - sprite = "BST5A0"; - } - 1435 - { - title = "Tulip (Orange)"; - sprite = "BST6A0"; - } - 1440 - { - title = "Cluster (Red)"; - sprite = "BSZ5A0"; - } - 1441 - { - title = "Cluster (Purple)"; - sprite = "BSZ5B0"; - } - 1442 - { - title = "Cluster (Blue)"; - sprite = "BSZ5C0"; - } - 1443 - { - title = "Cluster (Cyan)"; - sprite = "BSZ5D0"; - } - 1444 - { - title = "Cluster (Yellow)"; - sprite = "BSZ5E0"; - } - 1445 - { - title = "Cluster (Orange)"; - sprite = "BSZ5F0"; - } - 1450 - { - title = "Bush (Red)"; - sprite = "BSZ6A0"; - } - 1451 - { - title = "Bush (Purple)"; - sprite = "BSZ6B0"; - } - 1452 - { - title = "Bush (Blue)"; - sprite = "BSZ6C0"; - } - 1453 - { - title = "Bush (Cyan)"; - sprite = "BSZ6D0"; - } - 1454 - { - title = "Bush (Yellow)"; - sprite = "BSZ6E0"; - } - 1455 - { - title = "Bush (Orange)"; - sprite = "BSZ6F0"; - } - 1460 - { - title = "Vine (Red)"; - sprite = "BSZ7A0"; - } - 1461 - { - title = "Vine (Purple)"; - sprite = "BSZ7B0"; - } - 1462 - { - title = "Vine (Blue)"; - sprite = "BSZ7C0"; - } - 1463 - { - title = "Vine (Cyan)"; - sprite = "BSZ7D0"; - } - 1464 - { - title = "Vine (Yellow)"; - sprite = "BSZ7E0"; - } - 1465 - { - title = "Vine (Orange)"; - sprite = "BSZ7F0"; - } - 1470 - { - title = "BSZ Shrub"; - sprite = "BSZ8A0"; - } - 1471 - { - title = "BSZ Clover"; - sprite = "BSZ8B0"; - } - 1473 - { - title = "Palm Tree (Big)"; - width = 16; - height = 160; - sprite = "BSZ8D0"; - } - 1475 - { - title = "Palm Tree (Small)"; - width = 16; - height = 80; - sprite = "BSZ8F0"; - } -} - -azuretemple -{ - color = 10; // Green - title = "Azure Temple"; - - 1500 - { - arrow = 1; - blocking = 2; - title = "Glaregoyle"; - sprite = "BGARA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1501 - { - arrow = 1; - blocking = 2; - title = "Glaregoyle (Up)"; - sprite = "BGARA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1502 - { - arrow = 1; - blocking = 2; - title = "Glaregoyle (Down)"; - sprite = "BGARA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1503 - { - arrow = 1; - blocking = 2; - title = "Glaregoyle (Long)"; - sprite = "BGARA1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1504 - { - title = "ATZ Target"; - sprite = "RCRYB0"; - width = 24; - height = 32; - } - 1505 - { - title = "Green Flame"; - sprite = "CFLMA0E0"; - width = 8; - height = 32; - } - 1506 - { - arrow = 1; - blocking = 2; - title = "Blue Gargoyle"; - sprite = "BGARD1"; - width = 16; - height = 40; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } -} - -dreamhill -{ - color = 10; // Green - title = "Dream Hill"; - - 1600 - { - title = "Spring Tree"; - sprite = "TRE6A0"; - width = 16; - height = 32; - } - 1601 - { - title = "Shleep"; - sprite = "SHLPA0"; - width = 24; - height = 32; - } - 1602 - { - title = "Pian"; - sprite = "NTPNALAR"; - width = 16; - height = 32; - } -} - -nightstrk -{ - color = 13; // Pink - title = "NiGHTS Track"; - width = 8; - height = 4096; - sprite = "UNKNA0"; - - 1700 - { - title = "Axis"; - sprite = "internal:axis1"; - circle = 1; - unflippable = true; - ignoreZ = true; - flagsvaluetext = "Order"; - angletext = "Radius/Direction"; - parametertext = "Mare"; - } - 1701 - { - title = "Axis Transfer"; - sprite = "internal:axis2"; - unflippable = true; - ignoreZ = true; - flagsvaluetext = "Order"; - parametertext = "Mare"; - } - 1702 - { - title = "Axis Transfer Line"; - sprite = "internal:axis3"; - unflippable = true; - ignoreZ = true; - flagsvaluetext = "Order"; - parametertext = "Mare"; - } - 1710 - { - title = "Ideya Capture"; - sprite = "CAPSA0"; - width = 72; - height = 144; - angletext = "Rings"; - parametertext = "Mare"; - } -} - -nights -{ - color = 13; // Pink - title = "NiGHTS Items"; - width = 16; - height = 32; - - 1703 - { - title = "Ideya Drone"; - sprite = "NDRNA1"; - width = 16; - height = 56; - flags1text = "[1] Align player to middle"; - flags4text = "[4] Align player to top"; - flags8text = "[8] Die upon time up"; - angletext = "Time limit"; - parametertext = "Height"; - } - 1704 - { - arrow = 1; - title = "NiGHTS Bumper"; - sprite = "NBMPG3G7"; - width = 32; - height = 64; - unflippable = true; - flagsvaluetext = "Pitch"; - angletext = "Yaw"; - } - 1705 - { - arrow = 1; - title = "Hoop (Generic)"; - sprite = "HOOPA0"; - width = 80; - height = 160; - unflippable = true; - centerHitbox = true; - flagsvaluetext = "Height"; - angletext = "Pitch/Yaw"; - } - 1706 - { - title = "Blue Sphere"; - sprite = "SPHRA0"; - width = 16; - height = 24; - flags8height = 24; - flags8text = "[8] Float"; - unflippable = true; - } - 1707 - { - title = "Super Paraloop"; - sprite = "NPRUA0"; - flags4text = "[4] Bonus time only"; - flags8text = "[8] Spawn immediately"; - } - 1708 - { - title = "Drill Refill"; - sprite = "NPRUB0"; - flags4text = "[4] Bonus time only"; - flags8text = "[8] Spawn immediately"; - } - 1709 - { - title = "Nightopian Helper"; - sprite = "NPRUC0"; - flags4text = "[4] Bonus time only"; - flags8text = "[8] Spawn immediately"; - } - 1711 - { - title = "Extra Time"; - sprite = "NPRUD0"; - flags4text = "[4] Bonus time only"; - flags8text = "[8] Spawn immediately"; - } - 1712 - { - title = "Link Freeze"; - sprite = "NPRUE0"; - flags4text = "[4] Bonus time only"; - flags8text = "[8] Spawn immediately"; - } - 1713 - { - arrow = 1; - title = "Hoop (Customizable)"; - flags1text = "[1] Radius +16"; - flags2text = "[2] Radius +32"; - flags4text = "[4] Radius +64"; - flags8text = "[8] Radius +128"; - sprite = "HOOPA0"; - width = 80; - height = 160; - unflippable = true; - centerHitbox = true; - } - 1714 - { - title = "Ideya Anchor Point"; - sprite = "internal:axis1"; - width = 8; - height = 16; - parametertext = "Ideya"; - } -} - -mario -{ - color = 6; // Brown - title = "Mario"; - - 1800 - { - title = "Coin"; - sprite = "COINA0"; - width = 16; - height = 24; - flags8height = 24; - flags8text = "[8] Float"; - } - 1801 - { - arrow = 1; - title = "Goomba"; - sprite = "GOOMA0"; - width = 24; - height = 32; - } - 1802 - { - arrow = 1; - title = "Goomba (Blue)"; - sprite = "BGOMA0"; - width = 24; - height = 32; - } - 1803 - { - title = "Fire Flower"; - sprite = "FFWRB0"; - width = 16; - height = 32; - } - 1804 - { - title = "Koopa Shell"; - sprite = "SHLLA1"; - width = 16; - height = 20; - } - 1805 - { - title = "Puma (Jumping Fireball)"; - sprite = "PUMAA0"; - width = 8; - height = 16; - angletext = "Jump strength"; - } - 1806 - { - title = "King Bowser"; - sprite = "KOOPA0"; - width = 16; - height = 48; - } - 1807 - { - title = "Axe"; - sprite = "MAXEA0"; - width = 8; - height = 16; - } - 1808 - { - title = "Bush (Short)"; - sprite = "MUS1A0"; - width = 16; - height = 32; - } - 1809 - { - title = "Bush (Tall)"; - sprite = "MUS2A0"; - width = 16; - height = 32; - } - 1810 - { - title = "Toad"; - sprite = "TOADA0"; - width = 8; - height = 32; - } -} - -christmasdisco -{ - color = 10; // Green - title = "Christmas & Disco"; - - 1850 - { - title = "Christmas Pole"; - sprite = "XMS1A0"; - width = 16; - height = 40; - } - 1851 - { - title = "Candy Cane"; - sprite = "XMS2A0"; - width = 8; - height = 32; - } - 1852 - { - blocking = 2; - title = "Snowman"; - sprite = "XMS3A0"; - width = 16; - height = 64; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1853 - { - blocking = 2; - title = "Snowman (With Hat)"; - sprite = "XMS3B0"; - width = 16; - height = 80; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } - 1854 - { - title = "Lamp Post"; - sprite = "XMS4A0"; - width = 8; - height = 120; - } - 1855 - { - title = "Lamp Post (Snow)"; - sprite = "XMS4B0"; - width = 8; - height = 120; - } - 1856 - { - title = "Hanging Star"; - sprite = "XMS5A0"; - width = 4; - height = 80; - hangs = 1; - } - 1857 - { - title = "Berry Bush (Snow)"; - sprite = "BUS1B0"; - width = 16; - height = 32; - } - 1858 - { - title = "Bush (Snow)"; - sprite = "BUS2B0"; - width = 16; - height = 32; - } - 1859 - { - title = "Blueberry Bush (Snow)"; - sprite = "BUS3B0"; - width = 16; - height = 32; - } - 1875 - { - title = "Disco Ball"; - sprite = "DBALA0"; - width = 16; - height = 54; - hangs = 1; - } - 1876 - { - arrow = 1; - blocking = 2; - title = "Eggman Disco Statue"; - sprite = "ESTAB1"; - width = 20; - height = 96; - flags4text = "[4] Slides when pushed"; - flags8text = "[8] Not pushable"; - } -} - -stalagmites -{ - color = 10; // Green - title = "Stalagmites"; - width = 16; - height = 40; - - 1900 - { - title = "Brown Stalagmite (Tall)"; - sprite = "STLGA0"; - width = 16; - height = 40; - } - 1901 - { - title = "Brown Stalagmite"; - sprite = "STLGB0"; - width = 16; - height = 40; - } - 1902 - { - title = "Orange Stalagmite (Tall)"; - sprite = "STLGC0"; - width = 16; - height = 40; - } - 1903 - { - title = "Orange Stalagmite"; - sprite = "STLGD0"; - width = 16; - height = 40; - } - 1904 - { - title = "Red Stalagmite (Tall)"; - sprite = "STLGE0"; - width = 16; - height = 40; - } - 1905 - { - title = "Red Stalagmite"; - sprite = "STLGF0"; - width = 16; - height = 40; - } - 1906 - { - title = "Gray Stalagmite (Tall)"; - sprite = "STLGG0"; - width = 24; - height = 96; - } - 1907 - { - title = "Gray Stalagmite"; - sprite = "STLGH0"; - width = 16; - height = 40; - } - 1908 - { - title = "Blue Stalagmite (Tall)"; - sprite = "STLGI0"; - width = 16; - height = 40; - } - 1909 - { - title = "Blue Stalagmite"; - sprite = "STLGJ0"; - width = 16; - height = 40; - } -} - -hauntedheights -{ - color = 10; // Green - title = "Haunted Heights"; - - 2000 - { - title = "Smashing Spikeball"; - sprite = "FMCEA0"; - width = 18; - height = 28; - angletext = "Initial delay"; - } - 2001 - { - title = "HHZ Grass"; - sprite = "HHZMA0"; - width = 16; - height = 40; - } - 2002 - { - title = "HHZ Tentacle 1"; - sprite = "HHZMB0"; - width = 16; - height = 40; - } - 2003 - { - title = "HHZ Tentacle 2"; - sprite = "HHZMC0"; - width = 16; - height = 40; - } - 2004 - { - title = "HHZ Stalagmite (Tall)"; - sprite = "HHZME0"; - width = 16; - height = 40; - } - 2005 - { - title = "HHZ Stalagmite (Short)"; - sprite = "HHZMF0"; - width = 16; - height = 40; - } - 2006 - { - title = "Jack-o'-lantern 1"; - sprite = "PUMKA0"; - width = 16; - height = 40; - flags1text = "Don't flicker"; - } - 2007 - { - title = "Jack-o'-lantern 2"; - sprite = "PUMKB0"; - width = 16; - height = 40; - flags1text = "Don't flicker"; - } - 2008 - { - title = "Jack-o'-lantern 3"; - sprite = "PUMKC0"; - width = 16; - height = 40; - flags1text = "Don't flicker"; - } - 2009 - { - title = "Purple Mushroom"; - sprite = "SHRMD0"; - width = 16; - height = 48; - } - 2010 - { - title = "HHZ Tree"; - sprite = "HHPLC0"; - width = 12; - height = 40; - } -} - -frozenhillside -{ - color = 10; // Green - title = "Frozen Hillside"; - - 2100 - { - title = "Ice Shard (Small)"; - sprite = "FHZIA0"; - width = 8; - height = 32; - } - 2101 - { - title = "Ice Shard (Large)"; - sprite = "FHZIB0"; - width = 8; - height = 32; - } - 2102 - { - title = "Crystal Tree (Aqua)"; - sprite = "TRE3A0"; - width = 20; - height = 200; - } - 2103 - { - title = "Crystal Tree (Pink)"; - sprite = "TRE3B0"; - width = 20; - height = 200; - } - 2104 - { - title = "Amy Cameo"; - sprite = "ROSYA1"; - width = 16; - height = 48; - flags1text = "[1] Grayscale mode"; - } - 2105 - { - title = "Mistletoe"; - sprite = "XMS6A0"; - width = 52; - height = 106; - } -} - -flickies -{ - color = 10; // Green - title = "Flickies"; - width = 8; - height = 20; - flags1text = "[1] Move aimlessly"; - flags4text = "[4] No movement"; - flags8text = "[8] Hop"; - angletext = "Radius"; - - 2200 - { - title = "Bluebird"; - sprite = "FL01A1"; - } - 2201 - { - title = "Rabbit"; - sprite = "FL02A1"; - } - 2202 - { - title = "Chicken"; - sprite = "FL03A1"; - } - 2203 - { - title = "Seal"; - sprite = "FL04A1"; - } - 2204 - { - title = "Pig"; - sprite = "FL05A1"; - } - 2205 - { - title = "Chipmunk"; - sprite = "FL06A1"; - } - 2206 - { - title = "Penguin"; - sprite = "FL07A1"; - } - 2207 - { - title = "Fish"; - sprite = "FL08A1"; - parametertext = "Color"; - } - 2208 - { - title = "Ram"; - sprite = "FL09A1"; - } - 2209 - { - title = "Puffin"; - sprite = "FL10A1"; - } - 2210 - { - title = "Cow"; - sprite = "FL11A1"; - } - 2211 - { - title = "Rat"; - sprite = "FL12A1"; - } - 2212 - { - title = "Bear"; - sprite = "FL13A1"; - } - 2213 - { - title = "Dove"; - sprite = "FL14A1"; - } - 2214 - { - title = "Cat"; - sprite = "FL15A1"; - } - 2215 - { - title = "Canary"; - sprite = "FL16A1"; - } - 2216 - { - title = "Spider"; - sprite = "FS01A1"; - } - 2217 - { - title = "Bat"; - sprite = "FS02A0"; - } -} \ No newline at end of file diff --git a/extras/conf/SRB2_22Doom.cfg b/extras/conf/SRB2_22Doom.cfg deleted file mode 100644 index 65e49d387..000000000 --- a/extras/conf/SRB2_22Doom.cfg +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************\ - Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2 -\************************************************************************/ - -// This is required to prevent accidental use of a different configuration -type = "Doom Builder 2 Game Configuration"; - -// This is the title to show for this game -game = "Sonic Robo Blast 2 - 2.2 (Doom format)"; - -// This is the simplified game engine/sourceport name -engine = "zdoom"; - -// Settings common to all games and all map formats -include("Includes\\SRB222_common.cfg", "common"); - -// Settings common to Doom map format -include("Includes\\SRB222_common.cfg", "mapformat_doom"); - -include("Includes\\Game_SRB222.cfg"); - -// Script lumps detection -scriptlumpnames -{ - include("Includes\\SRB222_misc.cfg", "scriptlumpnames"); -} - -// THING TYPES -thingtypes -{ - include("Includes\\SRB222_things.cfg"); -} - -//Default things filters -thingsfilters -{ - include("Includes\\SRB222_misc.cfg", "thingsfilters"); -} \ No newline at end of file diff --git a/extras/conf/SRB2_22UDMF.cfg b/extras/conf/SRB2_22UDMF.cfg deleted file mode 100644 index 52104ed09..000000000 --- a/extras/conf/SRB2_22UDMF.cfg +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************\ - Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2 -\************************************************************************/ - -// This is required to prevent accidental use of a different configuration -type = "Doom Builder 2 Game Configuration"; - -// This is the title to show for this game -game = "Sonic Robo Blast 2 - 2.2 (UDMF)"; - -// This is the simplified game engine/sourceport name -engine = "zdoom"; - -// Settings common to all games and all map formats -include("Includes\\SRB222_common.cfg", "common"); - -// Settings common to Doom map format -include("Includes\\SRB222_common.cfg", "mapformat_udmf"); - -include("Includes\\Game_SRB222.cfg"); - -// Script lumps detection -scriptlumpnames -{ - include("Includes\\SRB222_misc.cfg", "scriptlumpnames"); -} - -// THING TYPES -thingtypes -{ - include("Includes\\SRB222_things.cfg"); -} - -//Default things filters -thingsfilters -{ - include("Includes\\SRB222_misc.cfg", "thingsfilters"); -} - -// ENUMERATIONS -// Each engine has its own additional thing types -// These are enumerated lists for linedef types and UDMF fields. -enums -{ - // Basic game enums - include("Includes\\SRB222_misc.cfg", "enums"); -} \ No newline at end of file From 06f9246fd36b1dde74f0cd1d3248aa7aadb2ae97 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 21 Mar 2020 12:06:52 +0100 Subject: [PATCH 43/47] Updates and fixes for the ZB config --- extras/conf/SRB2-22.cfg | 109 +++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 35 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index ec318321d..5119c1234 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -435,7 +435,7 @@ sectortypes 112 = "Trigger Line Ex. (NiGHTS Mare)"; 128 = "Check for Linedef Executor on FOFs"; 144 = "Egg Capsule"; - 160 = "Special Stage Time/Rings Parameters"; + 160 = "Special Stage Time/Spheres Parameters"; 176 = "Custom Global Gravity"; 512 = "Wind/Current"; 1024 = "Conveyor Belt"; @@ -490,7 +490,7 @@ gen_sectortypes 112 = "Trigger Line Ex. (NiGHTS Mare)"; 128 = "Check for Linedef Executor on FOFs"; 144 = "Egg Capsule"; - 160 = "Special Stage Time/Rings Parameters"; + 160 = "Special Stage Time/Spheres Parameters"; 176 = "Custom Global Gravity"; } @@ -766,6 +766,7 @@ linedeftypes { title = "Parameters"; prefix = "(22)"; + flags32text = "[5] Render outer sides only"; flags64text = "[6] Trigger linedef executor"; flags128text = "[7] Intangible"; flags256text = "[8] Stopped by pushables"; @@ -788,7 +789,6 @@ linedeftypes { title = "Angular Displacement by Front Sector"; prefix = "(32)"; - flags8text = "[3] Set delay by backside sector"; flags64text = "[6] Don't turn players"; flags512text = "[9] Turn all objects"; } @@ -1136,7 +1136,6 @@ linedeftypes { title = "Goo Water, Translucent, No Sides"; prefix = "(125)"; - flags8text = "[3] Slope skew sides"; flags64text = "[6] Use two light levels"; flags512text = "[9] Use target light level"; flags1024text = "[10] Ripple effect"; @@ -1227,6 +1226,18 @@ linedeftypes 3dfloorflags = "19F"; } + 153 + { + title = "Dynamically Sinking Platform"; + prefix = "(153)"; + flags8text = "[3] Slope skew sides"; + flags32text = "[5] Only block player"; + flags64text = "[6] Spindash to move"; + flags128text = "[7] Only block non-players"; + 3dfloor = true; + 3dfloorflags = "19F"; + } + 160 { title = "Floating, Bobbing"; @@ -1282,7 +1293,6 @@ linedeftypes title = "Rising Platform, Solid, Invisible"; prefix = "(193)"; flags2text = "[1] Sink when stepped on"; - flags8text = "[3] Slope skew sides"; flags32text = "[5] Only block player"; flags64text = "[6] Spindash to move"; flags128text = "[7] Only block non-players"; @@ -1488,16 +1498,22 @@ linedeftypes { title = "Mario Block"; prefix = "(250)"; + flags8text = "[3] Slope skew sides"; flags32text = "[5] Invisible block"; flags64text = "[6] Brick block"; 3dfloor = true; 3dfloorflags = "40019F"; + flags323dfloorflagsremove = "19E"; + flags643dfloorflagsadd = "200000"; } 251 { title = "Thwomp Block"; prefix = "(251)"; + flags8text = "[3] Slope skew sides"; + flags32text = "[5] Only block player"; + flags128text = "[7] Only block non-players"; flags512text = "[9] Custom crushing sound"; flags1024text = "[10] Custom speed"; 3dfloor = true; @@ -1513,8 +1529,8 @@ linedeftypes flags512text = "[9] Shattered by pushables"; flags1024text = "[10] Trigger linedef executor"; 3dfloor = true; - 3dfloorflags = "8800019"; - flags643dfloorflagsadd = "200006"; + 3dfloorflags = "880001D"; + flags643dfloorflagsadd = "200002"; } 253 @@ -1525,7 +1541,7 @@ linedeftypes flags512text = "[9] Shattered by pushables"; flags1024text = "[10] Trigger linedef executor"; 3dfloor = true; - 3dfloorflags = "8801019"; + 3dfloorflags = "880101D"; } 254 @@ -1533,6 +1549,7 @@ linedeftypes title = "Bustable Block"; prefix = "(254)"; flags8text = "[3] Slope skew sides"; + flags32text = "[5] Only block player"; flags64text = "[6] Strong characters only"; flags128text = "[7] Only block non-players"; flags512text = "[9] Shattered by pushables"; @@ -1593,6 +1610,7 @@ linedeftypes { title = "Custom FOF"; prefix = "(259)"; + flags8text = "[3] Slope skew sides"; flags32text = "[5] Only block player"; flags128text = "[7] Only block non-players"; flags512text = "[9] Shattered by pushables"; @@ -2161,6 +2179,14 @@ linedeftypes flags8text = "[3] Set delay by backside sector"; } + 449 + { + title = "Enable Bosses with Parameter"; + prefix = "(449)"; + flags8text = "[3] Set delay by backside sector"; + flags64text = "[6] Disable bosses"; + } + 457 { title = "Track Object's Angle"; @@ -2180,12 +2206,14 @@ linedeftypes { title = "Award Rings"; prefix = "(460)"; + flags8text = "[3] Set delay by backside sector"; } 461 { title = "Spawn Object"; prefix = "(461)"; + flags8text = "[3] Set delay by backside sector"; flags64text = "[6] Spawn inside a range"; } @@ -2193,6 +2221,7 @@ linedeftypes { title = "Stop Timer/Exit Stage in Record Attack"; prefix = "(462)"; + flags8text = "[3] Set delay by backside sector"; } } @@ -2206,7 +2235,7 @@ linedeftypes prefix = "(413)"; flags2text = "[1] Keep after death"; flags8text = "[3] Set delay by backside sector"; - flags32text = "[5] Seek to current song position"; + flags32text = "[5] Seek from current position"; flags64text = "[6] For everyone"; flags128text = "[7] Fade to custom volume"; flags512text = "[9] Don't loop"; @@ -2220,7 +2249,7 @@ linedeftypes flags2text = "[1] From calling sector"; flags8text = "[3] Set delay by backside sector"; flags64text = "[6] From nowhere for triggerer"; - flags512text = "[9] For everyone"; + flags512text = "[9] From nowhere for everyone"; flags1024text = "[10] From tagged sectors"; } @@ -2298,7 +2327,6 @@ linedeftypes flags8text = "[3] Set delay by backside sector"; } - 445 { title = "Make FOF Disappear/Reappear"; @@ -2325,8 +2353,8 @@ linedeftypes flags32text = "[5] Subtract Red value"; flags64text = "[6] Subtract Green value"; flags128text = "[7] Subtract Blue value"; - flags256text = "[8] Calc relative values"; - flags32768text = "[15] Use back side colormap"; + flags256text = "[8] Set relative to current"; + flags32768text = "[15] Use backside colormap"; } 448 @@ -2359,7 +2387,7 @@ linedeftypes prefix = "(452)"; flags8text = "[3] Set delay by backside sector"; flags64text = "[6] Do not handle FF_TRANS"; - flags256text = "[8] Set relative to current val"; + flags256text = "[8] Set relative to current"; } 453 @@ -2371,7 +2399,7 @@ linedeftypes flags32text = "[5] No collision during fade"; flags64text = "[6] Do not handle FF_TRANS"; flags128text = "[7] Do not handle lighting"; - flags256text = "[8] Set relative to current val"; + flags256text = "[8] Set relative to current"; flags512text = "[9] Speed = Tic Duration"; flags1024text = "[10] Override existing fade"; flags16384text = "[14] Do not handle collision"; @@ -2395,11 +2423,11 @@ linedeftypes flags32text = "[5] Subtract Red value"; flags64text = "[6] Subtract Green value"; flags128text = "[7] Subtract Blue value"; - flags256text = "[8] Calc relative values"; + flags256text = "[8] Set relative to current"; flags512text = "[9] Speed = Tic Duration"; flags1024text = "[10] Override existing fade"; flags16384text = "[14] Fade from invisible black"; - flags32768text = "[15] Use back side colormap"; + flags32768text = "[15] Use backside colormap"; } 456 @@ -2416,9 +2444,7 @@ linedeftypes flags2text = "[1] Close text prompt"; flags8text = "[3] Set delay by backside sector"; flags32text = "[5] Run executor tag on close"; - flags64text = "[6] For everyone"; - flags128text = "[7] Do not block controls"; - flags256text = "[8] Do not freeze time"; + flags128text = "[7] Don't disable controls"; flags32768text = "[15] Find prompt by name"; } } @@ -2524,7 +2550,7 @@ linedeftypes prefix = "(491)"; flags8text = "[3] Set delay by backside sector"; flags16text = "[4] Set raw alpha by Front X"; - flags256text = "[8] Calc relative values"; + flags256text = "[8] Set relative to current"; } 492 @@ -2534,7 +2560,7 @@ linedeftypes flags8text = "[3] Set delay by backside sector"; flags16text = "[4] Set raw alpha by Front X"; flags32text = "[5] No collision during fade"; - flags256text = "[8] Calc relative values"; + flags256text = "[8] Set relative to current"; flags512text = "[9] Speed = Tic Duration"; flags1024text = "[10] Override existing fade"; flags16384text = "[14] Do not handle collision"; @@ -2632,76 +2658,84 @@ linedeftypes { title = "Carry Objects on Floor"; prefix = "(520)"; + flags64text = "[6] Exclusive"; } 521 { title = "Carry Objects on Floor (Accelerative)"; prefix = "(521)"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 522 { title = "Carry Objects on Floor (Displacement)"; prefix = "(522)"; + flags64text = "[6] Exclusive"; } 523 { title = "Carry Objects on Ceiling"; prefix = "(523)"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 524 { title = "Carry Objects on Ceiling (Accelerative)"; prefix = "(524)"; + flags64text = "[6] Exclusive"; } 525 { title = "Carry Objects on Ceiling (Displacement)"; prefix = "(525)"; + flags64text = "[6] Exclusive"; } 530 { title = "Scroll Floor Texture and Carry Objects"; prefix = "(530)"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 531 { title = "Scroll Floor Texture and Carry Objects (Accelerative)"; prefix = "(531)"; + flags64text = "[6] Exclusive"; } 532 { title = "Scroll Floor Texture and Carry Objects (Displacement)"; prefix = "(532)"; + flags64text = "[6] Exclusive"; } 533 { title = "Scroll Ceiling Texture and Carry Objects"; prefix = "(533)"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 534 { title = "Scroll Ceiling Texture and Carry Objects (Accelerative)"; prefix = "(534)"; + flags64text = "[6] Exclusive"; } 535 { title = "Scroll Ceiling Texture and Carry Objects (Displacement)"; prefix = "(535)"; + flags64text = "[6] Exclusive"; } } @@ -2714,7 +2748,7 @@ linedeftypes title = "Wind"; prefix = "(541)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 542 @@ -2722,7 +2756,7 @@ linedeftypes title = "Upwards Wind"; prefix = "(542)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 543 @@ -2730,7 +2764,7 @@ linedeftypes title = "Downwards Wind"; prefix = "(543)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 544 @@ -2738,7 +2772,7 @@ linedeftypes title = "Current"; prefix = "(544)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 545 @@ -2746,7 +2780,7 @@ linedeftypes title = "Upwards Current"; prefix = "(545)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 546 @@ -2754,13 +2788,14 @@ linedeftypes title = "Downwards Current"; prefix = "(546)"; flags512text = "[9] Player slides"; - flags64text = "[6] Even across edges"; + flags64text = "[6] Exclusive"; } 547 { title = "Push/Pull"; prefix = "(547)"; + flags64text = "[6] Exclusive"; } } @@ -3897,9 +3932,10 @@ thingtypes title = "Monitors"; width = 18; height = 40; - flags1text = "[1] Run Linedef Executor on pop"; + flags1text = "[1] Run linedef executor on pop"; flags4text = "[4] Random (Strong)"; flags8text = "[8] Random (Weak)"; + angletext = "Tag"; 400 { @@ -4029,7 +4065,8 @@ thingtypes title = "Monitors (Respawning)"; width = 20; height = 44; - flags1text = "[1] Run Linedef Executor on pop"; + flags1text = "[1] Run linedef executor on pop"; + angletext = "Tag"; 431 { @@ -4126,6 +4163,7 @@ thingtypes width = 64; height = 128; angletext = "Angle/Order"; + parametertext = "Order"; } 520 { @@ -4558,6 +4596,7 @@ thingtypes sprite = "TOADA0"; width = 32; height = 16; + angletext = "Tag"; } 757 { @@ -5832,7 +5871,7 @@ thingtypes sprite = "CAPSA0"; width = 72; height = 144; - angletext = "Rings"; + angletext = "Spheres"; parametertext = "Mare"; } } From d2c83e1cdae12e0cd02493a4e6f4786b93a5a471 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 21 Mar 2020 15:16:07 +0100 Subject: [PATCH 44/47] Add Object Special text for Star Post --- extras/conf/SRB2-22.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 5119c1234..0168cf210 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -4162,6 +4162,7 @@ thingtypes sprite = "STPTA0M0"; width = 64; height = 128; + flags4text = "[4] Respawn at center"; angletext = "Angle/Order"; parametertext = "Order"; } From c806d8a5e8c6572d0acabcb4e9f2e1ce1d243693 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 21 Mar 2020 20:17:28 +0100 Subject: [PATCH 45/47] Another ZB config fix --- extras/conf/SRB2-22.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 0168cf210..57805a528 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3442,8 +3442,8 @@ thingtypes sprite = "ESHIA1"; width = 16; height = 48; - flags1text = "[1] 90 degrees counter-clockwise"; - flags4text = "[4] 90 degrees clockwise"; + flags1text = "[1] 90 degrees clockwise"; + flags4text = "[4] 90 degrees counter-clockwise"; flags8text = "[8] Double speed"; } 115 From 6911097b56afc99f8a0ef3329bcf9f3bf0e89230 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 22 Mar 2020 07:50:57 +0100 Subject: [PATCH 46/47] Minor ZB config fix --- extras/conf/SRB2-22.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 57805a528..12287ec80 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -6313,7 +6313,7 @@ thingtypes sprite = "PUMKA0"; width = 16; height = 40; - flags1text = "Don't flicker"; + flags1text = "[1] Don't flicker"; } 2007 { @@ -6321,7 +6321,7 @@ thingtypes sprite = "PUMKB0"; width = 16; height = 40; - flags1text = "Don't flicker"; + flags1text = "[1] Don't flicker"; } 2008 { @@ -6329,7 +6329,7 @@ thingtypes sprite = "PUMKC0"; width = 16; height = 40; - flags1text = "Don't flicker"; + flags1text = "[1] Don't flicker"; } 2009 { From 48e8c9058a1ea98531e5887abd76cdbc13b550ac Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 22 Mar 2020 12:55:34 +0100 Subject: [PATCH 47/47] Add arrow to wall spike in ZB config --- extras/conf/SRB2-22.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 12287ec80..ec030b32f 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -4191,6 +4191,7 @@ thingtypes sprite = "WSPKALAR"; width = 16; height = 14; + arrow = 1; flags1text = "[1] Start retracted"; flags4text = "[4] Retractable"; flags8text = "[8] Intangible";