DEADSOFTWARE

added common file with compiler flags; cosmetic fix in g_monsters.pas
[d2df-sdl.git] / src / engine / e_log.pas
index 472bd5762544126e0b60850d48eaf5ae6b7d7bac..dade4e35ec8b42a0fe605ba60d20b82b2468cbac 100644 (file)
@@ -1,4 +1,19 @@
-{$MODE DELPHI}
+(* 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 <http://www.gnu.org/licenses/>.
+ *)
+{$INCLUDE e_amodes.inc}
 {$R-}
 { $DEFINE CBLOG}
 unit e_log;
@@ -54,7 +69,7 @@ begin
   begin
     case RecordCategory of
       MSG_FATALERROR: write('FATAL: ');
-      MSG_WARNING: write('WARNINIG: ');
+      MSG_WARNING: write('WARNING: ');
     end;
     writeln(TextLine);
   end;
@@ -136,11 +151,6 @@ begin
   wcr := (tf.userData[udWasCR] <> 0);
   while count > 0 do
   begin
-    if wcr then
-    begin
-      wcr := false;
-      if buf^ = #10 then continue;
-    end;
     // look for some special char
     ep := buf;
     f := 0;
@@ -156,6 +166,7 @@ begin
     end;
     if f > 0 then
     begin
+      wcr := false;
       cbufPutChars(buf, f);
       Inc(buf, f);
       Dec(count, f);
@@ -184,9 +195,12 @@ begin
 {$IFDEF CBLOG}
       writeln(stderr);
 {$ENDIF}
-      wcr := (ch = #13);
-      x := 0;
-      cbufPut(#10);
+      if not wcr or (ch <> #10) then
+      begin
+        wcr := (ch = #13);
+        x := 0;
+        cbufPut(#10);
+      end;
       continue;
     end;
   end;
@@ -253,5 +267,5 @@ end;
 
 
 begin
-  e_InitWritelnDriver();
+  //e_InitWritelnDriver();
 end.