diff --git a/SMILEBASIC/console.d b/SMILEBASIC/console.d index 01507b9..787927a 100644 --- a/SMILEBASIC/console.d +++ b/SMILEBASIC/console.d @@ -302,7 +302,7 @@ class Console { if (!visibles[i] && !showCursor) continue; - petitcom.chScreen2(petitcom.currentDisplay.rect[i].x, petitcom.currentDisplay.rect[i].y, petitcom.currentDisplay.rect[i].w, petitcom.currentDisplay.rect[i].h); + petitcom.chRenderingDisplay(i); int consoleWidth = petitcom.currentDisplay.rect[i].w / fontWidth; int consoleHeight = petitcom.currentDisplay.rect[i].h / fontHeight; glDisable(GL_TEXTURE_2D); diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 5c1ac05..dbbf40e 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -401,7 +401,7 @@ class PetitComputer glViewport(x, currentDisplay.windowSize.height - h - y, w, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(x, x + w, y + h, y, 1024, -2048); + glOrtho(0, w, h, 0, 1024, -2048); } void chRenderingDisplay(int i) { @@ -409,7 +409,10 @@ class PetitComputer } void chRenderingDisplay(int i, int x, int y, int w, int h) { - chScreen2(currentDisplay.rect[i].x + x, currentDisplay.rect[i].y + y, w, h); + glViewport(x + currentDisplay.rect[i].x, currentDisplay.windowSize.height - h - y - currentDisplay.rect[i].y, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(x, x + w, y + h, y, 1024, -2048); } Button[] buttonTable; Sprite sprite; @@ -464,7 +467,7 @@ class PetitComputer { display0.x = (resolutionTable[gamepad].width - resolutionTable[tv].width) / 2; } - currentDisplay = Display([display0, display1], Size(std.algorithm.max(resolutionTable[gamepad].width, resolutionTable[tv].width), std.algorithm.max(resolutionTable[gamepad].height, resolutionTable[tv].height))); + currentDisplay = Display([display0, display1], Size(std.algorithm.max(resolutionTable[gamepad].width, resolutionTable[tv].width), resolutionTable[gamepad].height + resolutionTable[tv].height)); xscreenmode = 4; } displaynum = 0;