mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
srb2::Draw: add cache_patch static class method
This commit is contained in:
parent
311cf5ceea
commit
6347afb63f
2 changed files with 8 additions and 6 deletions
|
|
@ -132,11 +132,6 @@ void Chain::patch(patch_t* patch) const
|
|||
V_DrawStretchyFixedPatch(FloatToFixed(x_), FloatToFixed(y_), h * scale_, v * scale_, flags_, patch, colormap_);
|
||||
}
|
||||
|
||||
void Chain::patch(const char* name) const
|
||||
{
|
||||
patch(static_cast<patch_t*>(W_CachePatchName(name, PU_CACHE)));
|
||||
}
|
||||
|
||||
void Chain::thumbnail(UINT16 mapnum) const
|
||||
{
|
||||
const auto _ = Clipper(*this);
|
||||
|
|
@ -240,6 +235,11 @@ Chain::Clipper::~Clipper()
|
|||
V_ClearClipRect();
|
||||
}
|
||||
|
||||
patch_t* Draw::cache_patch(const char* name)
|
||||
{
|
||||
return static_cast<patch_t*>(W_CachePatchName(name, PU_CACHE));
|
||||
}
|
||||
|
||||
int Draw::font_to_fontno(Font font)
|
||||
{
|
||||
switch (font)
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ public:
|
|||
TextElement text() const { return TextElement().font(font_).flags(flags_); }
|
||||
|
||||
void patch(patch_t* patch) const;
|
||||
void patch(const char* name) const;
|
||||
void patch(const char* name) const { patch(Draw::cache_patch(name)); }
|
||||
|
||||
void thumbnail(UINT16 mapnum) const;
|
||||
|
||||
|
|
@ -217,6 +217,8 @@ public:
|
|||
friend Draw;
|
||||
};
|
||||
|
||||
static patch_t* cache_patch(const char* name);
|
||||
|
||||
constexpr Draw() {}
|
||||
explicit Draw(float x, float y) : chain_(x, y) {}
|
||||
Draw(const Chain& chain) : chain_(chain) {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue