mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Fixed typo in Q_UnicodeConvertT
Rehlds Demo Player: print number of frames calculated when demo ends successfully
This commit is contained in:
parent
ddc6d1e3d4
commit
438726f462
@ -41,9 +41,6 @@ set CMD_LINE_ARGS=%*
|
|||||||
goto mainEnd
|
goto mainEnd
|
||||||
|
|
||||||
:fail
|
: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
|
exit /b 1
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
|
@ -363,7 +363,7 @@ int Q_UnicodeConvertT(const T_IN* pIn, T_OUT *pOut, int nOutBytes, enum EStringC
|
|||||||
if (nMaxOut <= 0)
|
if (nMaxOut <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while (pIn)
|
while (*pIn)
|
||||||
{
|
{
|
||||||
bool bErr;
|
bool bErr;
|
||||||
uchar32 uVal;
|
uchar32 uVal;
|
||||||
|
@ -52,6 +52,7 @@ CPlayingEngExtInterceptor::CPlayingEngExtInterceptor(const char* fname, bool str
|
|||||||
printf("Playing testsuite\nrecorders's cmdline: %s\n", cmdLine);
|
printf("Playing testsuite\nrecorders's cmdline: %s\n", cmdLine);
|
||||||
|
|
||||||
m_StartTick = ::GetTickCount();
|
m_StartTick = ::GetTickCount();
|
||||||
|
m_NumFrames = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* CPlayingEngExtInterceptor::allocFuncCall()
|
void* CPlayingEngExtInterceptor::allocFuncCall()
|
||||||
@ -148,9 +149,13 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCall(bool peek, bool processCallb
|
|||||||
|
|
||||||
if (cmd->getOpcode() == ECF_NONE) {
|
if (cmd->getOpcode() == ECF_NONE) {
|
||||||
DWORD endTick = ::GetTickCount();
|
DWORD endTick = ::GetTickCount();
|
||||||
FILE* fl = fopen("rehlds_demo_stats.log", "w");
|
FILE* fl = fopen("rehlds_demo_stats.xml", "w");
|
||||||
if (fl) {
|
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);
|
fclose(fl);
|
||||||
}
|
}
|
||||||
TerminateProcess(GetCurrentProcess(), 777);
|
TerminateProcess(GetCurrentProcess(), 777);
|
||||||
@ -451,6 +456,10 @@ int CPlayingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int flags,
|
|||||||
|
|
||||||
freeFuncCall(playCall); freeFuncCall(playEndCall);
|
freeFuncCall(playCall); freeFuncCall(playEndCall);
|
||||||
|
|
||||||
|
if (res == -1) {
|
||||||
|
m_NumFrames++;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +136,7 @@ private:
|
|||||||
int m_PrevHeartBeat;
|
int m_PrevHeartBeat;
|
||||||
|
|
||||||
DWORD m_StartTick;
|
DWORD m_StartTick;
|
||||||
|
int m_NumFrames;
|
||||||
|
|
||||||
hostent_data_t m_CurrentHostentData;
|
hostent_data_t m_CurrentHostentData;
|
||||||
struct hostent m_CurrentHostent;
|
struct hostent m_CurrentHostent;
|
||||||
|
Loading…
Reference in New Issue
Block a user