Merge branch 'delete-lua' into 'next'

Delete Lua

See merge request STJr/SRB2!852
This commit is contained in:
LJ Sonic 2020-03-20 09:53:24 -04:00
commit 37b70fe857
58 changed files with 515 additions and 1326 deletions

View File

@ -51,8 +51,8 @@ jobs:
- /var/cache/apt/archives - /var/cache/apt/archives
- checkout - checkout
- run: - run:
name: Compile without network support and BLUA name: Compile without network support
command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1 command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1
- run: - run:
name: wipe build name: wipe build
command: make -C src LINUX=1 cleandep command: make -C src LINUX=1 cleandep

View File

@ -216,8 +216,6 @@ source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
### Configuration ### Configuration
set(SRB2_CONFIG_HAVE_BLUA ON CACHE BOOL
"Enable Lua interpreter support")
set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL 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.") "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 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).") "Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT).")
endif() endif()
if(${SRB2_CONFIG_HAVE_BLUA}) set(SRB2_LUA_SOURCES
add_definitions(-DHAVE_BLUA) lua_baselib.c
set(SRB2_LUA_SOURCES lua_blockmaplib.c
lua_baselib.c lua_consolelib.c
lua_blockmaplib.c lua_hooklib.c
lua_consolelib.c lua_hudlib.c
lua_hooklib.c lua_infolib.c
lua_hudlib.c lua_maplib.c
lua_infolib.c lua_mathlib.c
lua_maplib.c lua_mobjlib.c
lua_mathlib.c lua_playerlib.c
lua_mobjlib.c lua_script.c
lua_playerlib.c lua_skinlib.c
lua_script.c lua_thinkerlib.c
lua_skinlib.c )
lua_thinkerlib.c set(SRB2_LUA_HEADERS
) lua_hook.h
set(SRB2_LUA_HEADERS lua_hud.h
lua_hook.h lua_libs.h
lua_hud.h lua_script.h
lua_libs.h )
lua_script.h
)
prepend_sources(SRB2_LUA_SOURCES) prepend_sources(SRB2_LUA_SOURCES)
prepend_sources(SRB2_LUA_HEADERS) 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 set(SRB2_BLUA_SOURCES
blua/lapi.c blua/lapi.c
blua/lauxlib.c blua/lauxlib.c
blua/lbaselib.c blua/lbaselib.c
blua/lcode.c blua/lcode.c
blua/ldebug.c blua/ldebug.c
blua/ldo.c blua/ldo.c
blua/ldump.c blua/ldump.c
blua/lfunc.c blua/lfunc.c
blua/lgc.c blua/lgc.c
blua/linit.c blua/linit.c
blua/liolib.c blua/liolib.c
blua/llex.c blua/llex.c
blua/lmem.c blua/lmem.c
blua/lobject.c blua/lobject.c
blua/lopcodes.c blua/lopcodes.c
blua/lparser.c blua/lparser.c
blua/lstate.c blua/lstate.c
blua/lstring.c blua/lstring.c
blua/lstrlib.c blua/lstrlib.c
blua/ltable.c blua/ltable.c
blua/ltablib.c blua/ltablib.c
blua/ltm.c blua/ltm.c
blua/lundump.c blua/lundump.c
blua/lvm.c blua/lvm.c
blua/lzio.c blua/lzio.c
) )
set(SRB2_BLUA_HEADERS set(SRB2_BLUA_HEADERS
blua/lapi.h blua/lapi.h
blua/lauxlib.h blua/lauxlib.h
blua/lcode.h blua/lcode.h
blua/ldebug.h blua/ldebug.h
blua/ldo.h blua/ldo.h
blua/lfunc.h blua/lfunc.h
blua/lgc.h blua/lgc.h
blua/llex.h blua/llex.h
blua/llimits.h blua/llimits.h
blua/lmem.h blua/lmem.h
blua/lobject.h blua/lobject.h
blua/lopcodes.h blua/lopcodes.h
blua/lparser.h blua/lparser.h
blua/lstate.h blua/lstate.h
blua/lstring.h blua/lstring.h
blua/ltable.h blua/ltable.h
blua/ltm.h blua/ltm.h
blua/lua.h blua/lua.h
blua/luaconf.h blua/luaconf.h
blua/lualib.h blua/lualib.h
blua/lundump.h blua/lundump.h
blua/lvm.h blua/lvm.h
blua/lzio.h blua/lzio.h
) )
prepend_sources(SRB2_BLUA_SOURCES) prepend_sources(SRB2_BLUA_SOURCES)
prepend_sources(SRB2_BLUA_HEADERS) prepend_sources(SRB2_BLUA_HEADERS)
source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS}) source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
endif()
if(${SRB2_CONFIG_HAVE_GME}) if(${SRB2_CONFIG_HAVE_GME})
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})

View File

