DEADSOFTWARE

Now ported to android!
[d2df-sdl.git] / src / shared / xdynrec.pas
index 12d99d015c663a706eb258cf8523d9911ba8c7db..db576f60bdfff249cd1b2b8de783cd315ff5615e 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C)  DooM 2D:Forever Developers
+(* 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
@@ -21,7 +21,8 @@ interface
 
 uses
   SysUtils, Variants, Classes,
-  xparser, xstreams, utils, hashtable, mempool;
+  {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+  xparser, xstreams, utils, hashtable;
 
 
 // ////////////////////////////////////////////////////////////////////////// //
@@ -54,7 +55,7 @@ type
   TDynEBSList = specialize TSimpleList<TDynEBS>;
 
   // this is base type for all scalars (and arrays)
-  TDynField = class(TPoolObject)
+  TDynField = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
   public
     type
       TType = (TBool, TChar, TByte, TUByte, TShort, TUShort, TInt, TUInt, TString, TPoint, TSize, TColor, TList, TTrigData);
@@ -238,7 +239,7 @@ type
 
 
   // record, either with actual values, or with type definitions
-  TDynRecord = class(TPoolObject)
+  TDynRecord = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
   private
     mOwner: TDynMapDef;
     mId: AnsiString;
@@ -375,7 +376,7 @@ type
 
 
   // bitset/enum definition
-  TDynEBS = class(TPoolObject)
+  TDynEBS = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
   private
     mOwner: TDynMapDef;
     mIsEnum: Boolean;
@@ -420,7 +421,7 @@ type
 
 
   // parsed "mapdef.txt"
-  TDynMapDef = class(TPoolObject)
+  TDynMapDef = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
   public
     recTypes: TDynRecList; // [0] is always header
     trigTypes: TDynRecList; // trigdata
@@ -1179,7 +1180,7 @@ begin
   ahelp := '';
 
   // field name
-  fldname := pr.expectStrOrId();
+  fldname := pr.expectIdOrStr();
 
   while (not pr.isDelim(';')) do
   begin
@@ -2611,7 +2612,7 @@ begin
   end
   else
   begin
-    mTypeName := pr.expectStrOrId();
+    mTypeName := pr.expectIdOrStr();
     while (not pr.isDelim('{')) do
     begin
       if pr.eatId('header') then begin mHeader := true; continue; end;