mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-12-22 19:59:58 +00:00
Merge pull request #303 from fjtrujy/improve_sceGuViewport
Fix `sceGuVIewport` with odd center values
This commit is contained in:
@@ -10,8 +10,14 @@
|
|||||||
|
|
||||||
void sceGuViewport(int cx, int cy, int width, int height)
|
void sceGuViewport(int cx, int cy, int width, int height)
|
||||||
{
|
{
|
||||||
sendCommandf(VIEWPORT_X_SCALE, (float)(width >> 1));
|
float sx, sy, tx, ty;
|
||||||
sendCommandf(VIEWPORT_Y_SCALE, (float)((-height) >> 1));
|
sx = (float)(width) * 0.5f;
|
||||||
sendCommandf(VIEWPORT_X_CENTER, (float)cx);
|
sy = (float)(height) * -0.5f;
|
||||||
sendCommandf(VIEWPORT_Y_CENTER, (float)cy);
|
tx = (float)cx;
|
||||||
|
ty = (float)cy;
|
||||||
|
|
||||||
|
sendCommandf(VIEWPORT_X_SCALE, sx);
|
||||||
|
sendCommandf(VIEWPORT_Y_SCALE, sy);
|
||||||
|
sendCommandf(VIEWPORT_X_CENTER, tx);
|
||||||
|
sendCommandf(VIEWPORT_Y_CENTER, ty);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user