From e5017a6436ff4f8c9453e445d65c10c20c62093d Mon Sep 17 00:00:00 2001 From: Indev Date: Wed, 2 Aug 2023 14:33:19 +0300 Subject: [PATCH 1/2] Add intermission hud hook --- src/dehacked.c | 3 +++ src/lua_hud.h | 1 + src/lua_hudlib.c | 42 ++++++++++++++++++++++++++++++++++++++++-- src/y_inter.c | 20 ++++++++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 09ada89e0..52b2785c3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8732,6 +8732,9 @@ struct { {"TC_ALLWHITE",TC_ALLWHITE}, {"TC_RAINBOW",TC_RAINBOW}, {"TC_BLINK",TC_BLINK}, + + // Custom client features exposed to lua + {"FEATURE_INTERMISSIONHUD",1}, #endif {NULL,0} diff --git a/src/lua_hud.h b/src/lua_hud.h index 07ac577de..06ba0169b 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -43,5 +43,6 @@ boolean LUA_HudEnabled(enum hud option); void LUAh_GameHUD(player_t *stplyr, huddrawlist_h list); void LUAh_ScoresHUD(huddrawlist_h list); +void LUAh_IntermissionHUD(huddrawlist_h list); #endif // __LUA_HUD_H__ diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 854721b2a..f2eeae4c9 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -84,11 +84,13 @@ static const char *const patch_opt[] = { enum hudhook { hudhook_game = 0, - hudhook_scores + hudhook_scores = 1, + hudhook_intermission = 2, }; static const char *const hudhook_opt[] = { "game", "scores", + "intermission", NULL}; // alignment types for v.drawString @@ -987,7 +989,10 @@ int LUA_HudLib(lua_State *L) lua_rawseti(L, -2, 2); // HUD[2] = game rendering functions array lua_newtable(L); - lua_rawseti(L, -2, 3); // HUD[2] = scores rendering functions array + lua_rawseti(L, -2, 3); // HUD[3] = scores rendering functions array + + lua_newtable(L); + lua_rawseti(L, -2, 4); // HUD[4] = intermission rendering functions array lua_setfield(L, LUA_REGISTRYINDEX, "HUD"); luaL_newmetatable(L, META_HUDINFO); @@ -1132,4 +1137,37 @@ void LUAh_ScoresHUD(huddrawlist_h list) lua_setfield(gL, LUA_REGISTRYINDEX, "HUD_DRAW_LIST"); } +void LUAh_IntermissionHUD(huddrawlist_h list) +{ + if (!gL || !(hudAvailable & (1< Date: Wed, 2 Aug 2023 15:12:53 +0300 Subject: [PATCH 2/2] Add missing files to .gitignore --- .gitignore | 4 +++- assets/.gitignore | 1 + src/CMakeLists.txt | 8 ++++++++ src/sdl/CMakeLists.txt | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 797ea03df..8b73f04f5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ Win32_LIB_ASM_Release /assets/debian compile.sh *.gz -.vscode/ \ No newline at end of file +.vscode/ +out +build diff --git a/assets/.gitignore b/assets/.gitignore index b9dc7c70d..52c1d72f4 100644 --- a/assets/.gitignore +++ b/assets/.gitignore @@ -10,3 +10,4 @@ !LICENSE-3RD-PARTY.txt !CMakeLists.txt !debian-template/* +installer diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db19cbe81..e4eb9f134 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,7 @@ set(SRB2_CORE_SOURCES d_net.c d_netcmd.c d_netfil.c + d_protocol.c dehacked.c f_finale.c f_wipe.c @@ -31,6 +32,7 @@ set(SRB2_CORE_SOURCES m_fixed.c m_menu.c m_misc.c + m_perfstats.c m_queue.c m_random.c md5.c @@ -61,6 +63,7 @@ set(SRB2_CORE_HEADERS d_netcmd.h d_netfil.h d_player.h + d_protocol.h d_think.h d_ticcmd.h dehacked.h @@ -97,6 +100,7 @@ set(SRB2_CORE_HEADERS m_menu.h m_misc.h m_queue.h + m_perfstats.h m_random.h m_swap.h md5.h @@ -121,6 +125,7 @@ set(SRB2_CORE_RENDER_SOURCES r_draw.c r_fps.c r_main.c + r_patch.c r_plane.c r_segs.c r_sky.c @@ -134,6 +139,7 @@ set(SRB2_CORE_RENDER_SOURCES r_fps.h r_local.h r_main.h + r_patch r_plane.h r_segs.h r_sky.h @@ -261,6 +267,7 @@ if(${SRB2_CONFIG_HAVE_BLUA}) lua_script.c lua_skinlib.c lua_thinkerlib.c + lua_udatalib.c ) set(SRB2_LUA_HEADERS lua_hook.h @@ -268,6 +275,7 @@ if(${SRB2_CONFIG_HAVE_BLUA}) lua_hudlib_drawlist.h lua_libs.h lua_script.h + lua_udatalib.h ) prepend_sources(SRB2_LUA_SOURCES) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index b20adb096..67df4a646 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -274,16 +274,16 @@ if(${SDL2_FOUND}) ) ## strip debug symbols into separate file when using gcc - if(CMAKE_COMPILER_IS_GNUCC) - if(${CMAKE_BUILD_TYPE} MATCHES Debug) - message(STATUS "Will make separate debug symbols in *.debug") - add_custom_command(TARGET SRB2SDL2 POST_BUILD - COMMAND ${OBJCOPY} --only-keep-debug $ $.debug - COMMAND ${OBJCOPY} --strip-debug $ - COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ - ) - endif() - endif() + # if(CMAKE_COMPILER_IS_GNUCC) + # if(${CMAKE_BUILD_TYPE} MATCHES Debug) + # message(STATUS "Will make separate debug symbols in *.debug") + # add_custom_command(TARGET SRB2SDL2 POST_BUILD + # COMMAND ${OBJCOPY} --only-keep-debug $ $.debug + # COMMAND ${OBJCOPY} --strip-debug $ + # COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ + # ) + # endif() + # endif() #### Installation #### if(${CMAKE_SYSTEM} MATCHES Darwin) -- 2.54.0