diff --git a/src/com/nokia/mid/m3d/M3D.java b/src/com/nokia/mid/m3d/M3D.java index ca5f9d71..76bdf29d 100644 --- a/src/com/nokia/mid/m3d/M3D.java +++ b/src/com/nokia/mid/m3d/M3D.java @@ -65,8 +65,8 @@ public class M3D private double near; private double far; - private int color = 0xFF000000; - private int clearcolor = 0xFFFFFFFF; + private int color = 0xFF000000|Mobile.lcduiTextColor; + private int clearcolor = 0xFF000000|Mobile.lcduiBGColor; private M3D() { } @@ -235,12 +235,12 @@ public void popMatrix() public void color4ub(byte r, byte g, byte b, byte a) { - color = ((0xFF)<<24) | ((r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF); + color = (((0xFF)<<24) | ((r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF))|Mobile.lcduiTextColor; } public void clearColor4ub(byte r, byte g, byte b, byte a) { - clearcolor = ((0xFF)<<24) | ((r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF); + clearcolor = (((0xFF)<<24) | ((r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF))|Mobile.lcduiBGColor; } public void vertexPointerub(int a, int b, byte[] vertices) diff --git a/src/com/nokia/mid/m3d/Texture.java b/src/com/nokia/mid/m3d/Texture.java index 7baa7955..34bf2b39 100644 --- a/src/com/nokia/mid/m3d/Texture.java +++ b/src/com/nokia/mid/m3d/Texture.java @@ -19,6 +19,7 @@ import javax.microedition.lcdui.Image; +import org.recompile.mobile.Mobile; import org.recompile.mobile.PlatformImage; public class Texture @@ -39,7 +40,7 @@ public class Texture private double[] tempm = new double[9]; // scratch - private int[] colors = {0xFFFFFFFF, 0xFF000000}; + private int[] colors = {0xFF000000|Mobile.lcduiBGColor, 0xFF000000|Mobile.lcduiTextColor}; public Texture() { } public Texture(int a, int b, Image c) diff --git a/src/javax/microedition/lcdui/Alert.java b/src/javax/microedition/lcdui/Alert.java index faad6803..4f9761f0 100644 --- a/src/javax/microedition/lcdui/Alert.java +++ b/src/javax/microedition/lcdui/Alert.java @@ -170,6 +170,7 @@ public String renderScreen(int x, int y, int width, int height) { return ""; } + graphics.setColor(Mobile.lcduiTextColor); for(int l=0;l 0 ? (l-1)*lineSpacing : 0); int yend = ystart + Font.getDefaultFont().getHeight(); diff --git a/src/javax/microedition/lcdui/Canvas.java b/src/javax/microedition/lcdui/Canvas.java index 6b4d1a5a..aab74e04 100644 --- a/src/javax/microedition/lcdui/Canvas.java +++ b/src/javax/microedition/lcdui/Canvas.java @@ -260,12 +260,11 @@ private void paintCommandsBar() int padding = 2; + graphics.setColor(Mobile.lcduiTextColor); if (!commands.isEmpty()) { - graphics.setColor(Mobile.lcduiTextColor); graphics.drawString(commands.size() > 2 ? "Options" : commands.get(0).getLabel(), padding, height-barHeight, Graphics.LEFT); } - if (commands.size() == 2) { graphics.drawString(commands.get(1).getLabel(), width-padding, height-barHeight, Graphics.RIGHT); diff --git a/src/javax/microedition/lcdui/Displayable.java b/src/javax/microedition/lcdui/Displayable.java index a4c19cf9..cbb14fa0 100644 --- a/src/javax/microedition/lcdui/Displayable.java +++ b/src/javax/microedition/lcdui/Displayable.java @@ -188,19 +188,20 @@ protected void render() { if(currentCommand == i) { - graphics.fillRect(0,y,width,itemHeight); graphics.setColor(Mobile.lcduiBGColor); + graphics.fillRect(0,y,width,itemHeight); } + graphics.setColor(Mobile.lcduiTextColor); graphics.drawString(commands.get(i).getLabel(), width/2, y, Graphics.HCENTER); - graphics.setColor(Mobile.lcduiTextColor); y += itemHeight; } } currentY += contentHeight; + graphics.setColor(Mobile.lcduiTextColor); graphics.drawString("Okay", xPadding, currentY+titlePadding, Graphics.LEFT); graphics.drawString("Back", width-xPadding, currentY+titlePadding, Graphics.RIGHT); } @@ -219,6 +220,7 @@ protected void render() itemCommand = ((Form)this).getItemCommand(); } + graphics.setColor(Mobile.lcduiTextColor); switch(commands.size()) { case 0: break; diff --git a/src/javax/microedition/lcdui/Item.java b/src/javax/microedition/lcdui/Item.java index d6f1da8d..c25d442d 100644 --- a/src/javax/microedition/lcdui/Item.java +++ b/src/javax/microedition/lcdui/Item.java @@ -154,6 +154,7 @@ protected void renderItemLabel(PlatformGraphics graphics, int x, int y, int item { Font oldFont = graphics.getFont(); graphics.setFont(Font.getDefaultFont()); + graphics.setColor(Mobile.lcduiTextColor); graphics.drawString(getLabel(), x, y, 0); graphics.setFont(oldFont); } diff --git a/src/javax/microedition/lcdui/StringItem.java b/src/javax/microedition/lcdui/StringItem.java index 51a09aa4..99f73756 100644 --- a/src/javax/microedition/lcdui/StringItem.java +++ b/src/javax/microedition/lcdui/StringItem.java @@ -120,6 +120,7 @@ protected void renderItem(PlatformGraphics graphics, int x, int y, int width, in } else { + graphics.setColor(Mobile.lcduiTextColor); for(int l=0;l= (pixels.length * 8)) { throw new ArrayIndexOutOfBoundsException("drawPixels(byte) index out of bounds:" + width + " * " + height + "| pixels len:" + (pixels.length * 8) + "| offset:" + offset); } - int[] Type1 = {0xFFFFFFFF, 0xFF000000, 0x00FFFFFF, 0x00000000}; + int[] Type1 = {0xFF000000|Mobile.lcduiBGColor, 0xFF000000|Mobile.lcduiTextColor, 0x00000000|Mobile.lcduiBGColor, 0x00000000|Mobile.lcduiTextColor}; int c = 0; BufferedImage temp = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);// Nokia DirectGraphics states that image width and height CAN be zero. final int[] data = ((DataBufferInt) temp.getRaster().getDataBuffer()).getData();