summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Mueller <appgurulars@gmx.de>2022-01-28 17:50:51 +0100
committersfan5 <sfan5@live.de>2022-05-12 11:36:11 +0200
commit3afffcd36b2e23a2301e3dbcfdee30bd27fbf5e7 (patch)
tree196515e99a5d6caba0c44b08f7dfe31e1f2363e5 /src
parent5440de17859127bee4c0c9023c0e28570555d36f (diff)
downloadminetest-3afffcd36b2e23a2301e3dbcfdee30bd27fbf5e7.tar.gz
minetest-3afffcd36b2e23a2301e3dbcfdee30bd27fbf5e7.tar.bz2
minetest-3afffcd36b2e23a2301e3dbcfdee30bd27fbf5e7.zip
Fix builtin statbar backgrounds
see #12000
Diffstat (limited to 'src')
-rw-r--r--src/client/hud.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/hud.cpp b/src/client/hud.cpp
index 6011a8cff..259a18ab9 100644
--- a/src/client/hud.cpp
+++ b/src/client/hud.cpp
@@ -676,7 +676,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir,
// Rectangles for 1/2 the "off state" texture
core::rect<s32> srchalfrect2, dsthalfrect2;
- if (count % 2 == 1) {
+ if (count % 2 == 1 || maxcount % 2 == 1) {
// Need to draw halves: Calculate rectangles
srchalfrect = calculate_clipping_rect(srcd, steppos);
dsthalfrect = calculate_clipping_rect(dstd, steppos);
@@ -711,7 +711,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir,
}
}
- if (stat_texture_bg && maxcount > count / 2) {
+ if (stat_texture_bg && maxcount > count) {
// Draw "off state" textures
s32 start_offset;
if (count % 2 == 1)
@@ -731,8 +731,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir,
if (maxcount % 2 == 1) {
draw2DImageFilterScaled(driver, stat_texture_bg,
- dsthalfrect + p, srchalfrect,
- NULL, colors, true);
+ dsthalfrect + p, srchalfrect, NULL, colors, true);
}
}
}