MCPcopy Create free account
hub / github.com/defold/defold / AppInitialize

Function AppInitialize

engine/extension/src/extension.cpp:212–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 }
211
212 Result AppInitialize(AppParams* params)
213 {
214 const ExtensionDesc* ed = dmExtension::GetFirstExtension();
215 Result ret = RESULT_OK;
216 while (ed) {
217 if (ed->m_AppInitialize) {
218 g_CurrentExtension = ed;
219 ExtensionResult r = ed->m_AppInitialize(params);
220 if (r != EXTENSION_RESULT_OK) {
221 dmLogError("Failed to initialize (app-level) extension: %s", ed->m_Name);
222 ret = (dmExtension::Result)r;
223 break;
224 } else {
225 ((ExtensionDesc*)ed)->m_AppInitialized = true;
226 }
227 }
228 ed = dmExtension::GetNextExtension(ed);
229 }
230
231 g_CurrentExtension = 0x0;
232
233 if (ret != RESULT_OK) {
234 ed = dmExtension::GetFirstExtension();
235 uint32_t i = 0;
236 uint32_t n = i;
237 while (ed && i < n) {
238 if (ed->m_AppFinalize) {
239 ExtensionResult r = ed->m_AppFinalize(params);
240 if (r != EXTENSION_RESULT_OK) {
241 dmLogError("Failed to initialize (app-level) extension: %s", ed->m_Name);
242 }
243 }
244 ++i;
245 ed = dmExtension::GetNextExtension(ed);
246 }
247 }
248
249 return ret;
250 }
251
252 void PreRender(Params* params)
253 {

Callers 9

SetUpMethod · 0.85
SetUpMethod · 0.85
SetUpMethod · 0.85
engine.cppFile · 0.85
SetUpMethod · 0.85
TESTFunction · 0.85
SetUpMethod · 0.85
SetUpMethod · 0.85
TESTFunction · 0.85

Calls 2

GetNextExtensionFunction · 0.85
GetFirstExtensionFunction · 0.70

Tested by 8

SetUpMethod · 0.68
SetUpMethod · 0.68
SetUpMethod · 0.68
SetUpMethod · 0.68
TESTFunction · 0.68
SetUpMethod · 0.68
SetUpMethod · 0.68
TESTFunction · 0.68