projects
/
LazOpenGLCore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c0bac2
)
* fixed some Delphi7 errors
author
Bergmann89
<info@bergmann89.de>
Wed, 10 Dec 2014 17:18:08 +0000
(18:18 +0100)
committer
Bergmann89
<info@bergmann89.de>
Wed, 10 Dec 2014 17:18:08 +0000
(18:18 +0100)
glBitmap.pas
patch
|
blob
|
history
diff --git
a/glBitmap.pas
b/glBitmap.pas
index
759a404
..
ddee6ca
100644
(file)
--- a/
glBitmap.pas
+++ b/
glBitmap.pas
@@
-780,6
+780,13
@@
type
// - data type (e.g. ub, us, ui)
// - number of data types
// - data type (e.g. ub, us, ui)
// - number of data types
+{$IFNDEF fpc}
+ QWord = System.UInt64;
+ PQWord = ^QWord;
+
+ PtrInt = Longint;
+ PtrUInt = DWord;
+{$ENDIF}
TglBitmapFormat = (
tfEmpty = 0, //must be smallest value!
TglBitmapFormat = (
tfEmpty = 0, //must be smallest value!
@@
-905,7
+912,7
@@
type
end;
TglBitmapFormatDescriptor = class(TObject)
end;
TglBitmapFormatDescriptor = class(TObject)
-
strict
private
+ private
// cached properties
fBytesPerPixel: Single;
fChannelCount: Integer;
// cached properties
fBytesPerPixel: Single;
fChannelCount: Integer;
@@
-1324,16
+1331,8
@@
uses
Math, syncobjs, typinfo
{$IF DEFINED(GLB_SUPPORT_JPEG_READ) AND DEFINED(GLB_LAZ_JPEG)}, FPReadJPEG{$IFEND};
Math, syncobjs, typinfo
{$IF DEFINED(GLB_SUPPORT_JPEG_READ) AND DEFINED(GLB_LAZ_JPEG)}, FPReadJPEG{$IFEND};
-type
-{$IFNDEF fpc}
- QWord = System.UInt64;
- PQWord = ^QWord;
-
- PtrInt = Longint;
- PtrUInt = DWord;
-{$ENDIF}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
+type
TFormatDescriptor = class(TglBitmapFormatDescriptor)
public
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); virtual; abstract;
TFormatDescriptor = class(TglBitmapFormatDescriptor)
public
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); virtual; abstract;
@@
-1724,8
+1723,8
@@
type
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TbmpBitfieldFormat = class(TFormatDescriptor)
public
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TbmpBitfieldFormat = class(TFormatDescriptor)
public
- procedure SetValues(const aBPP: Integer; aMask: TglBitmapRec4ul); overload;
- procedure SetValues(const aBBP: Integer; const aPrec, aShift: TglBitmapRec4ub); overload;
+ procedure Set
Custom
Values(const aBPP: Integer; aMask: TglBitmapRec4ul); overload;
+ procedure Set
Custom
Values(const aBBP: Integer; const aPrec, aShift: TglBitmapRec4ub); overload;
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
end;
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
end;
@@
-1740,12
+1739,12
@@
type
fBitsPerPixel: Integer;
fColorTable: TbmpColorTable;
protected
fBitsPerPixel: Integer;
fColorTable: TbmpColorTable;
protected
- procedure SetValues; override;
overload;
+ procedure SetValues; override;
public
property ColorTable: TbmpColorTable read fColorTable write fColorTable;
property BitsPerPixel: Integer read fBitsPerPixel write fBitsPerPixel;
public
property ColorTable: TbmpColorTable read fColorTable write fColorTable;
property BitsPerPixel: Integer read fBitsPerPixel write fBitsPerPixel;
- procedure SetValues(const aFormat: TglBitmapFormat; const aBPP: Integer; const aPrec, aShift: TglBitmapRec4ub); overload;
+ procedure Set
Custom
Values(const aFormat: TglBitmapFormat; const aBPP: Integer; const aPrec, aShift: TglBitmapRec4ub); overload;
procedure CalcValues;
procedure CreateColorTable;
procedure CalcValues;
procedure CreateColorTable;
@@
-1935,7
+1934,7
@@
begin
if (desc.IsCompressed) or (desc.glFormat = 0) then
exit;
if (desc.IsCompressed) or (desc.glFormat = 0) then
exit;
- p := GetMem(ceil(25 * desc.BytesPerPixel)); // 5 x 5 pixel
+ p := GetMem
ory
(ceil(25 * desc.BytesPerPixel)); // 5 x 5 pixel
md := desc.CreateMappingData;
try
tmp := p;
md := desc.CreateMappingData;
try
tmp := p;
@@
-4104,7
+4103,7
@@
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TBitfieldFormat/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TBitfieldFormat/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TbmpBitfieldFormat.SetValues(const aBPP: Integer; aMask: TglBitmapRec4ul);
+procedure TbmpBitfieldFormat.Set
Custom
Values(const aBPP: Integer; aMask: TglBitmapRec4ul);
var
i: Integer;
begin
var
i: Integer;
begin
@@
-4120,7
+4119,7
@@
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TbmpBitfieldFormat.SetValues(const aBBP: Integer; const aPrec, aShift: TglBitmapRec4ub);
+procedure TbmpBitfieldFormat.Set
Custom
Values(const aBBP: Integer; const aPrec, aShift: TglBitmapRec4ub);
begin
fBitsPerPixel := aBBP;
fPrecision := aPrec;
begin
fBitsPerPixel := aBBP;
fPrecision := aPrec;
@@
-4178,7
+4177,7
@@
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TbmpColorTableFormat.SetValues(const aFormat: TglBitmapFormat; const aBPP: Integer; const aPrec, aShift: TglBitmapRec4ub);
+procedure TbmpColorTableFormat.Set
Custom
Values(const aFormat: TglBitmapFormat; const aBPP: Integer; const aPrec, aShift: TglBitmapRec4ub);
begin
fFormat := aFormat;
fBitsPerPixel := aBPP;
begin
fFormat := aFormat;
fBitsPerPixel := aBPP;
@@
-5294,7
+5293,7
@@
var
Shift.g := GreenShift;
Shift.b := BlueShift;
Shift.a := AlphaShift;
Shift.g := GreenShift;
Shift.b := BlueShift;
Shift.a := AlphaShift;
- bfFormat.SetValues(BitsPerPixel, Prec, Shift);
+ bfFormat.Set
Custom
Values(BitsPerPixel, Prec, Shift);
end;
pSourceMD := bfFormat.CreateMappingData;
pDestMD := FormatDesc.CreateMappingData;
end;
pSourceMD := bfFormat.CreateMappingData;
pDestMD := FormatDesc.CreateMappingData;
@@
-7068,7
+7067,7
@@
begin
if (fd.Format = tfEmpty) then
raise EglBitmapUnsupportedFormat.Create('no supported format found');
if (fd.Format = tfEmpty) then
raise EglBitmapUnsupportedFormat.Create('no supported format found');
- buf := GetMem(header.DataSize);
+ buf := GetMem
ory
(header.DataSize);
aStream.Read(buf^, header.DataSize);
SetDataPointer(buf, fd.Format, header.Width, header.Height);
aStream.Read(buf^, header.DataSize);
SetDataPointer(buf, fd.Format, header.Width, header.Height);
@@
-7205,7
+7204,7
@@
function TglBitmap.LoadBMP(const aStream: TStream): Boolean;
aFormat := TFormatDescriptor.Get(aFormat).WithAlpha;
result := TbmpBitfieldFormat.Create;
aFormat := TFormatDescriptor.Get(aFormat).WithAlpha;
result := TbmpBitfieldFormat.Create;
- result.SetValues(aInfo.biBitCount, aMask);
+ result.Set
Custom
Values(aInfo.biBitCount, aMask);
end;
end;
end;
end;
@@
-7374,7
+7373,7
@@
begin
Header.bfOffBits := Header.bfOffBits + 256 * SizeOf(Cardinal); //256 ColorTable entries
Converter := TbmpColorTableFormat.Create;
with (Converter as TbmpColorTableFormat) do begin
Header.bfOffBits := Header.bfOffBits + 256 * SizeOf(Cardinal); //256 ColorTable entries
Converter := TbmpColorTableFormat.Create;
with (Converter as TbmpColorTableFormat) do begin
- SetValues(fFormat, 1, FormatDesc.Precision, FormatDesc.Shift);
+ Set
Custom
Values(fFormat, 1, FormatDesc.Precision, FormatDesc.Shift);
CreateColorTable;
end;
end;
CreateColorTable;
end;
end;
@@
-7955,7
+7954,7
@@
var
end;
Converter := TbmpBitfieldFormat.Create;
end;
Converter := TbmpBitfieldFormat.Create;
- Converter.SetValues(dwRGBBitCount, glBitmapRec4ul(dwRBitMask, dwGBitMask, dwBBitMask, dwABitMask));
+ Converter.Set
Custom
Values(dwRGBBitCount, glBitmapRec4ul(dwRBitMask, dwGBitMask, dwBBitMask, dwABitMask));
end;
end;
end;
end;
end;
end;
@@
-8337,7
+8336,6
@@
begin
glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_HEIGHT, @TempHeight);
glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, @TempIntFormat);
glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_HEIGHT, @TempHeight);
glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, @TempIntFormat);
- IntFormat := tfEmpty;
FormatDesc := (TglBitmapFormatDescriptor.GetByFormat(TempIntFormat) as TFormatDescriptor);
IntFormat := FormatDesc.Format;
FormatDesc := (TglBitmapFormatDescriptor.GetByFormat(TempIntFormat) as TFormatDescriptor);
IntFormat := FormatDesc.Format;