Optional lunar.png loading from file

This commit is contained in:
Silent 2015-03-20 21:10:13 +01:00
parent 70e449fed0
commit 7d4e85b1dc

View File

@ -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;