diff options
Diffstat (limited to 'src/sliceitoff/images/images.py')
-rw-r--r-- | src/sliceitoff/images/images.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/sliceitoff/images/images.py b/src/sliceitoff/images/images.py deleted file mode 100644 index 7ae1f6d..0000000 --- a/src/sliceitoff/images/images.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -import pygame - -from display import Scaling - -DEBUG = os.getenv("DEBUG") - -class Images: - surfaces = {} - - @staticmethod - def reload_images(base_path): - __class__.surfaces = {} - filename_imagelist = os.path.join(base_path, "assets", "images.lst") - with open( filename_imagelist ) as imagelist_file: - for line in imagelist_file: - name, *path = line.strip().split() - filename = os.path.join(base_path, *path) - if DEBUG: - print(f"Loading images {name = }, {filename = }") - image = pygame.image.load(filename) - rgba = pygame.Surface.convert_alpha(image) - scaled = pygame.transform.smoothscale_by(rgba, Scaling.factor*10) - __class__.surfaces[name] = scaled - return True - - @staticmethod - def load_images(base_path): - if __class__.surfaces: - return False - return __class__.reload_images(base_path) -
\ No newline at end of file |