diff --git a/src/d_main.c b/src/d_main.c index fd57583d4..594829261 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 e1127f05c..da484841a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -106,6 +106,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 @@ -956,6 +957,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); @@ -7618,6 +7621,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; @@ -7891,6 +7896,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); @@ -8368,17 +8376,20 @@ INT32 K_getMinimapTrans(void) INT32 minimaptrans = cv_kartminimap.value; if (!minimaptrans) - return 0; + return -1; if (forceshowhud) return (10-minimaptrans)<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/lua_hudlib.c b/src/lua_hudlib.c index d6b6db5c3..8083807ad 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -615,7 +615,7 @@ static int libd_drawOnMinimap(lua_State *L) INT32 mm_x, mm_y; fixed_t patchw = 0, patchh = 0; - HUDONLY // only run this function in hud hooks + HUDONLY // only run this function in hud hooks // Draw the HUD only when playing in a level. // hu_stuff needs this, unlike st_stuff. @@ -635,7 +635,7 @@ static int libd_drawOnMinimap(lua_State *L) minimaptrans = K_getMinimapTrans(); // Exit early if it wouldn't draw anyway. - if (!minimaptrans) + if (minimaptrans == -1) return 0; x = luaL_checkinteger(L, 1); diff --git a/src/m_menu.c b/src/m_menu.c index 3a99e81e1..397a850c9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2033,7 +2033,7 @@ static const char* OP_PlayerCamOptionsTooltips[] = "Height of the Camera", "Speed of the Camera", "Should looking back inherit the Players Momentum?\nEither inherit Player Momentum or double of it\nmay make looking back while boosting or going in high speed less jarring", - "Allows looking up/down by holding aim forward/backward while standing still.", + "Allows looking up/down by holding\naim forward/backward while standing still.", "Speed of the Freecam/Spectator Camera", "Toggle between Third or First Person camera", }; @@ -2433,15 +2433,16 @@ static menuitem_t OP_SaturnHudMenu[] = {IT_STRING | IT_CVAR, NULL, "Show Names on Minimap", &cv_showminimapnames, 135}, {IT_STRING | IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 140}, {IT_STRING | IT_CVAR, NULL, "Spin Minimap Icons", &cv_spinoutroll, 150}, + {IT_STRING | IT_CVAR, NULL, "Player Angle Dot", &cv_showminimapangle, 160}, - {IT_STRING | IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 160}, + {IT_STRING | IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 170}, - {IT_STRING | IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 170}, + {IT_STRING | IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 180}, - {IT_STRING | IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 180}, - {IT_STRING | IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 185}, + {IT_STRING | IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 190}, + {IT_STRING | IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 195}, - {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 195}, + {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 205}, }; static const char* OP_SaturnHudTooltips[] = @@ -2466,6 +2467,7 @@ static const char* OP_SaturnHudTooltips[] = "Show player names on the minimap.", "Minimize the player icons on the minimap.", "Erratically rotate player icons during spinouts.", + "Show a dot showing the player facing angle.", "Make the Intermission screen look like in beta versions of Kart!\nEither with background or just the rest.", "Show the Director Toggle prompt when spectating.", "Nametag Options.", @@ -2495,6 +2497,7 @@ enum sh_mapname, sh_smallmap, sh_iconspinout, + sh_minidot, sh_betainter, sh_directorhud, sh_nametagmen, @@ -4946,6 +4949,9 @@ void M_Init(void) if (!nametaggfx) OP_NametagMenu[nt_ntchar].status = IT_GRAYEDOUT; + if (!minidoticon) + OP_SaturnHudMenu[sh_minidot].status = IT_GRAYEDOUT; + #ifndef NONET CV_RegisterVar(&cv_serversort); #endif 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