2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 07:37:02 +00:00

added AngelScript; work on extractor

This commit is contained in:
Jack Andersen
2015-07-15 16:03:38 -10:00
parent 58fe87b13d
commit 4252bd6e39
15 changed files with 227 additions and 33 deletions

View File

@@ -0,0 +1,21 @@
#include "HECL/Database.hpp"
namespace HECL
{
namespace Database
{
/* Centralized AngelScript engine */
AngelScript::asIScriptEngine* asENGINE = nullptr;
static bool InitEntered = false;
void InitASEngine()
{
if (InitEntered)
return;
InitEntered = true;
assert(asENGINE = AngelScript::asCreateScriptEngine(ANGELSCRIPT_VERSION));
}
}
}

View File

@@ -0,0 +1,24 @@
#include "HECL/Database.hpp"
namespace HECL
{
namespace Database
{
static std::string StringFactory(unsigned int byteLength, const char *s)
{
return std::string(s, byteLength);
}
ASStringType asSTRINGTYPE;
ASStringType::ASStringType() : ASType<std::string>("", "string")
{
assert(asENGINE->RegisterStringFactory("string",
AngelScript::asFUNCTION(StringFactory),
AngelScript::asCALL_CDECL) >= 0);
}
}
}

View File

@@ -1,3 +1,7 @@
add_library(HECLDatabaseInit
Registry.cpp
ASInit.cpp)
add_library(HECLDatabase
Project.cpp
Registry.cpp)
ASEngine.cpp
Project.cpp)