@ -340,9 +340,7 @@ CFLAGS+=-DHAVE_MINIUPNPC
endif endif
endif endif
ifndef NO_LUA include blua/Makefile.cfg
include blua/Makefile.cfg
endif
ifdef NOMD5 ifdef NOMD5
OPTS+=-DNOMD5 OPTS+=-DNOMD5
@ -683,9 +681,7 @@ $(OBJDIR)/depend.dep:
ifndef NOHW ifndef NOHW
$(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped $(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped
endif endif
ifndef NO_LUA
$(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped $(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped
endif
@sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep @sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep
$(REMOVE) $(OBJDIR)/depend.ped $(REMOVE) $(OBJDIR)/depend.ped
@echo "Created dependency file, depend.dep" @echo "Created dependency file, depend.dep"

View File

@ -74,11 +74,9 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
if (!sonic || sonic->health <= 0) if (!sonic || sonic->health <= 0)
return; return;
#ifdef HAVE_BLUA
// Lua can handle it! // Lua can handle it!
if (LUAh_BotAI(sonic, tails, cmd)) if (LUAh_BotAI(sonic, tails, cmd))
return; return;
#endif
if (tails->player->powers[pw_carry] == CR_MACESPIN || tails->player->powers[pw_carry] == CR_GENERIC) 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. // Bot AI isn't programmed in analog.
CV_SetValue(&cv_analog[1], false); CV_SetValue(&cv_analog[1], false);
#ifdef HAVE_BLUA
// Let Lua scripts build ticcmds // Let Lua scripts build ticcmds
if (LUAh_BotTiccmd(player, cmd)) if (LUAh_BotTiccmd(player, cmd))
return; return;
#endif
// We don't have any main character AI, sorry. D: // We don't have any main character AI, sorry. D:
if (player-players == consoleplayer) if (player-players == consoleplayer)

View File

@ -10,8 +10,6 @@ WFLAGS+=-Wno-logical-op
endif endif
endif endif
OPTS+=-DHAVE_BLUA
OBJS:=$(OBJS) \ OBJS:=$(OBJS) \
$(OBJDIR)/lapi.o \ $(OBJDIR)/lapi.o \
$(OBJDIR)/lbaselib.o \ $(OBJDIR)/lbaselib.o \

View File

@ -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! if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
{ {
#ifdef HAVE_BLUA
// don't I_Error for Lua commands // don't I_Error for Lua commands
// Lua commands can replace game commands, and they have priority. // 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, // 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. // it's good to have this here so we find out.
if (cmd->function != COM_Lua_f) if (cmd->function != COM_Lua_f)
#endif
I_Error("Command %s already exists\n", name); I_Error("Command %s already exists\n", name);
return; return;
@ -501,7 +499,6 @@ void COM_AddCommand(const char *name, com_func_t func)
com_commands = cmd; com_commands = cmd;
} }
#ifdef HAVE_BLUA
/** Adds a console command for Lua. /** Adds a console command for Lua.
* No I_Errors allowed; return a negative code instead. * No I_Errors allowed; return a negative code instead.
* *
@ -534,7 +531,6 @@ int COM_AddLuaCommand(const char *name)
com_commands = cmd; com_commands = cmd;
return 0; return 0;
} }
#endif
/** Tests if a command exists. /** Tests if a command exists.
* *
@ -1427,9 +1423,7 @@ finish:
} }
var->flags |= CV_MODIFIED; var->flags |= CV_MODIFIED;
// raise 'on change' code // raise 'on change' code
#ifdef HAVE_BLUA
LUA_CVarChanged(var->name); // let consolelib know what cvar this is. LUA_CVarChanged(var->name); // let consolelib know what cvar this is.
#endif
if (var->flags & CV_CALL && !stealth) if (var->flags & CV_CALL && !stealth)
var->func(); var->func();

View File

@ -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 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 // don't look through someone's view who isn't there
if (playernum == displayplayer) if (playernum == displayplayer)
{ {
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed. // The viewpoint was forcibly changed.
LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
#endif
displayplayer = consoleplayer; 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 RemoveAdminPlayer(playernum); // don't stay admin after you're gone
} }
#ifdef HAVE_BLUA
LUA_InvalidatePlayer(&players[playernum]); LUA_InvalidatePlayer(&players[playernum]);
#endif
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors(); P_CheckSurvivors();
@ -3177,9 +3169,7 @@ void SV_ResetServer(void)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
#ifdef HAVE_BLUA
LUA_InvalidatePlayer(&players[i]); LUA_InvalidatePlayer(&players[i]);
#endif
playeringame[i] = false; playeringame[i] = false;
playernode[i] = UINT8_MAX; playernode[i] = UINT8_MAX;
memset(playeraddress[i], 0, sizeof(*playeraddress)); memset(playeraddress[i], 0, sizeof(*playeraddress));
@ -3240,10 +3230,8 @@ void D_QuitNetGame(void)
// abort send/receive of files // abort send/receive of files
CloseNetFile(); CloseNetFile();
#ifdef HAVE_BLUA
RemoveAllLuaFileTransfers(); RemoveAllLuaFileTransfers();
waitingforluafiletransfer = false; waitingforluafiletransfer = false;
#endif
if (server) if (server)
{ {
@ -3414,10 +3402,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (server && multiplayer && motd[0] != '\0') if (server && multiplayer && motd[0] != '\0')
COM_BufAddText(va("sayto %d %s\n", newplayernum, motd)); COM_BufAddText(va("sayto %d %s\n", newplayernum, motd));
#ifdef HAVE_BLUA
if (!rejoined) if (!rejoined)
LUAh_PlayerJoin(newplayernum); LUAh_PlayerJoin(newplayernum);
#endif
} }
static boolean SV_AddWaitingPlayers(const char *name, const char *name2) 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.")); SV_SendRefuse(node, M_GetText("Too many players from\nthis node."));
else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join? else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join?
SV_SendRefuse(node, M_GetText("No players from\nthis node.")); SV_SendRefuse(node, M_GetText("No players from\nthis node."));
#ifdef HAVE_BLUA
else if (luafiletransfers) 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.")); 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 else
{ {
#ifndef NONET #ifndef NONET
@ -4215,7 +4199,6 @@ static void HandlePacketFromPlayer(SINT8 node)
Net_CloseConnection(node); Net_CloseConnection(node);
nodeingame[node] = false; nodeingame[node] = false;
break; break;
#ifdef HAVE_BLUA
case PT_ASKLUAFILE: case PT_ASKLUAFILE:
if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_ASKED) 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) if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_SENDING)
SV_HandleLuaFileSent(node); SV_HandleLuaFileSent(node);
break; break;
#endif
// -------------------------------------------- CLIENT RECEIVE ---------- // -------------------------------------------- CLIENT RECEIVE ----------
case PT_RESYNCHEND: case PT_RESYNCHEND:
// Only accept PT_RESYNCHEND from the server. // Only accept PT_RESYNCHEND from the server.
@ -4356,12 +4338,10 @@ static void HandlePacketFromPlayer(SINT8 node)
if (client) if (client)
Got_Filetxpak(); Got_Filetxpak();
break; break;
#ifdef HAVE_BLUA
case PT_SENDINGLUAFILE: case PT_SENDINGLUAFILE:
if (client) if (client)
CL_PrepareDownloadLuaFile(); CL_PrepareDownloadLuaFile();
break; break;
#endif
default: default:
DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n", DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n",
netbuffer->packettype, node)); netbuffer->packettype, node));

View File

@ -67,11 +67,9 @@ typedef enum
PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic
PT_RESYNCHGET, // Player got resynch packet PT_RESYNCHGET, // Player got resynch packet
#ifdef HAVE_BLUA
PT_SENDINGLUAFILE, // Server telling a client Lua needs to open a file 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_ASKLUAFILE, // Client telling the server they don't have the file
PT_HASLUAFILE, // Client telling the server they 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. // Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility.

View File

@ -91,9 +91,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "hardware/hw3sound.h" #include "hardware/hw3sound.h"
#endif #endif
#ifdef HAVE_BLUA
#include "lua_script.h" #include "lua_script.h"
#endif
// platform independant focus loss // platform independant focus loss
UINT8 window_notinfocus = false; UINT8 window_notinfocus = false;
@ -746,9 +744,7 @@ void D_SRB2Loop(void)
HW3S_EndFrameUpdate(); HW3S_EndFrameUpdate();
#endif #endif
#ifdef HAVE_BLUA
LUA_Step(); LUA_Step();
#endif
} }
} }
@ -1124,9 +1120,7 @@ void D_SRB2Main(void)
// can't use sprintf since there is %u in savegamename // can't use sprintf since there is %u in savegamename
strcatbf(savegamename, srb2home, PATHSEP); strcatbf(savegamename, srb2home, PATHSEP);
#ifdef HAVE_BLUA
snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home); snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home);
#endif
#else // DEFAULTDIR #else // DEFAULTDIR
snprintf(srb2home, sizeof srb2home, "%s", userhome); snprintf(srb2home, sizeof srb2home, "%s", userhome);
snprintf(downloaddir, sizeof downloaddir, "%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 // can't use sprintf since there is %u in savegamename
strcatbf(savegamename, userhome, PATHSEP); strcatbf(savegamename, userhome, PATHSEP);
#ifdef HAVE_BLUA
snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome); snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome);
#endif
#endif // DEFAULTDIR #endif // DEFAULTDIR
} }

View File

@ -715,10 +715,8 @@ void Net_CloseConnection(INT32 node)
InitNode(&nodes[node]); InitNode(&nodes[node]);
SV_AbortSendFiles(node); SV_AbortSendFiles(node);
#ifdef HAVE_BLUA
if (server) if (server)
SV_AbortLuaFileTransfer(node); SV_AbortLuaFileTransfer(node);
#endif
I_NetFreeNodenum(node); I_NetFreeNodenum(node);
#endif #endif
} }
@ -803,11 +801,9 @@ static const char *packettypename[NUMPACKETTYPE] =
"RESYNCHEND", "RESYNCHEND",
"RESYNCHGET", "RESYNCHGET",
#ifdef HAVE_BLUA
"SENDINGLUAFILE", "SENDINGLUAFILE",
"ASKLUAFILE", "ASKLUAFILE",
"HASLUAFILE", "HASLUAFILE",
#endif
"FILEFRAGMENT", "FILEFRAGMENT",
"TEXTCMD", "TEXTCMD",

View File

@ -157,10 +157,8 @@ static void Command_Isgamemodified_f(void);
static void Command_Cheats_f(void); static void Command_Cheats_f(void);
#ifdef _DEBUG #ifdef _DEBUG
static void Command_Togglemodified_f(void); static void Command_Togglemodified_f(void);
#ifdef HAVE_BLUA
static void Command_Archivetest_f(void); static void Command_Archivetest_f(void);
#endif #endif
#endif
// ========================================================================= // =========================================================================
// CLIENT VARIABLES // CLIENT VARIABLES
@ -415,11 +413,9 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
"DELFILE", // replace next time we add an XD "DELFILE", // replace next time we add an XD
"SETMOTD", "SETMOTD",
"SUICIDE", "SUICIDE",
#ifdef HAVE_BLUA
"LUACMD", "LUACMD",
"LUAVAR", "LUAVAR",
"LUAFILE" "LUAFILE"
#endif
}; };
// ========================================================================= // =========================================================================
@ -452,10 +448,8 @@ void D_RegisterServerCommands(void)
RegisterNetXCmd(XD_PAUSE, Got_Pause); RegisterNetXCmd(XD_PAUSE, Got_Pause);
RegisterNetXCmd(XD_SUICIDE, Got_Suicide); RegisterNetXCmd(XD_SUICIDE, Got_Suicide);
RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd); RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd);
#ifdef HAVE_BLUA
RegisterNetXCmd(XD_LUACMD, Got_Luacmd); RegisterNetXCmd(XD_LUACMD, Got_Luacmd);
RegisterNetXCmd(XD_LUAFILE, Got_LuaFile); RegisterNetXCmd(XD_LUAFILE, Got_LuaFile);
#endif
// Remote Administration // Remote Administration
COM_AddCommand("password", Command_Changepassword_f); COM_AddCommand("password", Command_Changepassword_f);
@ -504,9 +498,7 @@ void D_RegisterServerCommands(void)
COM_AddCommand("cheats", Command_Cheats_f); // test COM_AddCommand("cheats", Command_Cheats_f); // test
#ifdef _DEBUG #ifdef _DEBUG
COM_AddCommand("togglemodified", Command_Togglemodified_f); COM_AddCommand("togglemodified", Command_Togglemodified_f);
#ifdef HAVE_BLUA
COM_AddCommand("archivetest", Command_Archivetest_f); COM_AddCommand("archivetest", Command_Archivetest_f);
#endif
#endif #endif
// for master server connection // for master server connection
@ -915,7 +907,7 @@ void D_RegisterClientCommands(void)
#ifdef _DEBUG #ifdef _DEBUG
COM_AddCommand("causecfail", Command_CauseCfail_f); COM_AddCommand("causecfail", Command_CauseCfail_f);
#endif #endif
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) #ifdef LUA_ALLOW_BYTECODE
COM_AddCommand("dumplua", Command_Dumplua_f); COM_AddCommand("dumplua", Command_Dumplua_f);
#endif #endif
} }
@ -2029,9 +2021,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
UINT8 flags; UINT8 flags;
INT32 resetplayer = 1, lastgametype; INT32 resetplayer = 1, lastgametype;
UINT8 skipprecutscene, FLS; UINT8 skipprecutscene, FLS;
#ifdef HAVE_BLUA
INT16 mapnumber; INT16 mapnumber;
#endif
if (playernum != serverplayer && !IsPlayerAdmin(playernum)) if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{ {
@ -2093,10 +2083,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
CV_StealthSetValue(&cv_playercolor, players[0].skincolor); CV_StealthSetValue(&cv_playercolor, players[0].skincolor);
} }
#ifdef HAVE_BLUA
mapnumber = M_MapNumber(mapname[3], mapname[4]); mapnumber = M_MapNumber(mapname[3], mapname[4]);
LUAh_MapChange(mapnumber); LUAh_MapChange(mapnumber);
#endif
G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS); G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS);
if (demoplayback && !timingdemo) if (demoplayback && !timingdemo)
@ -2680,11 +2668,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
return; return;
} }
#ifdef HAVE_BLUA
// Don't switch team, just go away, please, go awaayyyy, aaauuauugghhhghgh // 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)) if (!LUAh_TeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled))
return; return;
#endif
//no status changes after hidetime //no status changes after hidetime
if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE))) 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. //reset view if you are changed, or viewing someone who was changed.
if (playernum == consoleplayer || displayplayer == playernum) if (playernum == consoleplayer || displayplayer == playernum)
{ {
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed. // The viewpoint was forcibly changed.
if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal. if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal.
LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true); LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
#endif
displayplayer = consoleplayer; displayplayer = consoleplayer;
} }
@ -4332,7 +4316,6 @@ static void Command_Togglemodified_f(void)
modifiedgame = !modifiedgame; modifiedgame = !modifiedgame;
} }
#ifdef HAVE_BLUA
extern UINT8 *save_p; extern UINT8 *save_p;
static void Command_Archivetest_f(void) static void Command_Archivetest_f(void)
{ {
@ -4377,7 +4360,6 @@ static void Command_Archivetest_f(void)
CONS_Printf("Done. No crash.\n"); CONS_Printf("Done. No crash.\n");
} }
#endif #endif
#endif
/** Makes a change to ::cv_forceskin take effect immediately. /** Makes a change to ::cv_forceskin take effect immediately.
* *

View File

@ -142,11 +142,9 @@ typedef enum
XD_SETMOTD, // 19 XD_SETMOTD, // 19
XD_SUICIDE, // 20 XD_SUICIDE, // 20
XD_DEMOTED, // 21 XD_DEMOTED, // 21
#ifdef HAVE_BLUA
XD_LUACMD, // 22 XD_LUACMD, // 22
XD_LUAVAR, // 23 XD_LUAVAR, // 23
XD_LUAFILE, // 24 XD_LUAFILE, // 24
#endif
MAXNETXCMD MAXNETXCMD
} netxcmd_t; } netxcmd_t;

View File

@ -95,11 +95,9 @@ char downloaddir[512] = "DOWNLOAD";
INT32 lastfilenum = -1; INT32 lastfilenum = -1;
#endif #endif
#ifdef HAVE_BLUA
luafiletransfer_t *luafiletransfers = NULL; luafiletransfer_t *luafiletransfers = NULL;
boolean waitingforluafiletransfer = false; boolean waitingforluafiletransfer = false;
char luafiledir[256 + 16] = "luafiles"; char luafiledir[256 + 16] = "luafiles";
#endif
/** Fills a serverinfo packet with information about wad files loaded. /** 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) void AddLuaFileTransfer(const char *filename, const char *mode)
{ {
luafiletransfer_t **prevnext; // A pointer to the "next" field of the last transfer in the list 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 // Make sure all directories in the file path exist
MakePathDirs(fileneeded[0].filename); MakePathDirs(fileneeded[0].filename);
} }
#endif
// Number of files to send // Number of files to send
// Little optimization to quickly test if there is a file in the queue // 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++; filestosend++;
} }
#ifdef HAVE_BLUA
/** Adds a file requested by Lua to the file list for a node /** Adds a file requested by Lua to the file list for a node
* *
* \param node The node to send the file to * \param node The node to send the file to
@ -798,7 +793,6 @@ boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode)
filestosend++; filestosend++;
return true; return true;
} }
#endif
/** Stops sending a file for a node, and removes the file request from the list, /** 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 * 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; file->status = FS_FOUND;
CONS_Printf(M_GetText("Downloading %s...(done)\n"), CONS_Printf(M_GetText("Downloading %s...(done)\n"),
filename); filename);
#ifdef HAVE_BLUA
if (luafiletransfers) if (luafiletransfers)
{ {
// Tell the server we have received the file // Tell the server we have received the file
netbuffer->packettype = PT_HASLUAFILE; netbuffer->packettype = PT_HASLUAFILE;
HSendPacket(servernode, true, 0, 0); HSendPacket(servernode, true, 0, 0);
} }
#endif
} }
} }
else else

View File

@ -72,7 +72,6 @@ boolean CL_CheckDownloadable(void);
boolean CL_SendRequestFile(void); boolean CL_SendRequestFile(void);
boolean Got_RequestFilePak(INT32 node); boolean Got_RequestFilePak(INT32 node);
#ifdef HAVE_BLUA
typedef enum typedef enum
{ {
LFTNS_WAITING, // This node is waiting for the server to send the file 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 StoreLuaFileCallback(INT32 id);
void RemoveLuaFileCallback(INT32 id); void RemoveLuaFileCallback(INT32 id);
void MakePathDirs(char *path); void MakePathDirs(char *path);
#endif
void SV_AbortSendFiles(INT32 node); void SV_AbortSendFiles(INT32 node);
void CloseNetFile(void); void CloseNetFile(void);

View File

@ -40,9 +40,7 @@
#include "m_cond.h" #include "m_cond.h"
#ifdef HAVE_BLUA
#include "v_video.h" // video flags (for lua) #include "v_video.h" // video flags (for lua)
#endif
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_light.h" #include "hardware/hw_light.h"
@ -77,10 +75,8 @@ static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
#endif #endif
static hudnum_t get_huditem(const char *word); static hudnum_t get_huditem(const char *word);
static menutype_t get_menutype(const char *word); static menutype_t get_menutype(const char *word);
#ifndef HAVE_BLUA //static INT16 get_gametype(const char *word);
static INT16 get_gametype(const char *word); //static powertype_t get_power(const char *word);
static powertype_t get_power(const char *word);
#endif
boolean deh_loaded = false; boolean deh_loaded = false;
static int dbg_line; 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. // Lua custom options also go above, contents may be case sensitive.
if (fastncmp(word, "LUA.", 4)) if (fastncmp(word, "LUA.", 4))
{ {
#ifdef HAVE_BLUA
UINT8 j; UINT8 j;
customoption_t *modoption; customoption_t *modoption;
@ -1450,9 +1445,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
modoption->option[31] = '\0'; modoption->option[31] = '\0';
strncpy(modoption->value, word2, 255); strncpy(modoption->value, word2, 255);
modoption->value[255] = '\0'; modoption->value[255] = '\0';
#else
// Silently ignore.
#endif
continue; continue;
} }
@ -3124,22 +3116,20 @@ static void readframe(MYFILE *f, INT32 num)
} }
z = 0; z = 0;
#ifdef HAVE_BLUA
found = LUA_SetLuaAction(&states[num], actiontocompare); found = LUA_SetLuaAction(&states[num], actiontocompare);
if (!found) if (!found)
#endif while (actionpointers[z].name)
while (actionpointers[z].name)
{
if (fastcmp(actiontocompare, actionpointers[z].name))
{ {
states[num].action = actionpointers[z].action; if (fastcmp(actiontocompare, actionpointers[z].name))
states[num].action.acv = actionpointers[z].action.acv; // assign {
states[num].action.acp1 = actionpointers[z].action.acp1; states[num].action = actionpointers[z].action;
found = true; states[num].action.acv = actionpointers[z].action.acv; // assign
break; states[num].action.acp1 = actionpointers[z].action.acp1;
found = true;
break;
}
z++;
} }
z++;
}
if (!found) if (!found)
deh_warning("Unknown action %s", actiontocompare); deh_warning("Unknown action %s", actiontocompare);
@ -8849,14 +8839,12 @@ static const char *const MOBJEFLAG_LIST[] = {
NULL NULL
}; };
#ifdef HAVE_BLUA
static const char *const MAPTHINGFLAG_LIST[4] = { static const char *const MAPTHINGFLAG_LIST[4] = {
"EXTRA", // Extra flag for objects. "EXTRA", // Extra flag for objects.
"OBJECTFLIP", // Reverse gravity flag for objects. "OBJECTFLIP", // Reverse gravity flag for objects.
"OBJECTSPECIAL", // Special flag used with certain objects. "OBJECTSPECIAL", // Special flag used with certain objects.
"AMBUSH" // Deaf monsters/do not react to sound. "AMBUSH" // Deaf monsters/do not react to sound.
}; };
#endif
static const char *const PLAYERFLAG_LIST[] = { static const char *const PLAYERFLAG_LIST[] = {
@ -8953,7 +8941,6 @@ static const char *const GAMETYPERULE_LIST[] = {
NULL NULL
}; };
#ifdef HAVE_BLUA
// Linedef flags // Linedef flags
static const char *const ML_LIST[16] = { static const char *const ML_LIST[16] = {
"IMPASSIBLE", "IMPASSIBLE",
@ -8973,7 +8960,6 @@ static const char *const ML_LIST[16] = {
"BOUNCY", "BOUNCY",
"TFERLINE" "TFERLINE"
}; };
#endif
// This DOES differ from r_draw's Color_Names, unfortunately. // This DOES differ from r_draw's Color_Names, unfortunately.
// Also includes Super colors // Also includes Super colors
@ -9272,11 +9258,7 @@ static const char *const MENUTYPES_LIST[] = {
struct { struct {
const char *n; const char *n;
// has to be able to hold both fixed_t and angle_t, so drastic measure!! // has to be able to hold both fixed_t and angle_t, so drastic measure!!
#ifdef HAVE_BLUA
lua_Integer v; lua_Integer v;
#else
INT64 v;
#endif
} const INT_CONST[] = { } const INT_CONST[] = {
// If a mod removes some variables here, // If a mod removes some variables here,
// please leave the names in-tact and just set // please leave the names in-tact and just set
@ -9532,7 +9514,6 @@ struct {
{"ME_ULTIMATE",ME_ULTIMATE}, {"ME_ULTIMATE",ME_ULTIMATE},
{"ME_PERFECT",ME_PERFECT}, {"ME_PERFECT",ME_PERFECT},
#ifdef HAVE_BLUA
// p_local.h constants // p_local.h constants
{"FLOATSPEED",FLOATSPEED}, {"FLOATSPEED",FLOATSPEED},
{"MAXSTEPMOVE",MAXSTEPMOVE}, {"MAXSTEPMOVE",MAXSTEPMOVE},
@ -9865,7 +9846,6 @@ struct {
{"TC_RAINBOW",TC_RAINBOW}, {"TC_RAINBOW",TC_RAINBOW},
{"TC_BLINK",TC_BLINK}, {"TC_BLINK",TC_BLINK},
{"TC_DASHMODE",TC_DASHMODE}, {"TC_DASHMODE",TC_DASHMODE},
#endif
{NULL,0} {NULL,0}
}; };
@ -10022,8 +10002,7 @@ static menutype_t get_menutype(const char *word)
return MN_NONE; 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 { // Returns the value of GT_ enumerations
INT16 i; INT16 i;
if (*word >= '0' && *word <= '9') if (*word >= '0' && *word <= '9')
@ -10049,7 +10028,7 @@ static powertype_t get_power(const char *word)
return i; return i;
deh_warning("Couldn't find power named 'pw_%s'",word); deh_warning("Couldn't find power named 'pw_%s'",word);
return pw_invulnerability; return pw_invulnerability;
} }*/
/// \todo Make ANY of this completely over-the-top math craziness obey the order of operations. /// \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; } 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 // 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. // Part 1: You got the start of the word, now find the end.
const char *p; const char *p;
@ -10307,16 +10286,14 @@ static fixed_t find_const(const char **rword)
const_warning("constant",word); const_warning("constant",word);
free(word); free(word);
return 0; return 0;
} }*/
#endif
// Loops through every constant and operation in word and performs its calculations, returning the final value. // Loops through every constant and operation in word and performs its calculations, returning the final value.
fixed_t get_number(const char *word) fixed_t get_number(const char *word)
{ {
#ifdef HAVE_BLUA
return LUA_EvalMath(word); 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); fixed_t i = find_const(&word);
INT32 o; INT32 o;
while(*word) { while(*word) {
@ -10326,8 +10303,7 @@ fixed_t get_number(const char *word)
else else
break; break;
} }
return i; return i;*/
#endif
} }
void DEH_Check(void) void DEH_Check(void)
@ -10352,7 +10328,6 @@ void DEH_Check(void)
#endif #endif
} }
#ifdef HAVE_BLUA
#include "lua_script.h" #include "lua_script.h"
#include "lua_libs.h" #include "lua_libs.h"
@ -10978,5 +10953,3 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
} }
} }
} }
#endif // HAVE_BLUA

View File

@ -34,11 +34,9 @@ void DEH_Check(void);
fixed_t get_number(const char *word); fixed_t get_number(const char *word);
#ifdef HAVE_BLUA
boolean LUA_SetLuaAction(void *state, const char *actiontocompare); boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
const char *LUA_GetActionName(void *action); const char *LUA_GetActionName(void *action);
void LUA_SetActionByName(void *state, const char *actiontocompare); void LUA_SetActionByName(void *state, const char *actiontocompare);
#endif
extern boolean deh_loaded; extern boolean deh_loaded;

View File

@ -493,7 +493,6 @@ extern UINT16 emeralds;
#define EMERALD7 64 #define EMERALD7 64
#define ALL7EMERALDS(v) ((v & (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) == (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) #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 #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]; extern INT32 luabanks[NUM_LUABANKS];

View File

@ -39,9 +39,7 @@
#include "fastcmp.h" #include "fastcmp.h"
#include "console.h" #include "console.h"
#ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
#endif
// Stage of animation: // Stage of animation:
// 0 = text, 1 = art screen // 0 = text, 1 = art screen
@ -2762,11 +2760,7 @@ void F_TitleScreenDrawer(void)
// rei|miru: use title pics? // rei|miru: use title pics?
hidepics = curhidepics; hidepics = curhidepics;
if (hidepics) if (hidepics)
#ifdef HAVE_BLUA
goto luahook; goto luahook;
#else
return;
#endif
switch(curttmode) switch(curttmode)
{ {
@ -3488,10 +3482,8 @@ void F_TitleScreenDrawer(void)
break; break;
} }
#ifdef HAVE_BLUA
luahook: luahook:
LUAh_TitleHUD(); LUAh_TitleHUD();
#endif
} }
// separate animation timer for backgrounds, since we also count // separate animation timer for backgrounds, since we also count

View File

@ -33,9 +33,7 @@
#include "doomstat.h" #include "doomstat.h"
#ifdef HAVE_BLUA
#include "lua_hud.h" // level title #include "lua_hud.h" // level title
#endif
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" #include "hardware/hw_main.h"

View File

@ -60,7 +60,7 @@ typedef enum
#endif #endif
EXT_PK3, EXT_PK3,
EXT_SOC, EXT_SOC,
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt EXT_LUA,
NUM_EXT, NUM_EXT,
NUM_EXT_TABLE = NUM_EXT-EXT_START, NUM_EXT_TABLE = NUM_EXT-EXT_START,
EXT_LOADED = 0x80 EXT_LOADED = 0x80

View File

