Atlas-Launcher/source/script/module/debug/_load.cpp

27 lines
644 B
C++

#include "_load.hpp"
#include <cassert>
#include <stdexcept>
#include <string>
#include "log.hpp"
namespace atlas::script::module::debug {
void load(const engine::Engine* atlasEngine) {
asIScriptEngine* asEngine = atlasEngine->getAsEngine();
int error;
// start namespace
error = asEngine->SetDefaultNamespace("atlas::debug"); assert(error >= 0);
// functions
error = asEngine->RegisterGlobalFunction("void log(const string &in category, const string &in message)", asFUNCTION(log), asCALL_CDECL); assert(error >= 0);
// end namespace
error = asEngine->SetDefaultNamespace(""); assert(error >= 0);
}
}