mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-01 08:33:46 +00:00
fix(jui): use the same iggy scalings for java UI
This commit is contained in:
parent
032e56a47a
commit
3310481ca3
|
|
@ -2372,13 +2372,9 @@ void Minecraft::resize(int width, int height) {
|
|||
this->height = height;
|
||||
|
||||
if (screen != NULL) {
|
||||
#ifdef _ENABLEIGGY
|
||||
// 4jcraft: use adjusted logical width instead of raw width for correct
|
||||
// screen size calculation.
|
||||
ScreenSizeCalculator ssc(options, this->width, height);
|
||||
#else
|
||||
ScreenSizeCalculator ssc(options, width, height);
|
||||
#endif
|
||||
int screenWidth = ssc.getWidth();
|
||||
int screenHeight = ssc.getHeight();
|
||||
// screen->init(this, screenWidth, screenHeight); // 4J -
|
||||
|
|
|
|||
|
|
@ -884,13 +884,11 @@ return -1;
|
|||
app.InitialiseTips();
|
||||
while (!RenderManager.ShouldClose()) {
|
||||
RenderManager.StartFrame();
|
||||
#ifdef _ENABLEIGGY
|
||||
if (pMinecraft->pollResize()) {
|
||||
int fbw, fbh;
|
||||
RenderManager.GetFramebufferSize(fbw, fbh);
|
||||
ui.setScreenSize(fbw, fbh);
|
||||
}
|
||||
#endif
|
||||
app.UpdateTime();
|
||||
PIXBeginNamedEvent(0, "Input manager tick");
|
||||
InputManager.Tick();
|
||||
|
|
|
|||
|
|
@ -1050,8 +1050,8 @@ void GameRenderer::render(float a, bool bFirst) {
|
|||
ScreenSizeCalculator ssc(mc->options, mc->width, mc->height);
|
||||
int screenWidth = ssc.getWidth();
|
||||
int screenHeight = ssc.getHeight();
|
||||
int xMouse = Mouse::getX() * screenWidth / mc->width;
|
||||
int yMouse = screenHeight - Mouse::getY() * screenHeight / mc->height - 1;
|
||||
int xMouse = InputManager.GetMouseX() * screenWidth / mc->width;
|
||||
int yMouse = InputManager.GetMouseY() * screenHeight / mc->height - 1;
|
||||
|
||||
int maxFps = getFpsCap(mc->options->framerateLimit);
|
||||
|
||||
|
|
@ -1837,13 +1837,9 @@ void GameRenderer::setupGuiScreen(int forceScale /*=-1*/) {
|
|||
int fbw, fbh;
|
||||
RenderManager.GetFramebufferSize(fbw, fbh);
|
||||
|
||||
#ifdef _ENABLEIGGY
|
||||
// 4jcraft: use actual framebuffer dimensions instead of mc->width/height
|
||||
// to ensure GUI scales correctly after a window resize.
|
||||
ScreenSizeCalculator ssc(mc->options, fbw, fbh, forceScale);
|
||||
#else
|
||||
ScreenSizeCalculator ssc(mc->options, mc->width, mc->height, forceScale);
|
||||
#endif
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
|
|
|||
Loading…
Reference in a new issue