From: <ent...@ma...> - 2012-03-21 11:21:58
|
Author: entryway Date: Wed Mar 21 12:21:41 2012 New Revision: 4222 Modified: branches/prboom-plus-24/prboom2/src/am_map.c branches/prboom-plus-24/prboom2/src/am_map.h branches/prboom-plus-24/prboom2/src/d_main.c branches/prboom-plus-24/prboom2/src/g_game.c Log: refactoring of automap code (related to uncapeed framerate) Modified: branches/prboom-plus-24/prboom2/src/am_map.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/am_map.c (original) +++ branches/prboom-plus-24/prboom2/src/am_map.c Wed Mar 21 12:21:41 2012 @@ -475,16 +475,8 @@ AM_rotate(&incx, &incy, viewangle - ANG90); } - if (movement_smooth) - { - m_x = prev_m_x + incx; - m_y = prev_m_y + incy; - } - else - { - m_x += incx; - m_y += incy; - } + m_x = prev_m_x + incx; + m_y = prev_m_y + incy; if (!(automapmode & am_rotate)) { @@ -546,13 +538,6 @@ } } -void AM_savePrevLocAndScale(void) -{ - prev_scale_mtof = scale_mtof; - prev_m_x = m_x; - prev_m_y = m_y; -} - // // AM_initVariables() // @@ -585,7 +570,7 @@ plr = &players[pnum]; m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;//e6y m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;//e6y - AM_savePrevLocAndScale(); + AM_Ticker(); AM_changeWindowLoc(); // for saving & restoring @@ -998,19 +983,9 @@ // void AM_Ticker (void) { - if (!(automapmode & am_active)) - return; - - if (automapmode & am_follow) - AM_doFollowPlayer(); - - // Change the zoom if necessary - if (ftom_zoommul != FRACUNIT) - AM_changeWindowScale(); - - // Change x,y location - if (m_paninc.x || m_paninc.y) - AM_changeWindowLoc(); + prev_scale_mtof = scale_mtof; + prev_m_x = m_x; + prev_m_y = m_y; } // @@ -2303,15 +2278,19 @@ void AM_Drawer (void) { // CPhipps - all automap modes put into one enum - if (!(automapmode & am_active)) return; + if (!(automapmode & am_active)) + return; if (automapmode & am_follow) - { - m_x = (viewx >> FRACTOMAPBITS) - m_w/2; - m_y = (viewy >> FRACTOMAPBITS) - m_h/2; - m_x2 = m_x + m_w; - m_y2 = m_y + m_h; - } + AM_doFollowPlayer(); + + // Change the zoom if necessary + if (ftom_zoommul != FRACUNIT) + AM_changeWindowScale(); + + // Change x,y location + if (m_paninc.x || m_paninc.y) + AM_changeWindowLoc(); AM_setFrameVariables(); Modified: branches/prboom-plus-24/prboom2/src/am_map.h ============================================================================== --- branches/prboom-plus-24/prboom2/src/am_map.h (original) +++ branches/prboom-plus-24/prboom2/src/am_map.h Wed Mar 21 12:21:41 2012 @@ -68,9 +68,6 @@ // Called by main loop. void AM_Ticker (void); -// For interpolation -void AM_savePrevLocAndScale(void); - // Called by main loop, // called instead of view drawer if automap active. void AM_Drawer (void); Modified: branches/prboom-plus-24/prboom2/src/d_main.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/d_main.c (original) +++ branches/prboom-plus-24/prboom2/src/d_main.c Wed Mar 21 12:21:41 2012 @@ -363,8 +363,6 @@ if (automapmode & am_active) { - if (movement_smooth) - AM_Ticker(); AM_Drawer(); } Modified: branches/prboom-plus-24/prboom2/src/g_game.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/g_game.c (original) +++ branches/prboom-plus-24/prboom2/src/g_game.c Wed Mar 21 12:21:41 2012 @@ -1150,12 +1150,9 @@ { case GS_LEVEL: P_Ticker (); - P_WalkTicker();//e6y - mlooky = 0;//e6y - if (!movement_smooth) - AM_Ticker(); - else - AM_savePrevLocAndScale(); + P_WalkTicker(); + mlooky = 0; + AM_Ticker(); ST_Ticker (); HU_Ticker (); break; |