Skip to content

Commit

Permalink
use PalEntry instead of int for ParseDrawTextureTags
Browse files Browse the repository at this point in the history
  • Loading branch information
marrub-- authored and coelckers committed Sep 16, 2022
1 parent fb32ff4 commit c6d6322
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/common/2d/v_draw.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -827,7 +827,7 @@ static inline FSpecialColormap * ListGetSpecialColormap(VMVa_List &tags)
//==========================================================================

template<class T>
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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1430,8 +1430,8 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double
}
// explicitly instantiate both versions for v_text.cpp.

template bool ParseDrawTextureTags<Va_List>(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<VMVa_List>(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<Va_List>(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<VMVa_List>(F2DDrawer* drawer, FGameTexture *img, double x, double y, uint32_t tag, VMVa_List& tags, DrawParms *parms, int type, PalEntry fill, double fillalpha);

//==========================================================================
//
Expand Down
2 changes: 1 addition & 1 deletion src/common/2d/v_draw.h
Expand Up @@ -266,7 +266,7 @@ enum
};

template<class T>
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<class T>
void DrawTextCommon(F2DDrawer *drawer, FFont* font, int normalcolor, double x, double y, const T* string, DrawParms& parms);
Expand Down

0 comments on commit c6d6322

Please sign in to comment.