From 36f696eafcd7b4932f460dc022ca69816e756a94 Mon Sep 17 00:00:00 2001 From: dinkc64 Date: Tue, 27 Jul 2021 01:47:56 -0400 Subject: [PATCH] add INCLUDE_LUA_SUPPORT tag to makefile --- makefile | 3 +++ src/burner/burner.h | 3 +++ src/burner/luaengine.cpp | 4 ++-- src/intf/video/vid_interface.cpp | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index e1b56179e..f56bbf609 100644 --- a/makefile +++ b/makefile @@ -39,6 +39,9 @@ INCLUDE_7Z_SUPPORT = 1 # Include AVI recording support (uses Video For Windows) INCLUDE_AVI_RECORDING = 1 +# Include LUA support (on Windows Standalone, LUA is enabled regardless) +#INCLUDE_LUA_SUPPORT = 1 + # Include symbols and other debug information in the executable #SYMBOL = 1 diff --git a/src/burner/burner.h b/src/burner/burner.h index a099913b5..a83e10af8 100644 --- a/src/burner/burner.h +++ b/src/burner/burner.h @@ -61,6 +61,9 @@ typedef struct tagIMAGE { #ifndef __LIBRETRO__ #include "interface.h" +#endif + +#if defined (INCLUDE_LUA_SUPPORT) || defined (BUILD_WIN32) #include "luaengine.h" #endif diff --git a/src/burner/luaengine.cpp b/src/burner/luaengine.cpp index cc3bc5791..38a51ffd5 100644 --- a/src/burner/luaengine.cpp +++ b/src/burner/luaengine.cpp @@ -1349,7 +1349,7 @@ static int joypad_set(lua_State *L) { // Set up for taking control of the indicated controller lua_joypads_used = 1; - memset(lua_joypads,0,0x0100); + memset(lua_joypads,0,sizeof(lua_joypads)); // Update the values of all the inputs for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { @@ -4088,7 +4088,7 @@ UINT32 FBA_LuaReadJoypad() { } lua_joypads_used = 0; - memset(lua_joypads,0,0x0100); + memset(lua_joypads,0,sizeof(lua_joypads)); return 0; } else diff --git a/src/intf/video/vid_interface.cpp b/src/intf/video/vid_interface.cpp index 8c8c42146..85d695cad 100644 --- a/src/intf/video/vid_interface.cpp +++ b/src/intf/video/vid_interface.cpp @@ -418,7 +418,9 @@ INT32 VidFrameCallback(bool bRedraw) // Called from blitter (VidFrame() VidDoTransTopVidImage(); } +#if defined (BUILD_WIN32) || defined (INCLUDE_LUA_SUPPORT) FBA_LuaGui((unsigned char*)pVidImage, nVidImageWidth, nVidImageHeight, nVidImageBPP, nVidImagePitch); +#endif } return 0;