-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreLuaScript.cpp
More file actions
41 lines (33 loc) · 1.08 KB
/
CoreLuaScript.cpp
File metadata and controls
41 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2006-13 HumaNature Studios Inc.
#include "CorePch.h"
#include "CoreLuaScript.h"
#include "NewStateMachine/stmAndLua.h"
namespace core {
CoreLuaScript::CoreLuaScript(lua_State* preAllocatedState /* = nullptr */)
: LuaScript(preAllocatedState)
{
if (!mWasPreAllocated)
{
// Register this lua state for use in the SLED debugger
stmAndLua::GetInstance().RegisterLuaState(L);
}
}
CoreLuaScript::~CoreLuaScript()
{
if(L && !mWasPreAllocated)
{
// un-register this lua state with SLED debugger
stmAndLua::GetInstance().UnregisterLuaState(L);
}
}
bool CoreLuaScript::executeScriptString(const char *script, const char *scriptPath /* = NULL */)
{
PROFILE_ZONE_DESC("LuaScript::loadScript::executeScript");
return LuaScript::executeScriptString(script, scriptPath);
}
bool CoreLuaScript::parseProperties()
{
PROFILE_ZONE_DESC("LuaScript::loadScript::parseProperties");
return LuaScript::parseProperties();
}
}