Fix transition bug

This commit is contained in:
a1batross 2016-04-06 16:29:31 +03:00
parent 85c4818254
commit 699849b124

View File

@ -53,18 +53,18 @@ float UI_GetTitleTransFraction( void )
void LerpQuad( ui_quad_t a, ui_quad_t b, float frac, ui_quad_t *c )
{
c->x = a.x + (b.x - a.x) * frac;
c->y = a.y + (b.y - a.y) * frac;
c->x = a.x + (b.x - a.x ) * frac;
c->y = a.y + (b.y - a.y ) * frac;
c->lx = a.lx + (b.lx - a.lx) * frac;
c->ly = a.ly + (b.ly - a.ly) * frac;
}
void UI_SetupTitleQuad()
{
TitleLerpQuads[1].x = UI_BANNER_POSX + BANNER_X_FIX;
TitleLerpQuads[1].y = UI_BANNER_POSY + BANNER_Y_FIX;
TitleLerpQuads[1].lx = UI_BANNER_WIDTH - 125;
TitleLerpQuads[1].ly = UI_BANNER_HEIGHT - 40;
TitleLerpQuads[1].x = UI_BANNER_POSX * ScreenHeight / 768;
TitleLerpQuads[1].y = UI_BANNER_POSY * ScreenHeight / 768;
TitleLerpQuads[1].lx = UI_BANNER_WIDTH * ScreenHeight / 768;
TitleLerpQuads[1].ly = UI_BANNER_HEIGHT * ScreenHeight / 768;
}
void UI_DrawTitleAnim()
@ -76,7 +76,6 @@ void UI_DrawTitleAnim()
wrect_t r = { 0, uiStatic.buttons_width, 26, 51 };
float frac = UI_GetTitleTransFraction();/*(sin(gpGlobals->time*4)+1)/2*/;
#ifdef TA_ALT_MODE
if( frac == 1 && transition_state == AS_TO_BUTTON )
return;
@ -98,7 +97,7 @@ void UI_DrawTitleAnim()
void UI_SetTitleAnim( int anim_state, menuPicButton_s *button )
{
// skip buttons which don't call new menu
if( !button || PreClickDepth == uiStatic.menuDepth && anim_state == AS_TO_TITLE )
if( !button || (PreClickDepth == uiStatic.menuDepth && anim_state == AS_TO_TITLE) )
return;
// replace cancel\done button with button which called this menu