This is morally equivalent to getWidgetRect, but takes into account the changes
to dimensions that MacText makes for borders and gutters and a text shadow.
Thus, these features are working again.
This change is required to support copies of the same cast member running in different channels.
* DIRECTOR: Move widget ownership from cast member to channel
* DIRECTOR: Cache cast dimensions from createWidget
* DIRECTOR: Add null checks for createWidget
* GRAPHICS: MACGUI: Clear active/hover WM references if the widget is destroyed
* DIRECTOR: LINGO: Re-add null check for kTheEditableText
* DIRECTOR: Avoid destroying widgets if the channel isn't dirty
* DIRECTOR: Fix dirty test
* DIRECTOR: Fix text field writeback
* DIRECTOR: Fix null cast check
* DIRECTOR: Add bbox as argument to createWidget
* DIRECTOR: Add setCast method to Channel
* DIRECTOR: Fix use-after-free in Channel::getMask
* DIRECTOR: Fix bounding box for Button sprites
* DIRECTOR: Cache widget dimensions in cast member
* DIRECTOR: Remove widget from channel if nextSprite is empty
* GRAPHICS: MACGUI: Fix MacText::splitString for empty string case
* DIRECTOR: Add null checks for movie and score in processEvents
Instead, there is an option to return the topmost non-focusable sprite, too.
Some scripts don't have buttons on them; they are just there for the hilite.
Now, rather than having a _castType in the sprite, I fixed the issue that might
have made this necessary in the first place -- overloading _castId with the
shape pattern whenever the sprite is a QuickDraw shape. There is now a separate
test function for QuickDraw shapes.
Now we only need to check with the channel to see if its contents need to be
re-rendered, and the channel takes care of updating its internal locations, as
well as those of the widgets.
This commit introduces several changes to the rendering pipeline.
- Rather than having a window for each score that is played, there is a Stage
in g_director that is only cleared when the upcoming stage has a different
size. This permits transitions still clean transitions between movies.
- Rather than relying upon general surface blitting functions, there is
progress toward a custom blitter than makes working with inks much easier. A
pixelwise function, inkDrawPixel, has been introduced.
- The mask-based approach to incremental rendering has been abandoned, as it
caused performance issues and strange rendering bugs. Now the renderer
operates on a traditional list of dirty rects that must be redrawn.
- QuickDraw shapes are more closely integrated with the renderer, and they do
not require a temporary surface to draw.
Some sprite properties are considered global across all frames.
This can be seen in Chop Suey where e.g the exitFrame script for
frame 1 will change the visibility on sprite channels that aren't used
until frame 3. This adds a new global list of sprite channel properties
that aren't attached to a Frame.
This just tracks visibility for now, additional properties can be moved
over from Sprite when they are confirmed to be global.