OnScreenDisplay: Make CallbackType an enum class
This commit is contained in:
parent
066af14272
commit
edda018d54
|
@ -609,8 +609,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
|||
}
|
||||
|
||||
// Install our callbacks
|
||||
OSD::AddCallback(OSD::OSD_INIT, ButtonManager::Init);
|
||||
OSD::AddCallback(OSD::OSD_SHUTDOWN, ButtonManager::Shutdown);
|
||||
OSD::AddCallback(OSD::CallbackType::Initialization, ButtonManager::Init);
|
||||
OSD::AddCallback(OSD::CallbackType::Shutdown, ButtonManager::Shutdown);
|
||||
|
||||
RegisterMsgAlertHandler(&MsgAlert);
|
||||
|
||||
|
|
|
@ -1520,7 +1520,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
|
|||
DrawDebugText();
|
||||
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_ONFRAME);
|
||||
OSD::DoCallbacks(OSD::CallbackType::OnFrame);
|
||||
OSD::DrawMessages();
|
||||
|
||||
// Copy the rendered frame to the real window
|
||||
|
|
|
@ -165,7 +165,7 @@ bool VideoBackend::Initialize(void *window_handle)
|
|||
return false;
|
||||
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_INIT);
|
||||
OSD::DoCallbacks(OSD::CallbackType::Initialization);
|
||||
|
||||
s_BackendInitialized = true;
|
||||
|
||||
|
@ -209,7 +209,7 @@ void VideoBackend::Shutdown()
|
|||
s_BackendInitialized = false;
|
||||
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_SHUTDOWN);
|
||||
OSD::DoCallbacks(OSD::CallbackType::Shutdown);
|
||||
|
||||
GLInterface->Shutdown();
|
||||
GLInterface.reset();
|
||||
|
|
|
@ -150,7 +150,7 @@ void SWRenderer::Swap(u32 fbWidth, u32 fbHeight)
|
|||
s_bScreenshot.store(false);
|
||||
}
|
||||
|
||||
OSD::DoCallbacks(OSD::OSD_ONFRAME);
|
||||
OSD::DoCallbacks(OSD::CallbackType::OnFrame);
|
||||
|
||||
DrawDebugText();
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ void VideoSoftware::Shutdown()
|
|||
DebugUtil::Shutdown();
|
||||
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_SHUTDOWN);
|
||||
OSD::DoCallbacks(OSD::CallbackType::Shutdown);
|
||||
|
||||
SWOGLWindow::Shutdown();
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void VideoSoftware::Video_Cleanup()
|
|||
void VideoSoftware::Video_Prepare()
|
||||
{
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_INIT);
|
||||
OSD::DoCallbacks(OSD::CallbackType::Initialization);
|
||||
|
||||
SWRenderer::Prepare();
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ void DoCallbacks(CallbackType type)
|
|||
}
|
||||
|
||||
// Wipe all callbacks on shutdown
|
||||
if (type == OSD_SHUTDOWN)
|
||||
if (type == CallbackType::Shutdown)
|
||||
s_callbacks.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,13 +17,13 @@ void DrawMessages(); // draw the current messages on the screen. Only call once
|
|||
void ClearMessages();
|
||||
|
||||
// On-screen callbacks
|
||||
enum CallbackType
|
||||
enum class CallbackType
|
||||
{
|
||||
OSD_INIT = 0,
|
||||
OSD_ONFRAME,
|
||||
OSD_SHUTDOWN
|
||||
Initialization,
|
||||
OnFrame,
|
||||
Shutdown
|
||||
};
|
||||
typedef std::function<void()> Callback;
|
||||
using Callback = std::function<void()>;
|
||||
|
||||
void AddCallback(CallbackType type, Callback cb);
|
||||
void DoCallbacks(CallbackType type);
|
||||
|
|
Loading…
Reference in New Issue