Browse Source

Fixed mouse behaviour

Thomas Buck 10 years ago
parent
commit
19d2ffb783
3 changed files with 16 additions and 7 deletions
  1. 1
    0
      ChangeLog
  2. 3
    1
      README.md
  3. 12
    6
      src/Camera.cpp

+ 1
- 0
ChangeLog View File

@@ -6,6 +6,7 @@
6 6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7 7
 
8 8
 	[ 20140105 ]
9
+	* Fixed strange Mouse Y-Axis Overflow bug
9 10
 	* Cleanup of Makefile
10 11
 
11 12
 	[ 20140104 ]

+ 3
- 1
README.md View File

@@ -4,7 +4,9 @@
4 4
 
5 5
 This project aims to get OpenRaider in a more usable state, maybe one day even being able to play the old Tomb Raider games flawlessly...
6 6
 
7
-If you just want to see OpenRaider doing something, without installing any of the dependencies needed to build OpenRaider, install [XQuartz](http://xquartz.macosforge.org/trac) (if you don't have it already) and grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
7
+If you just want to see OpenRaider doing something on your Mac, without installing any of the dependencies needed to build OpenRaider, install [XQuartz](http://xquartz.macosforge.org/trac) (if you don't have it already) and grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
8
+
9
+It seems as if OpenRaider will currently only work on Little Endian platforms. This is not nice and will hopefully be fixed in the future!
8 10
 
9 11
 ## Configuration
10 12
 

+ 12
- 6
src/Camera.cpp View File

@@ -32,6 +32,7 @@
32 32
  * Mongoose - Created
33 33
  =================================================================*/
34 34
 
35
+#include <stdio.h>
35 36
 #include <math.h>
36 37
 #include "hel/math.h"
37 38
 #include "Camera.h"
@@ -238,6 +239,7 @@ void Camera::setSensitivityX(float angle)
238 239
 	mRotateDelta = helDegToRad(angle);
239 240
 }
240 241
 
242
+
241 243
 ////////
242 244
 void Camera::command(enum camera_command cmd)
243 245
 {
@@ -290,13 +292,17 @@ void Camera::command(enum camera_command cmd)
290 292
 #endif
291 293
 	  break;
292 294
  case CAMERA_ROTATE_UP:
293
-	 mTheta2 += mRotateDelta2;
294
-	 rotate(mTheta2, 1.0, 0.0, 0.0);
295
+     if (mTheta2 < (M_PI / 2)) {
296
+	    mTheta2 += mRotateDelta2;
297
+	    rotate(mTheta2, 1.0, 0.0, 0.0);
298
+     }
295 299
 	 break;
296 300
  case CAMERA_ROTATE_DOWN:
297
-	 mTheta2 -= mRotateDelta2;
298
-	 rotate(mTheta2, 1.0, 0.0, 0.0);
299
-	 break;
301
+     if (mTheta2 > -(M_PI / 2)) {
302
+         mTheta2 -= mRotateDelta2;
303
+         rotate(mTheta2, 1.0, 0.0, 0.0);
304
+     }
305
+     break;
300 306
  case CAMERA_ROTATE_RIGHT:
301 307
 	 mTheta += mRotateDelta;
302 308
 	 rotate(mTheta, 0.0, 1.0, 0.0);
@@ -325,7 +331,7 @@ void Camera::command(enum camera_command cmd)
325 331
 }
326 332
 
327 333
 
328
-// FIXME: Mostly invalid for QUAT_CAM (can rotate on XYZ)
334
+//! \fixme Mostly invalid for QUAT_CAM (can rotate on XYZ)
329 335
 bool Camera::isBehind(int x, int z)
330 336
 {
331 337
   double bTheta, bCameraX, bCameraZ, Distance;

Loading…
Cancel
Save