mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 18:23:43 +01:00
softgpu: Use cached state for screen offset.
This commit is contained in:
1 parent
edb79d968f
commit
6896a7a64e
5 files changed
+29
-26
No files matched your search
@@ -133,15 +133,6 @@ ScreenCoords TransformUnit::ClipToScreen(const ClipCoords& coords)
|
||||
return ClipToScreenInternal(coords, nullptr);
|
||||
}
|
||||
|
||||
DrawingCoords TransformUnit::ScreenToDrawing(const ScreenCoords& coords)
|
||||
{
|
||||
DrawingCoords ret;
|
||||
// TODO: What to do when offset > coord?
|
||||
ret.x = ((s32)coords.x - gstate.getOffsetX16()) / 16;
|
||||
ret.y = ((s32)coords.y - gstate.getOffsetY16()) / 16;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ScreenCoords TransformUnit::DrawingToScreen(const DrawingCoords &coords, u16 z) {
|
||||
ScreenCoords ret;
|
||||
ret.x = (u32)coords.x * 16 + gstate.getOffsetX16();
|
||||
@@ -706,7 +697,7 @@ bool TransformUnit::GetCurrentSimpleVertices(int count, std::vector<GPUDebugVert
|
||||
float clipPos[4];
|
||||
Vec3ByMatrix44(clipPos, vert.pos.AsArray(), worldviewproj);
|
||||
ScreenCoords screenPos = ClipToScreen(clipPos);
|
||||
DrawingCoords drawPos = ScreenToDrawing(screenPos);
|
||||
DrawingCoords drawPos = ScreenToDrawing(screenPos, gstate.getOffsetX16(), gstate.getOffsetY16());
|
||||
|
||||
if (gstate.vertType & GE_VTYPE_TC_MASK) {
|
||||
vertices[i].u = vert.uv[0] * (float)gstate.getTextureWidth(0);
|
||||
|
||||
Reference in new issue
Block a user