mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
GRIM/EMI: Move lua creation into each engine class
This commit is contained in:
parent
1593fefb45
commit
2fe6e3f2a6
@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include "engines/grim/emi/emi.h"
|
||||
#include "engines/grim/emi/lua_v2.h"
|
||||
|
||||
|
||||
namespace Grim {
|
||||
@ -38,6 +39,10 @@ EMIEngine::~EMIEngine() {
|
||||
g_emi = NULL;
|
||||
}
|
||||
|
||||
LuaBase *EMIEngine::createLua() {
|
||||
return new Lua_V2();
|
||||
}
|
||||
|
||||
void EMIEngine::pushText(Common::List<TextObject *> *objects) {
|
||||
_textstack.push_back(objects);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
Common::List<TextObject *> *popText();
|
||||
|
||||
private:
|
||||
LuaBase *createLua();
|
||||
Common::List<Common::List<TextObject *> *> _textstack;
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/lua.h"
|
||||
#include "engines/grim/lua_v1.h"
|
||||
#include "engines/grim/emi/lua_v2.h"
|
||||
#include "engines/grim/emi/poolsound.h"
|
||||
#include "engines/grim/actor.h"
|
||||
#include "engines/grim/movie/movie.h"
|
||||
@ -200,6 +199,10 @@ void GrimEngine::clearPools() {
|
||||
_currSet = NULL;
|
||||
}
|
||||
|
||||
LuaBase *GrimEngine::createLua() {
|
||||
return new Lua_V1();
|
||||
}
|
||||
|
||||
void GrimEngine::createRenderer() {
|
||||
#ifdef USE_OPENGL
|
||||
_softRenderer = g_registry->getBool("soft_renderer");
|
||||
@ -288,12 +291,7 @@ Common::Error GrimEngine::run() {
|
||||
if (_softRenderer)
|
||||
g_driver->flipBuffer();
|
||||
|
||||
LuaBase *lua = NULL;
|
||||
if (getGameType() == GType_GRIM) {
|
||||
lua = new Lua_V1();
|
||||
} else {
|
||||
lua = new Lua_V2();
|
||||
}
|
||||
LuaBase *lua = createLua();
|
||||
|
||||
lua->registerOpcodes();
|
||||
lua->registerLua();
|
||||
|
@ -46,6 +46,7 @@ class Set;
|
||||
class TextObject;
|
||||
class PrimitiveObject;
|
||||
class Debugger;
|
||||
class LuaBase;
|
||||
|
||||
enum GrimGameType {
|
||||
GType_GRIM,
|
||||
@ -198,6 +199,7 @@ private:
|
||||
void buildActiveActorsList();
|
||||
void savegameCallback();
|
||||
void createRenderer();
|
||||
virtual LuaBase *createLua();
|
||||
|
||||
void savegameSave();
|
||||
void saveGRIM();
|
||||
|
Loading…
x
Reference in New Issue
Block a user