diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2026-07-31 13:20:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-31 13:20:48 -0400 |
| commit | 45718d8cccbde7bad1c090de82e343fba68dc27f (patch) | |
| tree | 283f733a77fb0ead544a652e17cf2dad2ad42e89 /include/d/d_drawlist.h | |
| parent | 641268e340402a965c90610f7c176d95e346c644 (diff) | |
Compiler compat fix: Passing of rvalue GXColors to non-const reference parameters (#1142)
Diffstat (limited to 'include/d/d_drawlist.h')
| -rw-r--r-- | include/d/d_drawlist.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 6ab8c6c9..58ed7da0 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -151,8 +151,14 @@ public: virtual void draw(); void setAlpha(u8 i_alpha) { mBlack.a = i_alpha; } - void setBlackColor(GXColor& c) { mBlack = c; } - void setWhiteColor(GXColor& c) { mWhite = c; } + void setBlackColor(GXColor& i_color) { mBlack = i_color; } + void setWhiteColor(GXColor& i_color) { mWhite = i_color; } + // some calls to these functions define i_color inline which is illegal in C++ for a non-const + // reference parameter - we add these overloads to enable standard compiler compatibility +#if !__MWERKS__ + void setBlackColor(const GXColor& i_color) { mBlack = const_cast<GXColor&>(i_color); } + void setWhiteColor(const GXColor& i_color) { mWhite = const_cast<GXColor&>(i_color); } +#endif public: struct TexEntry { |
