summaryrefslogtreecommitdiffstats
path: root/src/skel
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
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 'src/skel')
-rw-r--r--src/skel/skeleton.cpp9
-rw-r--r--src/skel/skeleton.h3
-rw-r--r--src/skel/win/win.cpp46
-rw-r--r--src/skel/win/win.h1
4 files changed, 48 insertions, 11 deletions
diff --git a/src/skel/skeleton.cpp b/src/skel/skeleton.cpp
index ecc0083d..73dd8bf8 100644
--- a/src/skel/skeleton.cpp
+++ b/src/skel/skeleton.cpp
@@ -15,6 +15,8 @@
static RwBool DefaultVideoMode = TRUE;
+bool TurnOnAnimViewer = false;
+
//RsGlobalType RsGlobal;
RsGlobalType &RsGlobal = *(RsGlobalType*)0x8F4360;
@@ -144,7 +146,14 @@ rsPreInitCommandLine(RwChar *arg)
return TRUE;
}
+#ifndef MASTER
+ if (!strcmp(arg, RWSTRING("-animviewer")))
+ {
+ TurnOnAnimViewer = TRUE;
+ return TRUE;
+ }
+#endif
return FALSE;
}
diff --git a/src/skel/skeleton.h b/src/skel/skeleton.h
index e22c1325..e357905d 100644
--- a/src/skel/skeleton.h
+++ b/src/skel/skeleton.h
@@ -79,8 +79,11 @@ enum RsEvent
rsPADANALOGUERIGHTRESET,
rsPREINITCOMMANDLINE,
rsACTIVATE,
+ rsANIMVIEWER,
};
+extern bool TurnOnAnimViewer;
+
typedef enum RsEvent RsEvent;
typedef RsEventStatus (*RsInputEventHandler)(RsEvent event, void *param);
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