Example #1
0
        public static DDPicture[,] GetAnimation(DDPicture parentPicture, int x, int y, int w, int h)
        {
            if (parentPicture.Get_W() % w != 0)
            {
                throw new DDError();
            }
            if (parentPicture.Get_H() % h != 0)
            {
                throw new DDError();
            }

            return(GetAnimation(parentPicture, x, y, w, h, parentPicture.Get_W() / w, parentPicture.Get_H() / h));
        }
Example #2
0
        public static void DrawBegin(DDPicture picture, double x, double y)
        {
            if (DB.Picture != null)
            {
                throw new DDError();
            }

            double w = picture.Get_W();
            double h = picture.Get_H();

            w /= 2.0;
            h /= 2.0;

            DB.Picture = picture;
            DB.X       = x;
            DB.Y       = y;
            DB.Layout  = new FreeInfo()
            {
                LTX = -w,
                LTY = -h,
                RTX = w,
                RTY = -h,
                RBX = w,
                RBY = h,
                LBX = -w,
                LBY = h,
            };
        }
Example #3
0
        public static IEnumerable <DDPicture> GetAnimation_YX(DDPicture parentPicture, int x, int y, int w, int h)
        {
            if (parentPicture.Get_W() % w != 0)
            {
                throw null;
            }
            if (parentPicture.Get_H() % h != 0)
            {
                throw null;
            }

            int xNum = parentPicture.Get_W() / w;
            int yNum = parentPicture.Get_H() / h;

            return(GetAnimation_YX(parentPicture, x, y, w, h, xNum, yNum));
        }
Example #4
0
        public static DDPicture[,] GetAnimation(DDPicture parentPicture, int x, int y, int w, int h)
        {
            if (parentPicture.Get_W() % w != 0)
            {
                throw null;
            }
            if (parentPicture.Get_H() % h != 0)
            {
                throw null;
            }

            int xNum = parentPicture.Get_W() / w;
            int yNum = parentPicture.Get_H() / h;

            return(GetAnimation(parentPicture, x, y, w, h, xNum, yNum));
        }
Example #5
0
        public static DDPicture GetPicture(DDPicture picture, int l, int t, int w, int h)
        {
            if (
                l < 0 || SCommon.IMAX < l ||
                t < 0 || SCommon.IMAX < t ||
                w < 1 || SCommon.IMAX - l < w ||
                h < 1 || SCommon.IMAX - t < h
                )
            {
                throw new DDError();
            }

            // ? 範囲外
            if (
                picture.Get_W() < l + w ||
                picture.Get_H() < t + h
                )
            {
                throw new DDError();
            }

            return(new DDPicture(
                       () =>
            {
                int handle = DX.DerivationGraph(l, t, w, h, picture.GetHandle());

                if (handle == -1)                         // ? 失敗
                {
                    throw new DDError();
                }

                return new DDPicture.PictureInfo()
                {
                    Handle = handle,
                    W = w,
                    H = h,
                };
            },
                       DDPictureLoaderUtils.ReleaseInfo,          // やる事同じなので共用しちゃう。
                       DDDerivationUtils.Add
                       ));
        }