diff --git a/src/d_main.c b/src/d_main.c index 39f354ba5..ad65138e8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1221,6 +1221,7 @@ boolean nametaggfx = false; // Nametag stuffs boolean driftgaugegfx = false; // Driftgauge stuffs boolean multiitem_icon = false; // Extra icons for Sneakers, Banana and Jawz boolean joystickicon = false; // Extra icons for the joystick input display +boolean minidoticon = false; // Dot graphic for minimap player angle display // static void IdentifyVersion(void) @@ -1433,6 +1434,11 @@ static void D_CheckSaturnExtraFiles(void) joystickicon = true; PUSHCONS(inputdisplay_cons_temp, last_inputdisplay_i, 3, "StickGFX"); } + + if (W_LumpExists("MMAPDOT")) + { + minidoticon = true; + } } // now check for colour hud stuff diff --git a/src/d_main.h b/src/d_main.h index 41ccce20f..f8e5b0b41 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -52,6 +52,7 @@ extern boolean nametaggfx; // Nametag stuffs extern boolean driftgaugegfx; // Driftgauge stuffs extern boolean multiitem_icon; // Extra icons for Sneakers, Banana and Jawz extern boolean joystickicon; // Extra icons for the joystick input display +extern boolean minidoticon; // Dot icon for minimap player angle display // // autoload stuff diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 4ec6f43ba..b4ee22d93 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -149,8 +149,9 @@ extern consvar_t cv_pingstyle; //extern consvar_t cv_smallpos; extern consvar_t cv_showminimapnames; extern consvar_t cv_minihead; +extern consvar_t cv_showminimapangle; -extern consvar_t cv_showlapemblem; +extern consvar_t cv_showlapemblem; extern consvar_t cv_showviewpointtext; extern consvar_t cv_showdownloadprompt; diff --git a/src/k_kart.c b/src/k_kart.c index 44cee66a6..0949f0a15 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -102,6 +102,7 @@ consvar_t cv_fancyroulette = {"animatedroulette", "Off", CV_SAVE, CV_OnOff, NULL consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showminimapnames = {"showminimapnames", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_showminimapangle = {"showminimapangle", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_highresportrait = {"highresportrait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // make char potraits use their high-res version instead @@ -952,6 +953,8 @@ void K_RegisterClientKartStuff(void) CV_RegisterVar(&cv_minihead); CV_RegisterVar(&cv_showminimapnames); + CV_RegisterVar(&cv_showminimapangle); + CV_RegisterVar(&cv_showlapemblem); CV_RegisterVar(&cv_stagetitle); @@ -7614,6 +7617,8 @@ static patch_t *joybacking; static patch_t *joyknob; static patch_t *joyshadow; +static patch_t *kp_minimapdot; + void K_LoadKartHUDGraphics(void) { INT32 i, j; @@ -7887,6 +7892,9 @@ void K_LoadKartHUDGraphics(void) kp_wantedsplit = W_CachePatchName("4PWANTED", PU_HUDGFX); kp_wantedreticle = W_CachePatchName("MMAPWANT", PU_HUDGFX); + if (minidoticon) + kp_minimapdot = W_CachePatchName("MMAPDOT", PU_HUDGFX); + // Kart Item Windows kp_itembg[0] = W_CachePatchName("K_ITBG", PU_HUDGFX); kp_itembg[1] = W_CachePatchName("K_ITBGD", PU_HUDGFX); @@ -10530,6 +10538,46 @@ static void K_drawKartPlayerCheck(void) } } +static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, patch_t *icon, UINT8 *colormap) +{ + // amnum xpos & ypos are the icon's speed around the HUD. + // The number being divided by is for how fast it moves. + // The higher the number, the slower it moves. + + // am xpos & ypos are the icon's starting position. Withouht + // it, they wouldn't 'spawn' on the top-right side of the HUD. + + fixed_t amnumxpos, amnumypos; + INT32 amxpos, amypos; + fixed_t scale = FRACUNIT; + patch_t *AutomapPic; + + AutomapPic = minimapinfo.minimap_pic; + + if (AutomapPic == NULL) + { + return; // no pic, just get outta here + } + + amnumxpos = (FixedMul(objx, minimapinfo.zoom) - minimapinfo.offs_x); + amnumypos = -(FixedMul(objy, minimapinfo.zoom) - minimapinfo.offs_y); + + if (encoremode) + amnumxpos = -amnumxpos; + + amxpos = amnumxpos + ((hudx + (AutomapPic->width-icon->width)/2)<height-icon->height)/2)<width / 4)<height / 4)<health <= 0 && players[localplayers[i]].pflags & PF_TIMEOVER) + continue; + + UINT8 *colormap; + fixed_t interpx, interpy; + + angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle); + + if (mobj->colorized) + colormap = R_GetTranslationColormap(TC_RAINBOW, mobj->color, GTC_CACHE); + else + colormap = R_GetLocalTranslationColormap(mobj->skin, mobj->localskin, mobj->color, GTC_CACHE, mobj->skinlocal); + + interpx = lerp(mobj->old_x, mobj->x); + interpy = lerp(mobj->old_y, mobj->y); + + K_drawKartMinimapIcon( + interpx, + interpy, + x + FixedMul(FCOS(ang), icondotradius), + y - FixedMul(FSIN(ang), icondotradius), + splitflags, + kp_minimapdot, + colormap + ); } } +#undef lerp + static void K_drawKartStartCountdown(void) { INT32 pnum = 0, splitflags = K_calcSplitFlags(0); // 3 diff --git a/src/r_fps.c b/src/r_fps.c index 3d10449cc..9827a65f2 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -278,7 +278,7 @@ void R_SetViewContext(enum viewcontext_e _viewcontext) } return (R_LerpFixed(from, to, rendertimefrac)); -} +}*/ angle_t R_InterpolateAngle(angle_t from, angle_t to) { @@ -288,7 +288,7 @@ angle_t R_InterpolateAngle(angle_t from, angle_t to) } return (R_LerpAngle(from, to, rendertimefrac)); -}*/ +} void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out) { diff --git a/src/r_fps.h b/src/r_fps.h index 563989fa6..006f80b67 100644 --- a/src/r_fps.h +++ b/src/r_fps.h @@ -134,7 +134,7 @@ void R_RelativeTeleportViewInterpolation(UINT8 p, fixed_t xdiff, fixed_t ydiff, // Set the current view context (the viewvars pointed to by newview) void R_SetViewContext(enum viewcontext_e _viewcontext); -fixed_t R_InterpolateFixed(fixed_t from, fixed_t to); +//fixed_t R_InterpolateFixed(fixed_t from, fixed_t to); angle_t R_InterpolateAngle(angle_t from, angle_t to); // Evaluate the interpolated mobj state for the given mobj