refactor(application): 将SquirrelVM执行逻辑改为启动回调
修改Application::run方法,接收一个启动回调函数参数,将原本直接执行的SquirrelVM::run逻辑改为由调用方通过回调控制。同时更新相关文档说明这一变更。
This commit is contained in:
@@ -230,7 +230,11 @@ int main(int argc, char **argv) {
|
||||
// SDL_Log("File: %s", path.c_str());
|
||||
// }
|
||||
|
||||
app.run();
|
||||
app.run([]() {
|
||||
if (SquirrelVM::get().isInitialized()) {
|
||||
SquirrelVM::get().run();
|
||||
}
|
||||
});
|
||||
|
||||
SDL_Log("Application exited normally");
|
||||
app.shutdown();
|
||||
|
||||
Reference in New Issue
Block a user