Thread View: comp.sys.acorn.tech
3 messages
3 total messages
Started by Eric Lafortune
Tue, 06 Oct 1992 16:39
Palette utility obscurity
Author: Eric Lafortune
Date: Tue, 06 Oct 1992 16:39
Date: Tue, 06 Oct 1992 16:39
88 lines
4075 bytes
4075 bytes
I am posting this article on behalf of John Tytgat (of Bass fame) because his News forwarding system seems to be acting up these days. Please reply to one of the adresses listed at the end of this message. Let me take this opportunity to plug his excellent disassembler !Dissi which is really worth while if you are interested in analysing code produced by an optimising C-compiler, for instance. :) Eric. ====================================================================== A WIMP problem this time : On page 1257 in the PRM we can read about the Message_PaletteChange : "This broadcast message is issued by the Palette utility. It should not be acknowledged. The utility generates it when the user finishes dragging one of the RGB bars for a given colour, or when a new palette file is loaded. If a task needs to adapt to a change in the physical colours on the screen,it should respond to this message by changing any of its internal tables (colour maps etc), and the call Wimp_ForceRedraw to ensure that its window are redrawn with the new colours. Note though that the palette utility automatically forces a redraw of the whole screen if any of the Wimp's standard colours change their logical mapping, so applications don't have to take further action. This message is not issued when the Wimp mode changes; Message_ModeChange (&400C1) reports this, so tasks interested in colour mapping changes should recognise this message too." I am particulary interested in the sentence : "Note though that the palette utility automatically forces a redraw of the whole screen if any of the Wimp's standard colours change their logical mapping, so applications don't have to take further action." Does this mean that when a Wimp program changes a colour in a 16 colour mode using "VDU 19, <colour number>, 16, <red>, <green>, <blue>", the palette utility automatically issues a redraw of the screen ??? I guess it has to mean something different because such a VDU 19,... sequence *does not* generate a redraw neither is there a broadcast message Message_PaletteChange (using Risc OS 2.0) being send. Is this a bug or do I misinterprete the PRMs ??? A quick way to verify what I am talking about : put yourself in a 16 colour mode, start-up !Paint, create a 16 colour sprite with the 'Palette' bit on and fill it with colour number 11 (that's red). Now find a TaskWindow which accepts control characters (eg. the !VMode application written by Brian Brunswick will do this). Open a new task and type 'BASIC'. Now we are going to change the logical mapping of colour number 11 by typing 'VDU 19, 11, 16, 255, 255, 255'. Your red sprite will change into a white one. As you can see there has been *no* redraw. To be sure of that last fact we will issue a broadcast message ourselves by : DIM Q% 256 !Q%=20 Q%!12=0 Q%!16=9 :REM Message_PaletteChange SYS "Wimp_SendMessage", 17, Q%, 0 !Paint will pick up this message, read the current palette and change its colour tables so that the red colour will now be represented by the actually closest colour, which seems to be a grey one (if this last thing didn't happen, you probably forgot to switch the 'Palette' bit on). Conclusion : In Risc OS 2.0 the palette utility *does not* automatically force a redraw if a Wimp standard colour changes its logical mapping, contrary to what the PRM claims. Can someone do the same test in Risc OS 3.x ? Any comments Acorn ??? John BASS tytgat@esat.kuleuven.ac.be tytgatj@imec.be (my old e-mail account "devijt1@imec.be" is no longer valid...)
Re: Palette utility obscurity
Author: Ian Palmer
Date: Wed, 07 Oct 1992 09:39
Date: Wed, 07 Oct 1992 09:39
57 lines
3140 bytes
3140 bytes
In article <1992Oct6.163937.9771@cs.kuleuven.ac.be> ericl@cs.kuleuven.ac.be (Eric Lafortune) writes:
(on bahalf of tytgat@esat.kuleuven.ac.be)
>
>A WIMP problem this time :
>
>On page 1257 in the PRM we can read about the Message_PaletteChange :
>
>I am particulary interested in the sentence : "Note though that the
>palette utility automatically forces a redraw of the whole screen if
>any of the Wimp's standard colours change their logical mapping, so
>applications don't have to take further action."
>
>Does this mean that when a Wimp program changes a colour in a 16 colour
>mode using "VDU 19, <colour number>, 16, <red>, <green>, <blue>", the
>palette utility automatically issues a redraw of the screen ???
>
I would guess not.
My understanding of this sentence, and from noticong what happans, I
would guess that this only applies to non-16 colour modes.
I have noticed, in 256 colour modes - but I would guess that the same
is true for 4 and 2 colour modes as well - that when changing colours
with !Palette the screen does get redrawn. I would guess that the
sentence means, precicly what it says, that when a logical mapping for
a wimp colour changes the screen is redrawn. This will never happen in
16 colour modes as there is only direct mapping os colours in this
mode (16 wimp colours, 16 totally definable colours available). Only
in 256 colours modes (256 colours from a very restricted palette), and
4 and 2 colours modes is there any logical mapping of colours.
For example, in the standard 256 mode palette and standard wimp
palette, wimp colour 0 (white) will be mapped to screen colour 255 (I
think), but if you make wimp colour 0, say, black - then it will be
mapped to screen colour 0 - needing a total redraw rather than a
simply change to the rgb values the VIDC outputs to the monitor.
This does rather suggest that the palette file, which someone has
already mentioned in a different thread, being simply a series of VDU
19 calls is a little messy. O.K. fine, in a 16 colour mode all you
need to do is treat is as such, but in all other screen types more
complex things need to go on, which will totally ignore half of the
file (ie. the 19,c,16 part) - a bit wasteful.
Ian
Of course this is totally based on my simple understanding, built up
without the help of PRMs - due to a lack of said item for RO3. Ho
Hum.
--
E-mail : ijp@doc.ic.ac.uk
___ __ Snail mail : Department of Computing, Huxley Building,
/ _ _ /_/ _ / _ _ _ _ Imperial College, 180 Queens Gate,
_/_ (_|_| ) / (_|_(_| ) )_|/_) London. SW7 2BZ. England.
Re: Palette utility obscurity
Author: TMOTA
Date: Fri, 09 Oct 1992 00:37
Date: Fri, 09 Oct 1992 00:37
30 lines
1649 bytes
1649 bytes
ericl@cs.kuleuven.ac.be (Eric Lafortune) writes:
>On page 1257 in the PRM we can read about the Message_PaletteChange :
[...]
>Does this mean that when a Wimp program changes a colour in a 16 colour
>mode using "VDU 19, <colour number>, 16, <red>, <green>, <blue>", the
>palette utility automatically issues a redraw of the screen ???
NO. You should only use the WIMP calls to set the palette when running
on the desktop, I think... I don't think the WIMP traps VDU 19's...
[...]
[...make a red sprite ...]
[...change palette for red colour...]
>Your red sprite will change into a white one. As you can see there has
>been *no* redraw. To be sure of that last fact we will issue a
>broadcast message ourselves by :
If you use Wimp colour-setting calls, this shouldn't be a problem.
If not:
* If you call ColourTrans_InvalidateCache any subsequent redraws should
do their best to get the colour right given the new palette.
* Issue your own redraw broadcast
--
_________________ "I'd like to answer this question in two ways:
/____ _ _/_ __ First in my normal voice, and then
// / //_//_ /_/ in a silly, high-pitched whine." (Monty Python)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads