From 70e449fed04a84a6a5b79d1e53abb1b80824a2c6 Mon Sep 17 00:00:00 2001 From: Silent Date: Fri, 20 Mar 2015 20:44:36 +0100 Subject: [PATCH] lunar64.png stored as a resource --- SAFix/Shaders.rc | Bin 146 -> 109 bytes SAFix/SilentPatchSA.cpp | 108 ++++++---------------------------------- SAFix/lunar64.png | Bin 0 -> 1018 bytes SAFix/resource.h | 1 + 4 files changed, 16 insertions(+), 93 deletions(-) create mode 100644 SAFix/lunar64.png diff --git a/SAFix/Shaders.rc b/SAFix/Shaders.rc index be9fe6e12fa29318e7349eb8e44a30e69efc32a7..7de812c25fc11be2f3cb697e2c8a0a4dac8a402d 100644 GIT binary patch literal 109 zcmY$+%uCKGO-WTyDoQQRFD*(=)yq)g<>KY?bP0<03v&+kaCC7E;tXNGwUth>6K7OV&#+&If7%Y48d4a||*w;e@NtDa}hPGBeRD$V&$*0RRdG BAHx6u literal 146 zcmW-a!3u&<6hzO~pnnkCzkd)DY7>#sN)S<@Kwe(TRUE)); + // RW caches those anyway, no need to duplicate caching + //if ( nAlphaBlending != TRUE ) + // RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast(TRUE)); atomic = AtomicDefaultRenderCallBack(atomic); - if ( nAlphaBlending != TRUE ) + //if ( nAlphaBlending != TRUE ) RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast(nAlphaBlending)); return atomic; @@ -654,7 +566,17 @@ bool GetCurrentZoneLockedOrUnlocked(float fPosX, float fPosY) void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float sizeY) { if ( !gpMoonMask ) - gpMoonMask = CPNGFile::ReadFromMemory(gMoonMaskPNG, sizeof(gMoonMaskPNG)); + { + HMODULE thisModule; + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR)DrawMoonWithPhases, &thisModule); + + HRSRC resource = FindResource(thisModule, MAKEINTRESOURCE(IDR_LUNAR64), RT_RCDATA); + void* pMoonMask = static_cast(LoadResource(thisModule, resource)); + + gpMoonMask = CPNGFile::ReadFromMemory(pMoonMask, SizeofResource(thisModule, resource)); + + FreeResource(pMoonMask); + } //D3DPERF_BeginEvent(D3DCOLOR_ARGB(0,0,0,0), L"render moon"); float currentDayFraction = nGameClockDays / 31.0f; diff --git a/SAFix/lunar64.png b/SAFix/lunar64.png new file mode 100644 index 0000000000000000000000000000000000000000..4dd9deed03f80d844f172aebf8c660750ae04516 GIT binary patch literal 1018 zcmVY`{s5hwvYL3hvvbO7z`wL&wdrTzaO3zR0*f^Xm} z_z2#C*PzB;3$+0~Kwr=c6pOBWSJ2zcDE639WG09OU+W3_tp)uOd=Sk9{_Pcb4&H># z00utLf-kY(hk!w#A86gg_x%l?fk)th1zuw&JWhuZsT#mlEVV%USg<3(aCMyM82tm+!4>e-xNC-F%>b_OP|=ki115t`84ld9 z&!7t25Y2>pq8XA=16Z_1i>~}&FvrZur5N-H@K7`pZb}lZGZ_Qgh^9CL9sw4J7Q8Ts zh4BcuZH91*{7k0-T=_B!oF*)m?5BJpaZ4Pw;AsSFM8ZsHtO4V}DEqlY(qG}zC3b^@ z;3}xLpD7!_lpiO$^2;TBEAJOGVV`IwT$2QaF_8gmb(2JU`$`GVo=+s!ggv4&!$oPJ zMK)vr(|m?#)i0OaSNmkel|Llf70yV&u+)$N-18H_T(B_L(KJz&;5fJ}S`!*=0B8B> zqI-X}gn!=$iS=NYXe~G^an24w223={&4eh6!E-BIG7=iV)t@Ok-maDCUp3;{VTb70 zd|G^25HC2kyD4C)M1S>TVip_#7ew1*paHD>^F^n=brRlzCt0xrY!{slkBX-w_zf5U zW`RW#-O3*%c7zIW3OorifQ4@=SS5PeYfj>6aW^x&E{n(q7RTa7?Tlcnx66&j!mxw?T6h(|4wGi|9mH={JDG4~yR>iT?Z_B%TX4ix$I*yaAHm0{J4C zZ-br}ogajpABCMi3^{)srkuVYLOFj)%=wF=l+%~RDd)c!p`89|jB@_VQOfDB$0_G; zkf5BtMJ6VvZ<311>D%Ne=WmpxoW4~yCZ}(f_R87Y<-KzHfr*%$eq_cgXCIo1XM~fF o&H3f*gOl;(