I tried but it kept giving me an access violation error.
In c++ you would do
BYTE *texture = new BYTE[datasize+headersize];
BYTE *unpackedtexture = new BYTE[unpackeddatasize+unpackedheadersize];
texture is then loaded from the file and sent to be uncompressed.
lzo1x_decompress(texture, fileHeader.PackedSize, unpackedtexture, fileHeader.unPackedSize, NULL);
texture is a pointer to where the byte array is allocated in the c++ source.
My translation was:
var
texture:array of byte;
unpackedtexture:array of byte;
begin
setlength(texture, datasize+headersize);
setlength(unpackedtexture, unpackeddatasize+unpackedheadersize);
I fill texture with the file to be uncompressed and send it to lzo the same way c++ source does.
lzo1x_decompress(@texture, fileHeader.PackedSize, @unpackedtexture, fileHeader.unPackedSize, NULL);
and Thats when I get the access violation?
as you can see you are supposed to send a pointer to the spot in memory where the texture is so I used @ to get the address.Since this did not work I tried using a pointer to point to texture and sending the pointer and the same result happens.