CStateManager: Convert reinterpret_cast instances over to static_cast

Conversions from void* can be done with static_cast.
This commit is contained in:
Lioncash 2020-03-16 20:05:21 -04:00
parent 0ae2364b24
commit 58b112dbe6
1 changed files with 5 additions and 5 deletions

View File

@ -286,10 +286,10 @@ void CStateManager::UpdateThermalVisor() {
} }
void CStateManager::RendererDrawCallback(const void* drawable, const void* ctx, int type) { void CStateManager::RendererDrawCallback(const void* drawable, const void* ctx, int type) {
const CStateManager& mgr = *reinterpret_cast<const CStateManager*>(ctx); const CStateManager& mgr = *static_cast<const CStateManager*>(ctx);
switch (type) { switch (type) {
case 0: { case 0: {
const CActor& actor = *reinterpret_cast<const CActor*>(drawable); const CActor& actor = *static_cast<const CActor*>(drawable);
if (actor.xc8_drawnToken == mgr.x8dc_objectDrawToken) if (actor.xc8_drawnToken == mgr.x8dc_objectDrawToken)
break; break;
if (actor.xc6_nextDrawNode != kInvalidUniqueId) if (actor.xc6_nextDrawNode != kInvalidUniqueId)
@ -299,10 +299,10 @@ void CStateManager::RendererDrawCallback(const void* drawable, const void* ctx,
break; break;
} }
case 1: case 1:
reinterpret_cast<const CSimpleShadow*>(drawable)->Render(mgr.x8f0_shadowTex); static_cast<const CSimpleShadow*>(drawable)->Render(mgr.x8f0_shadowTex);
break; break;
case 2: case 2:
reinterpret_cast<const CDecal*>(drawable)->Render(); static_cast<const CDecal*>(drawable)->Render();
break; break;
default: default:
break; break;
@ -479,7 +479,7 @@ void CStateManager::DrawReflection(const zeus::CVector3f& reflectPoint) {
} }
void CStateManager::ReflectionDrawer(void* ctx, const zeus::CVector3f& vec) { void CStateManager::ReflectionDrawer(void* ctx, const zeus::CVector3f& vec) {
reinterpret_cast<CStateManager*>(ctx)->DrawReflection(vec); static_cast<CStateManager*>(ctx)->DrawReflection(vec);
} }
void CStateManager::CacheReflection() { g_Renderer->CacheReflection(ReflectionDrawer, this, true); } void CStateManager::CacheReflection() { g_Renderer->CacheReflection(ReflectionDrawer, this, true); }