summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_model_load.c
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2014-11-27 17:19:24 +0200
committerBogdan Devichev <b.devichev@samsung.com>2014-12-05 11:10:52 +0200
commit42562b3ddf4552de7ef002e19e816165bfe9301e (patch)
tree5104eaed74beddd2c794b23bf627e41a83266f64 /src/lib/evas/common/evas_model_load.c
parent291291e027ade52033670f5b09cab4712926bf0b (diff)
Model_save_load. Step 4. Evas_3D_Mesh_File_Type sank into oblivion. Changing entry point to model_save_load. Changing API in examples.
Diffstat (limited to 'src/lib/evas/common/evas_model_load.c')
-rw-r--r--src/lib/evas/common/evas_model_load.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/evas/common/evas_model_load.c b/src/lib/evas/common/evas_model_load.c
index 1f35cb0d97..73503776d4 100644
--- a/src/lib/evas/common/evas_model_load.c
+++ b/src/lib/evas/common/evas_model_load.c
@@ -9,26 +9,26 @@
9 9
10 10
11void 11void
12evas_common_load_model_to_file(Evas_3D_Mesh *model, 12evas_common_load_model_to_file(Evas_3D_Mesh *model, const char *file)
13 const char *file,
14 Evas_3D_Mesh_File_Type type)
15{ 13{
16 switch (type) 14 char *p;
15 char *loader = NULL;
16
17 p = strrchr(file, '.');
18 if (p)
17 { 19 {
18 case EVAS_3D_MESH_FILE_TYPE_MD2: 20 p++;
19 evas_model_load_file_md2(model, file); 21#define CHECK_EXTENTION_BY_FILE_NAME(extention) \
20 break; 22 if (!strcasecmp(p, #extention)) \
21 case EVAS_3D_MESH_FILE_TYPE_OBJ: 23 { \
22 evas_model_load_file_obj(model, file); 24 evas_model_load_file_##extention(model, file); \
23 break; 25 loader = #extention; \
24 case EVAS_3D_MESH_FILE_TYPE_EET: 26 }
25 evas_model_load_file_eet(model, file); 27 CHECK_EXTENTION_BY_FILE_NAME(eet)
26 break; 28 CHECK_EXTENTION_BY_FILE_NAME(md2)
27 case EVAS_3D_MESH_FILE_TYPE_PLY: 29 CHECK_EXTENTION_BY_FILE_NAME(obj)
28 evas_model_load_file_ply(model, file); 30 CHECK_EXTENTION_BY_FILE_NAME(ply)
29 break; 31#undef CHECK_EXTENTION_BY_FILE_NAME
30 default:
31 ERR("Invalid mesh file type.");
32 break;
33 } 32 }
33 if (!loader) ERR("Invalid mesh file type.");
34} 34}