From: <tw...@us...> - 2020-04-25 12:53:16
|
Revision: 3089 http://sourceforge.net/p/gexperts/code/3089 Author: twm Date: 2020-04-25 12:53:14 +0000 (Sat, 25 Apr 2020) Log Message: ----------- updated to latest version from OSDN Modified Paths: -------------- trunk/ExternalSource/dzlib/dzlib.inc trunk/ExternalSource/dzlib/u_dzClassUtils.pas trunk/ExternalSource/dzlib/u_dzErrorThread.pas trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas Modified: trunk/ExternalSource/dzlib/dzlib.inc =================================================================== --- trunk/ExternalSource/dzlib/dzlib.inc 2020-04-18 15:36:43 UTC (rev 3088) +++ trunk/ExternalSource/dzlib/dzlib.inc 2020-04-25 12:53:14 UTC (rev 3089) @@ -12,6 +12,7 @@ // For now I assume the BDE is not installed for Delphi XE7 and later, but that // largely depends on what the user selected for installation. {$DEFINE BDE_IS_DEPRECATED} +{$DEFINE HAS_UNIT_NETENCODING} {$ENDIF} {$IFDEF DELPHI7_UP} @@ -63,6 +64,10 @@ {$DEFINE HAS_TOBJECT_TOSTRING} {$ENDIF} +{$IFDEF DELPHIXE_UP} +{$DEFINE HAS_UNIT_GENERICS_COLLECTION} +{$ENDIF} + {$IFDEF DELPHIXE2_UP} // AHandle is declared as THandle (otherwise it's an Integer) {$DEFINE THANDLESTREAM_CREATE_HANDLE_IS_THANDLE} Modified: trunk/ExternalSource/dzlib/u_dzClassUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzClassUtils.pas 2020-04-18 15:36:43 UTC (rev 3088) +++ trunk/ExternalSource/dzlib/u_dzClassUtils.pas 2020-04-25 12:53:14 UTC (rev 3089) @@ -1064,8 +1064,10 @@ begin // twm: this is not really efficient, because it reads single bytes, if it becomes a problem, optimize it ;-) OldPos := _Stream.Position; +{$IFNDEF DELPHIX_SEATTLE_UP} Endstring := 0; NewPos := 0; +{$ENDIF} while True do begin if _Stream.Read(c, 1) = 0 then begin // end of file EndString := _Stream.Position; Modified: trunk/ExternalSource/dzlib/u_dzErrorThread.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzErrorThread.pas 2020-04-18 15:36:43 UTC (rev 3088) +++ trunk/ExternalSource/dzlib/u_dzErrorThread.pas 2020-04-25 12:53:14 UTC (rev 3089) @@ -174,7 +174,6 @@ until Result or (_TimeoutMsecs <> INFINITE); end else begin WaitResult := WaitForSingleObject(H, _TimeoutMsecs); - Result := True; if WaitResult = WAIT_FAILED then RaiseLastOSError; Result := (WaitResult <> WAIT_TIMEOUT); Modified: trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2020-04-18 15:36:43 UTC (rev 3088) +++ trunk/ExternalSource/dzlib/u_dzGraphicsUtils.pas 2020-04-25 12:53:14 UTC (rev 3089) @@ -10,7 +10,9 @@ {$ENDIF} {$IFOPT O-} // Optimization -{$MESSAGE WARN 'optimization is off, consider turning it on for significantly better performance'} +{$IFNDEF NO_OPTIMIZE_DZ_GRAPHIC_UTILS_HINT} +{$MESSAGE HINT 'optimization is off, consider turning it on for significantly better performance'} +{$ENDIF} {$ELSE} // If optimization is on, we turn off assertions, just in case the programmer forgot. // The reason for this is that we have some assertions below that might significantly impact @@ -668,13 +670,18 @@ wDst: Integer; hDst: Integer; begin + wDst := _DestBmp.Width; + hDst := _DestBmp.Height; + if wDst = 0 then + raise Exception.Create(_('Destination bitmap width must not be 0.')); + if hDst = 0 then + raise Exception.Create(_('Destination bitmap height must not be 0.')); + DstHandle := _DestBmp.Canvas.Handle; OrigBltMode := GetStretchBltMode(DstHandle); try SetBrushOrgEx(DstHandle, 0, 0, @OrigBrushOrigin); SetStretchBltMode(DstHandle, HALFTONE); - wDst := _DestBmp.Width; - hDst := _DestBmp.Height; wSrc := _SrcBmp.Width; hSrc := _SrcBmp.Height; if (hSrc = 0) or (wSrc = 0) then begin @@ -682,14 +689,19 @@ // todo: Should this clear DestBmp? Result := False; end else begin - if hSrc > wSrc then begin - x := Round((wDst * (hSrc - wSrc)) / 2 / hSrc); + if SameValue(wSrc / hSrc, wDst / hDst) then begin + x := 0; y := 0; - wDst := Round(wDst * wSrc / hSrc); end else begin - x := 0; - y := Round((hDst * (wSrc - hSrc)) / 2 / wSrc); - hDst := Round(hDst * hSrc / wSrc); + if hSrc > wSrc then begin + x := Round((wDst * (hSrc - wSrc)) / 2 / hSrc); + y := 0; + wDst := Round(wDst * wSrc / hSrc); + end else begin + x := 0; + y := Round((hDst * (wSrc - hSrc)) / 2 / wSrc); + hDst := Round(hDst * hSrc / wSrc); + end; end; Result := dzStretchBlt(DstHandle, Rect(x, y, x + wDst - 1, y + hDst - 1), _SrcBmp); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |