Subversion Repositories plumbers

Compare Revisions

No changes between revisions

Regard whitespace Rev 8 → Rev 7

/trunk/PlumbersDelphi.groupproj
6,7 → 6,7
<Projects Include="SceneEditor\BinEdit.dproj">
<Dependencies/>
</Projects>
<Projects Include="Win32_Player\ShowTime32.dproj">
<Projects Include="Win32_Player\Showtime32.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
26,23 → 26,23
<Target Name="BinEdit:Make">
<MSBuild Projects="SceneEditor\BinEdit.dproj" Targets="Make"/>
</Target>
<Target Name="ShowTime32">
<MSBuild Projects="Win32_Player\ShowTime32.dproj"/>
<Target Name="Showtime32">
<MSBuild Projects="Win32_Player\Showtime32.dproj"/>
</Target>
<Target Name="ShowTime32:Clean">
<MSBuild Projects="Win32_Player\ShowTime32.dproj" Targets="Clean"/>
<Target Name="Showtime32:Clean">
<MSBuild Projects="Win32_Player\Showtime32.dproj" Targets="Clean"/>
</Target>
<Target Name="ShowTime32:Make">
<MSBuild Projects="Win32_Player\ShowTime32.dproj" Targets="Make"/>
<Target Name="Showtime32:Make">
<MSBuild Projects="Win32_Player\Showtime32.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="BinEdit;ShowTime32"/>
<CallTarget Targets="BinEdit;Showtime32"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="BinEdit:Clean;ShowTime32:Clean"/>
<CallTarget Targets="BinEdit:Clean;Showtime32:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="BinEdit:Make;ShowTime32:Make"/>
<CallTarget Targets="BinEdit:Make;Showtime32:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>
/trunk/SceneEditor/BinEdit_Icon.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/trunk/SceneEditor/BinEdit.dproj
55,7 → 55,7
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<Icon_MainIcon>BinEdit_Icon.ico</Icon_MainIcon>
<Icon_MainIcon>Project1_Icon.ico</Icon_MainIcon>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
70,10 → 70,6
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppEnableHighDPI>true</AppEnableHighDPI>
<DCC_ExeOutput>E:\_test</DCC_ExeOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<Version>7.0</Version>
/trunk/SceneEditor/BinEdit.res
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/SceneEditor/Project1_Icon.ICO
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/SceneEditor/Unit1.dfm
37,6 → 37,7
TabOrder = 0
OnClick = ListBox1Click
OnDblClick = ListBox1DblClick
ExplicitHeight = 466
end
object Button1: TButton
Left = 145
47,6 → 48,7
Caption = '+'
TabOrder = 3
OnClick = Button1Click
ExplicitTop = 488
end
object Button2: TButton
Left = 184
57,6 → 59,7
Caption = '-'
TabOrder = 4
OnClick = Button2Click
ExplicitTop = 488
end
object Button3: TButton
Left = 8
67,6 → 70,7
Caption = 'Save'
TabOrder = 6
OnClick = Button3Click
ExplicitTop = 534
end
object Button4: TButton
Left = 8
77,6 → 81,7
Caption = '^'
TabOrder = 1
OnClick = Button4Click
ExplicitTop = 488
end
object Button5: TButton
Left = 47
87,6 → 92,7
Caption = 'v'
TabOrder = 2
OnClick = Button5Click
ExplicitTop = 488
end
object Button10: TButton
Left = 112
97,6 → 103,7
Caption = 'Save + Test'
TabOrder = 7
OnClick = Button10Click
ExplicitTop = 534
end
object PageControl2: TPageControl
Left = 223
103,11 → 110,15
Top = 8
Width = 799
Height = 603
ActivePage = TabSheet4
ActivePage = TabSheet5
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 8
ExplicitWidth = 812
ExplicitHeight = 572
object TabSheet4: TTabSheet
Caption = 'Pictures'
ExplicitWidth = 804
ExplicitHeight = 544
DesignSize = (
791
575)
231,6 → 242,7
Caption = '+'
TabOrder = 6
OnClick = Button6Click
ExplicitTop = 517
end
object Button7: TButton
Left = 216
241,6 → 253,7
Caption = '-'
TabOrder = 7
OnClick = Button7Click
ExplicitTop = 517
end
object Button8: TButton
Left = 11
251,6 → 264,7
Caption = '^'
TabOrder = 4
OnClick = Button8Click
ExplicitTop = 517
end
object Button9: TButton
Left = 50
261,6 → 275,7
Caption = 'v'
TabOrder = 5
OnClick = Button9Click
ExplicitTop = 517
end
object ListBox2: TListBox
Left = 10
272,6 → 287,7
TabOrder = 3
OnClick = ListBox2Click
OnDblClick = ListBox2DblClick
ExplicitHeight = 396
end
object Edit3: TEdit
Left = 368
408,7 → 424,6
ItemHeight = 13
PopupMenu = PopupMenu1
TabOrder = 11
OnClick = ListBox3Click
OnDblClick = ListBox3DblClick
OnMouseDown = ListBox3MouseDown
end
457,29 → 472,15
Width = 305
Height = 211
Stretch = True
OnDblClick = Button12Click
OnMouseMove = Image1MouseMove
end
end
object Panel3: TPanel
Left = 583
Top = 439
Width = 194
Height = 122
BevelOuter = bvNone
TabOrder = 17
object Image3: TImage
Left = 8
Top = 0
Width = 177
Height = 108
Stretch = True
OnDblClick = ListBox3DblClick
end
end
end
object TabSheet5: TTabSheet
Caption = 'Decision'
ImageIndex = 1
ExplicitWidth = 804
ExplicitHeight = 573
object Label3: TLabel
Left = 16
Top = 16
786,7 → 787,7
Height = 22
MaxValue = 0
MinValue = 0
TabOrder = 4
TabOrder = 3
Value = 0
OnChange = ActionSpinEditsChange
end
797,7 → 798,7
Height = 22
MaxValue = 0
MinValue = 0
TabOrder = 3
TabOrder = 4
Value = 0
OnChange = ActionSpinEditsChange
end
872,6 → 873,7
Caption = 'New'
TabOrder = 5
OnClick = Button14Click
ExplicitTop = 530
end
object Timer1: TTimer
Enabled = False
/trunk/SceneEditor/Unit1.pas
1,14 → 1,6
unit Unit1;
 
// BUG: deleting of pictures does not work! the editor becomes very confused, and the changes are not saved at all?
// TODO: when closing the editor: ask if the user wants to save (but only if they changed something)
// TODO: the "folder open" icons look like you can CHOOSE a file, not open it!
// - change the icon to something else
// - add open-dialogs for choosing the bmp and wav files
// Idea: When actions are deleted, remove the colorful marking on the picture?
// Idea: unused liste auch bei decision page anzeigen
// Idea: hotspots: netz ziehen anstelle linke und rechts maustaste. netz in jede beliebige richtung ziehen und topleft/bottomright automatisch bestimmen
// Idea: decision bitmap markings: anti moiree?
// Idea: create a small thumbnail for "unused files", too?
 
interface
 
123,8 → 115,6
Addtoscene1: TMenuItem;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Image3: TImage;
procedure ListBox1Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
170,7 → 160,6
procedure Addtoscene1Click(Sender: TObject);
procedure ListBox3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ListBox3Click(Sender: TObject);
private
Game: TGameBinFile;
PlayStart: Cardinal;
177,7 → 166,6
MediaplayerOpened: boolean;
StopPlayRequest: boolean;
FirstTickCount: Cardinal;
procedure ShowSceneBmp;
function CurScene: PSceneDef;
procedure LoadScene;
procedure Load;
428,7 → 416,6
end
else
begin
TabSheet5.TabVisible := false;
DisableEnablePictureControls(false);
DisableEnableSceneControls(false);
DisableEnableFileControls(false);
526,7 → 513,6
DisableEnableFileControls(true);
DisableEnableSceneControls(true);
DisableEnablePictureControls(true);
TabSheet5.TabVisible := true;
Edit1.Enabled := true;
SpinEdit1.Enabled := true;
Edit3.Enabled := true;
537,22 → 523,6
end;
end;
 
