NScumm.Sky.Grid.LoadGrids C# (CSharp) Method

LoadGrids() public method

public LoadGrids ( ) : void
return void
        public void LoadGrids()
        {
            // no endian conversion necessary as I'm using uint8* instead of uint32*
            for (byte cnt = 0; cnt < TotNoGrids; cnt++)
            {
                _gameGrids[cnt] = _skyDisk.LoadFile(GridFileStart + cnt);
            }
            if (!SkyEngine.IsDemo)
            {
                // single disk demos never get that far
                // Reloading the grids can sometimes cause problems eg when reichs door is
                // open the door grid bit gets replaced so you can't get back in (or out)
                if (_skyLogic.ScriptVariables[Logic.REICH_DOOR_FLAG] != 0)
                    RemoveGrid(256, 280, 1, _skyCompact.FetchCpt((ushort)CptIds.ReichDoor20));
                //removeGrid(256, 280, 1, &SkyCompact::reich_door_20);
            }
        }

Usage Example

Esempio n. 1
0
        private bool FnEnterSection(uint sectionNo, uint b, uint c)
        {
            if (SkyEngine.IsDemo && (sectionNo > 2))
            {
                Control.ShowGameQuitMsg();
            }

            _scriptVariables[CUR_SECTION]    = sectionNo;
            SystemVars.Instance.CurrentMusic = 0;

            if (sectionNo == 5) //linc section - has different mouse icons
            {
                _skyMouse.ReplaceMouseCursors(60302);
            }

            if ((sectionNo != _currentSection) || SystemVars.Instance.SystemFlags.HasFlag(SystemFlags.GameRestored))
            {
                _currentSection = sectionNo;

                sectionNo++;
                _skyMusic.LoadSection((byte)sectionNo);
                _skySound.LoadSection((byte)sectionNo);
                _skyGrid.LoadGrids();
                SystemVars.Instance.SystemFlags &= ~SystemFlags.GameRestored;
            }

            return(true);
        }