Avoid the Win32 API if you can.

You have two alternative options. Option 1: squarely laugh at the Valve
programmer who tried to prevent you from doing this (quote: "ALL of
these should be protected, but one man can only accomplish so much in
one day AND work on features too") and use the following:

#undef time

Option 2: do the following.

struct tm wtf;
VCRHook_LocalTime(&wtf);
// do evil things with wtf here

Look into your C library's "time.h" (probably in the Platform SDK or
Visual Studio headers) how "struct tm" is defined.

Good luck.

~~ Ondra

Jeffrey "botman" Broome wrote:
Giancarlo Rivas wrote:
--
[ Picked text/plain from multipart/alternative ]
Hi, I wanted to get the local time of the system to save a file with
that
data but noticed time() shouldn't be used (USE_VCR_MODE), so what's the
alternate way to get the value?, couldn't find any alternate call.

GetLocalTime()?


SYSTEMTIME st;
GetLocalTime( &st );

int Year = st.wYear;
int Month = st.wMonth;
int DayOfWeek = st.wDayOfWeek;
int Day = st.wDay;
int Hour = st.wHour;
int Min = st.wMinute;
int Sec = st.wSecond;
int MSec = st.wMilliseconds;

...then sprintf() it to a string to be printed out or used as a filename.

--
Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to