summaryrefslogtreecommitdiffstats
path: root/src/skel/win
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-08-15 16:51:39 +0200
committereray orçunus <erayorcunus@gmail.com>2019-08-15 16:51:39 +0200
commit5bea16c7ccc617828d0aee2da23c8aa3f87375df (patch)
tree150df121717298a2735f418dcae366417b8404ec /src/skel/win
parentMore peds (diff)
downloadre3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar.gz
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar.bz2
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar.lz
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar.xz
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.tar.zst
re3-5bea16c7ccc617828d0aee2da23c8aa3f87375df.zip
Diffstat (limited to '')
-rw-r--r--src/skel/win/win.cpp46
-rw-r--r--src/skel/win/win.h1
2 files changed, 36 insertions, 11 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 04b89803..d4eb71be 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -94,6 +94,7 @@ static psGlobalType &PsGlobal = *(psGlobalType*)0x72CF60;
#include "Game.h"
#include "PCSave.h"
#include "Sprite2d.h"
+#include "AnimViewer.h"
VALIDATE_SIZE(psGlobalType, 0x28);
@@ -976,9 +977,9 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
RECT rect;
/* redraw window */
- if (RwInitialised && gGameState == GS_PLAYING_GAME)
+ if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
{
- RsEventHandler(rsIDLE, (void *)TRUE);
+ RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
}
/* Manually resize window */
@@ -1917,16 +1918,23 @@ _WinMain(HINSTANCE instance,
SetErrorMode(SEM_FAILCRITICALERRORS);
-
+ if (!TurnOnAnimViewer) {
#ifdef NO_MOVIES
- gGameState = GS_INIT_FRONTEND;
- TRACE("gGameState = GS_INIT_FRONTEND");
-
- LoadingScreen(nil, nil, "loadsc0");
- if ( !CGame::InitialiseOnceAfterRW() )
- RsGlobal.quit = TRUE;
-#endif
-
+ gGameState = GS_INIT_FRONTEND;
+ TRACE("gGameState = GS_INIT_FRONTEND");
+
+ LoadingScreen(nil, nil, "loadsc0");
+ if (!CGame::InitialiseOnceAfterRW())
+ RsGlobal.quit = TRUE;
+#endif
+ } else {
+#ifndef MASTER
+ CAnimViewer::Initialise();
+ FrontEndMenuManager.m_bGameNotLoaded = false;
+ gGameState = GS_ANIMVIEWER;
+ TurnOnAnimViewer = false;
+#endif
+ }
while ( TRUE )
{
@@ -2114,6 +2122,18 @@ _WinMain(HINSTANCE instance,
}
break;
}
+#ifndef MASTER
+ case GS_ANIMVIEWER:
+ {
+ float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
+ if (RwInitialised)
+ {
+ if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
+ RsEventHandler(rsANIMVIEWER, (void*)TRUE);
+ }
+ break;
+ }
+#endif
}
}
else
@@ -2158,6 +2178,8 @@ _WinMain(HINSTANCE instance,
{
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
+ else if ( gGameState == GS_ANIMVIEWER )
+ CAnimViewer::Shutdown();
CTimer::Stop();
@@ -2180,6 +2202,8 @@ _WinMain(HINSTANCE instance,
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
+ else if ( gGameState == GS_ANIMVIEWER )
+ CAnimViewer::Shutdown();
DMAudio.Terminate();
diff --git a/src/skel/win/win.h b/src/skel/win/win.h
index 69d38164..8c32e57d 100644
--- a/src/skel/win/win.h
+++ b/src/skel/win/win.h
@@ -17,6 +17,7 @@ enum eGameState
GS_FRONTEND,
GS_INIT_PLAYING_GAME,
GS_PLAYING_GAME,
+ GS_ANIMVIEWER,
};
enum eWinVersion