added missing patches to move to fillTriangle() and Mesh
[org.ibex.core.git] / src / org / ibex / plat / AWT.java
index 9ca0366..113ca78 100644 (file)
@@ -27,8 +27,7 @@ public class AWT extends JVM {
 
     protected void postInit() {
         if (Log.on) Log.diag(Platform.class, "               color depth = " +
-                            Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp");
-    }
+                            Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp"); }
 
     protected void _criticalAbort(String message) {
         if (Log.on) Log.info(this, message);
@@ -189,6 +188,24 @@ public class AWT extends JVM {
     
     protected static class AWTPixelBuffer implements PixelBuffer {
         
+        private int[] xpoints = new int[3];
+        private int[] ypoints = new int[3];
+        public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int argb) {
+            xpoints[0] = x1;
+            xpoints[1] = x2;
+            xpoints[2] = x3;
+            ypoints[0] = y1;
+            ypoints[1] = y2;
+            ypoints[2] = y3;
+            Graphics g = getGraphics();
+            g.setColor(new java.awt.Color((argb & 0x00ff0000) >> 16,
+                                          (argb & 0x0000ff00) >> 8,
+                                          argb & 0x000000ff/*,
+                                                             (argb & 0xff000000) >> 24*/));
+            g.fillPolygon(xpoints, ypoints, 3);
+        }
+
+        public void drawPicture(Picture p, Affine a, Mesh h) { throw new Error("drawPicture() not implemented"); }
         protected Image i = null;
         protected Graphics g = null;
         protected AWTSurface surface = null;
@@ -251,8 +268,9 @@ public class AWT extends JVM {
         }
 
         // this doens't seem to work on Windows
-        public void drawGlyph(org.ibex.graphics.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2,
-                              int rgb, int argb) {
+        public void drawGlyph(org.ibex.graphics.Font.Glyph source,Affine a,Mesh h,int rgb,int bg) {
+            //throw new Error("drawGlyph() not implemented");
+            /*
             Image i = ((AWTGlyph)source).getImage();
             if (((AWTGlyph)source).i2 == null)
                 ((AWTGlyph)source).i2 = new BufferedImage(i.getWidth(null), i.getHeight(null), BufferedImage.TYPE_INT_ARGB);
@@ -270,6 +288,7 @@ public class AWT extends JVM {
             g.fillRect(dx+i2.getWidth(null), cy1, cx2 - (dx+i2.getWidth(null)), cy2 - cy1);
             g.fillRect(cx1, dy+i2.getHeight(null), cx2 - cx1, cy2 - (dy+i2.getHeight(null)));
             g.setClip(0, 0, 1000, 1000);
+            */
         }
     }