Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11876/gemrb/plugins/Core Modified Files: Effect.h EffectMgr.h EffectQueue.h Inventory.h Plugin.h PluginMgr.cpp PluginMgr.h Video.h WorldMapControl.h Log Message: Another batch of doxygen docs updates Index: EffectQueue.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/EffectQueue.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EffectQueue.h 1 Aug 2005 20:52:14 -0000 1.12 --- EffectQueue.h 20 Oct 2005 20:39:14 -0000 1.13 *************** *** 20,23 **** --- 20,30 ---- */ + /** + * @file EffectQueue.h + * Declares EffectQueue class holding and processing all spell effects + * on a single Actor + * @author The GemRB Project + */ + #ifndef EFFECTQUEUE_H #define EFFECTQUEUE_H *************** *** 29,49 **** class Actor; #define MAX_EFFECTS 512 bool Init_EffectQueue(); class GEM_EXPORT EffectQueue { std::vector< Effect* > effects; Actor* Owner; public: EffectQueue(); virtual ~EffectQueue(); void SetOwner(Actor* act) { Owner = act; } Actor* GetOwner() { return Owner; } ! // Returns true is successful. fx is just a reference, AddEffect() ! // will malloc its own copy bool AddEffect(Effect* fx); bool RemoveEffect(Effect* fx); --- 36,73 ---- class Actor; + + /** Maximum number of different Effect opcodes */ #define MAX_EFFECTS 512 + /** Initializes table of available spell Effects used by all the queues */ bool Init_EffectQueue(); + + /** + * @class EffectQueue + * Class holding and processing spell Effects on a single Actor + */ + class GEM_EXPORT EffectQueue { + /** List of Effects applied on the Actor */ std::vector< Effect* > effects; + /** Actor which is target of the Effects */ Actor* Owner; + public: EffectQueue(); virtual ~EffectQueue(); + /** Sets Actor which is affected by these effects */ void SetOwner(Actor* act) { Owner = act; } + /** Returns Actor affected by these effects */ Actor* GetOwner() { return Owner; } ! /** Adds an Effect to the queue, subject to level and other checks. ! * Returns true is successful. fx is just a reference, AddEffect() ! * will malloc its own copy */ bool AddEffect(Effect* fx); + /** Removes first Effect matching fx from the queue. + * Effects are matched based on their contents */ bool RemoveEffect(Effect* fx); *************** *** 60,69 **** Effect *HasOpcodeMatchingCreature(ieDword opcode, Actor *actor); Effect *HasOpcodeWithResource(ieDword opcode, ieResRef resource); void dump(); }; typedef int (* EffectFunction)(Actor*, Actor*, Effect*); ! struct EffectLink { const char* Name; --- 84,96 ---- Effect *HasOpcodeMatchingCreature(ieDword opcode, Actor *actor); Effect *HasOpcodeWithResource(ieDword opcode, ieResRef resource); + + /** Lists contents of the queue on a terminal for debugging */ void dump(); }; + /** Prototype of a function implementing a particular Effect opcode */ typedef int (* EffectFunction)(Actor*, Actor*, Effect*); ! /** Links Effect name to a function implementing the effect */ struct EffectLink { const char* Name; Index: Plugin.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Plugin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Plugin.h 18 Jul 2004 08:33:40 -0000 1.5 --- Plugin.h 20 Oct 2005 20:39:14 -0000 1.6 *************** *** 20,23 **** --- 20,29 ---- */ + /** + * @file Plugin.h + * Declares Plugin class, base class for all plugins + * @author The GemRB Project + */ + #ifndef PLUGIN_H #define PLUGIN_H *************** *** 35,38 **** --- 41,49 ---- #endif + /** + * @class Plugin + * Base class for all GemRB plugins + */ + class GEM_EXPORT Plugin { public: Index: WorldMapControl.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/WorldMapControl.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WorldMapControl.h 19 Oct 2005 21:57:33 -0000 1.8 --- WorldMapControl.h 20 Oct 2005 20:39:14 -0000 1.9 *************** *** 21,25 **** /** ! * @file WorlMapControl.h * Declares WorldMapControl, widget for displaying world map */ --- 21,25 ---- /** ! * @file WorldMapControl.h * Declares WorldMapControl, widget for displaying world map */ Index: Inventory.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Inventory.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Inventory.h 5 Aug 2005 15:46:10 -0000 1.39 --- Inventory.h 20 Oct 2005 20:39:14 -0000 1.40 *************** *** 20,24 **** */ ! /* Class implementing creatures' and containers' inventory and item management */ #ifndef INVENTORY_H --- 20,29 ---- */ ! /** ! * @file Inventory.h ! * Declares Inventory, class implementing creatures' and containers' ! * inventory and item management ! * @author The GemRB Project ! */ #ifndef INVENTORY_H *************** *** 65,68 **** --- 70,74 ---- #define IW_QUIVER -22 // (-22, -23, -24) + /** Inventory types */ typedef enum ieInventoryType { INVENTORY_HEAP = 0, *************** *** 103,106 **** --- 109,119 ---- } ieCREItemFlagBits; + /** + * @class CREItem + * Class holding Item instance specific values and providing link between + * an Inventory and a stack of Items. + * It's keeping info on whether Item was identified, for example. + */ + class GEM_EXPORT CREItem { public: *************** *** 110,114 **** --- 123,129 ---- ieDword Flags; // 2 cached values from associated item. LEAVE IT SIGNED! + /** Weight of items in the stack */ int Weight; + /** Amount of items in this stack */ int StackAmount; *************** *** 120,123 **** --- 135,143 ---- }; + /** + * @class Inventory + * Class implementing creatures' and containers' inventory and item management + */ + class GEM_EXPORT Inventory { private: *************** *** 126,129 **** --- 146,150 ---- int InventoryType; int Changed; + /** Total weight of all items in Inventory */ int Weight; *************** *** 134,148 **** virtual ~Inventory(); ! /** removes an item from the inventory, destroys slot ! use it only for containers */ CREItem *GetItem(size_t idx); /** adds an item to the inventory */ void AddItem(CREItem *item); ! /** returns the count items in the inventory */ int CountItems(const char *resref, bool charges); /** looks for a particular item in a slot */ bool HasItemInSlot(const char *resref, int slot); ! /** looks for a particular item in the inventory */ ! /** flags: see ieCREItemFlagBits */ bool HasItem(const char *resref, ieDword flags); --- 155,169 ---- virtual ~Inventory(); ! /** Removes an item from the inventory, destroys slot. ! * Use it for containers only */ CREItem *GetItem(size_t idx); /** adds an item to the inventory */ void AddItem(CREItem *item); ! /** Returns number of items in the inventory */ int CountItems(const char *resref, bool charges); /** looks for a particular item in a slot */ bool HasItemInSlot(const char *resref, int slot); ! /** Looks for a particular item in the inventory. */ ! /* flags: see ieCREItemFlagBits */ bool HasItem(const char *resref, ieDword flags); *************** *** 158,163 **** ! /** returns CREItem in specified slot. if count !=0 it ! ** splits the item and returns only requested amount*/ CREItem* RemoveItem(unsigned int slot, unsigned int count = 0); /** returns slot of removed item, you can delete the removed item */ --- 179,184 ---- ! /** Returns CREItem in specified slot. ! * If count !=0 it splits the item and returns only requested amount */ CREItem* RemoveItem(unsigned int slot, unsigned int count = 0); /** returns slot of removed item, you can delete the removed item */ *************** *** 182,186 **** bool ItemsAreCompatible(CREItem* target, CREItem* source); ! /*finds the first slot of named item, if resref is empty, finds the first filled! slot*/ int FindItem(const char *resref, unsigned int flags); void DropItemAtLocation(unsigned int slot, unsigned int flags, Map *map, Point &loc); --- 203,207 ---- bool ItemsAreCompatible(CREItem* target, CREItem* source); ! /** Finds the first slot of named item, if resref is empty, finds the first filled! slot */ int FindItem(const char *resref, unsigned int flags); void DropItemAtLocation(unsigned int slot, unsigned int flags, Map *map, Point &loc); *************** *** 191,204 **** //void AddAllEffects(); void RemoveSlotEffects( CREItem* slot ); ! // Returns item in specified slot. Does NOT change inventory CREItem* GetSlotItem(unsigned int slot); bool EquipItem(unsigned int slot); bool UnEquipItem(unsigned int slot, bool removecurse); ! // Returns equipped weapon CREItem *GetUsedWeapon(); ! // Returns a slot which might be empty, or capable of holding item (or part of it) int FindCandidateSlot(int slottype, size_t first_slot, const char *resref = NULL); void dump(); private: int FindRanged(); --- 212,227 ---- //void AddAllEffects(); void RemoveSlotEffects( CREItem* slot ); ! /** Returns item in specified slot. Does NOT change inventory */ CREItem* GetSlotItem(unsigned int slot); bool EquipItem(unsigned int slot); bool UnEquipItem(unsigned int slot, bool removecurse); ! /** Returns equipped weapon */ CREItem *GetUsedWeapon(); ! /** Returns a slot which might be empty, or capable of holding item (or part of it) */ int FindCandidateSlot(int slottype, size_t first_slot, const char *resref = NULL); + /** Lists all items in the Invenory on terminal for debugging */ void dump(); + private: int FindRanged(); Index: Effect.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Effect.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Effect.h 1 Aug 2005 20:52:13 -0000 1.7 --- Effect.h 20 Oct 2005 20:39:14 -0000 1.8 *************** *** 20,23 **** --- 20,29 ---- */ + /** + * @file Effect.h + * Declares Effect class implementing spell and spell-like effects + * and related defines + */ + #ifndef EFFECT_H #define EFFECT_H *************** *** 56,59 **** --- 62,70 ---- #define FX_CAN_DISPEL 1 + /** + * @class Effect + * Structure holding information about single spell or spell-like effect. + */ + // the same as ITMFeature and SPLFeature typedef struct Effect { Index: PluginMgr.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/PluginMgr.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PluginMgr.h 14 May 2005 11:18:08 -0000 1.5 --- PluginMgr.h 20 Oct 2005 20:39:14 -0000 1.6 *************** *** 20,23 **** --- 20,29 ---- */ + /** + * @file PluginMgr.h + * Declares PluginMgr, loader for GemRB plugins + * @author The GemRB Project + */ + #ifndef PLUGINMGR_H #define PLUGINMGR_H *************** *** 45,48 **** --- 51,61 ---- #endif + /** + * @class PluginMgr + * Class for loading GemRB plugins from shared libraries or DLLs. + * It goes over all appropriately named files in PluginPath directory + * and tries to load them one after another. + */ + class GEM_EXPORT PluginMgr { public: Index: Video.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Video.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Video.h 18 Oct 2005 22:43:41 -0000 1.45 --- Video.h 20 Oct 2005 20:39:14 -0000 1.46 *************** *** 20,23 **** --- 20,29 ---- */ + /** + * @file Video.h + * Declares Video, base class for video output plugins. + * @author The GemRB Project + */ + #ifndef VIDEO_H #define VIDEO_H *************** *** 41,44 **** --- 47,55 ---- #endif + /** + * @class Video + * Base class for video output plugins. + */ + class GEM_EXPORT Video : public Plugin { public: *************** *** 47,55 **** --- 58,70 ---- virtual int Init(void) = 0; virtual int CreateDisplay(int width, int height, int bpp, bool fullscreen) = 0; + /** Sets window title of GemRB window */ virtual void SetDisplayTitle(char* title, char* icon) = 0; virtual VideoModes GetVideoModes(bool fullscreen = false) = 0; virtual bool TestVideoMode(VideoMode& vm) = 0; + /** Toggles GemRB between fullscreen and windowed mode */ virtual bool ToggleFullscreenMode() = 0; + /** Swaps displayed and back buffers */ virtual int SwapBuffers(void) = 0; + /** Grabs and releases mouse cursor within GemRB window */ virtual bool ToggleGrabInput() = 0; virtual Sprite2D* CreateSprite(int w, int h, int bpp, ieDword rMask, *************** *** 68,72 **** --- 83,90 ---- Color *palette = NULL, Region* clip = NULL) = 0; virtual void SetCursor(Sprite2D* up, Sprite2D* down) = 0; + /** Sets a temporary cursor when dragging an Item from Inventory */ virtual void SetDragCursor(Sprite2D* drag) = 0; + /** Return GemRB window screenshot. + * It's generated from the momentary back buffer */ virtual Sprite2D* GetPreview(int w, int h) = 0; virtual Region GetViewport(void) = 0; *************** *** 80,91 **** virtual void DrawRect(Region& rgn, Color& color, bool fill = true, bool clipped = false) = 0; virtual void DrawRectSprite(Region& rgn, Color& color, Sprite2D* sprite) = 0; ! /** This functions Draws a Circle */ virtual void DrawCircle(short cx, short cy, unsigned short r, Color& color) = 0; ! /** This functions Draws an Ellipse */ virtual void DrawEllipse(short cx, short cy, unsigned short xr, unsigned short yr, Color& color, bool clipped = true) = 0; ! /** This function Draws a Polygon on the Screen */ virtual void DrawPolyline(Gem_Polygon* poly, Color& color, bool fill = false) = 0; virtual void DrawLine(short x1, short y1, short x2, short y2, Color& color) = 0; --- 98,110 ---- virtual void DrawRect(Region& rgn, Color& color, bool fill = true, bool clipped = false) = 0; virtual void DrawRectSprite(Region& rgn, Color& color, Sprite2D* sprite) = 0; ! /** Draws a circle */ virtual void DrawCircle(short cx, short cy, unsigned short r, Color& color) = 0; ! /** Draws an ellipse */ virtual void DrawEllipse(short cx, short cy, unsigned short xr, unsigned short yr, Color& color, bool clipped = true) = 0; ! /** Draws a polygon on the screen */ virtual void DrawPolyline(Gem_Polygon* poly, Color& color, bool fill = false) = 0; + /** Draws a line segment */ virtual void DrawLine(short x1, short y1, short x2, short y2, Color& color) = 0; *************** *** 127,130 **** --- 146,152 ---- public: virtual void* GetVideoSurface() = 0; + /** Returns true if a pixel on a given position in the sprite + * is transparent. + * It is used to mask clicks to non-rectangular shaped controls */ virtual bool IsSpritePixelTransparent(Sprite2D* sprite, unsigned short x, unsigned short y) = 0; }; Index: PluginMgr.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/PluginMgr.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PluginMgr.cpp 22 Aug 2005 10:02:33 -0000 1.19 --- PluginMgr.cpp 20 Oct 2005 20:39:14 -0000 1.20 *************** *** 78,82 **** printf( "%s\n", path ); if (( hFile = ( long ) _findfirst( path, &c_file ) ) == -1L) //If there is no file matching our search ! #else { printMessage( "PluginMgr", "Searching for plugins in: ", WHITE ); --- 78,82 ---- printf( "%s\n", path ); if (( hFile = ( long ) _findfirst( path, &c_file ) ) == -1L) //If there is no file matching our search ! #else { printMessage( "PluginMgr", "Searching for plugins in: ", WHITE ); *************** *** 85,89 **** DIR* dir = opendir( path ); if (dir == NULL) //If we cannot open the Directory ! #endif { return; --- 85,89 ---- DIR* dir = opendir( path ); if (dir == NULL) //If we cannot open the Directory ! #endif { return; *************** *** 125,130 **** if (fnmatch( "*.so", de->d_name, 0 ) != 0) //If the current file has no ".so" extension, skip it continue; ! strcpy( path, pluginpath ); ! strcat( path, de->d_name ); printBracket( "PluginMgr", LIGHT_WHITE ); printf( ": Loading: " ); --- 125,129 ---- if (fnmatch( "*.so", de->d_name, 0 ) != 0) //If the current file has no ".so" extension, skip it continue; ! PathJoin( path, pluginpath, de->d_name, NULL ); printBracket( "PluginMgr", LIGHT_WHITE ); printf( ": Loading: " ); Index: EffectMgr.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/EffectMgr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EffectMgr.h 12 Jul 2005 18:11:16 -0000 1.2 --- EffectMgr.h 20 Oct 2005 20:39:14 -0000 1.3 *************** *** 20,23 **** --- 20,30 ---- */ + /** + * @file EffectMgr.h + * Declares EffectMgr class, loader for Effect objects + * @author The GemRB Project + */ + + #ifndef EFFECTMGR_H #define EFFECTMGR_H *************** *** 39,42 **** --- 46,54 ---- #endif + /** + * @class EffectMgr + * Abstract loader for Effect objects + */ + class GEM_EXPORT EffectMgr : public Plugin { public: *************** *** 44,49 **** --- 56,65 ---- virtual ~EffectMgr(void); virtual bool Open(DataStream* stream, bool autoFree = true) = 0; + + /** Fills fx with Effect data loaded from the stream */ virtual Effect* GetEffect(Effect *fx) = 0; + /** Fills fx with Effect v1 data loaded from the stream*/ virtual Effect* GetEffectV1(Effect *fx) = 0; + /** Fills fx with Effect v2.0 data loaded from the stream*/ virtual Effect* GetEffectV20(Effect *fx) = 0; }; |