mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'optimize-challenges-menu' into 'master'
Optimize Challenge Board drawing See merge request KartKrew/Kart!1783
This commit is contained in:
commit
66d2243c10
3 changed files with 24 additions and 8 deletions
|
|
@ -1344,6 +1344,8 @@ extern struct challengesmenu_s {
|
||||||
UINT8 fade;
|
UINT8 fade;
|
||||||
|
|
||||||
boolean cache_secondrowlocked;
|
boolean cache_secondrowlocked;
|
||||||
|
|
||||||
|
patch_t *tile_category[10][2];
|
||||||
} challengesmenu;
|
} challengesmenu;
|
||||||
|
|
||||||
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu);
|
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu);
|
||||||
|
|
|
||||||
|
|
@ -6031,16 +6031,10 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
|
||||||
categoryid = '9';
|
categoryid = '9';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pat = W_CachePatchName(va("UN_RR0%c%c",
|
pat = challengesmenu.tile_category[categoryid - '0'][ref->majorunlock ? 1 : 0];
|
||||||
categoryid,
|
|
||||||
(ref->majorunlock) ? 'B' : 'A'),
|
|
||||||
PU_CACHE);
|
|
||||||
if (pat == missingpat)
|
if (pat == missingpat)
|
||||||
{
|
{
|
||||||
pat = W_CachePatchName(va("UN_RR0%c%c",
|
pat = challengesmenu.tile_category[categoryid - '0'][ref->majorunlock ? 0 : 1];
|
||||||
categoryid,
|
|
||||||
(ref->majorunlock) ? 'A' : 'B'),
|
|
||||||
PU_CACHE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ref->icon != NULL && ref->icon[0])
|
else if (ref->icon != NULL && ref->icon[0])
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,24 @@ static void M_ChallengesAutoFocus(UINT16 unlockid, boolean fresh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void M_CacheChallengeTiles(void)
|
||||||
|
{
|
||||||
|
char name[9] = "UN_RR0xy";
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 10; ++i)
|
||||||
|
{
|
||||||
|
name[6] = '0' + i;
|
||||||
|
|
||||||
|
name[7] = 'A';
|
||||||
|
challengesmenu.tile_category[i][0] = W_CachePatchName(name, PU_CACHE);
|
||||||
|
|
||||||
|
name[7] = 'B';
|
||||||
|
challengesmenu.tile_category[i][1] = W_CachePatchName(name, PU_CACHE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
||||||
{
|
{
|
||||||
UINT16 newunlock;
|
UINT16 newunlock;
|
||||||
|
|
@ -338,6 +356,8 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
||||||
&& (gamedata->chaokeys < GDMAX_CHAOKEYS))
|
&& (gamedata->chaokeys < GDMAX_CHAOKEYS))
|
||||||
challengesmenu.chaokeyadd = true;
|
challengesmenu.chaokeyadd = true;
|
||||||
|
|
||||||
|
M_CacheChallengeTiles();
|
||||||
|
|
||||||
return &MISC_ChallengesDef;
|
return &MISC_ChallengesDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue