X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=1795d3dfac3fee06ec27dce320d5cbdb22af01f6;hb=83221a8d1b958465bd68e3c79575f4a94c8ffa42;hp=808c5f4515641e2a0183bad01e92d4b327361838;hpb=7f57e4b195f1a553c5bb01638cc7d9908c992c88;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 808c5f4..1795d3d 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -20,8 +20,6 @@ interface 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(); @@ -33,8 +31,6 @@ procedure g_Menu_Show_EndGameMenu(); procedure g_Menu_Show_QuitGameMenu(); var - gMenuFont: DWORD; - gMenuSmallFont: DWORD; PromptIP: string; PromptPort: Word; TempScale: Integer = -1; @@ -48,8 +44,8 @@ uses 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); @@ -780,7 +776,7 @@ begin slWaitStr := _lc[I_NET_SLIST_WAIT]; - r_Game_Draw; + r_Render_Draw; sys_Repaint; slReturnPressed := True; @@ -953,90 +949,6 @@ begin 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); @@ -1349,7 +1261,7 @@ end; procedure ProcOptionsPlayersMIMenu(); var s, a: string; - b: TModelInfo; + i: Integer; begin if g_ActiveWindow.Name = 'OptionsPlayersP1Menu' then s := 'P1' else s := 'P2'; @@ -1357,15 +1269,14 @@ begin if a = '' then Exit; - b := g_PlayerModel_GetInfo(a); - + i := g_PlayerModel_GetIndex(a); 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];