|
@@ -91,6 +91,9 @@ void Game::destroy() {
|
91
|
91
|
|
92
|
92
|
mLoaded = false;
|
93
|
93
|
mRender->setMode(Render::modeDisabled);
|
|
94
|
+
|
|
95
|
+ mRender->ClearWorld();
|
|
96
|
+ mWorld.destroy();
|
94
|
97
|
}
|
95
|
98
|
|
96
|
99
|
int Game::loadLevel(const char *level) {
|
|
@@ -99,9 +102,6 @@ int Game::loadLevel(const char *level) {
|
99
|
102
|
|
100
|
103
|
mName = bufferString("%s", level);
|
101
|
104
|
|
102
|
|
- mRender->ClearWorld();
|
103
|
|
- mWorld.destroy();
|
104
|
|
-
|
105
|
105
|
// Load the level pak into TombRaider
|
106
|
106
|
gOpenRaider->mConsole->print("Loading %s", mName);
|
107
|
107
|
int error = mTombRaider.Load(mName, percentCallbackTrampoline, this);
|
|
@@ -159,15 +159,28 @@ void Game::handleAction(ActionEvents action, bool isFinished) {
|
159
|
159
|
|
160
|
160
|
void Game::handleMouseMotion(int xrel, int yrel) {
|
161
|
161
|
if (mLoaded) {
|
162
|
|
-
|
|
162
|
+ if (xrel > 0)
|
|
163
|
+ while (xrel-- > 0)
|
|
164
|
+ mCamera->command(CAMERA_ROTATE_RIGHT);
|
|
165
|
+ else if (xrel < 0)
|
|
166
|
+ while (xrel++ < 0)
|
|
167
|
+ mCamera->command(CAMERA_ROTATE_LEFT);
|
|
168
|
+
|
|
169
|
+ if (yrel > 0)
|
|
170
|
+ while (yrel-- > 0)
|
|
171
|
+ mCamera->command(CAMERA_ROTATE_UP);
|
|
172
|
+ else if (yrel < 0)
|
|
173
|
+ while (yrel++ < 0)
|
|
174
|
+ mCamera->command(CAMERA_ROTATE_DOWN);
|
|
175
|
+
|
|
176
|
+ if (mLara) {
|
|
177
|
+ mLara->angles[1] = mCamera->getRadianYaw();
|
|
178
|
+ mLara->angles[2] = mCamera->getRadianPitch();
|
|
179
|
+ }
|
163
|
180
|
}
|
164
|
181
|
}
|
165
|
182
|
|
166
|
183
|
void Game::display() {
|
167
|
|
- if (mLoaded) {
|
168
|
|
-
|
169
|
|
- }
|
170
|
|
-
|
171
|
184
|
mRender->Display();
|
172
|
185
|
}
|
173
|
186
|
|