u32 w, h;
- struct mesh tile, circle;
+ struct mesh tile, circle, splitter_l, splitter_r;
int selected;
init_mesh( &world.circle, circle_mesh, vg_list_size( circle_mesh ) );
}
+ // splitters (temp)
+ {
+ float splitter_l[] =
+ {
+ #include "models/splitter_l.obj.h"
+ };
+ float splitter_r[] =
+ {
+ #include "models/splitter_r.obj.h"
+ };
+
+ init_mesh( &world.splitter_l, splitter_l, vg_list_size( splitter_l ) );
+ init_mesh( &world.splitter_r, splitter_r, vg_list_size( splitter_r ) );
+ }
+
map_load
(
"#############;\n"
{
free_mesh( &world.tile );
free_mesh( &world.circle );
+ free_mesh( &world.splitter_l );
+ free_mesh( &world.splitter_r );
map_free();
}
struct cell *cell = pcell((v2i){x,y});
int selected = world.selected == y*world.w + x;
- if( cell->state & FLAG_CANAL && !selected )
+ if( cell->state & FLAG_SPLIT )
+ {
+ glUniform4f( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 0.9f, 0.9f, 0.9f, 1.0f );
+ glUniform3f( SHADER_UNIFORM( shader_tile_colour, "uOffset" ), (float)x, (float)y, 1.0f );
+
+ struct mesh *splitter = cell->state & FLAG_FLIP_FLOP? &world.splitter_r: &world.splitter_l;
+
+ use_mesh( splitter );
+ draw_mesh( 0, splitter->elements );
+ use_mesh( &world.tile );
+ }
+
+ if( (cell->state & FLAG_CANAL) && !selected )
continue;
glUniform3f( SHADER_UNIFORM( shader_tile_colour, "uOffset" ), (float)x, (float)y, 1.0f );