changeset 738:485bbb2e7deb

API changes update.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 20:39:14 +0300
parents 897646df1de1
children 8bf67daf4030
files tests/vptest.c
diffstat 1 files changed, 15 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/tests/vptest.c	Sun Apr 21 20:33:48 2013 +0300
+++ b/tests/vptest.c	Sun Apr 21 20:39:14 2013 +0300
@@ -118,7 +118,9 @@
     int mouseX, mouseY, bx, by, err;
     BOOL initSDL = FALSE, initTTF = FALSE, exitFlag;
     DM3DVectorSpriteModel *model, *model2;
-    
+    DMResource *file;
+    int res;
+
     dmVerbosity = 5;
     if (!dmArgsProcess(argc, argv, optList, optListN,
         argHandleOpt, NULL, FALSE))
@@ -148,28 +150,26 @@
     }
     TTF_SetFontStyle(font, TTF_STYLE_NORMAL);
 
-    DMResource *res = dmf_create_stdio(optBitmapFilename, "rb");
-    if (res == NULL)
+    if ((res = dmf_create_stdio(optBitmapFilename, "rb", &file)) != DMERR_OK)
     {
         dmError("Could not open resource file '%s'.\n", optBitmapFilename);
         goto error_exit;
     }
-    bmap = dmLoadImage(res);
-    dmf_close(res);
+    bmap = dmLoadImage(file);
+    dmf_close(file);
     if (bmap == NULL)
     {
         dmError("Could not load image file '%s'.\n", optBitmapFilename);
         goto error_exit;
     }
 
-    res = dmf_create_stdio("trans6x6.png", "rb");
-    if (res == NULL)
+    if ((res = dmf_create_stdio("trans6x6.png", "rb", &file)) != DMERR_OK)
     {
         dmError("Could not open resource file '%s'.\n", optBitmapFilename);
         goto error_exit;
     }
-    fbmap = dmLoadImage(res);
-    dmf_close(res);
+    fbmap = dmLoadImage(file);
+    dmf_close(file);
     if (fbmap == NULL)
     {
         dmError("Could not load image file '%s'.\n", optBitmapFilename);
@@ -177,24 +177,22 @@
     }
     
     
-    res = dmf_create_stdio("mole.3d", "r");
-    if (res == NULL)
+    if ((res = dmf_create_stdio("mole.3d", "r", &file)) != DMERR_OK)
     {
         dmError("Could not open resource file '%s'.\n", optBitmapFilename);
         goto error_exit;
     }
-    err = dmRead3DVectorSpriteModel(res, &model);
-    dmf_close(res);
+    err = dmRead3DVectorSpriteModel(file, &model);
+    dmf_close(file);
     dmMsg(0, "Loaded, %d: %s\n", err, dmErrorStr(err));
 
-    res = dmf_create_stdio("roto.3d", "r");
-    if (res == NULL)
+    if ((res = dmf_create_stdio("roto.3d", "r", &file)) != DMERR_OK)
     {
         dmError("Could not open resource file '%s'.\n", optBitmapFilename);
         goto error_exit;
     }
-    err = dmRead3DVectorSpriteModel(res, &model2);
-    dmf_close(res);
+    err = dmRead3DVectorSpriteModel(file, &model2);
+    dmf_close(file);
     dmMsg(0, "Loaded, %d: %s\n", err, dmErrorStr(err));
     
     if (optBenchmark)