diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 17a977936f..fec208f2e7 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -848,7 +848,6 @@ bool TransformDrawEngine::TestBoundingBox(void* control_points, int vertexCount, static inline Vec3f ClipToScreenTemp(const Vec4f& coords) { - Vec3f ret; // TODO: Check for invalid parameters (x2 < x1, etc) float vpx1 = getFloat24(gstate.viewportx1); float vpx2 = getFloat24(gstate.viewportx2); @@ -873,9 +872,12 @@ static inline Vec3f ClipToScreenTemp(const Vec4f& coords) static Vec3f ScreenToDrawing(const Vec3f& coords) { Vec3f 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 = coords.x - gstate.getOffsetX16(); + ret.y = coords.y - gstate.getOffsetY16(); + + // Convert from 16 point to float. + ret.x *= 1.0 / 16.0; + ret.y *= 1.0 / 16.0; ret.z = coords.z; return ret; } @@ -945,8 +947,7 @@ bool TransformDrawEngine::GetCurrentSimpleVertices(int count, std::vector