diff options
| author | Lioncash <mathew1800@gmail.com> | 2016-03-17 01:51:09 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2016-03-17 02:01:38 -0400 |
| commit | 63e956cc7a57fe05aa2e422762349bee253715fb (patch) | |
| tree | bf10e1db6d2232dd0584b70f342dc173dd730bb1 /src/video_core/command_processor.cpp | |
| parent | 0c0fb463f0bf8c9dd179e44751b0a56b22cc6535 (diff) | |
video_core: Don't cast away const
Diffstat (limited to 'src/video_core/command_processor.cpp')
| -rw-r--r-- | src/video_core/command_processor.cpp | 11 |
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", |
