示例#1
0
 private void reloadLevelLayerData()
 {
     curActiveLayout   = cbLayoutNo.SelectedIndex;
     curVideoNo        = cbVideoNo.SelectedIndex;
     curBigBlockNo     = cbBigBlockNo.SelectedIndex;
     curBlockNo        = cbBlockNo.SelectedIndex;
     curPaletteNo      = cbPaletteNo.SelectedIndex;
     curLevelLayerData = ConfigScript.getLayout(curActiveLayout);
 }
示例#2
0
        public static bool setLayoutLinear(LevelLayerData curActiveLayerData, int curActiveLayout)
        {
            int layerAddr, scrollAddr, width, height;

            layerAddr  = ConfigScript.getLayoutAddr(curActiveLayout);
            scrollAddr = ConfigScript.getScrollAddr(curActiveLayout); //darkwing duck specific
            width      = curActiveLayerData.width;
            height     = curActiveLayerData.height;
            for (int i = 0; i < width * height; i++)
            {
                Globals.romdata[layerAddr + i] = (byte)curActiveLayerData.layer[i];
            }
            if (curActiveLayerData.scroll != null)
            {
                for (int i = 0; i < width * height; i++)
                {
                    Globals.romdata[scrollAddr + i] = (byte)curActiveLayerData.scroll[i];
                }
            }
            return(true);
        }
示例#3
0
 public static bool setLayout(LevelLayerData layerData, int levelNo)
 {
     return((setLayoutFunc ?? ((_, __) => true))(layerData, levelNo));
 }
示例#4
0
 private void reloadLevelLayer()
 {
     int layoutAddr = ConfigScript.getLayoutAddr(curActiveLayout);
     int scrollAddr = ConfigScript.getScrollAddr(curActiveLayout); //darkwing duck specific
     int width = curWidth;
     int height = curHeight;
     byte[] layer = new byte[width * height];
     byte[] scroll = new byte[width * height];
     for (int i = 0; i < width * height; i++)
     {
         scroll[i] = Globals.romdata[scrollAddr + i];
         layer[i] = Globals.romdata[layoutAddr + i];
     }
     curLevelLayerData = new LevelLayerData(width, height, layer, scroll, null);
     curActiveBlock = 0;
     pbMap.Invalidate();
 }
示例#5
0
        private void reloadLevelLayerData(bool resetScreenPos)
        {
            curWidth = Globals.getLevelWidth(curActiveLayout);
            curHeight = Globals.getLevelHeight(curActiveLayout);
            curActiveLayout = cbLayoutNo.SelectedIndex;
            curVideoNo = cbVideoNo.SelectedIndex + 0x90;
            curBigBlockNo = cbBigBlockNo.SelectedIndex;
            curBlockNo = cbBlockNo.SelectedIndex;
            curPaletteNo = cbPaletteNo.SelectedIndex;
            curActiveScreen = cbScreenNo.SelectedIndex;
            curLevelLayerData = (ConfigScript.getLayoutFunc != null) ? ConfigScript.getLayout(curActiveLayout) : Utils.getLayoutLinear(curActiveLayout);

            if (resetScreenPos)
            {
                cbScreenNo.Items.Clear();
                for (int i = 0; i < curLevelLayerData.width * curLevelLayerData.height; i++)
                    cbScreenNo.Items.Add(String.Format("{0:X}", i));
                cbScreenNo.SelectedIndex = findStartPosition();
            }
        }
示例#6
0
 private static bool getUpsort(LevelLayerData curLevelLayerData, int curIndex)
 {
     int curScroll = curLevelLayerData.scroll[curIndex] >> 5;
     bool upsort = curScroll == 0;
     return upsort;
 }
示例#7
0
 private static bool getBacksort(LevelLayerData curLevelLayerData, int curIndex)
 {
     //int curScroll = curLevelLayerData.scroll[curIndex] >> 5;
     int height = curIndex / curLevelLayerData.width;
     bool backSort = curLevelLayerData.dirs[height] != 0;
     return backSort;
 }