From b705142eb9980bdc06618f9b667018fffeef788b Mon Sep 17 00:00:00 2001 From: Thomas McKeesick Date: Fri, 2 Dec 2022 00:06:30 +1100 Subject: [PATCH 1/4] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4279db6f..1ac019a8 100644 --- a/README.md +++ b/README.md @@ -140,9 +140,12 @@ This will produce 4 executable bin files inside the `build/bin` directory, and a ## TODO - Short-term + - [ ] Import japanese names from data/pokemon.json +- Longer-term + +- Completed - [x] Fix bad whitespace stripping when building assets - [x] List all names -- Longer-term - [x] Make data structure to hold categories, names and pokemon - [x] Increase speed - [x] Improve categories to be more specific than shiny/regular From 1684d98d9d299ef4a6f5353c3d74227d5bfb6ed3 Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Tue, 20 Dec 2022 09:06:04 +1100 Subject: [PATCH 2/4] Update golang image to 1.19 --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index 686a1ab3..dd990290 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18 +FROM golang:1.19 WORKDIR /usr/local/src From 428060aad915eefe88ea7c9749f8c3cf19728a86 Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Mon, 16 Jan 2023 12:32:09 +1100 Subject: [PATCH 3/4] Skip converting "pokemon-gen7x" pokemon It turns out that this is redundant, as all pokemon that are present in 7x are also present in pokemon-gen8. ```python def collect_fpaths(dirpath): all_fpaths = set() for root_dirpath, dirpaths, fpaths in os.walk(dirpath): for fpath in fpaths: all_fpaths.add(fpath) return all_fpaths len(list(collect_fpaths('./pokemon-gen8/') - collect_fpaths('./pokemon-gen7x/'))) len(list(collect_fpaths('./pokemon-gen7x/') - collect_fpaths('./pokemon-gen8/'))) ``` --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index dd990290..26bfb34d 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -27,7 +27,7 @@ RUN go run /usr/local/src/src/bin/convert/png_convert.go \ -from /tmp/original/pokesprite/ \ -to /tmp/cows/ \ -padding 4 \ - -skip '["resources/", "misc/", "icons/", "items/", "items-outline/"]' \ + -skip '["resources/", "misc/", "icons/", "items/", "items-outline/", "pokemon-gen7x/"]' \ && rm -rf /tmp/original/pokesprite ADD . . From 351f31fee067cb22b380763214d91e64da0d9651 Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Mon, 16 Jan 2023 12:39:34 +1100 Subject: [PATCH 4/4] Remove the "pokemon-gen8" dir Instead, move all of the contents in this dir up one level. This means that we won't store the redundant "pokemon-gen8 category" in the category struct, as all pokemon now have this category after the removal of the gen7x dir This results in a small speed increase for selecting pokemon by name/category, which is currently the slowest operation ``` 5793100 /home/freman/bin/pokesay 4824767 bin/pokesay-linux-amd64 4787887 bin/pokesay-linux-amd64 ``` --- build/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Dockerfile b/build/Dockerfile index 26bfb34d..85c4ee7a 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -28,6 +28,7 @@ RUN go run /usr/local/src/src/bin/convert/png_convert.go \ -to /tmp/cows/ \ -padding 4 \ -skip '["resources/", "misc/", "icons/", "items/", "items-outline/", "pokemon-gen7x/"]' \ + && mv /tmp/cows/pokemon-gen8/* /tmp/cows && rmdir /tmp/cows/pokemon-gen8/ \ && rm -rf /tmp/original/pokesprite ADD . .