mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 15:32:10 +00:00
Reorganize minimap code
This commit is contained in:
parent
e7abd77299
commit
c5a4822df6
3 changed files with 79 additions and 0 deletions
|
@ -51,6 +51,8 @@
|
||||||
#include "lua_hook.h"
|
#include "lua_hook.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "k_kart.h"
|
||||||
|
|
||||||
// coords are scaled
|
// coords are scaled
|
||||||
#define HU_INPUTX 0
|
#define HU_INPUTX 0
|
||||||
#define HU_INPUTY 0
|
#define HU_INPUTY 0
|
||||||
|
@ -1067,6 +1069,7 @@ static void HU_DrawDemoInfo(void)
|
||||||
//
|
//
|
||||||
void HU_Drawer(void)
|
void HU_Drawer(void)
|
||||||
{
|
{
|
||||||
|
K_drawMinimap();
|
||||||
// SRB2kart 010217 - Automap Hud (temporarily commented out)
|
// SRB2kart 010217 - Automap Hud (temporarily commented out)
|
||||||
/*
|
/*
|
||||||
INT32 amnumxpos;
|
INT32 amnumxpos;
|
||||||
|
|
75
src/k_kart.c
75
src/k_kart.c
|
@ -4209,6 +4209,81 @@ static void K_drawKartItemClose(void)
|
||||||
V_DrawScaledPatch(ITEM_X, ITEM_Y, V_SNAPTORIGHT|V_SNAPTOTOP|splitflags, localpatch);
|
V_DrawScaledPatch(ITEM_X, ITEM_Y, V_SNAPTORIGHT|V_SNAPTOTOP|splitflags, localpatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_drawMinimap(void)
|
||||||
|
{
|
||||||
|
// SRB2kart 010217 - Automap Hud (temporarily commented out)
|
||||||
|
/*
|
||||||
|
INT32 amnumxpos;
|
||||||
|
INT32 amnumypos;
|
||||||
|
INT32 amxpos;
|
||||||
|
INT32 amypos;
|
||||||
|
INT32 lumpnum;
|
||||||
|
patch_t *AutomapPic;
|
||||||
|
INT32 i = 0;
|
||||||
|
|
||||||
|
// Draw the HUD only when playing in a level.
|
||||||
|
// hu_stuff needs this, unlike st_stuff.
|
||||||
|
if (Playing() && gamestate == GS_LEVEL)
|
||||||
|
{
|
||||||
|
INT32 x, y;
|
||||||
|
|
||||||
|
lumpnum = W_CheckNumForName(va("%sR", G_BuildAutoMapName(gamemap)));
|
||||||
|
|
||||||
|
if (lumpnum != -1 && (!modifiedgame || (modifiedgame && mapheaderinfo[gamemap-1].automap)))
|
||||||
|
AutomapPic = W_CachePatchName(va("%sR", G_BuildAutoMapName(gamemap)), PU_CACHE);
|
||||||
|
else
|
||||||
|
AutomapPic = W_CachePatchName(va("NOMAPR"), PU_CACHE);
|
||||||
|
|
||||||
|
if (splitscreen)
|
||||||
|
{
|
||||||
|
x = 160 - (AutomapPic->width/4);
|
||||||
|
y = 100 - (AutomapPic->height/4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = 312 - (AutomapPic->width/2);
|
||||||
|
y = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
V_DrawSmallScaledPatch(x, y, 0, AutomapPic);
|
||||||
|
|
||||||
|
// Player's tiny icons on the Automap.
|
||||||
|
if (lumpnum != -1 && (!modifiedgame || (modifiedgame && mapheaderinfo[gamemap-1].automap)))
|
||||||
|
{
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (players[i].mo && !players[i].spectator)
|
||||||
|
{
|
||||||
|
// 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.
|
||||||
|
amnumxpos = (players[i].mo->x / 320) >> FRACBITS;
|
||||||
|
amnumypos = (-players[i].mo->y / 340) >> FRACBITS;
|
||||||
|
|
||||||
|
amxpos = (x + amnumxpos) - (iconprefix[players[i].skin]->width/4);
|
||||||
|
amypos = (y + amnumypos) - (iconprefix[players[i].skin]->height/4);
|
||||||
|
|
||||||
|
if (!players[i].skincolor) // 'default' color
|
||||||
|
{
|
||||||
|
V_DrawSmallScaledPatch(amxpos, amypos, 0, iconprefix[players[i].skin]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UINT8 *colormap = transtables[players[i].skin] - 256 + (players[i].skincolor<<8);
|
||||||
|
V_DrawSmallMappedPatch(amxpos, amypos, 0,iconprefix[players[i].skin], colormap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(splitscreen || splitscreen3 || splitscreen4) && maptol & TOL_KART && !hu_showscores)
|
||||||
|
HU_DrawRaceRankings();
|
||||||
|
}*/
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
static void K_drawKartItemRoulette(void)
|
static void K_drawKartItemRoulette(void)
|
||||||
{
|
{
|
||||||
// ITEM_X = BASEVIDWIDTH-50; // 270
|
// ITEM_X = BASEVIDWIDTH-50; // 270
|
||||||
|
|
|
@ -44,6 +44,7 @@ void K_CheckBalloons(void);
|
||||||
void K_LoadKartHUDGraphics(void);
|
void K_LoadKartHUDGraphics(void);
|
||||||
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);
|
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);
|
||||||
void K_drawKartHUD(void);
|
void K_drawKartHUD(void);
|
||||||
|
void K_drawMinimap(void);
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
#endif // __K_KART__
|
#endif // __K_KART__
|
||||||
|
|
Loading…
Reference in a new issue