diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-03-27 12:16:08 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-03-27 15:19:02 -0400 |
| commit | d5a1edba09f95b868c03879a4c05ffef9a3d80d8 (patch) | |
| tree | 1997d5185b0c3e318170193af27824a5ae6152b5 /Source/Core | |
| parent | 9feb18866b42007212f4e6961b56c0b4df5c29a9 (diff) | |
HiresTextures: Remove unnecessary pointer casts in GenBaseName()
swap16 has an overload that accepts a u8*, performing the same behavior
in a well-defined manner.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/HiresTextures.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index 6362636387..9df399365f 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -243,10 +243,11 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co } break; case 16384 * 2: - for (size_t i = 0; i < texture_size / 2; i++) + for (size_t i = 0; i < texture_size; i += sizeof(u16)) { - min = std::min<u32>(min, Common::swap16(((u16*)texture)[i]) & 0x3fff); - max = std::max<u32>(max, Common::swap16(((u16*)texture)[i]) & 0x3fff); + const u16 texture_halfword = Common::swap16(texture[i]) & 0x3fff; + min = std::min<u32>(min, texture_halfword); + max = std::max<u32>(max, texture_halfword); } break; } |
