diff options
Diffstat (limited to 'src/sandbox.hpp')
-rw-r--r-- | src/sandbox.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sandbox.hpp b/src/sandbox.hpp index bc6f928..03a6a85 100644 --- a/src/sandbox.hpp +++ b/src/sandbox.hpp @@ -1,9 +1,9 @@ #pragma once +#include "common.hpp" #include "rand.hpp" #include <cstdint> -#include <vector> const int MBIT_DISPLACABLE = 1; @@ -28,15 +28,21 @@ struct Tile { }; struct Sandbox { - std::vector<uint32_t> _bitmap; - std::vector<Tile> _a; + uint32_t* bitmap; + Tile* tiles; + /// Dirty rects used by the current simulation step. Only used during it. + // TODO use multiple dirty rects? + Rect dirty_curr; + /// Dirty rects to be used, when the next simulation step happens. May write to this during simulation, or outside of simulation. + Rect dirty_writeto; RandomState _rand; Tile _wall_tile; int width, height; int _x, _y; int ncycle = 0; - Sandbox(int w, int h); + Sandbox(int w, int h, RandomState rand = {}); + ~Sandbox(); void simulate_step(); |