diff --git a/src/f_finale.c b/src/f_finale.c index b5715b863f8dcde6ee8d9f5cc621ab9ea7f72ccb..2c45aecc984997f7d329e0bff3371b6c9d93d71c 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -62,8 +62,6 @@ static tic_t stoptimer; static boolean keypressed = false; // (no longer) De-Demo'd Title Screen -static tic_t xscrolltimer; -static tic_t yscrolltimer; static INT32 menuanimtimer; // Title screen: background animation timing mobj_t *titlemapcameraref = NULL; @@ -2320,6 +2318,7 @@ void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname) INT32 pw, ph; // scaled by dupz patch_t *pat; INT32 i, j; + fixed_t fracmenuanimtimer, xscrolltimer, yscrolltimer; if (rendermode == render_none) return; @@ -2346,12 +2345,13 @@ void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname) tilex = max(FixedCeil(FixedDiv(vid.width, pw)) >> FRACBITS, 1)+2; // one tile on both sides of center tiley = max(FixedCeil(FixedDiv(vid.height, ph)) >> FRACBITS, 1)+2; - xscrolltimer = ((menuanimtimer*scrollxspeed)/16 + patwidth*xneg) % (patwidth); - yscrolltimer = ((menuanimtimer*scrollyspeed)/16 + patheight*yneg) % (patheight); + fracmenuanimtimer = (menuanimtimer * FRACUNIT) - (FRACUNIT - rendertimefrac); + xscrolltimer = ((fracmenuanimtimer*scrollxspeed)/16 + patwidth*xneg*FRACUNIT) % (patwidth * FRACUNIT); + yscrolltimer = ((fracmenuanimtimer*scrollyspeed)/16 + patheight*yneg*FRACUNIT) % (patheight * FRACUNIT); // coordinate offsets - xscrolled = xscrolltimer * dupz; - yscrolled = yscrolltimer * dupz; + xscrolled = FixedInt(xscrolltimer * dupz); + yscrolled = FixedInt(yscrolltimer * dupz); for (x = (xispos) ? -pw*(tilex-1)+pw : 0, i = 0; i < tilex; diff --git a/src/m_menu.c b/src/m_menu.c index ec5b3048b2734064c4debb96709ea67d39a79e8e..9b29d56ae12d3dbaa09411c65bb9c4582baf9361 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -171,8 +171,8 @@ static INT32 vidm_nummodes; static INT32 vidm_column_size; // new menus -static tic_t recatkdrawtimer = 0; -static tic_t ntsatkdrawtimer = 0; +static fixed_t recatkdrawtimer = 0; +static fixed_t ntsatkdrawtimer = 0; static tic_t charseltimer = 0; static fixed_t char_scroll = 0; @@ -5808,7 +5808,7 @@ static void M_DrawRecordAttackForeground(void) for (i = -12; i < (BASEVIDHEIGHT/height) + 12; i++) { - INT32 y = ((i*height) - (height - ((recatkdrawtimer*2)%height))); + INT32 y = ((i*height) - (height - ((FixedInt(recatkdrawtimer*2))%height))); // don't draw above the screen { INT32 sy = FixedMul(y, dupz<<FRACBITS) >> FRACBITS; @@ -5825,17 +5825,18 @@ static void M_DrawRecordAttackForeground(void) } // draw clock - fa = (FixedAngle(((recatkdrawtimer * 4) % 360)<<FRACBITS)>>ANGLETOFINESHIFT) & FINEMASK; + fa = (FixedAngle(((FixedInt(recatkdrawtimer * 4)) % 360)<<FRACBITS)>>ANGLETOFINESHIFT) & FINEMASK; V_DrawSciencePatch(160<<FRACBITS, (80<<FRACBITS) + (4*FINESINE(fa)), 0, clock, FRACUNIT); // Increment timer. - recatkdrawtimer++; + recatkdrawtimer += renderdeltatics; + if (recatkdrawtimer < 0) recatkdrawtimer = 0; } // NiGHTS Attack background. static void M_DrawNightsAttackMountains(void) { - static INT32 bgscrollx; + static fixed_t bgscrollx; INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); patch_t *background = W_CachePatchName(curbgname, PU_PATCH); INT16 w = background->width; @@ -5851,7 +5852,7 @@ static void M_DrawNightsAttackMountains(void) if (x < BASEVIDWIDTH) V_DrawScaledPatch(x, y, V_SNAPTOLEFT, background); - bgscrollx += (FRACUNIT/2); + bgscrollx += FixedMul(FRACUNIT/2, renderdeltatics); if (bgscrollx > w<<FRACBITS) bgscrollx &= 0xFFFF; } @@ -5882,7 +5883,7 @@ static void M_DrawNightsAttackBackground(void) M_DrawNightsAttackMountains(); // back top foreground patch - x = 0-(ntsatkdrawtimer%backtopwidth); + x = 0-(FixedInt(ntsatkdrawtimer)%backtopwidth); V_DrawScaledPatch(x, y, V_SNAPTOTOP|V_SNAPTOLEFT, backtopfg); for (i = 0; i < 3; i++) { @@ -5893,7 +5894,7 @@ static void M_DrawNightsAttackBackground(void) } // front top foreground patch - x = 0-((ntsatkdrawtimer*2)%fronttopwidth); + x = 0-(FixedInt(ntsatkdrawtimer*2)%fronttopwidth); V_DrawScaledPatch(x, y, V_SNAPTOTOP|V_SNAPTOLEFT, fronttopfg); for (i = 0; i < 3; i++) { @@ -5904,7 +5905,7 @@ static void M_DrawNightsAttackBackground(void) } // back bottom foreground patch - x = 0-(ntsatkdrawtimer%backbottomwidth); + x = 0-(FixedInt(ntsatkdrawtimer)%backbottomwidth); y = BASEVIDHEIGHT - backbottomheight; V_DrawScaledPatch(x, y, V_SNAPTOBOTTOM|V_SNAPTOLEFT, backbottomfg); for (i = 0; i < 3; i++) @@ -5916,7 +5917,7 @@ static void M_DrawNightsAttackBackground(void) } // front bottom foreground patch - x = 0-((ntsatkdrawtimer*2)%frontbottomwidth); + x = 0-(FixedInt(ntsatkdrawtimer*2)%frontbottomwidth); y = BASEVIDHEIGHT - frontbottomheight; V_DrawScaledPatch(x, y, V_SNAPTOBOTTOM|V_SNAPTOLEFT, frontbottomfg); for (i = 0; i < 3; i++) @@ -5928,7 +5929,8 @@ static void M_DrawNightsAttackBackground(void) } // Increment timer. - ntsatkdrawtimer++; + ntsatkdrawtimer += renderdeltatics; + if (ntsatkdrawtimer < 0) ntsatkdrawtimer = 0; } // NiGHTS Attack floating Super Sonic. @@ -5936,8 +5938,8 @@ static patch_t *ntssupersonic[2]; static void M_DrawNightsAttackSuperSonic(void) { const UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_YELLOW, GTC_CACHE); - INT32 timer = (ntsatkdrawtimer/4) % 2; - angle_t fa = (FixedAngle(((ntsatkdrawtimer * 4) % 360)<<FRACBITS)>>ANGLETOFINESHIFT) & FINEMASK; + INT32 timer = FixedInt(ntsatkdrawtimer/4) % 2; + angle_t fa = (FixedAngle((FixedInt(ntsatkdrawtimer * 4) % 360)<<FRACBITS)>>ANGLETOFINESHIFT) & FINEMASK; V_DrawFixedPatch(235<<FRACBITS, (120<<FRACBITS) - (8*FINESINE(fa)), FRACUNIT, 0, ntssupersonic[timer], colormap); }