From 9fd6cf54492cedd7f6231a0b1d0655120cb1c4d7 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 14 Oct 2014 15:11:37 +0200 Subject: Changed all occurences of PPC in the code to TerranovaTeam --- src/common/misc.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'src/common/misc.cpp') diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 92c3e9a..1cbd3b1 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -1,18 +1,21 @@ -// * This file is part of the COLOBOT source code -// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch -// * -// * This program is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, either version 3 of the License, or -// * (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * 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/. +/* + * This file is part of the Colobot: Gold Edition source code + * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam + * http://epsiteс.ch; http://colobot.info; http://github.com/colobot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the 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://gnu.org/licenses + */ #include "common/misc.h" -- cgit v1.2.3-1-g7c22 From d6e88a07b08585d6a6f151d34a07d8bca78711ea Mon Sep 17 00:00:00 2001 From: krzys-h Date: Mon, 27 Oct 2014 21:15:14 +0100 Subject: Support for %lvl% in TerrainInitTextures + cleanup cleanup: * Removed CProfile::SetUserPath (unused) * Removed CProfile::GetUserBasedPath (unused) * Removed CProfile::CopyFileToTemp (i have no idea why it even existed) * Removed CopyFileListToTemp (it did the same as CopyFileToTemp but for multiple files, wasn't even fully implemented) --- src/common/misc.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src/common/misc.cpp') diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 1cbd3b1..4954fc0 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -232,44 +232,6 @@ void TimeToAsciiClean(time_t time, char *buffer) when.tm_hour, when.tm_min); } -// Copy a list of numbered files into the temporary folder. - -bool CopyFileListToTemp(char* filename, int* list, int total) -{ - /*char name[100]; - char ext[10]; - char file[100]; - char save[100]; - char* p; - int i; - - strcpy(name, filename); - p = strchr(name, '.'); - if ( p == 0 ) - { - strcpy(ext, ".tga"); - } - else - { - strcpy(ext, p); - *p = 0; - } - - for ( i=0 ; i Date: Wed, 29 Oct 2014 17:53:46 +0100 Subject: Implemented mission timer --- src/common/misc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common/misc.cpp') diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 4954fc0..35a5560 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include // Returns a non-accented letter. @@ -232,6 +234,17 @@ void TimeToAsciiClean(time_t time, char *buffer) when.tm_hour, when.tm_min); } +std::string TimeFormat(float time) +{ + int minutes = floor(time/60); + double time2 = fmod(time, 60); + double seconds; + double fraction = modf(time2, &seconds)*100; + std::ostringstream sstream; + sstream << std::setfill('0') << std::setw(2) << minutes << ":" << std::setfill('0') << std::setw(2) << floor(seconds) << "." << std::setfill('0') << std::setw(2) << floor(fraction); + return sstream.str(); +} + // Adds an extension to file, if doesn't already one. -- cgit v1.2.3-1-g7c22