NScumm.Sword1.ResMan.Flush C# (CSharp) Метод

Flush() публичный Метод

public Flush ( ) : void
Результат void
        public void Flush()
        {
            for (uint clusCnt = 0; clusCnt < _prj.noClu; clusCnt++)
            {
                Clu cluster = _prj.clu[clusCnt];
                for (uint grpCnt = 0; grpCnt < cluster.noGrp; grpCnt++)
                {
                    Grp group = cluster.grp[grpCnt];
                    for (uint resCnt = 0; resCnt < group.noRes; resCnt++)
                        if (group.resHandle[resCnt].cond != MemMan.MEM_FREED)
                        {
                            _memMan.SetCondition(group.resHandle[resCnt], MemMan.MEM_CAN_FREE);
                            group.resHandle[resCnt].refCount = 0;
                        }
                }
                if (cluster.file != null)
                {
                    cluster.file.Dispose();
                    cluster.file = null;
                    cluster.refCount = 0;
                }
            }
            _openClus = 0;
            _openCluStart = _openCluEnd = null;
            // the memory manager cached the blocks we asked it to free, so explicitly make it free them
            _memMan.Flush();
        }
    }

Usage Example

Пример #1
0
        private void Reinitialize()
        {
            _sound.QuitScreen();
            _resMan.Flush();         // free everything that's currently alloced and opened. (*evil*)

            _logic.Initialize();     // now reinitialize these objects as they (may) have locked
            _objectMan.Initialize(); // resources which have just been wiped.
            _mouse.Initialize();
            // TODO: _system.WwarpMouse(320, 240);
            SystemVars.WantFade = true;
        }