/[projectaxis]/projectaxis/IsoEngine/IsoRenderer.h
ViewVC logotype

Diff of /projectaxis/IsoEngine/IsoRenderer.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by vovansim, Sat Jun 7 03:59:06 2003 UTC revision 1.2 by vovansim, Sat Sep 13 21:40:20 2003 UTC
# Line 1  Line 1 
 /** \file IsoRenderer.h  
  * Contains the IsoRenderer class, which combines several blitting optimizations into one easy-to-use package.  
  *  
  * @author <A href="mailto:vovansim@hotmail.com">Vovansim (aka Scorpion)</A>  
  * @version 1.0  
  * @date June 6, 2003  
  */  
   
1  #ifndef ISO_RENDERER_H  #ifndef ISO_RENDERER_H
2  #define ISO_RENDERER_H  #define ISO_RENDERER_H
3    
# Line 24  Line 16 
16  typedef void (*RENDERFN)(SDL_Surface* destination, RECT* clipRectangle, int destX, int destY, int mapX, int mapY);  typedef void (*RENDERFN)(SDL_Surface* destination, RECT* clipRectangle, int destX, int destY, int mapX, int mapY);
17    
18  /**  /**
  * Class IsoRenderer: the class that should be used to render the map and everything on it. Encapsulates all of the functionality required to render the map. Basically, the way it operates is: during the main body of the program loop, the class collects information on which areas of the screen need updating. This is done through several methods: addTile should be called when we know the coordinates of the tile on the map that needs updating (due to animation or whatever else) - the class will then automatically calculate the update rectangle and add it to the update list; addRect should be called when we know the rectangular area of the screen that needs to be updated (due to moving the GUI elements, for instance); finally, scrollFrame should be called when we need to scroll the view. Once all of the operations that might result in the map needing updating have been concluded, one should call the updateFrame method, which goes through the list of update rectangles and blits the areas affected onto the screen.  
19   *   *
20   * @todo Make the data members of the class private, and create the necessary accessors.   * @todo Make the data members of the class private, and create the necessary accessors.
21   * @todo Format the comments in emacs.   * @todo Format the comments in emacs.
22   * @todo Comment the functions.   * @todo Comment the functions.
  *  
  * @author <A href="mailto:vovansim@hotmail.com">Vovansim (aka Scorpion)</A>  
  * @version 1.0  
  * @date June 6, 2003  
23   */   */
24  class IsoRenderer {  class IsoRenderer {
25  public:  public:
# Line 80  public: Line 67  public:
67          //destructor          //destructor
68          virtual ~IsoRenderer();          virtual ~IsoRenderer();
69    
70          /** Sets the back buffer used for the game. */          //surfaces
71          void setBackBuffer(SDL_Surface* surface);          void setBackBuffer(SDL_Surface* surface);
         /** Sets the frame buffer used for the game. */  
72          void setFrameBuffer(SDL_Surface* surface);          void setFrameBuffer(SDL_Surface* surface);
73    
74          /** Sets the IsoTilePlotter used for the current instance of the game. */          //isocore components
75          void setPlotter(IsoTilePlotter* newPlotter);          void setPlotter(IsoTilePlotter* newPlotter);
         /** Sets the IsoTileWalker used for the current instance of the game. */  
76          void setWalker(IsoTileWalker* newWalker);          void setWalker(IsoTileWalker* newWalker);
         /** Sets the IsoMouseMap used for the current instance of the game. */  
77          void setMouseMap(IsoMouseMap* newMouseMap);          void setMouseMap(IsoMouseMap* newMouseMap);
         /** Sets the IsoScroller used for the current instance of the game. */  
78          void setScroller(IsoScroller* newScroller);          void setScroller(IsoScroller* newScroller);
79    
80          /** Sets the maximum number of update rectangles to keep track of during the game. */          //update list
81          void setUpdateRectCount(int maxRects);          void setUpdateRectCount(int maxRects);//sets up the rectangle list
82          /** Sets the size of the map (in tiles). */          //update map
83          void setMapSize(int newMapWidth, int newMapHeight);          void setMapSize(int newMapWidth, int newMapHeight);//sets up the update map
84          /** Sets the rendering function that will be called by the updateFrame method to render the tiles. */          //rendering functions
85          void setRenderFunction(RENDERFN newRenderFunction);          void setRenderFunction(RENDERFN newRenderFunction);
86          /** Sets the maximum extent rectangle of the tile, which is used to determine which neightbor tiles need updating when the addTile method is called. */          //extent rect
87          void setExtentRect(RECT* newExtent);          void setExtentRect(RECT* newExtent);
88          /** Adds an update rectangle to the list. This method should be called any time a rectangular area of the map needs updating. */          //add rect to list
89          void addRect(RECT* updateRect);          void addRect(RECT* updateRect);
         /** Adds a tile to the update list. This method should be called any time we know the coordinates of the tile that needs updating. */  
90          void addTile(int newMapX, int newMapY);          void addTile(int newMapX, int newMapY);
91          /** This method should be called whenever we want to scroll the map. The parameter values are in pixels. */          //scroll the frame
92          void scrollFrame(int scrollX, int scrollY);          void scrollFrame(int scrollX, int scrollY);
93          /** After the map areas have been marked dirty, it is time to update the map. Call this method to complete the blitting. */          //update the frame
94          void updateFrame();          void updateFrame();
95          ////////////////////////////// End Functions //////////////////////////////          ////////////////////////////// End Functions //////////////////////////////
96  };  };

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26