Now using interpolation strings

This commit is contained in:
Simon Lübeß
2020-12-01 19:29:14 +01:00
parent 6e2c801265
commit e7464118d6
8 changed files with 22 additions and 15 deletions
@@ -171,7 +171,7 @@ namespace GlitchyEngine
if(DirectX.Windows.Winuser.GetKeyboardState((uint8*)&CurrentState.KeyStates) == 0)
{
DirectX.Common.HResult errorCode = (.)GetLastError();
Log.EngineLogger.Error("Failed to get keyboard state. Message({}){}:", (int32)errorCode, errorCode);
Log.EngineLogger.Error($"Failed to get keyboard state. Message({(int32)errorCode}){errorCode}:");
}
// Get the current mouse position
@@ -181,13 +181,13 @@ namespace GlitchyEngine
if (ScreenToClient(windowHandle, ref CurrentState.CursorPosition) == 0)
{
DirectX.Common.HResult errorCode = (.)GetLastError();
Log.EngineLogger.Error("Failed to convert coordinates from screen to client space. Message({}){}:", (int32)errorCode, errorCode);
Log.EngineLogger.Error($"Failed to convert coordinates from screen to client space. Message({(int32)errorCode}){errorCode}:");
}
}
else
{
DirectX.Common.HResult errorCode = (.)GetLastError();
Log.EngineLogger.Error("Failed to get mouse position. Message({}){}:", (int32)errorCode, errorCode);
Log.EngineLogger.Error($"Failed to get mouse position. Message({(int32)errorCode}){errorCode}:");
}
// Calculate cursor movement
@@ -169,7 +169,7 @@ namespace GlitchyEngine
private void Init(WindowDescription desc)
{
Log.EngineLogger.Trace("Creating window \"{}\" ({}, {})...", desc.Title, desc.Width, desc.Height);
Log.EngineLogger.Trace($"Creating window \"{desc.Title}\" ({desc.Width}, {desc.Height})...");
_instanceHandle = (.)GetModuleHandleW(null);
@@ -189,7 +189,8 @@ namespace GlitchyEngine
if (RegisterClassExW(ref _windowClass) == 0)
{
Log.EngineLogger.Error("Failed to register window class.", (HResult)GetLastError());
uint32 lastError = GetLastError();
Log.EngineLogger.Error($"Failed to register window class. Message({(int)lastError}): {(HResult)lastError}");
Runtime.FatalError("Failed to register window class");
}
@@ -204,7 +205,7 @@ namespace GlitchyEngine
LoadWindowRectangle();
Log.EngineLogger.Trace("Created window \"{}\" ({}, {})", Title, Width, Height);
Log.EngineLogger.Trace($"Created window \"{Title}\" ({Width}, {Height})");
}
private bool _isResizingOrMoving;