MM Developer's Guide
MM Interfaces | MM Methods | MM Types and Misc API


IMoaMmGC2



Interface ID: IID_IMoaMmGC2
Pointer type: PIMoaMmGC2
Inheritance: IMoaUnknown
Header file: mmiservc.h

Constants and Structures

typedef MoaUlong	MoaMmXSpriteCapsFlags;

#define kMoaMmXSpriteCapsFlags_None                0
#define kMoaMmXSpriteCapsFlags_IsStatic            1     /* sprite doesn't want CollectChgs() calls, use InvalSpriteRect() to request update */
#define kMoaMmXSpriteCapsFlags_AutoTabEnabled      2     /* app handles tab key */
#define kMoaMmXSpriteCapsFlags_SupportsRotation    0x04
#define kMoaMmXSpriteCapsFlags_SupportsSkew        0x08
#define kMoaMmXSpriteCapsFlags_SupportsFlipH       0x10
#define kMoaMmXSpriteCapsFlags_SupportsFlipV       0x20
#define kMoaMmXSpriteCapsFlags_SupportsQuad        0x40
#define kMoaMmXSpriteCapsFlags_SupportsAutoBounds  0x80

When a sprite gets rotated or skewed, its bounding rectangle normally changes to reflect the new maximum X and Y extents of the image on the stage. Setting SupportsAutoBounds tells Director that your Xtra is ready for Director to change its bounding box as the sprite is rotated or skewed. If you do not set this constant, Director will not adjust the bounding rectangle with the result that the sprite is cropped to the area of the original rectangle.

typedef MoaLong MoaMmBlitState;

/* This is set if the author wants Director to use the quad 
/  parameter in the MoaMmBlitParams structure to do the Blit.  If
/  it's not set, the DstRect parameter to the function will be used.
/  Rotation/skew/flipH/flipV are OUTPUT values only, there are 
/  ignored for the Blit2 call. */

#define kMoaMmBlit_UseQuadForBlit  1

typedef struct
{
     MoaFloat             rotation;
     MoaFloat             skew;
     MoaBool              flipH;
     MoaBool              flipV;
     MoaFloat             quad[4][2];
     MoaMmBlitState       flags;

} MoaMmBlitParams;
typedef MoaMmBlitParams FAR * PMoaMmBlitParams;
typedef const MoaMmBlitParams FAR * ConstPMoaMmBlitParams;

typedef struct
{
     MoaRect                         spriteRect;    /* rect on stage where sprite appears */
     MoaMmXSpriteImageMode           imageMode;     /* imaged direct or to an offscreen buffer */
     MoaMmXSpriteFlags               flags;         /* sprite FX flags (see above) */
     MoaMmInk                        ink;           /* sprite ink mode */
     MoaMmInkParams                  inkParams;     /* extra params for some inks */
     MoaMmBlitParams                 blitParams;    /* extra params for Director blit functionality */
     MoaLong                         aux;           /* reserved */
} MoaMmXSpriteInfo;
typedef MoaMmXSpriteInfo FAR *       PMoaMmXSpriteInfo;
typedef const MoaMmXSpriteInfo FAR * ConstPMoaMmXSpriteInfo;

Description

The IMoaMmGC2 interface allows access to alpha channel support and rotation/skew/quad support.

Methods

Blit2()

Blit2()

Syntax

Blit2(PIMoaMmGC2 This,
ConstPMoaRect pDestRect,
struct IMoaMmGC FAR * pSrcGC,
ConstPMoaRect pSrcRect,
MoaMmInk ink,
ConstPMoaMmInkParams pInkParams,
ConstPMoaMmBlitParams pBlitParams,
struct IMoaMmGC FAR * pAlphaGC,
PMoaVoid nativeClipRegion)

Parameters

This
Pointer to the IMoaMmGC2 interface

pDestRect
ConstPMoaRect  Represents the area to which to copy

pSrcGC
struct IMoaMmGC FAR *  

pSrcRect
ConstPMoaRect  

ink
MoaMmInk  

pInkParams
ConstPMoaMmInkParams  Optional ConstPMoaMmInkParams specifying ink parameters

pBlitParams
ConstPMoaMmBlitParams  A pointer to a MoaMmBlitParam structure that contains relevant information on how to perform the blitting. The rotation/skew/flipH/flipV are output values only. Director passes these out to the Xtra during the image call so that the Xtra can use the values to image. It also passes out a quad parameter, which is the 4 point quad to use to distort the source image. This can be an input parameter for the Blit2() call, depending on the flags setting. If flags has the blit flag kMoaMmBlit_UseQuadForBlit set, the Blit2() call will use the quad. Otherwise, it will use the DstRect value.

pAlphaGC
struct IMoaMmGC FAR *  A pointer to an IMoaMmGc interface. This GC should contain the alpha bitmap used for blitting. If there is no alpha bitmap, pass in NULL to the call. The alpha bitmap can be 1, 2, 4, 8, or 32 bits deep. For 8-bit, 0x00 is transparent and 0xFF is opaque with the intermediate values a linear range of transparency settings. The other low-bit bitmaps have the same behavior. The 32-bit bitmap has an alpha value for each color channel so you can perform different alpha on R, G, and B.

nativeClipRegion
PMoaVoid  Macintosh RgnHandle or Windows HRGN

Returns

MoaError

Description

Blit2() is a extension of the Blit() method in the IMoaMmGC interface.

If an Xtra is supposed to work in both Director 6 and later versions, it can check the kMoaMmXSpriteFlags_ExtendedInfo flag in the flags parameter of the MoaMmXSpriteInfo structure of the Image call. If this flag is set, the MoaMmXSpriteInfo has the MoaMmBlitParams parameter as part of its structure and you can reference this parameter. Also, you can use Blit2() safely if this flag is set.

The following flags control Director's behavior with imaging an Xtra. These flags should be set appropriately if the Xtra supports the advanced imaging features of Director. If the Xtra has been upgraded to use Blit2(), all the following flags can be set. If the Xtra supports only a subset (Flash asset, for example), set the appropriate flags and Director will not allow some features (like quadding). AutoBounds means that the Xtra wants its bounds to grow as it is rotated or quadded. Turning this off allows the Xtra to image into its fixed rectangle, like a portal view.
#define kMoaMmXSpriteCapsFlags_SupportsRotation   0x04
#define kMoaMmXSpriteCapsFlags_SupportsSkew       0x08
#define kMoaMmXSpriteCapsFlags_SupportsFlipH      0x10
#define kMoaMmXSpriteCapsFlags_SupportsFlipV      0x20
#define kMoaMmXSpriteCapsFlags_SupportsQuad       0x40
#define kMoaMmXSpriteCapsFlags_SupportsAutoBounds 0x80

Copyright © 1995-2007 Adobe Macromedia Software LLC, Inc.