Thak--Graphics

BlastCBar  (Matt Wood)
    Purpose: Blast the control bar across the bottom of the screen. Reads from the CBar
                    Segment and blasts it to the ScreenBuffer.
    Inputs: None.
    Outputs: Splashes Control Bar across the bottom of the screen buffer.
    Notes: AX will not be maintained. Similar to DrawScreen in ECE 291, Fall 98, MP4.
 

DrawSelectedUnit   (Matt Wood)
    Purpose: Draws a portrait of the currently selected unit in the player's control bar.
    Inputs: Checks the variable PlayerSelected.
    Outputs: Draws appropriate portrait (or lack thereof) into the screen buffer.
    Notes: AX and BX will be modified.

DrawSUHealth (Matt Wood)
    Purpose: Draws a health bar for the selected unit in the control bar.
    Inputs: Reads PlayerSelected variable to determine which player is selected,
               then processes player's structure to determine health of that unit.
    Outputs: Draws a health bar to the screen buffer.
    Notes: AX will not be maintained. Invokes DrawHealthTick when needed to draw tick of health.
               Invokes DrawSUName to draw the Selected unit's name.

DrawHealthTick   (Matt Wood)
    Purpose: Draws tick of health for the player's health bar.
    Inputs: Invoked with TickLength  -- Length of health tick to draw.
                                    TickCorner -- Starting position in ScreenBuffer to draw.
                                    Color          -- Color of Tick to draw.
    Outputs: Draws One "tick" of health in the player's health bar.
    Notes: AX will not be maintained. Invoked by DrawSUHealth

DrawSUName  (Matt Wood)
    Purpose: Draws the name of the selected unit in the player's control bar.
                  (Caveman, Hut, Thak)
    Inputs: Checks PlayerSelected, Draws name of selected unit.
    Outputs: Draws Name of selected unit to screen buffer.
    Notes: AX and BX are not maintained. Invoked by DrawSUHealth.

LoadPCX    (Matt Wood, based on lab manual with palette loading removed)
    Purpose: Loads (decompresses) a .PCX image into a specified segment.
    Inputs: AX = offset of segment to write into
               DX = offset of string to filename to read from
    Notes: Largely based on MP4 function LoadPCX, with palette loading removed to
               optimize graphics speed by not reloading the palette.

LoadPCXFirst    (Lab Manual, MP4)
    Loads (decompresses) a .PCX image into a specified segment.
    Inputs: AX = offset of segment to write into
               DX = offset of string to filename to read from
    Notes: Same as lab manual Load PCX, loads and decodes PCX file and loads the palette
               Used only once at the beginning of the program to avoid reloading the palette.

InitBuf    (Matt Wood, Similar to MP4, minus the Z buffer)
    Purpose: Initializes the ScreenBuffer to all Black pixels.
    Inputs: None.
    Notes: Same as MP4 function, less the ZBuffer. Initializes the screen buffer to all black pixels.

DrawScreen    (Matt Wood, Same as MP4)
    Purpose: Blasts ScreenBuffer onto the video page.
    Inputs: None.
    Outputs: Writes contents of ScreenBuffer to Video Memory.
    Notes: Same as MP4 function. CX and AX will not be maintained.

DrawPoint    (Matt Wood, Similar to MP4)
    Purpose: Draws a point at (x,y) with a given color. Guarantees point is on screen.
    Inputs: Invoked with X position and Y position of point to draw, and in what color.
    Outputs: Draws pixel to ScreenBuffer.
    Notes: Similar to MP4 function.  AX will not be maintained.

DrawOwnership   (Matt Wood)
    Purpose: Draws appropriate color block of ownership for units. Red block indicates unit is owned by current player, blue
                   by other player.
    Inputs: Invoked with Selected -- Flag indicating whether or not to draw green dot to indicate unit is selected.
                                    X           -- X coordinate of top left corner of block
                                    Y           -- Y coordinate of top left corner of block
                                    Color    -- Color to draw block in (red or blue)
    Outputs: Draws a block of color indicating who owns this unit.
    Notes: AX will not be maintained. Invoked by DrawGameScreen. Invokes DrawPoint.

DrawGameScreen   (Matt Wood)
    Purpose: Invoked to draw the current viewable section of the game screen.
    Inputs: None, checks ViewPortX and ViewPortY to determine current visible portion of game.
    Outputs: Draws all background, units, and ownership boxes that are currently visible
                 on screen.
    Notes: AX and BX will not be maintained. Invokes DrawOwnership to draw ownership block,
               invokes DrawGSObject to draw the background, and invokes DrawGSUnits to draw
               cavemen.

DrawGSObject    (Matt Wood)
    Purpose: Draws an object (terrain or wall) onto the game screen.
    Inputs: Invoked with ObjectCorner -- Corner in DrawMap where drawing should begin.
                                    ObjectSize   -- Width of Background or Wall segment to draw.
                                    ColorMask    -- A flag indicating whether or not green should be masked.
    Outputs: Draws terrain or walls to the screenbuffer.
    Notes: AX will not be maintained. Invoked by DrawGameScreen. BX should be set to the upper left corner of where
                to draw in the screen buffer.
                ES should be the SBSeg.

DrawGSUnits       (Matt Wood)
    Purpose: Draws a unit (hut, wall, caveman) onto the game screen.
    Inputs: Invoked with UnitSize -- Indicates width of unit to draw.
    Outputs: Draws Current unit to appropriate position on GameScreen.
    Notes: AX will not be maintained. Invoked by DrawGameScreen.
               SI should point to XPos of unit to be drawn.
               DI should contain the position in the DrawMap to Draw.

ScrollScreen      (Matt Wood)
    Purpose: Checks if the Viewport needs to be scrolled, and adjusts ViewPort X and Y if
                   necessary.
    Inputs: Checks to see if any of the directional arrows have been pressed. (set by the keyboard isr)
    Outputs: Modifies ViewPortX and ViewPortY if necessary.
    Notes: None.

DrawMinimap    (Matt Wood)
    Purpose: Draws a minimap in the player's control bar.
    Inputs: None.  Pulls data from MyUnits, OtherUnits, and GameGrid.
    Outputs: Draws a minimap for the current player.  Red indicates own units,
                  blue other player's units, green grass, brown wall, and gray rock.
    Notes: Ax will not be maintained. Invokes DrawMiniBlock to draw blocks of color.

DrawMiniBlock    (Matt Wood)
    Purpose: Draws a block of color in the Minimap for a player.
                  ES should be the SBSeg.
    Inputs: Invoked with BlockCorner -- Position in ScreenBuffer to start drawing block
                                    BlockSize   -- Width of block to draw.
                                    Color       -- Color block should be drawn in.
    Outputs: Draws a block of specified size and color in the minimap.
    Notes: Ax will not be maintained. Invoked by DrawMinimap.

ScrollIntro    (Matt Wood)
    Purpose: Provides Scrolling effect during the end of the introduction sequence.
                  Scrolls starfield and hut faster than Thak graphic, which is masked.
                  Also animates hut to simulate burning.
    Inputs: None.
    Outputs: Draws a multilayer scrolling effect with animation.
    Notes: Ax will not be maintained. Invoked at beginning of game.

DrawCavemanBuild    (Matt Wood)
    Purpose: Draws a timer showing the progress of a caveman's training in the hut.
    Inputs: None.  Checks CavemanBuild variable.
    Outputs: Draws a Caveman Build indicator on the control bar.
    Notes: Ax will not be maintained. Invokes DrawHealthTick.


Back to Main