diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
| commit | 72c06a258940696093f255fb1061beb58e1cdd0b (patch) | |
| tree | 36b9a7712eec2d4f07837eab9c38ef1c5af85319 /src/tools/map_resave.c | |
| parent | e56feb597bc743677633432f77513b02907fd169 (diff) | |
| download | zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.tar.gz zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.zip | |
copied refactor to trunk
Diffstat (limited to 'src/tools/map_resave.c')
| -rw-r--r-- | src/tools/map_resave.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/tools/map_resave.c b/src/tools/map_resave.c deleted file mode 100644 index 37e00904..00000000 --- a/src/tools/map_resave.c +++ /dev/null @@ -1,36 +0,0 @@ -/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ -#include <engine/e_datafile.h> - -int main(int argc, char **argv) -{ - int i, id, type, size; - void *ptr; - DATAFILE *df; - DATAFILE_OUT *df_out; - - if(argc != 3) - return -1; - - df = datafile_load(argv[1]); - df_out = datafile_create(argv[2]); - - /* add all items */ - for(i = 0; i < datafile_num_items(df); i++) - { - ptr = datafile_get_item(df, i, &type, &id); - size = datafile_get_itemsize(df, i); - datafile_add_item(df_out, type, id, size, ptr); - } - - /* add all data */ - for(i = 0; i < datafile_num_data(df); i++) - { - ptr = datafile_get_data(df, i); - size = datafile_get_datasize(df, i); - datafile_add_data(df_out, size, ptr); - } - - datafile_unload(df); - datafile_finish(df_out); - return 0; -} |