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

@@ -17,11 +17,11 @@ class EE_API UIControlAnim : public UIDragable {
virtual bool IsType( const Uint32& type ) const;
virtual void Update();
virtual void Update();
const Float& Angle() const;
const Float& Angle() const;
void Angle( const Float& angle );
void Angle( const Float& angle );
const Vector2f& Scale() const;
@@ -29,31 +29,31 @@ class EE_API UIControlAnim : public UIDragable {
void Scale( const Float& scale );
const Float& Alpha() const;
const Float& Alpha() const;
virtual void Alpha( const Float& alpha );
virtual void Alpha( const Float& alpha );
virtual void AlphaChilds( const Float& alpha );
bool Animating();
bool Animating();
void StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
Interpolation * StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
void StartScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
Waypoints * StartScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
void StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
Waypoints * StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
void StartMovement( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Waypoints::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
Waypoints * StartMovement( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Waypoints::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
void StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
Interpolation * StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, Interpolation::OnPathEndCallback PathEndCallback = Interpolation::OnPathEndCallback() );
void CreateFadeIn( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
Interpolation * CreateFadeIn( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
void CreateFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
Interpolation * CreateFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
void CloseFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
Interpolation * CloseFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
void DisableFadeOut( const Time & Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
Interpolation * DisableFadeOut( const Time & Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear );
Interpolation * RotationInterpolation();
@@ -69,12 +69,12 @@ class EE_API UIControlAnim : public UIDragable {
protected:
friend class UIManager;
Float mAngle;
Float mAngle;
Vector2f mScale;
Float mAlpha;
Float mAlpha;
Interpolation * mAngleAnim;
Waypoints * mScaleAnim;
Waypoints * mScaleAnim;
Interpolation * mAlphaAnim;
Waypoints * mMoveAnim;

View File

@@ -13,19 +13,19 @@ class EE_API UIDragable : public UIControl {
virtual bool IsType( const Uint32& type ) const;
bool Dragging() const;
void Dragging( const bool& dragging );
bool Dragging() const;
void Dragging( const bool& dragging );
const Vector2i& DragPoint() const;
void DragPoint( const Vector2i& Point );
const Vector2i& DragPoint() const;
void DragPoint( const Vector2i& Point );
virtual void Update();
virtual void Update();
bool DragEnable() const;
void DragEnable( const bool& enable );
bool DragEnable() const;
void DragEnable( const bool& enable );
void DragButton( const Uint32& Button );
const Uint32& DragButton() const;
void DragButton( const Uint32& Button );
const Uint32& DragButton() const;
protected:
virtual ~UIDragable();

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();