Esempio n. 1
0
        public Anim Copy()
        {
            Anim animReturn = null;

            try {
                animReturn                   = new Anim();
                animReturn.bmpLoaded         = (Bitmap)bmpLoaded.Clone();
                animReturn.gunit             = gunit;
                animReturn.rectNowF          = new RectangleF(rectNowF.Left, rectNowF.Top, rectNowF.Width, rectNowF.Height);
                animReturn.rectNow           = new Rectangle(rectNow.Left, rectNow.Top, rectNow.Width, rectNow.Height);
                animReturn.lFramesCached     = lFramesCached;
                animReturn.sPathFileBaseName = sPathFileBaseName;
                animReturn.sFileExt          = sFileExt;
                //animReturn.sPathFile=sPathFile;
                animReturn.bFileSequence = bFileSequence;              //if use sPathFileBaseName+digits+"."+sExt, and sPathFile is first frame
                animReturn.iSeqDigitsMin = iSeqDigitsMin;              //, 0 if variable (i.exn. frame1.png...frame10.png)
                animReturn.lFrameNow     = lFrameNow;
                animReturn.lFrames       = lFrames;
                animReturn.iEffects      = iEffects;
                animReturn.imageOrig     = imageOrig;
                animReturn.iMaxEffects   = iMaxEffects;
                animReturn.lFramesCached = lFramesCached;
                if (lFramesCached == lFrames)
                {
                    animReturn.gbarrAnim = new GBuffer[lFramesCached];
                    for (long lNow = 0; lNow < lFrames; lNow++)
                    {
                        if (gbarrAnim[lNow] != null)
                        {
                            animReturn.gbarrAnim[lNow] = gbarrAnim[lNow].Copy();
                        }
                        else
                        {
                            RReporting.ShowErr("Trying to copy null frame!", "Anim Copy");
                        }
                    }
                }
                else
                {
                    RReporting.ShowError("Uncached anim not yet implemented", "anim Copy");
                }
                animReturn.gbFrame = animReturn.gbarrAnim[lFrameNow];
                if (iEffects > 0)
                {
                    animReturn.effectarr = new Effect[iEffects];
                    for (int i = 0; i < iEffects; i++)
                    {
                        animReturn.effectarr[i] = effectarr[i].Copy();
                    }
                }
            }
            catch (Exception exn) {
                RReporting.ShowExn(exn, "anim Copy");
            }
            return(animReturn);
        }
Esempio n. 2
0
        }        //end CopyAsGray

        public bool SaveSeq(string sSetFileBase, string sSetFileExt)
        {
            bool bGood = true;

            //try { //first write debug file
            sFileExt          = sSetFileExt;
            sPathFileBaseName = sSetFileBase;
            //	RString.StringToFile(sSetFileBase+".txt", RString.ToString(true)); }
            //catch (Exception exn) {
            //	RReporting.ShowExn(exn,anim SaveSeq","saving dump"); }
            try {
                for (long lFrameSave = 0; lFrameSave < lFrames; lFrameSave++)
                {
                    if (!SaveSeqFrame(lFrameSave))
                    {
                        bGood = false;
                        RReporting.ShowError("Couldn't Save " + PathFileOfSeqFrame(sSetFileBase, sSetFileExt, lFrameNow, iSeqDigitsMin), "SaveSeq");
                    }
                }
            } catch (Exception exn) { RReporting.ShowExn(exn, "SaveSeq"); }
            return(bGood);
        }        //SaveSeq