summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/common.hpp b/src/common.hpp
index e3bd19c..20c5a12 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -53,12 +53,6 @@ namespace world {
{-1, 0}, {-1, -1}, {0, -1}, {+1, -1}
};
- enum {
- TILE_NONE,
- TILE_DIRT,
- TILE_WALL
- };
-
class tile_t {
public:
unsigned type : 8;
@@ -94,6 +88,8 @@ namespace world {
float frac;
} trace_t;
+ void register_tile(uint8_t type, cflags_t cflags);
+
class world_t {
procgen::prng_t prng;
procgen::perlin_noise_t perlin;
@@ -107,7 +103,10 @@ namespace world {
friend render::state_t;
public:
+ void (*generator)(tile_t*, tile_index_t, procgen::perlin_noise_t*) = 0;
+
world_t(void);
+
sector_t *get_sector(sector_index_t index, bool partial = false);
tile_t *get_tile(tile_index_t index, bool partial = false);
@@ -266,9 +265,12 @@ namespace render {
ALIGN_CENTER_BOTTOM
} text_align_t;
+ void register_tile(uint8_t type, const char *path);
+
class state_t {
sf::RenderWindow *window;
+ void render_sector(world::sector_t *sector);
void drender_text(rectf_t rect, std::string str);
void drender_entity(world::entity_t *ent);
public:
@@ -277,6 +279,7 @@ namespace render {
state_t(sf::RenderWindow *window_);
void begin_frame(double time_, double dt_);
void end_frame(void);
+
void render(game::state_t *game);
void render(animated_texture_t *anim, rectf_t bounds, bool mirror = false);
void render(oriented_sprite_t *sprite, rectf_t bounds, float angle);
@@ -291,10 +294,6 @@ namespace render {
extern render::state_t *debug_render;
-namespace assets {
- void load(void);
-};
-
namespace text {
extern const wchar_t *unit_no_path;
extern const wchar_t *unit_blocked;