mirror of
https://github.com/moparisthebest/MoparScape
synced 2024-11-13 12:45:01 -05:00
Fixed 317 background, started working on 508 as well.
This commit is contained in:
parent
92ec7b0e72
commit
ee56129f49
@ -118,7 +118,16 @@ public class client extends RSApplet {
|
||||
}
|
||||
|
||||
public void setBackground(java.awt.Image image){
|
||||
if(image == null)
|
||||
return;
|
||||
bgImage = image;
|
||||
// mirror the right half, since 317 requires it
|
||||
int w = bgImage.getWidth(null);
|
||||
int h = bgImage.getHeight(null);
|
||||
bgImage.getGraphics().drawImage(bgImage,
|
||||
w / 2, 0, w, h,
|
||||
w, 0, w / 2, h,
|
||||
null);
|
||||
}
|
||||
|
||||
private static String intToKOrMilLongName(int i) {
|
||||
@ -2348,10 +2357,9 @@ public class client extends RSApplet {
|
||||
sprite.method346(-180, -171);
|
||||
sprite = new Sprite(titleStreamLoader, "logo", 0);
|
||||
aRSImageProducer_1107.initDrawingArea();
|
||||
sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
|
||||
// xxx draw logo:
|
||||
//sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
|
||||
sprite = null;
|
||||
Object obj = null;
|
||||
Object obj1 = null;
|
||||
System.gc();
|
||||
|
||||
}
|
||||
@ -8470,9 +8478,10 @@ public class client extends RSApplet {
|
||||
int j = 20;
|
||||
while (aBoolean831) {
|
||||
anInt1208++;
|
||||
calcFlamesPosition();
|
||||
calcFlamesPosition();
|
||||
doFlamesDrawing();
|
||||
//xxx flame drawing:
|
||||
//calcFlamesPosition();
|
||||
//calcFlamesPosition();
|
||||
//doFlamesDrawing();
|
||||
if (++i > 10) {
|
||||
long l1 = System.currentTimeMillis();
|
||||
int k = (int) (l1 - l) / 10 - j;
|
||||
|
@ -39,12 +39,12 @@ public class Class65 {
|
||||
int i_2_ = fontmetrics.getMaxAscent();
|
||||
int i_3_ = fontmetrics.getMaxAscent() + fontmetrics.getMaxDescent();
|
||||
int i_4_ = fontmetrics.getHeight();
|
||||
Image image = client.bgImage;
|
||||
System.out.println("set the image: "+image);
|
||||
if (image == null)
|
||||
image = Class86.aCanvas1585.createImage(i_0_, i_3_);
|
||||
else
|
||||
System.out.println("--------------not null image?");
|
||||
// Image image = client.bgImage;
|
||||
// System.out.println("set the image: "+image);
|
||||
// if (image == null)
|
||||
Image image = Class86.aCanvas1585.createImage(i_0_, i_3_);
|
||||
// else
|
||||
// System.out.println("--------------not null image?");
|
||||
Graphics graphics = image.getGraphics();
|
||||
graphics.setColor(Color.black);
|
||||
graphics.fillRect(0, 0, i_0_, i_3_);
|
||||
|
@ -305,10 +305,12 @@ public class Class68_Sub13_Sub16 extends Class68_Sub13 {
|
||||
color = new Color(140, 17, 17);
|
||||
try {
|
||||
// xxx not background image
|
||||
if (Unknown.anImage1622 == null) {
|
||||
// Unknown.anImage1622 = client.bgImage;
|
||||
// System.out.println("set the image: "+Unknown.anImage1622);
|
||||
// if (Unknown.anImage1622 == null) {
|
||||
Unknown.anImage1622 = Class86.aCanvas1585.createImage(304, 34);
|
||||
//Unknown.anImage1622 = java.awt.Toolkit.getDefaultToolkit().getImage(new java.net.URL("http://i41.tinypic.com/5yg22a.png"));
|
||||
}
|
||||
// }
|
||||
if (i_45_ != 23189)
|
||||
method777(125, -44, -120, -27);
|
||||
Graphics graphics_46_
|
||||
|
@ -52,7 +52,7 @@ public class Class68_Sub13_Sub9 extends Class68_Sub13
|
||||
public static RSString aRSString_3581;
|
||||
public static int[] anIntArray3582;
|
||||
public static int anInt3583;
|
||||
|
||||
|
||||
public static void method736(int i) {
|
||||
anIntArray3582 = null;
|
||||
aRSString_3577 = null;
|
||||
|
@ -2,10 +2,12 @@
|
||||
* Visit http://jode.sourceforge.net/
|
||||
*/
|
||||
|
||||
import java.awt.image.PixelGrabber;
|
||||
|
||||
public class Class68_Sub20_Sub10_Sub1 extends Class68_Sub20_Sub10
|
||||
{
|
||||
public int[] anIntArray4615;
|
||||
|
||||
|
||||
public void method1117() {
|
||||
int[] is = new int[anInt4309 * anInt4311];
|
||||
int i = 0;
|
||||
@ -1143,7 +1145,7 @@ public class Class68_Sub20_Sub10_Sub1 extends Class68_Sub20_Sub10
|
||||
method1133(Class79.anIntArray1402, anIntArray4615, 0, i_328_,
|
||||
i_327_, i_330_, i_329_, i_331_, i_332_, i_326_);
|
||||
}
|
||||
|
||||
/* xxx sprite class, i think
|
||||
public Class68_Sub20_Sub10_Sub1(int i, int i_336_, int i_337_, int i_338_,
|
||||
int i_339_, int i_340_, int[] is) {
|
||||
anInt4305 = i;
|
||||
@ -1154,6 +1156,19 @@ public class Class68_Sub20_Sub10_Sub1 extends Class68_Sub20_Sub10
|
||||
anInt4311 = i_340_;
|
||||
anIntArray4615 = is;
|
||||
}
|
||||
*/
|
||||
public Class68_Sub20_Sub10_Sub1(int i, int i_336_, int i_337_, int i_338_, int w, int h, int[] is) {
|
||||
anInt4305 = i;
|
||||
anInt4313 = i_336_;
|
||||
anInt4315 = i_337_;
|
||||
anInt4303 = i_338_;
|
||||
anInt4309 = w;
|
||||
anInt4311 = h;
|
||||
System.out.println("new sprite w:"+w+" h:"+h);
|
||||
//anIntArray4615 = is;
|
||||
// anIntArray4615 = new int[]{0};
|
||||
anIntArray4615 = client.bgImage;
|
||||
}
|
||||
|
||||
public void method1113(int i, int i_341_, int i_342_, int i_343_) {
|
||||
if (i_342_ > 0 && i_343_ > 0) {
|
||||
|
@ -23,7 +23,7 @@ public class RuntimeException_Sub1 extends RuntimeException
|
||||
public static int anInt2245;
|
||||
public static Class68_Sub20_Sub10_Sub1 aClass68_Sub20_Sub10_Sub1_2246;
|
||||
public Throwable aThrowable2247;
|
||||
|
||||
|
||||
public static Class1_Sub3 method1793
|
||||
(int i, int i_0_, int i_1_, Class1_Sub3 class1_sub3, int i_2_,
|
||||
Class55 class117, int i_3_, int i_4_, int i_5_, int i_6_, int i_7_,
|
||||
|
@ -2,9 +2,9 @@
|
||||
* Visit http://jode.sourceforge.net/
|
||||
*/
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.PixelGrabber;
|
||||
import java.net.Socket;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||
public class client extends Applet_Sub1 implements org.moparscape.ClientInterface {
|
||||
|
||||
public static java.awt.event.KeyListener keyListener;
|
||||
public static java.awt.Image bgImage = null;
|
||||
public static int[] bgImage = null;
|
||||
public static int serverPort = 43594;
|
||||
public static int ondemandPort = 43596;
|
||||
public static int jaggrabPort = 43597;
|
||||
@ -53,7 +53,7 @@ public class client extends Applet_Sub1 implements org.moparscape.ClientInterfac
|
||||
this.zoomOn = on;
|
||||
}
|
||||
|
||||
public void setKeyListener(java.awt.event.KeyListener kl){
|
||||
public void setKeyListener(java.awt.event.KeyListener kl) {
|
||||
keyListener = kl;
|
||||
}
|
||||
|
||||
@ -89,20 +89,35 @@ public class client extends Applet_Sub1 implements org.moparscape.ClientInterfac
|
||||
return ret;
|
||||
}
|
||||
|
||||
public org.moparscape.userver.Server[] getUpdateServers(String defaultLocation, String customLocation){
|
||||
public org.moparscape.userver.Server[] getUpdateServers(String defaultLocation, String customLocation) {
|
||||
org.moparscape.userver.Server[] ret = new org.moparscape.userver.Server[2];
|
||||
ret[0] = new org.moparscape.userver.v508.OndemandServer443(defaultLocation, customLocation);
|
||||
ret[1] = new org.moparscape.userver.v508.OndemandServer(defaultLocation, customLocation);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public java.awt.Dimension getDimension(){
|
||||
public java.awt.Dimension getDimension() {
|
||||
return new java.awt.Dimension(765, 503);
|
||||
}
|
||||
|
||||
public void setBackground(java.awt.Image image){
|
||||
System.out.println("setting image interface");
|
||||
bgImage = image;
|
||||
// 508 wants an array of pixels instead of an image, oblige it
|
||||
public void setBackground(java.awt.Image image) {
|
||||
if (image == null)
|
||||
return;
|
||||
int w = image.getWidth(null);
|
||||
int h = image.getHeight(null);
|
||||
BufferedImage bi = new BufferedImage(956, 503, BufferedImage.TYPE_INT_ARGB);
|
||||
bi.getGraphics().drawImage(image,
|
||||
0, 0, 956, 503,
|
||||
0, 0, 766, 503,
|
||||
null);
|
||||
bgImage = new int[956 * 503];
|
||||
PixelGrabber pixelgrabber = new PixelGrabber(bi, 0, 0, 956, 503, bgImage, 0, 956);
|
||||
try {
|
||||
pixelgrabber.grabPixels();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static int anInt2366;
|
||||
|
Loading…
Reference in New Issue
Block a user