1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

More documentation for the core class.

This commit is contained in:
Sandu Liviu Catalin 2015-11-08 07:20:31 +02:00
parent 3206d49404
commit c070c7acc8
2 changed files with 1089 additions and 300 deletions

View File

@ -39,7 +39,7 @@ Core::Core()
: m_State(SQMOD_SUCCESS) : m_State(SQMOD_SUCCESS)
, m_Options() , m_Options()
, m_VM(nullptr) , m_VM(nullptr)
, m_RootTable(nullptr) , m_RootTable()
, m_Scripts() , m_Scripts()
, m_ErrorMsg() , m_ErrorMsg()
, m_PlayerTrack() , m_PlayerTrack()
@ -384,7 +384,7 @@ bool Core::CreateVM()
{ {
DefaultVM::Set(m_VM); DefaultVM::Set(m_VM);
ErrorHandling::Enable(true); ErrorHandling::Enable(true);
m_RootTable.reset(new RootTable(m_VM)); m_RootTable = RootTable(m_VM);
m_Scripts.clear(); m_Scripts.clear();
} }
@ -429,7 +429,7 @@ void Core::DestroyVM()
// Release the references to the script objects // Release the references to the script objects
m_Scripts.clear(); m_Scripts.clear();
// Release the reference to the root table // Release the reference to the root table
m_RootTable.reset(); m_RootTable.Release();
// Assertions during close may cause double delete // Assertions during close may cause double delete
HSQUIRRELVM sq_vm = m_VM; HSQUIRRELVM sq_vm = m_VM;
// Explicitly set the virtual machine to null // Explicitly set the virtual machine to null
@ -947,6 +947,15 @@ Reference< CVehicle > Core::NewVehicle(SQInt32 model, SQInt32 world, SQFloat x,
return Reference< CVehicle >(); return Reference< CVehicle >();
} }
// ------------------------------------------------------------------------------------------------
void Core::OnVMClose()
{
// Call base classes manually
_Cmd->VMClose();
// Froward to instances
VMClose.Emit();
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void Core::OnBlipCreated(SQInt32 blip, SQInt32 header, SqObj & payload) void Core::OnBlipCreated(SQInt32 blip, SQInt32 header, SqObj & payload)
{ {
@ -1598,21 +1607,6 @@ void Core::OnScriptReload(SQInt32 header, SqObj & payload)
ScriptReload.Emit(header, payload); ScriptReload.Emit(header, payload);
} }
// ------------------------------------------------------------------------------------------------
void Core::OnLogMessage(SQInt32 type, const SQChar * message)
{
LogMessage.Emit(type, message);
}
// ------------------------------------------------------------------------------------------------
void Core::OnVMClose()
{
// Call base classes manually
_Cmd->VMClose();
// Froward to instances
VMClose.Emit();
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void Core::OnPlayerUpdate(SQInt32 player, SQInt32 type) void Core::OnPlayerUpdate(SQInt32 player, SQInt32 type)
{ {

File diff suppressed because it is too large Load Diff