Remove duplicated stubs for the scriptengine from mape

objectmenu
Günther Brammer 2015-12-20 00:30:52 +01:00
parent 5a570b96f1
commit e790d2c327
6 changed files with 15 additions and 37 deletions

View File

@ -785,6 +785,7 @@ set(MAPE_BASE_SOURCES
src/lib/C4Rect.h
src/object/C4Id.cpp
src/object/C4Id.h
src/script/C4ScriptStandaloneStubs.cpp
)
set(MAPE_SOURCES

View File

@ -118,3 +118,5 @@ bool C4Def::Load(C4Group& hGroup, StdMeshSkeletonLoader& loader, DWORD dwLoadWha
return true;
}
C4DefList Definitions;

View File

@ -31,38 +31,16 @@
#include "C4TextureShape.h"
/* This file implements stubs for the parts of the engine that are not used
* by mape. It also instantiates global variables required by mape that are
* not instantiated elsewhere. In particular, we avoid C4Globals.cpp. */
* by mape. */
/* These are actually used by mape: */
#ifdef _DEBUG
C4Set<C4PropList *> C4PropList::PropLists;
#endif
C4Set<C4PropListNumbered *> C4PropListNumbered::PropLists;
C4Set<C4PropListScript *> C4PropListScript::PropLists;
std::vector<C4PropListNumbered *> C4PropListNumbered::ShelvedPropLists;
int32_t C4PropListNumbered::EnumerationIndex = 0;
C4StringTable Strings;
C4AulScriptEngine ScriptEngine;
C4DefList Definitions;
/* These are just stubs used by dead code: */
C4Landscape Landscape;
C4PXSSystem PXS;
C4Config Config;
C4GameObjects Objects;
C4Reloc Reloc;
class C4Draw *pDraw = NULL;
bool EraseItemSafe(const char *szFilename) {return false;}
void Smoke(int32_t tx, int32_t ty, int32_t level, DWORD dwClr) {}
class C4SoundInstance *StartSoundEffectAt(const char *, int32_t, int32_t, int32_t, int32_t, int32_t, class C4SoundModifier *) { return NULL; }
C4Config::C4Config() {}
C4Config::~C4Config() {}
const char* C4Config::AtTempPath(const char *) { return NULL; }
const char* C4Config::AtRelativePath(char const* s) {return s;}
bool C4Reloc::Open(C4Group&, char const*) const {return false;}
bool C4Draw::TextOut(const char *, CStdFont &, float, C4Surface *, float, float, DWORD, BYTE, bool) { return false; }
@ -101,8 +79,6 @@ C4IDListChunk::~C4IDListChunk() {}
C4DefGraphics::C4DefGraphics(C4Def*) {}
void C4DefGraphics::Clear() {}
void C4Def::IncludeDefinition(C4Def*) {}
void C4DefList::Draw(C4ID, C4Facet &, bool, int32_t) {}
void C4DefList::CallEveryDefinition() {}
void C4DefList::ResetIncludeDependencies() {}
@ -154,8 +130,6 @@ C4PXSSystem::C4PXSSystem() {}
C4PXSSystem::~C4PXSSystem() {}
bool C4PXSSystem::Create(int, C4Real, C4Real, C4Real, C4Real) { return false; }
void AddDbgRec(C4RecordChunkType, const void *, int) {}
bool C4TextureShape::Load(C4Group &group, const char *filename, int32_t base_tex_wdt, int32_t base_tex_hgt) { return true; }
#if 0
@ -195,8 +169,5 @@ C4Game::C4Game(): Parameters(GameParameters), Clients(Parameters.Clients), Teams
C4Game::~C4Game() {}
#endif
C4AulDebug *C4AulDebug::pDebug;
void C4AulDebug::DebugStep(C4AulBCC*, C4Value*) {}
C4Shader::C4Shader() {}
C4Shader::~C4Shader() {}

View File

@ -22,6 +22,14 @@
#include "gamescript/C4Script.h"
#include "script/C4Aul.h"
#include "script/C4ScriptHost.h"
#include <C4DefList.h>
/* StandaloneStubs.cpp is shared with mape, which has a real implementation of these */
C4Def* C4DefList::GetByName(const StdStrBuf &) {return NULL;}
C4Def * C4DefList::GetDef(int) {return 0;}
int C4DefList::GetDefCount() {return 0;}
void C4DefList::CallEveryDefinition() {}
void C4DefList::ResetIncludeDependencies() {}
void InitializeC4Script()
{

View File

@ -19,11 +19,11 @@
#include <C4AulDebug.h>
#include <C4Config.h>
#include <C4Def.h>
#include <C4DefList.h>
#include <C4PropList.h>
#include <C4Record.h>
#include <C4Reloc.h>
/* Parts of the ScriptEngine that are normally in C4Globals for initialization order reasons. */
#ifdef _DEBUG
C4Set<C4PropList *> C4PropList::PropLists;
#endif
@ -34,17 +34,12 @@ int32_t C4PropListNumbered::EnumerationIndex = 0;
C4StringTable Strings;
C4AulScriptEngine ScriptEngine;
/* Stubs */
C4Config Config;
C4Config::C4Config() {}
C4Config::~C4Config() {}
const char * C4Config::AtRelativePath(char const*s) {return s;}
C4Def* C4DefList::GetByName(const StdStrBuf &) {return NULL;}
C4Def * C4DefList::GetDef(int) {return 0;}
int C4DefList::GetDefCount() {return 0;}
void C4DefList::CallEveryDefinition() {}
void C4DefList::ResetIncludeDependencies() {}
C4AulDebug *C4AulDebug::pDebug;
void C4AulDebug::DebugStep(C4AulBCC*,C4Value*) {}

View File

@ -121,6 +121,7 @@ if (GTEST_FOUND AND GMOCK_FOUND)
aul/AulMathTest.cpp
aul/AulPredefinedFunctionTest.cpp
../src/script/C4ScriptStandaloneStubs.cpp
../src/script/C4ScriptStandalone.cpp
LIBRARIES
libmisc
libc4script)