Bladeren bron

Removed FastCard option

Thomas Buck 10 jaren geleden
bovenliggende
commit
5c35ca3039
7 gewijzigde bestanden met toevoegingen van 45 en 112 verwijderingen
  1. 3
    0
      ChangeLog
  2. 1
    1
      README.md
  3. 8
    9
      include/Render.h
  4. 0
    3
      include/System.h
  5. 1
    6
      src/OpenRaider.cpp
  6. 19
    52
      src/Render.cpp
  7. 13
    41
      src/System.cpp

+ 3
- 0
ChangeLog Bestand weergeven

@@ -5,6 +5,9 @@
5 5
 
6 6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7 7
 
8
+	[ 20140216 ]
9
+	* Removed the FastCard option. Not necessary on todays hardware?!
10
+
8 11
 	[ 20140215 ]
9 12
 	* Enabled previously disabled polygon smoothing & color material
10 13
 	  when setting fastcard to true

+ 1
- 1
README.md Bestand weergeven

@@ -119,7 +119,7 @@ If you want to change this behaviour, this happens around line 1075 of `src/Open
119 119
 | /                        | Drop a waypoint test (formally undocumented) |
120 120
 | [ ]                      | Adjust idle animation for testing            |
121 121
 
122
-### Console Commands
122
+### Console/Config Commands
123 123
 
124 124
 Console commands (BOOL is now '0' or '1' for less typing).
125 125
 Pressing &lt;UP&gt; will go back to last command entered (saves typing).

+ 8
- 9
include/Render.h Bestand weergeven

@@ -89,14 +89,13 @@ class Render
89 89
         fEntityModels           = (1 << 6),
90 90
         fFog                    = (1 << 7),
91 91
         fUsePortals             = (1 << 8),
92
-        fFastCard               = (1 << 9),
93
-        fGL_Lights              = (1 << 10),
94
-        fOneRoom                = (1 << 11),
95
-        fRenderPonytail         = (1 << 12),
96
-        fMultiTexture           = (1 << 13),
97
-        fUpdateRoomListPerFrame = (1 << 14),
98
-        fAnimateAllModels       = (1 << 15),
99
-        fAllRooms               = (1 << 16)
92
+        fGL_Lights              = (1 << 9),
93
+        fOneRoom                = (1 << 10),
94
+        fRenderPonytail         = (1 << 11),
95
+        fMultiTexture           = (1 << 12),
96
+        fUpdateRoomListPerFrame = (1 << 13),
97
+        fAnimateAllModels       = (1 << 14),
98
+        fAllRooms               = (1 << 15)
100 99
     } RenderFlags;
101 100
 
102 101
     typedef enum {
@@ -173,7 +172,7 @@ class Render
173 172
      * Mongoose - Created, factored out of World
174 173
      ------------------------------------------------------*/
175 174
 
176
-    void Init(int width, int height, bool fastCard);
175
+    void Init(int width, int height);
177 176
     /*------------------------------------------------------
178 177
      * Pre  :
179 178
      * Post : Starts and sets up OpenGL target

+ 0
- 3
include/System.h Bestand weergeven

@@ -182,8 +182,6 @@ public:
182 182
 
183 183
     void setDriverGL(const char *driver);
184 184
 
185
-    void setFastCardPerformance(bool isFast);
186
-
187 185
     virtual void shutdown(int code) = 0;
188 186
 
189 187
     virtual void swapBuffersGL() = 0;
@@ -193,7 +191,6 @@ public:
193 191
 protected:
194 192
     unsigned int m_width;              //!< Width of the viewport
195 193
     unsigned int m_height;             //!< Height of the viewport
196
-    bool m_fastCard;                   //!< Assume expensive calls are fine if true
197 194
     char *m_driver;                    //!< String for dynamic use of GL library
198 195
     float m_clipNear;                  //!< Clip near distance
199 196
     float m_clipFar;                   //!< Clip far distance

+ 1
- 6
src/OpenRaider.cpp Bestand weergeven

@@ -886,12 +886,11 @@ void OpenRaider::start()
886 886
 
887 887
     // Mongoose 2002.08.13, This starts GL context
888 888
     printf("\n[Starting video subsystem...]\n");
889
-    setFastCardPerformance(true);
890 889
     initVideo(m_width, m_height, false);
891 890
 
892 891
     // Mongoose 2002.01.02, Disable rendering to avoid GL call conflicts
893 892
     m_render.setMode(Render::modeDisabled);
894
-    m_render.Init(m_width, m_height, m_fastCard);
893
+    m_render.Init(m_width, m_height);
895 894
     m_render.initTextures(m_homeDir, &m_texOffset, &mLevelTextureOffset);
896 895
 
897 896
     m_render.RegisterCamera(&m_camera);
@@ -3353,10 +3352,6 @@ void OpenRaider::handleCommand(char *cmd, unsigned int mode)
3353 3352
             {
3354 3353
                 m_height = atoi(cmd);
3355 3354
             }
3356
-            else if (rc_command("FastCard", cmd))
3357
-            {
3358
-                rc_get_bool(cmd, &m_fastCard);
3359
-            }
3360 3355
             else if (rc_command("FullScreen", cmd))
3361 3356
             {
3362 3357
                 rc_get_bool(cmd, &b);

+ 19
- 52
src/Render.cpp Bestand weergeven

@@ -197,7 +197,6 @@ void Render::initTextures(char *textureDir, unsigned int *numLoaded,
197 197
         unsigned int *nextId)
198 198
 {
199 199
     char filename[128];
200
-    bool fastCard = mFlags & Render::fFastCard;
201 200
     const char *console = "Toggle the Console with [`] key";
