Thomas Buck 11 years ago
parent
commit
28367b9b24
3 changed files with 10 additions and 17 deletions
  1. 2
    2
      include/World.h
  2. 3
    3
      src/OpenRaider.cpp
  3. 5
    12
      src/SDLSystem.cpp

+ 2
- 2
include/World.h View File

81
 
81
 
82
 typedef struct sprite_s
82
 typedef struct sprite_s
83
 {
83
 {
84
-    int num_verts; // 4 == Quad, 3 == Triangle, renderered as triangles
84
+    int num_verts; // 4 == Quad, 3 == Triangle, rendered as triangles
85
     vertex_t vertex[4];
85
     vertex_t vertex[4];
86
     texel_t texel[4];
86
     texel_t texel[4];
87
     float pos[3];
87
     float pos[3];
143
 {
143
 {
144
     int id;                    // Unique identifier
144
     int id;                    // Unique identifier
145
     float pos[3];              // World position
145
     float pos[3];              // World position
146
-    float angles[3];           // Eular angles (pitch, yaw, roll)
146
+    float angles[3];           // Euler angles (pitch, yaw, roll)
147
     int type;                  // {(0x00, item), (0x01, ai), (0x02, player)}
147
     int type;                  // {(0x00, item), (0x01, ai), (0x02, player)}
148
     int room;                  // Current room entity is in
148
     int room;                  // Current room entity is in
149
     worldMoveType moveType;    // Type of motion/clipping
149
     worldMoveType moveType;    // Type of motion/clipping

+ 3
- 3
src/OpenRaider.cpp View File

1701
 
1701
 
1702
     if (a < 0)
1702
     if (a < 0)
1703
     {
1703
     {
1704
-        //      continue;
1704
+        //continue;
1705
         return;
1705
         return;
1706
     }
1706
     }
1707
 
1707
 
1783
         printf("c"); // it's already cached
1783
         printf("c"); // it's already cached
1784
         fflush(stdout);
1784
         fflush(stdout);
1785
 
1785
 
1786
-        //      continue;
1786
+        //continue;
1787
         return;
1787
         return;
1788
     }
1788
     }
1789
 
1789
 
1893
                 print(true, "WARNING: Bad animation frame %i > %i\n",
1893
                 print(true, "WARNING: Bad animation frame %i > %i\n",
1894
                         frame_offset, m_tombraider.NumFrames());
1894
                         frame_offset, m_tombraider.NumFrames());
1895
 
1895
 
1896
-                // Mongoose 2002.08.15, Atempt to skip more likely bad animation data
1896
+                // Mongoose 2002.08.15, Attempt to skip more likely bad animation data
1897
                 print(true, "WARNING: Handling bad animation data...");
1897
                 print(true, "WARNING: Handling bad animation data...");
1898
                 return; //continue;
1898
                 return; //continue;
1899
             }
1899
             }

+ 5
- 12
src/SDLSystem.cpp View File

83
     }
83
     }
84
 #endif
84
 #endif
85
 
85
 
86
-    flags |= SDL_WINDOW_OPENGL;
86
+    flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
87
 
87
 
88
     mFullscreen = fullscreen;
88
     mFullscreen = fullscreen;
89
     if (mFullscreen)
89
     if (mFullscreen)
90
         flags |= SDL_WINDOW_FULLSCREEN;
90
         flags |= SDL_WINDOW_FULLSCREEN;
91
 
91
 
92
-    setGrabMouse(true); // Always grab mouse!
92
+    //setGrabMouse(true); // Always grab mouse!
93
 
93
 
94
     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
94
     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
95
     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
95
     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
101
             width, height, flags);
101
             width, height, flags);
102
     mGLContext = SDL_GL_CreateContext(mWindow);
102
     mGLContext = SDL_GL_CreateContext(mWindow);
103
 
103
 
104
-    //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
105
-    //SDL_EnableKeyRepeat(100, SDL_DEFAULT_REPEAT_INTERVAL);
106
-
107
 #ifdef UNICODE_SUPPORT
104
 #ifdef UNICODE_SUPPORT
108
     //@JML get Unicode value of key for international keyboard
105
     //@JML get Unicode value of key for international keyboard
109
     SDL_EnableUNICODE(1);
106
     SDL_EnableUNICODE(1);
117
 }
114
 }
118
 
115
 
119
 void SDLSystem::resize(unsigned int width, unsigned int height) {
116
 void SDLSystem::resize(unsigned int width, unsigned int height) {
120
-    GLfloat aspect;
121
-
122
     m_width = width;
117
     m_width = width;
123
     m_height = height;
118
     m_height = height;
124
 
119
 
125
-    aspect = (GLfloat)width/(GLfloat)height;
126
-
127
     glViewport(0, 0, width, height);
120
     glViewport(0, 0, width, height);
128
 
121
 
122
+    /* All this is already done in System::resizeGL() !?
123
+    GLfloat aspect = (GLfloat)width/(GLfloat)height;
129
     glMatrixMode(GL_PROJECTION);
124
     glMatrixMode(GL_PROJECTION);
130
     glLoadIdentity();
125
     glLoadIdentity();
131
 
126
 
138
 
133
 
139
     glMatrixMode(GL_MODELVIEW);
134
     glMatrixMode(GL_MODELVIEW);
140
     glLoadIdentity();
135
     glLoadIdentity();
136
+    */
141
 
137
 
142
     // Resize context
138
     // Resize context
143
     resizeGL(width, height);
139
     resizeGL(width, height);
365
                     switch(event.window.event) {
361
                     switch(event.window.event) {
366
                         case SDL_WINDOWEVENT_RESIZED:
362
                         case SDL_WINDOWEVENT_RESIZED:
367
                             resizeGL(event.window.data1, event.window.data2);
363
                             resizeGL(event.window.data1, event.window.data2);
368
-                            gameFrame();
369
                             break;
364
                             break;
370
                     }
365
                     }
371
                     break;
366
                     break;
397
             SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
392
             SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
398
         else
393
         else
399
             SDL_SetWindowFullscreen(mWindow, 0);
394
             SDL_SetWindowFullscreen(mWindow, 0);
400
-
401
-        // resize(width, height); // not needed with desktop fullscreen
402
     }
395
     }
403
 }
396
 }
404
 
397
 

Loading…
Cancel
Save