fix: alot of stuff changed. Mostly bugfixxes / architechture changes
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <SDL.h>
|
||||
|
||||
#include "Lightkeeper.h"
|
||||
@@ -9,8 +11,13 @@ int main(int argc, char* argv[]) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", SDL_GetError(), nullptr);
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
std::filesystem::path exeDir = SDL_GetBasePath();
|
||||
try {
|
||||
char* basePath = SDL_GetBasePath();
|
||||
if (basePath == nullptr) {
|
||||
throw std::runtime_error(std::string{"SDL_GetBasePath failed: "} + SDL_GetError());
|
||||
}
|
||||
const std::filesystem::path exeDir = basePath;
|
||||
SDL_free(basePath);
|
||||
|
||||
spdlog::set_level(spdlog::level::debug);
|
||||
|
||||
@@ -24,6 +31,10 @@ int main(int argc, char* argv[]) {
|
||||
});
|
||||
app.run();
|
||||
app.cleanup();
|
||||
} catch (const std::exception& exception) {
|
||||
spdlog::critical("Lightkeeper terminated with an error: {}", exception.what());
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_Quit();
|
||||
|
||||
Reference in New Issue
Block a user