diff pytouhou/opengl/texture.py @ 83:fc0294c745b6

Basic bullet handling! Clean up as soon as possible :p
author Thibaut Girka <thib@sitedethib.com>
date Sat, 03 Sep 2011 22:22:58 +0200
parents ab826bc29aa2
children ac2e5e1c2c3c
line wrap: on
line diff
--- a/pytouhou/opengl/texture.py
+++ b/pytouhou/opengl/texture.py
@@ -23,7 +23,7 @@ from OpenGL.GLU import *
 
 
 class TextureManager(object):
-    def __init__(self, archive):
+    def __init__(self, archive=None):
         self.archive = archive
         self.textures = {}
 
@@ -33,7 +33,12 @@ class TextureManager(object):
         return self.textures[key]
 
 
-    def preload(self, anms):
+    def preload(self, anm_wrapper):
+        try:
+            anms = anm_wrapper.anm_files
+        except AttributeError:
+            anms = anm_wrapper
+
         for anm in anms:
             key = anm.first_name, anm.secondary_name
             texture = self[key]