afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
915 stars 68 forks source link

Scene Manager #250

Closed afritz1 closed 1 year ago

afritz1 commented 1 year ago

This PR refactors how the active scene is managed. Previously there was a stack of map states in GameState and potentially several LevelInstances in memory with their own chunk managers, but now only one instance of each chunk manager is allowed, and GameState stores the active MapDefinition (the means of populating those chunk managers) as well as data for scene changes.

The scene manager helps with tech debt and makes it easier to implement the renderer since the resources needed by the active scene are now more clearly defined in the engine.