From e3e3e1f3bc09d75105f526d225875b671f634f78 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Fri, 10 Aug 2012 07:20:49 +0200 Subject: [PATCH] (PS3) Create gfx_ctx_get_aspect_ratio --- console/rgl/ps3/device_ctx.cpp | 16 ---------------- console/rgl/ps3/rgl.h | 1 - gfx/context/ps3_ctx.c | 16 ++++++++++++++++ gfx/context/ps3_ctx.h | 1 + 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/console/rgl/ps3/device_ctx.cpp b/console/rgl/ps3/device_ctx.cpp index c011dde301..06a7f24924 100644 --- a/console/rgl/ps3/device_ctx.cpp +++ b/console/rgl/ps3/device_ctx.cpp @@ -1050,22 +1050,6 @@ PSGLdevice* psglCreateDeviceExtended(const PSGLdeviceParameters *parameters ) return device; } -GLfloat psglGetDeviceAspectRatio(const PSGLdevice * device) -{ - CellVideoOutState videoState; - cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState); - - switch (videoState.displayMode.aspect) - { - case CELL_VIDEO_OUT_ASPECT_4_3: - return 4.0f/3.0f; - case CELL_VIDEO_OUT_ASPECT_16_9: - return 16.0f/9.0f; - } - - return 16.0f/9.0f; -} - void psglGetDeviceDimensions(const PSGLdevice * device, GLuint *width, GLuint *height) { *width = device->deviceParameters.width; diff --git a/console/rgl/ps3/rgl.h b/console/rgl/ps3/rgl.h index c194065d1d..f9a63b0729 100644 --- a/console/rgl/ps3/rgl.h +++ b/console/rgl/ps3/rgl.h @@ -1005,7 +1005,6 @@ extern void psglExit(); PSGLdevice *psglCreateDeviceAuto( GLenum colorFormat, GLenum depthFormat, GLenum multisamplingMode ); PSGLdevice *psglCreateDeviceExtended( const PSGLdeviceParameters *parameters ); -GLfloat psglGetDeviceAspectRatio(const PSGLdevice *device ); void psglGetDeviceDimensions(const PSGLdevice *device, GLuint *width, GLuint *height ); void psglDestroyDevice( PSGLdevice* device ); diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index 6b38196807..9057c2fae6 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -58,6 +58,22 @@ unsigned gfx_ctx_get_resolution_height(unsigned resolution_id) return resolution.height; } +float gfx_ctx_get_aspect_ratio(void) +{ + CellVideoOutState videoState; + cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState); + + switch (videoState.displayMode.aspect) + { + case CELL_VIDEO_OUT_ASPECT_4_3: + return 4.0f/3.0f; + case CELL_VIDEO_OUT_ASPECT_16_9: + return 16.0f/9.0f; + } + + return 16.0f/9.0f; +} + void gfx_ctx_get_available_resolutions (void) { bool defaultresolution; diff --git a/gfx/context/ps3_ctx.h b/gfx/context/ps3_ctx.h index 0635dc1554..f53a61d29f 100644 --- a/gfx/context/ps3_ctx.h +++ b/gfx/context/ps3_ctx.h @@ -19,6 +19,7 @@ void gfx_ctx_get_available_resolutions (void); int gfx_ctx_check_resolution(unsigned resolution_id); +float gfx_ctx_get_aspect_ratio(void); unsigned gfx_ctx_get_resolution_width(unsigned resolution_id); unsigned gfx_ctx_get_resolution_height(unsigned resolution_id); void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_rotate);