mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
srb2::Draw: relax type on colormap/colorize color argument
Lets you pass player_t.skincolor directly to the methods without using static_cast<skincolornum_t>. No, I don't want type safety on enums, this is SRB2.
This commit is contained in:
parent
84641c896e
commit
45a9042650
2 changed files with 9 additions and 9 deletions
|
|
@ -155,9 +155,9 @@ public:
|
||||||
Chain& clipy() { return clipy(y_, y_ + height_); }
|
Chain& clipy() { return clipy(y_, y_ + height_); }
|
||||||
|
|
||||||
Chain& colormap(const UINT8* colormap);
|
Chain& colormap(const UINT8* colormap);
|
||||||
Chain& colormap(skincolornum_t color);
|
Chain& colormap(UINT16 color);
|
||||||
Chain& colormap(INT32 skin, skincolornum_t color);
|
Chain& colormap(INT32 skin, UINT16 color);
|
||||||
Chain& colorize(skincolornum_t color);
|
Chain& colorize(UINT16 color);
|
||||||
|
|
||||||
void text(const char* str) const { string(str, flags_, font_); }
|
void text(const char* str) const { string(str, flags_, font_); }
|
||||||
void text(const std::string& str) const { text(str.c_str()); }
|
void text(const std::string& str) const { text(str.c_str()); }
|
||||||
|
|
|
||||||
|
|
@ -103,19 +103,19 @@ inline Draw::Chain& Draw::Chain::colormap(const UINT8* colormap)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Draw::Chain& Draw::Chain::colormap(skincolornum_t color)
|
inline Draw::Chain& Draw::Chain::colormap(UINT16 color)
|
||||||
{
|
{
|
||||||
return colormap(R_GetTranslationColormap(TC_DEFAULT, color, GTC_CACHE));
|
return colormap(R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolornum_t>(color), GTC_CACHE));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Draw::Chain& Draw::Chain::colormap(INT32 skin, skincolornum_t color)
|
inline Draw::Chain& Draw::Chain::colormap(INT32 skin, UINT16 color)
|
||||||
{
|
{
|
||||||
return colormap(R_GetTranslationColormap(skin, color, GTC_CACHE));
|
return colormap(R_GetTranslationColormap(skin, static_cast<skincolornum_t>(color), GTC_CACHE));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Draw::Chain& Draw::Chain::colorize(skincolornum_t color)
|
inline Draw::Chain& Draw::Chain::colorize(UINT16 color)
|
||||||
{
|
{
|
||||||
return colormap(R_GetTranslationColormap(TC_RAINBOW, color, GTC_CACHE));
|
return colormap(R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(color), GTC_CACHE));
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace srb2
|
}; // namespace srb2
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue