コード例 #1
0
ファイル: MapTile.cs プロジェクト: Hengle/GameEditor
    public void parseTile()
    {
        if (mParsed)
        {
            return;
        }
        Serializer serializer = new Serializer(mTileBuffer);

        serializer.read(ref mBngImgIdx);
        serializer.read(ref mMidImgIdx);
        serializer.read(ref mObjImgIdx);
        serializer.read(ref mDoorIdx);
        serializer.read(ref mDoorOffset);
        serializer.read(ref mAniFrame);
        serializer.read(ref mAniTick);
        serializer.read(ref mObjFileIdx);
        serializer.read(ref mLight);

        mHasBng = BinaryUtility.getHightestBit(mBngImgIdx) == 1;
        BinaryUtility.setHighestBit(ref mBngImgIdx, 0);
        mHasMid = BinaryUtility.getHightestBit(mMidImgIdx) == 1;
        BinaryUtility.setHighestBit(ref mMidImgIdx, 0);
        mHasObj = BinaryUtility.getHightestBit(mObjImgIdx) == 1;
        BinaryUtility.setHighestBit(ref mObjImgIdx, 0);
        mCanWalk  = (!mHasBng && !mHasObj && mObjImgIdx > 0);
        mCanFly   = !mHasObj;
        mDoorOpen = BinaryUtility.getHightestBit(mDoorOffset) == 1;
        mHasDoor  = BinaryUtility.getHightestBit(mDoorIdx) == 1;
        mHasAni   = BinaryUtility.getHightestBit(mAniFrame) == 1;
        BinaryUtility.setHighestBit(ref mAniFrame, 0);
    }