Improve doxygen documentation for path and minimap subsystems.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5961 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-09-07 21:44:06 +00:00
parent 4def288387
commit e26af6f48b
3 changed files with 37 additions and 42 deletions

View File

@ -29,6 +29,7 @@
/** Return values for routing
*
* @ingroup pathfinding
* @{
*/
typedef enum _fpath_retval
{
@ -38,22 +39,16 @@ typedef enum _fpath_retval
} FPATH_RETVAL;
/** Initialise the path-finding module.
*
* @ingroup pathfinding
*/
extern BOOL fpathInitialise(void);
/** Shutdown the path-finding module.
*
* @ingroup
*/
extern void fpathShutdown(void);
extern void fpathUpdate(void);
/** Find a route for a droid to a location.
*
* @ingroup pathfinding
*/
extern FPATH_RETVAL fpathDroidRoute(DROID* psDroid, SDWORD targetX, SDWORD targetY);
@ -64,8 +59,6 @@ extern FPATH_RETVAL fpathDroidRoute(DROID* psDroid, SDWORD targetX, SDWORD targe
*
* @param x,y the parameters of the map tile to check
* @return true if the given tile is blocking for this droid
*
* @ingroup pathfinding
*/
extern BOOL fpathBlockingTile(SDWORD x, SDWORD y, PROPULSION_TYPE propulsion);
@ -75,15 +68,15 @@ extern BOOL fpathBlockingTile(SDWORD x, SDWORD y, PROPULSION_TYPE propulsion);
* taking obstructions into consideration.
*
* Used for instance by VTOLs. Function is thread-safe.
*
* @ingroup pathfinding
*/
extern void fpathSetDirectRoute(DROID* psDroid, SDWORD targetX, SDWORD targetY);
/** Clean up path jobs and results for a droid. Function is thread-safe. */
extern void fpathRemoveDroidData(int id);
// Unit testing
/** Unit testing. */
void fpathTest(int x, int y, int x2, int y2);
/** @} */
#endif // __INCLUDED_SRC_FPATH_H__

View File

@ -174,16 +174,14 @@ float GetRadarZoom(void)
return RadarZoom;
}
// Calculate the radar pixel sizes. Returns pixels per tile.
//
/** Calculate the radar pixel sizes. Returns pixels per tile. */
static void CalcRadarPixelSize(float *SizeH, float *SizeV)
{
*SizeH = (float)radarHeight / (float)radarTexHeight;
*SizeV = (float)radarWidth / (float)radarTexWidth;
}
// Given a position within the radar, return a world coordinate.
//
/** Given a position within the radar, return a world coordinate. */
void CalcRadarPosition(int mX, int mY, int *PosX, int *PosY)
{
const int posX = mX - radarX; // pixel position within radar
@ -312,8 +310,7 @@ static PIELIGHT appliedRadarColour(RADAR_DRAW_MODE radarDrawMode, MAPTILE *WTile
return WScr;
}
// Draw the map tiles on the radar.
//
/** Draw the map tiles on the radar. */
static void DrawRadarTiles(UDWORD *screen)
{
SDWORD x, y;
@ -335,8 +332,7 @@ static void DrawRadarTiles(UDWORD *screen)
}
}
// Draw the droids and structure positions on the radar.
//
/** Draw the droids and structure positions on the radar. */
static void DrawRadarObjects(UDWORD *screen)
{
UBYTE clan;
@ -450,8 +446,7 @@ static void DrawRadarObjects(UDWORD *screen)
}
}
// Rotate an array of 2d vectors about a given angle, also translates them after rotating.
//
/** Rotate an array of 2d vectors about a given angle, also translates them after rotating. */
static void RotateVector2D(Vector3i *Vector, Vector3i *TVector, Vector3i *Pos, int Angle, int Count)
{
int Cos = COS(Angle);
@ -505,7 +500,7 @@ static SDWORD getLengthAdjust( void )
return dif / 2;
}
/* Draws a Myth/FF7 style viewing window */
/** Draws a Myth/FF7 style viewing window */
static void drawViewingWindow(UDWORD x, UDWORD y, float pixSizeH, float pixSizeV)
{
Vector3i v[4], tv[4], centre;
@ -573,8 +568,7 @@ static void DrawRadarExtras(float pixSizeH, float pixSizeV)
RenderWindowFrame(FRAME_RADAR, radarX - 1, radarY - 1, radarWidth + 2, radarHeight + 2);
}
// Does a screen coordinate lie within the radar area?
//
/** Does a screen coordinate lie within the radar area? */
BOOL CoordInRadar(int x,int y)
{
if (x >= radarX && x < radarX + radarWidth && y >= radarY && y < radarY + radarHeight)

View File

@ -18,41 +18,49 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file radar.h
* Minimap code.
* @defgroup Minimap Minimap (radar) subsystem.
* @{
*/
#ifndef __INCLUDED_SRC_RADAR_H__
#define __INCLUDED_SRC_RADAR_H__
void radarColour(UDWORD tileNumber, uint8_t r, uint8_t g, uint8_t b);
void radarColour(UDWORD tileNumber, uint8_t r, uint8_t g, uint8_t b); ///< Set radar colour for given terrain type.
#define MAX_RADARZOOM 2.50f
#define MIN_RADARZOOM 0.75f
#define RADARZOOM_STEP 0.25f
/* Radar.h */
extern void resetRadarRedraw(void);
extern BOOL InitRadar(void);
extern BOOL ShutdownRadar(void);
extern BOOL resizeRadar(void);
extern void drawRadar(void);
extern void CalcRadarPosition(int mX, int mY, int *PosX, int *PosY);
extern void SetRadarZoom(float ZoomLevel);
extern float GetRadarZoom(void);
extern BOOL CoordInRadar(int x,int y);
extern BOOL InitRadar(void); ///< Initialize minimap subsystem.
extern BOOL ShutdownRadar(void); ///< Shutdown minimap subsystem.
extern BOOL resizeRadar(void); ///< Recalculate minimap size. For initialization code only.
extern void drawRadar(void); ///< Draw the minimap on the screen.
extern void CalcRadarPosition(int mX, int mY, int *PosX, int *PosY); ///< Given a position within the radar, returns a world coordinate.
extern void SetRadarZoom(float ZoomLevel); ///< Set current zoom level. 1.0 is 1:1 resolution.
extern float GetRadarZoom(void); ///< Get current zoom level.
extern BOOL CoordInRadar(int x, int y); ///< Is screen coordinate inside minimap?
//different mini-map draw modes
/** Different mini-map draw modes. */
typedef enum _radar_draw_mode
{
RADAR_MODE_TERRAIN, //draw texture map
RADAR_MODE_DEFAULT = RADAR_MODE_TERRAIN,
RADAR_MODE_HEIGHT_MAP, //draw height map
RADAR_MODE_TERRAIN, ///< Draw terrain map
RADAR_MODE_DEFAULT = RADAR_MODE_TERRAIN, ///< Default is terrain map
RADAR_MODE_HEIGHT_MAP, ///< Draw height map
RADAR_MODE_COMBINED,
RADAR_MODE_NO_TERRAIN,
RADAR_MODE_NO_TERRAIN, ///< Only display objects
NUM_RADAR_MODES
}RADAR_DRAW_MODE;
extern BOOL bEnemyAllyRadarColor; //enemy/ally radar color
extern RADAR_DRAW_MODE radarDrawMode; //current mini-map mode
extern BOOL bEnemyAllyRadarColor; ///< Enemy/ally minimap color
extern RADAR_DRAW_MODE radarDrawMode; ///< Current minimap mode
extern void radarInitVars(void);
extern void radarInitVars(void); ///< Recalculate minimap variables. For initialization code only.
extern PIELIGHT clanColours[MAX_PLAYERS];
/** @} */
#endif // __INCLUDED_SRC_RADAR_H__