mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-22 21:42:28 +01:00
Optional lunar.png loading from file
This commit is contained in:
parent
70e449fed0
commit
7d4e85b1dc
@ -567,6 +567,16 @@ void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float size
|
||||
{
|
||||
if ( !gpMoonMask )
|
||||
{
|
||||
|
||||
if ( GetFileAttributes("lunar.png") != INVALID_FILE_ATTRIBUTES )
|
||||
{
|
||||
// load from file
|
||||
gpMoonMask = CPNGFile::ReadFromFile("lunar.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load from memory
|
||||
|
||||
HMODULE 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);
|
||||
}
|
||||
}
|
||||
//D3DPERF_BeginEvent(D3DCOLOR_ARGB(0,0,0,0), L"render moon");
|
||||
|
||||
float currentDayFraction = nGameClockDays / 31.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user