Merge pull request #1404 from shinovon/9

Symbian-specific fixes again
This commit is contained in:
UnknownShadow200 2025-07-29 20:10:00 +10:00 committed by GitHub
commit 92b899f5bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 63 additions and 27 deletions

View File

@ -42,6 +42,8 @@ typedef cc_uintptr GLpointer;
#define GL_TRIANGLES 0x0004 #define GL_TRIANGLES 0x0004
#define GL_QUADS 0x0007 #define GL_QUADS 0x0007
#define GL_ZERO 0
#define GL_ONE 1
#define GL_BLEND 0x0BE2 #define GL_BLEND 0x0BE2
#define GL_SRC_ALPHA 0x0302 #define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_ONE_MINUS_SRC_ALPHA 0x0303

View File

@ -616,6 +616,7 @@ typedef cc_uint8 cc_bool;
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL2 #define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL2
#else #else
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1 #define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
#define CC_DISABLE_ANIMATIONS
#endif #endif
#endif #endif
#endif #endif

View File

@ -25,6 +25,8 @@
#include "../misc/opengl/GL1Funcs.h" #include "../misc/opengl/GL1Funcs.h"
#if defined CC_BUILD_SYMBIAN #if defined CC_BUILD_SYMBIAN
#include "../misc/opengl/GL2Funcs.h" #include "../misc/opengl/GL2Funcs.h"
static cc_bool mbx;
#endif #endif
#if CC_BUILD_MAXSTACK <= (64 * 1024) #if CC_BUILD_MAXSTACK <= (64 * 1024)
@ -84,7 +86,9 @@ void Gfx_Create(void) {
#ifdef CC_BUILD_GL11_FALLBACK #ifdef CC_BUILD_GL11_FALLBACK
GLContext_GetAll(coreFuncs, Array_Elems(coreFuncs)); GLContext_GetAll(coreFuncs, Array_Elems(coreFuncs));
#endif #endif
#ifndef CC_BUILD_GLES
customMipmapsLevels = true; customMipmapsLevels = true;
#endif
Gfx.BackendType = CC_GFX_BACKEND_GL1; Gfx.BackendType = CC_GFX_BACKEND_GL1;
GL_InitCommon(); GL_InitCommon();
@ -335,6 +339,17 @@ static void SetAlphaTest(cc_bool enabled) {
void Gfx_DepthOnlyRendering(cc_bool depthOnly) { void Gfx_DepthOnlyRendering(cc_bool depthOnly) {
cc_bool enabled = !depthOnly; cc_bool enabled = !depthOnly;
#ifdef CC_BUILD_SYMBIAN
if (mbx) {
if (depthOnly) {
_glBlendFunc(GL_ZERO, GL_ONE);
Gfx_SetAlphaBlending(true);
} else {
_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
return;
}
#endif
SetColorWrite(enabled & gfx_colorMask[0], enabled & gfx_colorMask[1], SetColorWrite(enabled & gfx_colorMask[0], enabled & gfx_colorMask[1],
enabled & gfx_colorMask[2], enabled & gfx_colorMask[3]); enabled & gfx_colorMask[2], enabled & gfx_colorMask[3]);
@ -422,6 +437,18 @@ cc_bool Gfx_WarnIfNecessary(void) {
Gfx.Limitations |= GFX_LIMIT_VERTEX_ONLY_FOG; Gfx.Limitations |= GFX_LIMIT_VERTEX_ONLY_FOG;
return true; return true;
} }
#if defined CC_BUILD_SYMBIAN
if (String_ContainsConst(&renderer, "SGX")) {
} else if (String_ContainsConst(&renderer, "MBX")) {
Gfx.Limitations |= GFX_LIMIT_MINIMAL;
mbx = true;
} else if (!String_ContainsConst(&renderer, "HW")) {
Chat_AddRaw("&cSoftware rendering is being used, performance will greatly suffer.");
Gfx.Limitations |= GFX_LIMIT_MINIMAL;
return true;
}
#endif
return false; return false;
} }

View File

@ -485,35 +485,41 @@ void CCAppUi::HandleCommandL(TInt aCommand) {
// CCContainer implementation // CCContainer implementation
TInt CCContainer::LoopCallBack(TAny*) { TInt CCContainer::LoopCallBack(TAny*) {
cc_bool run = false;
for (;;) {
if (!WindowInfo.Exists) { if (!WindowInfo.Exists) {
Window_RequestClose(); Window_RequestClose();
container->iAppUi->Exit(); container->iAppUi->Exit();
return EFalse; return EFalse;
} }
// launcher -> game -> launcher -> ... loop if (run) {
launcher: run = false;
if (!gameRunning) { ProcessProgramArgs(0, 0);
if (Launcher_Tick()) {
return ETrue;
}
Launcher_Finish();
// run game
gameRunning = true;
Game_Setup(); Game_Setup();
gameRunning = true;
container->RestartTimerL(100); container->RestartTimerL(100);
} }
if (!gameRunning) {
if (Launcher_Tick()) break;
Launcher_Finish();
run = true;
continue;
}
if (!Game_Running) { if (!Game_Running) {
// return to launcher
gameRunning = false; gameRunning = false;
Game_Free(); Game_Free();
Launcher_Setup(); // Launcher_Setup();
container->RestartTimerL(10000); // container->RestartTimerL(10000);
goto launcher; WindowInfo.Exists = false;
continue;
} }
Game_RenderFrame(); Game_RenderFrame();
break;
}
return ETrue; return ETrue;
} }