| C T L _ S W A P C O N L O G O ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - CTL_#?
----------------------------------------------------------------------------
NAME
ctl_swapconlogo() - Swaps logo on the current handle.
SYNOPSIS
size = ctl_swapconlogo(ptr, bm, x, y);
ULONG ctl_swapconlogo(void *,
struct BitMap *, UWORD, UWORD);
FUNCTION
This function allows to swap logo(BitMap) that was added
by the 'ctl_addconlogo()' and also change its position on
the screen.
INPUTS
ptr - Logo handle as obtained with 'ctl_addconlogo()'.
bm - Standard BitMap structure.
x - Start point in X axis('bm' must be not NULL).
y - Start point in Y axis('bm' must be not NULL).
RETURNS
Outputs size of the area logo can be put to. The first 16
bits is X and the second 16 bits is Y. This allows to use
bitmaps that will be prepared during runtime and to cover
whole available area if needed.
BASES
SysBase, DOSBase, GfxBase, IntuitionBase
NOTES
Swapping logo does not imply changing the effective area!
For example, if primary logo is 40x40 and the logo to be
put in place is 40x50 then it will be trimmed to 40!
Starting points will be checked against the boundaries so
you do not need to worry about that.
If you want to animate and move that animation across the
screen call 'WaitTOF()' after every rendered frame!
Never freeze a task that executes this code or your Miggy
will hang! This is due to 'Forbid()'/'Permit()' pair that
is a must if older(V39 and below) 'console.device'...
Note however that 'nfo_ktm()' allows to freeze such tasks
without probs as it takes care of race conditions!
SEE ALSO
ctl_addconlogo(), ctl_remconlogo()
EXAMPLE
...
void *logo;
ULONG size;
UWORD x;
UWORD y;
/*
* Obtaining total available logo space.
*/
size = ctl_swapconlogo(logo, NULL, 0, 0);
x = (size >> 16);
y = (size & 0xFFFF);
BUGS
Although this bug was worked-around i decided to leave
its description. Read on!
It looks like 'XorRectRegion()' function does some wrong
ops... If one rectangle is to intersect another with the
shift in Y axis to the very top assuming previous and
current coords,
+------+ +- - - +
+------+ +- - - +
| | | | | |
| | ---> | X-OR | --->
| | +------+ +------+
+------+ +- - - + +------+ <--- Not reflected!
then the area left is not reflected in 'RectangleRegion'
but everything seems to work when the shift occurrs to
the bottom!
----------------------------------------------------------------------------
| |
| |