diff --git a/src/Actor.h b/src/Actor.h index fbc0ef9771..ec6117bdc7 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -133,7 +133,7 @@ public: NUM_CLOCKS }; - /** + /* * @brief What type of Effect this is. * * This is an internal enum for checking if an effect can be run; @@ -181,6 +181,9 @@ public: }; */ + /** + * @brief The present state for the Tween. + */ struct TweenState { void Init(); @@ -220,8 +223,13 @@ public: virtual void BeginDraw(); // pushes transform onto world matrix stack virtual void SetGlobalRenderStates(); // Actor should call this at beginning of their DrawPrimitives() virtual void SetTextureRenderStates(); // Actor should call this after setting a texture - virtual void DrawPrimitives() {}; // Derivatives should override - virtual void EndDraw(); // pops transform from world matrix stack + /** + * @brief Draw the primitives of the Actor. + * + * Derivative classes should override this function. */ + virtual void DrawPrimitives() {}; + /** @brief Pop the transform from the world matrix stack. */ + virtual void EndDraw(); // TODO: make Update non virtual and change all classes to override UpdateInternal // instead. @@ -246,10 +254,22 @@ public: * @brief Retrieve the Actor's parent. * @return the Actor's parent. */ Actor *GetParent() { return m_pParent; } + /** + * @brief Retrieve the Actor's lineage. + * @return the Actor's lineage. */ RString GetLineage() const; + /** + * @brief Retrieve the Actor's x position. + * @return the Actor's x position. */ float GetX() const { return m_current.pos.x; }; + /** + * @brief Retrieve the Actor's y position. + * @return the Actor's y position. */ float GetY() const { return m_current.pos.y; }; + /** + * @brief Retrieve the Actor's z position. + * @return the Actor's z position. */ float GetZ() const { return m_current.pos.z; }; float GetDestX() const { return DestTweenState().pos.x; }; float GetDestY() const { return DestTweenState().pos.y; }; @@ -258,8 +278,17 @@ public: void SetY( float y ) { DestTweenState().pos.y = y; }; void SetZ( float z ) { DestTweenState().pos.z = z; }; void SetXY( float x, float y ) { DestTweenState().pos.x = x; DestTweenState().pos.y = y; }; + /** + * @brief Add to the x position of this Actor. + * @param x the amount to add to the Actor's x position. */ void AddX( float x ) { SetX( GetDestX()+x ); } + /** + * @brief Add to the y position of this Actor. + * @param y the amount to add to the Actor's y position. */ void AddY( float y ) { SetY( GetDestY()+y ); } + /** + * @brief Add to the z position of this Actor. + * @param z the amount to add to the Actor's z position. */ void AddZ( float z ) { SetZ( GetDestZ()+z ); } // height and width vary depending on zoom @@ -284,9 +313,23 @@ public: void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = rot; } virtual void SetBaseAlpha( float fAlpha ) { m_fBaseAlpha = fAlpha; } - float GetZoom() const { return DestTweenState().scale.x; } // not accurate in some cases + /** + * @brief Retrieve the general zoom factor, using the x coordinate of the Actor. + * + * Note that this is not accurate in some cases. + * @return the zoom factor for the x coordinate of the Actor. */ + float GetZoom() const { return DestTweenState().scale.x; } + /** + * @brief Retrieve the zoom factor for the x coordinate of the Actor. + * @return the zoom factor for the x coordinate of the Actor. */ float GetZoomX() const { return DestTweenState().scale.x; } + /** + * @brief Retrieve the zoom factor for the y coordinate of the Actor. + * @return the zoom factor for the y coordinate of the Actor. */ float GetZoomY() const { return DestTweenState().scale.y; } + /** + * @brief Retrieve the zoom factor for the z coordinate of the Actor. + * @return the zoom factor for the z coordinate of the Actor. */ float GetZoomZ() const { return DestTweenState().scale.z; } void SetZoom( float zoom ) { DestTweenState().scale.x = zoom; DestTweenState().scale.y = zoom; DestTweenState().scale.z = zoom; } void SetZoomX( float zoom ) { DestTweenState().scale.x = zoom; } @@ -373,7 +416,12 @@ public: } const TweenState& DestTweenState() const { return const_cast(this)->DestTweenState(); } - enum StretchType { fit_inside, cover }; + /** @brief How do we handle stretching the Actor? */ + enum StretchType + { + fit_inside, /**< Have the Actor fit inside its parent, using the smaller zoom. */ + cover /**, Have the Actor cover its parent, using the larger zoom. */ + }; void ScaleToCover( const RectF &rect ) { ScaleTo( rect, cover ); } void ScaleToFitInside( const RectF &rect ) { ScaleTo( rect, fit_inside); }; @@ -454,6 +502,9 @@ public: // other properties + /** + * @brief Determine if the Actor is visible at this time. + * @return true if it's visible, false otherwise. */ bool GetVisible() const { return m_bVisible; } void SetVisible( bool b ) { m_bVisible = b; } void SetShadowLength( float fLength ) { m_fShadowLengthX = fLength; m_fShadowLengthY = fLength; } @@ -511,9 +562,12 @@ public: HiddenPtr m_pLuaInstance; protected: + /** @brief the name of the Actor. */ RString m_sName; + /** @brief the current parent of this Actor if it exists. */ Actor *m_pParent; + /** @brief Some general information about the Tween. */ struct TweenInfo { // counters for tweening diff --git a/src/ActorFrame.h b/src/ActorFrame.h index cba0ad677d..e5473ea1c8 100644 --- a/src/ActorFrame.h +++ b/src/ActorFrame.h @@ -1,10 +1,9 @@ -/** @brief ActorFrame - A container for other actors. */ - #ifndef ACTORFRAME_H #define ACTORFRAME_H #include "Actor.h" +/** @brief A container for other Actors. */ class ActorFrame : public Actor { public: @@ -17,7 +16,13 @@ public: void LoadFromNode( const XNode* pNode ); virtual ActorFrame *Copy() const; + /** + * @brief Add a new child to the ActorFrame. + * @param pActor the new Actor to add. */ virtual void AddChild( Actor *pActor ); + /** + * @brief Remove the specified child from the ActorFrame. + * @param pActor the Actor to remove. */ virtual void RemoveChild( Actor *pActor ); void TransferChildren( ActorFrame *pTo ); Actor* GetChild( const RString &sName ); @@ -93,6 +98,7 @@ public: protected: void LoadChildrenFromNode( const XNode* pNode ); + /** @brief The children Actors used by the ActorFrame. */ vector m_SubActors; bool m_bPropagateCommands; bool m_bDeleteChildren; @@ -118,7 +124,7 @@ protected: RageColor m_specularColor; RageVector3 m_lightDirection; }; - +/** @brief an ActorFrame that handles deleting children Actors automatically. */ class ActorFrameAutoDeleteChildren : public ActorFrame { public: diff --git a/src/ActorFrameTexture.h b/src/ActorFrameTexture.h index ae9c873c3d..08c068eadd 100644 --- a/src/ActorFrameTexture.h +++ b/src/ActorFrameTexture.h @@ -46,6 +46,7 @@ private: bool m_bAlphaBuffer; bool m_bFloat; bool m_bPreserveTexture; + /** @brief the name of this ActorFrameTexture. */ RString m_sTextureName; }; diff --git a/src/ActorProxy.h b/src/ActorProxy.h index 2416c6e7b5..1da6572d74 100644 --- a/src/ActorProxy.h +++ b/src/ActorProxy.h @@ -4,7 +4,7 @@ #include "Actor.h" struct lua_State; -/** @brief Rendrs another actor. */ +/** @brief Renders another actor. */ class ActorProxy: public Actor { public: diff --git a/src/ActorScroller.h b/src/ActorScroller.h index 030355306f..64c22e2098 100644 --- a/src/ActorScroller.h +++ b/src/ActorScroller.h @@ -1,5 +1,3 @@ -/* ActorScroller - ActorFrame that moves its children. */ - #ifndef ActorScroller_H #define ActorScroller_H @@ -7,7 +5,7 @@ #include "Quad.h" class XNode; #include "LuaExpressionTransform.h" - +/** @brief ActorFrame that moves its children. */ class ActorScroller : public ActorFrame { public: @@ -56,9 +54,21 @@ protected: virtual void ShiftSubActors( int iDist ); int m_iNumItems; - float m_fCurrentItem; // Item at center of list, usually between 0 and m_SubActors.size(), approaches destination + /** + * @brief the current item we are focused on. + * + * An item at the center of the list, usually between 0 and m_SubActors.size(), + * will approach its destination. + * + * The above comment was paraphrased from what was here previously. It could use + * some clearing up. -Wolfman2000 */ + float m_fCurrentItem; float m_fDestinationItem; - float m_fSecondsPerItem; // <= 0 means don't scroll + /** + * @brief How many seconds are there per item? + * + * If this is less than zero, then we are not scrolling. */ + float m_fSecondsPerItem; float m_fSecondsPauseBetweenItems; float m_fNumItemsToDraw; int m_iFirstSubActorIndex; @@ -85,8 +95,10 @@ public: #endif -/* - * (c) 2003-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2003-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ActorSound.h b/src/ActorSound.h index abadb8e041..f2153181e7 100644 --- a/src/ActorSound.h +++ b/src/ActorSound.h @@ -1,11 +1,9 @@ -/* ActorSound - RageSound Actor interface. */ - #ifndef ACTOR_SOUND_H #define ACTOR_SOUND_H #include "Actor.h" #include "RageSound.h" - +/** @brief RageSound Actor interface. */ class ActorSound: public Actor { public: @@ -30,8 +28,10 @@ private: #endif -/* - * (c) 2005 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2005 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/AnnouncerManager.h b/src/AnnouncerManager.h index eaa80b30cf..483e8b4509 100644 --- a/src/AnnouncerManager.h +++ b/src/AnnouncerManager.h @@ -2,17 +2,30 @@ #define ANNOUNCER_MANAGER_H #include "RageTypes.h" - +/** @brief The commentators who say seemlingly random things during gameplay. */ class AnnouncerManager { public: AnnouncerManager(); ~AnnouncerManager(); + /** + * @brief Retrieve the announcer names. + * @param AddTo the list of announcer names. */ void GetAnnouncerNames( vector& AddTo ); + /** + * @brief Determine if the specified announcer exists. + * @param sAnnouncerName the announcer we're checking for. + * @return true if it exists, false otherwise. */ bool DoesAnnouncerExist( RString sAnnouncerName ); + /** + * @brief Switch to a new specified announcer. + * @param sNewAnnouncerName the new announcer the Player will be listening to. */ void SwitchAnnouncer( RString sNewAnnouncerName ); - RString GetCurAnnouncerName() { return m_sCurAnnouncerName; }; + /** + * @brief Retrieve the current announcer's name. + * @param the current announcer's name. */ + RString GetCurAnnouncerName() const { return m_sCurAnnouncerName; }; void NextAnnouncer(); RString GetPathTo( RString sFolderName ); @@ -24,7 +37,7 @@ public: protected: static RString GetAnnouncerDirFromName( RString sAnnouncerName ); RString GetPathTo( RString AnnouncerPath, RString sFolderName ); - + /** @brief the current announcer's name. */ RString m_sCurAnnouncerName; }; @@ -33,8 +46,10 @@ extern AnnouncerManager* ANNOUNCER; // global and accessable from anywhere in ou #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a