DEADSOFTWARE

Cosmetic: DooM 2D:Forever -> Doom 2D: Forever
[d2df-sdl.git] / src / game / g_weapons.pas
index 311b18cbc344dbb78b83a7ad0d4c3053a858c9d9..97d127a46519fbf1a9c9589247cd468047e43b8b 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
@@ -118,7 +118,7 @@ uses
   g_console, g_options, g_game,
   g_triggers, MAPDEF, e_log, g_monsters, g_saveload,
   g_language, g_netmsg, g_grid,
-  binheap, hashtable, utils, xstreams;
+  geom, binheap, hashtable, utils, xstreams;
 
 type
   TWaterPanel = record
@@ -157,8 +157,13 @@ type
     x, y: Integer;
   end;
 
+  TBinHeapKeyHitTime = class
+  public
+    class function less (const a, b: Integer): Boolean; inline;
+  end;
+
   // indicies in `wgunHitTime` array
-  TBinaryHeapHitTimes = specialize TBinaryHeapBase<Integer>;
+  TBinaryHeapHitTimes = specialize TBinaryHeapBase<Integer, TBinHeapKeyHitTime>;
 
 var
   WaterMap: array of array of DWORD = nil;
@@ -168,7 +173,7 @@ var
   wgunHitTimeUsed: Integer = 0;
 
 
-function hitTimeLess (a, b: Integer): Boolean;
+class function TBinHeapKeyHitTime.less (const a, b: Integer): Boolean;
 var
   hta, htb: PHitTime;
 begin
@@ -1155,7 +1160,7 @@ begin
   g_Texture_CreateWADEx('TEXTURE_SHELL_SHELL', GameWAD+':TEXTURES\ESHELL');
 
   //wgunMonHash := hashNewIntInt();
-  wgunHitHeap := TBinaryHeapHitTimes.Create(hitTimeLess);
+  wgunHitHeap := TBinaryHeapHitTimes.Create();
 end;
 
 procedure g_Weapon_FreeData();