Thread: [Galkon's Refactored] Load a sprite via link instead of via directory[Galkon's ref]

Results 1 to 8 of 8
  1. #1 [Galkon's Refactored] Load a sprite via link instead of via directory[Galkon's ref] 
    Registered Member
    Join Date
    Mar 2009
    Posts
    134
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    Hey guyssss
    Can any1 please help me or gimme the method, to load a sprite from a website/URL instead of loading it from a directory?
    This could go really far if I get the help .
    Reply With Quote  
     

  2. #2  
    Registered Member
    Ant-Man's Avatar
    Join Date
    Aug 2010
    Posts
    1,018
    Thanks given
    277
    Thanks received
    177
    Rep Power
    452
    Tha fuck? No mis-leading links ya terd bucket.

    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Banned

    Join Date
    Jul 2008
    Posts
    3,532
    Thanks given
    188
    Thanks received
    696
    Rep Power
    0
    Quote Originally Posted by Ant-Man View Post
    Tha fuck? No mis-leading links ya terd bucket.
    what?

    OT: ive never thought of loading sprites from an online source such as a database but that would be pretty cool because you could change sprites without people re downloading your client. Only issue is people's internet speed.

    A problem with a method like that is it would have to update once the sprite is done being loaded and it would have to be stored somewhere and you would need to have a type of versionlist for the sprites to make it work accurately for everyone.
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Mar 2009
    Posts
    134
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by The Badger View Post
    what?

    OT: ive never thought of loading sprites from an online source such as a database but that would be pretty cool because you could change sprites without people re downloading your client. Only issue is people's internet speed.

    A problem with a method like that is it would have to update once the sprite is done being loaded and it would have to be stored somewhere and you would need to have a type of versionlist for the sprites to make it work accurately for everyone.
    Well... auto updating and version checking is the least of my worries.. I just need the right method to load a sprite from an URL, if you have any idea of how to do that, or know someone that does, please help me I really need it.
    Thanks.
    Reply With Quote  
     

  6. #5  
    Registered Member Steward's Avatar
    Join Date
    Jan 2011
    Posts
    32
    Thanks given
    0
    Thanks received
    7
    Rep Power
    1
    hmm I remember doing this a while back let me look into it.

    Edit:
    Imports
    Code:
    import java.awt.*;
    import javax.imageio.ImageIO;
    import java.io.IOException;
    import java.net.URL;
    Reading the image from a URL

    Code:
    private Image getImage(String url) {
            try {
                return ImageIO.read(new URL(url));
            } catch(IOException e) {
                return null;
            }
        }
    
        private final Image img1 = getImage("http://shiningpaladins.com/images/skillcape/smithing_cape.gif");
    Tell me if this helps you out.

    Edit 2:
    I am actually having a little bit of trouble. I can get it to load the background and all but when the game is loading at 'Unpacking media' it gets stuck, I think i interfered with one of the clients methods. You can look at it your self here is the first part of my sprite.java i used it in.
    Code:
    import java.awt.*;
    import java.awt.image.PixelGrabber;
    import java.awt.image.*;
    import javax.imageio.*;
    import java.io.IOException;
    import java.net.URL;
    import java.io.*;
    
    public final class Sprite extends DrawingArea {
    
    	public Sprite(int i, int j)
    	{
    		myPixels = new int[i * j];
    		myWidth = anInt1444 = i;
    		myHeight = anInt1445 = j;
    		anInt1442 = anInt1443 = 0;
    	}
    	
    	private Image getImage42(String url) {
            try {
                return ImageIO.read(new URL(url));
            } catch(IOException e) {
                return null;
            }
        }
    	
    	private final Image img1 = getImage42("http://i1120.photobucket.com/albums/l500/steward51/Background.png");
    	
    	public String location = "./Sprites/";
    
    	public Sprite(byte abyte0[], Component component)
    	{
    		try
    		{
    			Image image = img1;
    //			Image image = Toolkit.getDefaultToolkit().getImage(signlink.findcachedir()+"mopar.jpg");
    //			Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
    			MediaTracker mediatracker = new MediaTracker(component);
    			mediatracker.addImage(image, 0);
    			mediatracker.waitForAll();
    			myWidth = image.getWidth(component);
    			myHeight = image.getHeight(component);
    			anInt1444 = myWidth;
    			anInt1445 = myHeight;
    			anInt1442 = 0;
    			anInt1443 = 0;
    			myPixels = new int[myWidth * myHeight];
    			PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
    			pixelgrabber.grabPixels();
    		}
    		catch(Exception _ex)
    		{
    			System.out.println("Error converting jpg");
    		}
    	}
    removed
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Jan 2009
    Posts
    295
    Thanks given
    3
    Thanks received
    2
    Rep Power
    40
    Quote Originally Posted by Steward View Post
    I am actually having a little bit of trouble. I can get it to load the background and all but when the game is loading at 'Unpacking media' it gets stuck
    I think you ran out of memory. This has happened to me when i'm playing around with sprites. Make sure you're giving it enough memory when you initialize it. Example:
    Code:
    java -Xmx512m client
    If it's not that, post the trace.
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Jul 2008
    Posts
    3,532
    Thanks given
    188
    Thanks received
    696
    Rep Power
    0
    Quote Originally Posted by waffl3z0wnu View Post
    I think you ran out of memory. This has happened to me when i'm playing around with sprites. Make sure you're giving it enough memory when you initialize it. Example:
    Code:
    java -Xmx512m client
    If it's not that, post the trace.
    The client at most will use 200mb of ram while starting up, some other error is causing it to throw a heap space (im assuming thats what youre getting)
    Reply With Quote  
     

  9. #8  
    Registered Member Steward's Avatar
    Join Date
    Jan 2011
    Posts
    32
    Thanks given
    0
    Thanks received
    7
    Rep Power
    1
    Alright well here is what works for me. (This will load the background image for a client off a URL).
    Note: this will go inside of sprite.java

    Added Imports:
    Code:
    import java.awt.*;
    import javax.imageio.ImageIO;
    import java.io.IOException;
    import java.net.URL;
    In sprite.java, right above :
    Code:
    try
    		{
    			//Image image = Toolkit.getDefaultToolkit().getImage(location+"mopar.jpg");
    			Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
    add this:
    Code:
    BufferedImage image1 = null;
    		try
    		{
    		image1 = ImageIO.read(new URL("http://i1120.photobucket.com/albums/l500/steward51/Background.png"));
    			//ImageIO.write(image1, "png",new File("./Sprites/Loaded Images/Background.png")); //To save the file
    			System.out.println("Loaded Images.");
    		} catch (IOException e) {
            	e.printStackTrace();
            }
    To load the image:
    Code:
    Image image = image1;
    right above:
    Code:
    //Image image = Toolkit.getDefaultToolkit().getImage(location+"mopar.jpg");
    			//Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
    Note: you should know how to comment and un-comment lines.

    So this is my 'public Sprite(byte abyte0[], Component component)'
    Code:
    public Sprite(byte abyte0[], Component component)
    	{
    		BufferedImage image1 = null;
    		try
    		{
    		image1 = ImageIO.read(new URL("http://i1120.photobucket.com/albums/l500/steward51/Background.png"));
    			//ImageIO.write(image1, "png",new File("./Sprites/Loaded Images/Background.png")); //To save the file
    			System.out.println("Loaded Images.");
    		} catch (IOException e) {
            	e.printStackTrace();
            }
    		try
    		{
    			Image image = image1;
    			//Image image = Toolkit.getDefaultToolkit().getImage(location+"mopar.jpg");
    			//Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
    			MediaTracker mediatracker = new MediaTracker(component);
    			mediatracker.addImage(image, 0);
    			mediatracker.waitForAll();
    			myWidth = image.getWidth(component);
    			myHeight = image.getHeight(component);
    			anInt1444 = myWidth;
    			anInt1445 = myHeight;
    			anInt1442 = 0;
    			anInt1443 = 0;
    			myPixels = new int[myWidth * myHeight];
    			PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
    			pixelgrabber.grabPixels();
    		}
    		catch(Exception _ex)
    		{
    			System.out.println("Error converting jpg");
    		}
    	}
    If you want my sprite.java:
    Code:
    // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) 
    
    import sign.signlink;
    import java.awt.*;
    import java.awt.image.PixelGrabber;
    import java.awt.image.*;
    import javax.imageio.*;
    import java.io.IOException;
    import java.net.URL;
    import java.io.*;
    
    
    public final class Sprite extends DrawingArea {
    
    	public Sprite(int i, int j)
    	{
    		myPixels = new int[i * j];
    		myWidth = anInt1444 = i;
    		myHeight = anInt1445 = j;
    		anInt1442 = anInt1443 = 0;
    	}
    
    	public String location = "./Sprites/";
    
    	public Sprite(byte abyte0[], Component component)
    	{
    		BufferedImage image1 = null;
    		try
    		{
    		image1 = ImageIO.read(new URL("http://i1120.photobucket.com/albums/l500/steward51/Background.png"));
    			//ImageIO.write(image1, "png",new File("./Sprites/Loaded Images/Background.png")); //To save the file
    			System.out.println("Loaded Images.");
    		} catch (IOException e) {
            	e.printStackTrace();
            }
    		try
    		{
    			Image image = image1;
    			//Image image = Toolkit.getDefaultToolkit().getImage(location+"mopar.jpg");
    			//Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
    			MediaTracker mediatracker = new MediaTracker(component);
    			mediatracker.addImage(image, 0);
    			mediatracker.waitForAll();
    			myWidth = image.getWidth(component);
    			myHeight = image.getHeight(component);
    			anInt1444 = myWidth;
    			anInt1445 = myHeight;
    			anInt1442 = 0;
    			anInt1443 = 0;
    			myPixels = new int[myWidth * myHeight];
    			PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
    			pixelgrabber.grabPixels();
    		}
    		catch(Exception _ex)
    		{
    			System.out.println("Error converting jpg");
    		}
    	}
    
    	public Sprite(String img, int width, int height) {
    		try {
    			Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
    			myWidth = width;
    			myHeight = height;
    			anInt1444 = myWidth;
    			anInt1445 = myHeight;
    			anInt1442 = 0;
    			anInt1443 = 0;
    			myPixels = new int[myWidth * myHeight];
    			PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
    			pixelgrabber.grabPixels();
    			image = null;
    		} catch(Exception _ex) {
    			System.out.println(_ex);
    		}
    	}
    
    	public Sprite(String img) {
    		try {
    			Image image = Toolkit.getDefaultToolkit().getImage(location + img + ".png");
    			if (img.equalsIgnoreCase("chatarea")) {
    				myWidth = 519;
    				myHeight = 165;
    			} else if (img.equalsIgnoreCase("chatbuttons")) {
    				myWidth = 510;
    				myHeight = 22;
    			} else if (img.equalsIgnoreCase("chathover") || img.equalsIgnoreCase("chatclickedh") || img.equalsIgnoreCase("chatclicked")) {
    				myWidth = 56;
    				myHeight = 22;
    			} else if (img.equalsIgnoreCase("reporthover")) {
    				myWidth = 111;
    				myHeight = 22;
    			} else if (img.equalsIgnoreCase("tabarea")) {
    				myWidth = 246;
    				myHeight = 335;
    			} else if (img.equalsIgnoreCase("maparea")) {
    				myWidth = 246;
    				myHeight = 168;
    			} else if (img.equalsIgnoreCase("logiconh") || img.equalsIgnoreCase("logiconc")) {
    				myWidth = 22;
    				myHeight = 21;
    			} else if (img.equalsIgnoreCase("mapicon")) {
    				myWidth = 33;
    				myHeight = 33;
    			} else if (img.equalsIgnoreCase("emptyorb")) {
    				myWidth = 57;
    				myHeight = 34;
    			} else if (img.equalsIgnoreCase("hitpointsfill") || img.equalsIgnoreCase("prayerfill")) {
    				myWidth = 27;
    				myHeight = 27;
    			} else if (img.equalsIgnoreCase("hitpointsicon")) {
    				myWidth = 16;
    				myHeight = 13;
    			} else if (img.equalsIgnoreCase("prayericon")) {
    				myWidth = 20;
    				myHeight = 20;
    			} else if (img.equalsIgnoreCase("frame")) {
    				myWidth = 519;
    				myHeight = 338;
    			}
    			anInt1444 = myWidth;
    			anInt1445 = myHeight;
    			anInt1442 = 0;
    			anInt1443 = 0;
    			myPixels = new int[myWidth * myHeight];
    			PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
    			pixelgrabber.grabPixels();
    			image = null;
    		} catch(Exception _ex) {
    			System.out.println(_ex);
    		}
    	}
    
    	public Sprite(StreamLoader streamLoader, String s, int i)
    	{
    		Stream stream = new Stream(streamLoader.getDataForName(s + ".dat"));
    		Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat"));
    		stream_1.currentOffset = stream.readUnsignedWord();
    		anInt1444 = stream_1.readUnsignedWord();
    		anInt1445 = stream_1.readUnsignedWord();
    		int j = stream_1.readUnsignedByte();
    		int ai[] = new int[j];
    		for(int k = 0; k < j - 1; k++)
    		{
    			ai[k + 1] = stream_1.read3Bytes();
    			if(ai[k + 1] == 0)
    				ai[k + 1] = 1;
    		}
    
    		for(int l = 0; l < i; l++)
    		{
    			stream_1.currentOffset += 2;
    			stream.currentOffset += stream_1.readUnsignedWord() * stream_1.readUnsignedWord();
    			stream_1.currentOffset++;
    		}
    
    		anInt1442 = stream_1.readUnsignedByte();
    		anInt1443 = stream_1.readUnsignedByte();
    		myWidth = stream_1.readUnsignedWord();
    		myHeight = stream_1.readUnsignedWord();
    		int i1 = stream_1.readUnsignedByte();
    		int j1 = myWidth * myHeight;
    		myPixels = new int[j1];
    		if(i1 == 0)
    		{
    			for(int k1 = 0; k1 < j1; k1++)
    				myPixels[k1] = ai[stream.readUnsignedByte()];
    
    			return;
    		}
    		if(i1 == 1)
    		{
    			for(int l1 = 0; l1 < myWidth; l1++)
    			{
    				for(int i2 = 0; i2 < myHeight; i2++)
    					myPixels[l1 + i2 * myWidth] = ai[stream.readUnsignedByte()];
    
    			}
    
    		}
    	}
    
    	public void method343()
    	{
    		DrawingArea.initDrawingArea(myHeight, myWidth, myPixels);
    	}
    
    	public void method344(int i, int j, int k)
    	{
    		for(int i1 = 0; i1 < myPixels.length; i1++)
    		{
    			int j1 = myPixels[i1];
    			if(j1 != 0)
    			{
    				int k1 = j1 >> 16 & 0xff;
    				k1 += i;
    				if(k1 < 1)
    					k1 = 1;
    				else
    				if(k1 > 255)
    					k1 = 255;
    				int l1 = j1 >> 8 & 0xff;
    				l1 += j;
    				if(l1 < 1)
    					l1 = 1;
    				else
    				if(l1 > 255)
    					l1 = 255;
    				int i2 = j1 & 0xff;
    				i2 += k;
    				if(i2 < 1)
    					i2 = 1;
    				else
    				if(i2 > 255)
    					i2 = 255;
    				myPixels[i1] = (k1 << 16) + (l1 << 8) + i2;
    			}
    		}
    
    	}
    
    	public void method345()
    	{
    		int ai[] = new int[anInt1444 * anInt1445];
    		for(int j = 0; j < myHeight; j++)
    		{
    			System.arraycopy(myPixels, j * myWidth, ai, j + anInt1443 * anInt1444 + anInt1442, myWidth);
    		}
    
    		myPixels = ai;
    		myWidth = anInt1444;
    		myHeight = anInt1445;
    		anInt1442 = 0;
    		anInt1443 = 0;
    	}
    
    	public void method346(int i, int j)
    	{
    		i += anInt1442;
    		j += anInt1443;
    		int l = i + j * DrawingArea.width;
    		int i1 = 0;
    		int j1 = myHeight;
    		int k1 = myWidth;
    		int l1 = DrawingArea.width - k1;
    		int i2 = 0;
    		if(j < DrawingArea.topY)
    		{
    			int j2 = DrawingArea.topY - j;
    			j1 -= j2;
    			j = DrawingArea.topY;
    			i1 += j2 * k1;
    			l += j2 * DrawingArea.width;
    		}
    		if(j + j1 > DrawingArea.bottomY)
    			j1 -= (j + j1) - DrawingArea.bottomY;
    		if(i < DrawingArea.topX)
    		{
    			int k2 = DrawingArea.topX - i;
    			k1 -= k2;
    			i = DrawingArea.topX;
    			i1 += k2;
    			l += k2;
    			i2 += k2;
    			l1 += k2;
    		}
    		if(i + k1 > DrawingArea.bottomX)
    		{
    			int l2 = (i + k1) - DrawingArea.bottomX;
    			k1 -= l2;
    			i2 += l2;
    			l1 += l2;
    		}
    		if(k1 <= 0 || j1 <= 0)
    		{
    		} else
    		{
    			method347(l, k1, j1, i2, i1, l1, myPixels, DrawingArea.pixels);
    		}
    	}
    
    	private void method347(int i, int j, int k, int l, int i1, int k1,
    						   int ai[], int ai1[])
    	{
    		int l1 = -(j >> 2);
    		j = -(j & 3);
    		for(int i2 = -k; i2 < 0; i2++)
    		{
    			for(int j2 = l1; j2 < 0; j2++)
    			{
    				ai1[i++] = ai[i1++];
    				ai1[i++] = ai[i1++];
    				ai1[i++] = ai[i1++];
    				ai1[i++] = ai[i1++];
    			}
    
    			for(int k2 = j; k2 < 0; k2++)
    				ai1[i++] = ai[i1++];
    
    			i += k1;
    			i1 += l;
    		}
    	}
    
    	public void drawSprite1(int i, int j)
    	{
    		int k = 128;//was parameter
    		i += anInt1442;
    		j += anInt1443;
    		int i1 = i + j * DrawingArea.width;
    		int j1 = 0;
    		int k1 = myHeight;
    		int l1 = myWidth;
    		int i2 = DrawingArea.width - l1;
    		int j2 = 0;
    		if(j < DrawingArea.topY)
    		{
    			int k2 = DrawingArea.topY - j;
    			k1 -= k2;
    			j = DrawingArea.topY;
    			j1 += k2 * l1;
    			i1 += k2 * DrawingArea.width;
    		}
    		if(j + k1 > DrawingArea.bottomY)
    			k1 -= (j + k1) - DrawingArea.bottomY;
    		if(i < DrawingArea.topX)
    		{
    			int l2 = DrawingArea.topX - i;
    			l1 -= l2;
    			i = DrawingArea.topX;
    			j1 += l2;
    			i1 += l2;
    			j2 += l2;
    			i2 += l2;
    		}
    		if(i + l1 > DrawingArea.bottomX)
    		{
    			int i3 = (i + l1) - DrawingArea.bottomX;
    			l1 -= i3;
    			j2 += i3;
    			i2 += i3;
    		}
    		if(!(l1 <= 0 || k1 <= 0))
    		{
    			method351(j1, l1, DrawingArea.pixels, myPixels, j2, k1, i2, k, i1);
    		}
    	}
    
    	public void drawSprite(int i, int k)
    	{
    		i += anInt1442;
    		k += anInt1443;
    		int l = i + k * DrawingArea.width;
    		int i1 = 0;
    		int j1 = myHeight;
    		int k1 = myWidth;
    		int l1 = DrawingArea.width - k1;
    		int i2 = 0;
    		if(k < DrawingArea.topY)
    		{
    			int j2 = DrawingArea.topY - k;
    			j1 -= j2;
    			k = DrawingArea.topY;
    			i1 += j2 * k1;
    			l += j2 * DrawingArea.width;
    		}
    		if(k + j1 > DrawingArea.bottomY)
    			j1 -= (k + j1) - DrawingArea.bottomY;
    		if(i < DrawingArea.topX)
    		{
    			int k2 = DrawingArea.topX - i;
    			k1 -= k2;
    			i = DrawingArea.topX;
    			i1 += k2;
    			l += k2;
    			i2 += k2;
    			l1 += k2;
    		}
    		if(i + k1 > DrawingArea.bottomX)
    		{
    			int l2 = (i + k1) - DrawingArea.bottomX;
    			k1 -= l2;
    			i2 += l2;
    			l1 += l2;
    		}
    		if(!(k1 <= 0 || j1 <= 0))
    		{
    			method349(DrawingArea.pixels, myPixels, i1, l, k1, j1, l1, i2);
    		}
    	}
    
    	public void drawSprite2(int i, int j) {
    		int k = 225;//was parameter
    		i += anInt1442;
    		j += anInt1443;
    		int i1 = i + j * DrawingArea.width;
    		int j1 = 0;
    		int k1 = myHeight;
    		int l1 = myWidth;
    		int i2 = DrawingArea.width - l1;
    		int j2 = 0;
    		if(j < DrawingArea.topY) {
    			int k2 = DrawingArea.topY - j;
    			k1 -= k2;
    			j = DrawingArea.topY;
    			j1 += k2 * l1;
    			i1 += k2 * DrawingArea.width;
    		}
    		if(j + k1 > DrawingArea.bottomY)
    			k1 -= (j + k1) - DrawingArea.bottomY;
    		if(i < DrawingArea.topX) {
    			int l2 = DrawingArea.topX - i;
    			l1 -= l2;
    			i = DrawingArea.topX;
    			j1 += l2;
    			i1 += l2;
    			j2 += l2;
    			i2 += l2;
    		}
    		if(i + l1 > DrawingArea.bottomX) {
    			int i3 = (i + l1) - DrawingArea.bottomX;
    			l1 -= i3;
    			j2 += i3;
    			i2 += i3;
    		}
    		if(!(l1 <= 0 || k1 <= 0)) {
    			method351(j1, l1, DrawingArea.pixels, myPixels, j2, k1, i2, k, i1);
    		}
    	}
    
    	private void method349(int ai[], int ai1[], int j, int k, int l, int i1, int j1, int k1) {
    		int i;//was parameter
    		int l1 = -(l >> 2);
    		l = -(l & 3);
    		for(int i2 = -i1; i2 < 0; i2++) {
    			for(int j2 = l1; j2 < 0; j2++) {
    				i = ai1[j++];
    				if(i != 0 && i != -1)
    				{
    					ai[k++] = i;
    				} else {
    				k++;
    			}
    			i = ai1[j++];
    			if(i != 0 && i != -1) {
    				ai[k++] = i;
    			} else {
    				k++;
    			}
    			i = ai1[j++];
    			if(i != 0 && i != -1) {
    				ai[k++] = i;
    			} else {
    				k++;
    			}
    			i = ai1[j++];
    			if(i != 0 && i != -1) {
    				ai[k++] = i;
    			} else {
    				k++;
    			}
    		}
    
    		for(int k2 = l; k2 < 0; k2++) {
    			i = ai1[j++];
    			if(i != 0 && i != -1) {
    				ai[k++] = i;
    			} else {
    				k++;
    			}
    		}
    		k += j1;
    		j += k1;
    		}
    	}
    
    	private void method351(int i, int j, int ai[], int ai1[], int l, int i1,
    						   int j1, int k1, int l1)
    	{
    		int k;//was parameter
    		int j2 = 256 - k1;
    		for(int k2 = -i1; k2 < 0; k2++)
    		{
    			for(int l2 = -j; l2 < 0; l2++)
    			{
    				k = ai1[i++];
    				if(k != 0)
    				{
    					int i3 = ai[l1];
    					ai[l1++] = ((k & 0xff00ff) * k1 + (i3 & 0xff00ff) * j2 & 0xff00ff00) + ((k & 0xff00) * k1 + (i3 & 0xff00) * j2 & 0xff0000) >> 8;
    				} else
    				{
    					l1++;
    				}
    			}
    
    			l1 += j1;
    			i += l;
    		}
    	}
    
    	public void method352(int i, int j, int ai[], int k, int ai1[], int i1,
    						  int j1, int k1, int l1, int i2)
    	{
    		try
    		{
    			int j2 = -l1 / 2;
    			int k2 = -i / 2;
    			int l2 = (int)(Math.sin((double)j / 326.11000000000001D) * 65536D);
    			int i3 = (int)(Math.cos((double)j / 326.11000000000001D) * 65536D);
    			l2 = l2 * k >> 8;
    			i3 = i3 * k >> 8;
    			int j3 = (i2 << 16) + (k2 * l2 + j2 * i3);
    			int k3 = (i1 << 16) + (k2 * i3 - j2 * l2);
    			int l3 = k1 + j1 * DrawingArea.width;
    			for(j1 = 0; j1 < i; j1++)
    			{
    				int i4 = ai1[j1];
    				int j4 = l3 + i4;
    				int k4 = j3 + i3 * i4;
    				int l4 = k3 - l2 * i4;
    				for(k1 = -ai[j1]; k1 < 0; k1++)
    				{
    					DrawingArea.pixels[j4++] = myPixels[(k4 >> 16) + (l4 >> 16) * myWidth];
    					k4 += i3;
    					l4 -= l2;
    				}
    
    				j3 += l2;
    				k3 += i3;
    				l3 += DrawingArea.width;
    			}
    
    		}
    		catch(Exception _ex)
    		{
    		}
    	}
    
    	public void method353(int i,
    						  double d, int l1)
    	{
    		//all of the following were parameters
    		int j = 15;
    		int k = 20;
    		int l = 15;
    		int j1 = 256;
    		int k1 = 20;
    		//all of the previous were parameters
    		try
    		{
    			int i2 = -k / 2;
    			int j2 = -k1 / 2;
    			int k2 = (int)(Math.sin(d) * 65536D);
    			int l2 = (int)(Math.cos(d) * 65536D);
    			k2 = k2 * j1 >> 8;
    			l2 = l2 * j1 >> 8;
    			int i3 = (l << 16) + (j2 * k2 + i2 * l2);
    			int j3 = (j << 16) + (j2 * l2 - i2 * k2);
    			int k3 = l1 + i * DrawingArea.width;
    			for(i = 0; i < k1; i++)
    			{
    				int l3 = k3;
    				int i4 = i3;
    				int j4 = j3;
    				for(l1 = -k; l1 < 0; l1++)
    				{
    					int k4 = myPixels[(i4 >> 16) + (j4 >> 16) * myWidth];
    					if(k4 != 0)
    						DrawingArea.pixels[l3++] = k4;
    					else
    						l3++;
    					i4 += l2;
    					j4 -= k2;
    				}
    
    				i3 += k2;
    				j3 += l2;
    				k3 += DrawingArea.width;
    			}
    
    		}
    		catch(Exception _ex)
    		{
    		}
    	}
    
    	public void method354(Background background, int i, int j)
    	{
    		j += anInt1442;
    		i += anInt1443;
    		int k = j + i * DrawingArea.width;
    		int l = 0;
    		int i1 = myHeight;
    		int j1 = myWidth;
    		int k1 = DrawingArea.width - j1;
    		int l1 = 0;
    		if(i < DrawingArea.topY)
    		{
    			int i2 = DrawingArea.topY - i;
    			i1 -= i2;
    			i = DrawingArea.topY;
    			l += i2 * j1;
    			k += i2 * DrawingArea.width;
    		}
    		if(i + i1 > DrawingArea.bottomY)
    			i1 -= (i + i1) - DrawingArea.bottomY;
    		if(j < DrawingArea.topX)
    		{
    			int j2 = DrawingArea.topX - j;
    			j1 -= j2;
    			j = DrawingArea.topX;
    			l += j2;
    			k += j2;
    			l1 += j2;
    			k1 += j2;
    		}
    		if(j + j1 > DrawingArea.bottomX)
    		{
    			int k2 = (j + j1) - DrawingArea.bottomX;
    			j1 -= k2;
    			l1 += k2;
    			k1 += k2;
    		}
    		if(!(j1 <= 0 || i1 <= 0))
    		{
    			method355(myPixels, j1, background.aByteArray1450, i1, DrawingArea.pixels, 0, k1, k, l1, l);
    		}
    	}
    
    	private void method355(int ai[], int i, byte abyte0[], int j, int ai1[], int k,
    						   int l, int i1, int j1, int k1)
    	{
    		int l1 = -(i >> 2);
    		i = -(i & 3);
    		for(int j2 = -j; j2 < 0; j2++)
    		{
    			for(int k2 = l1; k2 < 0; k2++)
    			{
    				k = ai[k1++];
    				if(k != 0 && abyte0[i1] == 0)
    					ai1[i1++] = k;
    				else
    					i1++;
    				k = ai[k1++];
    				if(k != 0 && abyte0[i1] == 0)
    					ai1[i1++] = k;
    				else
    					i1++;
    				k = ai[k1++];
    				if(k != 0 && abyte0[i1] == 0)
    					ai1[i1++] = k;
    				else
    					i1++;
    				k = ai[k1++];
    				if(k != 0 && abyte0[i1] == 0)
    					ai1[i1++] = k;
    				else
    					i1++;
    			}
    
    			for(int l2 = i; l2 < 0; l2++)
    			{
    				k = ai[k1++];
    				if(k != 0 && abyte0[i1] == 0)
    					ai1[i1++] = k;
    				else
    					i1++;
    			}
    
    			i1 += l;
    			k1 += j1;
    		}
    
    	}
    
    	public int myPixels[];
    	public int myWidth;
    	public int myHeight;
    	private int anInt1442;
    	private int anInt1443;
    	public int anInt1444;
    	public int anInt1445;
    }
    removed
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Galkon's refactored] Fixing sprite loading
    By Alpinestars in forum Snippets
    Replies: 7
    Last Post: 12-19-2010, 02:58 PM
  2. Galkon's Refactored help
    By Arcobaleno in forum Help
    Replies: 0
    Last Post: 10-26-2010, 05:13 AM
  3. Galkon's Refactored - Help
    By Ghost` in forum Help
    Replies: 2
    Last Post: 10-02-2010, 02:24 AM
  4. $5.00 for help with Galkon's refactored
    By jordan641 in forum Requests
    Replies: 2
    Last Post: 07-23-2010, 04:33 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •