Added CLT, PXL support.
Added Mixed TIM with CLUT support. Some longtime bugs fixed.
This commit is contained in:
49
tim2view.lpi
49
tim2view.lpi
@@ -14,6 +14,9 @@
|
|||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<Title Value="tim2view"/>
|
<Title Value="tim2view"/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
<Icon Value="0"/>
|
<Icon Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<i18n>
|
<i18n>
|
||||||
@@ -23,8 +26,8 @@
|
|||||||
<UseVersionInfo Value="True"/>
|
<UseVersionInfo Value="True"/>
|
||||||
<AutoIncrementBuild Value="True"/>
|
<AutoIncrementBuild Value="True"/>
|
||||||
<MajorVersionNr Value="1"/>
|
<MajorVersionNr Value="1"/>
|
||||||
<RevisionNr Value="86"/>
|
<RevisionNr Value="88"/>
|
||||||
<BuildNr Value="1"/>
|
<BuildNr Value="12"/>
|
||||||
<StringTable CompanyName="Lab 313" FileDescription="The best TIMs tool ever!:)" ProductVersion=""/>
|
<StringTable CompanyName="Lab 313" FileDescription="The best TIMs tool ever!:)" ProductVersion=""/>
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
<BuildModes Count="6">
|
<BuildModes Count="6">
|
||||||
@@ -65,12 +68,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
</Item2>
|
</Item2>
|
||||||
<Item3 Name="Win Release x64">
|
<Item3 Name="Win Release x64">
|
||||||
@@ -109,12 +106,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
</Item3>
|
</Item3>
|
||||||
<Item4 Name="Linux Release x86">
|
<Item4 Name="Linux Release x86">
|
||||||
@@ -153,12 +144,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
</Item4>
|
</Item4>
|
||||||
<Item5 Name="Linux Release x64">
|
<Item5 Name="Linux Release x64">
|
||||||
@@ -197,12 +182,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
</Item5>
|
</Item5>
|
||||||
<Item6 Name="Mac Release x86">
|
<Item6 Name="Mac Release x86">
|
||||||
@@ -241,12 +220,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
</Item6>
|
</Item6>
|
||||||
</BuildModes>
|
</BuildModes>
|
||||||
@@ -267,7 +240,6 @@
|
|||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="tim2view.lpr"/>
|
<Filename Value="tim2view.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="tim2view"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="umain.pas"/>
|
<Filename Value="umain.pas"/>
|
||||||
@@ -280,12 +252,10 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="edc.pas"/>
|
<Filename Value="edc.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="edc"/>
|
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="ecc.pas"/>
|
<Filename Value="ecc.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="ecc"/>
|
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="ucommon.pas"/>
|
<Filename Value="ucommon.pas"/>
|
||||||
@@ -330,7 +300,6 @@
|
|||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="BGRABitmap"/>
|
|
||||||
</Unit12>
|
</Unit12>
|
||||||
<Unit13>
|
<Unit13>
|
||||||
<Filename Value="todos.inc"/>
|
<Filename Value="todos.inc"/>
|
||||||
@@ -376,12 +345,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<MsgFileName Value=""/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<Exceptions Count="3">
|
<Exceptions Count="3">
|
||||||
@@ -396,4 +359,4 @@
|
|||||||
</Item3>
|
</Item3>
|
||||||
</Exceptions>
|
</Exceptions>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
|||||||
388
tim2view.lps
388
tim2view.lps
@@ -1,204 +1,184 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="9"/>
|
<Version Value="9"/>
|
||||||
<BuildModes Active="Debug"/>
|
<BuildModes Active="Win Release x86"/>
|
||||||
<Units Count="15">
|
<Units Count="15">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="tim2view.lpr"/>
|
<Filename Value="tim2view.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="tim2view"/>
|
<CursorPos X="46" Y="13"/>
|
||||||
<WindowIndex Value="0"/>
|
<UsageCount Value="816"/>
|
||||||
<TopLine Value="1"/>
|
</Unit0>
|
||||||
<CursorPos X="46" Y="13"/>
|
<Unit1>
|
||||||
<UsageCount Value="816"/>
|
<Filename Value="umain.pas"/>
|
||||||
</Unit0>
|
<IsPartOfProject Value="True"/>
|
||||||
<Unit1>
|
<ComponentName Value="frmMain"/>
|
||||||
<Filename Value="umain.pas"/>
|
<HasResources Value="True"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<ComponentName Value="frmMain"/>
|
<UnitName Value="umain"/>
|
||||||
<HasResources Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<TopLine Value="691"/>
|
||||||
<UnitName Value="umain"/>
|
<CursorPos X="81" Y="710"/>
|
||||||
<EditorIndex Value="0"/>
|
<UsageCount Value="816"/>
|
||||||
<WindowIndex Value="0"/>
|
<Loaded Value="True"/>
|
||||||
<TopLine Value="295"/>
|
<LoadedDesigner Value="True"/>
|
||||||
<CursorPos X="66" Y="308"/>
|
</Unit1>
|
||||||
<UsageCount Value="816"/>
|
<Unit2>
|
||||||
<Loaded Value="True"/>
|
<Filename Value="edc.pas"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
</Unit1>
|
<UsageCount Value="816"/>
|
||||||
<Unit2>
|
</Unit2>
|
||||||
<Filename Value="edc.pas"/>
|
<Unit3>
|
||||||
<IsPartOfProject Value="True"/>
|
<Filename Value="ecc.pas"/>
|
||||||
<UnitName Value="edc"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UsageCount Value="816"/>
|
<TopLine Value="13"/>
|
||||||
</Unit2>
|
<UsageCount Value="816"/>
|
||||||
<Unit3>
|
</Unit3>
|
||||||
<Filename Value="ecc.pas"/>
|
<Unit4>
|
||||||
<IsPartOfProject Value="True"/>
|
<Filename Value="ucommon.pas"/>
|
||||||
<UnitName Value="ecc"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<WindowIndex Value="0"/>
|
<UnitName Value="ucommon"/>
|
||||||
<TopLine Value="13"/>
|
<EditorIndex Value="3"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<TopLine Value="15"/>
|
||||||
<UsageCount Value="816"/>
|
<CursorPos X="73" Y="11"/>
|
||||||
</Unit3>
|
<UsageCount Value="816"/>
|
||||||
<Unit4>
|
<Loaded Value="True"/>
|
||||||
<Filename Value="ucommon.pas"/>
|
</Unit4>
|
||||||
<IsPartOfProject Value="True"/>
|
<Unit5>
|
||||||
<UnitName Value="ucommon"/>
|
<Filename Value="utim.pas"/>
|
||||||
<EditorIndex Value="3"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<WindowIndex Value="0"/>
|
<UnitName Value="utim"/>
|
||||||
<TopLine Value="1"/>
|
<EditorIndex Value="10"/>
|
||||||
<CursorPos X="70" Y="9"/>
|
<TopLine Value="420"/>
|
||||||
<UsageCount Value="816"/>
|
<CursorPos Y="401"/>
|
||||||
<Loaded Value="True"/>
|
<UsageCount Value="816"/>
|
||||||
</Unit4>
|
<Loaded Value="True"/>
|
||||||
<Unit5>
|
</Unit5>
|
||||||
<Filename Value="utim.pas"/>
|
<Unit6>
|
||||||
<IsPartOfProject Value="True"/>
|
<Filename Value="ucdimage.pas"/>
|
||||||
<UnitName Value="utim"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="10"/>
|
<UnitName Value="ucdimage"/>
|
||||||
<WindowIndex Value="0"/>
|
<EditorIndex Value="2"/>
|
||||||
<TopLine Value="244"/>
|
<TopLine Value="112"/>
|
||||||
<CursorPos X="82" Y="311"/>
|
<CursorPos X="50" Y="117"/>
|
||||||
<UsageCount Value="816"/>
|
<UsageCount Value="816"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit5>
|
</Unit6>
|
||||||
<Unit6>
|
<Unit7>
|
||||||
<Filename Value="ucdimage.pas"/>
|
<Filename Value="usettings.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="ucdimage"/>
|
<UnitName Value="usettings"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="9"/>
|
||||||
<WindowIndex Value="0"/>
|
<TopLine Value="58"/>
|
||||||
<TopLine Value="112"/>
|
<CursorPos X="35" Y="63"/>
|
||||||
<CursorPos X="50" Y="117"/>
|
<UsageCount Value="816"/>
|
||||||
<UsageCount Value="816"/>
|
<Loaded Value="True"/>
|
||||||
<Loaded Value="True"/>
|
</Unit7>
|
||||||
</Unit6>
|
<Unit8>
|
||||||
<Unit7>
|
<Filename Value="uscanresult.pas"/>
|
||||||
<Filename Value="usettings.pas"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<UnitName Value="uscanresult"/>
|
||||||
<UnitName Value="usettings"/>
|
<EditorIndex Value="7"/>
|
||||||
<EditorIndex Value="9"/>
|
<TopLine Value="56"/>
|
||||||
<WindowIndex Value="0"/>
|
<CursorPos Y="71"/>
|
||||||
<TopLine Value="132"/>
|
<UsageCount Value="816"/>
|
||||||
<CursorPos X="1" Y="150"/>
|
<Loaded Value="True"/>
|
||||||
<UsageCount Value="816"/>
|
</Unit8>
|
||||||
<Loaded Value="True"/>
|
<Unit9>
|
||||||
</Unit7>
|
<Filename Value="uscanthread.pas"/>
|
||||||
<Unit8>
|
<IsPartOfProject Value="True"/>
|
||||||
<Filename Value="uscanresult.pas"/>
|
<UnitName Value="uscanthread"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<EditorIndex Value="8"/>
|
||||||
<UnitName Value="uscanresult"/>
|
<TopLine Value="18"/>
|
||||||
<EditorIndex Value="7"/>
|
<CursorPos X="37" Y="68"/>
|
||||||
<WindowIndex Value="0"/>
|
<UsageCount Value="816"/>
|
||||||
<TopLine Value="54"/>
|
<Loaded Value="True"/>
|
||||||
<CursorPos X="79" Y="80"/>
|
</Unit9>
|
||||||
<UsageCount Value="816"/>
|
<Unit10>
|
||||||
<Loaded Value="True"/>
|
<Filename Value="ucpucount.pas"/>
|
||||||
</Unit8>
|
<IsPartOfProject Value="True"/>
|
||||||
<Unit9>
|
<UnitName Value="ucpucount"/>
|
||||||
<Filename Value="uscanthread.pas"/>
|
<EditorIndex Value="4"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<TopLine Value="19"/>
|
||||||
<UnitName Value="uscanthread"/>
|
<CursorPos X="87" Y="34"/>
|
||||||
<EditorIndex Value="8"/>
|
<UsageCount Value="816"/>
|
||||||
<WindowIndex Value="0"/>
|
<Loaded Value="True"/>
|
||||||
<TopLine Value="172"/>
|
</Unit10>
|
||||||
<CursorPos X="3" Y="187"/>
|
<Unit11>
|
||||||
<UsageCount Value="816"/>
|
<Filename Value="udrawtim.pas"/>
|
||||||
<Loaded Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
</Unit9>
|
<UnitName Value="udrawtim"/>
|
||||||
<Unit10>
|
<EditorIndex Value="5"/>
|
||||||
<Filename Value="ucpucount.pas"/>
|
<CursorPos X="15" Y="212"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<UsageCount Value="816"/>
|
||||||
<UnitName Value="ucpucount"/>
|
<Loaded Value="True"/>
|
||||||
<EditorIndex Value="4"/>
|
</Unit11>
|
||||||
<WindowIndex Value="0"/>
|
<Unit12>
|
||||||
<TopLine Value="19"/>
|
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
||||||
<CursorPos X="87" Y="34"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UsageCount Value="816"/>
|
<TopLine Value="54"/>
|
||||||
<Loaded Value="True"/>
|
<CursorPos X="3" Y="69"/>
|
||||||
</Unit10>
|
<UsageCount Value="816"/>
|
||||||
<Unit11>
|
</Unit12>
|
||||||
<Filename Value="udrawtim.pas"/>
|
<Unit13>
|
||||||
<IsPartOfProject Value="True"/>
|
<Filename Value="todos.inc"/>
|
||||||
<UnitName Value="udrawtim"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<EditorIndex Value="1"/>
|
||||||
<EditorIndex Value="5"/>
|
<CursorPos X="31" Y="3"/>
|
||||||
<WindowIndex Value="0"/>
|
<UsageCount Value="802"/>
|
||||||
<TopLine Value="92"/>
|
<Loaded Value="True"/>
|
||||||
<CursorPos X="58" Y="103"/>
|
</Unit13>
|
||||||
<UsageCount Value="816"/>
|
<Unit14>
|
||||||
<Loaded Value="True"/>
|
<Filename Value="uexportimport.pas"/>
|
||||||
</Unit11>
|
<IsPartOfProject Value="True"/>
|
||||||
<Unit12>
|
<UnitName Value="uexportimport"/>
|
||||||
<Filename Value="bgrabitmap\bgrabitmap.pas"/>
|
<EditorIndex Value="6"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<TopLine Value="7"/>
|
||||||
<UnitName Value="BGRABitmap"/>
|
<CursorPos X="32" Y="35"/>
|
||||||
<WindowIndex Value="0"/>
|
<UsageCount Value="96"/>
|
||||||
<TopLine Value="54"/>
|
<Loaded Value="True"/>
|
||||||
<CursorPos X="3" Y="69"/>
|
</Unit14>
|
||||||
<UsageCount Value="816"/>
|
</Units>
|
||||||
</Unit12>
|
</ProjectSession>
|
||||||
<Unit13>
|
<Debugging>
|
||||||
<Filename Value="todos.inc"/>
|
<BreakPoints Count="3">
|
||||||
<IsPartOfProject Value="True"/>
|
<Item1>
|
||||||
<EditorIndex Value="1"/>
|
<Kind Value="bpkSource"/>
|
||||||
<WindowIndex Value="0"/>
|
<WatchScope Value="wpsLocal"/>
|
||||||
<TopLine Value="1"/>
|
<WatchKind Value="wpkWrite"/>
|
||||||
<CursorPos X="31" Y="3"/>
|
<Source Value="c:\Lazarus\fpc\2.6.2\source\packages\fcl-image\src\fpimage.inc"/>
|
||||||
<UsageCount Value="802"/>
|
<Line Value="350"/>
|
||||||
<Loaded Value="True"/>
|
</Item1>
|
||||||
</Unit13>
|
<Item2>
|
||||||
<Unit14>
|
<Kind Value="bpkSource"/>
|
||||||
<Filename Value="uexportimport.pas"/>
|
<WatchScope Value="wpsLocal"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<WatchKind Value="wpkWrite"/>
|
||||||
<UnitName Value="uexportimport"/>
|
<Source Value="c:\Lazarus\fpc\2.6.2\source\packages\fcl-image\src\fppalette.inc"/>
|
||||||
<EditorIndex Value="6"/>
|
<Line Value="159"/>
|
||||||
<WindowIndex Value="0"/>
|
</Item2>
|
||||||
<TopLine Value="7"/>
|
<Item3>
|
||||||
<CursorPos X="20" Y="16"/>
|
<Kind Value="bpkSource"/>
|
||||||
<UsageCount Value="83"/>
|
<WatchScope Value="wpsLocal"/>
|
||||||
<Loaded Value="True"/>
|
<WatchKind Value="wpkWrite"/>
|
||||||
</Unit14>
|
<Source Value="usettings.pas"/>
|
||||||
</Units>
|
<Line Value="74"/>
|
||||||
<General>
|
</Item3>
|
||||||
<ActiveWindowIndexAtStart Value="0"/>
|
</BreakPoints>
|
||||||
</General>
|
<Watches Count="3">
|
||||||
</ProjectSession>
|
<Item1>
|
||||||
<Debugging>
|
<Expression Value="IDX"/>
|
||||||
<BreakPoints Count="2">
|
<DisplayStyle Value="wdfHex"/>
|
||||||
<Item1>
|
</Item1>
|
||||||
<Kind Value="bpkSource"/>
|
<Item2>
|
||||||
<WatchScope Value="wpsLocal"/>
|
<Expression Value="TData^[POS]"/>
|
||||||
<WatchKind Value="wpkWrite"/>
|
<DisplayStyle Value="wdfHex"/>
|
||||||
<Source Value="c:\Lazarus\fpc\2.6.2\source\packages\fcl-image\src\fpimage.inc"/>
|
</Item2>
|
||||||
<Line Value="350"/>
|
<Item3>
|
||||||
</Item1>
|
<Expression Value="IDX_INT"/>
|
||||||
<Item2>
|
<DisplayStyle Value="wdfHex"/>
|
||||||
<Kind Value="bpkSource"/>
|
</Item3>
|
||||||
<WatchScope Value="wpsLocal"/>
|
</Watches>
|
||||||
<WatchKind Value="wpkWrite"/>
|
</Debugging>
|
||||||
<Source Value="c:\Lazarus\fpc\2.6.2\source\packages\fcl-image\src\fppalette.inc"/>
|
</CONFIG>
|
||||||
<Line Value="159"/>
|
|
||||||
</Item2>
|
|
||||||
</BreakPoints>
|
|
||||||
<Watches Count="3">
|
|
||||||
<Item1>
|
|
||||||
<Expression Value="IDX"/>
|
|
||||||
<DisplayStyle Value="wdfHex"/>
|
|
||||||
</Item1>
|
|
||||||
<Item2>
|
|
||||||
<Expression Value="TData^[POS]"/>
|
|
||||||
<DisplayStyle Value="wdfHex"/>
|
|
||||||
</Item2>
|
|
||||||
<Item3>
|
|
||||||
<Expression Value="IDX_INT"/>
|
|
||||||
<DisplayStyle Value="wdfHex"/>
|
|
||||||
</Item3>
|
|
||||||
</Watches>
|
|
||||||
</Debugging>
|
|
||||||
<EditorMacros Count="0"/>
|
|
||||||
</CONFIG>
|
|
||||||
|
|||||||
BIN
tim2view.res
BIN
tim2view.res
Binary file not shown.
12
ucommon.pas
12
ucommon.pas
@@ -3,26 +3,26 @@ unit ucommon;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
const
|
const
|
||||||
cProgramName = 'Tim2View SVN.r86 by [Lab 313] (for ' +
|
cProgramName = 'Tim2View SVN.r88 by [Lab 313] (for ' +
|
||||||
{$IFDEF Linux}'Linux' + {$IFEND}
|
{$IFDEF Linux}'Linux' + {$IFEND}
|
||||||
{$IFDEF Darwin}'Mac OS X' + {$IFEND}
|
{$IFDEF Darwin}'Mac OS X' + {$IFEND}
|
||||||
{$IFDEF Windows}'Windows' + {$IFEND}
|
{$IFDEF Windows}'Windows' + {$IFEND}
|
||||||
')';
|
')';
|
||||||
cExtractedTimsDir = 'TIMS';
|
cExtractedFilesDir = 'FILES';
|
||||||
cExtractedPngsDir = 'PNGS';
|
cExtractedPngsDir = 'PNGS';
|
||||||
cMaxFileSize = $2EAEED80;
|
cMaxFileSize = $2EAEED80;
|
||||||
|
|
||||||
cAutoExtractionTimFormat = '%s_%.6d_%.2db' + '.tim';
|
cAutoExtractionFileFormat = '%s_%.6d_%.2db' + '.%s' {tim|clt|pxl};
|
||||||
cAutoExtractionPngFormat = '%s_%.6d_%.2db_%.2dc' + '.png';
|
cAutoExtractionPngFormat = '%s_%.6d_%.2db_%.2dc' + '.png';
|
||||||
|
|
||||||
sStatusBarScanningFile = 'Scanning File...';
|
sStatusBarScanningFile = 'Scanning File...';
|
||||||
sStatusBarTimsExtracting = 'TIMs Extracting...';
|
sStatusBarFilesExtracting = 'Files Extracting...';
|
||||||
sStatusBarPngsExtracting = 'PNGs Extracting...';
|
sStatusBarPngsExtracting = 'PNGs Extracting...';
|
||||||
sStatusBarExtracted = 'Extracted Successfully!';
|
sStatusBarExtracted = 'Extracted Successfully!';
|
||||||
sStatusBarParsingResult = 'Parsing Result...';
|
sStatusBarParsingResult = 'Parsing Result...';
|
||||||
sScanResultGood = 'Scan completed!';
|
sScanResultGood = 'Scan completed!';
|
||||||
sSelectDirCaption = 'Please, select directory for scan...';
|
sSelectDirCaption = 'Please, select directory for scan...';
|
||||||
sThisTimHasNoCLUT = 'No CLUT';
|
sThisFileHasNoCLUT = 'No CLUT';
|
||||||
|
|
||||||
type
|
type
|
||||||
TBytesArray = array [0 .. cMaxFileSize - 1] of byte;
|
TBytesArray = array [0 .. cMaxFileSize - 1] of byte;
|
||||||
@@ -40,4 +40,4 @@ begin
|
|||||||
Result := Copy(Result, 1, Length(Result) - Length(ExtractFileExt(Result)));
|
Result := Copy(Result, 1, Length(Result) - Length(ExtractFileExt(Result)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ begin
|
|||||||
case TIM^.HEAD^.bBPP of
|
case TIM^.HEAD^.bBPP of
|
||||||
cTIM4C, cTIM4NC, cTIM8C, cTIM8NC:
|
cTIM4C, cTIM4NC, cTIM8C, cTIM8NC:
|
||||||
Image^.Pixels[X - 1, Y - 1] := INDEXES^[IDX] mod COLORS;
|
Image^.Pixels[X - 1, Y - 1] := INDEXES^[IDX] mod COLORS;
|
||||||
cTIM16C, cTIM16NC, cTIMMix:
|
cTIM16C, cTIM16NC, cTIMMixC, cTIMMixNC:
|
||||||
begin
|
begin
|
||||||
CW := 0;
|
CW := 0;
|
||||||
Move(INDEXES^[IDX], CW, 2);
|
Move(INDEXES^[IDX], CW, 2);
|
||||||
@@ -386,4 +386,4 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
143
umain.lfm
143
umain.lfm
@@ -9,7 +9,7 @@ object frmMain: TfrmMain
|
|||||||
VertScrollBar.Range = 344
|
VertScrollBar.Range = 344
|
||||||
ActiveControl = pnlList
|
ActiveControl = pnlList
|
||||||
AllowDropFiles = True
|
AllowDropFiles = True
|
||||||
ClientHeight = 643
|
ClientHeight = 648
|
||||||
ClientWidth = 790
|
ClientWidth = 790
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
@@ -494,11 +494,11 @@ object frmMain: TfrmMain
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDropFiles = FormDropFiles
|
OnDropFiles = FormDropFiles
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.2.2.0'
|
LCLVersion = '1.4.0.2'
|
||||||
object pnlStatus: TPanel
|
object pnlStatus: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 613
|
Top = 618
|
||||||
Width = 790
|
Width = 790
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
@@ -538,13 +538,13 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object cbbFiles: TComboBox
|
object cbbFiles: TComboBox
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 28
|
Height = 21
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 790
|
Width = 790
|
||||||
Align = alTop
|
Align = alTop
|
||||||
DropDownCount = 30
|
DropDownCount = 30
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
OnChange = actChangeFileExecute
|
OnChange = actChangeFileExecute
|
||||||
OnCloseUp = actReturnFocusExecute
|
OnCloseUp = actReturnFocusExecute
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
@@ -552,33 +552,33 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object pnlMain: TPanel
|
object pnlMain: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 585
|
Height = 597
|
||||||
Top = 28
|
Top = 21
|
||||||
Width = 790
|
Width = 790
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 585
|
ClientHeight = 597
|
||||||
ClientWidth = 790
|
ClientWidth = 790
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object splMain: TSplitter
|
object splMain: TSplitter
|
||||||
Left = 253
|
Left = 253
|
||||||
Height = 585
|
Height = 597
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
end
|
end
|
||||||
object pnlList: TPanel
|
object pnlList: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 585
|
Height = 597
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 253
|
Width = 253
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 585
|
ClientHeight = 597
|
||||||
ClientWidth = 253
|
ClientWidth = 253
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object lvList: TListView
|
object lvList: TListView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 372
|
Height = 384
|
||||||
Top = 28
|
Top = 28
|
||||||
Width = 253
|
Width = 253
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@@ -586,25 +586,31 @@ object frmMain: TfrmMain
|
|||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = '# / 0'
|
Caption = '# / 0'
|
||||||
Width = 41
|
Width = 249
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'BPP'
|
Caption = 'BPP'
|
||||||
Width = 35
|
Width = 30
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'CLUTs'
|
Caption = 'CLUTs'
|
||||||
Width = 47
|
Width = 42
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Alignment = taCenter
|
||||||
|
AutoSize = True
|
||||||
|
Caption = 'Type'
|
||||||
|
Width = 37
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'W x H'
|
Caption = 'W x H'
|
||||||
Width = 128
|
Width = 41
|
||||||
end>
|
end>
|
||||||
ColumnClick = False
|
ColumnClick = False
|
||||||
OwnerData = True
|
OwnerData = True
|
||||||
@@ -633,7 +639,7 @@ object frmMain: TfrmMain
|
|||||||
Height = 26
|
Height = 26
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 100
|
Width = 100
|
||||||
Action = actExtractPNGs
|
Action = actExtractPngs
|
||||||
Align = alRight
|
Align = alRight
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
@@ -642,7 +648,7 @@ object frmMain: TfrmMain
|
|||||||
Height = 26
|
Height = 26
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 100
|
Width = 100
|
||||||
Action = actExtractTIMs
|
Action = actExtractFiles
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
@@ -650,7 +656,7 @@ object frmMain: TfrmMain
|
|||||||
object tblTimInfo: TStringGrid
|
object tblTimInfo: TStringGrid
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 185
|
Height = 185
|
||||||
Top = 400
|
Top = 412
|
||||||
Width = 253
|
Width = 253
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
AutoEdit = False
|
AutoEdit = False
|
||||||
@@ -706,32 +712,32 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object pnlImage: TPanel
|
object pnlImage: TPanel
|
||||||
Left = 258
|
Left = 258
|
||||||
Height = 585
|
Height = 597
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 532
|
Width = 532
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
ClientHeight = 585
|
ClientHeight = 597
|
||||||
ClientWidth = 532
|
ClientWidth = 532
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object pnlImageOptions: TPanel
|
object pnlImageOptions: TPanel
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 32
|
Height = 27
|
||||||
Top = 552
|
Top = 569
|
||||||
Width = 530
|
Width = 530
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
ClientHeight = 32
|
ClientHeight = 27
|
||||||
ClientWidth = 530
|
ClientWidth = 530
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object btnShowClut: TButton
|
object btnShowClut: TButton
|
||||||
Left = 476
|
Left = 476
|
||||||
Height = 28
|
Height = 23
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 52
|
Width = 52
|
||||||
Align = alRight
|
Align = alRight
|
||||||
@@ -742,12 +748,12 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object cbbBitMode: TComboBox
|
object cbbBitMode: TComboBox
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 28
|
Height = 21
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 159
|
Width = 159
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
BorderSpacing.Around = 1
|
BorderSpacing.Around = 1
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'Real'
|
'Real'
|
||||||
@@ -766,12 +772,12 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object cbbTranspMode: TComboBox
|
object cbbTranspMode: TComboBox
|
||||||
Left = 162
|
Left = 162
|
||||||
Height = 28
|
Height = 21
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 150
|
Width = 150
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
BorderSpacing.Around = 1
|
BorderSpacing.Around = 1
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
ItemIndex = 1
|
ItemIndex = 1
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'Full transparence'
|
'Full transparence'
|
||||||
@@ -787,13 +793,13 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object cbbCLUT: TComboBox
|
object cbbCLUT: TComboBox
|
||||||
Left = 366
|
Left = 366
|
||||||
Height = 28
|
Height = 21
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 109
|
Width = 109
|
||||||
Align = alRight
|
Align = alRight
|
||||||
BorderSpacing.Around = 1
|
BorderSpacing.Around = 1
|
||||||
DropDownCount = 16
|
DropDownCount = 16
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
OnChange = actChangeClutIdxExecute
|
OnChange = actChangeClutIdxExecute
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
@@ -802,7 +808,7 @@ object frmMain: TfrmMain
|
|||||||
object pnlClut: TPanel
|
object pnlClut: TPanel
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 192
|
Height = 192
|
||||||
Top = 360
|
Top = 377
|
||||||
Width = 530
|
Width = 530
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
@@ -814,7 +820,7 @@ object frmMain: TfrmMain
|
|||||||
Visible = False
|
Visible = False
|
||||||
object grdClut: TDrawGrid
|
object grdClut: TDrawGrid
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 125
|
Height = 138
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 528
|
Width = 528
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@@ -839,8 +845,8 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object lblClutHint: TLabel
|
object lblClutHint: TLabel
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 65
|
Height = 52
|
||||||
Top = 126
|
Top = 139
|
||||||
Width = 528
|
Width = 528
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
@@ -852,7 +858,7 @@ object frmMain: TfrmMain
|
|||||||
end
|
end
|
||||||
object imgTim: TImage
|
object imgTim: TImage
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 359
|
Height = 376
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 530
|
Width = 530
|
||||||
AntialiasingMode = amOff
|
AntialiasingMode = amOff
|
||||||
@@ -895,13 +901,13 @@ object frmMain: TfrmMain
|
|||||||
Action = actExit
|
Action = actExit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object mnTIM: TMenuItem
|
object mnImage: TMenuItem
|
||||||
Caption = '&TIM'
|
Caption = '&Image'
|
||||||
object mnSaveTIM: TMenuItem
|
object mnSaveTIM: TMenuItem
|
||||||
Action = actExtractTim
|
Action = actExtractFile
|
||||||
end
|
end
|
||||||
object mnReplaceIn: TMenuItem
|
object mnReplaceIn: TMenuItem
|
||||||
Action = actReplaceTim
|
Action = actReplaceFile
|
||||||
end
|
end
|
||||||
object MenuItem1: TMenuItem
|
object MenuItem1: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
@@ -916,13 +922,14 @@ object frmMain: TfrmMain
|
|||||||
object mnOptions: TMenuItem
|
object mnOptions: TMenuItem
|
||||||
Caption = '&Options'
|
Caption = '&Options'
|
||||||
object mnAssociate: TMenuItem
|
object mnAssociate: TMenuItem
|
||||||
Action = actAssocTims
|
Action = actAddToSendto
|
||||||
|
AutoCheck = True
|
||||||
end
|
end
|
||||||
object N8: TMenuItem
|
object N8: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
object mnShowTimInfo: TMenuItem
|
object mnShowTimInfo: TMenuItem
|
||||||
Action = actShowTimInfo
|
Action = actShowFileInfo
|
||||||
AutoCheck = True
|
AutoCheck = True
|
||||||
ShowAlwaysCheckable = True
|
ShowAlwaysCheckable = True
|
||||||
end
|
end
|
||||||
@@ -958,10 +965,11 @@ object frmMain: TfrmMain
|
|||||||
left = 672
|
left = 672
|
||||||
top = 112
|
top = 112
|
||||||
end
|
end
|
||||||
object dlgSaveTIM: TSaveDialog
|
object dlgSaveFile: TSaveDialog
|
||||||
Title = 'Please, select where to save TIM file...'
|
Title = 'Please, select where to save TIM file...'
|
||||||
DefaultExt = '.tim'
|
DefaultExt = '.tim'
|
||||||
Filter = 'PSX TIM Files (*.tim)|*.tim|All Files (*.*)|*.*'
|
Filter = 'PSX TIM Files (*.tim)|*.tim|PSX CLT Files (*.clt)|*.clt|PSX PXL Files (*.pxl)|*.pxl|All Files (*.*)|*.*'
|
||||||
|
FilterIndex = 0
|
||||||
Options = [ofOverwritePrompt, ofHideReadOnly, ofNoChangeDir, ofNoNetworkButton, ofEnableSizing]
|
Options = [ofOverwritePrompt, ofHideReadOnly, ofNoChangeDir, ofNoNetworkButton, ofEnableSizing]
|
||||||
left = 592
|
left = 592
|
||||||
top = 112
|
top = 112
|
||||||
@@ -1021,9 +1029,9 @@ object frmMain: TfrmMain
|
|||||||
OnExecute = actExitExecute
|
OnExecute = actExitExecute
|
||||||
ShortCut = 121
|
ShortCut = 121
|
||||||
end
|
end
|
||||||
object actExtractTim: TAction
|
object actExtractFile: TAction
|
||||||
Caption = '&Extract TIM...'
|
Caption = '&Extract File...'
|
||||||
OnExecute = actExtractTimExecute
|
OnExecute = actExtractFileExecute
|
||||||
ShortCut = 113
|
ShortCut = 113
|
||||||
end
|
end
|
||||||
object actPngExport: TAction
|
object actPngExport: TAction
|
||||||
@@ -1036,9 +1044,9 @@ object frmMain: TfrmMain
|
|||||||
OnExecute = actPngImportExecute
|
OnExecute = actPngImportExecute
|
||||||
ShortCut = 116
|
ShortCut = 116
|
||||||
end
|
end
|
||||||
object actReplaceTim: TAction
|
object actReplaceFile: TAction
|
||||||
Caption = '&Replace TIM...'
|
Caption = '&Replace File...'
|
||||||
OnExecute = actReplaceTimExecute
|
OnExecute = actReplaceFileExecute
|
||||||
ShortCut = 114
|
ShortCut = 114
|
||||||
end
|
end
|
||||||
object actOpenRepo: TAction
|
object actOpenRepo: TAction
|
||||||
@@ -1058,18 +1066,19 @@ object frmMain: TfrmMain
|
|||||||
Caption = '&Stretch Image'
|
Caption = '&Stretch Image'
|
||||||
OnExecute = actStretchExecute
|
OnExecute = actStretchExecute
|
||||||
end
|
end
|
||||||
object actAssocTims: TAction
|
object actAddToSendto: TAction
|
||||||
Caption = '&Open TIMs with T2V'
|
AutoCheck = True
|
||||||
OnExecute = actAssocTimsExecute
|
Caption = '&SendTo Shortcut for Tim2View'
|
||||||
|
OnExecute = actAddToSendtoExecute
|
||||||
end
|
end
|
||||||
object actExtractTIMs: TAction
|
object actExtractFiles: TAction
|
||||||
Caption = 'Extract all &TIMs'
|
Caption = 'Extract all &Files'
|
||||||
OnExecute = actExtractTIMsExecute
|
OnExecute = actExtractFilesExecute
|
||||||
ShortCut = 8305
|
ShortCut = 8305
|
||||||
end
|
end
|
||||||
object actExtractPNGs: TAction
|
object actExtractPngs: TAction
|
||||||
Caption = '&Extract all PNGs'
|
Caption = '&Extract all PNGs'
|
||||||
OnExecute = actExtractPNGsExecute
|
OnExecute = actExtractPngsExecute
|
||||||
ShortCut = 8307
|
ShortCut = 8307
|
||||||
end
|
end
|
||||||
object actChangeClutIdx: TAction
|
object actChangeClutIdx: TAction
|
||||||
@@ -1090,20 +1099,20 @@ object frmMain: TfrmMain
|
|||||||
Caption = '&Background Color'
|
Caption = '&Background Color'
|
||||||
OnExecute = actChangeBackColorExecute
|
OnExecute = actChangeBackColorExecute
|
||||||
end
|
end
|
||||||
object actShowTimInfo: TAction
|
object actShowFileInfo: TAction
|
||||||
AutoCheck = True
|
AutoCheck = True
|
||||||
Caption = '&Show Tim Info'
|
Caption = '&Show File Info'
|
||||||
OnExecute = actShowTimInfoExecute
|
OnExecute = actShowFileInfoExecute
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object pmList: TPopupMenu
|
object pmList: TPopupMenu
|
||||||
left = 432
|
left = 432
|
||||||
top = 112
|
top = 112
|
||||||
object ExtractTIM1: TMenuItem
|
object ExtractTIM1: TMenuItem
|
||||||
Action = actExtractTim
|
Action = actExtractFile
|
||||||
end
|
end
|
||||||
object ReplaceTIM1: TMenuItem
|
object ReplaceTIM1: TMenuItem
|
||||||
Action = actReplaceTim
|
Action = actReplaceFile
|
||||||
end
|
end
|
||||||
object SaveasPNG1: TMenuItem
|
object SaveasPNG1: TMenuItem
|
||||||
Action = actPngExport
|
Action = actPngExport
|
||||||
@@ -1112,10 +1121,10 @@ object frmMain: TfrmMain
|
|||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
object mnExtractAllTims2: TMenuItem
|
object mnExtractAllTims2: TMenuItem
|
||||||
Action = actExtractTIMs
|
Action = actExtractFiles
|
||||||
end
|
end
|
||||||
object mnExtractAllPngs2: TMenuItem
|
object mnExtractAllPngs2: TMenuItem
|
||||||
Action = actExtractPNGs
|
Action = actExtractPngs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object pmImage: TPopupMenu
|
object pmImage: TPopupMenu
|
||||||
@@ -1125,7 +1134,7 @@ object frmMain: TfrmMain
|
|||||||
Action = actPngExport
|
Action = actPngExport
|
||||||
end
|
end
|
||||||
object mnSaveAsTim: TMenuItem
|
object mnSaveAsTim: TMenuItem
|
||||||
Action = actExtractTim
|
Action = actExtractFile
|
||||||
end
|
end
|
||||||
object N5: TMenuItem
|
object N5: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
@@ -1151,4 +1160,4 @@ object frmMain: TfrmMain
|
|||||||
left = 640
|
left = 640
|
||||||
top = 112
|
top = 112
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
87
umain.pas
87
umain.pas
@@ -18,22 +18,22 @@ type
|
|||||||
|
|
||||||
TfrmMain = class(TForm)
|
TfrmMain = class(TForm)
|
||||||
actAbout: TAction;
|
actAbout: TAction;
|
||||||
actAssocTims: TAction;
|
actAddToSendto: TAction;
|
||||||
actChangeClutIdx: TAction;
|
actChangeClutIdx: TAction;
|
||||||
actCloseFile: TAction;
|
actCloseFile: TAction;
|
||||||
actCloseFiles: TAction;
|
actCloseFiles: TAction;
|
||||||
actExit: TAction;
|
actExit: TAction;
|
||||||
actExtractPNGs: TAction;
|
actExtractPngs: TAction;
|
||||||
actExtractTim: TAction;
|
actExtractFile: TAction;
|
||||||
actExtractTIMs: TAction;
|
actExtractFiles: TAction;
|
||||||
actChangeFile: TAction;
|
actChangeFile: TAction;
|
||||||
actChangeBackColor: TAction;
|
actChangeBackColor: TAction;
|
||||||
actShowTimInfo: TAction;
|
actShowFileInfo: TAction;
|
||||||
actPngImport: TAction;
|
actPngImport: TAction;
|
||||||
actStopScan: TAction;
|
actStopScan: TAction;
|
||||||
actOpenLab: TAction;
|
actOpenLab: TAction;
|
||||||
actOpenRepo: TAction;
|
actOpenRepo: TAction;
|
||||||
actReplaceTim: TAction;
|
actReplaceFile: TAction;
|
||||||
actReturnFocus: TAction;
|
actReturnFocus: TAction;
|
||||||
actScanDir: TAction;
|
actScanDir: TAction;
|
||||||
actScanFile: TAction;
|
actScanFile: TAction;
|
||||||
@@ -51,7 +51,7 @@ type
|
|||||||
dlgColor: TColorDialog;
|
dlgColor: TColorDialog;
|
||||||
dlgOpenFile: TOpenDialog;
|
dlgOpenFile: TOpenDialog;
|
||||||
dlgSavePNG: TSavePictureDialog;
|
dlgSavePNG: TSavePictureDialog;
|
||||||
dlgSaveTIM: TSaveDialog;
|
dlgSaveFile: TSaveDialog;
|
||||||
ExtractTIM1: TMenuItem;
|
ExtractTIM1: TMenuItem;
|
||||||
grdClut: TDrawGrid;
|
grdClut: TDrawGrid;
|
||||||
imgTim: TImage;
|
imgTim: TImage;
|
||||||
@@ -87,7 +87,7 @@ type
|
|||||||
mnSite: TMenuItem;
|
mnSite: TMenuItem;
|
||||||
mnStretch: TMenuItem;
|
mnStretch: TMenuItem;
|
||||||
mnSVN: TMenuItem;
|
mnSVN: TMenuItem;
|
||||||
mnTIM: TMenuItem;
|
mnImage: TMenuItem;
|
||||||
N1: TMenuItem;
|
N1: TMenuItem;
|
||||||
N3: TMenuItem;
|
N3: TMenuItem;
|
||||||
N5: TMenuItem;
|
N5: TMenuItem;
|
||||||
@@ -108,24 +108,24 @@ type
|
|||||||
splMain: TSplitter;
|
splMain: TSplitter;
|
||||||
tblTimInfo: TStringGrid;
|
tblTimInfo: TStringGrid;
|
||||||
procedure actAboutExecute(Sender: TObject);
|
procedure actAboutExecute(Sender: TObject);
|
||||||
procedure actAssocTimsExecute(Sender: TObject);
|
procedure actAddToSendtoExecute(Sender: TObject);
|
||||||
procedure actChangeBackColorExecute(Sender: TObject);
|
procedure actChangeBackColorExecute(Sender: TObject);
|
||||||
procedure actChangeClutIdxExecute(Sender: TObject);
|
procedure actChangeClutIdxExecute(Sender: TObject);
|
||||||
procedure actChangeFileExecute(Sender: TObject);
|
procedure actChangeFileExecute(Sender: TObject);
|
||||||
procedure actCloseFileExecute(Sender: TObject);
|
procedure actCloseFileExecute(Sender: TObject);
|
||||||
procedure actCloseFilesExecute(Sender: TObject);
|
procedure actCloseFilesExecute(Sender: TObject);
|
||||||
procedure actExitExecute(Sender: TObject);
|
procedure actExitExecute(Sender: TObject);
|
||||||
procedure actExtractPNGsExecute(Sender: TObject);
|
procedure actExtractPngsExecute(Sender: TObject);
|
||||||
procedure actExtractTimExecute(Sender: TObject);
|
procedure actExtractFileExecute(Sender: TObject);
|
||||||
procedure actExtractTIMsExecute(Sender: TObject);
|
procedure actExtractFilesExecute(Sender: TObject);
|
||||||
procedure actOpenLabExecute(Sender: TObject);
|
procedure actOpenLabExecute(Sender: TObject);
|
||||||
procedure actOpenRepoExecute(Sender: TObject);
|
procedure actOpenRepoExecute(Sender: TObject);
|
||||||
procedure actPngImportExecute(Sender: TObject);
|
procedure actPngImportExecute(Sender: TObject);
|
||||||
procedure actReplaceTimExecute(Sender: TObject);
|
procedure actReplaceFileExecute(Sender: TObject);
|
||||||
procedure actReturnFocusExecute(Sender: TObject);
|
procedure actReturnFocusExecute(Sender: TObject);
|
||||||
procedure actScanDirExecute(Sender: TObject);
|
procedure actScanDirExecute(Sender: TObject);
|
||||||
procedure actScanFileExecute(Sender: TObject);
|
procedure actScanFileExecute(Sender: TObject);
|
||||||
procedure actShowTimInfoExecute(Sender: TObject);
|
procedure actShowFileInfoExecute(Sender: TObject);
|
||||||
procedure actStopScanExecute(Sender: TObject);
|
procedure actStopScanExecute(Sender: TObject);
|
||||||
procedure actStretchExecute(Sender: TObject);
|
procedure actStretchExecute(Sender: TObject);
|
||||||
procedure actPngExportExecute(Sender: TObject);
|
procedure actPngExportExecute(Sender: TObject);
|
||||||
@@ -173,7 +173,7 @@ type
|
|||||||
procedure DrawSelTim;
|
procedure DrawSelTim;
|
||||||
procedure DrawSelClut;
|
procedure DrawSelClut;
|
||||||
procedure SetCLUTListToNoCLUT;
|
procedure SetCLUTListToNoCLUT;
|
||||||
function FormatTimName(const FileName: string; ListIdx_, BitMode: Integer): string;
|
function FormatFileName(const FileName: string; ListIdx_, BitMode: Integer; Magic: Byte): string;
|
||||||
function FormatPngName(const FileName: string; ListIdx_, BitMode, Clut: Integer): string;
|
function FormatPngName(const FileName: string; ListIdx_, BitMode, Clut: Integer): string;
|
||||||
procedure ShowTim;
|
procedure ShowTim;
|
||||||
procedure ShowTimInfo(ShowInfo: Boolean);
|
procedure ShowTimInfo(ShowInfo: Boolean);
|
||||||
@@ -212,7 +212,7 @@ begin
|
|||||||
ScanPath(dlgOpenFile.Files.Strings[I - 1]);
|
ScanPath(dlgOpenFile.Files.Strings[I - 1]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actShowTimInfoExecute(Sender: TObject);
|
procedure TfrmMain.actShowFileInfoExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Settings.InfoVisible := (Sender as TAction).Checked;
|
Settings.InfoVisible := (Sender as TAction).Checked;
|
||||||
tblTimInfo.Visible := (Sender as TAction).Checked;
|
tblTimInfo.Visible := (Sender as TAction).Checked;
|
||||||
@@ -315,9 +315,9 @@ begin
|
|||||||
Application.MessageBox(cProgramName + #13#10#13#10 + '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;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actAssocTimsExecute(Sender: TObject);
|
procedure TfrmMain.actAddToSendtoExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Settings.AssociateWithTims;
|
Settings.AddToSendTo(not (Sender as TAction).Checked);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actChangeBackColorExecute(Sender: TObject);
|
procedure TfrmMain.actChangeBackColorExecute(Sender: TObject);
|
||||||
@@ -368,7 +368,7 @@ begin
|
|||||||
Close;
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actExtractPNGsExecute(Sender: TObject);
|
procedure TfrmMain.actExtractPngsExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
I, OFFSET, BIT_MODE, SIZE: Integer;
|
I, OFFSET, BIT_MODE, SIZE: Integer;
|
||||||
FName, Path: string;
|
FName, Path: string;
|
||||||
@@ -418,29 +418,30 @@ begin
|
|||||||
pbProgress.Position := 0;
|
pbProgress.Position := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actExtractTimExecute(Sender: TObject);
|
procedure TfrmMain.actExtractFileExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
TIM: PTIM;
|
TIM: PTIM;
|
||||||
begin
|
begin
|
||||||
dlgSaveTIM.FileName := FormatTimName(SelectedScanResult.ScanFile, SelectedTimIdx, SelectedTimInfo.BitMode);
|
dlgSaveFile.FileName := FormatFileName(SelectedScanResult.ScanFile, SelectedTimIdx, SelectedTimInfo.BitMode, SelectedTimInfo.Magic);
|
||||||
|
dlgSaveFile.FilterIndex := SelectedTimInfo.Magic - cTIMMagic + 1;
|
||||||
|
|
||||||
if not dlgSaveTIM.Execute then Exit;
|
if not dlgSaveFile.Execute then Exit;
|
||||||
|
|
||||||
TIM := SelectedTimInMode;
|
TIM := SelectedTimInMode;
|
||||||
SaveTimToFile(dlgSaveTIM.FileName, TIM);
|
SaveTimToFile(dlgSaveFile.FileName, TIM);
|
||||||
{$IFDEF Linux}FpChmod(dlgSaveTIM.FileName, &777);{$IFEND}
|
{$IFDEF Linux}FpChmod(dlgSaveFile.FileName, &777);{$IFEND}
|
||||||
FreeTIM(TIM);
|
FreeTIM(TIM);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actExtractTIMsExecute(Sender: TObject);
|
procedure TfrmMain.actExtractFilesExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
I, OFFSET, BIT_MODE, SIZE: Integer;
|
I, OFFSET, BIT_MODE, SIZE, MAGIC: Integer;
|
||||||
FName, Path: string;
|
FName, Path: string;
|
||||||
IsImage: Boolean;
|
IsImage: Boolean;
|
||||||
TIM: PTIM;
|
TIM: PTIM;
|
||||||
ScanTim: TTimInfo;
|
ScanTim: TTimInfo;
|
||||||
begin
|
begin
|
||||||
lblStatus.Caption := sStatusBarTimsExtracting;
|
lblStatus.Caption := sStatusBarFilesExtracting;
|
||||||
|
|
||||||
FName := SelectedScanResult.ScanFile;
|
FName := SelectedScanResult.ScanFile;
|
||||||
IsImage := SelectedScanResult.IsImage;
|
IsImage := SelectedScanResult.IsImage;
|
||||||
@@ -453,14 +454,15 @@ begin
|
|||||||
OFFSET := ScanTim.Position;
|
OFFSET := ScanTim.Position;
|
||||||
SIZE := ScanTim.Size;
|
SIZE := ScanTim.Size;
|
||||||
BIT_MODE := ScanTim.BitMode;
|
BIT_MODE := ScanTim.BitMode;
|
||||||
|
MAGIC := ScanTim.Magic;
|
||||||
|
|
||||||
Path := SysToUTF8(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStrUTF8(0)) + cExtractedTimsDir));
|
Path := SysToUTF8(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStrUTF8(0)) + cExtractedFilesDir));
|
||||||
CreateDirUTF8(Path);
|
CreateDirUTF8(Path);
|
||||||
Path := IncludeTrailingPathDelimiter(Path + ExtractFileName(FName));
|
Path := IncludeTrailingPathDelimiter(Path + ExtractFileName(FName));
|
||||||
CreateDirUTF8(Path);
|
CreateDirUTF8(Path);
|
||||||
|
|
||||||
TIM := LoadTimFromFile(FName, OFFSET, IsImage, SIZE);
|
TIM := LoadTimFromFile(FName, OFFSET, IsImage, SIZE);
|
||||||
Path := Path + FormatTimName(FName, I - 1, BIT_MODE);
|
Path := Path + FormatFileName(FName, I - 1, BIT_MODE, MAGIC);
|
||||||
SaveTimToFile(Path, TIM);
|
SaveTimToFile(Path, TIM);
|
||||||
{$IFDEF Linux}FpChmod(Path, &777);{$IFEND}
|
{$IFDEF Linux}FpChmod(Path, &777);{$IFEND}
|
||||||
FreeTIM(TIM);
|
FreeTIM(TIM);
|
||||||
@@ -503,7 +505,7 @@ begin
|
|||||||
Dispose(Image);
|
Dispose(Image);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.actReplaceTimExecute(Sender: TObject);
|
procedure TfrmMain.actReplaceFileExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
ScanRes: TScanResult;
|
ScanRes: TScanResult;
|
||||||
begin
|
begin
|
||||||
@@ -555,12 +557,14 @@ begin
|
|||||||
|
|
||||||
cbbBitMode.Tag := NativeInt($FF);
|
cbbBitMode.Tag := NativeInt($FF);
|
||||||
|
|
||||||
|
actAddToSendto.Checked := Settings.SendToShortcutExists;
|
||||||
|
|
||||||
actStretch.Checked := Settings.StretchMode;
|
actStretch.Checked := Settings.StretchMode;
|
||||||
cbbTranspMode.ItemIndex := Settings.TranspMode;
|
cbbTranspMode.ItemIndex := Settings.TranspMode;
|
||||||
LastDir := Settings.LastDir;
|
LastDir := Settings.LastDir;
|
||||||
cbbBitMode.ItemIndex := Settings.BitMode;
|
cbbBitMode.ItemIndex := Settings.BitMode;
|
||||||
pnlImage.Color := Settings.BackColor;
|
pnlImage.Color := Settings.BackColor;
|
||||||
actShowTimInfo.Checked := Settings.InfoVisible;
|
actShowFileInfo.Checked := Settings.InfoVisible;
|
||||||
|
|
||||||
ScanThreads := TScanThreadList.Create(False); //False - to able scan thread remove itself from this list
|
ScanThreads := TScanThreadList.Create(False); //False - to able scan thread remove itself from this list
|
||||||
ScanResults := TScanResultList.Create(False);
|
ScanResults := TScanResultList.Create(False);
|
||||||
@@ -708,6 +712,7 @@ begin
|
|||||||
Item.Caption := Format('%.6d', [Item.Index + 1]);
|
Item.Caption := Format('%.6d', [Item.Index + 1]);
|
||||||
Item.SubItems.Add(Format('%.2d', [TimInfoByIdx[Item.Index].BitMode]));
|
Item.SubItems.Add(Format('%.2d', [TimInfoByIdx[Item.Index].BitMode]));
|
||||||
Item.SubItems.Add(Format('%.2d', [TimInfoByIdx[Item.Index].Cluts]));
|
Item.SubItems.Add(Format('%.2d', [TimInfoByIdx[Item.Index].Cluts]));
|
||||||
|
Item.SubItems.Add(Format('%s', [AnsiUpperCase(TIMTypeStr(TimInfoByIdx[Item.Index].Magic))]));
|
||||||
Item.SubItems.Add(Format('%.3dx%.3d', [W, H]));
|
Item.SubItems.Add(Format('%.3dx%.3d', [W, H]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -835,13 +840,13 @@ begin
|
|||||||
actScanFile.Enabled := ScanThreads.Count = 0;
|
actScanFile.Enabled := ScanThreads.Count = 0;
|
||||||
actScanDir.Enabled := ScanThreads.Count = 0;
|
actScanDir.Enabled := ScanThreads.Count = 0;
|
||||||
|
|
||||||
actReplaceTim.Enabled := (lvList.Selected <> nil) and (lvList.Selected.Index <> -1);
|
actReplaceFile.Enabled := (lvList.Selected <> nil) and (lvList.Selected.Index <> -1);
|
||||||
|
|
||||||
actPngExport.Enabled := (Surf^ <> nil) and actReplaceTim.Enabled;
|
actPngExport.Enabled := (Surf^ <> nil) and actReplaceFile.Enabled;
|
||||||
actPngImport.Enabled := actReplaceTim.Enabled;
|
actPngImport.Enabled := actReplaceFile.Enabled;
|
||||||
actExtractTim.Enabled := actReplaceTim.Enabled;
|
actExtractFile.Enabled := actReplaceFile.Enabled;
|
||||||
|
|
||||||
pnlImageOptions.Enabled := actReplaceTim.Enabled;
|
pnlImageOptions.Enabled := actReplaceFile.Enabled;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.ScanFinished(Sender: TObject);
|
procedure TfrmMain.ScanFinished(Sender: TObject);
|
||||||
@@ -970,14 +975,14 @@ end;
|
|||||||
procedure TfrmMain.SetCLUTListToNoCLUT;
|
procedure TfrmMain.SetCLUTListToNoCLUT;
|
||||||
begin
|
begin
|
||||||
cbbCLUT.Items.Clear;
|
cbbCLUT.Items.Clear;
|
||||||
cbbCLUT.Items.Add(sThisTimHasNoClut);
|
cbbCLUT.Items.Add(sThisFileHasNoClut);
|
||||||
cbbCLUT.ItemIndex := 0;
|
cbbCLUT.ItemIndex := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfrmMain.FormatTimName(const FileName: string; ListIdx_,
|
function TfrmMain.FormatFileName(const FileName: string; ListIdx_,
|
||||||
BitMode: Integer): string;
|
BitMode: Integer; Magic: Byte): string;
|
||||||
begin
|
begin
|
||||||
Result := Format(cAutoExtractionTimFormat, [ExtractJustName(FileName), ListIdx_ + 1, BitMode]);
|
Result := Format(cAutoExtractionFileFormat, [ExtractJustName(FileName), ListIdx_ + 1, BitMode, TIMTypeStr(Magic)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfrmMain.FormatPngName(const FileName: string; ListIdx_, BitMode,
|
function TfrmMain.FormatPngName(const FileName: string; ListIdx_, BitMode,
|
||||||
@@ -1020,7 +1025,7 @@ begin
|
|||||||
|
|
||||||
tblTimInfo.Cells[1, 1] := Format('0x%x', [TimInfo.Position]);
|
tblTimInfo.Cells[1, 1] := Format('0x%x', [TimInfo.Position]);
|
||||||
|
|
||||||
tblTimInfo.Cells[1, 2] := Format('%d', [GetTimVersion(TIM)]);
|
tblTimInfo.Cells[1, 2] := Format('0x%.2x', [GetTimVersion(TIM)]);
|
||||||
tblTimInfo.Cells[1, 3] := Format('%s', [TIMIsGoodStr(TIM)]);
|
tblTimInfo.Cells[1, 3] := Format('%s', [TIMIsGoodStr(TIM)]);
|
||||||
|
|
||||||
if TIMHasCLUT(TIM) then
|
if TIMHasCLUT(TIM) then
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ uses fgl;
|
|||||||
|
|
||||||
type
|
type
|
||||||
TTimInfo = record
|
TTimInfo = record
|
||||||
|
Magic: Byte;
|
||||||
Position: Integer;
|
Position: Integer;
|
||||||
Size: Integer;
|
Size: Integer;
|
||||||
Width: Integer;
|
Width: Integer;
|
||||||
@@ -94,4 +95,4 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ procedure TScanThread.AddResult(TIM: PTIM);
|
|||||||
var
|
var
|
||||||
ScanTim: TTimInfo;
|
ScanTim: TTimInfo;
|
||||||
begin
|
begin
|
||||||
|
ScanTim.Magic := TIM^.HEAD^.bMagic;
|
||||||
ScanTim.Position := TIM^.dwTimPosition;
|
ScanTim.Position := TIM^.dwTimPosition;
|
||||||
ScanTim.Size := TIM^.dwSIZE;
|
ScanTim.Size := TIM^.dwSIZE;
|
||||||
ScanTim.Width := GetTimRealWidth(TIM);
|
ScanTim.Width := GetTimRealWidth(TIM);
|
||||||
@@ -221,4 +222,4 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@@ -26,11 +26,20 @@ type
|
|||||||
function FBitModeRead(): Integer;
|
function FBitModeRead(): Integer;
|
||||||
procedure FInfoVisibleWrite(Value: Boolean);
|
procedure FInfoVisibleWrite(Value: Boolean);
|
||||||
function FInfoVisibleRead(): Boolean;
|
function FInfoVisibleRead(): Boolean;
|
||||||
|
|
||||||
|
{$IFDEF windows}
|
||||||
|
function FGetSendtoShortcutPath: WideString;
|
||||||
|
procedure FCreateSendtoShortcut;
|
||||||
|
function FSendtoShortcutExists: Boolean;
|
||||||
|
{$IFEND}
|
||||||
public
|
public
|
||||||
constructor Create(const DirPath: string);
|
constructor Create(const DirPath: string);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
procedure AssociateWithTims;
|
{$IFDEF windows}
|
||||||
|
procedure AddToSendTo(Delete: Boolean);
|
||||||
|
property SendToShortcutExists: Boolean read FSendtoShortcutExists;
|
||||||
|
{$IFEND}
|
||||||
|
|
||||||
property TranspMode: Integer read FTranspModeRead write FTranspModeWrite;
|
property TranspMode: Integer read FTranspModeRead write FTranspModeWrite;
|
||||||
property StretchMode: Boolean read FStretchModeRead write FStretchModeWrite;
|
property StretchMode: Boolean read FStretchModeRead write FStretchModeWrite;
|
||||||
@@ -45,44 +54,71 @@ implementation
|
|||||||
uses FileUtil
|
uses FileUtil
|
||||||
|
|
||||||
{$IFDEF windows}
|
{$IFDEF windows}
|
||||||
,registry
|
,windows, shlobj {for special folders}, ActiveX, ComObj
|
||||||
{$IFEND}
|
{$IFEND}
|
||||||
;
|
;
|
||||||
|
|
||||||
const sMain = 'main';
|
const
|
||||||
|
sMain = 'main';
|
||||||
|
sSendtoShortcut : string = 'Open in Tim2View';
|
||||||
|
|
||||||
{ TSettings }
|
{ TSettings }
|
||||||
|
|
||||||
procedure TSettings.AssociateWithTims;
|
procedure TSettings.AddToSendTo(Delete: Boolean);
|
||||||
{$IFDEF windows}
|
{$IFDEF windows}
|
||||||
var
|
var
|
||||||
reg: TRegistry;
|
path: string;
|
||||||
begin
|
begin
|
||||||
reg := TRegistry.Create;
|
if Delete then
|
||||||
|
begin
|
||||||
try
|
path := UTF8Encode(FGetSendtoShortcutPath);
|
||||||
reg.RootKey := HKEY_CURRENT_USER;
|
DeleteFile(PChar(Utf8ToSys(path)));
|
||||||
reg.OpenKey('Software\Classes\.tim', True);
|
end
|
||||||
reg.WriteString('', 'TimFile');
|
else
|
||||||
reg.CloseKey;
|
FCreateSendtoShortcut;
|
||||||
|
|
||||||
reg.OpenKey('Software\Classes\TimFile', True);
|
|
||||||
reg.WriteString('', 'Tim File Format');
|
|
||||||
reg.CloseKey;
|
|
||||||
reg.OpenKey('Software\Classes\TimFile\DefaultIcon', True);
|
|
||||||
reg.WriteString('', '"' + ParamStr(0) +'",0');
|
|
||||||
reg.CloseKey;
|
|
||||||
reg.OpenKey('Software\Classes\TimFile\shell\Open\Command', True);
|
|
||||||
reg.WriteString('', '"' + ParamStr(0) + '" "%1"');
|
|
||||||
reg.CloseKey;
|
|
||||||
finally
|
|
||||||
reg.Free;
|
|
||||||
end;
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
begin
|
begin
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF windows}
|
||||||
|
function TSettings.FGetSendtoShortcutPath: WideString;
|
||||||
|
var
|
||||||
|
PIDL: PItemIDList;
|
||||||
|
InFolder: array[0..MAX_PATH] of Char;
|
||||||
|
begin
|
||||||
|
SHGetSpecialFolderLocation(0, CSIDL_SENDTO, PIDL);
|
||||||
|
SHGetPathFromIDList(PIDL, InFolder);
|
||||||
|
Result := InFolder + PathDelim + UTF8ToSys(sSendtoShortcut)+'.lnk';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSettings.FCreateSendtoShortcut;
|
||||||
|
var
|
||||||
|
IObject: IUnknown;
|
||||||
|
ISLink: IShellLink;
|
||||||
|
IPFile: IPersistFile;
|
||||||
|
TargetPath: string;
|
||||||
|
begin
|
||||||
|
{ Creates an instance of IShellLink }
|
||||||
|
IObject := CreateComObject(CLSID_ShellLink);
|
||||||
|
ISLink := IObject as IShellLink;
|
||||||
|
IPFile := IObject as IPersistFile;
|
||||||
|
|
||||||
|
TargetPath := ParamStr(0);
|
||||||
|
ISLink.SetPath(pChar(TargetPath));
|
||||||
|
ISLink.SetArguments(pChar(''));
|
||||||
|
ISLink.SetWorkingDirectory(pChar(ExtractFilePath(TargetPath)));
|
||||||
|
|
||||||
|
{ Create the link }
|
||||||
|
IPFile.Save(PWChar(FGetSendtoShortcutPath), false);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSettings.FSendtoShortcutExists: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FileExists(FGetSendtoShortcutPath);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TSettings.FTranspModeWrite(Value: Integer);
|
procedure TSettings.FTranspModeWrite(Value: Integer);
|
||||||
begin
|
begin
|
||||||
FIniFile.WriteInteger(sMain, 'TranspMode', Value);
|
FIniFile.WriteInteger(sMain, 'TranspMode', Value);
|
||||||
|
|||||||
67
utim.pas
67
utim.pas
@@ -7,6 +7,9 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
cTIMMagic = $10;
|
cTIMMagic = $10;
|
||||||
|
cCLTMagic = $11;
|
||||||
|
cPXLMagic = $12;
|
||||||
|
cMagics = [cTIMMagic, cCLTMagic, cPXLMagic];
|
||||||
cTIM4C = $08;
|
cTIM4C = $08;
|
||||||
cTIM4NC = $00;
|
cTIM4NC = $00;
|
||||||
cTIM4 = [cTIM4C, cTIM4NC];
|
cTIM4 = [cTIM4C, cTIM4NC];
|
||||||
@@ -19,12 +22,16 @@ const
|
|||||||
cTIM24C = $0B;
|
cTIM24C = $0B;
|
||||||
cTIM24NC = $03;
|
cTIM24NC = $03;
|
||||||
cTIM24 = [cTIM24C, cTIM24NC];
|
cTIM24 = [cTIM24C, cTIM24NC];
|
||||||
cTIMMix = $04;
|
cTIMMixC = $0C;
|
||||||
|
cTIMMixNC = $04;
|
||||||
|
cTIMMix = [cTIMMixC, cTIMMixNC];
|
||||||
cTIMVersions = [$00, $01];
|
cTIMVersions = [$00, $01];
|
||||||
cTIMWrongBads = [cTIM4NC, cTIM8NC, cTIMMix];
|
cTIMWrongBads = [cTIM4NC, cTIM8NC];
|
||||||
cTIMCLUT = [cTIM4C, cTIM8C, cTIM16C, cTIM24C];
|
cTIMGoodCLTs = [cTIM16NC];
|
||||||
cTIMNOCLUT = [cTIM4NC, cTIM8NC, cTIM16NC, cTIM24NC, cTIMMix];
|
cTIMGoodPXLs = [cTIM4NC, cTIM8NC];
|
||||||
cTIMBpp = [cTIM4C, cTIM8C, cTIM16C, cTIM24C, cTIM4NC, cTIM8NC, cTIM16NC, cTIM24NC, cTIMMix];
|
cTIMCLUT = [cTIM4C, cTIM8C, cTIM16C, cTIM24C, cTIMMixC];
|
||||||
|
cTIMNOCLUT = [cTIM4NC, cTIM8NC, cTIM16NC, cTIM24NC, cTIMMixNC];
|
||||||
|
cTIMBpp = [cTIM4C, cTIM8C, cTIM16C, cTIM24C, cTIMMixC, cTIM4NC, cTIM8NC, cTIM16NC, cTIM24NC, cTIMMixNC];
|
||||||
|
|
||||||
type
|
type
|
||||||
TTIMHeader = packed record // TIM Header (8 bytes)
|
TTIMHeader = packed record // TIM Header (8 bytes)
|
||||||
@@ -34,7 +41,7 @@ type
|
|||||||
bReserved2: byte; // Reserved byte 2 (1 byte)
|
bReserved2: byte; // Reserved byte 2 (1 byte)
|
||||||
bBPP: Integer; // Bit per Pixel (4 bytes)
|
bBPP: Integer; // Bit per Pixel (4 bytes)
|
||||||
// variants:
|
// variants:
|
||||||
// [$08, $09, $0A, $0B, $02, $03, $00, $01]
|
// [$08, $09, $0A, $0B, $0C, $00, $01, $02, $03, $04]
|
||||||
end;
|
end;
|
||||||
PTIMHeader = ^TTIMHeader;
|
PTIMHeader = ^TTIMHeader;
|
||||||
|
|
||||||
@@ -112,6 +119,7 @@ function GetTimRealWidth(TIM: PTIM): word;
|
|||||||
function GetTimHeight(TIM: PTIM): word;
|
function GetTimHeight(TIM: PTIM): word;
|
||||||
function TIMIsGood(TIM: PTIM): Boolean;
|
function TIMIsGood(TIM: PTIM): Boolean;
|
||||||
function TIMIsGoodStr(TIM: PTIM): string;
|
function TIMIsGoodStr(TIM: PTIM): string;
|
||||||
|
function TIMTypeStr(Magic: Byte): string;
|
||||||
function LoadTimFromBuf(BUFFER: pointer; var TIM: PTIM; var Position: Integer): Boolean;
|
function LoadTimFromBuf(BUFFER: pointer; var TIM: PTIM; var Position: Integer): Boolean;
|
||||||
function LoadTimFromFile(const FileName: string; var Position: Integer; ImageScan: Boolean; dwSize: Integer): PTIM;
|
function LoadTimFromFile(const FileName: string; var Position: Integer; ImageScan: Boolean; dwSize: Integer): PTIM;
|
||||||
procedure SaveTimToFile(const FileName: string; TIM: PTIM);
|
procedure SaveTimToFile(const FileName: string; TIM: PTIM);
|
||||||
@@ -198,7 +206,6 @@ end;
|
|||||||
function GetTIMCLUTSize(TIM: PTIM): Integer;
|
function GetTIMCLUTSize(TIM: PTIM): Integer;
|
||||||
begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
|
|
||||||
if not TIMHasCLUT(TIM) then Exit;
|
if not TIMHasCLUT(TIM) then Exit;
|
||||||
Result := TIM^.CLUT^.wColorsCount * TIM^.CLUT^.wClutsCount * 2 + SizeOf(TCLUTHeader);
|
Result := TIM^.CLUT^.wColorsCount * TIM^.CLUT^.wClutsCount * 2 + SizeOf(TCLUTHeader);
|
||||||
end;
|
end;
|
||||||
@@ -220,7 +227,7 @@ end;
|
|||||||
|
|
||||||
function CheckMagic(TIM: PTIM): Boolean;
|
function CheckMagic(TIM: PTIM): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (TIM^.HEAD^.bMagic = cTIMMagic);
|
Result := (TIM^.HEAD^.bMagic in cMagics);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CheckBpp(TIM: PTIM): Boolean;
|
function CheckBpp(TIM: PTIM): Boolean;
|
||||||
@@ -263,7 +270,7 @@ begin
|
|||||||
case TIM^.HEAD^.bBPP of
|
case TIM^.HEAD^.bBPP of
|
||||||
cTIM4C, cTIM4NC: Result := (TIM^.IMAGE^.wWidth * 4) and $FFFF;
|
cTIM4C, cTIM4NC: Result := (TIM^.IMAGE^.wWidth * 4) and $FFFF;
|
||||||
cTIM8C, cTIM8NC: Result := (TIM^.IMAGE^.wWidth * 2) and $FFFF;
|
cTIM8C, cTIM8NC: Result := (TIM^.IMAGE^.wWidth * 2) and $FFFF;
|
||||||
cTIM16C, cTIM16NC, cTIMMix: Result := TIM^.IMAGE^.wWidth;
|
cTIM16C, cTIM16NC, cTIMMixC, cTIMMixNC: Result := TIM^.IMAGE^.wWidth;
|
||||||
cTIM24C, cTIM24NC: Result := (Round(TIM^.IMAGE^.wWidth * 2 / 3)) and $FFFF;
|
cTIM24C, cTIM24NC: Result := (Round(TIM^.IMAGE^.wWidth * 2 / 3)) and $FFFF;
|
||||||
else
|
else
|
||||||
Result := 0;
|
Result := 0;
|
||||||
@@ -280,6 +287,11 @@ begin
|
|||||||
Result := CheckCLUTColors(TIM) and CheckCLUTCount(TIM) and CheckCLUTVramX(TIM) and CheckCLUTVramY(TIM);
|
Result := CheckCLUTColors(TIM) and CheckCLUTCount(TIM) and CheckCLUTVramX(TIM) and CheckCLUTVramY(TIM);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TIMIsNotWrongBad(TIM: PTIM): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (not(TIM^.HEAD^.bBPP in cTIMWrongBads)) or TIMIsGood(TIM);
|
||||||
|
end;
|
||||||
|
|
||||||
function CheckTIMSize(TIM: PTIM): Boolean;
|
function CheckTIMSize(TIM: PTIM): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (GetTIMSize(TIM) <= cTIMMaxSize);
|
Result := (GetTIMSize(TIM) <= cTIMMaxSize);
|
||||||
@@ -313,8 +325,26 @@ end;
|
|||||||
function CheckIMAGE(TIM: PTIM): Boolean;
|
function CheckIMAGE(TIM: PTIM): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := CheckIMAGEWidth(TIM) and CheckIMAGEHeight(TIM) and CheckIMAGEVramX(TIM) and CheckIMAGEVramY(TIM);
|
Result := CheckIMAGEWidth(TIM) and CheckIMAGEHeight(TIM) and CheckIMAGEVramX(TIM) and CheckIMAGEVramY(TIM);
|
||||||
|
end;
|
||||||
|
|
||||||
Result := Result and ((not(TIM^.HEAD^.bBPP in cTIMWrongBads)) or TIMIsGood(TIM));
|
function CheckTIM(TIM: PTIM): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (TIM^.HEAD^.bMagic = cTIMMagic);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CheckCLT(TIM: PTIM): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (TIM^.HEAD^.bMagic = cCLTMagic) and (TIM^.HEAD^.bBPP in cTIMGoodCLTs);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CheckPXL(TIM: PTIM): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (TIM^.HEAD^.bMagic = cPXLMagic) and (TIM^.HEAD^.bBPP in cTIMGoodPXLs);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CheckTimCltPxl(TIM: PTIM): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (CheckTIM(TIM) or CheckCLT(TIM) or CheckPXL(TIM)) and CheckIMAGE(TIM) and TIMIsNotWrongBad(TIM);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ClearTIM(TIM: PTIM);
|
procedure ClearTIM(TIM: PTIM);
|
||||||
@@ -330,6 +360,17 @@ begin
|
|||||||
if TIMIsGood(TIM) then Result := 'Yes' else Result := 'No';
|
if TIMIsGood(TIM) then Result := 'Yes' else Result := 'No';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TIMTypeStr(Magic: Byte): string;
|
||||||
|
begin
|
||||||
|
case Magic of
|
||||||
|
cTIMMagic: Result := 'tim';
|
||||||
|
cCLTMagic: Result := 'clt';
|
||||||
|
cPXLMagic: Result := 'pxl';
|
||||||
|
else
|
||||||
|
Result := 'unk';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function LoadTimFromBuf(BUFFER: pointer; var TIM: PTIM; var Position: Integer): Boolean;
|
function LoadTimFromBuf(BUFFER: pointer; var TIM: PTIM; var Position: Integer): Boolean;
|
||||||
var
|
var
|
||||||
P: Integer;
|
P: Integer;
|
||||||
@@ -356,7 +397,7 @@ begin
|
|||||||
|
|
||||||
Move(PBytesArray(BUFFER)^[P], TIM^.IMAGE^, SizeOf(TIMAGEHeader));
|
Move(PBytesArray(BUFFER)^[P], TIM^.IMAGE^, SizeOf(TIMAGEHeader));
|
||||||
|
|
||||||
if not CheckIMAGE(TIM) then Exit;
|
if not CheckTimCltPxl(TIM) then Exit;
|
||||||
if not CheckTIMSize(TIM) then Exit;
|
if not CheckTIMSize(TIM) then Exit;
|
||||||
|
|
||||||
TIM^.dwSize := GetTIMSize(TIM);
|
TIM^.dwSize := GetTIMSize(TIM);
|
||||||
@@ -527,7 +568,7 @@ begin
|
|||||||
Result := 24;
|
Result := 24;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if (TIM^.HEAD^.bBPP = cTIMMix) then
|
if (TIM^.HEAD^.bBPP in cTIMMix) then
|
||||||
begin
|
begin
|
||||||
Result := 16;
|
Result := 16;
|
||||||
Exit;
|
Exit;
|
||||||
@@ -594,4 +635,4 @@ begin
|
|||||||
Result := TIM^.IMAGE^.wVRAMY;
|
Result := TIM^.IMAGE^.wVRAMY;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Reference in New Issue
Block a user