DEADSOFTWARE

changed license to GPLv3 only; sorry, no trust to FSF anymore
[d2df-sdl.git] / src / shared / xdynrec.pas
index a9d3bbe45c86f9d7fd7195207cf079e4fdef88d5..511c82dd0fd2ba8aeafa406cc5ef26e714318148 100644 (file)
@@ -1,9 +1,8 @@
-(* 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,7 +20,8 @@ interface
 
 uses
   SysUtils, Variants, Classes,
-  xparser, xstreams, utils, hashtable, mempool;
+  {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+  xparser, xstreams, utils, hashtable;
 
 
 // ////////////////////////////////////////////////////////////////////////// //
@@ -54,7 +54,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 +238,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 +375,7 @@ type
 
 
   // bitset/enum definition
-  TDynEBS = class(TPoolObject)
+  TDynEBS = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
   private
     mOwner: TDynMapDef;
     mIsEnum: Boolean;
@@ -420,7 +420,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
@@ -550,7 +550,7 @@ begin
   if (mType = TType.TList) then
   begin
     mRVal := TDynRecList.Create();
-    mRHash := hashNewStrInt();
+    mRHash := THashStrInt.Create();
   end;
 end;
 
@@ -698,7 +698,7 @@ begin
   if (mRVal <> nil) then
   begin
     if (result.mRVal = nil) then result.mRVal := TDynRecList.Create(mRVal.count);
-    if (result.mRHash = nil) then result.mRHash := hashNewStrInt();
+    if (result.mRHash = nil) then result.mRHash := THashStrInt.Create();
     for rec in mRVal do result.addListItem(rec.clone(registerIn));
   end;
   result.mRecRef := mRecRef;
@@ -1179,7 +1179,7 @@ begin
   ahelp := '';
 
   // field name
-  fldname := pr.expectStrOrId();
+  fldname := pr.expectIdOrStr();
 
   while (not pr.isDelim(';')) do
   begin
@@ -2435,7 +2435,7 @@ begin
   if (fld.mRVal = nil) then
   begin
     fld.mRVal := TDynRecList.Create();
-    fld.mRHash := hashNewStrInt();
+    fld.mRHash := THashStrInt.Create();
   end;
   result := fld.addListItem(rc);
 end;
@@ -2611,7 +2611,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;