diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 0100e36ffcf22ff242052d5f17f5442e3fdddc88..48700f74e782969b9b562b2f54250ca4d874e527 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
+(* 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_gui;
interface
uses
unit g_gui;
interface
uses
- e_graphics, e_input, g_playermodel, g_basic, MAPSTRUCT, WADEDITOR;
+ e_graphics, e_input, g_playermodel, g_basic, MAPSTRUCT, wadreader;
const
MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
const
MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
procedure TGUIMapPreview.SetMap(Res: string);
var
procedure TGUIMapPreview.SetMap(Res: string);
var
- WAD: TWADEditor_1;
+ WAD: TWADFile;
MapReader: TMapReader_1;
panels: TPanelsRec1Array;
header: TMapHeaderRec_1;
a: Integer;
MapReader: TMapReader_1;
panels: TPanelsRec1Array;
header: TMapHeaderRec_1;
a: Integer;
- FileName, SectionName, ResName: string;
+ FileName: string;
Data: Pointer;
Len: Integer;
rX, rY: Single;
begin
Data: Pointer;
Len: Integer;
rX, rY: Single;
begin
- g_ProcessResourceStr(Res, FileName, SectionName, ResName);
+ FileName := g_ExtractWadName(Res);
- WAD := TWADEditor_1.Create();
+ WAD := TWADFile.Create();
if not WAD.ReadFile(FileName) then
begin
WAD.Free();
Exit;
end;
if not WAD.ReadFile(FileName) then
begin
WAD.Free();
Exit;
end;
- if not WAD.GetResource('', ResName, Data, Len) then
+ //k8: ignores path again
+ if not WAD.GetMapResource(g_ExtractFileName(Res), Data, Len) then
begin
WAD.Free();
Exit;
begin
WAD.Free();
Exit;