home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-05 | 2.3 KB | 64 lines | [TEXT/R*ch] |
- /* ScreenFlip.h -- type definitions & other header file stuff.
- */
-
- // Include file for the GWorld offscreen drawing stuff.
- #include <QDoffscreen.h>
-
- // Flipping the screen is implemented as a kind of rudimentary state machine.
- // At any time the module is in one of four flip states. kHorizontal and
- // kVertical mean we're in the processing of doing a horizontal resp. vertical
- // screen flip (duh). kSwitch means we are going to determine which direction
- // the next flip will be in. kNone means we are in a state of rest
- // between flips. kSwitch always comes at the end of a kNone period.
- typedef enum
- {
- kHorizontal,
- kVertical,
- kSwitch,
- kNone
- }
- TFlipStates;
-
-
- // This is a secondary state, which controls the direction the ripples of
- // the current animation are moving in (for the kVertical and kHorizontal flip states).
- typedef enum
- {
- kInwards,
- kOutwards
- }
- TDirectionStates;
-
-
- // In the following data structure most two-element arrays store information
- // pertaining horizontal flips in the first element, and the same information
- // for the vertical case in the second element. This makes it possible to
- // write things like 'bufworld[kVertical]' or 'maxStep[kHorizontal]', which is
- // not only very clear, but also allows us to eliminate a lot of code duplication.
-
- typedef struct
- {
- GWorldPtr bufWorld[2]; // Small buffers for storing a row resp. column of pixels.
- GWorldPtr offWorld; // Large buffer for storing a copy of the entire screen.
-
- PixMapHandle screenMap; // Bitmap for an entire screen.
- PixMapHandle realMap; // Bitmap for the physical screen.
- PixMapHandle bufMap[2]; // Bitmaps associated with the bufWorld array.
-
- Rect strip[2]; // Which two columns/rows to swap this step.
- Rect bufRect[2]; // Bounding rectangles associated with bufWorld.
- Rect r; // Bounding rectangle of the screen.
-
- TFlipStates movement; // Current flip state.
- TDirectionStates direction; // Current ripple movement.
- int t; // The current step (each step, two columns/rows get switched).
-
- long startTick, delay; // Variables for keeping track of delays between flips.
- int maxStep[2]; // After this many steps before flip is finished.
-
- Boolean demoMode; // Are we currently in After Dark demo mode?
- Boolean instantFlip; // Corresponds to check box in module interface.
- }
- TFlipData, *TFlipDataPtr;
-
-