diff --git a/src/shared/xdynrec.pas b/src/shared/xdynrec.pas
index a9d3bbe45c86f9d7fd7195207cf079e4fdef88d5..511c82dd0fd2ba8aeafa406cc5ef26e714318148 100644 (file)
--- a/src/shared/xdynrec.pas
+++ b/src/shared/xdynrec.pas
-(* 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
*
* 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
uses
SysUtils, Variants, Classes,
uses
SysUtils, Variants, Classes,
- xparser, xstreams, utils, hashtable, mempool;
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+ xparser, xstreams, utils, hashtable;
// ////////////////////////////////////////////////////////////////////////// //
// ////////////////////////////////////////////////////////////////////////// //
TDynEBSList = specialize TSimpleList<TDynEBS>;
// this is base type for all scalars (and arrays)
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);
public
type
TType = (TBool, TChar, TByte, TUByte, TShort, TUShort, TInt, TUInt, TString, TPoint, TSize, TColor, TList, TTrigData);
// record, either with actual values, or with type definitions
// record, either with actual values, or with type definitions
- TDynRecord = class(TPoolObject)
+ TDynRecord = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
mOwner: TDynMapDef;
mId: AnsiString;
private
mOwner: TDynMapDef;
mId: AnsiString;
// bitset/enum definition
// bitset/enum definition
- TDynEBS = class(TPoolObject)
+ TDynEBS = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
mOwner: TDynMapDef;
mIsEnum: Boolean;
private
mOwner: TDynMapDef;
mIsEnum: Boolean;
// parsed "mapdef.txt"
// parsed "mapdef.txt"
- TDynMapDef = class(TPoolObject)
+ TDynMapDef = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
recTypes: TDynRecList; // [0] is always header
trigTypes: TDynRecList; // trigdata
public
recTypes: TDynRecList; // [0] is always header
trigTypes: TDynRecList; // trigdata
if (mType = TType.TList) then
begin
mRVal := TDynRecList.Create();
if (mType = TType.TList) then
begin
mRVal := TDynRecList.Create();
- mRHash := hashNewStrInt();
+ mRHash := THashStrInt.Create();
end;
end;
end;
end;
if (mRVal <> nil) then
begin
if (result.mRVal = nil) then result.mRVal := TDynRecList.Create(mRVal.count);
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;
for rec in mRVal do result.addListItem(rec.clone(registerIn));
end;
result.mRecRef := mRecRef;
ahelp := '';
// field name
ahelp := '';
// field name
- fldname := pr.expectStrOrId();
+ fldname := pr.expectIdOrStr();
while (not pr.isDelim(';')) do
begin
while (not pr.isDelim(';')) do
begin
if (fld.mRVal = nil) then
begin
fld.mRVal := TDynRecList.Create();
if (fld.mRVal = nil) then
begin
fld.mRVal := TDynRecList.Create();
- fld.mRHash := hashNewStrInt();
+ fld.mRHash := THashStrInt.Create();
end;
result := fld.addListItem(rc);
end;
end;
result := fld.addListItem(rc);
end;
end
else
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;
while (not pr.isDelim('{')) do
begin
if pr.eatId('header') then begin mHeader := true; continue; end;