@ -47,9 +47,7 @@
#include "m_cond.h" // condition sets #include "m_cond.h" // condition sets
#include "md5.h" // demo checksums #include "md5.h" // demo checksums
#ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
#endif
gameaction_t gameaction; gameaction_t gameaction;
gamestate_t gamestate = GS_NULL; 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. UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage.
UINT16 emeralds; 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 token; // Number of tokens collected in a level
UINT32 tokenlist; // List of tokens collected UINT32 tokenlist; // List of tokens collected
boolean gottoken; // Did you get a token? Used for end of act 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) if (ssplayer == 1 && (cmd->forwardmove || cmd->sidemove || cmd->buttons)
&& displayplayer != consoleplayer) && displayplayer != consoleplayer)
{ {
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed. // The viewpoint was forcibly changed.
LUAh_ViewpointSwitch(player, &players[consoleplayer], true); LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
#endif
displayplayer = consoleplayer; 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])) && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
{ {
// ViewpointSwitch Lua hook. // ViewpointSwitch Lua hook.
#ifdef HAVE_BLUA
UINT8 canSwitchView = 0; UINT8 canSwitchView = 0;
#endif
if (splitscreen || !netgame) if (splitscreen || !netgame)
displayplayer = consoleplayer; displayplayer = consoleplayer;
@ -2066,14 +2060,12 @@ boolean G_Responder(event_t *ev)
if (!playeringame[displayplayer]) if (!playeringame[displayplayer])
continue; continue;
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
canSwitchView = LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], false); canSwitchView = LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
if (canSwitchView == 1) // Set viewpoint to this player if (canSwitchView == 1) // Set viewpoint to this player
break; break;
else if (canSwitchView == 2) // Skip this player else if (canSwitchView == 2) // Skip this player
continue; continue;
#endif
if (players[displayplayer].spectator) if (players[displayplayer].spectator)
continue; continue;
@ -2673,9 +2665,7 @@ void G_SpawnPlayer(INT32 playernum)
P_SpawnPlayer(playernum); P_SpawnPlayer(playernum);
G_MovePlayerToSpawnOrStarpost(playernum); G_MovePlayerToSpawnOrStarpost(playernum);
#ifdef HAVE_BLUA
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :) LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
#endif
} }
void G_MovePlayerToSpawnOrStarpost(INT32 playernum) void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
@ -3029,9 +3019,7 @@ void G_DoReborn(INT32 playernum)
} }
else else
{ {
#ifdef HAVE_BLUA
LUAh_MapChange(gamemap); LUAh_MapChange(gamemap);
#endif
titlecardforreload = true; titlecardforreload = true;
G_DoLoadLevel(true); G_DoLoadLevel(true);
titlecardforreload = false; titlecardforreload = false;
@ -6803,9 +6791,7 @@ void G_DoPlayDemo(char *defdemoname)
// Set skin // Set skin
SetPlayerSkin(0, skin); SetPlayerSkin(0, skin);
#ifdef HAVE_BLUA
LUAh_MapChange(gamemap); LUAh_MapChange(gamemap);
#endif
displayplayer = consoleplayer = 0; displayplayer = consoleplayer = 0;
memset(playeringame,0,sizeof(playeringame)); memset(playeringame,0,sizeof(playeringame));
playeringame[0] = true; playeringame[0] = true;

View File

@ -47,10 +47,8 @@
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
#endif #endif
#ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
#include "lua_hook.h" #include "lua_hook.h"
#endif
// coords are scaled // coords are scaled
#define HU_INPUTX 0 #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. // 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)) if (LUAh_PlayerMsg(playernum, target, flags, msg))
return; return;
#endif
if (spam_eatmsg) if (spam_eatmsg)
return; // don't proceed if we were supposed to eat the message. return; // don't proceed if we were supposed to eat the message.
@ -2177,18 +2173,14 @@ void HU_Drawer(void)
{ {
if (netgame || multiplayer) if (netgame || multiplayer)
{ {
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_rankings)) if (LUA_HudEnabled(hud_rankings))
#endif HU_DrawRankings();
HU_DrawRankings();
if (gametype == GT_COOP) if (gametype == GT_COOP)
HU_DrawNetplayCoopOverlay(); HU_DrawNetplayCoopOverlay();
} }
else else
HU_DrawCoopOverlay(); HU_DrawCoopOverlay();
#ifdef HAVE_BLUA
LUAh_ScoresHUD(); LUAh_ScoresHUD();
#endif
} }
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL)
@ -3171,29 +3163,20 @@ static void HU_DrawRankings(void)
static void HU_DrawCoopOverlay(void) static void HU_DrawCoopOverlay(void)
{ {
if (token if (token && LUA_HudEnabled(hud_tokens))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_tokens)
#endif
)
{ {
V_DrawString(168, 176, 0, va("- %d", token)); V_DrawString(168, 176, 0, va("- %d", token));
V_DrawSmallScaledPatch(148, 172, 0, tokenicon); V_DrawSmallScaledPatch(148, 172, 0, tokenicon);
} }
#ifdef HAVE_BLUA if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata))
if (LUA_HudEnabled(hud_tabemblems))
#endif
if (!modifiedgame || savemoddata)
{ {
V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems)); V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems));
V_DrawScaledPatch(128, 144 - SHORT(emblemicon->height)/4, 0, emblemicon); V_DrawScaledPatch(128, 144 - SHORT(emblemicon->height)/4, 0, emblemicon);
} }
#ifdef HAVE_BLUA
if (!LUA_HudEnabled(hud_coopemeralds)) if (!LUA_HudEnabled(hud_coopemeralds))
return; return;
#endif
if (emeralds & EMERALD1) if (emeralds & EMERALD1)
V_DrawScaledPatch((BASEVIDWIDTH/2)-8 , (BASEVIDHEIGHT/3)-32, 0, emeraldpics[0][0]); V_DrawScaledPatch((BASEVIDWIDTH/2)-8 , (BASEVIDHEIGHT/3)-32, 0, emeraldpics[0][0]);
@ -3215,20 +3198,14 @@ static void HU_DrawNetplayCoopOverlay(void)
{ {
int i; int i;
if (token if (token && LUA_HudEnabled(hud_tokens))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_tokens)
#endif
)
{ {
V_DrawString(168, 10, 0, va("- %d", token)); V_DrawString(168, 10, 0, va("- %d", token));
V_DrawSmallScaledPatch(148, 6, 0, tokenicon); V_DrawSmallScaledPatch(148, 6, 0, tokenicon);
} }
#ifdef HAVE_BLUA
if (!LUA_HudEnabled(hud_coopemeralds)) if (!LUA_HudEnabled(hud_coopemeralds))
return; return;
#endif
for (i = 0; i < 7; ++i) for (i = 0; i < 7; ++i)
{ {

View File

@ -11,7 +11,6 @@
/// \brief basic functions for Lua scripting /// \brief basic functions for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "p_local.h" #include "p_local.h"
#include "p_setup.h" // So we can have P_SetupLevelSky #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); luaL_register(L, NULL, lib);
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief blockmap library for Lua scripting /// \brief blockmap library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "p_local.h" #include "p_local.h"
#include "r_main.h" // validcount #include "r_main.h" // validcount
#include "lua_script.h" #include "lua_script.h"
@ -264,5 +263,3 @@ int LUA_BlockmapLib(lua_State *L)
lua_register(L, "searchBlockmap", lib_searchBlockmap); lua_register(L, "searchBlockmap", lib_searchBlockmap);
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief console modifying/etc library for Lua scripting /// \brief console modifying/etc library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "p_local.h" #include "p_local.h"
#include "g_game.h" #include "g_game.h"
@ -551,5 +550,3 @@ int LUA_ConsoleLib(lua_State *L)
luaL_register(L, NULL, lib); luaL_register(L, NULL, lib);
return 0; return 0;
} }
#endif

View File

@ -10,8 +10,6 @@
/// \file lua_hook.h /// \file lua_hook.h
/// \brief hooks for Lua scripting /// \brief hooks for Lua scripting
#ifdef HAVE_BLUA
#include "r_defs.h" #include "r_defs.h"
#include "d_player.h" #include "d_player.h"
@ -112,5 +110,3 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_
#endif #endif
#define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink #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 boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing
#endif

View File

@ -11,7 +11,6 @@
/// \brief hooks for Lua scripting /// \brief hooks for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "doomstat.h" #include "doomstat.h"
#include "p_mobj.h" #include "p_mobj.h"
#include "g_game.h" #include "g_game.h"
@ -1705,5 +1704,3 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
return keepplaying; return keepplaying;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief custom HUD rendering library for Lua scripting /// \brief custom HUD rendering library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "r_defs.h" #include "r_defs.h"
#include "r_local.h" #include "r_local.h"
@ -1466,5 +1465,3 @@ void LUAh_IntermissionHUD(void)
lua_pop(gL, -1); lua_pop(gL, -1);
hud_running = false; hud_running = false;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief infotable editing library for Lua scripting /// \brief infotable editing library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "info.h" #include "info.h"
#include "dehacked.h" #include "dehacked.h"
@ -1651,5 +1650,3 @@ int LUA_InfoLib(lua_State *L)
return 0; return 0;
} }
#endif

View File

@ -10,8 +10,6 @@
/// \file lua_libs.h /// \file lua_libs.h
/// \brief libraries for Lua scripting /// \brief libraries for Lua scripting
#ifdef HAVE_BLUA
extern lua_State *gL; extern lua_State *gL;
#define LREG_VALID "VALID_USERDATA" #define LREG_VALID "VALID_USERDATA"
@ -88,5 +86,3 @@ int LUA_ThinkerLib(lua_State *L);
int LUA_MapLib(lua_State *L); int LUA_MapLib(lua_State *L);
int LUA_BlockmapLib(lua_State *L); int LUA_BlockmapLib(lua_State *L);
int LUA_HudLib(lua_State *L); int LUA_HudLib(lua_State *L);
#endif

View File

@ -11,7 +11,6 @@
/// \brief game map library for Lua scripting /// \brief game map library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "r_state.h" #include "r_state.h"
#include "p_local.h" #include "p_local.h"
#include "p_setup.h" #include "p_setup.h"
@ -2337,5 +2336,3 @@ int LUA_MapLib(lua_State *L)
lua_setglobal(L, "mapheaderinfo"); lua_setglobal(L, "mapheaderinfo");
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief basic math library for Lua scripting /// \brief basic math library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
//#include "fastcmp.h" //#include "fastcmp.h"
#include "tables.h" #include "tables.h"
#include "p_local.h" #include "p_local.h"
@ -217,5 +216,3 @@ int LUA_MathLib(lua_State *L)
luaL_register(L, NULL, lib); luaL_register(L, NULL, lib);
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief mobj/thing library for Lua scripting /// \brief mobj/thing library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "r_skins.h" #include "r_skins.h"
#include "p_local.h" #include "p_local.h"
@ -915,5 +914,3 @@ int LUA_MobjLib(lua_State *L)
lua_setglobal(L, "mapthings"); lua_setglobal(L, "mapthings");
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief player object library for Lua scripting /// \brief player object library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "p_mobj.h" #include "p_mobj.h"
#include "d_player.h" #include "d_player.h"
@ -878,5 +877,3 @@ int LUA_PlayerLib(lua_State *L)
lua_setglobal(L, "players"); lua_setglobal(L, "players");
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief Lua scripting basics /// \brief Lua scripting basics
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "dehacked.h" #include "dehacked.h"
#include "z_zone.h" #include "z_zone.h"
@ -1423,5 +1422,3 @@ int Lua_optoption(lua_State *L, int narg,
return i; return i;
return -1; return -1;
} }
#endif // HAVE_BLUA

View File

@ -10,8 +10,6 @@
/// \file lua_script.h /// \file lua_script.h
/// \brief Lua scripting basics /// \brief Lua scripting basics
#ifdef HAVE_BLUA
#include "m_fixed.h" #include "m_fixed.h"
#include "doomtype.h" #include "doomtype.h"
#include "d_player.h" #include "d_player.h"
@ -102,5 +100,3 @@ void COM_Lua_f(void);
#define INLEVEL if (gamestate != GS_LEVEL && !titlemapinaction)\ #define INLEVEL if (gamestate != GS_LEVEL && !titlemapinaction)\
return luaL_error(L, "This can only be used in a level!"); return luaL_error(L, "This can only be used in a level!");
#endif

View File

@ -11,7 +11,6 @@
/// \brief player skin structure library for Lua scripting /// \brief player skin structure library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "fastcmp.h" #include "fastcmp.h"
#include "r_skins.h" #include "r_skins.h"
#include "sounds.h" #include "sounds.h"
@ -358,5 +357,3 @@ int LUA_SkinLib(lua_State *L)
return 0; return 0;
} }
#endif

View File

@ -11,7 +11,6 @@
/// \brief thinker library for Lua scripting /// \brief thinker library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#ifdef HAVE_BLUA
#include "p_local.h" #include "p_local.h"
#include "lua_script.h" #include "lua_script.h"
#include "lua_libs.h" #include "lua_libs.h"
@ -139,5 +138,3 @@ int LUA_ThinkerLib(lua_State *L)
lua_setglobal(L, "mobjs"); lua_setglobal(L, "mobjs");
return 0; return 0;
} }
#endif

View File

