I have the latest Lazarus, FPC and GLScene. I try to load PNG file to THudSprite. I am using TGLVfsPAK and it causes the TGLTexture loading routine to fetch the class of extension from HackTPictureRegisteredFormats. But it causes access violation on line
pFileFormats:=PAnsiChar(PInteger(@pGetFileFormats[2])^);
There is a saying // Warning: This will crash when Graphics.pas is compiled with the 'Use Debug DCUs' option.
But since I use Lazarus, it shouldn't be an issue?
This hack is to gain access to the list of file formats registered with TPicture, there's probably a proper way to do this on FPC without this hack. It's a hack that could could stop working between Delphi versions, so has to be tested each version of Delphi that comes out.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I managed to bypass this with changing the code in PictureRegisteredFormats.pas
inside GraphicClassForExtension function to
with TPicture.Create() do
try
result := FindGraphicClassWithFileExt(anExtension);
finally
free;
end;
It seems to work, but I have to test it with Pak files.
Seems to work with Pak files. I think with Lazarus the hack isn't necessary.