hedgewars/uVideoRec.pas
changeset 7386 e82a076df09b
parent 7379 aa29a2f16cc7
child 7392 bc3306c59a08
equal deleted inserted replaced
7383:8f675ab05802 7386:e82a076df09b
   244 var thumbpath: shortstring;
   244 var thumbpath: shortstring;
   245     k: LongInt;
   245     k: LongInt;
   246 begin
   246 begin
   247     thumbpath:= '/VideoTemp/' + RecPrefix;
   247     thumbpath:= '/VideoTemp/' + RecPrefix;
   248     AddFileLog('Saving thumbnail ' + thumbpath);
   248     AddFileLog('Saving thumbnail ' + thumbpath);
   249     if cScreenWidth > cScreenHeight then
   249     k:= max(max(cScreenWidth, cScreenHeight) div 400, 1); // here 400 is minimum size of thumbnail
   250         k:= cScreenWidth div 400  // here 400 is minimum size of thumbnail
       
   251     else
       
   252         k:= cScreenHeight div 400;
       
   253     if k = 0 then
       
   254         k:= 1;
       
   255     MakeScreenshot(thumbpath, k);
   250     MakeScreenshot(thumbpath, k);
   256     thumbnailSaved:= true;
   251     thumbnailSaved:= true;
   257 end;
   252 end;
   258 
   253 
   259 procedure BeginPreRecording;
   254 procedure BeginPreRecording;
   262     frequency, channels: LongInt;
   257     frequency, channels: LongInt;
   263 begin
   258 begin
   264     AddFileLog('BeginPreRecording');
   259     AddFileLog('BeginPreRecording');
   265 
   260 
   266     thumbnailSaved:= false;
   261     thumbnailSaved:= false;
   267     RecPrefix:= FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
   262     RecPrefix:= 'hw-' + FormatDateTime('YYYY-MM-DD_HH-mm-ss-z', Now());
   268 
   263 
   269     Mix_QuerySpec(@frequency, @format, @channels);
   264     Mix_QuerySpec(@frequency, @format, @channels);
   270     AddFileLog('sound: frequency = ' + IntToStr(frequency) + ', format = ' + IntToStr(format) + ', channels = ' + IntToStr(channels));
   265     AddFileLog('sound: frequency = ' + IntToStr(frequency) + ', format = ' + IntToStr(format) + ', channels = ' + IntToStr(channels));
   271     if format <> $8010 then
   266     if format <> $8010 then
   272     begin
   267     begin