[nostalgia/core] Rename customData functions in Context and move them out of Context
This commit is contained in:
@@ -23,7 +23,7 @@ class StudioUIDrawer: public core::Drawer {
|
||||
};
|
||||
|
||||
static int eventHandler(core::Context *ctx) noexcept {
|
||||
auto ui = ctx->customData<StudioUI>();
|
||||
auto ui = core::applicationData<StudioUI>(ctx);
|
||||
ui->update();
|
||||
return 16;
|
||||
}
|
||||
@@ -32,9 +32,9 @@ static ox::Error run(ox::UniquePtr<ox::FileSystem> fs) noexcept {
|
||||
oxRequireM(ctx, core::init(std::move(fs), "NostalgiaStudio"));
|
||||
core::setWindowTitle(ctx.get(), "Nostalgia Studio");
|
||||
core::setEventHandler(ctx.get(), eventHandler);
|
||||
auto ui = ox::make_unique<StudioUI>(ctx.get());
|
||||
StudioUIDrawer drawer(ui.get());
|
||||
ctx->setCustomData(ui.get());
|
||||
StudioUI ui(ctx.get());
|
||||
StudioUIDrawer drawer(&ui);
|
||||
core::setApplicationData(ctx.get(), &ui);
|
||||
ctx->drawers.emplace_back(&drawer);
|
||||
return core::run(ctx.get());
|
||||
}
|
||||
|
Reference in New Issue
Block a user