DEADSOFTWARE

added license info
[d2df-sdl.git] / src / game / g_menu.pas
index be5f4323240d895f97d6c414f3e52372d5451d18..16c2d0123a59fa48fcf595691908552b4a368d10 100644 (file)
@@ -1,3 +1,19 @@
+(* Copyright (C)  DooM 2D:Forever Developers
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *)
+{$MODE DELPHI}
 unit g_menu;
 
 interface
@@ -725,7 +741,7 @@ begin
 
     if a.pic <> '' then
     begin
-      g_ProcessResourceStr(a.pic, @fn, nil, nil);
+      fn := g_ExtractWadName(a.pic);
       if fn = '' then
         TGUIImage(win.GetControl('mpWADImage')).SetImage(wad+a.pic)
       else
@@ -783,7 +799,7 @@ begin
 
   wad := TWADFile.Create;
   if wad.ReadFile(GameWAD) then
-    wad.GetResource('FONTS', cfgres, cfgdata, cfglen);
+    wad.GetResource('FONTS/'+cfgres, cfgdata, cfglen);
   wad.Free();
 
   if cfglen <> 0 then
@@ -822,8 +838,8 @@ begin
   wad := TWADFile.Create;
   if wad.ReadFile(GameWAD) then
   begin
-    wad.GetResource('FONTS', txtres, cfgdata, cfglen);
-    wad.GetResource('FONTS', fntres, fntdata, fntlen);
+    wad.GetResource('FONTS/'+txtres, cfgdata, cfglen);
+    wad.GetResource('FONTS/'+fntres, fntdata, fntlen);
   end;
   wad.Free();
 
@@ -841,7 +857,7 @@ begin
       chrwidth := config.ReadInt(IntToStr(a), 'Width', 0);
       if chrwidth = 0 then Continue;
 
-      if e_CreateTextureMemEx(fntdata, CharID, cwdt*(a mod 16), chgt*(a div 16),
+      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;