Page 1 of 1

DefineVirtualFile and transparent PNG

Posted: Thu Feb 18, 2010 4:41 pm
by Paolo Canonici
Hello all,
I've implemented a resource file builder that takes a set of user's specified files and creates an unique huge file containing all the data. It works fine since I've tested the inverse action by extracting randomly a file and verifying that this exactly corresponds to the original one. All has gone well but I'm unable to correctly load PNGs with trasparency. Thus the following code raises an error:

Code: Select all

local vf$ = MCRFDefineVirtualFile("stuff2/fonts/comic16_00.png")
local brushid = LoadBrush(nil, vf$, {LoadAlpha = true})
DisplayBrush(brushid, 0, 0)
The error says: Image "comic16_00.png" does not have an alpha channel!

Note that MCRFDefineVirtualFile is a function wich translates the fully qualified file path into the correct virtual file by inspecting an index table (stored in the resource file too) and it's fully functional, infact the code above works on PNGs without transparency and other file types.

I'm using Hollywood 4.0 under WinUAE wich is emulating an A4000. Might it be an Hollywood bug or am I missing something?

Thanks all,
Paolo.

Re: DefineVirtualFile and transparent PNG

Posted: Fri Feb 19, 2010 11:59 am
by airsoftsoftwair
Yes, that's a bug in 4.0 that occurred only under OS3 but it is fixed in 4.5. From the Hollywood history:
- Fix [OS3]: Embedded alpha channel images did not work in compiled applets/executables