diff options
Diffstat (limited to 'src/game/editor/ed_layer_tiles.cpp')
| -rw-r--r-- | src/game/editor/ed_layer_tiles.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/game/editor/ed_layer_tiles.cpp b/src/game/editor/ed_layer_tiles.cpp index 555c26a3..18e3b695 100644 --- a/src/game/editor/ed_layer_tiles.cpp +++ b/src/game/editor/ed_layer_tiles.cpp @@ -22,6 +22,20 @@ LAYER_TILES::~LAYER_TILES() delete [] tiles; } +void LAYER_TILES::prepare_for_save() +{ + for(int y = 0; y < height; y++) + for(int x = 0; x < width; x++) + tiles[y*width+x].flags &= TILEFLAG_VFLIP|TILEFLAG_HFLIP; + + if(image != -1) + { + for(int y = 0; y < height; y++) + for(int x = 0; x < width; x++) + tiles[y*width+x].flags |= editor.map.images[image]->tileflags[tiles[y*width+x].index]; + } +} + void LAYER_TILES::make_palette() { for(int y = 0; y < height; y++) @@ -34,7 +48,7 @@ void LAYER_TILES::render() if(image >= 0 && image < editor.map.images.len()) tex_id = editor.map.images[image]->tex_id; gfx_texture_set(tex_id); - render_tilemap(tiles, width, height, 32.0f, vec4(1,1,1,1), 0); + render_tilemap(tiles, width, height, 32.0f, vec4(1,1,1,1), LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT); } int LAYER_TILES::convert_x(float x) const { return (int)(x/32.0f); } |