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;
char buffer[32];
struct tm time;
localtime_s(&time, &timestamp);
strftime(buffer, sizeof(buffer), "%Y/%m/%d %H:%M", &time);
#ifdef _WIN32
tm timeStruct;
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);
textSize = g_fntNewRodinDB->CalcTextSizeA(fontSize, FLT_MAX, 0, buffer);