From: Ketmar Dark Date: Mon, 25 Apr 2016 19:25:59 +0000 (+0300) Subject: restored console logs in headless mode X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=cd1240f995a9e5be94fe308e9b52b0cc7763d843;p=d2df-sdl.git restored console logs in headless mode --- diff --git a/src/game/g_main.pas b/src/game/g_main.pas index c78c2bf..e1e21d8 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -62,7 +62,7 @@ begin e_WriteLog('Read config file', MSG_NOTIFY); g_Options_Read(GameDir + '/' + CONFIG_FILENAME); - e_WriteToStdOut := {$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF} + e_WriteToStdOut := False; //{$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF} //GetSystemDefaultLCID() diff --git a/src/shared/conbuf.pas b/src/shared/conbuf.pas index 581a881..57ed644 100644 --- a/src/shared/conbuf.pas +++ b/src/shared/conbuf.pas @@ -60,6 +60,10 @@ function cbufLastChange (): LongWord; begin result := changeCount; end; // ////////////////////////////////////////////////////////////////////////// // +{$IFDEF HEADLESS} +var + needCon: Boolean = true; +{$ENDIF} procedure cbufPutChars (buf: PChar; count: Integer); var np: LongWord; @@ -67,6 +71,15 @@ var begin if count > 0 then begin +{$IFDEF HEADLESS} + //write(stderr, 'CON: '); + for np := 0 to count-1 do + begin + if needCon then begin write(stdout, 'CON: '); needCon := false; end; + write(stdout, buf[np]); + needCon := (buf[np] = #10); + end; +{$ENDIF} Inc(changeCount); if changeCount = 0 then changeCount := 1; while count > 0 do