Exemplo n.º 1
0
        public static PatternTable LoadNewTableForExpandedRom(bool linear, PatternTableType type, Level level)
        {
            PatternTable result = new PatternTable(linear);

            result.type = type;

            result.rom    = level.Rom;
            result.groups = null;

            result.BeginWrite();
            if (type == PatternTableType.sprite)
            {
                // These sprites should be loaded for every level's sprites
                result.loadExpandoGroup(ExpandoPatternOffsets.GlobalGameplaySprites);
                result.loadExpandoGroup(ExpandoPatternOffsets.DigitSprites);

                result.loadExpandoGroup(ExpandoPatternOffsets.GetSpriteEntry(level.Index));
            }
            else if (type == PatternTableType.background)
            {
                result.loadExpandoGroup(ExpandoPatternOffsets.GetBackgroundEntry(level.Index));
            }
            else
            {
                throw new ArgumentException("Invalid pattern table type specified.");
            }
            result.EndWrite();

            return(result);
        }
Exemplo n.º 2
0
        private void LoadGfxSlot(PatternTable gfx, int slot, int bank)
        {
            int offset = bank * chrBankSize + chrRomOffset;

            gfx.LoadTiles(rom.data, offset, slot * 0x40, 0x40);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets a linear pattern table that can be used for blitting to construct images using currentLevelIndex-specific graphics. The table is 1 graphic tile tall and 256 tiles wide.
 /// </summary>
 private void LoadPatterns()
 {
     patterns       = CreatePatternBitmap(true);
     spritePatterns = CreateSpritePatternBitmap(true);
 }
Exemplo n.º 4
0
		public void SetPatterns(PatternTable p) {
			patterns = p;
		}