SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Help

Reply
 
Thread Tools Search this Thread
Old 07-10-2017   #1
Lach
what the thok mate??
 
Lach's Avatar
Default Do screen resolutions differ among setups?

I'm trying to test whether my HUD Lua script works consistently on all resolutions. I noticed that when I ran srb2win with OpenGL, the list of available resolutions was very different to the list of available resolutions when I ran srb2dd on Software.

I can't properly run Software with srb2win, nor can I use OpenGL with srb2dd. I didn't think this would be an issue at first, but now I fear it may mean there are resolutions I cannot test on.

My fullscreen resolution is 1400 x 900. My question is, if I can get my script to work with all the resolutions currently available to me, will it work with the ones I cannot test on, assuming there are any?

Here are my available resolutions, from SDL2 OpenGL and DirectDraw Software respectively.



Lach is offline   Reply With Quote
Old 07-11-2017   #2
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

As far as I'm aware from checking the source code, srb2dd and srb2win are different regarding the list of resolutions... in that srb2dd makes a list of resolutions that are "available" for the computer or such I think, while srb2win's list of resolutions are currently all pre-defined in the source code. (I think srb2win's was originally meant to be the list of windowed mode resolutions, but it seems they got turned into the definitive list for fullscreen too when SDL2 was being implemented?)
Monster Iestyn is online now   Reply With Quote
Old 07-11-2017   #3
AlamGBC
WOO! GO ME! YAHOO!
Administrator
 
AlamGBC's Avatar
Default

Quote:
Originally Posted by Monster Iestyn View Post
As far as I'm aware from checking the source code, srb2dd and srb2win are different regarding the list of resolutions... in that srb2dd makes a list of resolutions that are "available" for the computer or such I think, while srb2win's list of resolutions are currently all pre-defined in the source code. (I think srb2win's was originally meant to be the list of windowed mode resolutions, but it seems they got turned into the definitive list for fullscreen too when SDL2 was being implemented?)
Well, the OLD SDL 1.2 code kept two display lists, one for windowed and another for fullscreen

But in the SDL 2.0 interface code, we keep a static list of screen modes with diff aspect ratios (1.60 (DOOM), 1.3 and 1.66)

We can add more modes, but we limit it to 18 modes due to how the video mode menu displays all the modes
__________________
"remember, hacking SRB2 is a good thing, cracking it's save games is not" - Alam and Logan Arias

3DS FC: 0473-7778-0919
AlamGBC is offline   Reply With Quote
Old 07-11-2017   #4
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

To directly answer the question at hand: the modes in srb2win are the same between software and OGL, so any resolutions there will be the only resolutions available once srb2dd is fully deprecated (once the SDL2 builds work well for everyone). However, I'd suggest testing in software mode for different resolutions; OGL stretches the HUD out so the standard 320x200 grid covers the window regardless of resolution, while software scales most things up only to the next integer scale value and doesn't distort by aspect ratio.

In general, if you're coding for general resolution testing and properly using V_SNAPTO*, your HUD hooks should be compatible with all resolutions. Some specific cases, like full-screen effects or object-tracking HUD items, will need special considerations, though, so testing in different resolutions is always good.

As an aside, the reason green resolutions (multiples of 320x200, not just any 16:10 resolution) are recommended for general play is because of this scaling behavior; all green resolutions will map HUD drawing calls the same way (barring V_NOSCALEPATCH shenanigans, which are an advanced use case) which makes supporting them all incredibly easy.
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 07-11-2017   #5
Lach
what the thok mate??
 
Lach's Avatar
Default

Quote:
Originally Posted by RedEnchilada View Post
However, I'd suggest testing in software mode for different resolutions; OGL stretches the HUD out so the standard 320x200 grid covers the window regardless of resolution, while software scales most things up only to the next integer scale value and doesn't distort by aspect ratio.
I'm well aware of the differences between Software and OpenGL, and I have written my code accordingly. The thing is, I can't be sure that the Software version of the code works on the resolutions I can't test on (i.e. the ones that srb2win supports that DirectDraw can't).
Quote:
Originally Posted by Lach View Post
I can't properly run Software with srb2win, nor can I use OpenGL with srb2dd. I didn't think this would be an issue at first, but now I fear it may mean there are resolutions I cannot test on.
Because of the way OpenGL works I think it certain that the script will work for all of SDL2's OpenGL resolutions. Narrowing my question down to this, it would be: If my script works for all the resolutions listed in my DirectDraw Software setup, will it work for all the ones in SDL2?

If it helps, here is the line of code in question:
Code:
elseif v.renderer() == "software"
	v.draw(v.width()-28*vx,4*vy, v.cachePatch("HUD_CRBX"), V_NOSCALESTART)
end
(vx and vy are the integer values for v.dupx() and v.dupy() respectively.)
Lach is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.