Clippings/CreateKeyFrameSample.txt

    //////////
    //
    // create a key frame sample containing the sprites and all of their shared images
    //
    //////////
 
 
    // create a new, empty key frame sample
    myErr = QTNewAtomContainer(&mySample);
    if (myErr != noErr)
        goto bail;
 
    // specify transparency color for recompression
    myKeyColor.red = myKeyColor.green = myKeyColor.blue = 0xffff;       // white
 
    // add images to the key frame sample - AddPICTImageToKeyFrameSample
    // will add the following atom data to the key frame atom container:
    //
    // kSpriteShareDataAtomType
    // kSpriteImagesContainerAtomType
    // kSpriteImageAtomType
    // kSpriteImageDataAtomType
    //
    // and optionally:
    //
    // kSpriteImageRegistrationAtomType
    // kSpriteImageNameAtomType
    
    AddPICTImageToKeyFrameSample(mySample, kIconPictID, &myKeyColor, kIconImageIndex, NULL, NULL);
    AddPICTImageToKeyFrameSample(mySample, kWorldPictID, &myKeyColor, kWorldImageIndex, NULL, NULL);
    AddPICTImageToKeyFrameSample(mySample, kBackgroundPictID, &myKeyColor, kBackgroundImageIndex, NULL, NULL);
    for (myIndex = 1; myIndex <= kNumSpaceShipImages; myIndex++)
        AddPICTImageToKeyFrameSample(mySample, kFirstSpaceShipPictID + myIndex - 1, &myKeyColor, myIndex + 3, NULL, NULL);