Kaynağa Gözat

Nicer output

Thomas Buck 10 yıl önce
ebeveyn
işleme
4f961c18a6
2 değiştirilmiş dosya ile 44 ekleme ve 47 silme
  1. 36
    40
      src/OpenRaider.cpp
  2. 8
    7
      src/Render.cpp

+ 36
- 40
src/OpenRaider.cpp Dosyayı Görüntüle

@@ -158,7 +158,7 @@ void percent_callback(int p) {
158 158
 
159 159
     switch (p) {
160 160
         case 10:
161
-            game.print(true, "Level textures loaded");
161
+            game.print(false, "Level textures loaded");
162 162
             break;
163 163
         default:
164 164
             game.print(false, "Level pak %i%% loaded", p);
@@ -863,14 +863,10 @@ void OpenRaider::processPakSounds()
863 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 867
         return;
873
-    }
868
+
869
+    printf("Processing pak sound files: ");
874 870
 
875 871
     for (i = 0; i < m_tombraider.getSoundSamplesCount(); ++i)
876 872
     {
@@ -895,11 +891,11 @@ void OpenRaider::processPakSounds()
895 891
         //pos[2] = sound[i].z;
896 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,7 +989,7 @@ void OpenRaider::loadLevel(char *mapname)
993 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 994
     // Cache/process meshes
999 995
     printf("Processing meshes: ");
@@ -1006,7 +1002,7 @@ void OpenRaider::loadLevel(char *mapname)
1006 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 1007
     // Cache/process sprites
1012 1008
     processSprites();
@@ -1175,13 +1171,13 @@ void OpenRaider::processTextures()
1175 1171
         if (bumpmap)
1176 1172
             delete [] bumpmap;
1177 1173
 
1178
-        printf(".");
1179
-        fflush(stdout);
1174
+        //printf(".");
1175
+        //fflush(stdout);
1180 1176
     }
1181 1177
 
1182 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,11 +1190,9 @@ void OpenRaider::processTextures()
1194 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 1194
     if (m_flags & OpenRaider_EnableSound) {
1200
-        switch (type)
1201
-        {
1195
+        switch (type) {
1202 1196
             case 0: //  Reset listener position
1203 1197
                 mSound.listenAt(pos, angles);
1204 1198
                 break;
@@ -1302,14 +1296,14 @@ void OpenRaider::processSprites()
1302 1296
                     r_mesh->sprite[l].texel[0].st[0] = (vec_t)(x) / TexelScale;
1303 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,6 +1321,7 @@ void OpenRaider::processMoveables()
1327 1321
     tr2_object_texture_t *object_texture = NULL;
1328 1322
     int i, j, object_id;
1329 1323
     int ent = 0;
1324
+    unsigned int statCount = 0;
1330 1325
 
1331 1326
 
1332 1327
     frame = m_tombraider.Frame();
@@ -1356,8 +1351,8 @@ void OpenRaider::processMoveables()
1356 1351
             // It's not a moveable, skip sprite
1357 1352
             if (j != (int)m_tombraider.NumSpriteSequences())
1358 1353
             {
1359
-                printf("s");
1360
-                fflush(stdout);
1354
+                //printf("s");
1355
+                //fflush(stdout);
1361 1356
                 continue;
1362 1357
             }
1363 1358
         }
@@ -1371,12 +1366,13 @@ void OpenRaider::processMoveables()
1371 1366
         // It's not a moveable or even a sprite?, skip unknown
1372 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 1371
             continue;
1377 1372
         }
1378 1373
 
1379 1374
         processMoveable(j, i, &ent, cache2, cache, object_id);
1375
+        statCount++;
1380 1376
     }
1381 1377
 
1382 1378
     // Get models that aren't items
@@ -1427,7 +1423,7 @@ void OpenRaider::processMoveables()
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,8 +1655,8 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1659 1655
         sModel->model = c_model;
1660 1656
         gWorld.addEntity(thing);
1661 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 1661
         //continue;
1666 1662
         return;
@@ -1845,8 +1841,8 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1845 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,8 +1922,8 @@ void OpenRaider::processModel(int index)
1926 1922
     {
1927 1923
         //! \fixme allow sparse lists with matching ids instead?
1928 1924
         gWorld.addMesh(NULL); // Filler, to make meshes array ids align
1929
-        printf("x");
1930
-        fflush(stdout);
1925
+        //printf("x");
1926
+        //fflush(stdout);
1931 1927
         return;
1932 1928
     }
1933 1929
 
@@ -2111,8 +2107,8 @@ void OpenRaider::processModel(int index)
2111 2107
     mesh->coloredRectangles.qSort(compareFaceTextureId);
2112 2108
 
2113 2109
     gWorld.addMesh(mesh);
2114
-    printf(".");
2115
-    fflush(stdout);
2110
+    //printf(".");
2111
+    //fflush(stdout);
2116 2112
 }
2117 2113
 
2118 2114
 
@@ -2136,8 +2132,8 @@ void OpenRaider::processRoom(int index)
2136 2132
         gWorld.addRoom(0x0);
2137 2133
         m_render.addRoom(0x0);
2138 2134
 
2139
-        printf("x");
2140
-        fflush(stdout);
2135
+        //printf("x");
2136
+        //fflush(stdout);
2141 2137
         return;
2142 2138
     }
2143 2139
 
@@ -2698,8 +2694,8 @@ void OpenRaider::processRoom(int index)
2698 2694
     rRoom->room = r_mesh;
2699 2695
     m_render.addRoom(rRoom);
2700 2696
 
2701
-    printf(".");
2702
-    fflush(stdout);
2697
+    //printf(".");
2698
+    //fflush(stdout);
2703 2699
 }
2704 2700
 
2705 2701
 //! \fixme Use rc_get_bool consistently!

+ 8
- 7
src/Render.cpp Dosyayı Görüntüle

@@ -407,11 +407,10 @@ void Render::Init(int width, int height)
407 407
     mHeight = height;
408 408
 
409 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 415
     // Testing for goodies
417 416
     // Mongoose 2001.12.31, Fixed string use to check for bad strings
@@ -419,13 +418,14 @@ void Render::Init(int width, int height)
419 418
 
420 419
     if (s && s[0])
421 420
     {
422
-        printf("\tGL_ARB_multitexture       \t\t");
421
+        //printf("\tGL_ARB_multitexture       \t\t");
423 422
 
424 423
         if (strstr(s, "GL_ARB_multitexture"))
425 424
         {
426 425
             mFlags |= Render::fMultiTexture;
427
-            printf("YES\n");
426
+            //printf("YES\n");
428 427
         }
428
+        /*
429 429
         else
430 430
         {
431 431
             printf("NO\n");
@@ -441,6 +441,7 @@ void Render::Init(int width, int height)
441 441
         {
442 442
             printf("NO\n");
443 443
         }
444
+        */
444 445
     }
445 446
 
446 447
     // Set up Z buffer

Loading…
İptal
Kaydet