From 97b8c0ccfbfea2a5be1a5cda651481ea128e4a06 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 17 May 2021 18:13:30 +0200 Subject: [PATCH] Revert "- fixed some uses of postincre,ment/decrements on narrow types." This reverts commit 668f8f2cf6eb535c45c003c6edc3997450771bec. Revert "- added a proper error message when '--' or '++' gets used on 8 or 16 bit values." This reverts commit a94f5dd1b3b106d08a0040e568874014321ad1b5. None of this was necessary - the triggered assert was bogus and had to be removed. --- .../rendering/vulkan/renderer/vk_renderbuffers.cpp | 7 +------ src/common/scripting/backend/codegen.cpp | 10 ++++------ src/playsim/d_player.h | 4 ++-- wadsrc/static/zscript/actors/hexen/firedemon.zs | 3 +-- wadsrc/static/zscript/actors/player/player.zs | 4 ++-- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp b/src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp index 75288a4f2e..34e44096d5 100644 --- a/src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp +++ b/src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp @@ -239,13 +239,8 @@ void VkRenderBuffers::CreateShadowmap() ImageBuilder builder; builder.setSize(gl_shadowmap_quality, 1024); - builder.setFormat(SceneNormalFormat); + builder.setFormat(VK_FORMAT_R32_SFLOAT); builder.setUsage(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT); - if (!builder.isFormatSupported(fb->device, VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) - { - SceneNormalFormat = VK_FORMAT_R8G8B8A8_UNORM; - builder.setFormat(SceneNormalFormat); - } Shadowmap.Image = builder.create(fb->device); Shadowmap.Image->SetDebugName("VkRenderBuffers.Shadowmap"); diff --git a/src/common/scripting/backend/codegen.cpp b/src/common/scripting/backend/codegen.cpp index ce3cc45937..2b4b1eab49 100644 --- a/src/common/scripting/backend/codegen.cpp +++ b/src/common/scripting/backend/codegen.cpp @@ -2145,9 +2145,9 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx) ValueType = Base->ValueType; - if (!Base->IsNumeric() || Base->ValueType->Size != 4) + if (!Base->IsNumeric()) { - ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected"); + ScriptPosition.Message(MSG_ERROR, "Numeric type expected"); delete this; return nullptr; } @@ -2170,7 +2170,6 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx) ExpEmit FxPreIncrDecr::Emit(VMFunctionBuilder *build) { assert(Token == TK_Incr || Token == TK_Decr); - assert(ValueType == Base->ValueType && IsNumeric()); int zero = build->GetConstantInt(0); int regtype = ValueType->GetRegType(); @@ -2232,9 +2231,9 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx) ValueType = Base->ValueType; - if (!Base->IsNumeric() || ValueType->Size != 4) + if (!Base->IsNumeric()) { - ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected"); + ScriptPosition.Message(MSG_ERROR, "Numeric type expected"); delete this; return nullptr; } @@ -2257,7 +2256,6 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx) ExpEmit FxPostIncrDecr::Emit(VMFunctionBuilder *build) { assert(Token == TK_Incr || Token == TK_Decr); - assert(ValueType == Base->ValueType && IsNumeric()); int zero = build->GetConstantInt(0); int regtype = ValueType->GetRegType(); diff --git a/src/playsim/d_player.h b/src/playsim/d_player.h index 269ff6984c..f11763386e 100644 --- a/src/playsim/d_player.h +++ b/src/playsim/d_player.h @@ -318,8 +318,8 @@ public: // This avoids anomalies with such things as Boom ice and conveyors. DVector2 Vel = { 0,0 }; - int turnticks = 0; bool centering = false; + uint8_t turnticks = 0; bool attackdown = false; @@ -344,7 +344,7 @@ public: int cheats = 0; // bit flags int timefreezer = 0; // Player has an active time freezer - int refire = 0; // refired shots are less accurate + short refire = 0; // refired shots are less accurate short inconsistant = 0; bool waiting = 0; int killcount = 0, itemcount = 0, secretcount = 0; // for intermission diff --git a/wadsrc/static/zscript/actors/hexen/firedemon.zs b/wadsrc/static/zscript/actors/hexen/firedemon.zs index 7849455af9..d585ea745f 100644 --- a/wadsrc/static/zscript/actors/hexen/firedemon.zs +++ b/wadsrc/static/zscript/actors/hexen/firedemon.zs @@ -218,8 +218,7 @@ class FireDemon : Actor // Normal movement if (!fdstrafecount) { - movecount = movecount - 1; - if (movecount < 0 || !MonsterMove ()) + if (--movecount<0 || !MonsterMove ()) { NewChaseDir (); } diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index b01c93e262..306c0ce84c 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -2652,7 +2652,7 @@ struct PlayerInfo native play // self is what internally is known as player_t native double bob; native vector2 vel; native bool centering; - native int turnticks; + native uint8 turnticks; native bool attackdown; native bool usedown; native uint oldbuttons; @@ -2670,7 +2670,7 @@ struct PlayerInfo native play // self is what internally is known as player_t native PSprite psprites; native int cheats; native int timefreezer; - native int refire; + native int16 refire; native int16 inconsistent; native bool waiting; native int killcount;