private void MainForm_Load(object sender, EventArgs e) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); Direct3D d3d = new Direct3D(); d3ddevice = new Device(d3d, 0, DeviceType.Hardware, panel1.Handle, CreateFlags.HardwareVertexProcessing, new PresentParameters { Windowed = true, SwapEffect = SwapEffect.Discard, EnableAutoDepthStencil = true, AutoDepthStencilFormat = Format.D24X8 }); EditorOptions.Initialize(d3ddevice); EditorOptions.OverrideLighting = true; EditorOptions.RenderDrawDistance = 10000; optionsEditor = new EditorOptionsEditor(cam); optionsEditor.FormUpdated += optionsEditor_FormUpdated; optionsEditor.CustomizeKeybindsCommand += CustomizeControls; optionsEditor.ResetDefaultKeybindsCommand += () => { actionList.ActionKeyMappings.Clear(); foreach (ActionKeyMapping keymapping in DefaultActionList.DefaultActionMapping) { actionList.ActionKeyMappings.Add(keymapping); } actionInputCollector.SetActions(actionList.ActionKeyMappings.ToArray()); }; actionList = ActionMappingList.Load(Path.Combine(Application.StartupPath, "keybinds.ini"), DefaultActionList.DefaultActionMapping); actionInputCollector = new ActionInputCollector(); actionInputCollector.SetActions(actionList.ActionKeyMappings.ToArray()); actionInputCollector.OnActionStart += ActionInputCollector_OnActionStart; actionInputCollector.OnActionRelease += ActionInputCollector_OnActionRelease; cammodel = new ModelFile(Properties.Resources.camera).Model; cammodel.Attach.ProcessVertexData(); cammesh = cammodel.Attach.CreateD3DMesh(); if (Program.Arguments.Length > 0) { LoadFile(Program.Arguments[0]); } }
private void MainForm_Load(object sender, EventArgs e) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); d3ddevice = new Device(new SharpDX.Direct3D9.Direct3D(), 0, DeviceType.Hardware, panel1.Handle, CreateFlags.HardwareVertexProcessing, new PresentParameters[] { new PresentParameters() { Windowed = true, SwapEffect = SwapEffect.Discard, EnableAutoDepthStencil = true, AutoDepthStencilFormat = Format.D24X8 } }); EditorOptions.Initialize(d3ddevice); Gizmo.InitGizmo(d3ddevice); if (Program.Arguments.Length > 0) { LoadFile(Program.Arguments[0]); } LevelData.StateChanged += LevelData_StateChanged; panel1.MouseWheel += panel1_MouseWheel; }
private void MainForm_Load(object sender, EventArgs e) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); d3ddevice = new Device(0, DeviceType.Hardware, panel1, CreateFlags.HardwareVertexProcessing, new PresentParameters { Windowed = true, SwapEffect = SwapEffect.Discard, EnableAutoDepthStencil = true, AutoDepthStencilFormat = DepthFormat.D24X8 }); d3ddevice.DeviceResizing += d3ddevice_DeviceResizing; EditorOptions.Initialize(d3ddevice); if (Program.Arguments.Length > 0) { LoadFile(Program.Arguments[0]); } }
private void MainForm_Load(object sender, EventArgs e) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); Direct3D d3d = new Direct3D(); d3ddevice = new Device(d3d, 0, DeviceType.Hardware, panel1.Handle, CreateFlags.HardwareVertexProcessing, new PresentParameters { Windowed = true, SwapEffect = SwapEffect.Discard, EnableAutoDepthStencil = true, AutoDepthStencilFormat = Format.D24X8 }); settingsfile = SettingsFile.Load(); EditorOptions.Initialize(d3ddevice); EditorOptions.OverrideLighting = true; EditorOptions.RenderDrawDistance = cam.DrawDistance = settingsfile.SA2EventViewer.DrawDistance_General; cam.ModifierKey = settingsfile.SA2EventViewer.CameraModifier; actionList = ActionMappingList.Load(Path.Combine(Application.StartupPath, "keybinds", "SA2EventViewer.ini"), DefaultActionList.DefaultActionMapping); actionInputCollector = new ActionInputCollector(); actionInputCollector.SetActions(actionList.ActionKeyMappings.ToArray()); actionInputCollector.OnActionStart += ActionInputCollector_OnActionStart; actionInputCollector.OnActionRelease += ActionInputCollector_OnActionRelease; optionsEditor = new EditorOptionsEditor(cam, actionList.ActionKeyMappings.ToArray(), DefaultActionList.DefaultActionMapping, false, false); optionsEditor.FormUpdated += optionsEditor_FormUpdated; optionsEditor.FormUpdatedKeys += optionsEditor_FormUpdatedKeys; cammodel = new ModelFile(Properties.Resources.camera).Model; cammodel.Attach.ProcessVertexData(); cammesh = cammodel.Attach.CreateD3DMesh(); if (Program.Arguments.Length > 0) { LoadFile(Program.Arguments[0]); } }
private void d3ddevice_DeviceResizing(object sender, CancelEventArgs e) { EditorOptions.Initialize(d3ddevice); }
void d3ddevice_DeviceResizing(object sender, System.ComponentModel.CancelEventArgs e) { // HACK: Not so sure we should have to re-initialize this every time... EditorOptions.Initialize(d3ddevice); }