s#///#///<# for doxygen docu, and tab cleaning

This commit is contained in:
jarod42 2004-04-06 20:50:04 +00:00
parent 24e9bbb014
commit c477e26366
45 changed files with 2642 additions and 2667 deletions

View file

@ -47,17 +47,17 @@
----------------------------------------------------------------------------*/
enum _diplomacy_ {
DiplomacyAllied, /// Ally with opponent
DiplomacyNeutral, /// Don't attack be neutral
DiplomacyEnemy, /// Attack opponent
DiplomacyCrazy, /// Ally and attack opponent
}; /// Diplomacy states for CommandDiplomacy
DiplomacyAllied, ///< Ally with opponent
DiplomacyNeutral, ///< Don't attack be neutral
DiplomacyEnemy, ///< Attack opponent
DiplomacyCrazy, ///< Ally and attack opponent
}; ///< Diplomacy states for CommandDiplomacy
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern unsigned SyncHash; /// Hash calculated to find sync failures
extern unsigned SyncHash; ///< Hash calculated to find sync failures
/*----------------------------------------------------------------------------
-- Functions

View file

@ -43,23 +43,23 @@
-- Variables
----------------------------------------------------------------------------*/
extern int AiSleepCycles; /// Ai sleeps # cycles
extern int AiTimeFactor; /// Adjust the AI build times
extern int AiCostFactor; /// Adjust the AI costs
extern int AiSleepCycles; ///< Ai sleeps # cycles
extern int AiTimeFactor; ///< Adjust the AI build times
extern int AiCostFactor; ///< Adjust the AI costs
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
extern void AiEachCycle(Player* player); /// Called each game cycle
extern void AiEachSecond(Player* player); /// Called each second
extern void AiEachCycle(Player* player); ///< Called each game cycle
extern void AiEachSecond(Player* player); ///< Called each second
extern void InitAiModule(void); /// Init AI global structures
extern void AiInit(Player* player); /// Init AI for this player
extern void CleanAi(void); /// Cleanup the AI module
extern void SaveAi(CLFile*file); /// Save the AI state
extern void InitAiModule(void); ///< Init AI global structures
extern void AiInit(Player* player); ///< Init AI for this player
extern void CleanAi(void); ///< Cleanup the AI module
extern void SaveAi(CLFile*file); ///< Save the AI state
extern void AiCclRegister(void); /// Register ccl features
extern void AiCclRegister(void); ///< Register ccl features
/*--------------------------------------------------------
-- Call Backs/Triggers

View file

@ -51,34 +51,34 @@ typedef struct _avi_frame_buffer_ AviFrameBuffer;
** Used to stored read and used frames.
*/
struct _avi_frame_buffer_ {
AviFrameBuffer* Next; /// Next buffer
int Length; /// Buffer length
unsigned char Data[1]; /// Buffer data
AviFrameBuffer* Next; ///< Next buffer
int Length; ///< Buffer length
unsigned char Data[1]; ///< Buffer data
};
/**
** Avi file handle structure
*/
typedef struct _avi_file_ {
CLFile* FileHandle; /// File handle
CLFile* FileHandle; ///< File handle
// Video streams
char VideoCodec[8]; /// Video codec
int Width; /// Video frame width
int Height; /// Video frame height
int FPS100; /// Frames per second * 100
long NumFrames; /// Number of video frames
int VideoStream; /// Video stream number
unsigned long VideoTag; /// Video stream tag
AviFrameBuffer* VideoFrames; /// Video frames
AviFrameBuffer** VideoFramesTail; /// Video frames tail pointer
AviFrameBuffer* VideoBuffer; /// Current video frame buffer
char VideoCodec[8]; ///< Video codec
int Width; ///< Video frame width
int Height; ///< Video frame height
int FPS100; ///< Frames per second * 100
long NumFrames; ///< Number of video frames
int VideoStream; ///< Video stream number
unsigned long VideoTag; ///< Video stream tag
AviFrameBuffer* VideoFrames; ///< Video frames
AviFrameBuffer** VideoFramesTail; ///< Video frames tail pointer
AviFrameBuffer* VideoBuffer; ///< Current video frame buffer
// Audio streams
int AudioStream; /// Audio stream number
unsigned long AudioTag; /// Audio stream tag
AviFrameBuffer* AudioFrames; /// Audio frames
AviFrameBuffer** AudioFramesTail; /// Audio frames tail pointer
AviFrameBuffer* AudioBuffer; /// Current audio frame buffer
int AudioRemain; /// Remaining bytes in buffer
int AudioStream; ///< Audio stream number
unsigned long AudioTag; ///< Audio stream tag
AviFrameBuffer* AudioFrames; ///< Audio frames
AviFrameBuffer** AudioFramesTail; ///< Audio frames tail pointer
AviFrameBuffer* AudioBuffer; ///< Current audio frame buffer
int AudioRemain; ///< Remaining bytes in buffer
} AviFile;
/*----------------------------------------------------------------------------

View file

@ -47,22 +47,22 @@
** Possible outcomes of the game.
*/
typedef enum _game_results_ {
GameNoResult, /// Game has no result
GameVictory, /// Game was won
GameDefeat, /// Game was lost
GameDraw, /// Game was draw
} GameResults; /// Game results
GameNoResult, ///< Game has no result
GameVictory, ///< Game was won
GameDefeat, ///< Game was lost
GameDraw, ///< Game was draw
} GameResults; ///< Game results
/**
** Type of the chapters.
*/
typedef enum _chapter_types_ {
ChapterPlayVideo, /// Play a video
ChapterShowPicture, /// Show a picture
ChapterPlayLevel, /// Play a level
ChapterDefeat, /// Levels played on defeat
ChapterDraw, /// Levels played on draw
ChapterEnd, /// End chapter (NOT SUPPORTED)
ChapterPlayVideo, ///< Play a video
ChapterShowPicture, ///< Show a picture
ChapterPlayLevel, ///< Play a level
ChapterDefeat, ///< Levels played on defeat
ChapterDraw, ///< Levels played on draw
ChapterEnd, ///< End chapter (NOT SUPPORTED)
} ChapterTypes;
/**
@ -74,77 +74,77 @@ typedef struct _campaign_chapter_ CampaignChapter;
** Picture text alignment
*/
typedef enum _picture_text_alignment_ {
PictureTextAlignLeft, /// Left align
PictureTextAlignCenter, /// Center align
PictureTextAlignLeft, ///< Left align
PictureTextAlignCenter, ///< Center align
} PictureTextAlignment;
/**
** Campaign picture text
*/
typedef struct _chapter_picture_text_ {
int Font; /// Font
int X; /// X position
int Y; /// Y position
int Width; /// Width
int Height; /// Height
PictureTextAlignment Align; /// Alignment
char* Text; /// Text
struct _chapter_picture_text_* Next; /// Next
int Font; ///< Font
int X; ///< X position
int Y; ///< Y position
int Width; ///< Width
int Height; ///< Height
PictureTextAlignment Align; ///< Alignment
char* Text; ///< Text
struct _chapter_picture_text_* Next; ///< Next
} ChapterPictureText;
/**
** Campaign chapter structure.
*/
struct _campaign_chapter_ {
CampaignChapter* Next; /// Next campaign chapter
ChapterTypes Type; /// Type of the chapter (level,...)
CampaignChapter* Next; ///< Next campaign chapter
ChapterTypes Type; ///< Type of the chapter (level,...)
union {
struct {
char* Name; /// Chapter name
} Level; /// Data for a level
char* Name; ///< Chapter name
} Level; ///< Data for a level
struct {
char* Image; /// File name of image
int FadeIn; /// Number of cycles to fade in
int FadeOut; /// Number of cycles to fade out
int DisplayTime; /// Number of cycles to display image
ChapterPictureText* Text; /// Linked list of text data
} Picture; /// Data for a picture
char* Image; ///< File name of image
int FadeIn; ///< Number of cycles to fade in
int FadeOut; ///< Number of cycles to fade out
int DisplayTime; ///< Number of cycles to display image
ChapterPictureText* Text; ///< Linked list of text data
} Picture; ///< Data for a picture
struct {
char* PathName; /// File name of video
int Flags; /// Playback flags
} Movie; /// Data for a movie
} Data; /// Data of the different chapter types
GameResults Result; /// Result of this chapter
char* PathName; ///< File name of video
int Flags; ///< Playback flags
} Movie; ///< Data for a movie
} Data; ///< Data of the different chapter types
GameResults Result; ///< Result of this chapter
};
/**
** Campaign structure.
*/
typedef struct _campaign_ {
const void* OType; /// Object type (future extensions)
const void* OType; ///< Object type (future extensions)
char* Ident; /// Unique identifier
char* Name; /// Campaign name
int Players; /// Campaign for X players
char* Ident; ///< Unique identifier
char* Name; ///< Campaign name
int Players; ///< Campaign for X players
char* File; /// File containing the campaign
char* File; ///< File containing the campaign
CampaignChapter* Chapters; /// Campaign chapters
CampaignChapter* Chapters; ///< Campaign chapters
} Campaign;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern int GameResult; /// Outcome of the game
extern int RestartScenario; /// Restart the scenario
extern int QuitToMenu; /// Quit to menu
extern char CurrentMapPath[]; /// Path of the current map
extern char DefaultMap[]; /// Default map path
extern char DefaultObjective[]; /// The default scenario objective
extern int GameResult; ///< Outcome of the game
extern int RestartScenario; ///< Restart the scenario
extern int QuitToMenu; ///< Quit to menu
extern char CurrentMapPath[]; ///< Path of the current map
extern char DefaultMap[]; ///< Default map path
extern char DefaultObjective[]; ///< The default scenario objective
extern Campaign* Campaigns; /// Campaigns
extern int NumCampaigns; /// Number of campaigns
extern Campaign* Campaigns; ///< Campaigns
extern int NumCampaigns; ///< Number of campaigns
/*----------------------------------------------------------------------------
-- Functions

View file

@ -65,24 +65,24 @@
----------------------------------------------------------------------------*/
typedef enum _cd_modes_ {
CDModeStopped = -1, /// Stopped
CDModeOff, /// Off
CDModeAll, /// All
CDModeRandom, /// Random
CDModeDefined, /// Defined
CDModeStopped = -1, ///< Stopped
CDModeOff, ///< Off
CDModeAll, ///< All
CDModeRandom, ///< Random
CDModeDefined, ///< Defined
} CDModes;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern CDModes CDMode; /// CD mode
extern int CDTrack; /// Current track
extern int NumCDTracks; /// Number of tracks on CD
extern CDModes CDMode; ///< CD mode
extern int CDTrack; ///< Current track
extern int NumCDTracks; ///< Number of tracks on CD
#ifdef USE_CDDA
extern int CDDrive; /// CDRom device
extern struct cdrom_tocentry CDtocentry[64]; /// TOC track header struct
extern int CDDrive; ///< CDRom device
extern struct cdrom_tocentry CDtocentry[64]; ///< TOC track header struct
#endif
/*----------------------------------------------------------------------------
@ -115,7 +115,7 @@ extern int CDRomCheck(void *);
#else
#define QuitCD() /// Dummy macro for without cd
#define QuitCD() ///< Dummy macro for without cd
#endif

View file

@ -38,17 +38,17 @@
----------------------------------------------------------------------------*/
typedef enum _replay_type_ {
ReplayNone, /// No replay
ReplaySinglePlayer, /// Single player replay
ReplayMultiPlayer, /// Multi player replay
} ReplayType; /// Replay types
ReplayNone, ///< No replay
ReplaySinglePlayer, ///< Single player replay
ReplayMultiPlayer, ///< Multi player replay
} ReplayType; ///< Replay types
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern int CommandLogDisabled; /// True, if command log is off
extern ReplayType ReplayGameType; /// Replay game type
extern int CommandLogDisabled; ///< True, if command log is off
extern ReplayType ReplayGameType; ///< Replay game type
/*----------------------------------------------------------------------------
-- Functions

View file

@ -119,34 +119,34 @@
/// Construction frame
typedef struct _construction_frame_ {
int Percent; /// Percent complete
int Percent; ///< Percent complete
enum {
ConstructionFileConstruction,
ConstructionFileMain,
} File; /// Graphic to use
int Frame; /// Frame number
struct _construction_frame_* Next; /// Next pointer
} File; ///< Graphic to use
int Frame; ///< Frame number
struct _construction_frame_* Next; ///< Next pointer
} ConstructionFrame;
/// Construction shown during construction of a building
typedef struct _construction_ {
const void* OType; /// Object type (future extensions)
char* Ident; /// construction identifier
const void* OType; ///< Object type (future extensions)
char* Ident; ///< construction identifier
struct {
char* File; /// sprite file
int Width; /// sprite width
int Height; /// sprite height
char* File; ///< sprite file
int Width; ///< sprite width
int Height; ///< sprite height
} File[TilesetMax], ShadowFile[TilesetMax];
ConstructionFrame* Frames; /// construction frames
ConstructionFrame* Frames; ///< construction frames
// --- FILLED UP ---
Graphic* Sprite; /// construction sprite image
int Width; /// sprite width
int Height; /// sprite height
Graphic* ShadowSprite; /// construction shadow sprite image
int ShadowWidth; /// shadow sprite width
int ShadowHeight; /// shadow sprite height
Graphic* Sprite; ///< construction sprite image
int Width; ///< sprite width
int Height; ///< sprite height
Graphic* ShadowSprite; ///< construction shadow sprite image
int ShadowWidth; ///< shadow sprite width
int ShadowHeight; ///< shadow sprite height
} Construction;
/*----------------------------------------------------------------------------
@ -157,7 +157,7 @@ typedef struct _construction_ {
-- Variables
----------------------------------------------------------------------------*/
extern const char ConstructionType[]; /// Construction type
extern const char ConstructionType[]; ///< Construction type
/*----------------------------------------------------------------------------
-- Functions

View file

@ -137,58 +137,58 @@ typedef struct _cursor_type_ CursorType;
/// Private type which specifies the cursor-type
struct _cursor_type_ {
const void* OType; /// Object type (future extensions)
char* Ident; /// Identifier to reference it
char* Race; /// Race name
char* File; /// Graphic file of the cursor
const void* OType; ///< Object type (future extensions)
char* Ident; ///< Identifier to reference it
char* Race; ///< Race name
char* File; ///< Graphic file of the cursor
int HotX; /// Hot point x
int HotY; /// Hot point y
int Width; /// Width of cursor
int Height; /// Height of cursor
int HotX; ///< Hot point x
int HotY; ///< Hot point y
int Width; ///< Width of cursor
int Height; ///< Height of cursor
int SpriteFrame; /// Current displayed cursor frame
int FrameRate; /// Rate of changing the frames
int SpriteFrame; ///< Current displayed cursor frame
int FrameRate; ///< Rate of changing the frames
// --- FILLED UP ---
Graphic* Sprite; /// Cursor sprite image
Graphic* Sprite; ///< Cursor sprite image
};
/// Cursor config reference
typedef struct _cursor_config_ {
char* Name; /// Config cursor-type name
CursorType* Cursor; /// Cursor-type pointer
char* Name; ///< Config cursor-type name
CursorType* Cursor; ///< Cursor-type pointer
} CursorConfig;
/// Cursor state
typedef enum _cursor_states_ {
CursorStatePoint, /// Normal cursor
CursorStateSelect, /// Select position
CursorStateRectangle, /// Rectangle selecting
CursorStatePoint, ///< Normal cursor
CursorStateSelect, ///< Select position
CursorStateRectangle, ///< Rectangle selecting
} CursorStates;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern const char CursorTypeType[]; /// cursor-type type
extern CursorType* Cursors; /// cursor-types description
extern const char CursorTypeType[]; ///< cursor-type type
extern CursorType* Cursors; ///< cursor-types description
extern CursorStates CursorState; /// current cursor state (point,...)
extern int CursorAction; /// action for selection
extern int CursorValue; /// value for action (spell type f.e.)
extern UnitType* CursorBuilding; /// building cursor
extern CursorStates CursorState; ///< current cursor state (point,...)
extern int CursorAction; ///< action for selection
extern int CursorValue; ///< value for action (spell type f.e.)
extern UnitType* CursorBuilding; ///< building cursor
extern CursorType* GameCursor; /// cursor-type
extern int CursorX; /// cursor position on screen X
extern int CursorY; /// cursor position on screen Y
extern int CursorStartX; /// rectangle started on screen X
extern int CursorStartY; /// rectangle started on screen Y
extern int CursorStartScrMapX; /// the same in screen map coordinate system
extern int CursorStartScrMapY; /// the same in screen map coordinate system
extern int SubScrollX; /// pixels the mouse moved while scrolling
extern int SubScrollY; /// pixels the mouse moved while scrolling
extern CursorType* GameCursor; ///< cursor-type
extern int CursorX; ///< cursor position on screen X
extern int CursorY; ///< cursor position on screen Y
extern int CursorStartX; ///< rectangle started on screen X
extern int CursorStartY; ///< rectangle started on screen Y
extern int CursorStartScrMapX; ///< the same in screen map coordinate system
extern int CursorStartScrMapY; ///< the same in screen map coordinate system
extern int SubScrollX; ///< pixels the mouse moved while scrolling
extern int SubScrollY; ///< pixels the mouse moved while scrolling
/*----------------------------------------------------------------------------
-- Functions

View file

@ -38,20 +38,15 @@
----------------------------------------------------------------------------*/
/**
**
** @fixme docu
**/
typedef struct DecorationSingle {
// next single-tile decoration belonging to the same decoration
struct DecorationSingle *nxt;
// exact 2x2 tile area
unsigned short *tiles;
// 16bit bitmask to and in order to *mark* the small deco
unsigned short bitmask;
// The coordinates of the upper-left corner of the 64*64 square
int cornerx, cornery;
struct DecorationSingle *nxt; ///< next single-tile decoration belonging to the same decoration
unsigned short *tiles; ///< exact 2x2 tile area
unsigned short bitmask; ///< 16bit bitmask to and in order to *mark* the small deco
int cornerx, cornery; ///< The coordinates of the upper-left corner of the 64*64 square
#ifdef DEBUG
// coordinates of the small deco on screen. mostly debug purposes.
int x, y, w, h;
int x, y, w, h; ///< coordinates of the small deco on screen. mostly debug purposes.
#endif
} DecorationSingle;
@ -61,29 +56,22 @@ typedef struct DecorationSingle {
** structu, so the mechanism can use it and automaticly update any other
** decoration overlapping it.
**
** draw = an user given function that draws the decoration using
** some vidoe functions based on the clip rectangle ClipX1,..
** data = an user given data-type given to above function, to be able
** to provide a generic draw-function independent of its data.
** x,y,w,h = dimension as given to DecorationAdd..
** @note now needed outside, but might be removed in the future
** l = decoration level as given to DecorationAdd (internal use only)
** singles = The sub-decoration type, as this decoration might be split
** into multiple small/fixed-sized data-type (internal use only)
** prv = prev decoration based on depth-level (internal use only)
** nxt = next decoration based on depth-level (internal use only)
** @note x, y, w, h now needed outside, but might be removed in the future
**/
typedef struct Deco {
void* data;
void (*drawclip)(void* data);
struct DecorationSingle* singles;
struct Deco* prv;
struct Deco* nxt;
int x;
int y;
int w;
int h;
int level;
void* data; ///< an user given data-type given to above function, to be able
///< to provide a generic draw-function independent of its data.
void (*drawclip)(void* data); ///< an user given function that draws the decoration using
///< some vidoe functions based on the clip rectangle ClipX1,..
struct DecorationSingle* singles; ///< The sub-decoration type, as this decoration might be split
///< into multiple small/fixed-sized data-type (internal use only)
struct Deco* prv; ///< prev decoration based on depth-level (internal use only)
struct Deco* nxt; ///< next decoration based on depth-level (internal use only)
int x; ///< dimension as given to DecorationAdd..
int y; ///< dimension as given to DecorationAdd..
int w; ///< dimension as given to DecorationAdd..
int h; ///< dimension as given to DecorationAdd..
int level; ///< decoration level as given to DecorationAdd (internal use only)
} Deco;
/*----------------------------------------------------------------------------

View file

@ -107,20 +107,20 @@
typedef struct _depend_rule_ DependRule;
enum {
DependRuleUnitType, /// Kind is an unit-type
DependRuleUpgrade, /// Kind is an upgrade
DependRuleUnitType, ///< Kind is an unit-type
DependRuleUpgrade, ///< Kind is an upgrade
};
/// Dependency rule
struct _depend_rule_ {
DependRule* Next; /// next hash chain, or rules
unsigned char Count; /// how many required
char Type; /// an unit-type or upgrade
DependRule* Next; ///< next hash chain, or rules
unsigned char Count; ///< how many required
char Type; ///< an unit-type or upgrade
union {
UnitType* UnitType; /// unit-type pointer
Upgrade* Upgrade; /// upgrade pointer
} Kind; /// required object
DependRule* Rule; /// requirements, and rule
UnitType* UnitType; ///< unit-type pointer
Upgrade* Upgrade; ///< upgrade pointer
} Kind; ///< required object
DependRule* Rule; ///< requirements, and rule
};
/*----------------------------------------------------------------------------

View file

@ -43,22 +43,22 @@ extern char EditorRunning;
extern char EditorMapLoaded;
/// Current editor state type.
typedef enum _editor_state_type_ {
EditorSelecting, /// Select
EditorEditTile, /// Edit tiles
EditorEditUnit, /// Edit units
} EditorStateType; /// Current editor state
EditorSelecting, ///< Select
EditorEditTile, ///< Edit tiles
EditorEditUnit, ///< Edit units
} EditorStateType; ///< Current editor state
/// Current editor state.
extern EditorStateType EditorState;
/// Editor CCL start file
extern const char* EditorStartFile;
extern char** EditorUnitTypes; /// Sorted editor unit-type table
extern char** EditorUnitTypes; ///< Sorted editor unit-type table
extern int MaxUnitIndex; /// Max unit icon draw index
extern int MaxUnitIndex; ///< Max unit icon draw index
extern char* EditorSelectIcon; /// Editor's select icon
extern char* EditorUnitsIcon; /// Editor's units icon
extern char* EditorSelectIcon; ///< Editor's select icon
extern char* EditorUnitsIcon; ///< Editor's units icon
/*----------------------------------------------------------------------------
-- Functions

View file

@ -91,29 +91,29 @@
/// Color font definition
typedef struct _color_font_ {
char* File; /// File containing font data
int Width; /// Max width of characters in file
int Height; /// Max height of characters in file
char CharWidth[208]; /// Real font width (starting with ' ')
char* File; ///< File containing font data
int Width; ///< Max width of characters in file
int Height; ///< Max height of characters in file
char CharWidth[208]; ///< Real font width (starting with ' ')
// --- FILLED UP ---
Graphic* Graphic; /// Graphic object used to draw
Graphic* Graphic; ///< Graphic object used to draw
} ColorFont;
/**
** Font selector for the font functions.
** FIXME: should be removed
** @fixme should be removed
*/
enum _game_font_ {
SmallFont, /// Small font used in stats
GameFont, /// Normal font used in game
LargeFont, /// Large font used in menus
SmallTitleFont, /// Small font used in episoden titles
LargeTitleFont, /// Large font used in episoden titles
SmallFont, ///< Small font used in stats
GameFont, ///< Normal font used in game
LargeFont, ///< Large font used in menus
SmallTitleFont, ///< Small font used in episoden titles
LargeTitleFont, ///< Large font used in episoden titles
};
#define MaxFonts 10 /// Number of fonts supported
#define MaxFonts 10 ///< Number of fonts supported
/**
** Color selector for the font functions.
@ -130,7 +130,7 @@ enum _game_font_ {
/**
** Font names
** FIXME: should use the names of the real fonts.
** @fixme should use the names of the real fonts.
*/
extern char *FontNames[];

View file

@ -136,10 +136,10 @@
-- Defines
----------------------------------------------------------------------------*/
#define IconActive 1 /// cursor on icon
#define IconClicked 2 /// mouse button down on icon
#define IconSelected 4 /// this the selected icon
#define IconAutoCast 8 /// auto cast icon
#define IconActive 1 ///< cursor on icon
#define IconClicked 2 ///< mouse button down on icon
#define IconSelected 4 ///< this the selected icon
#define IconAutoCast 8 ///< auto cast icon
/*----------------------------------------------------------------------------
-- Declarations
@ -153,55 +153,55 @@
** IconFile::Icons member isn't setup and used.
*/
typedef struct _icon_file_ {
char* FileName; /// Icon file name/path
char* FileName; ///< Icon file name/path
#if 0
unsigned Width; /// Icon width
unsigned Height; /// Icon height
unsigned Width; ///< Icon width
unsigned Height; ///< Icon height
/** FIXME: unsed */
unsigned Icons; /// Number of icons in this file
unsigned Icons; ///< Number of icons in this file
#endif
// --- FILLED UP ---
Graphic* Sprite; /// Graphic data loaded
Graphic* Sprite; ///< Graphic data loaded
} IconFile;
/// Icon: rectangle image used in menus
typedef struct _icon_ {
char* Ident; /// Icon identifier
char* Tileset; /// Tileset identifier
char* Ident; ///< Icon identifier
char* Tileset; ///< Tileset identifier
IconFile* File; /// File containing the data
unsigned Index; /// Index into file
IconFile* File; ///< File containing the data
unsigned Index; ///< Index into file
int Width; /// Icon width
int Height; /// Icon height
int Width; ///< Icon width
int Height; ///< Icon height
// --- FILLED UP ---
Graphic* Sprite; /// Graphic data loaded
Graphic* Sprite; ///< Graphic data loaded
} Icon;
#define NoIcon NULL /// used for errors == no valid icon
#define NoIcon NULL ///< used for errors == no valid icon
/// Icon reference (used in config tables)
typedef struct _icon_config_ {
char* Name; /// config icon name
Icon* Icon; /// icon pointer to use to run time
char* Name; ///< config icon name
Icon* Icon; ///< icon pointer to use to run time
} IconConfig;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern char** IconWcNames; /// pud original -> internal
extern char** IconWcNames; ///< pud original -> internal
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
extern void InitIcons(void); /// Init icons
extern void LoadIcons(void); /// Load icons
extern void CleanIcons(void); /// Cleanup icons
extern void InitIcons(void); ///< Init icons
extern void LoadIcons(void); ///< Load icons
extern void CleanIcons(void); ///< Cleanup icons
/// Name -> icon
extern Icon* IconByIdent(const char* ident);

View file

@ -47,26 +47,26 @@
/// Button Commands that need target selection
enum _button_cmd_ {
ButtonMove, /// order move
ButtonAttack, /// order attack
ButtonRepair, /// order repair
ButtonHarvest, /// order harvest
ButtonBuild, /// order build
ButtonPatrol, /// order patrol
ButtonAttackGround, /// order attack ground
ButtonSpellCast, /// order cast spell
ButtonUnload, /// order unload unit
ButtonStop, /// order stop
ButtonButton, /// choose other button set
ButtonTrain, /// order train
ButtonStandGround, /// order stand ground
ButtonReturn, /// order return goods
ButtonResearch, /// order reseach
ButtonUpgradeTo, /// order upgrade
ButtonCancel, /// cancel
ButtonCancelUpgrade, /// cancel upgrade
ButtonCancelTrain, /// cancel training
ButtonCancelBuild, /// cancel building
ButtonMove, ///< order move
ButtonAttack, ///< order attack
ButtonRepair, ///< order repair
ButtonHarvest, ///< order harvest
ButtonBuild, ///< order build
ButtonPatrol, ///< order patrol
ButtonAttackGround, ///< order attack ground
ButtonSpellCast, ///< order cast spell
ButtonUnload, ///< order unload unit
ButtonStop, ///< order stop
ButtonButton, ///< choose other button set
ButtonTrain, ///< order train
ButtonStandGround, ///< order stand ground
ButtonReturn, ///< order return goods
ButtonResearch, ///< order reseach
ButtonUpgradeTo, ///< order upgrade
ButtonCancel, ///< cancel
ButtonCancelUpgrade, ///< cancel upgrade
ButtonCancelTrain, ///< cancel training
ButtonCancelBuild, ///< cancel building
};
/// typedef for action of button
@ -75,152 +75,149 @@ typedef int (*ButtonCheckFunc)(const Unit*,const ButtonAction*);
/// Action of button
struct _button_action_ {
int Pos; /// button position in the grid
int Level; /// requires button level
enum _button_cmd_ Action; /// command on button press
int Value; /// extra value for command
char* ValueStr; /// keep original value string
/// Check if this button is allowed
ButtonCheckFunc Allowed;
char* AllowStr; /// argument for allowed
char* UnitMask; /// for which units is it available
IconConfig Icon; /// icon to display
int Key; /// alternative on keyboard
char* Hint; /// tip text
int Pos; ///< button position in the grid
int Level; ///< requires button level
enum _button_cmd_ Action; ///< command on button press
int Value; ///< extra value for command
char* ValueStr; ///< keep original value string
ButtonCheckFunc Allowed; ///< Check if this button is allowed
char* AllowStr; ///< argument for allowed
char* UnitMask; ///< for which units is it available
IconConfig Icon; ///< icon to display
int Key; ///< alternative on keyboard
char* Hint; ///< tip text
};
/// Button area under cursor
enum _button_area_ {
ButtonAreaSelected, /// Selected button
ButtonAreaTraining, /// Training button
ButtonAreaUpgrading, /// Upgrading button
ButtonAreaResearching, /// Researching button
ButtonAreaTransporting, /// Transporting button
ButtonAreaButton, /// Button panel button
ButtonAreaMenu, /// Menu button
ButtonAreaSelected, ///< Selected button
ButtonAreaTraining, ///< Training button
ButtonAreaUpgrading, ///< Upgrading button
ButtonAreaResearching, ///< Researching button
ButtonAreaTransporting, ///< Transporting button
ButtonAreaButton, ///< Button panel button
ButtonAreaMenu, ///< Menu button
};
/// Menu button under cursor
enum _menu_button_under_ {
ButtonUnderMenu, /// Menu button
ButtonUnderNetworkMenu, /// Network menu button
ButtonUnderNetworkDiplomacy, /// Diplomacy button
ButtonUnderMenu, ///< Menu button
ButtonUnderNetworkMenu, ///< Network menu button
ButtonUnderNetworkDiplomacy, ///< Diplomacy button
};
/// current interface state
enum _iface_state_ {
IfaceStateNormal, /// Normal Game state
IfaceStateMenu, /// Menu active
IfaceStateNormal, ///< Normal Game state
IfaceStateMenu, ///< Menu active
};
/// current key state
enum _key_state_ {
KeyStateCommand = 0, /// keys -> commands
KeyStateInput /// keys -> line editor
}; /// current keyboard state
KeyStateCommand = 0, ///< keys -> commands
KeyStateInput ///< keys -> line editor
}; ///< current keyboard state
/// additional keycodes
enum _key_codes_ {
KeyCodeUp=0x101, /// internal keycode: cursor up key
KeyCodeDown, /// internal keycode: cursor down key
KeyCodeLeft, /// internal keycode: cursor left key
KeyCodeRight, /// internal keycode: cursor right key
KeyCodePause, /// internal keycode: game pause key
KeyCodeUp = 0x101, ///< internal keycode: cursor up key
KeyCodeDown, ///< internal keycode: cursor down key
KeyCodeLeft, ///< internal keycode: cursor left key
KeyCodeRight, ///< internal keycode: cursor right key
KeyCodePause, ///< internal keycode: game pause key
KeyCodeF1, /// internal keycode: F1 function keys
KeyCodeF2, /// internal keycode: F2 function keys
KeyCodeF3, /// internal keycode: F3 function keys
KeyCodeF4, /// internal keycode: F4 function keys
KeyCodeF5, /// internal keycode: F5 function keys
KeyCodeF6, /// internal keycode: F6 function keys
KeyCodeF7, /// internal keycode: F7 function keys
KeyCodeF8, /// internal keycode: F8 function keys
KeyCodeF9, /// internal keycode: F9 function keys
KeyCodeF10, /// internal keycode: F10 function keys
KeyCodeF11, /// internal keycode: F11 function keys
KeyCodeF12, /// internal keycode: F12 function keys
KeyCodeF1, ///< internal keycode: F1 function keys
KeyCodeF2, ///< internal keycode: F2 function keys
KeyCodeF3, ///< internal keycode: F3 function keys
KeyCodeF4, ///< internal keycode: F4 function keys
KeyCodeF5, ///< internal keycode: F5 function keys
KeyCodeF6, ///< internal keycode: F6 function keys
KeyCodeF7, ///< internal keycode: F7 function keys
KeyCodeF8, ///< internal keycode: F8 function keys
KeyCodeF9, ///< internal keycode: F9 function keys
KeyCodeF10, ///< internal keycode: F10 function keys
KeyCodeF11, ///< internal keycode: F11 function keys
KeyCodeF12, ///< internal keycode: F12 function keys
KeyCodeKP0, /// internal keycode: keypad 0
KeyCodeKP1, /// internal keycode: keypad 1
KeyCodeKP2, /// internal keycode: keypad 2
KeyCodeKP3, /// internal keycode: keypad 3
KeyCodeKP4, /// internal keycode: keypad 4
KeyCodeKP5, /// internal keycode: keypad 5
KeyCodeKP6, /// internal keycode: keypad 6
KeyCodeKP7, /// internal keycode: keypad 7
KeyCodeKP8, /// internal keycode: keypad 8
KeyCodeKP9, /// internal keycode: keypad 9
KeyCodeKPPlus, /// internal keycode: keypad +
KeyCodeKPMinus, /// internal keycode: keypad -
KeyCodeKPPeriod, /// internal keycode: keypad .
KeyCodeKP0, ///< internal keycode: keypad 0
KeyCodeKP1, ///< internal keycode: keypad 1
KeyCodeKP2, ///< internal keycode: keypad 2
KeyCodeKP3, ///< internal keycode: keypad 3
KeyCodeKP4, ///< internal keycode: keypad 4
KeyCodeKP5, ///< internal keycode: keypad 5
KeyCodeKP6, ///< internal keycode: keypad 6
KeyCodeKP7, ///< internal keycode: keypad 7
KeyCodeKP8, ///< internal keycode: keypad 8
KeyCodeKP9, ///< internal keycode: keypad 9
KeyCodeKPPlus, ///< internal keycode: keypad +
KeyCodeKPMinus, ///< internal keycode: keypad -
KeyCodeKPPeriod, ///< internal keycode: keypad .
KeyCodeShift, /// internal keycode: shift modifier
KeyCodeControl, /// internal keycode: ctrl modifier
KeyCodeAlt, /// internal keycode: alt modifier
KeyCodeSuper, /// internal keycode: super modifier
KeyCodeHyper, /// internal keycode: hyper modifier
KeyCodeShift, ///< internal keycode: shift modifier
KeyCodeControl, ///< internal keycode: ctrl modifier
KeyCodeAlt, ///< internal keycode: alt modifier
KeyCodeSuper, ///< internal keycode: super modifier
KeyCodeHyper, ///< internal keycode: hyper modifier
KeyCodePrint, /// internal keycode: print screen
KeyCodeDelete, /// internal keycode: delete
KeyCodePrint, ///< internal keycode: print screen
KeyCodeDelete, ///< internal keycode: delete
};
/// Key modifier
enum _key_modifiers_ {
ModifierShift = 1, /// any shift key pressed
ModifierControl = 2, /// any controll key pressed
ModifierAlt = 4, /// any alt key pressed
ModifierSuper = 8, /// super key (reserved for WM)
ModifierHyper = 16, /// any hyper key pressed
ModifierShift = 1, ///< any shift key pressed
ModifierControl = 2, ///< any controll key pressed
ModifierAlt = 4, ///< any alt key pressed
ModifierSuper = 8, ///< super key (reserved for WM)
ModifierHyper = 16, ///< any hyper key pressed
};
#define MouseDoubleShift 8 /// shift for double click button
#define MouseDragShift 16 /// shift for drag button
#define MouseHoldShift 24 /// shift for hold button
#define MouseDoubleShift 8 ///< shift for double click button
#define MouseDragShift 16 ///< shift for drag button
#define MouseHoldShift 24 ///< shift for hold button
/// pressed mouse button flags
enum _mouse_buttons_ {
LeftButton = 2, /// Left button on mouse
MiddleButton = 4, /// Middle button on mouse
RightButton = 8, /// Right button on mouse
LeftButton = 2, ///< Left button on mouse
MiddleButton = 4, ///< Middle button on mouse
RightButton = 8, ///< Right button on mouse
UpButton = 16, /// Scroll up button on mouse
DownButton = 32, /// Scroll down button on mouse
UpButton = 16, ///< Scroll up button on mouse
DownButton = 32, ///< Scroll down button on mouse
/// Left+Middle button on mouse
LeftAndMiddleButton = LeftButton|MiddleButton,
/// Left+Right button on mouse
LeftAndRightButton = LeftButton|RightButton,
/// Middle+Right button on mouse
MiddleAndRightButton= MiddleButton|RightButton,
LeftAndMiddleButton = LeftButton | MiddleButton, ///< Left + Middle button on mouse
LeftAndRightButton = LeftButton | RightButton, ///< Left + Right button on mouse
MiddleAndRightButton= MiddleButton | RightButton, ///< Middle + Right button on mouse
};
/// Where is our cursor ?
enum _cursor_on_ {
CursorOnUnknown = -1, /// not known
CursorOnMinimap, /// minimap area
CursorOnButton, /// button area see: ButtonUnderCursor
CursorOnMap, /// over map area
CursorOnScrollUp, /// in scroll up area
CursorOnScrollDown, /// in scroll down area
CursorOnScrollLeft, /// in scroll left area
CursorOnScrollRight, /// in scroll right area
CursorOnScrollLeftUp, /// in scroll left+up area
CursorOnScrollLeftDown, /// in scroll left+down area
CursorOnScrollRightUp, /// in scroll right+up area
CursorOnScrollRightDown, /// in scroll right+down area
CursorOnUnknown = -1, ///< not known
CursorOnMinimap, ///< minimap area
CursorOnButton, ///< button area see: ButtonUnderCursor
CursorOnMap, ///< over map area
CursorOnScrollUp, ///< in scroll up area
CursorOnScrollDown, ///< in scroll down area
CursorOnScrollLeft, ///< in scroll left area
CursorOnScrollRight, ///< in scroll right area
CursorOnScrollLeftUp, ///< in scroll left+up area
CursorOnScrollLeftDown, ///< in scroll left+down area
CursorOnScrollRightUp, ///< in scroll right+up area
CursorOnScrollRightDown, ///< in scroll right+down area
};
/// Are We Scrolling With the Keyboard ?
enum _scroll_state_ {
ScrollNone = 0, /// not scrolling
ScrollUp = 1, /// scroll up only
ScrollDown = 2, /// scroll down only
ScrollLeft = 4, /// scroll left only
ScrollRight = 8, /// scroll right only
ScrollLeftUp = 5, /// scroll left+up
ScrollLeftDown = 6, /// scroll left+down
ScrollRightUp = 9, /// scroll right+up
ScrollRightDown = 10, /// scroll right+down
ScrollNone = 0, ///< not scrolling
ScrollUp = 1, ///< scroll up only
ScrollDown = 2, ///< scroll down only
ScrollLeft = 4, ///< scroll left only
ScrollRight = 8, ///< scroll right only
ScrollLeftUp = 5, ///< scroll left + up
ScrollLeftDown = 6, ///< scroll left + down
ScrollRightUp = 9, ///< scroll right + up
ScrollRightDown = 10, ///< scroll right + down
};
/*----------------------------------------------------------------------------

View file

@ -58,9 +58,9 @@
** FileList struct used by directory access routine
*/
typedef struct _filelist_ {
char* name; /// Name of the file
int type; /// Type of the file
void* xdata; /// Extra data attached by high level
char* name; ///< Name of the file
int type; ///< Type of the file
void* xdata; ///< Extra data attached by high level
} FileList;
@ -85,21 +85,21 @@ typedef struct _filelist_ {
** @todo zip archive support
*/
typedef struct _CL_File_ {
int cl_type; /// type of CLFile
FILE* cl_plain; /// standard file pointer
int cl_type; ///< type of CLFile
FILE* cl_plain; ///< standard file pointer
#ifdef USE_ZLIB
gzFile *cl_gz; /// gzip file pointer
gzFile *cl_gz; ///< gzip file pointer
#endif // !USE_ZLIB
#ifdef USE_BZ2LIB
BZFILE* cl_bz; /// bzip2 file pointer
BZFILE* cl_bz; ///< bzip2 file pointer
#endif // !USE_BZ2LIB
} CLFile;
enum {
CLF_TYPE_INVALID, /// invalid file handle
CLF_TYPE_PLAIN, /// plain text file handle
CLF_TYPE_GZIP, /// gzip file handle
CLF_TYPE_BZIP2, /// bzip2 file handle
CLF_TYPE_INVALID, ///< invalid file handle
CLF_TYPE_PLAIN, ///< plain text file handle
CLF_TYPE_GZIP, ///< gzip file handle
CLF_TYPE_BZIP2, ///< bzip2 file handle
};
#define CL_OPEN_READ 0x1

View file

@ -197,8 +197,8 @@
// 1024x1024: 8 MB 12 MB
// 2048*2048: 32 MB 48 MB
// 4096*4096: 128 MB 192 MB
#define MaxMapWidth 256 /// maximal map width supported
#define MaxMapHeight 256 /// maximal map height supported
#define MaxMapWidth 256 ///< maximal map width supported
#define MaxMapHeight 256 ///< maximal map height supported
/*----------------------------------------------------------------------------
-- Map - field
@ -206,42 +206,42 @@
/// Describes a field of the map
typedef struct _map_field_ {
unsigned short Tile; /// graphic tile number
unsigned short SeenTile; /// last seen tile (FOW)
unsigned short Flags; /// field flags
unsigned short Tile; ///< graphic tile number
unsigned short SeenTile; ///< last seen tile (FOW)
unsigned short Flags; ///< field flags
// FIXME: Value can be removed, walls and regeneration can be handled
// different.
unsigned char Value; /// HP for walls/ Wood Regeneration
unsigned char Visible[PlayerMax]; /// Seen counter 0 unexplored
unsigned char VisCloak[PlayerMax]; /// Visiblity for cloaking.
unsigned char Value; ///< HP for walls/ Wood Regeneration
unsigned char Visible[PlayerMax]; ///< Seen counter 0 unexplored
unsigned char VisCloak[PlayerMax]; ///< Visiblity for cloaking.
#ifndef NEW_UNIT_CACHE
Unit* UnitCache; /// An unit on the map field
Unit* UnitCache; ///< An unit on the map field
#else
UnitListItem* UnitCache; /// An unit on the map field
UnitListItem* UnitCache; ///< An unit on the map field
#endif
} MapField;
// Not used until now:
#if 0
#define MapFieldArray 0x0004 /// More than one unit on the field
#define MapFieldArray 0x0004 ///< More than one unit on the field
#endif
#define MapFieldHuman 0x0008 /// Human is owner of the field (walls)
#define MapFieldHuman 0x0008 ///< Human is owner of the field (walls)
#define MapFieldLandAllowed 0x0010 /// Land units allowed
#define MapFieldCoastAllowed 0x0020 /// Coast (transporter) units allowed
#define MapFieldWaterAllowed 0x0040 /// Water units allowed
#define MapFieldNoBuilding 0x0080 /// No buildings allowed
#define MapFieldLandAllowed 0x0010 ///< Land units allowed
#define MapFieldCoastAllowed 0x0020 ///< Coast (transporter) units allowed
#define MapFieldWaterAllowed 0x0040 ///< Water units allowed
#define MapFieldNoBuilding 0x0080 ///< No buildings allowed
#define MapFieldUnpassable 0x0100 /// Field is movement blocked
#define MapFieldWall 0x0200 /// Field contains wall
#define MapFieldRocks 0x0400 /// Field contains rocks
#define MapFieldForest 0x0800 /// Field contains forest
#define MapFieldUnpassable 0x0100 ///< Field is movement blocked
#define MapFieldWall 0x0200 ///< Field contains wall
#define MapFieldRocks 0x0400 ///< Field contains rocks
#define MapFieldForest 0x0800 ///< Field contains forest
#define MapFieldLandUnit 0x1000 /// Land unit on field
#define MapFieldAirUnit 0x2000 /// Air unit on field
#define MapFieldSeaUnit 0x4000 /// Water unit on field
#define MapFieldBuilding 0x8000 /// Building on field
#define MapFieldLandUnit 0x1000 ///< Land unit on field
#define MapFieldAirUnit 0x2000 ///< Air unit on field
#define MapFieldSeaUnit 0x4000 ///< Water unit on field
#define MapFieldBuilding 0x8000 ///< Building on field
/*----------------------------------------------------------------------------
-- Map info structure
@ -251,18 +251,18 @@ typedef struct _map_field_ {
** Get info about a map.
*/
typedef struct _map_info_ {
char* Description; /// Map description
char* MapTerrainName; /// Map terrain name
char* Filename; /// Map filename
// FIXME: Map Terrain Nr. should be removed.
int MapTerrain; /// Map terrain
int MapWidth; /// Map width
int MapHeight; /// Map height
int PlayerType[PlayerMax]; /// Same player->Type
int PlayerSide[PlayerMax]; /// Same player->Side
int PlayerResources[PlayerMax][MaxCosts]; /// Same player->Gold
int PlayerAi[PlayerMax]; /// Same player->Ai
unsigned int MapUID; /// Unique Map ID (hash)
char* Description; ///< Map description
char* MapTerrainName; ///< Map terrain name
char* Filename; ///< Map filename
/// @fixme Map Terrain Nr. should be removed.
int MapTerrain; ///< Map terrain
int MapWidth; ///< Map width
int MapHeight; ///< Map height
int PlayerType[PlayerMax]; ///< Same player->Type
int PlayerSide[PlayerMax]; ///< Same player->Side
int PlayerResources[PlayerMax][MaxCosts]; ///< Same player->Gold
int PlayerAi[PlayerMax]; ///< Same player->Ai
unsigned int MapUID; ///< Unique Map ID (hash)
} MapInfo;
/*----------------------------------------------------------------------------
@ -271,33 +271,33 @@ typedef struct _map_info_ {
/// Describes the wold map
typedef struct _world_map_ {
int Width; /// the map width
int Height; /// the map height
int Width; ///< the map width
int Height; ///< the map height
MapField* Fields; /// fields on map
unsigned* Visible[PlayerMax]; /// visible bit-field
MapField* Fields; ///< fields on map
unsigned* Visible[PlayerMax]; ///< visible bit-field
unsigned char NoFogOfWar; /// fog of war disabled
unsigned char NoFogOfWar; ///< fog of war disabled
char* TerrainName; /// terrain as name
// FIXME: terrain nr. should be removed?
int Terrain; /// terrain type (summer,winter,...)
Tileset* Tileset; /// tileset data
char* TerrainName; ///< terrain as name
/// @fixme terrain nr. should be removed?
int Terrain; ///< terrain type (summer,winter,...)
Tileset* Tileset; ///< tileset data
unsigned TileCount; /// how many tiles,
/// == TileGraphic->NFrames
Graphic* TileGraphic; /// graphic for all the tiles
unsigned TileCount; ///< how many tiles, (== TileGraphic->NFrames)
Graphic* TileGraphic; ///< graphic for all the tiles
char Description[32];/// map description short
char Description[32];///< map description short
MapInfo* Info; /// descriptive information (FIXME: DUPLICATES!)
MapInfo* Info; ///< descriptive information
/// @fixme (MapInfo* Info DUPLICATES!)
} WorldMap;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern WorldMap TheMap; /// The current map
extern WorldMap TheMap; ///< The current map
/// Fast draw tile, display and video mode independ
extern void VideoDrawTile(const int, int, int);
@ -309,7 +309,7 @@ extern unsigned char *VisionTable[3];
extern int *VisionLookup;
#ifdef NEW_DECODRAW
/// FIXME: docu
/// @fixme docu
extern void InitMapDecoration(void);
/// Decoration for the map.
extern Deco* MapDecoration;

View file

@ -41,6 +41,7 @@
-- Defines
----------------------------------------------------------------------------*/
/// @fixme do it configurable.
#define MASTER_HOST "mohydine.no-ip.com"
#define MASTER_PORT 7775

View file

@ -48,10 +48,10 @@
#define MI_DISABLED -1
#define MI_ENABLED 0
#define MenuButtonActive 1 /// cursor on button
#define MenuButtonClicked 2 /// mouse button down on button
#define MenuButtonSelected 4 /// selected button
#define MenuButtonDisabled 8 /// button cannot be depressed
#define MenuButtonActive 1 ///< cursor on button
#define MenuButtonClicked 2 ///< mouse button down on button
#define MenuButtonSelected 4 ///< selected button
#define MenuButtonDisabled 8 ///< button cannot be depressed
/**
** Menu button referencing
@ -62,9 +62,9 @@
*/
typedef int MenuButtonId;
/// FIXME: FILL IN THIS TABLE!!!!
/// @fixme FILL IN THIS TABLE!!!!
#define MBUTTON_MAIN 4 /// FIXME: write docu
#define MBUTTON_MAIN 4 /// @fixme write docu
#define MBUTTON_NETWORK 7
#define MBUTTON_GM_HALF 10
#define MBUTTON_132 13
@ -114,6 +114,7 @@ typedef int MenuButtonId;
/**
** Menuitem definition.
** @fixme docu.
*/
struct _menuitem_;
typedef struct _menuitem_text_ {
@ -168,27 +169,27 @@ typedef struct _menuitem_listbox_ {
} MenuitemListbox;
typedef struct _menuitem_vslider_ {
unsigned cflags;
int xsize; // x-size of slider, not including buttons
int ysize; // y-size of slider, not including buttons
int xsize; ///< x-size of slider, not including buttons
int ysize; ///< y-size of slider, not including buttons
void (*action)(struct _menuitem_ *, int);
int defper;
int percent; // percent of the way to bottom (0 to 100)
int curper; /* used in mouse-move state */
int cursel; /* used in mouse-over state */
int percent; ///< percent of the way to bottom (0 to 100)
int curper; ///< used in mouse-move state
int cursel; ///< used in mouse-over state
int style;
void (*handler)(void); /* for return key */
void (*handler)(void); ///< for return key
} MenuitemVslider;
typedef struct _menuitem_hslider_ {
unsigned cflags;
int xsize; // x-size of slider, not including buttons
int ysize; // y-size of slider, not including buttons
int xsize; ///< x-size of slider, not including buttons
int ysize; ///< y-size of slider, not including buttons
void (*action)(struct _menuitem_ *);
int defper;
int percent; // percent of the way to right (0 to 100)
int curper; /* used in mouse-move state */
int cursel; /* used in mouse-over state */
int percent; ///< percent of the way to right (0 to 100)
int curper; ///< used in mouse-move state
int cursel; ///< used in mouse-over state
int style;
void (*handler)(void); /* for return key */
void (*handler)(void); ///< for return key
} MenuitemHslider;
typedef struct _menuitem_drawfunc_ {
void (*draw)(struct _menuitem_ *);
@ -198,7 +199,7 @@ typedef struct _menuitem_input_ {
int xsize;
int ysize;
MenuButtonId button;
void (*action)(struct _menuitem_ *, int); /* for key */
void (*action)(struct _menuitem_ *, int); ///< for key
int nch;
int maxch;
char *normalcolor;
@ -217,15 +218,15 @@ typedef struct _menuitem_gem_ {
struct _menus_;
typedef struct _menuitem_ {
int mitype; /// FIXME: write docu
int mitype; ///< @fixme write docu
int xofs;
int yofs;
unsigned flags;
int font;
int transparent; /// Add the transparent flag to draw a translucide menu
void (*initfunc)(struct _menuitem_ *); /// constructor
void (*exitfunc)(struct _menuitem_ *); /// destructor
struct _menus_ *menu; /// backpointer for speedups
int transparent; ///< Add the transparent flag to draw a translucide menu
void (*initfunc)(struct _menuitem_ *); ///< constructor
void (*exitfunc)(struct _menuitem_ *); ///< destructor
struct _menus_ *menu; ///< backpointer for speedups
union {
MenuitemText text;
MenuitemButton button;
@ -236,12 +237,12 @@ typedef struct _menuitem_ {
MenuitemDrawfunc drawfunc;
MenuitemInput input;
MenuitemGem gem;
/// ... add here ...
///< ... add here ...
} d;
} Menuitem;
#define MI_TYPE_TEXT 1 /// FIXME: write docu
#define MI_TYPE_TEXT 1 ///< @fixme write docu
#define MI_TYPE_BUTTON 2
#define MI_TYPE_PULLDOWN 3
#define MI_TYPE_LISTBOX 4
@ -265,13 +266,13 @@ typedef struct _menuitem_ {
#define MI_CFLAGS_CONT 8
/// for MI_TYPE_PULLDOWN
#define MI_PSTATE_PASSIVE 1 /// Pulldown is passive (grey) drawn
#define MI_PSTATE_PASSIVE 1 ///< Pulldown is passive (grey) drawn
/// for MI_TYPE_GEM
#define MI_GSTATE_UNCHECKED 0 /// Gem has no check mark
#define MI_GSTATE_PASSIVE 1 /// Gem is passive (grey) drawn
#define MI_GSTATE_INVISIBLE 2 /// Gem is not drawn
#define MI_GSTATE_CHECKED 4 /// Gem is with check mark drawn
#define MI_GSTATE_UNCHECKED 0 ///< Gem has no check mark
#define MI_GSTATE_PASSIVE 1 ///< Gem is passive (grey) drawn
#define MI_GSTATE_INVISIBLE 2 ///< Gem is not drawn
#define MI_GSTATE_CHECKED 4 ///< Gem is with check mark drawn
#define MI_STYLE_SC_VSLIDER 1
#define MI_STYLE_SC_HSLIDER 2
@ -280,44 +281,44 @@ typedef struct _menuitem_ {
** Menu definition.
*/
typedef struct _menus_ {
// FIXME: char* Name; /// menu name
int X; /// menu area x pos
int Y; /// menu area y pos
int Width; /// menu area width
int Height; /// menu area height
char* Panel; /// optional background panel
int DefSel; /// initial selected item number (or -1)
int NumItems; /// number of items to follow
Menuitem* Items; /// buttons, etc
void (*NetAction)(void); /// network action callback
/// @fixme char* Name; ///< menu name
int X; ///< menu area x pos
int Y; ///< menu area y pos
int Width; ///< menu area width
int Height; ///< menu area height
char* Panel; ///< optional background panel
int DefSel; ///< initial selected item number (or -1)
int NumItems; ///< number of items to follow
Menuitem* Items; ///< buttons, etc
void (*NetAction)(void); ///< network action callback
} Menu;
/**
** Struct which specifies the buttons gfx
*/
typedef struct _menu_graphics_ {
char* File[MAX_RACES]; /// resource filename one for each race
int Width[MAX_RACES]; /// Width of button
int Height[MAX_RACES]; /// Height of button
Graphic* Sprite; /// sprite : FILLED
char* File[MAX_RACES]; ///< resource filename one for each race
int Width[MAX_RACES]; ///< Width of button
int Height[MAX_RACES]; ///< Height of button
Graphic* Sprite; ///< sprite : FILLED
} MenuGraphics;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern int GuiGameStarted; /// Game Started?
extern Menu *CurrentMenu; /// Currently processed menu
extern MenuGraphics MenuButtonGfx; /// Menu button graphics
extern int GuiGameStarted; ///< Game Started?
extern Menu *CurrentMenu; ///< Currently processed menu
extern MenuGraphics MenuButtonGfx; ///< Menu button graphics
extern MapInfo *MenuMapInfo; /// MapInfo of map used in gui menus
extern char MenuMapFullPath[1024]; /// Full path to currently selected map
extern MapInfo *MenuMapInfo; ///< MapInfo of map used in gui menus
extern char MenuMapFullPath[1024]; ///< Full path to currently selected map
extern int nKeyStrokeHelps; /// Number of loaded keystroke helps
extern char **KeyStrokeHelps; /// Keystroke help pairs
extern int nKeyStrokeHelps; ///< Number of loaded keystroke helps
extern char **KeyStrokeHelps; ///< Keystroke help pairs
#define MENUS_MAXMENU 128 /// FIXME: wrong place, docu
#define MENUS_MAXFUNC 128 /// FIXME: wrong place, docu
#define MENUS_MAXMENU 128 ///< @fixme wrong place, docu
#define MENUS_MAXFUNC 128 ///< @fixme wrong place, docu
#ifdef DOXYGEN // no real code, only for document

View file

@ -37,7 +37,7 @@
-- Declarations
----------------------------------------------------------------------------*/
#define MINIMAP_FAC (16*3) /// integer scale factor
#define MINIMAP_FAC (16*3) ///< integer scale factor
/// unit attacked are shown red for at least this amount of cycles
#define ATTACK_RED_DURATION (1*CYCLES_PER_SECOND)
@ -51,12 +51,12 @@
-- Variables
----------------------------------------------------------------------------*/
extern int MinimapX; /// Minimap drawing position x offset
extern int MinimapY; /// Minimap drawing position y offset
extern int MinimapX; ///< Minimap drawing position x offset
extern int MinimapY; ///< Minimap drawing position y offset
extern int MinimapWithTerrain; /// display minimap with terrain
extern int MinimapFriendly; /// switch colors of friendly units
extern int MinimapShowSelected; /// highlight selected units
extern int MinimapWithTerrain; ///< display minimap with terrain
extern int MinimapFriendly; ///< switch colors of friendly units
extern int MinimapShowSelected; ///< highlight selected units
/*----------------------------------------------------------------------------
-- Functions

View file

@ -343,7 +343,7 @@
----------------------------------------------------------------------------*/
#ifndef __STRUCT_MISSILETYPE__
#define __STRUCT_MISSILETYPE__ /// protect duplicate missile typedef
#define __STRUCT_MISSILETYPE__ ///< protect duplicate missile typedef
/**
** Missile-type typedef
@ -352,8 +352,8 @@ typedef struct _missile_type_ MissileType;
#endif
#define MAX_MISSILES 2048 /// maximum number of missiles
#define MAX_LOCAL_MISSILES 4096 /// maximum number of local missiles
#define MAX_MISSILES 2048 ///< maximum number of missiles
#define MAX_LOCAL_MISSILES 4096 ///< maximum number of local missiles
/**
** Missile-type-class typedef
@ -365,70 +365,70 @@ typedef int MissileClass;
**
*/
enum _missile_class_ {
// Missile does nothing
/// Missile does nothing
MissileClassNone,
// Missile flies from x,y to x1,y1
/// Missile flies from x,y to x1,y1
MissileClassPointToPoint,
// Missile flies from x,y to x1,y1 than shows hit animation.
/// Missile flies from x,y to x1,y1 than shows hit animation.
MissileClassPointToPointWithHit,
// Missile flies from x,y to x1,y1 and animates ONCE from start to finish and back
/// Missile flies from x,y to x1,y1 and animates ONCE from start to finish and back
MissileClassPointToPointCycleOnce,
// Missile flies from x,y to x1,y1 than bounces three times.
/// Missile flies from x,y to x1,y1 than bounces three times.
MissileClassPointToPointBounce,
// Missile appears at x,y, does it's anim and vanishes.
/// Missile appears at x,y, does it's anim and vanishes.
MissileClassStay,
// Missile appears at x,y, then cycle through the frames once.
/// Missile appears at x,y, then cycle through the frames once.
MissileClassCycleOnce,
// Missile doesn't move, than checks the source unit for HP.
/// Missile doesn't move, than checks the source unit for HP.
MissileClassFire,
// Missile shows the hit points.
/// Missile shows the hit points.
MissileClassHit,
// Missile flies from x,y to x1,y1 using a parabolic path
/// Missile flies from x,y to x1,y1 using a parabolic path
MissileClassParabolic,
// Missile wait on x,y until a non-air unit comes by, the explodes.
/// Missile wait on x,y until a non-air unit comes by, the explodes.
MissileClassLandMine,
// Missile appears at x,y, is whirlwind
/// Missile appears at x,y, is whirlwind
MissileClassWhirlwind,
// Missile surround x,y
/// Missile surround x,y
MissileClassFlameShield,
// Missile is death coil.
/// Missile is death coil.
MissileClassDeathCoil
};
/// Base structure of missile-types
struct _missile_type_ {
char* Ident; /// missile name
char* File; /// missile sprite file
int Transparency; /// missile transparency possible value is 50 (later 25 and 75)
int Width; /// missile width in pixels
int Height; /// missile height in pixels
int DrawLevel; /// Level to draw missile at
int SpriteFrames; /// number of sprite frames in graphic
int NumDirections; /// number of directions missile can face
char* Ident; ///< missile name
char* File; ///< missile sprite file
int Transparency; ///< missile transparency possible value is 50 (later 25 and 75)
int Width; ///< missile width in pixels
int Height; ///< missile height in pixels
int DrawLevel; ///< Level to draw missile at
int SpriteFrames; ///< number of sprite frames in graphic
int NumDirections; ///< number of directions missile can face
// FIXME: FireSound defined but not used!
SoundConfig FiredSound; /// fired sound
SoundConfig ImpactSound; /// impact sound for this missile-type
/// @fixme FireSound defined but not used!
SoundConfig FiredSound; ///< fired sound
SoundConfig ImpactSound; ///< impact sound for this missile-type
unsigned Flip : 1; /// flip image when facing left
unsigned CanHitOwner : 1; /// missile can hit the owner
unsigned FriendlyFire : 1;/// missile can't hit own units
unsigned Flip : 1; ///< flip image when facing left
unsigned CanHitOwner : 1; ///< missile can hit the owner
unsigned FriendlyFire : 1;///< missile can't hit own units
MissileClass Class; /// missile class
int NumBounces; /// number of bounces
int StartDelay; /// missile start delay
int Sleep; /// missile sleep
int Speed; /// missile speed
MissileClass Class; ///< missile class
int NumBounces; ///< number of bounces
int StartDelay; ///< missile start delay
int Sleep; ///< missile sleep
int Speed; ///< missile speed
int Range; /// missile damage range
int SplashFactor; /// missile splash divisor
char* ImpactName; /// impact missile-type name
MissileType* ImpactMissile; /// missile produces an impact
char* SmokeName; /// impact missile-type name
MissileType* SmokeMissile; /// Trailling missile
int Range; ///< missile damage range
int SplashFactor; ///< missile splash divisor
char* ImpactName; ///< impact missile-type name
MissileType* ImpactMissile; ///< missile produces an impact
char* SmokeName; ///< impact missile-type name
MissileType* SmokeMissile; ///< Trailling missile
// --- FILLED UP ---
Graphic* Sprite; /// missile sprite image
Graphic* Sprite; ///< missile sprite image
};
/*----------------------------------------------------------------------------
@ -443,52 +443,52 @@ typedef void FuncController(Missile *);
/// Missile on the map
struct _missile_ {
int SourceX; /// Missile Source X
int SourceY; /// Missile Source Y
int X; /// missile pixel position
int Y; /// missile pixel position
int DX; /// missile pixel destination
int DY; /// missile pixel destination
MissileType* Type; /// missile-type pointer
int SpriteFrame; /// sprite frame counter
int State; /// state
int AnimWait; /// Animation wait.
int Wait; /// delay between frames
int Delay; /// delay to showup
int SourceX; ///< Missile Source X
int SourceY; ///< Missile Source Y
int X; ///< missile pixel position
int Y; ///< missile pixel position
int DX; ///< missile pixel destination
int DY; ///< missile pixel destination
MissileType* Type; ///< missile-type pointer
int SpriteFrame; ///< sprite frame counter
int State; ///< state
int AnimWait; ///< Animation wait.
int Wait; ///< delay between frames
int Delay; ///< delay to showup
Unit* SourceUnit; /// unit that fires (could be killed)
Unit* TargetUnit; /// target unit, used for spells
Unit* SourceUnit; ///< unit that fires (could be killed)
Unit* TargetUnit; ///< target unit, used for spells
int Damage; /// direct damage that missile applies
int Damage; ///< direct damage that missile applies
int TTL; /// time to live (ticks) used for spells
int Hidden; /// If this is 1 then the missile is invisible
int TTL; ///< time to live (ticks) used for spells
int Hidden; ///< If this is 1 then the missile is invisible
// Internal use:
int CurrentStep; /// Current step (0 <= x < TotalStep).
int TotalStep; /// Total step.
int CurrentStep; ///< Current step (0 <= x < TotalStep).
int TotalStep; ///< Total step.
unsigned Local:1; /// missile is a local missile
Missile** MissileSlot; /// pointer to missile slot
unsigned Local:1; ///< missile is a local missile
Missile** MissileSlot; ///< pointer to missile slot
};
typedef struct _burning_building_frame_ {
int Percent; /// HP percent
MissileType* Missile; /// Missile to draw
struct _burning_building_frame_* Next; /// Next pointer
int Percent; ///< HP percent
MissileType* Missile; ///< Missile to draw
struct _burning_building_frame_* Next; ///< Next pointer
} BurningBuildingFrame;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern MissileType** MissileTypes; /// All missile-types
extern int NumMissileTypes; /// Number of missile-types
extern MissileType** MissileTypes; ///< All missile-types
extern int NumMissileTypes; ///< Number of missile-types
extern char** MissileTypeWcNames; /// Mapping wc-number 2 symbol
extern const char* MissileClassNames[]; /// Missile class names
extern char** MissileTypeWcNames; ///< Mapping wc-number 2 symbol
extern const char* MissileClassNames[]; ///< Missile class names
extern BurningBuildingFrame* BurningBuildingFrames; /// Burning building frames
extern BurningBuildingFrame* BurningBuildingFrames; ///< Burning building frames
/*----------------------------------------------------------------------------
-- Functions

View file

@ -49,16 +49,16 @@
** Play movie flags.
*/
enum _play_movie_flags_ {
PlayMovieFullScreen = 1, /// Switch to full screen
PlayMovieZoomScreen = 2, /// Zoom to screen size
PlayMovieKeepAspect = 4, /// Keep the aspect while zooming
PlayMovieFullScreen = 1, ///< Switch to full screen
PlayMovieZoomScreen = 2, ///< Zoom to screen size
PlayMovieKeepAspect = 4, ///< Keep the aspect while zooming
};
/**
** Movie handle.
*/
typedef struct _movie_ {
void* File; /// Demux handler
void* File; ///< Demux handler
} Movie;
/*----------------------------------------------------------------------------

View file

@ -117,10 +117,10 @@ typedef int Socket;
-- Variables
----------------------------------------------------------------------------*/
extern int NetLastSocket; /// Last socket
extern unsigned long NetLastHost; /// Last host number (net format)
extern int NetLastPort; /// Last port number (net format)
extern unsigned long NetLocalAddrs[]; /// Local IP-Addrs of this host (net format)
extern int NetLastSocket; ///< Last socket
extern unsigned long NetLastHost; ///< Last host number (net format)
extern int NetLastPort; ///< Last port number (net format)
extern unsigned long NetLocalAddrs[]; ///< Local IP-Addrs of this host (net format)
/*----------------------------------------------------------------------------
-- Functions

View file

@ -59,7 +59,7 @@
/// Network protocol printf format arguments
#define NetworkProtocolFormatArgs(v) (v) / 10000,((v) / 100) % 100,(v) % 100
#define NetworkDefaultPort 6660 /// Default communication port
#define NetworkDefaultPort 6660 ///< Default communication port
/*----------------------------------------------------------------------------
-- Declarations
@ -69,18 +69,18 @@
** Network systems active in current game.
*/
typedef struct _network_host_ {
unsigned long Host; /// Host address
unsigned short Port; /// Port on host
unsigned short PlyNr; /// Player nummer
char PlyName[16]; /// Name of player
unsigned long Host; ///< Host address
unsigned short Port; ///< Port on host
unsigned short PlyNr; ///< Player nummer
char PlyName[16]; ///< Name of player
} NetworkHost;
/**
** Connect state information of network systems active in current game.
*/
typedef struct _network_state_ {
unsigned char State; /// Menu: ConnectState
unsigned short MsgCnt; /// Menu: Counter for state msg of same type (detect unreachable)
unsigned char State; ///< Menu: ConnectState
unsigned short MsgCnt; ///< Menu: Counter for state msg of same type (detect unreachable)
// Fill in here...
} NetworkState;
@ -88,15 +88,15 @@ typedef struct _network_state_ {
** Multiplayer game setup menu state
*/
typedef struct _setup_state_ {
unsigned char ResOpt; /// Resources option
unsigned char UnsOpt; /// Unit # option
unsigned char FwsOpt; /// Fog of war option
unsigned char TssOpt; /// Tileset select option
unsigned char GaTOpt; /// Game type option
unsigned char CompOpt[PlayerMax]; /// Free slot option selection
unsigned char Ready[PlayerMax]; /// Client ready state
unsigned char Race[PlayerMax]; /// Client race selection
unsigned long LastFrame[PlayerMax]; /// Last message received
unsigned char ResOpt; ///< Resources option
unsigned char UnsOpt; ///< Unit # option
unsigned char FwsOpt; ///< Fog of war option
unsigned char TssOpt; ///< Tileset select option
unsigned char GaTOpt; ///< Game type option
unsigned char CompOpt[PlayerMax]; ///< Free slot option selection
unsigned char Ready[PlayerMax]; ///< Client ready state
unsigned char Race[PlayerMax]; ///< Client race selection
unsigned long LastFrame[PlayerMax]; ///< Last message received
// Fill in here...
} ServerSetup;
@ -107,20 +107,20 @@ typedef struct _setup_state_ {
** I mean the versions and the UID ...
*/
typedef struct _init_message_ {
unsigned char Type; /// Init message type
unsigned char SubType; /// Init message subtype
int Stratagus; /// Stratagus engine version
int Version; /// Network protocol version
unsigned int ConfUID; /// Engine configuration UID (Checksum) FIXME: not available yet
unsigned int MapUID; /// UID of map to play. FIXME: add MAP name, path, etc
int Lag; /// Lag time
int Updates; /// Update frequency
char HostsCount; /// Number of hosts
unsigned char Type; ///< Init message type
unsigned char SubType; ///< Init message subtype
int Stratagus; ///< Stratagus engine version
int Version; ///< Network protocol version
unsigned int ConfUID; ///< Engine configuration UID (Checksum) FIXME: not available yet
unsigned int MapUID; ///< UID of map to play. FIXME: add MAP name, path, etc
int Lag; ///< Lag time
int Updates; ///< Update frequency
char HostsCount; ///< Number of hosts
union {
NetworkHost Hosts[PlayerMax]; /// Participant information
NetworkHost Hosts[PlayerMax]; ///< Participant information
char MapPath[256];
ServerSetup State; /// Server Setup State information
ServerSetup State; ///< Server Setup State information
} u;
} InitMessage;
@ -128,97 +128,97 @@ typedef struct _init_message_ {
** Network init config message subtypes (menu state machine).
*/
enum _ic_message_subtype_ {
ICMHello, /// Client Request
ICMConfig, /// Setup message configure clients
ICMHello, ///< Client Request
ICMConfig, ///< Setup message configure clients
ICMEngineMismatch, /// Stratagus engine version doesn't match
ICMProtocolMismatch, /// Network protocol version doesn't match
ICMEngineConfMismatch, /// Engine configuration isn't identical
ICMMapUidMismatch, /// MAP UID doesn't match
ICMEngineMismatch, ///< Stratagus engine version doesn't match
ICMProtocolMismatch, ///< Network protocol version doesn't match
ICMEngineConfMismatch, ///< Engine configuration isn't identical
ICMMapUidMismatch, ///< MAP UID doesn't match
ICMGameFull, /// No player slots available
ICMWelcome, /// Acknowledge for new client connections
ICMGameFull, ///< No player slots available
ICMWelcome, ///< Acknowledge for new client connections
ICMWaiting, /// Client has received Welcome and is waiting for Map/State
ICMMap, /// MapInfo (and Mapinfo Ack)
ICMState, /// StateInfo
ICMResync, /// Ack StateInfo change
ICMWaiting, ///< Client has received Welcome and is waiting for Map/State
ICMMap, ///< MapInfo (and Mapinfo Ack)
ICMState, ///< StateInfo
ICMResync, ///< Ack StateInfo change
ICMServerQuit, /// Server has quit game
ICMGoodBye, /// Client wants to leave game
ICMSeeYou, /// Client has left game
ICMServerQuit, ///< Server has quit game
ICMGoodBye, ///< Client wants to leave game
ICMSeeYou, ///< Client has left game
ICMGo, /// Client is ready to run
ICMGo, ///< Client is ready to run
ICMAYT, /// Server asks are you there
ICMIAH, /// Client answers I am here
ICMAYT, ///< Server asks are you there
ICMIAH, ///< Client answers I am here
};
/**
** Network Client connect states
*/
enum _net_client_con_state_ {
ccs_unused = 0,
ccs_connecting, /// New client
ccs_connected, /// Has received slot info
ccs_mapinfo, /// Has received matching map-info
ccs_badmap, /// Has received non-matching map-info
ccs_synced, /// Client is in sync with server
ccs_async, /// Server user has changed selection
ccs_changed, /// Client user has made menu selection
ccs_detaching, /// Client user wants to detach
ccs_disconnected, /// Client has detached
ccs_unreachable, /// Server is unreachable
ccs_usercanceled, /// Connection canceled by user
ccs_nofreeslots, /// Server has no more free slots
ccs_serverquits, /// Server quits
ccs_goahead, /// Server wants to start game
ccs_started, /// Server has started game
ccs_incompatibleengine, /// Incompatible engine version
ccs_incompatiblenetwork, /// Incompatible netowrk version
ccs_unused = 0, ///< Unused.
ccs_connecting, ///< New client
ccs_connected, ///< Has received slot info
ccs_mapinfo, ///< Has received matching map-info
ccs_badmap, ///< Has received non-matching map-info
ccs_synced, ///< Client is in sync with server
ccs_async, ///< Server user has changed selection
ccs_changed, ///< Client user has made menu selection
ccs_detaching, ///< Client user wants to detach
ccs_disconnected, ///< Client has detached
ccs_unreachable, ///< Server is unreachable
ccs_usercanceled, ///< Connection canceled by user
ccs_nofreeslots, ///< Server has no more free slots
ccs_serverquits, ///< Server quits
ccs_goahead, ///< Server wants to start game
ccs_started, ///< Server has started game
ccs_incompatibleengine, ///< Incompatible engine version
ccs_incompatiblenetwork, ///< Incompatible netowrk version
};
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern char* NetworkArg; /// Network command line argument
extern int NetPlayers; /// Network players
extern int NetworkPort; /// Local network port to use
extern char* NetworkArg; ///< Network command line argument
extern int NetPlayers; ///< Network players
extern int NetworkPort; ///< Local network port to use
extern char LocalPlayerName[16]; /// Name of local player
extern char LocalPlayerName[16]; ///< Name of local player
extern int HostsCount; /// Number of hosts.
extern NetworkHost Hosts[PlayerMax]; /// Host, port, and number of all players.
extern int HostsCount; ///< Number of hosts.
extern NetworkHost Hosts[PlayerMax]; ///< Host, port, and number of all players.
extern int NetConnectRunning; /// Network menu: Setup mode active
extern NetworkState NetStates[PlayerMax]; /// Network menu: Server: Client Host states
extern unsigned char NetLocalState; /// Network menu: Local Server/Client connect state
extern int NetLocalHostsSlot; /// Network menu: Slot # in Hosts array of local client
extern char NetTriesText[32]; /// Network menu: Client tries count text
extern char NetServerText[64]; /// Network menu: Text describing the Network Server IP
extern int NetLocalPlayerNumber; /// Player number of local client
extern int NetConnectRunning; ///< Network menu: Setup mode active
extern NetworkState NetStates[PlayerMax]; ///< Network menu: Server: Client Host states
extern unsigned char NetLocalState; ///< Network menu: Local Server/Client connect state
extern int NetLocalHostsSlot; ///< Network menu: Slot # in Hosts array of local client
extern char NetTriesText[32]; ///< Network menu: Client tries count text
extern char NetServerText[64]; ///< Network menu: Text describing the Network Server IP
extern int NetLocalPlayerNumber; ///< Player number of local client
extern ServerSetup ServerSetupState; /// Network menu: Multiplayer Server Menu selections state
extern ServerSetup LocalSetupState; /// Network menu: Multiplayer Client Menu selections local state
extern ServerSetup ServerSetupState; ///< Network menu: Multiplayer Server Menu selections state
extern ServerSetup LocalSetupState; ///< Network menu: Multiplayer Client Menu selections local state
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
extern void NetworkServerStartGame(void); /// Server user has finally hit the start game button
extern void NetworkConnectSetupGame(void); /// Assign Player slot, evaluate Setup state..
extern void NetworkServerStartGame(void); ///< Server user has finally hit the start game button
extern void NetworkConnectSetupGame(void); ///< Assign Player slot, evaluate Setup state..
extern void NetworkInitClientConnect(void); /// Setup network connect state machine for clients
extern void NetworkExitClientConnect(void); /// Terminate network connect state machine for clients
extern void NetworkInitServerConnect(void); /// Setup network connect state machine for the server
extern void NetworkExitServerConnect(void); /// Terminate network connect state machine for the server
extern int NetworkParseSetupEvent(const char *buf, int size); /// Parse a network connect event
extern int NetworkSetupServerAddress(const char *serveraddr); /// Menu: Setup the server IP
extern void NetworkProcessClientRequest(void); /// Menu Loop: Send out client request messages
extern void NetworkProcessServerRequest(void); /// Menu Loop: Send out server request messages
extern void NetworkServerResyncClients(void); /// Menu Loop: Server: Mark clients state to send stateinfo message
extern void NetworkDetachFromServer(void); /// Menu Loop: Client: Send GoodBye to the server and detach
extern void NetworkInitClientConnect(void); ///< Setup network connect state machine for clients
extern void NetworkExitClientConnect(void); ///< Terminate network connect state machine for clients
extern void NetworkInitServerConnect(void); ///< Setup network connect state machine for the server
extern void NetworkExitServerConnect(void); ///< Terminate network connect state machine for the server
extern int NetworkParseSetupEvent(const char *buf, int size); ///< Parse a network connect event
extern int NetworkSetupServerAddress(const char *serveraddr); ///< Menu: Setup the server IP
extern void NetworkProcessClientRequest(void); ///< Menu Loop: Send out client request messages
extern void NetworkProcessServerRequest(void); ///< Menu Loop: Send out server request messages
extern void NetworkServerResyncClients(void); ///< Menu Loop: Server: Mark clients state to send stateinfo message
extern void NetworkDetachFromServer(void); ///< Menu Loop: Client: Send GoodBye to the server and detach
//@}

View file

@ -46,9 +46,9 @@
-- Defines
----------------------------------------------------------------------------*/
#define NetworkMaxLag 250 /// Debuging network lag (# game cycles)
#define NetworkMaxLag 250 ///< Debuging network lag (# game cycles)
#define MaxNetworkCommands 9 /// Max Commands In A Packet
#define MaxNetworkCommands 9 ///< Max Commands In A Packet
#define IsNetworkGame() (NetworkFildes != (Socket)-1)
@ -62,107 +62,107 @@
** @todo cleanup the message types.
*/
enum _message_type_ {
MessageNone, /// When Nothing Is Happening
MessageInitHello, /// Start connection
MessageInitReply, /// Connection reply
MessageInitConfig, /// Setup message configure clients
MessageNone, ///< When Nothing Is Happening
MessageInitHello, ///< Start connection
MessageInitReply, ///< Connection reply
MessageInitConfig, ///< Setup message configure clients
MessageSync, /// Heart beat
MessageSelection, /// Update a Selection from Team Player
MessageQuit, /// Quit game
MessageQuitAck, /// Quit reply - UNUSED YET - Protocol Version 2 - Reserved for menus
MessageResend, /// Resend message
MessageSync, ///< Heart beat
MessageSelection, ///< Update a Selection from Team Player
MessageQuit, ///< Quit game
MessageQuitAck, ///< Quit reply - UNUSED YET - Protocol Version 2 - Reserved for menus
MessageResend, ///< Resend message
MessageChat, /// Chat message
MessageChatTerm, /// Chat message termination - Protocol Version 2
MessageChat, ///< Chat message
MessageChatTerm, ///< Chat message termination - Protocol Version 2
MessageCommandStop, /// Unit command stop
MessageCommandStand, /// Unit command stand ground
MessageCommandFollow, /// Unit command follow
MessageCommandMove, /// Unit command move
MessageCommandRepair, /// Unit command repair
MessageCommandAttack, /// Unit command attack
MessageCommandGround, /// Unit command attack ground
MessageCommandPatrol, /// Unit command patrol
MessageCommandBoard, /// Unit command borad
MessageCommandUnload, /// Unit command unload
MessageCommandBuild, /// Unit command build building
MessageCommandDismiss, /// Unit command dismiss unit
MessageCommandResourceLoc, /// Unit command resource location
MessageCommandResource, /// Unit command resource
MessageCommandReturn, /// Unit command return goods
MessageCommandTrain, /// Unit command train
MessageCommandCancelTrain, /// Unit command cancel training
MessageCommandUpgrade, /// Unit command upgrade
MessageCommandCancelUpgrade, /// Unit command cancel upgrade
MessageCommandResearch, /// Unit command research
MessageCommandCancelResearch, /// Unit command cancel research
MessageCommandStop, ///< Unit command stop
MessageCommandStand, ///< Unit command stand ground
MessageCommandFollow, ///< Unit command follow
MessageCommandMove, ///< Unit command move
MessageCommandRepair, ///< Unit command repair
MessageCommandAttack, ///< Unit command attack
MessageCommandGround, ///< Unit command attack ground
MessageCommandPatrol, ///< Unit command patrol
MessageCommandBoard, ///< Unit command borad
MessageCommandUnload, ///< Unit command unload
MessageCommandBuild, ///< Unit command build building
MessageCommandDismiss, ///< Unit command dismiss unit
MessageCommandResourceLoc, ///< Unit command resource location
MessageCommandResource, ///< Unit command resource
MessageCommandReturn, ///< Unit command return goods
MessageCommandTrain, ///< Unit command train
MessageCommandCancelTrain, ///< Unit command cancel training
MessageCommandUpgrade, ///< Unit command upgrade
MessageCommandCancelUpgrade, ///< Unit command cancel upgrade
MessageCommandResearch, ///< Unit command research
MessageCommandCancelResearch, ///< Unit command cancel research
MessageExtendedCommand, /// Command is the next byte
MessageExtendedCommand, ///< Command is the next byte
// ATTN: __MUST__ be last due to spellid encoding!!!
MessageCommandSpellCast /// Unit command spell cast
MessageCommandSpellCast ///< Unit command spell cast
};
/**
** Network extended message types.
*/
enum _extended_message_type_ {
ExtendedMessageDiplomacy, /// Change diplomacy
ExtendedMessageSharedVision, /// Change shared vision
ExtendedMessageDiplomacy, ///< Change diplomacy
ExtendedMessageSharedVision, ///< Change shared vision
};
/**
** Network acknowledge message.
*/
typedef struct _ack_message_ {
unsigned char Type; /// Acknowledge message type
unsigned char Type; ///< Acknowledge message type
} Acknowledge;
/**
** Network command message.
*/
typedef struct _network_command_ {
UnitRef Unit; /// Command for unit
unsigned short X; /// Map position X
unsigned short Y; /// Map position Y
UnitRef Dest; /// Destination unit
UnitRef Unit; ///< Command for unit
unsigned short X; ///< Map position X
unsigned short Y; ///< Map position Y
UnitRef Dest; ///< Destination unit
} NetworkCommand;
/**
** Extended network command message.
*/
typedef struct _network_extended_command_ {
unsigned char ExtendedType; /// Extended network command type
unsigned char Arg1; /// Argument 1
unsigned short Arg2; /// Argument 2
unsigned short Arg3; /// Argument 3
unsigned short Arg4; /// Argument 4
unsigned char ExtendedType; ///< Extended network command type
unsigned char Arg1; ///< Argument 1
unsigned short Arg2; ///< Argument 2
unsigned short Arg3; ///< Argument 3
unsigned short Arg4; ///< Argument 4
} NetworkExtendedCommand;
/**
** Network chat message.
*/
typedef struct _network_chat_ {
unsigned char Player; /// Sending player
char Text[7]; /// Message bytes
unsigned char Player; ///< Sending player
char Text[7]; ///< Message bytes
} NetworkChat;
/**
** Network Selection Info
*/
typedef struct _network_selection_header_ {
unsigned NumberSent : 6; /// New Number Selected
unsigned Add : 1; /// Adding to Selection
unsigned Remove : 1; /// Removing from Selection
unsigned char Type[MaxNetworkCommands]; /// Command
unsigned NumberSent : 6; ///< New Number Selected
unsigned Add : 1; ///< Adding to Selection
unsigned Remove : 1; ///< Removing from Selection
unsigned char Type[MaxNetworkCommands]; ///< Command
} NetworkSelectionHeader;
/**
** Network Selection Update
*/
typedef struct _network_selection_ {
UnitRef Unit[4]; /// Selection Units
UnitRef Unit[4]; ///< Selection Units
} NetworkSelection;
/**
@ -171,9 +171,8 @@ typedef struct _network_selection_ {
** Header for the packet.
*/
typedef struct _network_packet_header_ {
unsigned char Cycle; /// Destination game cycle
unsigned char Type[MaxNetworkCommands]; /// Command
/// Commands in packet
unsigned char Cycle; ///< Destination game cycle
unsigned char Type[MaxNetworkCommands]; ///< Commands in packet
} NetworkPacketHeader;
/**
@ -183,7 +182,7 @@ typedef struct _network_packet_header_ {
**
*/
typedef struct _network_packet_ {
NetworkPacketHeader Header; /// Packet Header Info
NetworkPacketHeader Header; ///< Packet Header Info
NetworkCommand Command[MaxNetworkCommands];
} NetworkPacket;
@ -191,26 +190,26 @@ typedef struct _network_packet_ {
-- Variables
----------------------------------------------------------------------------*/
extern int NetworkNumInterfaces; /// Network number of interfaces
extern Socket NetworkFildes; /// Network file descriptor
extern int NetworkInSync; /// Network is in sync
extern int NetworkUpdates; /// Network update each # game cycles
extern int NetworkLag; /// Network lag (# game cycles)
extern unsigned long NetworkStatus[PlayerMax]; /// Network status
extern int NoRandomPlacementMultiplayer;// Removes randomization of player placements
extern int NetworkNumInterfaces; ///< Network number of interfaces
extern Socket NetworkFildes; ///< Network file descriptor
extern int NetworkInSync; ///< Network is in sync
extern int NetworkUpdates; ///< Network update each # game cycles
extern int NetworkLag; ///< Network lag (# game cycles)
extern unsigned long NetworkStatus[PlayerMax]; ///< Network status
extern int NoRandomPlacementMultiplayer; ///< Removes randomization of player placements
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
extern void InitNetwork1(void); /// Initialise network part 1 (ports)
extern void InitNetwork2(void); /// Initialise network part 2
extern void ExitNetwork1(void); /// Cleanup network part 1 (ports)
extern void NetworkEvent(void); /// Handle network events
extern void NetworkSync(void); /// Hold in sync
extern void NetworkQuit(void); /// Quit game
extern void NetworkRecover(void); /// Recover network
extern void NetworkCommands(void); /// Get all network commands
extern void NetworkChatMessage(const char*msg); /// Send chat message
extern void InitNetwork1(void); ///< Initialise network part 1 (ports)
extern void InitNetwork2(void); ///< Initialise network part 2
extern void ExitNetwork1(void); ///< Cleanup network part 1 (ports)
extern void NetworkEvent(void); ///< Handle network events
extern void NetworkSync(void); ///< Hold in sync
extern void NetworkQuit(void); ///< Quit game
extern void NetworkRecover(void); ///< Recover network
extern void NetworkCommands(void); ///< Get all network commands
extern void NetworkChatMessage(const char*msg); ///< Send chat message
/// Send network command.
extern void NetworkSendCommand(int command, const Unit* unit, int x, int y,
const Unit* dest, const UnitType* type, int status);

View file

@ -52,11 +52,11 @@
** stop others how far to goal.
*/
enum _move_return_ {
PF_FAILED=-3, /// This Pathfinder failed, try another
PF_UNREACHABLE=-2, /// Unreachable stop
PF_REACHED=-1, /// Reached goal stop
PF_WAIT=0, /// Wait, no time or blocked
PF_MOVE=1, /// On the way moving
PF_FAILED=-3, ///< This Pathfinder failed, try another
PF_UNREACHABLE=-2, ///< Unreachable stop
PF_REACHED=-1, ///< Reached goal stop
PF_WAIT=0, ///< Wait, no time or blocked
PF_MOVE=1, ///< On the way moving
};
/**

View file

@ -294,65 +294,65 @@
----------------------------------------------------------------------------*/
#ifndef __STRUCT_PLAYER__
#define __STRUCT_PLAYER__ /// protect duplicate player typedef
typedef struct _player_ Player; /// player typedef
#define __STRUCT_PLAYER__ ///< protect duplicate player typedef
typedef struct _player_ Player; ///< player typedef
#endif
/// Player structure
struct _player_ {
int Player; /// player as number
char* Name; /// name of non computer
int Player; ///< player as number
char* Name; ///< name of non computer
int Type; /// type of player (human,computer,...)
char* RaceName; /// name of race
int Race; /// race of player (orc,human,...)
int AiNum; /// AI for computer
int Type; ///< type of player (human,computer,...)
char* RaceName; ///< name of race
int Race; ///< race of player (orc,human,...)
int AiNum; ///< AI for computer
// friend enemy detection
int Team; /// team of player
unsigned Enemy; /// enemy bit field for this player
unsigned Allied; /// allied bit field for this player
unsigned SharedVision; /// shared vision bit field
int Team; ///< team of player
unsigned Enemy; ///< enemy bit field for this player
unsigned Allied; ///< allied bit field for this player
unsigned SharedVision; ///< shared vision bit field
int StartX; /// map tile start X position
int StartY; /// map tile start Y position
int StartX; ///< map tile start X position
int StartY; ///< map tile start Y position
int Resources[MaxCosts]; /// resources in store
int LastResources[MaxCosts]; /// last values for revenue
int Incomes[MaxCosts]; /// income of the resources
int Revenue[MaxCosts]; /// income rate of the resources
int Resources[MaxCosts]; ///< resources in store
int LastResources[MaxCosts]; ///< last values for revenue
int Incomes[MaxCosts]; ///< income of the resources
int Revenue[MaxCosts]; ///< income rate of the resources
// FIXME: shouldn't use the constant
int UnitTypesCount[UnitTypeMax]; /// total units of unit-type
int UnitTypesCount[UnitTypeMax]; ///< total units of unit-type
int AiEnabled; /// handle AI on local computer
void* Ai; /// Ai structure pointer
int AiEnabled; ///< handle AI on local computer
void* Ai; ///< Ai structure pointer
Unit** Units; /// units of this player
int TotalNumUnits; /// total # units for units' list
int NumBuildings; /// # buildings
int Supply; /// supply available/produced
int Demand; /// demand of player
Unit** Units; ///< units of this player
int TotalNumUnits; ///< total # units for units' list
int NumBuildings; ///< # buildings
int Supply; ///< supply available/produced
int Demand; ///< demand of player
int UnitLimit; /// # food units allowed
int BuildingLimit; /// # buildings allowed
int TotalUnitLimit; /// # total unit number allowed
int UnitLimit; ///< # food units allowed
int BuildingLimit; ///< # buildings allowed
int TotalUnitLimit; ///< # total unit number allowed
int Score; /// Points for killing ...
int Score; ///< Points for killing ...
int TotalUnits;
int TotalBuildings;
int TotalResources[MaxCosts];
int TotalRazings;
int TotalKills; /// How many unit killed
int TotalKills; ///< How many unit killed
// Display video
Uint32 Color; /// color of units on minimap
Uint32 Color; ///< color of units on minimap
UnitColors UnitColors; /// Unit colors for new units
UnitColors UnitColors; ///< Unit colors for new units
// Upgrades/Allows:
Allow Allow; /// Allowed for player
UpgradeTimers UpgradeTimers; /// Timer for the upgrades
Allow Allow; ///< Allowed for player
UpgradeTimers UpgradeTimers; ///< Timer for the upgrades
};
/**
@ -362,17 +362,17 @@ struct _player_ {
*/
#define MAX_RACES 8
typedef struct _player_race_ {
int Race[MAX_RACES]; /// race number
char Visible[MAX_RACES]; /// race should be visible in pulldown
char* Name[MAX_RACES]; /// race names
char* Display[MAX_RACES]; /// text to display in pulldown
int Count; /// number of races
int Race[MAX_RACES]; ///< race number
char Visible[MAX_RACES]; ///< race should be visible in pulldown
char* Name[MAX_RACES]; ///< race names
char* Display[MAX_RACES]; ///< text to display in pulldown
int Count; ///< number of races
} PlayerRace;
enum PlayerRacesOld {
PlayerRaceHuman = 0, /// belongs to human
PlayerRaceOrc = 1, /// belongs to orc
PlayerRaceHuman = 0, ///< belongs to human
PlayerRaceOrc = 1, ///< belongs to orc
};
#define PlayerRaceNeutral (PlayerRaces.Count-1)
@ -415,12 +415,12 @@ enum PlayerRacesOld {
** of this player are rescued.
*/
enum PlayerTypes {
PlayerNeutral = 2, /// neutral
PlayerNobody = 3, /// unused slot
PlayerComputer = 4, /// computer player
PlayerPerson = 5, /// human player
PlayerRescuePassive = 6, /// rescued passive
PlayerRescueActive = 7, /// rescued active
PlayerNeutral = 2, ///< neutral
PlayerNobody = 3, ///< unused slot
PlayerComputer = 4, ///< computer player
PlayerPerson = 5, ///< human player
PlayerRescuePassive = 6, ///< rescued passive
PlayerRescueActive = 7, ///< rescued active
};
/**
@ -429,39 +429,39 @@ enum PlayerTypes {
** Mapped with #AiTypeWcNames to internal symbols.
*/
enum PlayerAis {
PlayerAiLand = 0x00, /// attack at land
PlayerAiPassive = 0x01, /// passive does nothing
PlayerAiSea = 0x19, /// attack at sea
PlayerAiAir = 0x1A, /// attack at air
PlayerAiUniversal = 0xFF, /// attack best possible
PlayerAiLand = 0x00, ///< attack at land
PlayerAiPassive = 0x01, ///< passive does nothing
PlayerAiSea = 0x19, ///< attack at sea
PlayerAiAir = 0x1A, ///< attack at air
PlayerAiUniversal = 0xFF, ///< attack best possible
};
#define PlayerNumNeutral 15 /// this is the neutral player slot
#define PlayerNumNeutral 15 ///< this is the neutral player slot
#if 0
#define PlayerMax 16 /// maximal players supported
#define PlayerMax 16 ///< maximal players supported
#endif
/**
** Notify types. Noties are send to the player.
*/
enum _notify_type_ {
NotifyRed, /// Red alram
NotifyYellow, /// Yellow alarm
NotifyGreen, /// Green alarm
NotifyRed, ///< Red alram
NotifyYellow, ///< Yellow alarm
NotifyGreen, ///< Green alarm
};
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern int NumPlayers; /// How many player slots used
extern Player Players[PlayerMax]; /// All players
extern Player* ThisPlayer; /// Player on local computer
extern int NoRescueCheck; /// Disable rescue check
extern int NumPlayers; ///< How many player slots used
extern Player Players[PlayerMax]; ///< All players
extern Player* ThisPlayer; ///< Player on local computer
extern int NoRescueCheck; ///< Disable rescue check
extern Uint32 PlayerColors[PlayerMax][4];
extern char* PlayerColorNames[PlayerMax]; /// Player color names
extern char* PlayerColorNames[PlayerMax]; ///< Player color names
extern PlayerRace PlayerRaces; /// Player races
extern PlayerRace PlayerRaces; ///< Player races
/*----------------------------------------------------------------------------
-- Functions

View file

@ -46,43 +46,43 @@
//
// Used for reading puds.
//
#define MapMoveOnlyLand 0x01 /// only land units
#define MapMoveCoast 0x02 /// only water transporters
#define MapMoveHuman 0x04 /// marks human wall on map
#define MapMoveWallO 0x08 /// orcish wall on map
#define MapMoveOnlyLand 0x01 ///< only land units
#define MapMoveCoast 0x02 ///< only water transporters
#define MapMoveHuman 0x04 ///< marks human wall on map
#define MapMoveWallO 0x08 ///< orcish wall on map
// 1101
#define MapMoveWallH 0x0D /// human wall on map
#define MapMoveDirt 0x10 /// no buildings allowed
#define MapMoveWallH 0x0D ///< human wall on map
#define MapMoveDirt 0x10 ///< no buildings allowed
// 20
#define MapMoveOnlyWater 0x40 /// only water units
#define MapMoveUnpassable 0x80 /// blocked
#define MapMoveOnlyWater 0x40 ///< only water units
#define MapMoveUnpassable 0x80 ///< blocked
#define MapMoveForestOrRock 0x81 /// forest or rock on map
#define MapMoveCoast2 0x82 /// unknown
#define MapMoveWall 0x8D /// wall on map
#define MapMoveForestOrRock 0x81 ///< forest or rock on map
#define MapMoveCoast2 0x82 ///< unknown
#define MapMoveWall 0x8D ///< wall on map
#define MapMoveLandUnit 0x100 /// land unit
#define MapMoveAirUnit 0x200 /// air unit
#define MapMoveSeaUnit 0x400 /// water unit
#define MapMoveBuildingUnit 0x800 /// building unit
#define MapMoveBlocked 0xF00 /// no unit allowed
#define MapMoveLandUnit 0x100 ///< land unit
#define MapMoveAirUnit 0x200 ///< air unit
#define MapMoveSeaUnit 0x400 ///< water unit
#define MapMoveBuildingUnit 0x800 ///< building unit
#define MapMoveBlocked 0xF00 ///< no unit allowed
// LOW BITS: Area connected!
#define MapActionWater 0x0000 /// water on map
#define MapActionLand 0x4000 /// land on map
#define MapActionIsland 0xFFFA /// no trans, no land on map
#define MapActionWall 0xFFFB /// wall on map
#define MapActionRocks 0xFFFD /// rocks on map
#define MapActionForest 0xFFFE /// forest on map
/// @note LOW BITS: Area connected!
#define MapActionWater 0x0000 ///< water on map
#define MapActionLand 0x4000 ///< land on map
#define MapActionIsland 0xFFFA ///< no trans, no land on map
#define MapActionWall 0xFFFB ///< wall on map
#define MapActionRocks 0xFFFD ///< rocks on map
#define MapActionForest 0xFFFE ///< forest on map
// These are hard-coded PUD internals (and, as such, belong here!)
// FIXME: for our own maps this should become configurable
#define WC_UnitPeasant 0x02 /// human peasant
#define WC_UnitPeon 0x03 /// orc peon
#define WC_UnitGoldMine 0x5C /// goldmine
#define WC_UnitOilPatch 0x5D /// oilpatch
#define WC_StartLocationHuman 0x5E /// start location human
#define WC_StartLocationOrc 0x5F /// start location orc
/// @note These are hard-coded PUD internals (and, as such, belong here!)
/// @fixme for our own maps this should become configurable
#define WC_UnitPeasant 0x02 ///< human peasant
#define WC_UnitPeon 0x03 ///< orc peon
#define WC_UnitGoldMine 0x5C ///< goldmine
#define WC_UnitOilPatch 0x5D ///< oilpatch
#define WC_StartLocationHuman 0x5E ///< start location human
#define WC_StartLocationOrc 0x5F ///< start location orc
/*----------------------------------------------------------------------------
-- Declarations

View file

@ -71,8 +71,8 @@ extern int LuaCall(int narg, int clear);
-- Variables
----------------------------------------------------------------------------*/
extern char* CclStartFile; /// CCL start file
extern int CclInConfigFile; /// True while config file parsing
extern char* CclStartFile; ///< CCL start file
extern int CclInConfigFile; ///< True while config file parsing
/*----------------------------------------------------------------------------
-- Functions
@ -82,14 +82,14 @@ extern const char* LuaToString(lua_State* l, int narg);
extern lua_Number LuaToNumber(lua_State* l, int narg);
extern int LuaToBoolean(lua_State* l, int narg);
extern void CclGarbageCollect(int fast); /// Perform garbage collection
extern void InitCcl(void); /// Initialise ccl
extern void LoadCcl(void); /// Load ccl config file
extern void SaveCcl(CLFile* file); /// Save CCL module
extern void SavePreferences(void); /// Save user preferences
extern int CclCommand(const char*); /// Execute a ccl command
extern void CclFree(void*); /// Save free
extern void CleanCclCredits(); /// Free Ccl Credits Memory
extern void CclGarbageCollect(int fast); ///< Perform garbage collection
extern void InitCcl(void); ///< Initialise ccl
extern void LoadCcl(void); ///< Load ccl config file
extern void SaveCcl(CLFile* file); ///< Save CCL module
extern void SavePreferences(void); ///< Save user preferences
extern int CclCommand(const char*); ///< Execute a ccl command
extern void CclFree(void*); ///< Save free
extern void CleanCclCredits(); ///< Free Ccl Credits Memory
//@}

View file

@ -45,13 +45,13 @@
-- Functions
----------------------------------------------------------------------------*/
extern void SoundCclRegister(void); /// register ccl features
extern void SoundCclRegister(void); ///< register ccl features
#else // }{ defined(WITH_SOUND)
//-----------------------------------------------------------------------------
extern void SoundCclRegister(void); /// register ccl features
extern void SoundCclRegister(void); ///< register ccl features
#endif // } !defined(WITH_SOUND)

View file

@ -60,27 +60,27 @@ typedef struct _settings_ Settings;
**
*/
struct _settings_ {
int NetGameType; /// Multiplayer or single player
int NetGameType; ///< Multiplayer or single player
// Individual presets:
// For single-player game only Presets[0] will be used..
struct {
int Race; /// Race of the player
int Team; /// Team of player -- NOT SELECTABLE YET
int Type; /// Type of player (for network games)
int Race; ///< Race of the player
int Team; ///< Team of player -- NOT SELECTABLE YET
int Type; ///< Type of player (for network games)
} Presets[PlayerMax];
// Common settings:
int Resources; /// Preset resource factor
int NumUnits; /// Preset # of units
int Opponents; /// Preset # of ai-opponents
int Terrain; /// Terrain type (summer,winter,...)
int GameType; /// Game type (melee, free for all,...)
int NoFogOfWar; /// No fog of war
int RevealMap; /// Reveal map
int Resources; ///< Preset resource factor
int NumUnits; ///< Preset # of units
int Opponents; ///< Preset # of ai-opponents
int Terrain; ///< Terrain type (summer,winter,...)
int GameType; ///< Game type (melee, free for all,...)
int NoFogOfWar; ///< No fog of war
int RevealMap; ///< Reveal map
};
#define SettingsPresetMapDefault -1 /// Special: Use pud/cm supplied
#define SettingsPresetMapDefault -1 ///< Special: Use pud/cm supplied
/**
** Single or multiplayer settings
@ -129,40 +129,40 @@ enum _game_types_ {
// ----------------------------------------------------------------------------
#define MAX_BRIEFING_VOICES 20 /// How many intro voices supported
#define MAX_OBJECTIVES 9 /// How many objectives supported
#define MAX_BRIEFING_VOICES 20 ///< How many intro voices supported
#define MAX_OBJECTIVES 9 ///< How many objectives supported
typedef struct _intro_ {
char* Title; /// Intro title
char* Background; /// Background picture
char* TextFile; /// Intro text file
char* VoiceFile[MAX_BRIEFING_VOICES]; /// Intro voice file
char* Objectives[MAX_OBJECTIVES]; /// Objectives text
} Intro; /// Intro definition
char* Title; ///< Intro title
char* Background; ///< Background picture
char* TextFile; ///< Intro text file
char* VoiceFile[MAX_BRIEFING_VOICES]; ///< Intro voice file
char* Objectives[MAX_OBJECTIVES]; ///< Objectives text
} Intro; ///< Intro definition
// ----------------------------------------------------------------------------
typedef struct _credits_ {
char* Background; /// Background picture
char* Names; /// Names
char* Background; ///< Background picture
char* Names; ///< Names
} Credits;
// ----------------------------------------------------------------------------
#define MAX_TIPS 50 /// How many tips supported
#define MAX_TIPS 50 ///< How many tips supported
extern char* Tips[MAX_TIPS+1]; /// Array of tips
extern int ShowTips; /// Show tips at start of level
extern int CurrentTip; /// Current tip to display
extern char* Tips[MAX_TIPS+1]; ///< Array of tips
extern int ShowTips; ///< Show tips at start of level
extern int CurrentTip; ///< Current tip to display
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern Settings GameSettings; /// Game settings
extern Intro GameIntro; /// Game intro
extern Credits GameCredits; /// Game credits
extern Settings GameSettings; ///< Game settings
extern Intro GameIntro; ///< Game intro
extern Credits GameCredits; ///< Game credits
/*----------------------------------------------------------------------------
-- Functions

View file

@ -46,48 +46,48 @@
-- Definitons
----------------------------------------------------------------------------*/
#define MaxSampleVolume 255 /// Maximum sample volume
#define NO_SOUND 0 /// No valid sound ID
#define MaxSampleVolume 255 ///< Maximum sample volume
#define NO_SOUND 0 ///< No valid sound ID
/**
** Global game sounds, not associated to any unit-type
*/
typedef struct _game_sound_ {
SoundConfig PlacementError; /// used by ui
SoundConfig PlacementSuccess; /// used by ui
SoundConfig Click; /// used by ui
SoundConfig PlacementError; ///< used by ui
SoundConfig PlacementSuccess; ///< used by ui
SoundConfig Click; ///< used by ui
SoundConfig Docking; /// ship reaches coast
SoundConfig BuildingConstruction; /// building under construction
SoundConfig Docking; ///< ship reaches coast
SoundConfig BuildingConstruction; ///< building under construction
//FIXME: (Fabrice) I don't think it's the correct place to put this
SoundConfig WorkComplete[MAX_RACES]; /// building ready
/// @fixme (Fabrice) I don't think it's the correct place to put this
SoundConfig WorkComplete[MAX_RACES]; ///< building ready
SoundConfig Rescue[MAX_RACES]; /// rescue units
SoundConfig Rescue[MAX_RACES]; ///< rescue units
} GameSound;
typedef enum _play_section_type_ {
PlaySectionUnknown = -1, /// Unknown
PlaySectionGame, /// Game
PlaySectionBriefing, /// Briefing
PlaySectionStats, /// Stats
PlaySectionStatsVictory, /// Stats Victory
PlaySectionStatsDefeat, /// Stats Defeat
PlaySectionMainMenu, /// Main menu
PlaySectionUnknown = -1, ///< Unknown
PlaySectionGame, ///< Game
PlaySectionBriefing, ///< Briefing
PlaySectionStats, ///< Stats
PlaySectionStatsVictory, ///< Stats Victory
PlaySectionStatsDefeat, ///< Stats Defeat
PlaySectionMainMenu, ///< Main menu
} PlaySectionType;
typedef enum _play_section_order_ {
PlaySectionOrderAll, /// Sequential order
PlaySectionOrderRandom, /// Random order
PlaySectionOrderAll, ///< Sequential order
PlaySectionOrderRandom, ///< Random order
} PlaySectionOrder;
typedef struct _play_section_ {
char* Race; /// Race, NULL if for all races
PlaySectionType Type; /// Type
unsigned long CDTracks; /// Bit field of cd tracks. 32 enough?
PlaySectionOrder CDOrder; /// CD order
char** Files; /// Files
PlaySectionOrder FileOrder; /// File order
char* Race; ///< Race, NULL if for all races
PlaySectionType Type; ///< Type
unsigned long CDTracks; ///< Bit field of cd tracks. 32 enough?
PlaySectionOrder CDOrder; ///< CD order
char** Files; ///< Files
PlaySectionOrder FileOrder; ///< File order
} PlaySection;
/*----------------------------------------------------------------------------
@ -99,16 +99,16 @@ typedef struct _play_section_ {
** really turning it off on the server side.
*/
extern int SoundOff;
extern int MusicOff; /// Music turned off
extern int MusicOff; ///< Music turned off
extern GameSound GameSounds; /// Game sound configuration
extern GameSound GameSounds; ///< Game sound configuration
extern int PlayingMusic; /// flag true if playing music
extern int CallbackMusic; /// flag true callback ccl if stops
extern int PlayingMusic; ///< flag true if playing music
extern int CallbackMusic; ///< flag true callback ccl if stops
extern PlaySection* PlaySections; /// Play sections
extern int NumPlaySections; /// Number of play sections
extern PlaySectionType CurrentPlaySection; /// Current play section type
extern PlaySection* PlaySections; ///< Play sections
extern int NumPlaySections; ///< Number of play sections
extern PlaySectionType CurrentPlaySection; ///< Current play section type
extern char* CurrentMusicFile;
@ -174,23 +174,23 @@ extern void StopMusic(void);
-- Definitons
----------------------------------------------------------------------------*/
#define SoundOff 1 /// Dummy macro for without sound
#define PlayingMusic 1 /// Dummy macro for without sound
#define CurrentMusicFile "" /// Dummy macro for without sound
#define SoundOff 1 ///< Dummy macro for without sound
#define PlayingMusic 1 ///< Dummy macro for without sound
#define CurrentMusicFile "" ///< Dummy macro for without sound
#define PlayUnitSound(u,g) /// Dummy macro for without sound
#define PlayMissileSound(s,v) /// Dummy macro for without sound
#define PlayGameSound(s,v) /// Dummy macro for without sound
#define SetGlobalVolume(v) /// Dummy macro for without sound
#define SetMusicVolume(v) /// Dummy macro for without sound
#define InitSoundClient() /// Dummy macro for without sound
#define PlayUnitSound(u,g) ///< Dummy macro for without sound
#define PlayMissileSound(s,v) ///< Dummy macro for without sound
#define PlayGameSound(s,v) ///< Dummy macro for without sound
#define SetGlobalVolume(v) ///< Dummy macro for without sound
#define SetMusicVolume(v) ///< Dummy macro for without sound
#define InitSoundClient() ///< Dummy macro for without sound
#define PlaySoundFile(v) /// Dummy macro for without sound
#define PlayMusic(v) 0 /// Dummy macro for without sound
#define StopMusic() /// Dummy macro for without sound
#define CallbackMusicOn() /// Dummy macro for without sound
#define CallbackMusicOff() /// Dummy macro for without sound
#define PlaySectionMusic(v) /// Dummy macro for without sound
#define PlaySoundFile(v) ///< Dummy macro for without sound
#define PlayMusic(v) 0 ///< Dummy macro for without sound
#define StopMusic() ///< Dummy macro for without sound
#define CallbackMusicOn() ///< Dummy macro for without sound
#define CallbackMusicOff() ///< Dummy macro for without sound
#define PlaySectionMusic(v) ///< Dummy macro for without sound
#endif // } WITH_SOUND

View file

@ -34,23 +34,23 @@
//@{
/*----------------------------------------------------------------------------
-- Declarations
-- Declarations
----------------------------------------------------------------------------*/
/**
** Sound referencing.
** Sound referencing.
**
** Client side representation of the sound id.
** Passed to the sound server API.
** Client side representation of the sound id.
** Passed to the sound server API.
*/
typedef void* SoundId; /// sound identifier
typedef void* SoundId; ///< sound identifier
/*----------------------------------------------------------------------------
-- Variables
-- Variables
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
/// Make a sound bound to identifier
@ -64,12 +64,12 @@ extern SoundId MakeSoundGroup(const char* name,SoundId first,SoundId second);
/// Helper function, displays the mapping between sound names and sound ids
extern void DisplaySoundHashTable(void);
#ifndef WITH_SOUND // {
#ifndef WITH_SOUND // {
#define SoundIdForName(n) NULL /// Dummy macro for without sound
#define SoundIdForName(n) NULL ///< Dummy macro for without sound
#endif // } WITH_SOUND
#endif // } WITH_SOUND
//@}
#endif // !__SOUND_ID_H__
#endif // !__SOUND_ID_H__

View file

@ -33,10 +33,10 @@
//@{
#ifdef WITH_SOUND // {
#ifdef WITH_SOUND // {
/*----------------------------------------------------------------------------
-- Includes
-- Includes
----------------------------------------------------------------------------*/
#if defined(USE_THREAD) && !defined(USE_SDLA)
@ -48,164 +48,163 @@ extern sem_t SoundThreadChannelSemaphore;
#include "sound_id.h"
/*----------------------------------------------------------------------------
-- Definitons
-- Definitons
----------------------------------------------------------------------------*/
/**
** Maximal volume value
** Maximal volume value
*/
#define MaxVolume 255
/**
** General sample object typedef. (forward)
** General sample object typedef. (forward)
*/
typedef struct _sample_ Sample;
/**
** General sound object type.
** General sound object type.
**
** @todo FIXME: This is the planned new sample handling,
** which supports streaming, decompressing on demand, caching.
** @fixme This is the planned new sample handling,
** which supports streaming, decompressing on demand, caching.
*/
typedef struct _sample_type_ {
/**
** Read next samples from object.
** Read next samples from object.
**
** @param o pointer to object.
** @param buf buffer to fill.
** @param len length of buffer.
** @param o pointer to object.
** @param buf buffer to fill.
** @param len length of buffer.
**
** @return Number of bytes filled.
** @return Number of bytes filled.
*/
int (*Read) (Sample* o, void* buf, int len);
int (*Read) (Sample* o, void* buf, int len);
/**
** Free the sample object.
** Free the sample object.
**
** @param o pointer to object.
** @param o pointer to object.
*/
void (*Free) (Sample* o);
void (*Free) (Sample* o);
} SampleType;
/**
** RAW samples.
** RAW samples.
*/
struct _sample_ {
const SampleType* Type; /// Object type dependend
void* User; /// Object user data
const SampleType* Type; ///< Object type dependend
void* User; ///< Object user data
unsigned char Channels; /// mono or stereo
unsigned char SampleSize; /// sample size in bits
unsigned int Frequency; /// frequency in hz
unsigned short BitsPerSample; /// bits in a sample 8/16/32
int Length; /// sample length
char Data[1]; /// sample bytes
unsigned char Channels; ///< mono or stereo
unsigned char SampleSize; ///< sample size in bits
unsigned int Frequency; ///< frequency in hz
unsigned short BitsPerSample; ///< bits in a sample 8/16/32
int Length; ///< sample length
char Data[1]; ///< sample bytes
};
/// Free a sample object.
#define SoundFree(o) ((o)->Type->Free)((o))
#define SoundFree(o) ((o)->Type->Free)((o))
/// Save (NULL) free a sample object.
#define SoundSaveFree(o) \
do { if( (o) ) ((o)->Type->Free)((o)); } while( 0 )
/**
** Sound double group: a sound that groups two sounds, used to implement
** the annoyed/selected sound system of WC
** Sound double group: a sound that groups two sounds, used to implement
** the annoyed/selected sound system of WC
*/
typedef struct _two_groups_ {
struct _sound_ *First; /// first group: selected sound
struct _sound_ *Second; /// second group: annoyed sound
struct _sound_ *First; ///< first group: selected sound
struct _sound_ *Second; ///< second group: annoyed sound
} TwoGroups;
/**
** A possible value for Number in the Sound struct: means a simple sound
*/
** A possible value for Number in the Sound struct: means a simple sound
*/
#define ONE_SOUND 0
/**
** A possible value for Number in the Sound struct: means a double group (for
** selection/annoyed sounds)
*/
** A possible value for Number in the Sound struct: means a double group (for
** selection/annoyed sounds)
*/
#define TWO_GROUPS 1
/**
** the range value that makes a sound volume distance independent
*/
** the range value that makes a sound volume distance independent
*/
#define INFINITE_SOUND_RANGE 255
/**
** the maximum range value
*/
** the maximum range value
*/
#define MAX_SOUND_RANGE 254
/**
** Sound definition.
** Sound definition.
*/
typedef struct _sound_ {
/**
** Range is a multiplier for ::DistanceSilent.
** 255 means infinite range of the sound.
** Range is a multiplier for ::DistanceSilent.
** 255 means infinite range of the sound.
*/
unsigned char Range; /// Range is a multiplier for DistanceSilent
unsigned char Number; /// single, group, or table of sounds.
unsigned char Range; ///< Range is a multiplier for DistanceSilent
unsigned char Number; ///< single, group, or table of sounds.
union {
Sample* OneSound; /// if it's only a simple sound
Sample** OneGroup; /// when it's a simple group
TwoGroups* TwoGroups; /// when it's a double group
Sample* OneSound; ///< if it's only a simple sound
Sample** OneGroup; ///< when it's a simple group
TwoGroups* TwoGroups; ///< when it's a double group
} Sound;
} Sound;
/**
** Sound unique identifier
** Sound unique identifier
*/
typedef Sound* ServerSoundId;
/**
** Origin of a sound
** Origin of a sound
*/
typedef struct _origin_ {
const void* Base; /// pointer on a Unit
unsigned Id; /// unique identifier (if the pointer has been shared)
const void* Base; ///< pointer on a Unit
unsigned Id; ///< unique identifier (if the pointer has been shared)
} Origin;
/**
** sound request FIFO
** sound request FIFO
*/
typedef struct _sound_request {
Origin Source; /// origin of sound
unsigned short Power; /// Volume or Distance
SoundId Sound; /// which sound
unsigned Used : 1; /// flag for used/unused
unsigned Fight : 1; /// is it a fight sound?
unsigned Selection : 1; /// is it a selection sound?
unsigned IsVolume : 1; /// how to interpret power (as a
///volume or as a distance?)
char Stereo; /// stereo location of sound (
///-128 left, 0 center, 127 right)
Origin Source; ///< origin of sound
unsigned short Power; ///< Volume or Distance
SoundId Sound; ///< which sound
unsigned Used : 1; ///< flag for used/unused
unsigned Fight : 1; ///< is it a fight sound?
unsigned Selection : 1; ///< is it a selection sound?
unsigned IsVolume : 1; ///< how to interpret power (as a
///<volume or as a distance?)
char Stereo; ///< stereo location of sound (
///<-128 left, 0 center, 127 right)
} SoundRequest;
#define MAX_SOUND_REQUESTS 32 /// maximal number of sound requests
#define MAX_SOUND_REQUESTS 32 ///< maximal number of sound requests
#define MaxChannels 16 /// How many channels are supported
#define MaxChannels 16 ///< How many channels are supported
/// Channels for sound effects and unit speach
typedef struct _sound_channel_
{
unsigned char Command; /// channel command
int Point; /// point into sample
Sample* Sample; /// sample to play
Origin Source; /// unit playing
unsigned char Volume; /// Volume of this channel
SoundId Sound; /// The sound currently played
/// stereo location of sound (-128 left, 0 center, 127 right)
signed char Stereo;
unsigned char Command; ///< channel command
int Point; ///< point into sample
Sample* Sample; ///< sample to play
Origin Source; ///< unit playing
unsigned char Volume; ///< Volume of this channel
SoundId Sound; ///< The sound currently played
signed char Stereo; ///< stereo location of sound (-128 left, 0 center, 127 right)
} SoundChannel;
/**
** Play audio flags.
*/
enum _play_audio_flags_ {
PlayAudioStream = 1, /// Stream the file from medium
PlayAudioPreLoad = 2, /// Load compressed in memory
PlayAudioLoadInMemory = 4, /// Preload file into memory
PlayAudioLoadOnDemand = 8, /// Load only if needed.
PlayAudioStream = 1, ///< Stream the file from medium
PlayAudioPreLoad = 2, ///< Load compressed in memory
PlayAudioLoadInMemory = 4, ///< Preload file into memory
PlayAudioLoadOnDemand = 8, ///< Load only if needed.
};
/*----------------------------------------------------------------------------
@ -230,8 +229,8 @@ extern int NextSoundRequestIn;
/// FIFO index out
extern int NextSoundRequestOut;
#define ChannelFree 0 /// channel is free
#define ChannelPlay 3 /// channel is playing
#define ChannelFree 0 ///< channel is free
#define ChannelPlay 3 ///< channel is playing
/// All possible sound channels
extern SoundChannel Channels[MaxChannels];
@ -243,7 +242,7 @@ extern int NextFreeChannel;
extern int WithSoundThread;
#endif
/// FIXME: docu
/// @fixme docu
extern int SoundThreadRunning;
#ifdef DEBUG
@ -251,29 +250,30 @@ extern int SoundThreadRunning;
extern unsigned AllocatedSoundMemory;
#endif
extern Sample* MusicSample; /// Music samples
extern Sample* MusicSample; ///< Music samples
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
extern Sample* LoadFlac(const char* name,int flags); /// Load a flac file
extern Sample* LoadWav(const char* name,int flags); /// Load a wav file
extern Sample* LoadOgg(const char* name,int flags); /// Load an ogg file
extern Sample* LoadMp3(const char* name,int flags); /// Load a mp3 file
extern Sample* LoadFlac(const char* name,int flags); ///< Load a flac file
extern Sample* LoadWav(const char* name,int flags); ///< Load a wav file
extern Sample* LoadOgg(const char* name,int flags); ///< Load an ogg file
extern Sample* LoadMp3(const char* name,int flags); ///< Load a mp3 file
extern int ConvertToStereo32(const char* in, char* out, int frequency,
int bitrate, int channels, int bytes);
/// Register a sound (can be a simple sound or a group)
/// Register a sound (can be a simple sound or a group)
extern SoundId RegisterSound(const char* file[],unsigned number);
/**
** Ask the sound server to put together two sounds to form a special sound.
** @param first first part of the group
** @param second second part of the group
** @return the special sound unique identifier
** @brief Create a special sound group with two sounds
**
** Ask the sound server to put together two sounds to form a special sound.
** @param first first part of the group
** @param second second part of the group
** @return the special sound unique identifier
*/
extern SoundId RegisterTwoGroups(const SoundId first,const SoundId second);
@ -304,30 +304,30 @@ extern int InitSoundServer(void);
extern void PlayListAdvance(void);
/** Ask the sound layer to write the content of its buffer to the sound
device. To be used only in the unthreaded version.
*/
** device. To be used only in the unthreaded version.
*/
extern void WriteSound(void);
/// Cleanup sound.
/// Cleanup sound.
extern void QuitSound(void);
#else // }{ WITH_SOUND
#else // }{ WITH_SOUND
/*----------------------------------------------------------------------------
-- Definitons
-- Definitons
----------------------------------------------------------------------------*/
#define SoundFildes -1 /// Dummy macro for without sound
#define SoundThreadRunning 0 /// Dummy macro for without sound
#define SoundFildes -1 ///< Dummy macro for without sound
#define SoundThreadRunning 0 ///< Dummy macro for without sound
#define InitSound() 0 /// Dummy macro for without sound
#define WriteSound NULL /// Dummy macro for without sound
#define QuitSound() /// Dummy macro for without sound
#define PlayListAdvance() /// Dummy macro for without sound
#endif // } WITH_SOUND
#define InitSound() 0 ///< Dummy macro for without sound
#define WriteSound NULL ///< Dummy macro for without sound
#define QuitSound() ///< Dummy macro for without sound
#define PlayListAdvance() ///< Dummy macro for without sound
#endif // } WITH_SOUND
extern int WaitForSoundDevice; /// Block until sound device available
extern int WaitForSoundDevice; ///< Block until sound device available
//@}
#endif // !__SOUND_SERVER_H__
#endif // !__SOUND_SERVER_H__

View file

@ -48,117 +48,116 @@
#include "script.h"
/*----------------------------------------------------------------------------
-- Definitons
-- Definitons
----------------------------------------------------------------------------*/
/**
** Different targets.
** Different targets.
*/
typedef enum {
TargetSelf,
TargetPosition,
TargetUnit
} TargetType;
} TargetType;
typedef struct _spell_action_type_ SpellActionType;
/*
** Pointer on function that cast the spell.
** Pointer on function that cast the spell.
*/
typedef int SpellFunc(Unit* caster, const struct _spell_type_* spell,
const struct _spell_action_type_* action, Unit* target, int x, int y);
/**
** Different targets.
** Different targets.
*/
typedef enum {
LocBaseCaster,
LocBaseTarget
} LocBaseType;
} LocBaseType;
/*
** This struct is used for defining a missile start/stop location.
** This struct is used for defining a missile start/stop location.
**
** It's evaluated like this, and should be more or less flexible.:
** base coordinates(caster or target) + (AddX,AddY) + (rand()%AddRandX,rand()%AddRandY)
** It's evaluated like this, and should be more or less flexible.:
** base coordinates(caster or target) + (AddX,AddY) + (rand()%AddRandX,rand()%AddRandY)
**
**/
typedef struct {
LocBaseType Base; /// The base for the location (caster/target)
int AddX; /// Add to the X coordinate
int AddY; /// Add to the X coordinate
int AddRandX; /// Random add to the X coordinate
int AddRandY; /// Random add to the X coordinate
LocBaseType Base; ///< The base for the location (caster/target)
int AddX; ///< Add to the X coordinate
int AddY; ///< Add to the X coordinate
int AddRandX; ///< Random add to the X coordinate
int AddRandY; ///< Random add to the X coordinate
} SpellActionMissileLocation;
struct _spell_action_type_ {
SpellFunc* CastFunction;
// FIXME" some time information doesn't work as it should.
/// @fixme some time information doesn't work as it should.
union {
struct {
int HP; /// Target HP gain.(can be negative)
int Mana; /// Target Mana gain.(can be negative)
int HP; ///< Target HP gain.(can be negative)
int Mana; ///< Target Mana gain.(can be negative)
} AreaAdjustVitals;
struct {
int Damage; /// Missile damage.
int TTL; /// Missile TTL.
int Delay; /// Missile original delay.
SpellActionMissileLocation StartPoint; /// Start point description.
SpellActionMissileLocation EndPoint; /// Start point description.
MissileType *Missile; /// Missile fired on cast
int Damage; ///< Missile damage.
int TTL; ///< Missile TTL.
int Delay; ///< Missile original delay.
SpellActionMissileLocation StartPoint; ///< Start point description.
SpellActionMissileLocation EndPoint; ///< Start point description.
MissileType* Missile; ///< Missile fired on cast
} SpawnMissile;
struct {
int Damage; /// Damage for every unit in range.
int Range; /// Range of the explosion.
int Damage; ///< Damage for every unit in range.
int Range; ///< Range of the explosion.
} Demolish;
struct {
int Fields; /// The size of the affected square.
int Shards; /// Number of shards thrown.
int Damage; /// Damage for every shard.
/// The offset of the missile start point to the hit location.
int StartOffsetX;
int StartOffsetY;
MissileType *Missile; /// Missile fired on cast
int Fields; ///< The size of the affected square.
int Shards; ///< Number of shards thrown.
int Damage; ///< Damage for every shard.
int StartOffsetX; ///< The offset of the missile start point to the hit location.
int StartOffsetY; ///< The offset of the missile start point to the hit location.
MissileType* Missile; ///< Missile fired on cast
} AreaBombardment;
struct {
UnitType *PortalType; /// The unit type spawned
UnitType* PortalType; ///< The unit type spawned
} SpawnPortal;
struct {
int HasteTicks; /// Number of ticks to set Haste to.
int SlowTicks; /// Number of ticks to set Slow to.
int BloodlustTicks; /// Number of ticks to set Bloodlust to.
int InvisibilityTicks; /// Number of ticks to set Invisibility to.
int InvincibilityTicks; /// Number of ticks to set UnholyArmor to.
#define BUFF_NOT_AFFECTED 0xC0FF33 /// Don't like the value? The value doesn't like you!
int HasteTicks; ///< Number of ticks to set Haste to.
int SlowTicks; ///< Number of ticks to set Slow to.
int BloodlustTicks; ///< Number of ticks to set Bloodlust to.
int InvisibilityTicks; ///< Number of ticks to set Invisibility to.
int InvincibilityTicks; ///< Number of ticks to set UnholyArmor to.
#define BUFF_NOT_AFFECTED 0xC0FF33 ///< Don't like the value? The value doesn't like you!
} AdjustBuffs;
struct {
int HP; /// Target HP gain.(can be negative)
int Mana; /// Target Mana gain.(can be negative)
int HP; ///< Target HP gain.(can be negative)
int Mana; ///< Target Mana gain.(can be negative)
/// This spell is designed to be used wit very small amounts. The spell
/// can scale up to MaxMultiCast times. Use 0 for infinite.
int MaxMultiCast;
} AdjustVitals;
struct {
UnitType *NewForm; /// The new form
int PlayerNeutral; /// Convert the unit to the neutral player.
// TODO: temporary polymorphs would be awesome, but hard to implement
UnitType* NewForm; ///< The new form
int PlayerNeutral; ///< Convert the unit to the neutral player.
/// @todo temporary polymorphs would be awesome, but hard to implement
} Polymorph;
struct {
UnitType *UnitType; /// Type of unit to be summoned.
int TTL; /// Time to live for summoned unit. 0 means infinite
int RequireCorpse; /// Corpse consumed while summoning.
UnitType* UnitType; ///< Type of unit to be summoned.
int TTL; ///< Time to live for summoned unit. 0 means infinite
int RequireCorpse; ///< Corpse consumed while summoning.
} Summon;
// What about a resurection spell?
} Data;
SpellActionType* Next; /// Next action.
SpellActionType* Next; ///< Next action.
};
/*
@ -168,10 +167,10 @@ struct _spell_action_type_ {
*/
typedef struct {
TargetType which_sort_of_target; /// for identify what sort of target.
int X; /// x coord.
int Y; /// y coord.
Unit *unit; /// Unit target.
TargetType which_sort_of_target; ///< for identify what sort of target.
int X; ///< x coord.
int Y; ///< y coord.
Unit* unit; ///< Unit target.
} Target;
/*
@ -181,100 +180,100 @@ typedef struct {
*/
/**
** Conditions for a spell.
** Conditions for a spell.
**
** @todo Move more parameters into this structure.
** @todo Move more parameters into this structure.
*/
typedef struct ConditionInfo {
//
// Conditions that check specific flags. Possible values are the defines below.
// Conditions that check specific flags. Possible values are the defines below.
//
#define CONDITION_FALSE 1
#define CONDITION_TRUE 0
#define CONDITION_ONLY 2
char Coward; /// Target is coward. Don't bloodlust them.
char Alliance; /// Target is allied.
char Building; /// Target is a building.
char TargetSelf; /// Target is the same as the caster.
char *BoolFlag; /// User defined boolean flag.
/// FIXME: NOT IMPLEMENTED:
char UnitBuffed; /// Target is buffed(haste/slow/bloodlust). Dispel magic?
char Coward; ///< Target is coward. Don't bloodlust them.
char Alliance; ///< Target is allied.
char Building; ///< Target is a building.
char TargetSelf; ///< Target is the same as the caster.
char *BoolFlag; ///< User defined boolean flag.
/// @fixme NOT IMPLEMENTED:
char UnitBuffed; ///< Target is buffed(haste/slow/bloodlust). Dispel magic?
//
// Conditions related to vitals:
// Conditions related to vitals:
//
int MinHpPercent; /// Target must have more hp than that.
int MaxHpPercent; /// Target must have less hp than that. Used for heal-like spells.
int MinManaPercent; /// Target must have more mana than that. Mana drain spells?
int MaxManaPercent; /// Target must have less mana than that. Mana fountains?
int MinHpPercent; ///< Target must have more hp than that.
int MaxHpPercent; ///< Target must have less hp than that. Used for heal-like spells.
int MinManaPercent; ///< Target must have more mana than that. Mana drain spells?
int MaxManaPercent; ///< Target must have less mana than that. Mana fountains?
//
// Conditions related to buffs:
// Conditions related to buffs:
//
int MaxHasteTicks; /// Target must less haste ticks left.
int MaxSlowTicks; /// Target must less slow ticks left.
int MaxBloodlustTicks; /// Target must less bloodlust ticks left.
int MaxInvisibilityTicks; /// Target must less bloodlust ticks left.
int MaxInvincibilityTicks; /// Target must less bloodlust ticks left.
int MaxHasteTicks; ///< Target must less haste ticks left.
int MaxSlowTicks; ///< Target must less slow ticks left.
int MaxBloodlustTicks; ///< Target must less bloodlust ticks left.
int MaxInvisibilityTicks; ///< Target must less bloodlust ticks left.
int MaxInvincibilityTicks; ///< Target must less bloodlust ticks left.
//
// FIXME: more? feel free to add, here and to
// FIXME: PassCondition, CclSpellParseCondition, SaveSpells
// @fixme more? feel free to add, here and to
// @fixme PassCondition, CclSpellParseCondition, SaveSpells
//
} ConditionInfo;
/**
** Informations about the autocasting mode.
** Informations about the autocasting mode.
*/
typedef struct {
/// FIXME: this below is SQUARE!!!
int Range; /// Max range of the target.
/// @fixme this below is SQUARE!!!
int Range; ///< Max range of the target.
ConditionInfo *Condition; /// Conditions to cast the spell.
ConditionInfo* Condition; ///< Conditions to cast the spell.
/// Detalied generic conditions (not per-target, where Condition is evaluated.)
/// Combat mode is when there are hostile non-coward units around
int Combat; /// If it should be casted in combat
int Combat; ///< If it should be casted in combat
/// FIXME: Add stuff here for target preference.
/// FIXME: Heal units with the lowest hit points first.
/// @fixme Add stuff here for target preference.
/// @fixme Heal units with the lowest hit points first.
} AutoCastInfo;
struct _spell_type_;
/**
** Base structure of a spell type.
** Base structure of a spell type.
*/
typedef struct _spell_type_ {
// Identification stuff
char *Ident; /// Spell unique identifier (spell-holy-vision)
char *Name; /// Spell name shown by the engine
int Slot; /// Spell numeric identifier
char* Ident; ///< Spell unique identifier (spell-holy-vision)
char* Name; ///< Spell name shown by the engine
int Slot; ///< Spell numeric identifier
// Spell Specifications
TargetType Target; /// Targetting information. See TargetType.
SpellActionType *Action; /// More arguments for spell (damage, delay, additional sounds...).
TargetType Target; ///< Targetting information. See TargetType.
SpellActionType *Action; ///< More arguments for spell (damage, delay, additional sounds...).
int Range; /// Max range of the target.
int Range; ///< Max range of the target.
#define INFINITE_RANGE 0xFFFFFFF
int ManaCost; /// Required mana for each cast.
int RepeatCast; /// If the spell will be cast again until out of targets.
int ManaCost; ///< Required mana for each cast.
int RepeatCast; ///< If the spell will be cast again until out of targets.
int DependencyId; /// Id of upgrade, -1 if no upgrade needed for cast the spell.
ConditionInfo *Condition; /// Conditions to cast the spell. (generic (no test for each target))
int DependencyId; ///< Id of upgrade, -1 if no upgrade needed for cast the spell.
ConditionInfo *Condition; ///< Conditions to cast the spell. (generic (no test for each target))
// Autocast informations. No AICast means the AI use AutoCast.
AutoCastInfo *AutoCast; /// AutoCast information for your own units
AutoCastInfo *AICast; /// AutoCast information for ai. More detalied.
AutoCastInfo* AutoCast; ///< AutoCast information for your own units
AutoCastInfo* AICast; ///< AutoCast information for ai. More detalied.
// Graphics and sounds. Add something else here?
SoundConfig SoundWhenCast; /// Sound played if cast
// Graphics and sounds. Add something else here?
SoundConfig SoundWhenCast; ///< Sound played if cast
} SpellType;
/*----------------------------------------------------------------------------
-- Variables
-- Variables
----------------------------------------------------------------------------*/
/**
** Define the names and effects of all available spells.
** Define the names and effects of all available spells.
*/
extern SpellType **SpellTypeTable;
@ -283,10 +282,10 @@ extern int SpellTypeCount;
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
/// register fonction.
/// register fonction.
extern void SpellCclRegister(void);
/// init spell tables
@ -300,11 +299,11 @@ extern int SpellIsAvailable(const Player* player, int SpellId);
/// returns != 0 if spell can be casted (enough mana, valid target)
extern int CanCastSpell(const Unit* caster, const SpellType*,
const Unit* target, int x, int y);
const Unit* target, int x, int y);
/// cast spell on target unit or place at x,y
extern int SpellCast(Unit* caster, const SpellType*,
Unit* target, int x, int y);
Unit* target, int x, int y);
/// auto cast the spell if possible
extern int AutoCastSpell(Unit* caster, const SpellType* spell);
@ -323,7 +322,7 @@ extern SpellType* SpellTypeById(int Id);
extern unsigned CclGetSpellByIdent(lua_State* l);
// return 0, 1, 2 for true, only, false.
/// return 0, 1, 2 for true, only, false.
extern char Ccl2Condition(lua_State* l, const char* value);
/*
@ -343,4 +342,4 @@ SpellFunc CastSpawnMissile;
//@}
#endif // !__SPELLS_H__
#endif // !__SPELLS_H__

View file

@ -66,7 +66,7 @@
#endif // } __GNUC__
#ifndef __GNUC__ // { disable GNU C Compiler features
#define __attribute__(args) /// Does nothing for non GNU CC
#define __attribute__(args) ///< Does nothing for non GNU CC
#endif // }
#ifdef _MSC_VER
@ -77,8 +77,8 @@
#define inline __inline
#define alloca _alloca
#pragma warning(disable:4244) /// Conversion from double to uchar
#pragma warning(disable:4761) /// Integral size mismatch
#pragma warning(disable:4244) ///< Conversion from double to uchar
#pragma warning(disable:4761) ///< Integral size mismatch
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#include <string.h>
@ -118,7 +118,7 @@ typedef struct _missile_type_ MissileType;
** DebugLevel0("Test %d\n" _C_ 1);
** DebugLevel0("Test %d %d\n" _C_ 1 _C_ 2);
*/
#define _C_ , /// Debug , to simulate vararg macros
#define _C_ , ///< Debug , to simulate vararg macros
/// Print function in debug macros
#define PrintFunction() \
@ -216,10 +216,10 @@ typedef struct _missile_type_ MissileType;
== Storage types
============================================================================*/
#define global /// Defines global visible names
#define global ///< Defines global visible names
#ifdef DEBUG
#define local /// Defines local visible names
#define local ///< Defines local visible names
#else
#define local static
#endif
@ -233,7 +233,7 @@ typedef struct _missile_type_ MissileType;
----------------------------------------------------------------------------*/
#ifndef VERSION
#define VERSION "2.00" /// Engine version shown
#define VERSION "2.00" ///< Engine version shown
#endif
#ifndef StratagusMajorVerion
@ -258,28 +258,28 @@ typedef struct _missile_type_ MissileType;
extern char NameLine[];
#ifndef STRATAGUS_LIB_PATH
#define STRATAGUS_LIB_PATH "data" /// Where to find the data files
#define STRATAGUS_LIB_PATH "data" ///< Where to find the data files
#endif
#ifndef STRATAGUS_HOME_PATH
#ifdef __APPLE__
#define STRATAGUS_HOME_PATH "Library/Stratagus"
#else
#define STRATAGUS_HOME_PATH ".stratagus"/// Data files in user home dir
#define STRATAGUS_HOME_PATH ".stratagus"///< Data files in user home dir
#endif
#endif
#define MAGIC_FOR_NEW_UNITS 33 /// How many percent of max mana for new units
#define MAGIC_FOR_NEW_UNITS 33 ///< How many percent of max mana for new units
/*----------------------------------------------------------------------------
-- Some limits
----------------------------------------------------------------------------*/
#define TilesetMax 8 /// How many tilesets are supported
#define PlayerMax 16 /// How many players are supported
#define UnitTypeMax 257 /// How many unit types supported
#define UpgradeMax 256 /// How many upgrades supported
#define UnitMax 2048 /// How many units supported
#define TilesetMax 8 ///< How many tilesets are supported
#define PlayerMax 16 ///< How many players are supported
#define UnitTypeMax 257 ///< How many unit types supported
#define UpgradeMax 256 ///< How many upgrades supported
#define UnitMax 2048 ///< How many units supported
/*----------------------------------------------------------------------------
-- Screen
@ -287,12 +287,12 @@ extern char NameLine[];
// FIXME: this values should go into a general ui structure
#define DEFAULT_VIDEO_WIDTH 640 /// Default video width
#define DEFAULT_VIDEO_HEIGHT 480 /// Default video height
#define DEFAULT_VIDEO_WIDTH 640 ///< Default video width
#define DEFAULT_VIDEO_HEIGHT 480 ///< Default video height
// This is for 1600x1200
#define MAXMAP_W 50 /// Maximum map width in tiles on screen
#define MAXMAP_H 40 /// Maximum map height in tiles
#define MAXMAP_W 50 ///< Maximum map width in tiles on screen
#define MAXMAP_H 40 ///< Maximum map height in tiles
/// Scrolling area (<= 15 y)
#define SCROLL_UP 15
@ -316,29 +316,29 @@ extern char NameLine[];
/// Must redraw flags
enum _must_redraw_flags_ {
RedrawNothing = 1 << 0, /// Nothing to do
RedrawMinimap = 1 << 1, /// Minimap area
RedrawMap = 1 << 2, /// Map area
RedrawCursor = 1 << 3, /// Cursor changed
RedrawResources = 1 << 4, /// Resources
RedrawNothing = 1 << 0, ///< Nothing to do
RedrawMinimap = 1 << 1, ///< Minimap area
RedrawMap = 1 << 2, ///< Map area
RedrawCursor = 1 << 3, ///< Cursor changed
RedrawResources = 1 << 4, ///< Resources
RedrawMessage = 1 << 13, /// Message
RedrawStatusLine = 1 << 14, /// Statusline
RedrawInfoPanel = 1 << 15, /// Unit description
RedrawButtonPanel = 1 << 16, /// Unit buttons
RedrawFillers = 1 << 17, /// Fillers
RedrawMinimapBorder = 1 << 18, /// Area around minimap
RedrawMessage = 1 << 13, ///< Message
RedrawStatusLine = 1 << 14, ///< Statusline
RedrawInfoPanel = 1 << 15, ///< Unit description
RedrawButtonPanel = 1 << 16, ///< Unit buttons
RedrawFillers = 1 << 17, ///< Fillers
RedrawMinimapBorder = 1 << 18, ///< Area around minimap
RedrawCosts = 1 << 19, /// Costs in status line
RedrawMenuButton = 1 << 20, /// Area above minimap
RedrawMinimapCursor = 1 << 21, /// Minimap cursor changed
RedrawMenu = 1 << 22, /// Menu
RedrawTimer = 1 << 23, /// Timer
RedrawCosts = 1 << 19, ///< Costs in status line
RedrawMenuButton = 1 << 20, ///< Area above minimap
RedrawMinimapCursor = 1 << 21, ///< Minimap cursor changed
RedrawMenu = 1 << 22, ///< Menu
RedrawTimer = 1 << 23, ///< Timer
// Bits 24-29 are unused.
RedrawAll = 1 << 30, /// All flag set by RedrawEverything
RedrawEverything = -1, /// Must redraw everything
RedrawAll = 1 << 30, ///< All flag set by RedrawEverything
RedrawEverything = -1, ///< Must redraw everything
};
/// Must redraw all maps
@ -379,7 +379,7 @@ extern int SlowFrameCounter;
#define MyRand() rand()
enum {
TitleFlagCenter = 1 << 0, /// Center Text
TitleFlagCenter = 1 << 0, ///< Center Text
};
typedef struct _title_screen_label_ {
@ -397,44 +397,44 @@ typedef struct _title_screen_ {
TitleScreenLabel** Labels;
} TitleScreen;
extern TitleScreen** TitleScreens; /// File for title screen
extern char* GameName; /// Name of the game
extern char* MenuBackground; /// File for menu background
extern char* MenuMusic; /// File for menu music
extern char* ClickMissile; /// Missile to show when you click
extern char* DamageMissile; /// Missile to show damage caused
extern char* StratagusLibPath; /// Location of stratagus data
extern TitleScreen** TitleScreens; ///< File for title screen
extern char* GameName; ///< Name of the game
extern char* MenuBackground; ///< File for menu background
extern char* MenuMusic; ///< File for menu music
extern char* ClickMissile; ///< Missile to show when you click
extern char* DamageMissile; ///< Missile to show damage caused
extern char* StratagusLibPath; ///< Location of stratagus data
extern int SpeedBuild; /// Speed factor for building
extern int SpeedTrain; /// Speed factor for training
extern int SpeedUpgrade; /// Speed factor for upgrading
extern int SpeedResearch; /// Speed factor for researching
extern int SpeedBuild; ///< Speed factor for building
extern int SpeedTrain; ///< Speed factor for training
extern int SpeedUpgrade; ///< Speed factor for upgrading
extern int SpeedResearch; ///< Speed factor for researching
extern char UseHPForXp; /// true if gain XP by dealing damage, false if by killing.
extern char UseHPForXp; ///< true if gain XP by dealing damage, false if by killing.
extern unsigned SyncRandSeed; /// Sync random seed value
extern unsigned SyncRandSeed; ///< Sync random seed value
extern unsigned long GameCycle; /// Game simulation cycle counter
extern unsigned long FastForwardCycle; /// Game Replay Fast Forward Counter
extern unsigned long GameCycle; ///< Game simulation cycle counter
extern unsigned long FastForwardCycle; ///< Game Replay Fast Forward Counter
extern void LoadGame(char*); /// Load saved game back
extern void SaveGame(const char*); /// Save game for later load
extern int SaveGameLoading; /// Save game is in progress of loading
extern void LoadGame(char*); ///< Load saved game back
extern void SaveGame(const char*); ///< Save game for later load
extern int SaveGameLoading; ///< Save game is in progress of loading
extern void LoadAll(void); /// Load all data back
extern void LoadAll(void); ///< Load all data back
extern void InitSyncRand(void); /// Initialize the syncron rand
extern int SyncRand(void); /// Syncron rand
extern void InitSyncRand(void); ///< Initialize the syncron rand
extern int SyncRand(void); ///< Syncron rand
extern volatile void Exit(int err); /// Exit stratagus
extern volatile void ExitFatal(int err); /// Exit stratagus with fatal error
extern volatile void Exit(int err); ///< Exit stratagus
extern volatile void ExitFatal(int err); ///< Exit stratagus with fatal error
extern void UpdateDisplay(void); /// Game display update
extern void InitModules(void); /// Initinalize all modules
extern void LoadModules(void); /// Load all modules
extern void CleanModules(void); /// Cleanup all modules
extern void DrawMapArea(void); /// Draw the map area
extern void GameMainLoop(void); /// Game main loop
extern void UpdateDisplay(void); ///< Game display update
extern void InitModules(void); ///< Initinalize all modules
extern void LoadModules(void); ///< Load all modules
extern void CleanModules(void); ///< Cleanup all modules
extern void DrawMapArea(void); ///< Draw the map area
extern void GameMainLoop(void); ///< Game main loop
/// Show load progress
extern void ShowLoadProgress(const char* fmt,...);
@ -456,8 +456,8 @@ extern long isqrt(long num);
== Misc
============================================================================*/
// FIXME: configurable. maybe we could move it into one big global
// FIXME: settings struct?
// @fixme configurable. maybe we could move it into one big global
// @fixme settings struct?
/// How many resources the player gets back if canceling building
#define CancelBuildingCostsFactor 75
/// How many resources the player gets back if canceling training

View file

@ -34,325 +34,322 @@
//@{
/*----------------------------------------------------------------------------
-- Includes
-- Includes
----------------------------------------------------------------------------*/
#include "etlib/hash.h"
#include "iolib.h"
/*----------------------------------------------------------------------------
-- Documentation
-- Documentation
----------------------------------------------------------------------------*/
/**
** @struct _tileset_ tileset.h
** @struct _tileset_ tileset.h
**
** \#include "tileset.h"
** \#include "tileset.h"
**
** typedef struct _tileset_ Tileset;
** typedef struct _tileset_ Tileset;
**
** This structure contains all informations about the tileset of the map.
** It defines the look and properties of the tiles. Currently only one
** tileset pro map is supported. In the future it is planned to support
** multiple tilesets on the same map. Also is planned to support animated
** tiles.
** Currently the tilesize is fixed to 32x32 pixels, to support later other
** sizes please use always the constants ::TileSizeX and ::TileSizeY.
** This structure contains all informations about the tileset of the map.
** It defines the look and properties of the tiles. Currently only one
** tileset pro map is supported. In the future it is planned to support
** multiple tilesets on the same map. Also is planned to support animated
** tiles.
** Currently the tilesize is fixed to 32x32 pixels, to support later other
** sizes please use always the constants ::TileSizeX and ::TileSizeY.
**
** The tileset structure members:
** The tileset structure members:
**
** Tileset::Ident
** Tileset::Ident
**
** Unique identifier (FE.: tileset-summer, tileset-winter) for the
** tileset. Used by the map to define which tileset should be used.
** Like always the identifier should only be used during
** configuration and not during runtime!
** @see WorldMap, WorldMap::TerrainName.
** Unique identifier (FE.: tileset-summer, tileset-winter) for the
** tileset. Used by the map to define which tileset should be used.
** Like always the identifier should only be used during
** configuration and not during runtime!
** @see WorldMap, WorldMap::TerrainName.
**
** Tileset::Class
** Tileset::Class
**
** Identifier for the tileset class. All exchangable tilesets
** should have the same class. Can be used by the level editor.
** Identifier for the tileset class. All exchangable tilesets
** should have the same class. Can be used by the level editor.
**
** Tileset::Name
** Tileset::Name
**
** Long name of the tileset. Can be used by the level editor.
** Long name of the tileset. Can be used by the level editor.
**
** Tileset::File
** Tileset::File
**
** Name of the graphic file, containing all tiles. Following
** widths are supported:
** @li 512 pixel: 16 tiles pro row
** @li 527 pixel: 16 tiles pro row with 1 pixel gap
** @li 626 pixel: 19 tiles pro row with 1 pixel gap
** Name of the graphic file, containing all tiles. Following
** widths are supported:
** @li 512 pixel: 16 tiles pro row
** @li 527 pixel: 16 tiles pro row with 1 pixel gap
** @li 626 pixel: 19 tiles pro row with 1 pixel gap
**
** Tileset::NumTiles
** Tileset::NumTiles
**
** The number of different tiles in the tables.
** The number of different tiles in the tables.
**
** Tileset::Table
** Tileset::Table
**
** Table to map the abstract level (PUD) tile numbers, to tile
** numbers in the graphic file (Tileset::File).
** FE. 16 (solid light water) in pud to 328 in png.
** Table to map the abstract level (PUD) tile numbers, to tile
** numbers in the graphic file (Tileset::File).
** FE. 16 (solid light water) in pud to 328 in png.
**
** Tileset::FlagsTable
** Tileset::FlagsTable
**
** Table of the tile flags used by the editor.
** @see MapField::Flags
** Table of the tile flags used by the editor.
** @see MapField::Flags
**
** Tileset::BasicNameTable
** Tileset::BasicNameTable
**
** Index to name of the basic tile type. FE. "light-water".
** If the index is 0, the tile is not used.
** @see Tileset::TileNames
** Index to name of the basic tile type. FE. "light-water".
** If the index is 0, the tile is not used.
** @see Tileset::TileNames
**
** Tileset::MixedNameTable
** Tileset::MixedNameTable
**
** Index to name of the mixed tile type. FE. "light-water".
** If this index is 0, the tile is a solid tile.
** @see Tileset::TileNames
** Index to name of the mixed tile type. FE. "light-water".
** If this index is 0, the tile is a solid tile.
** @see Tileset::TileNames
**
** Tileset::TileTypeTable
** Tileset::TileTypeTable
**
** Lookup table of the tile type. Maps the graphic file tile
** number back to a tile type (::TileTypeWood, ::TileTypeWater,
** ...)
** Lookup table of the tile type. Maps the graphic file tile
** number back to a tile type (::TileTypeWood, ::TileTypeWater,
** ...)
**
** @note The creation of this table is currently hardcoded in
** the engine. It should be calculated from the flags in the
** tileset configuration (CCL). And it is created for the map
** and not for the tileset.
** @note The creation of this table is currently hardcoded in
** the engine. It should be calculated from the flags in the
** tileset configuration (CCL). And it is created for the map
** and not for the tileset.
**
** @note I'm not sure if this table is needed in the future.
** @note I'm not sure if this table is needed in the future.
**
** @see TileType.
** @see TileType.
**
** Tileset::AnimationTable
** Tileset::AnimationTable
**
** Contains the animation of tiles.
** Contains the animation of tiles.
**
** @note This is currently not used.
** @note This is currently not used.
**
** Tileset::NumNames
** Tileset::NumNames
**
** Number of different tile names.
** Number of different tile names.
**
** Tileset::TileNames
** Tileset::TileNames
**
** The different tile names. FE "light-grass", "dark-water".
** The different tile names. FE "light-grass", "dark-water".
**
** Tileset::TopOneTree
** Tileset::TopOneTree
**
** The tile number of tile only containing the top part of a tree.
** Is created on the map by lumber chopping.
** The tile number of tile only containing the top part of a tree.
** Is created on the map by lumber chopping.
**
** Tileset::MidOneTree
** Tileset::MidOneTree
**
** The tile number of tile only containing the connection of
** the top part to the bottom part of tree.
** Is created on the map by lumber chopping.
** The tile number of tile only containing the connection of
** the top part to the bottom part of tree.
** Is created on the map by lumber chopping.
**
** Tileset::BotOneTree
** Tileset::BotOneTree
**
** The tile number of tile only containing the bottom part of a
** tree. Is created on the map by lumber chopping.
** The tile number of tile only containing the bottom part of a
** tree. Is created on the map by lumber chopping.
**
** Tileset::RemovedTree
** Tileset::RemovedTree
**
** The tile number of the tile placed where trees are removed.
** Is created on the map by lumber chopping.
** The tile number of the tile placed where trees are removed.
** Is created on the map by lumber chopping.
**
** Tileset::GrowingTree[2]
** Tileset::GrowingTree[2]
**
** Contains the tile numbers of a growing tree from small to big.
** @note Not yet used.
** Contains the tile numbers of a growing tree from small to big.
** @note Not yet used.
**
** Tilset::WoodTable[20]
** Tilset::WoodTable[20]
**
** Table for wood removable. This table contains the tile which
** is placed after a tree removement, depending on the surrounding.
** Table for wood removable. This table contains the tile which
** is placed after a tree removement, depending on the surrounding.
**
** Tileset::MixedLookupTable[MaxTilesInTileset]
** Table for finding what part of the tile contains wood/rock,
** and which part is grass or bare ground.
** Tileset::MixedLookupTable[MaxTilesInTileset]
** Table for finding what part of the tile contains wood/rock,
** and which part is grass or bare ground.
**
** Tileset::TopOneRock
** Tileset::TopOneRock
**
** The tile number of tile only containing the top part of a rock.
** Is created on the map by destroying rocks.
** The tile number of tile only containing the top part of a rock.
** Is created on the map by destroying rocks.
**
** Tileset::MidOneRock
** Tileset::MidOneRock
**
** The tile number of tile only containing the connection of
** the top part to the bottom part of a rock.
** Is created on the map by destroying rocks.
** The tile number of tile only containing the connection of
** the top part to the bottom part of a rock.
** Is created on the map by destroying rocks.
**
** Tileset::BotOneRock
** Tileset::BotOneRock
**
** The tile number of tile only containing the bottom part of a
** rock. Is created on the map by destroying rocks.
** The tile number of tile only containing the bottom part of a
** rock. Is created on the map by destroying rocks.
**
** Tileset::RemovedRock
** Tileset::RemovedRock
**
** The tile number of the tile placed where rocks are removed.
** Is created on the map by destroying rocks.
** The tile number of the tile placed where rocks are removed.
** Is created on the map by destroying rocks.
**
** Tileset::RockTable[20]
** Tileset::RockTable[20]
**
** Table for rock removable. Depending on the surrinding this
** table contains the new tile to be placed.
** Table for rock removable. Depending on the surrinding this
** table contains the new tile to be placed.
**
** @todo Johns: I don't think this table or routines look correct.
** But they work correct.
** @todo Johns: I don't think this table or routines look correct.
** But they work correct.
**
** Tileset::HumanWallTable
** Tileset::HumanWallTable
**
** Table of human wall tiles, index depends on the surroundings.
** Table of human wall tiles, index depends on the surroundings.
**
** Tileset::OrcWallTable
** Tileset::OrcWallTable
**
** Table of orc wall tiles, index depends on the surroundings.
** Table of orc wall tiles, index depends on the surroundings.
**
** Tileset::ItemsHash
** Tileset::ItemsHash
**
** Hash table of item numbers to unit names.
** Hash table of item numbers to unit names.
**
** @struct _tileset_ tileset.h
** @struct _tileset_ tileset.h
**
** \#include "tileset.h"
** \#include "tileset.h"
**
** typedef struct _tile_info_ TileInfo;
** typedef struct _tile_info_ TileInfo;
**
** This structure includes everything about a specific tile from the tileset.
** This structure includes everything about a specific tile from the tileset.
**
** TileInfo::BaseTerrain
** TileInfo::BaseTerrain
**
** This is the base terrain type of a tile. Only 15 of those
** are currently supported.
** This is the base terrain type of a tile. Only 15 of those
** are currently supported.
**
** TileInfo::MixTerrain
** TileInfo::MixTerrain
**
** FIXME:
** This is the terrain the tile is mixed with. This is 0 for
** a solid tile, we should make it equal to BaseTerrain
** @fixme This is the terrain the tile is mixed with. This is 0 for
** a solid tile, we should make it equal to BaseTerrain
**
*/
/*----------------------------------------------------------------------------
-- Declarations
-- Declarations
----------------------------------------------------------------------------*/
/// Size of a tile in X
extern int TileSizeX;
/// Size of a tile in Y
extern int TileSizeY;
extern int TileSizeX; ///< Size of a tile in X
extern int TileSizeY; ///< Size of a tile in Y
// This is only used for tile cache size
#define MaxTilesInTileset 5056 /// Current limit of tiles in tileset
#define MaxTilesInTileset 5056 ///< Current limit of tiles in tileset
/**
** These are used for lookup tiles types
** mainly used for the FOW implementation of the seen woods/rocks
** These are used for lookup tiles types
** mainly used for the FOW implementation of the seen woods/rocks
**
** @todo FIXME: I think this can be removed, we can use the flags?
** I'm not sure, if we have seen and real time to considere.
** @fixme I think this can be removed, we can use the flags?
** I'm not sure, if we have seen and real time to considere.
*/
typedef enum _tile_type_ {
TileTypeUnknown, /// Unknown tile type
TileTypeWood, /// Any wood tile
TileTypeRock, /// Any rock tile
TileTypeCoast, /// Any coast tile
TileTypeHumanWall, /// Any human wall tile
TileTypeOrcWall, /// Any orc wall tile
TileTypeWater, /// Any water tile
TileTypeUnknown, ///< Unknown tile type
TileTypeWood, ///< Any wood tile
TileTypeRock, ///< Any rock tile
TileTypeCoast, ///< Any coast tile
TileTypeHumanWall, ///< Any human wall tile
TileTypeOrcWall, ///< Any orc wall tile
TileTypeWater, ///< Any water tile
} TileType;
/// Single tile definition
typedef struct _tile_info_ {
unsigned char BaseTerrain; /// Basic terrain of the tile
unsigned char MixTerrain; /// Terrain mixed with this
unsigned char BaseTerrain; ///< Basic terrain of the tile
unsigned char MixTerrain; ///< Terrain mixed with this
} TileInfo;
/// Definition for a terrain type
typedef struct _solid_terrain_info_ {
char* TerrainName; /// Name of the terrain
int NumSolidTiles; /// How many solid tile variants
// FIXME: When drawing with the editor add some kind fo probabilities for every tile.
unsigned short* SolidTiles; /// Solid tile IDs
char* TerrainName; ///< Name of the terrain
int NumSolidTiles; ///< How many solid tile variants
/// @fixme When drawing with the editor add some kind fo probabilities for every tile.
unsigned short* SolidTiles; ///< Solid tile IDs
} SolidTerrainInfo;
/// Tileset definition
/// Tileset definition
typedef struct _tileset_ {
char* Ident; /// Tileset identifier
char* File; /// CCL file containing tileset data
char* Class; /// Class for future extensions
char* Name; /// Nice name to display
char* ImageFile; /// File containing image data
char* Ident; ///< Tileset identifier
char* File; ///< CCL file containing tileset data
char* Class; ///< Class for future extensions
char* Name; ///< Nice name to display
char* ImageFile; ///< File containing image data
int NumTiles; /// Number of tiles in the tables
int TileSizeX; /// Size of a tile in X
int TileSizeY; /// Size of a tile in Y
unsigned short* Table; /// Pud to internal conversion table
unsigned short* FlagsTable; /// Flag table for editor
int NumTiles; ///< Number of tiles in the tables
int TileSizeX; ///< Size of a tile in X
int TileSizeY; ///< Size of a tile in Y
unsigned short* Table; ///< Pud to internal conversion table
unsigned short* FlagsTable; ///< Flag table for editor
TileInfo* Tiles; /// Tile descriptions
TileInfo* Tiles; ///< Tile descriptions
// FIXME: currently hardcoded
unsigned char* TileTypeTable; /// For fast lookup of tile type
// FIXME: currently unsupported
unsigned short* AnimationTable; /// Tile animation sequences
/// @fixme currently hardcoded
unsigned char* TileTypeTable; ///< For fast lookup of tile type
/// @fixme currently unsupported
unsigned short* AnimationTable; ///< Tile animation sequences
int NumTerrainTypes; /// Number of different terrain types
SolidTerrainInfo* SolidTerrainTypes;/// Information about solid terrains.
int NumTerrainTypes; ///< Number of different terrain types
SolidTerrainInfo* SolidTerrainTypes; ///< Information about solid terrains.
unsigned TopOneTree; /// Tile for one tree top
unsigned MidOneTree; /// Tile for one tree middle
unsigned BotOneTree; /// Tile for one tree bottom
int RemovedTree; /// Tile placed where trees are gone
unsigned GrowingTree[2]; /// Growing tree tiles
int WoodTable[20]; /// Table for tree removable
int MixedLookupTable[MaxTilesInTileset];
/// Lookup for what part of tile used
unsigned TopOneRock; /// Tile for one rock top
unsigned MidOneRock; /// Tile for one rock middle
unsigned BotOneRock; /// Tile for one rock bottom
int RemovedRock; /// Tile placed where rocks are gone
int RockTable[20]; /// Removed rock placement table
unsigned TopOneTree; ///< Tile for one tree top
unsigned MidOneTree; ///< Tile for one tree middle
unsigned BotOneTree; ///< Tile for one tree bottom
int RemovedTree; ///< Tile placed where trees are gone
unsigned GrowingTree[2]; ///< Growing tree tiles
int WoodTable[20]; ///< Table for tree removable
int MixedLookupTable[MaxTilesInTileset]; ///< Lookup for what part of tile used
unsigned TopOneRock; ///< Tile for one rock top
unsigned MidOneRock; ///< Tile for one rock middle
unsigned BotOneRock; ///< Tile for one rock bottom
int RemovedRock; ///< Tile placed where rocks are gone
int RockTable[20]; ///< Removed rock placement table
unsigned HumanWallTable[16]; /// Human wall placement table
unsigned OrcWallTable[16]; /// Orc wall placement table
unsigned HumanWallTable[16]; ///< Human wall placement table
unsigned OrcWallTable[16]; ///< Orc wall placement table
hashtable(char*,128) ItemsHash; /// Items hash table
hashtable(char*,128) ItemsHash; ///< Items hash table
} Tileset;
// FIXME: this #define's should be removed
/// @fixme this #define's should be removed
enum _tileset_nr_ {
TilesetSummer, /// Reference number for summer
TilesetWinter, /// Reference number for winter
TilesetWasteland, /// Reference number for wasteland
TilesetSwamp, /// Reference number for swamp
TilesetSummer, ///< Reference number for summer
TilesetWinter, ///< Reference number for winter
TilesetWasteland, ///< Reference number for wasteland
TilesetSwamp, ///< Reference number for swamp
};
/*----------------------------------------------------------------------------
-- Variables
-- Variables
----------------------------------------------------------------------------*/
extern char** TilesetWcNames; /// Mapping wc-number 2 symbol
extern char** TilesetWcNames; ///< Mapping wc-number 2 symbol
extern int NumTilesets; /// Number of available tilesets
extern Tileset** Tilesets; /// Tileset information
extern int NumTilesets; ///< Number of available tilesets
extern Tileset** Tilesets; ///< Tileset information
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
extern void LoadTileset(void); /// Load tileset definition
extern void CleanTilesets(void); /// Cleanup the tileset module
extern void LoadTileset(void); ///< Load tileset definition
extern void CleanTilesets(void); ///< Cleanup the tileset module
extern void TilesetCclRegister(void); /// Register CCL features for tileset
extern void TilesetCclRegister(void); ///< Register CCL features for tileset
//@}

View file

@ -34,49 +34,49 @@
//@{
/*----------------------------------------------------------------------------
-- Includes
-- Includes
----------------------------------------------------------------------------*/
#include "script.h"
/*----------------------------------------------------------------------------
-- Declarations
-- Declarations
----------------------------------------------------------------------------*/
/**
** Timer structure
** Timer structure
*/
typedef struct _timer_ {
char Init; /// timer is initialized
char Running; /// timer is running
char Increasing; /// increasing or decreasing
long Cycles; /// current value in game cycles
unsigned long LastUpdate; /// GameCycle of last update
char Init; ///< timer is initialized
char Running; ///< timer is running
char Increasing; ///< increasing or decreasing
long Cycles; ///< current value in game cycles
unsigned long LastUpdate; ///< GameCycle of last update
} Timer;
#define ANY_UNIT ((const UnitType*)0)
#define ALL_UNITS ((const UnitType*)-1)
#define ALL_FOODUNITS ((const UnitType*)-2)
#define ALL_BUILDINGS ((const UnitType*)-3)
#define ANY_UNIT ((const UnitType*)0)
#define ALL_UNITS ((const UnitType*)-1)
#define ALL_FOODUNITS ((const UnitType*)-2)
#define ALL_BUILDINGS ((const UnitType*)-3)
/*----------------------------------------------------------------------------
-- Variables
-- Variables
----------------------------------------------------------------------------*/
extern Timer GameTimer; /// the game timer
extern Timer GameTimer; ///< the game timer
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
extern int TriggerGetPlayer(lua_State* l);/// get player number.
extern const UnitType* TriggerGetUnitType(lua_State* l); /// get the unit-type
extern void TriggersEachCycle(void); /// test triggers
extern int TriggerGetPlayer(lua_State* l);///< get player number.
extern const UnitType* TriggerGetUnitType(lua_State* l); ///< get the unit-type
extern void TriggersEachCycle(void); ///< test triggers
extern void TriggerCclRegister(void); /// Register ccl features
extern void SaveTriggers(CLFile* file); /// Save the trigger module
extern void InitTriggers(void); /// Setup triggers
extern void CleanTriggers(void); /// Cleanup the trigger module
extern void TriggerCclRegister(void); ///< Register ccl features
extern void SaveTriggers(CLFile* file); ///< Save the trigger module
extern void InitTriggers(void); ///< Setup triggers
extern void CleanTriggers(void); ///< Cleanup the trigger module
//@}

View file

@ -33,8 +33,8 @@
//@{
// FIXME: this only the start of the new user interface
// FIXME: all user interface variables should go here and be configurable
/// @fixme this only the start of the new user interface
/// @fixme all user interface variables should go here and be configurable
/*----------------------------------------------------------------------------
-- Includes
@ -51,17 +51,17 @@
/// buttons on screen themselves
typedef struct _button_ {
int X; /// x coordinate on the screen
int Y; /// y coordinate on the screen
int Width; /// width of the button on the screen
int Height; /// height of the button on the screen
int X; ///< x coordinate on the screen
int Y; ///< y coordinate on the screen
int Width; ///< width of the button on the screen
int Height; ///< height of the button on the screen
} Button;
#define MAX_NUM_VIEWPORTS 8 /// Number of supported viewports
#define MAX_NUM_VIEWPORTS 8 ///< Number of supported viewports
#if !defined(__STRUCT_VIEWPORT__)
#define __STRUCT_VIEWPORT__ /// protect duplicate viewport typedef
typedef struct _viewport_ Viewport; /// Viewport typedef
#define __STRUCT_VIEWPORT__ ///< protect duplicate viewport typedef
typedef struct _viewport_ Viewport; ///< Viewport typedef
#endif
/**
@ -91,24 +91,24 @@ typedef struct _viewport_ Viewport; /// Viewport typedef
** @todo binding to a group.
*/
struct _viewport_ {
int X; /// Screen pixel left corner x coordinate
int Y; /// Screen pixel upper corner y coordinate
int EndX; /// Screen pixel right x coordinate
int EndY; /// Screen pixel bottom y coordinate
int X; ///< Screen pixel left corner x coordinate
int Y; ///< Screen pixel upper corner y coordinate
int EndX; ///< Screen pixel right x coordinate
int EndY; ///< Screen pixel bottom y coordinate
int MapX; /// Map tile left corner x coordinate
int MapY; /// Map tile upper corner y coordinate
int OffsetX; /// Map tile offset
int OffsetY; /// Map tile offset
int MapWidth; /// Width in map tiles
int MapHeight; /// Height in map tiles
int MapX; ///< Map tile left corner x coordinate
int MapY; ///< Map tile upper corner y coordinate
int OffsetX; ///< Map tile offset
int OffsetY; ///< Map tile offset
int MapWidth; ///< Width in map tiles
int MapHeight; ///< Height in map tiles
#ifdef NEW_MAPDRAW
char MustRedrawTile[MAXMAP_W * MAXMAP_H]; /// Must redraw tile
char MustRedrawRow[MAXMAP_W]; /// Must redraw row
char MustRedrawTile[MAXMAP_W * MAXMAP_H]; ///< Must redraw tile
char MustRedrawRow[MAXMAP_W]; ///< Must redraw row
#endif
Unit* Unit; /// Bound to this unit
Unit* Unit; ///< Bound to this unit
};
/**
@ -117,240 +117,240 @@ struct _viewport_ {
** @todo this should be later user configurable
*/
typedef enum {
VIEWPORT_SINGLE, /// Old single viewport
VIEWPORT_SPLIT_HORIZ, /// Two viewports split horizontal
VIEWPORT_SPLIT_HORIZ3, /// Three viewports split horiontal
VIEWPORT_SPLIT_VERT, /// Two viewports split vertical
VIEWPORT_QUAD, /// Four viewports split symmetric
NUM_VIEWPORT_MODES, /// Number of different viewports.
VIEWPORT_SINGLE, ///< Old single viewport
VIEWPORT_SPLIT_HORIZ, ///< Two viewports split horizontal
VIEWPORT_SPLIT_HORIZ3, ///< Three viewports split horiontal
VIEWPORT_SPLIT_VERT, ///< Two viewports split vertical
VIEWPORT_QUAD, ///< Four viewports split symmetric
NUM_VIEWPORT_MODES, ///< Number of different viewports.
} ViewportMode;
#define ScPanel "sc-panel" /// hack for transparency
#define ScPanel "sc-panel" ///< hack for transparency
/**
** Menu panels
*/
typedef struct _menu_panel_ {
char* Ident; /// Unique identifier
GraphicConfig Panel; /// Panel
struct _menu_panel_* Next; /// Next pointer
char* Ident; ///< Unique identifier
GraphicConfig Panel; ///< Panel
struct _menu_panel_* Next; ///< Next pointer
} MenuPanel;
/**
** Defines the user interface.
*/
typedef struct _ui_ {
char* Name; /// interface name to select
int Width; /// useable for this width
int Height; /// useable for this height
char* Name; ///< interface name to select
int Width; ///< useable for this width
int Height; ///< useable for this height
int MouseScroll; /// Enable mouse scrolling
int KeyScroll; /// Enable keyboard scrolling
int MouseScroll; ///< Enable mouse scrolling
int KeyScroll; ///< Enable keyboard scrolling
/// Middle-Mouse Scroll Speed (screenpixels per mousepixel)
int MouseScrollSpeedDefault;
/// Middle-Mouse Scroll Speed with Control pressed
int MouseScrollSpeedControl;
int MouseWarpX; /// Cursor warp X position
int MouseWarpY; /// Cursor warp Y position
int MouseWarpX; ///< Cursor warp X position
int MouseWarpY; ///< Cursor warp Y position
char* NormalFontColor; /// Color for normal text displayed
char* ReverseFontColor; /// Color for reverse text displayed
char* NormalFontColor; ///< Color for normal text displayed
char* ReverseFontColor; ///< Color for reverse text displayed
// Fillers
GraphicConfig* Filler; /// Filler graphics
int* FillerX; /// Filler X positions
int* FillerY; /// Filler Y positions
int NumFillers; /// Number of fillers
GraphicConfig* Filler; ///< Filler graphics
int* FillerX; ///< Filler X positions
int* FillerY; ///< Filler Y positions
int NumFillers; ///< Number of fillers
// Resource line
GraphicConfig Resource; /// Resource background
int ResourceX; /// Resource X position
int ResourceY; /// Resource Y position
GraphicConfig Resource; ///< Resource background
int ResourceX; ///< Resource X position
int ResourceY; ///< Resource Y position
struct {
GraphicConfig Icon; /// icon image
int IconFrame; /// icon frame
int IconX; /// icon X position
int IconY; /// icon Y position
int IconW; /// icon W position
int IconH; /// icon H position
int TextX; /// text X position
int TextY; /// text Y position
} Resources[MaxCosts + 2]; /// Icon+Text of all resources
/// +2 for food and score
GraphicConfig Icon; ///< icon image
int IconFrame; ///< icon frame
int IconX; ///< icon X position
int IconY; ///< icon Y position
int IconW; ///< icon W position
int IconH; ///< icon H position
int TextX; ///< text X position
int TextY; ///< text Y position
} Resources[MaxCosts + 2]; ///< Icon+Text of all resources
///< +2 for food and score
// Info panel
GraphicConfig InfoPanel; /// Info panel background
int InfoPanelX; /// Info panel screen X position
int InfoPanelY; /// Info panel screen Y position
int InfoPanelW; /// Info panel width
int InfoPanelH; /// Info panel height
GraphicConfig InfoPanel; ///< Info panel background
int InfoPanelX; ///< Info panel screen X position
int InfoPanelY; ///< Info panel screen Y position
int InfoPanelW; ///< Info panel width
int InfoPanelH; ///< Info panel height
Button* SingleSelectedButton; /// FIXME: docu
char* SingleSelectedText; /// FIXME: docu
int SingleSelectedFont; /// FIXME: docu
int SingleSelectedTextX; /// FIXME: docu
int SingleSelectedTextY; /// FIXME: docu
Button* SelectedButtons; /// Selected buttons
int NumSelectedButtons; /// Number of selected buttons
char* SelectedText; /// FIXME: docu
int SelectedFont; /// FIXME: docu
int SelectedTextX; /// FIXME: docu
int SelectedTextY; /// FIXME: docu
int MaxSelectedFont; /// FIXME: docu
int MaxSelectedTextX; /// position to place '+#' text
int MaxSelectedTextY; /// if > maximum units selected
Button* SingleSelectedButton; ///< FIXME: docu
char* SingleSelectedText; ///< FIXME: docu
int SingleSelectedFont; ///< FIXME: docu
int SingleSelectedTextX; ///< FIXME: docu
int SingleSelectedTextY; ///< FIXME: docu
Button* SelectedButtons; ///< Selected buttons
int NumSelectedButtons; ///< Number of selected buttons
char* SelectedText; ///< FIXME: docu
int SelectedFont; ///< FIXME: docu
int SelectedTextX; ///< FIXME: docu
int SelectedTextY; ///< FIXME: docu
int MaxSelectedFont; ///< FIXME: docu
int MaxSelectedTextX; ///< position to place '+#' text
int MaxSelectedTextY; ///< if > maximum units selected
Button* SingleTrainingButton; /// FIXME: docu
char* SingleTrainingText; /// FIXME: docu
int SingleTrainingFont; /// FIXME: docu
int SingleTrainingTextX; /// FIXME: docu
int SingleTrainingTextY; /// FIXME: docu
Button* TrainingButtons; /// Training buttons
int NumTrainingButtons; /// Number of training buttons
char* TrainingText; /// FIXME: docu
int TrainingFont; /// FIXME: docu
int TrainingTextX; /// FIXME: docu
int TrainingTextY; /// FIXME: docu
Button* SingleTrainingButton; ///< FIXME: docu
char* SingleTrainingText; ///< FIXME: docu
int SingleTrainingFont; ///< FIXME: docu
int SingleTrainingTextX; ///< FIXME: docu
int SingleTrainingTextY; ///< FIXME: docu
Button* TrainingButtons; ///< Training buttons
int NumTrainingButtons; ///< Number of training buttons
char* TrainingText; ///< FIXME: docu
int TrainingFont; ///< FIXME: docu
int TrainingTextX; ///< FIXME: docu
int TrainingTextY; ///< FIXME: docu
Button* UpgradingButton;
char* UpgradingText;
int UpgradingFont;
int UpgradingTextX;
int UpgradingTextY;
Button* UpgradingButton; ///< FIXME: docu
char* UpgradingText; ///< FIXME: docu
int UpgradingFont; ///< FIXME: docu
int UpgradingTextX; ///< FIXME: docu
int UpgradingTextY; ///< FIXME: docu
Button* ResearchingButton;
char* ResearchingText;
int ResearchingFont;
int ResearchingTextX;
int ResearchingTextY;
Button* ResearchingButton; ///< FIXME: docu
char* ResearchingText; ///< FIXME: docu
int ResearchingFont; ///< FIXME: docu
int ResearchingTextX; ///< FIXME: docu
int ResearchingTextY; ///< FIXME: docu
Button* TransportingButtons;
int NumTransportingButtons; /// Number of transporting buttons
char* TransportingText;
int TransportingFont;
int TransportingTextX;
int TransportingTextY;
Button* TransportingButtons; ///< FIXME: docu
int NumTransportingButtons; ///< Number of transporting buttons
char* TransportingText; ///< FIXME: docu
int TransportingFont; ///< FIXME: docu
int TransportingTextX; ///< FIXME: docu
int TransportingTextY; ///< FIXME: docu
// Completed bar
SDL_Color CompletedBarColorRGB; /// color for completed bar
Uint32 CompletedBarColor; /// color for completed bar
int CompletedBarShadow; /// should complete bar have shadow
int CompletedBarX; /// completed bar X position
int CompletedBarY; /// completed bar Y position
int CompletedBarW; /// completed bar width
int CompletedBarH; /// completed bar height
char* CompletedBarText; /// completed bar text
int CompletedBarFont; /// completed bar font
int CompletedBarTextX; /// completed bar text X position
int CompletedBarTextY; /// completed bar text Y position
SDL_Color CompletedBarColorRGB; ///< color for completed bar
Uint32 CompletedBarColor; ///< color for completed bar
int CompletedBarShadow; ///< should complete bar have shadow
int CompletedBarX; ///< completed bar X position
int CompletedBarY; ///< completed bar Y position
int CompletedBarW; ///< completed bar width
int CompletedBarH; ///< completed bar height
char* CompletedBarText; ///< completed bar text
int CompletedBarFont; ///< completed bar font
int CompletedBarTextX; ///< completed bar text X position
int CompletedBarTextY; ///< completed bar text Y position
// Button panel
GraphicConfig ButtonPanel; /// Button panel background
Button* ButtonButtons; /// Button panel buttons
int NumButtonButtons; /// Number of button panel buttons
int ButtonPanelX; /// Button panel screen X position
int ButtonPanelY; /// Button panel screen Y position
int CommandKeyFont; /// Command key font
GraphicConfig ButtonPanel; ///< Button panel background
Button* ButtonButtons; ///< Button panel buttons
int NumButtonButtons; ///< Number of button panel buttons
int ButtonPanelX; ///< Button panel screen X position
int ButtonPanelY; ///< Button panel screen Y position
int CommandKeyFont; ///< Command key font
// Map area
ViewportMode ViewportMode; /// Current viewport mode
Viewport* MouseViewport; /// Viewport containing mouse
Viewport* SelectedViewport; /// Current selected active viewport
int NumViewports; /// # Viewports currently used
Viewport Viewports[MAX_NUM_VIEWPORTS]; /// Parameters of all viewports
ViewportMode ViewportMode; ///< Current viewport mode
Viewport* MouseViewport; ///< Viewport containing mouse
Viewport* SelectedViewport; ///< Current selected active viewport
int NumViewports; ///< # Viewports currently used
Viewport Viewports[MAX_NUM_VIEWPORTS]; ///< Parameters of all viewports
// Map* attributes of Viewport are unused here:
Viewport MapArea; /// geometry of the whole map area
Viewport MapArea; ///< geometry of the whole map area
// The menu panel
GraphicConfig MenuPanel; /// menu panel background
int MenuPanelX; /// menu panel screen X position
int MenuPanelY; /// menu panel screen Y position
GraphicConfig MenuPanel; ///< menu panel background
int MenuPanelX; ///< menu panel screen X position
int MenuPanelY; ///< menu panel screen Y position
/// Menu buttons
struct {
int X; /// button screen X position
int Y; /// button screen Y position
char* Text; /// button caption
int Font; /// button caption font
int Width; /// button width
int Height; /// button height
int Button; /// button style
int X; ///< button screen X position
int Y; ///< button screen Y position
char* Text; ///< button caption
int Font; ///< button caption font
int Width; ///< button width
int Height; ///< button height
int Button; ///< button style
} MenuButton,
NetworkMenuButton,
NetworkDiplomacyButton;
// The minimap
GraphicConfig MinimapPanel; /// minimap panel background
int MinimapPanelX; /// minimap panel screen X position
int MinimapPanelY; /// minimap panel screen Y position
int MinimapW; /// minimap screen Width
int MinimapH; /// minimap screen Height
int MinimapPosX; /// minimap screen X position
int MinimapPosY; /// minimap screen Y position
int MinimapTransparent; /// unexplored areas are transparent
Uint32 ViewportCursorColor; /// minimap cursor color
GraphicConfig MinimapPanel; ///< minimap panel background
int MinimapPanelX; ///< minimap panel screen X position
int MinimapPanelY; ///< minimap panel screen Y position
int MinimapW; ///< minimap screen Width
int MinimapH; ///< minimap screen Height
int MinimapPosX; ///< minimap screen X position
int MinimapPosY; ///< minimap screen Y position
int MinimapTransparent; ///< unexplored areas are transparent
Uint32 ViewportCursorColor; ///< minimap cursor color
// The status line
GraphicConfig StatusLine; /// Status line background
int StatusLineX; /// status line screen X position
int StatusLineY; /// status line screen Y position
int StatusLineTextX; /// status line screen text X position
int StatusLineTextY; /// status line screen text Y position
int StatusLineFont; /// Status line font
GraphicConfig StatusLine; ///< Status line background
int StatusLineX; ///< status line screen X position
int StatusLineY; ///< status line screen Y position
int StatusLineTextX; ///< status line screen text X position
int StatusLineTextY; ///< status line screen text Y position
int StatusLineFont; ///< Status line font
// Offsets for 640x480 center used by menus
int Offset640X; /// Offset for 640x480 X position
int Offset480Y; /// Offset for 640x480 Y position
int Offset640X; ///< Offset for 640x480 X position
int Offset480Y; ///< Offset for 640x480 Y position
//
// Cursors used.
//
CursorConfig Point; /// General pointing cursor
CursorConfig Glass; /// HourGlass, system is waiting
CursorConfig Cross; /// Multi-select cursor.
CursorConfig YellowHair; /// Yellow action,attack cursor.
CursorConfig GreenHair; /// Green action,attack cursor.
CursorConfig RedHair; /// Red action,attack cursor.
CursorConfig Scroll; /// Cursor for scrolling map around.
CursorConfig Point; ///< General pointing cursor
CursorConfig Glass; ///< HourGlass, system is waiting
CursorConfig Cross; ///< Multi-select cursor.
CursorConfig YellowHair; ///< Yellow action,attack cursor.
CursorConfig GreenHair; ///< Green action,attack cursor.
CursorConfig RedHair; ///< Red action,attack cursor.
CursorConfig Scroll; ///< Cursor for scrolling map around.
CursorConfig ArrowE; /// Cursor pointing east
CursorConfig ArrowNE; /// Cursor pointing north east
CursorConfig ArrowN; /// Cursor pointing north
CursorConfig ArrowNW; /// Cursor pointing north west
CursorConfig ArrowW; /// Cursor pointing west
CursorConfig ArrowSW; /// Cursor pointing south west
CursorConfig ArrowS; /// Cursor pointing south
CursorConfig ArrowSE; /// Cursor pointing south east
CursorConfig ArrowE; ///< Cursor pointing east
CursorConfig ArrowNE; ///< Cursor pointing north east
CursorConfig ArrowN; ///< Cursor pointing north
CursorConfig ArrowNW; ///< Cursor pointing north west
CursorConfig ArrowW; ///< Cursor pointing west
CursorConfig ArrowSW; ///< Cursor pointing south west
CursorConfig ArrowS; ///< Cursor pointing south
CursorConfig ArrowSE; ///< Cursor pointing south east
// FIXME: could use different sounds/speech for the errors
// Is in gamesounds?
// SoundConfig PlacementError; /// played on placements errors
// SoundConfig PlacementSuccess; /// played on placements success
// SoundConfig Click; /// click noice used often
/// @fixme could use different sounds/speech for the errors
/// Is in gamesounds?
/// SoundConfig PlacementError; ///< played on placements errors
/// SoundConfig PlacementSuccess; ///< played on placements success
/// SoundConfig Click; ///< click noice used often
MenuPanel* MenuPanels; /// Menu panels
MenuPanel* MenuPanels; ///< Menu panels
GraphicConfig VictoryBackground; /// FIXME: docu
GraphicConfig DefeatBackground; /// FIXME: docu
GraphicConfig VictoryBackground; ///< FIXME: docu
GraphicConfig DefeatBackground; ///< FIXME: docu
} UI;
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
extern UI TheUI; /// The user interface
extern UI** UI_Table; /// All available user interfaces
extern UI TheUI; ///< The user interface
extern UI** UI_Table; ///< All available user interfaces
extern char RightButtonAttacks; /// right button 0 move, 1 attack.
extern ButtonAction* CurrentButtons; /// Current Selected Buttons
extern char FancyBuildings; /// Mirror buildings 1 yes, 0 now.
extern char RightButtonAttacks; ///< right button 0 move, 1 attack.
extern ButtonAction* CurrentButtons; ///< Current Selected Buttons
extern char FancyBuildings; ///< Mirror buildings 1 yes, 0 now.
extern int SpeedKeyScroll; /// Keyboard Scrolling Speed, in Frames
extern int SpeedMouseScroll; /// Mouse Scrolling Speed, in Frames
extern int SpeedKeyScroll; ///< Keyboard Scrolling Speed, in Frames
extern int SpeedMouseScroll; ///< Mouse Scrolling Speed, in Frames
extern char* UiGroupKeys; /// up to 11 keys used for group selection
extern char* UiGroupKeys; ///< up to 11 keys used for group selection
// only exported to save them

File diff suppressed because it is too large Load diff

View file

@ -35,55 +35,54 @@
//@{
/*----------------------------------------------------------------------------
-- Includes
-- Includes
----------------------------------------------------------------------------*/
#include "sound_id.h"
#include "upgrade_structs.h"
/*----------------------------------------------------------------------------
-- Declarations
-- Declarations
----------------------------------------------------------------------------*/
/**
** Sound definition
** Sound definition
*/
typedef struct _sound_config_ {
char* Name; /// config sound name
SoundId Sound; /// identifier send to sound server
char* Name; ///< config sound name
SoundId Sound; ///< identifier send to sound server
} SoundConfig;
/**
** The sounds of the units.
**
** Played for the various events.
** Played for the various events.
*/
typedef struct _unit_sound_ {
SoundConfig Selected; /// selected by user
SoundConfig Acknowledgement; /// acknowledge of use command
SoundConfig Ready; /// unit training... ready
SoundConfig Repair; /// unit repairing
SoundConfig Harvest[MaxCosts]; /// unit harvesting
SoundConfig Help; /// unit is attacked
SoundConfig Dead; /// unit is killed
SoundConfig Selected; ///< selected by user
SoundConfig Acknowledgement; ///< acknowledge of use command
SoundConfig Ready; ///< unit training... ready
SoundConfig Repair; ///< unit repairing
SoundConfig Harvest[MaxCosts]; ///< unit harvesting
SoundConfig Help; ///< unit is attacked
SoundConfig Dead; ///< unit is killed
} UnitSound;
//FIXME: temporary solution should perhaps be a member of a more general
// weapon structure.
/// @fixme temporary solution should perhaps be a member of a more general weapon structure.
/**
** Attack sounds
** Attack sounds
*/
typedef struct _weapon_sound_ {
SoundConfig Attack; /// weapon is fired
SoundConfig Attack; ///< weapon is fired
} WeaponSound;
/*----------------------------------------------------------------------------
-- Variables
-- Variables
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Functions
-- Functions
----------------------------------------------------------------------------*/
/**
@ -98,12 +97,12 @@ extern void LoadUnitSounds(void);
*/
extern void MapUnitSounds(void);
#ifndef WITH_SOUND // {
#ifndef WITH_SOUND // {
#define LoadUnitSounds() /// Dummy function for without sound
#define MapUnitSounds() /// Dummy function for without sound
#define LoadUnitSounds() ///< Dummy function for without sound
#define MapUnitSounds() ///< Dummy function for without sound
#endif // } !WITH_SOUND
#endif // } !WITH_SOUND
//@}

File diff suppressed because it is too large Load diff

View file

@ -85,10 +85,10 @@ extern int UpgradeIdByIdent(const char* sid);
/// Upgrade will be acquired
extern void UpgradeAcquire(Player* player, const Upgrade* upgrade);
// for now it will be empty?
// perhaps acquired upgrade can be lost if (for example) a building is lost
// (lumber mill? stronghold?)
// this function will apply all modifiers in reverse way
/// for now it will be empty?
/// perhaps acquired upgrade can be lost if (for example) a building is lost
/// (lumber mill? stronghold?)
/// this function will apply all modifiers in reverse way
extern void UpgradeLost(Player* player, int id);
/*----------------------------------------------------------------------------

View file

@ -52,18 +52,18 @@
** Indices into costs/resource/income array.
*/
typedef enum _costs_ {
TimeCost, /// time in game cycles
TimeCost, ///< time in game cycles
// standard
GoldCost, /// gold resource
WoodCost, /// wood resource
OilCost, /// oil resource
GoldCost, ///< gold resource
WoodCost, ///< wood resource
OilCost, ///< oil resource
// extensions
Cost4, /// resource 4
Cost5, /// resource 5
Cost6, /// resource 6
Cost4, ///< resource 4
Cost5, ///< resource 5
Cost6, ///< resource 6
MaxCosts /// how many different costs
MaxCosts ///< how many different costs
} CostType;
#define FoodCost MaxCosts
@ -123,27 +123,27 @@ extern int DefaultResourceAmounts[MaxCosts];
** This are the current stats of an unit. Upgraded or downgraded.
*/
typedef struct _unit_stats_ {
int AttackRange; /// how far can the unit attack
int SightRange; /// how far can the unit see
int Armor; /// armor strength
int BasicDamage; /// weapon basic damage
int PiercingDamage; /// weapon piercing damage
int Speed; /// movement speed
int HitPoints; /// hit points
int RegenerationRate; /// HP regeration rate in HP
int Costs[MaxCosts]; /// current costs of the unit
int Level; /// unit level (upgrades)
int AttackRange; ///< how far can the unit attack
int SightRange; ///< how far can the unit see
int Armor; ///< armor strength
int BasicDamage; ///< weapon basic damage
int PiercingDamage; ///< weapon piercing damage
int Speed; ///< movement speed
int HitPoints; ///< hit points
int RegenerationRate; ///< HP regeration rate in HP
int Costs[MaxCosts]; ///< current costs of the unit
int Level; ///< unit level (upgrades)
} UnitStats;
/**
** The main useable upgrades.
*/
typedef struct _upgrade_ {
const void* OType; /// object type (future extensions)
char* Ident; /// identifier
int Costs[MaxCosts]; /// costs for the upgrade
// FIXME: not used by buttons
IconConfig Icon; /// icon to display to the user
const void* OType; ///< object type (future extensions)
char* Ident; ///< identifier
int Costs[MaxCosts]; ///< costs for the upgrade
/// @fixme not used by buttons
IconConfig Icon; ///< icon to display to the user
} Upgrade;
/*----------------------------------------------------------------------------
@ -156,16 +156,16 @@ typedef struct _upgrade_ {
** @see UnitStats
*/
typedef struct _modifiers_ {
int AttackRange; /// attack range modifier
int SightRange; /// sight range modifier
int BasicDamage; /// basic damage modifier
int PiercingDamage; /// piercing damage modifier
int Armor; /// armor modifier
int Speed; /// speed modifier (FIXME: not working)
int HitPoints; /// hit points modifier
int RegenerationRate; /// HP regeneration rate modifier
int AttackRange; ///< attack range modifier
int SightRange; ///< sight range modifier
int BasicDamage; ///< basic damage modifier
int PiercingDamage; ///< piercing damage modifier
int Armor; ///< armor modifier
int Speed; ///< speed modifier (FIXME: not working)
int HitPoints; ///< hit points modifier
int RegenerationRate; ///< HP regeneration rate modifier
int Costs[MaxCosts]; /// costs modifier
int Costs[MaxCosts]; ///< costs modifier
} Modifiers;
/**
@ -175,20 +175,20 @@ typedef struct _modifiers_ {
*/
typedef struct _upgrade_modifier_ {
int UpgradeId; /// used to filter required modifier
int UpgradeId; ///< used to filter required modifier
Modifiers Modifier; /// modifier of unit stats
Modifiers Modifier; ///< modifier of unit stats
// allow/forbid bitmaps -- used as chars for example:
// `?' -- leave as is, `F' -- forbid, `A' -- allow
// FIXME: see below allow more semantics?
// FIXME: pointers or ids would be faster and less memory use
int ChangeUnits[UnitTypeMax]; /// add/remove allowed units
char ChangeUpgrades[UpgradeMax]; /// allow/forbid upgrades
char ApplyTo[UnitTypeMax]; /// which unit types are affected
/// @fixme see below allow more semantics?
/// @fixme pointers or ids would be faster and less memory use
int ChangeUnits[UnitTypeMax]; ///< add/remove allowed units
char ChangeUpgrades[UpgradeMax]; ///< allow/forbid upgrades
char ApplyTo[UnitTypeMax]; ///< which unit types are affected
// FIXME: UnitType*
void* ConvertTo; /// convert to this unit-type.
/// @fixme void* cshould be UnitType*
void* ConvertTo; ///< convert to this unit-type.
} UpgradeModifier;
@ -206,8 +206,8 @@ typedef struct _upgrade_modifier_ {
** @li `X' -- fixed, acquired can't be disabled
*/
typedef struct _allow_ {
int Units[UnitTypeMax]; /// maximum amount of units allowed
char Upgrades[UpgradeMax]; /// upgrades allowed/disallowed
int Units[UnitTypeMax]; ///< maximum amount of units allowed
char Upgrades[UpgradeMax]; ///< upgrades allowed/disallowed
} Allow;
/**
@ -220,7 +220,7 @@ typedef struct _upgrade_timers_ {
** all 0 at the beginning, all upgrade actions do increment values in
** this struct.
*/
int Upgrades[UpgradeMax]; /// counter for each upgrade
int Upgrades[UpgradeMax]; ///< counter for each upgrade
} UpgradeTimers;
@ -228,8 +228,8 @@ typedef struct _upgrade_timers_ {
-- Variables
----------------------------------------------------------------------------*/
extern const char UpgradeType[]; /// upgrade type
extern Upgrade Upgrades[UpgradeMax]; /// the main user usable upgrades
extern const char UpgradeType[]; ///< upgrade type
extern Upgrade Upgrades[UpgradeMax]; ///< the main user usable upgrades
//@}

View file

@ -50,12 +50,12 @@ typedef struct _graphic_ {
int Height;
int NumFrames;
#ifdef USE_OPENGL
int GraphicWidth; /// Original graphic width
int GraphicHeight; /// Original graphic height
GLfloat TextureWidth; /// Width of the texture
GLfloat TextureHeight; /// Height of the texture
int NumTextureNames; /// Number of textures
GLuint* TextureNames; /// Texture names
int GraphicWidth; ///< Original graphic width
int GraphicHeight; ///< Original graphic height
GLfloat TextureWidth; ///< Width of the texture
GLfloat TextureHeight; ///< Height of the texture
int NumTextureNames; ///< Number of textures
GLuint* TextureNames; ///< Texture names
#endif
} Graphic;
@ -96,8 +96,8 @@ typedef struct _event_callback_ {
/// Graphic reference used during config/setup
typedef struct _graphic_config_ {
char* File; /// config graphic name or file
Graphic* Graphic; /// graphic pointer to use to run time
char* File; ///< config graphic name or file
Graphic* Graphic; ///< graphic pointer to use to run time
} GraphicConfig;
/// Creates a shared hardware palette from an independent Palette struct.
@ -106,7 +106,7 @@ extern SDL_Palette* VideoCreateSharedPalette(const SDL_Palette* palette);
/// Free a shared hardware palette.
extern void VideoFreeSharedPalette(SDL_Palette* palette);
extern int ColorCycleAll; /// Flag color cycle palettes
extern int ColorCycleAll; ///< Flag color cycle palettes
/**
** Typedef for palette links.
@ -117,11 +117,11 @@ typedef struct _palette_link_ PaletteLink;
** Links all palettes together to join the same palettes.
*/
struct _palette_link_ {
SDL_Surface* Surface; /// Surface that contains palette
PaletteLink* Next; /// Previous palette
SDL_Surface* Surface; ///< Surface that contains palette
PaletteLink* Next; ///< Previous palette
};
extern PaletteLink* PaletteList; /// List of all used palettes loaded
extern PaletteLink* PaletteList; ///< List of all used palettes loaded
extern void VideoPaletteListAdd(SDL_Surface* surface);
extern void VideoPaletteListRemove(SDL_Surface* surface);
@ -275,9 +275,9 @@ extern unsigned long GetTicks(void);
/// Toggle mouse grab mode
extern void ToggleGrabMouse(int mode);
extern EventCallback* Callbacks; /// Current callbacks
extern EventCallback GameCallbacks; /// Game callbacks
extern EventCallback MenuCallbacks; /// Menu callbacks
extern EventCallback* Callbacks; ///< Current callbacks
extern EventCallback GameCallbacks; ///< Game callbacks
extern EventCallback MenuCallbacks; ///< Menu callbacks
extern Uint32 ColorBlack;
extern Uint32 ColorDarkGreen;
@ -289,12 +289,12 @@ extern Uint32 ColorRed;
extern Uint32 ColorGreen;
extern Uint32 ColorYellow;
extern int ColorWaterCycleStart; /// color # start for color cycling
extern int ColorWaterCycleEnd; /// color # end for color cycling
extern int ColorIconCycleStart; /// color # start for color cycling
extern int ColorIconCycleEnd; /// color # end for color cycling
extern int ColorBuildingCycleStart; /// color # start for color cycling
extern int ColorBuildingCycleEnd; /// color # end for color cycling
extern int ColorWaterCycleStart; ///< color # start for color cycling
extern int ColorWaterCycleEnd; ///< color # end for color cycling
extern int ColorIconCycleStart; ///< color # start for color cycling
extern int ColorIconCycleEnd; ///< color # end for color cycling
extern int ColorBuildingCycleStart; ///< color # start for color cycling
extern int ColorBuildingCycleEnd; ///< color # end for color cycling
#ifndef USE_OPENGL
#define VideoMapRGB(f, r, g, b) SDL_MapRGB((f), (r), (g), (b))

View file

@ -5,12 +5,12 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
// T H E W A R B E G I N S
// Stratagus - A free fantasy real time strategy game engine
// T H E W A R B E G I N S
// Stratagus - A free fantasy real time strategy game engine
//
/**@name wav.h - The wav file format header file. */
//
// (c) Copyright 1998-2001 by Lutz Sammer
// (c) Copyright 1998-2001 by Lutz Sammer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// $Id$
// $Id$
#ifndef __WAV_H__
#define __WAV_H__
@ -34,70 +34,67 @@
//@{
/*----------------------------------------------------------------------------
-- Wav
-- Wav
----------------------------------------------------------------------------*/
//
// Define values for WAV format
// Define values for WAV format
//
#define RIFF 0x46464952 ///< "RIFF" chunk names.
#define WAVE 0x45564157 /// "WAVE" chunk names.
#define FMT 0x20746D66 /// "fmt " chunk names.
#define DATA 0x61746164 /// "data" chunk names.
/*
** Wav types
*/
#define WAV_UNKNOWN 0
#define WAV_PCM_CODE 1
#define WAV_ADPCM 2
#define WAV_ALAW 6
#define WAV_MULAW 7
#define WAV_OKI_ADPCM 16
#define WAV_DIGISTD 21
#define WAV_DIGIFIX 22
#define IBM_MULAW 0x0101
#define IBM_ALAW 0x0102
#define IBM_ADPCM 0x0103
#define WAV_MONO 1
#define WAV_STEREO 2
/**
** chunk names.
** Wav format
*/
#define RIFF 0x46464952 // "RIFF"
#define WAVE 0x45564157 // "WAVE"
#define FMT 0x20746D66 // "fmt "
#define DATA 0x61746164 // "data"
/**
** Wav types
*/
#define WAV_UNKNOWN 0
#define WAV_PCM_CODE 1
#define WAV_ADPCM 2
#define WAV_ALAW 6
#define WAV_MULAW 7
#define WAV_OKI_ADPCM 16
#define WAV_DIGISTD 21
#define WAV_DIGIFIX 22
#define IBM_MULAW 0x0101
#define IBM_ALAW 0x0102
#define IBM_ADPCM 0x0103
#define WAV_MONO 1
#define WAV_STEREO 2
//
// Wav format
//
typedef struct __wav_fmt__ {
unsigned int FMTchunk;
unsigned int FMTlength;
unsigned short Encoding; /// 1 = PCM
unsigned short Channels; /// 1 = mono, 2 = stereo
unsigned int Frequency; /// One of 11025, 22050, or 44100 Hz
unsigned int ByteRate; /// Average bytes per second
unsigned short SampleSize; /// Bytes per sample block
unsigned short BitsPerSample; /// One of 8, 12, 16
unsigned int FMTchunk;
unsigned int FMTlength;
unsigned short Encoding; ///< 1 = PCM
unsigned short Channels; ///< 1 = mono, 2 = stereo
unsigned int Frequency; ///< One of 11025, 22050, or 44100 Hz
unsigned int ByteRate; ///< Average bytes per second
unsigned short SampleSize; ///< Bytes per sample block
unsigned short BitsPerSample; ///< One of 8, 12, 16
} WavFMT;
//
// Wav data
//
/**
** Wav data
*/
typedef struct __wav_data__ {
unsigned int DATAchunk;
unsigned int DATAlength;
unsigned char Data[0]; /// Wave PCM data follows...
unsigned int DATAchunk;
unsigned int DATAlength;
unsigned char Data[0]; ///< Wave PCM data follows...
} WavDATA;
//
// General chunk found in the WAV file
//
/**
** General chunk found in the WAV file
*/
typedef struct __wav_chunk__ {
unsigned int Magic;
unsigned int Length;
unsigned char Data[0];
unsigned int Magic;
unsigned int Length;
unsigned char Data[0];
} WavChunk;
//@}