Browse Source

Nicer output

Thomas Buck 10 years ago
parent
commit
4f961c18a6
2 changed files with 44 additions and 47 deletions
  1. 36
    40
      src/OpenRaider.cpp
  2. 8
    7
      src/Render.cpp

+ 36
- 40
src/OpenRaider.cpp View File

158
 
158
 
159
     switch (p) {
159
     switch (p) {
160
         case 10:
160
         case 10:
161
-            game.print(true, "Level textures loaded");
161
+            game.print(false, "Level textures loaded");
162
             break;
162
             break;
163
         default:
163
         default:
164
             game.print(false, "Level pak %i%% loaded", p);
164
             game.print(false, "Level pak %i%% loaded", p);
863
     // in this group, bits 0-1: channel number
863
     // in this group, bits 0-1: channel number
864
     */
864
     */
865
 
865
 
866
-    if (m_flags & OpenRaider_EnableSound)
867
-    {
868
-        printf("Processing pak sound files: ");
869
-    }
870
-    else
871
-    {
866
+    if (!(m_flags & OpenRaider_EnableSound))
872
         return;
867
         return;
873
-    }
868
+
869
+    printf("Processing pak sound files: ");
874
 
870
 
875
     for (i = 0; i < m_tombraider.getSoundSamplesCount(); ++i)
871
     for (i = 0; i < m_tombraider.getSoundSamplesCount(); ++i)
876
     {
872
     {
895
         //pos[2] = sound[i].z;
891
         //pos[2] = sound[i].z;
896
         //mSound.SourceAt(id, pos);
892
         //mSound.SourceAt(id, pos);
897
 
893
 
898
-        printf(".");
899
-        fflush(stdout);
894
+        //printf(".");
895
+        //fflush(stdout);
900
     }
896
     }
901
 
897
 
902
-    printf("\n");
898
+    printf("Done! Found %u files.\n", m_tombraider.getSoundSamplesCount());
903
 }
899
 }
904
 
900
 
905
 
901
 
993
         print(false, "Processing rooms: %i/%i", i, m_tombraider.NumRooms());
989
         print(false, "Processing rooms: %i/%i", i, m_tombraider.NumRooms());
994
     }
990
     }
995
 
991
 
996
-    printf("\n");
992
+    printf("Done! Found %d rooms.\n", m_tombraider.NumRooms());
997
 
993
 
998
     // Cache/process meshes
994
     // Cache/process meshes
999
     printf("Processing meshes: ");
995
     printf("Processing meshes: ");
1006
         print(false, "Processing meshes: %i/%i", i, m_tombraider.getMeshCount());
1002
         print(false, "Processing meshes: %i/%i", i, m_tombraider.getMeshCount());
1007
     }
1003
     }
1008
 
1004
 
1009
-    printf("\n");
1005
+    printf("Done! Found %d meshes.\n", m_tombraider.getMeshCount());
1010
 
1006
 
1011
     // Cache/process sprites
1007
     // Cache/process sprites
1012
     processSprites();
1008
     processSprites();
1175
         if (bumpmap)
1171
         if (bumpmap)
1176
             delete [] bumpmap;
1172
             delete [] bumpmap;
1177
 
1173
 
1178
-        printf(".");
1179
-        fflush(stdout);
1174
+        //printf(".");
1175
+        //fflush(stdout);
1180
     }
1176
     }
1181
 
1177
 
1182
     gTextureOffset = mLevelTextureOffset + m_tombraider.NumTextures();
1178
     gTextureOffset = mLevelTextureOffset + m_tombraider.NumTextures();
1183
 
1179
 
1184
-    printf("\n");
1180
+    printf("Done! Found %d textures.\n", m_tombraider.NumTextures());
1185
 }
1181
 }
1186
 
1182
 
1187
 
1183
 
1194
 // Private Mutators
1190
 // Private Mutators
1195
 ////////////////////////////////////////////////////////////
1191
 ////////////////////////////////////////////////////////////
1196
 
1192
 
