OnScreenDisplay: Make CallbackType an enum class

This commit is contained in:
Lioncash 2016-01-02 14:45:41 -05:00
parent 066af14272
commit edda018d54
7 changed files with 14 additions and 14 deletions

View File

@ -609,8 +609,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
} }
// Install our callbacks // Install our callbacks
OSD::AddCallback(OSD::OSD_INIT, ButtonManager::Init); OSD::AddCallback(OSD::CallbackType::Initialization, ButtonManager::Init);
OSD::AddCallback(OSD::OSD_SHUTDOWN, ButtonManager::Shutdown); OSD::AddCallback(OSD::CallbackType::Shutdown, ButtonManager::Shutdown);
RegisterMsgAlertHandler(&MsgAlert); RegisterMsgAlertHandler(&MsgAlert);

View File

@ -1520,7 +1520,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
DrawDebugText(); DrawDebugText();
// Do our OSD callbacks // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_ONFRAME); OSD::DoCallbacks(OSD::CallbackType::OnFrame);
OSD::DrawMessages(); OSD::DrawMessages();
// Copy the rendered frame to the real window // Copy the rendered frame to the real window

View File

@ -165,7 +165,7 @@ bool VideoBackend::Initialize(void *window_handle)
return false; return false;
// Do our OSD callbacks // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT); OSD::DoCallbacks(OSD::CallbackType::Initialization);
s_BackendInitialized = true; s_BackendInitialized = true;
@ -209,7 +209,7 @@ void VideoBackend::Shutdown()
s_BackendInitialized = false; s_BackendInitialized = false;
// Do our OSD callbacks // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_SHUTDOWN); OSD::DoCallbacks(OSD::CallbackType::Shutdown);
GLInterface->Shutdown(); GLInterface->Shutdown();
GLInterface.reset(); GLInterface.reset();

View File

@ -150,7 +150,7 @@ void SWRenderer::Swap(u32 fbWidth, u32 fbHeight)
s_bScreenshot.store(false); s_bScreenshot.store(false);
} }
OSD::DoCallbacks(OSD::OSD_ONFRAME); OSD::DoCallbacks(OSD::CallbackType::OnFrame);
DrawDebugText(); DrawDebugText();

View File

@ -150,7 +150,7 @@ void VideoSoftware::Shutdown()
DebugUtil::Shutdown(); DebugUtil::Shutdown();
// Do our OSD callbacks // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_SHUTDOWN); OSD::DoCallbacks(OSD::CallbackType::Shutdown);
SWOGLWindow::Shutdown(); SWOGLWindow::Shutdown();
} }
@ -163,7 +163,7 @@ void VideoSoftware::Video_Cleanup()
void VideoSoftware::Video_Prepare() void VideoSoftware::Video_Prepare()
{ {
// Do our OSD callbacks // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT); OSD::DoCallbacks(OSD::CallbackType::Initialization);
SWRenderer::Prepare(); SWRenderer::Prepare();

View File

@ -83,7 +83,7 @@ void DoCallbacks(CallbackType type)
} }
// Wipe all callbacks on shutdown // Wipe all callbacks on shutdown
if (type == OSD_SHUTDOWN) if (type == CallbackType::Shutdown)
s_callbacks.clear(); s_callbacks.clear();
} }

View File

@ -17,13 +17,13 @@ void DrawMessages(); // draw the current messages on the screen. Only call once
void ClearMessages(); void ClearMessages();
// On-screen callbacks // On-screen callbacks
enum CallbackType enum class CallbackType
{ {
OSD_INIT = 0, Initialization,
OSD_ONFRAME, OnFrame,
OSD_SHUTDOWN Shutdown
}; };
typedef std::function<void()> Callback; using Callback = std::function<void()>;
void AddCallback(CallbackType type, Callback cb); void AddCallback(CallbackType type, Callback cb);
void DoCallbacks(CallbackType type); void DoCallbacks(CallbackType type);