void AM_initVariables(void) { int pnum; thinker_t *think; //static event_t st_notify = { ev_keyup, AM_MSGENTERED }; automapactive = true; fb = I_VideoBuffer; f_oldloc.x = INT_MAX; amclock = 0; lightlev = 0; m_paninc.x = m_paninc.y = 0; ftom_zoommul = FRACUNIT; mtof_zoommul = FRACUNIT; m_w = FTOM(f_w); m_h = FTOM(f_h); // find player to center on initially if (!playeringame[pnum = consoleplayer]) for (pnum = 0; pnum < maxplayers; pnum++) if (playeringame[pnum]) break; plr = &players[pnum]; oldplr.x = plr->mo->x; oldplr.y = plr->mo->y; m_x = plr->mo->x - m_w / 2; m_y = plr->mo->y - m_h / 2; AM_changeWindowLoc(); // for saving & restoring old_m_x = m_x; old_m_y = m_y; old_m_w = m_w; old_m_h = m_h; // load in the location of keys, if in baby mode // memset(KeyPoints, 0, sizeof(vertex_t)*3); if (gameskill == sk_baby) { for (think = thinkercap.next; think != &thinkercap; think = think->next) { if (think->function != P_MobjThinker) { //not a mobj continue; } } } // inform the status bar of the change //c ST_Responder(&st_notify); }
void AM_Ticker (void) { if (!automapactive) return; amclock++; if (followplayer) 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(); // Update light level // AM_updateLightLev(); }
// // AM_initVariables() // // Initialize the variables for the automap // // Affects the automap global variables // Status bar is notified that the automap has been entered // Passed nothing, returns nothing // void AM_initVariables(void) { int pnum; static event_t st_notify = { ev_keyup, AM_MSGENTERED }; automapactive = true; fb = screens[0]; f_oldloc.x = MAXINT; amclock = 0; lightlev = 0; m_paninc.x = m_paninc.y = 0; ftom_zoommul = FRACUNIT; mtof_zoommul = FRACUNIT; m_w = FTOM(f_w); m_h = FTOM(f_h); // find player to center on initially if (!playeringame[pnum = consoleplayer]) for (pnum=0;pnum<MAXPLAYERS;pnum++) if (playeringame[pnum]) break; plr = &players[pnum]; m_x = plr->mo->x - m_w/2; m_y = plr->mo->y - m_h/2; AM_changeWindowLoc(); // for saving & restoring old_m_x = m_x; old_m_y = m_y; old_m_w = m_w; old_m_h = m_h; // inform the status bar of the change ST_Responder(&st_notify); }
void AM_initVariables(void) { int pnum; thinker_t *think; mobj_t *mo; //static event_t st_notify = { ev_keyup, AM_MSGENTERED }; automapactive = true; // fb = screen; f_oldloc.x = MAXINT; amclock = 0; lightlev = 0; m_paninc.x = m_paninc.y = 0; ftom_zoommul = FRACUNIT; mtof_zoommul = FRACUNIT; m_w = FTOM(f_w); m_h = FTOM(f_h); // find player to center on initially if(!players[pnum = consoleplayer].plr->ingame) for(pnum = 0; pnum < MAXPLAYERS; pnum++) if(players[pnum].plr->ingame) break; plr = &players[pnum]; oldplr.x = plr->plr->mo->x; oldplr.y = plr->plr->mo->y; m_x = plr->plr->mo->x - m_w / 2; m_y = plr->plr->mo->y - m_h / 2; AM_changeWindowLoc(); // for saving & restoring old_m_x = m_x; old_m_y = m_y; old_m_w = m_w; old_m_h = m_h; // load in the location of keys, if in baby mode memset(KeyPoints, 0, sizeof(vertex_t) * 3); if(gameskill == sk_baby) { for(think = thinkercap.next; think != &thinkercap; think = think->next) { if(think->function != P_MobjThinker) { //not a mobj continue; } mo = (mobj_t *) think; if(mo->type == MT_CKEY) { KeyPoints[0].x = mo->x; KeyPoints[0].y = mo->y; } else if(mo->type == MT_AKYY) { KeyPoints[1].x = mo->x; KeyPoints[1].y = mo->y; } else if(mo->type == MT_BKYY) { KeyPoints[2].x = mo->x; KeyPoints[2].y = mo->y; } } } // inform the status bar of the change //c ST_Responder(&st_notify); }