Skip to content

Commit 99c7e38

Browse files
committed
Moved gen_images.py to tools
1 parent 5145b33 commit 99c7e38

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

BUILDING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ or even do nothing at all. In such cases you should use `python rg_tool.py ...`
8080

8181

8282
## Changing the launcher's images
83-
All images used by the launcher (headers, logos) are located in `launcher/main/images`. If you edit them you must run the `launcher/main/gen_images.py` script to regenerate `images.c`. Magenta (rgb(255, 0, 255) / 0xF81F) is used as the transparency color.
83+
All images used by the launcher (headers, logos) are located in `launcher/main/images`. If you edit them you must run the `tools/gen_images.py` script to regenerate `launcher/main/images.c`. Refer to [THEMING.md](THEMING.md) for details about the image format.
8484

8585

8686
## Updating translations

THEMING.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ A theme is a folder placed in `sd:/retro-go/themes` containing the following fil
2727
| banner_X.png | PNG 272x24 | Launcher banners where X is the name of the launcher tab | No |
2828
| logo_X.png | PNG 46x50 | Launcher logos where X is the name of the launcher tab | No |
2929

30-
It is highly recommended to keep the image files sizes as small as possible to ensure good loading speed. This can be achieved by using the lowest bit depth possible when saving your PNG file. Tools like [pngquant](https://pngquant.org/) can also help!
31-
3230

3331
### theme.json
3432

@@ -93,3 +91,10 @@ Colors are RGB565 and can be represented as integers or hex strings. The special
9391
````
9492

9593
Important: If retro-go refuses to load your theme, please run your theme.json through a JSON validator to make sure the format is correct (JSON is quite strict regarding quotes or trailing commas for example).
94+
95+
96+
### Images
97+
98+
It is highly recommended to keep the image files sizes as small as possible to ensure good loading speed. This can be achieved by using the lowest bit depth possible when saving your PNG file. Tools like [pngquant](https://pngquant.org/) can also help!
99+
100+
Magenta (rgb(255, 0, 255) / 0xF81F) is used as the transparency color in some situations.

launcher/main/gen_images.py tools/gen_images.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# This scripts should be run to update images.c when you edit images
44

5-
os.chdir(sys.path[0])
5+
# os.chdir(sys.path[0])
66

77
output = '#include "gui.h"\n\n'
88
refs = ""
99

10-
for file in sorted(glob.glob("images/*.png")):
10+
for file in sorted(glob.glob("launcher/main/images/*.png")):
1111
with open(file, "rb") as f:
1212
data = f.read()
1313
size = len(data)
@@ -26,5 +26,5 @@
2626

2727
output += "\nconst binfile_t *builtin_images[] = {%s\n0\n};\n" % refs
2828

29-
with open("images.c", "w", newline="") as f:
29+
with open("launcher/main/images.c", "w", newline="") as f:
3030
f.write(output)

0 commit comments

Comments
 (0)