DEADSOFTWARE

menu: optionally disable menu in client
[d2df-sdl.git] / src / game / g_menu.pas
index cb5ea3cabb527cf74084aaf9511b0ec07bc9e79f..fe851b8250fc878ba0935ea3b65697e7dc0f21bd 100644 (file)
@@ -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;
@@ -49,7 +45,7 @@ uses
   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_render;
+  utils, wadreader, g_system, r_render, r_game;
 
 
 type TYNCallback = procedure (yes:Boolean);
@@ -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);