mirror of
https://github.com/halpz/re3.git
synced 2025-07-02 15:30:46 +00:00
AnimViewer fixes, commentary from miami
This commit is contained in:
@ -83,9 +83,6 @@ enum eGameState
|
||||
GS_FRONTEND,
|
||||
GS_INIT_PLAYING_GAME,
|
||||
GS_PLAYING_GAME,
|
||||
#ifndef MASTER
|
||||
GS_ANIMVIEWER,
|
||||
#endif
|
||||
};
|
||||
extern RwUInt32 gGameState;
|
||||
|
||||
|
@ -1257,17 +1257,11 @@ void resizeCB(GLFWwindow* window, int width, int height) {
|
||||
* memory things don't work.
|
||||
*/
|
||||
/* redraw window */
|
||||
#ifndef MASTER
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
|
||||
{
|
||||
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
|
||||
}
|
||||
#else
|
||||
|
||||
if (RwInitialised && gGameState == GS_PLAYING_GAME)
|
||||
{
|
||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (RwInitialised && height > 0 && width > 0) {
|
||||
RwRect r;
|
||||
@ -1646,18 +1640,6 @@ main(int argc, char *argv[])
|
||||
FrontEndMenuManager.DrawMemoryCardStartUpMenus();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TurnOnAnimViewer)
|
||||
{
|
||||
#ifndef MASTER
|
||||
CAnimViewer::Initialise();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
gGameState = GS_ANIMVIEWER;
|
||||
TurnOnAnimViewer = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
initkeymap();
|
||||
|
||||
@ -1677,6 +1659,18 @@ main(int argc, char *argv[])
|
||||
* Enter the message processing loop...
|
||||
*/
|
||||
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewer in LCS, but not compiled on III Mobile.
|
||||
LoadingScreen("Loading the ModelViewer", NULL, GetRandomSplashScreen());
|
||||
CAnimViewer::Initialise();
|
||||
CTimer::Update();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if (TheMemoryCard.m_bWantToLoad)
|
||||
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
|
||||
@ -1691,7 +1685,13 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
glfwPollEvents();
|
||||
if( ForegroundApp )
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewerCore in LCS, but TheModelViewer on other state-machine III-VCs.
|
||||
TheModelViewer();
|
||||
} else
|
||||
#endif
|
||||
if ( ForegroundApp )
|
||||
{
|
||||
switch ( gGameState )
|
||||
{
|
||||
@ -1894,18 +1894,6 @@ main(int argc, char *argv[])
|
||||
}
|
||||
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
|
||||
@ -1977,12 +1965,13 @@ main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
@ -2004,12 +1993,13 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
DMAudio.Terminate();
|
||||
|
||||
|
@ -10,14 +10,13 @@
|
||||
|
||||
#include "skeleton.h"
|
||||
#include "platform.h"
|
||||
#include "main.h"
|
||||
#include "MemoryHeap.h"
|
||||
|
||||
|
||||
|
||||
static RwBool DefaultVideoMode = TRUE;
|
||||
|
||||
bool TurnOnAnimViewer = false;
|
||||
|
||||
RsGlobalType RsGlobal;
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -162,7 +161,7 @@ rsPreInitCommandLine(RwChar *arg)
|
||||
#ifndef MASTER
|
||||
if (!strcmp(arg, RWSTRING("-animviewer")))
|
||||
{
|
||||
TurnOnAnimViewer = TRUE;
|
||||
gbModelViewer = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -79,11 +79,8 @@ enum RsEvent
|
||||
rsPADANALOGUERIGHTRESET,
|
||||
rsPREINITCOMMANDLINE,
|
||||
rsACTIVATE,
|
||||
rsANIMVIEWER,
|
||||
};
|
||||
|
||||
extern bool TurnOnAnimViewer;
|
||||
|
||||
typedef enum RsEvent RsEvent;
|
||||
|
||||
typedef RsEventStatus (*RsInputEventHandler)(RsEvent event, void *param);
|
||||
|
@ -1017,17 +1017,12 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
RECT rect;
|
||||
|
||||
/* redraw window */
|
||||
#ifndef MASTER
|
||||
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
|
||||
{
|
||||
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
|
||||
}
|
||||
#else
|
||||
|
||||
if (RwInitialised && gGameState == GS_PLAYING_GAME)
|
||||
{
|
||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Manually resize window */
|
||||
rect.left = rect.top = 0;
|
||||
rect.bottom = newPos->bottom - newPos->top;
|
||||
@ -2183,17 +2178,17 @@ WinMain(HINSTANCE instance,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TurnOnAnimViewer)
|
||||
{
|
||||
#ifndef MASTER
|
||||
if (gbModelViewer) {
|
||||
// This is TheModelViewer in LCS, but not compiled on III Mobile.
|
||||
LoadingScreen("Loading the ModelViewer", NULL, GetRandomSplashScreen());
|
||||
CAnimViewer::Initialise();
|
||||
CTimer::Update();
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_bGameNotLoaded = false;
|
||||
#endif
|
||||
gGameState = GS_ANIMVIEWER;
|
||||
TurnOnAnimViewer = false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
while ( TRUE )
|
||||
{
|
||||
@ -2238,6 +2233,12 @@ WinMain(HINSTANCE instance,
|
||||
DispatchMessage(&message);
|
||||
}
|
||||
}
|
||||
#ifndef MASTER
|
||||
else if (gbModelViewer) {
|
||||
// This is TheModelViewerCore in LCS
|
||||
TheModelViewer();
|
||||
}
|
||||
#endif
|
||||
else if( ForegroundApp )
|
||||
{
|
||||
switch ( gGameState )
|
||||
@ -2451,18 +2452,6 @@ 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
|
||||
@ -2534,13 +2523,14 @@ WinMain(HINSTANCE instance,
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
if ( FrontEndMenuManager.m_bFirstTime == true )
|
||||
@ -2561,12 +2551,13 @@ WinMain(HINSTANCE instance,
|
||||
}
|
||||
|
||||
|
||||
#ifndef MASTER
|
||||
if ( gbModelViewer )
|
||||
CAnimViewer::Shutdown();
|
||||
else
|
||||
#endif
|
||||
if ( gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
#ifndef MASTER
|
||||
else if ( gGameState == GS_ANIMVIEWER )
|
||||
CAnimViewer::Shutdown();
|
||||
#endif
|
||||
|
||||
DMAudio.Terminate();
|
||||
|
||||
|
Reference in New Issue
Block a user