X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_weapons.pas;h=5f3f99a2565ec8ec56a67399680ed9ac866071df;hb=4d5a94c228a43cdd0333979f3aa218c56c248188;hp=182207f233740454ac355b5034c59625b78aea0b;hpb=94a927ca673a2d8af4b8449d434f3c70f38b11c1;p=d2df-sdl.git diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 182207f..5f3f99a 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -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; + TBinaryHeapHitTimes = specialize TBinaryHeapBase; 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 @@ -1094,7 +1099,7 @@ end; procedure g_Weapon_LoadData(); begin - e_WriteLog('Loading weapons data...', MSG_NOTIFY); + e_WriteLog('Loading weapons data...', TMsgType.Notify); g_Sound_CreateWADEx('SOUND_WEAPON_HITPUNCH', GameWAD+':SOUNDS\HITPUNCH'); g_Sound_CreateWADEx('SOUND_WEAPON_MISSPUNCH', GameWAD+':SOUNDS\MISSPUNCH'); @@ -1155,12 +1160,12 @@ begin g_Texture_CreateWADEx('TEXTURE_SHELL_SHELL', GameWAD+':TEXTURES\ESHELL'); //wgunMonHash := hashNewIntInt(); - wgunHitHeap := TBinaryHeapHitTimes.Create(hitTimeLess); + wgunHitHeap := TBinaryHeapHitTimes.Create(); end; procedure g_Weapon_FreeData(); begin - e_WriteLog('Releasing weapons data...', MSG_NOTIFY); + e_WriteLog('Releasing weapons data...', TMsgType.Notify); g_Sound_Delete('SOUND_WEAPON_HITPUNCH'); g_Sound_Delete('SOUND_WEAPON_MISSPUNCH'); @@ -1497,7 +1502,7 @@ begin if (dy > 0) then yi := 1 else if (dy < 0) then yi := -1 else yi := 0; {$IF DEFINED(D2F_DEBUG)} - e_WriteLog(Format('GUN TRACE: (%d,%d) to (%d,%d)', [x, y, x2, y2]), MSG_NOTIFY); + e_WriteLog(Format('GUN TRACE: (%d,%d) to (%d,%d)', [x, y, x2, y2]), TMsgType.Notify); stt := getTimeMicro(); {$ENDIF} @@ -1553,7 +1558,7 @@ begin begin {$IF DEFINED(D2F_DEBUG)} stt := getTimeMicro()-stt; - e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY); + e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), TMsgType.Notify); {$ENDIF} g_GFX_Spark(wallHitX, wallHitY, 2+Random(2), 180+a, 0, 0); if g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(wallHitX, wallHitY, 180+a, NET_GFX_SPARK); @@ -1562,7 +1567,7 @@ begin begin {$IF DEFINED(D2F_DEBUG)} stt := getTimeMicro()-stt; - e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY); + e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), TMsgType.Notify); {$ENDIF} end; @@ -2511,14 +2516,14 @@ begin if (Shots[i].ShotType = WEAPON_BARON_FIRE) or (Shots[i].ShotType = WEAPON_MANCUB_FIRE) or (Shots[i].ShotType = WEAPON_SKEL_FIRE) then - Animation.DrawEx(Obj.X, Obj.Y, M_NONE, p, a) + Animation.DrawEx(Obj.X, Obj.Y, TMirrorType.None, p, a) else - Animation.Draw(Obj.X, Obj.Y, M_NONE); + Animation.Draw(Obj.X, Obj.Y, TMirrorType.None); end else if TextureID <> 0 then begin if (Shots[i].ShotType = WEAPON_ROCKETLAUNCHER) then - e_DrawAdv(TextureID, Obj.X, Obj.Y, 0, True, False, a, @p, M_NONE) + e_DrawAdv(TextureID, Obj.X, Obj.Y, 0, True, False, a, @p, TMirrorType.None) else if (Shots[i].ShotType <> WEAPON_FLAMETHROWER) then e_Draw(TextureID, Obj.X, Obj.Y, 0, True, False); end;