mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +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
1
TODO.md
1
TODO.md
|
|
@ -11,6 +11,7 @@ Common:
|
||||||
- [ ] Menu
|
- [ ] Menu
|
||||||
- [ ] Config
|
- [ ] Config
|
||||||
- [x] Merge S60v3 and ^3 branches
|
- [x] Merge S60v3 and ^3 branches
|
||||||
|
- [ ] Move map to top left corner
|
||||||
|
|
||||||
GLES 2.0 specific:
|
GLES 2.0 specific:
|
||||||
- [x] Optimize to always run 10+ fps
|
- [x] Optimize to always run 10+ fps
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ ALWAYS_BUILD_AS_ARM
|
||||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
|
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
|
||||||
STDCPP
|
STDCPP
|
||||||
MACRO RW_GL3
|
MACRO RW_GL3
|
||||||
|
MACRO RW_OPENGL // because carbide is too stupid
|
||||||
#else
|
#else
|
||||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport
|
SYSTEMINCLUDE /epoc32/include/stdapis/stlport
|
||||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl
|
SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
|
||||||
#if defined __ARMCC_VERSION && !defined _DEBUG
|
#if defined __ARMCC_VERSION && !defined _DEBUG
|
||||||
#pragma O2
|
#pragma O2 // fixes crash
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32 CCullZones::NumCullZones;
|
int32 CCullZones::NumCullZones;
|
||||||
|
|
|
||||||
|
|
@ -1758,9 +1758,7 @@ Idle(void *arg)
|
||||||
if (gbShowTimebars)
|
if (gbShowTimebars)
|
||||||
tbDisplay();
|
tbDisplay();
|
||||||
|
|
||||||
tbStartTimer(0, "EndOfFrame");
|
|
||||||
DoRWStuffEndOfFrame();
|
DoRWStuffEndOfFrame();
|
||||||
tbEndTimer("EndOfFrame");
|
|
||||||
|
|
||||||
POP_MEMID(); // MEMID_RENDER
|
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");
|
": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
|
||||||
#else
|
#else
|
||||||
while(n--){
|
while(n--){
|
||||||
const RwV3d i = *in;
|
*out = mat * *in;
|
||||||
*out = mat * i;
|
|
||||||
in = (RwV3d*)((uint8*)in + stride);
|
in = (RwV3d*)((uint8*)in + stride);
|
||||||
out++;
|
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");
|
": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
|
||||||
#else
|
#else
|
||||||
while(n--){
|
while(n--){
|
||||||
const RwV3d i = *in;
|
*out = mat * *in;
|
||||||
*out = mat * i;
|
|
||||||
in++;
|
in++;
|
||||||
out++;
|
out++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ static EGLConfig eglConfig;
|
||||||
|
|
||||||
rw::EngineOpenParams openParams;
|
rw::EngineOpenParams openParams;
|
||||||
|
|
||||||
|
static RwBool ForegroundApp = TRUE;
|
||||||
|
static RwBool RwInitialised = FALSE;
|
||||||
|
|
||||||
const TUid KUidRE3 = {0xe0d67647};
|
const TUid KUidRE3 = {0xe0d67647};
|
||||||
|
|
||||||
#define JOY_A 0 // cross
|
#define JOY_A 0 // cross
|
||||||
|
|
@ -85,8 +88,6 @@ static uint32 cyclesPerMS;
|
||||||
|
|
||||||
static psGlobalType PsGlobal;
|
static psGlobalType PsGlobal;
|
||||||
|
|
||||||
static TBool foreground;
|
|
||||||
|
|
||||||
static bool spinning;
|
static bool spinning;
|
||||||
|
|
||||||
bool qwerty;
|
bool qwerty;
|
||||||
|
|
@ -101,7 +102,7 @@ const char* _psGetUserFilesFolder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleExit() {
|
void HandleExit() {
|
||||||
if (IsForegroundApp()) {
|
if (ForegroundApp) {
|
||||||
User::ResetInactivityTime();
|
User::ResetInactivityTime();
|
||||||
}
|
}
|
||||||
RThread thread;
|
RThread thread;
|
||||||
|
|
@ -124,9 +125,36 @@ RwChar** _psGetVideoModeList() {
|
||||||
return modes;
|
return modes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void psPostRWinit(void)
|
||||||
|
{
|
||||||
|
CPad::GetPad(0)->Clear(true);
|
||||||
|
CPad::GetPad(1)->Clear(true);
|
||||||
|
}
|
||||||
|
|
||||||
void _psSelectScreenVM(RwInt32 videoMode) {
|
void _psSelectScreenVM(RwInt32 videoMode) {
|
||||||
RwTexDictionarySetCurrent( nil );
|
RwTexDictionarySetCurrent( nil );
|
||||||
FrontEndMenuManager.UnloadTextures();
|
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();
|
FrontEndMenuManager.LoadAllTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -252,7 +280,7 @@ uint32 CTimer::GetCyclesPerMillisecond(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RwBool IsForegroundApp() {
|
RwBool IsForegroundApp() {
|
||||||
return foreground;
|
return ForegroundApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MapScanCode(TInt aScanCode, TInt aModifiers) {
|
static int MapScanCode(TInt aScanCode, TInt aModifiers) {
|
||||||
|
|
@ -354,10 +382,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spinning) return ETrue;
|
if (spinning) return ETrue;
|
||||||
|
RwInitialised = TRUE;
|
||||||
|
|
||||||
switch (container->gGameState) {
|
switch (container->gGameState) {
|
||||||
case GS_START_UP:
|
case GS_START_UP:
|
||||||
foreground = true;
|
|
||||||
if (HAL::Get(HAL::ENanoTickPeriod, tickPeriod) != KErrNone) {
|
if (HAL::Get(HAL::ENanoTickPeriod, tickPeriod) != KErrNone) {
|
||||||
User::Panic(_L("Could not init timer"), 0);
|
User::Panic(_L("Could not init timer"), 0);
|
||||||
}
|
}
|
||||||
|
|
@ -371,8 +399,8 @@ public:
|
||||||
RsGlobal.quit = TRUE;
|
RsGlobal.quit = TRUE;
|
||||||
return ETrue;
|
return ETrue;
|
||||||
}
|
}
|
||||||
// container->gGameState = GS_INIT_FRONTEND;
|
container->gGameState = GS_INIT_FRONTEND;
|
||||||
container->gGameState = GS_INIT_PLAYING_GAME;
|
// container->gGameState = GS_INIT_PLAYING_GAME;
|
||||||
break;
|
break;
|
||||||
case GS_INIT_FRONTEND:
|
case GS_INIT_FRONTEND:
|
||||||
LoadingScreen(nil, nil, "loadsc0");
|
LoadingScreen(nil, nil, "loadsc0");
|
||||||
|
|
@ -382,11 +410,10 @@ public:
|
||||||
CMenuManager::m_bStartUpFrontEndRequested = true;
|
CMenuManager::m_bStartUpFrontEndRequested = true;
|
||||||
|
|
||||||
container->gGameState = GS_FRONTEND;
|
container->gGameState = GS_FRONTEND;
|
||||||
|
|
||||||
// container->gGameState = GS_INIT_PLAYING_GAME;
|
// container->gGameState = GS_INIT_PLAYING_GAME;
|
||||||
break;
|
break;
|
||||||
case GS_FRONTEND:
|
case GS_FRONTEND:
|
||||||
if (!IsForegroundApp()) break;
|
if (!ForegroundApp) break;
|
||||||
RsEventHandler(rsFRONTENDIDLE, nil);
|
RsEventHandler(rsFRONTENDIDLE, nil);
|
||||||
if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bWantToLoad )
|
if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bWantToLoad )
|
||||||
{
|
{
|
||||||
|
|
@ -409,17 +436,52 @@ public:
|
||||||
TRACE("gGameState = GS_PLAYING_GAME;");
|
TRACE("gGameState = GS_PLAYING_GAME;");
|
||||||
break;
|
break;
|
||||||
case GS_PLAYING_GAME:
|
case GS_PLAYING_GAME:
|
||||||
if (!IsForegroundApp()) break;
|
if (!ForegroundApp) break;
|
||||||
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||||
// if ( RwInitialised )
|
if ( RwInitialised ) {
|
||||||
// {
|
|
||||||
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
||||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||||
// }
|
}
|
||||||
break;
|
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();
|
User::ResetInactivityTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -463,7 +525,7 @@ public:
|
||||||
RsGlobal.height = size.iHeight;
|
RsGlobal.height = size.iHeight;
|
||||||
|
|
||||||
EGLint attribs[] = {
|
EGLint attribs[] = {
|
||||||
EGL_BUFFER_SIZE, 24,
|
EGL_BUFFER_SIZE, 16,
|
||||||
EGL_DEPTH_SIZE, 16,
|
EGL_DEPTH_SIZE, 16,
|
||||||
EGL_STENCIL_SIZE, 0,
|
EGL_STENCIL_SIZE, 0,
|
||||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||||
|
|
@ -521,10 +583,11 @@ public:
|
||||||
ControlsManager.MakeControllerActionsBlank();
|
ControlsManager.MakeControllerActionsBlank();
|
||||||
ControlsManager.InitDefaultControlConfiguration();
|
ControlsManager.InitDefaultControlConfiguration();
|
||||||
|
|
||||||
|
RwInitialised = FALSE;
|
||||||
if(RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR) return;
|
if(RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR) return;
|
||||||
|
|
||||||
CPad::GetPad(0)->Clear(true);
|
RwInitialised = TRUE;
|
||||||
CPad::GetPad(1)->Clear(true);
|
psPostRWinit();
|
||||||
|
|
||||||
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
|
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
|
||||||
RsGlobal.ps = &PsGlobal;
|
RsGlobal.ps = &PsGlobal;
|
||||||
|
|
@ -694,7 +757,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination) {
|
void HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination) {
|
||||||
if (!IsForegroundApp() || iAppUi->IsDisplayingDialog()) return;
|
if (!ForegroundApp || iAppUi->IsDisplayingDialog()) return;
|
||||||
switch (aEvent.Type()) {
|
switch (aEvent.Type()) {
|
||||||
case EEventKeyDown:
|
case EEventKeyDown:
|
||||||
case EEventKeyUp: {
|
case EEventKeyUp: {
|
||||||
|
|
@ -720,7 +783,7 @@ public:
|
||||||
AddToStackL(iContainer);
|
AddToStackL(iContainer);
|
||||||
}
|
}
|
||||||
void HandleForegroundEventL(TBool aForeground) {
|
void HandleForegroundEventL(TBool aForeground) {
|
||||||
foreground = aForeground;
|
ForegroundApp = aForeground;
|
||||||
}
|
}
|
||||||
|
|
||||||
~RE3AppUi() {
|
~RE3AppUi() {
|
||||||
|
|
|
||||||
8
vendor/librw/src/gl/gl3raster.cpp
vendored
8
vendor/librw/src/gl/gl3raster.cpp
vendored
|
|
@ -139,10 +139,10 @@ rasterCreateTexture(Raster *raster)
|
||||||
|
|
||||||
glGenTextures(1, &natras->texid);
|
glGenTextures(1, &natras->texid);
|
||||||
uint32 prev = bindTexture(natras->texid);
|
uint32 prev = bindTexture(natras->texid);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, natras->internalFormat,
|
// glTexImage2D(GL_TEXTURE_2D, 0, natras->internalFormat,
|
||||||
// raster->width, raster->height,
|
//// raster->width, raster->height,
|
||||||
1,1,
|
// 1,1,
|
||||||
0, natras->format, natras->type, nil);
|
// 0, natras->format, natras->type, nil);
|
||||||
// TODO: allocate other levels...probably
|
// TODO: allocate other levels...probably
|
||||||
#ifndef __SYMBIAN32__
|
#ifndef __SYMBIAN32__
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, natras->numLevels-1);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, natras->numLevels-1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue