mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +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;
|
this->height = height;
|
||||||
|
|
||||||
if (screen != NULL) {
|
if (screen != NULL) {
|
||||||
#ifdef _ENABLEIGGY
|
|
||||||
// 4jcraft: use adjusted logical width instead of raw width for correct
|
// 4jcraft: use adjusted logical width instead of raw width for correct
|
||||||
// screen size calculation.
|
// screen size calculation.
|
||||||
ScreenSizeCalculator ssc(options, this->width, height);
|
ScreenSizeCalculator ssc(options, this->width, height);
|
||||||
#else
|
|
||||||
ScreenSizeCalculator ssc(options, width, height);
|
|
||||||
#endif
|
|
||||||
int screenWidth = ssc.getWidth();
|
int screenWidth = ssc.getWidth();
|
||||||
int screenHeight = ssc.getHeight();
|
int screenHeight = ssc.getHeight();
|
||||||
// screen->init(this, screenWidth, screenHeight); // 4J -
|
// screen->init(this, screenWidth, screenHeight); // 4J -
|
||||||
|
|
|
||||||
|
|
@ -884,13 +884,11 @@ return -1;
|
||||||
app.InitialiseTips();
|
app.InitialiseTips();
|
||||||
while (!RenderManager.ShouldClose()) {
|
while (!RenderManager.ShouldClose()) {
|
||||||
RenderManager.StartFrame();
|
RenderManager.StartFrame();
|
||||||
#ifdef _ENABLEIGGY
|
|
||||||
if (pMinecraft->pollResize()) {
|
if (pMinecraft->pollResize()) {
|
||||||
int fbw, fbh;
|
int fbw, fbh;
|
||||||
RenderManager.GetFramebufferSize(fbw, fbh);
|
RenderManager.GetFramebufferSize(fbw, fbh);
|
||||||
ui.setScreenSize(fbw, fbh);
|
ui.setScreenSize(fbw, fbh);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
app.UpdateTime();
|
app.UpdateTime();
|
||||||
PIXBeginNamedEvent(0, "Input manager tick");
|
PIXBeginNamedEvent(0, "Input manager tick");
|
||||||
InputManager.Tick();
|
InputManager.Tick();
|
||||||
|
|
|
||||||
|
|
@ -1050,8 +1050,8 @@ void GameRenderer::render(float a, bool bFirst) {
|
||||||
ScreenSizeCalculator ssc(mc->options, mc->width, mc->height);
|
ScreenSizeCalculator ssc(mc->options, mc->width, mc->height);
|
||||||
int screenWidth = ssc.getWidth();
|
int screenWidth = ssc.getWidth();
|
||||||
int screenHeight = ssc.getHeight();
|
int screenHeight = ssc.getHeight();
|
||||||
int xMouse = Mouse::getX() * screenWidth / mc->width;
|
int xMouse = InputManager.GetMouseX() * screenWidth / mc->width;
|
||||||
int yMouse = screenHeight - Mouse::getY() * screenHeight / mc->height - 1;
|
int yMouse = InputManager.GetMouseY() * screenHeight / mc->height - 1;
|
||||||
|
|
||||||
int maxFps = getFpsCap(mc->options->framerateLimit);
|
int maxFps = getFpsCap(mc->options->framerateLimit);
|
||||||
|
|
||||||
|
|
@ -1837,13 +1837,9 @@ void GameRenderer::setupGuiScreen(int forceScale /*=-1*/) {
|
||||||
int fbw, fbh;
|
int fbw, fbh;
|
||||||
RenderManager.GetFramebufferSize(fbw, fbh);
|
RenderManager.GetFramebufferSize(fbw, fbh);
|
||||||
|
|
||||||
#ifdef _ENABLEIGGY
|
|
||||||
// 4jcraft: use actual framebuffer dimensions instead of mc->width/height
|
// 4jcraft: use actual framebuffer dimensions instead of mc->width/height
|
||||||
// to ensure GUI scales correctly after a window resize.
|
// to ensure GUI scales correctly after a window resize.
|
||||||
ScreenSizeCalculator ssc(mc->options, fbw, fbh, forceScale);
|
ScreenSizeCalculator ssc(mc->options, fbw, fbh, forceScale);
|
||||||
#else
|
|
||||||
ScreenSizeCalculator ssc(mc->options, mc->width, mc->height, forceScale);
|
|
||||||
#endif
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue