Subversion Repositories plumbers

Compare Revisions

No changes between revisions

Regard whitespace Rev 6 → Rev 5

/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 = 608
ClientHeight = 628
ClientWidth = 1043
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
19,7 → 19,7
OnShow = FormShow
DesignSize = (
1043
608)
628)
PixelsPerInch = 96
TextHeight = 13
object ListBox1: TListBox
57,7 → 57,7
end
object Button3: TButton
Left = 8
Top = 554
Top = 574
Width = 105
Height = 46
Anchors = [akLeft, akBottom]
85,7 → 85,7
end
object Button10: TButton
Left = 112
Top = 554
Top = 574
Width = 105
Height = 46
Anchors = [akLeft, akBottom]
97,7 → 97,7
Left = 223
Top = 8
Width = 812
Height = 592
Height = 612
ActivePage = TabSheet4
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 8
105,7 → 105,7
Caption = 'Pictures'
DesignSize = (
804
564)
584)
object Label1: TLabel
Left = 16
Top = 24
120,6 → 120,14
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
433,22 → 441,7
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
459,6 → 452,18
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
521,6 → 526,7
TabOrder = 3
object TabSheet1: TTabSheet
Caption = 'Action 1 (Red)'
ExplicitWidth = 333
object Label5: TLabel
Left = 171
Top = 72
610,6 → 616,7
object TabSheet2: TTabSheet
Caption = 'Action 2 (Green)'
ImageIndex = 1
ExplicitWidth = 333
object Label13: TLabel
Left = 16
Top = 16
699,6 → 706,7
object TabSheet3: TTabSheet
Caption = 'Action 3 (Blue)'
ImageIndex = 2
ExplicitWidth = 333
object Label7: TLabel
Left = 16
Top = 16
813,27 → 821,8
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,6 → 1,9
unit Unit1;
 
// Idea: create a small thumbnail for "unused files", too?
// 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
 
interface
 
10,7 → 13,7
Vcl.Menus;
 
const
CUR_VER = '2017-10-02';
CUR_VER = '2017-08-09';
 
type
TForm1 = class(TForm)
113,8 → 116,6
About1: TMenuItem;
PopupMenu1: TPopupMenu;
Addtoscene1: TMenuItem;
Panel1: TPanel;
Panel2: TPanel;
procedure ListBox1Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
187,7 → 188,6
procedure DisableEnableSceneControls(enable: boolean);
procedure DisableEnablePictureControls(enable: boolean);
procedure DisableEnableFileControls(enable: boolean);
class procedure AspectRatio(image: TImage; panel: TControl);
end;
 
var
388,9 → 388,6
Button14.Enabled := enable;
end;
 
var
AutomaticNextDia: boolean;
 
procedure TForm1.Button15Click(Sender: TObject);
var
decisionBMP: string;
400,7 → 397,7
begin
if PlayStart <> 0 then
begin
if MediaplayerOpened and not AutomaticNextDia then
if MediaplayerOpened then
begin
if MediaPlayer1.Mode = mpPlaying then MediaPlayer1.Stop;
Mediaplayer1.TimeFormat := tfMilliseconds;
410,7 → 407,6
MediaPlayer1.Play;
end;
end;
AutomaticNextDia := false;
FirstTickCount := GetTickCount;
PlayStart := GetTickCount - CurPictureTimepos * 100;
end
479,7 → 475,6
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
491,7 → 486,6
if (CurScene^.szDecisionBmp <> '') and FileExists(decisionBMP) then
begin
Image2.Picture.LoadFromFile(decisionBMP);
AspectRatio(Image2, Panel2);
end
else
begin
835,34 → 829,6
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;
872,14 → 838,9
 
Filename := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + CurPicture^.szBitmapFile);
if FileExists(Filename) then
begin
Image2.Picture.LoadFromFile(Filename);
AspectRatio(Image2, Panel2);
end
Image2.Picture.LoadFromFile(Filename) // TODO: keep aspect ratio
else
begin
Image2.Picture := nil;
end;
 
Label18.Caption := _DecisecondToTime(CurPictureTimepos);
 
1000,25 → 961,17
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);
1035,10 → 988,7
 
idx := ListBox3.Items.IndexOf(Edit3.Text);
if idx <> -1 then ListBox3.Items.Delete(idx);
finally
ListBox3.Items.EndUpdate;
end;
end;
 
procedure TForm1.RecalcSoundtrackLength;
var
1263,11 → 1213,11
Filename: string;
begin
FileName := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + Edit2.Text);
if not FileExists(FileName) then exit;
if FileExists(FileName) then
Image1.Picture.Bitmap.LoadFromFile(FileName) // TODO: keep aspect ratio
else
Image1.Picture := nil;
 
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:
Deleted: svn:global-ignores
-__recovery