diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index bf16be8604bbb3ba5a91b4156d4a5fb23819d5c7..5c4f23285f7741d9bd374f675c5bbee486d805ae 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
procedure g_Menu_Init();
procedure g_Menu_Free();
procedure g_Menu_Reset();
procedure g_Menu_Init();
procedure g_Menu_Free();
procedure g_Menu_Reset();
-procedure LoadStdFont(cfgres, texture: string; var FontID: DWORD);
-procedure LoadFont(txtres, fntres: string; var FontID: DWORD);
procedure g_Menu_AskLanguage();
procedure g_Menu_Show_SaveMenu();
procedure g_Menu_AskLanguage();
procedure g_Menu_Show_SaveMenu();
procedure g_Menu_Show_QuitGameMenu();
var
procedure g_Menu_Show_QuitGameMenu();
var
- gMenuFont: DWORD;
- gMenuSmallFont: DWORD;
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
implementation
uses
implementation
uses
- g_gui, g_textures, r_graphics, g_window, g_game, g_map,
- g_base, g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
+ {$IFDEF ENABLE_GFX}
+ g_gfx,
+ {$ENDIF}
+ {$IFDEF ENABLE_GIBS}
+ g_gibs,
+ {$ENDIF}
+ g_gui, r_textures, r_graphics, g_game, g_map,
+ 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,
e_log, SysUtils, CONFIG, g_playermodel, DateUtils,
MAPDEF, Math, g_saveload,
g_language, e_res,
- g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch,
- utils, wadreader, g_system, r_game;
+ g_net, g_netmsg, g_netmaster, g_items, e_input,
+ utils, wadreader, g_system, r_render, r_game;
type TYNCallback = procedure (yes:Boolean);
type TYNCallback = procedure (yes:Boolean);
var
menu: TGUIMenu;
i: Integer;
var
menu: TGUIMenu;
i: Integer;
- ovs: Boolean;
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
else
gBPP := 32;
else
gBPP := 32;
- ovs := gVSync;
gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
- if (ovs <> gVSync) then
- sys_EnableVSync(gVSync);
gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
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_Shells_SetMax(TGUIScroll(menu.GetControl('scShellsMax')).Value*30);
- g_Gibs_SetMax(TGUIScroll(menu.GetControl('scGibsMax')).Value*25);
+ {$IFDEF ENABLE_GIBS}
+ g_Gibs_SetMax(TGUIScroll(menu.GetControl('scGibsMax')).Value*25);
+ {$ENDIF}
g_Corpses_SetMax(TGUIScroll(menu.GetControl('scCorpsesMax')).Value*5);
g_Corpses_SetMax(TGUIScroll(menu.GetControl('scCorpsesMax')).Value*5);
- case TGUISwitch(menu.GetControl('swGibsCount')).ItemIndex of
- 0: gGibsCount := 0;
- 1: gGibsCount := 8;
- 2: gGibsCount := 16;
- 3: gGibsCount := 32;
- else gGibsCount := 48;
- end;
+ {$IFDEF ENABLE_GIBS}
+ case TGUISwitch(menu.GetControl('swGibsCount')).ItemIndex of
+ 0: gGibsCount := 0;
+ 1: gGibsCount := 8;
+ 2: gGibsCount := 16;
+ 3: gGibsCount := 32;
+ else gGibsCount := 48;
+ end;
+ {$ENDIF}
gBloodCount := TGUISwitch(menu.GetControl('swBloodCount')).ItemIndex;
gFlash := TGUISwitch(menu.GetControl('swScreenFlash')).ItemIndex;
gBloodCount := TGUISwitch(menu.GetControl('swBloodCount')).ItemIndex;
gFlash := TGUISwitch(menu.GetControl('swScreenFlash')).ItemIndex;
TEAM_RED, TEAM_BLUE);
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
begin
TEAM_RED, TEAM_BLUE);
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
begin
- gPlayer1Settings.Model := Model.Name;
+ gPlayer1Settings.Model := Model.GetName();
gPlayer1Settings.Color := Model.Color;
end;
gPlayer1Settings.Color := Model.Color;
end;
TEAM_RED, TEAM_BLUE);
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
begin
TEAM_RED, TEAM_BLUE);
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
begin
- gPlayer2Settings.Model := Model.Name;
+ gPlayer2Settings.Model := Model.GetName();
gPlayer2Settings.Color := Model.Color;
end;
gPlayer2Settings.Color := Model.Color;
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
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('scShellsMax')).Value := g_Shells_GetMax() div 30;
- TGUIScroll(menu.GetControl('scGibsMax')).Value := g_Gibs_GetMax() div 25;
+ {$IFDEF ENABLE_GIBS}
+ TGUIScroll(menu.GetControl('scGibsMax')).Value := g_Gibs_GetMax() div 25;
+ {$ENDIF}
TGUIScroll(menu.GetControl('scCorpsesMax')).Value := g_Corpses_GetMax() div 5;
TGUISwitch(menu.GetControl('swBloodCount')).ItemIndex := gBloodCount;
TGUIScroll(menu.GetControl('scCorpsesMax')).Value := g_Corpses_GetMax() div 5;
TGUISwitch(menu.GetControl('swBloodCount')).ItemIndex := gBloodCount;
with TGUISwitch(menu.GetControl('swGibsType')) do
if gAdvGibs then ItemIndex := 1 else ItemIndex := 0;
with TGUISwitch(menu.GetControl('swGibsType')) do
if gAdvGibs then ItemIndex := 1 else ItemIndex := 0;
- with TGUISwitch(menu.GetControl('swGibsCount')) do
- case gGibsCount of
- 0: ItemIndex := 0;
- 8: ItemIndex := 1;
- 16: ItemIndex := 2;
- 32: ItemIndex := 3;
- else ItemIndex := 4;
+ {$IFDEF ENABLE_GIBS}
+ with TGUISwitch(menu.GetControl('swGibsCount')) do
+ begin
+ case gGibsCount of
+ 0: ItemIndex := 0;
+ 8: ItemIndex := 1;
+ 16: ItemIndex := 2;
+ 32: ItemIndex := 3;
+ else ItemIndex := 4;
+ end;
end;
end;
+ {$ENDIF}
with TGUISwitch(menu.GetControl('swBackGround')) do
if gDrawBackGround then ItemIndex := 0 else ItemIndex := 1;
with TGUISwitch(menu.GetControl('swBackGround')) do
if gDrawBackGround then ItemIndex := 0 else ItemIndex := 1;
slWaitStr := _lc[I_NET_SLIST_WAIT];
slWaitStr := _lc[I_NET_SLIST_WAIT];
- r_Game_Draw;
+ r_Render_Draw;
sys_Repaint;
slReturnPressed := True;
sys_Repaint;
slReturnPressed := True;
ProcChangeColor(nil);
end;
ProcChangeColor(nil);
end;
-procedure LoadStdFont(cfgres, texture: string; var FontID: DWORD);
-var
- cwdt, chgt: Byte;
- spc: ShortInt;
- ID: DWORD;
- wad: TWADFile;
- cfgdata: Pointer;
- cfglen: Integer;
- config: TConfig;
-begin
- cfglen := 0;
-
- wad := TWADFile.Create;
- if wad.ReadFile(GameWAD) then
- wad.GetResource('FONTS/'+cfgres, cfgdata, cfglen);
- wad.Free();
-
- if cfglen <> 0 then
- begin
- g_Texture_CreateWADEx('FONT_STD', GameWAD+':FONTS\'+texture);
-
- config := TConfig.CreateMem(cfgdata, cfglen);
- cwdt := Min(Max(config.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
- chgt := Min(Max(config.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
- spc := Min(Max(config.ReadInt('FontMap', 'Kerning', 0), -128), 127);
-
- if g_Texture_Get('FONT_STD', ID) then
- e_TextureFontBuild(ID, FontID, cwdt, chgt, spc);
-
- config.Free();
- end;
-
- if cfglen <> 0 then FreeMem(cfgdata);
-end;
-
-procedure LoadFont(txtres, fntres: string; var FontID: DWORD);
-var
- cwdt, chgt: Byte;
- spc: ShortInt;
- CharID: DWORD;
- wad: TWADFile;
- cfgdata, fntdata: Pointer;
- cfglen, fntlen: Integer;
- config: TConfig;
- chrwidth: Integer;
- a: Byte;
-begin
- cfglen := 0;
- fntlen := 0;
-
- wad := TWADFile.Create;
- if wad.ReadFile(GameWAD) then
- begin
- wad.GetResource('FONTS/'+txtres, cfgdata, cfglen);
- wad.GetResource('FONTS/'+fntres, fntdata, fntlen);
- end;
- wad.Free();
-
- if cfglen <> 0 then
- begin
- config := TConfig.CreateMem(cfgdata, cfglen);
- cwdt := Min(Max(config.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
- chgt := Min(Max(config.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
-
- spc := Min(Max(config.ReadInt('FontMap', 'Kerning', 0), -128), 127);
- FontID := e_CharFont_Create(spc);
-
- for a := 0 to 255 do
- begin
- chrwidth := config.ReadInt(IntToStr(a), 'Width', 0);
- if chrwidth = 0 then Continue;
-
- if e_CreateTextureMemEx(fntdata, fntlen, CharID, cwdt*(a mod 16), chgt*(a div 16),
- cwdt, chgt) then
- e_CharFont_AddChar(FontID, CharID, Chr(a), chrwidth);
- end;
-
- config.Free();
- end;
-
- if cfglen <> 0 then FreeMem(cfgdata);
- if fntlen <> 0 then FreeMem(fntdata);
-end;
-
procedure MenuLoadData();
begin
e_WriteLog('Loading menu data...', TMsgType.Notify);
procedure MenuLoadData();
begin
e_WriteLog('Loading menu data...', TMsgType.Notify);
procedure ProcOptionsPlayersMIMenu();
var
s, a: string;
procedure ProcOptionsPlayersMIMenu();
var
s, a: string;
- b: TModelInfo;
+ i: Integer;
begin
if g_ActiveWindow.Name = 'OptionsPlayersP1Menu' then s := 'P1' else s := 'P2';
begin
if g_ActiveWindow.Name = 'OptionsPlayersP1Menu' then s := 'P1' else s := 'P2';
if a = '' then Exit;
if a = '' then Exit;
- b := g_PlayerModel_GetInfo(a);
-
+ i := g_PlayerModel_GetIndex(a);
with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
begin
with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
begin
- TGUILabel(GetControl('lbName')).Text := b.Name;
- TGUILabel(GetControl('lbAuthor')).Text := b.Author;
- TGUIMemo(GetControl('meComment')).SetText(b.Description);
+ TGUILabel(GetControl('lbName')).Text := PlayerModelsArray[i].Name;
+ TGUILabel(GetControl('lbAuthor')).Text := PlayerModelsArray[i].Author;
+ TGUIMemo(GetControl('meComment')).SetText(PlayerModelsArray[i].Description);
- if b.HaveWeapon then
+ if PlayerModelsArray[i].HaveWeapon then
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_YES]
else
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_NO];
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_YES]
else
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_NO];
with TGUIModelView(g_ActiveWindow.GetControl('mv'+s+'Model')) do
begin
NextAnim();
with TGUIModelView(g_ActiveWindow.GetControl('mv'+s+'Model')) do
begin
NextAnim();
- Model.GetCurrentAnimation.Loop := True;
- Model.GetCurrentAnimationMask.Loop := True;
+ Model.AnimState.Loop := True;
end;
end;
end;
end;
procedure g_Menu_Init();
begin
MenuLoadData();
procedure g_Menu_Init();
begin
MenuLoadData();
- g_GUI_Init();
CreateAllMenus();
end;
procedure g_Menu_Free();
begin
CreateAllMenus();
end;
procedure g_Menu_Free();
begin
- g_GUI_Destroy();
-
- e_WriteLog('Releasing menu data...', TMsgType.Notify);
-
MenuFreeData();
end;
MenuFreeData();
end;