void CRender::DrawString(bool CenterText, float x, float y, COLOR32 Color, PCoreString szText, ...) { char szBuffer[1024]; GET_VA_ARGS(szText, szBuffer); if (CenterText) x -= GetStringWidth(szBuffer) / 2; RECT Rect = { (int)x, (int)y, 0, 0 }; RECT ShadowRect = { (int)x + 1, (int)y, 0, 0 }; RECT ShadowRect2 = { (int)x + 1, (int)y + 1, 0, 0 }; RECT ShadowRect3 = { (int)x, (int)y + 1, 0, 0 }; RECT ShadowRect4 = { (int)x - 1, (int)y + 1, 0, 0 }; RECT ShadowRect5 = { (int)x - 1, (int)y, 0, 0 }; RECT ShadowRect6 = { (int)x - 1, (int)y - 1, 0, 0 }; RECT ShadowRect7 = { (int)x, (int)y - 1, 0, 0 }; RECT ShadowRect8 = { (int)x + 1, (int)y - 1, 0, 0 }; pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect2, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect3, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect4, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect5, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect6, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect7, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &ShadowRect8, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(0, 0, 0, Color.a - 25)); pD3DFont->DrawText(NULL, szBuffer, -1, &Rect, DT_LEFT | DT_NOCLIP, D3DCOLOR_RGBA(Color.r, Color.g, Color.g, Color.a)); }
// Console logging void CLog::Log(eLogType Type, PCoreString szText, ...) { if (Type > LogLevel) return; char szBuffer[1024]; GET_VA_ARGS(szText, szBuffer); if (LogToConsole) printf("%s\n", szBuffer); }
void Console::Add(const char* Text, ...) { char Buffer[512]; GET_VA_ARGS(Text, Buffer); console_entry_t tmp; tmp.Line = Buffer; ConsoleStorage.insert(ConsoleStorage.begin(), tmp); }
float CRender::GetStringWidth(char *szText, ...) { char szBuffer[1024]; GET_VA_ARGS(szText, szBuffer); RECT Rect; ZeroMemory(&Rect, sizeof(Rect)); pD3DFont->DrawText(0, szBuffer, -1, &Rect, DT_CALCRECT, 0); return (float)Rect.right; }
void CSettings::OutputSetting(CoreVariable *Var, PCHAR ExtraName, PCHAR szValue, ...) { char szBuffer[1024]; GET_VA_ARGS(szValue, szBuffer); File << " <Name = " << Var->Name << " " << ExtraName << "> <Type = " << szCoreVariableType[Var->Type] << "> <Value = " << szBuffer << ">\n"; }
void CSettings::OutputSetting(CoreVariable *Var, PCHAR szValue, ...) { char szBuffer[1024]; GET_VA_ARGS(szValue, szBuffer); File << CreateElementLine(Var->Name, true) << " <Type = " << szCoreVariableType[Var->Type] << "> <Value = " << szBuffer << ">\n"; }
void Console::Error(const char* ErrorMsg, ...) { char Buffer[1024]; GET_VA_ARGS(ErrorMsg, Buffer); Add(Buffer); }
void CLog::Log(PCoreString szText, ...) { char szBuffer[1024]; GET_VA_ARGS(szText, szBuffer); Log(eLogType::NORMAL, szBuffer); }