diff options
| author | 2015-07-25 12:50:32 -0700 | |
|---|---|---|
| committer | 2015-07-25 12:50:32 -0700 | |
| commit | 9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1 (patch) | |
| tree | 732bc1b978397a05fab07d5443fe05534ea39b37 /src/video_core | |
| parent | Merge pull request #981 from Subv/checkboxes (diff) | |
| parent | Vertex Shader : Undo casting (diff) | |
| download | yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.gz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.xz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.zip | |
Merge pull request #892 from zawata/another-warning-fixes
Yet More Warning Fixes
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/command_processor.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 32 | ||||
| -rw-r--r-- | src/video_core/pica.h | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 92ba8754f..43ae06181 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -103,7 +103,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): | 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): |
| 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): | 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): |
| 105 | { | 105 | { |
| 106 | unsigned index = id - PICA_REG_INDEX(command_buffer.trigger[0]); | 106 | unsigned index = static_cast<unsigned>(id - PICA_REG_INDEX(command_buffer.trigger[0])); |
| 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); | 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); |
| 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; | 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; |
| 109 | g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); | 109 | g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); |
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index d24c0f11e..fc9faffc3 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -85,7 +85,7 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) { | |||
| 85 | vertices.push_back(v1); | 85 | vertices.push_back(v1); |
| 86 | vertices.push_back(v2); | 86 | vertices.push_back(v2); |
| 87 | 87 | ||
| 88 | int num_vertices = vertices.size(); | 88 | size_t num_vertices = vertices.size(); |
| 89 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); | 89 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| @@ -241,8 +241,8 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data | |||
| 241 | 241 | ||
| 242 | dvle.main_offset_words = main_offset; | 242 | dvle.main_offset_words = main_offset; |
| 243 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; | 243 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; |
| 244 | dvle.output_register_table_size = output_info_table.size(); | 244 | dvle.output_register_table_size = static_cast<uint32_t>(output_info_table.size()); |
| 245 | QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo)); | 245 | QueueForWriting((u8*)output_info_table.data(), static_cast<u32>(output_info_table.size() * sizeof(OutputRegisterInfo))); |
| 246 | 246 | ||
| 247 | // TODO: Create a label table for "main" | 247 | // TODO: Create a label table for "main" |
| 248 | 248 | ||
| @@ -497,31 +497,31 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture | |||
| 497 | // Lookup base value | 497 | // Lookup base value |
| 498 | Math::Vec3<int> ret; | 498 | Math::Vec3<int> ret; |
| 499 | if (differential_mode) { | 499 | if (differential_mode) { |
| 500 | ret.r() = differential.r; | 500 | ret.r() = static_cast<int>(differential.r); |
| 501 | ret.g() = differential.g; | 501 | ret.g() = static_cast<int>(differential.g); |
| 502 | ret.b() = differential.b; | 502 | ret.b() = static_cast<int>(differential.b); |
| 503 | if (x >= 2) { | 503 | if (x >= 2) { |
| 504 | ret.r() += differential.dr; | 504 | ret.r() += static_cast<int>(differential.dr); |
| 505 | ret.g() += differential.dg; | 505 | ret.g() += static_cast<int>(differential.dg); |
| 506 | ret.b() += differential.db; | 506 | ret.b() += static_cast<int>(differential.db); |
| 507 | } | 507 | } |
| 508 | ret.r() = Color::Convert5To8(ret.r()); | 508 | ret.r() = Color::Convert5To8(ret.r()); |
| 509 | ret.g() = Color::Convert5To8(ret.g()); | 509 | ret.g() = Color::Convert5To8(ret.g()); |
| 510 | ret.b() = Color::Convert5To8(ret.b()); | 510 | ret.b() = Color::Convert5To8(ret.b()); |
| 511 | } else { | 511 | } else { |
| 512 | if (x < 2) { | 512 | if (x < 2) { |
| 513 | ret.r() = Color::Convert4To8(separate.r1); | 513 | ret.r() = Color::Convert4To8(static_cast<u8>(separate.r1)); |
| 514 | ret.g() = Color::Convert4To8(separate.g1); | 514 | ret.g() = Color::Convert4To8(static_cast<u8>(separate.g1)); |
| 515 | ret.b() = Color::Convert4To8(separate.b1); | 515 | ret.b() = Color::Convert4To8(static_cast<u8>(separate.b1)); |
| 516 | } else { | 516 | } else { |
| 517 | ret.r() = Color::Convert4To8(separate.r2); | 517 | ret.r() = Color::Convert4To8(static_cast<u8>(separate.r2)); |
| 518 | ret.g() = Color::Convert4To8(separate.g2); | 518 | ret.g() = Color::Convert4To8(static_cast<u8>(separate.g2)); |
| 519 | ret.b() = Color::Convert4To8(separate.b2); | 519 | ret.b() = Color::Convert4To8(static_cast<u8>(separate.b2)); |
| 520 | } | 520 | } |
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | // Add modifier | 523 | // Add modifier |
| 524 | unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value(); | 524 | unsigned table_index = static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value()); |
| 525 | 525 | ||
| 526 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ | 526 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ |
| 527 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, | 527 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, |
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index aec6f0660..38599a7a3 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -913,7 +913,7 @@ struct Regs { | |||
| 913 | 913 | ||
| 914 | #define ADD_FIELD(name) \ | 914 | #define ADD_FIELD(name) \ |
| 915 | do { \ | 915 | do { \ |
| 916 | map.insert({PICA_REG_INDEX(name), #name}); \ | 916 | map.insert({static_cast<u32>(PICA_REG_INDEX(name)), #name}); \ |
| 917 | /* TODO: change to Regs::name when VS2015 and other compilers support it */ \ | 917 | /* TODO: change to Regs::name when VS2015 and other compilers support it */ \ |
| 918 | for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \ | 918 | for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \ |
| 919 | map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ | 919 | map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ |