* Fix compilation using EnableAdvancedGraphics define

* Fix objects demo project file
* Remove lcltypes.inc file

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@182 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2007-06-18 14:57:33 +00:00
parent 1ca9c64f5e
commit 3887d4ba32
4 changed files with 27 additions and 14 deletions

View File

@ -30,7 +30,8 @@
{.$define EnablePrint}
{$define NeedWindows}
{.$define EnableNCFunctions}
{.$define EnableAdvancedGraphics}
{$define EnableAdvancedGraphics}
{$define EnableAlphaBlend}
{$define EnableHeader}
{$define EnableTimer}
{.$define EnableAccessible}

View File

@ -263,7 +263,6 @@ var // Clipboard format IDs used in OLE drag'n drop and clipboard transfers.
{$MinEnumSize 1, make enumerations as small as possible}
type
{$I lcltypes.inc}
// The exception used by the trees.
EVirtualTreeError = class(Exception);
@ -4444,6 +4443,21 @@ end;
//----------------------------------------------------------------------------------------------------------------------
function GetBitmapBitsFromBitmap(Bitmap: HBITMAP): Pointer;
var
DIB: TDIBSection;
begin
Result := nil;
if Bitmap <> 0 then
begin
if GetObject(Bitmap, SizeOf(DIB), @DIB) = SizeOf(DIB) then
begin
Assert(DIB.dsBm.bmPlanes * DIB.dsBm.bmBitsPixel = 32, 'Alpha blending error: bitmap must use 32 bpp.');
Result := DIB.dsBm.bmBits;
end;
end;
end;
function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer;
// Helper function to calculate the start address for the given row.
@ -6991,9 +7005,16 @@ var
HalfWidth,
HalfHeight: Integer;
T: Extended;
SourceBits, TargetBits: Pointer;
begin
{$ifdef EnableAdvancedGraphics}
SourceBits := GetBitmapBitsFromBitmap(Source.Handle);
TargetBits := GetBitmapBitsFromBitmap(Target.Handle);
if (SourceBits = nil) or (TargetBits = nil) then
Exit;
UseColorKey := ColorKey <> clNone;
ColorKeyRef := ColorToRGB(ColorKey) and $FFFFFF;
// Color values are in the form BGR (red on LSB) while bitmap colors are in the form ARGB (blue on LSB)
@ -7013,8 +7034,8 @@ begin
HalfHeight := Height div 2;
for Y := 0 to Height - 1 do
begin
TargetRun := Scanline[Y];
SourceRun := Source.Scanline[Y];
TargetRun := CalculateScanline(TargetBits, Width, Height, Y);
SourceRun := CalculateScanline(SourceBits, Source.Width, Source.Height, Y);
for X := 0 to Width - 1 do
begin
Color := SourceRun.Color and $FFFFFF;
@ -17258,7 +17279,7 @@ begin
NewCursor := crVT_MOVES;
end;
end;
// Now load the cursor and apply it.
Cursor := NewCursor;
end;

View File

@ -65,10 +65,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<<<<<<< .mine
=======
<PathDelim Value="\"/>
>>>>>>> .r167
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>

View File

@ -1,6 +0,0 @@
//TBiDiMode = (bdLeftToRight, bdRightToLeft, bdRightToLeftNoAlign, bdRightToLeftReadingOnly);