Skip to content

Commit 6be0f31

Browse files
authored
Merge branch 'master' into feat/wide-path-io-v2
2 parents d8f5c4d + 1443976 commit 6be0f31

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build DLL
2-
on: push
2+
on:
3+
push:
4+
pull_request:
5+
release:
6+
types: [published]
37
jobs:
48
build_dll:
59
strategy:
@@ -15,6 +19,7 @@ jobs:
1519
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed/
1620
DEPS_DIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.triplet }}
1721
INST_DIR: ${{ github.workspace }}/install-prefix
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1823
steps:
1924
- name: Checkout
2025
uses: actions/checkout@v4
@@ -69,3 +74,28 @@ jobs:
6974
${{ env.DEPS_DIR }}/bin/*.pdb
7075
${{ github.workspace }}/build/Release/lzip.pdb
7176
${{ github.workspace }}/build/Release/lcurl.pdb
77+
78+
- name: Upload to release
79+
if: ${{ github.event_name == 'release' }}
80+
run: |
81+
cd ${{ env.INST_DIR }}
82+
tar -cvf SimpleGraphicDLLs-${{ matrix.triplet }}.tar *.dll
83+
gh release upload ${{ github.event.release.tag_name }} SimpleGraphicDLLs-${{ matrix.triplet }}.tar
84+
85+
- name: Notify PathOfBuilding repo
86+
if: ${{ github.event_name == 'release' }}
87+
uses: peter-evans/repository-dispatch@v3
88+
with:
89+
token: ${{ secrets.WIRES77_PAT }}
90+
repository: ${{ github.repository_owner }}/PathOfBuilding
91+
event-type: update-simple-graphic
92+
client-payload: '{"tag": "${{ github.event.release.tag_name }}", "release_link": "${{ github.event.release.html_url }}"}'
93+
94+
- name: Notify PathOfBuilding-PoE2 repo
95+
if: ${{ github.event_name == 'release' }}
96+
uses: peter-evans/repository-dispatch@v3
97+
with:
98+
token: ${{ secrets.WIRES77_PAT }}
99+
repository: ${{ github.repository_owner }}/PathOfBuilding-PoE2
100+
event-type: update-simple-graphic
101+
client-payload: '{"tag": "${{ github.event.release.tag_name }}", "release_link": "${{ github.event.release.html_url }}"}'

engine/core/core_image.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ bool targa_c::Load(std::filesystem::path const& fileName, std::optional<size_cal
250250
bool targa_c::Save(std::filesystem::path const& fileName)
251251
{
252252
auto format = tex.format();
253-
if (is_compressed(format) || !is_unsigned_integer(format))
253+
if (is_compressed(format) || !is_unsigned(format))
254254
return true;
255255

256256
int comp = (int)component_count(format);
@@ -319,7 +319,7 @@ bool jpeg_c::Save(std::filesystem::path const& fileName)
319319
{
320320
// JPEG only supports RGB and grayscale images
321321
auto format = tex.format();
322-
if (is_compressed(format) || !is_unsigned_integer(format))
322+
if (is_compressed(format) || !is_unsigned(format))
323323
return true;
324324

325325
int comp = (int)component_count(format);
@@ -385,7 +385,7 @@ bool png_c::Load(std::filesystem::path const& fileName, std::optional<size_callb
385385
bool png_c::Save(std::filesystem::path const& fileName)
386386
{
387387
auto format = tex.format();
388-
if (is_compressed(format) || !is_unsigned_integer(format))
388+
if (is_compressed(format) || !is_unsigned(format))
389389
return true;
390390

391391
int comp = (int)component_count(format);

ui_api.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,12 +1588,20 @@ static int l_RemoveDir(lua_State* L)
15881588
{
15891589
ui_main_c* ui = GetUIPtr(L);
15901590
int n = lua_gettop(L);
1591-
ui->LAssert(L, n >= 1, "Usage: l_RemoveDir(path)");
1591+
ui->LAssert(L, n >= 1, "Usage: l_RemoveDir(path, recurse)");
15921592
ui->LAssert(L, lua_isstring(L, 1), "l_RemoveDir() argument 1: expected string, got %s", luaL_typename(L, 1));
15931593
char const* givenPath = lua_tostring(L, 1);
15941594
auto path = std::filesystem::u8path(givenPath);
1595+
bool recursive = false;
1596+
if (n > 1) {
1597+
ui->LAssert(L, lua_isboolean(L, 2), "l_RemoveDir() argument 2: expected boolean, got %s", luaL_typename(L, 2));
1598+
recursive = lua_toboolean(L, 2);
1599+
}
15951600
std::error_code ec;
1596-
if (!is_directory(path, ec) || ec || !remove(path, ec) || ec) {
1601+
if (!is_directory(path, ec) || ec
1602+
|| (recursive && !remove_all(path, ec)) || ec
1603+
|| (!recursive && !remove(path, ec)) || ec)
1604+
{
15971605
lua_pushnil(L);
15981606
lua_pushstring(L, strerror(ec.value()));
15991607
return 2;

0 commit comments

Comments
 (0)