forked from Mirrors/openclonk
Remove now unnecessary stubs from C4ScriptStandaloneStubs
parent
6b6dd96719
commit
5a570b96f1
|
@ -42,9 +42,9 @@ bool C4ScriptHost::ResolveAppends(C4DefList *rDefs)
|
|||
if (State != ASS_PREPARSED) return false;
|
||||
for (std::list<StdCopyStrBuf>::iterator a = Appends.begin(); a != Appends.end(); ++a)
|
||||
{
|
||||
if (*a != "*")
|
||||
if (*a != "*" || !rDefs)
|
||||
{
|
||||
C4Def *Def = rDefs->GetByName(*a);
|
||||
C4Def *Def = rDefs ? rDefs->GetByName(*a) : NULL;
|
||||
if (Def)
|
||||
{
|
||||
if (std::find(Def->Script.SourceScripts.begin(), Def->Script.SourceScripts.end(), GetScriptHost()) == Def->Script.SourceScripts.end())
|
||||
|
@ -93,7 +93,7 @@ bool C4ScriptHost::ResolveIncludes(C4DefList *rDefs)
|
|||
// append all includes to local script
|
||||
for (std::list<StdCopyStrBuf>::reverse_iterator i = Includes.rbegin(); i != Includes.rend(); ++i)
|
||||
{
|
||||
C4Def *Def = rDefs->GetByName(*i);
|
||||
C4Def *Def = rDefs ? rDefs->GetByName(*i) : NULL;
|
||||
if (Def)
|
||||
{
|
||||
// resolve #includes in included script first (#include-chains :( )
|
||||
|
@ -180,7 +180,8 @@ void C4AulScriptEngine::Link(C4DefList *rDefs)
|
|||
// engine is always parsed (for global funcs)
|
||||
State = ASS_PARSED;
|
||||
|
||||
rDefs->CallEveryDefinition();
|
||||
if (rDefs)
|
||||
rDefs->CallEveryDefinition();
|
||||
|
||||
// Done modifying the proplists now
|
||||
for (C4AulScript *s = Child0; s; s = s->Next)
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "c4group/C4Group.h"
|
||||
#include "gamescript/C4Script.h"
|
||||
#include "script/C4Aul.h"
|
||||
#include "object/C4DefList.h"
|
||||
#include "script/C4ScriptHost.h"
|
||||
|
||||
void InitializeC4Script()
|
||||
|
@ -35,7 +34,7 @@ void InitializeC4Script()
|
|||
C4Value RunLoadedC4Script()
|
||||
{
|
||||
// Link script engine (resolve includes/appends, generate code)
|
||||
ScriptEngine.Link(&::Definitions);
|
||||
ScriptEngine.Link(NULL);
|
||||
|
||||
// Set name list for globals
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
|
|
|
@ -15,17 +15,14 @@
|
|||
|
||||
#include <C4Include.h>
|
||||
|
||||
#include <C4Config.h>
|
||||
#include <C4DefList.h>
|
||||
#include <C4GameObjects.h>
|
||||
#include <C4MapScript.h>
|
||||
#include <C4Material.h>
|
||||
#include <C4Reloc.h>
|
||||
#include <C4Aul.h>
|
||||
#include <C4AulDebug.h>
|
||||
#include <C4ScriptHost.h>
|
||||
#include <C4Config.h>
|
||||
#include <C4Def.h>
|
||||
#include <C4Log.h>
|
||||
#include <C4DefList.h>
|
||||
#include <C4PropList.h>
|
||||
#include <C4Record.h>
|
||||
#include <C4Reloc.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
C4Set<C4PropList *> C4PropList::PropLists;
|
||||
|
@ -42,65 +39,18 @@ C4Config::C4Config() {}
|
|||
C4Config::~C4Config() {}
|
||||
const char * C4Config::AtRelativePath(char const*s) {return s;}
|
||||
|
||||
C4DefList Definitions;
|
||||
C4DefList::C4DefList() {}
|
||||
C4DefList::~C4DefList() {}
|
||||
C4Def* C4DefList::GetByName(const StdStrBuf &) {return NULL;}
|
||||
C4Def * C4DefList::GetDef(int) {return 0;}
|
||||
int C4DefList::GetDefCount() {return 0;}
|
||||
void C4DefList::CallEveryDefinition() {}
|
||||
void C4DefList::ResetIncludeDependencies() {}
|
||||
bool C4DefList::DrawFontImage(const char* szImageTag, C4Facet& rTarget, C4DrawTransform* pTransform) { return false; }
|
||||
float C4DefList::GetFontImageAspect(const char* szImageTag) { return -1.0f; }
|
||||
|
||||
C4MaterialMap MaterialMap;
|
||||
C4MaterialMap::C4MaterialMap() {}
|
||||
C4MaterialMap::~C4MaterialMap() {}
|
||||
void C4MaterialMap::UpdateScriptPointers() {}
|
||||
|
||||
C4AulDebug *C4AulDebug::pDebug;
|
||||
void C4AulDebug::DebugStep(C4AulBCC*,C4Value*) {}
|
||||
|
||||
C4GameObjects Objects;
|
||||
C4GameObjects::C4GameObjects() {}
|
||||
C4GameObjects::~C4GameObjects() {}
|
||||
void C4GameObjects::UpdateScriptPointers() {}
|
||||
void C4GameObjects::Clear(bool) {}
|
||||
void C4GameObjects::Default() {}
|
||||
bool C4GameObjects::Remove(C4Object*) {return 0;}
|
||||
bool C4GameObjects::AssignInfo() {return 0;}
|
||||
bool C4GameObjects::ValidateOwners() {return 0;}
|
||||
C4Value C4GameObjects::GRBroadcast(char const*, C4AulParSet*, bool, bool) {return C4Value();}
|
||||
|
||||
C4ObjectList::C4ObjectList() {}
|
||||
C4ObjectList::~C4ObjectList() {}
|
||||
void C4ObjectList::Default() {}
|
||||
void C4ObjectList::Clear() {}
|
||||
void C4ObjectList::InsertLinkBefore(C4ObjectLink*, C4ObjectLink*) {}
|
||||
void C4ObjectList::InsertLink(C4ObjectLink*, C4ObjectLink*) {}
|
||||
void C4ObjectList::RemoveLink(C4ObjectLink*) {}
|
||||
bool C4ObjectList::Add(C4Object*, C4ObjectList::SortType, C4ObjectList*) {return 0;}
|
||||
bool C4ObjectList::Remove(C4Object*) {return 0;}
|
||||
bool C4ObjectList::AssignInfo() {return 0;}
|
||||
bool C4ObjectList::ValidateOwners() {return 0;}
|
||||
|
||||
void C4NotifyingObjectList::InsertLinkBefore(C4ObjectLink *pLink, C4ObjectLink *pBefore) {}
|
||||
void C4NotifyingObjectList::InsertLink(C4ObjectLink*, C4ObjectLink*) {}
|
||||
void C4NotifyingObjectList::RemoveLink(C4ObjectLink*) {}
|
||||
|
||||
C4Reloc Reloc;
|
||||
bool C4Reloc::Open(C4Group&, char const*) const { return false; }
|
||||
|
||||
void C4LSector::Clear() {}
|
||||
void C4Def::IncludeDefinition(C4Def*) {}
|
||||
bool EraseItemSafe(const char *szFilename) {return false;}
|
||||
void AddDbgRec(C4RecordChunkType, const void *, int) {}
|
||||
|
||||
C4MapScriptHost MapScript;
|
||||
C4MapScriptHost::C4MapScriptHost() {}
|
||||
C4MapScriptHost::~C4MapScriptHost() {}
|
||||
void C4MapScriptHost::Clear() {}
|
||||
C4PropListStatic *C4MapScriptHost::GetPropList() {return NULL;}
|
||||
bool C4MapScriptHost::Load(C4Group &, const char *, const char *, C4LangStringTable *) { return false; }
|
||||
bool C4MapScriptHost::LoadData(const char *, const char *, C4LangStringTable *) { return false; }
|
||||
void C4MapScriptHost::AddEngineFunctions() {}
|
||||
|
|
|
@ -57,7 +57,7 @@ C4Value AulTest::RunCode(const char *code, bool wrap)
|
|||
src += ">";
|
||||
|
||||
GameScript.LoadData(src.c_str(), wrapped.c_str(), NULL);
|
||||
ScriptEngine.Link(&::Definitions);
|
||||
ScriptEngine.Link(NULL);
|
||||
ScriptEngine.GlobalNamed.SetNameList(&ScriptEngine.GlobalNamedNames);
|
||||
|
||||
return GameScript.Call("Main", nullptr, true);
|
||||
|
|
Loading…
Reference in New Issue