This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -316,8 +316,8 @@ void Activity::Clear() {
316
316
if (int screenId = ScreenOfPlayer (player); screenId != -1 ) {
317
317
g_FrameMan.ClearScreenText (screenId);
318
318
g_CameraMan.SetScreenOcclusion (Vector (), screenId);
319
- g_CameraMan.SetScreenShake (0 .0F , screenId);
320
319
}
320
+ g_CameraMan.ResetAllScreenShake ();
321
321
322
322
// TODO currently this sets brains to players arbitrarily. We should save information on which brain is for which player in the scene so we can set them properly!
323
323
if (m_IsActive[player]) {
Original file line number Diff line number Diff line change @@ -293,11 +293,6 @@ namespace RTE {
293
293
// Stop all music played by the current activity. It will be re-started by the new Activity.
294
294
g_AudioMan.StopMusic ();
295
295
296
- // Reset screen positions and shake
297
- for (int screen = 0 ; screen < c_MaxScreenCount; screen++) {
298
- g_CameraMan.SetScreenShake (0 , screen);
299
- }
300
-
301
296
m_ActivityAllowsSaving = false ;
302
297
303
298
m_StartActivity.reset (activity);
Original file line number Diff line number Diff line change @@ -171,6 +171,16 @@ namespace RTE {
171
171
return Vector (static_cast <float >(frameWidth), static_cast <float >(frameHeight));
172
172
}
173
173
174
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
175
+
176
+ void CameraMan::ResetAllScreenShake () {
177
+ for (int screenId = 0 ; screenId < g_FrameMan.GetScreenCount (); ++screenId) {
178
+ Screen &screen = m_Screens[screenId];
179
+ screen.ScreenShakeMagnitude = 0 ;
180
+ screen.ScrollTimer .Reset ();
181
+ }
182
+ }
183
+
174
184
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
175
185
176
186
void CameraMan::AddScreenShake (float magnitude, const Vector &position) {
Original file line number Diff line number Diff line change @@ -200,6 +200,11 @@ namespace RTE {
200
200
#pragma endregion
201
201
202
202
#pragma region Screen Shake Actions
203
+ // / <summary>
204
+ // / Resets all screen shake and the screen scroll timers that affect it.
205
+ // / </summary>
206
+ void ResetAllScreenShake ();
207
+
203
208
// / <summary>
204
209
// / Increases the magnitude of screen shake.
205
210
// / This is used for spatially located screen-shake, and will automatically determine which screens have shake applied
You can’t perform that action at this time.
0 commit comments