summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_model_save.c
blob: 7ab39702bf67a2e3fe521901a0e398b066ad9163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "evas_options.h"

#include "evas_common_private.h"
#include "evas_private.h"

void
evas_common_save_model_to_file(Evas_3D_Mesh *model,
                               const char *file,
                               Evas_3D_Mesh_Frame *f)
{
   char *p;
   char *saver = NULL;

   p = strrchr(file, '.');
   if (p)
     {
        p++;
#define CHECK_EXTENTION_BY_FILE_NAME(extention)                \
        if (!strcasecmp(p, #extention))                        \
          {                                                    \
             evas_model_save_file_##extention(model, file, f); \
             saver = #extention;                               \
          }
        CHECK_EXTENTION_BY_FILE_NAME(eet)
        CHECK_EXTENTION_BY_FILE_NAME(obj)
        CHECK_EXTENTION_BY_FILE_NAME(ply)
#undef CHECK_EXTENTION_BY_FILE_NAME
     }
   if (!saver) ERR("Invalid mesh file type.");
}