procedure TForm1.ShowSceneBmp;
var
Filename: string;
begin
Filename := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + CurPicture^.szBitmapFile);
if FileExists(Filename) then
begin
Image2.Picture.LoadFromFile(Filename);
AspectRatio(Image2, Panel2);
end
else
begin
Image2.Picture := nil;
end;
end;
 
procedure TForm1.Button16Click(Sender: TObject);
begin
ListBox2.ItemIndex := 0; // go to the beginning
721,7 → 691,6
ListBox2.ItemIndex := bakIdx;
ListBox2Click(Listbox2);
end;
RecalcUnusedFiles;
end;
end;
 
796,7 → 765,6
begin
_WriteStringToFilename(@CurScene^.szDecisionBmp, Edit2.Text);
RecalcUnusedFiles;
RedrawDecisionBitmap;
Label27.Visible := not FileExists(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + Edit2.Text) and not (Edit2.Text = '');
Button11.Visible := CurScene^.szDecisionBmp <> '';
end;
806,7 → 774,6
_WriteStringToFilename(@CurPicture^.szBitmapFile, Edit3.Text);
ListBox2.Items[ListBox2.ItemIndex] := Format('(%d) %s', [CurPicture^.duration, CurPicture^.szBitmapFile]);
RecalcUnusedFiles;
ShowSceneBmp;
Label26.Visible := not FileExists(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + Edit3.Text);
Button12.Visible := CurPicture^.szBitmapFile <> '';
end;
897,11 → 864,22
end;
 
procedure TForm1.ListBox2Click(Sender: TObject);
var
Filename: string;
begin
SpinEdit13.Value := CurPicture^.duration;
Edit3.Text := string(CurPicture^.szBitmapFile);
 
ShowSceneBmp;
Filename := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + CurPicture^.szBitmapFile);
if FileExists(Filename) then
begin
Image2.Picture.LoadFromFile(Filename);
AspectRatio(Image2, Panel2);
end
else
begin
Image2.Picture := nil;
end;
 
Label18.Caption := _DecisecondToTime(CurPictureTimepos);
 
916,18 → 894,6
Button15Click(Button15);
end;
 
procedure TForm1.ListBox3Click(Sender: TObject);
var
fileName: string;
begin
if ListBox3.ItemIndex = -1 then exit;
fileName := IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + ListBox3.Items[ListBox3.ItemIndex];
Image3.Visible := FileExists(FileName);
if not FileExists(FileName) then exit;
Image3.Picture.LoadFromFile(Filename);
AspectRatio(Image3, Panel3);
end;
 
procedure TForm1.ListBox3DblClick(Sender: TObject);
var
fileName: string;
1040,8 → 1006,6
try
ListBox3.Clear;
 
Image3.Visible := false;
 
if FindFirst(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + '*.*', faArchive, SR) = 0 then
begin
repeat
1267,7 → 1231,7
 
