|
|
发表于 2005-12-13 23:45:00
|
显示全部楼层
Re: 谁想作兼职啊?反编译手机游戏代码,
看你发贴子招聘人作反编译手机游戏代码,最好自己从网上找反编译器,自己作反编译手机游戏代码。我送你一个关于MIDP2APIGAME类部分反编译文件。QQ:523125933
package javax.microedition.lcdui.game;
import com.sun.midp.lcdui.DisplayAccess;
import com.sun.midp.lcdui.GameMap;
import javax.microedition.lcdui.*;
// Referenced classes of package javax.microedition.lcdui.game:
// GameDeviceCaps
public abstract class GameCanvas extends Canvas
{
protected GameCanvas(boolean suppressKeyEvents)
{
offscreen_buffer = Image.createImage(FULLSCREEN_WIDTH, FULLSCREEN_HEIGHT);
setSuppressKeyEvents(this, suppressKeyEvents);
}
protected Graphics getGraphics()
{
return offscreen_buffer.getGraphics();
}
public int getKeyStates()
{
DisplayAccess displayAccess = GameMap.get(this);
if(displayAccess != null)
return displayAccess.getKeyMask();
else
return 0;
}
public void paint(Graphics g)
{
g.drawImage(offscreen_buffer, 0, 0, 20);
}
public void flushGraphics(int x, int y, int width, int height)
{
if(width < 1 || height < 1)
return;
DisplayAccess displayAccess = GameMap.get(this);
if(displayAccess != null)
displayAccess.flush(this, offscreen_buffer, x, y, width, height);
}
public void flushGraphics()
{
DisplayAccess displayAccess = GameMap.get(this);
if(displayAccess != null)
displayAccess.flush(this, offscreen_buffer, 0, 0, getWidth(), getHeight());
}
private native void setSuppressKeyEvents(Canvas canvas, boolean flag);
public static final int UP_PRESSED = 2;
public static final int DOWN_PRESSED = 64;
public static final int LEFT_PRESSED = 4;
public static final int RIGHT_PRESSED = 32;
public static final int FIRE_PRESSED = 256;
public static final int GAME_A_PRESSED = 512;
public static final int GAME_B_PRESSED = 1024;
public static final int GAME_C_PRESSED = 2048;
public static final int GAME_D_PRESSED = 4096;
private static final int FULLSCREEN_HEIGHT;
private static final int FULLSCREEN_WIDTH;
private Image offscreen_buffer;
static
{
GameDeviceCaps gdc = new GameDeviceCaps();
FULLSCREEN_WIDTH = gdc.width;
FULLSCREEN_HEIGHT = gdc.height;
gdc = null;
}
}
package javax.microedition.lcdui.game;
class GameDeviceCaps
{
GameDeviceCaps()
{
init();
}
private native void init();
int width;
int height;
}
package javax.microedition.lcdui.game;
import javax.microedition.lcdui.Graphics;
public abstract class Layer
{
Layer(int width, int height)
{
visible = true;
setWidthImpl(width);
setHeightImpl(height);
}
public void setPosition(int x, int y)
{
this.x = x;
this.y = y;
}
public void move(int dx, int dy)
{
x += dx;
y += dy;
}
public final int getX()
{
return x;
}
public final int getY()
{
return y;
}
public final int getWidth()
{
return width;
}
public final int getHeight()
{
return height;
}
public void setVisible(boolean visible)
{
this.visible = visible;
}
public final boolean isVisible()
{
return visible;
}
public abstract void paint(Graphics g);
void setWidthImpl(int width)
{
if(width < 0)
{
throw new IllegalArgumentException();
} else
{
this.width = width;
return;
}
}
void setHeightImpl(int height)
{
if(height < 0)
{
throw new IllegalArgumentException();
} else
{
this.height = height;
return;
}
}
int x;
int y;
int width;
int height;
boolean visible;
}
package javax.microedition.lcdui.game;
import javax.microedition.lcdui.Graphics;
// Referenced classes of package javax.microedition.lcdui.game:
// Layer
public class LayerManager
{
public LayerManager()
{
component = new Layer[4];
setViewWindow(0, 0, 0x7fffffff, 0x7fffffff);
}
public void append(Layer l)
{
removeImpl(l);
addImpl(l, nlayers);
}
public void insert(Layer l, int index)
{
if(index < 0 || index > nlayers)
{
throw new IndexOutOfBoundsException();
} else
{
removeImpl(l);
addImpl(l, index);
return;
}
}
public Layer getLayerAt(int index)
{
if(index < 0 || index >= nlayers)
throw new IndexOutOfBoundsException();
else
return component[index];
}
public int getSize()
{
return nlayers;
}
public void remove(Layer l)
{
removeImpl(l);
}
public void paint(Graphics g, int x, int y)
{
int clipX = g.getClipX();
int clipY = g.getClipY();
int clipW = g.getClipWidth();
int clipH = g.getClipHeight();
g.translate(x - viewX, y - viewY);
g.clipRect(viewX, viewY, viewWidth, viewHeight);
int i = nlayers;
do
{
if(--i < 0)
break;
Layer comp = component;
if(comp.visible)
comp.paint(g);
} while(true);
g.translate(-x + viewX, -y + viewY);
g.setClip(clipX, clipY, clipW, clipH);
}
public void setViewWindow(int x, int y, int width, int height)
{
if(width < 0 || height < 0)
{
throw new IllegalArgumentException();
} else
{
viewX = x;
viewY = y;
viewWidth = width;
viewHeight = height;
return;
}
}
private void addImpl(Layer layer, int index)
{
if(nlayers == component.length)
{
Layer newcomponents[] = new Layer[nlayers + 4];
System.arraycopy(component, 0, newcomponents, 0, nlayers);
System.arraycopy(component, index, newcomponents, index + 1, nlayers - index);
component = newcomponents;
} else
{
System.arraycopy(component, index, component, index + 1, nlayers - index);
}
component[index] = layer;
nlayers++;
}
private void removeImpl(Layer l)
{
if(l == null)
throw new NullPointerException();
int i = nlayers;
do
{
if(--i < 0)
break;
if(component == l)
remove(i);
} while(true);
}
private void remove(int index)
{
System.arraycopy(component, index + 1, component, index, nlayers - index - 1);
component[--nlayers] = null;
}
private int nlayers;
private Layer component[];
private int viewX;
private int viewY;
private int viewWidth;
private int viewHeight;
}
|
|