summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-01-23 17:14:06 +0100
committerGitHub <noreply@github.com>2017-01-23 17:14:06 +0100
commit1c854f2daa2929ae5d8bb0e6978a11eb9abf442b (patch)
tree6eb4c70f6e6dcdf8c9eaf5fbbb9c73360091e493 /Source/Core/VideoCommon
parent6d879f7f3ae2cf4a20f574f301e3edb458f27c90 (diff)
parent940aa6f32d5348c40fdc904e42b47fbe032fcd4d (diff)
Merge pull request #4727 from lioncash/enum-class
VideoBackendBase: Convert EFBAccessType and FieldType into enum classes
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp12
-rw-r--r--Source/Core/VideoCommon/MainBase.cpp10
-rw-r--r--Source/Core/VideoCommon/VideoBackendBase.h16
3 files changed, 20 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index aa19f41928..fc6af84f27 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -31,7 +31,8 @@ void AsyncRequests::PullEventsInternal()
{
m_merged_efb_pokes.clear();
Event first_event = m_queue.front();
- EFBAccessType t = first_event.type == Event::EFB_POKE_COLOR ? POKE_COLOR : POKE_Z;
+ const auto t = first_event.type == Event::EFB_POKE_COLOR ? EFBAccessType::PokeColor :
+ EFBAccessType::PokeZ;
do
{
@@ -114,23 +115,24 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
case Event::EFB_POKE_COLOR:
{
EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data};
- g_renderer->PokeEFB(POKE_COLOR, &poke, 1);
+ g_renderer->PokeEFB(EFBAccessType::PokeColor, &poke, 1);
}
break;
case Event::EFB_POKE_Z:
{
EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data};
- g_renderer->PokeEFB(POKE_Z, &poke, 1);
+ g_renderer->PokeEFB(EFBAccessType::PokeZ, &poke, 1);
}
break;
case Event::EFB_PEEK_COLOR:
- *e.efb_peek.data = g_renderer->AccessEFB(PEEK_COLOR, e.efb_peek.x, e.efb_peek.y, 0);
+ *e.efb_peek.data =
+ g_renderer->AccessEFB(EFBAccessType::PeekColor, e.efb_peek.x, e.efb_peek.y, 0);
break;
case Event::EFB_PEEK_Z:
- *e.efb_peek.data = g_renderer->AccessEFB(PEEK_Z, e.efb_peek.x, e.efb_peek.y, 0);
+ *e.efb_peek.data = g_renderer->AccessEFB(EFBAccessType::PeekZ, e.efb_peek.x, e.efb_peek.y, 0);
break;
case Event::SWAP_EVENT:
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp
index 659eec31b3..cac970fff4 100644
--- a/Source/Core/VideoCommon/MainBase.cpp
+++ b/Source/Core/VideoCommon/MainBase.cpp
@@ -72,11 +72,11 @@ u32 VideoBackendBase::Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 Inpu
return 0;
}
- if (type == POKE_COLOR || type == POKE_Z)
+ if (type == EFBAccessType::PokeColor || type == EFBAccessType::PokeZ)
{
AsyncRequests::Event e;
- e.type = type == POKE_COLOR ? AsyncRequests::Event::EFB_POKE_COLOR :
- AsyncRequests::Event::EFB_POKE_Z;
+ e.type = type == EFBAccessType::PokeColor ? AsyncRequests::Event::EFB_POKE_COLOR :
+ AsyncRequests::Event::EFB_POKE_Z;
e.time = 0;
e.efb_poke.data = InputData;
e.efb_poke.x = x;
@@ -88,8 +88,8 @@ u32 VideoBackendBase::Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 Inpu
{
AsyncRequests::Event e;
u32 result;
- e.type = type == PEEK_COLOR ? AsyncRequests::Event::EFB_PEEK_COLOR :
- AsyncRequests::Event::EFB_PEEK_Z;
+ e.type = type == EFBAccessType::PeekColor ? AsyncRequests::Event::EFB_PEEK_COLOR :
+ AsyncRequests::Event::EFB_PEEK_Z;
e.time = 0;
e.efb_peek.x = x;
e.efb_peek.y = y;
diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h
index 69b2df58c1..5a598aa4dc 100644
--- a/Source/Core/VideoCommon/VideoBackendBase.h
+++ b/Source/Core/VideoCommon/VideoBackendBase.h
@@ -17,18 +17,18 @@ class Mapping;
}
class PointerWrap;
-enum FieldType
+enum class FieldType
{
- FIELD_ODD = 0,
- FIELD_EVEN = 1,
+ Odd,
+ Even,
};
-enum EFBAccessType
+enum class EFBAccessType
{
- PEEK_Z = 0,
- POKE_Z,
- PEEK_COLOR,
- POKE_COLOR
+ PeekZ,
+ PokeZ,
+ PeekColor,
+ PokeColor
};
struct SCPFifoStruct