Ejemplo n.º 1
0
        /// <summary>
        /// modelのパターン(x,y)をbufferに描画する
        /// </summary>
        /// <param name="model">レイヤーモデル</param>
        /// <param name="buffer">描画対象バッファ</param>
        /// <param name="xPos">水平位置</param>
        /// <param name="yPos">垂直位置</param>
        public static void Draw(CharaChipRenderData model, ImageBuffer buffer, int xPos, int yPos)
        {
            if ((xPos < 0) || (xPos > 2) || (yPos < 0) || (yPos > 3))
            {
                return;
            }

            buffer.Clear();

            if ((model == null) || (model.LayerCount == 0))
            {
                return;
            }

            for (int i = model.LayerCount - 1; i >= 0; i--)
            {
                RenderLayer layer = model.GetLayer(i);
                if (layer.Image == null)
                {
                    continue;
                }

                // レイヤーを描画する。
                DrawLayer(buffer, xPos, yPos, layer);
            }
        }