Fix localtime_s.

This commit is contained in:
Dario 2024-12-16 13:27:06 -03:00
parent 392a0e99bf
commit 86331a935d

View file

@ -281,9 +281,14 @@ static void DrawAchievement(int rowIndex, float yOffset, Achievement& achievemen
return; return;
char buffer[32]; char buffer[32];
struct tm time; #ifdef _WIN32
localtime_s(&time, &timestamp); tm timeStruct;
strftime(buffer, sizeof(buffer), "%Y/%m/%d %H:%M", &time); tm *timePtr = &timeStruct;
localtime_s(timePtr, &timestamp);
#else
tm *timePtr = localtime(&timestamp);
#endif
strftime(buffer, sizeof(buffer), "%Y/%m/%d %H:%M", timePtr);
fontSize = Scale(12); fontSize = Scale(12);
textSize = g_fntNewRodinDB->CalcTextSizeA(fontSize, FLT_MAX, 0, buffer); textSize = g_fntNewRodinDB->CalcTextSizeA(fontSize, FLT_MAX, 0, buffer);