From 343fa8f0cbad19402a2533651acc53149be1fcf5 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 27 Nov 2013 18:53:28 +0100 Subject: Add a PLATFORM_GNU global variable matching all GNU systems such as Debian's Linux, kFreeBSD and Hurd --- src/common/config.h.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 63cd93b..6408b6e 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -3,6 +3,7 @@ // Macros set by CMake #cmakedefine PLATFORM_WINDOWS @PLATFORM_WINDOWS@ #cmakedefine PLATFORM_LINUX @PLATFORM_LINUX@ +#cmakedefine PLATFORM_GNU @PLATFORM_GNU@ #cmakedefine PLATFORM_MACOSX @PLATFORM_MACOSX@ #cmakedefine PLATFORM_OTHER @PLATFORM_OTHER@ -- cgit v1.2.3-1-g7c22 From 8deb1305726966b3b583865dec1ba7ba1327d8cb Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Tue, 3 Dec 2013 00:11:26 +0100 Subject: Changed char[] to std::string in restext Experimental changes --- src/common/restext.cpp | 32 ++++++++++++-------------------- src/common/restext.h | 2 +- src/common/stringutils.cpp | 34 ++++++++++++++++++++++++++++++++++ src/common/stringutils.h | 11 +++++++---- 4 files changed, 54 insertions(+), 25 deletions(-) (limited to 'src/common') diff --git a/src/common/restext.cpp b/src/common/restext.cpp index d61fa63..c5d0ceb 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -776,9 +776,7 @@ static KeyDesc keyTable[22] = bool SearchKey(const char *cmd, InputSlot &key) { - int i; - - for ( i=0 ; i<22 ; i++ ) + for (int i = 0; i < 22 ;i++) { if ( strstr(cmd, keyTable[i].name) == cmd ) { @@ -791,14 +789,11 @@ bool SearchKey(const char *cmd, InputSlot &key) // Replaces the commands "\key name;" in a text. -static void PutKeyName(char* dst, const char* src) +static void PutKeyName(std::string& dst, const char* src) { - InputSlot key; - char name[50]; - int s, d, n; - unsigned int res; + dst.clear(); - s = d = 0; + int s = 0; while ( src[s] != 0 ) { if ( src[s+0] == '\\' && @@ -807,18 +802,16 @@ static void PutKeyName(char* dst, const char* src) src[s+3] == 'y' && src[s+4] == ' ' ) { + InputSlot key; if ( SearchKey(src+s+5, key) ) { - res = CRobotMain::GetInstancePointer()->GetInputBinding(key).primary; + unsigned int res = CRobotMain::GetInstancePointer()->GetInputBinding(key).primary; if (res != KEY_INVALID) { - if ( GetResource(RES_KEY, res, name) ) + std::string keyName; + if ( GetResource(RES_KEY, res, keyName) ) { - n = 0; - while ( name[n] != 0 ) - { - dst[d++] = name[n++]; - } + dst.append(keyName); while ( src[s++] != ';' ); continue; } @@ -826,9 +819,8 @@ static void PutKeyName(char* dst, const char* src) } } - dst[d++] = src[s++]; + dst.append(1, src[s++]); } - dst[d++] = 0; } // Returns the translated text of a resource that needs key substitution @@ -905,13 +897,13 @@ static const char* GetResourceBase(ResType type, int num) // Returns the text of a resource. -bool GetResource(ResType type, int num, char* text) +bool GetResource(ResType type, int num, std::string& text) { const char *tmpl = GetResourceBase(type, num); if (!tmpl) { - text[0] = 0; + text.clear(); return false; } diff --git a/src/common/restext.h b/src/common/restext.h index e4659e2..b5a3415 100644 --- a/src/common/restext.h +++ b/src/common/restext.h @@ -157,5 +157,5 @@ void InitializeRestext(); void SetGlobalGamerName(std::string name); bool SearchKey(const char *cmd, InputSlot& slot); -bool GetResource(ResType type, int num, char* text); +bool GetResource(ResType type, int num, std::string& text); diff --git a/src/common/stringutils.cpp b/src/common/stringutils.cpp index 953abba..37169a5 100644 --- a/src/common/stringutils.cpp +++ b/src/common/stringutils.cpp @@ -17,6 +17,40 @@ #include "common/stringutils.h" +#include +#include + + +static std::string VFormat(const char *fmt, va_list ap) +{ + size_t size = 1024; + char stackbuf[1024]; + std::vector dynamicbuf; + char *buf = &stackbuf[0]; + + while (1) + { + int needed = vsnprintf (buf, size, fmt, ap); + + if (needed <= static_cast(size) && needed >= 0) + { + return std::string(buf, static_cast(needed)); + } + + size = (needed > 0) ? (needed+1) : (size*2); + dynamicbuf.resize(size); + buf = &dynamicbuf[0]; + } +} + +std::string StrUtils::Format(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + std::string buf = VFormat(fmt, ap); + va_end(ap); + return buf; +} std::string StrUtils::Replace(const std::string &str, const std::string &oldStr, const std::string &newStr) { diff --git a/src/common/stringutils.h b/src/common/stringutils.h index c60bfb0..e80163a 100644 --- a/src/common/stringutils.h +++ b/src/common/stringutils.h @@ -31,11 +31,11 @@ namespace StrUtils { /** If given, \a ok is set to true/false on success/failure. Warning: To avoid unnecessary problems, *always* give full template qualifier e.g. ToString\ */ template -std::string ToString(T value, bool *ok = NULL) +std::string ToString(T value, bool *ok = nullptr) { std::ostringstream s; s << value; - if (ok != NULL) + if (ok != nullptr) *ok = !s.fail(); return s.str(); } @@ -44,17 +44,20 @@ std::string ToString(T value, bool *ok = NULL) /** If given, \a ok is set to true/false on success/failure. Warning: To avoid unnecessary problems, *always* give full template qualifier e.g. FromString\ */ template -T FromString(const std::string &str, bool *ok = NULL) +T FromString(const std::string &str, bool *ok = nullptr) { std::istringstream s; s.str(str); T value; s >> value; - if (ok != NULL) + if (ok != nullptr) *ok = !s.fail(); return value; } +//! Replacement for sprintf() +std::string Format(const char *fmt, ...); + //! Returns a string with every occurence of \a oldStr in \a str replaced to \a newStr std::string Replace(const std::string &str, const std::string &oldStr, const std::string &newStr); -- cgit v1.2.3-1-g7c22 From a79bd6c5c780d8f63dff49a0abc78a5c59318fe4 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Wed, 25 Dec 2013 23:41:50 +0100 Subject: Fixed build of stringutils.cpp /var/www/colobot_compiled/colobot/dev/colobot/src/common/stringutils.cpp:33:51: error: 'vsnprintf' was not declared in this scope --- src/common/stringutils.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/stringutils.cpp b/src/common/stringutils.cpp index 37169a5..03a0f0b 100644 --- a/src/common/stringutils.cpp +++ b/src/common/stringutils.cpp @@ -18,6 +18,7 @@ #include "common/stringutils.h" #include +#include #include -- cgit v1.2.3-1-g7c22 From 3eec21895efe3812758d022233fd817faf1529c1 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 26 Dec 2013 19:48:44 +0100 Subject: Renamed "New player" to "Change player" (#220) --- src/common/restext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/restext.cpp b/src/common/restext.cpp index c5d0ceb..a63c4ca 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -156,7 +156,7 @@ void InitializeRestext() stringsEvent[EVENT_INTERFACE_TEEN] = "Free game\\Free game without a specific goal"; stringsEvent[EVENT_INTERFACE_USER] = "User\\User levels"; stringsEvent[EVENT_INTERFACE_PROTO] = "Proto\\Prototypes under development"; - stringsEvent[EVENT_INTERFACE_NAME] = "New player\\Choose player's name"; + stringsEvent[EVENT_INTERFACE_NAME] = "Change player\\Change player"; stringsEvent[EVENT_INTERFACE_SETUP] = "Options\\Preferences"; stringsEvent[EVENT_INTERFACE_AGAIN] = "Restart\\Restart the mission from the beginning"; stringsEvent[EVENT_INTERFACE_WRITE] = "Save\\Save the current mission "; -- cgit v1.2.3-1-g7c22 From 16842b5e837e26f27962a36cd5f29f79ab588505 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 26 Dec 2013 21:09:19 +0100 Subject: Changed default loglevel on dev builds to Debug --- src/common/logger.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common') diff --git a/src/common/logger.cpp b/src/common/logger.cpp index a02854d..7fc8fb0 100644 --- a/src/common/logger.cpp +++ b/src/common/logger.cpp @@ -26,7 +26,11 @@ template<> CLogger* CSingleton::m_instance = nullptr; CLogger::CLogger() { m_file = NULL; + #if DEV_BUILD + m_logLevel = LOG_DEBUG; + #else m_logLevel = LOG_INFO; + #endif } -- cgit v1.2.3-1-g7c22 From 9a741a66a4982cf324834dc2f1e5cff6e6038ade Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Dec 2013 11:15:36 +0100 Subject: Changed version display in bottom-right corner to be actually version number instead of date --- src/common/config.h.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 6408b6e..98ccefe 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -27,6 +27,7 @@ #define COLOBOT_VERSION "@COLOBOT_VERSION_FULL@" #define COLOBOT_CODENAME "@COLOBOT_VERSION_CODENAME@" #define COLOBOT_FULLNAME "Colobot @COLOBOT_VERSION_CODENAME@" +#define COLOBOT_VERSION_DISPLAY "@COLOBOT_VERSION_DISPLAY@" #define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" #define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" -- cgit v1.2.3-1-g7c22 From 246b7e107e058e9da972e038e28ccdb7085c09cc Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Dec 2013 20:36:11 +0100 Subject: Removed prototypes support --- src/common/event.cpp | 1 - src/common/event.h | 1 - src/common/restext.cpp | 4 ---- src/common/restext.h | 3 --- 4 files changed, 9 deletions(-) (limited to 'src/common') diff --git a/src/common/event.cpp b/src/common/event.cpp index 7acac77..9dc3943 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -161,7 +161,6 @@ void InitializeEventTypeTexts() EVENT_TYPE_TEXT[EVENT_INTERFACE_DEFI] = "EVENT_INTERFACE_DEFI"; EVENT_TYPE_TEXT[EVENT_INTERFACE_MISSION] = "EVENT_INTERFACE_MISSION"; EVENT_TYPE_TEXT[EVENT_INTERFACE_FREE] = "EVENT_INTERFACE_FREE"; - EVENT_TYPE_TEXT[EVENT_INTERFACE_PROTO] = "EVENT_INTERFACE_PROTO"; EVENT_TYPE_TEXT[EVENT_INTERFACE_NAME] = "EVENT_INTERFACE_NAME"; EVENT_TYPE_TEXT[EVENT_INTERFACE_SETUP] = "EVENT_INTERFACE_SETUP"; EVENT_TYPE_TEXT[EVENT_INTERFACE_QUIT] = "EVENT_INTERFACE_QUIT"; diff --git a/src/common/event.h b/src/common/event.h index 9405660..c5eb615 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -184,7 +184,6 @@ enum EventType EVENT_INTERFACE_DEFI = 401, EVENT_INTERFACE_MISSION = 402, EVENT_INTERFACE_FREE = 403, - EVENT_INTERFACE_PROTO = 404, EVENT_INTERFACE_NAME = 405, EVENT_INTERFACE_SETUP = 406, EVENT_INTERFACE_QUIT = 407, diff --git a/src/common/restext.cpp b/src/common/restext.cpp index a63c4ca..6533c7c 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -63,7 +63,6 @@ void InitializeRestext() stringsText[RT_TITLE_FREE] = "Free game"; stringsText[RT_TITLE_TEEN] = "Free game"; stringsText[RT_TITLE_USER] = "User levels"; - stringsText[RT_TITLE_PROTO] = "Prototypes"; stringsText[RT_TITLE_SETUP] = "Options"; stringsText[RT_TITLE_NAME] = "Player's name"; stringsText[RT_TITLE_PERSO] = "Customize your appearance"; @@ -75,14 +74,12 @@ void InitializeRestext() stringsText[RT_PLAY_CHAPm] = " Planets:"; stringsText[RT_PLAY_CHAPf] = " Planets:"; stringsText[RT_PLAY_CHAPu] = " User levels:"; - stringsText[RT_PLAY_CHAPp] = " Planets:"; stringsText[RT_PLAY_CHAPte] = " Chapters:"; stringsText[RT_PLAY_LISTt] = " Exercises in the chapter:"; stringsText[RT_PLAY_LISTd] = " Challenges in the chapter:"; stringsText[RT_PLAY_LISTm] = " Missions on this planet:"; stringsText[RT_PLAY_LISTf] = " Free game on this planet:"; stringsText[RT_PLAY_LISTu] = " Missions on this level:"; - stringsText[RT_PLAY_LISTp] = " Prototypes on this planet:"; stringsText[RT_PLAY_LISTk] = " Free game on this chapter:"; stringsText[RT_PLAY_RESUME] = " Summary:"; @@ -155,7 +152,6 @@ void InitializeRestext() stringsEvent[EVENT_INTERFACE_FREE] = "Free game\\Free game without a specific goal"; stringsEvent[EVENT_INTERFACE_TEEN] = "Free game\\Free game without a specific goal"; stringsEvent[EVENT_INTERFACE_USER] = "User\\User levels"; - stringsEvent[EVENT_INTERFACE_PROTO] = "Proto\\Prototypes under development"; stringsEvent[EVENT_INTERFACE_NAME] = "Change player\\Change player"; stringsEvent[EVENT_INTERFACE_SETUP] = "Options\\Preferences"; stringsEvent[EVENT_INTERFACE_AGAIN] = "Restart\\Restart the mission from the beginning"; diff --git a/src/common/restext.h b/src/common/restext.h index b5a3415..cde7203 100644 --- a/src/common/restext.h +++ b/src/common/restext.h @@ -66,7 +66,6 @@ enum ResTextType RT_TITLE_DEFI = 43, RT_TITLE_MISSION = 44, RT_TITLE_FREE = 45, - RT_TITLE_PROTO = 46, RT_TITLE_SETUP = 47, RT_TITLE_NAME = 48, RT_TITLE_PERSO = 49, @@ -79,12 +78,10 @@ enum ResTextType RT_PLAY_CHAPd = 61, RT_PLAY_CHAPm = 62, RT_PLAY_CHAPf = 63, - RT_PLAY_CHAPp = 64, RT_PLAY_LISTt = 65, RT_PLAY_LISTd = 66, RT_PLAY_LISTm = 67, RT_PLAY_LISTf = 68, - RT_PLAY_LISTp = 69, RT_PLAY_RESUME = 70, RT_PLAY_CHAPu = 71, RT_PLAY_LISTu = 72, -- cgit v1.2.3-1-g7c22 From 0ff7e55b3343fbca959fb11236a009fb3790b652 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Dec 2013 22:28:25 +0100 Subject: Fix for #177 - save list sorting --- src/common/misc.cpp | 17 +++++++++++++++++ src/common/misc.h | 1 + 2 files changed, 18 insertions(+) (limited to 'src/common') diff --git a/src/common/misc.cpp b/src/common/misc.cpp index b96abca..65689e6 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -230,6 +230,23 @@ void TimeToAscii(time_t time, char *buffer) #endif*/ } +// Converting time to string. + +void TimeToAsciiClean(time_t time, char *buffer) +{ + struct tm when; + int year; + + when = *localtime(&time); + year = when.tm_year+1900; + if ( year < 2000 ) year -= 1900; + else year -= 2000; + + sprintf(buffer, "%.2d%.2d%.2d%.2d%.2d", + year, when.tm_mon+1, when.tm_mday, + when.tm_hour, when.tm_min); +} + // Copy a list of numbered files into the temporary folder. bool CopyFileListToTemp(char* filename, int* list, int total) diff --git a/src/common/misc.h b/src/common/misc.h index bcebf76..3c147b1 100644 --- a/src/common/misc.h +++ b/src/common/misc.h @@ -28,6 +28,7 @@ extern char GetToUpper(char letter); extern char GetToLower(char letter); extern void TimeToAscii(time_t time, char *buffer); +extern void TimeToAsciiClean(time_t time, char *buffer); extern bool CopyFileListToTemp(char* filename, int* list, int total); extern void AddExt(char* filename, const char* ext); -- cgit v1.2.3-1-g7c22 From 8d30791595cf981b08310472faa2066a99aa9595 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 31 Dec 2013 17:20:03 +0100 Subject: Ability to set language via ini file If language autodetection doesn't work, someone might want to manually force the game to use correct language without using -language parameter every time --- src/common/profile.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/common') diff --git a/src/common/profile.cpp b/src/common/profile.cpp index 77c70c3..ee3e873 100644 --- a/src/common/profile.cpp +++ b/src/common/profile.cpp @@ -91,7 +91,7 @@ bool CProfile::SetLocalProfileString(std::string section, std::string key, std:: } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -106,7 +106,7 @@ bool CProfile::GetLocalProfileString(std::string section, std::string key, std:: } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -122,7 +122,7 @@ bool CProfile::SetLocalProfileInt(std::string section, std::string key, int valu } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -137,7 +137,7 @@ bool CProfile::GetLocalProfileInt(std::string section, std::string key, int &val } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -153,7 +153,7 @@ bool CProfile::SetLocalProfileFloat(std::string section, std::string key, float } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -168,7 +168,7 @@ bool CProfile::GetLocalProfileFloat(std::string section, std::string key, float } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); return false; } return true; @@ -178,7 +178,7 @@ bool CProfile::GetLocalProfileFloat(std::string section, std::string key, float std::vector< std::string > CProfile::GetLocalProfileSection(std::string section, std::string key) { std::vector< std::string > ret_list; - boost::regex re(key + "[0-9]*"); //we want to match all key followed my any number + boost::regex re(key + "[0-9]*"); //we want to match all key followed by any number try { @@ -192,7 +192,7 @@ std::vector< std::string > CProfile::GetLocalProfileSection(std::string section, } catch (std::exception & e) { - GetLogger()->Error("Error on parsing profile: %s\n", e.what()); + GetLogger()->Info("Error on parsing profile: %s\n", e.what()); } return ret_list; -- cgit v1.2.3-1-g7c22 From 082989a413b229176210890dbda635ef98bb5b7d Mon Sep 17 00:00:00 2001 From: krzys-h Date: Wed, 1 Jan 2014 19:49:29 +0100 Subject: Changed main menu title to "COLOBOT: Gold Edition" --- src/common/restext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/restext.cpp b/src/common/restext.cpp index 6533c7c..b63160d 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -56,7 +56,7 @@ void InitializeRestext() stringsText[RT_KEY_OR] = " or "; stringsText[RT_TITLE_BASE] = "COLOBOT"; - stringsText[RT_TITLE_INIT] = "COLOBOT"; + stringsText[RT_TITLE_INIT] = "COLOBOT: Gold Edition"; stringsText[RT_TITLE_TRAINER] = "Programming exercises"; stringsText[RT_TITLE_DEFI] = "Challenges"; stringsText[RT_TITLE_MISSION] = "Missions"; -- cgit v1.2.3-1-g7c22 From 2cf84ad2148c8f88a1153771b357cc8b3208e38a Mon Sep 17 00:00:00 2001 From: Oleg Kosmakov Date: Fri, 21 Mar 2014 09:34:52 +0200 Subject: Added spaces to align values --- src/common/global.h | 260 ++++++++++++++++++++++++++-------------------------- 1 file changed, 130 insertions(+), 130 deletions(-) (limited to 'src/common') diff --git a/src/common/global.h b/src/common/global.h index da62bac..5f85ce3 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -28,137 +28,137 @@ */ enum Error { - ERR_OK = 0, //! < ok - ERR_GENERIC = 1, //! < any error - ERR_CONTINUE = 2, //! < continues - ERR_STOP = 3, //! < stops - ERR_CMD = 4, //! < unknown command - ERR_MANIP_VEH = 100, //! < inappropriate vehicle - ERR_MANIP_FLY = 101, //! < impossible in flight - ERR_MANIP_BUSY = 102, //! < taking: hands already occupied - ERR_MANIP_NIL = 103, //! < taking: nothing has to take - ERR_MANIP_MOTOR = 105, //! < busy: impossible to move - ERR_MANIP_OCC = 106, //! < busy: location already occupied - ERR_MANIP_FRIEND = 107, //! < no other vehicle - ERR_MANIP_RADIO = 108, //! < impossible because radioactive - ERR_MANIP_WATER = 109, //! < not possible under water - ERR_MANIP_EMPTY = 110, //! < nothing to deposit - ERR_BUILD_FLY = 120, //! < not possible in flight - ERR_BUILD_WATER = 121, //! < not possible under water - ERR_BUILD_ENERGY = 122, //! < not enough energy - ERR_BUILD_METALAWAY = 123, //! < lack of metal (too far) - ERR_BUILD_METALNEAR = 124, //! < lack of metal (too close) - ERR_BUILD_METALINEX = 125, //! < lack of metal - ERR_BUILD_FLAT = 126, //! < not enough flat ground - ERR_BUILD_FLATLIT = 127, //! < not enough flat ground space - ERR_BUILD_BUSY = 128, //! < location occupied - ERR_BUILD_BASE = 129, //! < too close to the rocket - ERR_BUILD_NARROW = 130, //! < buildings too close - ERR_BUILD_MOTOR = 131, //! < built: not possible in movement - ERR_BUILD_DISABLED = 132, //! < built: can not produce this object in this mission - ERR_BUILD_RESEARCH = 133, //! < built: can not produce not researched object - ERR_SEARCH_FLY = 140, //! < not possible in flight - ERR_SEARCH_VEH = 141, //! < inappropriate vehicle - ERR_SEARCH_MOTOR = 142, //! < impossible in movement - ERR_TERRA_VEH = 150, //! < inappropriate vehicle - ERR_TERRA_ENERGY = 151, //! < not enough energy - ERR_TERRA_FLOOR = 152, //! < inappropriate ground - ERR_TERRA_BUILDING = 153, //! < building too close - ERR_TERRA_OBJECT = 154, //! < object too close - ERR_FIRE_VEH = 160, //! < inappropriate vehicle - ERR_FIRE_ENERGY = 161, //! < not enough energy - ERR_FIRE_FLY = 162, //! < not possible in flight - ERR_RECOVER_VEH = 170, //! < inappropriate vehicle - ERR_RECOVER_ENERGY = 171, //! < not enough energy - ERR_RECOVER_NULL = 172, //! < lack of ruin - ERR_CONVERT_EMPTY = 180, //! < no stone was transformed - ERR_SHIELD_VEH = 190, //! < inappropriate vehicle - ERR_SHIELD_ENERGY = 191, //! < not enough energy - ERR_MOVE_IMPOSSIBLE = 200, //! < move impossible - ERR_FIND_IMPOSSIBLE = 201, //! < find impossible - ERR_GOTO_IMPOSSIBLE = 210, //! < goto impossible - ERR_GOTO_ITER = 211, //! < goto too complicated - ERR_GOTO_BUSY = 212, //! < goto destination occupied - ERR_DERRICK_NULL = 300, //! < no ore underground - ERR_STATION_NULL = 301, //! < no energy underground - ERR_TOWER_POWER = 310, //! < no battery - ERR_TOWER_ENERGY = 311, //! < more energy - ERR_RESEARCH_POWER = 320, //! < no battery - ERR_RESEARCH_ENERGY = 321, //! < more energy - ERR_RESEARCH_TYPE = 322, //! < the wrong type of battery - ERR_RESEARCH_ALREADY = 323, //! < research already done - ERR_ENERGY_NULL = 330, //! < no energy underground - ERR_ENERGY_LOW = 331, //! < not enough energy - ERR_ENERGY_EMPTY = 332, //! < lack of metal - ERR_ENERGY_BAD = 333, //! < transforms only the metal - ERR_BASE_DLOCK = 340, //! < doors locked - ERR_BASE_DHUMAN = 341, //! < you must be on spaceship - ERR_LABO_NULL = 350, //! < nothing to analyze - ERR_LABO_BAD = 351, //! < analyzes only organic ball - ERR_LABO_ALREADY = 352, //! < analysis already made - ERR_NUCLEAR_NULL = 360, //! < no energy underground - ERR_NUCLEAR_LOW = 361, //! < not enough energy - ERR_NUCLEAR_EMPTY = 362, //! < lack of uranium - ERR_NUCLEAR_BAD = 363, //! < transforms only uranium - ERR_FACTORY_NULL = 370, //! < no metal - ERR_FACTORY_NEAR = 371, //! < vehicle too close - ERR_RESET_NEAR = 380, //! < vehicle too close - ERR_INFO_NULL = 390, //! < no information terminal - ERR_VEH_VIRUS = 400, //! < vehicle infected by a virus - ERR_BAT_VIRUS = 401, //! < building infected by a virus - ERR_DESTROY_NOTFOUND = 410, //! < not found anything to destroy - ERR_WRONG_OBJ = 420, //! < inappropriate vehicle - ERR_VEH_POWER = 500, //! < no battery - ERR_VEH_ENERGY = 501, //! < more energy - ERR_FLAG_FLY = 510, //! < impossible in flight - ERR_FLAG_WATER = 511, //! < impossible during swimming - ERR_FLAG_MOTOR = 512, //! < impossible in movement - ERR_FLAG_BUSY = 513, //! < taking: already creating flag - ERR_FLAG_CREATE = 514, //! < too many flags - ERR_FLAG_PROXY = 515, //! < too close - ERR_FLAG_DELETE = 516, //! < nothing to remove - ERR_MISSION_NOTERM = 600, //! < Mission not completed - ERR_DELETEMOBILE = 700, //! < vehicle destroyed - ERR_DELETEBUILDING = 701, //! < building destroyed - ERR_TOOMANY = 702, //! < too many objects - ERR_OBLIGATORYTOKEN = 800, //! < compulsory instruction missing - ERR_PROHIBITEDTOKEN = 801, //! < instruction prohibited + ERR_OK = 0, //! < ok + ERR_GENERIC = 1, //! < any error + ERR_CONTINUE = 2, //! < continues + ERR_STOP = 3, //! < stops + ERR_CMD = 4, //! < unknown command + ERR_MANIP_VEH = 100, //! < inappropriate vehicle + ERR_MANIP_FLY = 101, //! < impossible in flight + ERR_MANIP_BUSY = 102, //! < taking: hands already occupied + ERR_MANIP_NIL = 103, //! < taking: nothing has to take + ERR_MANIP_MOTOR = 105, //! < busy: impossible to move + ERR_MANIP_OCC = 106, //! < busy: location already occupied + ERR_MANIP_FRIEND = 107, //! < no other vehicle + ERR_MANIP_RADIO = 108, //! < impossible because radioactive + ERR_MANIP_WATER = 109, //! < not possible under water + ERR_MANIP_EMPTY = 110, //! < nothing to deposit + ERR_BUILD_FLY = 120, //! < not possible in flight + ERR_BUILD_WATER = 121, //! < not possible under water + ERR_BUILD_ENERGY = 122, //! < not enough energy + ERR_BUILD_METALAWAY = 123, //! < lack of metal (too far) + ERR_BUILD_METALNEAR = 124, //! < lack of metal (too close) + ERR_BUILD_METALINEX = 125, //! < lack of metal + ERR_BUILD_FLAT = 126, //! < not enough flat ground + ERR_BUILD_FLATLIT = 127, //! < not enough flat ground space + ERR_BUILD_BUSY = 128, //! < location occupied + ERR_BUILD_BASE = 129, //! < too close to the rocket + ERR_BUILD_NARROW = 130, //! < buildings too close + ERR_BUILD_MOTOR = 131, //! < built: not possible in movement + ERR_BUILD_DISABLED = 132, //! < built: can not produce this object in this mission + ERR_BUILD_RESEARCH = 133, //! < built: can not produce not researched object + ERR_SEARCH_FLY = 140, //! < not possible in flight + ERR_SEARCH_VEH = 141, //! < inappropriate vehicle + ERR_SEARCH_MOTOR = 142, //! < impossible in movement + ERR_TERRA_VEH = 150, //! < inappropriate vehicle + ERR_TERRA_ENERGY = 151, //! < not enough energy + ERR_TERRA_FLOOR = 152, //! < inappropriate ground + ERR_TERRA_BUILDING = 153, //! < building too close + ERR_TERRA_OBJECT = 154, //! < object too close + ERR_FIRE_VEH = 160, //! < inappropriate vehicle + ERR_FIRE_ENERGY = 161, //! < not enough energy + ERR_FIRE_FLY = 162, //! < not possible in flight + ERR_RECOVER_VEH = 170, //! < inappropriate vehicle + ERR_RECOVER_ENERGY = 171, //! < not enough energy + ERR_RECOVER_NULL = 172, //! < lack of ruin + ERR_CONVERT_EMPTY = 180, //! < no stone was transformed + ERR_SHIELD_VEH = 190, //! < inappropriate vehicle + ERR_SHIELD_ENERGY = 191, //! < not enough energy + ERR_MOVE_IMPOSSIBLE = 200, //! < move impossible + ERR_FIND_IMPOSSIBLE = 201, //! < find impossible + ERR_GOTO_IMPOSSIBLE = 210, //! < goto impossible + ERR_GOTO_ITER = 211, //! < goto too complicated + ERR_GOTO_BUSY = 212, //! < goto destination occupied + ERR_DERRICK_NULL = 300, //! < no ore underground + ERR_STATION_NULL = 301, //! < no energy underground + ERR_TOWER_POWER = 310, //! < no battery + ERR_TOWER_ENERGY = 311, //! < more energy + ERR_RESEARCH_POWER = 320, //! < no battery + ERR_RESEARCH_ENERGY = 321, //! < more energy + ERR_RESEARCH_TYPE = 322, //! < the wrong type of battery + ERR_RESEARCH_ALREADY = 323, //! < research already done + ERR_ENERGY_NULL = 330, //! < no energy underground + ERR_ENERGY_LOW = 331, //! < not enough energy + ERR_ENERGY_EMPTY = 332, //! < lack of metal + ERR_ENERGY_BAD = 333, //! < transforms only the metal + ERR_BASE_DLOCK = 340, //! < doors locked + ERR_BASE_DHUMAN = 341, //! < you must be on spaceship + ERR_LABO_NULL = 350, //! < nothing to analyze + ERR_LABO_BAD = 351, //! < analyzes only organic ball + ERR_LABO_ALREADY = 352, //! < analysis already made + ERR_NUCLEAR_NULL = 360, //! < no energy underground + ERR_NUCLEAR_LOW = 361, //! < not enough energy + ERR_NUCLEAR_EMPTY = 362, //! < lack of uranium + ERR_NUCLEAR_BAD = 363, //! < transforms only uranium + ERR_FACTORY_NULL = 370, //! < no metal + ERR_FACTORY_NEAR = 371, //! < vehicle too close + ERR_RESET_NEAR = 380, //! < vehicle too close + ERR_INFO_NULL = 390, //! < no information terminal + ERR_VEH_VIRUS = 400, //! < vehicle infected by a virus + ERR_BAT_VIRUS = 401, //! < building infected by a virus + ERR_DESTROY_NOTFOUND = 410, //! < not found anything to destroy + ERR_WRONG_OBJ = 420, //! < inappropriate vehicle + ERR_VEH_POWER = 500, //! < no battery + ERR_VEH_ENERGY = 501, //! < more energy + ERR_FLAG_FLY = 510, //! < impossible in flight + ERR_FLAG_WATER = 511, //! < impossible during swimming + ERR_FLAG_MOTOR = 512, //! < impossible in movement + ERR_FLAG_BUSY = 513, //! < taking: already creating flag + ERR_FLAG_CREATE = 514, //! < too many flags + ERR_FLAG_PROXY = 515, //! < too close + ERR_FLAG_DELETE = 516, //! < nothing to remove + ERR_MISSION_NOTERM = 600, //! < Mission not completed + ERR_DELETEMOBILE = 700, //! < vehicle destroyed + ERR_DELETEBUILDING = 701, //! < building destroyed + ERR_TOOMANY = 702, //! < too many objects + ERR_OBLIGATORYTOKEN = 800, //! < compulsory instruction missing + ERR_PROHIBITEDTOKEN = 801, //! < instruction prohibited - INFO_FIRST = 10000, //! < first information - INFO_BUILD = 10001, //! < construction builded - INFO_CONVERT = 10002, //! < metal available - INFO_RESEARCH = 10003, //! < search ended - INFO_FACTORY = 10004, //! < vehicle manufactured - INFO_LABO = 10005, //! < analysis ended - INFO_ENERGY = 10006, //! < battery available - INFO_NUCLEAR = 10007, //! < nuclear battery available - INFO_FINDING = 10008, //! < nuclear battery available - INFO_MARKPOWER = 10020, //! < location for station found - INFO_MARKURANIUM = 10021, //! < location for derrick found - INFO_MARKSTONE = 10022, //! < location for derrick found - INFO_MARKKEYa = 10023, //! < location for derrick found - INFO_MARKKEYb = 10024, //! < location for derrick found - INFO_MARKKEYc = 10025, //! < location for derrick found - INFO_MARKKEYd = 10026, //! < location for derrick found - INFO_RESEARCHTANK = 10030, //! < research ended - INFO_RESEARCHFLY = 10031, //! < research ended - INFO_RESEARCHTHUMP = 10032, //! < research ended - INFO_RESEARCHCANON = 10033, //! < research ended - INFO_RESEARCHTOWER = 10034, //! < research ended - INFO_RESEARCHPHAZER = 10035, //! < research ended - INFO_RESEARCHSHIELD = 10036, //! < research ended - INFO_RESEARCHATOMIC = 10037, //! < research ended - INFO_WIN = 10040, //! < win - INFO_LOST = 10041, //! < lost - INFO_LOSTq = 10042, //! < lost immediately - INFO_WRITEOK = 10043, //! < record done - INFO_DELETEPATH = 10050, //! < way mark deleted - INFO_DELETEMOTHER = 10100, //! < insect killed - INFO_DELETEANT = 10101, //! < insect killed - INFO_DELETEBEE = 10102, //! < insect killed - INFO_DELETEWORM = 10103, //! < insect killed - INFO_DELETESPIDER = 10104, //! < insect killed - INFO_BEGINSATCOM = 10105, //! < use your SatCom + INFO_FIRST = 10000, //! < first information + INFO_BUILD = 10001, //! < construction builded + INFO_CONVERT = 10002, //! < metal available + INFO_RESEARCH = 10003, //! < search ended + INFO_FACTORY = 10004, //! < vehicle manufactured + INFO_LABO = 10005, //! < analysis ended + INFO_ENERGY = 10006, //! < battery available + INFO_NUCLEAR = 10007, //! < nuclear battery available + INFO_FINDING = 10008, //! < nuclear battery available + INFO_MARKPOWER = 10020, //! < location for station found + INFO_MARKURANIUM = 10021, //! < location for derrick found + INFO_MARKSTONE = 10022, //! < location for derrick found + INFO_MARKKEYa = 10023, //! < location for derrick found + INFO_MARKKEYb = 10024, //! < location for derrick found + INFO_MARKKEYc = 10025, //! < location for derrick found + INFO_MARKKEYd = 10026, //! < location for derrick found + INFO_RESEARCHTANK = 10030, //! < research ended + INFO_RESEARCHFLY = 10031, //! < research ended + INFO_RESEARCHTHUMP = 10032, //! < research ended + INFO_RESEARCHCANON = 10033, //! < research ended + INFO_RESEARCHTOWER = 10034, //! < research ended + INFO_RESEARCHPHAZER = 10035, //! < research ended + INFO_RESEARCHSHIELD = 10036, //! < research ended + INFO_RESEARCHATOMIC = 10037, //! < research ended + INFO_WIN = 10040, //! < win + INFO_LOST = 10041, //! < lost + INFO_LOSTq = 10042, //! < lost immediately + INFO_WRITEOK = 10043, //! < record done + INFO_DELETEPATH = 10050, //! < way mark deleted + INFO_DELETEMOTHER = 10100, //! < insect killed + INFO_DELETEANT = 10101, //! < insect killed + INFO_DELETEBEE = 10102, //! < insect killed + INFO_DELETEWORM = 10103, //! < insect killed + INFO_DELETESPIDER = 10104, //! < insect killed + INFO_BEGINSATCOM = 10105, //! < use your SatCom ERR_MAX //! < number of values }; -- cgit v1.2.3-1-g7c22 From 7485ed790caeaa76efab0e9df48224cf1943ec27 Mon Sep 17 00:00:00 2001 From: Oleg Kosmakov Date: Fri, 21 Mar 2014 13:08:36 +0200 Subject: Fixes #295 When cannon cannot turn at specified angle, it will still reach the edge angle, but return the error code --- src/common/global.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/global.h b/src/common/global.h index 5f85ce3..8b72774 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -123,6 +123,7 @@ enum Error ERR_TOOMANY = 702, //! < too many objects ERR_OBLIGATORYTOKEN = 800, //! < compulsory instruction missing ERR_PROHIBITEDTOKEN = 801, //! < instruction prohibited + ERR_AIM_IMPOSSIBLE = 900, //! < cannot aim at specified angle(s) INFO_FIRST = 10000, //! < first information INFO_BUILD = 10001, //! < construction builded -- cgit v1.2.3-1-g7c22 From 4491f51839a8d6806d27cc50bbb6e285205e3d24 Mon Sep 17 00:00:00 2001 From: Oleg Kosmakov Date: Fri, 21 Mar 2014 13:15:15 +0200 Subject: Whitespace --- src/common/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/global.h b/src/common/global.h index 8b72774..79206af 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -106,7 +106,7 @@ enum Error ERR_INFO_NULL = 390, //! < no information terminal ERR_VEH_VIRUS = 400, //! < vehicle infected by a virus ERR_BAT_VIRUS = 401, //! < building infected by a virus - ERR_DESTROY_NOTFOUND = 410, //! < not found anything to destroy + ERR_DESTROY_NOTFOUND = 410, //! < not found anything to destroy ERR_WRONG_OBJ = 420, //! < inappropriate vehicle ERR_VEH_POWER = 500, //! < no battery ERR_VEH_ENERGY = 501, //! < more energy -- cgit v1.2.3-1-g7c22 From f0d97bfdb91a2c0a17d1697b145d4df930280dbb Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 18 May 2014 12:12:47 +0200 Subject: Better datadir mod support --- src/common/global.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/common') diff --git a/src/common/global.h b/src/common/global.h index 79206af..4049bdc 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -178,25 +178,6 @@ enum Language LANGUAGE_RUSSIAN = 4 }; -/** - * \enum DataDir - * \brief Directories in data directory - */ -enum DataDir -{ - DIR_AI, //! < ai scripts - DIR_FONT, //! < fonts - DIR_HELP, //! < help files - DIR_ICON, //! < icons & images - DIR_LEVEL, //! < levels - DIR_MODEL, //! < models - DIR_MUSIC, //! < music - DIR_SOUND, //! < sounds - DIR_TEXTURE, //! < textures - - DIR_MAX //! < number of dirs -}; - /** * \enum BuildType -- cgit v1.2.3-1-g7c22 From 613e1d74c47cf3a756af9aff75575c7567699381 Mon Sep 17 00:00:00 2001 From: Mohamed Waheed Date: Tue, 24 Jun 2014 01:35:05 +0300 Subject: implemented savefile screenshot feature --- src/common/image.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ src/common/image.h | 6 ++++++ 2 files changed, 46 insertions(+) (limited to 'src/common') diff --git a/src/common/image.cpp b/src/common/image.cpp index 8a876e3..ff5e42c 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -418,3 +418,43 @@ bool CImage::SavePNG(const std::string& fileName) return true; } +void CImage::SetDataPixels(void *pixels){ + + if (m_data != nullptr){ + + if (m_data->surface != nullptr) + { + if ( m_data->surface->pixels != nullptr ){ + unsigned int* pixels = static_cast(m_data->surface->pixels); + delete [] pixels; + m_data->surface->pixels = nullptr; + } + } + } + + m_data->surface->pixels = pixels; +} + +void CImage::flipVertical(){ + + SDL_Surface* result = SDL_CreateRGBSurface(m_data->surface->flags, m_data->surface->w, m_data->surface->h, + m_data->surface->format->BytesPerPixel * 8, m_data->surface->format->Rmask, m_data->surface->format->Gmask, + m_data->surface->format->Bmask, m_data->surface->format->Amask); + + assert(result != nullptr); + + Uint8* srcPixels = static_cast (m_data->surface->pixels); + Uint8* resultPixels = static_cast (result->pixels); + + Uint32 pitch = m_data->surface->pitch; + Uint32 pxLength = pitch*m_data->surface->h; + + for(int line = 0; line < m_data->surface->h; ++line) { + Uint32 pos = line * pitch; + memcpy(&resultPixels[pos], &srcPixels[(pxLength-pos)-pitch], pitch); + } + + SDL_FreeSurface(m_data->surface); + + m_data->surface = result; +} \ No newline at end of file diff --git a/src/common/image.h b/src/common/image.h index 31dab2d..afbebc2 100644 --- a/src/common/image.h +++ b/src/common/image.h @@ -109,6 +109,12 @@ public: //! Returns the last error std::string GetError(); + //! Flips the image vertically + void flipVertical(); + + //! sets/replaces the pixels from the surface + void SetDataPixels(void *pixels); + private: //! Blit to new RGBA surface with given size void BlitToNewRGBASurface(int width, int height); -- cgit v1.2.3-1-g7c22 From b7125a5b24bc6d2581bec0d3f792ba948e0e7edd Mon Sep 17 00:00:00 2001 From: Mohamed Waheed Date: Tue, 24 Jun 2014 20:27:31 +0300 Subject: formatting and enhancements for savefile screenshot feature --- src/common/image.cpp | 33 +++++++++++++++++---------------- src/common/image.h | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src/common') diff --git a/src/common/image.cpp b/src/common/image.cpp index ff5e42c..e3d1ef7 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -420,26 +420,27 @@ bool CImage::SavePNG(const std::string& fileName) void CImage::SetDataPixels(void *pixels){ - if (m_data != nullptr){ - - if (m_data->surface != nullptr) - { - if ( m_data->surface->pixels != nullptr ){ - unsigned int* pixels = static_cast(m_data->surface->pixels); - delete [] pixels; - m_data->surface->pixels = nullptr; - } - } + Uint8* srcPixels = static_cast (pixels); + Uint8* resultPixels = static_cast (m_data->surface->pixels); + + Uint32 pitch = m_data->surface->pitch; + + for(int line = 0; line < m_data->surface->h; ++line) { + Uint32 pos = line * pitch; + memcpy(&resultPixels[pos], &srcPixels[pos], pitch); } - - m_data->surface->pixels = pixels; } -void CImage::flipVertical(){ +void CImage::flipVertically(){ - SDL_Surface* result = SDL_CreateRGBSurface(m_data->surface->flags, m_data->surface->w, m_data->surface->h, - m_data->surface->format->BytesPerPixel * 8, m_data->surface->format->Rmask, m_data->surface->format->Gmask, - m_data->surface->format->Bmask, m_data->surface->format->Amask); + SDL_Surface* result = SDL_CreateRGBSurface( m_data->surface->flags, + m_data->surface->w, + m_data->surface->h, + m_data->surface->format->BytesPerPixel * 8, + m_data->surface->format->Rmask, + m_data->surface->format->Gmask, + m_data->surface->format->Bmask, + m_data->surface->format->Amask); assert(result != nullptr); diff --git a/src/common/image.h b/src/common/image.h index afbebc2..b93f2f9 100644 --- a/src/common/image.h +++ b/src/common/image.h @@ -110,7 +110,7 @@ public: std::string GetError(); //! Flips the image vertically - void flipVertical(); + void flipVertically(); //! sets/replaces the pixels from the surface void SetDataPixels(void *pixels); -- cgit v1.2.3-1-g7c22 From 1835d2ae580525603308206f7b8e6b4552b3ca0f Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Jun 2014 19:50:09 +0200 Subject: Removed old code based on #ifs (issue #55) --- src/common/misc.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/common') diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 65689e6..92c3e9a 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -192,18 +192,6 @@ void TimeToAscii(time_t time, char *buffer) year = when.tm_year+1900; if ( year < 2000 ) year -= 1900; else year -= 2000; -/* TODO -#if _FRENCH - sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d", - when.tm_mday, when.tm_mon+1, year, - when.tm_hour, when.tm_min); -#endif -#if _GERMAN | _WG - sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d", - when.tm_mday, when.tm_mon+1, year, - when.tm_hour, when.tm_min); -#endif -#if _ENGLISH*/ char format[10]; int hour; @@ -222,12 +210,6 @@ void TimeToAscii(time_t time, char *buffer) sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d %s", when.tm_mon+1, when.tm_mday, year, hour, when.tm_min, format); -/*#endif -#if _POLISH - sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d", - when.tm_mday, when.tm_mon+1, year, - when.tm_hour, when.tm_min); -#endif*/ } // Converting time to string. -- cgit v1.2.3-1-g7c22