mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
Optional lunar.png loading from file
This commit is contained in:
parent
70e449fed0
commit
7d4e85b1dc
1 changed files with 17 additions and 6 deletions
|
@ -567,6 +567,16 @@ void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float size
|
||||||
{
|
{
|
||||||
if ( !gpMoonMask )
|
if ( !gpMoonMask )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ( GetFileAttributes("lunar.png") != INVALID_FILE_ATTRIBUTES )
|
||||||
|
{
|
||||||
|
// load from file
|
||||||
|
gpMoonMask = CPNGFile::ReadFromFile("lunar.png");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Load from memory
|
||||||
|
|
||||||
HMODULE thisModule;
|
HMODULE thisModule;
|
||||||
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR)DrawMoonWithPhases, &thisModule);
|
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR)DrawMoonWithPhases, &thisModule);
|
||||||
|
|
||||||
|
@ -577,6 +587,7 @@ void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float size
|
||||||
|
|
||||||
FreeResource(pMoonMask);
|
FreeResource(pMoonMask);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//D3DPERF_BeginEvent(D3DCOLOR_ARGB(0,0,0,0), L"render moon");
|
//D3DPERF_BeginEvent(D3DCOLOR_ARGB(0,0,0,0), L"render moon");
|
||||||
|
|
||||||
float currentDayFraction = nGameClockDays / 31.0f;
|
float currentDayFraction = nGameClockDays / 31.0f;
|
||||||
|
|
Loading…
Reference in a new issue