Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

sync core pkg with alt branch

  • Loading branch information...
commit 6dbd2457d7981f179d721ef9647fa75f3e5b9d5d 1 parent 1750417
mitrisdev authored
18 src/edu/mit/d54/Display2D.java
View
@@ -73,7 +73,7 @@ public Graphics2D getGraphics()
/**
* This method has been deprecated and will be removed in the future. Please use the getPixel and setPixel methods instead.
- * @deprecated Use the setRGB and getRGB methods in this class instead.
+ * @deprecated Use the setPixel and getPixel methods in this class instead.
* @return The {@link BufferedImage} backing the frame being rendered.
*/
public BufferedImage getImage()
@@ -90,6 +90,14 @@ public int getWidth()
}
/**
+ * @return The height of the display in pixels.
+ */
+ public int getHeight()
+ {
+ return height;
+ }
+
+ /**
* Get the RGB value for the specified pixel in the currently active frame.
* @param x Pixel x coordinate
* @param y Pixel y coordinate
@@ -140,14 +148,6 @@ public void setPixelHSB(int x, int y, float h, float s, float b)
}
/**
- * @return The height of the display in pixels.
- */
- public int getHeight()
- {
- return height;
- }
-
- /**
* Returns the aspect ratio (width:height) of an individual pixel. This is useful for rendering things which might
* need to be distorted to take rectangular pixels into account.
* @return The aspect ratio of an individual pixel.
2  src/edu/mit/d54/DisplayPanel.java
View
@@ -12,7 +12,7 @@
*/
public class DisplayPanel extends JPanel implements DisplayListener {
private static final long serialVersionUID = 3798905037016922251L;
- private final Display2D display;
+ protected final Display2D display;
private final int pixelX,pixelY,borderX,borderY;
/**
21 src/edu/mit/d54/PluginRunner.java
View
@@ -14,12 +14,29 @@
public static void main(String[] args) {
if (args.length<1)
{
- System.out.println("Usage: java PluginRunner <plugin-class-name>");
+ System.out.println("Usage: java PluginRunner [--framerate=<framerate] <plugin-class-name>");
System.exit(1);
}
- String clsname=args[0];
+ String clsname=null;
Display2D display=new GBDisplay();
double framerate=15.0;
+ for (String arg : args)
+ {
+ if (arg.startsWith("--framerate="))
+ {
+ framerate=Float.parseFloat(arg.substring(12));
+ }
+ else if (clsname==null)
+ {
+ clsname=arg;
+ }
+ else
+ {
+ System.out.println("Unknown or extra argument: "+arg);
+ System.exit(10);
+ }
+ }
+
DisplayPlugin plugin=null;
try
{
Please sign in to comment.
Something went wrong with that request. Please try again.