summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-10-24 23:39:15 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-10-24 23:39:15 +0200
commit16e1a2f3dd5c08a3847aa635d4bd9dbf83f83c3f (patch)
treef268eb9171bf17817e7b6065870e027a5d834f3f /src/common.hpp
parent6723790daa66c333103f940540ea7ef83a4057d9 (diff)
Tile rendering needs a redoing.
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/common.hpp b/src/common.hpp
index 5da7f33..fde9bc8 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -44,8 +44,9 @@ namespace world {
typedef vec_t<coord_t, 2> sector_index_t;
typedef vec_t<coord_t, 2> tile_index_t;
- static tile_index_t neighbor_offsets[4] = {
- {1, 0}, {0, 1}, {-1, 0}, {0, -1}
+ static tile_index_t neighbor_offsets[8] = {
+ {+1, 0}, {+1, +1}, {0, +1}, {-1, +1},
+ {-1, 0}, {-1, -1}, {0, -1}, {+1, -1}
};
enum {
@@ -57,7 +58,7 @@ namespace world {
class tile_t {
public:
unsigned type : 8;
- unsigned neighbors : 4;
+ unsigned neighbors : 8;
unsigned variant : 8;
};
@@ -221,26 +222,6 @@ namespace render {
void load(std::string prefix, size_t xc, size_t yc);
};
- class tile_t {
- public:
- virtual void load(std::string prefix) = 0;
- virtual sf::Texture *get_texture(int neighbors, bool *mirror) = 0;
- };
-
- class tile_monotonic_t : public tile_t {
- sf::Texture texture;
- public:
- void load(std::string prefix);
- sf::Texture *get_texture(int neighbors, bool *mirror);
- };
-
- class tile_connecting12_t : public tile_t {
- sf::Texture textures[12];
- public:
- void load(std::string prefix);
- sf::Texture *get_texture(int neighbors, bool *mirror);
- };
-
class state_t {
sf::RenderWindow *window;
double now;
@@ -264,8 +245,8 @@ namespace assets {
} human_assets_t;
extern human_assets_t human;
- extern render::tile_monotonic_t tile_dirt;
- extern render::tile_connecting12_t tile_wall;
+ extern sf::Texture tile_dirt;
+ extern sf::Texture tile_wall;
void load(void);
};