Changeset 431:fef028d65451


Ignore:
Timestamp:
Sep 7, 2013, 11:52:16 AM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
a2aba4e0114bf8c22f80464e7ad297fe09074b68
Message:

Cache tiling of the background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/level.py

    r425 r431  
    4141        self._tile_image = None
    4242        self._surface = None
     43        self._base_surface = None
    4344        self._exterior = False
    4445        self._glue = puzzle.PuzzleGlue()
     
    238239            # We assume we don't change
    239240            return self._surface
    240         self._surface = tile_surface((self.x, self.y), self._tile_image)
     241        if self._base_surface is None:
     242            self._base_surface = tile_surface((self.x, self.y), self._tile_image)
     243        self._surface = self._base_surface.copy()
    241244        return self._surface
Note: See TracChangeset for help on using the changeset viewer.