MCPcopy Create free account
hub / github.com/Siv3D/OpenSiv3D / init

Method init

Siv3D/src/Siv3D/Script/CScript.cpp:62–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 void CScript::init()
63 {
64 if (m_initialized)
65 {
66 return;
67 }
68
69 LOG_SCOPED_TRACE(U"CScript::init()");
70
71 if (m_engine = AngelScript::asCreateScriptEngine(ANGELSCRIPT_VERSION);
72 (not m_engine))
73 {
74 throw EngineError{ U"asCreateScriptEngine() failed" };
75 }
76
77 if (m_engine->SetMessageCallback(asFUNCTION(detail::MessageCallback), &m_messages, AngelScript::asCALL_CDECL) < 0)
78 {
79 throw EngineError{ U"SetMessageCallback() failed" };
80 }
81 m_engine->SetEngineProperty(AngelScript::asEP_REQUIRE_ENUM_SCOPE, 1);
82 m_engine->SetEngineProperty(AngelScript::asEP_USE_CHARACTER_LITERALS, 1);
83 m_engine->SetEngineProperty(AngelScript::asEP_DISALLOW_EMPTY_LIST_ELEMENTS, 1);
84 m_engine->SetEngineProperty(AngelScript::asEP_ALLOW_UNSAFE_REFERENCES, 1);
85
86 {
87 AngelScript::RegisterScriptArray(m_engine);
88 AngelScript::RegisterScriptGrid(m_engine);
89 RegisterTypes(m_engine);
90 RegisterYesNo(m_engine);
91 RegisterNamedParameter(m_engine);
92 RegisterUtility(m_engine);
93 RegisterChar(m_engine);
94 AngelScript::RegisterStdString(m_engine);
95 RegisterNone_t(m_engine);
96 RegisterOptional(m_engine);
97 RegisterNumber(m_engine);
98 RegisterFloatingPoint(m_engine);
99 RegisterParse(m_engine);
100
101 RegisterDuration(m_engine);
102 RegisterDate(m_engine);
103 RegisterDateTime(m_engine);
104 RegisterTime(m_engine);
105 RegisterStopwatch(m_engine);
106 RegisterVariableSpeedStopwatch(m_engine);
107 RegisterTimer(m_engine);
108 RegisterProfiler(m_engine);
109 RegisterMillisecClock(m_engine);
110 RegisterMicrosecClock(m_engine);
111 RegisterRDTSCClock(m_engine);
112
113 RegisterTextEncoding(m_engine);
114 RegisterOpenMode(m_engine);
115 RegisterTextReader(m_engine);
116 RegisterTextWriter(m_engine);
117 RegisterINI(m_engine);
118
119 RegisterSpecialFolder(m_engine);

Callers 7

ScriptMethod · 0.45
SaveFunction · 0.45
LoadFunction · 0.45
GetFunction · 0.45
PostFunction · 0.45
GetAsyncFunction · 0.45
PostAsyncFunction · 0.45

Calls 15

RegisterScriptArrayFunction · 0.85
RegisterScriptGridFunction · 0.85
RegisterYesNoFunction · 0.85
RegisterNamedParameterFunction · 0.85
RegisterUtilityFunction · 0.85
RegisterCharFunction · 0.85
RegisterStdStringFunction · 0.85
RegisterNone_tFunction · 0.85
RegisterOptionalFunction · 0.85
RegisterNumberFunction · 0.85
RegisterFloatingPointFunction · 0.85
RegisterParseFunction · 0.85

Tested by

no test coverage detected