diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ebfac3050..bd01cad42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -752,8 +752,8 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CUR DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h - COMMAND lemon -C${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon - DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon ) + COMMAND lemon -C${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/zcc-parse.lemon + DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/zcc-parse.lemon ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h COMMAND re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re @@ -819,9 +819,9 @@ file( GLOB HEADER_FILES sfmt/*.h sound/*.h textures/*.h - thingdef/*.h + scripting/*.h + scripting/vm/*.h xlat/*.h - zscript/*.h *.h ) @@ -910,7 +910,7 @@ set( NOT_COMPILED_SOURCE_FILES xlat/xlat_parser.y xlat_parser.c xlat_parser.h - zscript/zcc-parse.lemon + scripting/zscript/zcc-parse.lemon zcc-parse.c zcc-parse.h @@ -1226,14 +1226,6 @@ set (PCH_SOURCES textures/texturemanager.cpp textures/tgatexture.cpp textures/warptexture.cpp - thingdef/olddecorations.cpp - thingdef/thingdef.cpp - thingdef/thingdef_data.cpp - thingdef/thingdef_exp.cpp - thingdef/thingdef_expression.cpp - thingdef/thingdef_parse.cpp - thingdef/thingdef_properties.cpp - thingdef/thingdef_states.cpp xlat/parse_xlat.cpp fragglescript/t_func.cpp fragglescript/t_load.cpp @@ -1248,15 +1240,23 @@ set (PCH_SOURCES r_data/voxels.cpp r_data/renderstyle.cpp r_data/r_interpolate.cpp + scripting/thingdef.cpp + scripting/thingdef_data.cpp + scripting/thingdef_properties.cpp + scripting/codegeneration/thingdef_expression.cpp + scripting/decorate/olddecorations.cpp + scripting/decorate/thingdef_exp.cpp + scripting/decorate/thingdef_parse.cpp + scripting/decorate/thingdef_states.cpp + scripting/vm/vmbuilder.cpp + scripting/vm/vmdisasm.cpp + scripting/vm/vmexec.cpp + scripting/vm/vmframe.cpp + scripting/zscript/ast.cpp + scripting/zscript/zcc_compile.cpp + scripting/zscript/zcc_expr.cpp + scripting/zscript/zcc_parser.cpp sfmt/SFMT.cpp - zscript/ast.cpp - zscript/vmbuilder.cpp - zscript/vmdisasm.cpp - zscript/vmexec.cpp - zscript/vmframe.cpp - zscript/zcc_compile.cpp - zscript/zcc_expr.cpp - zscript/zcc_parser.cpp ) enable_precompiled_headers( g_pch.h PCH_SOURCES ) @@ -1316,11 +1316,11 @@ include_directories( . oplsynth sound textures - thingdef timidity wildmidi xlat - zscript + scripting + scripting/vm ../gdtoa ../dumb/include ${CMAKE_BINARY_DIR}/gdtoa @@ -1428,7 +1428,9 @@ source_group("Audio Files\\Timidity\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRE source_group("Audio Files\\Timidity\\Source" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/timidity/.+\\.cpp$") source_group("Audio Files\\WildMidi\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/wildmidi/.+\\.h$") source_group("Audio Files\\WildMidi\\Source" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/wildmidi/.+\\.cpp$") -source_group("Decorate++" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thingdef/.+") +source_group("External\\Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/math/.+") +source_group("External\\RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/.+") +source_group("Externak\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+") source_group("FraggleScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/fragglescript/.+") source_group("Games\\Doom Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_doom/.+") source_group("Games\\Heretic Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_heretic/.+") @@ -1436,9 +1438,7 @@ source_group("Games\\Hexen Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR source_group("Games\\Raven Shared" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_raven/.+") source_group("Games\\Strife Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_strife/.+") source_group("Intermission" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/intermission/.+") -source_group("Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/math/.+") source_group("Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/menu/.+") -source_group("RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/.+") source_group("Render Core\\Render Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/r_.+\\.h$") source_group("Render Core\\Render Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/r_.+\\.cpp$") source_group("Render Data\\Resource Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/r_data/.+\\.h$") @@ -1446,15 +1446,17 @@ source_group("Render Data\\Resource Sources" REGULAR_EXPRESSION "^${CMAKE_CURREN source_group("Render Data\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/.+") source_group("Render Interface" FILES r_defs.h r_renderer.h r_sky.cpp r_sky.h r_state.h r_utility.cpp r_utility.h) source_group("Resource Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/resourcefiles/.+") -source_group("POSIX Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/.+") -source_group("Cocoa Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/cocoa/.+") -source_group("OS X Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/.+") -source_group("Unix Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/unix/.+") -source_group("SDL Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/sdl/.+") -source_group("SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+") +source_group("Platforms\\POSIX Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/.+") +source_group("Platforms\\Cocoa Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/cocoa/.+") +source_group("Platforms\\OS X Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/.+") +source_group("Platforms\\Unix Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/unix/.+") +source_group("Platforms\\SDL Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/sdl/.+") +source_group("Platforms\\Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+") +source_group("Scripting\\Decorate" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/decorate/.+") +source_group("Scripting\\ZScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h) +source_group("Scripting\\Code Generation" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/codegeneration/.+") +source_group("Scripting\\VM" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/vm/.+") source_group("Shared Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_shared/.+") source_group("Versioning" FILES version.h win32/zdoom.rc) -source_group("Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+") source_group("Xlat" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/xlat/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h) -source_group("ZScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/zscript/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h) source_group("Source Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h sc_man_scanner.re) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index d062ce533..d5150e985 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -70,6 +70,9 @@ #include "doomerrors.h" #include "p_effect.h" #include "serializer.h" +#include "vm.h" +#include "thingdef.h" +#include "info.h" #include "vmbuilder.h" // [SO] Just the way Randy said to do it :) diff --git a/src/d_main.cpp b/src/d_main.cpp index dad2b86d9..d7757ddf4 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -109,6 +109,7 @@ #include "p_local.h" #include "autosegs.h" #include "fragglescript/t_fs.h" +#include "vm.h" EXTERN_CVAR(Bool, hud_althud) void DrawHUD(); diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index afdc75508..28715a0ec 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -77,6 +77,7 @@ #include "r_utility.h" #include "menu/menu.h" #include "intermission/intermission.h" +#include "vm.h" // MACROS ------------------------------------------------------------------ diff --git a/src/dobjtype.h b/src/dobjtype.h index 8ccb62aca..19aeca71b 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -68,7 +68,6 @@ struct StateCallData; class VMFrameStack; struct VMValue; struct VMReturn; -typedef int (*actionf_p)(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/ class VMFunction; // A VM function ------------------------------------------------------------ diff --git a/src/g_doom/a_arachnotron.cpp b/src/g_doom/a_arachnotron.cpp index 62660c7f5..e558b05b2 100644 --- a/src/g_doom/a_arachnotron.cpp +++ b/src/g_doom/a_arachnotron.cpp @@ -4,7 +4,7 @@ #include "p_local.h" #include "p_enemy.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ DEFINE_ACTION_FUNCTION(AActor, A_BspiAttack) diff --git a/src/g_doom/a_archvile.cpp b/src/g_doom/a_archvile.cpp index 84481e5f6..06be5cc0c 100644 --- a/src/g_doom/a_archvile.cpp +++ b/src/g_doom/a_archvile.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ // diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index b0e725910..8d4163c09 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -7,7 +7,7 @@ #include "s_sound.h" #include "statnums.h" #include "a_specialspot.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" #include "g_level.h" */ diff --git a/src/g_doom/a_cacodemon.cpp b/src/g_doom/a_cacodemon.cpp index 3532374cf..775580c29 100644 --- a/src/g_doom/a_cacodemon.cpp +++ b/src/g_doom/a_cacodemon.cpp @@ -7,7 +7,7 @@ #include "gstrings.h" #include "a_action.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_headattack ("HeadAttack"); diff --git a/src/g_doom/a_cyberdemon.cpp b/src/g_doom/a_cyberdemon.cpp index 9e0ddd1dd..55d9181bf 100644 --- a/src/g_doom/a_cyberdemon.cpp +++ b/src/g_doom/a_cyberdemon.cpp @@ -4,7 +4,7 @@ #include "s_sound.h" #include "p_enemy.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack) diff --git a/src/g_doom/a_demon.cpp b/src/g_doom/a_demon.cpp index 3f8e2f626..330b02b30 100644 --- a/src/g_doom/a_demon.cpp +++ b/src/g_doom/a_demon.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_sargattack ("SargAttack"); diff --git a/src/g_doom/a_doomimp.cpp b/src/g_doom/a_doomimp.cpp index f00b53a42..6130d39ca 100644 --- a/src/g_doom/a_doomimp.cpp +++ b/src/g_doom/a_doomimp.cpp @@ -7,7 +7,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_troopattack ("TroopAttack"); diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 129c32f1e..b68ded59d 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -7,7 +7,7 @@ #include "gi.h" #include "doomstat.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "p_enemy.h" #include "a_doomglobal.h" @@ -19,6 +19,7 @@ #include "p_maputl.h" #include "serializer.h" #include "g_shared/a_pickups.h" +#include "vm.h" // Include all the other Doom stuff here to reduce compile time #include "a_arachnotron.cpp" diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index a35a31b61..fd60e85d8 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -11,7 +11,7 @@ #include "p_effect.h" #include "gi.h" #include "templates.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_doom/a_fatso.cpp b/src/g_doom/a_fatso.cpp index 872e1982d..eeef39984 100644 --- a/src/g_doom/a_fatso.cpp +++ b/src/g_doom/a_fatso.cpp @@ -7,7 +7,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ // diff --git a/src/g_doom/a_keen.cpp b/src/g_doom/a_keen.cpp index d0a10da58..5c57128a3 100644 --- a/src/g_doom/a_keen.cpp +++ b/src/g_doom/a_keen.cpp @@ -5,7 +5,7 @@ #include "p_spec.h" #include "p_enemy.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ // diff --git a/src/g_doom/a_lostsoul.cpp b/src/g_doom/a_lostsoul.cpp index 056802fe0..35468ac08 100644 --- a/src/g_doom/a_lostsoul.cpp +++ b/src/g_doom/a_lostsoul.cpp @@ -9,7 +9,7 @@ #include "gi.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ FRandom pr_oldsoul ("BetaLostSoul"); diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index 3620b88db..8a0aa41bf 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -6,7 +6,7 @@ #include "a_action.h" #include "templates.h" #include "m_bbox.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_doom/a_possessed.cpp b/src/g_doom/a_possessed.cpp index f6b559c4b..e665e8f11 100644 --- a/src/g_doom/a_possessed.cpp +++ b/src/g_doom/a_possessed.cpp @@ -7,7 +7,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_posattack ("PosAttack"); diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index 9c8a38602..adb0ea100 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -8,7 +8,7 @@ #include "p_enemy.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index 2c293a2de..76f3e4577 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -7,7 +7,7 @@ #include "a_doomglobal.h" #include "s_sound.h" #include "r_data/r_translate.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_doom/a_spidermaster.cpp b/src/g_doom/a_spidermaster.cpp index aaafc4d99..ab12db4f0 100644 --- a/src/g_doom/a_spidermaster.cpp +++ b/src/g_doom/a_spidermaster.cpp @@ -6,7 +6,7 @@ #include "p_local.h" #include "p_enemy.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_spidrefire ("SpidRefire"); diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index 7f62d5f0e..78eb7ca8d 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -11,7 +11,7 @@ #include "p_enemy.h" #include "d_event.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ void P_UpdateBeak (AActor *actor); diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index f5870f09e..632260648 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -9,7 +9,7 @@ #include "a_sharedglobal.h" #include "gstrings.h" #include "a_specialspot.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_heretic/a_hereticartifacts.cpp b/src/g_heretic/a_hereticartifacts.cpp index 518abb44a..1c4677cb6 100644 --- a/src/g_heretic/a_hereticartifacts.cpp +++ b/src/g_heretic/a_hereticartifacts.cpp @@ -5,7 +5,7 @@ #include "gstrings.h" #include "p_local.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ // Tome of power ------------------------------------------------------------ diff --git a/src/g_heretic/a_hereticimp.cpp b/src/g_heretic/a_hereticimp.cpp index 81185c0c1..41e207ef1 100644 --- a/src/g_heretic/a_hereticimp.cpp +++ b/src/g_heretic/a_hereticimp.cpp @@ -6,7 +6,7 @@ #include "s_sound.h" #include "p_local.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_impmsatk ("ImpMsAttack"); diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 36969f6e7..d3ffbac23 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -6,7 +6,7 @@ #include "p_local.h" #include "s_sound.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "p_enemy.h" #include "a_specialspot.h" #include "g_level.h" @@ -18,6 +18,7 @@ #include "a_morph.h" #include "p_spec.h" #include "serializer.h" +#include "vm.h" // Include all the other Heretic stuff here to reduce compile time #include "a_chicken.cpp" diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index eb7d49983..c86cafce7 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -11,7 +11,7 @@ #include "gstrings.h" #include "gi.h" #include "r_data/r_translate.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index a88748407..c80a7bbed 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -7,7 +7,7 @@ #include "p_enemy.h" #include "a_action.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_heretic/a_knight.cpp b/src/g_heretic/a_knight.cpp index 9f42a328a..9c4ae2473 100644 --- a/src/g_heretic/a_knight.cpp +++ b/src/g_heretic/a_knight.cpp @@ -7,7 +7,7 @@ #include "a_action.h" #include "a_sharedglobal.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_dripblood ("DripBlood"); diff --git a/src/g_heretic/a_wizard.cpp b/src/g_heretic/a_wizard.cpp index 704488f16..e66bc5531 100644 --- a/src/g_heretic/a_wizard.cpp +++ b/src/g_heretic/a_wizard.cpp @@ -7,7 +7,7 @@ #include "p_enemy.h" #include "a_action.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_wizatk3 ("WizAtk3"); diff --git a/src/g_hexen/a_bats.cpp b/src/g_hexen/a_bats.cpp index 56c7ac024..875910059 100644 --- a/src/g_hexen/a_bats.cpp +++ b/src/g_hexen/a_bats.cpp @@ -4,7 +4,7 @@ #include "m_random.h" #include "p_local.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_batspawn ("BatSpawn"); diff --git a/src/g_hexen/a_bishop.cpp b/src/g_hexen/a_bishop.cpp index 5fb95d8be..a88daa23b 100644 --- a/src/g_hexen/a_bishop.cpp +++ b/src/g_hexen/a_bishop.cpp @@ -6,7 +6,7 @@ #include "a_action.h" #include "m_random.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_boom ("BishopBoom"); diff --git a/src/g_hexen/a_centaur.cpp b/src/g_hexen/a_centaur.cpp index 692688b63..75049650d 100644 --- a/src/g_hexen/a_centaur.cpp +++ b/src/g_hexen/a_centaur.cpp @@ -3,7 +3,7 @@ #include "p_enemy.h" #include "a_action.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_centaurdefend ("CentaurDefend"); diff --git a/src/g_hexen/a_clericflame.cpp b/src/g_hexen/a_clericflame.cpp index 5b4eba2e8..a9c8b6378 100644 --- a/src/g_hexen/a_clericflame.cpp +++ b/src/g_hexen/a_clericflame.cpp @@ -10,7 +10,7 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ const double FLAMESPEED = 0.45; diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index b08ab3e74..f660b1e7d 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -7,7 +7,7 @@ #include "a_hexenglobal.h" #include "gstrings.h" #include "a_weaponpiece.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" */ diff --git a/src/g_hexen/a_clericmace.cpp b/src/g_hexen/a_clericmace.cpp index 69f1f729c..fce979af1 100644 --- a/src/g_hexen/a_clericmace.cpp +++ b/src/g_hexen/a_clericmace.cpp @@ -2,7 +2,7 @@ #include "m_random.h" #include "p_local.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_maceatk ("CMaceAttack"); diff --git a/src/g_hexen/a_clericstaff.cpp b/src/g_hexen/a_clericstaff.cpp index de4e1d75f..6b54d4de3 100644 --- a/src/g_hexen/a_clericstaff.cpp +++ b/src/g_hexen/a_clericstaff.cpp @@ -10,7 +10,7 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_staffcheck ("CStaffCheck"); diff --git a/src/g_hexen/a_dragon.cpp b/src/g_hexen/a_dragon.cpp index c94be3988..ca56525a9 100644 --- a/src/g_hexen/a_dragon.cpp +++ b/src/g_hexen/a_dragon.cpp @@ -6,7 +6,7 @@ #include "a_action.h" #include "m_random.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_dragonseek ("DragonSeek"); diff --git a/src/g_hexen/a_fighteraxe.cpp b/src/g_hexen/a_fighteraxe.cpp index f47ad6a9d..a194869f3 100644 --- a/src/g_hexen/a_fighteraxe.cpp +++ b/src/g_hexen/a_fighteraxe.cpp @@ -10,9 +10,11 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ +DECLARE_ACTION(A_Raise) + #define AXERANGE (2.25 * MELEERANGE) static FRandom pr_axeatk ("FAxeAtk"); diff --git a/src/g_hexen/a_fighterhammer.cpp b/src/g_hexen/a_fighterhammer.cpp index c33737bfd..f8fbe33e3 100644 --- a/src/g_hexen/a_fighterhammer.cpp +++ b/src/g_hexen/a_fighterhammer.cpp @@ -10,7 +10,7 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ const double HAMMER_RANGE = 1.5 * MELEERANGE; diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index 3624ed625..d946c689c 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -8,7 +8,7 @@ #include "p_local.h" #include "a_action.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ IMPLEMENT_CLASS (AFighterWeapon) diff --git a/src/g_hexen/a_fighterquietus.cpp b/src/g_hexen/a_fighterquietus.cpp index 3d04e984a..a86d4911a 100644 --- a/src/g_hexen/a_fighterquietus.cpp +++ b/src/g_hexen/a_fighterquietus.cpp @@ -10,7 +10,7 @@ #include "gstrings.h" #include "a_hexenglobal.h" #include "a_weaponpiece.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_quietusdrop ("QuietusDrop"); diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index 712363167..b60c904e3 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "a_action.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ #define FIREDEMON_ATTACK_RANGE (64*8.) diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index ccc2bf112..3d9555843 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -10,7 +10,7 @@ #include "a_action.h" #include "a_hexenglobal.h" #include "w_wad.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_hexen/a_fog.cpp b/src/g_hexen/a_fog.cpp index b89f8d38c..98dbf62b7 100644 --- a/src/g_hexen/a_fog.cpp +++ b/src/g_hexen/a_fog.cpp @@ -1,7 +1,7 @@ /* #include "m_random.h" #include "p_local.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_fogspawn ("FogSpawn"); diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index c96c4cc1f..267320029 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -7,7 +7,7 @@ #include "m_random.h" #include "a_hexenglobal.h" #include "i_system.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_hexen/a_hexenmisc.cpp b/src/g_hexen/a_hexenmisc.cpp index 31a17c3a3..2c91f37b2 100644 --- a/src/g_hexen/a_hexenmisc.cpp +++ b/src/g_hexen/a_hexenmisc.cpp @@ -7,7 +7,7 @@ #include "a_sharedglobal.h" #include "a_hexenglobal.h" #include "i_system.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "gi.h" #include "g_level.h" #include "p_enemy.h" @@ -24,6 +24,7 @@ #include "p_maputl.h" #include "p_spec.h" #include "serializer.h" +#include "vm.h" // Include all the Hexen stuff here to reduce compile time #include "a_bats.cpp" diff --git a/src/g_hexen/a_hexenspecialdecs.cpp b/src/g_hexen/a_hexenspecialdecs.cpp index 28de8d46a..61d5780d1 100644 --- a/src/g_hexen/a_hexenspecialdecs.cpp +++ b/src/g_hexen/a_hexenspecialdecs.cpp @@ -11,7 +11,7 @@ #include "p_local.h" #include "p_lnspec.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" */ diff --git a/src/g_hexen/a_iceguy.cpp b/src/g_hexen/a_iceguy.cpp index d00e86041..d518c7db7 100644 --- a/src/g_hexen/a_iceguy.cpp +++ b/src/g_hexen/a_iceguy.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "a_action.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_iceguylook ("IceGuyLook"); diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index 7f0d3a43c..01457b91c 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -25,7 +25,7 @@ #include "a_action.h" #include "m_random.h" #include "i_system.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_hexen/a_magecone.cpp b/src/g_hexen/a_magecone.cpp index f31e57e58..b33f93787 100644 --- a/src/g_hexen/a_magecone.cpp +++ b/src/g_hexen/a_magecone.cpp @@ -10,7 +10,7 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ const int SHARDSPAWN_LEFT = 1; diff --git a/src/g_hexen/a_magelightning.cpp b/src/g_hexen/a_magelightning.cpp index 896384f4e..f322d88a6 100644 --- a/src/g_hexen/a_magelightning.cpp +++ b/src/g_hexen/a_magelightning.cpp @@ -10,7 +10,7 @@ #include "p_pspr.h" #include "gstrings.h" #include "a_hexenglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_hexen/a_magestaff.cpp b/src/g_hexen/a_magestaff.cpp index d7b06d009..ca846d794 100644 --- a/src/g_hexen/a_magestaff.cpp +++ b/src/g_hexen/a_magestaff.cpp @@ -7,7 +7,7 @@ #include "a_hexenglobal.h" #include "gstrings.h" #include "a_weaponpiece.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_hexen/a_pig.cpp b/src/g_hexen/a_pig.cpp index ea767dccd..11bfe3ce8 100644 --- a/src/g_hexen/a_pig.cpp +++ b/src/g_hexen/a_pig.cpp @@ -11,7 +11,7 @@ #include "p_enemy.h" #include "d_event.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_snoutattack ("SnoutAttack"); diff --git a/src/g_hexen/a_serpent.cpp b/src/g_hexen/a_serpent.cpp index 998466053..1f6d1dd2b 100644 --- a/src/g_hexen/a_serpent.cpp +++ b/src/g_hexen/a_serpent.cpp @@ -7,7 +7,7 @@ #include "a_action.h" #include "m_random.h" #include "p_terrain.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_serpentchase ("SerpentChase"); diff --git a/src/g_hexen/a_spike.cpp b/src/g_hexen/a_spike.cpp index 9f7396399..1e81f568f 100644 --- a/src/g_hexen/a_spike.cpp +++ b/src/g_hexen/a_spike.cpp @@ -7,7 +7,7 @@ #include "a_sharedglobal.h" #include "s_sound.h" #include "m_bbox.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_thrustraise ("ThrustRaise"); diff --git a/src/g_hexen/a_summon.cpp b/src/g_hexen/a_summon.cpp index eb5d825bf..c9daad6ec 100644 --- a/src/g_hexen/a_summon.cpp +++ b/src/g_hexen/a_summon.cpp @@ -6,7 +6,7 @@ #include "p_local.h" #include "s_sound.h" #include "ravenshared.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_hexen/a_teleportother.cpp b/src/g_hexen/a_teleportother.cpp index 7333d9d91..a89e62b4b 100644 --- a/src/g_hexen/a_teleportother.cpp +++ b/src/g_hexen/a_teleportother.cpp @@ -7,7 +7,7 @@ #include "s_sound.h" #include "p_lnspec.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" */ diff --git a/src/g_hexen/a_wraith.cpp b/src/g_hexen/a_wraith.cpp index 460fa6503..f5c1f44f4 100644 --- a/src/g_hexen/a_wraith.cpp +++ b/src/g_hexen/a_wraith.cpp @@ -7,7 +7,7 @@ #include "a_action.h" #include "m_random.h" #include "a_sharedglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_stealhealth ("StealHealth"); diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 9f58ce4c3..e3636fe1b 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -8,12 +8,13 @@ #include "a_action.h" #include "gi.h" #include "w_wad.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" #include "a_pickups.h" #include "d_player.h" #include "serializer.h" +#include "vm.h" #define MAULATORTICS (25*35) diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index c0ec37d09..3b1191131 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -1,5 +1,5 @@ #include "actor.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "p_conversation.h" #include "p_lnspec.h" #include "a_action.h" diff --git a/src/g_shared/a_bridge.cpp b/src/g_shared/a_bridge.cpp index 178f004ca..3161c2a45 100644 --- a/src/g_shared/a_bridge.cpp +++ b/src/g_shared/a_bridge.cpp @@ -2,7 +2,7 @@ #include "info.h" #include "gi.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" static FRandom pr_orbit ("Orbit"); diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 00a6692b2..906be04c4 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -14,7 +14,7 @@ #include "a_strifeglobal.h" #include "a_morph.h" #include "a_specialspot.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "g_game.h" #include "doomstat.h" diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index ac162a241..3ab67425d 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -14,7 +14,7 @@ #include "statnums.h" #include "gstrings.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "v_text.h" #include "doomstat.h" #include "doomdata.h" diff --git a/src/g_shared/a_specialspot.cpp b/src/g_shared/a_specialspot.cpp index 1d8d1f72d..48a8ce1a1 100644 --- a/src/g_shared/a_specialspot.cpp +++ b/src/g_shared/a_specialspot.cpp @@ -37,7 +37,7 @@ #include "p_local.h" #include "statnums.h" #include "i_system.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" #include "serializer.h" #include "a_pickups.h" diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index edd250deb..36ffbc271 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -13,7 +13,7 @@ #include "cmdlib.h" #include "templates.h" #include "sbar.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" #include "g_level.h" #include "d_net.h" diff --git a/src/g_shared/sbarinfo.cpp b/src/g_shared/sbarinfo.cpp index 42f28173c..2e764a403 100644 --- a/src/g_shared/sbarinfo.cpp +++ b/src/g_shared/sbarinfo.cpp @@ -57,6 +57,7 @@ #include "p_acs.h" #include "gstrings.h" #include "version.h" +#include "cmdlib.h" #define ARTIFLASH_OFFSET (statusBar->invBarOffset+6) enum diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index c4d8ec1ed..4733c6e41 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -52,6 +52,7 @@ #include "d_net.h" #include "d_player.h" #include "r_utility.h" +#include "cmdlib.h" #include diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index a3bb76b7f..191b097d2 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -54,6 +54,7 @@ #include "serializer.h" #include "gstrings.h" #include "r_utility.h" +#include "cmdlib.h" #include "../version.h" diff --git a/src/g_strife/a_acolyte.cpp b/src/g_strife/a_acolyte.cpp index e8049da1b..6f08a84c8 100644 --- a/src/g_strife/a_acolyte.cpp +++ b/src/g_strife/a_acolyte.cpp @@ -7,7 +7,7 @@ #include "s_sound.h" #include "a_strifeglobal.h" #include "doomdata.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_alienspectres.cpp b/src/g_strife/a_alienspectres.cpp index a7624785b..d4103015c 100644 --- a/src/g_strife/a_alienspectres.cpp +++ b/src/g_strife/a_alienspectres.cpp @@ -9,7 +9,7 @@ #include "a_strifeglobal.h" #include "c_console.h" #include "gstrings.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_crusader.cpp b/src/g_strife/a_crusader.cpp index b54fdd427..8e340b820 100644 --- a/src/g_strife/a_crusader.cpp +++ b/src/g_strife/a_crusader.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "s_sound.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static bool CrusaderCheckRange (AActor *self) diff --git a/src/g_strife/a_entityboss.cpp b/src/g_strife/a_entityboss.cpp index 72eeaac3a..b7f60e26f 100644 --- a/src/g_strife/a_entityboss.cpp +++ b/src/g_strife/a_entityboss.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "s_sound.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" */ diff --git a/src/g_strife/a_inquisitor.cpp b/src/g_strife/a_inquisitor.cpp index e372d8de1..16871300a 100644 --- a/src/g_strife/a_inquisitor.cpp +++ b/src/g_strife/a_inquisitor.cpp @@ -5,7 +5,7 @@ #include "p_local.h" #include "p_enemy.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_inq ("Inquisitor"); diff --git a/src/g_strife/a_loremaster.cpp b/src/g_strife/a_loremaster.cpp index ead116c63..2d695ac8d 100644 --- a/src/g_strife/a_loremaster.cpp +++ b/src/g_strife/a_loremaster.cpp @@ -5,7 +5,7 @@ #include "m_random.h" #include "p_local.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ // Loremaster (aka Priest) -------------------------------------------------- diff --git a/src/g_strife/a_oracle.cpp b/src/g_strife/a_oracle.cpp index f1f0b0b2b..139786d89 100644 --- a/src/g_strife/a_oracle.cpp +++ b/src/g_strife/a_oracle.cpp @@ -4,7 +4,7 @@ #include "a_strifeglobal.h" #include "p_enemy.h" #include "r_defs.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index bed5f838b..9c8cb6be3 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "s_sound.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_reaver.cpp b/src/g_strife/a_reaver.cpp index 372aea794..09d771a19 100644 --- a/src/g_strife/a_reaver.cpp +++ b/src/g_strife/a_reaver.cpp @@ -6,7 +6,7 @@ #include "m_random.h" #include "p_local.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_reaverattack ("ReaverAttack"); diff --git a/src/g_strife/a_rebels.cpp b/src/g_strife/a_rebels.cpp index f2031a7a3..c4df1cba1 100644 --- a/src/g_strife/a_rebels.cpp +++ b/src/g_strife/a_rebels.cpp @@ -8,7 +8,7 @@ #include "gi.h" #include "a_sharedglobal.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index 91adbb01e..42a7aeb47 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -4,7 +4,7 @@ #include "a_action.h" #include "p_local.h" #include "m_random.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_sentinelrefire ("SentinelRefire"); diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index 00b19055c..1b1f13b1a 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -6,7 +6,7 @@ #include "s_sound.h" #include "m_random.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ class ASpectralMonster : public AActor diff --git a/src/g_strife/a_stalker.cpp b/src/g_strife/a_stalker.cpp index 8ee07de8a..210bd8c22 100644 --- a/src/g_strife/a_stalker.cpp +++ b/src/g_strife/a_stalker.cpp @@ -5,7 +5,7 @@ #include "p_local.h" #include "p_enemy.h" #include "s_sound.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_stalker ("Stalker"); diff --git a/src/g_strife/a_strifeitems.cpp b/src/g_strife/a_strifeitems.cpp index 26ac88393..20de58d4f 100644 --- a/src/g_strife/a_strifeitems.cpp +++ b/src/g_strife/a_strifeitems.cpp @@ -13,7 +13,7 @@ #include "a_keys.h" #include "c_console.h" #include "templates.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index ad6bbe133..32ce0e395 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -10,7 +10,7 @@ #include "p_enemy.h" #include "p_lnspec.h" #include "c_console.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" #include "gstrings.h" #include "a_keys.h" @@ -21,6 +21,7 @@ #include "serializer.h" #include "p_spec.h" #include "portal.h" +#include "vm.h" // Include all the other Strife stuff here to reduce compile time #include "a_acolyte.cpp" diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index be3c3bf2b..66d635aa5 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -6,7 +6,7 @@ #include "s_sound.h" #include "p_enemy.h" #include "templates.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_strife/a_templar.cpp b/src/g_strife/a_templar.cpp index 547d4d73e..5ca2ef862 100644 --- a/src/g_strife/a_templar.cpp +++ b/src/g_strife/a_templar.cpp @@ -6,7 +6,7 @@ #include "p_enemy.h" #include "s_sound.h" #include "a_strifeglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" */ static FRandom pr_templar ("Templar"); diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index fed1c4337..6d1294b53 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -6,8 +6,8 @@ #include "p_enemy.h" #include "a_action.h" #include "gstrings.h" -#include "thingdef/thingdef.h" -#include "thingdef/thingdef.h" +#include "vm.h" +#include "vm.h" #include "doomstat.h" */ diff --git a/src/g_strife/strife_sbar.cpp b/src/g_strife/strife_sbar.cpp index bcdf624d7..122846a82 100644 --- a/src/g_strife/strife_sbar.cpp +++ b/src/g_strife/strife_sbar.cpp @@ -17,6 +17,7 @@ #include "g_level.h" #include "colormatcher.h" #include "v_palette.h" +#include "cmdlib.h" // Number of tics to move the popscreen up and down. #define POP_TIME (TICRATE/8) diff --git a/src/info.cpp b/src/info.cpp index ea6701fac..191ed2bd5 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -52,7 +52,7 @@ #include "cmdlib.h" #include "g_level.h" #include "stats.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "d_player.h" extern void LoadActors (); diff --git a/src/info.h b/src/info.h index 0e49e1f8f..5ba7eafd9 100644 --- a/src/info.h +++ b/src/info.h @@ -54,6 +54,18 @@ class FScanner; struct FActorInfo; class FIntCVar; +enum EStateDefineFlags +{ + SDF_NEXT = 0, + SDF_STATE = 1, + SDF_STOP = 2, + SDF_WAIT = 3, + SDF_LABEL = 4, + SDF_INDEX = 5, + SDF_MASK = 7, + SDF_DEHACKED = 8, // Identify a state as having been modified by a dehacked lump +}; + enum EStateType { STATE_Actor, diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 618189b4f..0fcf4e4d5 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -50,6 +50,7 @@ #include "m_joy.h" #include "gi.h" #include "i_sound.h" +#include "cmdlib.h" #include "optionmenuitems.h" diff --git a/src/menu/menuinput.cpp b/src/menu/menuinput.cpp index 892118742..39d7a8c0b 100644 --- a/src/menu/menuinput.cpp +++ b/src/menu/menuinput.cpp @@ -40,6 +40,7 @@ #include "d_gui.h" #include "v_font.h" #include "v_palette.h" +#include "cmdlib.h" // [TP] New #includes #include "v_text.h" diff --git a/src/menu/messagebox.cpp b/src/menu/messagebox.cpp index 601c3e736..a72a37740 100644 --- a/src/menu/messagebox.cpp +++ b/src/menu/messagebox.cpp @@ -32,6 +32,7 @@ ** */ +#include #include "menu/menu.h" #include "d_event.h" #include "d_gui.h" diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 71ef65f22..29aee9e12 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -83,6 +83,7 @@ #include "a_morph.h" #include "i_music.h" #include "serializer.h" +#include "thingdef.h" #include "g_shared/a_pickups.h" diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index c6bc8215b..c8e110a68 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -61,7 +61,7 @@ #include "c_console.h" #include "doomerrors.h" #include "a_sharedglobal.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "v_video.h" #include "v_font.h" #include "doomstat.h" @@ -77,6 +77,8 @@ #include "p_maputl.h" #include "p_spec.h" #include "templates.h" +#include "vm.h" +#include "thingdef.h" #include "math/cmath.h" AActor *SingleActorFromTID(int tid, AActor *defactor); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index b7ad54095..5f63ff1e5 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -43,7 +43,7 @@ #include "p_enemy.h" #include "a_sharedglobal.h" #include "a_action.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "d_dehacked.h" #include "g_level.h" #include "r_utility.h" @@ -53,6 +53,7 @@ #include "p_spec.h" #include "p_checkposition.h" #include "math/cmath.h" +#include "vm.h" #include "gi.h" diff --git a/src/p_enemy.h b/src/p_enemy.h index 1be77a4ec..7f4424fd6 100644 --- a/src/p_enemy.h +++ b/src/p_enemy.h @@ -1,7 +1,8 @@ #ifndef __P_ENEMY_H__ #define __P_ENEMY_H__ -#include "thingdef/thingdef.h" +#include "vm.h" +#include "vectors.h" struct sector_t; class AActor; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 1ebec242e..e443db368 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -53,7 +53,7 @@ #include "a_action.h" #include "a_keys.h" #include "p_conversation.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_game.h" #include "teaminfo.h" #include "r_data/r_translate.h" @@ -71,6 +71,7 @@ #include "p_checkposition.h" #include "serializer.h" #include "r_utility.h" +#include "thingdef.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index e5b076acd..db2059088 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -25,7 +25,7 @@ #include "gi.h" #include "p_pspr.h" #include "templates.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "d_player.h" #include "serializer.h" diff --git a/src/p_pspr.h b/src/p_pspr.h index ea03e109f..568c289d2 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -25,7 +25,7 @@ // Basic data types. // Needs fixed point, and BAM angles. -#include "thingdef/thingdef.h" +//#include "vm.h" #define WEAPONBOTTOM 128. @@ -120,7 +120,6 @@ void DoReadyWeaponToBob(AActor *self); void DoReadyWeaponToFire(AActor *self, bool primary = true, bool secondary = true); void DoReadyWeaponToSwitch(AActor *self, bool switchable = true); -DECLARE_ACTION(A_Raise) void A_ReFire(AActor *self, FState *state = NULL); #endif // __P_PSPR_H__ diff --git a/src/p_states.cpp b/src/p_states.cpp index 1a8116e53..007f7f5ce 100644 --- a/src/p_states.cpp +++ b/src/p_states.cpp @@ -39,7 +39,8 @@ #include "i_system.h" #include "c_dispatch.h" #include "v_text.h" -#include "thingdef/thingdef.h" +#include "vm.h" +#include "thingdef.h" // Each state is owned by an actor. Actors can own any number of // states, but a single state cannot be owned by more than one diff --git a/src/p_user.cpp b/src/p_user.cpp index 0f3b6a516..c60e4bff6 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -48,7 +48,7 @@ #include "doomdef.h" #include "c_dispatch.h" #include "tarray.h" -#include "thingdef/thingdef.h" +#include "vm.h" #include "g_level.h" #include "d_net.h" #include "gstrings.h" diff --git a/src/thingdef/thingdef_exp.h b/src/scripting/codegeneration/thingdef_exp.h similarity index 100% rename from src/thingdef/thingdef_exp.h rename to src/scripting/codegeneration/thingdef_exp.h diff --git a/src/thingdef/thingdef_expression.cpp b/src/scripting/codegeneration/thingdef_expression.cpp similarity index 100% rename from src/thingdef/thingdef_expression.cpp rename to src/scripting/codegeneration/thingdef_expression.cpp diff --git a/src/thingdef/olddecorations.cpp b/src/scripting/decorate/olddecorations.cpp similarity index 99% rename from src/thingdef/olddecorations.cpp rename to src/scripting/decorate/olddecorations.cpp index 9afbfc965..4bcb2c36c 100644 --- a/src/thingdef/olddecorations.cpp +++ b/src/scripting/decorate/olddecorations.cpp @@ -48,7 +48,7 @@ #include "decallib.h" #include "i_system.h" #include "thingdef.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" #include "r_data/r_translate.h" // TYPES ------------------------------------------------------------------- diff --git a/src/thingdef/thingdef_exp.cpp b/src/scripting/decorate/thingdef_exp.cpp similarity index 99% rename from src/thingdef/thingdef_exp.cpp rename to src/scripting/decorate/thingdef_exp.cpp index 11baef722..2f52fb260 100644 --- a/src/thingdef/thingdef_exp.cpp +++ b/src/scripting/decorate/thingdef_exp.cpp @@ -48,7 +48,7 @@ #include "thingdef.h" #include "p_lnspec.h" #include "doomstat.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" FRandom pr_exrandom ("EX_Random"); diff --git a/src/thingdef/thingdef_parse.cpp b/src/scripting/decorate/thingdef_parse.cpp similarity index 99% rename from src/thingdef/thingdef_parse.cpp rename to src/scripting/decorate/thingdef_parse.cpp index 6d1077ffe..5fbe27a9d 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/scripting/decorate/thingdef_parse.cpp @@ -49,7 +49,7 @@ #include "v_palette.h" #include "doomerrors.h" #include "i_system.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" #include "w_wad.h" #include "v_video.h" #include "version.h" diff --git a/src/thingdef/thingdef_states.cpp b/src/scripting/decorate/thingdef_states.cpp similarity index 99% rename from src/thingdef/thingdef_states.cpp rename to src/scripting/decorate/thingdef_states.cpp index 3b692391c..59d620b2a 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/scripting/decorate/thingdef_states.cpp @@ -54,7 +54,7 @@ #include "s_sound.h" #include "i_system.h" #include "colormatcher.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" #include "version.h" #include "templates.h" diff --git a/src/thingdef/thingdef.cpp b/src/scripting/thingdef.cpp similarity index 99% rename from src/thingdef/thingdef.cpp rename to src/scripting/thingdef.cpp index 8b174988d..175aa8990 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -61,7 +61,7 @@ #include "p_conversation.h" #include "v_text.h" #include "thingdef.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" #include "a_sharedglobal.h" #include "vmbuilder.h" #include "stats.h" diff --git a/src/thingdef/thingdef.h b/src/scripting/thingdef.h similarity index 76% rename from src/thingdef/thingdef.h rename to src/scripting/thingdef.h index 152f32431..84f1f7d06 100644 --- a/src/thingdef/thingdef.h +++ b/src/scripting/thingdef.h @@ -6,6 +6,7 @@ #include "s_sound.h" #include "sc_man.h" #include "cmdlib.h" +#include "vm.h" class FScanner; @@ -46,18 +47,6 @@ class FxExpression; struct FStateLabels; -enum EStateDefineFlags -{ - SDF_NEXT = 0, - SDF_STATE = 1, - SDF_STOP = 2, - SDF_WAIT = 3, - SDF_LABEL = 4, - SDF_INDEX = 5, - SDF_MASK = 7, - SDF_DEHACKED = 8, // Identify a state as having been modified by a dehacked lump -}; - struct FStateDefine { FName Label; @@ -171,13 +160,6 @@ inline void ResetBaggage (Baggage *bag, PClassActor *stateclass) // //========================================================================== -struct AFuncDesc -{ - const char *Name; - actionf_p Function; - VMNativeFunction **VMPointer; -}; - AFuncDesc *FindFunction(const char * string); @@ -189,8 +171,6 @@ class FxVMFunctionCall *ParseAction(FScanner &sc, FState state, FString statestr FName CheckCastKludges(FName in); void SetImplicitArgs(TArray *args, TArray *argflags, PClass *cls, DWORD funcflags); -PFunction *FindGlobalActionFunction(const char *name); - //========================================================================== // // Property parser @@ -232,23 +212,13 @@ enum EDefinitionType }; #if defined(_MSC_VER) -#pragma section(".areg$u",read) #pragma section(".greg$u",read) -#pragma section(".mreg$u",read) -#define MSVC_ASEG __declspec(allocate(".areg$u")) -#define GCC_ASEG #define MSVC_PSEG __declspec(allocate(".greg$u")) #define GCC_PSEG -#define MSVC_MSEG __declspec(allocate(".mreg$u")) -#define GCC_MSEG #else -#define MSVC_ASEG -#define GCC_ASEG __attribute__((section(SECTION_AREG))) __attribute__((used)) #define MSVC_PSEG #define GCC_PSEG __attribute__((section(SECTION_GREG))) __attribute__((used)) -#define MSVC_MSEG -#define GCC_MSEG __attribute__((section(SECTION_MREG))) __attribute__((used)) #endif @@ -322,39 +292,4 @@ int MatchString (const char *in, const char **strings); #define PROP_COLOR_PARM(var, no) \ int var = params[(no)+1].i== 0? params[(no)+2].i : V_GetColor(NULL, params[(no)+2].s); - -// Macros to handle action functions. These are here so that I don't have to -// change every single use in case the parameters change. -#define DECLARE_ACTION(name) extern VMNativeFunction *name##_VMPtr; - -// This distinction is here so that CALL_ACTION produces errors when trying to -// access a function that requires parameters. -#define DEFINE_ACTION_FUNCTION(cls, name) \ - static int AF_##name(VM_ARGS); \ - VMNativeFunction *name##_VMPtr; \ - static const AFuncDesc cls##_##name##_Hook = { #name, AF_##name, &name##_VMPtr }; \ - extern AFuncDesc const *const cls##_##name##_HookPtr; \ - MSVC_ASEG AFuncDesc const *const cls##_##name##_HookPtr GCC_ASEG = &cls##_##name##_Hook; \ - static int AF_##name(VM_ARGS) - -#define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) DEFINE_ACTION_FUNCTION(cls, name) - -//#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall -//#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall - -#define CALL_ACTION(name,self) { /*AF_##name(self, self, NULL, 0, NULL)*/ \ - VMValue params[3] = { self, self, VMValue(NULL, ATAG_STATEINFO) }; \ - stack->Call(name##_VMPtr, params, countof(params), NULL, 0, NULL); \ - } - - -#define ACTION_RETURN_STATE(v) do { FState *state = v; if (numret > 0) { assert(ret != NULL); ret->SetPointer(state, ATAG_STATE); return 1; } return 0; } while(0) -#define ACTION_RETURN_FLOAT(v) do { double u = v; if (numret > 0) { assert(ret != nullptr); ret->SetFloat(u); return 1; } return 0; } while(0) -#define ACTION_RETURN_INT(v) do { int u = v; if (numret > 0) { assert(ret != NULL); ret->SetInt(u); return 1; } return 0; } while(0) -#define ACTION_RETURN_BOOL(v) ACTION_RETURN_INT(v) - -// Checks to see what called the current action function -#define ACTION_CALL_FROM_ACTOR() (stateinfo == nullptr || stateinfo->mStateType == STATE_Actor) -#define ACTION_CALL_FROM_PSPRITE() (self->player && stateinfo != nullptr && stateinfo->mStateType == STATE_Psprite) -#define ACTION_CALL_FROM_INVENTORY() (stateinfo != nullptr && stateinfo->mStateType == STATE_StateChain) #endif diff --git a/src/thingdef/thingdef_data.cpp b/src/scripting/thingdef_data.cpp similarity index 100% rename from src/thingdef/thingdef_data.cpp rename to src/scripting/thingdef_data.cpp diff --git a/src/thingdef/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp similarity index 100% rename from src/thingdef/thingdef_properties.cpp rename to src/scripting/thingdef_properties.cpp diff --git a/src/zscript/vm.h b/src/scripting/vm/vm.h similarity index 90% rename from src/zscript/vm.h rename to src/scripting/vm/vm.h index a000e9533..28b555e4e 100644 --- a/src/zscript/vm.h +++ b/src/scripting/vm/vm.h @@ -3,6 +3,7 @@ #include "zstring.h" #include "dobject.h" +#include "autosegs.h" #define MAX_RETURNS 8 // Maximum number of results a function called by script code can return #define MAX_TRY_DEPTH 8 // Maximum number of nested TRYs in a single function @@ -960,4 +961,63 @@ void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction #define PARAM_OBJECT_OPT(x,type) ++paramnum; PARAM_OBJECT_OPT_AT(paramnum,x,type) #define PARAM_CLASS_OPT(x,base) ++paramnum; PARAM_CLASS_OPT_AT(paramnum,x,base) +typedef int(*actionf_p)(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/ + +struct AFuncDesc +{ + const char *Name; + actionf_p Function; + VMNativeFunction **VMPointer; +}; + +#if defined(_MSC_VER) +#pragma section(".areg$u",read) + +#define MSVC_ASEG __declspec(allocate(".areg$u")) +#define GCC_ASEG +#else +#define MSVC_ASEG +#define GCC_ASEG __attribute__((section(SECTION_AREG))) __attribute__((used)) +#endif + +// Macros to handle action functions. These are here so that I don't have to +// change every single use in case the parameters change. +#define DECLARE_ACTION(name) extern VMNativeFunction *name##_VMPtr; + +// This distinction is here so that CALL_ACTION produces errors when trying to +// access a function that requires parameters. +#define DEFINE_ACTION_FUNCTION(cls, name) \ + static int AF_##name(VM_ARGS); \ + VMNativeFunction *name##_VMPtr; \ + static const AFuncDesc cls##_##name##_Hook = { #name, AF_##name, &name##_VMPtr }; \ + extern AFuncDesc const *const cls##_##name##_HookPtr; \ + MSVC_ASEG AFuncDesc const *const cls##_##name##_HookPtr GCC_ASEG = &cls##_##name##_Hook; \ + static int AF_##name(VM_ARGS) + +#define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) DEFINE_ACTION_FUNCTION(cls, name) + +//#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall +//#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall + +#define CALL_ACTION(name,self) { /*AF_##name(self, self, NULL, 0, NULL)*/ \ + VMValue params[3] = { self, self, VMValue(NULL, ATAG_STATEINFO) }; \ + stack->Call(name##_VMPtr, params, countof(params), NULL, 0, NULL); \ + } + + +#define ACTION_RETURN_STATE(v) do { FState *state = v; if (numret > 0) { assert(ret != NULL); ret->SetPointer(state, ATAG_STATE); return 1; } return 0; } while(0) +#define ACTION_RETURN_FLOAT(v) do { double u = v; if (numret > 0) { assert(ret != nullptr); ret->SetFloat(u); return 1; } return 0; } while(0) +#define ACTION_RETURN_INT(v) do { int u = v; if (numret > 0) { assert(ret != NULL); ret->SetInt(u); return 1; } return 0; } while(0) +#define ACTION_RETURN_BOOL(v) ACTION_RETURN_INT(v) + +// Checks to see what called the current action function +#define ACTION_CALL_FROM_ACTOR() (stateinfo == nullptr || stateinfo->mStateType == STATE_Actor) +#define ACTION_CALL_FROM_PSPRITE() (self->player && stateinfo != nullptr && stateinfo->mStateType == STATE_Psprite) +#define ACTION_CALL_FROM_INVENTORY() (stateinfo != nullptr && stateinfo->mStateType == STATE_StateChain) + +class PFunction; + +PFunction *FindGlobalActionFunction(const char *name); + + #endif diff --git a/src/zscript/vmbuilder.cpp b/src/scripting/vm/vmbuilder.cpp similarity index 100% rename from src/zscript/vmbuilder.cpp rename to src/scripting/vm/vmbuilder.cpp diff --git a/src/zscript/vmbuilder.h b/src/scripting/vm/vmbuilder.h similarity index 100% rename from src/zscript/vmbuilder.h rename to src/scripting/vm/vmbuilder.h diff --git a/src/zscript/vmdisasm.cpp b/src/scripting/vm/vmdisasm.cpp similarity index 100% rename from src/zscript/vmdisasm.cpp rename to src/scripting/vm/vmdisasm.cpp diff --git a/src/zscript/vmexec.cpp b/src/scripting/vm/vmexec.cpp similarity index 100% rename from src/zscript/vmexec.cpp rename to src/scripting/vm/vmexec.cpp diff --git a/src/zscript/vmexec.h b/src/scripting/vm/vmexec.h similarity index 100% rename from src/zscript/vmexec.h rename to src/scripting/vm/vmexec.h diff --git a/src/zscript/vmframe.cpp b/src/scripting/vm/vmframe.cpp similarity index 100% rename from src/zscript/vmframe.cpp rename to src/scripting/vm/vmframe.cpp diff --git a/src/zscript/vmops.h b/src/scripting/vm/vmops.h similarity index 100% rename from src/zscript/vmops.h rename to src/scripting/vm/vmops.h diff --git a/src/zscript/ast.cpp b/src/scripting/zscript/ast.cpp similarity index 100% rename from src/zscript/ast.cpp rename to src/scripting/zscript/ast.cpp diff --git a/src/zscript/zcc-parse.lemon b/src/scripting/zscript/zcc-parse.lemon similarity index 100% rename from src/zscript/zcc-parse.lemon rename to src/scripting/zscript/zcc-parse.lemon diff --git a/src/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp similarity index 99% rename from src/zscript/zcc_compile.cpp rename to src/scripting/zscript/zcc_compile.cpp index 19af0e7c1..0d9558a52 100644 --- a/src/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -46,7 +46,7 @@ #include "v_text.h" #include "p_lnspec.h" #include "gdtoa.h" -#include "thingdef_exp.h" +#include "codegeneration/thingdef_exp.h" #define DEFINING_CONST ((PSymbolConst *)(void *)1) diff --git a/src/zscript/zcc_compile.h b/src/scripting/zscript/zcc_compile.h similarity index 100% rename from src/zscript/zcc_compile.h rename to src/scripting/zscript/zcc_compile.h diff --git a/src/zscript/zcc_expr.cpp b/src/scripting/zscript/zcc_expr.cpp similarity index 100% rename from src/zscript/zcc_expr.cpp rename to src/scripting/zscript/zcc_expr.cpp diff --git a/src/zscript/zcc_exprlist.h b/src/scripting/zscript/zcc_exprlist.h similarity index 100% rename from src/zscript/zcc_exprlist.h rename to src/scripting/zscript/zcc_exprlist.h diff --git a/src/zscript/zcc_parser.cpp b/src/scripting/zscript/zcc_parser.cpp similarity index 100% rename from src/zscript/zcc_parser.cpp rename to src/scripting/zscript/zcc_parser.cpp diff --git a/src/zscript/zcc_parser.h b/src/scripting/zscript/zcc_parser.h similarity index 100% rename from src/zscript/zcc_parser.h rename to src/scripting/zscript/zcc_parser.h diff --git a/src/serializer.cpp b/src/serializer.cpp index 7861701c0..5564cdf50 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -63,6 +63,7 @@ #include "w_zip.h" #include "doomerrors.h" #include "v_text.h" +#include "cmdlib.h" char nulspace[1024 * 1024 * 4]; bool save_full = false; // for testing. Should be removed afterward. diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 21370d082..42933e5db 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -58,6 +58,7 @@ #include "i_music.h" #include "i_musicinterns.h" #include "tempfiles.h" +#include "cmdlib.h" #include "oalload.h" diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 108edff3b..12ca10e32 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -51,6 +51,7 @@ #include "r_data/r_translate.h" #include "templates.h" #include "gstrings.h" +#include "cmdlib.h" // States for the intermission typedef enum