diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-05 19:38:47 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-05 19:38:47 +0000 |
| commit | 23ffe1ff6577adfce7980f961978ed3e8de59ed6 (patch) | |
| tree | c0ee4bef0861b560a658305137dd0a0dbfb2b0d5 /src/game/editor | |
| parent | c20d99b81d2867193f7f971b230b0d59d1358991 (diff) | |
| download | zcatch-23ffe1ff6577adfce7980f961978ed3e8de59ed6.tar.gz zcatch-23ffe1ff6577adfce7980f961978ed3e8de59ed6.zip | |
updated to svn version of portaudio. fixed a couple of issues with linux and multiple sound devices.
Diffstat (limited to 'src/game/editor')
| -rw-r--r-- | src/game/editor/ed_editor.hpp | 1 | ||||
| -rw-r--r-- | src/game/editor/ed_io.cpp | 25 |
2 files changed, 19 insertions, 7 deletions
diff --git a/src/game/editor/ed_editor.hpp b/src/game/editor/ed_editor.hpp index cddc9c92..8312c65d 100644 --- a/src/game/editor/ed_editor.hpp +++ b/src/game/editor/ed_editor.hpp @@ -345,6 +345,7 @@ public: void reset(bool create_default=true); int save(const char *filename); int load(const char *filename); + int append(const char *filename); void render(); QUAD *get_selected_quad(); diff --git a/src/game/editor/ed_io.cpp b/src/game/editor/ed_io.cpp index 80c82548..0db94c9b 100644 --- a/src/game/editor/ed_io.cpp +++ b/src/game/editor/ed_io.cpp @@ -7,7 +7,7 @@ static int make_version(int i, const T &v) { return (i<<16)+sizeof(T); } // backwards compatiblity -void editor_load_old(DATAFILE *df) +void editor_load_old(DATAFILE *df, MAP *map) { class mapres_image { @@ -17,7 +17,6 @@ void editor_load_old(DATAFILE *df) int image_data; }; - struct mapres_tilemap { int image; @@ -97,10 +96,10 @@ void editor_load_old(DATAFILE *df) if(tmap->main) { // move game layer to correct position - for(int i = 0; i < editor.map.groups[0]->layers.len()-1; i++) + for(int i = 0; i < map->groups[0]->layers.len()-1; i++) { - if(editor.map.groups[0]->layers[i] == editor.game_layer) - editor.map.groups[0]->swap_layers(i, i+1); + if(map->groups[0]->layers[i] == editor.game_layer) + map->groups[0]->swap_layers(i, i+1); } game_width = tmap->width; @@ -108,7 +107,7 @@ void editor_load_old(DATAFILE *df) } // add new layer - editor.map.groups[0]->add_layer(l); + map->groups[0]->add_layer(l); // process the data unsigned char *src_data = (unsigned char *)datafile_get_data(df, tmap->data); @@ -332,6 +331,11 @@ int EDITOR::save(const char *filename) return 1; } +void load_into_map(DATAFILE *df, MAP *map) +{ + +} + int EDITOR::load(const char *filename) { DATAFILE *df = datafile_load(filename); @@ -343,8 +347,9 @@ int EDITOR::load(const char *filename) if(!item) { // import old map + MAP old_mapstuff; editor.reset(); - editor_load_old(df); + editor_load_old(df, &old_mapstuff); } else if(item->version == 1) { @@ -501,3 +506,9 @@ int EDITOR::load(const char *filename) return 0; } + + +int EDITOR::append(const char *filename) +{ + return 0; +} |