diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index d543e3fdb5048e130d0def4a71730acb1db1ff47..3f65bba33336ec96c8a80a4f7a8c0f0e268a3efa 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
MAPREADER, f_selectmap, f_savemap, WADEDITOR, WADSTRUCT, MAPDEF,
g_map, f_saveminimap, f_addresource, CONFIG, f_packmap,
f_addresource_sound, f_maptest, f_choosetype,
- g_language, f_selectlang, ClipBrd;
+ g_language, f_selectlang, ClipBrd, g_resources;
const
UNDO_DELETE_PANEL = 1;
3: str := _lc[I_PROP_TR_SHOT_AIM_3];
else str := _lc[I_PROP_TR_SHOT_AIM_0];
end;
- with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_AIM], str, True)-1] do
+ with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_AIM], str, True)] do
begin
EditStyle := esPickList;
ReadOnly := True;
cwdt, chgt: Byte;
spc: ShortInt;
ID: DWORD;
- wad: TWADEditor_1;
cfgdata: Pointer;
cfglen: Integer;
config: TConfig;
begin
- cfgdata := nil;
- cfglen := 0;
ID := 0;
-
- wad := TWADEditor_1.Create;
- if wad.ReadFile(EditorDir+'data/Game.wad') then
- wad.GetResource('FONTS', cfgres, cfgdata, cfglen);
- wad.Free();
-
- if cfglen <> 0 then
+ g_ReadResource(EditorDir + 'data/Game.wad', 'FONTS', cfgres, cfgdata, cfglen);
+ if cfgdata <> nil then
begin
- if not g_CreateTextureWAD('FONT_STD', EditorDir+'data/Game.wad:FONTS\'+texture) then
+ if not g_CreateTextureWAD('FONT_STD', EditorDir + 'data/Game.wad:FONTS\' + texture) then
e_WriteLog('ERROR ERROR ERROR', MSG_WARNING);
config := TConfig.CreateMem(cfgdata, cfglen);
spc := Min(Max(config.ReadInt('FontMap', 'Kerning', 0), -128), 127);
if g_GetTexture('FONT_STD', ID) then
- e_TextureFontBuild(ID, FontID, cwdt, chgt, spc-2);
+ e_TextureFontBuild(ID, FontID, cwdt, chgt, spc - 2);
config.Free();
+ FreeMem(cfgdata)
end
else
- e_WriteLog('Could not load FONT_STD', MSG_WARNING);
-
- if cfglen <> 0 then FreeMem(cfgdata);
+ begin
+ e_WriteLog('Could not load FONT_STD', MSG_WARNING)
+ end
end;
procedure TMainForm.FormCreate(Sender: TObject);