public void SaveSettings(FileParser.Block block) { block.SetBool("Use Custom Address", useCustomAddress); if (useCustomAddress) { block.SetInt("Custom Address", segmentOffset); } block.SetIntArray("ROM Pointers", pointerControl1.GetROMPointers()); block.SetIntArray("RAM Pointers", pointerControl1.GetRAMPointers()); SpecialPointer[] specialPointers = specialPointerControl1.GetPointers(); StringBuilder b = new StringBuilder(); foreach (SpecialPointer p in specialPointers) { b.Append(p.ToString() + "; "); } if (b.Length > 0) { block.SetString("Special Pointers", b.ToString()); } block.SetString("Obj File", sourceFileName); block.SetInt("Type Style", cmbTypeStyle.SelectedIndex, false); foreach (Control control in panelCollisionTypes.Controls) { CollisionTypeControl c = control as CollisionTypeControl; if (c != null) { block.SetInt(c.patch.name, c.patch.type); block.SetBool(c.patch.name + " enabled", c.enableImport); } } if (collision.specialBoxes != null) { int num = collision.specialBoxes.boxes.Count; int[] type = new int[num], x1 = new int[num], x2 = new int[num], z1 = new int[num], z2 = new int[num], y = new int[num]; int i = 0; foreach (SpecialCollisionBox box in collision.specialBoxes.boxes) { type[i] = box.type; x1[i] = box.x1; x2[i] = box.x2; z1[i] = box.z1; z2[i] = box.z2; y[i] = box.y; i++; } block.SetIntArray("Special Boxes", type, true); block.SetIntArray("Special Boxes X1", x1, false); block.SetIntArray("Special Boxes X2", x2, false); block.SetIntArray("Special Boxes Z1", z1, false); block.SetIntArray("Special Boxes Z2", z2, false); block.SetIntArray("Special Boxes Height", y, false); } }
public void SaveSettings(FileParser.Block block) { foreach (KeyValuePair <string, TextureImage> texture in textures) { block.SetString("Texture " + texture.Key, texture.Value.format.ToString() + ", " + texture.Value.bpp.ToString()); } }
public void SaveSettings(FileParser.Block block) { block.SetString("ROM", EmulationState.instance.ROMName); block.SetIntArray("Run level scripts", runLevelScripts.ToArray()); block.SetInt("Base Offset", segmentedAddress); block.SetInt("Import Scale", (int)Settings.importScale); block.SetBlock("Globals", new FileParser.Block(globalsControl)); block.SetBlock("Textures", new FileParser.Block(textureLibrary)); //Write Display List data block.SetInt("NumDisplayLists", displayLists.Count, false); int i = 0; foreach (ReadWrite dl in displayLists) { block.SetBlock("DisplayList" + i++, new FileParser.Block(dl)); } //Write Collision Map data block.SetInt("NumCollisionMaps", collisionMaps.Count, false); i = 0; foreach (ReadWrite dl in collisionMaps) { block.SetBlock("CollisionMap" + i++, new FileParser.Block(dl)); } }
public void SaveSettings(FileParser.Block block) { block.SetBool("Use Custom Address", useCustomAddress); if (useCustomAddress) { block.SetInt("Custom Address", segmentOffset); } block.SetIntArray("ROM Pointers", pointerControl.GetROMPointers()); block.SetIntArray("RAM Pointers", pointerControl.GetRAMPointers()); block.SetInt("Layer", (int)numLayer.Value); for (int i = 0; i < paramControls.Length; i++) { block.SetInt(paramControls[i].ParameterName, (int)paramControls[i].cmbType.SelectedIndex); if (paramControls[i].cmbType.SelectedIndex == paramControls[i].cmbType.Items.Count - 1) { block.SetInt("Custom " + paramControls[i].ParameterName, paramControls[i].customValue); } } block.SetString("Obj File", sourceFileName); block.SetInt("Color Interpretation", (int)conversionSettings.colorInterpretation); if (displayList != null) { block.SetInt("Cycle Type", (int)displayList.renderstates.cycleType, false); block.SetInt("Blend modes", displayList.renderstates.blendMode); block.SetInt("Render states", displayList.renderstates.otherModesLow); block.SetInt("RCP Set", displayList.renderstates.RCPSet); block.SetInt("RCP Unset", displayList.renderstates.RCPUnset); block.SetInt("Combiner Low", (int)(displayList.renderstates.combiner.state & 0xFFFFFFFF)); block.SetInt("Combiner High", (int)((displayList.renderstates.combiner.state >> 0x20) & 0xFFFFFF)); block.SetDouble("Texture Scale X", displayList.renderstates.textureScaleX); block.SetDouble("Texture Scale Y", displayList.renderstates.textureScaleY); } if (this.textureControl.materialLibrary != null) { foreach (KeyValuePair <string, TextureInfo> tex in this.textureControl.materialLibrary) { if (tex.Value.addressX != TextureInfo.AddressMode.G_TX_WRAP || tex.Value.addressY != TextureInfo.AddressMode.G_TX_WRAP || tex.Value.stRAMPointers.Length + tex.Value.stROMPointers.Length > 0) { block.SetBlock(tex.Key, new FileParser.Block(tex.Value)); } } } }