From a5938f5e13815bc27db5d0dd2f6b995efb1bae30 Mon Sep 17 00:00:00 2001 From: janwas Date: Thu, 3 Jun 2004 01:42:40 +0000 Subject: [PATCH] tiny bit of dox This was SVN commit r377. --- source/ps/CConsole.cpp | 16 ++++++++-------- source/ps/CConsole.h | 9 +++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 4bc28a2b8b..5bdcc9f815 100755 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -9,7 +9,7 @@ CConsole::CConsole(float X, float Y, float W, float H) m_bToggle = false; m_bVisible = false; - m_VisibleFrac = 0.0f; + m_fVisibleFrac = 0.0f; m_szBuffer = (char*)malloc(sizeof(char) * BUFFER_SIZE); FlushBuffer(); @@ -114,19 +114,19 @@ void CConsole::Update(const float DeltaTime) const float Delta = DeltaTime / AnimateTime; if(m_bVisible) { - m_VisibleFrac += Delta; - if(m_VisibleFrac > 1.0f) + m_fVisibleFrac += Delta; + if(m_fVisibleFrac > 1.0f) { - m_VisibleFrac = 1.0f; + m_fVisibleFrac = 1.0f; m_bToggle = false; } } else { - m_VisibleFrac -= Delta; - if(m_VisibleFrac < 0.0f) + m_fVisibleFrac -= Delta; + if(m_fVisibleFrac < 0.0f) { - m_VisibleFrac = 0.0f; + m_fVisibleFrac = 0.0f; m_bToggle = false; } } @@ -140,7 +140,7 @@ void CConsole::Render() // animation: slide in from top of screen const float MaxY = m_fHeight; - const float DeltaY = (1.0f - m_VisibleFrac) * MaxY; + const float DeltaY = (1.0f - m_fVisibleFrac) * MaxY; glTranslatef(m_fX, m_fY + DeltaY, 0.0f); //Move to window position diff --git a/source/ps/CConsole.h b/source/ps/CConsole.h index f967fd8bc2..db62ff5e64 100755 --- a/source/ps/CConsole.h +++ b/source/ps/CConsole.h @@ -26,8 +26,9 @@ private: float m_fHeight; float m_fWidth; - // show / hide animation - float m_VisibleFrac; + // "position" in show/hide animation, how visible the console is (0..1). + // allows implementing other animations than sliding, e.g. fading in/out. + float m_fVisibleFrac; std::map m_mapFuncList; @@ -41,8 +42,8 @@ private: int m_iBufferLength; bool m_bFocus; - bool m_bVisible; - bool m_bToggle; + bool m_bVisible; // console is to be drawn + bool m_bToggle; // show/hide animation is currently active char* ToLower(const char* szMessage, uint iSize = 0); char* Trim(const char* szMessage, const char cChar = 32, uint iSize = 0);