ColourTrans_GenerateTable
Anton Reiser (471) 63 posts |
I have a problem with ColourTrans_GenerateTable in combination with a mode 27 sprite without palette. My code:
In the returned table the values in 0..7 are the same as in 8..15. It’s the same as in !Paint if Display > Using desktop colours is unset. If I give this sprite a palette with !Paint, all works fine. ColourTrans version is 1.95 (29. May 2016) What I’m missing? |
Rick Murray (539) 13840 posts |
This is normal. The default colours in a 16 colour mode are for the lower eight to be the black, red, green, yellow, blue, magenta, cyan, and white. The upper eight are flashing colours, but since this doesn’t make sense in a sprite, it’ll look like duplicates of the first eight. It’s a historical thing, based upon how the old Beeb used to work (MODE 2). |
Anton Reiser (471) 63 posts |
So in WIMP environment to plot such a sprite by OS_SpriteOp 52 I have to check first the sprite details and build the WIMP palette myself? Is there any SWI to ask the WIMP for the palette in mode N? I see none. |
Rick Murray (539) 13840 posts |
Not just that, but you’ll also need to take the scaling into account, or things may go amusingly wrong in 2:4 pixel modes. Look at https://www.riscosopen.org/wiki/documentation/show/Wimp_ReadPalette and https://www.riscosopen.org/wiki/documentation/show/Wimp_ReadPixTrans. PS: You don’t get the palette in MODE n, you get the current palette. It’s supposed to be mode independent, at least, that’s the idea. |
Stuart Swales (8827) 1357 posts |
Doesn’t Wimp_PlotIcon sort all this guff out for you? |
Anton Reiser (471) 63 posts |
Wimp_PlotIcon is not the first thing that comes in mind while digging throu the PRMs. |