From 7a3874745ca370a799d95b5f86e85fcc8eadefbb Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 29 Mar 2008 11:44:03 +0000 Subject: fixed loads of graphical optimizations --- src/game/editor/ed_layer_tiles.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/game/editor/ed_layer_tiles.cpp') 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); } -- cgit 1.4.1