Fixed Linux file permissions; Added two view bitmodes; Removed bitmode resetting after selection another Tim.
This commit is contained in:
15
tim2view.lpi
15
tim2view.lpi
@@ -24,6 +24,7 @@
|
||||
<AutoIncrementBuild Value="True"/>
|
||||
<MajorVersionNr Value="1"/>
|
||||
<RevisionNr Value="67"/>
|
||||
<BuildNr Value="2"/>
|
||||
<StringTable CompanyName="Lab 313" FileDescription="The best TIMs tool ever!:)" ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
@@ -42,7 +43,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="13">
|
||||
<Units Count="14">
|
||||
<Unit0>
|
||||
<Filename Value="tim2view.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@@ -111,6 +112,10 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BGRABitmap"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="todos.inc"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit13>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
@@ -130,15 +135,7 @@
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<RelocatableUnit Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
|
||||
293
tim2view.lps
293
tim2view.lps
@@ -1,138 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="9"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="13">
|
||||
<Unit0>
|
||||
<Filename Value="tim2view.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="tim2view"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="52" Y="16"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umain.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="frmMain"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="umain"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="242"/>
|
||||
<CursorPos X="87" Y="265"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="edc.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="edc"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="ecc.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ecc"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="ucommon.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucommon"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="56" Y="12"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="utim.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="utim"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="285"/>
|
||||
<CursorPos X="31" Y="299"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="ucdimage.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucdimage"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="81"/>
|
||||
<CursorPos X="95" Y="89"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="usettings.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="usettings"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="17"/>
|
||||
<CursorPos X="76" Y="31"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="uscanresult.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uscanresult"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="16"/>
|
||||
<CursorPos X="64" Y="25"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="uscanthread.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uscanthread"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="79"/>
|
||||
<CursorPos X="75" Y="120"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="ucpucount.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucpucount"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="udrawtim.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="udrawtim"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="40"/>
|
||||
<CursorPos X="21" Y="45"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BGRABitmap"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit12>
|
||||
</Units>
|
||||
<General>
|
||||
<ActiveWindowIndexAtStart Value="0"/>
|
||||
</General>
|
||||
</ProjectSession>
|
||||
<EditorMacros Count="0"/>
|
||||
</CONFIG>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="9"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="14">
|
||||
<Unit0>
|
||||
<Filename Value="tim2view.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="tim2view"/>
|
||||
<EditorIndex Value="8"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="52" Y="16"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umain.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="frmMain"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="umain"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="427"/>
|
||||
<CursorPos X="9" Y="450"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="edc.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="edc"/>
|
||||
<UsageCount Value="40"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="ecc.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ecc"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="13"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="ucommon.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucommon"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="35" Y="6"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="utim.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="utim"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="431"/>
|
||||
<CursorPos X="65" Y="447"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="ucdimage.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucdimage"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="81"/>
|
||||
<CursorPos X="95" Y="89"/>
|
||||
<UsageCount Value="40"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="usettings.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="usettings"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="81"/>
|
||||
<CursorPos X="55" Y="92"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="uscanresult.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uscanresult"/>
|
||||
<EditorIndex Value="9"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="16"/>
|
||||
<CursorPos X="64" Y="25"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="uscanthread.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uscanthread"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="53" Y="88"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="ucpucount.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ucpucount"/>
|
||||
<UsageCount Value="40"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="udrawtim.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="udrawtim"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="76"/>
|
||||
<CursorPos X="62" Y="41"/>
|
||||
<UsageCount Value="40"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BGRABitmap"/>
|
||||
<UsageCount Value="40"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="todos.inc"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="7"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="94" Y="2"/>
|
||||
<UsageCount Value="26"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit13>
|
||||
</Units>
|
||||
<General>
|
||||
<ActiveWindowIndexAtStart Value="0"/>
|
||||
</General>
|
||||
</ProjectSession>
|
||||
<EditorMacros Count="0"/>
|
||||
</CONFIG>
|
||||
|
||||
BIN
tim2view.res
BIN
tim2view.res
Binary file not shown.
@@ -3,7 +3,7 @@ unit ucommon;
|
||||
interface
|
||||
|
||||
const
|
||||
cProgramName = 'Tim2View SVN.r67 by [Lab 313] (for ' +
|
||||
cProgramName = 'Tim2View SVN.r70 by [Lab 313] (for ' +
|
||||
{$IFDEF Linux}'Linux' + {$IFEND}
|
||||
{$IFDEF Darwin}'Mac OS X' + {$IFEND}
|
||||
{$IFDEF Windows}'Windows' + {$IFEND}
|
||||
@@ -18,7 +18,7 @@ const
|
||||
sStatusBarScanningFile = 'Scanning File...';
|
||||
sStatusBarTimsExtracting = 'TIMs Extracting...';
|
||||
sStatusBarPngsExtracting = 'PNGs Extracting...';
|
||||
sStatusBarExtracted = 'Exctracted Successfully!';
|
||||
sStatusBarExtracted = 'Extracted Successfully!';
|
||||
sStatusBarParsingResult = 'Parsing Result...';
|
||||
sScanResultGood = 'Scan completed!';
|
||||
sSelectDirCaption = 'Please, select directory for scan...';
|
||||
|
||||
127
umain.lfm
127
umain.lfm
@@ -1,7 +1,7 @@
|
||||
object frmMain: TfrmMain
|
||||
Left = 561
|
||||
Left = 807
|
||||
Height = 590
|
||||
Top = 213
|
||||
Top = 193
|
||||
Width = 780
|
||||
HorzScrollBar.Page = 780
|
||||
HorzScrollBar.Range = 489
|
||||
@@ -524,6 +524,7 @@ object frmMain: TfrmMain
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Smooth = True
|
||||
TabOrder = 1
|
||||
BarShowText = True
|
||||
end
|
||||
object btnStopScan: TButton
|
||||
Left = 1
|
||||
@@ -581,7 +582,6 @@ object frmMain: TfrmMain
|
||||
Top = 28
|
||||
Width = 253
|
||||
Align = alClient
|
||||
AutoWidthLastColumn = True
|
||||
Columns = <
|
||||
item
|
||||
Caption = '# / 0'
|
||||
@@ -600,7 +600,7 @@ object frmMain: TfrmMain
|
||||
item
|
||||
Alignment = taCenter
|
||||
Caption = 'CLUTs'
|
||||
Width = 84
|
||||
Width = 57
|
||||
end>
|
||||
ColumnClick = False
|
||||
GridLines = True
|
||||
@@ -656,61 +656,23 @@ object frmMain: TfrmMain
|
||||
Color = clBtnFace
|
||||
ParentColor = False
|
||||
TabOrder = 1
|
||||
object splImageClut: TSplitter
|
||||
Cursor = crVSplit
|
||||
Left = 1
|
||||
Height = 3
|
||||
Top = 1
|
||||
Width = 520
|
||||
Align = alTop
|
||||
Beveled = True
|
||||
Color = clBtnFace
|
||||
ParentColor = False
|
||||
ResizeAnchor = akTop
|
||||
end
|
||||
object grdCurrClut: TDrawGrid
|
||||
Left = 1
|
||||
Height = 150
|
||||
Top = 320
|
||||
Width = 520
|
||||
Align = alBottom
|
||||
AutoEdit = False
|
||||
ColCount = 1
|
||||
DefaultColWidth = 14
|
||||
DefaultRowHeight = 14
|
||||
Enabled = False
|
||||
ExtendedSelect = False
|
||||
FixedCols = 0
|
||||
FixedRows = 0
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goDrawFocusSelected]
|
||||
RowCount = 1
|
||||
ScrollBars = ssAutoVertical
|
||||
TabOrder = 0
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'Tahoma'
|
||||
UseXORFeatures = True
|
||||
Visible = False
|
||||
OnDblClick = grdCurrClutDblClick
|
||||
OnDrawCell = grdCurrClutDrawCell
|
||||
end
|
||||
object pnlImageOptions: TPanel
|
||||
Left = 1
|
||||
Height = 25
|
||||
Top = 470
|
||||
Height = 27
|
||||
Top = 468
|
||||
Width = 520
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 25
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 27
|
||||
ClientWidth = 520
|
||||
Color = clBtnFace
|
||||
ParentColor = False
|
||||
TabOrder = 1
|
||||
TabOrder = 0
|
||||
object btnShowClut: TButton
|
||||
Left = 467
|
||||
Left = 466
|
||||
Height = 23
|
||||
Top = 1
|
||||
Top = 2
|
||||
Width = 52
|
||||
Align = alRight
|
||||
BorderSpacing.Around = 1
|
||||
@@ -719,18 +681,20 @@ object frmMain: TfrmMain
|
||||
TabOrder = 0
|
||||
end
|
||||
object cbbBitMode: TComboBox
|
||||
Left = 1
|
||||
Left = 2
|
||||
Height = 21
|
||||
Top = 1
|
||||
Width = 90
|
||||
Top = 2
|
||||
Width = 159
|
||||
Align = alLeft
|
||||
BorderSpacing.Around = 1
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Real'
|
||||
'4 BPP'
|
||||
'8 BPP'
|
||||
'4 BPP (Inner palette)'
|
||||
'4 BPP (Random palette) '
|
||||
'8 BPP (Inner palette)'
|
||||
'8 BPP (Random palette)'
|
||||
'16 BPP'
|
||||
'24 BPP'
|
||||
)
|
||||
@@ -741,9 +705,9 @@ object frmMain: TfrmMain
|
||||
Text = 'Real'
|
||||
end
|
||||
object cbbTranspMode: TComboBox
|
||||
Left = 92
|
||||
Left = 162
|
||||
Height = 21
|
||||
Top = 1
|
||||
Top = 2
|
||||
Width = 136
|
||||
Align = alLeft
|
||||
BorderSpacing.Around = 1
|
||||
@@ -762,9 +726,9 @@ object frmMain: TfrmMain
|
||||
Text = 'Full transparence'
|
||||
end
|
||||
object cbbCLUT: TComboBox
|
||||
Left = 357
|
||||
Left = 356
|
||||
Height = 21
|
||||
Top = 1
|
||||
Top = 2
|
||||
Width = 109
|
||||
Align = alRight
|
||||
BorderSpacing.Around = 1
|
||||
@@ -775,10 +739,49 @@ object frmMain: TfrmMain
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object pnlClut: TPanel
|
||||
Left = 1
|
||||
Height = 116
|
||||
Top = 352
|
||||
Width = 520
|
||||
Align = alBottom
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 116
|
||||
ClientWidth = 520
|
||||
Color = clBtnFace
|
||||
ParentColor = False
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
object grdClut: TDrawGrid
|
||||
Left = 1
|
||||
Height = 114
|
||||
Top = 1
|
||||
Width = 518
|
||||
Align = alClient
|
||||
AutoEdit = False
|
||||
ColCount = 1
|
||||
DefaultColWidth = 14
|
||||
DefaultRowHeight = 14
|
||||
Enabled = False
|
||||
ExtendedSelect = False
|
||||
FixedCols = 0
|
||||
FixedRows = 0
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goDrawFocusSelected]
|
||||
RowCount = 1
|
||||
ScrollBars = ssAutoVertical
|
||||
TabOrder = 0
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'Tahoma'
|
||||
UseXORFeatures = True
|
||||
OnDblClick = grdClutDblClick
|
||||
OnDrawCell = grdClutDrawCell
|
||||
end
|
||||
end
|
||||
object imgTim: TImage
|
||||
Left = 1
|
||||
Height = 316
|
||||
Top = 4
|
||||
Height = 351
|
||||
Top = 1
|
||||
Width = 520
|
||||
AntialiasingMode = amOff
|
||||
Align = alClient
|
||||
@@ -825,7 +828,7 @@ object frmMain: TfrmMain
|
||||
Title = 'Please, select File...'
|
||||
DefaultExt = '.bin'
|
||||
Filter = 'All Files (*.*)|*.*'
|
||||
Options = [ofHideReadOnly, ofNoChangeDir, ofAllowMultiSelect, ofFileMustExist, ofNoNetworkButton, ofEnableSizing, ofForceShowHidden]
|
||||
Options = [ofHideReadOnly, ofNoChangeDir, ofAllowMultiSelect, ofNoNetworkButton, ofEnableSizing, ofForceShowHidden]
|
||||
left = 664
|
||||
top = 448
|
||||
end
|
||||
@@ -1076,7 +1079,7 @@ object frmMain: TfrmMain
|
||||
end
|
||||
end
|
||||
object dlgSelectDir: TSelectDirectoryDialog
|
||||
Options = [ofNoChangeDir, ofPathMustExist, ofNoNetworkButton, ofEnableSizing, ofViewDetail]
|
||||
Options = [ofNoChangeDir, ofNoNetworkButton, ofEnableSizing, ofViewDetail]
|
||||
left = 449
|
||||
top = 450
|
||||
end
|
||||
|
||||
89
umain.pas
89
umain.pas
@@ -10,6 +10,8 @@ uses
|
||||
|
||||
uscanresult, uscanthread, usettings, utim, udrawtim;
|
||||
|
||||
{$INCLUDE todos.inc}
|
||||
|
||||
type
|
||||
|
||||
{ TfrmMain }
|
||||
@@ -49,7 +51,7 @@ type
|
||||
dlgSavePNG: TSavePictureDialog;
|
||||
dlgSaveTIM: TSaveDialog;
|
||||
ExtractTIM1: TMenuItem;
|
||||
grdCurrClut: TDrawGrid;
|
||||
grdClut: TDrawGrid;
|
||||
imgTim: TImage;
|
||||
lblStatus: TLabel;
|
||||
lvList: TListView;
|
||||
@@ -83,6 +85,7 @@ type
|
||||
N1: TMenuItem;
|
||||
N3: TMenuItem;
|
||||
N5: TMenuItem;
|
||||
pnlClut: TPanel;
|
||||
pbProgress: TProgressBar;
|
||||
pnlExtractAll: TPanel;
|
||||
pnlImage: TPanel;
|
||||
@@ -95,7 +98,6 @@ type
|
||||
ReplaceTIM1: TMenuItem;
|
||||
SaveasPNG1: TMenuItem;
|
||||
dlgSelectDir: TSelectDirectoryDialog;
|
||||
splImageClut: TSplitter;
|
||||
splMain: TSplitter;
|
||||
sbMain: TStatusBar;
|
||||
procedure actAboutExecute(Sender: TObject);
|
||||
@@ -124,8 +126,8 @@ type
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDropFiles(Sender: TObject; const FileNames: array of string);
|
||||
procedure grdCurrClutDblClick(Sender: TObject);
|
||||
procedure grdCurrClutDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState);
|
||||
procedure grdClutDblClick(Sender: TObject);
|
||||
procedure grdClutDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState);
|
||||
procedure lvListData(Sender: TObject; Item: TListItem);
|
||||
procedure lvListSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
|
||||
private
|
||||
@@ -165,6 +167,7 @@ type
|
||||
function FormatPngName(const FileName: string; ListIdx_, BitMode, Clut: Integer): string;
|
||||
procedure ShowTim;
|
||||
procedure ShowTimInfo(ShowInfo: Boolean);
|
||||
procedure RemoveGridSelection;
|
||||
public
|
||||
{ public declarations }
|
||||
ScanResults: TScanResultList; //List of finished scan results
|
||||
@@ -182,6 +185,10 @@ uses ucdimage, ucpucount, lcltype, ucommon, LCLIntf
|
||||
{$IFDEF windows}
|
||||
,registry
|
||||
{$IFEND}
|
||||
|
||||
{$IFDEF Linux}
|
||||
,BaseUnix
|
||||
{$IFEND}
|
||||
;
|
||||
|
||||
{$R *.lfm}
|
||||
@@ -229,11 +236,12 @@ begin
|
||||
if not dlgSavePNG.Execute then Exit;
|
||||
|
||||
Surf^.SaveToFile(UTF8ToSys(dlgSavePNG.FileName));
|
||||
{$IFDEF Linux}FpChmod(dlgSavePNG.FileName, &777){$IFEND}
|
||||
end;
|
||||
|
||||
procedure TfrmMain.btnShowClutClick(Sender: TObject);
|
||||
begin
|
||||
grdCurrClut.Visible := not grdCurrClut.Visible;
|
||||
pnlClut.Visible := not pnlClut.Visible;
|
||||
DrawSelClut;
|
||||
actReturnFocus.Execute;
|
||||
end;
|
||||
@@ -262,7 +270,7 @@ end;
|
||||
|
||||
procedure TfrmMain.actAboutExecute(Sender: TObject);
|
||||
begin
|
||||
Application.MessageBox(cProgramName + #13 + 'Some "about strings" should be here!:)', 'About', MB_OK + MB_ICONINFORMATION);
|
||||
Application.MessageBox(cProgramName + #13#10#13#10 + 'Some "about strings" should be here!:)', 'About', MB_OK + MB_ICONINFORMATION);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.actAssocTimsExecute(Sender: TObject);
|
||||
@@ -380,7 +388,9 @@ begin
|
||||
TIM := LoadTimFromFile(FName, OFFSET, IsImage, SIZE);
|
||||
TimToPNG(TIM, cbbCLUT.ItemIndex, Surf_, cbbTranspMode.ItemIndex);
|
||||
|
||||
Surf_^.SaveToFile(UTF8ToSys(Path + FormatPngName(FName, I - 1, BIT_MODE, 0)));
|
||||
Path := Path + FormatPngName(FName, I - 1, BIT_MODE, 0);
|
||||
Surf_^.SaveToFile(UTF8ToSys(Path));
|
||||
{$IFDEF Linux}FpChmod(Path, &777){$IFEND}
|
||||
Surf_^.Free;
|
||||
Surf_^ := nil;
|
||||
|
||||
@@ -404,6 +414,7 @@ begin
|
||||
|
||||
TIM := SelectedTim;
|
||||
SaveTimToFile(dlgSaveTIM.FileName, TIM);
|
||||
{$IFDEF Linux}FpChmod(dlgSaveTIM.FileName, &777){$IFEND}
|
||||
FreeTIM(TIM);
|
||||
end;
|
||||
|
||||
@@ -435,7 +446,9 @@ begin
|
||||
CreateDirUTF8(Path);
|
||||
|
||||
TIM := LoadTimFromFile(FName, OFFSET, IsImage, SIZE);
|
||||
SaveTimToFile(Path + FormatTimName(FName, I - 1, BIT_MODE), TIM);
|
||||
Path := Path + FormatTimName(FName, I - 1, BIT_MODE);
|
||||
SaveTimToFile(Path, TIM);
|
||||
{$IFDEF Linux}FpChmod(Path, &777){$IFEND}
|
||||
FreeTIM(TIM);
|
||||
|
||||
pbProgress.Position := I;
|
||||
@@ -501,24 +514,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||
var
|
||||
hGridRect: TGridRect;
|
||||
begin
|
||||
{$IFnDEF Windows}mnOptions.Enabled := False;{$IFEND}
|
||||
|
||||
Settings := TSettings.Create(ExtractFilePath(ParamStrUTF8(0)));
|
||||
|
||||
actStretch.Checked := Settings.StretchMode;
|
||||
cbbTranspMode.ItemIndex := Settings.TranspMode;
|
||||
LastDir := Settings.LastDir;
|
||||
cbbBitMode.ItemIndex := Settings.BitMode;
|
||||
pnlImage.Color := Settings.BackColor;
|
||||
|
||||
hGridRect.Top := -1;
|
||||
hGridRect.Left := -1;
|
||||
hGridRect.Right := -1;
|
||||
hGridRect.Bottom := -1;
|
||||
grdCurrClut.Selection := hGridRect;
|
||||
|
||||
ScanThreads := TScanThreadList.Create(False); //False - to able scan thread remove itself from this list
|
||||
ScanResults := TScanResultList.Create(False);
|
||||
StartedScans := 0;
|
||||
@@ -543,7 +547,7 @@ begin
|
||||
ScanPath(FileNames[i - 1]);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.grdCurrClutDblClick(Sender: TObject);
|
||||
procedure TfrmMain.grdClutDblClick(Sender: TObject);
|
||||
var
|
||||
TIM: PTIM;
|
||||
I, SELECTED_CELL, W, DIALOG_COLOR, CLUT_NUM: Integer;
|
||||
@@ -553,7 +557,7 @@ begin
|
||||
TIM := SelectedTim;
|
||||
if TIM = nil then Exit;
|
||||
|
||||
SELECTED_CELL := grdCurrCLUT.Row * grdCurrCLUT.ColCount + grdCurrCLUT.Col;
|
||||
SELECTED_CELL := grdClut.Row * grdClut.ColCount + grdClut.Col;
|
||||
W := GetTimColorsCount(TIM);
|
||||
|
||||
if SELECTED_CELL >= W then
|
||||
@@ -603,7 +607,7 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmMain.grdCurrClutDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
procedure TfrmMain.grdClutDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
aRect: TRect; aState: TGridDrawState);
|
||||
var
|
||||
TIM: PTIM;
|
||||
@@ -617,7 +621,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
DrawClutCell(TIM, cbbCLUT.ItemIndex, @grdCurrCLUT, ACol, ARow);
|
||||
DrawClutCell(TIM, cbbCLUT.ItemIndex, @grdClut, ACol, ARow);
|
||||
|
||||
FreeTIM(TIM);
|
||||
end;
|
||||
@@ -763,6 +767,8 @@ end;
|
||||
|
||||
procedure TfrmMain.CheckButtonsAndMainMenu;
|
||||
begin
|
||||
RemoveGridSelection;
|
||||
|
||||
cbbFiles.Enabled := (cbbFiles.Items.Count <> 0);
|
||||
|
||||
pnlList.Enabled := cbbFiles.Enabled;
|
||||
@@ -827,7 +833,6 @@ begin
|
||||
if TIM = nil then Exit;
|
||||
|
||||
CLUTS := GetTIMClutsCount(TIM);
|
||||
//cbbCLUT.Items.Clear;
|
||||
|
||||
cbbCLUT.Items.BeginUpdate;
|
||||
for I := 0 to cbbCLUT.Items.Count -1 do
|
||||
@@ -854,9 +859,11 @@ begin
|
||||
|
||||
case cbbBitMode.ItemIndex of
|
||||
1: mode := cTIM4C;
|
||||
2: mode := cTIM8C;
|
||||
3: mode := cTIM16NC;
|
||||
4: mode := cTIM24NC;
|
||||
2: mode := cTIM4NC;
|
||||
3: mode := cTIM8C;
|
||||
4: mode := cTIM8NC;
|
||||
5: mode := cTIM16NC;
|
||||
6: mode := cTIM24NC;
|
||||
else
|
||||
mode := $FF;
|
||||
end;
|
||||
@@ -878,26 +885,26 @@ procedure TfrmMain.DrawSelClut;
|
||||
var
|
||||
TIM: PTIM;
|
||||
begin
|
||||
if not grdCurrClut.Visible then Exit;
|
||||
if not pnlClut.Visible then Exit;
|
||||
|
||||
ClearGrid(@grdCurrCLUT);
|
||||
ClearGrid(@grdClut);
|
||||
|
||||
TIM := SelectedTim;
|
||||
if TIM = nil then
|
||||
begin
|
||||
grdCurrCLUT.ColCount := 1;
|
||||
grdCurrCLUT.RowCount := 1;
|
||||
grdClut.ColCount := 1;
|
||||
grdClut.RowCount := 1;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
grdCurrCLUT.Enabled := TIMHasCLUT(TIM);
|
||||
grdClut.Enabled := TIMHasCLUT(TIM);
|
||||
|
||||
if TIMHasCLUT(TIM) then
|
||||
DrawCLUT(TIM, cbbCLUT.ItemIndex, @grdCurrCLUT)
|
||||
DrawCLUT(TIM, cbbCLUT.ItemIndex, @grdClut)
|
||||
else
|
||||
begin
|
||||
grdCurrCLUT.ColCount := 1;
|
||||
grdCurrCLUT.RowCount := 1;
|
||||
grdClut.ColCount := 1;
|
||||
grdClut.RowCount := 1;
|
||||
end;
|
||||
|
||||
FreeTIM(TIM);
|
||||
@@ -927,7 +934,8 @@ begin
|
||||
if (lvList.Selected = nil) then Exit;
|
||||
if (lvList.Items.Count = 0) then Exit;
|
||||
|
||||
cbbBitMode.ItemIndex := 0;
|
||||
{ TODO : Reset bitmode or not? }
|
||||
//cbbBitMode.ItemIndex := 0;
|
||||
|
||||
UpdateCLUTInfo;
|
||||
DrawSelTim;
|
||||
@@ -981,5 +989,16 @@ begin
|
||||
FreeTIM(TIM);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.RemoveGridSelection;
|
||||
var
|
||||
hGrid: TGridRect;
|
||||
begin
|
||||
hGrid.Top := -1;
|
||||
hGrid.Left := -1;
|
||||
hGrid.Right := -1;
|
||||
hGrid.Bottom := -1;
|
||||
grdClut.Selection := hGrid;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ type
|
||||
function FLastDirRead(): string;
|
||||
procedure FBackColorWrite(Color: TColor);
|
||||
function FBackColorRead(): TColor;
|
||||
procedure FBitModeWrite(Mode: Integer);
|
||||
function FBitModeRead(): Integer;
|
||||
public
|
||||
constructor Create(const DirPath: string);
|
||||
destructor Destroy; override;
|
||||
@@ -29,6 +31,7 @@ type
|
||||
property StretchMode: Boolean read FStretchModeRead write FStretchModeWrite;
|
||||
property LastDir: string read FLastDirRead write FLastDirWrite;
|
||||
property BackColor: TColor read FBackColorRead write FBackColorWrite;
|
||||
property BitMode: Integer read FBitModeRead write FBitModeWrite;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -79,6 +82,16 @@ begin
|
||||
Result := FIniFile.ReadInteger(sMain, 'BackColor', clBtnFace);
|
||||
end;
|
||||
|
||||
procedure TSettings.FBitModeWrite(Mode: Integer);
|
||||
begin
|
||||
FIniFile.WriteInteger(sMain, 'BitMode', Mode);
|
||||
end;
|
||||
|
||||
function TSettings.FBitModeRead: Integer;
|
||||
begin
|
||||
Result := FIniFile.ReadInteger(sMain, 'BitMode', 0);
|
||||
end;
|
||||
|
||||
constructor TSettings.Create(const DirPath: string);
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
Reference in New Issue
Block a user