Hi,
After updating Lazarus from 9.24 to 9.26 the code that previously worked now does not.
I am getting the message: "function header doesn't match any method of this class".
The function which is supposedly at error is:
procedure TDX7LockableTexture.LockRect(Rect: PRect; Level: Integer;
out Bits: Pointer; out Pitch: Integer);
var
MipMap : IDirectDrawSurface7;
MipDesc: TDDSurfaceDesc2;
begin
Bits := nil;
Pitch:= 0;
MipMap:= GetSurfaceLevel(Level);
if (MipMap = nil) then
begin
Errors.Insert(errInvalidCall, Self, ClassName, 'LockRect');
Exit;
end;
FillChar(MipDesc, SizeOf(TDDSurfaceDesc2), 0);
MipDesc.dwSize:= SizeOf(TDDSurfaceDesc2);
if (Succeeded(MipMap.Lock(Rect, MipDesc, DDLOCK_SURFACEMEMORYPTR or
DDLOCK_WAIT, 0))) then
begin
Bits := MipDesc.lpSurface;
Pitch:= MipDesc.lPitch;
end else Errors.Insert(errAccessTexture, Self, ClassName, 'LockRect');
MipMap:= nil;
end;
Complete declaration of the class is:
type
TDX7LockableTexture = class(TCustomLockableTexture)
private
FSurface: IDirectDrawSurface7;
FSurfaceDesc: TDDSurfaceDesc2;
LockedRect: TRect;
procedure InitSurfaceDesc();
function CreateTextureInstance(): Boolean;
procedure DestroyTextureInstance();
function GetSurfaceLevel(Level: Integer): IDirectDrawSurface7;
function GetSizeOfLevel(Level: Integer): TPoint2px;
procedure LockRect(Rect: PRect; Level: Integer; out Bits: Pointer;
out Pitch: Integer);
procedure UnlockRect(Rect: PRect; Level: Integer);
function GetLockRectPtr(Rect: PRect): PRect;
function GetPixelData(Level: Integer; Buffer: TSystemSurface): Boolean;
function SetPixelData(Level: Integer; Buffer: TSystemSurface): Boolean;
function MakeMipmap(DestNo, SrcNo: Integer): Boolean;
protected
procedure UpdateSize(); override;
function CreateTexture(): Boolean; override;
procedure DestroyTexture(); override;
public
property Surface: IDirectDrawSurface7 read FSurface;
property SurfaceDesc: TDDSurfaceDesc2 read FSurfaceDesc;
procedure Bind(Stage: Integer); override;
procedure UpdateMipmaps(); override;
procedure Lock(const Rect: TRect; out Bits: Pointer;
out Pitch: Integer); override;
procedure Unlock(); override;
constructor Create(); override;
end;
What's interesting is that if I copy and paste the supposedly erroneous function BELOW some other function, now the error appears at other function, e.g. UnlockRect, UpdateMipmaps, whatever. Seems like the compiler just don't want to compile the code below certain point in this unit.
Anyone had this issue before? Is there an option I need to be looking at to fix this?