- Timestamp:
- 06/03/04 03:42:40 (21 years ago)
- Location:
- ps/trunk/source/ps
- Files:
-
- 2 edited
-
CConsole.cpp (modified) (4 diffs)
-
CConsole.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/ps/CConsole.cpp
r374 r377 10 10 m_bVisible = false; 11 11 12 m_ VisibleFrac = 0.0f;12 m_fVisibleFrac = 0.0f; 13 13 14 14 m_szBuffer = (char*)malloc(sizeof(char) * BUFFER_SIZE); … … 115 115 if(m_bVisible) 116 116 { 117 m_ VisibleFrac += Delta;118 if(m_ VisibleFrac > 1.0f)117 m_fVisibleFrac += Delta; 118 if(m_fVisibleFrac > 1.0f) 119 119 { 120 m_ VisibleFrac = 1.0f;120 m_fVisibleFrac = 1.0f; 121 121 m_bToggle = false; 122 122 } … … 124 124 else 125 125 { 126 m_ VisibleFrac -= Delta;127 if(m_ VisibleFrac < 0.0f)126 m_fVisibleFrac -= Delta; 127 if(m_fVisibleFrac < 0.0f) 128 128 { 129 m_ VisibleFrac = 0.0f;129 m_fVisibleFrac = 0.0f; 130 130 m_bToggle = false; 131 131 } … … 141 141 // animation: slide in from top of screen 142 142 const float MaxY = m_fHeight; 143 const float DeltaY = (1.0f - m_ VisibleFrac) * MaxY;143 const float DeltaY = (1.0f - m_fVisibleFrac) * MaxY; 144 144 145 145 glTranslatef(m_fX, m_fY + DeltaY, 0.0f); //Move to window position -
ps/trunk/source/ps/CConsole.h
r374 r377 27 27 float m_fWidth; 28 28 29 // show / hide animation 30 float m_VisibleFrac; 29 // "position" in show/hide animation, how visible the console is (0..1). 30 // allows implementing other animations than sliding, e.g. fading in/out. 31 float m_fVisibleFrac; 31 32 32 33 std::map<std::string, fptr> m_mapFuncList; … … 42 43 43 44 bool m_bFocus; 44 bool m_bVisible; 45 bool m_bToggle; 45 bool m_bVisible; // console is to be drawn 46 bool m_bToggle; // show/hide animation is currently active 46 47 47 48 char* ToLower(const char* szMessage, uint iSize = 0);
Note:
See TracChangeset
for help on using the changeset viewer.
