mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-04 07:52:22 +00:00
M_PickMenuBGMap: Change to work off map ID
Guarantees successful update when invalidated by level replacement
This commit is contained in:
parent
5c2a4ae68f
commit
9e3ca7a59b
1 changed files with 10 additions and 9 deletions
|
|
@ -169,7 +169,7 @@ void M_DrawUnderline(INT32 left, INT32 right, INT32 y)
|
||||||
|
|
||||||
static patch_t *addonsp[NUM_EXT+5];
|
static patch_t *addonsp[NUM_EXT+5];
|
||||||
|
|
||||||
static patch_t *bgMapImage;
|
static INT16 bgMapID = NEXTMAP_INVALID;
|
||||||
void M_PickMenuBGMap(void)
|
void M_PickMenuBGMap(void)
|
||||||
{
|
{
|
||||||
UINT16 *allowedMaps;
|
UINT16 *allowedMaps;
|
||||||
|
|
@ -195,7 +195,7 @@ void M_PickMenuBGMap(void)
|
||||||
|
|
||||||
if ((mapheaderinfo[i]->typeoflevel & (TOL_SPECIAL|TOL_VERSUS)) != 0)
|
if ((mapheaderinfo[i]->typeoflevel & (TOL_SPECIAL|TOL_VERSUS)) != 0)
|
||||||
{
|
{
|
||||||
// Don't spoil Special Stages or bosses.
|
// Don't spoil Special or Versus.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,12 +221,7 @@ void M_PickMenuBGMap(void)
|
||||||
}
|
}
|
||||||
Z_Free(allowedMaps);
|
Z_Free(allowedMaps);
|
||||||
|
|
||||||
bgMapImage = mapheaderinfo[ret]->thumbnailPic;
|
bgMapID = ret;
|
||||||
|
|
||||||
if (bgMapImage == NULL)
|
|
||||||
{
|
|
||||||
bgMapImage = W_CachePatchName("MENUBG4", PU_CACHE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static fixed_t bgText1Scroll = 0;
|
static fixed_t bgText1Scroll = 0;
|
||||||
|
|
@ -271,11 +266,17 @@ void M_DrawMenuBackground(void)
|
||||||
fixed_t text1loop = SHORT(text1->height)*FRACUNIT;
|
fixed_t text1loop = SHORT(text1->height)*FRACUNIT;
|
||||||
fixed_t text2loop = SHORT(text2->width)*FRACUNIT;
|
fixed_t text2loop = SHORT(text2->width)*FRACUNIT;
|
||||||
|
|
||||||
if (bgMapImage == NULL)
|
if (bgMapID >= nummapheaders)
|
||||||
{
|
{
|
||||||
M_PickMenuBGMap();
|
M_PickMenuBGMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
patch_t *bgMapImage = mapheaderinfo[bgMapID]->thumbnailPic;
|
||||||
|
if (bgMapImage == NULL)
|
||||||
|
{
|
||||||
|
bgMapImage = W_CachePatchName("MENUBG4", PU_CACHE);
|
||||||
|
}
|
||||||
|
|
||||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, bgMapImage, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SLATE, GTC_MENUCACHE));
|
V_DrawFixedPatch(0, 0, FRACUNIT, 0, bgMapImage, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SLATE, GTC_MENUCACHE));
|
||||||
V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, W_CachePatchName("MENUCUTD", PU_CACHE), NULL);
|
V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, W_CachePatchName("MENUCUTD", PU_CACHE), NULL);
|
||||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUCUT", PU_CACHE), NULL);
|
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUCUT", PU_CACHE), NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue