From: Ketmar Dark Date: Wed, 16 Aug 2017 12:36:43 +0000 (+0300) Subject: added common file with compiler flags; cosmetic fix in g_monsters.pas X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=7292fe409145dfcbb2776e34bb64d56e32985b9d;p=d2df-sdl.git added common file with compiler flags; cosmetic fix in g_monsters.pas --- diff --git a/src/engine/e_amodes.inc b/src/engine/e_amodes.inc new file mode 100644 index 0000000..b71ccfa --- /dev/null +++ b/src/engine/e_amodes.inc @@ -0,0 +1,14 @@ +{$MODE DELPHI} +{$MODESWITCH NESTEDPROCVARS+} +{$MODESWITCH DUPLICATELOCALS-} +{$MODESWITCH CBLOCKS+} +{$ASSERTIONS ON} +{$LONGSTRINGS ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$STATIC ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS OFF} +{$EXTENDEDSYNTAX ON} +{$B-} +{$S-} diff --git a/src/engine/e_fixedbuffer.pas b/src/engine/e_fixedbuffer.pas index 92c984c..c593021 100644 --- a/src/engine/e_fixedbuffer.pas +++ b/src/engine/e_fixedbuffer.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} unit e_fixedbuffer; interface diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index d3cb67e..39b6e43 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} unit e_graphics; interface diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas index 269a1d1..deded67 100644 --- a/src/engine/e_input.pas +++ b/src/engine/e_input.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} unit e_input; interface diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas index 75b325e..dade4e3 100644 --- a/src/engine/e_log.pas +++ b/src/engine/e_log.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} {$R-} { $DEFINE CBLOG} unit e_log; diff --git a/src/engine/e_sound.pas b/src/engine/e_sound.pas index 333ab50..d4d13b8 100644 --- a/src/engine/e_sound.pas +++ b/src/engine/e_sound.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} unit e_sound; {$IFDEF USE_SDLMIXER} diff --git a/src/engine/e_textures.pas b/src/engine/e_textures.pas index 8dfd2cc..ae5cea4 100644 --- a/src/engine/e_textures.pas +++ b/src/engine/e_textures.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE e_amodes.inc} unit e_textures; { This unit provides interface to load 24-bit and 32-bit uncompressed images diff --git a/src/game/g_amodes.inc b/src/game/g_amodes.inc new file mode 100644 index 0000000..b71ccfa --- /dev/null +++ b/src/game/g_amodes.inc @@ -0,0 +1,14 @@ +{$MODE DELPHI} +{$MODESWITCH NESTEDPROCVARS+} +{$MODESWITCH DUPLICATELOCALS-} +{$MODESWITCH CBLOCKS+} +{$ASSERTIONS ON} +{$LONGSTRINGS ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$STATIC ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS OFF} +{$EXTENDEDSYNTAX ON} +{$B-} +{$S-} diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index 1705e0e..40b8e4e 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_basic; interface diff --git a/src/game/g_console.pas b/src/game/g_console.pas index fcabed7..ec4ce69 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_console; interface diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 73e6b28..18f5639 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_game; interface diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index f39d071..e24db1f 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_gfx; interface diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas index 984d8e7..a56c670 100644 --- a/src/game/g_grid.pas +++ b/src/game/g_grid.pas @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} -{$modeswitch nestedprocvars} +{$INCLUDE g_amodes.inc} unit g_grid; interface diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index c276cfd..ca49c71 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_gui; interface diff --git a/src/game/g_items.pas b/src/game/g_items.pas index d94b996..2b7008e 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_items; interface diff --git a/src/game/g_language.pas b/src/game/g_language.pas index aa82810..412e2f7 100644 --- a/src/game/g_language.pas +++ b/src/game/g_language.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_language; interface diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 2d9d7e4..d5a5a83 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_main; interface diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 91102f1..d56ed47 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} -{$modeswitch nestedprocvars} +{$INCLUDE g_amodes.inc} unit g_map; interface diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 29817ae..7c51f80 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_menu; interface diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index e37e2e4..27846f4 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_monsters; interface @@ -100,7 +100,7 @@ type function Live(): Boolean; procedure SetHealth(aH: Integer); procedure Push(vx, vy: Integer); - function Damage(Damage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean; + function Damage(aDamage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean; function Heal(Value: Word): Boolean; procedure BFGHit(); procedure Update(); @@ -1574,7 +1574,7 @@ begin vilefire := nil; end; -function TMonster.Damage(Damage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean; +function TMonster.Damage(aDamage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean; var c, it: Integer; p: TPlayer; @@ -1604,15 +1604,15 @@ begin // Ðîáîòó óðîíà íåò: if FMonsterType = MONSTER_ROBO then - Damage := 0; + aDamage := 0; // Íàíîñèì óðîí: - if g_Game_IsServer then Dec(FHealth, Damage); + if g_Game_IsServer then Dec(FHealth, aDamage); // Óñèëèâàåì áîëü ìîíñòðà îò óðîíà: if FPain = 0 then FPain := 3; - FPain := FPain+Damage; + FPain := FPain+aDamage; // Åñëè áîëü ñóùåñòâåííàÿ, òî ìåíÿåì ñîñòîÿíèå íà áîëåâîå: if FState <> STATE_PAIN then @@ -1623,8 +1623,8 @@ begin // Åñëè ðàçðåøåíà êðîâü - ñîçäàåì áðûçãè êðîâè: if (gBloodCount > 0) then begin - c := Min(Damage, 200); - c := c*gBloodCount - (Damage div 4) + Random(c div 2); + c := Min(aDamage, 200); + c := c*gBloodCount - (aDamage div 4) + Random(c div 2); if (VelX = 0) and (VelY = 0) then MakeBloodSimple(c) diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 944ce6f..3596849 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_net; interface diff --git a/src/game/g_nethandler.pas b/src/game/g_nethandler.pas index 4f4cfed..a4711af 100644 --- a/src/game/g_nethandler.pas +++ b/src/game/g_nethandler.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_nethandler; interface diff --git a/src/game/g_netmaster.pas b/src/game/g_netmaster.pas index 9c4c4ad..64681c3 100644 --- a/src/game/g_netmaster.pas +++ b/src/game/g_netmaster.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_netmaster; interface diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index a5bd880..3049838 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_netmsg; interface diff --git a/src/game/g_options.pas b/src/game/g_options.pas index 416f3b3..a262439 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_options; interface diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index d724f2a..39c1b10 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_panel; interface diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas index 4564750..d581eb3 100644 --- a/src/game/g_phys.pas +++ b/src/game/g_phys.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_phys; interface diff --git a/src/game/g_player.pas b/src/game/g_player.pas index ef8b1af..d5b318f 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_player; interface diff --git a/src/game/g_playermodel.pas b/src/game/g_playermodel.pas index f3e1f8d..0392cc4 100644 --- a/src/game/g_playermodel.pas +++ b/src/game/g_playermodel.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_playermodel; interface diff --git a/src/game/g_res_downloader.pas b/src/game/g_res_downloader.pas index 6d112ee..471268e 100644 --- a/src/game/g_res_downloader.pas +++ b/src/game/g_res_downloader.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_res_downloader; interface diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index f020b9b..039883d 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_saveload; interface diff --git a/src/game/g_sound.pas b/src/game/g_sound.pas index 813d8d1..a3ef547 100644 --- a/src/game/g_sound.pas +++ b/src/game/g_sound.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_sound; interface diff --git a/src/game/g_textures.pas b/src/game/g_textures.pas index 9d9720c..21b33ae 100644 --- a/src/game/g_textures.pas +++ b/src/game/g_textures.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_textures; interface diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 8c1c1b8..278e92a 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_triggers; interface diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index baf7108..22fc69d 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_weapons; interface diff --git a/src/game/g_window.pas b/src/game/g_window.pas index e7cc9cd..89511af 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *) -{$MODE DELPHI} +{$INCLUDE g_amodes.inc} unit g_window; interface