Skip to content

Commit 9e2d942

Browse files
committed
add .editorconfig
1 parent 512fbe3 commit 9e2d942

File tree

8 files changed

+62
-47
lines changed

8 files changed

+62
-47
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = unset
5+
indent_style = space
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.cpp]
10+
charset = utf-8
11+
indent_size = 4
12+
13+
[*.{obj,anm,tra}]
14+
15+
[*.md]
16+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*.anm text eol=crlf linguist-language=Lua working-tree-encoding=cp932
44
*.scn text eol=crlf linguist-language=Lua working-tree-encoding=cp932
55
*.cam text eol=crlf linguist-language=Lua working-tree-encoding=cp932
6-
*.tra text eol=crlf linguist-language=Lua working-tree-encoding=cp932
6+
*.tra text eol=crlf linguist-language=Lua working-tree-encoding=cp932

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ updates:
1616
patterns:
1717
- "actions/upload-artifact"
1818
- "actions/download-artifact"
19-
19+

.github/workflows/build.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: ilammy/msvc-dev-cmd@v1
2424
with:
2525
arch: x86
26-
26+
2727
- uses: leafo/gh-actions-lua@v10
2828
with:
2929
luaVersion: 5.1.5
@@ -46,13 +46,13 @@ jobs:
4646
cp Readme.md pub
4747
cd pub
4848
7z a Bevel_And_Emboss_M.zip *
49-
49+
5050
- name: Upload artifact
5151
uses: actions/upload-artifact@v4
5252
with:
5353
name: Bevel_And_Emboss_M
5454
path: ${{ github.workspace }}/pub/Bevel_And_Emboss_M.zip
55-
55+
5656
create_release:
5757
name: Create release
5858
needs: build
@@ -63,18 +63,17 @@ jobs:
6363
uses: actions/checkout@v4
6464
with:
6565
fetch-depth: 0
66-
66+
6767
- uses: actions/download-artifact@v4
6868
with:
6969
name: Bevel_And_Emboss_M
7070
path: artifacts
71-
71+
7272
- name: Create a Release
7373
env:
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575
run: |
7676
REVCOUNT=`git rev-list --count HEAD`
7777
RELEASE_NAME=r${REVCOUNT}
7878
TAG_NAME=r${REVCOUNT}
79-
gh release create "${TAG_NAME}" ${{ github.workspace }}/artifacts/*.zip -t "${RELEASE_NAME}"
80-
79+
gh release create "${TAG_NAME}" ${{ github.workspace }}/artifacts/*.zip -t "${RELEASE_NAME}"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/*/build/*
1+
/*/build/*

LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Mr-Ojii
3+
Copyright (c) 2022-2025 Mr-Ojii
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

dll_src/Bevel_And_Emboss_M.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static HMODULE get_utl_module() {
206206

207207
static void multi_thread(std::function<void(int, int)>&& f, bool single = false) {
208208
if (exec_multi_thread_func && !single) {
209-
exec_multi_thread_func([](int thread_id, int thread_num, void* param1, void* param2) {
209+
exec_multi_thread_func([](int thread_id, int thread_num, void* param1, void* param2) {
210210
(*reinterpret_cast<std::function<void(int, int)>*>(param1))(thread_id, thread_num);
211211
}, &f, nullptr);
212212
} else {
@@ -313,13 +313,13 @@ int bevel_and_emboss(lua_State *L) {
313313
std::unique_ptr<Pixel_Info[]> pix_info = std::make_unique_for_overwrite<Pixel_Info[]>(size);
314314

315315
Pixel_BGRA* pixel = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
316-
316+
317317
std::unique_ptr<bool[]> border_ans = std::make_unique_for_overwrite<bool[]>(size);
318-
318+
319319
for(int j = 0; j < h; j++) {
320320
for(int i = 0; i < w; i++) {
321321
pix_info[j * w + i] = {pixel[j * w + i].a, HUGE_VAL, static_cast<double>(i), static_cast<double>(j), 1, 0};
322-
322+
323323
//rikky_module.borderingも一緒に
324324
//端か、端ではなかった場合上下左右がth以下だった場合
325325
if(a_th < pixel[j * w + i].a && ((i == 0 || j == 0 || i == w-1 || j == h-1) || (pixel[j * w + i - 1].a <= a_th || pixel[j * w + i + 1].a <= a_th || pixel[j * w + i - w].a <= a_th || pixel[j * w + i + w].a <= a_th)))
@@ -348,7 +348,7 @@ int bevel_and_emboss(lua_State *L) {
348348

349349
//外側判定
350350
bool ccw = (tmp_point.y == 0 || (pixel[static_cast<int>((tmp_point.y - 1) * w + tmp_point.x)].a <= a_th));
351-
351+
352352
while(true) {
353353
pb.push_back(tmp_point);
354354
border_ans[tmp_point.y * w + tmp_point.x] = false;
@@ -394,7 +394,7 @@ int bevel_and_emboss(lua_State *L) {
394394

395395
if(next_point.x == -1 || next_point.y == -1)
396396
break;
397-
397+
398398
tmp_point = next_point;
399399
}
400400
p.push_back(std::move(pb));
@@ -416,7 +416,7 @@ int bevel_and_emboss(lua_State *L) {
416416
} else {
417417
double dx = std::clamp(a6 < a_th ? (a5 - a_th) / (a5 - a6) : a4 < a_th ? (a5 - a_th) / (a4 - a5) : 0.0, -1.0, 1.0);
418418
double dy = std::clamp(a2 < a_th ? (a5 - a_th) / (a5 - a2) : a8 < a_th ? (a5 - a_th) / (a8 - a5) : 0.0, -1.0, 1.0);
419-
pi[j].x += dx / (1 + std::abs(dy / dx));
419+
pi[j].x += dx / (1 + std::abs(dy / dx));
420420
pi[j].y += dy / (1 + std::abs(dx / dy));
421421
}
422422
}
@@ -439,7 +439,7 @@ int bevel_and_emboss(lua_State *L) {
439439
bufy = y0;
440440
}
441441
}
442-
442+
443443
for(int i = 0; i < p.size(); i++) {
444444
auto& pi = p[i];
445445
size_t s[2] = {pi.size() - 2, pi.size() - 1};
@@ -546,7 +546,7 @@ int bevel_and_emboss(lua_State *L) {
546546
utl_drawtarget(L, "tempbuffer");
547547

548548
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
549-
549+
550550
multi_thread([&](int thread_id, int thread_num) {
551551
size_t start = size * thread_id / thread_num;
552552
size_t end = size * (thread_id + 1) / thread_num;
@@ -580,7 +580,7 @@ int bevel_and_emboss(lua_State *L) {
580580
utl_copybuffer(L, "obj", "tmp");
581581

582582
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
583-
583+
584584
multi_thread([&](int thread_id, int thread_num) {
585585
size_t start = size * thread_id / thread_num;
586586
size_t end = size * (thread_id + 1) / thread_num;
@@ -664,7 +664,7 @@ int bevel_and_emboss(lua_State *L) {
664664
pix[i].a = bevel_buffer[i].a;
665665
}
666666
});
667-
667+
668668
utl_putpixeldata(L, pix);
669669
break;
670670
}
@@ -686,7 +686,7 @@ int bevel_and_emboss(lua_State *L) {
686686
utl_drawtarget(L, "tempbuffer");
687687

688688
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
689-
689+
690690
multi_thread([&](int thread_id, int thread_num) {
691691
size_t start = size * thread_id / thread_num;
692692
size_t end = size * (thread_id + 1) / thread_num;
@@ -710,7 +710,7 @@ int bevel_and_emboss(lua_State *L) {
710710
utl_draw(L, alp1);
711711

712712
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
713-
713+
714714
multi_thread([&](int thread_id, int thread_num) {
715715
size_t start = size * thread_id / thread_num;
716716
size_t end = size * (thread_id + 1) / thread_num;
@@ -735,7 +735,7 @@ int bevel_and_emboss(lua_State *L) {
735735
utl_copybuffer(L, "obj", "tmp");
736736

737737
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
738-
738+
739739
multi_thread([&](int thread_id, int thread_num) {
740740
size_t start = size * thread_id / thread_num;
741741
size_t end = size * (thread_id + 1) / thread_num;
@@ -749,7 +749,7 @@ int bevel_and_emboss(lua_State *L) {
749749
case 3: //ピローエンボス
750750
{
751751
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
752-
752+
753753
multi_thread([&](int thread_id, int thread_num) {
754754
size_t start = size * thread_id / thread_num;
755755
size_t end = size * (thread_id + 1) / thread_num;
@@ -765,7 +765,7 @@ int bevel_and_emboss(lua_State *L) {
765765
utl_drawtarget(L, "tempbuffer");
766766

767767
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
768-
768+
769769
multi_thread([&](int thread_id, int thread_num) {
770770
size_t start = size * thread_id / thread_num;
771771
size_t end = size * (thread_id + 1) / thread_num;
@@ -789,7 +789,7 @@ int bevel_and_emboss(lua_State *L) {
789789
utl_draw(L, alp1);
790790

791791
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
792-
792+
793793
multi_thread([&](int thread_id, int thread_num) {
794794
size_t start = size * thread_id / thread_num;
795795
size_t end = size * (thread_id + 1) / thread_num;
@@ -814,7 +814,7 @@ int bevel_and_emboss(lua_State *L) {
814814
utl_copybuffer(L, "obj", "tmp");
815815

816816
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
817-
817+
818818
multi_thread([&](int thread_id, int thread_num) {
819819
size_t start = size * thread_id / thread_num;
820820
size_t end = size * (thread_id + 1) / thread_num;
@@ -845,7 +845,7 @@ int bevel_and_emboss(lua_State *L) {
845845
setObjField(L, obj);
846846

847847
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
848-
848+
849849
multi_thread([&](int thread_id, int thread_num) {
850850
size_t start = size * thread_id / thread_num;
851851
size_t end = size * (thread_id + 1) / thread_num;
@@ -878,7 +878,7 @@ int bevel_and_emboss(lua_State *L) {
878878
setObjField(L, obj);
879879

880880
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
881-
881+
882882
multi_thread([&](int thread_id, int thread_num) {
883883
size_t start = size * thread_id / thread_num;
884884
size_t end = size * (thread_id + 1) / thread_num;
@@ -923,7 +923,7 @@ int bevel_and_emboss(lua_State *L) {
923923
setObjField(L, obj);
924924

925925
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
926-
926+
927927
multi_thread([&](int thread_id, int thread_num) {
928928
size_t start = size * thread_id / thread_num;
929929
size_t end = size * (thread_id + 1) / thread_num;
@@ -956,7 +956,7 @@ int bevel_and_emboss(lua_State *L) {
956956
setObjField(L, obj);
957957

958958
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
959-
959+
960960
multi_thread([&](int thread_id, int thread_num) {
961961
size_t start = size * thread_id / thread_num;
962962
size_t end = size * (thread_id + 1) / thread_num;
@@ -980,7 +980,7 @@ int bevel_and_emboss(lua_State *L) {
980980

981981
lua_getfield(L, -1, "effect");
982982
lua_call(L, 0, 0);
983-
983+
984984
utl_draw(L, alp2);
985985
break;
986986
}
@@ -1001,7 +1001,7 @@ int bevel_and_emboss(lua_State *L) {
10011001
setObjField(L, obj);
10021002

10031003
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1004-
1004+
10051005
multi_thread([&](int thread_id, int thread_num) {
10061006
size_t start = size * thread_id / thread_num;
10071007
size_t end = size * (thread_id + 1) / thread_num;
@@ -1034,7 +1034,7 @@ int bevel_and_emboss(lua_State *L) {
10341034
setObjField(L, obj);
10351035

10361036
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1037-
1037+
10381038
multi_thread([&](int thread_id, int thread_num) {
10391039
size_t start = size * thread_id / thread_num;
10401040
size_t end = size * (thread_id + 1) / thread_num;
@@ -1079,7 +1079,7 @@ int bevel_and_emboss(lua_State *L) {
10791079
setObjField(L, obj);
10801080

10811081
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1082-
1082+
10831083
multi_thread([&](int thread_id, int thread_num) {
10841084
size_t start = size * thread_id / thread_num;
10851085
size_t end = size * (thread_id + 1) / thread_num;
@@ -1103,16 +1103,16 @@ int bevel_and_emboss(lua_State *L) {
11031103

11041104
lua_getfield(L, -1, "effect");
11051105
lua_call(L, 0, 0);
1106-
1106+
11071107
utl_draw(L, alp1);
11081108
utl_temptarget(L, w, h);
11091109
utl_copybuffer(L, "obj", "tmp");
11101110
utl_drawtarget(L, "framebuffer");
1111-
1111+
11121112
setObjField(L, obj);
11131113

11141114
pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1115-
1115+
11161116
multi_thread([&](int thread_id, int thread_num) {
11171117
size_t start = size * thread_id / thread_num;
11181118
size_t end = size * (thread_id + 1) / thread_num;
@@ -1136,14 +1136,14 @@ int bevel_and_emboss(lua_State *L) {
11361136

11371137
lua_getfield(L, -1, "effect");
11381138
lua_call(L, 0, 0);
1139-
1139+
11401140
utl_draw(L, alp2);
11411141
break;
11421142
}
11431143
case 8: //ベベル(外側) ハイライトのみ
11441144
{
11451145
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1146-
1146+
11471147
multi_thread([&](int thread_id, int thread_num) {
11481148
size_t start = size * thread_id / thread_num;
11491149
size_t end = size * (thread_id + 1) / thread_num;
@@ -1168,7 +1168,7 @@ int bevel_and_emboss(lua_State *L) {
11681168
case 9: //ベベル(内側) ハイライトのみ
11691169
{
11701170
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1171-
1171+
11721172
multi_thread([&](int thread_id, int thread_num) {
11731173
size_t start = size * thread_id / thread_num;
11741174
size_t end = size * (thread_id + 1) / thread_num;
@@ -1193,7 +1193,7 @@ int bevel_and_emboss(lua_State *L) {
11931193
case 10: //エンボス ハイライトのみ
11941194
{
11951195
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1196-
1196+
11971197
multi_thread([&](int thread_id, int thread_num) {
11981198
size_t start = size * thread_id / thread_num;
11991199
size_t end = size * (thread_id + 1) / thread_num;
@@ -1242,7 +1242,7 @@ int bevel_and_emboss(lua_State *L) {
12421242
case 12: //ベベル(外側) シャドウのみ
12431243
{
12441244
Pixel_BGRA* pix = reinterpret_cast<Pixel_BGRA*>(utl_getpixeldata(L));
1245-
1245+
12461246
multi_thread([&](int thread_id, int thread_num) {
12471247
size_t start = size * thread_id / thread_num;
12481248
size_t end = size * (thread_id + 1) / thread_num;

dll_src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
2121
target_link_options(${PROJECT_NAME} PRIVATE -static-libstdc++ -static)
2222
endif()
2323

24-
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
24+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")

0 commit comments

Comments
 (0)