1197
-void OpenRaider::soundEvent(int type, int id, vec3_t pos, vec3_t angles)
1198
-{
1193
+void OpenRaider::soundEvent(int type, int id, vec3_t pos, vec3_t angles) {
1199
     if (m_flags & OpenRaider_EnableSound) {
1194
     if (m_flags & OpenRaider_EnableSound) {
1200
-        switch (type)
1201
-        {
1195
+        switch (type) {
1202
             case 0: //  Reset listener position
1196
             case 0: //  Reset listener position
1203
                 mSound.listenAt(pos, angles);
1197
                 mSound.listenAt(pos, angles);
1204
                 break;
1198
                 break;
1302
                     r_mesh->sprite[l].texel[0].st[0] = (vec_t)(x) / TexelScale;
1296
                     r_mesh->sprite[l].texel[0].st[0] = (vec_t)(x) / TexelScale;
1303
                     r_mesh->sprite[l].texel[0].st[1] = (vec_t)(y+height)/TexelScale;
1297
                     r_mesh->sprite[l].texel[0].st[1] = (vec_t)(y+height)/TexelScale;
1304
 
1298
 
1305
-                    printf(".");
1306
-                    fflush(stdout);
1299
+                    //printf(".");
1300
+                    //fflush(stdout);
1307
                 }
1301
                 }
1308
             }
1302
             }
1309
         }
1303
         }
1310
     }
1304
     }
1311
 
1305
 
1312
-    printf("\n");
1306
+    printf("Done! Found %d sprites.\n", m_tombraider.NumSpriteSequences());
1313
 }
1307
 }
1314
 
1308
 
1315
 
1309
 
1327
     tr2_object_texture_t *object_texture = NULL;
1321
     tr2_object_texture_t *object_texture = NULL;
1328
     int i, j, object_id;
1322
     int i, j, object_id;
1329
     int ent = 0;
1323
     int ent = 0;
1324
+    unsigned int statCount = 0;
1330
 
1325
 
1331
 
1326
 
1332
     frame = m_tombraider.Frame();
1327
     frame = m_tombraider.Frame();
1356
             // It's not a moveable, skip sprite
1351
             // It's not a moveable, skip sprite
1357
             if (j != (int)m_tombraider.NumSpriteSequences())
1352
             if (j != (int)m_tombraider.NumSpriteSequences())
1358
             {
1353
             {
1359
-                printf("s");
1360
-                fflush(stdout);
1354
+                //printf("s");
1355
+                //fflush(stdout);
1361
                 continue;
1356
                 continue;
1362
             }
1357
             }
1363
         }
1358
         }
1371
         // It's not a moveable or even a sprite?, skip unknown
1366
         // It's not a moveable or even a sprite?, skip unknown
1372
         if (j == (int)m_tombraider.NumMoveables())
1367
         if (j == (int)m_tombraider.NumMoveables())
1373
         {
1368
         {
1374
-            printf("?"); // what the wolf?
1375
-            fflush(stdout);
1369
+            //printf("?"); // what the wolf?
1370
+            //fflush(stdout);
1376
             continue;
1371
             continue;
1377
         }
1372
         }
1378
 
1373
 
1379
         processMoveable(j, i, &ent, cache2, cache, object_id);
1374
         processMoveable(j, i, &ent, cache2, cache, object_id);
1375
+        statCount++;
1380
     }
1376
     }
1381
 
1377
 
1382
     // Get models that aren't items
1378
     // Get models that aren't items
1427
         }
1423
         }
1428
     }
1424
     }
1429
 
1425
 
1430
-    printf("\n");
1426
+    printf("Done! Found %d models.\n", m_tombraider.NumMoveables() + statCount);
1431
 }
1427
 }
1432
 
1428
 
1433
 
1429
 
1659
         sModel->model = c_model;
1655
         sModel->model = c_model;
1660
         gWorld.addEntity(thing);
1656
         gWorld.addEntity(thing);
1661
         gWorld.addModel(c_model);
1657
         gWorld.addModel(c_model);
1662
-        printf("c"); // it's already cached
1663
-        fflush(stdout);
1658
+        //printf("c"); // it's already cached
1659
+        //fflush(stdout);
1664
 
1660
 
1665
         //continue;
1661
         //continue;
1666
         return;
1662
         return;
1845
                 (m_tombraider.Engine() == TR_VERSION_2));
1841
                 (m_tombraider.Engine() == TR_VERSION_2));
1846
     }
1842
     }
1847
 
1843
 
1848
-    printf(".");
1849
-    fflush(stdout);
1844
+    //printf(".");
1845
+    //fflush(stdout);
1850
 }
