Compare commits

...

2 Commits

Author SHA1 Message Date
e0ec9e0c5f [nostalgia,olympic] Move olympic::run to global namespace
All checks were successful
Build / build (push) Successful in 2m34s
2024-12-06 00:13:10 -06:00
9a42a9b9d9 [nfde] Fix Windows warnings 2024-12-06 00:12:38 -06:00
5 changed files with 9 additions and 19 deletions

View File

@ -201,7 +201,7 @@ nfdresult_t SetDefaultExtension(::IFileDialog* fileOpenDialog,
}
if (*p_spec) {
// multiple file extensions for this type (need to allocate memory)
size_t numChars = p_spec - filterList[0].spec;
size_t numChars = static_cast<size_t>(p_spec - filterList[0].spec);
// allocate one more char space for the '\0'
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) * (numChars + 1));
if (!extnBuf) {
@ -710,7 +710,7 @@ nfdresult_t CopyCharToWChar(const nfdu8char_t* inStr, nfdnchar_t*& outStr) {
int charsNeeded = MultiByteToWideChar(CP_UTF8, 0, inStr, -1, nullptr, 0);
assert(charsNeeded);
nfdnchar_t* tmp_outStr = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) * charsNeeded);
nfdnchar_t* tmp_outStr = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) * static_cast<size_t>(charsNeeded));
if (!tmp_outStr) {
return NFD_ERROR;
}
@ -727,7 +727,7 @@ nfdresult_t CopyWCharToNFDChar(const nfdnchar_t* inStr, nfdu8char_t*& outStr) {
int bytesNeeded = WideCharToMultiByte(CP_UTF8, 0, inStr, -1, nullptr, 0, nullptr, nullptr);
assert(bytesNeeded);
nfdu8char_t* tmp_outStr = NFDi_Malloc<nfdu8char_t>(sizeof(nfdu8char_t) * bytesNeeded);
nfdu8char_t* tmp_outStr = NFDi_Malloc<nfdu8char_t>(sizeof(nfdu8char_t) * static_cast<size_t>(bytesNeeded));
if (!tmp_outStr) {
return NFD_ERROR;
}

View File

@ -157,8 +157,6 @@ static ox::Error runScene(turbine::Context &tctx) {
return turbine::run(tctx);
}
namespace olympic {
ox::Error run(
[[maybe_unused]] ox::StringView project,
[[maybe_unused]] ox::StringView appName,
@ -172,5 +170,3 @@ ox::Error run(
oxRequireM(tctx, turbine::init(std::move(fs), project));
return runTileSheetSetTest(*tctx);
}
}

View File

@ -17,6 +17,10 @@
#define OLYMPIC_APP_VERSION "dev build"
#endif
#ifndef OLYMPIC_GUI_APP
#define OLYMPIC_GUI_APP 0
#endif
#ifndef OLYMPIC_PROJECT_NAMESPACE
#define OLYMPIC_PROJECT_NAMESPACE project
#endif
@ -34,8 +38,8 @@
#endif
namespace olympic {
ox::String appVersion = ox::String(OLYMPIC_APP_VERSION);
}
ox::Error run(
ox::StringView project,
@ -43,8 +47,6 @@ ox::Error run(
ox::StringView projectDataDir,
ox::SpanView<char const*> argv) noexcept;
}
namespace OLYMPIC_PROJECT_NAMESPACE {
void registerKeelModules() noexcept;
void registerStudioModules() noexcept;
@ -64,7 +66,7 @@ int main(int argc, char const**argv) {
#if OLYMPIC_LOAD_STUDIO_MODULES
OLYMPIC_PROJECT_NAMESPACE::registerStudioModules();
#endif
auto const err = olympic::run(
auto const err = run(
OLYMPIC_PROJECT_NAME,
OLYMPIC_APP_NAME,
OLYMPIC_PROJECT_DATADIR,

View File

@ -97,8 +97,6 @@ static ox::Error run(ox::SpanView<char const*> argv, ox::StringView projectDataD
return pack(argSrc, argRomBin, argManifest, projectDataDir);
}
namespace olympic {
ox::Error run(
[[maybe_unused]] ox::StringView project,
[[maybe_unused]] ox::StringView appName,
@ -106,5 +104,3 @@ ox::Error run(
ox::SpanView<char const*> argv) noexcept {
return ::run(argv, projectDataDir);
}
}

View File

@ -67,8 +67,6 @@ static ox::Error run(
}
namespace olympic {
ox::Error run(
ox::StringView project,
ox::StringView appName,
@ -76,5 +74,3 @@ ox::Error run(
ox::SpanView<char const*> args) noexcept {
return studio::run(ox::sfmt("{} {}", project, appName), projectDataDir, args);
}
}