private void reloadLevelLayerData() { curActiveLayout = cbLayoutNo.SelectedIndex; curVideoNo = cbVideoNo.SelectedIndex; curBigBlockNo = cbBigBlockNo.SelectedIndex; curBlockNo = cbBlockNo.SelectedIndex; curPaletteNo = cbPaletteNo.SelectedIndex; curLevelLayerData = ConfigScript.getLayout(curActiveLayout); }
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); }
public static bool setLayout(LevelLayerData layerData, int levelNo) { return((setLayoutFunc ?? ((_, __) => true))(layerData, levelNo)); }
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(); }
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(); } }
private static bool getUpsort(LevelLayerData curLevelLayerData, int curIndex) { int curScroll = curLevelLayerData.scroll[curIndex] >> 5; bool upsort = curScroll == 0; return upsort; }
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; }