Rename Time to StkTime, X11 has a type called Time

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13604 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
curaga 2013-08-30 12:24:12 +00:00
parent 2a6c1a0a8f
commit efe3b59bc5
14 changed files with 31 additions and 31 deletions

View File

@ -162,7 +162,7 @@ void Addon::writeXML(std::ofstream *out_stream)
// ----------------------------------------------------------------------------
std::string Addon::getDateAsString() const
{
return Time::toString(m_date);
return StkTime::toString(m_date);
} // getDateAsString
// ----------------------------------------------------------------------------

View File

@ -99,7 +99,7 @@ private:
* in the addons.xml file. */
bool m_still_exists;
/** Date when the addon was added. */
Time::TimeType m_date;
StkTime::TimeType m_date;
/** A description of this addon. */
core::stringw m_description;
/** The URL of the icon (relative to the server) */
@ -168,7 +168,7 @@ public:
// ------------------------------------------------------------------------
/** Returns the date (in seconds since epoch) when the addon was
* uploaded. */
Time::TimeType getDate() const { return m_date; }
StkTime::TimeType getDate() const { return m_date; }
// ------------------------------------------------------------------------
/** Returns a user readable date as a string. */
std::string getDateAsString() const;

View File

@ -270,7 +270,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
bool download = UserConfigParams::m_news_last_updated==0 ||
UserConfigParams::m_news_last_updated
+UserConfigParams::m_news_frequency
< Time::getTimeSinceEpoch() || forceRefresh;
< StkTime::getTimeSinceEpoch() || forceRefresh;
if(!download)
{
@ -303,7 +303,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
{
std::string xml_file = file_manager->getAddonsFile("news.xml");
if(download)
UserConfigParams::m_news_last_updated = Time::getTimeSinceEpoch();
UserConfigParams::m_news_last_updated = StkTime::getTimeSinceEpoch();
const XMLNode *xml = new XMLNode(xml_file);
// A proper news file has at least a version number, mtime, and
@ -319,7 +319,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
status = downloadFileInternal(&r);
if(status==CURLE_OK)
UserConfigParams::m_news_last_updated =
Time::getTimeSinceEpoch();
StkTime::getTimeSinceEpoch();
delete xml;
xml = new XMLNode(xml_file);
}
@ -416,7 +416,7 @@ CURLcode NetworkHttp::loadAddonsList(const XMLNode *xml,
bool forceRefresh)
{
std::string addon_list_url("");
Time::TimeType mtime(0);
StkTime::TimeType mtime(0);
const XMLNode *include = xml->getNode("include");
if(include)
{
@ -456,7 +456,7 @@ CURLcode NetworkHttp::loadAddonsList(const XMLNode *xml,
{
std::string xml_file = file_manager->getAddonsFile("addons.xml");
if(download)
UserConfigParams::m_addons_last_updated=Time::getTimeSinceEpoch();
UserConfigParams::m_addons_last_updated=StkTime::getTimeSinceEpoch();
const XMLNode *xml = new XMLNode(xml_file);
addons_manager->initOnline(xml);
if(UserConfigParams::logAddons())

View File

@ -50,7 +50,7 @@ NewsManager::~NewsManager()
*/
void NewsManager::init()
{
UserConfigParams::m_news_last_updated = Time::getTimeSinceEpoch();
UserConfigParams::m_news_last_updated = StkTime::getTimeSinceEpoch();
std::string xml_file = file_manager->getAddonsFile("news.xml");
const XMLNode *xml = new XMLNode(xml_file);

View File

@ -79,7 +79,7 @@ void PlayerProfile::incrementUseFrequency()
//------------------------------------------------------------------------------
int64_t PlayerProfile::generateUniqueId(const char* playerName)
{
return ((int64_t)(Time::getTimeSinceEpoch()) << 32) |
return ((int64_t)(StkTime::getTimeSinceEpoch()) << 32) |
((rand() << 16) & 0xFFFF0000) |
(StringUtils::simpleHash(playerName) & 0xFFFF);
}

View File

@ -242,7 +242,7 @@ void IntUserConfigParam::findYourDataInAnAttributeOf(const XMLNode* node)
} // findYourDataInAnAttributeOf
// ============================================================================
TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
TimeUserConfigParam::TimeUserConfigParam(StkTime::TimeType default_value,
const char* param_name,
const char* comment)
{
@ -254,7 +254,7 @@ TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
} // TimeUserConfigParam
// ----------------------------------------------------------------------------
TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
TimeUserConfigParam::TimeUserConfigParam(StkTime::TimeType default_value,
const char* param_name,
GroupUserConfigParam* group,
const char* comment)

View File

@ -132,14 +132,14 @@ public:
// ============================================================================
class TimeUserConfigParam : public UserConfigParam
{
Time::TimeType m_value;
Time::TimeType m_default_value;
StkTime::TimeType m_value;
StkTime::TimeType m_default_value;
public:
TimeUserConfigParam(Time::TimeType default_value, const char* param_name,
TimeUserConfigParam(StkTime::TimeType default_value, const char* param_name,
const char* comment = NULL);
TimeUserConfigParam(Time::TimeType default_value, const char* param_name,
TimeUserConfigParam(StkTime::TimeType default_value, const char* param_name,
GroupUserConfigParam* group, const char* comment=NULL);
void write(XMLWriter& stream) const;
@ -148,10 +148,10 @@ public:
irr::core::stringw toString() const;
void revertToDefaults() { m_value = m_default_value; }
operator Time::TimeType() const { return m_value; }
Time::TimeType& operator=(const Time::TimeType& v)
operator StkTime::TimeType() const { return m_value; }
StkTime::TimeType& operator=(const StkTime::TimeType& v)
{ m_value = v; return m_value; }
Time::TimeType& operator=(const TimeUserConfigParam& v)
StkTime::TimeType& operator=(const TimeUserConfigParam& v)
{ m_value = (int)v; return m_value; }
}; // TimeUserConfigParam

View File

@ -26,9 +26,9 @@
*/
Time::TimeType getTime()
StkTime::TimeType getTime()
{
return Time::getTimeSinceEpoch();
return StkTime::getTimeSinceEpoch();
}
//! constructor

View File

@ -149,7 +149,7 @@ using namespace gui;
gui::IGUIFont *OverrideFont, *LastBreakFont;
IOSOperator* Operator;
Time::TimeType BlinkStartTime;
StkTime::TimeType BlinkStartTime;
s32 CursorPos;
s32 HScrollPos, VScrollPos; // scroll position in characters
u32 Max;

View File

@ -244,7 +244,7 @@ FileManager::~FileManager()
}
struct stat mystat;
stat(full_path.c_str(), &mystat);
Time::TimeType current = Time::getTimeSinceEpoch();
StkTime::TimeType current = StkTime::getTimeSinceEpoch();
if(current - mystat.st_ctime <24*3600)
{
if(UserConfigParams::logAddons())

View File

@ -198,7 +198,7 @@ void CutsceneWorld::update(float dt)
curr->reset();
}
m_time = 0.01f;
m_time_at_second_reset = Time::getRealTime();
m_time_at_second_reset = StkTime::getRealTime();
m_second_reset = true;
}
else if (m_second_reset)
@ -213,7 +213,7 @@ void CutsceneWorld::update(float dt)
}
//m_time_at_second_reset = m_time;
m_time_at_second_reset = Time::getRealTime();
m_time_at_second_reset = StkTime::getRealTime();
m_time = 0.01f;
}
else
@ -221,7 +221,7 @@ void CutsceneWorld::update(float dt)
// this way of calculating time and dt is more in line with what
// irrlicht does andprovides better synchronisation
double prev_time = m_time;
double now = Time::getRealTime();
double now = StkTime::getRealTime();
m_time = now - m_time_at_second_reset;
dt = (float)(m_time - prev_time);
}

View File

@ -209,8 +209,8 @@ void AddonsScreen::loadList()
GUIEngine::SpinnerWidget* w_filter_date =
getWidget<GUIEngine::SpinnerWidget>("filter_date");
int date_index = w_filter_date->getValue();
Time::TimeType date = Time::getTimeSinceEpoch();
date = Time::addInterval(date,
StkTime::TimeType date = StkTime::getTimeSinceEpoch();
date = StkTime::addInterval(date,
-m_date_filters[date_index].year,
-m_date_filters[date_index].month,
-m_date_filters[date_index].day);
@ -242,7 +242,7 @@ void AddonsScreen::loadList()
continue;
// Filter by date.
if (date_index != 0 && Time::compareTime(date, addon.getDate()) > 0)
if (date_index != 0 && StkTime::compareTime(date, addon.getDate()) > 0)
continue;
// Filter by name, designer and description.

View File

@ -23,7 +23,7 @@
* time of the application, 1.1.1970, ...).
* The value is a double precision floating point value in seconds.
*/
double Time::getRealTime(long startAt)
double StkTime::getRealTime(long startAt)
{
return irr_driver->getRealTime()/1000.0;
} // getTimeSinceEpoch

View File

@ -31,7 +31,7 @@
#include <string>
class Time
class StkTime
{
public:
typedef time_t TimeType;