Skip to content

Commit

Permalink
COMMON: Move Lua into Common and make it into...
Browse files Browse the repository at this point in the history
an engine feature
  • Loading branch information
nipunG314 authored and sev- committed Aug 13, 2019
1 parent f019afa commit c1f029c
Show file tree
Hide file tree
Showing 71 changed files with 88 additions and 70 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -20,7 +20,7 @@
* *
*/ */


#include "sword25/util/double_serialization.h" #include "common/lua/double_serialization.h"


#include "common/scummsys.h" #include "common/scummsys.h"


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -44,16 +44,16 @@
*/ */




#include "sword25/util/lua_persistence.h" #include "lua_persistence.h"


#include "sword25/util/double_serialization.h" #include "double_serialization.h"
#include "sword25/util/lua_persistence_util.h" #include "lua_persistence_util.h"


#include "common/stream.h" #include "common/stream.h"


#include "lua/lobject.h" #include "lobject.h"
#include "lua/lstate.h" #include "lstate.h"
#include "lua/lgc.h" #include "lgc.h"




namespace Lua { namespace Lua {
Expand Down
Expand Up @@ -46,7 +46,7 @@
#ifndef LUA_PERSISTENCE_H #ifndef LUA_PERSISTENCE_H
#define LUA_PERSISTENCE_H #define LUA_PERSISTENCE_H


#include "sword25/util/lua/lua.h" #include "lua.h"




namespace Common { namespace Common {
Expand Down
Expand Up @@ -67,14 +67,14 @@
*/ */




#include "sword25/util/lua_persistence_util.h" #include "lua_persistence_util.h"


#include "common/scummsys.h" #include "common/scummsys.h"


#include "lua/lobject.h" #include "lobject.h"
#include "lua/lstate.h" #include "lstate.h"
#include "lua/lgc.h" #include "lgc.h"
#include "lua/lopcodes.h" #include "lopcodes.h"




namespace Lua { namespace Lua {
Expand Down
Expand Up @@ -50,7 +50,7 @@


struct lua_State; struct lua_State;


#include "lua/lobject.h" #include "lobject.h"


typedef TValue *StkId; typedef TValue *StkId;


Expand Down
Expand Up @@ -44,17 +44,17 @@
*/ */




#include "sword25/util/lua_persistence.h" #include "lua_persistence.h"


#include "sword25/util/double_serialization.h" #include "double_serialization.h"
#include "sword25/util/lua_persistence_util.h" #include "lua_persistence_util.h"


#include "common/stream.h" #include "common/stream.h"


#include "lua/lobject.h" #include "lobject.h"
#include "lua/lstate.h" #include "lstate.h"
#include "lua/lgc.h" #include "lgc.h"
#include "lua/lopcodes.h" #include "lopcodes.h"




namespace Lua { namespace Lua {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -20,7 +20,7 @@
* *
*/ */


#include "sword25/util/lua/scummvm_file.h" #include "scummvm_file.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#include "common/language.h" #include "common/language.h"


Expand Down
File renamed without changes.
37 changes: 37 additions & 0 deletions common/module.mk
Expand Up @@ -62,5 +62,42 @@ MODULE_OBJS += \
updates.o updates.o
endif endif


ifdef USE_LUA
MODULE_OBJS += \
lua/double_serialization.o \
lua/lapi.o \
lua/lauxlib.o \
lua/lbaselib.o \
lua/lcode.o \
lua/ldblib.o \
lua/ldblib.o \
lua/ldebug.o \
lua/ldo.o \
lua/lfunc.o \
lua/lgc.o \
lua/linit.o \
lua/liolib.o \
lua/llex.o \
lua/lmathlib.o \
lua/lmem.o \
lua/loadlib.o \
lua/lobject.o \
lua/lopcodes.o \
lua/loslib.o \
lua/lparser.o \
lua/lstate.o \
lua/lstring.o \
lua/lstrlib.o \
lua/ltable.o \
lua/ltablib.o \
lua/ltm.o \
lua/lua_persist.o \
lua/lua_persistence_util.o \
lua/lua_unpersist.o \
lua/lvm.o \
lua/lzio.o \
lua/scummvm_file.o
endif

# Include common rules # Include common rules
include $(srcdir)/rules.mk include $(srcdir)/rules.mk
16 changes: 14 additions & 2 deletions configure
Expand Up @@ -173,6 +173,7 @@ _use_cxx11=no
_verbose_build=no _verbose_build=no
_text_console=no _text_console=no
_mt32emu=yes _mt32emu=yes
_lua=yes
_build_scalers=yes _build_scalers=yes
_build_hq_scalers=yes _build_hq_scalers=yes
_enable_prof=no _enable_prof=no
Expand Down Expand Up @@ -253,8 +254,7 @@ add_feature png "PNG" "_png"
add_feature theoradec "libtheoradec" "_theoradec" add_feature theoradec "libtheoradec" "_theoradec"
add_feature vorbis "Vorbis file support" "_vorbis _tremor" add_feature vorbis "Vorbis file support" "_vorbis _tremor"
add_feature zlib "zlib" "_zlib" add_feature zlib "zlib" "_zlib"

add_feature lua "lua" "_lua"



# Directories for installing ScummVM. # Directories for installing ScummVM.
# This list is closely based on what GNU autoconf does, # This list is closely based on what GNU autoconf does,
Expand Down Expand Up @@ -1027,6 +1027,7 @@ Optional Features:
--enable-plugins enable the support for dynamic plugins --enable-plugins enable the support for dynamic plugins
--default-dynamic make plugins dynamic by default --default-dynamic make plugins dynamic by default
--disable-mt32emu don't enable the integrated MT-32 emulator --disable-mt32emu don't enable the integrated MT-32 emulator
--disable-lua don't enable Lua support
--disable-nuked-opl don't build Nuked OPL driver --disable-nuked-opl don't build Nuked OPL driver
--disable-16bit don't enable 16bit color support --disable-16bit don't enable 16bit color support
--disable-highres don't enable support for high resolution engines >320x240 --disable-highres don't enable support for high resolution engines >320x240
Expand Down Expand Up @@ -1255,6 +1256,8 @@ for ac_option in $@; do
--default-dynamic) _plugins_default=dynamic;; --default-dynamic) _plugins_default=dynamic;;
--enable-mt32emu) _mt32emu=yes ;; --enable-mt32emu) _mt32emu=yes ;;
--disable-mt32emu) _mt32emu=no ;; --disable-mt32emu) _mt32emu=no ;;
--enable-lua) _lua=yes ;;
--disable-lua) _lua=no ;;
--enable-nuked-opl) _nuked_opl=yes ;; --enable-nuked-opl) _nuked_opl=yes ;;
--disable-nuked-opl) _nuked_opl=no ;; --disable-nuked-opl) _nuked_opl=no ;;
--enable-translation) _translation=yes ;; --enable-translation) _translation=yes ;;
Expand Down Expand Up @@ -4107,6 +4110,11 @@ fi
# #
define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU' define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU'


