Changeset 346 for trunk/LocalPlayer
- Timestamp:
- Apr 6, 2021, 7:19:02 PM (4 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r331 r346 111 111 procedure WaterSign(x0, y0, iix: Integer); 112 112 procedure Search(SearchString: string); 113 procedure OnScroll(var m: TMessage); message WM_VSCROLL;113 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 114 114 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 115 115 public … … 351 351 end; 352 352 353 procedure THelpDlg.OnScroll(var m: TMessage);353 procedure THelpDlg.OnScroll(var Msg: TMessage); 354 354 begin 355 355 { TODO: Handled by MouseWheel event 356 if ScrollBar.Process( m) then begin356 if ScrollBar.Process(Msg) then begin 357 357 Sel := -1; 358 358 SmartUpdateContent(true) … … 452 452 MaxSum = 9 * 9 * 255 * 75 div 100; 453 453 var 454 x, y, dx, dy, xSrc, ySrc, sum, xx: integer;454 x, y, dx, dy, xSrc, ySrc, Sum, xx: integer; 455 455 Heaven: array [0..nHeaven] of integer; 456 PaintPtr, CoalPtr: TPixelPointer; 456 PaintPtr: TPixelPointer; 457 CoalPtr: TPixelPointer; 457 458 ImpPtr: array [-1..1] of TPixelPointer; 458 459 begin … … 466 467 xSrc := iix mod 7 * xSizeBig; 467 468 ySrc := (iix div 7 + 1) * ySizeBig; 468 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do 469 PaintPtr := PixelPointer(OffScreen, ScaleToNative(x0), ScaleToNative(y0)); 470 CoalPtr := PixelPointer(Templates.Data, ScaleToNative(xCoal), ScaleToNative(yCoal)); 471 for dy := -1 to 1 do 472 ImpPtr[dy] := PixelPointer(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc)); 473 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin 469 474 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin 470 PaintPtr := PixelPointer(OffScreen, 0, ScaleToNative(y0) + y);471 CoalPtr := PixelPointer(Templates.Data, 0, ScaleToNative(yCoal) + y);472 475 for dy := -1 to 1 do 473 476 if ((Max(y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 474 ImpPtr[dy] := PixelPointer(BigImp, 0, ScaleToNative(ySrc) + (Max(y + ScaleToNative(dy), 0) shr 1));475 for x := 0 to ScaleToNative(xSizeBig ) * 2- 1 do begin476 sum := 0;477 ImpPtr[dy].SetXY(0, Max(y + ScaleToNative(dy), 0) shr 1); 478 for x := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin 479 Sum := 0; 477 480 for dx := -1 to 1 do begin 478 xx := ScaleToNative(xSrc) +Max((x + ScaleToNative(dx)), 0) shr 1;481 xx := Max((x + ScaleToNative(dx)), 0) shr 1; 479 482 for dy := -1 to 1 do begin 480 483 ImpPtr[dy].SetX(xx); … … 483 486 ((y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and 484 487 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 485 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y ) + dy) shr 1]) then486 sum := sum + 9 * 255488 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y + ScaleToNative(dy))) shr 1]) then 489 Sum := Sum + 9 * 255 487 490 else 488 sum := sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 *491 Sum := Sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 * 489 492 ImpPtr[dy].Pixel^.R; 490 493 end; 491 494 end; 492 if sum < MaxSum then begin // no saturation 493 CoalPtr.SetX(ScaleToNative(xCoal) + x); 494 sum := 1 shl 22 - (MaxSum - sum) * (256 - CoalPtr.Pixel^.B * 2); 495 PaintPtr.SetX(x0 + x); 496 PaintPtr.Pixel^.B := PaintPtr.Pixel^.B * sum shr 22; 497 PaintPtr.Pixel^.G := PaintPtr.Pixel^.G * sum shr 22; 498 PaintPtr.Pixel^.R := PaintPtr.Pixel^.R * sum shr 22; 495 if Sum < MaxSum then begin // no saturation 496 Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2); 497 PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255); 498 PaintPtr.Pixel^.G := Min(PaintPtr.Pixel^.G * Sum shr 22, 255); 499 PaintPtr.Pixel^.R := Min(PaintPtr.Pixel^.R * Sum shr 22, 255); 499 500 end; 501 PaintPtr.NextPixel; 502 CoalPtr.NextPixel; 500 503 end; 501 504 end; 505 PaintPtr.NextLine; 506 CoalPtr.NextLine; 507 end; 502 508 Offscreen.EndUpdate; 503 509 BigImp.EndUpdate; -
trunk/LocalPlayer/PVSB.pas
r172 r346 32 32 procedure Init(Max, PageSize: Integer); 33 33 procedure SetPos(Pos: Integer); 34 function Process(const m: TMessage): boolean;34 function Process(const Msg: TMessage): boolean; 35 35 function ProcessMouseWheel(Delta: Integer): Boolean; 36 36 procedure Show(Visible: boolean); … … 65 65 end; 66 66 67 function TPVScrollBar.Process(const m: TMessage): boolean;67 function TPVScrollBar.Process(const Msg: TMessage): boolean; 68 68 var 69 69 NewPos: integer; … … 73 73 else 74 74 begin 75 if ( m.wParam and $ffff) in [SB_THUMBPOSITION, SB_THUMBTRACK] then75 if (Msg.wParam and $ffff) in [SB_THUMBPOSITION, SB_THUMBTRACK] then 76 76 begin 77 result := (( m.wParam shr 16) and $ffff) <> ScrollBar.Position;78 ScrollBar.Position := ( m.wParam shr 16) and $ffff;77 result := ((Msg.wParam shr 16) and $ffff) <> ScrollBar.Position; 78 ScrollBar.Position := (Msg.wParam shr 16) and $ffff; 79 79 end else begin 80 case ( m.wParam and $ffff) of80 case (Msg.wParam and $ffff) of 81 81 SB_LINEUP: 82 82 NewPos := ScrollBar.Position - 1; … … 95 95 NewPos := Max - ScrollBar.PageSize + 1; 96 96 result := NewPos <> ScrollBar.Position; 97 if (NewPos <> ScrollBar.Position) or (( m.wParam and $ffff) = SB_ENDSCROLL) then97 if (NewPos <> ScrollBar.Position) or ((Msg.wParam and $ffff) = SB_ENDSCROLL) then 98 98 begin 99 99 ScrollBar.Position := NewPos; -
trunk/LocalPlayer/Select.pas
r340 r346 45 45 private 46 46 Kind: TListKind; 47 LineDistance, MaxLines, cixProject, pView, Sel, DispLines, Layer, nColumn, 48 TechNameSpace, ScienceNation: integer; 47 LineDistance: Integer; 48 MaxLines: Integer; 49 cixProject: Integer; 50 pView: Integer; 51 Sel: Integer; 52 DispLines: Integer; 53 Layer: Integer; 54 nColumn: Integer; 55 TechNameSpace: Integer; 56 ScienceNation: Integer; 49 57 sb: TPVScrollbar; 50 58 Lines, FirstShrinkedLine: array [0 .. MaxLayer - 1] of integer; 51 59 code: array [0 .. MaxLayer - 1, 0 .. 4095] of integer; 52 60 Column: array [0 .. nPl - 1] of integer; 53 Closable, MultiPage: boolean; 61 Closable: Boolean; 62 MultiPage: Boolean; 54 63 ScienceNationDotBuffer: TBitmap; 55 64 procedure ScrollBarUpdate(Sender: TObject); … … 58 67 function RenameCity(cix: integer): boolean; 59 68 function RenameModel(mix: integer): boolean; 60 procedure OnScroll(var m: TMessage); message WM_VSCROLL;69 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 61 70 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 62 71 public … … 133 142 end; 134 143 135 procedure TListDlg.OnScroll(var m: TMessage);144 procedure TListDlg.OnScroll(var Msg: TMessage); 136 145 begin 137 146 { TODO: Handled by MouseWheel event 138 if sb.Process( m) then begin147 if sb.Process(Msg) then begin 139 148 Sel := -2; 140 149 SmartUpdateContent(true); -
trunk/LocalPlayer/Term.pas
r337 r346 322 322 procedure LoadSettings; 323 323 procedure SaveSettings; 324 procedure OnScroll(var m: TMessage); message WM_VSCROLL;324 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 325 325 procedure OnEOT(var Msg: TMessage); message WM_EOT; 326 326 procedure SoundPreload(Check: TSoundBlocks); … … 3668 3668 end; 3669 3669 3670 procedure TMainScreen.OnScroll(var m: TMessage);3671 begin 3672 if sb.Process( m) then begin3670 procedure TMainScreen.OnScroll(var Msg: TMessage); 3671 begin 3672 if sb.Process(Msg) then begin 3673 3673 PanelPaint; 3674 3674 Update;
Note:
See TracChangeset
for help on using the changeset viewer.