problem with 32-bit color sprites
Sergey Lentsov (8268) 63 posts |
Hello, Me needs to display and scale down 32bit color sprites with alpha-channel. Problem that sometimes Tinct does not produce any output and not return any error when try to plot bit sprites.
I also tried to just output the sprite without scaling with Tinct_PlotAlpha but it also display nothing and error is NULL Is there any solution to scale and plot big 32bit ARGB sprites correctly with alpha channel? May be I missed something in the standard “OS_SpriteOp 52 – Paint Sprite Scaled” SWI ? |
Stuart Swales (8827) 1357 posts |
I think this page should tell you all you need to know regarding Tinct: https://www.netsurf-browser.org/projects/tinct/ Projects are moving away from using it, e.g. the latest PrivateEye https://www.riscosopen.org/forum/forums/1/topics/17597 That sprite doesn’t have an alpha channel as far as I can see – have you transformed it in memory before plotting? |
nemo (145) 2556 posts |
I’ve been asked to respond to this, as I’m not normally round here. SpriteOp has never supported RGBA sprites – some applications (PhotoDesk) write alpha to the fourth byte of 32bpp pixels, and some applications (Vantage) can use it. But SpriteOp only supports an Alpha Mask, and if your sprite type is &301680B5 then it doesn’t have an Alpha mask – it probably only has a 1bpp mask. IIRC There is a configuration option for PhotoDesk to write out a full Alpha Mask (or I may have misremembered that). Alternatively, you will have to create an Alpha Mask from your RGBA pixels. This involves ensuring you’ve reserved enough free memory in the sprite area to create the mask (width×height pixels), calling SpriteOp &x26 to create the Alpha Mask, then manually copying the A from your RGBA pixels to the pixels of the mask. |
Sergey Lentsov (8268) 63 posts |
Studying the PrivateEye sources I found that there exists some modern osspriteop_EXT_STYLE sprites which can be displayed correctly on RISCOS 5 with SpriteExtend module 1.52 or above. I tried to loading the PNG with alpha-channel in the PrivateEye and save the output as sprite and check the binary output. It is the same as for Tinct-like sprites (32bit with alpha-value) only ModeWord is different 0×78608051 instead of 0×301680b5. No separate alpha masks required. When i just change the mode word from 0×301680b5 to 0×78608051 in the Tinct-like sprite then it start output correct with alpha-channel on my RISCOS 5.28 with using OS_SpriteOp 52 |
Stuart Swales (8827) 1357 posts |
Changing the sprite mode word to a RISC OS 5.21 type one in order to successfully plot alpha rang a bell – see Jeffrey’s notes here from the dim and distant past: https://www.riscosopen.org/forum/forums/11/topics/2514#posts-31595 Did ChangeFSI ever get updated to save alpha channel from a PNG import? |
nemo (145) 2556 posts |
I forgot about b15 on RO5.2+ |