Mildred a shark
Professional

MCookiePtr is a useful function in its own right but has been included in the c2p section of the manual because it is of particular use for providing the `Chunky' parameter of Mc2p. Using MCookiePtr you can return an address that has been calculated based on the cookie of one of Mildred's Shape objects.

At its simplest, the routine will take the base address of the Shape's cookie data. It will check if `wrapping' is active (see the relevent section of the manual) and if so will add the Shape's Handle coordinate position to the base address. Then it will check if `clipping' is active (see the relevent section of the manual), and if so it will add the Shape's clip window top-left corner coordinate position to the base address. This final address will then be returned and can be used mainly as the Chunky.l address required by Mc2p.

In its more sophisticated form, the routine can also take additional Xoffset and Yoffset coordinates, produce an address offset from them and add this also to the base address. Using this on its own you can position the topleft corner of the chunky source data. MCookiePtr allows you to view a usually unviewable Shape's cookie.

If you do not specify a chunky Shape object to use, the routine will assume the currently used Shape object and base its calculations on that Shape's cookie instead.

Possible syntax:
MCookiePtr ( ShapeNum.w)


MCookiePtr ( Xoffset.w, Yoffset.w )

MCookiePtr ( Xoffset.w, Yoffset.w, ShapeNum.w )

Returns:
ChunkyAddress.l


ShapeNum.w
---- This is the number of a previously created chunky Shape object. This should be numbered from 0 to the total number of objects minus 1. Calculations will be based on the base address of this Shape's cookie data. If this parameter is omitted, the currently used Shape will be assumed. The shape must have a cookie!

Xoffset.w ---- Xoffset is a horizontal coordinate offset to be added to the position of the source data once other calculations have been completed. If omitted, the offset simply won't be added.

Yoffset.w ---- Yoffset is a verticle coordinate offset to be added to the position of the source data once other calculations have been completed. If omitted, the offset simply won't be added.


ChunkyAddress.l ---- MCookiePtr is a function and will return a longword address representing the location of some chunky-graphics data in memory.

a shark