Refactor yaze.cc for improved code organization and readability

This commit is contained in:
scawful
2024-08-30 20:29:51 -04:00
parent d7849c2098
commit 3d214fe663

View File

@@ -38,7 +38,7 @@ int main(int argc, char** argv) {
#ifdef __APPLE__ #ifdef __APPLE__
InitializeCocoa(); InitializeCocoa();
#endif #endif
try {
while (controller.IsActive()) { while (controller.IsActive()) {
controller.OnInput(); controller.OnInput();
if (auto status = controller.OnLoad(); !status.ok()) { if (auto status = controller.OnLoad(); !status.ok()) {
@@ -48,15 +48,6 @@ int main(int argc, char** argv) {
controller.DoRender(); controller.DoRender();
} }
controller.OnExit(); controller.OnExit();
} catch (const std::bad_alloc& e) {
std::cerr << "Memory allocation failed: " << e.what() << std::endl;
return EXIT_FAILURE;
} catch (const std::exception& e) {
std::cerr << "Exception: " << e.what() << std::endl;
return EXIT_FAILURE;
} catch (...) {
std::cerr << "Unknown exception" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }