diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-26 19:36:06 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-26 20:07:05 +0000 |
commit | 3779d090f0bde96edca5b700fdfdf12a584992fa (patch) | |
tree | 4f0a20588f64e57a962518d7cf08cf1e48a1b205 /game/terrain.h | |
parent | Name Worker threads if supported (diff) | |
download | ilt-3779d090f0bde96edca5b700fdfdf12a584992fa.tar.bz2 ilt-3779d090f0bde96edca5b700fdfdf12a584992fa.tar.xz ilt-3779d090f0bde96edca5b700fdfdf12a584992fa.zip |
Split meshes by surface and tile
Tile is derived per face based on the first vertices point rounded to
roughly 1km.
Diffstat (limited to 'game/terrain.h')
-rw-r--r-- | game/terrain.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/game/terrain.h b/game/terrain.h index 095b4ef..f5b1b32 100644 --- a/game/terrain.h +++ b/game/terrain.h @@ -37,7 +37,13 @@ private: GLsizei count; }; + struct SurfaceKey { + const Surface * surface; + GlobalPosition2D basePosition; + bool operator<(const SurfaceKey &) const; + }; + glBuffer verticesBuffer; - std::multimap<const Surface *, SurfaceArrayBuffer> meshes; + std::map<SurfaceKey, SurfaceArrayBuffer> meshes; Texture::Ptr grass = std::make_shared<Texture>("grass.png"); }; |