Skip to content

Commit

Permalink
Revert "- fixed some uses of postincre,ment/decrements on narrow types."
Browse files Browse the repository at this point in the history
This reverts commit 668f8f2.

Revert "- added a proper error message when '--' or '++' gets used on 8 or 16 bit values."

This reverts commit a94f5dd.

None of this was necessary - the triggered assert was bogus and had to be removed.
  • Loading branch information
coelckers committed May 17, 2021
1 parent 6ebe30c commit 97b8c0c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp
Expand Up @@ -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");

Expand Down
10 changes: 4 additions & 6 deletions src/common/scripting/backend/codegen.cpp
Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/playsim/d_player.h
Expand Up @@ -318,8 +318,8 @@ class player_t
// 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;
Expand All @@ -344,7 +344,7 @@ class player_t

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
Expand Down
3 changes: 1 addition & 2 deletions wadsrc/static/zscript/actors/hexen/firedemon.zs
Expand Up @@ -218,8 +218,7 @@ class FireDemon : Actor
// Normal movement
if (!fdstrafecount)
{
movecount = movecount - 1;
if (movecount < 0 || !MonsterMove ())
if (--movecount<0 || !MonsterMove ())
{
NewChaseDir ();
}
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

2 comments on commit 97b8c0c

@Cacodemon345
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that the Vulkan changes has been reverted?

@coelckers
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They got into this commit by accident, of course they need to be reapplied as a separate commit.

Please sign in to comment.