changeset 268:f07ddc4982c6

More testing.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 10 Oct 2012 14:08:39 +0300
parents 509d8c72d774
children 159264c27929
files vptest.c
diffstat 1 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vptest.c	Wed Oct 10 14:08:12 2012 +0300
+++ b/vptest.c	Wed Oct 10 14:08:39 2012 +0300
@@ -202,7 +202,7 @@
     TTF_Font *font = NULL;
     int mouseX, mouseY, bx, by, err;
     BOOL initSDL = FALSE, initTTF = FALSE, exitFlag;
-    DM3DVectorSpriteModel *model;
+    DM3DVectorSpriteModel *model, *model2;
     
     dmVerbosity = 5;
     if (!dmArgsProcess(argc, argv, optList, optListN,
@@ -271,6 +271,16 @@
     err = dmRead3DVectorSpriteModel(res, &model);
     dmf_close(res);
     dmMsg(0, "Loaded, %d: %s\n", err, dmErrorStr(err));
+
+    res = dmf_create_stdio("roto.3d", "r");
+    if (res == NULL)
+    {
+        dmError("Could not open resource file '%s'.\n", optBitmapFilename);
+        goto error_exit;
+    }
+    err = dmRead3DVectorSpriteModel(res, &model2);
+    dmf_close(res);
+    dmMsg(0, "Loaded, %d: %s\n", err, dmErrorStr(err));
     
     if (optBenchmark)
     {
@@ -373,16 +383,26 @@
 
 #if 1
         DMVector pos;
-        pos.x = 0;
-        pos.y = 0;
-        pos.z = 800;
         
         DMMatrix mat;
 //        dm_matrix_rot_a(&mat, f*0.1, 0, (3.1415926535f * 2.0f * ((DMFloat) mouseX + (DMFloat) mouseY) ) / 500.0f);
 //        dm_matrix_rot_a(&mat, f*0.1, f*0.1, f*0.1);
         dm_matrix_rot_a(&mat, 0, 0, f*0.1);
+
+        pos.x = -118;
+        pos.y = 0;
+        pos.z = 100;
  
-        dmDraw3DVectorSpriteModel(screen, model, &pos, &mat, fbmap, lcol);
+        dmDraw3DVectorSpriteModel(screen, model2, &pos, &mat, fbmap, lcol);
+
+        pos.x = 118;
+        pos.y = 0;
+        pos.z = 100;
+
+        dm_matrix_rot_a(&mat, 0, 0, -f*0.1+0.125);
+        dmDraw3DVectorSpriteModel(screen, model2, &pos, &mat, fbmap, lcol);
+
+
 #endif
 
 #if 0