something something

This commit is contained in:
2026-01-09 11:57:24 +05:00
parent 175fe61e5c
commit 346779060e
5 changed files with 34 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ void Engine::stopLoop(){
void Engine::handleModuleError(IEngineModule& module, const char* type, const char* method, const char* error){
std::string error_message = ougge_format(
"Catched %s at %s.%s(): %s",
type, module.getName(), method, error);
type, module.getName().c_str(), method, error);
std::cerr<<error_message<<std::endl;
error_messages.push_back(error_message);
}

View File

@@ -26,22 +26,27 @@ void MonoGameObjectSystem::registerNativeCallbacks(){
auto createGameObject_callback = static_cast<void(*)(u64*, u32*)> (
[](u64* id_out, u32* index_out) -> void {
std::cout<<"createGameObject_callback"<<std::endl;
this_static->createGameObjectInPool(id_out, index_out);
}
);
mono_add_internal_call("createGameObject", (void*)createGameObject_callback);
mono_add_internal_call("Ougge.NativeFunctions::createGameObject", (void*)createGameObject_callback);
auto freeGameObject_callback = static_cast<bool(*)(u32)>(
[](u32 index) -> bool {
std::cout<<"freeGameObject_callback"<<std::endl;
return this_static->gameObjectPool.erase(index);
}
);
mono_add_internal_call("freeGameObject", (void*)freeGameObject_callback);
mono_add_internal_call("Ougge.NativeFunctions::freeGameObject", (void*)freeGameObject_callback);
}
void MonoGameObjectSystem::beginFrame(){
for(auto pair : gameObjectPool){
gameObjectInvokeUpdate(pair.second.getObjectHandle().getObject(), engine.deltaTime);
auto obj = pair.second.getObjectHandle().getObject();
std::cout<<"updating obj: "<<obj<<std::endl;
gameObjectInvokeUpdate(obj, engine.deltaTime);
}
}