diff --git a/src/BackgroundUtil.h b/src/BackgroundUtil.h index 855b13f349..be93fa640e 100644 --- a/src/BackgroundUtil.h +++ b/src/BackgroundUtil.h @@ -1,5 +1,3 @@ -/* BackgroundUtil - Shared background-related routines. */ - #ifndef BackgroundUtil_H #define BackgroundUtil_H @@ -61,7 +59,7 @@ struct BackgroundChange RString GetTextDescription() const; }; - +/** @brief Shared background-related routines. */ namespace BackgroundUtil { void SortBackgroundChangesArray( vector &vBackgroundChanges ); diff --git a/src/EnumHelper.h b/src/EnumHelper.h index fc32a8589a..5c8b222523 100644 --- a/src/EnumHelper.h +++ b/src/EnumHelper.h @@ -27,7 +27,7 @@ struct EnumTraits }; template LuaReference EnumTraits::StringToEnum; template LuaReference EnumTraits::EnumToString; - +/** @brief Lua helpers for Enumerators. */ namespace Enum { template diff --git a/src/FontCharmaps.h b/src/FontCharmaps.h index da8cdbee85..28307dc2a8 100644 --- a/src/FontCharmaps.h +++ b/src/FontCharmaps.h @@ -1,7 +1,6 @@ -/* FontCharmaps - Defines common frame to character mappings for Fonts. */ #ifndef FONT_CHARMAPS_H #define FONT_CHARMAPS_H - +/** @brief Defines common frame to character mappings for Fonts. */ namespace FontCharmaps { extern const wchar_t M_SKIP; diff --git a/src/GameLoop.h b/src/GameLoop.h index d35374d9f2..365e74daf8 100644 --- a/src/GameLoop.h +++ b/src/GameLoop.h @@ -1,8 +1,6 @@ -/* GameLoop - Main rendering and update loop. */ - #ifndef GAME_LOOP_H #define GAME_LOOP_H - +/** @brief Main rendering and update loop. */ namespace GameLoop { void RunGameLoop(); diff --git a/src/GamePreferences.h b/src/GamePreferences.h index dc9ee840e1..28ff545170 100644 --- a/src/GamePreferences.h +++ b/src/GamePreferences.h @@ -3,7 +3,7 @@ #include "Preference.h" #include "GameConstantsAndTypes.h" - +/** @brief Quick access to other variables. */ namespace GamePreferences { extern Preference m_CoinMode; diff --git a/src/JsonUtil.h b/src/JsonUtil.h index 26ab10e6f4..c676af1ebc 100644 --- a/src/JsonUtil.h +++ b/src/JsonUtil.h @@ -1,11 +1,9 @@ -/* JsonUtil - Utilities for handling JSON data. */ - #ifndef JsonUtil_H #define JsonUtil_H class RageFileBasic; #include "jsoncpp/include/json/value.h" - +/** @brief Utilities for handling JSON data. */ namespace JsonUtil { bool LoadFromString( Json::Value &root, RString sData, RString &sErrorOut ); diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 32cef86941..b39217f3f7 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -33,6 +33,7 @@ static Impl *pImpl = NULL; #pragma warning (disable : 4611) #endif +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const bool &Object ); @@ -70,6 +71,7 @@ void LuaManager::UnsetGlobal( const RString &sName ) Release( L ); } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const bool &Object ) { lua_pushboolean( L, Object ); } diff --git a/src/LuaManager.h b/src/LuaManager.h index ef6bd4454d..08beb9aa0d 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -47,6 +47,7 @@ private: extern LuaManager *LUA; +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { /* Load the given script with the given name. On success, the resulting diff --git a/src/LuaReference.cpp b/src/LuaReference.cpp index 1d819ffe0f..ec036d2911 100644 --- a/src/LuaReference.cpp +++ b/src/LuaReference.cpp @@ -158,6 +158,7 @@ RString LuaReference::Serialize() const return sRet; } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> bool FromStack( lua_State *L, LuaReference &Object, int iOffset ) @@ -200,6 +201,7 @@ void LuaTable::Get( Lua *L, const RString &sKey ) lua_remove( L, -2 ); // remove self } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const LuaReference &Object ) diff --git a/src/MessageManager.h b/src/MessageManager.h index 3d424ce3aa..256dbf41fc 100644 --- a/src/MessageManager.h +++ b/src/MessageManager.h @@ -207,7 +207,14 @@ public: bool operator != ( const T &other ) const { return val != other; } }; -namespace LuaHelpers { template void Push( lua_State *L, const BroadcastOnChange &Object ) { LuaHelpers::Push( L, Object.Get() ); } } +/** @brief Utilities for working with Lua. */ +namespace LuaHelpers +{ + template void Push( lua_State *L, const BroadcastOnChange &Object ) + { + LuaHelpers::Push( L, Object.Get() ); + } +} template class BroadcastOnChange1D diff --git a/src/NotesLoaderBMS.h b/src/NotesLoaderBMS.h index bcce260b1b..74c51d9d9c 100644 --- a/src/NotesLoaderBMS.h +++ b/src/NotesLoaderBMS.h @@ -1,10 +1,8 @@ -/* BMSLoader - reads a Song from a set of .BMS files. */ - #ifndef NOTES_LOADER_BMS_H #define NOTES_LOADER_BMS_H class Song; - +/** @brief Reads a Song from a set of .BMS files. */ namespace BMSLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderKSF.h b/src/NotesLoaderKSF.h index fcc53682de..e6bfbdd193 100644 --- a/src/NotesLoaderKSF.h +++ b/src/NotesLoaderKSF.h @@ -1,10 +1,8 @@ -/* KSFLoader - Reads a Song from a set of .KSF files. */ - #ifndef NOTES_LOADER_KSF_H #define NOTES_LOADER_KSF_H class Song; - +/** @brief Reads a Song from a set of .KSF files. */ namespace KSFLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 2153d177f9..96f5375e1e 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -562,7 +562,10 @@ bool MidiFileIn :: readVariableLength( unsigned long *value ) return true; } - +/** + * @brief Utilities for working with the Guitar mode. + * + * Is this going to be kept in sm-ssc? */ namespace Guitar { enum GuitarDifficulty { easy, medium, hard, expert, NUM_GuitarDifficulty }; diff --git a/src/NotesLoaderMidi.h b/src/NotesLoaderMidi.h index 09ef41a700..4b496a122b 100644 --- a/src/NotesLoaderMidi.h +++ b/src/NotesLoaderMidi.h @@ -1,10 +1,8 @@ -/* MidiLoader - Reads a Song from a .mid file. */ - #ifndef NotesLoaderMidi_H #define NotesLoaderMidi_H class Song; - +/** @brief Reads a Song from a .mid file. */ namespace MidiLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index f8a7e78352..4864c74411 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -1,5 +1,3 @@ -/* SMLoader - Reads a Song from an .SM file. */ - #ifndef NotesLoaderSM_H #define NotesLoaderSM_H @@ -9,7 +7,7 @@ class MsdFile; class Song; class Steps; class TimingData; - +/** @brief Reads a Song from an .SM file. */ namespace SMLoader { void LoadFromSMTokens( RString sStepsType, RString sDescription, RString sDifficulty, @@ -29,8 +27,10 @@ namespace SMLoader #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Preference.h b/src/Preference.h index 317936fe20..4fdcdc1346 100644 --- a/src/Preference.h +++ b/src/Preference.h @@ -121,6 +121,7 @@ private: void (*m_pfnValidate)(T& val); }; +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template void Push( lua_State *L, const Preference &Object ) { LuaHelpers::Push( L, Object.Get() ); } } template diff --git a/src/RageDisplay_OGL_Helpers.h b/src/RageDisplay_OGL_Helpers.h index 5f232e2b74..3a59abe38e 100644 --- a/src/RageDisplay_OGL_Helpers.h +++ b/src/RageDisplay_OGL_Helpers.h @@ -30,6 +30,7 @@ /* Not in glext.h: */ typedef bool (APIENTRY * PWSWAPINTERVALEXTPROC) (int interval); +/** @brief Utilities for working with the RageDisplay. */ namespace RageDisplay_OGL_Helpers { void Init(); diff --git a/src/RageException.h b/src/RageException.h index db97dae7d3..0d87af61c4 100644 --- a/src/RageException.h +++ b/src/RageException.h @@ -1,8 +1,9 @@ -/* RageException - Class for throwing fatal errors. */ - #ifndef RAGE_EXCEPTION_H #define RAGE_EXCEPTION_H - +/** + * @brief Namespace for throwing fatal errors. + * + * The original documentation stated this was a class for some reason. */ namespace RageException { void NORETURN Throw( const char *fmt, ... ) PRINTF(1,2); diff --git a/src/RageFile.cpp b/src/RageFile.cpp index 471e39c34e..89133252e8 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -424,7 +424,7 @@ public: }; LUA_REGISTER_CLASS( RageFile ) - +/** @brief Utilities for working with RageFiles. */ namespace RageFileUtil { int CreateRageFile( lua_State *L ) diff --git a/src/RageFile.h b/src/RageFile.h index 013b59eb6c..700f4de36f 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -83,7 +83,7 @@ private: int m_Mode; }; -/* Convenience wrappers for reading binary files. */ +/** @brief Convenience wrappers for reading binary files. */ namespace FileReading { /* On error, these set sError to the error message. If sError is already diff --git a/src/RageFileManager.h b/src/RageFileManager.h index 2013864719..a8ad652585 100644 --- a/src/RageFileManager.h +++ b/src/RageFileManager.h @@ -1,8 +1,6 @@ -/* RageFileManager - File utilities and high-level manager for RageFile objects. */ - #ifndef RAGE_FILE_MANAGER_H #define RAGE_FILE_MANAGER_H - +/** @brief Constants for working with the RageFileManager. */ namespace RageFileManagerUtil { extern RString sInitialWorkingDirectory; @@ -12,7 +10,7 @@ namespace RageFileManagerUtil class RageFileDriver; class RageFileBasic; struct lua_State; - +/** @brief File utilities and high-level manager for RageFile objects. */ class RageFileManager { public: diff --git a/src/RageFileManager_ReadAhead.h b/src/RageFileManager_ReadAhead.h index a5091ca089..7e42687cc5 100644 --- a/src/RageFileManager_ReadAhead.h +++ b/src/RageFileManager_ReadAhead.h @@ -2,7 +2,7 @@ #define RAGE_FILE_MANAGER_READAHEAD_H #include "RageFileBasic.h" - +/** @brief Utilities for reading the RageFiles. */ namespace RageFileManagerReadAhead { void Init(); diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index fc0e7ae428..4084641bde 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -396,7 +396,7 @@ int PolyphaseFilter::NumInputsForOutputSamples( const State &State, int iOut, in return iIn; } - +/** @brief Utilities for working with the PolyphaseFilter cache. */ namespace PolyphaseFilterCache { /* Cache filter data, and reuse it without copying. All operations after creation diff --git a/src/RageSoundUtil.h b/src/RageSoundUtil.h index 99153f87eb..d87ad11249 100644 --- a/src/RageSoundUtil.h +++ b/src/RageSoundUtil.h @@ -1,8 +1,6 @@ -/* RageSoundUtil - simple utilities that operate on sound buffers. */ - #ifndef RAGE_SOUND_UTIL_H #define RAGE_SOUND_UTIL_H - +/** @brief Simple utilities that operate on sound buffers. */ namespace RageSoundUtil { void Attenuate( float *pBuf, int iSamples, float fVolume ); diff --git a/src/RageSurfaceUtils.h b/src/RageSurfaceUtils.h index 1ed132c69b..8492be00dc 100644 --- a/src/RageSurfaceUtils.h +++ b/src/RageSurfaceUtils.h @@ -8,6 +8,7 @@ struct RageSurfacePalette; struct RageSurfaceFormat; struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { uint32_t decodepixel( const uint8_t *p, int bpp ); diff --git a/src/RageSurfaceUtils_Dither.h b/src/RageSurfaceUtils_Dither.h index c72a5cdd29..62a67437d8 100644 --- a/src/RageSurfaceUtils_Dither.h +++ b/src/RageSurfaceUtils_Dither.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_UTILS_DITHER_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void OrderedDither(const RageSurface *src, RageSurface *dst); diff --git a/src/RageSurfaceUtils_Palettize.h b/src/RageSurfaceUtils_Palettize.h index 8ea56b1cf8..9a5a86b7d5 100644 --- a/src/RageSurfaceUtils_Palettize.h +++ b/src/RageSurfaceUtils_Palettize.h @@ -4,6 +4,7 @@ #define RAGE_SURFACE_UTILS_PALETTIZE struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void Palettize( RageSurface *&pImg, int iColors=256, bool bDither=true ); diff --git a/src/RageSurfaceUtils_Zoom.h b/src/RageSurfaceUtils_Zoom.h index f5378e59cd..01b56fc1f7 100644 --- a/src/RageSurfaceUtils_Zoom.h +++ b/src/RageSurfaceUtils_Zoom.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_UTILS_ZOOM_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void Zoom( RageSurface *&src, int width, int height ); diff --git a/src/RageSurface_Load.h b/src/RageSurface_Load.h index 9935695566..04765fccf7 100644 --- a/src/RageSurface_Load.h +++ b/src/RageSurface_Load.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_LOAD_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { enum OpenResult diff --git a/src/RageSurface_Save_BMP.h b/src/RageSurface_Save_BMP.h index eb928a1eb8..ed5cb58c32 100644 --- a/src/RageSurface_Save_BMP.h +++ b/src/RageSurface_Save_BMP.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SaveBMP( RageSurface *surface, RageFile &f ); diff --git a/src/RageSurface_Save_JPEG.cpp b/src/RageSurface_Save_JPEG.cpp index 4587ec3c3d..ef1ca8faf2 100644 --- a/src/RageSurface_Save_JPEG.cpp +++ b/src/RageSurface_Save_JPEG.cpp @@ -7,6 +7,7 @@ #include "RageFile.h" #undef FAR /* fix for VC */ +/** @brief A helper to get the jpeg lib. */ namespace jpeg { extern "C" diff --git a/src/RageSurface_Save_JPEG.h b/src/RageSurface_Save_JPEG.h index ebde4ab2f8..b41fbae9ff 100644 --- a/src/RageSurface_Save_JPEG.h +++ b/src/RageSurface_Save_JPEG.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SaveJPEG( RageSurface *surface, RageFile &f, bool bHighQual=true ); diff --git a/src/RageSurface_Save_PNG.h b/src/RageSurface_Save_PNG.h index 2d7ba4c355..67ae9f74a9 100644 --- a/src/RageSurface_Save_PNG.h +++ b/src/RageSurface_Save_PNG.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SavePNG( RageSurface *pImg, RageFile &f, RString &sError ); diff --git a/src/RageTypes.cpp b/src/RageTypes.cpp index 2b87f0d499..977c17f2ec 100644 --- a/src/RageTypes.cpp +++ b/src/RageTypes.cpp @@ -73,7 +73,7 @@ RString RageColor::NormalizeColorString( RString sColor ) return ""; return c.ToString(); } - +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> bool FromStack( lua_State *L, RageColor &Object, int iOffset ) diff --git a/src/RageUtil.h b/src/RageUtil.h index eb489e50ca..ac9c68f377 100644 --- a/src/RageUtil.h +++ b/src/RageUtil.h @@ -615,6 +615,7 @@ int GetFileSizeInBytes( const RString &sFilePath ); void FixSlashesInPlace( RString &sPath ); void CollapsePath( RString &sPath, bool bRemoveLeadingDot=false ); +/** @brief Utilities for converting the RStrings. */ namespace StringConversion { template diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index 71215d9e9d..a7b1e94180 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -1,5 +1,3 @@ -/* CachedObject - cached object pointers with automatic invalidation. */ - #ifndef RAGE_UTIL_CACHED_OBJECT_H #define RAGE_UTIL_CACHED_OBJECT_H @@ -7,13 +5,15 @@ template class CachedObjectPointer; - +/** @brief Utilities for working with the + CachedObjects. */ namespace CachedObjectHelpers { void Lock(); void Unlock(); } +/** @brief Cached object pointers with automatic invalidation. */ template class CachedObject { diff --git a/src/ScreenManager.cpp b/src/ScreenManager.cpp index b10963b20f..701b27d574 100644 --- a/src/ScreenManager.cpp +++ b/src/ScreenManager.cpp @@ -81,6 +81,7 @@ static Preference g_bPruneFonts( "PruneFonts", true ); // Screen registration static map *g_pmapRegistrees = NULL; +/** @brief Utility functions for the ScreenManager. */ namespace ScreenManagerUtil { // in draw order first to last diff --git a/src/ScreenMessage.h b/src/ScreenMessage.h index de01907747..5124cd52a0 100644 --- a/src/ScreenMessage.h +++ b/src/ScreenMessage.h @@ -17,14 +17,14 @@ extern const ScreenMessage SM_LoseFocus; extern const ScreenMessage SM_Pause; extern const ScreenMessage SM_Success; extern const ScreenMessage SM_Failure; - +/** @brief Helpers for the ScreenMessages. */ namespace ScreenMessageHelpers { ScreenMessage ToScreenMessage( const RString & Name ); RString ScreenMessageToString( ScreenMessage SM ); }; -// Automatically generate a unique ScreenMessage value +/** @brief Automatically generate a unique ScreenMessage value */ #define AutoScreenMessage( x ) \ const ScreenMessage x = ScreenMessageHelpers::ToScreenMessage( #x ) diff --git a/src/StdString.h b/src/StdString.h index f92cd07a65..cb13bbb796 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -1,5 +1,3 @@ -/** @brief StdString - std::string convenience wrapper. */ - // ============================================================================= // FILE: StdString.h // AUTHOR: Joe O'Leary (with outside help noted in comments) @@ -122,29 +120,29 @@ void MakeLower( char *p, size_t iLen ); void MakeUpper( wchar_t *p, size_t iLen ); void MakeLower( wchar_t *p, size_t iLen ); -// ============================================================================= -// INLINE FUNCTIONS ON WHICH CSTDSTRING RELIES -// -// Usually for generic text mapping, we rely on preprocessor macro definitions -// to map to string functions. However the CStdStr<> template cannot use -// macro-based generic text mappings because its character types do not get -// resolved until template processing which comes AFTER macro processing. In -// other words, UNICODE is of little help to us in the CStdStr template -// -// Therefore, to keep the CStdStr declaration simple, we have these inline -// functions. The template calls them often. Since they are inline (and NOT -// exported when this is built as a DLL), they will probably be resolved away -// to nothing. -// -// Without these functions, the CStdStr<> template would probably have to broken -// out into two, almost identical classes. Either that or it would be a huge, -// convoluted mess, with tons of "if" statements all over the place checking the -// size of template parameter CT. -// -// In several cases, you will see two versions of each function. One version is -// the more portable, standard way of doing things, while the other is the -// non-standard, but often significantly faster Visual C++ way. -// ============================================================================= +/** + * @brief Inline functions on which CStdString relies on. + * + * Usually for generic text mapping, we rely on preprocessor macro definitions + * to map to string functions. However the CStdStr<> template cannot use + * macro-based generic text mappings because its character types do not get + * resolved until template processing which comes AFTER macro processing. In + * other words, UNICODE is of little help to us in the CStdStr template. + * + * Therefore, to keep the CStdStr declaration simple, we have these inline + * functions. The template calls them often. Since they are inline (and NOT + * exported when this is built as a DLL), they will probably be resolved away + * to nothing. + * + * Without these functions, the CStdStr<> template would probably have to broken + * out into two, almost identical classes. Either that or it would be a huge, + * convoluted mess, with tons of "if" statements all over the place checking the + * size of template parameter CT. + * + * In several cases, you will see two versions of each function. One version is + * the more portable, standard way of doing things, while the other is the + * non-standard, but often significantly faster Visual C++ way. + */ namespace StdString { // ----------------------------------------------------------------------------- diff --git a/src/StepMania.h b/src/StepMania.h index 04aa4754bc..d5e66b1890 100644 --- a/src/StepMania.h +++ b/src/StepMania.h @@ -7,6 +7,7 @@ class VideoModeParams; int main( int argc, char* argv[] ); +/** @brief Utility functions for controlling the whole game. */ namespace StepMania { void ApplyGraphicOptions(); diff --git a/src/Trail.h b/src/Trail.h index 2e53965319..f0f9fb040f 100644 --- a/src/Trail.h +++ b/src/Trail.h @@ -10,7 +10,8 @@ class Song; class Steps; struct lua_State; -/** @brief One such Song and Step in the entire Trail. */ +/** @brief One such Song and + * Step in the entire Trail. */ struct TrailEntry { TrailEntry(): @@ -24,9 +25,13 @@ struct TrailEntry } void GetAttackArray( AttackArray &out ) const; + /** @brief The Song involved in the entry. */ Song* pSong; + /** @brief The Step involved in the entry. */ Steps* pSteps; + /** @brief The Modifiers applied for the whole Song. */ RString Modifiers; + /** @brief The Attacks that will take place durring the Song. */ AttackArray Attacks; /** * @brief Is this Song and its Step meant to be a secret?