Last fixes for stable version.

This commit is contained in:
meffi@lab313.ru
2014-05-07 17:48:45 +00:00
parent 27d22bec0e
commit 347d12c47a
8 changed files with 281 additions and 258 deletions

View File

@@ -23,7 +23,8 @@
<UseVersionInfo Value="True"/> <UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/> <AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="1"/> <MajorVersionNr Value="1"/>
<RevisionNr Value="85"/> <RevisionNr Value="86"/>
<BuildNr Value="1"/>
<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">
@@ -346,7 +347,7 @@
<Version Value="11"/> <Version Value="11"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Target> <Target>
<Filename Value="руссиш\tim2view_$(TargetOS)"/> <Filename Value="output\tim2view_$(TargetOS)"/>
</Target> </Target>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir);bgrabitmap"/> <IncludeFiles Value="$(ProjOutDir);bgrabitmap"/>

View File

@@ -23,8 +23,8 @@
<UnitName Value="umain"/> <UnitName Value="umain"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="540"/> <TopLine Value="295"/>
<CursorPos X="66" Y="556"/> <CursorPos X="66" Y="308"/>
<UsageCount Value="816"/> <UsageCount Value="816"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
@@ -48,11 +48,10 @@
<Filename Value="ucommon.pas"/> <Filename Value="ucommon.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ucommon"/> <UnitName Value="ucommon"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="35" Y="6"/> <CursorPos X="70" Y="9"/>
<UsageCount Value="816"/> <UsageCount Value="816"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
@@ -62,8 +61,8 @@
<UnitName Value="utim"/> <UnitName Value="utim"/>
<EditorIndex Value="10"/> <EditorIndex Value="10"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="185"/> <TopLine Value="244"/>
<CursorPos X="1" Y="204"/> <CursorPos X="82" Y="311"/>
<UsageCount Value="816"/> <UsageCount Value="816"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit5> </Unit5>
@@ -126,10 +125,11 @@
<Filename Value="udrawtim.pas"/> <Filename Value="udrawtim.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="udrawtim"/> <UnitName Value="udrawtim"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="92"/>
<CursorPos X="15" Y="6"/> <CursorPos X="58" Y="103"/>
<UsageCount Value="816"/> <UsageCount Value="816"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit11> </Unit11>
@@ -148,7 +148,7 @@
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="20" Y="1"/> <CursorPos X="31" Y="3"/>
<UsageCount Value="802"/> <UsageCount Value="802"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit13> </Unit13>
@@ -160,7 +160,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="7"/> <TopLine Value="7"/>
<CursorPos X="20" Y="16"/> <CursorPos X="20" Y="16"/>
<UsageCount Value="77"/> <UsageCount Value="83"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit14> </Unit14>
</Units> </Units>

Binary file not shown.

View File

@@ -1 +1 @@
{ TODO : Zooming? } { TODO : Zooming? }

View File

@@ -3,7 +3,7 @@ unit ucommon;
interface interface
const const
cProgramName = 'Tim2View SVN.r85 by [Lab 313] (for ' + cProgramName = 'Tim2View SVN.r86 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}

View File

@@ -381,7 +381,7 @@ begin
for Y := 1 to ROWS do for Y := 1 to ROWS do
for X := 1 to COLS do for X := 1 to COLS do
begin begin
ClearCanvas(@Grid^.Canvas, Grid^.CellRect(X - 1, Y - 1)); //ClearCanvas(@Grid^.Canvas, Grid^.CellRect(X - 1, Y - 1));
DrawClutCell(TIM, CLUT_NUM, Grid, X - 1, Y - 1); DrawClutCell(TIM, CLUT_NUM, Grid, X - 1, Y - 1);
end; end;
end; end;

View File

