Daily Coding Horrors

Maravillosidades varias que se encuentra uno… toma, cómetelo con patatas.

//----------------------------------------------------------
bool TMenuState::doProcessState(float _dt)
{
if (getStuff()->getInputController())
{
TEventInfo mEventInfo;
if (getGame()->getInputController()->getEvent(E_ET_TOUCH_RELEASE, mEventInfo))
{
m_scrollInfo[0].fDragOld = 0;
m_scrollInfo[1].fDragOld = 0;

if (!m_scrollTouchCallback.empty())
{
Vector2 touchMoved = mEventInfo.pointing->touches[0]._locationBegan - mEventInfo.pointing->touches[0]._locationMoved;

#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
auCamera::TViewPort vp;
auVideo::getRenderStateCache()->getViewport(vp);
auCamera::EOrientation orientation = vp.getOrientation();

if (orientation == auCamera::EOrientationPortraitUpsideDown || orientation == auCamera::EOrientationLandscapeLeft)
touchMoved *= -1;
#endif
std::ostringstream oss;
oss << m_scrollTouchCallback << "(" << InputGesture::TOUCH_MIN_DRAG_DISP) ? "true" : "false") << ", " << MIN_TOUCH_SCROLL_MOVE) ? "true" : "false") << execute(oss.str().c_str()); } } else { bool bPressed = getGame()->getInputController()->getEvent(E_ET_TOUCH, mEventInfo);
processScroll(mEventInfo, bPressed, 0, _dt);	// Procesa scroll horizontal
processScroll(mEventInfo, bPressed, 1, _dt);	// Procesa scroll vertical
}

traverseMenu();
}

return true;
}