202 201
     const char *menu = "Press <esc> for menu";
203 202
     int font_id;
@@ -217,10 +216,7 @@ void Render::initTextures(char *textureDir, unsigned int *numLoaded,
217 216
     mTexture.setMaxTextureCount(128);  /* TR never needs more than 32 iirc
218 217
                                           However, color texturegen is a lot */
219 218
 
220
-    if (fastCard)
221
-    {
222
-        mTexture.setFlag(Texture::fUseMipmaps);
223
-    }
219
+    mTexture.setFlag(Texture::fUseMipmaps);
224 220
 
225 221
     printf("Processing Textures:\n");
226 222
 
@@ -425,19 +421,12 @@ void renderTrace(int color, vec3_t start, vec3_t end)
425 421
 }
426 422
 
427 423
 
428
-void Render::Init(int width, int height, bool fast_card)
424
+void Render::Init(int width, int height)
429 425
 {
430 426
     char *s;
431 427
 
432
-
433 428
     mWidth = width;
434 429
     mHeight = height;
435
-    mFlags |= Render::fFastCard;
436
-
437
-    if (!fast_card)
438
-    {
439
-        mFlags ^= Render::fFastCard;
440
-    }
441 430
 
442 431
     // Print driver support information
443 432
     printf("\n## GL Driver Info ##\n");
@@ -493,44 +482,25 @@ void Render::Init(int width, int height, bool fast_card)
493 482
     glDisable(GL_LIGHTING);
494 483
 
495 484
     // Set up alpha blending
496
-    if (fast_card)
497
-    {
498
-        glEnable(GL_BLEND);
499
-        glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
485
+    glEnable(GL_BLEND);
486
+    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
500 487
 
501
-        //glEnable(GL_ALPHA_TEST); // Disable per pixel alpha blending
502
-        glAlphaFunc(GL_GREATER, 0);
503
-    }
504
-    else
505
-    {
506
-        glDisable(GL_BLEND);
507
-        glDisable(GL_ALPHA_TEST);
508
-    }
488
+    //glEnable(GL_ALPHA_TEST); // Disable per pixel alpha blending
489
+    glAlphaFunc(GL_GREATER, 0);
509 490
 
510 491
     glPointSize(5.0);
511 492
 
512 493
     // Setup shading
513 494
     glShadeModel(GL_SMOOTH);
514 495
 
515
-    if (fast_card)
516
-    {
517
-        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
518
-        glHint(GL_FOG_HINT, GL_NICEST);
519
-        glEnable(GL_COLOR_MATERIAL);
520
-        glEnable(GL_DITHER);
496
+    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
497
+    glHint(GL_FOG_HINT, GL_NICEST);
498
+    glEnable(GL_COLOR_MATERIAL);
499
+    glEnable(GL_DITHER);
521 500
 
522
-        // AA polygon edges
523
-        //glEnable(GL_POLYGON_SMOOTH);
524
-        //glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
525
-    }
526
-    else
527
-    {
528
-        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
529
-        glHint(GL_FOG_HINT, GL_FASTEST);
530
-        glDisable(GL_COLOR_MATERIAL);
531
-        glDisable(GL_DITHER);
532
-        glDisable(GL_POLYGON_SMOOTH);
533
-    }
501
+    // AA polygon edges
502
+    glEnable(GL_POLYGON_SMOOTH);
503
+    glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
534 504
 
535 505
     glDisable(GL_LINE_SMOOTH);
536 506
     glDisable(GL_POINT_SMOOTH);
@@ -687,16 +657,13 @@ void Render::setMode(int n)
687 657
             glDisable(GL_TEXTURE_2D);
688 658
             break;
689 659
         default:
690
-            if (mFlags & Render::fFastCard)
660
+            if (mMode == Render::modeLoadScreen)
691 661
             {
692
-                if (mMode == Render::modeLoadScreen)
693
-                {
694
-                    glBlendFunc(GL_SRC_ALPHA, GL_ONE);
695
-                }
696
-                else
697
-                {
698
-                    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
699
-                }
662
+                glBlendFunc(GL_SRC_ALPHA, GL_ONE);
663
+            }
664
+            else
665
+            {
666
+                glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
700 667
             }
701 668
 
702 669
             glClearColor(BLACK[0], BLACK[1], BLACK[2], BLACK[3]);

+ 13
- 41
src/System.cpp Bestand weergeven

@@ -43,7 +43,6 @@ System::System()
43 43
 {
44 44
     m_width = 800;
45 45
     m_height = 600;
46
-    m_fastCard = true;
47 46
 
48 47
     m_driver = 0x0;
49 48
 
@@ -412,12 +411,6 @@ void System::setDriverGL(const char *driver)
412 411
 }
413 412
 
414 413
 
415
-void System::setFastCardPerformance(bool is_fast)
416
-{
417
-    m_fastCard = is_fast;
418
-}
419
-
420
-
421 414
 void System::resetTicks()
422 415
 {
423 416
     system_timer(0);
@@ -485,49 +478,28 @@ void System::initGL()
485 478
     glDisable(GL_LIGHTING);
486 479
 
487 480
     // Set up alpha blending
488
-    if (m_fastCard)
489
-    {
490
-        glEnable(GL_BLEND);
491
-        glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
481
+    glEnable(GL_BLEND);
482
+    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
492 483
 
493
-        //glEnable(GL_ALPHA_TEST); // Disable per pixel alpha blending
494
-        glAlphaFunc(GL_GREATER, 0);
495
-    }
496
-    else
497
-    {
498
-        glDisable(GL_BLEND);
499
-        glDisable(GL_ALPHA_TEST);
500
-    }
484
+    //glEnable(GL_ALPHA_TEST); // Disable per pixel alpha blending
485
+    glAlphaFunc(GL_GREATER, 0);
501 486
 
502 487
     glPointSize(5.0);
503 488
 
504 489
     // Setup shading
505 490
     glShadeModel(GL_SMOOTH);
506 491
 
507
-    if (m_fastCard)
508
-    {
509
-        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
510
-        glHint(GL_FOG_HINT, GL_NICEST);
511
-        glEnable(GL_COLOR_MATERIAL);
512
-        glEnable(GL_DITHER);
492
+    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
493
+    glHint(GL_FOG_HINT, GL_NICEST);
494
+    glEnable(GL_COLOR_MATERIAL);
495
+    glEnable(GL_DITHER);
513 496
 
514
-        // AA polygon edges
515
-        glEnable(GL_POLYGON_SMOOTH);
516
-        glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
497
+    // AA polygon edges
498
+    glEnable(GL_POLYGON_SMOOTH);
499
+    glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
517 500
 
518
-        glEnable(GL_POINT_SMOOTH);
519
-        glEnable(GL_FOG);
520
-    }
521
-    else
522
-    {
523
-        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
524
-        glHint(GL_FOG_HINT, GL_FASTEST);
525
-        glDisable(GL_COLOR_MATERIAL);
526
-        glDisable(GL_DITHER);
527
-        glDisable(GL_POLYGON_SMOOTH);
528
-        glDisable(GL_POINT_SMOOTH);
529
-        glDisable(GL_FOG);
530
-    }
501
+    glEnable(GL_POINT_SMOOTH);
502
+    glEnable(GL_FOG);
531 503
 
532 504
     glDisable(GL_LINE_SMOOTH);
533 505
     glDisable(GL_AUTO_NORMAL);

Laden…
Annuleren
Opslaan