summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 899e037)
raw | patch | inline | side by side (parent: 899e037)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 24 Sep 2017 09:49:02 +0000 (12:49 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 24 Sep 2017 09:49:17 +0000 (12:49 +0300) |
16 files changed:
index bb12c810cc55dd61addc602e374148f08e742cda..ab3f4fe1c14a0e5dd00dc909c79e48e91406ac0b 100644 (file)
fmod,
fmodtypes,
fmoderrors,
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
e_log,
SysUtils;
nRefs: Integer;
end;
- TBasicSound = class(TPoolObject)
+ TBasicSound = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FChannel: FMOD_CHANNEL;
index 4d2e93d25260243e34c6228fb59c4b40cb9ba652..1b8d376aa72f82076369d611ddc245ba10bd0a50 100644 (file)
uses
sdl2,
SDL2_mixer,
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
e_log,
SysUtils;
nRefs: Integer;
end;
- TBasicSound = class(TPoolObject)
+ TBasicSound = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FChanNum: Integer; // <0: no channel allocated
diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas
index 5ef72f2ace02f5868e1e16771ffa6eefce4c2f53..27fa615fba297bda231768783ed094bbdc579155 100644 (file)
--- a/src/game/g_grid.pas
+++ b/src/game/g_grid.pas
interface
+{$IFDEF USE_MEMPOOL}
uses
mempool;
+{$ENDIF}
const
GridTileSize = 32; // must be power of two!
type
TBodyProxyId = Integer;
- generic TBodyGridBase<ITP> = class(TPoolObject)
+ generic TBodyGridBase<ITP> = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
type TGridQueryCB = function (obj: ITP; tag: Integer): Boolean is nested; // return `true` to stop
type TGridRayQueryCB = function (obj: ITP; tag: Integer; x, y, prevx, prevy: Integer): Boolean is nested; // return `true` to stop
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 893bdd8e2c0c2362a99b345ca9262e966b3b1d8f..35c1da4ea7f1fbfc916b691b2679edb40659ce59 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
interface
uses
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
e_graphics, e_input, e_log, g_playermodel, g_basic, MAPDEF, utils;
const
TFontType = (Texture, Character);
- TFont = class(TPoolObject)
+ TFont = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
ID: DWORD;
FScale: Single;
TOnChangeEvent = procedure(Sender: TGUIControl);
TOnEnterEvent = procedure(Sender: TGUIControl);
- TGUIControl = class(TPoolObject)
+ TGUIControl = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FX, FY: Integer;
FEnabled: Boolean;
property RightAlign: Boolean read FRightAlign write FRightAlign; // for menu
end;
- TGUIWindow = class(TPoolObject)
+ TGUIWindow = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FActiveControl: TGUIControl;
FDefControl: string;
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 3b630ab674faa7c70df292c70143bdf6f30a0bde..94e61712c56dbd741a4cdb13a7626dbf2054cfcc 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
interface
uses
- mempool, geom,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF} geom,
e_log, e_input,
g_textures, g_basic, e_graphics, g_phys, g_grid, g_player, g_monsters,
g_window, g_map, g_triggers, g_items, g_game, g_panel, g_console, g_gfx,
index 66ab556c29a82469bcce792ebbafa8d3b81b19bc..175420e083f4fa82271a9f4dd0b53e15209c065f 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
uses
SysUtils, Classes,
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
g_basic, e_graphics, g_phys, g_textures, g_grid,
g_saveload, g_panel, xprofiler;
}
type
- TMonster = class(TPoolObject)
+ TMonster = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FMonsterType: Byte;
FUID: Word;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index b4d00c9923a6f8e4a63d15795fe00d42e9d112c5..bcad3ca07b1ce6a1cd202e0a9613928ce45ad840 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
uses
SysUtils, Classes,
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
e_graphics, g_playermodel, g_basic, g_textures,
g_weapons, g_phys, g_sound, g_saveload, MAPDEF,
g_panel;
Time: Word;
end;
- TPlayer = class(TPoolObject)
+ TPlayer = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FIamBot: Boolean;
FUID: Word;
procedure positionChanged (); inline; //WARNING! call this after entity position was changed, or coldet will not work right!
end;
- TCorpse = class(TPoolObject)
+ TCorpse = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FModelName: String;
FMess: Boolean;
index 44651438e93ec006d360c5f67598ab26e3199a67..ebb3915efedfbc09ab7379729f7fa9bcd4dcfd78 100644 (file)
interface
uses
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
MAPDEF, g_textures, g_basic, g_weapons, e_graphics, utils;
const
Array [A_STAND..A_LAST] of
Array [TDirection.D_LEFT..TDirection.D_RIGHT] of Array of TDFPoint;
- TPlayerModel = class(TPoolObject)
+ TPlayerModel = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FName: String;
FDirection: TDirection;
index 6f239e4df78266d2ca749f9588727224a1004b7f..f129b9e219d9ff88a224951a8bbddba784fff022 100644 (file)
--- a/src/game/g_textures.pas
+++ b/src/game/g_textures.pas
uses
SysUtils, Classes,
- mempool,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
e_graphics, MAPDEF, ImagingTypes, Imaging, ImagingUtility;
Type
TLevelTextureArray = Array of TLevelTexture;
- TAnimation = class(TPoolObject)
+ TAnimation = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
ID: DWORD;
FAlpha: Byte;
diff --git a/src/shared/CONFIG.pas b/src/shared/CONFIG.pas
index 7ecc51e70fb180944e2dd2c36b48ce917bb3f1a3..4aa7e659b79a47c6d0351c4002533414dc0c3fc9 100644 (file)
--- a/src/shared/CONFIG.pas
+++ b/src/shared/CONFIG.pas
{$INCLUDE a_modes.inc}
unit CONFIG;
-{
------------------------------------
-CONFIG.PAS ÂÅÐÑÈß ÎÒ 24.09.06
------------------------------------
-}
-
interface
+{$IFDEF USE_MEMPOOL}
uses
mempool;
+{$ENDIF}
type
TParam = record
Section: Word;
end;
- TConfig = class(TPoolObject)
+ TConfig = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FParams: array of TParam;
FSections: array of ShortString;
diff --git a/src/shared/exoma.pas b/src/shared/exoma.pas
index ffa11a91bec8aea9a243163c19731cbd1c98a2e4..6b6c12d698023fd0cd42a37a268a5ff51e6abc04 100644 (file)
--- a/src/shared/exoma.pas
+++ b/src/shared/exoma.pas
interface
uses
- typinfo, SysUtils, Variants, mempool, hashtable, xparser;
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+ typinfo, SysUtils, Variants,
+ hashtable, xparser;
// ////////////////////////////////////////////////////////////////////////// //
// ////////////////////////////////////////////////////////////////////////// //
type
- TPropHash = class(TPoolObject)
+ TPropHash = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
mClass: TClass;
mNames: THashStrInt;
// ////////////////////////////////////////////////////////////////////////// //
type
- TExprConstList = class(TPoolObject)
+ TExprConstList = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
function valid (const cname: AnsiString): Boolean; virtual; abstract;
function get (const cname: AnsiString; out v: Variant): Boolean; virtual; abstract;
// ////////////////////////////////////////////////////////////////////////// //
type
- TExprScope = class(TPoolObject)
+ TExprScope = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
class procedure error (const amsg: AnsiString);
class procedure errorfmt (const afmt: AnsiString; const args: array of const);
procedure setField (obj: TObject; const afldname: AnsiString; var aval: Variant); virtual;
end;
- TExprBase = class(TPoolObject)
+ TExprBase = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
class function coerce2bool (var v0: Variant): Boolean;
class function toInt (var v: Variant): LongInt;
diff --git a/src/shared/idpool.pas b/src/shared/idpool.pas
index 4722be8838635794e913348909d334ba72befdcc..9e0a0124e810bff02b7a74d79d6cf1e5305a1c76 100644 (file)
--- a/src/shared/idpool.pas
+++ b/src/shared/idpool.pas
interface
+{$IFDEF USE_MEMPOOL}
uses
mempool;
+{$ENDIF}
// ////////////////////////////////////////////////////////////////////////// //
type
//TODO: implement getting n sequential ids
- TIdPool = class(TPoolObject)
+ TIdPool = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
const InvalidId = $ffffffff;
diff --git a/src/shared/mempool.pas b/src/shared/mempool.pas
index 0ca3f2f589a437c3931a6d7a510313aa24035dac..37527dde9ee617f56d647370f4515b93e4fc72fb 100644 (file)
--- a/src/shared/mempool.pas
+++ b/src/shared/mempool.pas
interface
+{$IFDEF USE_MEMPOOL}
uses
SysUtils;
public procedure FreeInstance (); override;
{$ENDIF}
end;
-
+{$ENDIF}
implementation
+{$IFDEF USE_MEMPOOL}
uses
hashtable;
{$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
dumpPools();
{$ENDIF}
+{$ENDIF} // USE_MEMPOOL
end.
index 818e912f7ee532a42591b2059d890d39c4b27edb..09bb5033dcda43c19fac864f90e13649f4d23a6c 100644 (file)
--- a/src/shared/wadreader.pas
+++ b/src/shared/wadreader.pas
uses
Classes,
- mempool, sfs, xstreams, utils;
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+ sfs, xstreams, utils;
type
- TWADFile = class(TPoolObject)
+ TWADFile = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
fFileName: AnsiString; // empty: not opened
fIter: TSFSFileList;
diff --git a/src/shared/xdynrec.pas b/src/shared/xdynrec.pas
index 12d99d015c663a706eb258cf8523d9911ba8c7db..7d1098ee7de0710dfef124fb51c02de429561f66 100644 (file)
--- a/src/shared/xdynrec.pas
+++ b/src/shared/xdynrec.pas
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)
- 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);
// record, either with actual values, or with type definitions
- TDynRecord = class(TPoolObject)
+ TDynRecord = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
mOwner: TDynMapDef;
mId: AnsiString;
// bitset/enum definition
- TDynEBS = class(TPoolObject)
+ TDynEBS = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
mOwner: TDynMapDef;
mIsEnum: Boolean;
// parsed "mapdef.txt"
- TDynMapDef = class(TPoolObject)
+ TDynMapDef = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
recTypes: TDynRecList; // [0] is always header
trigTypes: TDynRecList; // trigdata
diff --git a/src/shared/xparser.pas b/src/shared/xparser.pas
index 6ecf7f029f90777e46e0382783100f0cef9aabe7..7d7a9ed5d3bbdeb237376833203c68374a90986c 100644 (file)
--- a/src/shared/xparser.pas
+++ b/src/shared/xparser.pas
interface
uses
- Classes, mempool;
+ Classes{$IFDEF USE_MEMPOOL}, mempool{$ENDIF};
// ////////////////////////////////////////////////////////////////////////// //
type
- TTextParser = class(TPoolObject)
+ TTextParser = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
public
const
TTNone = -1;