changeset 254:6bd565019f9a

Preload textures to avoid slowdowns during gameplay
author Thibaut Girka <thib@sitedethib.com>
date Sun, 22 Jan 2012 18:03:47 +0100
parents ea4832f843aa
children a0d6b1915591
files pytouhou/ui/gamerenderer.pyx
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/ui/gamerenderer.pyx
+++ b/pytouhou/ui/gamerenderer.pyx
@@ -33,6 +33,10 @@ cdef class GameRenderer(Renderer):
         self.game = game
         self.background = background
 
+        if game:
+            # Preload textures
+            self.texture_manager.preload(game.resource_loader.instanced_anms.values())
+
 
     def render(self):
         glClear(GL_DEPTH_BUFFER_BIT)