Logo Pending


On SCI Windows – Part 1 – SysWindow

Welcome to the first of a series of posts about window styles in SCI games. In this first entry I’ll go over the most basic of window styles available, the kernel-drawn one.

A regular old SCI window is drawn by the kernel’s RDrawWindow function. It can draw or not draw various parts. The type property that you can set on a SysWindow object yields the following possibilities:

nwNORMAL (stdWindow for those of us with the original source) looks like exactly that. A filled frame with a shadow. There’s nothing particularly awesome about these.
nwTRANSPARENT (wNoSave) windows forego the filling-in, revealing that the drop shadow isn’t two lines but a full rectangle. As the proper name implies, this skips taking a little screenshot of what’s underneath so when the window is closed things can be restored quickly.
nwNOFRAME (wNoBorder) windows only have the fill.
nwTITLE (wTitled) windows extend upwards a little bit to make room for a title bar. If the title property is zero, the title bar is left empty. If it’s not, it better point to a valid string.
Besides these basic styles, you can also combine them. Surprising or not, there is a proper window in this image, with a port, location, pen color and everything.
Some combinations are a little silly to look at…
…while others are simply useless. If there’s no frame, there’s no title bar!
The fill is of course not always white (assuming it’s applied in the first place) — setting the back property to the desired color palette index handles the fill, and the color property likewise affects the contents, as demonstrated in Leisure Suit Larry 3.

One last style bit is 128/0x80 wCustom, which has no SCI Studio/Companion counterpart constant and makes the kernel not draw anything at all. This is specifically for custom-drawn window frames, as we’ll cover in the next part.

The logic for RDrawWindow goes a little like this:

  1. If we don’t have wNoSave set, save the underbits.
  2. If we don’t have wCustom set
    1. If we don’t have wNoBorder set
      1. Draw the frame and drop shadow. We’ve already raised the roof in RNewWindow.
      2. If we have wTitle set, draw the bar and (if nonzero), the title text. We now have something like style 1 or 5.
    2. Shrink the window rectangle a bit.
    3. If we don’t have wNoSave set, draw the window interior. Basically, do style 2.
  3. Show what we have wrought.¹

And that’s all there is to know about how a SysWindow is drawn to the screen.

¹: actual comment at this step.

Like
1
[ ]

One thought on “On SCI Windows – Part 1 – SysWindow

  1. You might wonder why the example from LSL3 has a gray title bar and my demonstrations have a black title bar. This is simply a version difference. LSL3 is an SCI0 game, in 16-color EGA. The interpreter can guarantee that color 8 will be dark gray. SCI1 runs in 256-color VGA and the only guarantee it gets is that colors 0 and 255 will be black and white. Because it sets them up like that itself. In my personal fork SCI11+, the title bars are still black but you get an extra kernel command to change this.

Leave a Reply

Your email address will not be published. Required fields are marked *