[Scummvm-devel] Features and graphics modes
Max Horn
max at quendi.de
Sat Mar 13 07:18:32 CET 2004
Am 13.03.2004 um 15:24 schrieb Marcus Comstedt:
>
> Max Horn <max at quendi.de> writes:
>
>> When the set screen size has an aspect ration of 640:400 = 320:200 =
>> 8:5, then strech it to 640:480 = 320:240 = 8:6 = 4:3
>>
>> So, you only have to do a vertical strech by a factor of 6/5.
>
> Wouldn't it make more sense to define it as stretching the image to
> fill the screen, rather than defining it as strething by 6/5? I.e. if
> an engine (hypothetically) opens a screen of 320:192, wouldn't it be
> better to stretch it by 5/4 than 6/5?
Well at this time, the aspect ratio correction is *ONLY* defined for
320x200 (and multiples thereof). For all other resolutions, it is
disabled (at least in the SDL backend).
The reason is that we only know the proper aspect ratio correction for
this very common resolution. If we ever add support for a bizarre game
running at 320x192, then we would have to figure out what the "proper"
aspect ratio for it might be. Maybe it should be stretched to 320x200,
or 320x240, or 320x382, or 320x220, or ...
Anyway, feel free to implement it to always stretch to a 4:3 ratio --
just be aware that it's totally impossible to tell if that's the right
thing to do :-). If we ever get support for such a weird game, then
we'll probably have to revamp the aspect ratio correction API anyway,
and allow setting a target size. Right now, however, this is not
needed, so for the sake of simplicity (and to ease porter's life), we
stick with the simple API we have.
>
>
>> Yes. And that already is a case. Look at common/system.cpp to find the
>> implementation of
>> bool OSystem::setGraphicsMode(const char *name);
>
> Ok. But why does it replace the name "default" with "2x"? I have
> only a single mode called "default". I have no mode called "2x".
The problem is that it's near impossible to define what is "default"
for all given backends. And not all backends will want to add "default"
to the list of their scalers (e.g. for the SDL backend this wouldn't
make sense).
I guess a "proper" fix for this might be to define a special
"kDefaultScalerMode" or whatever constant, which then can be passed to
setGraphicsMode, i.e. setGraphicsMode() could be changed to
setGraphicsMode.
if (mode == "default")
setGraphicsMode(kDefaultScalerMode);
else ..
For now, you can easily overload setGraphicsMode(const char*), or add
#ifdef's to common/system.cpp. I am reluctant to implement a "proper"
fix before we have feedback from other porters (right now you seem to
be the only porter who actually looked at the new OSystem stuff).
Cheers,
Max
More information about the Scummvm-devel
mailing list