Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fixed some uses of postincre,ment/decrements on narrow types.
THe VM has no opcode for this, all these places produced code with undefined behavior.
  • Loading branch information
coelckers committed May 17, 2021
1 parent a94f5dd commit 668f8f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/common/rendering/vulkan/renderer/vk_renderbuffers.cpp
Expand Up @@ -239,8 +239,13 @@ void VkRenderBuffers::CreateShadowmap()

ImageBuilder builder;
builder.setSize(gl_shadowmap_quality, 1024);
builder.setFormat(VK_FORMAT_R32_SFLOAT);
builder.setFormat(SceneNormalFormat);
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
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
short refire = 0; // refired shots are less accurate
int 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: 2 additions & 1 deletion wadsrc/static/zscript/actors/hexen/firedemon.zs
Expand Up @@ -218,7 +218,8 @@ class FireDemon : Actor
// Normal movement
if (!fdstrafecount)
{
if (--movecount<0 || !MonsterMove ())
movecount = movecount - 1;
if (movecount < 0 || !MonsterMove ())
{
NewChaseDir ();
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/inventory/stateprovider.zs
Expand Up @@ -406,7 +406,7 @@ class StateProvider : Inventory
if ((player.cmd.buttons & BT_ATTACK)
&& !player.ReadyWeapon.bAltFire && !pending && player.health > 0)
{
player.refire = player.refire + 1;
player.refire++;
player.mo.FireWeapon(ResolveState(flash));
}
else if ((player.cmd.buttons & BT_ALTATTACK)
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 uint8 turnticks;
native int 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 int16 refire;
native int refire;
native int16 inconsistent;
native bool waiting;
native int killcount;
Expand Down

0 comments on commit 668f8f2

Please sign in to comment.