procedure TForm1.About1Click(Sender: TObject);
begin
ShowMessage('Plumbers Dont''t Wear Ties - GAME.BIN editor (can be also used to create new games based on the "ShowTime" engine!)'+#13#10#13#10+'Written by Daniel Marschall (www.daniel-marschall.de)'+#13#10#13#10+'Published by ViaThinkSoft (www.viathinksoft.com)'+#13#10#13#10+'Current version: ' + CUR_VER);
ShowMessage('Plumbers Dont''t Wear Ties - GAME.BIN editor (can be also used to create new games based on the "ShowTime" engine!)'+#13#10#13#10+'Written by Daniel Marschall (www.daniel-marschall.de)'+#13#10#13#10+'Published by ViaThinkSoft (www.viathinksoft.com).'+#13#10#13#10+'Current version: ' + CUR_VER);
end;
 
procedure TForm1.ActionSpinEditsChange(Sender: TObject);
1299,9 → 1263,6
Filename: string;
begin
FileName := string(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + Edit2.Text);
 
Image1.Visible := FileExists(FileName);
 
if not FileExists(FileName) then exit;
 
Image1.Picture.Bitmap.LoadFromFile(FileName);
/trunk/Win32_Player/Main.pas
1,23 → 1,14
unit Main;
 
// TODO: When the windows is only resized a little bit (A few pixels), the window should not centered
// Idea: Calc the width and height of ALL pictures, and then size the form to the biggest value?
// BUG: if bitmap is not existing, then the error "ReadBitmapFile(): Unable to open bitmap file" appears. Not good.
// BUG: If you drag the window, the dia show will stop playing, but the sound continues! This makes everything out of sync.
// TODO: When the windows is only resized a little bit (A few pixels), the window should not centered
// ... Calc the width and height of ALL pictures, and then size the form to the biggest value?
// ... or hard code the resolution in the INI file?
// Idea: Ini Parameter if fullscreen is applied or not
// Idea: Savestates, speedup, pause, Use Space bar to go to the next decision point.
// TODO: Ini Parameter if fullscreen is applied or not
// TODO: Check out if hotspot coords should have their origin at the picture or the form position.
// Idea: Savestates. Speedup. Pause.
// Idea: Use Space bar to go to the next decision point.
 
// -----------------------------------------------------------------------------
 
// HOTSPOT_RELATIVE_ORIGIN is a new behavior which is not compatible with the original engine.
// With HOTSPOT_RELATIVE_ORIGIN enabled, the coordinates will be relative to the picture
// The original game has the origin at the top left corner of the screen.
// This is a problem because the game as well as the scene editor does not know the
// desired resolution, as it is automatically determined.
// If we would hardcode the desired canvas (640x480) in <ExeName>.ini, then
// it would work, but then, the scene Editor can not know the desired resolution...
{$DEFINE HOTSPOT_RELATIVE_ORIGIN}
 
interface
 
uses
116,13 → 107,13
// Make form bigger if necessary
if Image1.Width > ClientWidth then
begin
ClientWidth := Min(Image1.Width, Screen.Width);
ClientWidth := Image1.Width;
if (ClientWidth >= Screen.Width) then FullscreenMode := true;
Position := poScreenCenter;
end;
if Image1.Height > ClientHeight then
begin
ClientHeight := Min(Image1.Height, Screen.Height);
ClientHeight := Image1.Height;
if (ClientHeight >= Screen.Height) then FullscreenMode := true;
Position := poScreenCenter;
end;
241,7 → 232,7
var
i: integer;
begin
// If hotspots are overlaying, the lowest action will be chosen (same behavior as original game)
// TODO: if hotspots are overlaying; which hotspot will be prefered? the top ones? check out the original game.
for i := Low(FHotspots) to High(FHotspots) do
begin
if Assigned(FHotspots[i].lpAction) and
258,11 → 249,7
 
procedure TMainForm.ControlClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
{$IFDEF HOTSPOT_RELATIVE_ORIGIN}
ClickEvent(X, Y);
{$ELSE}
ClickEvent(X+TControl(Sender).Left, Y+TControl(Sender).Top);
{$ENDIF}
end;
 
procedure TMainForm.StartupTimerTimer(Sender: TObject);
/trunk/Win32_Player/Showtime32.dpr
1,4 → 1,4
program ShowTime32;
program Showtime32;
 
uses
Forms,
/trunk/Win32_Player/Showtime32.dproj
1,7 → 1,7
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{F68EE1AF-C815-4B78-9228-27C1D5A58382}</ProjectGuid>
<MainSource>ShowTime32.dpr</MainSource>
<MainSource>Showtime32.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
50,7 → 50,7
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_ExeOutput>C:\Users\DELL User\Downloads\Plumbers\PC Contents\C\PLUMBER\</DCC_ExeOutput>
<SanitizedProjectName>ShowTime32</SanitizedProjectName>
<SanitizedProjectName>Showtime32</SanitizedProjectName>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1031</VerInfo_Locale>
116,7 → 116,7
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ShowTime32.dpr</Source>
<Source Name="MainSource">Showtime32.dpr</Source>
</Source>
</Delphi.Personality>
<Platforms>