Minor changes and fixes

master
Maksim 2022-05-26 19:30:24 +03:00
parent d48d6f8dc0
commit 2d0b2e7ea7
9 changed files with 17 additions and 22 deletions

1
.gitattributes vendored
View File

@ -1,2 +1,3 @@
* text=auto
*.cpp diff=cpp
*.h diff=cpp

View File

@ -14,12 +14,13 @@ on:
jobs:
luacheck:
name: "Builtin Luacheck and Unit Tests"
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install luarocks
run: |
sudo apt-get install luarocks -qyy
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v9
with:
luaVersion: "5.1.5"
- uses: leafo/gh-actions-luarocks@v4
- name: Install luarocks tools
run: |

View File

@ -23,9 +23,8 @@ local function vector_absmax(v)
end
core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, unused_dir, damage)
if player:get_hp() == 0
or player:get_animation().range ~= "stand" then
return -- RIP or attached
if player:get_hp() == 0 then
return -- RIP
end
-- Server::handleCommand_Interact() adds eye offset to one but not the other

View File

@ -1234,7 +1234,7 @@
# bind_address =
# Disable to prevent clients that don't support protocol version 37 from connecting.
# enable_proto_compat = true
# enable_protocol_compat = true
# Enable to disallow old clients from connecting.
# Older clients are compatible in the sense that they will not crash when connecting

View File

@ -558,7 +558,7 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text,
float imgR = scale;
#else
float imgRatio = (float) img_size.Height / img_size.Width;
u32 imgW = npot2(screensize.X / 2.0f);
u32 imgW = npot2(screensize.X / 2);
if (imgW > (screensize.X * 0.7) && imgW >= 1024)
imgW /= 2;
u32 imgH = imgW * imgRatio;
@ -608,7 +608,7 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text,
core::rect<s32>(507, 24, 508, 40)
};
for (const auto & i : rects) {
for (const auto &i : rects) {
const s32 clipx = (percent * imgW) / 100;
core::rect<s32> r(
MYMIN(i.UpperLeftCorner.X * imgR, clipx), i.UpperLeftCorner.Y * imgR,
@ -616,12 +616,12 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text,
);
if (r.getArea() <= 0)
break;
get_video_driver()->draw2DRectangle(
driver->draw2DRectangle(
video::SColor(255, 255 - percent * 2, percent * 2, 25),
r + img_pos, nullptr);
}
draw2DImageFilterScaled(get_video_driver(), progress_img,
draw2DImageFilterScaled(driver, progress_img,
core::rect<s32>(img_pos.X, img_pos.Y,
img_pos.X + (percent * imgW) / 100,
img_pos.Y + imgH),
@ -633,7 +633,7 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text,
}
guienv->drawAll();
get_video_driver()->endScene();
driver->endScene();
guitext->remove();
}
@ -825,7 +825,8 @@ v2u32 RenderingEngine::getDisplaySize()
#else // __ANDROID__/__IOS__
float RenderingEngine::getDisplayDensity()
{
return porting::getDisplayDensity();
static const float density = porting::getDisplayDensity();
return density;
}
v2u32 RenderingEngine::getDisplaySize()

View File

@ -1068,13 +1068,6 @@ video::IImage * Align2Npot2(video::IImage * image,
if (dim.Width == width)
return image;
#ifdef __IOS__
if (height > 64 || width > 64) {
height /= 2;
width /= 2;
}
#endif
video::IImage *targetimage =
driver->createImage(video::ECF_A8R8G8B8,
core::dimension2d<u32>(width, height));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 171 B