hedgewars/uVideoRec.pas
changeset 14914 66b510a8b81c
parent 14908 a414d37278df
child 14935 9ab78e08a34c
equal deleted inserted replaced
14913:444ed0622348 14914:66b510a8b81c
    81 begin
    81 begin
    82     AddFileLog('BeginVideoRecording');
    82     AddFileLog('BeginVideoRecording');
    83 
    83 
    84 {$IOCHECKS OFF}
    84 {$IOCHECKS OFF}
    85     // open file with prerecorded camera positions
    85     // open file with prerecorded camera positions
    86     filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.txtin';
    86     filename:= shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix) + '.txtin';
    87     Assign(cameraFile, filename);
    87     Assign(cameraFile, filename);
    88     Reset(cameraFile, SizeOf(TFrame));
    88     Reset(cameraFile, SizeOf(TFrame));
    89     maxProgress:= FileSize(cameraFile);
    89     maxProgress:= FileSize(cameraFile);
    90     if IOResult <> 0 then
    90     if IOResult <> 0 then
    91     begin
    91     begin
   111         desc:= desc + 'Map: ' + cMapName + #10;
   111         desc:= desc + 'Map: ' + cMapName + #10;
   112     if Theme <> '' then
   112     if Theme <> '' then
   113         desc:= desc + 'Theme: ' + Theme + #10;
   113         desc:= desc + 'Theme: ' + Theme + #10;
   114     desc:= desc + 'prefix[' + RecPrefix + ']prefix';
   114     desc:= desc + 'prefix[' + RecPrefix + ']prefix';
   115 
   115 
   116     filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix;
   116     filename:= shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix);
   117 
   117 
   118     recordAudio:= (cAudioCodec <> 'no');
   118     recordAudio:= (cAudioCodec <> 'no');
   119     if recordAudio then
   119     if recordAudio then
   120         soundFilePath:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.sw'
   120         soundFilePath:= shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix) + '.sw'
   121     else
   121     else
   122         soundFilePath:= '';
   122         soundFilePath:= '';
   123 
   123 
   124     if checkFails(AVWrapper_Init(@AddFileLogRaw
   124     if checkFails(AVWrapper_Init(@AddFileLogRaw
   125         , PChar(ansistring(filename))
   125         , PChar(ansistring(filename))
   283     // then we need to copy demo so that frontend will be able to find it later.
   283     // then we need to copy demo so that frontend will be able to find it later.
   284     if recordFileName <> '' then
   284     if recordFileName <> '' then
   285     begin
   285     begin
   286         if GameType <> gmtDemo then // this is save and game demo is not recording, abort
   286         if GameType <> gmtDemo then // this is save and game demo is not recording, abort
   287             exit;
   287             exit;
   288         CopyFile(recordFileName, UserPathPrefix + '/VideoTemp/' + RecPrefix + '.hwd');
   288         CopyFile(recordFileName, shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix) + '.hwd');
   289     end;
   289     end;
   290 
   290 
   291     if cIsSoundEnabled then
   291     if cIsSoundEnabled then
   292         begin
   292         begin
   293         Mix_QuerySpec(@frequency, @format, @channels);
   293         Mix_QuerySpec(@frequency, @format, @channels);
   299             exit;
   299             exit;
   300             end;
   300             end;
   301 
   301 
   302 {$IOCHECKS OFF}
   302 {$IOCHECKS OFF}
   303         // create sound file
   303         // create sound file
   304         filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.sw';
   304         filename:= shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix) + '.sw';
   305         Assign(audioFile, filename);
   305         Assign(audioFile, filename);
   306         Rewrite(audioFile, 1);
   306         Rewrite(audioFile, 1);
   307         if IOResult <> 0 then
   307         if IOResult <> 0 then
   308             begin
   308             begin
   309             AddFileLog('Error: Could not write to ' + filename);
   309             AddFileLog('Error: Could not write to ' + filename);
   310             exit;
   310             exit;
   311             end;
   311             end;
   312         end;
   312         end;
   313 
   313 
   314     // create file with camera positions
   314     // create file with camera positions
   315     filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.txtout';
   315     filename:= shortstring(UserPathPrefix) + '/VideoTemp/' + shortstring(RecPrefix) + '.txtout';
   316     Assign(cameraFile, filename);
   316     Assign(cameraFile, filename);
   317     Rewrite(cameraFile, SizeOf(TFrame));
   317     Rewrite(cameraFile, SizeOf(TFrame));
   318     if IOResult <> 0 then
   318     if IOResult <> 0 then
   319         begin
   319         begin
   320         AddFileLog('Error: Could not write to ' + filename);
   320         AddFileLog('Error: Could not write to ' + filename);