Subversion Repositories plumbers

Compare Revisions

No changes between revisions

Regard whitespace Rev 5 → Rev 6

/trunk/SceneEditor/BinEdit.res
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/SceneEditor/Unit1.dfm
4,7 → 4,7
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'ShowTime Editor'
ClientHeight = 628
ClientHeight = 608
ClientWidth = 1043
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
19,7 → 19,7
OnShow = FormShow
DesignSize = (
1043
628)
608)
PixelsPerInch = 96
TextHeight = 13
object ListBox1: TListBox
57,7 → 57,7
end
object Button3: TButton
Left = 8
Top = 574
Top = 554
Width = 105
Height = 46
Anchors = [akLeft, akBottom]
85,7 → 85,7
end
object Button10: TButton
Left = 112
Top = 574
Top = 554
Width = 105
Height = 46
Anchors = [akLeft, akBottom]
97,7 → 97,7
Left = 223
Top = 8
Width = 812
Height = 612
Height = 592
ActivePage = TabSheet4
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 8
105,7 → 105,7
Caption = 'Pictures'
DesignSize = (
804
584)
564)
object Label1: TLabel
Left = 16
Top = 24
120,14 → 120,6
Height = 13
Caption = 'Sound playback:'
end
object Image2: TImage
Left = 272
Top = 190
Width = 305
Height = 211
Stretch = True
OnMouseMove = Image1MouseMove
end
object Label12: TLabel
Left = 272
Top = 127
441,7 → 433,22
Visible = False
OnClick = Button18Click
end
object Panel2: TPanel
Left = 272
Top = 189
Width = 305
Height = 212
TabOrder = 16
object Image2: TImage
Left = 0
Top = 1
Width = 305
Height = 211
Stretch = True
OnMouseMove = Image1MouseMove
end
end
end
object TabSheet5: TTabSheet
Caption = 'Decision'
ImageIndex = 1
452,18 → 459,6
Height = 13
Caption = 'Decision-Picture:'
end
object Image1: TImage
Left = 12
Top = 255
Width = 409
Height = 290
Cursor = crCross
Stretch = True
OnMouseDown = Image1MouseDown
OnMouseEnter = Image1MouseEnter
OnMouseLeave = Image1MouseLeave
OnMouseMove = Image1MouseMove
end
object Label10: TLabel
Left = 12
Top = 552
526,7 → 521,6
TabOrder = 3
object TabSheet1: TTabSheet
Caption = 'Action 1 (Red)'
ExplicitWidth = 333
object Label5: TLabel
Left = 171
Top = 72
616,7 → 610,6
object TabSheet2: TTabSheet
Caption = 'Action 2 (Green)'
ImageIndex = 1
ExplicitWidth = 333
object Label13: TLabel
Left = 16
Top = 16
706,7 → 699,6
object TabSheet3: TTabSheet
Caption = 'Action 3 (Blue)'
ImageIndex = 2
ExplicitWidth = 333
object Label7: TLabel
Left = 16
Top = 16
821,8 → 813,27
Visible = False
OnClick = Button11Click
end
object Panel1: TPanel
Left = 12
Top = 255
Width = 409
Height = 291
TabOrder = 4
object Image1: TImage
Left = 0
Top = 1
Width = 409
Height = 290
Cursor = crCross
Stretch = True
OnMouseDown = Image1MouseDown
OnMouseEnter = Image1MouseEnter
OnMouseLeave = Image1MouseLeave
OnMouseMove = Image1MouseMove
end
end
end
end
object Button14: TButton
Left = 8
Top = 529
/trunk/SceneEditor/Unit1.pas
1,9 → 1,6
unit Unit1;
 
// TODO: create for "unused files" box a small thumbnail, too?
// TODO: sound interrupts when playing the dia show
// TODO: aspect ratio
// TODO: unused files: exclude *.db or *.pk
// Idea: create a small thumbnail for "unused files", too?
 
interface
 
13,7 → 10,7
Vcl.Menus;
 
const
CUR_VER = '2017-08-09';
CUR_VER = '2017-10-02';
 
type
TForm1 = class(TForm)
116,6 → 113,8
About1: TMenuItem;
PopupMenu1: TPopupMenu;
Addtoscene1: TMenuItem;
Panel1: TPanel;
Panel2: TPanel;
procedure ListBox1Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
188,6 → 187,7
procedure DisableEnableSceneControls(enable: boolean);
procedure DisableEnablePictureControls(enable: boolean);
procedure DisableEnableFileControls(enable: boolean);
class procedure AspectRatio(image: TImage; panel: TControl);
end;
 
