summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_model_save.c
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2014-11-27 17:19:24 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-12-23 21:16:07 +0100
commitaaddf1a963c7e3b8aef18c4f366c8e9f8bf43e66 (patch)
tree696fc6fac8f2d4403a833b77ff135c329675e7d8 /src/lib/evas/common/evas_model_save.c
parent02c85b9fe8d9acb2802210eb65bca450f21c5712 (diff)
evas: Evas_3D_Mesh_File_Type sank into oblivion. Changing entry point to model_save_load. Changing API in examples.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_model_save.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/evas/common/evas_model_save.c b/src/lib/evas/common/evas_model_save.c
index 85b9b4113f..7ab39702bf 100644
--- a/src/lib/evas/common/evas_model_save.c
+++ b/src/lib/evas/common/evas_model_save.c
@@ -7,26 +7,28 @@
7#include "evas_common_private.h" 7#include "evas_common_private.h"
8#include "evas_private.h" 8#include "evas_private.h"
9 9
10
11void 10void
12evas_common_save_model_to_file(Evas_3D_Mesh *model, 11evas_common_save_model_to_file(Evas_3D_Mesh *model,
13 const char *file, 12 const char *file,
14 Evas_3D_Mesh_Frame *f, 13 Evas_3D_Mesh_Frame *f)
15 Evas_3D_Mesh_File_Type type)
16{ 14{
17 switch (type) 15 char *p;
16 char *saver = NULL;
17
18 p = strrchr(file, '.');
19 if (p)
18 { 20 {
19 case EVAS_3D_MESH_FILE_TYPE_OBJ: 21 p++;
20 evas_model_save_file_obj(model, file, f); 22#define CHECK_EXTENTION_BY_FILE_NAME(extention) \
21 break; 23 if (!strcasecmp(p, #extention)) \
22 case EVAS_3D_MESH_FILE_TYPE_EET: 24 { \
23 evas_model_save_file_eet(model, file, f); 25 evas_model_save_file_##extention(model, file, f); \
24 break; 26 saver = #extention; \
25 case EVAS_3D_MESH_FILE_TYPE_PLY: 27 }
26 evas_model_save_file_ply(model, file, f); 28 CHECK_EXTENTION_BY_FILE_NAME(eet)
27 break; 29 CHECK_EXTENTION_BY_FILE_NAME(obj)
28 default: 30 CHECK_EXTENTION_BY_FILE_NAME(ply)
29 ERR("Invalid mesh file type."); 31#undef CHECK_EXTENTION_BY_FILE_NAME
30 break;
31 } 32 }
33 if (!saver) ERR("Invalid mesh file type.");
32} 34}