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

Function RegisterResourceTypeScript

engine/gameobject/src/gameobject/res_script.cpp:135–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 static ResourceResult RegisterResourceTypeScript(HResourceTypeContext ctx, HResourceType type)
136 {
137 // The engine.cpp creates the contexts for some of our our built in types (i.e. same context for some types)
138 void* context = ResourceTypeContextGetContextByHash(ctx, ResourceTypeGetNameHash(type));
139 assert(context);
140 return (ResourceResult)dmResource::SetupType(ctx,
141 type,
142 context,
143 ResScriptPreload,
144 ResScriptCreate,
145 0,
146 ResScriptDestroy,
147 ResScriptRecreate);
148 }
149}
150
151DM_DECLARE_RESOURCE_TYPE(ResourceTypeScript, "scriptc", dmGameObject::RegisterResourceTypeScript, 0);

Callers

nothing calls this directly

Calls 4

ResourceTypeGetNameHashFunction · 0.85
SetupTypeFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected