Sys::GetDateTimeStr now returns a different format for the date string.

Minor clean up.
This commit is contained in:
Martín Lucas Golini
2014-08-07 02:57:54 -03:00
parent b66a467a57
commit ea4476f134
8 changed files with 58 additions and 72 deletions

View File

@@ -483,29 +483,17 @@ double Sys::GetSystemTime() {
}
std::string Sys::GetDateTimeStr() {
std::string str;
time_t rawtime;
time ( &rawtime );
#ifdef EE_COMPILER_MSVC
char buf[256];
struct tm timeinfo;
localtime_s ( &timeinfo, &rawtime );
asctime_s( &buf[0], 256, &timeinfo );
str = std::string( buf );
#else
char buf[64];
struct tm * timeinfo;
timeinfo = localtime ( &rawtime );
str = std::string( asctime (timeinfo) );
#endif
if ( str[ str.length() - 1 ] == '\n' )
{
str = str.substr( 0, str.length() - 1 );
}
strftime(buf, sizeof(buf), "%Y-%m-%d %X", timeinfo);
return str;
return std::string( buf );
}
#define EE_MAX_CFG_PATH_LEN 1024

View File

@@ -183,7 +183,7 @@ bool UIControlAnim::Animating() {
return ( NULL != mAlphaAnim && mAlphaAnim->Enabled() ) || ( NULL != mAngleAnim && mAngleAnim->Enabled() ) || ( NULL != mScaleAnim && mScaleAnim->Enabled() ) || ( NULL != mMoveAnim && mMoveAnim->Enabled() );
}
void UIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
Interpolation * UIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
if ( NULL == mAlphaAnim )
mAlphaAnim = eeNew( Interpolation, () );
@@ -210,9 +210,11 @@ void UIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const Ti
CurChild = CurChild->NextGet();
}
}
return mAlphaAnim;
}
void UIControlAnim::StartScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
Waypoints * UIControlAnim::StartScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
if ( NULL == mScaleAnim )
mScaleAnim = eeNew( Waypoints, () );
@@ -224,13 +226,15 @@ void UIControlAnim::StartScaleAnim( const Vector2f& From, const Vector2f& To, co
mScaleAnim->Type( Type );
Scale( From );
return mScaleAnim;
}
void UIControlAnim::StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
StartScaleAnim( Vector2f( From, From ), Vector2f( To, To ), TotalTime, Type, PathEndCallback );
Waypoints * UIControlAnim::StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
return StartScaleAnim( Vector2f( From, From ), Vector2f( To, To ), TotalTime, Type, PathEndCallback );
}
void UIControlAnim::StartMovement( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& Type, Waypoints::OnPathEndCallback PathEndCallback ) {
Waypoints * UIControlAnim::StartMovement( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& Type, Waypoints::OnPathEndCallback PathEndCallback ) {
if ( NULL == mMoveAnim )
mMoveAnim = eeNew( Waypoints, () );
@@ -242,9 +246,11 @@ void UIControlAnim::StartMovement( const Vector2i& From, const Vector2i& To, con
mMoveAnim->Type( Type );
Pos( From );
return mMoveAnim;
}
void UIControlAnim::StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
Interpolation * UIControlAnim::StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) {
if ( NULL == mAngleAnim )
mAngleAnim = eeNew( Interpolation, () );
@@ -256,27 +262,32 @@ void UIControlAnim::StartRotation( const Float& From, const Float& To, const Tim
mAngleAnim->Type( Type );
Angle( From );
return mAngleAnim;
}
void UIControlAnim::CreateFadeIn( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
StartAlphaAnim( mAlpha, 255.f, Time, AlphaChilds, Type );
Interpolation * UIControlAnim::CreateFadeIn( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
return StartAlphaAnim( mAlpha, 255.f, Time, AlphaChilds, Type );
}
void UIControlAnim::CreateFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
StartAlphaAnim( 255.f, mAlpha, Time, AlphaChilds, Type );
Interpolation * UIControlAnim::CreateFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
return StartAlphaAnim( 255.f, mAlpha, Time, AlphaChilds, Type );
}
void UIControlAnim::CloseFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
Interpolation * UIControlAnim::CloseFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
StartAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type );
mControlFlags |= UI_CTRL_FLAG_CLOSE_FO;
return mAlphaAnim;
}
void UIControlAnim::DisableFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
Interpolation * UIControlAnim::DisableFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
Enabled( false );
StartAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type );
mControlFlags |= UI_CTRL_FLAG_DISABLE_FADE_OUT;
return mAlphaAnim;
}
void UIControlAnim::BackgroundDraw() {

View File

@@ -184,10 +184,7 @@ void UIDropDownList::Show() {
mListBox->Visible( true );
if ( UIThemeManager::instance()->DefaultEffectsEnabled() ) {
if ( 255.f == mListBox->Alpha() )
mListBox->StartAlphaAnim( 0.f, 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
else
mListBox->CreateFadeIn( UIThemeManager::instance()->ControlsFadeInTime() );
mListBox->StartAlphaAnim( 255.f == mListBox->Alpha() ? 0.f : mListBox->Alpha(), 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
}
}

View File

@@ -38,10 +38,7 @@ bool UIPopUpMenu::Show() {
ToFront();
if ( UIThemeManager::instance()->DefaultEffectsEnabled() ) {
if ( 255.f == Alpha() )
StartAlphaAnim( 0.f, 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
else
CreateFadeIn( UIThemeManager::instance()->ControlsFadeInTime() );
StartAlphaAnim( 255.f == mAlpha ? 0.f : mAlpha, 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
}
SetFocus();

View File

@@ -73,10 +73,7 @@ void UITooltip::Show() {
Visible( true );
if ( UIThemeManager::instance()->DefaultEffectsEnabled() ) {
if ( 255.f == mAlpha )
StartAlphaAnim( 0.f, 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
else
CreateFadeIn( UIThemeManager::instance()->ControlsFadeInTime() );
StartAlphaAnim( 255.f == mAlpha ? 0.f : mAlpha, 255.f, UIThemeManager::instance()->ControlsFadeInTime() );
}
}
}

View File

@@ -715,11 +715,7 @@ bool UIWindow::Show() {
SetFocus();
if ( mBaseAlpha == Alpha() ) {
StartAlphaAnim( 0.f, mBaseAlpha, UIThemeManager::instance()->ControlsFadeInTime() );
} else {
StartAlphaAnim( mAlpha, mBaseAlpha, UIThemeManager::instance()->ControlsFadeInTime() );
}
StartAlphaAnim( mBaseAlpha == Alpha() ? 0.f : mAlpha, mBaseAlpha, UIThemeManager::instance()->ControlsFadeInTime() );
if ( IsModal() ) {
CreateModalControl();