diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-10-17 21:55:45 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-10-17 21:55:45 +0200 |
commit | f6e27099b294d55c15a6b5dad13cda7730a17a71 (patch) | |
tree | 2ce292b3fc476767bc4cd0040cea0fb83242146e /src/common | |
parent | 9738631e5e49f6b8edc32b9128e0c5d52f7df44f (diff) | |
download | colobot-f6e27099b294d55c15a6b5dad13cda7730a17a71.tar.gz colobot-f6e27099b294d55c15a6b5dad13cda7730a17a71.tar.bz2 colobot-f6e27099b294d55c15a6b5dad13cda7730a17a71.zip |
Doxygen/comment fixes and some #include refactoring
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/error_ids.h | 1 | ||||
-rw-r--r-- | src/common/event.cpp | 1 | ||||
-rw-r--r-- | src/common/event.h | 1 | ||||
-rw-r--r-- | src/common/event_ids.h | 1 | ||||
-rw-r--r-- | src/common/global.h | 3 | ||||
-rw-r--r-- | src/common/image.cpp | 3 | ||||
-rw-r--r-- | src/common/image.h | 2 | ||||
-rw-r--r-- | src/common/iman.cpp | 1 | ||||
-rw-r--r-- | src/common/iman.h | 6 | ||||
-rw-r--r-- | src/common/ioutils.h | 2 | ||||
-rw-r--r-- | src/common/key.h | 5 | ||||
-rw-r--r-- | src/common/logger.cpp | 3 | ||||
-rw-r--r-- | src/common/logger.h | 30 | ||||
-rw-r--r-- | src/common/misc.cpp | 2 | ||||
-rw-r--r-- | src/common/misc.h | 15 | ||||
-rw-r--r-- | src/common/profile.cpp | 3 | ||||
-rw-r--r-- | src/common/profile.h | 63 | ||||
-rw-r--r-- | src/common/restext.cpp | 5 | ||||
-rw-r--r-- | src/common/restext.h | 1 | ||||
-rw-r--r-- | src/common/restext_strings.c | 11 | ||||
-rw-r--r-- | src/common/singleton.h | 1 | ||||
-rw-r--r-- | src/common/stringutils.cpp | 3 |
22 files changed, 80 insertions, 83 deletions
diff --git a/src/common/error_ids.h b/src/common/error_ids.h index fc1f7d6..fd7d4e0 100644 --- a/src/common/error_ids.h +++ b/src/common/error_ids.h @@ -19,6 +19,7 @@ #pragma once + enum Error { ERR_OK = 0, // ok diff --git a/src/common/event.cpp b/src/common/event.cpp index 4e5ec1a..b078dc5 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -16,6 +16,7 @@ #include "common/event.h" + #include "common/iman.h" #include "common/logger.h" diff --git a/src/common/event.h b/src/common/event.h index ce2872a..04b75c9 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -24,6 +24,7 @@ #include "common/key.h" #include "common/event_ids.h" + #include "math/point.h" #include "math/vector.h" diff --git a/src/common/event_ids.h b/src/common/event_ids.h index b6c646c..ecf10b5 100644 --- a/src/common/event_ids.h +++ b/src/common/event_ids.h @@ -19,6 +19,7 @@ #pragma once + /** \enum EventType \brief Type of event message diff --git a/src/common/global.h b/src/common/global.h index 9704a2b..43c77ac 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -21,7 +21,8 @@ #pragma once -#include "error_ids.h" + +#include "common/error_ids.h" /** * \enum Language diff --git a/src/common/image.cpp b/src/common/image.cpp index adb8ce7..f3cfa34 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -14,9 +14,8 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// image.cpp -#include "image.h" +#include "common/image.h" #include <stdlib.h> #include <stdio.h> diff --git a/src/common/image.h b/src/common/image.h index 54bbd3d..d23a6fa 100644 --- a/src/common/image.h +++ b/src/common/image.h @@ -21,7 +21,9 @@ #pragma once + #include "graphics/core/color.h" + #include "math/intpoint.h" #include <stddef.h> diff --git a/src/common/iman.cpp b/src/common/iman.cpp index e59afb1..6a0a9eb 100644 --- a/src/common/iman.cpp +++ b/src/common/iman.cpp @@ -14,7 +14,6 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// iman.cpp #include "common/iman.h" diff --git a/src/common/iman.h b/src/common/iman.h index 75655aa..53caed7 100644 --- a/src/common/iman.h +++ b/src/common/iman.h @@ -15,14 +15,14 @@ // * along with this program. If not, see http://www.gnu.org/licenses/. /** - * \file iman.h + * \file common/iman.h * \brief Instance manager for managed classes */ #pragma once -#include <common/singleton.h> -#include <common/misc.h> + +#include "common/singleton.h" /** diff --git a/src/common/ioutils.h b/src/common/ioutils.h index e7668eb..9a94617 100644 --- a/src/common/ioutils.h +++ b/src/common/ioutils.h @@ -15,7 +15,7 @@ // * along with this program. If not, see http://www.gnu.org/licenses/. /** - * \file ioutils.h + * \file common/ioutils.h * \brief Functions for binary I/O */ diff --git a/src/common/key.h b/src/common/key.h index 11076a3..196f66d 100644 --- a/src/common/key.h +++ b/src/common/key.h @@ -14,7 +14,10 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// key.h +/** + * \file common/key.h + * \brief Key-related macros and enums + */ #pragma once diff --git a/src/common/logger.cpp b/src/common/logger.cpp index ed8df8c..5a78433 100644 --- a/src/common/logger.cpp +++ b/src/common/logger.cpp @@ -14,9 +14,8 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// logger.cpp -#include <common/logger.h> +#include "common/logger.h" #include <stdio.h> diff --git a/src/common/logger.h b/src/common/logger.h index dfeeb98..198e5e5 100644 --- a/src/common/logger.h +++ b/src/common/logger.h @@ -19,9 +19,9 @@ * \brief Class for logging information to file or console */ - #pragma once + #include "common/singleton.h" #include <string> @@ -58,48 +58,48 @@ class CLogger : public CSingleton<CLogger> ~CLogger(); /** Write message to console or file - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Message(const char *str, ...); /** Write message to console or file with LOG_TRACE level - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Trace(const char *str, ...); /** Write message to console or file with LOG_DEBUG level - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Debug(const char *str, ...); /** Write message to console or file with LOG_INFO level - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Info(const char *str, ...); /** Write message to console or file with LOG_WARN level - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Warn(const char *str, ...); /** Write message to console or file with LOG_ERROR level - * @param str - message to write - * @param ... - additional arguments + * \param str - message to write + * \param ... - additional arguments */ void Error(const char *str, ...); /** Set output file to write logs to - * @param filename - output file to write to + * \param filename - output file to write to */ void SetOutputFile(std::string filename); /** Set log level. Logs with level below will not be shown - * @param level - minimum log level to write + * \param level - minimum log level to write */ void SetLogLevel(LogType level); diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 2ed6e2c..2bce3b8 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -14,8 +14,6 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// misc.cpp - #include "common/misc.h" diff --git a/src/common/misc.h b/src/common/misc.h index f6fd609..f210706 100644 --- a/src/common/misc.h +++ b/src/common/misc.h @@ -14,7 +14,6 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// misc.h #pragma once @@ -22,20 +21,6 @@ #include <time.h> -// TODO: to be removed (replaced by TrackedKey enum and mouse states in app.h) -const int KS_PAGEUP = (1<<4); -const int KS_PAGEDOWN = (1<<5); -const int KS_SHIFT = (1<<6); -const int KS_CONTROL = (1<<7); -const int KS_MLEFT = (1<<8); -const int KS_MRIGHT = (1<<9); -const int KS_NUMUP = (1<<10); -const int KS_NUMDOWN = (1<<11); -const int KS_NUMLEFT = (1<<12); -const int KS_NUMRIGHT = (1<<13); -const int KS_NUMPLUS = (1<<14); -const int KS_NUMMINUS = (1<<15); - // TODO: rewrite/refactor or remove extern char GetNoAccent(char letter); diff --git a/src/common/profile.cpp b/src/common/profile.cpp index 2c78f9f..5432489 100644 --- a/src/common/profile.cpp +++ b/src/common/profile.cpp @@ -14,10 +14,9 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// profile.cpp - #include "common/profile.h" + #include "common/logger.h" #include <utility> diff --git a/src/common/profile.h b/src/common/profile.h index facb414..9bc6c37 100644 --- a/src/common/profile.h +++ b/src/common/profile.h @@ -21,18 +21,19 @@ #pragma once -#include <boost/property_tree/ptree.hpp> #include "common/singleton.h" +#include <boost/property_tree/ptree.hpp> + #include <string> #include <vector> /** -* @class CProfile +* \class CProfile * -* @brief Class for loading profile (currently for loading ini config file) +* \brief Class for loading profile (currently for loading ini config file) * */ class CProfile : public CSingleton<CProfile> @@ -42,62 +43,62 @@ class CProfile : public CSingleton<CProfile> ~CProfile(); /** Loads colobot.ini from current directory - * @return return true on success + * \return return true on success */ bool InitCurrentDirectory(); /** Sets string value in section under specified key - * @param std::string section - * @param std::string key - * @param std::string value - * @return return true on success + * \param section + * \param key + * \param value + * \return return true on success */ bool SetLocalProfileString(std::string section, std::string key, std::string value); /** Gets string value in section under specified key - * @param std::string section - * @param std::string key - * @param std::string& buffer - * @return return true on success + * \param section + * \param key + * \param buffer + * \return return true on success */ bool GetLocalProfileString(std::string section, std::string key, std::string& buffer); /** Sets int value in section under specified key - * @param std::string section - * @param std::string key - * @param int value - * @return return true on success + * \param section + * \param key + * \param value + * \return return true on success */ bool SetLocalProfileInt(std::string section, std::string key, int value); /** Gets int value in section under specified key - * @param std::string section - * @param std::string key - * @param int& value - * @return return true on success + * \param section + * \param key + * \param value + * \return return true on success */ bool GetLocalProfileInt(std::string section, std::string key, int &value); /** Sets float value in section under specified key - * @param std::string section - * @param std::string key - * @param float value - * @return return true on success + * \param section + * \param key + * \param value + * \return return true on success */ bool SetLocalProfileFloat(std::string section, std::string key, float value); /** Gets float value in section under specified key - * @param std::string section - * @param std::string key - * @param float& value - * @return return true on success + * \param section + * \param key + * \param value + * \return return true on success */ bool GetLocalProfileFloat(std::string section, std::string key, float &value); /** Gets all values in section under specified key - * @param std::string section - * @param std::string key - * @return vector of values + * \param section + * \param key + * \return vector of values */ std::vector< std::string > GetLocalProfileSection(std::string section, std::string key); diff --git a/src/common/restext.cpp b/src/common/restext.cpp index 9a3d964..4404e90 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -12,7 +12,8 @@ // * GNU General Public License for more details. // * // * You should have received a copy of the GNU General Public License -// * along with this program. If not, see http://www.gnu.org/licenses/.// restext.cpp +// * along with this program. If not, see http://www.gnu.org/licenses/. + #include "common/restext.h" @@ -20,7 +21,9 @@ #include "common/event.h" #include "common/logger.h" #include "common/stringutils.h" + #include "CBot/resource.h" + #include "object/object.h" #include "object/robotmain.h" diff --git a/src/common/restext.h b/src/common/restext.h index 6abb7f5..fa45e7b 100644 --- a/src/common/restext.h +++ b/src/common/restext.h @@ -21,6 +21,7 @@ #pragma once + #include "common/global.h" #include "common/restext_ids.h" diff --git a/src/common/restext_strings.c b/src/common/restext_strings.c index d041a28..45828e3 100644 --- a/src/common/restext_strings.c +++ b/src/common/restext_strings.c @@ -14,12 +14,17 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -#include "common/restext_ids.h" -#include "common/event_ids.h" -#include "object/object_ids.h" + #include "common/error_ids.h" +#include "common/event_ids.h" +#include "common/restext_ids.h" + #include "CBot/resource.h" +#include "object/object_ids.h" + + + const char * const strings_text[] = { [RT_VERSION_ID] = "Colobot Gold", diff --git a/src/common/singleton.h b/src/common/singleton.h index 7407504..c1b28d9 100644 --- a/src/common/singleton.h +++ b/src/common/singleton.h @@ -19,7 +19,6 @@ * \brief CSingleton base class for singletons */ - #pragma once #include <cassert> diff --git a/src/common/stringutils.cpp b/src/common/stringutils.cpp index 12a3179..db486f0 100644 --- a/src/common/stringutils.cpp +++ b/src/common/stringutils.cpp @@ -14,9 +14,8 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// stringutils.cpp -#include "stringutils.h" +#include "common/stringutils.h" std::string StrUtils::Replace(const std::string &str, const std::string &oldStr, const std::string &newStr) |