parent
67e0e7dc08
commit
1e0ec6edfb
|
@ -182,13 +182,13 @@ static void render_regular_game_scene(Scene_t* scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queue Sprite rendering
|
// Queue Sprite rendering
|
||||||
sc_map_foreach_value(&scene->ent_manager.entities, p_ent)
|
unsigned int ent_idx;
|
||||||
|
CSprite_t* p_cspr;
|
||||||
|
sc_map_foreach(&scene->ent_manager.component_map[CSPRITE_T], ent_idx, p_cspr)
|
||||||
{
|
{
|
||||||
|
Entity_t* p_ent = get_entity(&scene->ent_manager, ent_idx);
|
||||||
if (!p_ent->m_alive) continue;
|
if (!p_ent->m_alive) continue;
|
||||||
|
|
||||||
CSprite_t* p_cspr = get_component(p_ent, CSPRITE_T);
|
|
||||||
if (p_cspr == NULL) continue;
|
|
||||||
|
|
||||||
const SpriteRenderInfo_t spr = p_cspr->sprites[p_cspr->current_idx];
|
const SpriteRenderInfo_t spr = p_cspr->sprites[p_cspr->current_idx];
|
||||||
if (spr.sprite == NULL) continue;
|
if (spr.sprite == NULL) continue;
|
||||||
|
|
||||||
|
@ -234,6 +234,7 @@ static void render_regular_game_scene(Scene_t* scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture2D* bg = get_texture(&scene->engine->assets, "bg_tex");
|
Texture2D* bg = get_texture(&scene->engine->assets, "bg_tex");
|
||||||
|
|
||||||
BeginTextureMode(scene->layers.render_layers[GAME_LAYER].layer_tex);
|
BeginTextureMode(scene->layers.render_layers[GAME_LAYER].layer_tex);
|
||||||
ClearBackground(WHITE);
|
ClearBackground(WHITE);
|
||||||
DrawTexturePro(*bg,
|
DrawTexturePro(*bg,
|
||||||
|
@ -416,12 +417,14 @@ static void render_regular_game_scene(Scene_t* scene)
|
||||||
for (int tile_x = min.x; tile_x < max.x; tile_x++)
|
for (int tile_x = min.x; tile_x < max.x; tile_x++)
|
||||||
{
|
{
|
||||||
int i = tile_x + tile_y * tilemap.width;
|
int i = tile_x + tile_y * tilemap.width;
|
||||||
|
if (!tilemap.tiles[i].wet && tilemap.tiles[i].water_level == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int x = tile_x * TILE_SIZE;
|
int x = tile_x * TILE_SIZE;
|
||||||
int y = tile_y * TILE_SIZE;
|
int y = tile_y * TILE_SIZE;
|
||||||
|
|
||||||
// Draw water flow
|
// Draw water flow
|
||||||
if (tilemap.tiles[i].wet)
|
|
||||||
{
|
|
||||||
#define SURFACE_THICKNESS 4
|
#define SURFACE_THICKNESS 4
|
||||||
int up = i - tilemap.width;
|
int up = i - tilemap.width;
|
||||||
unsigned int bot = i + tilemap.width;
|
unsigned int bot = i + tilemap.width;
|
||||||
|
@ -448,11 +451,10 @@ static void render_regular_game_scene(Scene_t* scene)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tilemap.tiles[i].max_water_level < MAX_WATER_LEVEL)
|
//if (tilemap.tiles[i].max_water_level < MAX_WATER_LEVEL)
|
||||||
{
|
//{
|
||||||
DrawRectangleLinesEx((Rectangle){x, y, TILE_SIZE, TILE_SIZE}, 2.0, ColorAlpha(BLUE, 0.5));
|
// DrawRectangleLinesEx((Rectangle){x, y, TILE_SIZE, TILE_SIZE}, 2.0, ColorAlpha(BLUE, 0.5));
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t water_height = tilemap.tiles[i].water_level * WATER_BBOX_STEP;
|
uint32_t water_height = tilemap.tiles[i].water_level * WATER_BBOX_STEP;
|
||||||
Color water_colour = ColorAlpha(BLUE, 0.5);
|
Color water_colour = ColorAlpha(BLUE, 0.5);
|
||||||
|
|
Loading…
Reference in New Issue