mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-01 03:06:22 +00:00
M_DrawCharacterSprite: Refactor for more fine-grained control of sprite2, angle, and animation frame
This commit is contained in:
parent
04ceb09fd4
commit
4cd1f894a2
1 changed files with 7 additions and 9 deletions
|
|
@ -1390,16 +1390,14 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
|
|||
}
|
||||
|
||||
// returns false if the character couldn't be rendered
|
||||
static boolean M_DrawCharacterSprite(INT16 x, INT16 y, INT16 skin, boolean charflip, boolean animate, INT32 addflags, UINT8 *colormap)
|
||||
static boolean M_DrawCharacterSprite(INT16 x, INT16 y, INT16 skin, UINT8 spr2, UINT8 rotation, UINT32 frame, INT32 addflags, UINT8 *colormap)
|
||||
{
|
||||
UINT8 spr;
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
patch_t *sprpatch;
|
||||
UINT8 rotation = (charflip ? 1 : 7);
|
||||
UINT32 frame = animate ? setup_animcounter : 0;
|
||||
|
||||
spr = P_GetSkinSprite2(&skins[skin], SPR2_STIN, NULL);
|
||||
spr = P_GetSkinSprite2(&skins[skin], spr2, NULL);
|
||||
sprdef = &skins[skin].sprites[spr];
|
||||
|
||||
if (!sprdef->numframes) // No frames ??
|
||||
|
|
@ -1511,7 +1509,7 @@ static void M_DrawCharSelectSprite(UINT8 num, INT16 x, INT16 y, boolean charflip
|
|||
color = p->color;
|
||||
colormap = R_GetTranslationColormap(p->skin, color, GTC_MENUCACHE);
|
||||
|
||||
M_DrawCharacterSprite(x, y, p->skin, charflip, (p->mdepth == CSSTEP_READY), 0, colormap);
|
||||
M_DrawCharacterSprite(x, y, p->skin, SPR2_STIN, (charflip ? 1 : 7), ((p->mdepth == CSSTEP_READY) ? setup_animcounter : 0), 0, colormap);
|
||||
}
|
||||
|
||||
static void M_DrawCharSelectPreview(UINT8 num)
|
||||
|
|
@ -1880,7 +1878,7 @@ static void M_DrawProfileCard(INT32 x, INT32 y, boolean greyedout, profile_t *p)
|
|||
|
||||
if (skinnum >= 0)
|
||||
{
|
||||
if (M_DrawCharacterSprite(x-22, y+119, skinnum, false, false, 0, colormap))
|
||||
if (M_DrawCharacterSprite(x-22, y+119, skinnum, SPR2_STIN, 7, 0, 0, colormap))
|
||||
V_DrawMappedPatch(x+14, y+66, 0, faceprefix[skinnum][FACE_RANK], colormap);
|
||||
}
|
||||
|
||||
|
|
@ -1912,7 +1910,7 @@ static void M_DrawProfileCard(INT32 x, INT32 y, boolean greyedout, profile_t *p)
|
|||
(K_FollowerUsable(fln) ? TC_DEFAULT : TC_BLINK),
|
||||
col, GTC_MENUCACHE);
|
||||
|
||||
if (M_DrawCharacterSprite(x-22, y+119, skinnum, false, false, 0, ccolormap))
|
||||
if (M_DrawCharacterSprite(x-22, y+119, skinnum, SPR2_STIN, 7, 0, 0, ccolormap))
|
||||
{
|
||||
V_DrawMappedPatch(x+14, y+66, 0, faceprefix[skinnum][FACE_RANK], ccolormap);
|
||||
}
|
||||
|
|
@ -5007,7 +5005,7 @@ static void M_DrawChallengePreview(INT32 x, INT32 y)
|
|||
if (skin != -1)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(skin, skins[skin].prefcolor, GTC_MENUCACHE);
|
||||
M_DrawCharacterSprite(x, y, skin, false, false, 0, colormap);
|
||||
M_DrawCharacterSprite(x, y, skin, SPR2_STIN, 7, 0, 0, colormap);
|
||||
|
||||
for (i = 0; i < skin; i++)
|
||||
{
|
||||
|
|
@ -5065,7 +5063,7 @@ static void M_DrawChallengePreview(INT32 x, INT32 y)
|
|||
if (skin == -1)
|
||||
skin = 0;
|
||||
colormap = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_BLACK, GTC_MENUCACHE);
|
||||
M_DrawCharacterSprite(x, y, skin, false, false, 0, colormap);
|
||||
M_DrawCharacterSprite(x, y, skin, SPR2_STIN, 7, 0, 0, colormap);
|
||||
|
||||
// Draw follower next to them
|
||||
if (fskin != -1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue