diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-29 11:44:03 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-29 11:44:03 +0000 |
| commit | 7a3874745ca370a799d95b5f86e85fcc8eadefbb (patch) | |
| tree | 16f1e28f2f499279496866a63cabf88e2f2ad6c4 /src/game/editor/ed_layer_tiles.cpp | |
| parent | 171d6b1c206c0488b59d157bc266319bf4ab482b (diff) | |
| download | zcatch-7a3874745ca370a799d95b5f86e85fcc8eadefbb.tar.gz zcatch-7a3874745ca370a799d95b5f86e85fcc8eadefbb.zip | |
fixed loads of graphical optimizations
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); } |