From 4b40767050ec8259187e0e633db54fb336d06793 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 29 Sep 2020 01:00:10 -0400 Subject: [PATCH] CGraphics: Fix implicit truncation errors --- Runtime/Graphics/CGraphics.cpp | 4 ++-- Runtime/Graphics/CGraphics.hpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 49ae7ffd5..39b40e27d 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -317,8 +317,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1, const // int finalMinY = std::max(minY, 0 /* ViewportY origin */); // int finalMaxY = std::min(maxY, int(g_Viewport.xc_height)); - int width = maxX2 - minX2; - int height = maxY2 - minY2; + u32 width = maxX2 - minX2; + u32 height = maxY2 - minY2; return {true, minX2, minY2, diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index f5723fef1..016ec2d3c 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -116,11 +116,11 @@ extern SViewport g_Viewport; struct SClipScreenRect { bool x0_valid = false; - int32_t x4_left = 0; - int32_t x8_top = 0; - uint32_t xc_width = 0; - uint32_t x10_height = 0; - uint32_t x14_dstWidth = 0; + s32 x4_left = 0; + s32 x8_top = 0; + u32 xc_width = 0; + u32 x10_height = 0; + u32 x14_dstWidth = 0; float x18_uvXMin = 0.f; float x1c_uvXMax = 0.f; float x20_uvYMin = 0.f;