Examples of AnimBlock


Examples of _api.alienfactory.javamappy.AnimBlock

    log.info("Reading [" + aniBlockCount + "] AniBlock properties...");

    int offset1, offset2, noOfFrames, startFrame;
    int frames[];

    AnimBlock animBlocks[] = new AnimBlock[aniBlockCount];
    index = super.getChunkLength() - 16;
    aniBlockCount = 0;
    AnimBlock animBlock;
    StringBuffer sequence;
    while (super.getByte(index) != -1) {
      animBlock = new AnimBlock();

      animBlock.setType    (super.getByte(index+0));
      animBlock.setDelay    (super.getByte(index+1));
      animBlock.setDelayCountdown(super.getByte(index+2));
      animBlock.setUserData  (super.getByte(index+3));

      offset1         = getInt(index + 8);
      offset2         = getInt(index + 12);
      noOfFrames         = (offset2 - offset1) / intSize;
      frames           = new int[noOfFrames];
      startFrame         = (getInt(index + 4) - offset1) / intSize;
      animBlock.setFrames    (frames);
     
      // we can't set the current frame if it hasn't got any frames!
      if (noOfFrames > 0)
        animBlock.setCurrentFrameIndex(startFrame);
     
      // convert values between map types
      if (map.getMapHeader().getMapType() != 0)
        offset1 = (offset1 * 4) - super.getChunkLength();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.