const fix

This commit is contained in:
Glenn Maynard
2006-01-15 07:12:05 +00:00
parent 6be6053227
commit 1d186c481d
4 changed files with 17 additions and 16 deletions
+9 -8
View File
@@ -104,9 +104,9 @@ public:
float GetX() const { return m_current.pos.x; };
float GetY() const { return m_current.pos.y; };
float GetZ() const { return m_current.pos.z; };
float GetDestX() { return DestTweenState().pos.x; };
float GetDestY() { return DestTweenState().pos.y; };
float GetDestZ() { return DestTweenState().pos.z; };
float GetDestX() const { return DestTweenState().pos.x; };
float GetDestY() const { return DestTweenState().pos.y; };
float GetDestZ() const { return DestTweenState().pos.z; };
void SetX( float x ) { DestTweenState().pos.x = x; };
void SetY( float y ) { DestTweenState().pos.y = y; };
void SetZ( float z ) { DestTweenState().pos.z = z; };
@@ -116,10 +116,10 @@ public:
void AddZ( float z ) { SetZ( GetDestZ()+z ); }
// height and width vary depending on zoom
float GetUnzoomedWidth() { return m_size.x; }
float GetUnzoomedHeight() { return m_size.y; }
float GetZoomedWidth() { return m_size.x * m_baseScale.x * DestTweenState().scale.x; }
float GetZoomedHeight() { return m_size.y * m_baseScale.y * DestTweenState().scale.y; }
float GetUnzoomedWidth() const { return m_size.x; }
float GetUnzoomedHeight() const { return m_size.y; }
float GetZoomedWidth() const { return m_size.x * m_baseScale.x * DestTweenState().scale.x; }
float GetZoomedHeight() const { return m_size.y * m_baseScale.y * DestTweenState().scale.y; }
void SetWidth( float width ) { m_size.x = width; }
void SetHeight( float height ) { m_size.y = height; }
@@ -208,7 +208,7 @@ public:
virtual void HurryTweening( float factor );
// Let ActorFrame and BGAnimation override
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
TweenState& DestTweenState() // where Actor will end when its tween finish
TweenState& DestTweenState() // where Actor will end when its tween finish
{
if( m_pTempState != NULL ) // effect_lua running
return *m_pTempState;
@@ -217,6 +217,7 @@ public:
else
return m_Tweens.back()->state;
}
const TweenState& DestTweenState() const { return const_cast<Actor*>(this)->DestTweenState(); }
enum StretchType { fit_inside, cover };
+3 -3
View File
@@ -740,7 +740,7 @@ void OptionRow::SetOptionIcon( PlayerNumber pn, const CString &sText, GameComman
LUA->UnsetGlobal( "ThisGameCommand" );
}
BitmapText &OptionRow::GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow )
const BitmapText &OptionRow::GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow ) const
{
bool bOneChoice = m_RowDef.m_bOneChoiceForAllPlayers;
int index = -1;
@@ -763,9 +763,9 @@ BitmapText &OptionRow::GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow )
return *m_textItems[index];
}
void OptionRow::GetWidthXY( PlayerNumber pn, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut )
void OptionRow::GetWidthXY( PlayerNumber pn, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ) const
{
BitmapText &text = GetTextItemForRow( pn, iChoiceOnRow );
const BitmapText &text = GetTextItemForRow( pn, iChoiceOnRow );
iWidthOut = int(roundf( text.GetZoomedWidth() ));
iXOut = int(roundf( text.GetDestX() ));
+3 -3
View File
@@ -188,12 +188,12 @@ public:
RowType GetRowType() const { return m_RowType; }
OptionRowHandler *GetHandler() { return m_pHand; }
BitmapText &GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow );
void GetWidthXY( PlayerNumber pn, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut );
const BitmapText &GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow ) const;
void GetWidthXY( PlayerNumber pn, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ) const;
// ScreenOptions calls positions m_FrameDestination, then m_Frame tween to that same TweenState.
void SetRowHidden( bool bRowHidden ) { m_bHidden = bRowHidden; }
bool GetRowHidden() { return m_bHidden; }
bool GetRowHidden() const { return m_bHidden; }
unsigned GetTextItemsSize() const { return m_textItems.size(); }
bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; }
+2 -2
View File
@@ -134,7 +134,7 @@ void ScreenOptionsMaster::BeginFadingOut()
int iCurRow = this->GetCurrentRow();
ASSERT( iCurRow >= 0 && iCurRow < (int)m_pRows.size() );
OptionRow &row = *m_pRows[iCurRow];
const OptionRow &row = *m_pRows[iCurRow];
{
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
@@ -143,7 +143,7 @@ void ScreenOptionsMaster::BeginFadingOut()
// not the "goes down" item
if( iChoice != -1 && iCurRow < (int) m_OptionRowHandlers.size() )
{
OptionRowHandler *pHand = m_OptionRowHandlers[iCurRow];
const OptionRowHandler *pHand = m_OptionRowHandlers[iCurRow];
if( pHand != NULL )
m_bExportWillSetANewScreen = pHand->HasScreen( iChoice );
}