diff --git a/src/lindbergh/graphics.c b/src/lindbergh/graphics.c index adb399f..37f3cda 100644 --- a/src/lindbergh/graphics.c +++ b/src/lindbergh/graphics.c @@ -179,6 +179,45 @@ int XF86VidModeGetAllModeLines(Display *display, int screen, int *modecount_retu return true; } +/** + * Function which games use to scale the output, some games behave well when this is changed + * others less so. + */ +void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + int (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = dlsym(RTLD_NEXT, "glViewport"); + switch (getConfig()->crc32) + { + case LETS_GO_JUNGLE: + case LETS_GO_JUNGLE_REVA: + { + if (width == 1360 && height == 768) + { + width = getConfig()->width; + height = getConfig()->height; + } + } + break; + + case LETS_GO_JUNGLE_SPECIAL: + { + printf("glViewPort(%d, %d, %d, %d);\n", x, y, width, height); + + if (width == 2048 && height == 768) + { + width = getConfig()->width * 2; + height = getConfig()->height; + } + } + break; + + default: + break; + } + + _glViewport(x, y, width, height); +} + typedef unsigned int uint; int glXSwapIntervalSGI(int interval) diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index 741135d..0c8997d 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -282,7 +282,7 @@ int initPatch() detourFunction(0x083a61cc, stubReturn); } break; - case AFTER_BURNER_CLIMAX_REVA: + case AFTER_BURNER_CLIMAX_REVB: { if (config->showDebugMessages == 1) { @@ -309,7 +309,7 @@ int initPatch() detourFunction(0x081e492e, amDipswSetLed); } break; - case AFTER_BURNER_CLIMAX_REVB: + case AFTER_BURNER_CLIMAX_REVA: { if (config->showDebugMessages == 1) {