summaryrefslogtreecommitdiff
path: root/gfx.py
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2015-11-01 16:06:15 -0700
committerIIMarckus <iimarckus@gmail.com>2015-11-01 16:06:15 -0700
commit25c126c69beebfdf26d0de286e25c65f6f3db16e (patch)
tree46c064628b3d8015da22d6396b3c711e80646745 /gfx.py
parent006d14640ce7f434bdc09be20eb92778574d4a89 (diff)
Revert bad merge.
"Merge pull request #317 from yenatch/pngs-kind-of" This reverts commit 25025d1b6c00e94ac9e479747898d30267fb3282, reversing changes made to 0d17d4a75866d053f5e0b48c66deb2508071d98b.
Diffstat (limited to 'gfx.py')
-rw-r--r--gfx.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/gfx.py b/gfx.py
index e23a0b697..ec5bbb9d8 100644
--- a/gfx.py
+++ b/gfx.py
@@ -12,17 +12,12 @@ pics = [
'gfx/shrink2',
]
-cache = {}
-def get_cache(filename):
- global cache
- cached = cache.get(filename)
- if cached == None:
- cached = open(filename).read()
- cache[filename] = cached
- return cached
-
+base_stats = None
def get_base_stats():
- return get_cache('data/base_stats.asm')
+ global base_stats
+ if not base_stats:
+ base_stats = open('data/base_stats.asm').read()
+ return base_stats
def get_pokemon_dimensions(name):
if name == 'egg':
@@ -47,7 +42,7 @@ def filepath_rules(filepath):
pokemon_name = ''
if 'gfx/pics/' in filedir:
- pokemon_name = filedir.split('/')[-1]
+ pokemon_name = filedir.split('/')[3]
if pokemon_name.startswith('unown_'):
index = filedir.find(pokemon_name)
if index != -1: