From c6d63224947f99fd5bd3207f074261dbdd06938e Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Mon, 12 Sep 2022 06:08:32 -0600 Subject: [PATCH] use PalEntry instead of int for ParseDrawTextureTags --- src/common/2d/v_draw.cpp | 10 +++++----- src/common/2d/v_draw.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index 836bc22842..3d56829bac 100644 --- a/src/common/2d/v_draw.cpp +++ b/src/common/2d/v_draw.cpp @@ -306,7 +306,7 @@ void DrawShape(F2DDrawer *drawer, FGameTexture *img, DShape2D *shape, VMVa_List drawer->AddShape(img, shape, parms); } -void DrawShapeFill(F2DDrawer *drawer, int color, double amount, DShape2D *shape, VMVa_List &args) +void DrawShapeFill(F2DDrawer *drawer, PalEntry color, double amount, DShape2D *shape, VMVa_List &args) { DrawParms parms; uint32_t tag = ListGetInt(args); @@ -827,7 +827,7 @@ static inline FSpecialColormap * ListGetSpecialColormap(VMVa_List &tags) //========================================================================== template -bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, int type, int fill, double fillalpha) +bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, int type, PalEntry fill, double fillalpha) { INTBOOL boolval; int intval; @@ -861,7 +861,7 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double parms->destwidth = INT_MAX; parms->destheight = INT_MAX; parms->Alpha = type == DrawTexture_Fill ? fillalpha : 1.f; - parms->fillcolor = type == DrawTexture_Fill ? fill : -1; + parms->fillcolor = type == DrawTexture_Fill ? fill : PalEntry(~0u); parms->TranslationId = -1; parms->colorOverlay = 0; parms->alphaChannel = false; @@ -1430,8 +1430,8 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double } // explicitly instantiate both versions for v_text.cpp. -template bool ParseDrawTextureTags(F2DDrawer* drawer, FGameTexture *img, double x, double y, uint32_t tag, Va_List& tags, DrawParms *parms, int type, int fill, double fillalpha); -template bool ParseDrawTextureTags(F2DDrawer* drawer, FGameTexture *img, double x, double y, uint32_t tag, VMVa_List& tags, DrawParms *parms, int type, int fill, double fillalpha); +template bool ParseDrawTextureTags(F2DDrawer* drawer, FGameTexture *img, double x, double y, uint32_t tag, Va_List& tags, DrawParms *parms, int type, PalEntry fill, double fillalpha); +template bool ParseDrawTextureTags(F2DDrawer* drawer, FGameTexture *img, double x, double y, uint32_t tag, VMVa_List& tags, DrawParms *parms, int type, PalEntry fill, double fillalpha); //========================================================================== // diff --git a/src/common/2d/v_draw.h b/src/common/2d/v_draw.h index 8626c1e4a5..686e5dc46d 100644 --- a/src/common/2d/v_draw.h +++ b/src/common/2d/v_draw.h @@ -266,7 +266,7 @@ enum }; template -bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture* img, double x, double y, uint32_t tag, T& tags, DrawParms* parms, int type, int fill = -1, double fillalpha = 0.0); +bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture* img, double x, double y, uint32_t tag, T& tags, DrawParms* parms, int type, PalEntry fill = ~0u, double fillalpha = 0.0); template void DrawTextCommon(F2DDrawer *drawer, FFont* font, int normalcolor, double x, double y, const T* string, DrawParms& parms);