Change debug() output from gametime to real time.

In MP games, since gametime can vary so much between machines, needed a more reliable time source to sync up messages between them.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6679 4a71c877-e1ca-e34f-864e-861f7616d084
master
Buginator 2009-02-21 22:24:02 +00:00
parent 19a76d4320
commit e920507134
1 changed files with 10 additions and 2 deletions

View File

@ -28,7 +28,7 @@
#include <string.h>
#include <stdio.h>
#include <time.h>
#include "frameint.h"
#include "string_ext.h"
@ -371,8 +371,16 @@ void _debug( code_part part, const char *function, const char *str, ... )
if (!repeated)
{
time_t rawtime;
struct tm * timeinfo;
char ourtime[15]; //HH:MM:SS
time ( &rawtime );
timeinfo = localtime ( &rawtime );
strftime (ourtime,15,"%I:%M:%S",timeinfo);
// Assemble the outputBuffer:
ssprintf(outputBuffer, "%-8s|%012u: %s", code_part_names[part], gameTime, useInputBuffer1 ? inputBuffer[1] : inputBuffer[0]);
ssprintf(outputBuffer, "%-8s|%s: %s", code_part_names[part], ourtime, useInputBuffer1 ? inputBuffer[1] : inputBuffer[0]);
printToDebugCallbacks(outputBuffer);
}