[nostalgia] Split part of Core out into Foundation, add module system
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
/*
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ox/logconn/logconn.hpp>
|
||||
|
||||
#include <nostalgia/core/core.hpp>
|
||||
#include <nostalgia/foundation/media.hpp>
|
||||
|
||||
#include <nostalgia/appmodules/appmodules.hpp>
|
||||
|
||||
#include "app.hpp"
|
||||
|
||||
static ox::Error run(int argc, const char **argv) noexcept {
|
||||
ox::trace::init();
|
||||
nostalgia::loadModules();
|
||||
if (argc < 2) {
|
||||
oxErr("Please provide path to project directory or OxFS file.\n");
|
||||
return OxError(1);
|
||||
}
|
||||
const auto path = argv[1];
|
||||
oxRequireM(fs, nostalgia::foundation::loadRomFs(path));
|
||||
return run(std::move(fs));
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) {
|
||||
#ifdef DEBUG
|
||||
ox::LoggerConn loggerConn;
|
||||
const auto loggerErr = loggerConn.initConn("Nostalgia Player");
|
||||
@@ -19,16 +33,6 @@ static ox::Error run(int argc, const char **argv) noexcept {
|
||||
ox::trace::setLogger(&loggerConn);
|
||||
}
|
||||
#endif
|
||||
if (argc < 2) {
|
||||
oxErr("Please provide path to project directory or OxFS file.\n");
|
||||
return OxError(1);
|
||||
}
|
||||
const auto path = argv[1];
|
||||
oxRequireM(fs, nostalgia::core::loadRomFs(path));
|
||||
return run(std::move(fs));
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) {
|
||||
const auto err = run(argc, argv);
|
||||
oxAssert(err, "Something went wrong...");
|
||||
return static_cast<int>(err);
|
||||
|
||||
Reference in New Issue
Block a user