@ -788,7 +788,7 @@ void Command_CauseCfail_f(void)
} }
#endif #endif
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) #ifdef LUA_ALLOW_BYTECODE
void Command_Dumplua_f(void) void Command_Dumplua_f(void)
{ {
if (modifiedgame) if (modifiedgame)
@ -1062,9 +1062,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
mapthing_t *mt = mapthings; mapthing_t *mt = mapthings;
sector_t *sec = player->mo->subsector->sector; sector_t *sec = player->mo->subsector->sector;
#ifdef HAVE_BLUA
LUA_InvalidateMapthings(); LUA_InvalidateMapthings();
#endif
mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL); mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL);

View File

@ -68,7 +68,7 @@ void Command_Toggletwod_f(void);
#ifdef _DEBUG #ifdef _DEBUG
void Command_CauseCfail_f(void); void Command_CauseCfail_f(void);
#endif #endif
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE) #ifdef LUA_ALLOW_BYTECODE
void Command_Dumplua_f(void); void Command_Dumplua_f(void);
#endif #endif

View File

@ -6657,12 +6657,6 @@ static void M_HandleAddons(INT32 choice)
M_AddonExec(KEY_ENTER); M_AddonExec(KEY_ENTER);
break; break;
case EXT_LUA: 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_SOC:
case EXT_WAD: case EXT_WAD:
#ifdef USE_KART #ifdef USE_KART

File diff suppressed because it is too large Load Diff

View File

@ -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) if (special->flags & (MF_ENEMY|MF_BOSS) && special->flags2 & MF2_FRET)
return; return;
#ifdef HAVE_BLUA
if (LUAh_TouchSpecial(special, toucher) || P_MobjWasRemoved(special)) if (LUAh_TouchSpecial(special, toucher) || P_MobjWasRemoved(special))
return; return;
#endif
// 0 = none, 1 = elemental pierce, 2 = bubble bounce // 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) 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) if (!netgame)
return; // Presumably it's obvious what's happening in splitscreen. return; // Presumably it's obvious what's happening in splitscreen.
#ifdef HAVE_BLUA
if (LUAh_HurtMsg(player, inflictor, source, damagetype)) if (LUAh_HurtMsg(player, inflictor, source, damagetype))
return; return;
#endif
deadtarget = (player->mo->health <= 0); 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->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL);
target->health = 0; // This makes it easy to check if something's dead elsewhere. 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)) if (LUAh_MobjDeath(target, inflictor, source, damagetype) || P_MobjWasRemoved(target))
return; return;
#endif
// Let EVERYONE know what happened to a player! 01-29-2002 Tails // Let EVERYONE know what happened to a player! 01-29-2002 Tails
if (target->player && !target->player->spectator) 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) boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
{ {
player_t *player; player_t *player;
#ifdef HAVE_BLUA
boolean force = false; boolean force = false;
#else
static const boolean force = false;
#endif
if (objectplacing) if (objectplacing)
return false; return false;
@ -3533,7 +3523,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
return false; return false;
} }
#ifdef HAVE_BLUA
// Everything above here can't be forced. // Everything above here can't be forced.
if (!metalrecording) if (!metalrecording)
{ {
@ -3545,7 +3534,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
else if (shouldForce == 2) else if (shouldForce == 2)
return false; return false;
} }
#endif
if (!force) 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 if (!force && target->flags2 & MF2_FRET) // Currently flashing from being hit
return false; return false;
#ifdef HAVE_BLUA
if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target)) if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target))
return true; return true;
#endif
if (target->health > 1) if (target->health > 1)
target->flags2 |= MF2_FRET; 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))) || (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam)))
return false; // Don't run eachother over in special stages and team games and such 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)) if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
return true; return true;
#endif
P_NiGHTSDamage(target, source); // -5s :( P_NiGHTSDamage(target, source); // -5s :(
return true; return true;
} }
@ -3687,18 +3671,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (force if (force
|| (inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE)) // Super Sonic is stunned! || (inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE)) // Super Sonic is stunned!
{ {
#ifdef HAVE_BLUA
if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
#endif
P_SuperDamage(player, inflictor, source, damage); P_SuperDamage(player, inflictor, source, damage);
return true; return true;
} }
return false; return false;
} }
#ifdef HAVE_BLUA
else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
return true; return true;
#endif
else if (player->powers[pw_shield] || (player->bot && !ultimatemode)) //If One-Hit Shield else if (player->powers[pw_shield] || (player->bot && !ultimatemode)) //If One-Hit Shield
{ {
P_ShieldDamage(player, inflictor, source, damage, damagetype); P_ShieldDamage(player, inflictor, source, damage, damagetype);

View File

@ -756,11 +756,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->z + tmthing->height < thing->z) if (tmthing->z + tmthing->height < thing->z)
return true; // underneath return true; // underneath
#ifdef HAVE_BLUA
// REX HAS SEEN YOU // REX HAS SEEN YOU
if (!LUAh_SeenPlayer(tmthing->target->player, thing->player)) if (!LUAh_SeenPlayer(tmthing->target->player, thing->player))
return false; return false;
#endif
seenplayer = thing->player; seenplayer = thing->player;
return false; 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 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 UINT8 shouldCollide = LUAh_MobjCollide(thing, tmthing); // checks hook for thing's type
if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing)) if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing))
@ -957,9 +954,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
return false; // force collide return false; // force collide
else if (shouldCollide == 2) else if (shouldCollide == 2)
return true; // force no collide return true; // force no collide
}
{ shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type
UINT8 shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type
if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing)) if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing))
return true; // one of them was removed??? return true; // one of them was removed???
if (shouldCollide == 1) if (shouldCollide == 1)
@ -967,7 +963,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (shouldCollide == 2) else if (shouldCollide == 2)
return true; // force no collide 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)) 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 // this line is out of the if so upper and lower textures can be hit by a splat
blockingline = ld; blockingline = ld;
#ifdef HAVE_BLUA
{ {
UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, blockingline); // checks hook for thing's type UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, blockingline); // checks hook for thing's type
if (P_MobjWasRemoved(tmthing)) if (P_MobjWasRemoved(tmthing))
@ -1956,7 +1950,6 @@ static boolean PIT_CheckLine(line_t *ld)
else if (shouldCollide == 2) else if (shouldCollide == 2)
return true; // force no collide return true; // force no collide
} }
#endif
if (!ld->backsector) // one sided line if (!ld->backsector) // one sided line
{ {

View File

@ -62,9 +62,7 @@ void P_RunCachedActions(void)
{ {
var1 = states[ac->statenum].var1; var1 = states[ac->statenum].var1;
var2 = states[ac->statenum].var2; var2 = states[ac->statenum].var2;
#ifdef HAVE_BLUA
astate = &states[ac->statenum]; astate = &states[ac->statenum];
#endif
if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case... if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case...
states[ac->statenum].action.acp1(ac->mobj); states[ac->statenum].action.acp1(ac->mobj);
next = ac->next; next = ac->next;
@ -459,9 +457,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
{ {
var1 = st->var1; var1 = st->var1;
var2 = st->var2; var2 = st->var2;
#ifdef HAVE_BLUA
astate = st; astate = st;
#endif
st->action.acp1(mobj); st->action.acp1(mobj);
// woah. a player was removed by an action. // woah. a player was removed by an action.
@ -585,9 +581,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
{ {
var1 = st->var1; var1 = st->var1;
var2 = st->var2; var2 = st->var2;
#ifdef HAVE_BLUA
astate = st; astate = st;
#endif
st->action.acp1(mobj); st->action.acp1(mobj);
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
return false; return false;
@ -1906,15 +1900,12 @@ void P_XYMovement(mobj_t *mo)
B_MoveBlocked(player); B_MoveBlocked(player);
} }
#ifdef HAVE_BLUA
if (LUAh_MobjMoveBlocked(mo)) if (LUAh_MobjMoveBlocked(mo))
{ {
if (P_MobjWasRemoved(mo)) if (P_MobjWasRemoved(mo))
return; return;
} }
else else if (P_MobjWasRemoved(mo))
#endif
if (P_MobjWasRemoved(mo))
return; return;
else if (mo->flags & MF_BOUNCE) else if (mo->flags & MF_BOUNCE)
{ {
@ -7643,12 +7634,10 @@ static void P_RosySceneryThink(mobj_t *mobj)
static void P_MobjSceneryThink(mobj_t *mobj) static void P_MobjSceneryThink(mobj_t *mobj)
{ {
#ifdef HAVE_BLUA
if (LUAh_MobjThinker(mobj)) if (LUAh_MobjThinker(mobj))
return; return;
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
return; return;
#endif
if ((mobj->flags2 & MF2_SHIELD) && !P_AddShield(mobj)) if ((mobj->flags2 & MF2_SHIELD) && !P_AddShield(mobj))
return; return;
@ -7993,9 +7982,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if (!mobj->fuse) if (!mobj->fuse)
{ {
#ifdef HAVE_BLUA
if (!LUAh_MobjFuse(mobj)) if (!LUAh_MobjFuse(mobj))
#endif
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
@ -8054,9 +8041,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
mobj->fuse--; mobj->fuse--;
if (!mobj->fuse) if (!mobj->fuse)
{ {
#ifdef HAVE_BLUA
if (!LUAh_MobjFuse(mobj)) if (!LUAh_MobjFuse(mobj))
#endif
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
@ -8085,7 +8070,6 @@ static boolean P_MobjPushableThink(mobj_t *mobj)
static boolean P_MobjBossThink(mobj_t *mobj) static boolean P_MobjBossThink(mobj_t *mobj)
{ {
#ifdef HAVE_BLUA
if (LUAh_BossThinker(mobj)) if (LUAh_BossThinker(mobj))
{ {
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
@ -8094,7 +8078,6 @@ static boolean P_MobjBossThink(mobj_t *mobj)
else if (P_MobjWasRemoved(mobj)) else if (P_MobjWasRemoved(mobj))
return false; return false;
else else
#endif
switch (mobj->type) switch (mobj->type)
{ {
case MT_EGGMOBILE: case MT_EGGMOBILE:
@ -10004,113 +9987,110 @@ static boolean P_FuseThink(mobj_t *mobj)
if (mobj->fuse) if (mobj->fuse)
return true; return true;
#ifdef HAVE_BLUA
if (LUAh_MobjFuse(mobj) || P_MobjWasRemoved(mobj)) if (LUAh_MobjFuse(mobj) || P_MobjWasRemoved(mobj))
; ;
else else if (mobj->info->flags & MF_MONITOR)
#endif {
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; 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 mobj->fuse = 30;
case MT_THROWNGRENADE: P_SetMobjState(mobj, S_LAVAFALL_TELL);
case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE: S_StartSound(mobj, mobj->info->seesound);
P_SetMobjState(mobj, mobj->info->deathstate); }
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; 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; mobj->extravalue2 = (mobj->extravalue2 + 1) % 3;
if (mobj->extravalue2 == 0) if (mobj->extravalue2 == 0)
{ {
P_SetMobjState(mobj, mobj->info->spawnstate); P_SetMobjState(mobj, mobj->info->spawnstate);
mobj->fuse = 100; mobj->fuse = 100;
S_StopSound(mobj); S_StopSound(mobj);
S_StartSound(mobj, sfx_s3k8c); 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.
} }
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); return !P_MobjWasRemoved(mobj);
} }
@ -10179,7 +10159,6 @@ void P_MobjThinker(mobj_t *mobj)
return; return;
} }
#ifdef HAVE_BLUA
// Check for a Lua thinker first // Check for a Lua thinker first
if (!mobj->player) if (!mobj->player)
{ {
@ -10193,7 +10172,7 @@ void P_MobjThinker(mobj_t *mobj)
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
return; return;
} }
#endif
// if it's pushable, or if it would be pushable other than temporary disablement, use the // if it's pushable, or if it would be pushable other than temporary disablement, use the
// separate thinker // separate thinker
if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse)) 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 // Set shadowscale here, before spawn hook so that Lua can change it
mobj->shadowscale = P_DefaultMobjShadowScale(mobj); mobj->shadowscale = P_DefaultMobjShadowScale(mobj);
#ifdef HAVE_BLUA
// DANGER! This can cause P_SpawnMobj to return NULL! // DANGER! This can cause P_SpawnMobj to return NULL!
// Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks! // Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks!
if (LUAh_MobjSpawn(mobj)) 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)) else if (P_MobjWasRemoved(mobj))
return NULL; return NULL;
else else
#endif
switch (mobj->type) switch (mobj->type)
{ {
case MT_ALTVIEWMAN: 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; var1 = st->var1;
var2 = st->var2; var2 = st->var2;
#ifdef HAVE_BLUA
astate = st; astate = st;
#endif
st->action.acp1(mobj); st->action.acp1(mobj);
// DANGER! This can cause P_SpawnMobj to return NULL! // 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! // 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) void P_RemoveMobj(mobj_t *mobj)
{ {
I_Assert(mobj != NULL); I_Assert(mobj != NULL);
#ifdef HAVE_BLUA
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
return; // something already removing this mobj. return; // something already removing this mobj.
mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing. mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing.
LUAh_MobjRemoved(mobj); LUAh_MobjRemoved(mobj);
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work. 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! // Rings only, please!
if (mobj->spawnpoint && 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) static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean *doangle)
{ {
#ifdef HAVE_BLUA
boolean override = LUAh_MapThingSpawn(mobj, mthing); boolean override = LUAh_MapThingSpawn(mobj, mthing);
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
@ -12718,7 +12688,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
if (override) if (override)
return true; return true;
#endif
switch (mobj->type) switch (mobj->type)
{ {

View File

@ -4183,8 +4183,6 @@ void P_SaveGame(void)
{ {
P_ArchiveMisc(); P_ArchiveMisc();
P_ArchivePlayer(); P_ArchivePlayer();
// yes, even in non HAVE_BLUA
P_ArchiveLuabanksAndConsistency(); P_ArchiveLuabanksAndConsistency();
} }
@ -4220,9 +4218,7 @@ void P_SaveNetGame(void)
P_NetArchiveSpecials(); P_NetArchiveSpecials();
P_NetArchiveColormaps(); P_NetArchiveColormaps();
} }
#ifdef HAVE_BLUA
LUA_Archive(); LUA_Archive();
#endif
P_ArchiveLuabanksAndConsistency(); P_ArchiveLuabanksAndConsistency();
} }
@ -4264,9 +4260,7 @@ boolean P_LoadNetGame(void)
P_RelinkPointers(); P_RelinkPointers();
P_FinishMobjs(); P_FinishMobjs();
} }
#ifdef HAVE_BLUA
LUA_UnArchive(); LUA_UnArchive();
#endif
// This is stupid and hacky, but maybe it'll work! // This is stupid and hacky, but maybe it'll work!
P_SetRandSeed(P_GetInitSeed()); P_SetRandSeed(P_GetInitSeed());

View File

@ -57,9 +57,7 @@
#include "filesrch.h" // refreshdirmenu #include "filesrch.h" // refreshdirmenu
#ifdef HAVE_BLUA
#include "lua_hud.h" // level title #include "lua_hud.h" // level title
#endif
#include "f_finale.h" // wipes #include "f_finale.h" // wipes
@ -3526,9 +3524,7 @@ boolean P_LoadLevel(boolean fromnetsave)
// Close text prompt before freeing the old level // Close text prompt before freeing the old level
F_EndTextPrompt(false, true); F_EndTextPrompt(false, true);
#ifdef HAVE_BLUA
LUA_InvalidateLevel(); LUA_InvalidateLevel();
#endif
for (ss = sectors; sectors+numsectors != ss; ss++) 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); G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1);
} }
P_PreTicker(2); P_PreTicker(2);
#ifdef HAVE_BLUA
LUAh_MapLoad(); LUAh_MapLoad();
#endif
} }
// No render mode, stop here. // No render mode, stop here.
@ -3859,10 +3853,8 @@ boolean P_AddWadFile(const char *wadfilename)
// Update the detected resources. // Update the detected resources.
// Note: ALWAYS load Lua scripts first, SOCs right after, and the remaining resources afterwards. // Note: ALWAYS load Lua scripts first, SOCs right after, and the remaining resources afterwards.
#ifdef HAVE_BLUA
// if (luaNum) // Lua scripts. // if (luaNum) // Lua scripts.
// P_LoadLuaScrRange(wadnum, luaPos, luaNum); // P_LoadLuaScrRange(wadnum, luaPos, luaNum);
#endif
// if (socNum) // SOCs. // if (socNum) // SOCs.
// P_LoadDehackRange(wadnum, socPos, socNum); // P_LoadDehackRange(wadnum, socPos, socNum);
if (sfxNum) // Sounds. TODO: Function currently only updates already existing sounds, the rest is handled somewhere else. if (sfxNum) // Sounds. TODO: Function currently only updates already existing sounds, the rest is handled somewhere else.

View File

@ -3366,14 +3366,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
} }
case 443: // Calls a named Lua function case 443: // Calls a named Lua function
#ifdef HAVE_BLUA
if (line->text) if (line->text)
LUAh_LinedefExecute(line, mo, callsec); LUAh_LinedefExecute(line, mo, callsec);
else 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)); 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; break;
case 444: // Earthquake camera case 444: // Earthquake camera

View File

@ -269,9 +269,7 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
// //
void P_RemoveThinker(thinker_t *thinker) void P_RemoveThinker(thinker_t *thinker)
{ {
#ifdef HAVE_BLUA
LUA_InvalidateUserdata(thinker); LUA_InvalidateUserdata(thinker);
#endif
thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed;
} }
@ -643,9 +641,7 @@ void P_Ticker(boolean run)
if (demoplayback) if (demoplayback)
G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0); G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0);
#ifdef HAVE_BLUA
LUAh_PreThinkFrame(); LUAh_PreThinkFrame();
#endif
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) 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)) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]); P_PlayerAfterThink(&players[i]);
#ifdef HAVE_BLUA
LUAh_ThinkFrame(); LUAh_ThinkFrame();
#endif
} }
// Run shield positioning // Run shield positioning
@ -745,9 +739,7 @@ void P_Ticker(boolean run)
if (modeattacking) if (modeattacking)
G_GhostTicker(); G_GhostTicker();
#ifdef HAVE_BLUA
LUAh_PostThinkFrame(); LUAh_PostThinkFrame();
#endif
} }
P_MapEnd(); P_MapEnd();
@ -767,9 +759,8 @@ void P_PreTicker(INT32 frames)
{ {
P_MapStart(); P_MapStart();
#ifdef HAVE_BLUA
LUAh_PreThinkFrame(); LUAh_PreThinkFrame();
#endif
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)) 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)) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]); P_PlayerAfterThink(&players[i]);
#ifdef HAVE_BLUA
LUAh_ThinkFrame(); LUAh_ThinkFrame();
#endif
// Run shield positioning // Run shield positioning
P_RunShields(); P_RunShields();
@ -804,9 +793,7 @@ void P_PreTicker(INT32 frames)
P_UpdateSpecials(); P_UpdateSpecials();
P_RespawnSpecials(); P_RespawnSpecials();
#ifdef HAVE_BLUA
LUAh_PostThinkFrame(); LUAh_PostThinkFrame();
#endif
P_MapEnd(); P_MapEnd();
} }

View File

@ -1109,7 +1109,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing)
if (!player->mo || player->spectator || !thing || P_MobjWasRemoved(thing)) if (!player->mo || player->spectator || !thing || P_MobjWasRemoved(thing))
return false; return false;
#ifdef HAVE_BLUA
{ {
UINT8 shouldCollide = LUAh_PlayerCanDamage(player, thing); UINT8 shouldCollide = LUAh_PlayerCanDamage(player, thing);
if (P_MobjWasRemoved(thing)) if (P_MobjWasRemoved(thing))
@ -1119,7 +1118,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing)
else if (shouldCollide == 2) else if (shouldCollide == 2)
return false; // force no return false; // force no
} }
#endif
// Invinc/super. Not for Monitors. // Invinc/super. Not for Monitors.
if (!(thing->flags & MF_MONITOR) && (player->powers[pw_invulnerability] || player->powers[pw_super])) 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]; char newmusic[7];
strncpy(newmusic, musname, 7); strncpy(newmusic, musname, 7);
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) #ifdef HAVE_LUA_MUSICPLUS
if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping)) if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping))
return; return;
#endif #endif
@ -1602,10 +1600,8 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
break; break;
case JT_OTHER: // Other state case JT_OTHER: // Other state
#ifdef HAVE_BLUA
result = LUAh_ShouldJingleContinue(&players[i], musname); result = LUAh_ShouldJingleContinue(&players[i], musname);
break; break;
#endif
case JT_NONE: // Null state case JT_NONE: // Null state
case JT_MASTER: // Main level music 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"); I_Error("P_SpawnShieldOrb: player->mo is NULL!\n");
#endif #endif
#ifdef HAVE_BLUA
if (LUAh_ShieldSpawn(player)) if (LUAh_ShieldSpawn(player))
return; return;
#endif
if (player->powers[pw_shield] & SH_FORCE) if (player->powers[pw_shield] & SH_FORCE)
orbtype = MT_FORCE_ORB; 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)) && (player->pflags & PF_JUMPSTASIS || player->mo->state-states != S_PLAY_GLIDE_LANDING))
return; return;
#ifdef HAVE_BLUA
if (cmd->buttons & BT_USE) if (cmd->buttons & BT_USE)
{ {
if (LUAh_SpinSpecial(player)) if (LUAh_SpinSpecial(player))
return; return;
} }
#endif
#ifdef ESLOPE #ifdef ESLOPE
canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2); 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 if (cmd->buttons & BT_USE && !LUAh_ShieldSpecial(player)) // Spin button effects
#ifdef HAVE_BLUA
&& !LUAh_ShieldSpecial(player)
#endif
)
{ {
// Force stop // Force stop
if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) 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! // and you don't have a shield, do it!
P_DoSuperTransformation(player, false); P_DoSuperTransformation(player, false);
} }
else else if (!LUAh_JumpSpinSpecial(player))
#ifdef HAVE_BLUA switch (player->charability)
if (!LUAh_JumpSpinSpecial(player)) {
#endif case CA_THOK:
switch (player->charability) if (player->powers[pw_super]) // Super Sonic float
{
case CA_THOK:
if (player->powers[pw_super]) // Super Sonic float
{
if ((player->speed > 5*player->mo->scale) // FixedMul(5<<FRACBITS, player->mo->scale), but scale is FRACUNIT-based
&& (P_MobjFlip(player->mo)*player->mo->momz <= 0))
{ {
if (player->panim != PA_RUN && player->panim != PA_WALK) if ((player->speed > 5*player->mo->scale) // FixedMul(5<<FRACBITS, player->mo->scale), but scale is FRACUNIT-based
&& (P_MobjFlip(player->mo)*player->mo->momz <= 0))
{ {
if (player->speed >= FixedMul(player->runspeed, player->mo->scale)) if (player->panim != PA_RUN && player->panim != PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN); {
else if (player->speed >= FixedMul(player->runspeed, player->mo->scale))
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT); P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN);
} else
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT);
}
player->mo->momz = 0; player->mo->momz = 0;
player->pflags &= ~(PF_STARTJUMP|PF_SPINNING); player->pflags &= ~(PF_STARTJUMP|PF_SPINNING);
}
} }
} break;
break; case CA_TELEKINESIS:
case CA_TELEKINESIS: if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY))
if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY)) {
{ P_Telekinesis(player,
P_Telekinesis(player, -FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player)
-FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player) FixedMul(384*FRACUNIT, player->mo->scale));
FixedMul(384*FRACUNIT, player->mo->scale)); }
} break;
break; case CA_TWINSPIN:
case CA_TWINSPIN: if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY))
if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY)) {
{ player->pflags |= PF_THOKKED;
player->pflags |= PF_THOKKED; S_StartSound(player->mo, sfx_s3k42);
S_StartSound(player->mo, sfx_s3k42); player->mo->frame = 0;
player->mo->frame = 0; P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN); }
} break;
break; default:
default: break;
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)) if (cmd->buttons & BT_JUMP && !player->exiting && !P_PlayerInPain(player))
{ {
#ifdef HAVE_BLUA
if (LUAh_JumpSpecial(player)) if (LUAh_JumpSpecial(player))
; ;
else // all situations below this require jump button not to be pressed already
#endif else if (player->pflags & PF_JUMPDOWN)
if (player->pflags & PF_JUMPDOWN) // all situations below this require jump button not to be pressed already
; ;
else
// Jump S3&K style while in quicksand. // Jump S3&K style while in quicksand.
if (P_InQuicksand(player->mo)) else if (P_InQuicksand(player->mo))
{ {
P_DoJump(player, true); P_DoJump(player, true);
player->secondjump = 0; player->secondjump = 0;
@ -5313,9 +5295,8 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
P_SetTarget(&player->mo->tracer, NULL); P_SetTarget(&player->mo->tracer, NULL);
player->powers[pw_flashing] = TICRATE/4; player->powers[pw_flashing] = TICRATE/4;
} }
else
// can't jump while in air, can't jump while jumping // 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); P_DoJump(player, true);
player->secondjump = 0; player->secondjump = 0;
@ -5331,9 +5312,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
}*/ }*/
else if (player->pflags & PF_JUMPED) else if (player->pflags & PF_JUMPED)
{ {
#ifdef HAVE_BLUA
if (!LUAh_AbilitySpecial(player)) if (!LUAh_AbilitySpecial(player))
#endif
switch (player->charability) switch (player->charability)
{ {
case CA_THOK: case CA_THOK:
@ -5528,30 +5507,28 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
} }
else if (player->pflags & PF_THOKKED) else if (player->pflags & PF_THOKKED)
{ {
#ifdef HAVE_BLUA
if (!LUAh_AbilitySpecial(player)) if (!LUAh_AbilitySpecial(player))
#endif switch (player->charability)
switch (player->charability) {
{ case CA_FLY:
case CA_FLY: case CA_SWIM: // Swim
case CA_SWIM: // Swim if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER)) ; // Can't do anything if you're a fish out of water!
; // 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.
else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost. {
{ player->fly1 = 20;
player->fly1 = 20;
if (player->charability == CA_SWIM) if (player->charability == CA_SWIM)
player->fly1 /= 2; player->fly1 /= 2;
// Slow down! // Slow down!
if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale)) 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)); P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale));
} }
break; break;
default: default:
break; break;
} }
} }
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super]) else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super])
P_DoJumpShield(player); P_DoJumpShield(player);
@ -10638,10 +10615,8 @@ boolean P_SpectatorJoinGame(player_t *player)
else else
changeto = (P_RandomFixed() & 1) + 1; changeto = (P_RandomFixed() & 1) + 1;
#ifdef HAVE_BLUA
if (!LUAh_TeamSwitch(player, changeto, true, false, false)) if (!LUAh_TeamSwitch(player, changeto, true, false, false))
return false; return false;
#endif
if (player->mo) if (player->mo)
{ {
@ -10655,11 +10630,9 @@ boolean P_SpectatorJoinGame(player_t *player)
//Reset away view //Reset away view
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
{ {
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed. // The viewpoint was forcibly changed.
LUAh_ViewpointSwitch(player, &players[consoleplayer], true); LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
#endif
displayplayer = consoleplayer; displayplayer = consoleplayer;
} }
@ -10677,10 +10650,8 @@ boolean P_SpectatorJoinGame(player_t *player)
// respawn in place and sit there for the rest of the round. // respawn in place and sit there for the rest of the round.
if (!((gametyperules & GTR_HIDEFROZEN) && leveltime > (hidetime * TICRATE))) if (!((gametyperules & GTR_HIDEFROZEN) && leveltime > (hidetime * TICRATE)))
{ {
#ifdef HAVE_BLUA
if (!LUAh_TeamSwitch(player, 3, true, false, false)) if (!LUAh_TeamSwitch(player, 3, true, false, false))
return false; return false;
#endif
if (player->mo) if (player->mo)
{ {
P_RemoveMobj(player->mo); P_RemoveMobj(player->mo);
@ -10704,11 +10675,9 @@ boolean P_SpectatorJoinGame(player_t *player)
//Reset away view //Reset away view
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
{ {
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here. // Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed. // The viewpoint was forcibly changed.
LUAh_ViewpointSwitch(player, &players[consoleplayer], true); LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
#endif
displayplayer = consoleplayer; displayplayer = consoleplayer;
} }
@ -11631,9 +11600,7 @@ void P_PlayerThink(player_t *player)
} }
if (player->playerstate == PST_REBORN) if (player->playerstate == PST_REBORN)
{ {
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
return; return;
} }
} }
@ -11737,9 +11704,7 @@ void P_PlayerThink(player_t *player)
if (player->playerstate == PST_DEAD) if (player->playerstate == PST_DEAD)
{ {
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
return; return;
} }
} }
@ -11862,9 +11827,7 @@ void P_PlayerThink(player_t *player)
{ {
player->mo->flags2 &= ~MF2_SHADOW; player->mo->flags2 &= ~MF2_SHADOW;
P_DeathThink(player); P_DeathThink(player);
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
return; return;
} }
@ -11906,9 +11869,7 @@ void P_PlayerThink(player_t *player)
{ {
if (P_SpectatorJoinGame(player)) if (P_SpectatorJoinGame(player))
{ {
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
return; // player->mo was removed. return; // player->mo was removed.
} }
} }
@ -12013,9 +11974,7 @@ void P_PlayerThink(player_t *player)
if (!player->mo) if (!player->mo)
{ {
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
return; // P_MovePlayer removed player->mo. return; // P_MovePlayer removed player->mo.
} }
@ -12457,9 +12416,7 @@ void P_PlayerThink(player_t *player)
} }
#undef dashmode #undef dashmode
#ifdef HAVE_BLUA
LUAh_PlayerThink(player); LUAh_PlayerThink(player);
#endif
/* /*
// Colormap verification // Colormap verification
@ -13009,11 +12966,9 @@ void P_PlayerAfterThink(player_t *player)
if (player->followmobj) if (player->followmobj)
{ {
#ifdef HAVE_BLUA
if (LUAh_FollowMobj(player, player->followmobj) || P_MobjWasRemoved(player->followmobj)) if (LUAh_FollowMobj(player, player->followmobj) || P_MobjWasRemoved(player->followmobj))
{;} {;}
else else
#endif
{ {
switch (player->followmobj->type) switch (player->followmobj->type)
{ {

View File

@ -40,7 +40,7 @@ extern INT32 msg_id;
#include "m_misc.h" // for tunes command #include "m_misc.h" // for tunes command
#include "m_cond.h" // for conditionsets #include "m_cond.h" // for conditionsets
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) #ifdef HAVE_LUA_MUSICPLUS
#include "lua_hook.h" // MusicChange hook #include "lua_hook.h" // MusicChange hook
#endif #endif
@ -2314,7 +2314,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
return; return;
strncpy(newmusic, mmusic, 7); 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)) if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms))
return; return;
#endif #endif

View File

@ -50,7 +50,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -145,7 +145,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -248,7 +248,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch" PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"
@ -350,7 +350,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch" PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"

View File

@ -1272,7 +1272,6 @@
HAVE_SDL, HAVE_SDL,
HAVE_MIXER, HAVE_MIXER,
HAVE_PNG, HAVE_PNG,
HAVE_BLUA,
LUA_USE_POSIX, LUA_USE_POSIX,
COMPVERSION, COMPVERSION,
HWRENDER, HWRENDER,
@ -1395,7 +1394,6 @@
HAVE_SDL, HAVE_SDL,
HAVE_MIXER, HAVE_MIXER,
HAVE_PNG, HAVE_PNG,
HAVE_BLUA,
LUA_USE_POSIX, LUA_USE_POSIX,
COMPVERSION, COMPVERSION,
HWRENDER, HWRENDER,

View File

@ -42,9 +42,7 @@
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
#endif #endif
#ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
#endif
UINT16 objectsdrawn = 0; 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); V_DrawThinString(hudinfo[HUD_LIVES].x+18, hudinfo[HUD_LIVES].y, v_colmap, skins[stplyr->skin].hudname);
// Power Stones collected // Power Stones collected
if (G_RingSlingerGametype() if (G_RingSlingerGametype() && LUA_HudEnabled(hud_powerstones))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_powerstones)
#endif
)
{ {
INT32 workx = hudinfo[HUD_LIVES].x+1, j; 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 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()) if (!G_IsTitleCardAvailable())
return; return;
#ifdef HAVE_BLUA
if (!LUA_HudEnabled(hud_stagetitle)) if (!LUA_HudEnabled(hud_stagetitle))
goto luahook; goto luahook;
#endif
if (lt_ticker >= (lt_endtime + TICRATE)) if (lt_ticker >= (lt_endtime + TICRATE))
#ifdef HAVE_BLUA
goto luahook; goto luahook;
#else
return;
#endif
if ((lt_ticker-lt_lasttic) > 1) if ((lt_ticker-lt_lasttic) > 1)
lt_ticker = lt_lasttic+1; lt_ticker = lt_lasttic+1;
@ -1396,10 +1384,8 @@ void ST_drawTitleCard(void)
lt_lasttic = lt_ticker; lt_lasttic = lt_ticker;
#ifdef HAVE_BLUA
luahook: luahook:
LUAh_TitleCardHUD(stplyr); LUAh_TitleCardHUD(stplyr);
#endif
} }
// //
@ -1444,7 +1430,7 @@ static void ST_drawPowerupHUD(void)
if (stplyr->spectator || stplyr->playerstate != PST_LIVE) if (stplyr->spectator || stplyr->playerstate != PST_LIVE)
return; return;
// --------- // ---------
// Finish icon // Finish icon
// --------- // ---------
@ -1785,11 +1771,7 @@ static void ST_drawNiGHTSHUD(void)
const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)); const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS));
// Drill meter // Drill meter
if ( if (LUA_HudEnabled(hud_nightsdrill) && stplyr->powers[pw_carry] == CR_NIGHTSMODE)
#ifdef HAVE_BLUA
LUA_HudEnabled(hud_nightsdrill) &&
#endif
stplyr->powers[pw_carry] == CR_NIGHTSMODE)
{ {
INT32 locx = 16, locy = 180; INT32 locx = 16, locy = 180;
INT32 dfill; INT32 dfill;
@ -1831,9 +1813,7 @@ static void ST_drawNiGHTSHUD(void)
if (!oldspecialstage if (!oldspecialstage
// Don't display when the score is showing (it popping up for a split second when exiting a map is intentional) // 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) && !(stplyr->texttimer && stplyr->textvar == 4)
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_nightslink) && LUA_HudEnabled(hud_nightslink)
#endif
&& ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link". && ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link".
{ {
ST_drawNiGHTSLink(); ST_drawNiGHTSLink();
@ -1847,10 +1827,8 @@ static void ST_drawNiGHTSHUD(void)
} }
// Begin drawing brackets/chip display // Begin drawing brackets/chip display
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_nightsspheres)) if (LUA_HudEnabled(hud_nightsspheres))
{ {
#endif
ST_DrawTopLeftOverlayPatch(16, 8, nbracket); ST_DrawTopLeftOverlayPatch(16, 8, nbracket);
if (G_IsSpecialStage(gamemap)) if (G_IsSpecialStage(gamemap))
ST_DrawTopLeftOverlayPatch(24, 16, ( 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); V_DrawTallNum((total_spherecount >= 1000) ? 76 : 72, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount);
else else
V_DrawTallNum(68, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount); V_DrawTallNum(68, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount);
#ifdef HAVE_BLUA
} }
#endif
// Score // Score
if (!stplyr->exiting && !oldspecialstage if (!stplyr->exiting && !oldspecialstage && LUA_HudEnabled(hud_nightsscore))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_nightsscore)
#endif
)
ST_DrawNightsOverlayNum(304<<FRACBITS, 14<<FRACBITS, FRACUNIT, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_AZURE); ST_DrawNightsOverlayNum(304<<FRACBITS, 14<<FRACBITS, FRACUNIT, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_AZURE);
if (!stplyr->exiting
#ifdef HAVE_BLUA
// TODO give this its own section for Lua // TODO give this its own section for Lua
&& LUA_HudEnabled(hud_nightsscore) if (!stplyr->exiting && LUA_HudEnabled(hud_nightsscore))
#endif
)
{ {
if (modeattacking == ATTACKING_NIGHTS) if (modeattacking == ATTACKING_NIGHTS)
{ {
@ -2027,11 +1995,7 @@ static void ST_drawNiGHTSHUD(void)
} }
// Ideya time remaining // Ideya time remaining
if (!stplyr->exiting && stplyr->nightstime > 0 if (!stplyr->exiting && stplyr->nightstime > 0 && LUA_HudEnabled(hud_nightstime))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_nightstime)
#endif
)
{ {
INT32 realnightstime = stplyr->nightstime/TICRATE; INT32 realnightstime = stplyr->nightstime/TICRATE;
INT32 numbersize; INT32 numbersize;
@ -2122,10 +2086,8 @@ static void ST_drawNiGHTSHUD(void)
} }
// Records/extra text // Records/extra text
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_nightsrecords)) if (LUA_HudEnabled(hud_nightsrecords))
#endif ST_drawNightsRecords();
ST_drawNightsRecords();
} }
} }
@ -2403,20 +2365,16 @@ static void ST_drawTeamHUD(void)
else else
p = bmatcico; p = bmatcico;
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_teamscores)) 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) if (gametyperules & GTR_TEAMFLAGS)
p = rflagico; p = rflagico;
else else
p = rmatcico; p = rmatcico;
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_teamscores)) 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)) if (!(gametyperules & GTR_TEAMFLAGS))
goto num; goto num;
@ -2427,18 +2385,12 @@ static void ST_drawTeamHUD(void)
// Show which flags aren't at base. // Show which flags aren't at base.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (players[i].gotflag & GF_BLUEFLAG // Blue flag isn't at base // Blue flag isn't at base
#ifdef HAVE_BLUA if (players[i].gotflag & GF_BLUEFLAG && LUA_HudEnabled(hud_teamscores))
&& LUA_HudEnabled(hud_teamscores)
#endif
)
V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(nonicon->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon); 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 // Red flag isn't at base
#ifdef HAVE_BLUA if (players[i].gotflag & GF_REDFLAG && LUA_HudEnabled(hud_teamscores))
&& LUA_HudEnabled(hud_teamscores)
#endif
)
V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2); V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2);
whichflag |= players[i].gotflag; 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. // Display a countdown timer showing how much time left until the flag returns to base.
{ {
if (blueflag && blueflag->fuse > 1 if (blueflag && blueflag->fuse > 1 && LUA_HudEnabled(hud_teamscores))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_teamscores)
#endif
)
V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (blueflag->fuse / TICRATE))); V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (blueflag->fuse / TICRATE)));
if (redflag && redflag->fuse > 1 if (redflag && redflag->fuse > 1 && LUA_HudEnabled(hud_teamscores))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_teamscores)
#endif
)
V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (redflag->fuse / TICRATE))); V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (redflag->fuse / TICRATE)));
} }
} }
num: num:
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_teamscores)) 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)) 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 #undef SEP
} }
@ -2661,24 +2601,14 @@ static void ST_overlayDrawer(void)
ST_drawNiGHTSHUD(); ST_drawNiGHTSHUD();
else else
{ {
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_score)) if (LUA_HudEnabled(hud_score))
#endif ST_drawScore();
ST_drawScore();
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_time)) if (LUA_HudEnabled(hud_time))
#endif ST_drawTime();
ST_drawTime();
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_rings)) if (LUA_HudEnabled(hud_rings))
#endif ST_drawRings();
ST_drawRings();
if (!modeattacking if (!modeattacking && LUA_HudEnabled(hud_lives))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_lives)
#endif
)
ST_drawLivesArea(); ST_drawLivesArea();
} }
} }
@ -2753,11 +2683,7 @@ static void ST_overlayDrawer(void)
// Draw Match-related stuff // Draw Match-related stuff
//\note Match HUD is drawn no matter what gametype. //\note Match HUD is drawn no matter what gametype.
// ... just not if you're a spectator. // ... just not if you're a spectator.
if (!stplyr->spectator if (!stplyr->spectator && LUA_HudEnabled(hud_weaponrings))
#ifdef HAVE_BLUA
&& (LUA_HudEnabled(hud_weaponrings))
#endif
)
ST_drawMatchHUD(); ST_drawMatchHUD();
// Race HUD Stuff // Race HUD Stuff
@ -2798,20 +2724,14 @@ static void ST_overlayDrawer(void)
else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2) else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2)
ST_drawPowerupHUD(); // same as it ever was... ST_drawPowerupHUD(); // same as it ever was...
#ifdef HAVE_BLUA
if (!(netgame || multiplayer) || !hu_showscores) if (!(netgame || multiplayer) || !hu_showscores)
LUAh_GameHUD(stplyr); LUAh_GameHUD(stplyr);
#endif
// draw level title Tails // draw level title Tails
if (stagetitle && (!WipeInAction) && (!WipeStageTitle)) if (stagetitle && (!WipeInAction) && (!WipeStageTitle))
ST_drawTitleCard(); ST_drawTitleCard();
if (!hu_showscores && (netgame || multiplayer) if (!hu_showscores && (netgame || multiplayer) && LUA_HudEnabled(hud_textspectator))
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_textspectator)
#endif
)
ST_drawTextHUD(); ST_drawTextHUD();
if (modeattacking && !(demoplayback && hu_showscores)) if (modeattacking && !(demoplayback && hu_showscores))

View File

@ -189,7 +189,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile)
{ {
UINT16 posStart, posEnd; UINT16 posStart, posEnd;
#ifdef HAVE_BLUA
posStart = W_CheckNumForFolderStartPK3("Lua/", wadnum, 0); posStart = W_CheckNumForFolderStartPK3("Lua/", wadnum, 0);
if (posStart != INT16_MAX) if (posStart != INT16_MAX)
{ {
@ -198,7 +198,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile)
for (; posStart < posEnd; posStart++) for (; posStart < posEnd; posStart++)
LUA_LoadLump(wadnum, posStart); LUA_LoadLump(wadnum, posStart);
} }
#endif
posStart = W_CheckNumForFolderStartPK3("SOC/", wadnum, 0); posStart = W_CheckNumForFolderStartPK3("SOC/", wadnum, 0);
if (posStart != INT16_MAX) if (posStart != INT16_MAX)
{ {
@ -224,7 +224,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile)
{ {
UINT16 lump; UINT16 lump;
#ifdef HAVE_BLUA
// Find Lua scripts before SOCs to allow new A_Actions in SOC editing. // Find Lua scripts before SOCs to allow new A_Actions in SOC editing.
{ {
lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; 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) if (memcmp(lump_p->name,"LUA_",4)==0)
LUA_LoadLump(wadnum, lump); LUA_LoadLump(wadnum, lump);
} }
#endif
{ {
lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
@ -749,11 +747,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
case RET_SOC: case RET_SOC:
lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG"); lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG");
break; break;
#ifdef HAVE_BLUA
case RET_LUA: case RET_LUA:
lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT"); lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT");
break; break;
#endif
case RET_PK3: case RET_PK3:
lumpinfo = ResGetLumpsZip(handle, &numlumps); lumpinfo = ResGetLumpsZip(handle, &numlumps);
break; 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); CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfile->filename);
DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0, mainfile); DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0, mainfile);
break; break;
#ifdef HAVE_BLUA
case RET_LUA: case RET_LUA:
LUA_LoadLump(numwadfiles - 1, 0); LUA_LoadLump(numwadfiles - 1, 0);
break; break;
#endif
default: default:
break; 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 // detect wad file by the absence of the other supported extensions
if (stricmp(&filename[strlen(filename) - 4], ".soc") if (stricmp(&filename[strlen(filename) - 4], ".soc")
#ifdef HAVE_BLUA && stricmp(&filename[strlen(filename) - 4], ".lua"))
&& stricmp(&filename[strlen(filename) - 4], ".lua")
#endif
)
{ {
goodfile = W_VerifyWAD(handle, checklist, status); goodfile = W_VerifyWAD(handle, checklist, status);
} }

View File

@ -55,7 +55,7 @@
Optimization="0" Optimization="0"
OmitFramePointers="false" OmitFramePointers="false"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" MinimalRebuild="true"
RuntimeLibrary="1" RuntimeLibrary="1"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
@ -153,7 +153,7 @@
Optimization="0" Optimization="0"
OmitFramePointers="false" OmitFramePointers="false"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
SmallerTypeCheck="true" SmallerTypeCheck="true"
@ -256,7 +256,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
@ -356,7 +356,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
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" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"

View File

@ -37,9 +37,7 @@
#include "m_cond.h" // condition sets #include "m_cond.h" // condition sets
#include "lua_hook.h" // IntermissionThinker hook #include "lua_hook.h" // IntermissionThinker hook
#ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
#endif
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
@ -330,9 +328,7 @@ void Y_IntermissionDrawer(void)
if (intertype == int_none) if (intertype == int_none)
{ {
#ifdef HAVE_BLUA
LUAh_IntermissionHUD(); LUAh_IntermissionHUD();
#endif
return; return;
} }
@ -384,11 +380,9 @@ void Y_IntermissionDrawer(void)
else else
V_DrawPatchFill(bgtile); V_DrawPatchFill(bgtile);
#ifdef HAVE_BLUA
LUAh_IntermissionHUD(); LUAh_IntermissionHUD();
if (!LUA_HudEnabled(hud_intermissiontally)) if (!LUA_HudEnabled(hud_intermissiontally))
goto skiptallydrawer; goto skiptallydrawer;
#endif
dontdrawbg: dontdrawbg:
if (intertype == int_coop) if (intertype == int_coop)
@ -944,11 +938,9 @@ dontdrawbg:
} }
} }
#ifdef HAVE_BLUA
skiptallydrawer: skiptallydrawer:
if (!LUA_HudEnabled(hud_intermissionmessages)) if (!LUA_HudEnabled(hud_intermissionmessages))
return; return;
#endif
if (timer) if (timer)
V_DrawCenteredString(BASEVIDWIDTH/2, 188, V_YELLOWMAP, V_DrawCenteredString(BASEVIDWIDTH/2, 188, V_YELLOWMAP,
@ -973,9 +965,7 @@ void Y_Ticker(void)
if (paused || P_AutoPause()) if (paused || P_AutoPause())
return; return;
#ifdef HAVE_BLUA
LUAh_IntermissionThinker(); LUAh_IntermissionThinker();
#endif
intertic++; intertic++;

View File

@ -217,11 +217,9 @@ void Z_Free(void *ptr)
CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line); CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line);
#endif #endif
#ifdef HAVE_BLUA
// anything that isn't by lua gets passed to lua just in case. // anything that isn't by lua gets passed to lua just in case.
if (block->tag != PU_LUA) if (block->tag != PU_LUA)
LUA_InvalidateUserdata(ptr); LUA_InvalidateUserdata(ptr);
#endif
// TODO: if zdebugging, make sure no other block has a user // TODO: if zdebugging, make sure no other block has a user
// that is about to be freed. // that is about to be freed.