X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fconbuf.pas;h=1be01b2f80df2eb36fffd90ec3d380828a97ea5d;hb=1f680d4a7f8c68a3f205d09b7a83e9f11c8498c6;hp=751f39ad06596afbfec3df125271b2c30ca19f8f;hpb=25fd929e92f5bc8dcedc5a39385cf6286b9b91c6;p=d2df-sdl.git diff --git a/src/shared/conbuf.pas b/src/shared/conbuf.pas index 751f39a..1be01b2 100644 --- a/src/shared/conbuf.pas +++ b/src/shared/conbuf.pas @@ -1,3 +1,18 @@ +(* Copyright (C) DooM 2D:Forever Developers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *) {$MODE OBJFPC} unit conbuf; @@ -23,6 +38,9 @@ function cbufLineUp (var sp: LongWord; var ep: LongWord): Boolean; procedure cbufClear (); +var + conbufDumpToStdOut: Boolean = false; + implementation @@ -45,6 +63,9 @@ function cbufLastChange (): LongWord; begin result := changeCount; end; // ////////////////////////////////////////////////////////////////////////// // +var + needCon: Boolean = true; + procedure cbufPutChars (buf: PChar; count: Integer); var np: LongWord; @@ -52,6 +73,15 @@ var begin if count > 0 then begin + if conbufDumpToStdOut then + begin + 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; + end; Inc(changeCount); if changeCount = 0 then changeCount := 1; while count > 0 do