MrCrayfish's Gun Mod

MrCrayfish's Gun Mod

25M Downloads

Sights and Animations do not work on Mac

Alpha-72 opened this issue ยท 4 comments

commented

Hello,

I have been having trouble with the magnifying scopes and third-person firing animations for version 16.1 on mac. The medium and long scopes magnify an area below their reticle, and firing animations in third person are not visible.

Otherwise, the mod is amazing. I especially like the ability to change colors.

Thank you.

commented

I have these same problems too. At least for the scope issues, it seems to be related to the retina screen scaling used by most macbooks. If you multiply the window width and height by 2, the scopes look right.

ScreenTextureState.java

RenderSystem.bindTexture(this.getTextureId());
  if(mainWindow.getWidth() != this.lastWindowWidth || mainWindow.getHeight() != this.lastWindowHeight)
  {
      // When window resizes the texture needs to be re-initialized and copied, so both are done in the same call
      this.lastWindowWidth = mainWindow.getWidth();
      this.lastWindowHeight = mainWindow.getHeight();
      glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, mainWindow.getWidth() * 2, mainWindow.getHeight() * 2, 0);
  }
  else
  {
      // Copy sub-image is faster than copy because the texture does not need to be initialized
      glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, mainWindow.getWidth() * 2, mainWindow.getHeight() * 2);
  }

I might make a pr later once I understand the issue better.

commented

@liam-b It seems this can be fixed by getting the frame buffer width and height instead of the window width and height.

Can you try replacing getWidth/getHeight with getFramebufferWidth/getFramebufferHeight? Let me know if this fixes the issue.

commented

Yep, that seems to work perfectly for me (tested on both internal and an external display).

commented

Fixed in cfae162