fix bug/issue with shader saving - it will fail to save if dir exists
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 22 Apr 2012 04:55:11 +0000 (04:55 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 22 Apr 2012 04:55:11 +0000 (04:55 +0000)
for saved shaders (but doesnt have the binary file there). fixed!
(also compress the file too)

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@70382 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_common/evas_gl_shader.c

index d7ca3b9..f587c98 100644 (file)
@@ -991,7 +991,7 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program *p,
         return 0;
      }
 
-   if (eet_write(ef, pname, data, length, 0) < 0)
+   if (eet_write(ef, pname, data, length, 1) < 0)
      {
         if (data) free(data);
         return 0;
@@ -1196,8 +1196,10 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared)
    unsigned int i;
 
    if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
-      res = _evas_gl_shader_file_mkpath(bin_dir_path);
-   if (!res) return 0; /* we can't make directory */
+     {
+        res = _evas_gl_shader_file_mkpath(bin_dir_path);
+        if (!res) return 0; /* we can't make directory */
+     }
 
    _evas_gl_shader_file_check(bin_dir_path, bin_file_path,
                               sizeof(bin_dir_path));