diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index aa0073e175..acdbe9f57e 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -97,8 +97,8 @@ DrawingCoords TransformUnit::ScreenToDrawing(const ScreenCoords& coords) { DrawingCoords ret; // TODO: What to do when offset > coord? - ret.x = (((u32)coords.x - gstate.getOffsetX16()) / 16) & 0x3ff; - ret.y = (((u32)coords.y - gstate.getOffsetY16()) / 16) & 0x3ff; + ret.x = ((s32)coords.x - gstate.getOffsetX16()) / 16; + ret.y = ((s32)coords.y - gstate.getOffsetY16()) / 16; ret.z = coords.z; return ret; } diff --git a/GPU/Software/TransformUnit.h b/GPU/Software/TransformUnit.h index 9cda18df7f..0a54a088c0 100644 --- a/GPU/Software/TransformUnit.h +++ b/GPU/Software/TransformUnit.h @@ -62,17 +62,17 @@ struct ScreenCoords struct DrawingCoords { DrawingCoords() {} - DrawingCoords(u10 x, u10 y, u16 z) : x(x), y(y), z(z) {} + DrawingCoords(s16 x, s16 y, u16 z) : x(x), y(y), z(z) {} - u10 x; - u10 y; + s16 x; + s16 y; u16 z; - Vec2 xy() const { return Vec2(x, y); } + Vec2 xy() const { return Vec2(x, y); } DrawingCoords operator * (const float t) const { - return DrawingCoords((u10)(x * t), (u10)(y * t), (u16)(z * t)); + return DrawingCoords((s16)(x * t), (s16)(y * t), (u16)(z * t)); } DrawingCoords operator + (const DrawingCoords& oth) const