|
@@ -12,10 +12,16 @@ using bbiwarg.Utility;
|
|
|
|
|
|
namespace bbiwarg.Graphics
|
|
namespace bbiwarg.Graphics
|
|
{
|
|
{
|
|
|
|
+ public enum PalmGridControlFocus {
|
|
|
|
+ Rows,
|
|
|
|
+ Columns
|
|
|
|
+ }
|
|
|
|
+
|
|
class OutputWindow : GameWindow
|
|
class OutputWindow : GameWindow
|
|
{
|
|
{
|
|
private InputHandler inputHandler;
|
|
private InputHandler inputHandler;
|
|
private InputProvider inputProvider;
|
|
private InputProvider inputProvider;
|
|
|
|
+ private PalmGridControlFocus palmGridControlFocus;
|
|
|
|
|
|
private uint textureID;
|
|
private uint textureID;
|
|
|
|
|
|
@@ -47,13 +53,10 @@ namespace bbiwarg.Graphics
|
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
|
|
|
|
|
- // video controls
|
|
|
|
|
|
+ palmGridControlFocus = PalmGridControlFocus.Rows;
|
|
|
|
+ Keyboard.KeyDown += HandleKeyDownPalmGridControls;
|
|
if (inputProvider is VideoInputProvider)
|
|
if (inputProvider is VideoInputProvider)
|
|
- {
|
|
|
|
- Keyboard.KeyRepeat = true;
|
|
|
|
- Keyboard.KeyDown += HandleKeyDown;
|
|
|
|
- Logger.log("video controls enabled (space=pause, right=nextFrame, left=previousFrame)", LogSubject.VideoControls);
|
|
|
|
- }
|
|
|
|
|
|
+ Keyboard.KeyDown += HandleKeyDownVideoControls;
|
|
|
|
|
|
VSync = VSyncMode.Off;
|
|
VSync = VSyncMode.Off;
|
|
}
|
|
}
|
|
@@ -127,7 +130,7 @@ namespace bbiwarg.Graphics
|
|
Timer.outputAll();
|
|
Timer.outputAll();
|
|
}
|
|
}
|
|
|
|
|
|
- private void HandleKeyDown(object sender, KeyboardKeyEventArgs e)
|
|
|
|
|
|
+ private void HandleKeyDownVideoControls(object sender, KeyboardKeyEventArgs e)
|
|
{
|
|
{
|
|
VideoInputProvider vip = (VideoInputProvider)inputProvider;
|
|
VideoInputProvider vip = (VideoInputProvider)inputProvider;
|
|
switch (e.Key)
|
|
switch (e.Key)
|
|
@@ -154,5 +157,34 @@ namespace bbiwarg.Graphics
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void HandleKeyDownPalmGridControls(object sender, KeyboardKeyEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ switch (e.Key) {
|
|
|
|
+ case Key.R:
|
|
|
|
+ palmGridControlFocus = PalmGridControlFocus.Rows;
|
|
|
|
+ break;
|
|
|
|
+ case Key.C:
|
|
|
|
+ palmGridControlFocus = PalmGridControlFocus.Columns;
|
|
|
|
+ break;
|
|
|
|
+ case Key.Plus:
|
|
|
|
+ case Key.KeypadPlus:
|
|
|
|
+ case Key.BracketRight: //fix
|
|
|
|
+ if (palmGridControlFocus == PalmGridControlFocus.Rows)
|
|
|
|
+ Constants.PalmGridNumRows++;
|
|
|
|
+ else
|
|
|
|
+ Constants.PalmGridNumColumns++;
|
|
|
|
+ break;
|
|
|
|
+ case Key.Minus:
|
|
|
|
+ case Key.KeypadMinus:
|
|
|
|
+ case Key.Slash: //fix
|
|
|
|
+ if (palmGridControlFocus == PalmGridControlFocus.Rows)
|
|
|
|
+ Constants.PalmGridNumRows = Math.Max(1, Constants.PalmGridNumRows - 1);
|
|
|
|
+ else
|
|
|
|
+ Constants.PalmGridNumColumns = Math.Max(1, Constants.PalmGridNumColumns-1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|