You've already forked lazarus-ccr
* 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:
@ -30,7 +30,8 @@
|
|||||||
{.$define EnablePrint}
|
{.$define EnablePrint}
|
||||||
{$define NeedWindows}
|
{$define NeedWindows}
|
||||||
{.$define EnableNCFunctions}
|
{.$define EnableNCFunctions}
|
||||||
{.$define EnableAdvancedGraphics}
|
{$define EnableAdvancedGraphics}
|
||||||
|
{$define EnableAlphaBlend}
|
||||||
{$define EnableHeader}
|
{$define EnableHeader}
|
||||||
{$define EnableTimer}
|
{$define EnableTimer}
|
||||||
{.$define EnableAccessible}
|
{.$define EnableAccessible}
|
||||||
|
@ -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}
|
{$MinEnumSize 1, make enumerations as small as possible}
|
||||||
|
|
||||||
type
|
type
|
||||||
{$I lcltypes.inc}
|
|
||||||
// The exception used by the trees.
|
// The exception used by the trees.
|
||||||
EVirtualTreeError = class(Exception);
|
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;
|
function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer;
|
||||||
|
|
||||||
// Helper function to calculate the start address for the given row.
|
// Helper function to calculate the start address for the given row.
|
||||||
@ -6991,9 +7005,16 @@ var
|
|||||||
HalfWidth,
|
HalfWidth,
|
||||||
HalfHeight: Integer;
|
HalfHeight: Integer;
|
||||||
T: Extended;
|
T: Extended;
|
||||||
|
SourceBits, TargetBits: Pointer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef EnableAdvancedGraphics}
|
{$ifdef EnableAdvancedGraphics}
|
||||||
|
SourceBits := GetBitmapBitsFromBitmap(Source.Handle);
|
||||||
|
TargetBits := GetBitmapBitsFromBitmap(Target.Handle);
|
||||||
|
|
||||||
|
if (SourceBits = nil) or (TargetBits = nil) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
UseColorKey := ColorKey <> clNone;
|
UseColorKey := ColorKey <> clNone;
|
||||||
ColorKeyRef := ColorToRGB(ColorKey) and $FFFFFF;
|
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)
|
// 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;
|
HalfHeight := Height div 2;
|
||||||
for Y := 0 to Height - 1 do
|
for Y := 0 to Height - 1 do
|
||||||
begin
|
begin
|
||||||
TargetRun := Scanline[Y];
|
TargetRun := CalculateScanline(TargetBits, Width, Height, Y);
|
||||||
SourceRun := Source.Scanline[Y];
|
SourceRun := CalculateScanline(SourceBits, Source.Width, Source.Height, Y);
|
||||||
for X := 0 to Width - 1 do
|
for X := 0 to Width - 1 do
|
||||||
begin
|
begin
|
||||||
Color := SourceRun.Color and $FFFFFF;
|
Color := SourceRun.Color and $FFFFFF;
|
||||||
@ -17258,7 +17279,7 @@ begin
|
|||||||
NewCursor := crVT_MOVES;
|
NewCursor := crVT_MOVES;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Now load the cursor and apply it.
|
// Now load the cursor and apply it.
|
||||||
Cursor := NewCursor;
|
Cursor := NewCursor;
|
||||||
end;
|
end;
|
||||||
|
@ -65,10 +65,7 @@
|
|||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
<<<<<<< .mine
|
|
||||||
=======
|
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
>>>>>>> .r167
|
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Generate Value="Faster"/>
|
<Generate Value="Faster"/>
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TBiDiMode = (bdLeftToRight, bdRightToLeft, bdRightToLeftNoAlign, bdRightToLeftReadingOnly);
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user