From 301498e09e4e3d827aeb8f7e96fe9d4e6cab6741 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 07:54:38 +0500 Subject: [PATCH 01/24] Use ram pointers instead of vbo in gl1immed --- src/skel/symbian/symbian.cpp | 1 + vendor/librw/src/gles1/gl1immed.cpp | 78 ++++++++++++----------------- 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 3cf05b7..3a3048b 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -334,6 +334,7 @@ static int MapScanCode(TInt aScanCode, TInt aModifiers) { case 'z': case 'Z': case '1': + case EStdKeyDevice3: return JOY_B; case 'x': case 'X': diff --git a/vendor/librw/src/gles1/gl1immed.cpp b/vendor/librw/src/gles1/gl1immed.cpp index d9f7260..b071e1b 100644 --- a/vendor/librw/src/gles1/gl1immed.cpp +++ b/vendor/librw/src/gles1/gl1immed.cpp @@ -17,8 +17,6 @@ namespace rw { namespace gles1 { -uint32 im2DVbo, im2DIbo; - static int primTypeMap[] = { GL_POINTS, // invalid GL_LINES, @@ -32,15 +30,11 @@ static int primTypeMap[] = { void openIm2D(void) { - glGenBuffers(1, &im2DIbo); - glGenBuffers(1, &im2DVbo); } void closeIm2D(void) { - glDeleteBuffers(1, &im2DIbo); - glDeleteBuffers(1, &im2DVbo); } static Im2DVertex tmpprimbuf[3]; @@ -70,15 +64,16 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices) Camera *cam; cam = (Camera*)engine->currentCamera; - glBindBuffer(GL_ARRAY_BUFFER, im2DVbo); - glBufferData(GL_ARRAY_BUFFER, numVertices*sizeof(Im2DVertex), vertices, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(Im2DVertex), (void*)0); + glVertexPointer(3, GL_FLOAT, sizeof(Im2DVertex), vertices); + glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im2DVertex), (void*)OFFSET_OF(Im2DVertex, r)); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im2DVertex), (void*)((uint8*)vertices + OFFSET_OF(Im2DVertex, r))); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(Im2DVertex), (void*)OFFSET_OF(Im2DVertex, u)); + glTexCoordPointer(2, GL_FLOAT, sizeof(Im2DVertex), (void*)((uint8*)vertices + OFFSET_OF(Im2DVertex, u))); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -110,18 +105,17 @@ void im2DRenderIndexedPrimitive(PrimitiveType primType, Camera *cam; cam = (Camera*)engine->currentCamera; - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, im2DIbo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, numIndices*2, indices, GL_DYNAMIC_DRAW); - - glBindBuffer(GL_ARRAY_BUFFER, im2DVbo); - glBufferData(GL_ARRAY_BUFFER, numVertices*sizeof(Im2DVertex), vertices, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(Im2DVertex), (void*)0); + glVertexPointer(3, GL_FLOAT, sizeof(Im2DVertex), vertices); + glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im2DVertex), (void*)OFFSET_OF(Im2DVertex, r)); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im2DVertex), (void*)((uint8*)vertices + OFFSET_OF(Im2DVertex, r))); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(Im2DVertex), (void*)OFFSET_OF(Im2DVertex, u)); + glTexCoordPointer(2, GL_FLOAT, sizeof(Im2DVertex), (void*)((uint8*)vertices + OFFSET_OF(Im2DVertex, u))); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -133,7 +127,7 @@ void im2DRenderIndexedPrimitive(PrimitiveType primType, glLoadIdentity(); flushCache(); - glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, nil); + glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); glMatrixMode(GL_PROJECTION); glPopMatrix(); @@ -147,30 +141,17 @@ void im2DRenderIndexedPrimitive(PrimitiveType primType, // Im3D -static AttribDesc im3dattribDesc[3] = { - { ATTRIB_POS, GL_FLOAT, GL_FALSE, 3, - sizeof(Im3DVertex), 0 }, - { ATTRIB_COLOR, GL_UNSIGNED_BYTE, GL_TRUE, 4, - sizeof(Im3DVertex), OFFSET_OF(Im3DVertex, r) }, - { ATTRIB_TEXCOORDS0, GL_FLOAT, GL_FALSE, 2, - sizeof(Im3DVertex), OFFSET_OF(Im3DVertex, u) }, -}; -static uint32 im3DVbo, im3DIbo; -static int32 num3DVertices; // not actually needed here +static int32 num3DVertices; static void* currentIm3dVertices; void openIm3D(void) { - glGenBuffers(1, &im3DIbo); - glGenBuffers(1, &im3DVbo); } void closeIm3D(void) { - glDeleteBuffers(1, &im3DIbo); - glDeleteBuffers(1, &im3DVbo); } void @@ -186,21 +167,23 @@ im3DTransform(void *vertices, int32 numVertices, Matrix *world, uint32 flags) if((flags & im3d::VERTEXUV) == 0) SetRenderStatePtr(TEXTURERASTER, nil); - glBindBuffer(GL_ARRAY_BUFFER, im3DVbo); - glBufferData(GL_ARRAY_BUFFER, numVertices*sizeof(Im3DVertex), vertices, GL_DYNAMIC_DRAW); + currentIm3dVertices = vertices; num3DVertices = numVertices; } void im3DRenderPrimitive(PrimitiveType primType) { - glBindBuffer(GL_ARRAY_BUFFER, im3DVbo); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(Im3DVertex), (void*)0); + glVertexPointer(3, GL_FLOAT, sizeof(Im3DVertex), currentIm3dVertices); + glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im3DVertex), (void*)OFFSET_OF(Im3DVertex, r)); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im3DVertex), (void*)((uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r))); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(Im3DVertex), (void*)OFFSET_OF(Im3DVertex, u)); + glTexCoordPointer(2, GL_FLOAT, sizeof(Im3DVertex), (void*)((uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u))); flushCache(); glDrawArrays(primTypeMap[primType], 0, num3DVertices); @@ -213,19 +196,20 @@ im3DRenderPrimitive(PrimitiveType primType) void im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndices) { - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, im3DIbo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, numIndices*2, indices, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBuffer(GL_ARRAY_BUFFER, im3DVbo); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(Im3DVertex), (void*)0); + glVertexPointer(3, GL_FLOAT, sizeof(Im3DVertex), currentIm3dVertices); + glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im3DVertex), (void*)OFFSET_OF(Im3DVertex, r)); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Im3DVertex), (void*)((uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r))); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(Im3DVertex), (void*)OFFSET_OF(Im3DVertex, u)); + glTexCoordPointer(2, GL_FLOAT, sizeof(Im3DVertex), (void*)((uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u))); flushCache(); - glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, nil); + glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); From 00eb422ee4b000b542cbc4ff4a66c8ea32279c06 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 08:22:22 +0500 Subject: [PATCH 02/24] Update todo --- TODO.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 26cc810..a36f688 100644 --- a/TODO.md +++ b/TODO.md @@ -3,15 +3,15 @@ Common: - [x] Window implementation - [x] Fix shader compilation - [x] Downscale textures -- [ ] Simplify geometry - [x] Touch controls - [x] Keyboard controls -- [ ] Audio? - [x] Menu - [x] Config - [x] Merge S60v3 and ^3 branches +- [ ] Simplify geometry - [ ] Move map to top left corner - [ ] Do something with sprites, they're still taking too much frame time +- [ ] Audio? GLES 2.0 specific: - [x] Optimize to always run 10+ fps @@ -23,7 +23,7 @@ GLES 2.0 specific: GLES 1.1 specific: - [x] Backport to STLport v4 - [x] GLES 1.1 engine -- [ ] Keyboard mappings for both QWERTY/12-keys +- [x] Keyboard mappings for both QWERTY/12-keys - [ ] Use pvrtc compression Issues: From 52b026b6890080941818e5339f5866a411b64c11 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 19:00:54 +0500 Subject: [PATCH 03/24] Add L3 and R3 --- src/renderer/Hud.cpp | 6 ++++++ src/skel/symbian/symbian.cpp | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/renderer/Hud.cpp b/src/renderer/Hud.cpp index dacec8b..51aec58 100644 --- a/src/renderer/Hud.cpp +++ b/src/renderer/Hud.cpp @@ -1355,6 +1355,12 @@ void CHud::DrawAfterFade() CSprite2d::DrawRect(CRECT(320 + 20, 286 + y, 60, 20), CRGBA(0, 0, 0, 128)); PRINT("start", 320 + 20, 290 + y, 60); + // l3, r3 + CSprite2d::DrawRect(CRECT(320 - 80, 254 + y, 60, 20), CRGBA(0, 0, 0, 128)); + PRINT("L3", 320 - 80, 258 + y, 60); + CSprite2d::DrawRect(CRECT(320 + 20, 254 + y, 60, 20), CRGBA(0, 0, 0, 128)); + PRINT("R3", 320 + 20, 258 + y, 60); + // dpad CSprite2d::DrawRect(CRECT(0, 80 + y, w / 4, 120), CRGBA(0, 0, 0, 128)); PRINT("/\\", w / 8 - 15, 90 + y, 30); diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 3a3048b..8bc0585 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -71,6 +71,8 @@ const TUid KUidRE3 = {0xe0d67647}; #define JOY_L2 6 #define JOY_R2 7 #define JOY_BACK 8 +#define JOY_L3 9 +#define JOY_R3 10 #define JOY_START 11 #define JOY_DPAD_UP 12 #define JOY_DPAD_RIGHT 13 @@ -357,6 +359,10 @@ static int MapScanCode(TInt aScanCode, TInt aModifiers) { return JOY_L2; case '8': return JOY_R2; + case '9': + return JOY_L3; + case '0': + return JOY_R3; case EStdKeyDevice0: return JOY_BACK; @@ -411,7 +417,6 @@ public: CMenuManager::m_bStartUpFrontEndRequested = true; container->gGameState = GS_FRONTEND; -// container->gGameState = GS_INIT_PLAYING_GAME; break; case GS_FRONTEND: if (!ForegroundApp) break; @@ -616,7 +621,7 @@ public: int w = Size().iWidth; int h = Size().iHeight; - if (h > 360) y += h - 360; + if (h > 360) y += (h * 360) / 480; // if (FrontEndMenuManager.m_bMenuActive) { // PSGLOBAL(lastMousePos).x = x; @@ -677,7 +682,7 @@ public: stickCenterX[i] = x; stickCenterY[i] = y; } - } else if (y >= 280 && y <= 280 + 32) { + } else if (y > 280 && y < 280 + 32) { if (x > 320 - 80 && x < 320 - 20) { // select activeZone[i] = JOY_BACK + 1; @@ -687,6 +692,14 @@ public: activeZone[i] = JOY_START + 1; virtualButtons[JOY_START] = 1; } + } else if (y > 280 - 32 && y < 280) { + if (x > 320 - 80 && x < 320 - 20) { + activeZone[i] = JOY_L3 + 1; + virtualButtons[JOY_L3] = 1; + } else if (x > 320 + 20 && x < 320 + 80) { + activeZone[i] = JOY_R3 + 1; + virtualButtons[JOY_R3] = 1; + } } else if (y >= 80 && y <= 80 + 120) { if (x < w / 4) { // dpad From 9ae42063f80132fdcdd731752155e81211535825 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 19:18:31 +0500 Subject: [PATCH 04/24] Hide controller hud on keyboard presses --- src/skel/symbian/symbian.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 8bc0585..a413b70 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -616,6 +616,7 @@ public: } virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent) { + touch = true; int x = aPointerEvent.iPosition.iX; int y = aPointerEvent.iPosition.iY; int w = Size().iWidth; @@ -777,6 +778,7 @@ public: case EEventKeyUp: { TInt k = MapScanCode(aEvent.Key()->iScanCode, aEvent.Key()->iModifiers); if (k == -1) break; + touch = false; virtualButtons[k] = aEvent.Type() == EEventKeyDown; break; } From b1eaa2fcdf40834192bdbdea3bb640010e1f6f5e Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 19:34:24 +0500 Subject: [PATCH 05/24] Fix --- src/skel/symbian/symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index a413b70..7631727 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -622,7 +622,7 @@ public: int w = Size().iWidth; int h = Size().iHeight; - if (h > 360) y += (h * 360) / 480; + if (h > 360) y = (y * 360) / 480; // if (FrontEndMenuManager.m_bMenuActive) { // PSGLOBAL(lastMousePos).x = x; From 3899270fa3ce0223d2f987b2b07ad861fe601517 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 19:53:01 +0500 Subject: [PATCH 06/24] some --- src/renderer/Hud.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/Hud.cpp b/src/renderer/Hud.cpp index 51aec58..7b9e0dd 100644 --- a/src/renderer/Hud.cpp +++ b/src/renderer/Hud.cpp @@ -1363,17 +1363,17 @@ void CHud::DrawAfterFade() // dpad CSprite2d::DrawRect(CRECT(0, 80 + y, w / 4, 120), CRGBA(0, 0, 0, 128)); - PRINT("/\\", w / 8 - 15, 90 + y, 30); + PRINT("\"", w / 8 - 15, 90 + y, 30); PRINT("v", w / 8 - 15, 160 + y, 30); PRINT("<", w / 8 - 60, 125 + y, 30); PRINT(">", w / 8 + 30, 125 + y, 30); // abxy CSprite2d::DrawRect(CRECT(w - w / 4, 80 + y, w / 4, 120), CRGBA(0, 0, 0, 128)); - PRINT("/\\", w - w / 8 - 15, 90 + y, 30); + PRINT("\"", w - w / 8 - 15, 90 + y, 30); PRINT("X", w - w / 8 - 15, 160 + y, 30); PRINT("[]", w - w / 8 - 60, 125 + y, 30); - PRINT("O", w - w / 8 + 30, 125 + y, 30); + PRINT("|", w - w / 8 + 30, 125 + y, 30); #undef PRINT #undef CRECT } From 1247cd5013c48b38eaf789ae2749640c6b21c6f6 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 20:00:16 +0500 Subject: [PATCH 07/24] Enable classic control by default --- src/core/Frontend.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 8faa6c2..db481f2 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -5140,6 +5140,9 @@ CMenuManager::ProcessButtonPresses(void) ControlsManager.MakeControllerActionsBlank(); ControlsManager.InitDefaultControlConfiguration(); ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp()); +#if defined __SYMBIAN32__ + m_ControlMethod = CONTROL_CLASSIC; +#else #if !defined RW_GL3 && !defined RW_GLES1 if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) { DIDEVCAPS devCaps; @@ -5147,8 +5150,6 @@ CMenuManager::ProcessButtonPresses(void) PSGLOBAL(joy1)->GetCapabilities(&devCaps); ControlsManager.InitDefaultControlConfigJoyPad(devCaps.dwButtons); } -#elif defined __SYMBIAN32__ - // TODO #else if (PSGLOBAL(joy1id) != -1 && glfwJoystickPresent(PSGLOBAL(joy1id))) { int count; @@ -5157,6 +5158,7 @@ CMenuManager::ProcessButtonPresses(void) } #endif m_ControlMethod = CONTROL_STANDARD; +#endif #ifdef FIX_BUGS MousePointerStateHelper.bInvertVertically = true; TheCamera.m_fMouseAccelVertical = 0.003f; From 11a958b643f3a8de723795dbdec8c48d63bd4f39 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 7 May 2026 20:26:36 +0500 Subject: [PATCH 08/24] Resize handler --- src/skel/symbian/symbian.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 7631727..61716d3 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -786,6 +786,14 @@ public: break; } } + + void HandleResourceChange(TInt aType) { + switch (aType) { + case KEikDynamicLayoutVariantSwitch: + SetExtentToWholeScreen(); + break; + } + } }; class RE3AppUi : public CAknAppUi { From 8092ab707f6465aad6a85d1834383f5daad3cce8 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 03:07:20 +0500 Subject: [PATCH 09/24] Update todo --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index a36f688..f6be93c 100644 --- a/TODO.md +++ b/TODO.md @@ -19,6 +19,7 @@ GLES 2.0 specific: - [ ] Optimize to always run 20+ fps - [ ] Use etc1 compression - [ ] Fix face animations in optimized builds +- [ ] Skinning shader is still broken on VC4 GLES 1.1 specific: - [x] Backport to STLport v4 From e9250933232618e4d2a9f84551003dfadb996762 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 03:09:05 +0500 Subject: [PATCH 10/24] Update todo --- TODO.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index f6be93c..5aa16dd 100644 --- a/TODO.md +++ b/TODO.md @@ -11,7 +11,7 @@ Common: - [ ] Simplify geometry - [ ] Move map to top left corner - [ ] Do something with sprites, they're still taking too much frame time -- [ ] Audio? +- [ ] Audio GLES 2.0 specific: - [x] Optimize to always run 10+ fps @@ -26,6 +26,7 @@ GLES 1.1 specific: - [x] GLES 1.1 engine - [x] Keyboard mappings for both QWERTY/12-keys - [ ] Use pvrtc compression +- [ ] Optimize to always run 10+ fps Issues: - [x] Fix crash in Texture::destroy on exit From aa1ca0e884d203355fd6a91ab30266150e64ce43 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 03:19:48 +0500 Subject: [PATCH 11/24] Add more key mappings --- src/skel/symbian/symbian.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 61716d3..e0ad7bc 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -337,6 +337,8 @@ static int MapScanCode(TInt aScanCode, TInt aModifiers) { case 'Z': case '1': case EStdKeyDevice3: + case EStdKeyEnter: + case EStdKeyNkpEnter: return JOY_B; case 'x': case 'X': @@ -349,6 +351,7 @@ static int MapScanCode(TInt aScanCode, TInt aModifiers) { case 's': case 'S': case '3': + case EStdKeyBackspace: return JOY_Y; case '5': From 48cb957c035e3f13b07e3e44e2f0860a31369363 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 03:54:20 +0500 Subject: [PATCH 12/24] Update todo --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index 5aa16dd..11a6b91 100644 --- a/TODO.md +++ b/TODO.md @@ -20,6 +20,7 @@ GLES 2.0 specific: - [ ] Use etc1 compression - [ ] Fix face animations in optimized builds - [ ] Skinning shader is still broken on VC4 +- [ ] Disappearing background in cutscenes GLES 1.1 specific: - [x] Backport to STLport v4 From e392f442b629abd0903f43af6c353b7fcfac116a Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 05:24:57 +0500 Subject: [PATCH 13/24] Fix --- group/bld.inf | 1 + group/common.mmh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/group/bld.inf b/group/bld.inf index bcb0a2f..93771b3 100644 --- a/group/bld.inf +++ b/group/bld.inf @@ -2,6 +2,7 @@ PRJ_PLATFORMS DEFAULT ARMV6 PRJ_MMPFILES +gnumakefile Icons_scalable_dc.mk gnumakefile shaders.mk librw_gles2.mmp re3_gles2.mmp diff --git a/group/common.mmh b/group/common.mmh index 3c7bbaf..4f5ec61 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -18,7 +18,7 @@ SRCDBG OPTION ARMCC --gnu -Otime --diag_suppress 1,68,111,174,381,1293 OPTION_REPLACE ARMCC --cpu 6 OPTION_REPLACE ARMCC --fpu softvfp+vfpv2 --fpmode fast -OPTION_REPLACE ARMCC -O2 -O3 // too dangerous! +OPTION_REPLACE ARMCC -O2 -O3 #ifdef ARMCC ALWAYS_BUILD_AS_ARM #endif @@ -27,7 +27,7 @@ ALWAYS_BUILD_AS_ARM SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 STDCPP MACRO RW_GL3 -MACRO RW_OPENGL // because carbide is too stupid +MACRO RW_OPENGL #else SYSTEMINCLUDE /epoc32/include/stdapis/stlport SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl From 85d6e68889f5b7e8df21546a81e127af26c2ef6f Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 05:59:16 +0500 Subject: [PATCH 14/24] Try to fix compilation --- group/common.mmh | 2 +- src/core/ZoneCull.cpp | 3 ++- src/math/math.cpp | 10 ++++++++++ src/peds/PlayerPed.cpp | 3 ++- src/skel/symbian/symbian.cpp | 7 +++---- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/group/common.mmh b/group/common.mmh index 4f5ec61..a72793f 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -32,5 +32,5 @@ MACRO RW_OPENGL SYSTEMINCLUDE /epoc32/include/stdapis/stlport SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl MACRO RW_GLES1 -MACRO S60V5 +MACRO S60V3 #endif diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp index 03b399d..56192ea 100644 --- a/src/core/ZoneCull.cpp +++ b/src/core/ZoneCull.cpp @@ -16,7 +16,8 @@ #include "Renderer.h" #if defined __ARMCC_VERSION && !defined _DEBUG -#pragma O2 // fixes crash +// fixes crash +#pragma O2 #endif int32 CCullZones::NumCullZones; diff --git a/src/math/math.cpp b/src/math/math.cpp index 8cb56da..ff86039 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -80,7 +80,12 @@ 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--){ +#ifdef S60V3 + const RwV3d i = *in; + *out = mat * i; +#else *out = mat * *in; +#endif in = (RwV3d*)((uint8*)in + stride); out++; } @@ -110,7 +115,12 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector ": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory"); #else while(n--){ +#ifdef S60V3 + const RwV3d i = *in; + *out = mat * i; +#else *out = mat * *in; +#endif in++; out++; } diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 4876f79..e44a208 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1,5 +1,6 @@ #if defined __ARMCC_VERSION && !defined _DEBUG -#pragma O2 // fixes crash +// fixes crash +#pragma O2 #endif #include "common.h" diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index e0ad7bc..0d8a0f5 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -445,10 +445,9 @@ public: TRACE("gGameState = GS_PLAYING_GAME;"); break; case GS_PLAYING_GAME: - if (!ForegroundApp) break; - float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond(); - if ( RwInitialised ) { - if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms) +// float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond(); + if (RwInitialised && ForegroundApp) { +// if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms) RsEventHandler(rsIDLE, (void *)TRUE); } break; From baa6d4e1c21583a7e5c8d4c3aec6653adf2c3fac Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 06:09:41 +0500 Subject: [PATCH 15/24] something --- src/core/timebars.cpp | 3 --- vendor/librw/src/gl/gl3immed.cpp | 32 -------------------------------- vendor/librw/src/rwbase.h | 6 ++---- 3 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/core/timebars.cpp b/src/core/timebars.cpp index c0621f8..8f01fe0 100644 --- a/src/core/timebars.cpp +++ b/src/core/timebars.cpp @@ -84,9 +84,6 @@ void tbEndTimer(Const char* name) } assert(n != 1500); TimerBar.Timers[n].endTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerFrame(); - if (strcmp(name, "EndOfFrame")) { - endOfFrameTime = TimerBar.Timers[n].endTime - TimerBar.Timers[n].startTime; - } } float Diag_GetFPS() diff --git a/vendor/librw/src/gl/gl3immed.cpp b/vendor/librw/src/gl/gl3immed.cpp index a4b7474..1619f23 100644 --- a/vendor/librw/src/gl/gl3immed.cpp +++ b/vendor/librw/src/gl/gl3immed.cpp @@ -113,18 +113,10 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices) glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0); glEnableVertexAttribArray(ATTRIB_COLOR); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r)); - #else - glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, r)); - #endif glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u)); - #else - glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, u)); - #endif glDrawArrays(primTypeMap[primType], 0, numVertices); @@ -154,18 +146,10 @@ im2DRenderIndexedPrimitive(PrimitiveType primType, glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0); glEnableVertexAttribArray(ATTRIB_COLOR); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r)); - #else - glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, r)); - #endif glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u)); - #else - glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, u)); - #endif glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); @@ -232,18 +216,10 @@ im3DRenderPrimitive(PrimitiveType primType) glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0); glEnableVertexAttribArray(ATTRIB_COLOR); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r)); - #else - glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, r)); - #endif glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u)); - #else - glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, u)); - #endif glDrawArrays(primTypeMap[primType], 0, num3DVertices); @@ -264,18 +240,10 @@ im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndic glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0); glEnableVertexAttribArray(ATTRIB_COLOR); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r)); - #else - glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, r)); - #endif glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); - #ifdef __SYMBIAN32__ glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u)); - #else - glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, u)); - #endif glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); diff --git a/vendor/librw/src/rwbase.h b/vendor/librw/src/rwbase.h index 87a6f33..9a8f660 100644 --- a/vendor/librw/src/rwbase.h +++ b/vendor/librw/src/rwbase.h @@ -11,14 +11,12 @@ #ifdef __SYMBIAN32__ #undef stderr #define stderr stdout +#endif #ifdef OFFSET_OF #undef OFFSET_OF #endif - -#define OFFSET_OF(type, member) \ - ((size_t)((char*)&(((type*)0)->member) - (char*)0)) -#endif +#define OFFSET_OF(type, member) ((size_t)&(((type*)0)->member)) // TODO: clean up the opengl defines // and figure out what we even want here... From e81dbee77a5724d215788726352f3b2515d56b36 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 20:36:41 +0500 Subject: [PATCH 16/24] Enable bullet traces --- src/core/Frontend.cpp | 4 +++- src/core/config.h | 2 +- src/renderer/SpecialFX.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index db481f2..e27ebcf 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3689,6 +3689,7 @@ const char* controllerTypesPaths[] = { void CMenuManager::LoadController(int8 type) { +#ifdef BUTTON_ICONS switch (type) { case CONTROLLER_DUALSHOCK2: @@ -3703,7 +3704,8 @@ CMenuManager::LoadController(int8 type) CFont::LoadButtons("MODELS/X360BTNS.TXD"); break; } - +#endif + // Unload current textures for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++) m_aFrontEndSprites[i].Delete(); diff --git a/src/core/config.h b/src/core/config.h index b7baed8..56a689e 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -342,7 +342,7 @@ enum Config { #define ALT_DODO_CHEAT #define REGISTER_START_BUTTON #define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls -#define BUTTON_ICONS // use textures to show controller buttons +//#define BUTTON_ICONS // use textures to show controller buttons // Hud, frontend and radar //#define PS2_HUD diff --git a/src/renderer/SpecialFX.cpp b/src/renderer/SpecialFX.cpp index 485a404..4f4e4a0 100644 --- a/src/renderer/SpecialFX.cpp +++ b/src/renderer/SpecialFX.cpp @@ -138,7 +138,7 @@ CSpecialFX::Render(void) { PUSH_RENDERGROUP("CSpecialFX::Render"); // CMotionBlurStreaks::Render(); -// CBulletTraces::Render(); + CBulletTraces::Render(); // CBrightLights::Render(); // CShinyTexts::Render(); CMoneyMessages::Render(); From 0d9599fd52fcacb9b7fcc1ebdd756e349042e3c6 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 8 May 2026 20:46:20 +0500 Subject: [PATCH 17/24] Use vfpv2 instead of softvfp+vfpv2 --- group/common.mmh | 2 +- group/re3_gles2.mmp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/group/common.mmh b/group/common.mmh index a72793f..1b4576d 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -17,7 +17,7 @@ SRCDBG OPTION ARMCC --gnu -Otime --diag_suppress 1,68,111,174,381,1293 OPTION_REPLACE ARMCC --cpu 6 -OPTION_REPLACE ARMCC --fpu softvfp+vfpv2 --fpmode fast +OPTION_REPLACE ARMCC --fpu vfpv2 --fpmode fast OPTION_REPLACE ARMCC -O2 -O3 #ifdef ARMCC ALWAYS_BUILD_AS_ARM diff --git a/group/re3_gles2.mmp b/group/re3_gles2.mmp index b440269..90187ca 100644 --- a/group/re3_gles2.mmp +++ b/group/re3_gles2.mmp @@ -6,5 +6,6 @@ LIBRARY libglesv2.lib LIBRARY libegl.lib LIBRARY platformver.lib STATICLIBRARY librw_gles2.lib -ARMFPU softvfp+vfpv2 +ARMFPU vfpv2 +SMPSAFE #include "re3.mmh" \ No newline at end of file From 5f33056f5ab2a0a9447aaed5cc6fa89057503bdd Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 04:06:58 +0500 Subject: [PATCH 18/24] Fix build config --- group/common.mmh | 2 +- group/librw_gles1.mmp | 4 ++-- group/librw_gles2.mmp | 4 ++-- group/re3_gles1.mmp | 4 ++-- group/re3_gles2.mmp | 4 ++-- src/skel/symbian/symbian.cpp | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/group/common.mmh b/group/common.mmh index 1b4576d..2f816b1 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -23,7 +23,7 @@ OPTION_REPLACE ARMCC -O2 -O3 ALWAYS_BUILD_AS_ARM #endif -#ifdef SYMBIAN_3 +#ifdef __SYMBIAN_3 SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 STDCPP MACRO RW_GL3 diff --git a/group/librw_gles1.mmp b/group/librw_gles1.mmp index 0ed82e4..1564461 100644 --- a/group/librw_gles1.mmp +++ b/group/librw_gles1.mmp @@ -1,4 +1,4 @@ -#undef SYMBIAN3 -#define S60V3 +#undef __SYMBIAN3 +#define __S60V3 TARGET librw_gles1.lib #include "librw.mmh" \ No newline at end of file diff --git a/group/librw_gles2.mmp b/group/librw_gles2.mmp index b161ff5..0f854c5 100644 --- a/group/librw_gles2.mmp +++ b/group/librw_gles2.mmp @@ -1,4 +1,4 @@ -#undef S60V3 -#define SYMBIAN_3 +#undef __S60V3 +#define __SYMBIAN_3 TARGET librw_gles2.lib #include "librw.mmh" \ No newline at end of file diff --git a/group/re3_gles1.mmp b/group/re3_gles1.mmp index 79ed835..713d46e 100644 --- a/group/re3_gles1.mmp +++ b/group/re3_gles1.mmp @@ -1,5 +1,5 @@ -#undef SYMBIAN_3 -#define S60V3 +#undef __SYMBIAN_3 +#define __S60V3 //TARGET re3_gles1.exe TARGET re3_gles1.exe LIBRARY libstdcpp.lib diff --git a/group/re3_gles2.mmp b/group/re3_gles2.mmp index 90187ca..ae7782a 100644 --- a/group/re3_gles2.mmp +++ b/group/re3_gles2.mmp @@ -1,5 +1,5 @@ -#undef S60V3 -#define SYMBIAN_3 +#undef __S60V3 +#define __SYMBIAN_3 TARGET re3.exe LIBRARY libstdcppv5.lib LIBRARY libglesv2.lib diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index 0d8a0f5..3c9588e 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -515,13 +515,13 @@ public: SetFocus(ETrue); -#ifdef RW_GL3 +#ifndef S60V3 Window().EnableAdvancedPointers(); #endif EnableDragEvents(); ActivateL(); -#ifdef RW_GL3 +#ifndef S60V3 // VC4 check VersionInfo::TPlatformVersion platformVersion; VersionInfo::GetVersion(platformVersion); @@ -640,7 +640,7 @@ public: // CCoeControl::HandlePointerEventL(aPointerEvent); // return; // } -#ifdef RW_GL3 +#ifndef S60V3 const TAdvancedPointerEvent* advpointer = aPointerEvent.AdvancedPointerEvent(); int i = advpointer != NULL ? advpointer->PointerNumber() : 0; #else From 124ea7befd49d64427a784e3cb43bafbc935e654 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 04:15:27 +0500 Subject: [PATCH 19/24] something --- group/common.mmh | 2 +- group/librw_gles1.mmp | 3 +-- group/librw_gles2.mmp | 3 +-- group/re3_gles1.mmp | 3 +-- group/re3_gles2.mmp | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/group/common.mmh b/group/common.mmh index 2f816b1..1b4576d 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -23,7 +23,7 @@ OPTION_REPLACE ARMCC -O2 -O3 ALWAYS_BUILD_AS_ARM #endif -#ifdef __SYMBIAN_3 +#ifdef SYMBIAN_3 SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 STDCPP MACRO RW_GL3 diff --git a/group/librw_gles1.mmp b/group/librw_gles1.mmp index 1564461..4d2e805 100644 --- a/group/librw_gles1.mmp +++ b/group/librw_gles1.mmp @@ -1,4 +1,3 @@ -#undef __SYMBIAN3 -#define __S60V3 +#undef SYMBIAN3 TARGET librw_gles1.lib #include "librw.mmh" \ No newline at end of file diff --git a/group/librw_gles2.mmp b/group/librw_gles2.mmp index 0f854c5..d33a32e 100644 --- a/group/librw_gles2.mmp +++ b/group/librw_gles2.mmp @@ -1,4 +1,3 @@ -#undef __S60V3 -#define __SYMBIAN_3 +#define SYMBIAN_3 TARGET librw_gles2.lib #include "librw.mmh" \ No newline at end of file diff --git a/group/re3_gles1.mmp b/group/re3_gles1.mmp index 713d46e..bade9b7 100644 --- a/group/re3_gles1.mmp +++ b/group/re3_gles1.mmp @@ -1,5 +1,4 @@ -#undef __SYMBIAN_3 -#define __S60V3 +#undef SYMBIAN_3 //TARGET re3_gles1.exe TARGET re3_gles1.exe LIBRARY libstdcpp.lib diff --git a/group/re3_gles2.mmp b/group/re3_gles2.mmp index ae7782a..5d2a0d0 100644 --- a/group/re3_gles2.mmp +++ b/group/re3_gles2.mmp @@ -1,5 +1,4 @@ -#undef __S60V3 -#define __SYMBIAN_3 +#define SYMBIAN_3 TARGET re3.exe LIBRARY libstdcppv5.lib LIBRARY libglesv2.lib From fa4776192b9bd193bbf6b1bf628ca6734a8e366c Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 18:10:08 +0500 Subject: [PATCH 20/24] Add resources in pkg --- group/common.mmh | 1 + sis/re3-gles1.pkg | 30 +++++++++++++++++------------- sis/re3.pkg | 24 ++++++++++++++++++------ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/group/common.mmh b/group/common.mmh index 1b4576d..e04e11c 100644 --- a/group/common.mmh +++ b/group/common.mmh @@ -18,6 +18,7 @@ SRCDBG OPTION ARMCC --gnu -Otime --diag_suppress 1,68,111,174,381,1293 OPTION_REPLACE ARMCC --cpu 6 OPTION_REPLACE ARMCC --fpu vfpv2 --fpmode fast +// too dangerous! OPTION_REPLACE ARMCC -O2 -O3 #ifdef ARMCC ALWAYS_BUILD_AS_ARM diff --git a/sis/re3-gles1.pkg b/sis/re3-gles1.pkg index b76f1c5..5a13e0c 100644 --- a/sis/re3-gles1.pkg +++ b/sis/re3-gles1.pkg @@ -1,22 +1,26 @@ #{"GTA III"},(0xe0d67647),1,0,0 -[0x101F7961], 0, 0, 0, {"S60ProductID"} -[0x1028315F], 0, 0, 0, {"S60ProductID"} -[0x20022E6D], 0, 0, 0, {"S60ProductID"} +[0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 +[0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 +[0x20022E6D], 0, 0, 0, {"S60ProductID"} ; ^3 %{"nnproject"} :"nnproject" -;IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) ; old or missing openc -; "incompatible_openc.txt"-"", FT, FORCEABORT -;ENDIF - -;IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll") -; "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe" -;ELSE -; "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe" -;ENDIF "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe" "$(EPOCROOT)\epoc32\data\z\private\10003a3f\import\apps\re3_reg.rsc" - "!:\private\10003a3f\import\apps\re3_reg.rsc" "$(EPOCROOT)\epoc32\data\z\resource\apps\re3.rsc" - "!:\resource\apps\re3.rsc" -"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif" \ No newline at end of file +"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif" + +"..\gamefiles\data\PARTICLE.CFG" - "E:\data\gta3\data\PARTICLE.CFG" +"..\gamefiles\models\fonts_j.txd" - "E:\data\gta3\models\fonts_j.txd" +"..\gamefiles\models\fonts_p.txd" - "E:\data\gta3\models\fonts_p.txd" +"..\gamefiles\models\fonts_r.txd" - "E:\data\gta3\models\fonts_r.txd" +"..\gamefiles\TEXT\american.gxt" - "E:\data\gta3\TEXT\american.gxt" +"..\gamefiles\TEXT\english.gxt" - "E:\data\gta3\TEXT\english.gxt" +"..\gamefiles\TEXT\french.gxt" - "E:\data\gta3\TEXT\french.gxt" +"..\gamefiles\TEXT\german.gxt" - "E:\data\gta3\TEXT\german.gxt" +"..\gamefiles\TEXT\italian.gxt" - "E:\data\gta3\TEXT\italian.gxt" +"..\gamefiles\TEXT\JAPANESE.gxt" - "E:\data\gta3\TEXT\JAPANESE.gxt" +"..\gamefiles\TEXT\polish.gxt" - "E:\data\gta3\TEXT\polish.gxt" +"..\gamefiles\TEXT\spanish.gxt" - "E:\data\gta3\TEXT\spanish.gxt" diff --git a/sis/re3.pkg b/sis/re3.pkg index 1c9097c..83795a9 100644 --- a/sis/re3.pkg +++ b/sis/re3.pkg @@ -1,8 +1,8 @@ #{"GTA III"},(0xe0d67647),1,0,0 -[0x101F7961], 0, 0, 0, {"S60ProductID"} -[0x1028315F], 0, 0, 0, {"S60ProductID"} -[0x20022E6D], 0, 0, 0, {"S60ProductID"} +[0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 +[0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 +[0x20022E6D], 0, 0, 0, {"S60ProductID"} ; ^3 %{"nnproject"} :"nnproject" @@ -11,12 +11,24 @@ IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) ; old or missing openc "incompatible_openc.txt"-"", FT, FORCEABORT ENDIF -IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll") +IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll") ; ^3 "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe" -ELSE +ELSE ; everything else "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe" ENDIF -;"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe" "$(EPOCROOT)\epoc32\data\z\private\10003a3f\import\apps\re3_reg.rsc" - "!:\private\10003a3f\import\apps\re3_reg.rsc" "$(EPOCROOT)\epoc32\data\z\resource\apps\re3.rsc" - "!:\resource\apps\re3.rsc" "$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif" + +"..\gamefiles\data\PARTICLE.CFG" - "E:\data\gta3\data\PARTICLE.CFG" +"..\gamefiles\models\fonts_j.txd" - "E:\data\gta3\models\fonts_j.txd" +"..\gamefiles\models\fonts_p.txd" - "E:\data\gta3\models\fonts_p.txd" +"..\gamefiles\models\fonts_r.txd" - "E:\data\gta3\models\fonts_r.txd" +"..\gamefiles\TEXT\american.gxt" - "E:\data\gta3\TEXT\american.gxt" +"..\gamefiles\TEXT\english.gxt" - "E:\data\gta3\TEXT\english.gxt" +"..\gamefiles\TEXT\french.gxt" - "E:\data\gta3\TEXT\french.gxt" +"..\gamefiles\TEXT\german.gxt" - "E:\data\gta3\TEXT\german.gxt" +"..\gamefiles\TEXT\italian.gxt" - "E:\data\gta3\TEXT\italian.gxt" +"..\gamefiles\TEXT\JAPANESE.gxt" - "E:\data\gta3\TEXT\JAPANESE.gxt" +"..\gamefiles\TEXT\polish.gxt" - "E:\data\gta3\TEXT\polish.gxt" +"..\gamefiles\TEXT\spanish.gxt" - "E:\data\gta3\TEXT\spanish.gxt" From d49730b8275e45b24b249a21eeb2237cd3feeb96 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 18:56:44 +0500 Subject: [PATCH 21/24] Fix face animations Caused by `--fpmode fast` optimization --- vendor/librw/src/base.cpp | 7 +++++-- vendor/librw/src/rwbase.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vendor/librw/src/base.cpp b/vendor/librw/src/base.cpp index e3b78a0..02457c4 100644 --- a/vendor/librw/src/base.cpp +++ b/vendor/librw/src/base.cpp @@ -137,6 +137,9 @@ slerp(const Quat &q, const Quat &p, float32 a) c = -c; q1 = negate(q1); } + if(c > 1.0f) { + c = 1.0f; + } float32 phi = acosf(c); if(phi > 0.00001f){ float32 s = sinf(phi); @@ -547,7 +550,7 @@ Matrix::invertGeneral(Matrix *dst, const Matrix *src) // get the determinant from that det = src->up.x * dst->right.y + src->at.x * dst->right.z + dst->right.x * src->right.x; invdet = 1.0; - if(det != 0.0f) + if(fabsf(det) > 0.00001f) invdet = 1.0f/det; dst->right.x *= invdet; dst->right.y *= invdet; @@ -570,7 +573,7 @@ Matrix::makeRotation(Matrix *dst, const V3d *axis, float32 angle) { // V3d v = normalize(*axis); float32 len = dot(*axis, *axis); - if(len != 0.0f) len = 1.0f/sqrtf(len); + if(len > 0.00001f) len = 1.0f/sqrtf(len); V3d v = rw::scale(*axis, len); angle = angle*(float)M_PI/180.0f; float32 s = sinf(angle); diff --git a/vendor/librw/src/rwbase.h b/vendor/librw/src/rwbase.h index 9a8f660..fca8bed 100644 --- a/vendor/librw/src/rwbase.h +++ b/vendor/librw/src/rwbase.h @@ -560,7 +560,7 @@ enum Platform PLATFORM_WDGL = 11, // WarDrum OpenGL PLATFORM_GL3 = 12, // my GL3 implementation - PLATFORM_GLES1 = 13, + PLATFORM_GLES1 = 14, NUM_PLATFORMS, From 0588e8866f52cb21f4747a9aec4dffde3b8db5f5 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 19:00:19 +0500 Subject: [PATCH 22/24] Bump pkg version forgot --- sis/re3-gles1.pkg | 2 +- sis/re3.pkg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sis/re3-gles1.pkg b/sis/re3-gles1.pkg index 5a13e0c..b20c89d 100644 --- a/sis/re3-gles1.pkg +++ b/sis/re3-gles1.pkg @@ -1,4 +1,4 @@ -#{"GTA III"},(0xe0d67647),1,0,0 +#{"GTA III"},(0xe0d67647),1,0,1 [0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 [0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 diff --git a/sis/re3.pkg b/sis/re3.pkg index 83795a9..84887fd 100644 --- a/sis/re3.pkg +++ b/sis/re3.pkg @@ -1,4 +1,4 @@ -#{"GTA III"},(0xe0d67647),1,0,0 +#{"GTA III"},(0xe0d67647),1,0,1 [0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 [0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 From 4e180c10516649492358f0db9973988181c2c122 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Sat, 9 May 2026 19:07:55 +0500 Subject: [PATCH 23/24] Update todo --- TODO.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 11a6b91..698f30f 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,7 @@ GLES 2.0 specific: - [ ] Fix face animations in optimized builds - [ ] Skinning shader is still broken on VC4 - [ ] Disappearing background in cutscenes +- [ ] HUD still disappearing sometimes GLES 1.1 specific: - [x] Backport to STLport v4 @@ -28,9 +29,10 @@ GLES 1.1 specific: - [x] Keyboard mappings for both QWERTY/12-keys - [ ] Use pvrtc compression - [ ] Optimize to always run 10+ fps +- [ ] Fix z-buffer issues (world clips through hud) +- [ ] Fix lighting Issues: - [x] Fix crash in Texture::destroy on exit - [x] Save menu is too slow -- [x] HUD disappearing on GLES 2.0 (mostly fixed, was caused by OOM) - [x] Crash when picking up a bat From 67cd77edf88c9cc1a3e73787271d047a0ac7ff21 Mon Sep 17 00:00:00 2001 From: Dante Leoncini Date: Sat, 9 May 2026 17:20:59 -0300 Subject: [PATCH 24/24] I already fixed the issue where the heads appeared black during cutscenes. It seems it was a vertex color problem --- src/core/main.cpp | 22 +++++++++++++--------- vendor/librw/src/gles1/gl1skin.cpp | 5 +++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 87484ee..d44fe99 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1448,17 +1448,21 @@ RenderEffects(void) CGlass::Render(); CWaterCannons::Render(); CSpecialFX::Render(); -// CShadows::RenderStaticShadows(); -// CShadows::RenderStoredShadows(); -// CSkidmarks::Render(); -// CAntennas::Render(); -// CRubbish::Render(); -// CCoronas::Render(); + #ifdef RW_GLES1 + CShadows::RenderStaticShadows(); + CShadows::RenderStoredShadows(); + CSkidmarks::Render(); + CAntennas::Render(); + CRubbish::Render(); + CCoronas::Render(); + #endif CParticle::Render(); CPacManPickups::Render(); -// CWeaponEffects::Render(); -// CPointLights::RenderFogEffect(); -// CMovingThings::Render(); + #ifdef RW_GLES1 + CWeaponEffects::Render(); + CPointLights::RenderFogEffect(); + CMovingThings::Render(); + #endif CRenderer::RenderFirstPersonVehicle(); POP_RENDERGROUP(); } diff --git a/vendor/librw/src/gles1/gl1skin.cpp b/vendor/librw/src/gles1/gl1skin.cpp index 901923d..a4c3849 100644 --- a/vendor/librw/src/gles1/gl1skin.cpp +++ b/vendor/librw/src/gles1/gl1skin.cpp @@ -33,6 +33,10 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header) InstanceData *inst = header->inst; int32 n = header->numMeshes; + //test rapido a ver si es la textura + glDisableClientState(GL_COLOR_ARRAY); + glColor4f(1,1,1,1); + while(n--){ m = inst->material; setMaterial(flags, m->color, m->surfaceProps); @@ -47,6 +51,7 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header) // skinInstanceCB: igual que defaultInstanceCB, sin pesos/indices // porque GLES1 no puede hacer skinning en GPU +// aunque... capaz podemos hacerloc on el PowerVR y las extensiones void skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance) {