summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e93442c)
raw | patch | inline | side by side (parent: e93442c)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Jan 2022 10:10:02 +0000 (13:10 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Jan 2022 10:10:02 +0000 (13:10 +0300) |
20 files changed:
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 68efd413c1f51b782ddec50a1549f397156cae71..c576b7ce994358cd3d696320a37dfd2dd6fd41e9 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
g_res_downloader in 'g_res_downloader.pas',
g_grid in 'g_grid.pas',
g_game in 'g_game.pas',
- g_gfx in 'g_gfx.pas',
+ {$IFDEF ENABLE_GFX}
+ g_gfx in 'g_gfx.pas',
+ {$ENDIF}
g_items in 'g_items.pas',
g_map in 'g_map.pas',
g_monsters in 'g_monsters.pas',
r_animations in 'opengl/r_animations.pas',
r_console in 'opengl/r_console.pas',
r_game in 'opengl/r_game.pas',
- r_gfx in 'opengl/r_gfx.pas',
+ {$IFDEF ENABLE_GFX}
+ r_gfx in 'opengl/r_gfx.pas',
+ {$ENDIF}
r_graphics in 'opengl/r_graphics.pas',
r_items in 'opengl/r_items.pas',
r_map in 'opengl/r_map.pas',
Inc(idx);
//if arg = '--twinkletwinkle' then gwin_k8_enable_light_experiments := true;
if arg = '--jah' then g_profile_history_size := 100;
- if arg = '--no-particles' then gpart_dbg_enabled := false;
if arg = '--no-los' then gmon_dbg_los_enabled := false;
if arg = '--profile-render' then g_profile_frame_draw := true;
if arg = '--profile-coldet' then g_profile_collision := true;
if arg = '--profile-los' then g_profile_los := true;
- if arg = '--no-part-phys' then gpart_dbg_phys_enabled := false;
- if arg = '--no-part-physics' then gpart_dbg_phys_enabled := false;
- if arg = '--no-particles-phys' then gpart_dbg_phys_enabled := false;
- if arg = '--no-particles-physics' then gpart_dbg_phys_enabled := false;
- if arg = '--no-particle-phys' then gpart_dbg_phys_enabled := false;
- if arg = '--no-particle-physics' then gpart_dbg_phys_enabled := false;
+ {$IFDEF ENABLE_GFX}
+ if arg = '--no-particles' then gpart_dbg_enabled := false;
+ if arg = '--no-part-phys' then gpart_dbg_phys_enabled := false;
+ if arg = '--no-part-physics' then gpart_dbg_phys_enabled := false;
+ if arg = '--no-particles-phys' then gpart_dbg_phys_enabled := false;
+ if arg = '--no-particles-physics' then gpart_dbg_phys_enabled := false;
+ if arg = '--no-particle-phys' then gpart_dbg_phys_enabled := false;
+ if arg = '--no-particle-physics' then gpart_dbg_phys_enabled := false;
+ {$ENDIF}
if arg = '--debug-input' then g_dbg_input := True;
diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas
index d119742bcec3881673e4e8acb7a922810da417ae..bfe84f93ddc2370855c59a3d685d27dc0166f0cc 100644 (file)
--- a/src/game/g_basic.pas
+++ b/src/game/g_basic.pas
implementation
uses
- Math, geom, e_log, g_map, g_gfx, g_player, SysUtils, MAPDEF,
+ Math, geom, e_log, g_map, g_player, SysUtils, MAPDEF,
StrUtils, g_monsters, g_items, g_game;
{$PUSH}
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 2c0bf6145fa7109d51ab4ecb68d5f81902c63004..aa06ac00c412c9a13c36afdac7d8dedb5920f8db 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
{$IFDEF ENABLE_TOUCH}
g_system,
{$ENDIF}
- g_textures, e_input, g_game, g_gfx, g_player, g_items,
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ g_textures, e_input, g_game, g_player, g_items,
SysUtils, g_basic, g_options, Math, e_res,
g_language, g_net, g_netmsg, e_log, conbuf;
WriteLn(f, 'sv_public ', IfThen(NetUseMaster, 1, 0));
// game settings
- WriteLn(f, 'g_max_particles ', g_GFX_GetMax());
+ {$IFDEF ENABLE_GFX}
+ WriteLn(f, 'g_max_particles ', g_GFX_GetMax());
+ {$ENDIF}
WriteLn(f, 'g_max_shells ', g_Shells_GetMax());
WriteLn(f, 'g_max_gibs ', g_Gibs_GetMax());
WriteLn(f, 'g_max_corpses ', g_Corpses_GetMax());
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 41238952d636e6c903dd2f9de1b9fbb4261d78ac..512f5bf174648cecdfd9d19da857cdf68b2062a2 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
{$IFDEF ENABLE_MENU}
g_menu,
{$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
{$IFNDEF HEADLESS}
r_render, g_system,
{$ENDIF}
e_res, g_window,
e_input, e_log, g_console, g_items, g_map, g_panel,
- g_playermodel, g_gfx, g_options, Math,
+ g_playermodel, g_options, Math,
g_triggers, g_monsters, e_sound, CONFIG,
g_language, g_net, g_phys,
ENet, e_msg, g_netmsg, g_netmaster,
g_Triggers_Update();
g_Weapon_Update();
g_Monsters_Update();
- g_GFX_Update();
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Update;
+ {$ENDIF}
g_Player_UpdateAll();
g_Player_UpdatePhysicalObjects();
begin
if Length(p) = 2 then
begin
- a := Max(0, StrToInt(p[1]));
- g_GFX_SetMax(a)
+ {$IFDEF ENABLE_GFX}
+ a := Max(0, StrToInt(p[1]));
+ g_GFX_SetMax(a)
+ {$ENDIF}
end
else if Length(p) = 1 then
begin
- e_LogWritefln('%s', [g_GFX_GetMax()])
+ {$IFDEF ENABLE_GFX}
+ e_LogWritefln('%s', [g_GFX_GetMax()])
+ {$ELSE}
+ e_LogWritefln('%s', [0])
+ {$ENDIF}
end
else
begin
conRegVar('mon_sq_enabled', @gmon_debug_use_sqaccel, 'accelerated spatial queries for monsters', 'accelerated monster coldet');
conRegVar('wtrace_sq_enabled', @gwep_debug_fast_trace, 'accelerated spatial queries for weapon hitscan trace', 'accelerated weapon hitscan');
+{$IFDEF ENABLE_GFX}
conRegVar('pr_enabled', @gpart_dbg_enabled, 'enable/disable particles', 'particles');
conRegVar('pr_phys_enabled', @gpart_dbg_phys_enabled, 'enable/disable particle physics', 'particle physics');
+{$ENDIF}
conRegVar('los_enabled', @gmon_dbg_los_enabled, 'enable/disable monster LOS calculations', 'monster LOS', true);
conRegVar('mon_think', @gmon_debug_think, 'enable/disable monster thinking', 'monster thinking', true);
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index d0bf54b182c1657158b93f0f0c469d74222d9cfe..224faeed37e415d8c1be49f2af769207f83f12f7 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
implementation
-uses
- {$IFNDEF HEADLESS}
- r_render,
- {$ENDIF}
- g_map, g_panel, g_basic, Math,
- g_options, g_console, SysUtils, g_triggers, MAPDEF,
- g_game, g_language, g_net, utils, xprofiler;
+ uses
+ {$IFNDEF HEADLESS}
+ r_render,
+ {$ENDIF}
+ g_map, g_panel, Math, utils,
+ g_options, SysUtils, MAPDEF
+ ;
const
diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index 347fec50ff557e91a9849c71268ad2c8132f82d3..a6caf4e7cd30b71125de40636e0e7b2c3116f906 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
implementation
-uses
- Math,
- g_basic, g_sound, g_gfx, g_map,
- g_game, g_triggers, g_console, g_player, g_net, g_netmsg,
- e_log, g_options,
- g_grid, binheap, idpool, utils, xstreams;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ Math,
+ g_basic, g_sound, g_map,
+ g_game, g_triggers, g_console, g_player, g_net, g_netmsg,
+ e_log, g_options,
+ g_grid, binheap, idpool, utils, xstreams
+ ;
// ////////////////////////////////////////////////////////////////////////// //
var
if (RespawnTime = 0) and (not alive) then
begin
if not QuietRespawn then g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', InitX, InitY);
- g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, InitX + (Obj.Rect.Width div 2) - 16, InitY + (Obj.Rect.Height div 2) - 16);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_ITEM_RESPAWN,
+ InitX + (Obj.Rect.Width div 2) - 16,
+ InitY + (Obj.Rect.Height div 2) - 16
+ );
+ {$ENDIF}
Obj.oldX := InitX;
Obj.oldY := InitY;
Obj.X := InitX;
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 0e31b25d28acb6a33847bb606cf8367bafaceb8a..ac94845f5d1085d026ceb644de3d84e0f6eb6d73 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
implementation
-uses
- e_input, e_log, e_res, g_items, g_gfx, g_console,
- g_weapons, g_game, g_sound, e_sound, CONFIG,
- g_options, g_triggers, g_player,
- Math, g_monsters, g_saveload, g_language, g_netmsg,
- sfs, xstreams, hashtable, wadreader,
- g_res_downloader;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ e_input, e_log, e_res, g_items, g_console,
+ g_weapons, g_game, g_sound, e_sound, CONFIG,
+ g_options, g_triggers, g_player,
+ Math, g_monsters, g_saveload, g_language, g_netmsg,
+ sfs, xstreams, hashtable, wadreader,
+ g_res_downloader
+ ;
const
FLAGRECT: TRectWH = (X:15; Y:12; Width:33; Height:52);
g_Weapon_Init();
g_Monsters_Init();
- // Åñëè íå LoadState, òî ñîçäàåì êàðòó ñòîëêíîâåíèé:
- if not gLoadGameMode then g_GFX_Init();
+ {$IFDEF ENABLE_GFX}
+ // Åñëè íå LoadState, òî ñîçäàåì êàðòó ñòîëêíîâåíèé:
+ if not gLoadGameMode then g_GFX_Init();
+ {$ENDIF}
// Ñáðîñ ëîêàëüíûõ ìàññèâîâ:
mapTextureList := nil;
end;
begin
- g_GFX_Free();
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Free;
+ {$ENDIF}
g_Weapon_Free();
g_Items_Free();
g_Triggers_Free();
if pan.Enabled and mapGrid.proxyEnabled[pan.proxyId] then exit;
pan.Enabled := True;
- g_Mark(pan.X, pan.Y, pan.Width, pan.Height, MARK_DOOR, true);
+
+ {$IFDEF ENABLE_GFX}
+ g_Mark(pan.X, pan.Y, pan.Width, pan.Height, MARK_DOOR, true);
+ {$ENDIF}
mapGrid.proxyEnabled[pan.proxyId] := true;
//if (pan.proxyId >= 0) then mapGrid.proxyEnabled[pan.proxyId] := true
if (not pan.Enabled) and (not mapGrid.proxyEnabled[pan.proxyId]) then exit;
pan.Enabled := False;
- g_Mark(pan.X, pan.Y, pan.Width, pan.Height, MARK_DOOR, false);
+ {$IFDEF ENABLE_GFX}
+ g_Mark(pan.X, pan.Y, pan.Width, pan.Height, MARK_DOOR, false);
+ {$ENDIF}
mapGrid.proxyEnabled[pan.proxyId] := false;
//if (pan.proxyId >= 0) then begin mapGrid.removeBody(pan.proxyId); pan.proxyId := -1; end;
begin
LiftType := t;
- g_Mark(X, Y, Width, Height, MARK_LIFT, false);
- //TODO: make separate lift tags, and change tag here
-
- case LiftType of
- LIFTTYPE_UP: g_Mark(X, Y, Width, Height, MARK_LIFTUP);
- LIFTTYPE_DOWN: g_Mark(X, Y, Width, Height, MARK_LIFTDOWN);
- LIFTTYPE_LEFT: g_Mark(X, Y, Width, Height, MARK_LIFTLEFT);
- LIFTTYPE_RIGHT: g_Mark(X, Y, Width, Height, MARK_LIFTRIGHT);
- end;
+ {$IFDEF ENABLE_GFX}
+ g_Mark(X, Y, Width, Height, MARK_LIFT, false);
+ //TODO: make separate lift tags, and change tag here
+ case LiftType of
+ LIFTTYPE_UP: g_Mark(X, Y, Width, Height, MARK_LIFTUP);
+ LIFTTYPE_DOWN: g_Mark(X, Y, Width, Height, MARK_LIFTDOWN);
+ LIFTTYPE_LEFT: g_Mark(X, Y, Width, Height, MARK_LIFTLEFT);
+ LIFTTYPE_RIGHT: g_Mark(X, Y, Width, Height, MARK_LIFTRIGHT);
+ end;
+ {$ENDIF}
//if g_Game_IsServer and g_Game_IsNet then MH_SEND_PanelState(pguid);
// mark platform as interesting
loadPanels();
///// /////
- // Îáíîâëÿåì êàðòó ñòîëêíîâåíèé è ñåòêó
- g_GFX_Init();
+ {$IFDEF ENABLE_GFX}
+ // Îáíîâëÿåì êàðòó ñòîëêíîâåíèé è ñåòêó
+ g_GFX_Init();
+ {$ENDIF}
+
//mapCreateGrid();
///// Çàãðóæàåì ìóçûêó: /////
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 1795d3dfac3fee06ec27dce320d5cbdb22af01f6..6daf00cdf864e399b541cfa8a4599b1ffac82b0d 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
implementation
uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
g_gui, r_textures, r_graphics, g_game, g_map,
- g_base, g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
+ g_base, g_basic, g_console, g_sound, g_player, g_options, g_weapons,
e_log, SysUtils, CONFIG, g_playermodel, DateUtils,
MAPDEF, Math, g_saveload,
g_language, e_res,
menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
- g_GFX_SetMax(TGUIScroll(menu.GetControl('scParticlesCount')).Value*1000);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_SetMax(TGUIScroll(menu.GetControl('scParticlesCount')).Value*1000);
+ {$ENDIF}
g_Shells_SetMax(TGUIScroll(menu.GetControl('scShellsMax')).Value*30);
g_Gibs_SetMax(TGUIScroll(menu.GetControl('scGibsMax')).Value*25);
g_Corpses_SetMax(TGUIScroll(menu.GetControl('scCorpsesMax')).Value*5);
menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
- TGUIScroll(menu.GetControl('scParticlesCount')).Value := g_GFX_GetMax() div 1000;
+ {$IFDEF ENABLE_GFX}
+ TGUIScroll(menu.GetControl('scParticlesCount')).Value := g_GFX_GetMax() div 1000;
+ {$ENDIF}
TGUIScroll(menu.GetControl('scShellsMax')).Value := g_Shells_GetMax() div 30;
TGUIScroll(menu.GetControl('scGibsMax')).Value := g_Gibs_GetMax() div 25;
TGUIScroll(menu.GetControl('scCorpsesMax')).Value := g_Corpses_GetMax() div 5;
index df1b4acfff22c5e1aaf7f64599bdb9f007e0ce59..e3374e496ebcf7001c9094dc5476720411ab7884 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
tx, ty: Integer;
FStartID: Integer;
FObj: TObj;
- FBloodRed: Byte;
- FBloodGreen: Byte;
- FBloodBlue: Byte;
- FBloodKind: Byte;
+ {$IFDEF ENABLE_GFX}
+ FBloodRed: Byte;
+ FBloodGreen: Byte;
+ FBloodBlue: Byte;
+ FBloodKind: Byte;
+ {$ENDIF}
FShellTimer: Integer;
FShellType: Byte;
FFirePainTime: Integer;
{$IFDEF ENABLE_MENU}
g_menu,
{$ENDIF}
- e_log, g_sound, g_gfx, g_player, g_game,
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ e_log, g_sound, g_player, g_game,
g_weapons, g_triggers, g_items, g_options,
g_console, g_map, Math, wadreader,
g_language, g_netmsg, idpool, utils, xstreams;
mplatCheckFrameId := 0;
mNeedSend := false;
+{$IFDEF ENABLE_GFX}
if FMonsterType in [MONSTER_ROBO, MONSTER_BARREL] then
FBloodKind := BLOOD_SPARKS
else
FBloodGreen := 0;
FBloodBlue := 0;
end;
+{$ENDIF}
SetLength(FAnim, Length(ANIMTABLE));
for a := ANIM_SLEEP to ANIM_PAIN do
procedure TMonster.MakeBloodSimple(Count: Word);
begin
+{$IFDEF ENABLE_GFX}
g_GFX_Blood(FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2)+8,
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2),
Count div 2, 3, -1, 16, (FObj.Rect.Height*2 div 3),
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2),
Count div 2, -3, -1, 16, (FObj.Rect.Height*2) div 3,
FBloodRed, FBloodGreen, FBloodBlue, FBloodKind);
+{$ENDIF}
end;
procedure TMonster.MakeBloodVector(Count: Word; VelX, VelY: Integer);
begin
+{$IFDEF ENABLE_GFX}
g_GFX_Blood(FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2),
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2),
Count, VelX, VelY, 16, (FObj.Rect.Height*2) div 3,
FBloodRed, FBloodGreen, FBloodBlue, FBloodKind);
+{$ENDIF}
end;
procedure TMonster.Push(vx, vy: Integer);
if not silent then
begin
g_Sound_PlayExAt('SOUND_GAME_TELEPORT', Obj.X, Obj.Y);
+{$IFDEF ENABLE_GFX}
g_GFX_QueueEffect(
R_GFX_TELEPORT,
FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2)-32,
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2)-32
);
-
+{$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2)-32,
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2)-32, 1,
// Эффект телепорта в точке назначения:
if not silent then
begin
+{$IFDEF ENABLE_GFX}
g_GFX_QueueEffect(
R_GFX_TELEPORT,
FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2)-32,
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2)-32
);
-
+{$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(FObj.X+FObj.Rect.X+(FObj.Rect.Width div 2)-32,
FObj.Y+FObj.Rect.Y+(FObj.Rect.Height div 2)-32, 0,
if WordBool(st and MOVE_INWATER) and (Random(32) = 0) then
case FMonsterType of
MONSTER_FISH:
- if Random(4) = 0 then
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ begin
+ {$IFDEF ENABLE_GFX}
+ if Random(4) = 0 then
+ begin
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y + FObj.Rect.Y + Random(4),
+ 1,
+ 0,
+ 0
+ );
+ end;
+ {$ENDIF}
+ end;
MONSTER_ROBO, MONSTER_BARREL:
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
- else begin
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
- FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
+ begin
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y + FObj.Rect.Y + Random(4),
+ 1,
+ 0,
+ 0
+ );
+ {$ENDIF}
+ end;
+ else
+ begin
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width - 4),
+ FObj.Y+FObj.Rect.Y + Random(4),
+ 5,
+ 4,
+ 4
+ );
+ {$ENDIF}
if Random(2) = 0 then
g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
else
if WordBool(st and MOVE_INWATER) and (Random(32) = 0) then
case FMonsterType of
MONSTER_FISH:
- if Random(4) = 0 then
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ begin
+ {$IFDEF ENABLE_GFX}
+ if Random(4) = 0 then
+ begin
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y + FObj.Rect.Y + Random(4),
+ 1,
+ 0,
+ 0
+ );
+ end;
+ {$ENDIF}
+ end;
MONSTER_ROBO, MONSTER_BARREL:
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
- else begin
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
- FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
+ begin
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y + FObj.Rect.Y + Random(4),
+ 1,
+ 0,
+ 0
+ );
+ {$ENDIF}
+ end;
+ else
+ begin
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(
+ FObj.X + FObj.Rect.X + Random(FObj.Rect.Width - 4),
+ FObj.Y + FObj.Rect.Y + Random(4),
+ 5,
+ 4,
+ 4
+ );
+ {$ENDIF}
if Random(2) = 0 then
g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
else
end;
procedure TMonster.OnFireFlame(Times: DWORD = 1);
- var i: DWORD; x, y: Integer;
+ {$IFDEF ENABLE_GFX}
+ var i: DWORD; x, y: Integer;
+ {$ENDIF}
begin
- if (Random(10) = 1) and (Times = 1) then
- Exit;
-
- for i := 1 to Times do
- begin
- x := Obj.X + Obj.Rect.X + Random(Obj.Rect.Width + Times * 2) - (R_GFX_FLAME_WIDTH div 2);
- y := Obj.Y + 8 + Random(8 + Times * 2) + IfThen(FState = MONSTATE_DEAD, 16, 0);
- g_GFX_QueueEffect(R_GFX_FLAME, x, y);
- end;
+ {$IFDEF ENABLE_GFX}
+ if (Random(10) = 1) and (Times = 1) then
+ Exit;
+ for i := 1 to Times do
+ begin
+ x := Obj.X + Obj.Rect.X + Random(Obj.Rect.Width + Times * 2) - (R_GFX_FLAME_WIDTH div 2);
+ y := Obj.Y + 8 + Random(8 + Times * 2) + IfThen(FState = MONSTATE_DEAD, 16, 0);
+ g_GFX_QueueEffect(R_GFX_FLAME, x, y);
+ end;
+ {$ENDIF}
end;
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index f3b095591d8b08a94c4296b2360403a1ed88506c..efb5d322ffd7f80ed3b6529d6dea47720e3c2aef 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
implementation
-uses
- {$IFDEF ENABLE_MENU}
- g_gui,
- {$ENDIF}
- Math, ENet, e_input, e_log, g_base, g_basic,
- g_textures, g_gfx, g_sound, g_console, g_options,
- g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys,
- g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF;
+ uses
+ {$IFDEF ENABLE_MENU}
+ g_gui,
+ {$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ Math, ENet, e_input, e_log, g_base, g_basic,
+ g_textures, g_sound, g_console, g_options,
+ g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys,
+ g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF
+ ;
const
NET_KEY_LEFT = 1;
case Kind of
NET_GFX_SPARK:
- g_GFX_Spark(X, Y, 2 + Random(2), Ang, 0, 0);
-
+ begin
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Spark(X, Y, 2 + Random(2), Ang, 0, 0);
+ {$ENDIF}
+ end;
NET_GFX_TELE:
begin
- g_GFX_QueueEffect(R_GFX_TELEPORT_FAST, X, Y);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_TELEPORT_FAST, X, Y);
+ {$ENDIF}
if Ang = 1 then
g_Sound_PlayExAt('SOUND_GAME_TELEPORT', X, Y);
end;
-
NET_GFX_EXPLODE:
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, X - 64, Y - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, X - 64, Y - 64);
+ {$ENDIF}
if Ang = 1 then
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEROCKET', X, Y);
end;
-
NET_GFX_BFGEXPL:
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, X - 64, Y - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, X - 64, Y - 64);
+ {$ENDIF}
if Ang = 1 then
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBFG', X, Y);
end;
-
NET_GFX_BFGHIT:
begin
- g_GFX_QueueEffect(R_GFX_BFG_HIT, X - 32, Y - 32);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_BFG_HIT, X - 32, Y - 32);
+ {$ENDIF}
end;
-
NET_GFX_FIRE:
begin
- g_GFX_QueueEffect(R_GFX_FIRE, X, Y);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_FIRE, X, Y);
+ {$ENDIF}
if Ang = 1 then
g_Sound_PlayExAt('SOUND_FIRE', X, Y);
end;
-
NET_GFX_RESPAWN:
begin
- g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X, Y);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X, Y);
+ {$ENDIF}
if Ang = 1 then
g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', X, Y);
end;
-
NET_GFX_SHELL1:
+ begin
g_Player_CreateShell(X, Y, 0, -2, SHELL_BULLET);
-
+ end;
NET_GFX_SHELL2:
+ begin
g_Player_CreateShell(X, Y, 0, -2, SHELL_SHELL);
-
+ end;
NET_GFX_SHELL3:
begin
g_Player_CreateShell(X, Y, 0, -2, SHELL_SHELL);
if not Quiet then
begin
g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', X, Y);
- g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X+(it.Obj.Rect.Width div 2)-16, Y+(it.Obj.Rect.Height div 2)-16);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X+(it.Obj.Rect.Width div 2)-16, Y+(it.Obj.Rect.Height div 2)-16);
+ {$ENDIF}
end;
end;
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index 91b0a05bb755c9f87762b127ec68ffedd0cfb2e7..e825938b09beaf404853489cb01ae55497b560a7 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
{$IFDEF USE_SDL2}
SDL2,
{$ENDIF}
- e_log, e_input, g_console, g_sound, g_gfx, g_player, Math,
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ e_log, e_input, g_console, g_sound, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game,
g_items, wadreader, envvars;
end;
(* section Game *)
- g_GFX_SetMax(2000);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_SetMax(2000);
+ {$ENDIF}
g_Shells_SetMax(300);
g_Gibs_SetMax(150);
g_Corpses_SetMax(20);
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 87bbb476ea2ed2be218abb30f6988877e58cba39..ee8e17dbb9b435f622117f0c69fced8a0fc29f94 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
implementation
-uses
- g_basic, g_map, g_game, g_gfx, g_weapons, g_triggers,
- g_console, g_language, g_monsters, g_player, g_grid, e_log, geom, utils, xstreams;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ g_basic, g_map, g_game, g_weapons, g_triggers,
+ g_console, g_language, g_monsters, g_player, g_grid, e_log, geom, utils, xstreams
+ ;
const
PANEL_SIGNATURE = $4C4E4150; // 'PANL'
e_LogWritefln('panel moved: arridx=%s; guid=%s; proxyid=%s; old:(%s,%s)-(%sx%s); new:(%s,%s)-(%sx%s)',
[arrIdx, mGUID, proxyId, px, py, pw, ph, x, y, width, height]);
}
- g_Mark(px, py, pw, ph, MARK_WALL, false);
+ {$IFDEF ENABLE_GFX}
+ g_Mark(px, py, pw, ph, MARK_WALL, false);
+ {$ENDIF}
if (Width < 1) or (Height < 1) then
begin
mapGrid.proxyEnabled[proxyId] := false;
begin
mapGrid.moveBody(proxyId, X, Y);
end;
- g_Mark(X, Y, Width, Height, MARK_WALL);
+ {$IFDEF ENABLE_GFX}
+ g_Mark(X, Y, Width, Height, MARK_WALL);
+ {$ENDIF}
end;
end;
end;
diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas
index 69199797b06237a4ac9023f44ced5fc1868a4ad2..3ff102b6e00b3220b8ce658b4cc7666726468820 100644 (file)
--- a/src/game/g_phys.pas
+++ b/src/game/g_phys.pas
implementation
-uses
- g_map, g_basic, Math, g_player, g_console, SysUtils,
- g_sound, g_gfx, MAPDEF, g_monsters, g_game, utils;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ g_map, g_basic, Math, g_player, g_console, SysUtils,
+ g_sound, MAPDEF, g_monsters, g_game, utils
+ ;
const
g_Sound_PlayExAt('SOUND_GAME_BULK2', Obj^.X, Obj^.Y);
end;
- g_GFX_Water(Obj^.X+Obj^.Rect.X+(Obj^.Rect.Width div 2),
- Obj^.Y+Obj^.Rect.Y+(Obj^.Rect.Height div 2),
- Min(5*(abs(Obj^.Vel.X)+abs(Obj^.Vel.Y)), 50),
- -Obj^.Vel.X, -Obj^.Vel.Y,
- Obj^.Rect.Width, 16, Color);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Water(Obj^.X+Obj^.Rect.X+(Obj^.Rect.Width div 2),
+ Obj^.Y+Obj^.Rect.Y+(Obj^.Rect.Height div 2),
+ Min(5*(abs(Obj^.Vel.X)+abs(Obj^.Vel.Y)), 50),
+ -Obj^.Vel.X, -Obj^.Vel.Y,
+ Obj^.Rect.Width, 16, Color);
+ {$ENDIF}
end;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index ea7cb7d1a11d50e8b4e0d9ad9e57663fb3cfd424..db438329dd146c0de2d43eb20ec662bc99002c09 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
{$IFNDEF HEADLESS}
r_render,
{$ENDIF}
- e_log, g_map, g_items, g_console, g_gfx, Math,
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ e_log, g_map, g_items, g_console, Math,
g_options, g_triggers, g_game, g_grid, e_res,
wadreader, g_monsters, CONFIG, g_language,
g_net, g_netmsg,
var
a: Integer;
GibsArray: TGibsArray;
- Blood: TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ Blood: TModelBlood;
+ {$ENDIF}
begin
if mid = -1 then
Exit;
Exit;
if not g_PlayerModel_GetGibs(mid, GibsArray) then
Exit;
- Blood := PlayerModelsArray[mid].Blood;
+
+ {$IFDEF ENABLE_GFX}
+ Blood := PlayerModelsArray[mid].Blood;
+ {$ENDIF}
for a := 0 to High(GibsArray) do
with gGibs[CurrentGib] do
positionChanged(); // this updates spatial accelerators
RAngle := Random(360);
- if gBloodCount > 0 then
- g_GFX_Blood(fX, fY, 16*gBloodCount+Random(5*gBloodCount), -16+Random(33), -16+Random(33),
- Random(48), Random(48), Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$IFDEF ENABLE_GFX}
+ if gBloodCount > 0 then
+ begin
+ g_GFX_Blood(
+ fX,
+ fY,
+ 16 * gBloodCount + Random(5 * gBloodCount),
+ -16 + Random(33),
+ -16 + Random(33),
+ Random(48),
+ Random(48),
+ Blood.R,
+ Blood.G,
+ Blood.B,
+ Blood.Kind
+ );
+ end;
+ {$ENDIF}
if CurrentGib >= High(gGibs) then
CurrentGib := 0
HIT_BFG, HIT_ROCKET, HIT_SOME: MakeBloodVector(c, vx, vy);
end;
- if t = HIT_WATER then
- g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
- FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4);
+ {$IFDEF ENABLE_GFX}
+ if t = HIT_WATER then
+ begin
+ g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
+ FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4);
+ end;
+ {$ENDIF}
end;
// Буфер урона:
end;
procedure TPlayer.MakeBloodSimple(Count: Word);
- var Blood: TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ var Blood: TModelBlood;
+ {$ENDIF}
begin
- Blood := SELF.FModel.GetBlood();
- g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)+8,
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
- Count div 2, 3, -1, 16, (PLAYER_RECT.Height*2 div 3),
- Blood.R, Blood.G, Blood.B, Blood.Kind);
- g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-8,
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
- Count div 2, -3, -1, 16, (PLAYER_RECT.Height*2) div 3,
- Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$IFDEF ENABLE_GFX}
+ Blood := SELF.FModel.GetBlood();
+ g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)+8,
+ FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
+ Count div 2, 3, -1, 16, (PLAYER_RECT.Height*2 div 3),
+ Blood.R, Blood.G, Blood.B, Blood.Kind);
+ g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-8,
+ FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
+ Count div 2, -3, -1, 16, (PLAYER_RECT.Height*2) div 3,
+ Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$ENDIF}
end;
procedure TPlayer.MakeBloodVector(Count: Word; VelX, VelY: Integer);
- var Blood: TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ var Blood: TModelBlood;
+ {$ENDIF}
begin
- Blood := SELF.FModel.GetBlood();
- g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
- Count, VelX, VelY, 16, (PLAYER_RECT.Height*2) div 3,
- Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$IFDEF ENABLE_GFX}
+ Blood := SELF.FModel.GetBlood();
+ g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
+ FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
+ Count, VelX, VelY, 16, (PLAYER_RECT.Height*2) div 3,
+ Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$ENDIF}
end;
procedure TPlayer.QueueWeaponSwitch(Weapon: Byte);
FFirePainTime := 0;
FFireAttacker := 0;
-// Анимация возрождения:
- if (not gLoadGameMode) and (not Silent) then
- g_GFX_QueueEffect(
- R_GFX_TELEPORT_FAST,
- FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
- );
+ {$IFDEF ENABLE_GFX}
+ // Анимация возрождения:
+ if (not gLoadGameMode) and (not Silent) then
+ begin
+ g_GFX_QueueEffect(
+ R_GFX_TELEPORT_FAST,
+ FObj.X + PLAYER_RECT.X + (PLAYER_RECT.Width div 2) - 32,
+ FObj.Y + PLAYER_RECT.Y + (PLAYER_RECT.Height div 2) - 32
+ );
+ end;
+ {$ENDIF}
FSpectator := False;
FGhost := False;
if not silent then
begin
g_Sound_PlayExAt('SOUND_GAME_TELEPORT', FObj.X, FObj.Y);
- g_GFX_QueueEffect(
- R_GFX_TELEPORT_FAST,
- FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_TELEPORT_FAST,
+ FObj.X + PLAYER_RECT.X + (PLAYER_RECT.Width div 2) - 32,
+ FObj.Y + PLAYER_RECT.Y + (PLAYER_RECT.Height div 2) - 32
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32, 1,
if not silent then
begin
- g_GFX_QueueEffect(
- R_GFX_TELEPORT_FAST,
- FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
- FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_TELEPORT_FAST,
+ FObj.X + PLAYER_RECT.X + (PLAYER_RECT.Width div 2) - 32,
+ FObj.Y + PLAYER_RECT.Y + (PLAYER_RECT.Height div 2) - 32
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32, 0,
end
else if (FAir mod 31 = 0) and not blockmon then
begin
- g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4);
+ {$ENDIF}
if Random(2) = 0 then
g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
else
if BodyInLiquid(0, 0) then
begin
- g_GFX_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1,
- Obj.Y+Obj.Rect.Height+8, 1, 8, 4);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1,
+ Obj.Y+Obj.Rect.Height+8, 1, 8, 4);
+ {$ENDIF}
if Random(2) = 0 then
g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
else
for i := 1 to Times do
begin
- g_GFX_QueueEffect(
- R_GFX_SMOKE_TRANS,
- Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_SMOKE_WIDTH div 2),
- Obj.Y+Obj.Rect.Height-4+Random(8+Times*2)
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_SMOKE_TRANS,
+ Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_SMOKE_WIDTH div 2),
+ Obj.Y+Obj.Rect.Height-4+Random(8+Times*2)
+ );
+ {$ENDIF}
end;
end;
for i := 1 to Times do
begin
- g_GFX_QueueEffect(
- R_GFX_FLAME,
- Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_FLAME_WIDTH div 2),
- Obj.Y+8+Random(8+Times*2)
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_FLAME,
+ Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_FLAME_WIDTH div 2),
+ Obj.Y+8+Random(8+Times*2)
+ );
+ {$ENDIF}
end;
end;
procedure TCorpse.Damage(Value: Word; SpawnerUID: Word; vx, vy: Integer);
- var Blood: TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ var Blood: TModelBlood;
+ {$ENDIF}
begin
if FState = CORPSE_STATE_REMOVEME then
Exit;
end
else
begin
- Blood := FModel.GetBlood();
FObj.Vel.X := FObj.Vel.X + vx;
FObj.Vel.Y := FObj.Vel.Y + vy;
- g_GFX_Blood(FObj.X+PLAYER_CORPSERECT.X+(PLAYER_CORPSERECT.Width div 2),
- FObj.Y+PLAYER_CORPSERECT.Y+(PLAYER_CORPSERECT.Height div 2),
- Value, vx, vy, 16, (PLAYER_CORPSERECT.Height*2) div 3,
- Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$IFDEF ENABLE_GFX}
+ Blood := FModel.GetBlood();
+ g_GFX_Blood(FObj.X+PLAYER_CORPSERECT.X+(PLAYER_CORPSERECT.Width div 2),
+ FObj.Y+PLAYER_CORPSERECT.Y+(PLAYER_CORPSERECT.Height div 2),
+ Value, vx, vy, 16, (PLAYER_CORPSERECT.Height*2) div 3,
+ Blood.R, Blood.G, Blood.B, Blood.Kind);
+ {$ENDIF}
end;
end;
index 86d5b5a8be9b8d124ad79aa872302319d3d5c076..34dbdfdbe02be7ea1dc9a4056f684f3a3b92e5cd 100644 (file)
interface
- uses MAPDEF, g_textures, g_base, g_basic, g_weapons, utils, g_gfx;
+ uses MAPDEF, g_textures, g_base, g_basic, g_weapons, utils;
const
A_STAND = 0;
Back: Boolean;
end;
+{$IFDEF ENABLE_GFX}
TModelBlood = record
R, G, B, Kind: Byte;
end;
+{$ENDIF}
TModelSound = record
ID: DWORD;
function PlaySound(SoundType, Level: Byte; X, Y: Integer): Boolean;
procedure Update();
- function GetBlood (): TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ function GetBlood (): TModelBlood;
+ {$ENDIF}
+
function GetName (): String;
published
procedure g_PlayerModel_FreeData();
function g_PlayerModel_Load(FileName: String): Boolean;
function g_PlayerModel_GetNames(): SSArray;
-function g_PlayerModel_GetBlood(ModelName: String): TModelBlood;
function g_PlayerModel_Get(ModelName: String): TPlayerModel;
function g_PlayerModel_GetGibs (ModelID: Integer; var Gibs: TGibsArray): Boolean;
function g_PlayerModel_GetIndex (ModelName: String): Integer;
+{$IFDEF ENABLE_GFX}
+ function g_PlayerModel_GetBlood(ModelName: String): TModelBlood;
+{$ENDIF}
+
procedure g_PlayerModel_LoadFake (ModelName, FileName: String);
(* --- private data --- *)
PainSounds: TModelSoundArray;
DieSounds: TModelSoundArray;
SlopSound: Byte;
- Blood: TModelBlood;
+ {$IFDEF ENABLE_GFX}
+ Blood: TModelBlood;
+ {$ENDIF}
// =======================
FileName: String;
Anim: TModelTextures;
implementation
-uses
- g_sound, g_console, SysUtils, g_player, CONFIG,
- e_sound, g_options, g_map, Math, e_log, wadreader;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ g_sound, g_console, SysUtils, g_player, CONFIG,
+ e_sound, g_options, g_map, Math, e_log, wadreader
+ ;
const
FLAG_DEFPOINT: TDFPoint = (X:32; Y:16);
PlayerModelsArray[ID].Author := config.ReadStr('Model', 'author', '');
PlayerModelsArray[ID].Description := config.ReadStr('Model', 'description', '');
PlayerModelsArray[ID].FileName := FileName;
- with PlayerModelsArray[ID] do
- begin
- Blood.R := MAX(0, MIN(255, config.ReadInt('Blood', 'R', 150)));
- Blood.G := MAX(0, MIN(255, config.ReadInt('Blood', 'G', 0)));
- Blood.B := MAX(0, MIN(255, config.ReadInt('Blood', 'B', 0)));
- case config.ReadStr('Blood', 'Kind', 'NORMAL') of
- 'NORMAL': Blood.Kind := BLOOD_NORMAL;
- 'SPARKS': Blood.Kind := BLOOD_CSPARKS;
- 'COMBINE': Blood.Kind := BLOOD_COMBINE;
- else
- Blood.Kind := BLOOD_NORMAL
- end
- end;
+
+ {$IFDEF ENABLE_GFX}
+ with PlayerModelsArray[ID] do
+ begin
+ Blood.R := MAX(0, MIN(255, config.ReadInt('Blood', 'R', 150)));
+ Blood.G := MAX(0, MIN(255, config.ReadInt('Blood', 'G', 0)));
+ Blood.B := MAX(0, MIN(255, config.ReadInt('Blood', 'B', 0)));
+ case config.ReadStr('Blood', 'Kind', 'NORMAL') of
+ 'NORMAL': Blood.Kind := BLOOD_NORMAL;
+ 'SPARKS': Blood.Kind := BLOOD_CSPARKS;
+ 'COMBINE': Blood.Kind := BLOOD_COMBINE;
+ else
+ Blood.Kind := BLOOD_NORMAL
+ end
+ end;
+ {$ENDIF}
for b := A_STAND to A_LAST do
begin
end;
end;
+{$IFDEF ENABLE_GFX}
function g_PlayerModel_GetBlood(ModelName: string): TModelBlood;
var
a: Integer;
Break;
end;
end;
+{$ENDIF}
procedure g_PlayerModel_FreeData();
var i, b: Integer;
FCurrentWeapon := Weapon
end;
+{$IFDEF ENABLE_GFX}
function TPlayerModel.GetBlood (): TModelBlood;
begin
Result := PlayerModelsArray[FID].Blood
end;
+{$ENDIF}
function TPlayerModel.GetName (): String;
begin
index ce31a88c3012f4002c7f06aa7883398b811d6304..6629ef5b060334b2375699df35aa06733806cbfe 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
implementation
-uses
- Math,
- g_player, g_map, g_panel, g_gfx, g_game,
- g_console, g_monsters, g_items, g_phys, g_weapons,
- wadreader, e_log, g_language, e_res,
- g_options, g_net, g_netmsg, utils, xparser, xstreams;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ Math,
+ g_player, g_map, g_panel, g_game,
+ g_console, g_monsters, g_items, g_phys, g_weapons,
+ wadreader, e_log, g_language, e_res,
+ g_options, g_net, g_netmsg, utils, xparser, xstreams
+ ;
const
TRIGGER_SIGNATURE = $58475254; // 'TRGX'
TRIGGER_SHOT_EXPL:
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, wx - 64, wy - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, wx - 64, wy - 64);
+ {$ENDIF}
Projectile := False;
g_Weapon_Explode(wx, wy, 60, 0);
snd := 'SOUND_WEAPON_EXPLODEROCKET';
TRIGGER_SHOT_BFGEXPL:
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, wx - 64, wy - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, wx - 64, wy - 64);
+ {$ENDIF}
Projectile := False;
g_Weapon_BFG9000(wx, wy, 0);
snd := 'SOUND_WEAPON_EXPLODEBFG';
procedure tr_MakeEffect (X, Y, VX, VY: Integer; T, ST, CR, CG, CB: Byte; Silent, Send: Boolean);
begin
- if T = TRIGGER_EFFECT_PARTICLE then
- begin
- case ST of
- TRIGGER_EFFECT_SLIQUID:
- begin
- if (CR = 255) and (CG = 0) and (CB = 0) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 1, 0, 0, 0)
- else if (CR = 0) and (CG = 255) and (CB = 0) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 2, 0, 0, 0)
- else if (CR = 0) and (CG = 0) and (CB = 255) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 3, 0, 0, 0)
- else g_GFX_SimpleWater(X, Y, 1, VX, VY, 0, 0, 0, 0);
- end;
- TRIGGER_EFFECT_LLIQUID: g_GFX_SimpleWater(X, Y, 1, VX, VY, 4, CR, CG, CB);
- TRIGGER_EFFECT_DLIQUID: g_GFX_SimpleWater(X, Y, 1, VX, VY, 5, CR, CG, CB);
- TRIGGER_EFFECT_BLOOD: g_GFX_Blood(X, Y, 1, VX, VY, 0, 0, CR, CG, CB);
- TRIGGER_EFFECT_SPARK: g_GFX_Spark(X, Y, 1, GetAngle2(VX, VY), 0, 0);
- TRIGGER_EFFECT_BUBBLE: g_GFX_Bubbles(X, Y, 1, 0, 0);
+ {$IFDEF ENABLE_GFX}
+ if T = TRIGGER_EFFECT_PARTICLE then
+ begin
+ case ST of
+ TRIGGER_EFFECT_SLIQUID:
+ begin
+ if (CR = 255) and (CG = 0) and (CB = 0) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 1, 0, 0, 0)
+ else if (CR = 0) and (CG = 255) and (CB = 0) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 2, 0, 0, 0)
+ else if (CR = 0) and (CG = 0) and (CB = 255) then g_GFX_SimpleWater(X, Y, 1, VX, VY, 3, 0, 0, 0)
+ else g_GFX_SimpleWater(X, Y, 1, VX, VY, 0, 0, 0, 0);
+ end;
+ TRIGGER_EFFECT_LLIQUID: g_GFX_SimpleWater(X, Y, 1, VX, VY, 4, CR, CG, CB);
+ TRIGGER_EFFECT_DLIQUID: g_GFX_SimpleWater(X, Y, 1, VX, VY, 5, CR, CG, CB);
+ TRIGGER_EFFECT_BLOOD: g_GFX_Blood(X, Y, 1, VX, VY, 0, 0, CR, CG, CB);
+ TRIGGER_EFFECT_SPARK: g_GFX_Spark(X, Y, 1, GetAngle2(VX, VY), 0, 0);
+ TRIGGER_EFFECT_BUBBLE: g_GFX_Bubbles(X, Y, 1, 0, 0);
+ end;
end;
- end;
+ {$ENDIF}
if T = TRIGGER_EFFECT_ANIMATION then
begin
case ST of
EFFECT_TELEPORT: begin
if not Silent then g_Sound_PlayExAt('SOUND_GAME_TELEPORT', X, Y);
- g_GFX_QueueEffect(R_GFX_TELEPORT_FAST, X - 32, Y - 32);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_TELEPORT_FAST, X - 32, Y - 32);
+ {$ENDIF}
if Send and g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(X, Y, Byte(not Silent), NET_GFX_TELE);
end;
EFFECT_RESPAWN: begin
if not Silent then g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', X, Y);
- g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X - 16, Y - 16);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_ITEM_RESPAWN, X - 16, Y - 16);
+ {$ENDIF}
if Send and g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(X-16, Y-16, Byte(not Silent), NET_GFX_RESPAWN);
end;
EFFECT_FIRE: begin
if not Silent then g_Sound_PlayExAt('SOUND_FIRE', X, Y);
- g_GFX_QueueEffect(R_GFX_FIRE, X - 32, Y - 128);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_FIRE, X - 32, Y - 128);
+ {$ENDIF}
if Send and g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(X-32, Y-128, Byte(not Silent), NET_GFX_FIRE);
end;
end;
if tgcMax > 0 then Inc(SpawnedCount);
case tgcEffect of
- EFFECT_TELEPORT: begin
+ EFFECT_TELEPORT:
+ begin
g_Sound_PlayExAt('SOUND_GAME_TELEPORT', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_TELEPORT_FAST,
- mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
- mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-32
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_TELEPORT_FAST,
+ mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
+ mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-32
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-32, 1,
NET_GFX_TELE);
end;
- EFFECT_RESPAWN: begin
+ EFFECT_RESPAWN:
+ begin
g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_ITEM_RESPAWN,
- mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-16,
- mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-16
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_ITEM_RESPAWN,
+ mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-16,
+ mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-16
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-16,
mon.Obj.Y+mon.Obj.Rect.Y+(mon.Obj.Rect.Height div 2)-16, 1,
NET_GFX_RESPAWN);
end;
- EFFECT_FIRE: begin
+ EFFECT_FIRE:
+ begin
g_Sound_PlayExAt('SOUND_FIRE', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_FIRE,
- mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
- mon.Obj.Y+mon.Obj.Rect.Y+mon.Obj.Rect.Height-128
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_FIRE,
+ mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
+ mon.Obj.Y+mon.Obj.Rect.Y+mon.Obj.Rect.Height-128
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(mon.Obj.X+mon.Obj.Rect.X+(mon.Obj.Rect.Width div 2)-32,
mon.Obj.Y+mon.Obj.Rect.Y+mon.Obj.Rect.Height-128, 1,
if tgcMax > 0 then Inc(SpawnedCount);
case tgcEffect of
- EFFECT_TELEPORT: begin
+ EFFECT_TELEPORT:
+ begin
it := g_Items_ByIdx(iid);
g_Sound_PlayExAt('SOUND_GAME_TELEPORT', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_TELEPORT_FAST,
- it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
- it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-32
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_TELEPORT_FAST,
+ it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
+ it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-32
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-32, 1,
NET_GFX_TELE);
end;
- EFFECT_RESPAWN: begin
+ EFFECT_RESPAWN:
+ begin
it := g_Items_ByIdx(iid);
g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_ITEM_RESPAWN,
- it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-16,
- it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-16
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_ITEM_RESPAWN,
+ it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-16,
+ it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-16
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-16,
it.Obj.Y+it.Obj.Rect.Y+(it.Obj.Rect.Height div 2)-16, 1,
NET_GFX_RESPAWN);
end;
- EFFECT_FIRE: begin
+ EFFECT_FIRE:
+ begin
it := g_Items_ByIdx(iid);
g_Sound_PlayExAt('SOUND_FIRE', tgcTX, tgcTY);
- g_GFX_QueueEffect(
- R_GFX_FIRE,
- it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
- it.Obj.Y+it.Obj.Rect.Y+it.Obj.Rect.Height-128
- );
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(
+ R_GFX_FIRE,
+ it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
+ it.Obj.Y+it.Obj.Rect.Y+it.Obj.Rect.Height-128
+ );
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then
MH_SEND_Effect(it.Obj.X+it.Obj.Rect.X+(it.Obj.Rect.Width div 2)-32,
it.Obj.Y+it.Obj.Rect.Y+it.Obj.Rect.Height-128, 1,
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 12d20a4b6be36f90b176903f3c4a3b68ba8fb33b..b8c35a8a77a73d29cf762e6ce9d2e2e7e80a6f8e 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
implementation
-uses
- Math, g_map, g_player, g_gfx, g_sound, g_panel,
- g_console, g_options, g_game,
- g_triggers, MAPDEF, e_log, g_monsters, g_saveload,
- g_language, g_netmsg, g_grid,
- geom, binheap, hashtable, utils, xstreams;
+ uses
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ Math, g_map, g_player, g_sound, g_panel,
+ g_console, g_options, g_game,
+ g_triggers, MAPDEF, e_log, g_monsters, g_saveload,
+ g_language, g_netmsg, g_grid,
+ geom, binheap, hashtable, utils, xstreams
+ ;
type
TWaterPanel = record
stt := getTimeMicro()-stt;
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);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_Spark(wallHitX, wallHitY, 2+Random(2), 180+a, 0, 0);
+ {$ENDIF}
if g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(wallHitX, wallHitY, 180+a, NET_GFX_SPARK);
end
else
procedure g_Weapon_bfghit(x, y: Integer);
begin
- g_GFX_QueueEffect(R_GFX_BFG_HIT, x - 32, y - 32);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_BFG_HIT, x - 32, y - 32);
+ {$ENDIF}
end;
procedure g_Weapon_pistol(x, y, xd, yd: Integer; SpawnerUID: Word;
o: TObj;
spl: Boolean;
Loud: Boolean;
- tcx, tcy: Integer;
+ {$IFDEF ENABLE_GFX}
+ var tcx, tcy: Integer;
+ {$ENDIF}
begin
if Shots = nil then
Exit;
if WordBool(st and MOVE_HITAIR) then
g_Obj_SetSpeed(@Obj, 12);
- // Â âîäå øëåéô - ïóçûðè, â âîçäóõå øëåéô - äûì:
- if WordBool(st and MOVE_INWATER) then
- g_GFX_Bubbles(Obj.X+(Obj.Rect.Width div 2),
- Obj.Y+(Obj.Rect.Height div 2),
- 1+Random(3), 16, 16)
- else
- g_GFX_QueueEffect(R_GFX_SMOKE_TRANS, Obj.X-14+Random(9), Obj.Y+(Obj.Rect.Height div 2)-20+Random(9));
+ {$IFDEF ENABLE_GFX}
+ // Â âîäå øëåéô - ïóçûðè, â âîçäóõå øëåéô - äûì:
+ if WordBool(st and MOVE_INWATER) then
+ begin
+ g_GFX_Bubbles(Obj.X + (Obj.Rect.Width div 2), Obj.Y + (Obj.Rect.Height div 2), 1 + Random(3), 16, 16)
+ end
+ else
+ begin
+ g_GFX_QueueEffect(R_GFX_SMOKE_TRANS, Obj.X-14+Random(9), Obj.Y+(Obj.Rect.Height div 2)-20+Random(9));
+ end;
+ {$ENDIF}
// Ïîïàëè â êîãî-òî èëè â ñòåíó:
if WordBool(st and (MOVE_HITWALL or MOVE_HITLAND or MOVE_HITCEIL)) or
g_Weapon_Explode(cx, cy, 60, SpawnerUID);
if ShotType = WEAPON_SKEL_FIRE then
- begin // Âçðûâ ñíàðÿäà Ñêåëåòà
+ begin // Âçðûâ ñíàðÿäà Ñêåëåòà
+ {$IFDEF ENABLE_GFX}
g_GFX_QueueEffect(R_GFX_EXPLODE_SKELFIRE, Obj.X + 32 - 58, Obj.Y + 8 - 36);
g_DynLightExplosion((Obj.X+32), (Obj.Y+8), 64, 1, 0, 0);
- end
+ {$ENDIF}
+ end
else
- begin // Âçðûâ Ðàêåòû
+ begin // Âçðûâ Ðàêåòû
+ {$IFDEF ENABLE_GFX}
g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
g_DynLightExplosion(cx, cy, 64, 1, 0, 0);
- end;
+ {$ENDIF}
+ end;
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEROCKET', Obj.X, Obj.Y);
(g_Weapon_Hit(@Obj, a, SpawnerUID, HIT_SOME, False) <> 0) or
(Timeout < 1) then
begin
- if ShotType = WEAPON_PLASMA then
- g_GFX_QueueEffect(R_GFX_EXPLODE_PLASMA, cx - 16, cy - 16)
- else
- g_GFX_QueueEffect(R_GFX_EXPLODE_BSPFIRE, cx - 16, cy - 16);
- g_DynLightExplosion(cx, cy, 32, 0, 0.5, 0.5);
+ {$IFDEF ENABLE_GFX}
+ if ShotType = WEAPON_PLASMA then
+ g_GFX_QueueEffect(R_GFX_EXPLODE_PLASMA, cx - 16, cy - 16)
+ else
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BSPFIRE, cx - 16, cy - 16);
+ g_DynLightExplosion(cx, cy, 32, 0, 0.5, 0.5);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEPLASMA', Obj.X, Obj.Y);
ShotType := 0;
end;
// Ïîä âîäîé òîæå
if WordBool(st and (MOVE_HITWATER or MOVE_INWATER)) then
begin
- if WordBool(st and MOVE_HITWATER) then
- begin
- tcx := Random(8);
- tcy := Random(8);
- g_GFX_QueueEffect(R_GFX_SMOKE, cx-4+tcx-(R_GFX_SMOKE_WIDTH div 2), cy-4+tcy-(R_GFX_SMOKE_HEIGHT div 2));
- end
- else
- g_GFX_Bubbles(cx, cy, 1+Random(3), 16, 16);
+ {$IFDEF ENABLE_GFX}
+ if WordBool(st and MOVE_HITWATER) then
+ begin
+ tcx := Random(8);
+ tcy := Random(8);
+ g_GFX_QueueEffect(R_GFX_SMOKE, cx-4+tcx-(R_GFX_SMOKE_WIDTH div 2), cy-4+tcy-(R_GFX_SMOKE_HEIGHT div 2));
+ end
+ else
+ begin
+ g_GFX_Bubbles(cx, cy, 1 + Random(3), 16, 16);
+ end;
+ {$ENDIF}
ShotType := 0;
Continue;
end;
if (gTime mod LongWord(tf) = 0) then
begin
- case Stopped of
- MOVE_HITWALL: begin tcx := cx-4+Random(8); tcy := cy-12+Random(24); end;
- MOVE_HITLAND: begin tcx := cx-12+Random(24); tcy := cy-10+Random(8); end;
- MOVE_HITCEIL: begin tcx := cx-12+Random(24); tcy := cy+6+Random(8); end;
- else begin tcx := cx-4+Random(8); tcy := cy-4+Random(8); end;
- end;
- g_GFX_QueueEffect(R_GFX_FLAME_RAND, tcx - (R_GFX_FLAME_WIDTH div 2), tcy - (R_GFX_FLAME_HEIGHT div 2));
- //g_DynLightExplosion(tcx, tcy, 1, 1, 0.8, 0.3);
+ {$IFDEF ENABLE_GFX}
+ case Stopped of
+ MOVE_HITWALL: begin tcx := cx-4+Random(8); tcy := cy-12+Random(24); end;
+ MOVE_HITLAND: begin tcx := cx-12+Random(24); tcy := cy-10+Random(8); end;
+ MOVE_HITCEIL: begin tcx := cx-12+Random(24); tcy := cy+6+Random(8); end;
+ else begin tcx := cx-4+Random(8); tcy := cy-4+Random(8); end;
+ end;
+ g_GFX_QueueEffect(R_GFX_FLAME_RAND, tcx - (R_GFX_FLAME_WIDTH div 2), tcy - (R_GFX_FLAME_HEIGHT div 2));
+ //g_DynLightExplosion(tcx, tcy, 1, 1, 0.8, 0.3);
+ {$ENDIF}
end;
end;
begin
// Ëó÷è BFG:
if g_Game_IsServer then g_Weapon_BFG9000(cx, cy, SpawnerUID);
- g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, cx - 64, cy - 64);
- g_DynLightExplosion(cx, cy, 96, 0, 1, 0);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, cx - 64, cy - 64);
+ g_DynLightExplosion(cx, cy, 96, 0, 1, 0);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBFG', Obj.X, Obj.Y);
ShotType := 0;
end;
(g_Weapon_Hit(@Obj, a, SpawnerUID, HIT_SOME) <> 0) or
(Timeout < 1) then
begin
- case ShotType of
- WEAPON_IMP_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_IMPFIRE, cx - 32, cy - 32);
- WEAPON_CACO_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_CACOFIRE, cx - 32, cy - 32);
- WEAPON_BARON_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_BARONFIRE, cx - 32, cy - 32);
- end;
+ {$IFDEF ENABLE_GFX}
+ case ShotType of
+ WEAPON_IMP_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_IMPFIRE, cx - 32, cy - 32);
+ WEAPON_CACO_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_CACOFIRE, cx - 32, cy - 32);
+ WEAPON_BARON_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_BARONFIRE, cx - 32, cy - 32);
+ end;
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBALL', Obj.X, Obj.Y);
ShotType := 0;
end;
(g_Weapon_Hit(@Obj, 40, SpawnerUID, HIT_SOME, False) <> 0) or
(Timeout < 1) then
begin
- // Âçðûâ:
- g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ // Âçðûâ:
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBALL', Obj.X, Obj.Y);
ShotType := 0;
end;
end;
procedure g_Weapon_DestroyShot(I: Integer; X, Y: Integer; Loud: Boolean = True);
- var cx, cy: Integer;
+ {$IFDEF ENABLE_GFX}
+ var cx, cy: Integer;
+ {$ENDIF}
begin
if Shots = nil then
Exit;
if ShotType = 0 then Exit;
Obj.X := X;
Obj.Y := Y;
- cx := Obj.X + (Obj.Rect.Width div 2);
- cy := Obj.Y + (Obj.Rect.Height div 2);
+ {$IFDEF ENABLE_GFX}
+ cx := Obj.X + (Obj.Rect.Width div 2);
+ cy := Obj.Y + (Obj.Rect.Height div 2);
+ {$ENDIF}
case ShotType of
WEAPON_ROCKETLAUNCHER, WEAPON_SKEL_FIRE: // Ðàêåòû è ñíàðÿäû Ñêåëåòà
begin
if Loud then
begin
- if ShotType = WEAPON_SKEL_FIRE then
- g_GFX_QueueEffect(R_GFX_EXPLODE_SKELFIRE, (Obj.X + 32) - 32, (Obj.Y + 8) - 32)
- else
- g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ {$IFDEF ENABLE_GFX}
+ if ShotType = WEAPON_SKEL_FIRE then
+ g_GFX_QueueEffect(R_GFX_EXPLODE_SKELFIRE, (Obj.X + 32) - 32, (Obj.Y + 8) - 32)
+ else
+ g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEROCKET', Obj.X, Obj.Y);
end;
end;
begin
if loud then
begin
- if ShotType = WEAPON_PLASMA then
- g_GFX_QueueEffect(R_GFX_EXPLODE_PLASMA, cx - 16, cy - 16)
- else
- g_GFX_QueueEffect(R_GFX_EXPLODE_BSPFIRE, cx - 16, cy - 16);
+ {$IFDEF ENABLE_GFX}
+ if ShotType = WEAPON_PLASMA then
+ g_GFX_QueueEffect(R_GFX_EXPLODE_PLASMA, cx - 16, cy - 16)
+ else
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BSPFIRE, cx - 16, cy - 16);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEPLASMA', Obj.X, Obj.Y);
end;
end;
WEAPON_BFG: // BFG
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, cx - 64, cy - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_BFG, cx - 64, cy - 64);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBFG', Obj.X, Obj.Y);
end;
begin
if loud then
begin
- case ShotType of
- WEAPON_IMP_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_IMPFIRE, cx - 32, cy - 32);
- WEAPON_CACO_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_CACOFIRE, cx - 32, cy - 32);
- WEAPON_BARON_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_BARONFIRE, cx - 32, cy - 32);
- end;
+ {$IFDEF ENABLE_GFX}
+ case ShotType of
+ WEAPON_IMP_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_IMPFIRE, cx - 32, cy - 32);
+ WEAPON_CACO_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_CACOFIRE, cx - 32, cy - 32);
+ WEAPON_BARON_FIRE: g_GFX_QueueEffect(R_GFX_EXPLODE_BARONFIRE, cx - 32, cy - 32);
+ end;
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBALL', Obj.X, Obj.Y);
end;
end;
WEAPON_MANCUB_FIRE: // Âûñòðåë Ìàíêóáóñà
begin
- g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ {$IFDEF ENABLE_GFX}
+ g_GFX_QueueEffect(R_GFX_EXPLODE_ROCKET, cx - 64, cy - 64);
+ {$ENDIF}
g_Sound_PlayExAt('SOUND_WEAPON_EXPLODEBALL', Obj.X, Obj.Y);
end;
end; // case ShotType of...
index 67598f3ca953a6e58187a8b2fa7da6294c5a7e13..f838360e4156efb0634ff3d112cb150dcab9a5c7 100644 (file)
{$IFDEF ENABLE_MENU}
g_gui, g_menu,
{$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ g_gfx, r_gfx,
+ {$ENDIF}
SysUtils, Classes, Math,
g_base, g_basic, r_graphics,
g_system,
MAPDEF, xprofiler, utils, wadreader, CONFIG,
e_input, e_sound,
g_language, g_console, g_triggers, g_player, g_options, g_monsters, g_map, g_panel,
- g_items, g_weapons, g_gfx, g_phys, g_net, g_netmaster,
- g_game, r_console, r_gfx, r_items, r_map, r_monsters, r_weapons, r_netmaster, r_player, r_textures,
+ g_items, g_weapons, g_phys, g_net, g_netmaster,
+ g_game, r_console, r_items, r_map, r_monsters, r_weapons, r_netmaster, r_player, r_textures,
r_playermodel
;
drawOther('monsters', @r_Monsters_Draw);
drawOther('itemdrop', @r_Items_DrawDrop);
drawPanelType('*door', PANEL_CLOSEDOOR, g_rlayer_door);
- drawOther('gfx', @r_GFX_Draw);
+ {$IFDEF ENABLE_GFX}
+ drawOther('gfx', @r_GFX_Draw);
+ {$ENDIF}
drawOther('flags', @r_Map_DrawFlags);
drawPanelType('*acid1', PANEL_ACID1, g_rlayer_acid1);
drawPanelType('*acid2', PANEL_ACID2, g_rlayer_acid2);
index 1773ba729dd1090331bb415d4cc8efbb35bbd5bc..b49c5a96b868f4c5b077a03017eda3dc7b577eab 100644 (file)
function r_Render_WriteScreenShot (filename: String): Boolean;
function r_Render_GetGibRect (m, id: Integer): TRectWH;
- procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
-{$IFDEF ENABLE_TOUCH}
- // touch screen button location and size
- procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
-{$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
+ {$ENDIF}
+
+ {$IFDEF ENABLE_TOUCH}
+ // touch screen button location and size
+ procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
+ {$ENDIF}
procedure r_Render_DrawLoading (force: Boolean); // !!! remove it
{$IFDEF ENABLE_TOUCH}
r_touch,
{$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ r_gfx,
+ {$ENDIF}
SysUtils, Classes, Math,
e_log, g_system, utils,
g_game, g_options, g_console,
r_window, r_graphics, r_console, r_playermodel, r_textures, r_animations,
- r_weapons, r_items, r_gfx, r_monsters, r_map, r_player, r_game
+ r_weapons, r_items, r_monsters, r_map, r_player, r_game
;
var
r_Monsters_Load;
r_Weapon_Load;
r_Items_Load;
- r_GFX_Load;
+ {$IFDEF ENABLE_GFX}
+ r_GFX_Load;
+ {$ENDIF}
end;
procedure r_Render_Free;
begin
- r_GFX_Free;
+ {$IFDEF ENABLE_GFX}
+ r_GFX_Free;
+ {$ENDIF}
r_Items_Free;
r_Weapon_Free;
r_Monsters_Free;
procedure r_Render_Update;
begin
- r_GFX_Update;
+ {$IFDEF ENABLE_GFX}
+ r_GFX_Update;
+ {$ENDIF}
r_Map_Update;
r_PlayerModel_Update;
r_Console_Update;
Result := r_PlayerModel_GetGibRect(m, id)
end;
+{$IFDEF ENABLE_GFX}
procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
begin
r_GFX_OnceAnim(AnimType, X, Y)
end;
+{$ENDIF}
{$IFDEF ENABLE_TOUCH}
procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index 74bf8717d170806b5ef6abd5bf40adddc2d26901..ae6ded6acfc7eb1d00c1924427fd920fa5c1a64f 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
{$UNDEF ENABLE_TOUCH}
{$DEFINE DISABLE_TOUCH}
{$ENDIF}
+ {$IFDEF ENABLE_GFX}
+ {$WARNING GFX in headless mode has no sense. Disabled.}
+ {$UNDEF ENABLE_GFX}
+ {$DEFINE DISABLE_GFX}
+ {$ENDIF}
{$ENDIF}
{$IF DEFINED(ENABLE_MENU) AND DEFINED(DISABLE_MENU)}
{$ENDIF}
{$ENDIF}
+{$IF DEFINED(ENABLE_GFX) AND DEFINED(DISABLE_GFX)}
+ {$ERROR Select ENABLE_GFX or DISABLE_GFX}
+{$ELSEIF NOT DEFINED(ENABLE_GFX) AND NOT DEFINED(DISABLE_GFX)}
+ // default ENABLE/DISABLE gfx
+ {$IFDEF HEADLESS}
+ {$DEFINE DISABLE_GFX}
+ {$ELSE}
+ {$DEFINE ENABLE_GFX}
+ {$ENDIF}
+{$ENDIF}
+
{$IF DEFINED(USE_SYSSTUB)}
{$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
{$ERROR Only one system driver must be selected!}