From 7cd515fcfa1a5aac5605fcc63381033563fbf5d7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 14 Mar 2022 14:11:05 -0400 Subject: map is now "infinite" using chunks that dynamically load like in diamond&pearl game is also slow as shit now --- src/game.h | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index 446680a..40ace3d 100644 --- a/src/game.h +++ b/src/game.h @@ -16,20 +16,6 @@ constexpr int TilesetIndex(int x, int y) { return x + y * 24; } -enum class Tile { - Floor, - Wall, - Dust, - Lamp -}; - -enum class Source { - None, - Dust, - Lamp, - Player -}; - enum class LoseState { None, PoppingLamps, @@ -52,8 +38,6 @@ struct Input { } }; -using coord = std::tuple; - struct Kickup { int x; int y; @@ -64,18 +48,6 @@ struct Kickup { std::set front; }; -struct MapData { - Tile tile = Tile::Floor; - bool lit = false; - bool wasLit = false; - size_t dustLife = 0; - Source lightType = Source::None; - int lightRadius = 0; - std::set litTiles; - int renderId = -1; - bool dirtyRender = true; -}; - class Game { public: @@ -89,7 +61,7 @@ public: bool quit = false; LoseState losing = LoseState::None; - Map map; + Map map; std::list kickups; int litSpots = 0; bool dirtyLighting = true; @@ -105,18 +77,10 @@ public: Animation playerAnim {"../res/player_anim.txt"}; int maxZoom = INIT_ZOOM; - int curZoom = INIT_ZOOM; - int curBoundX = map.getLeft(); - int curBoundY = map.getTop(); - bool zooming = false; int zoomProgress = 0; int zoomLength; - int lastZoomTop; - int lastZoomLeft; - int lastZoomWidth; - int lastZoomHeight; Input keystate; bool firstInput = false; @@ -159,7 +123,7 @@ private: void processKickup(); - void growMap(size_t zoom); + void loadMap(); void setZoom(size_t zoom); -- cgit 1.4.1