From 7adc15d97e9aa8c0e073663104a4d219661c7377 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 15 Apr 2014 21:46:18 +0000 Subject: [PATCH] work on opengl display manager: optimized codepaths, user retroshader selection, support for importing a textureID from another core; add erase button to lua console; --- BizHawk.Client.Common/config/Config.cs | 5 + .../BizHawk.Client.EmuHawk.csproj | 7 +- .../DisplayManager/DisplayManager.cs | 391 +++++++++------ .../DisplayManager/FilterManager.cs | 447 +++++++++--------- .../DisplayManager/Filters/BaseFilter.cs | 120 +++++ .../DisplayManager/Filters/Gui.cs | 226 +++++++++ .../DisplayManager/Filters/Retro.cs | 274 +++++++++++ .../DisplayManager/Filters/Utils.cs | 90 ++++ .../DisplayManager/RenderTargetFrugalizer.cs | 3 +- .../DisplayManager/TextureFrugalizer.cs | 2 +- BizHawk.Client.EmuHawk/PresentationPanel.cs | 13 - .../Properties/Resources.Designer.cs | 361 +------------- .../Properties/Resources.resx | 249 +++++----- .../config/DisplayConfigLite.Designer.cs | 137 +++++- .../config/DisplayConfigLite.cs | 46 +- BizHawk.Client.EmuHawk/images/Erase.png | Bin 0 -> 612 bytes .../Lua/Libraries/EmuLuaLibrary.Input.cs | 4 +- .../tools/Lua/LuaConsole.Designer.cs | 126 +++-- .../tools/Lua/LuaConsole.cs | 6 + .../tools/Lua/LuaConsole.resx | 23 +- BizHawk.Common/Extensions/Extensions.cs | 10 + .../N64/NativeAPI/mupen64plusVideoApi.cs | 7 + .../BizHawk.Bizware.BizwareGL.OpenTK.csproj | 4 + .../IGL_TK.cs | 19 + .../RetroShader.cs | 2 + .../BizHawk.Bizware.BizwareGL/BitmapBuffer.cs | 2 + .../BizHawk.Bizware.BizwareGL.csproj | 6 + .../BizHawk.Bizware.BizwareGL/GuiRenderer.cs | 18 +- Bizware/BizHawk.Bizware.BizwareGL/IGL.cs | 11 + .../BizHawk.Bizware.BizwareGL/RenderTarget.cs | 6 + .../BizHawk.Bizware.BizwareGL/Texture2d.cs | 10 + .../BizHawk.Bizware.BizwareGL/VertexLayout.cs | 28 +- .../mupen64plus-video-glide64mk2.vcxproj | 3 +- .../src/Glide64/Main.cpp | 15 + output/Shaders/BizHawk/BizScanlines.glsl | 4 +- output/Shaders/BizHawk/bicubic-fast.cgp | 4 + 36 files changed, 1692 insertions(+), 987 deletions(-) create mode 100644 BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs create mode 100644 BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs create mode 100644 BizHawk.Client.EmuHawk/DisplayManager/Filters/Retro.cs create mode 100644 BizHawk.Client.EmuHawk/DisplayManager/Filters/Utils.cs create mode 100644 BizHawk.Client.EmuHawk/images/Erase.png create mode 100644 output/Shaders/BizHawk/bicubic-fast.cgp diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index fcb83f8dc6..2b0b8b70d5 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -60,6 +60,8 @@ namespace BizHawk.Client.Common public int TargetZoomFactor = 2; public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256 public int TargetDisplayFilter = 0; + public int DispFinalFilter = 0; + public string DispUserFilterPath; public RecentFiles RecentRoms = new RecentFiles(8); public bool PauseWhenMenuActivated = true; public bool SaveWindowPosition = true; @@ -161,7 +163,10 @@ namespace BizHawk.Client.Common public int DispAutoholdx = 0; public int DispAutoholdy = 0; public int DispAutoholdanchor = 1; + public bool DispBlurry = false; // make display look ugly + public bool DispFixAspectRatio = true; + public bool DispFixScaleInteger = false; // Sound options public bool SoundEnabled = true; diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index 59fb334d18..f207588c27 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -407,6 +407,10 @@ + + + + @@ -1353,8 +1357,6 @@ - - @@ -1454,6 +1456,7 @@ + diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 7cd86f86b8..86f556a050 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -1,4 +1,7 @@ -using System; +//TODO +//we could flag textures as 'actually' render targets (keep a reference to the render target?) which could allow us to convert between them more quickly in some cases + +using System; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -6,6 +9,7 @@ using System.Text; using System.Threading; using System.Collections.Generic; using System.Windows.Forms; +using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; @@ -13,6 +17,8 @@ using System.Drawing.Imaging; using BizHawk.Common; using BizHawk.Emulation.Common; using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk.FilterManager; +using BizHawk.Client.EmuHawk; using BizHawk.Bizware.BizwareGL; @@ -28,6 +34,15 @@ namespace BizHawk.Client.EmuHawk /// public class DisplayManager : IDisposable { + class DisplayManagerRenderTargetProvider : FilterManager.IRenderTargetProvider + { + DisplayManagerRenderTargetProvider(Func callback) { Callback = callback; } + Func Callback; + RenderTarget FilterManager.IRenderTargetProvider.Get(Size size) + { + return Callback(size); + } + } public DisplayManager(PresentationPanel presentationPanel) { @@ -40,7 +55,6 @@ namespace BizHawk.Client.EmuHawk Renderer = new GuiRenderer(GL); - Video2xFrugalizer = new RenderTargetFrugalizer(GL); VideoTextureFrugalizer = new TextureFrugalizer(GL); ShaderChainFrugalizers = new RenderTargetFrugalizer[16]; //hacky hardcoded limit.. need some other way to manage these @@ -56,16 +70,22 @@ namespace BizHawk.Client.EmuHawk var fiHq2x = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk/hq2x.cgp")); if(fiHq2x.Exists) using(var stream = fiHq2x.OpenRead()) - ShaderChain_hq2x = new RetroShaderChain(GL,new RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk")); + ShaderChain_hq2x = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk")); var fiScanlines = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/BizScanlines.cgp")); if (fiScanlines.Exists) using (var stream = fiScanlines.OpenRead()) - ShaderChain_scanlines = new RetroShaderChain(GL,new RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk")); + ShaderChain_scanlines = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk")); + var fiBicubic = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/bicubic-fast.cgp")); + if (fiBicubic.Exists) + using (var stream = fiBicubic.OpenRead()) + ShaderChain_bicubic = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk")); LuaSurfaceSets["emu"] = new SwappableDisplaySurfaceSet(); LuaSurfaceSets["native"] = new SwappableDisplaySurfaceSet(); LuaSurfaceFrugalizers["emu"] = new TextureFrugalizer(GL); LuaSurfaceFrugalizers["native"] = new TextureFrugalizer(GL); + + RefreshUserShader(); } public bool Disposed { get; private set; } @@ -93,7 +113,7 @@ namespace BizHawk.Client.EmuHawk //layer resources PresentationPanel presentationPanel; //well, its the final layer's target, at least GraphicsControl GraphicsControl; //well, its the final layer's target, at least - + FilterManager.FilterProgram CurrentFilterProgram; /// /// these variables will track the dimensions of the last frame's (or the next frame? this is confusing) emulator native output size @@ -102,135 +122,249 @@ namespace BizHawk.Client.EmuHawk TextureFrugalizer VideoTextureFrugalizer; Dictionary LuaSurfaceFrugalizers = new Dictionary(); - RenderTargetFrugalizer Video2xFrugalizer; RenderTargetFrugalizer[] ShaderChainFrugalizers; - RetroShaderChain ShaderChain_hq2x, ShaderChain_scanlines; + Filters.RetroShaderChain ShaderChain_hq2x, ShaderChain_scanlines, ShaderChain_bicubic; + Filters.RetroShaderChain ShaderChain_user; - /// - /// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline - /// Then it will stuff it into the bound PresentationPanel - /// - public void UpdateSource(IVideoProvider videoProvider) + public void RefreshUserShader() { - //wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVidepProviders) - BitmapBuffer bb = new BitmapBuffer(videoProvider.BufferWidth, videoProvider.BufferHeight, videoProvider.GetVideoBuffer()); + if (ShaderChain_user != null) + ShaderChain_user.Dispose(); + var fi = new FileInfo(Global.Config.DispUserFilterPath); + if (fi.Exists) + using (var stream = fi.OpenRead()) + ShaderChain_user = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.GetDirectoryName(Global.Config.DispUserFilterPath)); + } - //record the size of what we received, since lua and stuff is gonna want to draw onto it - currEmuWidth = bb.Width; - currEmuHeight = bb.Height; - - //now, acquire the data sent from the videoProvider into a texture - var videoTexture = VideoTextureFrugalizer.Get(bb); - - //acquire the lua surfaces as textures - Texture2d luaEmuTexture = null; - var luaEmuSurface = LuaSurfaceSets["emu"].GetCurrent(); - if (luaEmuSurface != null) - luaEmuTexture = LuaSurfaceFrugalizers["emu"].Get(luaEmuSurface); - - Texture2d luaNativeTexture = null; - var luaNativeSurface = LuaSurfaceSets["native"].GetCurrent(); - if (luaNativeSurface != null) - luaNativeTexture = LuaSurfaceFrugalizers["native"].Get(luaNativeSurface); - - //select shader chain - RetroShaderChain selectedChain = null; + FilterManager.FilterProgram BuildDefaultChain(Size chain_insize, Size chain_outsize) + { + //select user special FX shader chain + Dictionary selectedChainProperties = new Dictionary(); + Filters.RetroShaderChain selectedChain = null; if (Global.Config.TargetDisplayFilter == 1 && ShaderChain_hq2x != null && ShaderChain_hq2x.Available) selectedChain = ShaderChain_hq2x; if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available) - selectedChain = ShaderChain_scanlines; - - //run shader chain - Texture2d currentTexture = videoTexture; - if (selectedChain != null) { - foreach (var pass in selectedChain.Passes) - { - //calculate size of input and output (note, we dont have a distinction between logical size and POW2 buffer size yet, like we should) - - Size insize = currentTexture.Size; - Size outsize = insize; + //shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f); + selectedChain = ShaderChain_scanlines; + selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f; + } + if (Global.Config.TargetDisplayFilter == 3 && ShaderChain_user != null && ShaderChain_user.Available) + selectedChain = ShaderChain_user; - //calculate letterboxing scale factors for the current configuration, so that ScaleType.Viewport can do something intelligent - var LLpass = new LetterboxingLogic(GraphicsControl.Width, GraphicsControl.Height, insize.Width, insize.Height); + Filters.FinalPresentation fPresent = new Filters.FinalPresentation(chain_outsize); + Filters.SourceImage fInput = new Filters.SourceImage(chain_insize); + Filters.OSD fOSD = new Filters.OSD(); + fOSD.RenderCallback = () => + { + var size = fOSD.FindInput().SurfaceFormat.Size; + Renderer.Begin(size.Width, size.Height); + MyBlitter myBlitter = new MyBlitter(this); + myBlitter.ClipBounds = new Rectangle(0, 0, size.Width, size.Height); + Renderer.SetBlendState(GL.BlendNormal); + GlobalWin.OSD.Begin(myBlitter); + GlobalWin.OSD.DrawScreenInfo(myBlitter); + GlobalWin.OSD.DrawMessages(myBlitter); + Renderer.End(); + }; - if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) { throw new NotImplementedException("ScaleType Absolute"); } - if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Viewport) outsize.Width = LLpass.Rectangle.Width; - if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Source) outsize.Width = (int)(insize.Width * pass.Scale.X); - if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) { throw new NotImplementedException("ScaleType Absolute"); } - if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Viewport) outsize.Height = LLpass.Rectangle.Height; - if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Source) outsize.Height = (int)(insize.Height * pass.Scale.Y); + FilterManager.FilterProgram chain = new FilterManager.FilterProgram(); - if (pass.InputFilterLinear) - videoTexture.SetFilterLinear(); - else - videoTexture.SetFilterNearest(); + //add the first filter, encompassing output from the emulator core + chain.AddFilter(fInput, "input"); - var rt = ShaderChainFrugalizers[pass.Index].Get(outsize.Width, outsize.Height); - rt.Bind(); + //add lua layer 'emu' + AppendLuaLayer(chain, "emu"); - var shader = selectedChain.Shaders[pass.Index]; - shader.Bind(); - if(selectedChain == ShaderChain_scanlines) - shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f); - shader.Run(currentTexture, insize, outsize, true); - currentTexture = rt.Texture2d; - } + //add user-selected retro shader + if (selectedChain != null) + AppendRetroShaderChain(chain, "retroShader", selectedChain, selectedChainProperties); + + //choose final filter + Filters.FinalPresentation.eFilterOption finalFilter = Filters.FinalPresentation.eFilterOption.None; + if (Global.Config.DispFinalFilter == 1) finalFilter = Filters.FinalPresentation.eFilterOption.Bilinear; + if (Global.Config.DispFinalFilter == 2) finalFilter = Filters.FinalPresentation.eFilterOption.Bicubic; + //if bicubic is selected and unavailable, dont use it + if (!ShaderChain_bicubic.Available && fPresent.FilterOption == Filters.FinalPresentation.eFilterOption.Bicubic) + { + finalFilter = Filters.FinalPresentation.eFilterOption.None; + } + fPresent.FilterOption = finalFilter; + + //now if bicubic is chosen, insert it + if (finalFilter == Filters.FinalPresentation.eFilterOption.Bicubic) + AppendRetroShaderChain(chain, "bicubic", ShaderChain_bicubic, null); + + //add final presentation + chain.AddFilter(fPresent, "presentation"); + + //add lua layer 'native' + AppendLuaLayer(chain, "native"); + + //and OSD goes on top of that + chain.AddFilter(fOSD, "osd"); + + return chain; + } + + void AppendRetroShaderChain(FilterManager.FilterProgram program, string name, Filters.RetroShaderChain retroChain, Dictionary properties) + { + for (int i = 0; i < retroChain.Passes.Length; i++) + { + var pass = retroChain.Passes[i]; + var rsp = new Filters.RetroShaderPass(retroChain, i); + string fname = string.Format("{0}[{1}]", name, i); + program.AddFilter(rsp, fname); + rsp.Parameters = properties; + } + } + + void AppendLuaLayer(FilterManager.FilterProgram chain, string name) + { + Texture2d luaNativeTexture = null; + var luaNativeSurface = LuaSurfaceSets[name].GetCurrent(); + if (luaNativeSurface == null) + return; + luaNativeTexture = LuaSurfaceFrugalizers[name].Get(luaNativeSurface); + var fLuaLayer = new Filters.LuaLayer(); + fLuaLayer.SetTexture(luaNativeTexture); + chain.AddFilter(fLuaLayer, name); + } + + /// + /// Using the current filter program, turn a mouse coordinate from window space to the original emulator screen space. + /// + public Point UntransformPoint(Point p) + { + //first, turn it into a window coordinate + p = presentationPanel.Control.PointToClient(p); + + //now, if theres no filter program active, just give up + if (CurrentFilterProgram == null) return p; + + //otherwise, have the filter program untransform it + Vector2 v = new Vector2(p.X, p.Y); + v = CurrentFilterProgram.UntransformPoint("default",v); + return new Point((int)v.X, (int)v.Y); + } + + /// + /// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline + /// Then it will stuff it into the bound PresentationPanel. + /// --- + /// If the int[] is size=1, then it contains an openGL texture ID (and the size should be as specified from videoProvider) + /// Don't worry about the case where the frontend isnt using opengl; it isnt supported yet, and it will be my responsibility to deal with anyway + /// + public void UpdateSource(IVideoProvider videoProvider) + { + int[] videoBuffer = videoProvider.GetVideoBuffer(); + +TESTEROO: + int bufferWidth = videoProvider.BufferWidth; + int bufferHeight = videoProvider.BufferHeight; + bool isGlTextureId = videoBuffer.Length == 1; + + + BitmapBuffer bb = null; + Texture2d videoTexture; + if (isGlTextureId) + { + videoTexture = GL.WrapGLTexture2d(new IntPtr(videoBuffer[0]), bufferWidth, bufferHeight); + } + else + { + //wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVideoProviders) + bb = new BitmapBuffer(bufferWidth, bufferHeight, videoBuffer); + + //now, acquire the data sent from the videoProvider into a texture + videoTexture = VideoTextureFrugalizer.Get(bb); } - //begin drawing to the PresentationPanel: - GraphicsControl.Begin(); + //TEST (to be removed once we have an actual example of bring in a texture ID from opengl emu core): + if (!isGlTextureId) + { + videoBuffer = new int[1] { videoTexture.Id.ToInt32() }; + goto TESTEROO; + } - //1. clear it with the background color that the emulator specified (could we please only clear the necessary letterbox area, to save some time?) - GL.SetClearColor(Color.FromArgb(videoProvider.BackgroundColor)); - GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit); + //record the size of what we received, since lua and stuff is gonna want to draw onto it + currEmuWidth = bufferWidth; + currEmuHeight = bufferHeight; - //2. begin 2d rendering - Renderer.Begin(GraphicsControl.Width, GraphicsControl.Height); + //build the default filter chain and set it up with services filters will need + Size chain_insize = new Size(bufferWidth, bufferHeight); + Size chain_outsize = GraphicsControl.Size; + CurrentFilterProgram = BuildDefaultChain(chain_insize, chain_outsize); + CurrentFilterProgram.GuiRenderer = Renderer; + CurrentFilterProgram.GL = GL; + //chain.RenderTargetProvider = new DisplayManagerRenderTargetProvider((size) => ShaderChainFrugalizers); - //3. figure out how to draw the emulator output content - var LL = new LetterboxingLogic(GraphicsControl.Width, GraphicsControl.Height, currentTexture.IntWidth, currentTexture.IntHeight); + //setup the source image filter + Filters.SourceImage fInput = CurrentFilterProgram["input"] as Filters.SourceImage; + fInput.Texture = videoTexture; + + //setup the final presentation filter + Filters.FinalPresentation fPresent = CurrentFilterProgram["presentation"] as Filters.FinalPresentation; + fPresent.BackgroundColor = videoProvider.BackgroundColor; + fPresent.GuiRenderer = Renderer; + fPresent.GL = GL; + CurrentFilterProgram.Compile("default", chain_insize, chain_outsize); - //4. draw the emulator content - Renderer.SetBlendState(GL.BlendNone); - Renderer.Modelview.Push(); - Renderer.Modelview.Translate(LL.dx, LL.dy); - Renderer.Modelview.Scale(LL.finalScale); - if (Global.Config.DispBlurry) - videoTexture.SetFilterLinear(); - else - videoTexture.SetFilterNearest(); - Renderer.Draw(currentTexture); - //4.b draw the "lua emu surface" which is designed for art matching up exactly with the emulator output - Renderer.SetBlendState(GL.BlendNormal); - if(luaEmuTexture != null) Renderer.Draw(luaEmuTexture); - Renderer.Modelview.Pop(); + //run filter chain + Texture2d texCurr = null; + RenderTarget rtCurr = null; + int rtCounter = 0; + bool inFinalTarget = false; + foreach (var step in CurrentFilterProgram.Program) + { + switch (step.Type) + { + case FilterManager.FilterProgram.ProgramStepType.Run: + { + int fi = (int)step.Args; + var f = CurrentFilterProgram.Filters[fi]; + f.SetInput(texCurr); + f.Run(); + var orec = f.FindOutput(); + if (orec != null) + { + if (orec.SurfaceDisposition == FilterManager.SurfaceDisposition.Texture) + { + texCurr = f.GetOutput(); + rtCurr = null; + } + } + break; + } + case FilterManager.FilterProgram.ProgramStepType.NewTarget: + { + var size = (Size)step.Args; + rtCurr = ShaderChainFrugalizers[rtCounter++].Get(size); + rtCurr.Bind(); + CurrentFilterProgram.CurrRenderTarget = rtCurr; + break; + } + case FilterManager.FilterProgram.ProgramStepType.FinalTarget: + inFinalTarget = true; + rtCurr = null; + CurrentFilterProgram.CurrRenderTarget = null; + GraphicsControl.Begin(); + break; + } + } + Debug.Assert(inFinalTarget); - //5a. draw the native layer content - //4.b draw the "lua emu surface" which is designed for art matching up exactly with the emulator output - if (luaNativeTexture != null) Renderer.Draw(luaNativeTexture); - - //5b. draw the native layer OSD - MyBlitter myBlitter = new MyBlitter(this); - myBlitter.ClipBounds = new Rectangle(0, 0, GraphicsControl.Width, GraphicsControl.Height); - GlobalWin.OSD.Begin(myBlitter); - GlobalWin.OSD.DrawScreenInfo(myBlitter); - GlobalWin.OSD.DrawMessages(myBlitter); - - //6. finished drawing - Renderer.End(); - - //7. apply the vsync setting (should probably try to avoid repeating this) + //apply the vsync setting (should probably try to avoid repeating this) bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync; presentationPanel.GraphicsControl.SetVsync(vsync); - //7. present and conclude drawing + //present and conclude drawing presentationPanel.GraphicsControl.SwapBuffers(); presentationPanel.GraphicsControl.End(); //cleanup: - bb.Dispose(); + if(bb != null) bb.Dispose(); NeedsToPaint = false; //?? } @@ -270,6 +404,16 @@ namespace BizHawk.Client.EmuHawk return ret; } + public void ClearLuaSurfaces() + { + foreach (var kvp in LuaSurfaceSets) + { + var surf = LockLuaSurface(kvp.Key); + surf.Clear(); + UnlockLuaSurface(surf); + } + } + /// /// Unlocks this DisplaySurface which had better have been locked as a lua surface /// @@ -320,40 +464,7 @@ namespace BizHawk.Client.EmuHawk public Rectangle ClipBounds { get; set; } } - /// - /// applies letterboxing logic to figure out how to fit the source dimensions into the target dimensions. - /// In the future this could also apply rules like integer-only scaling, etc. - /// TODO - make this work with a output rect instead of float and dx/dy - /// - class LetterboxingLogic - { - public LetterboxingLogic(int targetWidth, int targetHeight, int sourceWidth, int sourceHeight) - { - float vw = (float)targetWidth; - float vh = (float)targetHeight; - float widthScale = vw / sourceWidth; - float heightScale = vh / sourceHeight; - finalScale = Math.Min(widthScale, heightScale); - dx = (int)((vw - finalScale * sourceWidth) / 2); - dy = (int)((vh - finalScale * sourceHeight) / 2); - Rectangle = new Rectangle((int)dx, (int)dy, (int)(finalScale * sourceWidth), (int)(finalScale * sourceHeight)); - } - - /// - /// scale to be applied to both x and y - /// - public float finalScale; - - /// - /// offset - /// - public float dx, dy; - - /// - /// The destination rectangle - /// - public Rectangle Rectangle; - } + } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs index bf25266574..67545cc5f2 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs @@ -1,14 +1,13 @@ -//https://github.com/Themaister/RetroArch/wiki/GLSL-shaders -//https://github.com/Themaister/Emulator-Shader-Pack/blob/master/Cg/README -//https://github.com/libretro/common-shaders/ - using System; +using System.Linq; +using System.Diagnostics; using System.Collections.Generic; using System.IO; using System.Drawing; using BizHawk.Common; using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk.Filters; using BizHawk.Bizware.BizwareGL; using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; @@ -16,248 +15,226 @@ using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; using OpenTK; using OpenTK.Graphics; -namespace BizHawk.Client.EmuHawk +namespace BizHawk.Client.EmuHawk.FilterManager { - /// - /// - /// - class RetroShaderChain : IDisposable + public enum SurfaceDisposition { - public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false) - { - Owner = owner; - this.Preset = preset; - Passes = preset.Passes.ToArray(); - - bool ok = true; - - //load up the shaders - Shaders = new RetroShader[preset.Passes.Count]; - for(int i=0;i - /// Whether this shader chain is available (it wont be available if some resources failed to load or compile) - /// - public bool Available { get; private set; } - - public readonly IGL Owner; - public readonly RetroShaderPreset Preset; - public readonly RetroShader[] Shaders; - public readonly RetroShaderPreset.ShaderPass[] Passes; + Unspecified, Texture, RenderTarget } - class RetroShaderPreset + public class SurfaceFormat { - /// - /// Parses an instance from a stream to a CGP file - /// - public RetroShaderPreset(Stream stream) - { - var content = new StreamReader(stream).ReadToEnd(); - Dictionary dict = new Dictionary(); + public SurfaceFormat(Size size) { this.Size = size; } + public Size Size { get; private set; } + } - //parse the key-value-pair format of the file - content = content.Replace("\r", ""); - foreach (var _line in content.Split('\n')) + public class SurfaceState + { + public SurfaceState() { } + public SurfaceState(SurfaceFormat surfaceFormat, SurfaceDisposition surfaceDisposition = SurfaceDisposition.Unspecified) + { + this.SurfaceFormat = surfaceFormat; + this.SurfaceDisposition = surfaceDisposition; + } + public SurfaceFormat SurfaceFormat; + public SurfaceDisposition SurfaceDisposition; + } + + public interface IRenderTargetProvider + { + RenderTarget Get(Size size); + } + + public class FilterProgram + { + public List Filters = new List(); + Dictionary FilterNameIndex = new Dictionary(); + public List Program = new List(); + + public BaseFilter this[string name] + { + get { - var line = _line.Trim(); - if(line.StartsWith("#")) continue; //lines that are solely comments - if (line == "") continue; //empty line - int eq = line.IndexOf('='); - var key = line.Substring(0,eq).Trim(); - var value = line.Substring(eq + 1).Trim(); - int quote = value.IndexOf('\"'); - if (quote != -1) - value = value.Substring(quote + 1, value.IndexOf('\"', quote + 1) - (quote + 1)); - else + BaseFilter ret; + FilterNameIndex.TryGetValue(name, out ret); + return ret; + } + } + + public enum ProgramStepType + { + Run, + NewTarget, + FinalTarget + } + + //services to filters: + public GuiRenderer GuiRenderer; + public IGL GL; + public IRenderTargetProvider RenderTargetProvider; + public RenderTarget GetRenderTarget(string channel = "default") { return CurrRenderTarget; } + public RenderTarget CurrRenderTarget; + + public void AddFilter(BaseFilter filter, string name = "") + { + Filters.Add(filter); + FilterNameIndex[name] = filter; + } + + /// + /// Receives a point in the coordinate space of the output of the filter program and untransforms it back to input points + /// + public Vector2 UntransformPoint(string channel, Vector2 point) + { + for (int i = Filters.Count - 1; i >= 0; i--) + { + var filter = Filters[i]; + point = filter.UntransformPoint(channel, point); + } + return point; + } + + public class ProgramStep + { + public ProgramStep(ProgramStepType type, object args, string comment = null) + { + this.Type = type; + this.Args = args; + this.Comment = comment; + } + public ProgramStepType Type; + public object Args; + public string Comment; + public override string ToString() + { + if (Type == ProgramStepType.Run) + return string.Format("Run {0} ({1})", (int)Args, Comment); + if (Type == ProgramStepType.NewTarget) + return string.Format("NewTarget {0}", (Size)Args); + if (Type == ProgramStepType.FinalTarget) + return string.Format("FinalTarget"); + return null; + } + } + + public void Compile(string channel, Size insize, Size outsize) + { + RETRY: + + Program.Clear(); + + //prep filters for initialization + foreach (var f in Filters) + { + f.BeginInitialization(this); + f.Initialize(); + } + + //propagate input size forwards through filter chain to allow a 'flex' filter to determine what its input will be + Size presize = insize; + for (int i = 0; i < Filters.Count; i++) + { + var filter = Filters[i]; + presize = filter.PresizeInput(channel, presize); + } + + //propagate output size backwards through filter chain to allow a 'flex' filter to determine its output based on the desired output needs + presize = outsize; + for (int i = Filters.Count - 1; i >= 0; i--) + { + var filter = Filters[i]; + presize = filter.PresizeOutput(channel, presize); + } + + SurfaceState currState = null; + List RenderTargets = new List(); + + for (int i = 0; i < Filters.Count; i++) + { + BaseFilter f = Filters[i]; + + //check whether this filter needs input. if so, notify it of the current pipeline state + var iosi = f.FindInput(channel); + if (iosi != null) { - //remove comments from end of value. exclusive from above condition, since comments after quoted strings would be snipped by the quoted string extraction - int hash = value.IndexOf('#'); - if (hash != -1) - value = value.Substring(0, hash); - value = value.Trim(); + iosi.SurfaceFormat = currState.SurfaceFormat; + f.SetInputFormat(channel, currState); + + //check if the desired disposition needs to change from texture to render target + //(if so, insert a render filter) + if (iosi.SurfaceDisposition == SurfaceDisposition.RenderTarget && currState.SurfaceDisposition == SurfaceDisposition.Texture) + { + var renderer = new Render(); + Filters.Insert(i, renderer); + goto RETRY; + } + //check if the desired disposition needs to change from a render target to a texture + //(if so, the current render target gets resolved, and made no longer current + else if (iosi.SurfaceDisposition == SurfaceDisposition.Texture && currState.SurfaceDisposition == SurfaceDisposition.RenderTarget) + { + var resolver = new Resolve(); + Filters.Insert(i, resolver); + goto RETRY; + } } - dict[key.ToLower()] = value; - } - //process the keys - int nShaders = FetchInt(dict, "shaders", 0); - for (int i = 0; i < nShaders; i++) + //now, the filter will have set its output state depending on its input state. check if it outputs: + iosi = f.FindOutput(channel); + if (iosi != null) + { + if (currState == null) + { + currState = new SurfaceState(); + currState.SurfaceFormat = iosi.SurfaceFormat; + currState.SurfaceDisposition = iosi.SurfaceDisposition; + } + else + { + //if output disposition is unspecified, change it to whatever we've got right now + if (iosi.SurfaceDisposition == SurfaceDisposition.Unspecified) + { + iosi.SurfaceDisposition = currState.SurfaceDisposition; + } + + bool newTarget = false; + if (iosi.SurfaceFormat.Size != currState.SurfaceFormat.Size) + newTarget = true; + else if (currState.SurfaceDisposition == SurfaceDisposition.Texture && iosi.SurfaceDisposition == SurfaceDisposition.RenderTarget) + newTarget = true; + + if (newTarget) + { + currState = new SurfaceState(); + iosi.SurfaceFormat = currState.SurfaceFormat = iosi.SurfaceFormat; + iosi.SurfaceDisposition = currState.SurfaceDisposition = iosi.SurfaceDisposition; + Program.Add(new ProgramStep(ProgramStepType.NewTarget, currState.SurfaceFormat.Size)); + } + else + { + currState.SurfaceDisposition = iosi.SurfaceDisposition; + } + } + + + } + + Program.Add(new ProgramStep(ProgramStepType.Run, i, f.GetType().Name)); + + } //filter loop + + //patch the program so that the final rendertarget set operation is the framebuffer instead + for (int i = Program.Count - 1; i >= 0; i--) { - ShaderPass sp = new ShaderPass(); - sp.Index = i; - Passes.Add(sp); - - sp.InputFilterLinear = FetchBool(dict, "filter_linear" + i, false); //Should this value not be defined, the filtering option is implementation defined. - sp.OuputFloat = FetchBool(dict, "float_framebuffer" + i, false); - sp.FrameCountMod = FetchInt(dict, "frame_count_mod" + i, 1); - sp.ShaderPath = FetchString(dict, "shader" + i, "?"); //todo - change extension to .cg for better compatibility? just change .cg to .glsl transparently at last second? - - //If no scale type is assumed, it is assumed that it is set to "source" with scaleN set to 1.0. - //It is possible to set scale_type_xN and scale_type_yN to specialize the scaling type in either direction. scale_typeN however overrides both of these. - sp.ScaleTypeX = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_x" + i, "Source"), true); - sp.ScaleTypeY = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_y" + i, "Source"), true); - ScaleType st = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type" + i, "NotSet"), true); - if (st != ScaleType.NotSet) - sp.ScaleTypeX = sp.ScaleTypeY = st; - - //scaleN controls both scaling type in horizontal and vertical directions. If scaleN is defined, scale_xN and scale_yN have no effect. - sp.Scale.X = FetchFloat(dict, "scale_x" + i, 1); - sp.Scale.Y = FetchFloat(dict, "scale_y" + i, 1); - float scale = FetchFloat(dict, "scale" + i, -999); - if(scale != -999) - sp.Scale.X = sp.Scale.Y = FetchFloat(dict,"scale" + i, 1); - - //TODO - LUTs + var ps = Program[i]; + if (ps.Type == ProgramStepType.NewTarget) + { + var size = (Size)ps.Args; + Debug.Assert(size == outsize); + ps.Type = ProgramStepType.FinalTarget; + ps.Args = null; + break; + } } } - - public List Passes = new List(); - - public enum ScaleType - { - NotSet, Source, Viewport, Absolute - } - - public class ShaderPass - { - public int Index; - public string ShaderPath; - public bool InputFilterLinear; - public bool OuputFloat; - public int FrameCountMod; - public ScaleType ScaleTypeX; - public ScaleType ScaleTypeY; - public Vector2 Scale; - } - - string FetchString(Dictionary dict, string key, string @default) - { - string str; - if (dict.TryGetValue(key, out str)) - return str; - else return @default; - } - - int FetchInt(Dictionary dict, string key, int @default) - { - string str; - if (dict.TryGetValue(key, out str)) - return int.Parse(str); - else return @default; - } - - float FetchFloat(Dictionary dict, string key, float @default) - { - string str; - if (dict.TryGetValue(key, out str)) - return float.Parse(str); - else return @default; - } - - bool FetchBool(Dictionary dict, string key, bool @default) - { - string str; - if (dict.TryGetValue(key, out str)) - return ParseBool(str); - else return @default; - } - - - bool ParseBool(string value) - { - if (value == "1") return true; - if (value == "0") return false; - value = value.ToLower(); - if (value == "true") return true; - if (value == "false") return false; - throw new InvalidOperationException("Unparseable bool in CGP file content"); - } } -} - -//Here, I started making code to support GUI editing of filter chains. -//I decided to go for broke and implement retroarch's system first, and then the GUI editing should be able to internally produce a metashader - -//namespace BizHawk.Client.EmuHawk -//{ -// class FilterManager -// { -// class PipelineState -// { -// public PipelineState(PipelineState other) -// { -// Size = other.Size; -// Format = other.Format; -// } -// public Size Size; -// public string Format; -// } - -// abstract class BaseFilter -// { -// bool Connect(FilterChain chain, BaseFilter parent) -// { -// Chain = chain; -// Parent = parent; -// return OnConnect(); -// } - -// public PipelineState OutputState; -// public FilterChain Chain; -// public BaseFilter Parent; - -// public abstract bool OnConnect(); -// } - -// class FilterChain -// { -// public void AddFilter(BaseFilter filter) -// { -// } -// } - -// class Filter_Grayscale : BaseFilter -// { -// public override bool OnConnect() -// { -// if(Parent.OutputState.Format != "rgb") return false; -// OutputState = new PipelineState { Parent.OutputState; } -// } -// } - -// class Filter_EmuOutput_RGBA : BaseFilter -// { -// public Filter_EmuOutput_RGBA(int width, int height) -// { -// OutputState = new PipelineState() { Size = new Size(width, height), Format = "rgb" }; -// } - -// public override bool OnConnect() -// { -// return true; -// } -// } - -// } -//} \ No newline at end of file +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs new file mode 100644 index 0000000000..94aaec6057 --- /dev/null +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs @@ -0,0 +1,120 @@ +using System; +using System.Linq; +using System.Diagnostics; +using System.Collections.Generic; +using System.IO; +using System.Drawing; + +using BizHawk.Common; +using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk.FilterManager; + +using BizHawk.Bizware.BizwareGL; +using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; + +using OpenTK; +using OpenTK.Graphics; + +//Here's how to make a filter: +//1. Reset your state entirely in Initialize(). +// The filter will be re-initialized several times while the chain is getting worked out, but not re-instantiated. +// This is sort of annoying, but there's pretty good reasons for it (some external process has created the filters and set parameters needed to govern their chaining and surface properties) +//2. In Initialize(), be sure to use DeclareInput +//(something about PresizeInput()) +//3. PresizeOutput() will be called next +//4. In SetInputFormat(), use DeclareOutput to set the output based on your desires, or the provided input format. +//5. In Run(), the render target is already set. If using a texture, use InputTexture +//6. In Run(), if supplying an output texture, use YieldOutput + +namespace BizHawk.Client.EmuHawk.Filters +{ + public class BaseFilter + { + //initialization stuff + public void BeginInitialization(FilterProgram program) { IOSurfaceInfos.Clear(); FilterProgram = program; } + public virtual void Initialize() { } + public virtual Size PresizeInput(string channel, Size size) { return size; } + public virtual Size PresizeOutput(string channel, Size size) { return size; } + public virtual void SetInputFormat(string channel, SurfaceState state) { } + public Dictionary Parameters = new Dictionary(); + + //runtime signals + public virtual Vector2 UntransformPoint(string channel, Vector2 point) + { + //base class behaviour here just uses the input and output sizes, if appropriate. few filters will have to do anything more complex + var input = FindInput(channel); + var output = FindInput(channel); + if (input != null && output != null) + { + point.X *= ((float)output.SurfaceFormat.Size.Width) / (float)input.SurfaceFormat.Size.Width; + point.Y *= ((float)output.SurfaceFormat.Size.Height) / (float)input.SurfaceFormat.Size.Height; + } + return point; + } + public void SetInput(Texture2d tex) + { + InputTexture = tex; + } + public virtual void Run() { } + public Texture2d GetOutput() { return OutputTexture; } + + //filter actions + protected void YieldOutput(Texture2d tex) + { + OutputTexture = tex; + } + + protected FilterProgram FilterProgram; + protected Texture2d InputTexture; + private Texture2d OutputTexture; + + //setup utilities + protected IOSurfaceInfo DeclareInput(SurfaceDisposition disposition = SurfaceDisposition.Unspecified, string channel = "default") { return DeclareIO(SurfaceDirection.Input, channel, disposition); } + protected IOSurfaceInfo DeclareOutput(SurfaceDisposition disposition = SurfaceDisposition.Unspecified, string channel = "default") { return DeclareIO(SurfaceDirection.Output, channel, disposition); } + + protected IOSurfaceInfo DeclareOutput(SurfaceState state, string channel = "default") + { + var iosi = DeclareIO(SurfaceDirection.Output, channel, state.SurfaceDisposition); + iosi.SurfaceFormat = state.SurfaceFormat; + return iosi; + } + + public IOSurfaceInfo FindInput(string channel = "default") { return FindIOSurfaceInfo(channel, SurfaceDirection.Input); } + public IOSurfaceInfo FindOutput(string channel = "default") { return FindIOSurfaceInfo(channel, SurfaceDirection.Output); } + + private IOSurfaceInfo DeclareIO(SurfaceDirection direction, string channel, SurfaceDisposition disposition) + { + var iosi = new IOSurfaceInfo(); + iosi.SurfaceDirection = direction; + iosi.Channel = channel; + iosi.SurfaceDisposition = disposition; + IOSurfaceInfos.Add(iosi); + return iosi; + } + + List IOSurfaceInfos = new List(); + + + IOSurfaceInfo FindIOSurfaceInfo(string channel, SurfaceDirection direction) + { + foreach (var iosi in IOSurfaceInfos) + if (iosi.Channel == channel && iosi.SurfaceDirection == direction) + return iosi; + return null; + } + + public class IOSurfaceInfo + { + public SurfaceFormat SurfaceFormat; + public SurfaceDirection SurfaceDirection; + public SurfaceDisposition SurfaceDisposition; + public string Channel; + } + + public enum SurfaceDirection + { + Input, Output + } + } + +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs new file mode 100644 index 0000000000..4afd3a66aa --- /dev/null +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs @@ -0,0 +1,226 @@ +using System; +using System.Linq; +using System.Diagnostics; +using System.Collections.Generic; +using System.IO; +using System.Drawing; + +using BizHawk.Common; +using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk; +using BizHawk.Client.EmuHawk.FilterManager; + +using BizHawk.Bizware.BizwareGL; +using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; + +using OpenTK; +using OpenTK.Graphics; + +namespace BizHawk.Client.EmuHawk.Filters +{ + /// + /// applies letterboxing logic to figure out how to fit the source dimensions into the target dimensions. + /// In the future this could also apply rules like integer-only scaling, etc. + /// + class LetterboxingLogic + { + /// + /// the location within the destination region of the output content (scaled and translated) + /// + public int vx, vy, vw, vh; + + /// + /// the scale factor eventually used + /// + public float WidthScale, HeightScale; + + public LetterboxingLogic(bool maintainAspect, bool maintainInteger, int targetWidth, int targetHeight, int sourceWidth, int sourceHeight) + { + //do maths on the viewport and the native resolution and the user settings to get a display rectangle + Size sz = new Size(targetWidth, targetHeight); + + float widthScale = (float)sz.Width / sourceWidth; + float heightScale = (float)sz.Height / sourceHeight; + if (maintainAspect) + { + if (widthScale > heightScale) widthScale = heightScale; + if (heightScale > widthScale) heightScale = widthScale; + } + if (maintainInteger) + { + widthScale = (float)Math.Floor(widthScale); + heightScale = (float)Math.Floor(heightScale); + } + vw = (int)(widthScale * sourceWidth); + vh = (int)(heightScale * sourceHeight); + vx = (sz.Width - vw) / 2; + vy = (sz.Height - vh) / 2; + WidthScale = widthScale; + HeightScale = heightScale; + } + + } + + public class FinalPresentation : BaseFilter + { + public enum eFilterOption + { + None, Bilinear, Bicubic + } + + public eFilterOption FilterOption = eFilterOption.None; + public RetroShaderChain BicubicFilter; + + public FinalPresentation(Size size) + { + this.OutputSize = size; + } + + Size OutputSize, InputSize; + public int BackgroundColor; + public GuiRenderer GuiRenderer; + public IGL GL; + bool nop; + LetterboxingLogic LL; + + public override void Initialize() + { + DeclareInput(); + nop = false; + } + + public override Size PresizeOutput(string channel, Size size) + { + if (FilterOption == eFilterOption.Bicubic) + { + size.Width = LL.vw; + size.Height = LL.vh; + return size; + } + return base.PresizeOutput(channel, size); + } + + public override Size PresizeInput(string channel, Size size) + { + if (FilterOption != eFilterOption.Bicubic) + return size; + + LL = new LetterboxingLogic(Global.Config.DispFixAspectRatio, Global.Config.DispFixScaleInteger, OutputSize.Width, OutputSize.Height, size.Width, size.Height); + + return size; + } + + public override void SetInputFormat(string channel, SurfaceState state) + { + bool need = false; + if (state.SurfaceFormat.Size != OutputSize) + need = true; + if (FilterOption != eFilterOption.None) + need = true; + + if (!need) + { + nop = true; + return; + } + + FindInput().SurfaceDisposition = SurfaceDisposition.Texture; + DeclareOutput(new SurfaceState(new SurfaceFormat(OutputSize), SurfaceDisposition.RenderTarget)); + InputSize = state.SurfaceFormat.Size; + LL = new LetterboxingLogic(Global.Config.DispFixAspectRatio, Global.Config.DispFixScaleInteger, OutputSize.Width, OutputSize.Height, InputSize.Width, InputSize.Height); + } + + public override Vector2 UntransformPoint(string channel, Vector2 point) + { + if (nop) + return point; + point.X -= LL.vx; + point.Y -= LL.vy; + point.X /= LL.WidthScale; + point.Y /= LL.HeightScale; + return point; + } + + public override void Run() + { + if (nop) + return; + + GL.SetClearColor(Color.FromArgb(BackgroundColor)); + GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit); + + GuiRenderer.Begin(OutputSize.Width, OutputSize.Height); + GuiRenderer.SetBlendState(GL.BlendNone); + GuiRenderer.Modelview.Push(); + GuiRenderer.Modelview.Translate(LL.vx, LL.vy); + GuiRenderer.Modelview.Scale(LL.WidthScale, LL.HeightScale); + if(FilterOption != eFilterOption.None) + InputTexture.SetFilterLinear(); + else + InputTexture.SetFilterNearest(); + + if (FilterOption == eFilterOption.Bicubic) + { + } + + + GuiRenderer.Draw(InputTexture); + + GuiRenderer.End(); + } + } + + public class LuaLayer : BaseFilter + { + public override void Initialize() + { + DeclareInput(SurfaceDisposition.RenderTarget); + } + public override void SetInputFormat(string channel, SurfaceState state) + { + DeclareOutput(state); + } + + Bizware.BizwareGL.Texture2d Texture; + + public void SetTexture(Bizware.BizwareGL.Texture2d tex) + { + Texture = tex; + } + + public override void Run() + { + var outSize = FindOutput().SurfaceFormat.Size; + FilterProgram.GuiRenderer.Begin(outSize); + FilterProgram.GuiRenderer.SetBlendState(FilterProgram.GL.BlendNormal); + FilterProgram.GuiRenderer.Draw(Texture); + FilterProgram.GuiRenderer.End(); + } + } + + public class OSD : BaseFilter + { + //this class has the ability to disable its operations for higher performance when the callback is removed, + //without having to take it out of the chain. although, its presence in the chain may slow down performance due to added resolves/renders + //so, we should probably rebuild the chain. + + public override void Initialize() + { + if (RenderCallback == null) return; + DeclareInput(SurfaceDisposition.RenderTarget); + } + public override void SetInputFormat(string channel, SurfaceState state) + { + if (RenderCallback == null) return; + DeclareOutput(state); + } + + public Action RenderCallback; + + public override void Run() + { + if (RenderCallback == null) return; + RenderCallback(); + } + } +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/Retro.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Retro.cs new file mode 100644 index 0000000000..b528d36836 --- /dev/null +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Retro.cs @@ -0,0 +1,274 @@ +//https://github.com/Themaister/RetroArch/wiki/GLSL-shaders +//https://github.com/Themaister/Emulator-Shader-Pack/blob/master/Cg/README +//https://github.com/libretro/common-shaders/ + +using System; +using System.Linq; +using System.Diagnostics; +using System.Collections.Generic; +using System.IO; +using System.Drawing; + +using BizHawk.Common; +using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk; +using BizHawk.Client.EmuHawk.FilterManager; + +using BizHawk.Bizware.BizwareGL; +using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; + +using OpenTK; +using OpenTK.Graphics; + +namespace BizHawk.Client.EmuHawk.Filters +{ + public class RetroShaderChain : IDisposable + { + public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false) + { + Owner = owner; + this.Preset = preset; + Passes = preset.Passes.ToArray(); + + bool ok = true; + + //load up the shaders + Shaders = new RetroShader[preset.Passes.Count]; + for (int i = 0; i < preset.Passes.Count; i++) + { + RetroShaderPreset.ShaderPass pass = preset.Passes[i]; + + //acquire content + string path = Path.Combine(baseDirectory, pass.ShaderPath); + string content = File.ReadAllText(path); + + var shader = new RetroShader(Owner, content, debug); + Shaders[i] = shader; + if (!shader.Pipeline.Available) + ok = false; + } + + Available = ok; + } + + public void Dispose() + { + //todo + } + + /// + /// Whether this shader chain is available (it wont be available if some resources failed to load or compile) + /// + public bool Available { get; private set; } + + public readonly IGL Owner; + public readonly RetroShaderPreset Preset; + public readonly RetroShader[] Shaders; + public readonly RetroShaderPreset.ShaderPass[] Passes; + } + + public class RetroShaderPreset + { + /// + /// Parses an instance from a stream to a CGP file + /// + public RetroShaderPreset(Stream stream) + { + var content = new StreamReader(stream).ReadToEnd(); + Dictionary dict = new Dictionary(); + + //parse the key-value-pair format of the file + content = content.Replace("\r", ""); + foreach (var _line in content.Split('\n')) + { + var line = _line.Trim(); + if (line.StartsWith("#")) continue; //lines that are solely comments + if (line == "") continue; //empty line + int eq = line.IndexOf('='); + var key = line.Substring(0, eq).Trim(); + var value = line.Substring(eq + 1).Trim(); + int quote = value.IndexOf('\"'); + if (quote != -1) + value = value.Substring(quote + 1, value.IndexOf('\"', quote + 1) - (quote + 1)); + else + { + //remove comments from end of value. exclusive from above condition, since comments after quoted strings would be snipped by the quoted string extraction + int hash = value.IndexOf('#'); + if (hash != -1) + value = value.Substring(0, hash); + value = value.Trim(); + } + dict[key.ToLower()] = value; + } + + //process the keys + int nShaders = FetchInt(dict, "shaders", 0); + for (int i = 0; i < nShaders; i++) + { + ShaderPass sp = new ShaderPass(); + sp.Index = i; + Passes.Add(sp); + + sp.InputFilterLinear = FetchBool(dict, "filter_linear" + i, false); //Should this value not be defined, the filtering option is implementation defined. + sp.OuputFloat = FetchBool(dict, "float_framebuffer" + i, false); + sp.FrameCountMod = FetchInt(dict, "frame_count_mod" + i, 1); + sp.ShaderPath = FetchString(dict, "shader" + i, "?"); //todo - change extension to .cg for better compatibility? just change .cg to .glsl transparently at last second? + + //If no scale type is assumed, it is assumed that it is set to "source" with scaleN set to 1.0. + //It is possible to set scale_type_xN and scale_type_yN to specialize the scaling type in either direction. scale_typeN however overrides both of these. + sp.ScaleTypeX = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_x" + i, "Source"), true); + sp.ScaleTypeY = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_y" + i, "Source"), true); + ScaleType st = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type" + i, "NotSet"), true); + if (st != ScaleType.NotSet) + sp.ScaleTypeX = sp.ScaleTypeY = st; + + //scaleN controls both scaling type in horizontal and vertical directions. If scaleN is defined, scale_xN and scale_yN have no effect. + sp.Scale.X = FetchFloat(dict, "scale_x" + i, 1); + sp.Scale.Y = FetchFloat(dict, "scale_y" + i, 1); + float scale = FetchFloat(dict, "scale" + i, -999); + if (scale != -999) + sp.Scale.X = sp.Scale.Y = FetchFloat(dict, "scale" + i, 1); + + //TODO - LUTs + } + } + + public List Passes = new List(); + + public enum ScaleType + { + NotSet, Source, Viewport, Absolute + } + + public class ShaderPass + { + public int Index; + public string ShaderPath; + public bool InputFilterLinear; + public bool OuputFloat; + public int FrameCountMod; + public ScaleType ScaleTypeX; + public ScaleType ScaleTypeY; + public Vector2 Scale; + } + + string FetchString(Dictionary dict, string key, string @default) + { + string str; + if (dict.TryGetValue(key, out str)) + return str; + else return @default; + } + + int FetchInt(Dictionary dict, string key, int @default) + { + string str; + if (dict.TryGetValue(key, out str)) + return int.Parse(str); + else return @default; + } + + float FetchFloat(Dictionary dict, string key, float @default) + { + string str; + if (dict.TryGetValue(key, out str)) + return float.Parse(str); + else return @default; + } + + bool FetchBool(Dictionary dict, string key, bool @default) + { + string str; + if (dict.TryGetValue(key, out str)) + return ParseBool(str); + else return @default; + } + + + bool ParseBool(string value) + { + if (value == "1") return true; + if (value == "0") return false; + value = value.ToLower(); + if (value == "true") return true; + if (value == "false") return false; + throw new InvalidOperationException("Unparseable bool in CGP file content"); + } + } + + public class RetroShaderPass : BaseFilter + { + RetroShaderChain RSC; + RetroShaderPreset.ShaderPass SP; + int RSI; + Size OutputSize; + + public override string ToString() + { + return string.Format("RetroShaderPass[#{0}]", RSI); + } + + public RetroShaderPass(RetroShaderChain RSC, int index) + { + this.RSC = RSC; + this.RSI = index; + this.SP = RSC.Passes[index]; + } + + public override void Initialize() + { + DeclareInput(SurfaceDisposition.Texture); + } + + public override void SetInputFormat(string channel, SurfaceState state) + { + Size insize = state.SurfaceFormat.Size; + if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) OutputSize.Width = (int)SP.Scale.X; + if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) OutputSize.Width = (int)SP.Scale.Y; + if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Source) OutputSize.Width = (int)(insize.Width * SP.Scale.X); + if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Source) OutputSize.Height = (int)(insize.Height * SP.Scale.Y); + + var outState = new SurfaceState(); + outState.SurfaceFormat = new SurfaceFormat(OutputSize); + outState.SurfaceDisposition = SurfaceDisposition.RenderTarget; + DeclareOutput(outState); + } + + public override Size PresizeOutput(string channel, Size size) + { + OutputSize = size; + return size; + } + + public override Size PresizeInput(string channel, Size insize) + { + Size outsize = insize; + if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) outsize.Width = (int)SP.Scale.X; + if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) outsize.Width = (int)SP.Scale.Y; + if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Source) outsize.Width = (int)(insize.Width * SP.Scale.X); + if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Source) outsize.Height = (int)(insize.Height * SP.Scale.Y); + return outsize; + } + + public override void Run() + { + var shader = RSC.Shaders[RSI]; + + shader.Bind(); + + //apply all parameters to this shader.. even if it was meant for other shaders. kind of lame. + if(Parameters != null) + foreach (var kvp in Parameters) + { + if (kvp.Value is float) + shader.Pipeline[kvp.Key].Set((float)kvp.Value); + } + + var outDisposition = FindOutput().SurfaceDisposition; + var input = InputTexture; + RSC.Shaders[RSI].Run(input, input.Size, OutputSize, InputTexture.IsUpsideDown); + } + } + + +} diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/Utils.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Utils.cs new file mode 100644 index 0000000000..5833785a56 --- /dev/null +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Utils.cs @@ -0,0 +1,90 @@ +using System; +using System.Linq; +using System.Diagnostics; +using System.Collections.Generic; +using System.IO; +using System.Drawing; + +using BizHawk.Common; +using BizHawk.Client.Common; +using BizHawk.Client.EmuHawk; +using BizHawk.Client.EmuHawk.FilterManager; + +using BizHawk.Bizware.BizwareGL; +using BizHawk.Bizware.BizwareGL.Drivers.OpenTK; + +using OpenTK; +using OpenTK.Graphics; + +namespace BizHawk.Client.EmuHawk.Filters +{ + public class SourceImage : BaseFilter + { + public SourceImage(Size size) + { + this.Size = size; + } + + Size Size; + + public Texture2d Texture; + + public override void Run() + { + YieldOutput(Texture); + } + + public override void Initialize() + { + DeclareOutput(new SurfaceState(new SurfaceFormat(Size), SurfaceDisposition.Texture)); + } + + public override void SetInputFormat(string channel, SurfaceState format) + { + DeclareOutput(SurfaceDisposition.Texture); + } + } + + /// + /// transforms an input texture to an output render target (by rendering it) + /// + class Render : BaseFilter + { + public override void Initialize() + { + DeclareInput(SurfaceDisposition.Texture); + } + + public override void SetInputFormat(string channel, SurfaceState state) + { + DeclareOutput(new SurfaceState(state.SurfaceFormat, SurfaceDisposition.RenderTarget)); + } + + public override void Run() + { + GuiRenderer renderer = FilterProgram.GuiRenderer; + renderer.Begin(FindOutput().SurfaceFormat.Size); + renderer.SetBlendState(FilterProgram.GL.BlendNone); + renderer.Draw(InputTexture); + renderer.End(); + } + } + + class Resolve : BaseFilter + { + public override void Initialize() + { + DeclareInput(SurfaceDisposition.RenderTarget); + } + + public override void SetInputFormat(string channel, SurfaceState state) + { + DeclareOutput(new SurfaceState(state.SurfaceFormat, SurfaceDisposition.Texture)); + } + + public override void Run() + { + YieldOutput(FilterProgram.GetRenderTarget().Texture2d); + } + } +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/DisplayManager/RenderTargetFrugalizer.cs b/BizHawk.Client.EmuHawk/DisplayManager/RenderTargetFrugalizer.cs index 0c1ef00136..693424ff73 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/RenderTargetFrugalizer.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/RenderTargetFrugalizer.cs @@ -39,6 +39,7 @@ namespace BizHawk.Client.EmuHawk IGL GL; List CurrentRenderTargets; + public RenderTarget Get(System.Drawing.Size dimensions) { return Get(dimensions.Width, dimensions.Height); } public RenderTarget Get(int width, int height) { //get the current entry @@ -59,7 +60,7 @@ namespace BizHawk.Client.EmuHawk } //now shuffle the buffers - CurrentRenderTargets.Insert(0, CurrentRenderTargets[1]); + CurrentRenderTargets[0] = CurrentRenderTargets[1]; CurrentRenderTargets[1] = CurrentRenderTarget; return CurrentRenderTarget; diff --git a/BizHawk.Client.EmuHawk/DisplayManager/TextureFrugalizer.cs b/BizHawk.Client.EmuHawk/DisplayManager/TextureFrugalizer.cs index 6093d7a6b2..5dc24e0713 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/TextureFrugalizer.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/TextureFrugalizer.cs @@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk } //now shuffle the buffers - CurrentTextures.Insert(0,CurrentTextures[1]); + CurrentTextures[0] = CurrentTextures[1]; CurrentTextures[1] = CurrentTexture; return CurrentTexture; diff --git a/BizHawk.Client.EmuHawk/PresentationPanel.cs b/BizHawk.Client.EmuHawk/PresentationPanel.cs index c14b1e9790..6ce908d741 100644 --- a/BizHawk.Client.EmuHawk/PresentationPanel.cs +++ b/BizHawk.Client.EmuHawk/PresentationPanel.cs @@ -57,20 +57,7 @@ namespace BizHawk.Client.EmuHawk public bool Resized { get; set; } - public sd.Point ScreenToScreen(sd.Point p) - { - //TODO GL - yeah, this is broken for now, sorry. - //This logic now has more to do with DisplayManager - //p = GraphicsControl.Control.PointToClient(p); - //sd.Point ret = new sd.Point(p.X * sw / GraphicsControl.Control.Width, - // p.Y * sh / GraphicsControl.Control.Height); - //return ret; - throw new InvalidOperationException("Not supported right now, sorry"); - } - public Size NativeSize { get { return GraphicsControl.ClientSize; } } - - } diff --git a/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs b/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs index f91de35d3c..b21fbded8d 100644 --- a/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs +++ b/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs @@ -60,9 +60,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap A78Joystick { get { object obj = ResourceManager.GetObject("A78Joystick", resourceCulture); @@ -70,9 +67,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap addWatch { get { object obj = ResourceManager.GetObject("addWatch", resourceCulture); @@ -80,9 +74,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap alt_about_image { get { object obj = ResourceManager.GetObject("alt_about_image", resourceCulture); @@ -90,9 +81,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap atari_controller { get { object obj = ResourceManager.GetObject("atari_controller", resourceCulture); @@ -100,9 +88,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap AudioHS { get { object obj = ResourceManager.GetObject("AudioHS", resourceCulture); @@ -110,9 +95,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap AutoSearch { get { object obj = ResourceManager.GetObject("AutoSearch", resourceCulture); @@ -120,9 +102,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap AVI { get { object obj = ResourceManager.GetObject("AVI", resourceCulture); @@ -130,9 +109,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Back { get { object obj = ResourceManager.GetObject("Back", resourceCulture); @@ -140,9 +116,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap BackMore { get { object obj = ResourceManager.GetObject("BackMore", resourceCulture); @@ -150,9 +123,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Blank { get { object obj = ResourceManager.GetObject("Blank", resourceCulture); @@ -160,9 +130,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap BlueDown { get { object obj = ResourceManager.GetObject("BlueDown", resourceCulture); @@ -170,9 +137,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap BlueUp { get { object obj = ResourceManager.GetObject("BlueUp", resourceCulture); @@ -180,9 +144,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Both { get { object obj = ResourceManager.GetObject("Both", resourceCulture); @@ -190,9 +151,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Bug { get { object obj = ResourceManager.GetObject("Bug", resourceCulture); @@ -200,9 +158,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap C64Joystick { get { object obj = ResourceManager.GetObject("C64Joystick", resourceCulture); @@ -210,9 +165,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap C64Keyboard { get { object obj = ResourceManager.GetObject("C64Keyboard", resourceCulture); @@ -220,9 +172,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap C64Symbol { get { object obj = ResourceManager.GetObject("C64Symbol", resourceCulture); @@ -230,9 +179,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap calculator { get { object obj = ResourceManager.GetObject("calculator", resourceCulture); @@ -240,9 +186,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap camera { get { object obj = ResourceManager.GetObject("camera", resourceCulture); @@ -250,9 +193,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap cheat { get { object obj = ResourceManager.GetObject("cheat", resourceCulture); @@ -260,9 +200,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// internal static System.Drawing.Icon Cheats { get { object obj = ResourceManager.GetObject("Cheats", resourceCulture); @@ -270,9 +207,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap checkbox { get { object obj = ResourceManager.GetObject("checkbox", resourceCulture); @@ -280,9 +214,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Close { get { object obj = ResourceManager.GetObject("Close", resourceCulture); @@ -290,9 +221,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap colecovisioncontroller { get { object obj = ResourceManager.GetObject("colecovisioncontroller", resourceCulture); @@ -300,9 +228,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap console16x16 { get { object obj = ResourceManager.GetObject("console16x16", resourceCulture); @@ -310,9 +235,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap console32x32 { get { object obj = ResourceManager.GetObject("console32x32", resourceCulture); @@ -320,9 +242,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap CopyFolderHS { get { object obj = ResourceManager.GetObject("CopyFolderHS", resourceCulture); @@ -330,9 +249,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap corphawk { get { object obj = ResourceManager.GetObject("corphawk", resourceCulture); @@ -340,9 +256,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap CorpHawkSmall { get { object obj = ResourceManager.GetObject("CorpHawkSmall", resourceCulture); @@ -350,9 +263,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap CutHS { get { object obj = ResourceManager.GetObject("CutHS", resourceCulture); @@ -360,9 +270,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Debugger { get { object obj = ResourceManager.GetObject("Debugger", resourceCulture); @@ -370,9 +277,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Delete { get { object obj = ResourceManager.GetObject("Delete", resourceCulture); @@ -380,9 +284,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Duplicate { get { object obj = ResourceManager.GetObject("Duplicate", resourceCulture); @@ -390,9 +291,13 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// + internal static System.Drawing.Bitmap Erase { + get { + object obj = ResourceManager.GetObject("Erase", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap ExclamationRed { get { object obj = ResourceManager.GetObject("ExclamationRed", resourceCulture); @@ -400,9 +305,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap FastForward { get { object obj = ResourceManager.GetObject("FastForward", resourceCulture); @@ -410,9 +312,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap FindHS { get { object obj = ResourceManager.GetObject("FindHS", resourceCulture); @@ -420,9 +319,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Forward { get { object obj = ResourceManager.GetObject("Forward", resourceCulture); @@ -430,9 +326,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap ForwardMore { get { object obj = ResourceManager.GetObject("ForwardMore", resourceCulture); @@ -440,9 +333,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Freeze { get { object obj = ResourceManager.GetObject("Freeze", resourceCulture); @@ -450,9 +340,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Fullscreen { get { object obj = ResourceManager.GetObject("Fullscreen", resourceCulture); @@ -460,9 +347,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GameController { get { object obj = ResourceManager.GetObject("GameController", resourceCulture); @@ -470,9 +354,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GBA_Controller { get { object obj = ResourceManager.GetObject("GBA_Controller", resourceCulture); @@ -480,9 +361,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap gba_icon { get { object obj = ResourceManager.GetObject("gba_icon", resourceCulture); @@ -490,9 +368,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GBController { get { object obj = ResourceManager.GetObject("GBController", resourceCulture); @@ -500,9 +375,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GENController { get { object obj = ResourceManager.GetObject("GENController", resourceCulture); @@ -510,9 +382,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GenesisControllerIcon { get { object obj = ResourceManager.GetObject("GenesisControllerIcon", resourceCulture); @@ -520,9 +389,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap GreenCheck { get { object obj = ResourceManager.GetObject("GreenCheck", resourceCulture); @@ -530,9 +396,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Hack { get { object obj = ResourceManager.GetObject("Hack", resourceCulture); @@ -540,9 +403,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Help { get { object obj = ResourceManager.GetObject("Help", resourceCulture); @@ -550,9 +410,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap HomeBrew { get { object obj = ResourceManager.GetObject("HomeBrew", resourceCulture); @@ -560,9 +417,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap HotKeys { get { object obj = ResourceManager.GetObject("HotKeys", resourceCulture); @@ -570,9 +424,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Import { get { object obj = ResourceManager.GetObject("Import", resourceCulture); @@ -580,9 +431,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap InsertSeparator { get { object obj = ResourceManager.GetObject("InsertSeparator", resourceCulture); @@ -590,9 +438,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap IntVController { get { object obj = ResourceManager.GetObject("IntVController", resourceCulture); @@ -600,9 +445,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Lightning { get { object obj = ResourceManager.GetObject("Lightning", resourceCulture); @@ -610,9 +452,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap LightOff { get { object obj = ResourceManager.GetObject("LightOff", resourceCulture); @@ -620,9 +459,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap LightOn { get { object obj = ResourceManager.GetObject("LightOn", resourceCulture); @@ -630,9 +466,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap LoadConfig { get { object obj = ResourceManager.GetObject("LoadConfig", resourceCulture); @@ -640,9 +473,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// internal static System.Drawing.Icon logo { get { object obj = ResourceManager.GetObject("logo", resourceCulture); @@ -650,9 +480,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Lua { get { object obj = ResourceManager.GetObject("Lua", resourceCulture); @@ -660,9 +487,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap MessageConfig { get { object obj = ResourceManager.GetObject("MessageConfig", resourceCulture); @@ -670,9 +494,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap MoveDown { get { object obj = ResourceManager.GetObject("MoveDown", resourceCulture); @@ -680,9 +501,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap MoveLeft { get { object obj = ResourceManager.GetObject("MoveLeft", resourceCulture); @@ -690,9 +508,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap MoveRight { get { object obj = ResourceManager.GetObject("MoveRight", resourceCulture); @@ -700,9 +515,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap MoveUp { get { object obj = ResourceManager.GetObject("MoveUp", resourceCulture); @@ -710,9 +522,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap N64 { get { object obj = ResourceManager.GetObject("N64", resourceCulture); @@ -720,9 +529,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap NES_Controller { get { object obj = ResourceManager.GetObject("NES_Controller", resourceCulture); @@ -730,9 +536,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap NESControllerIcon { get { object obj = ResourceManager.GetObject("NESControllerIcon", resourceCulture); @@ -740,9 +543,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap NewFile { get { object obj = ResourceManager.GetObject("NewFile", resourceCulture); @@ -750,18 +550,12 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// internal static System.IO.UnmanagedMemoryStream nothawk { get { return ResourceManager.GetStream("nothawk", resourceCulture); } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap OpenFile { get { object obj = ResourceManager.GetObject("OpenFile", resourceCulture); @@ -769,9 +563,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Paste { get { object obj = ResourceManager.GetObject("Paste", resourceCulture); @@ -779,9 +570,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Pause { get { object obj = ResourceManager.GetObject("Pause", resourceCulture); @@ -789,9 +577,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap pcb { get { object obj = ResourceManager.GetObject("pcb", resourceCulture); @@ -799,9 +584,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap pcejin1 { get { object obj = ResourceManager.GetObject("pcejin1", resourceCulture); @@ -809,9 +591,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap PCEngineController { get { object obj = ResourceManager.GetObject("PCEngineController", resourceCulture); @@ -819,9 +598,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap pencil { get { object obj = ResourceManager.GetObject("pencil", resourceCulture); @@ -829,9 +605,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Play { get { object obj = ResourceManager.GetObject("Play", resourceCulture); @@ -839,9 +612,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap poke { get { object obj = ResourceManager.GetObject("poke", resourceCulture); @@ -849,9 +619,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Previous { get { object obj = ResourceManager.GetObject("Previous", resourceCulture); @@ -859,9 +626,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap PrintPreviewHS { get { object obj = ResourceManager.GetObject("PrintPreviewHS", resourceCulture); @@ -869,9 +633,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap ReadOnly { get { object obj = ResourceManager.GetObject("ReadOnly", resourceCulture); @@ -879,9 +640,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap reboot { get { object obj = ResourceManager.GetObject("reboot", resourceCulture); @@ -889,9 +647,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Recent { get { object obj = ResourceManager.GetObject("Recent", resourceCulture); @@ -899,9 +654,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap RecordHS { get { object obj = ResourceManager.GetObject("RecordHS", resourceCulture); @@ -909,9 +661,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap redo { get { object obj = ResourceManager.GetObject("redo", resourceCulture); @@ -919,9 +668,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Refresh { get { object obj = ResourceManager.GetObject("Refresh", resourceCulture); @@ -929,9 +675,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Refresh1 { get { object obj = ResourceManager.GetObject("Refresh1", resourceCulture); @@ -939,9 +682,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap restart { get { object obj = ResourceManager.GetObject("restart", resourceCulture); @@ -949,9 +689,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap RetroQuestion { get { object obj = ResourceManager.GetObject("RetroQuestion", resourceCulture); @@ -959,9 +696,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap SaturnController { get { object obj = ResourceManager.GetObject("SaturnController", resourceCulture); @@ -969,9 +703,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Save { get { object obj = ResourceManager.GetObject("Save", resourceCulture); @@ -979,9 +710,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap SaveAs { get { object obj = ResourceManager.GetObject("SaveAs", resourceCulture); @@ -989,9 +717,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap SaveConfig { get { object obj = ResourceManager.GetObject("SaveConfig", resourceCulture); @@ -999,9 +724,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Scan { get { object obj = ResourceManager.GetObject("Scan", resourceCulture); @@ -1009,9 +731,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap search { get { object obj = ResourceManager.GetObject("search", resourceCulture); @@ -1019,9 +738,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap sms_icon { get { object obj = ResourceManager.GetObject("sms_icon", resourceCulture); @@ -1039,9 +755,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap SNES_Controller { get { object obj = ResourceManager.GetObject("SNES_Controller", resourceCulture); @@ -1049,9 +762,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap SNESControllerIcon { get { object obj = ResourceManager.GetObject("SNESControllerIcon", resourceCulture); @@ -1059,9 +769,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Stop { get { object obj = ResourceManager.GetObject("Stop", resourceCulture); @@ -1069,9 +776,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TAStudio { get { object obj = ResourceManager.GetObject("TAStudio", resourceCulture); @@ -1079,9 +783,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap textdoc { get { object obj = ResourceManager.GetObject("textdoc", resourceCulture); @@ -1089,9 +790,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TI83_Controller { get { object obj = ResourceManager.GetObject("TI83_Controller", resourceCulture); @@ -1099,9 +797,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TI83Calculator { get { object obj = ResourceManager.GetObject("TI83Calculator", resourceCulture); @@ -1109,9 +804,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap ToolBox { get { object obj = ResourceManager.GetObject("ToolBox", resourceCulture); @@ -1119,9 +811,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Translation { get { object obj = ResourceManager.GetObject("Translation", resourceCulture); @@ -1129,9 +818,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TruncateFromFile { get { object obj = ResourceManager.GetObject("TruncateFromFile", resourceCulture); @@ -1139,9 +825,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TruncateFromRW { get { object obj = ResourceManager.GetObject("TruncateFromRW", resourceCulture); @@ -1149,9 +832,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap TurboFastForward { get { object obj = ResourceManager.GetObject("TurboFastForward", resourceCulture); @@ -1159,9 +839,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap tvIcon { get { object obj = ResourceManager.GetObject("tvIcon", resourceCulture); @@ -1169,9 +846,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap undo { get { object obj = ResourceManager.GetObject("undo", resourceCulture); @@ -1179,9 +853,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap Unfreeze { get { object obj = ResourceManager.GetObject("Unfreeze", resourceCulture); @@ -1189,9 +860,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap WarningHS { get { object obj = ResourceManager.GetObject("WarningHS", resourceCulture); @@ -1199,9 +867,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap watch { get { object obj = ResourceManager.GetObject("watch", resourceCulture); @@ -1209,9 +874,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap whiteTriDown { get { object obj = ResourceManager.GetObject("whiteTriDown", resourceCulture); @@ -1219,9 +881,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap whiteTriLeft { get { object obj = ResourceManager.GetObject("whiteTriLeft", resourceCulture); @@ -1229,9 +888,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap whiteTriRight { get { object obj = ResourceManager.GetObject("whiteTriRight", resourceCulture); @@ -1239,9 +895,6 @@ namespace BizHawk.Client.EmuHawk.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// internal static System.Drawing.Bitmap whiteTriUp { get { object obj = ResourceManager.GetObject("whiteTriUp", resourceCulture); diff --git a/BizHawk.Client.EmuHawk/Properties/Resources.resx b/BizHawk.Client.EmuHawk/Properties/Resources.resx index d502093a2e..bb1cd5eae8 100644 --- a/BizHawk.Client.EmuHawk/Properties/Resources.resx +++ b/BizHawk.Client.EmuHawk/Properties/Resources.resx @@ -118,6 +118,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\config\ControllerImages\C64Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\checkbox.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\AudioHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -139,6 +145,9 @@ ..\images\SaveAs.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\tvIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\Save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -148,9 +157,6 @@ ..\config\ControllerImages\SMSController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\MoveRight.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -160,8 +166,11 @@ ..\images\poke.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\config\ControllerImages\GBA_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\config\ControllerImages\A78Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\NewFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -181,62 +190,68 @@ ..\images\Bug.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\LoadConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\corphawk.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\PrintPreviewHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\AVI.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\SNESControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Play.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\TruncateFromRW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\CutHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\LightOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Hack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Lightning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\HotKeys.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Refresh.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\InsertSeparator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\LightOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\MessageConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\CopyFolderHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\Recent.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\config\ControllerImages\N64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\config\ControllerImages\colecovisioncontroller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\config\ControllerImages\IntVController.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\Unfreeze.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\TruncateFromRW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\BackMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Blank.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\logo.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\pcb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\config\ControllerImages\SNES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\LightOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -247,39 +262,42 @@ ..\images\addWatch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\OpenFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\ToolBox.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\GenesisControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\Debugger.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\FindHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\Scan.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\GameController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\gba-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Blank.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\cheat.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Refresh.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\whiteTriDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\undo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\alt_about_image.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -289,8 +307,8 @@ ..\images\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\watch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\MoveUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\ExclamationRed.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -310,11 +328,11 @@ ..\images\Freeze.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\WarningHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\config\ControllerImages\TI83_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\NESControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -325,8 +343,8 @@ ..\images\SaveConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\undo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -768,44 +786,38 @@ ..\config\ControllerImages\GBController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\config\ControllerImages\TI83Calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\OpenFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\config\ControllerImages\SNES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\config\ControllerImages\C64Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Previous.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\HomeBrew.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\logo.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Hack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\RecordHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\gba-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\GreenCheck.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\BackMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Cheats.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\AutoSearch.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Lightning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Play.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Cheats.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\Pause.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -819,62 +831,59 @@ ..\images\MoveLeft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\TAStudio.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\atari_controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\CorpHawkSmall.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\PrintPreviewHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\config\ControllerImages\A78Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\config\ControllerImages\C64Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\ForwardMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\WarningHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Forward.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Duplicate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\C64Symbol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\Previous.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Translation.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\restart.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\CorpHawkSmall.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Duplicate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\config\ControllerImages\C64Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\config\ControllerImages\GBA_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Forward.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\config\ControllerImages\IntVController.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\C64Symbol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\config\ControllerImages\TI83Calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\TAStudio.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\config\ControllerImages\GENController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\config\ControllerImages\N64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\atari_controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\Translation.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\ForwardMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\ReadOnly.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\config\ControllerImages\TI83_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\config\ControllerImages\NES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -882,20 +891,14 @@ ..\images\Lua.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\CopyFolderHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\GenesisControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\MoveUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\watch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\pcb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\tvIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\images\checkbox.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Erase.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\sms-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs index 80a5e2a7d7..3acdf8cf59 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs @@ -30,7 +30,6 @@ { this.btnCancel = new System.Windows.Forms.Button(); this.btnOk = new System.Windows.Forms.Button(); - this.checkBilinearFilter = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.tbScanlineIntensity = new System.Windows.Forms.TrackBar(); @@ -38,15 +37,24 @@ this.rbScanlines = new System.Windows.Forms.RadioButton(); this.rbHq2x = new System.Windows.Forms.RadioButton(); this.checkLetterbox = new System.Windows.Forms.CheckBox(); + this.checkPadInteger = new System.Windows.Forms.CheckBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.rbFinalFilterBicubic = new System.Windows.Forms.RadioButton(); + this.rbFinalFilterNone = new System.Windows.Forms.RadioButton(); + this.rbFinalFilterBilinear = new System.Windows.Forms.RadioButton(); + this.rbUser = new System.Windows.Forms.RadioButton(); + this.btnSelectUserFilter = new System.Windows.Forms.Button(); + this.lblUserFilterName = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit(); + this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(205, 201); + this.btnCancel.Location = new System.Drawing.Point(289, 190); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 5; @@ -56,7 +64,7 @@ // btnOk // this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOk.Location = new System.Drawing.Point(124, 201); + this.btnOk.Location = new System.Drawing.Point(208, 190); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(75, 23); this.btnOk.TabIndex = 4; @@ -64,16 +72,6 @@ this.btnOk.UseVisualStyleBackColor = true; this.btnOk.Click += new System.EventHandler(this.btnOk_Click); // - // checkBilinearFilter - // - this.checkBilinearFilter.AutoSize = true; - this.checkBilinearFilter.Location = new System.Drawing.Point(12, 145); - this.checkBilinearFilter.Name = "checkBilinearFilter"; - this.checkBilinearFilter.Size = new System.Drawing.Size(85, 17); - this.checkBilinearFilter.TabIndex = 0; - this.checkBilinearFilter.Text = "Bilinear Filter"; - this.checkBilinearFilter.UseVisualStyleBackColor = true; - // // label1 // this.label1.AutoSize = true; @@ -85,16 +83,19 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.lblUserFilterName); + this.groupBox1.Controls.Add(this.btnSelectUserFilter); + this.groupBox1.Controls.Add(this.rbUser); this.groupBox1.Controls.Add(this.tbScanlineIntensity); this.groupBox1.Controls.Add(this.rbNone); this.groupBox1.Controls.Add(this.rbScanlines); this.groupBox1.Controls.Add(this.rbHq2x); this.groupBox1.Location = new System.Drawing.Point(12, 34); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(200, 105); + this.groupBox1.Size = new System.Drawing.Size(173, 132); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; - this.groupBox1.Text = "Filter"; + this.groupBox1.Text = "Scaling Filter"; // // tbScanlineIntensity // @@ -143,24 +144,109 @@ // checkLetterbox // this.checkLetterbox.AutoSize = true; - this.checkLetterbox.Location = new System.Drawing.Point(12, 168); + this.checkLetterbox.Location = new System.Drawing.Point(12, 172); this.checkLetterbox.Name = "checkLetterbox"; - this.checkLetterbox.Size = new System.Drawing.Size(188, 17); + this.checkLetterbox.Size = new System.Drawing.Size(173, 17); this.checkLetterbox.TabIndex = 8; - this.checkLetterbox.Text = "Letterbox (to maintain aspect ratio)"; + this.checkLetterbox.Text = "Maintain aspect ratio (letterbox)"; this.checkLetterbox.UseVisualStyleBackColor = true; // + // checkPadInteger + // + this.checkPadInteger.AutoSize = true; + this.checkPadInteger.Location = new System.Drawing.Point(12, 195); + this.checkPadInteger.Name = "checkPadInteger"; + this.checkPadInteger.Size = new System.Drawing.Size(120, 17); + this.checkPadInteger.TabIndex = 9; + this.checkPadInteger.Text = "Pad to integer scale"; + this.checkPadInteger.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.rbFinalFilterBicubic); + this.groupBox2.Controls.Add(this.rbFinalFilterNone); + this.groupBox2.Controls.Add(this.rbFinalFilterBilinear); + this.groupBox2.Location = new System.Drawing.Point(191, 34); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(173, 132); + this.groupBox2.TabIndex = 8; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Final Filter"; + // + // rbFinalFilterBicubic + // + this.rbFinalFilterBicubic.AutoSize = true; + this.rbFinalFilterBicubic.Location = new System.Drawing.Point(7, 65); + this.rbFinalFilterBicubic.Name = "rbFinalFilterBicubic"; + this.rbFinalFilterBicubic.Size = new System.Drawing.Size(142, 17); + this.rbFinalFilterBicubic.TabIndex = 3; + this.rbFinalFilterBicubic.TabStop = true; + this.rbFinalFilterBicubic.Text = "Bicubic (shader. buggy?)"; + this.rbFinalFilterBicubic.UseVisualStyleBackColor = true; + // + // rbFinalFilterNone + // + this.rbFinalFilterNone.AutoSize = true; + this.rbFinalFilterNone.Location = new System.Drawing.Point(6, 19); + this.rbFinalFilterNone.Name = "rbFinalFilterNone"; + this.rbFinalFilterNone.Size = new System.Drawing.Size(51, 17); + this.rbFinalFilterNone.TabIndex = 2; + this.rbFinalFilterNone.TabStop = true; + this.rbFinalFilterNone.Text = "None"; + this.rbFinalFilterNone.UseVisualStyleBackColor = true; + // + // rbFinalFilterBilinear + // + this.rbFinalFilterBilinear.AutoSize = true; + this.rbFinalFilterBilinear.Location = new System.Drawing.Point(6, 42); + this.rbFinalFilterBilinear.Name = "rbFinalFilterBilinear"; + this.rbFinalFilterBilinear.Size = new System.Drawing.Size(59, 17); + this.rbFinalFilterBilinear.TabIndex = 0; + this.rbFinalFilterBilinear.TabStop = true; + this.rbFinalFilterBilinear.Text = "Bilinear"; + this.rbFinalFilterBilinear.UseVisualStyleBackColor = true; + // + // rbUser + // + this.rbUser.AutoSize = true; + this.rbUser.Location = new System.Drawing.Point(6, 88); + this.rbUser.Name = "rbUser"; + this.rbUser.Size = new System.Drawing.Size(47, 17); + this.rbUser.TabIndex = 4; + this.rbUser.TabStop = true; + this.rbUser.Text = "User"; + this.rbUser.UseVisualStyleBackColor = true; + // + // btnSelectUserFilter + // + this.btnSelectUserFilter.Location = new System.Drawing.Point(83, 88); + this.btnSelectUserFilter.Name = "btnSelectUserFilter"; + this.btnSelectUserFilter.Size = new System.Drawing.Size(75, 23); + this.btnSelectUserFilter.TabIndex = 5; + this.btnSelectUserFilter.Text = "Select"; + this.btnSelectUserFilter.UseVisualStyleBackColor = true; + this.btnSelectUserFilter.Click += new System.EventHandler(this.btnSelectUserFilter_Click); + // + // lblUserFilterName + // + this.lblUserFilterName.Location = new System.Drawing.Point(6, 114); + this.lblUserFilterName.Name = "lblUserFilterName"; + this.lblUserFilterName.Size = new System.Drawing.Size(161, 15); + this.lblUserFilterName.TabIndex = 10; + this.lblUserFilterName.Text = "Will contain user filter name"; + // // DisplayConfigLite // this.AcceptButton = this.btnOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(292, 236); + this.ClientSize = new System.Drawing.Size(376, 225); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.checkPadInteger); this.Controls.Add(this.checkLetterbox); this.Controls.Add(this.groupBox1); this.Controls.Add(this.label1); - this.Controls.Add(this.checkBilinearFilter); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOk); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; @@ -169,6 +255,8 @@ this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -178,7 +266,6 @@ private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnOk; - private System.Windows.Forms.CheckBox checkBilinearFilter; private System.Windows.Forms.Label label1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.RadioButton rbNone; @@ -186,5 +273,13 @@ private System.Windows.Forms.RadioButton rbHq2x; private System.Windows.Forms.TrackBar tbScanlineIntensity; private System.Windows.Forms.CheckBox checkLetterbox; + private System.Windows.Forms.CheckBox checkPadInteger; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.RadioButton rbFinalFilterBicubic; + private System.Windows.Forms.RadioButton rbFinalFilterNone; + private System.Windows.Forms.RadioButton rbFinalFilterBilinear; + private System.Windows.Forms.Button btnSelectUserFilter; + private System.Windows.Forms.RadioButton rbUser; + private System.Windows.Forms.Label lblUserFilterName; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs index 1b6aef02c7..1cb1fc3efc 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -14,6 +15,7 @@ namespace BizHawk.Client.EmuHawk.config { public partial class DisplayConfigLite : Form { + string PathSelection; public DisplayConfigLite() { InitializeComponent(); @@ -21,8 +23,18 @@ namespace BizHawk.Client.EmuHawk.config rbNone.Checked = Global.Config.TargetDisplayFilter == 0; rbHq2x.Checked = Global.Config.TargetDisplayFilter == 1; rbScanlines.Checked = Global.Config.TargetDisplayFilter == 2; - checkBilinearFilter.Checked = Global.Config.DispBlurry; + rbUser.Checked = Global.Config.TargetDisplayFilter == 3; + + PathSelection = Global.Config.DispUserFilterPath ?? ""; + RefreshState(); + + rbFinalFilterNone.Checked = Global.Config.DispFinalFilter == 0; + rbFinalFilterBilinear.Checked = Global.Config.DispFinalFilter == 1; + rbFinalFilterBicubic.Checked = Global.Config.DispFinalFilter == 2; + tbScanlineIntensity.Value = Global.Config.TargetScanlineFilterIntensity; + checkLetterbox.Checked = Global.Config.DispFixAspectRatio; + checkPadInteger.Checked = Global.Config.DispFixScaleInteger; } private void btnOk_Click(object sender, EventArgs e) @@ -33,12 +45,42 @@ namespace BizHawk.Client.EmuHawk.config Global.Config.TargetDisplayFilter = 1; if (rbScanlines.Checked) Global.Config.TargetDisplayFilter = 2; + if (rbUser.Checked) + Global.Config.TargetDisplayFilter = 3; + + if(rbFinalFilterNone.Checked) + Global.Config.DispFinalFilter = 0; + if(rbFinalFilterBilinear.Checked) + Global.Config.DispFinalFilter = 1; + if(rbFinalFilterBicubic.Checked) + Global.Config.DispFinalFilter = 2; - Global.Config.DispBlurry = checkBilinearFilter.Checked; Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value; + Global.Config.DispUserFilterPath = PathSelection; + GlobalWin.DisplayManager.RefreshUserShader(); + DialogResult = System.Windows.Forms.DialogResult.OK; Close(); } + + void RefreshState() + { + lblUserFilterName.Text = Path.GetFileNameWithoutExtension(PathSelection); + } + + private void btnSelectUserFilter_Click(object sender, EventArgs e) + { + var ofd = new OpenFileDialog(); + ofd.Filter = ".CGP (*.cgp)|*.cgp"; + ofd.FileName = PathSelection; + if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + rbUser.Checked = true; + PathSelection = Path.GetFullPath(ofd.FileName); + RefreshState(); + } + } + } } diff --git a/BizHawk.Client.EmuHawk/images/Erase.png b/BizHawk.Client.EmuHawk/images/Erase.png new file mode 100644 index 0000000000000000000000000000000000000000..6b716c3dc0655528911f8e9f026ba399025fb3fb GIT binary patch literal 612 zcmV-q0-ODbP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy8gxZibW?9;ba!ELWdKlNX>N2bPDNB8b~7$DE-^4L^m3s900F#7 zL_t(IPkoZjOTus%$A29=#Ox6C^6zwr4xKwi9l}#35<*dzm}OK5*(y;fOKrZ)+_D#Y z(byo=!h>{>C|`z=fo&?}E$p$?$eBGnjIn*b-{-sEo;EIVhY%{gSK<0+iGuLPvcugy z-56E}=<7(WbrlK)=i1t{(O5H^rACL5E8x*wC$#cLgV}7h+nbx$c>JBBKCIT-_BNs} zFa8#2umSB*EEdaTGLPwW`r+Xv8m-ba@|>SFCxRs4EzwUumF4;SWD*^mo+t!B+wFEG zoz13FDWBhu9LGluk#ws5sX;Im1cB#y$vyi;GYsQ&xzHYS_*>9E+U4}P%H?vYRH{@e z#bPm^&jU@-EUy_sNlfAP54CMG;QFUho9$WjYiJA&Zv;fkkxSiPf=nwa4!T zdx?gEIV{VPBsn>&!Nz*)S+))wvS4C<3IYHm)45!Zq9{lL^!JZ4?eEHh@fmd>5P(Q9 z1X6*L<2W40A&DFt8F#F*V4lOn;jqbM0vU_~d+ow>$7oN(F)nRx$O8BbXpjYiL4(1d y)9F+reae-YU0(cW`I=v$6=J>R@_lWjV!|i;dKhdxl^g{C0000 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp - olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4 - 4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm - YWyoYla/B+1M9JtxWLPpaH22JORIjI6gKAMB0jyEimIdo4OlbuaprwVMOOMovammpDADc34qppwUrmnl - 5Kni3aFlFg2j3y1z5mnRTJccnNIltQhwq0jFry+mOXNtpWZWDx1Z1NhV3C3JwGFOw25SYjVe5oYhiUKd - HKMmwQUrMWUw/CF3NnZvvYKqUh1TvUroS3fXe7HXkwidMngTS2t5KLbregSzMY2f3Wr4qKW6LJvGR1rX - 0MLor8OhKYTJBn/GHvvxrliCTBrsOqXIoOBHh5K+hmSq7FqmexTQHuUytkaKxuNMNgYyVneA4Qd7GKjc - hjLaRzxH7gIU6JIZaEvgtk1D8wsxSWecCDgNzWFMvwxm/PkhRmr3Mli1nW9lvjRdWc0Jf+/5jzRmyWmv - S+GOLQu6U6BFjPvqKOP1AYw88WOoZif9DgmfLVtxaj1RSLdwNvrkPCA3M54KqxrnvRia9MKcGrUrqFOt - 5H7qKsqT1mGO9+Lqhc2ELdw+U/r0i+gVZ8hMiCDx3DHORwZyKnQ/hw/uYt9uCTskPvh6e7Fp41rWr/Fg - g6eHO+A/lyD8ARfG3mk9fv1YAAAAAElFTkSuQmCC + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I + k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC + TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p + AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0 + BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr + UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG + CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5 + F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS + rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt + NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp + 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W + AAAAAElFTkSuQmCC diff --git a/BizHawk.Common/Extensions/Extensions.cs b/BizHawk.Common/Extensions/Extensions.cs index 038605935c..6342694e21 100644 --- a/BizHawk.Common/Extensions/Extensions.cs +++ b/BizHawk.Common/Extensions/Extensions.cs @@ -18,6 +18,16 @@ namespace BizHawk.Common return Path.GetDirectoryName(path); } + public static IEnumerable> EnumerateNodes(this LinkedList list) + { + var node = list.First; + while (node != null) + { + yield return node; + node = node.Next; + } + } + public static int LowerBoundBinarySearch(this IList list, Func keySelector, TKey key) where TKey : IComparable { int min = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs index cfa6fc33bf..6a5685e604 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs @@ -36,6 +36,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi private delegate void ReadScreen2Res(IntPtr dummy, ref int width, ref int height, int buffer); ReadScreen2Res GFXReadScreen2Res; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate Int32 GetScreenTextureID(); + GetScreenTextureID GFXGetScreenTextureID; + public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings) { @@ -58,6 +63,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi videoplugin); GFXReadScreen2 = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2)); GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res)); + if(GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero) + GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID)); } public void GetScreenDimensions(ref int width, ref int height) diff --git a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/BizHawk.Bizware.BizwareGL.OpenTK.csproj b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/BizHawk.Bizware.BizwareGL.OpenTK.csproj index f1ae381fe4..0ada5332b5 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/BizHawk.Bizware.BizwareGL.OpenTK.csproj +++ b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/BizHawk.Bizware.BizwareGL.OpenTK.csproj @@ -53,6 +53,10 @@ + + {866F8D13-0678-4FF9-80A4-A3993FD4D8A3} + BizHawk.Common + {9F84A0B2-861E-4EF4-B89B-5E2A3F38A465} BizHawk.Bizware.BizwareGL diff --git a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs index b769216156..63f4f2227a 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs @@ -261,6 +261,20 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK GL.BindTexture(TextureTarget.Texture2D, tex.Id.ToInt32()); } + public void SetTextureWrapMode(Texture2d tex, bool clamp) + { + BindTexture2d(tex); + int mode; + if (clamp) + { + mode = (int)global::OpenTK.Graphics.OpenGL.TextureWrapMode.ClampToEdge; + } + else + mode = (int)global::OpenTK.Graphics.OpenGL.TextureWrapMode.Repeat; + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, mode); + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, mode); + } + public unsafe void BindArrayData(void* pData) { MyBindArrayData(sStatePendingVertexLayout, pData); @@ -351,6 +365,11 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK return new Texture2d(this, id, width, height); } + public Texture2d WrapGLTexture2d(IntPtr glTexId, int width, int height) + { + return new Texture2d(this as IGL,glTexId, width, height); + } + public void LoadTextureData(Texture2d tex, BitmapBuffer bmp) { sdi.BitmapData bmp_data = bmp.LockBits(); diff --git a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/RetroShader.cs b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/RetroShader.cs index 76c789e118..20101be5df 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/RetroShader.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/RetroShader.cs @@ -57,6 +57,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK var Modelview = Owner.CreateGuiViewMatrix(OutputSize); Pipeline["MVPMatrix"].Set(Modelview * Projection, false); + Owner.SetTextureWrapMode(tex, true); Pipeline["Texture"].Set(tex); Owner.SetViewport(OutputSize); @@ -81,6 +82,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK pData[i++] = 0; pData[i++] = 0; pData[i++] = 0; pData[i++] = 0; //junk pData[i++] = 1; pData[i++] = v1; //texcoord + Owner.SetBlendState(Owner.BlendNone); Owner.BindArrayData(pData); Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4); } diff --git a/Bizware/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs b/Bizware/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs index 5d15763061..218eef9e57 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs @@ -29,6 +29,8 @@ namespace BizHawk.Bizware.BizwareGL public int Width, Height; public int[] Pixels; + public Size Size { get { return new Size(Width, Height); } } + sd.Bitmap WrappedBitmap; GCHandle CurrLockHandle; BitmapData CurrLock; diff --git a/Bizware/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj b/Bizware/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj index 28cb4ec6e8..8ce68abcf9 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj +++ b/Bizware/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj @@ -82,6 +82,12 @@ + + + {866F8D13-0678-4FF9-80A4-A3993FD4D8A3} + BizHawk.Common + +