- avoid storing texture pointers in longer lived data
* these circumvented all internal texture replacement logic. Texture objects should only be resolved right before drawing them * added an explicit ‚tilebackground‘ option for the summary screen to fix problems with bad decision logic based on incorrect texture type checks. Automatic tiling no longer depends on texture type, but solely on size. * added a DrawTexture variant that can be passed a texture ID instead of a pointer
This commit is contained in:
parent
21b6f722be
commit
989dcfcf1c
9 changed files with 74 additions and 48 deletions
|
|
@ -194,10 +194,8 @@ int CleanXfac_1, CleanYfac_1, CleanWidth_1, CleanHeight_1;
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DrawTexture(F2DDrawer *drawer, FGameTexture* img, double x, double y, int tags_first, ...)
|
||||
static void DoDrawTexture(F2DDrawer *drawer, FGameTexture* img, double x, double y, int tags_first, Va_List& tags)
|
||||
{
|
||||
Va_List tags;
|
||||
va_start(tags.list, tags_first);
|
||||
DrawParms parms;
|
||||
|
||||
if (!img || !img->isValid()) return;
|
||||
|
|
@ -210,6 +208,23 @@ void DrawTexture(F2DDrawer *drawer, FGameTexture* img, double x, double y, int t
|
|||
drawer->AddTexture(img, parms);
|
||||
}
|
||||
|
||||
|
||||
void DrawTexture(F2DDrawer *drawer, FGameTexture* img, double x, double y, int tags_first, ...)
|
||||
{
|
||||
Va_List tags;
|
||||
va_start(tags.list, tags_first);
|
||||
DoDrawTexture(drawer, img, x, y, tags_first, tags);
|
||||
}
|
||||
|
||||
void DrawTexture(F2DDrawer *drawer, FTextureID texid, bool animate, double x, double y, int tags_first, ...)
|
||||
{
|
||||
Va_List tags;
|
||||
va_start(tags.list, tags_first);
|
||||
auto img = TexMan.GetGameTexture(texid, animate);
|
||||
DoDrawTexture(drawer, img, x, y, tags_first, tags);
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// ZScript texture drawing function
|
||||
|
|
@ -218,7 +233,7 @@ void DrawTexture(F2DDrawer *drawer, FGameTexture* img, double x, double y, int t
|
|||
|
||||
int ListGetInt(VMVa_List &tags);
|
||||
|
||||
static void DrawTexture(F2DDrawer *drawer, FGameTexture *img, double x, double y, VMVa_List &args)
|
||||
static void DoDrawTexture(F2DDrawer *drawer, FGameTexture *img, double x, double y, VMVa_List &args)
|
||||
{
|
||||
DrawParms parms;
|
||||
uint32_t tag = ListGetInt(args);
|
||||
|
|
@ -242,7 +257,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawTexture)
|
|||
|
||||
auto tex = TexMan.GameByIndex(texid, animate);
|
||||
VMVa_List args = { param + 4, 0, numparam - 5, va_reginfo + 4 };
|
||||
DrawTexture(twod, tex, x, y, args);
|
||||
DoDrawTexture(twod, tex, x, y, args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1609,4 +1624,4 @@ DEFINE_ACTION_FUNCTION(_Screen, SetOffset)
|
|||
PARAM_FLOAT(x);
|
||||
PARAM_FLOAT(y);
|
||||
ACTION_RETURN_VEC2(twod->SetOffset(DVector2(x, y)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue