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