1. 26 Dec, 2020 4 commits
  2. 25 Dec, 2020 1 commit
    • Simon Goller's avatar
      Fix future memory leak of registered images · fccc526d
      Simon Goller authored and neosam's avatar neosam committed
      Sprites were loaded during the level_loading und the level images in
      InGameState::new() but they were never cleaned up.  As soon as the
      InGameState starts several times, this would lead to a memory leak.
      This commit contains a separate treatment for sprites and the level
      images:
      
      Since sprites are stored as a global Enum, they will now be initialized
      only once on the first loading state.  When loading the images, they
      check if the ImageHandle is already registered on the renderer to
      determine if loading is required.
      
      Level foreground and background on the other hand are dynamically loaded
      in the InGameState.  The InGameState got a new attribute
      `registered_images: Vec<resources::ImageHandle>` which stores all
      `ImageHandle` of dynamically loaded images.  On deinint, they
      get deregistered from `Rendering`.
      fccc526d
  3. 22 Dec, 2020 2 commits
    • Simon Goller's avatar
      Cargo fmt · 48d6a677
      Simon Goller authored
      48d6a677
    • Simon Goller's avatar
      Use sprite enum · d828d38d
      Simon Goller authored
      Sprites are now stored in sprites.rs in the Sprite enum.  This
      can be used to generate ImageHandles to generate Sprite
      entities.
      d828d38d