aspect
This commit is contained in:
@@ -61,6 +61,7 @@ void screenBind() {
|
||||
case SCREEN_MODE_FIXED_SIZE: {
|
||||
SCREEN.width = SCREEN.fixedSize.width;
|
||||
SCREEN.height = SCREEN.fixedSize.height;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
|
||||
if(SCREEN.framebufferReady) {
|
||||
// Is current framebuffer the correct size?
|
||||
@@ -96,6 +97,7 @@ void screenBind() {
|
||||
// No need to use framebuffer.
|
||||
SCREEN.width = fbWidth;
|
||||
SCREEN.height = fbHeight;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
|
||||
if(SCREEN.framebufferReady) {
|
||||
frameBufferDispose(&SCREEN.framebuffer);
|
||||
@@ -124,6 +126,7 @@ void screenBind() {
|
||||
// Correct size, nothing to do.
|
||||
SCREEN.width = newFbWidth;
|
||||
SCREEN.height = newFbHeight;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
frameBufferBind(&SCREEN.framebuffer);
|
||||
return;
|
||||
}
|
||||
@@ -135,9 +138,10 @@ void screenBind() {
|
||||
|
||||
// Create new framebuffer
|
||||
frameBufferInit(&SCREEN.framebuffer, newFbWidth, newFbHeight);
|
||||
SCREEN.framebufferReady = true;
|
||||
SCREEN.width = newFbWidth;
|
||||
SCREEN.height = newFbHeight;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
SCREEN.framebufferReady = true;
|
||||
|
||||
// Bind FB
|
||||
frameBufferBind(&SCREEN.framebuffer);
|
||||
@@ -155,6 +159,7 @@ void screenBind() {
|
||||
|
||||
SCREEN.width = newFbWidth;
|
||||
SCREEN.height = newFbHeight;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
|
||||
if(fbWidth == newFbWidth && fbHeight == newFbHeight) {
|
||||
// No need to use framebuffer.
|
||||
@@ -198,6 +203,7 @@ void screenBind() {
|
||||
|
||||
SCREEN.width = newFbWidth;
|
||||
SCREEN.height = newFbHeight;
|
||||
SCREEN.aspect = (float_t)SCREEN.width / (float_t)SCREEN.height;
|
||||
|
||||
if(fbWidth == newFbWidth && fbHeight == newFbHeight) {
|
||||
// No need to use framebuffer.
|
||||
|
@@ -35,6 +35,7 @@ typedef struct {
|
||||
// Calculated dimensions of the viewport, to be used by the camera
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
float_t aspect;
|
||||
|
||||
#if DISPLAY_SIZE_DYNAMIC == 1
|
||||
framebuffer_t framebuffer;
|
||||
|
Reference in New Issue
Block a user