[gzdoom a95edc3] game screen not stretched
Posted: Sat Apr 11, 2015 11:20
As I really hate repeating myself, I won't, just point you back to the thread, where I've explained the problem in detail.
On the other hand, a slightly different hack, that leads to somewhat interesting results.
- initial screen is in top left corner, but isn't stretched and its upper part is unnecessarily cleared
- load/save menu is drawn incorrectly, but still somewhat usable
- once the game starts, hud and menu are drawn in the top left corner in the internal res, the gamescreen itself is drawn at incorrect ratio (takes the whole width, but height is computed in an odd way - back on zdoom forum I've incorrectly called that "skybox", but with this hack it's more clear it's a mater of incorrect ratio)
On that last note, once the hack is turned into a proper fix, it might lead to a way for modifying GZDoom for a simple implementation of "keep original ratio in fullscreen" option.
...
Latest in the hack series. Funny thing: this one is both most broken and most working yet.
- I'm nearly sure it's broken on Windows
- I've tested only with internal res 800x600 (though should work with any of actual 4:3 (meaning - not for 320x200)) and a 16:10 screen
- before you ask: black bars at the sides were intended (for reasons that should be somewhat clear)
- game screen, hud and menus are drawn (AFAICT) correctly
- not the save/load screen though (didn't found the relevant code)
- oops, map is broken in a funny way (namely the content is correct, but not the background - any chance it's the same codepath as load/save menus ?)
Now, could I have some constructive feedback ?
...
...and shortly after writing the above, I found that place. As I guessed, it was the same place for both map and load save menu.
Now the only important thing remaining to complete this hack is finding where the little hickup upon loading a save comes from - for an eye blink or two screen size is wrong. Other than that, I'd call it done.
...
OK, a bit more tinkering has led to this. Sorry for history wipeout, but with 3 attachments per post limit, I needed to delete something - that didn't really mean I needed to delete all of it, but given somewhat still sub-par quality of the hack not all that much is lost.
That hickup were (as most of you had likely guessed) wipers.
Current issues:
- still most likely breaks Windows
- still just under previously mentioned int.res/monitor restrictions
- screenshots are incorrect (fixing that might be a bit more complicated than the wipers)
- not sure if that .ortho change in gl_renderer.cpp is needed (it just mirrors the separation in a different part of code)
- don't quite understand when 'bounds!=NULL' is hit in FGLRenderer::SetViewport, so can't tell if that part is correct
- somewhat uncertain about scaling the bounding box in FGLRenderer::Clear, but it seems to work
- some of the parts only work correctly cause in Linux GetHeight() == GetTrueHeight()
- as I don't really understand the renderer, I can't really tell if it would be possible for the Wiper to retrieve the texture at internal res and only render it as fullscreen res (would be more consistent)
Unrelated, but it seems that in FGLRenderer::DrawTexture, 'int btm = (SCREENHEIGHT - screen->GetHeight()) / 2;' is effectively 'int btm = 0;' for all of the current platforms.
...
Latest iteration (I wonder when I hit the size limit of a single post):
- screenshots seem fixed; as do savepics
- to fix savepics, I've made a change, reverting a part of my previous change to FGLRenderer::SetViewport (that 'bounds!=NULL'); as they put it "this code smells" - it gives me correct result, but in no way it should be right
Well, if anything's still broken (besides what was noted above), I'd like to know about it, as it's likely some part of the game I haven't looked at.
...
No real changes this time, just removed a use of a magic number (which would mater only for multihead setups, which I'm not really in position to test).
Removal of the previous version therefore deliberate.
...
A few months have passed...yet surprisingly little progress has been made.
OK, so this version does bring significant changes over the previous one (simplifying and correcting a function, dropping a few unnecessary changes, etc.), but basically this code is just bitrotting.
A minor catch about this version is that the whole SDLGLVideo::ScaleBoxSimple was written with my incomplete ratio hack in mind, therefore it looks quite well...as long as ZDoom isn't adding its own ratio corrections into the mix.
Still, even without that console text gets ridiculously small in fullscreen...
On the other hand, a slightly different hack, that leads to somewhat interesting results.
- initial screen is in top left corner, but isn't stretched and its upper part is unnecessarily cleared
- load/save menu is drawn incorrectly, but still somewhat usable
- once the game starts, hud and menu are drawn in the top left corner in the internal res, the gamescreen itself is drawn at incorrect ratio (takes the whole width, but height is computed in an odd way - back on zdoom forum I've incorrectly called that "skybox", but with this hack it's more clear it's a mater of incorrect ratio)
On that last note, once the hack is turned into a proper fix, it might lead to a way for modifying GZDoom for a simple implementation of "keep original ratio in fullscreen" option.
...
Latest in the hack series. Funny thing: this one is both most broken and most working yet.
- I'm nearly sure it's broken on Windows
- I've tested only with internal res 800x600 (though should work with any of actual 4:3 (meaning - not for 320x200)) and a 16:10 screen
- before you ask: black bars at the sides were intended (for reasons that should be somewhat clear)
- game screen, hud and menus are drawn (AFAICT) correctly
- not the save/load screen though (didn't found the relevant code)
- oops, map is broken in a funny way (namely the content is correct, but not the background - any chance it's the same codepath as load/save menus ?)
Now, could I have some constructive feedback ?
...
...and shortly after writing the above, I found that place. As I guessed, it was the same place for both map and load save menu.
Now the only important thing remaining to complete this hack is finding where the little hickup upon loading a save comes from - for an eye blink or two screen size is wrong. Other than that, I'd call it done.
...
OK, a bit more tinkering has led to this. Sorry for history wipeout, but with 3 attachments per post limit, I needed to delete something - that didn't really mean I needed to delete all of it, but given somewhat still sub-par quality of the hack not all that much is lost.
That hickup were (as most of you had likely guessed) wipers.
Current issues:
- still most likely breaks Windows
- still just under previously mentioned int.res/monitor restrictions
- screenshots are incorrect (fixing that might be a bit more complicated than the wipers)
- not sure if that .ortho change in gl_renderer.cpp is needed (it just mirrors the separation in a different part of code)
- don't quite understand when 'bounds!=NULL' is hit in FGLRenderer::SetViewport, so can't tell if that part is correct
- somewhat uncertain about scaling the bounding box in FGLRenderer::Clear, but it seems to work
- some of the parts only work correctly cause in Linux GetHeight() == GetTrueHeight()
- as I don't really understand the renderer, I can't really tell if it would be possible for the Wiper to retrieve the texture at internal res and only render it as fullscreen res (would be more consistent)
Unrelated, but it seems that in FGLRenderer::DrawTexture, 'int btm = (SCREENHEIGHT - screen->GetHeight()) / 2;' is effectively 'int btm = 0;' for all of the current platforms.
...
Latest iteration (I wonder when I hit the size limit of a single post):
- screenshots seem fixed; as do savepics
- to fix savepics, I've made a change, reverting a part of my previous change to FGLRenderer::SetViewport (that 'bounds!=NULL'); as they put it "this code smells" - it gives me correct result, but in no way it should be right
Well, if anything's still broken (besides what was noted above), I'd like to know about it, as it's likely some part of the game I haven't looked at.
...
No real changes this time, just removed a use of a magic number (which would mater only for multihead setups, which I'm not really in position to test).
Removal of the previous version therefore deliberate.
...
A few months have passed...yet surprisingly little progress has been made.
OK, so this version does bring significant changes over the previous one (simplifying and correcting a function, dropping a few unnecessary changes, etc.), but basically this code is just bitrotting.
A minor catch about this version is that the whole SDLGLVideo::ScaleBoxSimple was written with my incomplete ratio hack in mind, therefore it looks quite well...as long as ZDoom isn't adding its own ratio corrections into the mix.
Still, even without that console text gets ridiculously small in fullscreen...