var
388,6 → 388,9
Button14.Enabled := enable;
end;
 
var
AutomaticNextDia: boolean;
 
procedure TForm1.Button15Click(Sender: TObject);
var
decisionBMP: string;
397,7 → 400,7
begin
if PlayStart <> 0 then
begin
if MediaplayerOpened then
if MediaplayerOpened and not AutomaticNextDia then
begin
if MediaPlayer1.Mode = mpPlaying then MediaPlayer1.Stop;
Mediaplayer1.TimeFormat := tfMilliseconds;
407,6 → 410,7
MediaPlayer1.Play;
end;
end;
AutomaticNextDia := false;
FirstTickCount := GetTickCount;
PlayStart := GetTickCount - CurPictureTimepos * 100;
end
475,6 → 479,7
if not Application.Terminated and (ListBox2.ItemIndex < ListBox2.Count-1) and not StopPlayRequest then
begin
ListBox2.ItemIndex := ListBox2.ItemIndex + 1;
AutomaticNextDia := true;
ListBox2Click(ListBox2);
end;
end
486,6 → 491,7
if (CurScene^.szDecisionBmp <> '') and FileExists(decisionBMP) then
begin
Image2.Picture.LoadFromFile(decisionBMP);
AspectRatio(Image2, Panel2);
end
else
begin
829,6 → 835,34
end;
end;
 
class procedure TForm1.AspectRatio(image: TImage; panel: TControl);
var
wi, hi, ws, hs: integer;
ri, rs: double;
begin
wi := image.Picture.Width;
hi := image.Picture.Height;
ri := wi / hi;
 
ws := panel.Width;
hs := panel.Height;
rs := ws / hs;
 
if rs > ri then
begin
image.Width := Round(wi * hs/hi);
image.Height := hs;
end
else
begin
image.Width := ws;
image.Height := Round(hi * ws/wi);
end;
 
image.Left := Round(panel.Width / 2 - image.Width / 2);
image.Top := Round(panel.Height / 2 - image.Height / 2);
end;
 
procedure TForm1.ListBox2Click(Sender: TObject);
var
Filename: string;
838,9 → 872,14
 
Filename := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + CurPicture^.szBitmapFile);
if FileExists(Filename) then
Image2.Picture.LoadFromFile(Filename) // TODO: keep aspect ratio
begin
Image2.Picture.LoadFromFile(Filename);
AspectRatio(Image2, Panel2);
end
else
begin
Image2.Picture := nil;
end;
 
Label18.Caption := _DecisecondToTime(CurPictureTimepos);
 
961,17 → 1000,25
var
i, idx: integer;
SR: TSearchRec;
ext: string;
begin
ListBox3.Items.BeginUpdate;
try
ListBox3.Clear;
 
if FindFirst(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + '*.*', faArchive, SR) = 0 then
begin
repeat
ext := UpperCase(ExtractFileExt(SR.Name));
if ((ext <> '.PK' {Adobe Audition}) and (ext <> '.DB' {Windows Thumbnail})) then
begin
ListBox3.Items.Add(SR.Name); //Fill the list
end;
until FindNext(SR) <> 0;
FindClose(SR);
end;
 
// Remove the entries which are present
for i := CurScene^.pictureIndex to CurScene^.pictureIndex+CurScene^.numPics-1 do
begin
idx := ListBox3.Items.IndexOf(Game.pictures[i].szBitmapFile);
988,7 → 1035,10
 
idx := ListBox3.Items.IndexOf(Edit3.Text);
if idx <> -1 then ListBox3.Items.Delete(idx);
finally
ListBox3.Items.EndUpdate;
end;
end;
 
procedure TForm1.RecalcSoundtrackLength;
var
1213,11 → 1263,11
Filename: string;
begin
FileName := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + Edit2.Text);
if FileExists(FileName) then
Image1.Picture.Bitmap.LoadFromFile(FileName) // TODO: keep aspect ratio
else
Image1.Picture := nil;
if not FileExists(FileName) then exit;
 
Image1.Picture.Bitmap.LoadFromFile(FileName);
AspectRatio(Image1, Panel1);
 
Image1.Picture.Bitmap.PixelFormat := pf24bit; // Extend the palette, so we have red, green and blue guaranteed.
 
Image1.Canvas.Brush.Style := bsDiagCross;
/trunk/SceneEditor
Property changes:
Added: svn:global-ignores
+__recovery