[Scummvm-devel] SCI: line drawing functions

Jordi Vilalta jvprat at gmail.com
Mon Feb 23 23:14:11 CET 2009


Hi,

To add a bit of background, it must be noted that FreeSCI supported
rendering vectorial graphics to arbitrarily scaled surfaces. That
means that it could render directly to a 640x400 with higher
resolution than rendering to 320x200 and later scaling the bitmap.

Additionally SCI has several buffers (visuals, priorities, and
probably something more I'm missing). The most important buffers here
are the internal ones, which interact with the game logic. Right now
all buffers are scaled together, so all draw operations happen at the
same resolution. While it simplifies the code it introduces
differences in behaviour when compared to the original SCI
interpreter. It seems most of these bugs were already fixed in FreeSCI
but some of them remain open.

If I recall correctly, the current SCI gfx driver for ScummVM has 1x
scaling hardcoded because it wasn't easy to configure from the user's
point of view, but it could be reenabled if desired. The point is: the
engine already supports it, do we want to keep this feature or must we
strip it? I have no preference on that, but I think some people may
like it, and whoever doesn't like it just would have to disable it.

2009/2/23 Max Horn:
>
> Am 23.02.2009 um 05:19 schrieb Filippos Karapetis:
>
>> Hello
>>
>> I was having a look at SCI's line drawing functions, and have some
>> questions
>> - would it be safe to replace the line drawing functions inside gfx/
>> gfx_support.cpp and gfx/gfx_line.cpp with our
>> Graphics::drawThickLine() function? I personally don't see any
>> issues with this, and I've tested some SCI games with this change,
>> and they seem to run correctly, but I just wanted to get a second
>> opinion. Our line code is in graphics/primitives.cpp and is based on
>> Bresenham's line algorithm.
>> - it seems that there is provision in the code to draw thicker lines
>> than 1 pixel, but it seems only line thickness of 1 is used... so we
>> could replace this with our simpler Graphics::drawLine function,
>> instead of Graphics::drawThickLine, right?
>
>
> I would be careful with replacing. If you are sure the two methods
> produce pixel identical output, it could be considered. But if not,
> better don't do it right now, or wait until Walter or Lars confirmed
> it is OK. As in AGI, stuff might depend on specific pixels being set
> or not, for priority screens. Well, or not, but an expert should clear
> this.

I agree with Max in that it should be safe just if the outputs are
pixel identical. Using scales bigger than 1x will probably be the
trickiest since line thickness will probably vary. Anyway I'd also
like to hear an expert's opinion ;)

Regards,
Jordi




More information about the Scummvm-devel mailing list