mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-22 02:41:56 +00:00
Merge remote-tracking branch 'origin/quads' into quads
# Conflicts: # src/k_kart.c
This commit is contained in:
commit
5db276173e
11 changed files with 174 additions and 87 deletions
|
@ -765,6 +765,8 @@ void D_RegisterClientCommands(void)
|
|||
// m_menu.c
|
||||
CV_RegisterVar(&cv_crosshair);
|
||||
CV_RegisterVar(&cv_crosshair2);
|
||||
CV_RegisterVar(&cv_crosshair3);
|
||||
CV_RegisterVar(&cv_crosshair4);
|
||||
CV_RegisterVar(&cv_alwaysfreelook);
|
||||
CV_RegisterVar(&cv_alwaysfreelook2);
|
||||
|
||||
|
|
141
src/hu_stuff.c
141
src/hu_stuff.c
|
@ -86,6 +86,7 @@ patch_t *rmatcico;
|
|||
patch_t *bmatcico;
|
||||
patch_t *tagico;
|
||||
patch_t *tallminus;
|
||||
patch_t *iconprefix[MAXSKINS]; // minimap icons
|
||||
|
||||
//-------------------------------------------
|
||||
// coop hud
|
||||
|
@ -960,6 +961,68 @@ static inline void HU_DrawCrosshair2(void)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void HU_DrawCrosshair3(void)
|
||||
{
|
||||
INT32 i, y;
|
||||
|
||||
i = cv_crosshair3.value & 3;
|
||||
if (!i)
|
||||
return;
|
||||
|
||||
if ((netgame || multiplayer) && players[thirddisplayplayer].spectator)
|
||||
return;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y = (INT32)gr_basewindowcentery;
|
||||
else
|
||||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y += (INT32)gr_viewheight;
|
||||
else
|
||||
#endif
|
||||
y += viewheight;
|
||||
|
||||
V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void HU_DrawCrosshair4(void)
|
||||
{
|
||||
INT32 i, y;
|
||||
|
||||
i = cv_crosshair4.value & 3;
|
||||
if (!i)
|
||||
return;
|
||||
|
||||
if ((netgame || multiplayer) && players[fourthdisplayplayer].spectator)
|
||||
return;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y = (INT32)gr_basewindowcentery;
|
||||
else
|
||||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
||||
if (splitscreen > 2)
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y += (INT32)gr_viewheight;
|
||||
else
|
||||
#endif
|
||||
y += viewheight;
|
||||
|
||||
V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
static void HU_DrawCEcho(void)
|
||||
{
|
||||
INT32 i = 0;
|
||||
|
@ -1070,78 +1133,6 @@ static void HU_DrawDemoInfo(void)
|
|||
void HU_Drawer(void)
|
||||
{
|
||||
K_drawMinimap();
|
||||
// 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 = translationtables[players[i].skin] - 256 + (players[i].skincolor<<8);
|
||||
V_DrawSmallMappedPatch(amxpos, amypos, 0,iconprefix[players[i].skin], colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!splitscreen && maptol & TOL_KART && !hu_showscores)
|
||||
HU_DrawRaceRankings();
|
||||
}
|
||||
*/
|
||||
//
|
||||
|
||||
// draw chat string plus cursor
|
||||
if (chat_on)
|
||||
|
@ -1187,6 +1178,12 @@ void HU_Drawer(void)
|
|||
|
||||
if (!automapactive && cv_crosshair2.value && !demoplayback && !camera2.chase && !players[secondarydisplayplayer].spectator)
|
||||
HU_DrawCrosshair2();
|
||||
|
||||
if (!automapactive && cv_crosshair3.value && !demoplayback && !camera3.chase && !players[thirddisplayplayer].spectator)
|
||||
HU_DrawCrosshair3();
|
||||
|
||||
if (!automapactive && cv_crosshair4.value && !demoplayback && !camera4.chase && !players[fourthdisplayplayer].spectator)
|
||||
HU_DrawCrosshair4();
|
||||
|
||||
// draw desynch text
|
||||
if (hu_resynching)
|
||||
|
|
|
@ -78,6 +78,7 @@ extern patch_t *rmatcico;
|
|||
extern patch_t *bmatcico;
|
||||
extern patch_t *tagico;
|
||||
extern patch_t *tallminus;
|
||||
extern patch_t *iconprefix[MAXSKINS];
|
||||
|
||||
// set true when entering a chat message
|
||||
extern boolean chat_on;
|
||||
|
|
42
src/k_kart.c
42
src/k_kart.c
|
@ -4193,10 +4193,31 @@ static void K_drawKartItemClose(void)
|
|||
V_DrawScaledPatch(ITEM_X, ITEM_Y, splitflags, localpatch);
|
||||
}
|
||||
|
||||
void K_LoadIconGraphics(char *facestr, INT32 skinnum)
|
||||
{
|
||||
char namelump[9];
|
||||
|
||||
// hack: make sure base face name is no more than 8 chars
|
||||
if (strlen(facestr) > 8)
|
||||
facestr[8] = '\0';
|
||||
strcpy(namelump, facestr); // copy base name
|
||||
|
||||
iconprefix[skinnum] = W_CachePatchName(namelump, PU_HUDGFX);
|
||||
iconfreed[skinnum] = false;
|
||||
}
|
||||
|
||||
#if 0 //unused
|
||||
static void K_UnLoadIconGraphics(INT32 skinnum)
|
||||
{
|
||||
Z_Free(iconprefix[skinnum]);
|
||||
iconfreed[skinnum] = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void K_drawMinimap(void)
|
||||
{
|
||||
// SRB2kart 010217 - Automap Hud (temporarily commented out)
|
||||
/*
|
||||
// SRB2kart 12/18/17 - Automap HUD
|
||||
|
||||
INT32 amnumxpos;
|
||||
INT32 amnumypos;
|
||||
INT32 amxpos;
|
||||
|
@ -4211,10 +4232,10 @@ void K_drawMinimap(void)
|
|||
{
|
||||
INT32 x, y;
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildAutoMapName(gamemap)));
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
|
||||
|
||||
if (lumpnum != -1 && (!modifiedgame || (modifiedgame && mapheaderinfo[gamemap-1].automap)))
|
||||
AutomapPic = W_CachePatchName(va("%sR", G_BuildAutoMapName(gamemap)), PU_CACHE);
|
||||
if (lumpnum != -1)
|
||||
AutomapPic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_CACHE);
|
||||
else
|
||||
AutomapPic = W_CachePatchName(va("NOMAPR"), PU_CACHE);
|
||||
|
||||
|
@ -4232,7 +4253,7 @@ void K_drawMinimap(void)
|
|||
V_DrawSmallScaledPatch(x, y, 0, AutomapPic);
|
||||
|
||||
// Player's tiny icons on the Automap.
|
||||
if (lumpnum != -1 && (!modifiedgame || (modifiedgame && mapheaderinfo[gamemap-1].automap)))
|
||||
if (lumpnum != -1)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -4256,16 +4277,15 @@ void K_drawMinimap(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
UINT8 *colormap = transtables[players[i].skin] - 256 + (players[i].skincolor<<8);
|
||||
UINT8 *colormap = R_GetTranslationColormap(players[i].skin, players[i].skincolor, 0); //transtables[players[i].skin] - 256 + (players[i].skincolor<<8);
|
||||
V_DrawSmallMappedPatch(amxpos, amypos, 0,iconprefix[players[i].skin], colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!splitscreen && maptol & TOL_KART && !hu_showscores)
|
||||
HU_DrawRaceRankings();
|
||||
}*/
|
||||
;
|
||||
/*if (!splitscreen && maptol & TOL_RACE && !hu_showscores)
|
||||
HU_DrawRaceRankings();*/
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartItemRoulette(void)
|
||||
|
|
|
@ -43,6 +43,7 @@ void K_CheckBalloons(void);
|
|||
void K_LoadKartHUDGraphics(void);
|
||||
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_LoadIconGraphics(char *facestr, INT32 skinnum);
|
||||
void K_drawMinimap(void);
|
||||
|
||||
// =========================================================================
|
||||
|
|
49
src/m_menu.c
49
src/m_menu.c
|
@ -507,6 +507,8 @@ static menuitem_t MPauseMenu[] =
|
|||
{IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,40},
|
||||
{IT_CALL | IT_STRING, NULL, "Player 1 Setup", M_SetupMultiPlayer, 48}, // splitscreen
|
||||
{IT_CALL | IT_STRING, NULL, "Player 2 Setup", M_SetupMultiPlayer2, 56}, // splitscreen
|
||||
{IT_CALL | IT_STRING, NULL, "Player 3 Setup", M_SetupMultiPlayer3, 64}, // splitscreen
|
||||
{IT_CALL | IT_STRING, NULL, "Player 4 Setup", M_SetupMultiPlayer4, 72}, // splitscreen
|
||||
|
||||
{IT_STRING | IT_CALL, NULL, "Spectate", M_ConfirmSpectate, 48},
|
||||
{IT_STRING | IT_CALL, NULL, "Enter Game", M_ConfirmEnterGame, 48},
|
||||
|
@ -526,6 +528,8 @@ typedef enum
|
|||
mpause_continue,
|
||||
mpause_psetupsplit,
|
||||
mpause_psetupsplit2,
|
||||
mpause_psetupsplit3,
|
||||
mpause_psetupsplit4,
|
||||
mpause_spectate,
|
||||
mpause_entergame,
|
||||
mpause_switchteam,
|
||||
|
@ -891,7 +895,7 @@ static menuitem_t MP_MainMenu[] =
|
|||
#endif
|
||||
{IT_CALL | IT_STRING, NULL, "TWO PLAYER GAME", M_StartSplitServerMenu, 60},
|
||||
{IT_CALL | IT_STRING, NULL, "THREE PLAYER GAME", M_Start3PServerMenu, 70},
|
||||
{IT_CALL | IT_STRING, NULL, "FOUR PLAYER GAME", M_Start4PServerMenu, 80},
|
||||
{IT_CALL | IT_STRING, NULL, "FOUR PLAYER GAME", M_Start4PServerMenu, 80},
|
||||
|
||||
{IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 100},
|
||||
{IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 110},
|
||||
|
@ -2697,10 +2701,16 @@ void M_StartControlPanel(void)
|
|||
MPauseMenu[mpause_scramble].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetupsplit].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetupsplit2].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetupsplit3].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetupsplit4].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_spectate].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_entergame].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_switchteam].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetup].status = IT_DISABLED;
|
||||
// Reset these in case splitscreen messes things up
|
||||
MPauseMenu[mpause_options].alphaKey = 64;
|
||||
MPauseMenu[mpause_title].alphaKey = 80;
|
||||
MPauseMenu[mpause_quit].alphaKey = 88;
|
||||
|
||||
if ((server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
|
@ -2710,7 +2720,30 @@ void M_StartControlPanel(void)
|
|||
}
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
MPauseMenu[mpause_psetupsplit].status = MPauseMenu[mpause_psetupsplit2].status = IT_STRING | IT_CALL;
|
||||
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
MPauseMenu[mpause_psetupsplit3].status = IT_STRING | IT_CALL;
|
||||
|
||||
if (splitscreen == 2)
|
||||
{
|
||||
MPauseMenu[mpause_options].alphaKey = 72;
|
||||
MPauseMenu[mpause_title].alphaKey = 88;
|
||||
MPauseMenu[mpause_quit].alphaKey = 96;
|
||||
}
|
||||
|
||||
if (splitscreen == 3)
|
||||
{
|
||||
MPauseMenu[mpause_psetupsplit4].status = IT_STRING | IT_CALL;
|
||||
MPauseMenu[mpause_options].alphaKey = 80;
|
||||
MPauseMenu[mpause_title].alphaKey = 96;
|
||||
MPauseMenu[mpause_quit].alphaKey = 104;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MPauseMenu[mpause_psetup].status = IT_STRING | IT_CALL;
|
||||
|
@ -7241,13 +7274,21 @@ static void M_DrawControl(void)
|
|||
char tmp[50];
|
||||
INT32 i;
|
||||
INT32 keys[2];
|
||||
const char *ctrl;
|
||||
|
||||
// draw title, strings and submenu
|
||||
M_DrawGenericMenu();
|
||||
|
||||
M_CentreText(30,
|
||||
(setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" :
|
||||
"PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR"));
|
||||
if (setupcontrols_secondaryplayer)
|
||||
ctrl = "SET CONTROLS FOR SECONDARY PLAYER";
|
||||
else if (setupcontrols_thirdplayer)
|
||||
ctrl = "SET CONTROLS FOR THIRD PLAYER";
|
||||
else if (setupcontrols_fourthplayer)
|
||||
ctrl = "SET CONTROLS FOR FOURTH PLAYER";
|
||||
else
|
||||
ctrl = "PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR";
|
||||
|
||||
M_CentreText(30, ctrl);
|
||||
|
||||
for (i = 0;i < currentMenu->numitems;i++)
|
||||
{
|
||||
|
|
|
@ -2620,6 +2620,12 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
// same for second player
|
||||
if (!cv_chasecam2.changed)
|
||||
CV_SetValue(&cv_chasecam2, chase);
|
||||
|
||||
if (!cv_chasecam3.changed)
|
||||
CV_SetValue(&cv_chasecam3, chase);
|
||||
|
||||
if (!cv_chasecam4.changed)
|
||||
CV_SetValue(&cv_chasecam4, chase);
|
||||
}
|
||||
|
||||
// Initial height of PointOfView
|
||||
|
|
|
@ -2493,6 +2493,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
|
|||
for (i = 0; i < sfx_skinsoundslot0; i++)
|
||||
if (S_sfx[i].skinsound != -1)
|
||||
skin->soundsid[S_sfx[i].skinsound] = i;
|
||||
strncpy(skin->iconprefix, "SONICICN", 8);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2542,6 +2543,8 @@ void R_InitSkins(void)
|
|||
skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
|
||||
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, 0);
|
||||
strncpy(skin->iconprefix, "SONICICN", 8);
|
||||
K_LoadIconGraphics(skin->iconprefix, 0);
|
||||
|
||||
//MD2 for sonic doesn't want to load in Linux.
|
||||
#ifdef HWRENDER
|
||||
|
@ -2870,6 +2873,11 @@ void R_AddSkins(UINT16 wadnum)
|
|||
skin->jumpfactor = FLOAT_TO_FIXED(atof(value));
|
||||
else if (!stricmp(stoken, "highresscale"))
|
||||
skin->highresscale = FLOAT_TO_FIXED(atof(value));
|
||||
else if (!stricmp(stoken, "faceicon"))
|
||||
{
|
||||
strupr(value);
|
||||
strncpy(skin->iconprefix, value, sizeof skin->iconprefix);
|
||||
}
|
||||
else
|
||||
{
|
||||
INT32 found = false;
|
||||
|
@ -2971,6 +2979,9 @@ next_token:
|
|||
|
||||
// add face graphics
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, numskins);
|
||||
|
||||
// load minimap icons
|
||||
K_LoadIconGraphics(skin->iconprefix, numskins);
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
|
|
|
@ -113,6 +113,9 @@ typedef struct
|
|||
|
||||
// specific sounds per skin
|
||||
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
|
||||
|
||||
// minimap icons
|
||||
char iconprefix[9];
|
||||
} skin_t;
|
||||
|
||||
// -----------
|
||||
|
|
|
@ -129,6 +129,7 @@ static patch_t *gotbflag;
|
|||
//
|
||||
|
||||
static boolean facefreed[MAXPLAYERS];
|
||||
boolean iconfreed[MAXPLAYERS];
|
||||
|
||||
hudinfo_t hudinfo[NUMHUDITEMS] =
|
||||
{
|
||||
|
@ -412,7 +413,10 @@ void ST_Init(void)
|
|||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
facefreed[i] = true;
|
||||
iconfreed[i] = true;
|
||||
}
|
||||
|
||||
if (dedicated)
|
||||
return;
|
||||
|
|
|
@ -70,6 +70,7 @@ extern patch_t *faceprefix[MAXSKINS]; // face status patches
|
|||
extern patch_t *superprefix[MAXSKINS]; // super face status patches
|
||||
extern patch_t *livesback;
|
||||
extern patch_t *ngradeletters[7];
|
||||
extern boolean iconfreed[MAXPLAYERS];
|
||||
|
||||
/** HUD location information (don't move this comment)
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue