SCI/FreeSCI/Graphics/Architecture

From ScummVM :: Wiki
< SCI‎ | FreeSCI‎ | Graphics
Revision as of 15:14, 20 January 2009 by Timofonic (talk | contribs) (Merging of the FreeSCI documentation. Page done.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Architecture

In extension of the architecture used up until FreeSCI 0.3.0, the new graphics subsystem now uses a total of six buffers:


Map Name # of buffers scaled bpp
visual 3 yes determined by driver
priority 2 yes 8
control 1 no 8


Of these, the visual and priority buffers have to be provided by the graphics driver, since they are relevant for display and may actually be present physically (since the priority map is nothing other than a Z buffer). The control map, a special buffer used by the interpreter to check whether moving objects hit obstacles on the screen or touch zones with special meanings, is only relevant for the interpreter and therefore handled one level above the graphics driver.

I will refer to the level above as the "operational layer". This layer handles all of the primitive graphical operations. It performs clipping, keeps track of modified regions, and emulates functions required but not supported natively by the graphics driver.

The operational layer is also responsible for the four pixmap operations, which draw background pictures, images, text, or mouse pointers. These pointers are only referred to by their respective ID numbers; they are retreived from the graphical resource manager. This graphical resource manager (GRM) is another separate subsystem- it retreives graphical resources in one of a set of standard formats, and translates them to the graphics driver's native format in one of several possible ways. It also receives hints from the operational layer to improve its caching strategy.

Finally, above the operational layer, another layer is situated: This widget layer provides abstract descriptions of things on the screen as objects, so-called widgets. It provides the primary interface for the interpreter to interact with.