diff --git a/src/skel/crossplatform.cpp b/src/skel/crossplatform.cpp index 7364e6a1..3825722a 100644 --- a/src/skel/crossplatform.cpp +++ b/src/skel/crossplatform.cpp @@ -1,6 +1,10 @@ #include "common.h" #include "crossplatform.h" +#ifdef __WIIU__ +#include +#endif + // Codes compatible with Windows and Linux #ifndef _WIN32 @@ -17,9 +21,22 @@ void tmToSystemTime(const tm *tm, SYSTEMTIME *out) { } void GetLocalTime_CP(SYSTEMTIME *out) { +#ifndef __WIIU__ time_t timestamp = time(nil); tm *localTm = localtime(×tamp); tmToSystemTime(localTm, out); +#else + OSCalendarTime time; + OSTicksToCalendarTime(OSGetTime(), &time); + out->wYear = time.tm_year; + out->wMonth = time.tm_mon + 1; + out->wDayOfWeek = time.tm_wday; + out->wDay = time.tm_mday; + out->wHour = time.tm_hour; + out->wMinute = time.tm_min; + out->wSecond = time.tm_sec; + out->wMilliseconds = time.tm_msec; +#endif } #endif