mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
Reduce buffer size back to 16, enable start menu
RwInitialised non-sense
This commit is contained in:
parent
38bc1a6dab
commit
689c76b4c5
7 changed files with 92 additions and 31 deletions
|
|
@ -16,7 +16,7 @@
|
|||
#include "Renderer.h"
|
||||
|
||||
#if defined __ARMCC_VERSION && !defined _DEBUG
|
||||
#pragma O2
|
||||
#pragma O2 // fixes crash
|
||||
#endif
|
||||
|
||||
int32 CCullZones::NumCullZones;
|
||||
|
|
|
|||
|
|
@ -1758,9 +1758,7 @@ Idle(void *arg)
|
|||
if (gbShowTimebars)
|
||||
tbDisplay();
|
||||
|
||||
tbStartTimer(0, "EndOfFrame");
|
||||
DoRWStuffEndOfFrame();
|
||||
tbEndTimer("EndOfFrame");
|
||||
|
||||
POP_MEMID(); // MEMID_RENDER
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const RwV3d *in,
|
|||
": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
|
||||
#else
|
||||
while(n--){
|
||||
const RwV3d i = *in;
|
||||
*out = mat * i;
|
||||
*out = mat * *in;
|
||||
in = (RwV3d*)((uint8*)in + stride);
|
||||
out++;
|
||||
}
|
||||
|
|
@ -111,8 +110,7 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector
|
|||
": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
|
||||
#else
|
||||
while(n--){
|
||||
const RwV3d i = *in;
|
||||
*out = mat * i;
|
||||
*out = mat * *in;
|
||||
in++;
|
||||
out++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ static EGLConfig eglConfig;
|
|||
|
||||
rw::EngineOpenParams openParams;
|
||||
|
||||
static RwBool ForegroundApp = TRUE;
|
||||
static RwBool RwInitialised = FALSE;
|
||||
|
||||
const TUid KUidRE3 = {0xe0d67647};
|
||||
|
||||
#define JOY_A 0 // cross
|
||||
|
|
@ -85,8 +88,6 @@ static uint32 cyclesPerMS;
|
|||
|
||||
static psGlobalType PsGlobal;
|
||||
|
||||
static TBool foreground;
|
||||
|
||||
static bool spinning;
|
||||
|
||||
bool qwerty;
|
||||
|
|
@ -101,7 +102,7 @@ const char* _psGetUserFilesFolder() {
|
|||
}
|
||||
|
||||
void HandleExit() {
|
||||
if (IsForegroundApp()) {
|
||||
if (ForegroundApp) {
|
||||
User::ResetInactivityTime();
|
||||
}
|
||||
RThread thread;
|
||||
|
|
@ -124,9 +125,36 @@ RwChar** _psGetVideoModeList() {
|
|||
return modes;
|
||||
}
|
||||
|
||||
void psPostRWinit(void)
|
||||
{
|
||||
CPad::GetPad(0)->Clear(true);
|
||||
CPad::GetPad(1)->Clear(true);
|
||||
}
|
||||
|
||||
void _psSelectScreenVM(RwInt32 videoMode) {
|
||||
RwTexDictionarySetCurrent( nil );
|
||||
FrontEndMenuManager.UnloadTextures();
|
||||
|
||||
RwInitialised = FALSE;
|
||||
|
||||
RsEventHandler(rsRWTERMINATE, nil);
|
||||
|
||||
if ( RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR )
|
||||
return;
|
||||
|
||||
RwInitialised = TRUE;
|
||||
|
||||
RwRect r;
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.w = RsGlobal.maximumWidth;
|
||||
r.h = RsGlobal.maximumHeight;
|
||||
|
||||
RsEventHandler(rsCAMERASIZE, &r);
|
||||
|
||||
psPostRWinit();
|
||||
|
||||
FrontEndMenuManager.LoadAllTextures();
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +280,7 @@ uint32 CTimer::GetCyclesPerMillisecond(void) {
|
|||
}
|
||||
|
||||
RwBool IsForegroundApp() {
|
||||
return foreground;
|
||||
return ForegroundApp;
|
||||
}
|
||||
|
||||
static int MapScanCode(TInt aScanCode, TInt aModifiers) {
|
||||
|
|
@ -354,10 +382,10 @@ public:
|
|||
}
|
||||
|
||||
if (spinning) return ETrue;
|
||||
RwInitialised = TRUE;
|
||||
|
||||
switch (container->gGameState) {
|
||||
case GS_START_UP:
|
||||
foreground = true;
|
||||
if (HAL::Get(HAL::ENanoTickPeriod, tickPeriod) != KErrNone) {
|
||||
User::Panic(_L("Could not init timer"), 0);
|
||||
}
|
||||
|
|
@ -371,8 +399,8 @@ public:
|
|||
RsGlobal.quit = TRUE;
|
||||
return ETrue;
|
||||
}
|
||||
// container->gGameState = GS_INIT_FRONTEND;
|
||||
container->gGameState = GS_INIT_PLAYING_GAME;
|
||||
container->gGameState = GS_INIT_FRONTEND;
|
||||
// container->gGameState = GS_INIT_PLAYING_GAME;
|
||||
break;
|
||||
case GS_INIT_FRONTEND:
|
||||
LoadingScreen(nil, nil, "loadsc0");
|
||||
|
|
@ -382,11 +410,10 @@ public:
|
|||
CMenuManager::m_bStartUpFrontEndRequested = true;
|
||||
|
||||
container->gGameState = GS_FRONTEND;
|
||||
|
||||
// container->gGameState = GS_INIT_PLAYING_GAME;
|
||||
break;
|
||||
case GS_FRONTEND:
|
||||
if (!IsForegroundApp()) break;
|
||||
if (!ForegroundApp) break;
|
||||
RsEventHandler(rsFRONTENDIDLE, nil);
|
||||
if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bWantToLoad )
|
||||
{
|
||||
|
|
@ -409,17 +436,52 @@ public:
|
|||
TRACE("gGameState = GS_PLAYING_GAME;");
|
||||
break;
|
||||
case GS_PLAYING_GAME:
|
||||
if (!IsForegroundApp()) break;
|
||||
if (!ForegroundApp) break;
|
||||
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||
// if ( RwInitialised )
|
||||
// {
|
||||
if ( RwInitialised ) {
|
||||
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsForegroundApp()) {
|
||||
if (FrontEndMenuManager.m_bWantToRestart) {
|
||||
RwInitialised = FALSE;
|
||||
FrontEndMenuManager.UnloadTextures();
|
||||
CPad::ResetCheats();
|
||||
CPad::StopPadsShaking();
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_DISABLE);
|
||||
CTimer::Stop();
|
||||
if ( FrontEndMenuManager.m_bWantToLoad )
|
||||
{
|
||||
CGame::ShutDownForRestart();
|
||||
CGame::InitialiseWhenRestarting();
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
||||
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
|
||||
FrontEndMenuManager.m_bWantToLoad = false;
|
||||
} else {
|
||||
if ( container->gGameState == GS_PLAYING_GAME )
|
||||
CGame::ShutDown();
|
||||
|
||||
CTimer::Stop();
|
||||
|
||||
if ( FrontEndMenuManager.m_bFirstTime == true )
|
||||
{
|
||||
container->gGameState = GS_INIT_FRONTEND;
|
||||
TRACE("gGameState = GS_INIT_FRONTEND;");
|
||||
}
|
||||
else
|
||||
{
|
||||
container->gGameState = GS_INIT_PLAYING_GAME;
|
||||
TRACE("gGameState = GS_INIT_PLAYING_GAME;");
|
||||
}
|
||||
}
|
||||
|
||||
FrontEndMenuManager.m_bFirstTime = false;
|
||||
FrontEndMenuManager.m_bWantToRestart = false;
|
||||
}
|
||||
|
||||
if (ForegroundApp) {
|
||||
User::ResetInactivityTime();
|
||||
}
|
||||
|
||||
|
|
@ -463,7 +525,7 @@ public:
|
|||
RsGlobal.height = size.iHeight;
|
||||
|
||||
EGLint attribs[] = {
|
||||
EGL_BUFFER_SIZE, 24,
|
||||
EGL_BUFFER_SIZE, 16,
|
||||
EGL_DEPTH_SIZE, 16,
|
||||
EGL_STENCIL_SIZE, 0,
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
|
|
@ -521,10 +583,11 @@ public:
|
|||
ControlsManager.MakeControllerActionsBlank();
|
||||
ControlsManager.InitDefaultControlConfiguration();
|
||||
|
||||
RwInitialised = FALSE;
|
||||
if(RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR) return;
|
||||
|
||||
CPad::GetPad(0)->Clear(true);
|
||||
CPad::GetPad(1)->Clear(true);
|
||||
|
||||
RwInitialised = TRUE;
|
||||
psPostRWinit();
|
||||
|
||||
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
|
||||
RsGlobal.ps = &PsGlobal;
|
||||
|
|
@ -694,7 +757,7 @@ public:
|
|||
}
|
||||
|
||||
void HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination) {
|
||||
if (!IsForegroundApp() || iAppUi->IsDisplayingDialog()) return;
|
||||
if (!ForegroundApp || iAppUi->IsDisplayingDialog()) return;
|
||||
switch (aEvent.Type()) {
|
||||
case EEventKeyDown:
|
||||
case EEventKeyUp: {
|
||||
|
|
@ -720,7 +783,7 @@ public:
|
|||
AddToStackL(iContainer);
|
||||
}
|
||||
void HandleForegroundEventL(TBool aForeground) {
|
||||
foreground = aForeground;
|
||||
ForegroundApp = aForeground;
|
||||
}
|
||||
|
||||
~RE3AppUi() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue