2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Fixed typo in Q_UnicodeConvertT

Rehlds Demo Player: print number of frames calculated when demo ends successfully
This commit is contained in:
dreamstalker 2015-06-13 16:08:16 +04:00
parent ddc6d1e3d4
commit 438726f462
4 changed files with 13 additions and 6 deletions

View File

@ -41,9 +41,6 @@ set CMD_LINE_ARGS=%*
goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd

View File

@ -363,7 +363,7 @@ int Q_UnicodeConvertT(const T_IN* pIn, T_OUT *pOut, int nOutBytes, enum EStringC
if (nMaxOut <= 0)
return 0;
while (pIn)
while (*pIn)
{
bool bErr;
uchar32 uVal;

View File

@ -52,6 +52,7 @@ CPlayingEngExtInterceptor::CPlayingEngExtInterceptor(const char* fname, bool str
printf("Playing testsuite\nrecorders's cmdline: %s\n", cmdLine);
m_StartTick = ::GetTickCount();
m_NumFrames = 0;
}
void* CPlayingEngExtInterceptor::allocFuncCall()
@ -148,9 +149,13 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCall(bool peek, bool processCallb
if (cmd->getOpcode() == ECF_NONE) {
DWORD endTick = ::GetTickCount();
FILE* fl = fopen("rehlds_demo_stats.log", "w");
FILE* fl = fopen("rehlds_demo_stats.xml", "w");
if (fl) {
fprintf(fl, "Finished playing demo; duration=%umsec", (endTick - m_StartTick));
fprintf(fl, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fprintf(fl, "<DemoStats>\n");
fprintf(fl, " <Duration>%u</Duration>\n", (endTick - m_StartTick));
fprintf(fl, " <NumFrames>%u</NumFrames>\n", m_NumFrames);
fprintf(fl, "</DemoStats>\n");
fclose(fl);
}
TerminateProcess(GetCurrentProcess(), 777);
@ -451,6 +456,10 @@ int CPlayingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int flags,
freeFuncCall(playCall); freeFuncCall(playEndCall);
if (res == -1) {
m_NumFrames++;
}
return res;
}

View File

@ -136,6 +136,7 @@ private:
int m_PrevHeartBeat;
DWORD m_StartTick;
int m_NumFrames;
hostent_data_t m_CurrentHostentData;
struct hostent m_CurrentHostent;