#
# Check whether Lua support is requested
#
define_in_config_if_yes "$_lua" 'USE_LUA'

# #
# Check whether Nuked OPL emulator support is disabled # Check whether Nuked OPL emulator support is disabled
# #
Expand Down Expand Up @@ -5405,6 +5413,10 @@ if test "$_mt32emu" = yes ; then
echo_n ", MT-32 emulator" echo_n ", MT-32 emulator"
fi fi


if test "$_lua" = yes ; then
echo_n ", Lua"
fi

if test "$_nuked_opl" = yes ; then if test "$_nuked_opl" = yes ; then
echo_n ", Nuked OPL emulator" echo_n ", Nuked OPL emulator"
fi fi
Expand Down
1 change: 1 addition & 0 deletions devtools/create_project/create_project.cpp
Expand Up @@ -1074,6 +1074,7 @@ const Feature s_features[] = {
{ "16bit", "USE_RGB_COLOR", "", true, "16bit color support" }, { "16bit", "USE_RGB_COLOR", "", true, "16bit color support" },
{ "highres", "USE_HIGHRES", "", true, "high resolution" }, { "highres", "USE_HIGHRES", "", true, "high resolution" },
{ "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" }, { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" },
{ "lua", "USE_LUA", "", true, "lua" },
{ "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling. { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
{ "opengl", "USE_OPENGL", "", true, "OpenGL support" }, { "opengl", "USE_OPENGL", "", true, "OpenGL support" },
{ "opengles", "USE_GLES", "", true, "forced OpenGL ES mode" }, { "opengles", "USE_GLES", "", true, "forced OpenGL ES mode" },
Expand Down
2 changes: 1 addition & 1 deletion engines/sword25/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script # This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine sword25 "Broken Sword 2.5" yes "" "" "png zlib 16bit highres" add_engine sword25 "Broken Sword 2.5" yes "" "" "png zlib 16bit highres lua"
4 changes: 2 additions & 2 deletions engines/sword25/gfx/graphicengine.cpp
Expand Up @@ -50,8 +50,8 @@


#include "sword25/fmv/movieplayer.h" #include "sword25/fmv/movieplayer.h"


#include "sword25/util/lua/lua.h" #include "common/lua/lua.h"
#include "sword25/util/lua/lauxlib.h" #include "common/lua/lauxlib.h"
enum { enum {
BIT_DEPTH = 32, BIT_DEPTH = 32,
BACKBUFFER_COUNT = 1 BACKBUFFER_COUNT = 1
Expand Down
4 changes: 2 additions & 2 deletions engines/sword25/math/vertex.cpp
Expand Up @@ -31,8 +31,8 @@


#include "sword25/math/vertex.h" #include "sword25/math/vertex.h"


#include "sword25/util/lua/lua.h" #include "common/lua/lua.h"
#include "sword25/util/lua/lauxlib.h" #include "common/lua/lauxlib.h"


namespace Sword25 { namespace Sword25 {


Expand Down
34 changes: 1 addition & 33 deletions engines/sword25/module.mk
Expand Up @@ -53,39 +53,7 @@ MODULE_OBJS := \
script/luascript.o \ script/luascript.o \
script/lua_extensions.o \ script/lua_extensions.o \
sfx/soundengine.o \ sfx/soundengine.o \
sfx/soundengine_script.o \ sfx/soundengine_script.o
util/lua/lapi.o \
util/lua/lauxlib.o \
util/lua/lbaselib.o \
util/lua/lcode.o \
util/lua/ldblib.o \
util/lua/ldebug.o \
util/lua/ldo.o \
util/lua/lfunc.o \
util/lua/lgc.o \
util/lua/linit.o \
util/lua/liolib.o \
util/lua/llex.o \
util/lua/lmathlib.o \
util/lua/lmem.o \
util/lua/loadlib.o \
util/lua/lobject.o \
util/lua/lopcodes.o \
util/lua/loslib.o \
util/lua/lparser.o \
util/lua/lstate.o \
util/lua/lstring.o \
util/lua/lstrlib.o \
util/lua/ltable.o \
util/lua/ltablib.o \
util/lua/ltm.o \
util/lua/lvm.o \
util/lua/lzio.o \
util/lua/scummvm_file.o \
util/double_serialization.o \
util/lua_persistence_util.o \
util/lua_persist.o \
util/lua_unpersist.o


# This module can be built as a plugin # This module can be built as a plugin
ifeq ($(ENABLE_SWORD25), DYNAMIC_PLUGIN) ifeq ($(ENABLE_SWORD25), DYNAMIC_PLUGIN)
Expand Down
4 changes: 2 additions & 2 deletions engines/sword25/script/luabindhelper.h
Expand Up @@ -34,8 +34,8 @@


#include "sword25/kernel/common.h" #include "sword25/kernel/common.h"


#include "sword25/util/lua/lua.h" #include "common/lua/lua.h"
#include "sword25/util/lua/lauxlib.h" #include "common/lua/lauxlib.h"


namespace Sword25 { namespace Sword25 {


Expand Down
4 changes: 2 additions & 2 deletions engines/sword25/script/luacallback.cpp
Expand Up @@ -34,8 +34,8 @@
#include "sword25/script/luacallback.h" #include "sword25/script/luacallback.h"
#include "sword25/script/luabindhelper.h" #include "sword25/script/luabindhelper.h"


#include "sword25/util/lua/lua.h" #include "common/lua/lua.h"
#include "sword25/util/lua/lauxlib.h" #include "common/lua/lauxlib.h"


const char *CALLBACKTABLE_NAME = "__CALLBACKS"; const char *CALLBACKTABLE_NAME = "__CALLBACKS";


Expand Down
8 changes: 4 additions & 4 deletions engines/sword25/script/luascript.cpp
Expand Up @@ -40,10 +40,10 @@
#include "sword25/kernel/outputpersistenceblock.h" #include "sword25/kernel/outputpersistenceblock.h"
#include "sword25/kernel/inputpersistenceblock.h" #include "sword25/kernel/inputpersistenceblock.h"


#include "sword25/util/lua/lua.h" #include "common/lua/lua.h"
#include "sword25/util/lua/lualib.h" #include "common/lua/lualib.h"
#include "sword25/util/lua/lauxlib.h" #include "common/lua/lauxlib.h"
#include "sword25/util/lua_persistence.h" #include "common/lua/lua_persistence.h"


namespace Sword25 { namespace Sword25 {


Expand Down

0 comments on commit c1f029c

Please sign in to comment.