changeset 733:b505b81a43de

Fix resource loading.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 20:03:08 +0300
parents 2f02d9b4caa3
children 56c1d288f0e2
files dmres.c dmsimple.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dmres.c	Sun Apr 21 19:58:59 2013 +0300
+++ b/dmres.c	Sun Apr 21 20:03:08 2013 +0300
@@ -610,7 +610,7 @@
  */
 static int dmResourcePreload(DMResource *handle)
 {
-    int ret = DMERR_INIT_FAIL;
+    int ret = DMERR_OK;
 
     // Check if we want to preload raw data?
     if (handle->lib->flags & DRF_PRELOAD_RAW)
@@ -624,6 +624,8 @@
             if (ret == DMERR_OK)
                 handle->flags |= DMF_LOADED_RAW | DMF_PERSIST;
         }
+        else
+            ret = DMERR_INIT_FAIL;
 
         dmfreset(handle);
     }
--- a/dmsimple.c	Sun Apr 21 19:58:59 2013 +0300
+++ b/dmsimple.c	Sun Apr 21 20:03:08 2013 +0300
@@ -253,7 +253,7 @@
     char buf[128];
 
     if ((res = dmf_open(engine.resources, filename, &file)) != DMERR_OK)
-        return DMERR_FOPEN;
+        return res;
 
     while (dmfgets(buf, sizeof(buf), file) != NULL)
     {