Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gu/pspgu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ void sceGuScissor(int x, int y, int w, int h);
* @param width - Width of viewport
* @param height - Height of viewport
**/
void sceGuViewport(int cx, int cy, int width, int height);
void sceGuViewport(float cx, float cy, float width, float height);

/**
* Draw bezier surface
Expand Down
14 changes: 6 additions & 8 deletions src/gu/sceGuViewport.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@

#include "guInternal.h"

void sceGuViewport(int cx, int cy, int width, int height)
void sceGuViewport(float cx, float cy, float width, float height)
{
float sx, sy, tx, ty;
sx = (float)(width) * 0.5f;
sy = (float)(height) * -0.5f;
tx = (float)cx;
ty = (float)cy;
float sx, sy;
sx = width * 0.5f;
sy = height * -0.5f;

sendCommandf(VIEWPORT_X_SCALE, sx);
sendCommandf(VIEWPORT_Y_SCALE, sy);
sendCommandf(VIEWPORT_X_CENTER, tx);
sendCommandf(VIEWPORT_Y_CENTER, ty);
sendCommandf(VIEWPORT_X_CENTER, cx);
sendCommandf(VIEWPORT_Y_CENTER, cy);
}