From 7a692b1557bd8d6f1aaf84fe00986fc9943a12db Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 14 Jul 2018 22:58:24 +0200 Subject: [PATCH] - added DTA_LegacyRenderStyle so that STYLE_* constants can be passed directly to the Draw functions. - fixed the optional parameter in Shape2D.Clear. --- src/v_2ddrawer.cpp | 2 +- src/v_draw.cpp | 4 ++++ src/v_video.h | 3 ++- wadsrc/static/zscript/base.txt | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/v_2ddrawer.cpp b/src/v_2ddrawer.cpp index e359be3745..4999c5241f 100644 --- a/src/v_2ddrawer.cpp +++ b/src/v_2ddrawer.cpp @@ -40,7 +40,7 @@ IMPLEMENT_CLASS(DShape2D, false, false) DEFINE_ACTION_FUNCTION(DShape2D, Clear) { PARAM_SELF_PROLOGUE(DShape2D); - PARAM_INT(which); + PARAM_INT_DEF(which); if ( which&C_Verts ) self->mVertices.Clear(); if ( which&C_Coords ) self->mCoords.Clear(); if ( which&C_Indices ) self->mIndices.Clear(); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 59192cd8b5..e3ebe63bcd 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -839,6 +839,10 @@ bool DFrameBuffer::ParseDrawTextureTags(FTexture *img, double x, double y, uint3 parms->style.AsDWORD = ListGetInt(tags); break; + case DTA_LegacyRenderStyle: // mainly for ZScript which does not handle FRenderStyle that well. + parms->style = (ERenderStyle)ListGetInt(tags); + break; + case DTA_SpecialColormap: parms->specialcolormap = ListGetSpecialColormap(tags); break; diff --git a/src/v_video.h b/src/v_video.h index f4ac30092f..2e6c0cd301 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -195,7 +195,8 @@ enum DTA_SrcX, // specify a source rectangle (this supersedes the poorly implemented DTA_WindowLeft/Right DTA_SrcY, DTA_SrcWidth, - DTA_SrcHeight + DTA_SrcHeight, + DTA_LegacyRenderStyle, // takes an old-style STYLE_* constant instead of an FRenderStyle }; diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index e1ecc9fedf..dbf71a9424 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -161,7 +161,8 @@ enum DrawTextureTags DTA_SrcX, // specify a source rectangle (this supersedes the poorly implemented DTA_WindowLeft/Right DTA_SrcY, DTA_SrcWidth, - DTA_SrcHeight + DTA_SrcHeight, + DTA_LegacyRenderStyle, // takes an old-style STYLE_* constant instead of an FRenderStyle };