Skip to content

Commit c9000a7

Browse files
committed
slight improvements to misc script
1 parent 364ca2b commit c9000a7

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

misc/steam_mini_profile_to_reel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ png: $(OUTPNG)
2323

2424
default:
2525
$(MAKE) bmp
26-
rm *_003.bmp *_020.bmp
26+
-rm *_003.bmp *_020.bmp
2727
$(MAKE) png
2828
$(MAKE) atlas.pkm
2929
$(MAKE) atlas.txt
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
#!/usr/bin/env python3
2+
import glob
3+
import math
24

35
w = 800
46
h = 480
57

8+
filecount = glob.glob("./*_0*.png")
9+
rows = math.ceil(len(filecount) / 5)
10+
611
f = open("atlas.txt", "w")
7-
for row in range(0,8):
8-
for column in range(0,5):
9-
f.write("{} {} {} {}\n".format( w*column, h*row, w,h))
12+
count = 0
13+
for row in range(0, rows):
14+
for column in range(0, 5):
15+
count += 1
16+
if count > len(filecount):
17+
break
18+
f.write("{} {} {} {}\n".format(w * column, h * row, w, h))
19+
1020
f.close()
1121

1222
f = open("config.txt", "w")
13-
f.write("delayMS: 200\n")
23+
f.write("delayMS: 100\n")
1424
f.close()

0 commit comments

Comments
 (0)