@@ -9,7 +9,7 @@ object frmMain: TfrmMain
VertScrollBar.Range = 344 VertScrollBar.Range = 344
ActiveControl = pnlList ActiveControl = pnlList
AllowDropFiles = True AllowDropFiles = True
ClientHeight = 648 ClientHeight = 643
ClientWidth = 790 ClientWidth = 790
Color = clBtnFace Color = clBtnFace
Font.Color = clWindowText Font.Color = clWindowText
@@ -498,7 +498,7 @@ object frmMain: TfrmMain
object pnlStatus: TPanel object pnlStatus: TPanel
Left = 0 Left = 0
Height = 30 Height = 30
Top = 618 Top = 613
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 = 21 Height = 28
Top = 0 Top = 0
Width = 790 Width = 790
Align = alTop Align = alTop
DropDownCount = 30 DropDownCount = 30
Enabled = False Enabled = False
ItemHeight = 13 ItemHeight = 0
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 = 597 Height = 585
Top = 21 Top = 28
Width = 790 Width = 790
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 597 ClientHeight = 585
ClientWidth = 790 ClientWidth = 790
TabOrder = 1 TabOrder = 1
object splMain: TSplitter object splMain: TSplitter
Left = 253 Left = 253
Height = 597 Height = 585
Top = 0 Top = 0
Width = 5 Width = 5
end end
object pnlList: TPanel object pnlList: TPanel
Left = 0 Left = 0
Height = 597 Height = 585
Top = 0 Top = 0
Width = 253 Width = 253
Align = alLeft Align = alLeft
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 597 ClientHeight = 585
ClientWidth = 253 ClientWidth = 253
TabOrder = 0 TabOrder = 0
object lvList: TListView object lvList: TListView
Left = 0 Left = 0
Height = 384 Height = 372
Top = 28 Top = 28
Width = 253 Width = 253
Align = alClient Align = alClient
@@ -586,28 +586,27 @@ object frmMain: TfrmMain
item item
AutoSize = True AutoSize = True
Caption = '# / 0' Caption = '# / 0'
Width = 249 Width = 41
end end
item item
Alignment = taCenter Alignment = taCenter
AutoSize = True AutoSize = True
Caption = 'BPP' Caption = 'BPP'
Width = 30 Width = 35
end end
item item
Alignment = taCenter Alignment = taCenter
AutoSize = True AutoSize = True
Caption = 'CLUTs' Caption = 'CLUTs'
Width = 42 Width = 47
end end
item item
Alignment = taCenter Alignment = taCenter
AutoSize = True AutoSize = True
Caption = 'W x H' Caption = 'W x H'
Width = 41 Width = 128
end> end>
ColumnClick = False ColumnClick = False
GridLines = True
OwnerData = True OwnerData = True
PopupMenu = pmList PopupMenu = pmList
ReadOnly = True ReadOnly = True
@@ -651,7 +650,7 @@ object frmMain: TfrmMain
object tblTimInfo: TStringGrid object tblTimInfo: TStringGrid
Left = 0 Left = 0
Height = 185 Height = 185
Top = 412 Top = 400
Width = 253 Width = 253
Align = alBottom Align = alBottom
AutoEdit = False AutoEdit = False
@@ -666,7 +665,6 @@ object frmMain: TfrmMain
TitleFont.Color = clWindowText TitleFont.Color = clWindowText
TitleFont.Height = -11 TitleFont.Height = -11
TitleFont.Name = 'Tahoma' TitleFont.Name = 'Tahoma'
Visible = False
ColWidths = ( ColWidths = (
102 102
150 150
@@ -708,32 +706,32 @@ object frmMain: TfrmMain
end end
object pnlImage: TPanel object pnlImage: TPanel
Left = 258 Left = 258
Height = 597 Height = 585
Top = 0 Top = 0
Width = 532 Width = 532
Align = alClient Align = alClient
BevelOuter = bvLowered BevelOuter = bvLowered
ClientHeight = 597 ClientHeight = 585
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 = 27 Height = 32
Top = 569 Top = 552
Width = 530 Width = 530
Align = alBottom Align = alBottom
AutoSize = True AutoSize = True
BevelOuter = bvLowered BevelOuter = bvLowered
ClientHeight = 27 ClientHeight = 32
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 = 23 Height = 28
Top = 2 Top = 2
Width = 52 Width = 52
Align = alRight Align = alRight
@@ -744,12 +742,12 @@ object frmMain: TfrmMain
end end
object cbbBitMode: TComboBox object cbbBitMode: TComboBox
Left = 2 Left = 2
Height = 21 Height = 28
Top = 2 Top = 2
Width = 159 Width = 159
Align = alLeft Align = alLeft
BorderSpacing.Around = 1 BorderSpacing.Around = 1
ItemHeight = 13 ItemHeight = 0
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'Real' 'Real'
@@ -768,12 +766,12 @@ object frmMain: TfrmMain
end end
object cbbTranspMode: TComboBox object cbbTranspMode: TComboBox
Left = 162 Left = 162
Height = 21 Height = 28
Top = 2 Top = 2
Width = 150 Width = 150
Align = alLeft Align = alLeft
BorderSpacing.Around = 1 BorderSpacing.Around = 1
ItemHeight = 13 ItemHeight = 0
ItemIndex = 1 ItemIndex = 1
Items.Strings = ( Items.Strings = (
'Full transparence' 'Full transparence'
@@ -789,13 +787,13 @@ object frmMain: TfrmMain
end end
object cbbCLUT: TComboBox object cbbCLUT: TComboBox
Left = 366 Left = 366
Height = 21 Height = 28
Top = 2 Top = 2
Width = 109 Width = 109
Align = alRight Align = alRight
BorderSpacing.Around = 1 BorderSpacing.Around = 1
DropDownCount = 16 DropDownCount = 16
ItemHeight = 13 ItemHeight = 0
OnChange = actChangeClutIdxExecute OnChange = actChangeClutIdxExecute
Style = csDropDownList Style = csDropDownList
TabOrder = 3 TabOrder = 3
@@ -804,7 +802,7 @@ object frmMain: TfrmMain
object pnlClut: TPanel object pnlClut: TPanel
Left = 1 Left = 1
Height = 192 Height = 192
Top = 377 Top = 360
Width = 530 Width = 530
Align = alBottom Align = alBottom
BevelOuter = bvLowered BevelOuter = bvLowered
@@ -816,7 +814,7 @@ object frmMain: TfrmMain
Visible = False Visible = False
object grdClut: TDrawGrid object grdClut: TDrawGrid
Left = 1 Left = 1
Height = 138 Height = 125
Top = 1 Top = 1
Width = 528 Width = 528
Align = alClient Align = alClient
@@ -841,8 +839,8 @@ object frmMain: TfrmMain
end end
object lblClutHint: TLabel object lblClutHint: TLabel
Left = 1 Left = 1
Height = 52 Height = 65
Top = 139 Top = 126
Width = 528 Width = 528
Align = alBottom Align = alBottom
Alignment = taCenter Alignment = taCenter
@@ -854,7 +852,7 @@ object frmMain: TfrmMain
end end
object imgTim: TImage object imgTim: TImage
Left = 1 Left = 1
Height = 376 Height = 359
Top = 1 Top = 1
Width = 530 Width = 530
AntialiasingMode = amOff AntialiasingMode = amOff

View File

@@ -238,6 +238,16 @@ begin
Result := (TIM^.HEAD^.bBPP in cTIMCLUT); Result := (TIM^.HEAD^.bBPP in cTIMCLUT);
end; end;
function CheckCLUTVramX(TIM: PTIM): Boolean;
begin
Result := (TIM^.CLUT^.wVRAMX + TIM^.CLUT^.wColorsCount) <= cCLUTColorsMax;
end;
function CheckCLUTVramY(TIM: PTIM): Boolean;
begin
Result := (TIM^.CLUT^.wVRAMY + TIM^.CLUT^.wClutsCount) <= cCLUTCountMax;
end;
function CheckCLUTColors(TIM: PTIM): Boolean; function CheckCLUTColors(TIM: PTIM): Boolean;
begin begin
Result := (TIM^.CLUT^.wColorsCount >= 1) and (TIM^.CLUT^.wColorsCount <= cCLUTColorsMax); Result := (TIM^.CLUT^.wColorsCount >= 1) and (TIM^.CLUT^.wColorsCount <= cCLUTColorsMax);
@@ -267,9 +277,7 @@ end;
function CheckCLUT(TIM: PTIM): Boolean; function CheckCLUT(TIM: PTIM): Boolean;
begin begin
Result := (CheckCLUTColors(TIM) and CheckCLUTCount(TIM) Result := CheckCLUTColors(TIM) and CheckCLUTCount(TIM) and CheckCLUTVramX(TIM) and CheckCLUTVramY(TIM);
// Need to Check CLUT^.dwSize
);
end; end;
function CheckTIMSize(TIM: PTIM): Boolean; function CheckTIMSize(TIM: PTIM): Boolean;
@@ -282,15 +290,31 @@ begin
Result := (TIM^.IMAGE^.dwSize = GetTIMIMAGESize(TIM)); Result := (TIM^.IMAGE^.dwSize = GetTIMIMAGESize(TIM));
end; end;
function CheckIMAGEWidth(TIM: PTIM): Boolean;
begin
Result := (TIM^.IMAGE^.wWidth >= 1) and (TIM^.IMAGE^.wWidth <= cIMAGEWidthMax);
end;
function CheckIMAGEHeight(TIM: PTIM): Boolean;
begin
Result := (TIM^.IMAGE^.wHeight >= 1) and (TIM^.IMAGE^.wHeight <= cIMAGEHeightMax);
end;
function CheckIMAGEVramX(TIM: PTIM): Boolean;
begin
Result := (TIM^.IMAGE^.wVRAMX + TIM^.IMAGE^.wWidth) <= cCLUTColorsMax;
end;
function CheckIMAGEVramY(TIM: PTIM): Boolean;
begin
Result := (TIM^.IMAGE^.wVRAMY + TIM^.IMAGE^.wHeight) <= cCLUTCountMax;
end;
function CheckIMAGE(TIM: PTIM): Boolean; function CheckIMAGE(TIM: PTIM): Boolean;
begin begin
Result := False; Result := CheckIMAGEWidth(TIM) and CheckIMAGEHeight(TIM) and CheckIMAGEVramX(TIM) and CheckIMAGEVramY(TIM);
if (TIM^.IMAGE^.wWidth = 0) or (TIM^.IMAGE^.wHeight = 0) then Exit; Result := Result and ((not(TIM^.HEAD^.bBPP in cTIMWrongBads)) or TIMIsGood(TIM));
if (TIM^.IMAGE^.wWidth > cIMAGEWidthMax) or (TIM^.IMAGE^.wHeight > cIMAGEHeightMax) then Exit;
Result := (not(TIM^.HEAD^.bBPP in cTIMWrongBads)) or TIMIsGood(TIM);
end; end;
procedure ClearTIM(TIM: PTIM); procedure ClearTIM(TIM: PTIM);