1846
 }
1851
 
1847
 
1852
 
1848
 
1926
     {
1922
     {
1927
         //! \fixme allow sparse lists with matching ids instead?
1923
         //! \fixme allow sparse lists with matching ids instead?
1928
         gWorld.addMesh(NULL); // Filler, to make meshes array ids align
1924
         gWorld.addMesh(NULL); // Filler, to make meshes array ids align
1929
-        printf("x");
1930
-        fflush(stdout);
1925
+        //printf("x");
1926
+        //fflush(stdout);
1931
         return;
1927
         return;
1932
     }
1928
     }
1933
 
1929
 
2111
     mesh->coloredRectangles.qSort(compareFaceTextureId);
2107
     mesh->coloredRectangles.qSort(compareFaceTextureId);
2112
 
2108
 
2113
     gWorld.addMesh(mesh);
2109
     gWorld.addMesh(mesh);
2114
-    printf(".");
2115
-    fflush(stdout);
2110
+    //printf(".");
2111
+    //fflush(stdout);
2116
 }
2112
 }
2117
 
2113
 
2118
 
2114
 
2136
         gWorld.addRoom(0x0);
2132
         gWorld.addRoom(0x0);
2137
         m_render.addRoom(0x0);
2133
         m_render.addRoom(0x0);
2138
 
2134
 
2139
-        printf("x");
2140
-        fflush(stdout);
2135
+        //printf("x");
2136
+        //fflush(stdout);
2141
         return;
2137
         return;
2142
     }
2138
     }
2143
 
2139
 
2698
     rRoom->room = r_mesh;
2694
     rRoom->room = r_mesh;
2699
     m_render.addRoom(rRoom);
2695
     m_render.addRoom(rRoom);
2700
 
2696
 
2701
-    printf(".");
2702
-    fflush(stdout);
2697
+    //printf(".");
2698
+    //fflush(stdout);
2703
 }
2699
 }
2704
 
2700
 
2705
 //! \fixme Use rc_get_bool consistently!
2701
 //! \fixme Use rc_get_bool consistently!

+ 8
- 7
src/Render.cpp View File

407
     mHeight = height;
407
     mHeight = height;
408
 
408
 
409
     // Print driver support information
409
     // Print driver support information
410
-    printf("\n## GL Driver Info ##\n");
411
-    printf("Vendor     : %s\n", glGetString(GL_VENDOR));
412
-    printf("Renderer   : %s\n", glGetString(GL_RENDERER));
413
-    printf("Version    : %s\n\n", glGetString(GL_VERSION));
414
-    //printf("\tExtensions : %s\n\n\n", (char*)glGetString(GL_EXTENSIONS));
410
+    printf("GL Vendor   : %s\n", glGetString(GL_VENDOR));
411
+    printf("GL Renderer : %s\n", glGetString(GL_RENDERER));
412
+    printf("GL Version  : %s\n", glGetString(GL_VERSION));
413
+    //printf("Extensions : %s\n\n\n", (char*)glGetString(GL_EXTENSIONS));
415
 
414
 
416
     // Testing for goodies
415
     // Testing for goodies
417
     // Mongoose 2001.12.31, Fixed string use to check for bad strings
416
     // Mongoose 2001.12.31, Fixed string use to check for bad strings
419
 
418
 
420
     if (s && s[0])
419
     if (s && s[0])
421
     {
420
     {
422
-        printf("\tGL_ARB_multitexture       \t\t");
421
+        //printf("\tGL_ARB_multitexture       \t\t");
423
 
422
 
424
         if (strstr(s, "GL_ARB_multitexture"))
423
         if (strstr(s, "GL_ARB_multitexture"))
425
         {
424
         {
426
             mFlags |= Render::fMultiTexture;
425
             mFlags |= Render::fMultiTexture;
427
-            printf("YES\n");
426
+            //printf("YES\n");
428
         }
427
         }
428
+        /*
429
         else
429
         else
430
         {
430
         {
431
             printf("NO\n");
431
             printf("NO\n");
441
         {
441
         {
442
             printf("NO\n");
442
             printf("NO\n");
443
         }
443
         }
444
+        */
444
     }
445
     }
445
 
446
 
446
     // Set up Z buffer
447
     // Set up Z buffer

Loading…
Cancel
Save