From 2b7c86831f1693116f30ea10eb29d7dda9ecef40 Mon Sep 17 00:00:00 2001 From: Raymond Date: Mon, 2 Nov 2009 10:34:41 +0000 Subject: [PATCH] Fixed error in ReturnData. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@176 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- Units/MMLCore/window.pas | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Units/MMLCore/window.pas b/Units/MMLCore/window.pas index fb78555..9b8cc51 100644 --- a/Units/MMLCore/window.pas +++ b/Units/MMLCore/window.pas @@ -280,10 +280,10 @@ begin if Self.Frozen then begin; TmpData := Self.FrozenData; - Inc(TmpData, ys * width + xs); - Result.Ptr:= tmpData; - Result.IncPtrWith:= Self.FrozenSize.x - width; Result.RowLen:= Self.FrozenSize.x; + Result.IncPtrWith:= Result.RowLen - width; + Inc(TmpData, ys * Result.RowLen + xs); + Result.Ptr:= tmpData; end else case Self.TargetMode of w_BMP : @@ -292,11 +292,10 @@ begin TmpData := TargetBitmap.FData; // Increase the pointer to the specified start of the data. - - Inc(TmpData, ys * width + xs); - Result.Ptr := TmpData; - Result.IncPtrWith:= TargetBitmap.Width - width; Result.RowLen:= TargetBitmap.Width; + Result.IncPtrWith:= Result.RowLen - width; + Inc(TmpData, ys * Result.RowLen + xs); + Result.Ptr := TmpData; end; w_Window: begin @@ -343,12 +342,10 @@ begin TmpData := Self.ArrayPtr; // Increase the pointer to the specified start of the data. - - Inc(TmpData, ys * width + xs); - Result.Ptr := TmpData; - Result.IncPtrWith:= Self.ArraySize.x - width; Result.RowLen:= Self.ArraySize.x; - + Result.IncPtrWith:= Result.RowLen - width; + Inc(TmpData, ys * Result.RowLen + xs); + Result.Ptr := TmpData; end; end; end; @@ -435,7 +432,6 @@ var begin Self.GetDimensions(w, h); - //THIS IS NOT THE FUCKING WIDTH/HEIGHT YA! ww := xe-xs; hh := ye-ys; if(xs < 0) or (ys < 0) or (xe >= W) or (ye >= H) then