New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop minimum width/2 height/2 screen constraint? #1661

Closed
Beuc opened this Issue Dec 8, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@Beuc
Copy link
Contributor

Beuc commented Dec 8, 2018

As part of the recent fit-to-screen change in Emscripten, we fit e.g. a 720p display in a 640x280/360x560 browser client area. This is below 360p and causes issues due to the following constraint in gldraw.pyx:

--- a/renpy/gl/gldraw.pyx
+++ b/renpy/gl/gldraw.pyx
@@ -221,8 +221,9 @@ cdef class GLDraw:
         pwidth *= self.dpi_scale
         pheight *= self.dpi_scale
 
-        pwidth = max(vwidth / 2, pwidth)
-        pheight = max(vheight / 2, pheight)

I would suggest removing it since there is a second limitation of 256*256 a bit below which seems enough to prevent aberrant values:

        pwidth = max(pwidth, 256)
        pheight = max(pheight, 256)

What do you think?

@renpytom

This comment has been minimized.

Copy link
Member

renpytom commented Dec 9, 2018

The main idea here is to stop people from dropping it below the 50% point, which is where aliasing starts occurring for a non-mipmapped texture. I should be adding mipmapping in 7.2, so we should be able to drop this there. (Though I think that shrinking the browser that small is a terrible idea, and it probably makes sense to configure things to pop up a new browser window rather than force people to view a game that small by default.)

More specifically, I'll drop this in the gl2 path, while leaving it intact in the gl renderer, which I'd like to avoid touching.

@Beuc

This comment has been minimized.

Copy link
Contributor

Beuc commented Dec 9, 2018

Oops, did I forgot to mention I was referring to a mobile browser? :)

@Beuc

This comment has been minimized.

Copy link
Contributor

Beuc commented Dec 13, 2018

I feel I'm missing something, because I realized Android is not affected by the /2 limit, e.g. a 1080p game is resized correctly on my 360p phone (/3). Even more, if forced in portrait mode the game area is tiny but still no stretching or partial offscreen.

The "/2" code I quoted above is outside of the if not renpy.mobile block - is Android not using gl/gldraw.pyx?

@renpytom renpytom closed this in 62637db Jan 11, 2019

@renpytom

This comment has been minimized.

Copy link
Member

renpytom commented Jan 12, 2019

I've removed this limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment