Changed WheelBase::SetItemPosition to make it send the item index and num items args to the transform function.

This commit is contained in:
Kyzentun Keeslala
2015-09-10 21:39:39 -06:00
parent 0d5a3fdfc1
commit 493751c6d2
2 changed files with 4 additions and 15 deletions
+3 -14
View File
@@ -98,20 +98,9 @@ void WheelBase::BeginScreen()
m_WheelState = STATE_SELECTING; m_WheelState = STATE_SELECTING;
} }
void WheelBase::SetItemPosition( Actor &item, float fPosOffsetsFromMiddle ) void WheelBase::SetItemPosition(Actor &item, int item_index, float offset_from_middle)
{ {
/* Don't supply and item index or num items. The number of items can be so Actor::TweenState ts = m_exprItemTransformFunction.GetTransformCached(offset_from_middle, item_index, NUM_WHEEL_ITEMS);
* large that transforms that depend on such large numbers are likely to break. */
int iItemIndex = 0; // dummy
int iNumItems = 1; // dummy
Actor::TweenState ts = m_exprItemTransformFunction.GetTransformCached( fPosOffsetsFromMiddle, iItemIndex, iNumItems );
// Round to achieve pixel alignment. Any benefit to moving this to Lua? -Chris
ts.pos.x = roundf( ts.pos.x );
ts.pos.y = roundf( ts.pos.y );
ts.pos.z = roundf( ts.pos.z );
item.DestTweenState() = ts; item.DestTweenState() = ts;
} }
@@ -152,7 +141,7 @@ void WheelBase::SetPositions()
else else
pDisplay->SetVisible( true ); pDisplay->SetVisible( true );
SetItemPosition( *pDisplay, fOffsetFromSelection ); SetItemPosition(*pDisplay, i, fOffsetFromSelection);
} }
} }
+1 -1
View File
@@ -49,7 +49,7 @@ public:
bool IsSettled() const; bool IsSettled() const;
void GetItemPosition( float fPosOffsetsFromMiddle, float& fX_out, float& fY_out, float& fZ_out, float& fRotationX_out ); void GetItemPosition( float fPosOffsetsFromMiddle, float& fX_out, float& fY_out, float& fZ_out, float& fRotationX_out );
void SetItemPosition( Actor &item, float fPosOffsetsFromMiddle ); void SetItemPosition(Actor &item, int item_index, float offset_from_middle);
virtual bool Select(); // return true if this selection can end the screen virtual bool Select(); // return true if this selection can end the screen