From 8c62223f908e67a20918adc0381c2f186d15f47f Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 30 Mar 2024 09:51:57 +1100 Subject: [PATCH] 3DS/GameCube/Wii: Increase max texture width/height for little bit faster world rendering --- .github/workflows/build_ds.yml | 6 ++++-- .github/workflows/build_n64.yml | 7 ++++++- src/Entity.h | 2 +- src/Graphics_3DS.c | 5 +++-- src/Graphics_GCWii.c | 9 +++++---- src/_GraphicsBase.h | 4 ++-- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_ds.yml b/.github/workflows/build_ds.yml index 24a4e1920..b082d98ab 100644 --- a/.github/workflows/build_ds.yml +++ b/.github/workflows/build_ds.yml @@ -20,6 +20,7 @@ jobs: export BLOCKSDSEXT=/opt/blocksds/external make ds + # otherwise notify_failure doesn't work - name: Install curl when necessary if: ${{ always() && steps.compile.outcome == 'failure' }} @@ -30,9 +31,10 @@ jobs: with: NOTIFY_MESSAGE: 'Failed to compile DS build' WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}' - + + - uses: ./.github/actions/upload_build if: ${{ always() && steps.compile.outcome == 'success' }} with: SOURCE_FILE: 'classicube.nds' - DEST_NAME: 'classicube.nds' \ No newline at end of file + DEST_NAME: 'classicube.nds' diff --git a/.github/workflows/build_n64.yml b/.github/workflows/build_n64.yml index e9d08f591..3646c4611 100644 --- a/.github/workflows/build_n64.yml +++ b/.github/workflows/build_n64.yml @@ -26,6 +26,11 @@ jobs: make n64 + # otherwise notify_failure doesn't work + - name: Install curl when necessary + if: ${{ always() && steps.compile.outcome == 'failure' }} + run: apt install curl + - uses: ./.github/actions/notify_failure if: ${{ always() && steps.compile.outcome == 'failure' }} with: @@ -37,4 +42,4 @@ jobs: if: ${{ always() && steps.compile.outcome == 'success' }} with: SOURCE_FILE: 'ClassiCube-n64.z64' - DEST_NAME: 'ClassiCube-n64.z64' \ No newline at end of file + DEST_NAME: 'ClassiCube-n64.z64' diff --git a/src/Entity.h b/src/Entity.h index 9f751c218..18fcbd220 100644 --- a/src/Entity.h +++ b/src/Entity.h @@ -87,7 +87,7 @@ struct EntityVTABLE { /* And therefore trying to access the ModelVB Field in entity struct instances created by the CEF plugin */ /* results in attempting to read or write data from potentially invalid memory */ #define ENTITY_FLAG_HAS_MODELVB 0x02 -/* Whether in classic mode, to slightly adjust this entity downwards when rendering it * +/* Whether in classic mode, to slightly adjust this entity downwards when rendering it */ /* to replicate the behaviour of the original vanilla classic client */ #define ENTITY_FLAG_CLASSIC_ADJUST 0x04 diff --git a/src/Graphics_3DS.c b/src/Graphics_3DS.c index ce78696ea..08164e8d9 100644 --- a/src/Graphics_3DS.c +++ b/src/Graphics_3DS.c @@ -148,8 +148,9 @@ static GfxResourceID white_square; void Gfx_Create(void) { if (!Gfx.Created) InitCitro3D(); - Gfx.MaxTexWidth = 512; - Gfx.MaxTexHeight = 512; + Gfx.MaxTexWidth = 1024; + Gfx.MaxTexHeight = 1024; + Gfx.MaxTexSize = 512 * 512; Gfx.Created = true; gfx_vsync = true; diff --git a/src/Graphics_GCWii.c b/src/Graphics_GCWii.c index d5eb44973..8032e4f6d 100644 --- a/src/Graphics_GCWii.c +++ b/src/Graphics_GCWii.c @@ -50,8 +50,9 @@ static void InitGX(void) { void Gfx_Create(void) { if (!Gfx.Created) InitGX(); - Gfx.MaxTexWidth = 512; - Gfx.MaxTexHeight = 512; + Gfx.MaxTexWidth = 1024; + Gfx.MaxTexHeight = 1024; + Gfx.MaxTexSize = 512 * 512; Gfx.Created = true; gfx_vsync = true; @@ -282,7 +283,7 @@ cc_bool Gfx_WarnIfNecessary(void) { return false; } GfxResourceID Gfx_CreateIb2(int count, Gfx_FillIBFunc fillFunc, void* obj) { //fillFunc(gfx_indices, count, obj); // not used since render using GX_QUADS anyways - return 1; + return (void*)1; } void Gfx_BindIb(GfxResourceID ib) { } @@ -552,4 +553,4 @@ void Gfx_DrawVb_IndexedTris(int verticesCount) { void Gfx_DrawIndexedTris_T2fC4b(int verticesCount, int startVertex) { Draw_TexturedTriangles(verticesCount, startVertex); } -#endif \ No newline at end of file +#endif diff --git a/src/_GraphicsBase.h b/src/_GraphicsBase.h index 8fd3e41ae..3efd775b6 100644 --- a/src/_GraphicsBase.h +++ b/src/_GraphicsBase.h @@ -136,7 +136,7 @@ void Gfx_RecreateContext(void) { } cc_bool reducedPerformance; -static void TickReducedPerformance(void) { +static CC_INLINE void TickReducedPerformance(void) { Thread_Sleep(100); /* 10 FPS */ if (reducedPerformance) return; @@ -144,7 +144,7 @@ static void TickReducedPerformance(void) { Chat_AddOf(&Gfx_LowPerfMessage, MSG_TYPE_EXTRASTATUS_2); } -static void EndReducedPerformance(void) { +static CC_INLINE void EndReducedPerformance(void) { if (!reducedPerformance) return; reducedPerformance = false; Chat_AddOf(&String_Empty, MSG_TYPE_EXTRASTATUS_2);