First post, by gulikoza
- Rank
- Oldbie
Hi,
Some of you might remember some (long? 😀) time ago, Moe and I started a project to see if we could port MacGLide (which is/was supposed to be a MAC port of OpenGlide) enhancements back to Linux & Windows (actually make it crossplatform using SDL). We never released the code since it barely built and the project somehow died soon after cause of lack of time. But there are some interesting ideas in the MacGLide fork including making OpenGL render at higher resolution than Glide thinks it's rendering. This is a patch to bring that functionality back to OpenGlide (a full circle 😀)
It's fairly simple, just the matter of correctly setting glViewport, resizing LFB reads/writes and presto - any resolution you want. I can't take all the credits, the code is originally taken from Macglide, modified for our SDL-Glide project and now ported to OpenGlide. I've tested it with a few games, there doesn't seem to be much problems. The LFB writes are bilinearly resized to target resolution, reads are a bit simpler (a simple nearest resize). I've also fixed some memory management problems (seems like OpenGlide was allocating twice the necessary space for buffers??). There might be problems if a game reads the LFB, adds some stuff, then writes the whole thing back (could look ugly because of the resizing). If that happens, there might be a reason to add some code to check and write only the pixels that have really changed...I have also added/copied the code for grLfb*Region (which in turn seems to be taken from the linux sst1 driver source), since this was totally broken/missing in OpenGlide.
A new config option was added: Resolution. It's a floating point where 0 specifies original/auto resolution, 1.0-16.0 are scale factors and anything larger than that is fixed width (with height calculated automatically, 4:3 AR assumed). That's how we made it in SDL-Glide project I haven't changed it now. Any comments/suggestions/problem reports are welcome.