[nostalgia] Split part of Core out into Foundation, add module system
This commit is contained in:
@@ -22,8 +22,7 @@ endif()
|
||||
|
||||
target_link_libraries(
|
||||
nostalgia
|
||||
NostalgiaWorld
|
||||
NostalgiaCore
|
||||
NostalgiaAppModules
|
||||
OxLogConn
|
||||
)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include <nostalgia/core/core.hpp>
|
||||
#include <nostalgia/foundation/media.hpp>
|
||||
|
||||
using namespace nostalgia;
|
||||
|
||||
@@ -33,6 +34,7 @@ static int updateHandler(core::Context *ctx) noexcept {
|
||||
}
|
||||
spriteX += xmod;
|
||||
spriteY += ymod;
|
||||
//constexpr ox::StringView sprites = "nostalgia";
|
||||
for (unsigned i = 0; i < sprites.len(); ++i) {
|
||||
const auto c = static_cast<unsigned>(sprites[i] - ('a' - 1));
|
||||
core::setSprite(ctx, i, spriteX + 8 * (static_cast<int>(i) + 1), spriteY, c, 0, 0, 0);
|
||||
|
||||
@@ -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