Browse Source

Removed FastCard option

Thomas Buck 11 years ago
parent
commit
5c35ca3039
7 changed files with 45 additions and 112 deletions
  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 View File

5
 
5
 
6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
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
 	[ 20140215 ]
11
 	[ 20140215 ]
9
 	* Enabled previously disabled polygon smoothing & color material
12
 	* Enabled previously disabled polygon smoothing & color material
10
 	  when setting fastcard to true
13
 	  when setting fastcard to true

+ 1
- 1
README.md View File

119
 | /                        | Drop a waypoint test (formally undocumented) |
119
 | /                        | Drop a waypoint test (formally undocumented) |
120
 | [ ]                      | Adjust idle animation for testing            |
120
 | [ ]                      | Adjust idle animation for testing            |
121
 
121
 
122
-### Console Commands
122
+### Console/Config Commands
123
 
123
 
124
 Console commands (BOOL is now '0' or '1' for less typing).
124
 Console commands (BOOL is now '0' or '1' for less typing).
125
 Pressing &lt;UP&gt; will go back to last command entered (saves typing).
125
 Pressing &lt;UP&gt; will go back to last command entered (saves typing).

+ 8
- 9
include/Render.h View File

89
         fEntityModels           = (1 << 6),
89
         fEntityModels           = (1 << 6),
90
         fFog                    = (1 << 7),
90
         fFog                    = (1 << 7),
91
         fUsePortals             = (1 << 8),
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
     } RenderFlags;
99
     } RenderFlags;
101
 
100
 
102
     typedef enum {
101
     typedef enum {
173
      * Mongoose - Created, factored out of World
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
      * Pre  :
177
      * Pre  :
179
      * Post : Starts and sets up OpenGL target
178
      * Post : Starts and sets up OpenGL target

+ 0
- 3
include/System.h View File

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

+ 1
- 6
src/OpenRaider.cpp View File

886
 
886
 
887
     // Mongoose 2002.08.13, This starts GL context
887
     // Mongoose 2002.08.13, This starts GL context
888
     printf("\n[Starting video subsystem...]\n");
888
     printf("\n[Starting video subsystem...]\n");
889
-    setFastCardPerformance(true);
890
     initVideo(m_width, m_height, false);
889
     initVideo(m_width, m_height, false);
891
 
890
 
892
     // Mongoose 2002.01.02, Disable rendering to avoid GL call conflicts
891
     // Mongoose 2002.01.02, Disable rendering to avoid GL call conflicts
893
     m_render.setMode(Render::modeDisabled);
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
     m_render.initTextures(m_homeDir, &m_texOffset, &mLevelTextureOffset);
894
     m_render.initTextures(m_homeDir, &m_texOffset, &mLevelTextureOffset);
896
 
895
 
897
     m_render.RegisterCamera(&m_camera);
896
     m_render.RegisterCamera(&m_camera);
3353
             {
3352
             {
3354
                 m_height = atoi(cmd);
3353
                 m_height = atoi(cmd);
3355
             }
3354
             }
3356
-            else if (rc_command("FastCard", cmd))
3357
-            {
3358
-                rc_get_bool(cmd, &m_fastCard);
3359
-            }
3360
             else if (rc_command("FullScreen", cmd))
3355
             else if (rc_command("FullScreen", cmd))
3361
             {
3356
             {
3362
                 rc_get_bool(cmd, &b);
3357
                 rc_get_bool(cmd, &b);

+ 19
- 52
src/Render.cpp View File

197
         unsigned int *nextId)
197
         unsigned int *nextId)
198
 {
198
 {
199
     char filename[128];
199
     char filename[128];
200
-    bool fastCard = mFlags & Render::fFastCard;
201
     const char *console = "Toggle the Console with [`] key";
200
     const char *console = "Toggle the Console with [`] key";
202
     const char *menu = "Press <esc> for menu";
201
     const char *menu = "Press <esc> for menu";
203
     int font_id;
202
     int font_id;
217
     mTexture.setMaxTextureCount(128);  /* TR never needs more than 32 iirc
216
     mTexture.setMaxTextureCount(128);  /* TR never needs more than 32 iirc
218
                                           However, color texturegen is a lot */
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
     printf("Processing Textures:\n");
221
     printf("Processing Textures:\n");
226
 
222
 
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
     char *s;
426
     char *s;
431
 
427
 
432
-
433
     mWidth = width;
428
     mWidth = width;
434
     mHeight = height;
429
     mHeight = height;
435
-    mFlags |= Render::fFastCard;
436
-
437
-    if (!fast_card)
438
-    {
439
-        mFlags ^= Render::fFastCard;
440
-    }
441
 
430
 
442
     // Print driver support information
431
     // Print driver support information
443
     printf("\n## GL Driver Info ##\n");
432
     printf("\n## GL Driver Info ##\n");
493
     glDisable(GL_LIGHTING);
482
     glDisable(GL_LIGHTING);
494
 
483
 
495
     // Set up alpha blending
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
     glPointSize(5.0);
491
     glPointSize(5.0);
511
 
492
 
512
     // Setup shading
493
     // Setup shading
513
     glShadeModel(GL_SMOOTH);
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
     glDisable(GL_LINE_SMOOTH);
505
     glDisable(GL_LINE_SMOOTH);
536
     glDisable(GL_POINT_SMOOTH);
506
     glDisable(GL_POINT_SMOOTH);
687
             glDisable(GL_TEXTURE_2D);
657
             glDisable(GL_TEXTURE_2D);
688
             break;
658
             break;
689
         default:
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
             glClearColor(BLACK[0], BLACK[1], BLACK[2], BLACK[3]);
669
             glClearColor(BLACK[0], BLACK[1], BLACK[2], BLACK[3]);

+ 13
- 41
src/System.cpp View File

43
 {
43
 {
44
     m_width = 800;
44
     m_width = 800;
45
     m_height = 600;
45
     m_height = 600;
46
-    m_fastCard = true;
47
 
46
 
48
     m_driver = 0x0;
47
     m_driver = 0x0;
49
 
48
 
412
 }
411
 }
413
 
412
 
414
 
413
 
415
-void System::setFastCardPerformance(bool is_fast)
416
-{
417
-    m_fastCard = is_fast;
418
-}
419
-
420
-
421
 void System::resetTicks()
414
 void System::resetTicks()
422
 {
415
 {
423
     system_timer(0);
416
     system_timer(0);
485
     glDisable(GL_LIGHTING);
478
     glDisable(GL_LIGHTING);
486
 
479
 
487
     // Set up alpha blending
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
     glPointSize(5.0);
487
     glPointSize(5.0);
503
 
488
 
504
     // Setup shading
489
     // Setup shading
505
     glShadeModel(GL_SMOOTH);
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
     glDisable(GL_LINE_SMOOTH);
504
     glDisable(GL_LINE_SMOOTH);
533
     glDisable(GL_AUTO_NORMAL);
505
     glDisable(GL_AUTO_NORMAL);

Loading…
Cancel
Save