summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_processor.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2016-03-17 06:51:09 +0100
committerLioncash <mathew1800@gmail.com>2016-03-17 07:01:38 +0100
commit63e956cc7a57fe05aa2e422762349bee253715fb (patch)
treebf10e1db6d2232dd0584b70f342dc173dd730bb1 /src/video_core/command_processor.cpp
parentMerge pull request #1537 from lioncash/const (diff)
downloadyuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar.gz
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar.bz2
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar.lz
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar.xz
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.tar.zst
yuzu-63e956cc7a57fe05aa2e422762349bee253715fb.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/command_processor.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 54721561e..33414258a 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -234,7 +234,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
const auto& index_info = regs.index_array;
const u8* index_address_8 = Memory::GetPhysicalPointer(base_address + index_info.offset);
- const u16* index_address_16 = (u16*)index_address_8;
+ const u16* index_address_16 = reinterpret_cast<const u16*>(index_address_8);
bool index_u16 = index_info.format != 0;
#if PICA_DUMP_GEOMETRY
@@ -345,10 +345,11 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
: (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::SHORT) ? 2 : 1);
}
- const float srcval = (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::BYTE) ? *(s8*)srcdata :
- (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::UBYTE) ? *(u8*)srcdata :
- (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::SHORT) ? *(s16*)srcdata :
- *(float*)srcdata;
+ const float srcval =
+ (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::BYTE) ? *reinterpret_cast<const s8*>(srcdata) :
+ (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::UBYTE) ? *reinterpret_cast<const u8*>(srcdata) :
+ (vertex_attribute_formats[i] == Regs::VertexAttributeFormat::SHORT) ? *reinterpret_cast<const s16*>(srcdata) :
+ *reinterpret_cast<const float*>(srcdata);
input.attr[i][comp] = float24::FromFloat32(srcval);
LOG_TRACE(HW_GPU, "Loaded component %x of attribute %x for vertex %x (index %x) from 0x%08x + 0x%08x + 0x%04x: %f",