X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2Ff_main.pas;h=00802bbdd83bed88d058252f8107dc09979495bd;hb=e784adbf59a182d6049d259d97ba92b06333b94d;hp=4498ee9efd55146bcab5e8b00205ed86bb668d16;hpb=4b7a983868b2447702b82c0077bce1cb70cdc72b;p=d2df-editor.git diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 4498ee9..00802bb 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -337,7 +337,7 @@ uses f_options, e_graphics, e_log, GL, Math, f_mapoptions, g_basic, f_about, f_mapoptimization, f_mapcheck, f_addresource_texture, g_textures, - f_activationtype, f_keys, wadreader, + f_activationtype, f_keys, wadreader, fileutil, MAPREADER, f_selectmap, f_savemap, WADEDITOR, MAPDEF, g_map, f_saveminimap, f_addresource, CONFIG, f_packmap, f_addresource_sound, f_maptest, f_choosetype, @@ -2651,6 +2651,10 @@ begin EditorDir := ExtractFilePath(Application.ExeName); e_InitLog(EditorDir+'Editor.log', WM_NEWFILE); + e_WriteLog('Doom 2D: Forever Editor version ' + EDITOR_VERSION, MSG_NOTIFY); + e_WriteLog('Build date: ' + EDITOR_BUILDDATE + ' ' + EDITOR_BUILDTIME, MSG_NOTIFY); + e_WriteLog('Build hash: ' + g_GetBuildHash(), MSG_NOTIFY); + e_WriteLog('Build by: ' + g_GetBuilderName(), MSG_NOTIFY); slInvalidTextures := TStringList.Create; @@ -6728,7 +6732,7 @@ end; procedure TMainForm.miTestMapClick(Sender: TObject); var - mapWAD, tempWAD: String; + newWAD, oldWAD, tempMap: String; args: SSArray; opt: LongWord; time, i: Integer; @@ -6738,12 +6742,18 @@ begin // Сохраняем временную карту: time := 0; repeat - mapWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d.wad', [time]); + newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d.wad', [time]); Inc(time); - until not FileExists(mapWAD); - tempWAD := mapWAD + ':\' + TEST_MAP_NAME; - SaveMap(tempWAD); - tempWAD := ExtractRelativePath(ExtractFilePath(TestD2dExe) + 'maps/', tempWAD); + until not FileExists(newWAD); + if OpenedMap <> '' then + begin + oldWad := g_ExtractWadName(OpenedMap); + if CopyFile(oldWad, newWad) = false then + e_WriteLog('MapTest: unable to copy [' + oldWad + '] to [' + newWad + ']', MSG_WARNING) + end; + tempMap := newWAD + ':\' + TEST_MAP_NAME; + SaveMap(tempMap); + tempMap := ExtractRelativePath(ExtractFilePath(TestD2dExe) + 'maps/', tempMap); // Опции игры: opt := 32 + 64; @@ -6762,9 +6772,7 @@ begin proc := TProcessUTF8.Create(nil); proc.Executable := TestD2dExe; proc.Parameters.Add('-map'); - proc.Parameters.Add(tempWAD); - proc.Parameters.Add('-testmap'); - proc.Parameters.Add(tempWAD); + proc.Parameters.Add(tempMap); proc.Parameters.Add('-gm'); proc.Parameters.Add(TestGameMode); proc.Parameters.Add('-limt'); @@ -6800,7 +6808,7 @@ begin end; proc.Free(); - SysUtils.DeleteFile(mapWAD); + SysUtils.DeleteFile(newWAD); Application.Restore(); end;