diff --git a/output/tim2view_linux_i386 b/output/tim2view_linux_i386 index a2e63f8..ad0ddad 100644 Binary files a/output/tim2view_linux_i386 and b/output/tim2view_linux_i386 differ diff --git a/output/tim2view_linux_x86_64 b/output/tim2view_linux_x86_64 index 670e0fb..eecddb2 100644 Binary files a/output/tim2view_linux_x86_64 and b/output/tim2view_linux_x86_64 differ diff --git a/output/tim2view_win32_i386.exe b/output/tim2view_win32_i386.exe index 97d5608..f265419 100644 Binary files a/output/tim2view_win32_i386.exe and b/output/tim2view_win32_i386.exe differ diff --git a/output/tim2view_win64_x86_64.exe b/output/tim2view_win64_x86_64.exe index 1cf245f..1ad2ea9 100644 Binary files a/output/tim2view_win64_x86_64.exe and b/output/tim2view_win64_x86_64.exe differ diff --git a/tim2view.lpi b/tim2view.lpi index 6f5c9b4..0b0d1bf 100644 --- a/tim2view.lpi +++ b/tim2view.lpi @@ -27,7 +27,7 @@ - + diff --git a/udrawtim.pas b/udrawtim.pas index fcc8c30..1a77933 100644 --- a/udrawtim.pas +++ b/udrawtim.pas @@ -14,7 +14,7 @@ type procedure Tim2Png(TIM: PTIM; CLUT_NUM: Integer; Image: PDrawSurf; TranspMode: Byte); procedure Png2Tim(Image: PDrawSurf; Dest: PTIM); procedure DrawClutCell(TIM: PTIM; CLUT_NUM: Integer; Grid: PDrawGrid; X, Y: Integer); -procedure DrawClut(TIM: PTIM; CLUT_NUM: Integer; Grid: PDrawGrid); +procedure SetupCLUT(TIM: PTIM; CLUT_NUM: Integer; Grid: PDrawGrid); procedure ClearCanvas(ACanvas: PCanvas; Rect: TRect); procedure ClearGrid(Grid: PDrawGrid); @@ -365,7 +365,7 @@ begin Dispose(CLUT_COLOR); end; -procedure DrawCLUT(TIM: PTIM; CLUT_NUM: Integer; Grid: PDrawGrid); +procedure SetupCLUT(TIM: PTIM; CLUT_NUM: Integer; Grid: PDrawGrid); var X, Y, ROWS, COLS, COLORS: Integer; begin @@ -375,17 +375,6 @@ begin ROWS := Ceil(COLORS / COLS); Grid^.RowCount := ROWS; - - (* - //Grid^.BeginUpdate; - for Y := 1 to ROWS do - for X := 1 to COLS do - begin - //ClearCanvas(@Grid^.Canvas, Grid^.CellRect(X - 1, Y - 1)); - DrawClutCell(TIM, CLUT_NUM, Grid, X - 1, Y - 1); - end; - //Grid^.EndUpdate(true); *) - //Grid^.Repaint; end; end. diff --git a/umain.lfm b/umain.lfm index 978b07f..2337bb9 100644 --- a/umain.lfm +++ b/umain.lfm @@ -644,47 +644,37 @@ object frmMain: TfrmMain ColumnClickSorts = True Columns = < item - MinSize = 10 - MaxSize = 200 Title.Caption = '#' Width = 60 end item Alignment = taCenter - MinSize = 10 - MaxSize = 200 Title.Alignment = taCenter Title.Caption = 'BPP' Width = 40 end item Alignment = taCenter - MinSize = 10 - MaxSize = 200 Title.Alignment = taCenter Title.Caption = 'CLUTs' Width = 40 end + item + Title.Alignment = taCenter + Title.Caption = 'Colors' + Width = 40 + end item Alignment = taCenter - MinSize = 10 - MaxSize = 200 Title.Alignment = taCenter Title.Caption = 'Type' Width = 40 end item Alignment = taCenter - MinSize = 10 - MaxSize = 200 Title.Alignment = taCenter Title.Caption = 'W x H' Width = 60 - end - item - Title.Alignment = taCenter - Title.Caption = 'File Name' - Width = 56 end> FixedCols = 0 Flat = True @@ -709,8 +699,8 @@ object frmMain: TfrmMain 40 40 40 + 40 60 - 56 ) end end @@ -843,6 +833,7 @@ object frmMain: TfrmMain TitleFont.Color = clWindowText TitleFont.Height = -11 TitleFont.Name = 'Tahoma' + UseXORFeatures = True OnDblClick = grdClutDblClick OnDrawCell = grdClutDrawCell OnKeyUp = grdClutKeyUp diff --git a/umain.pas b/umain.pas index 5dff666..792e3c9 100644 --- a/umain.pas +++ b/umain.pas @@ -185,7 +185,7 @@ type procedure SetTimsListCount(Count: Integer); procedure UpdateCLUTInfo; procedure DrawSelTim; - procedure DrawSelClut; + procedure SetupSelClut; procedure SetCLUTListToNoCLUT; function FormatFileName(const FileName: string; ListIdx_, BitMode: Integer; Magic: Byte): string; function FormatPngName(const FileName: string; ListIdx_, BitMode, Clut: Integer): string; @@ -284,7 +284,7 @@ end; procedure TfrmMain.btnShowClutClick(Sender: TObject); begin pnlClut.Visible := not pnlClut.Visible; - UpdateTim(False, True, False); + SetupSelClut; actReturnFocus.Execute; end; @@ -329,9 +329,9 @@ begin grdTimsList.Cells[0, I] := Format('%.6d', [I]); grdTimsList.Cells[1, I] := Format('%.2d', [TimInfoByIdx[I - 1].BitMode]); grdTimsList.Cells[2, I] := Format('%.2d', [TimInfoByIdx[I - 1].Cluts]); - grdTimsList.Cells[3, I] := AnsiUpperCase(TIMTypeStr(TimInfoByIdx[I - 1].Magic)); - grdTimsList.Cells[4, I] := Format('%.3dx%.3d', [W, H]); - grdTimsList.Cells[5, I] := SelectedScanResult.ScanFile; + grdTimsList.Cells[3, I] := Format('%.2d', [TimInfoByIdx[I - 1].Colors]); + grdTimsList.Cells[4, I] := AnsiUpperCase(TIMTypeStr(TimInfoByIdx[I - 1].Magic)); + grdTimsList.Cells[5, I] := Format('%.3dx%.3d', [W, H]); end; grdTimsList.EndUpdate; @@ -842,7 +842,7 @@ var AWxH, BWxH: string; begin case ACol of - 0, 1, 2: + 0, 1, 2, 3: begin AIdx := StrToIntDef(grdTimsList.Cells[ACol, ARow], 0); BIdx := StrToIntDef(grdTimsList.Cells[BCol, BRow], 0); @@ -850,7 +850,7 @@ begin // Result will be either <0, =0, or >0 for normal order. Result := AIdx - BIdx; end; - 4: + 5: begin AWxH := grdTimsList.Cells[ACol, ARow]; BWxH := grdTimsList.Cells[BCol, BRow]; @@ -1145,13 +1145,13 @@ begin imgTim.Stretch := actStretch.Checked; end; -procedure TfrmMain.DrawSelClut; +procedure TfrmMain.SetupSelClut; var TIM: PTIM; begin if not pnlClut.Visible then Exit; - ClearGrid(@grdClut); + //ClearGrid(@grdClut); TIM := SelectedTimInMode; if TIM = nil then @@ -1164,7 +1164,7 @@ begin grdClut.Enabled := TIMHasCLUT(TIM); if TIMHasCLUT(TIM) then - DrawCLUT(TIM, cbbCLUT.ItemIndex, @grdClut) + SetupCLUT(TIM, cbbCLUT.ItemIndex, @grdClut) else begin grdClut.ColCount := 1; @@ -1257,7 +1257,7 @@ begin if Tim then DrawSelTim; if Clut then begin - DrawSelClut; + SetupSelClut; grdClut.Repaint; end; end; diff --git a/uscanresult.pas b/uscanresult.pas index 0bda024..a4ccf2c 100644 --- a/uscanresult.pas +++ b/uscanresult.pas @@ -13,6 +13,7 @@ type Height: Integer; BitMode: Byte; Cluts: Integer; + Colors: Integer; Good: Boolean; end; diff --git a/uscanthread.pas b/uscanthread.pas index 7eaa19b..edaf7a1 100644 --- a/uscanthread.pas +++ b/uscanthread.pas @@ -77,6 +77,8 @@ begin else ScanTim.Cluts := 0; + ScanTim.Colors := GetTimColorsCount(TIM); + ScanTim.Good := TIMIsGood(TIM); pScanResult.Count := TIM^.dwTimNumber;