Thread: Keldagrim client heavily renamed | 667 data

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 Keldagrim client heavily renamed | 667 data 


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    Features:
    • Renamed (Fields, Methods, Classes, list shown below, some classes were already renamed, etc..)
    • Removed startup text (I personally prefer it this way, i commented the text out)
    • Account Create (Replaced recover account, preference I chose)
    • Removed logo
    • Removed summoning orb
    • Removed XP counter extras (Now just "open/close" operations)
    • Changed "Report Abuse" to "Players Online" (not completed, report abuse interface is bugged)

    Spoiler for Progress Log:

    Update posts:
    http://www.rune-server.org/runescape...ml#post4820109
    http://www.rune-server.org/runescape...ml#post4820145

    Code:
    Naming - http://www.rune-server.org/runescape-development/rs2-client/configuration/550630-renamed-classes-methods-fields.html
    
    Classes renamed (Old -> New)
    Sounds -> WaveSound
    Client -> Game
    Class11 -> CollisionMap
    Class13 -> BZip2
    Class21 -> ModelHeader
    Class29 -> SoundEnvelope
    Class30_Sub1 -> TemporaryObject
    Class32 -> BZip2Context
    Class33 -> Vertex
    Class39 -> SoundFilter
    Class4 -> ChunkUtil
    Class40 -> TileOverlay
    Class43 -> TileUnderlay
    Class47 -> CullBox
    Class6 -> SoundSample
    WorldController -> LandScape
    Class10 -> Object1 -> WallLock
    Class26 -> Object2 -> WallDecoration
    Class49 -> Object3 -> GroundDecoration
    Class3 -> Object4 -> ItemPile
    Class28 -> Object5 -> StaticObject
    Class30_Sub2_Sub4_Sub3 -> Animable_Sub3 -> SceneSpotAnim
    Class30_Sub2_Sub4_Sub4 -> Animable_Sub4 -> SceneProjectile
    Class30_Sub2_Sub4_Sub5 -> Animable_Sub5 -> SceneObject
    Class20 -> Animable -> Sequence
    Class30_Sub2_Sub1 -> DrawingArea -> Canvas2D
    Class22 -> Floor -> Flo
    Class36 -> FrameReader -> SequenceFrame
    Class30_Sub3 -> Ground -> Tile
    Class30_Sub2_Sub1_Sub2 -> IndexedImage -> RSBitmap
    Class44 -> JagexArchive -> Archive
    Class23 -> StillGraphic -> SpotAnim
    Applet_Sub1 -> RSApplet -> GameShell
    Class46 -> ObjectDef -> GameObject
    Class42_Sub1 -> ResourceProvider -> OnDemandRequester
    Class35 -> TextInput -> JString
    Class30_Sub2 -> NodeSub -> Tuple
    Class17 -> ISAACRandomGen -> ISAACCipher
    
    Client - Fields renamed, Methods renamed
    Buffer - Fields renamed, Methods renamed
    BZip2 - Fields renamed
    ChunkUtil - Methods renamed
    CollisionMap - Fields renamed, Methods renamed
    CullBox - Fields renamed
    IdentityKit - Fields renamed, Meothds renamed
    Item - Fields renamed
    ModelHeader - Fields renamed (not  all)
    RSInterface - Fields renamed, Methods renamed
    SceneGraph - Fields renamed, Methods renamed
    SkinList - Fields renamed
    SoundEnvelop - Fields renamed, Methods renamed (not all)
    SoundFilter - Methods renamed (not all)
    WaveSound - Fields renamed, Methods renamed
    Landscape - Fields renamed, Methods renamed
    WallDecoration - Fields renamed
    WallLock - Fields renamed
    WallDecoration - Fields renamed
    GroundDecoration - Fields renamed
    ItemPile - Fields renamed
    StaticObject - Fields renamed
    SceneSpotAnim - Fields renamed, Methods renamed
    SceneProjectile - Fields renamed, Methods renamed
    SceneObject - Fields renamed, Methods renamed
    Sequence - Fields renamed, Methods renamed
    Canvas2d - Fields renamed, Methods renamed
    Flo - Fields renamed, Methods renamed (not all)
    SequenceFrame - Fields renamed, Methods renamed
    Tile - Fields renamed
    RSBitmap - Fields renamed, Methods renamed
    Archive - Fields renamed
    JagexBuffer - Fields renamed, Methods renamed
    Model - Fields renamed, Methods renamed (not all)
    NPC - Methods renamed
    SoundSample - Fields renamed, Methods renamed
    SpotAnim - Fields renamed (not all)
    TemporaryObject - Fields renamed
    TileOverlay - Fields renamed
    Varp - Fields renamed (not all)
    GameShell - Fields renamed
    GameObject - Fields renamed, Methods renamed (not all)
    OnDemandRequester - Fields renamed, Methods renamed
    JString - Methods renamed
    RSFont - Fields renamed, Methods renamed
    Tuple - Fields renamed, Methods renamed (not all)
    ISAACCipher - Methods renamed

    Spoiler for Sample Classes:

    Code:
    package src;
    
    public class Rasterizer extends Canvas2D
    {
    	public static void nullLoader()
    	{
    		shadowDecay = null;
    		SINE = null;
    		COSINE = null;
    		lineOffsets = null;
    		texelArrayPool = null;
    		texelCache = null;
    		textureLastUsed = null;
    		hsl2rgb = null;
    		brightness = 1.0F;
    	}
    
    	public static void nullLoaderSafe()
    	{
    		lineOffsets = null;
    		texelArrayPool = null;
    		texelCache = null;
    		textureLastUsed = null;
    		OFFSETS_512_334 = null;
    		OFFSETS_765_503 = null;
    		brightness = 1.0F;
    	}
    
    	public static void resetConstCache()
    	{
    		OFFSETS_512_334 = null;
    		OFFSETS_765_503 = null;
    	}
    
    	public static void initTextures(int count)
    	{
    		loadedTextureCount = count;
    		textureLastUsed = new int[count];
    		texelCache = new int[count][];
    	}
    
    	private static int[] OFFSETS_512_334 = null;
    	private static int[] OFFSETS_765_503 = null;
    
    	public static int[] getOffsets(int j, int k)
    	{
    		if (j == 512 && k == 334 && OFFSETS_512_334 != null)
    			return OFFSETS_512_334;
    
    		if (j == 765 + 1 && k == 503 && OFFSETS_765_503 != null)
    			return OFFSETS_765_503;
    
    		int[] t = new int[k];
    		for (int l = 0; l < k; l++)
    			t[l] = j * l;
    
    		if (j == 512 && k == 334)
    			OFFSETS_512_334 = t;
    
    		if (j == 765 + 1 && k == 503)
    			OFFSETS_765_503 = t;
    
    		return t;
    	}
    
    	public boolean isValid()
    	{
    		return texelArrayPool != null && texelCache != null;
    	}
    
    	public static void setDefaultBounds() {
    		setBounds(width, height);
    	}
    
    	public static void setBounds(int width, int height) {
    		lineOffsets = getOffsets(width, height);
    		centerX = width / 2;
    		centerY = height / 2;
    	}
    
    	public static void clearTextureCache() {
    		texelArrayPool = null;
    		for (int i = 0; i < loadedTextureCount; i++) {
    			texelCache[i] = null;
    		}
    
    	}
    
    	public static void resetTextures() {
    		if (texelArrayPool == null) {
    			textureTexelPoolPointer = 50;//was parameter
    			texelArrayPool = new int[textureTexelPoolPointer][0x10000];
    			for (int k = 0; k < loadedTextureCount; k++)
    				texelCache[k] = null;
    
    
    		}
    	}
    
    	public static void resetTexture(int textureId) {
    		if (texelCache[textureId] == null) {
    			return;
    		}
    		texelArrayPool[textureTexelPoolPointer++] = texelCache[textureId];
    		texelCache[textureId] = null;
    	}
    
    	private static int[] getTexturePixels(int textureId) {
    		Texture texture = Texture.get(textureId);
    		if (texture == null)
    			return null;
    
    		textureLastUsed[textureId] = textureGetCount++;
    		if (texelCache[textureId] != null)
    			return texelCache[textureId];
    
    		int texels[];
    		//Start of mem management code
    		if (textureTexelPoolPointer > 0) {	//Freed texture data arrays available
    			texels = texelArrayPool[--textureTexelPoolPointer];
    			texelArrayPool[textureTexelPoolPointer] = null;
    		} else {   //No freed texture data arrays available, recycle least used texture's array
    			int lastUsed = 0;
    			int target = -1;
    			for (int i = 0; i < loadedTextureCount; i++) {
    				if (texelCache[i] != null && (textureLastUsed[i] < lastUsed || target == -1)) {
    					lastUsed = textureLastUsed[i];
    					target = i;
    				}
    			}
    
    			texels = texelCache[target];
    			texelCache[target] = null;
    		}
    		texelCache[textureId] = texels;
    		//End of mem management code
    		if (texture.width == 64)
    			for (int y = 0; y < 128; y++)
    				for (int x = 0; x < 128; x++)
    					texels[x + (y << 7)] = texture.getPixel((x >> 1) + ((y >> 1) << 6));
    
    
    		else
    			for (int texelPtr = 0; texelPtr < 16384; texelPtr++)
    				texels[texelPtr] = texture.getPixel(texelPtr);
    
    
    		TextureDef def = textureId >= 0 && textureId < TextureDef.textures.length ? TextureDef.textures[textureId]:null;
    		int blendType = def != null ? def.anInt1226 : 0;
    		if (blendType != 1 && blendType != 2)
    			blendType = 0;
    
    		for (int texelPtr = 0; texelPtr < 16384; texelPtr++) {
    			int texel = texels[texelPtr];
    			int alpha;
    			if (blendType == 2)
    				alpha = texel >>> 24;
    			else if (blendType == 1)
    				alpha = texel != 0 ? 0xff:0;
    
    			else
    			{
    				alpha = texel >>> 24;
    				if (def != null && !def.aBoolean1223)
    					alpha /= 5;
    
    			}
    			texel &= 0xffffff;
    			texel = adjustBrightnessLinear(texel, 179);
    			texel = adjustBrightness(texel, brightness);
    			texel &= 0xf8f8ff;
    			texels[texelPtr] = texel | (alpha << 24);
    			texels[16384 + texelPtr] = ((texel - (texel >>> 3)) & 0xf8f8ff) | (alpha << 24);
    			texels[32768 + texelPtr] = ((texel - (texel >>> 2)) & 0xf8f8ff) | (alpha << 24);
    			texels[49152 + texelPtr] = ((texel - (texel >>> 2) - (texel >>> 3)) & 0xf8f8ff) | (alpha << 24);
    		}
    
    		return texels;
    	}
     
    	public static void calculatePalette(float brightness)
    	{
    		brightness += Math.random() * 0.03F - 0.015F;
    		//if (Rasterizer.brightness == brightness)
    		//	return;
    
    		Rasterizer.brightness = brightness;
    		int hsl = 0;
    		for (int k = 0; k < 512; k++) {
    			float d1 = (float) (k / 8) / 64F + 0.0078125F;
    			float d2 = (float) (k & 7) / 8F + 0.0625F;
    			for (int k1 = 0; k1 < 128; k1++) {
    				float d3 = (float) k1 / 128F;
    				float r = d3;
    				float g = d3;
    				float b = d3;
    				if (d2 != 0.0F) {
    					float d7;
    					if (d3 < 0.5F) {
    						d7 = d3 * (1.0F + d2);
    					} else {
    						d7 = (d3 + d2) - d3 * d2;
    					}
    					float d8 = 2F * d3 - d7;
    					float d9 = d1 + 1F / 3F;
    					if (d9 > 1.0F) {
    						d9--;
    					}
    					float d10 = d1;
    					float d11 = d1 - 1F / 3F;
    					if (d11 < 0.0F) {
    						d11++;
    					}
    					if (6F * d9 < 1.0F) {
    						r = d8 + (d7 - d8) * 6F * d9;
    					} else if (2F * d9 < 1.0F) {
    						r = d7;
    					} else if (3F * d9 < 2F) {
    						r = d8 + (d7 - d8) * ((2F / 3F) - d9) * 6F;
    					} else {
    						r = d8;
    					}
    					if (6F * d10 < 1.0F) {
    						g = d8 + (d7 - d8) * 6F * d10;
    					} else if (2F * d10 < 1.0F) {
    						g = d7;
    					} else if (3F * d10 < 2F) {
    						g = d8 + (d7 - d8) * ((2F / 3F) - d10) * 6F;
    					} else {
    						g = d8;
    					}
    					if (6F * d11 < 1.0F) {
    						b = d8 + (d7 - d8) * 6F * d11;
    					} else if (2F * d11 < 1.0F) {
    						b = d7;
    					} else if (3F * d11 < 2F) {
    						b = d8 + (d7 - d8) * ((2F / 3F) - d11) * 6F;
    					} else {
    						b = d8;
    					}
    				}
    				int rgb = ((int) ((float) Math.pow((double) r, (double) brightness) * 256F) << 16) + ((int) ((float) Math.pow((double) g, (double) brightness) * 256F) << 8) + (int) ((float) Math.pow((double) b, (double) brightness) * 256F);
    				if (rgb == 0)
    					rgb = 1;
    
    				hsl2rgb[hsl++] = rgb;
    			}
    
    		}
    
    		for (int textureId = 0; textureId != loadedTextureCount; ++textureId)
    			resetTexture(textureId);
    
    	}
    
    	private static float brightness = 1.0F;
    
    	private static int adjustBrightness(int rgb, float brightness) {
    		return ((int) ((float) Math.pow((double) ((float) (rgb >>> 16) / 256.0F), (double) brightness) * 256.0F) << 16) | 
    			((int) ((float) Math.pow((double) ((float) ((rgb >>> 8) & 0xff) / 256.0F), (double) brightness) * 256.0F) << 8) | 
    			(int) ((float) Math.pow((double) ((float) (rgb & 0xff) / 256.0F), (double) brightness) * 256.0F);
    	}
    
    
    	private static int adjustBrightnessLinear(int rgb, int factor)
    	{
    		return ((((rgb >>> 16) * factor) & 0xff00) << 8) | 
    			((((rgb >>> 8) & 0xff) * factor) & 0xff00) | 
    			(((rgb & 0xff) * factor) >> 8);
    	}
    
    	public static void drawShadedTriangle(int y_a, int y_b, int y_c, int x_a, int x_b, int x_c, int z_a, int z_b, int z_c) {
    		++triangles;
    		int x_a_off = 0;
    		int z_a_off = 0;
    		if (y_b != y_a) {
    			x_a_off = (x_b - x_a << 16) / (y_b - y_a);
    			z_a_off = (z_b - z_a << 15) / (y_b - y_a);
    		}
    		int x_b_off = 0;
    		int z_b_off = 0;
    		if (y_c != y_b) {
    			x_b_off = (x_c - x_b << 16) / (y_c - y_b);
    			z_b_off = (z_c - z_b << 15) / (y_c - y_b);
    		}
    		int x_c_off = 0;
    		int z_c_off = 0;
    		if (y_c != y_a) {
    			x_c_off = (x_a - x_c << 16) / (y_a - y_c);
    			z_c_off = (z_a - z_c << 15) / (y_a - y_c);
    		}
    		if (y_a <= y_b && y_a <= y_c) {
    			if (y_a >= Canvas2D.bottomY) {
    				return;
    			}
    			if (y_b > Canvas2D.bottomY) {
    				y_b = Canvas2D.bottomY;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_b < y_c) {
    				x_c = x_a <<= 16;
    				z_c = z_a <<= 15;
    				if (y_a < 0) {
    					x_c -= x_c_off * y_a;
    					x_a -= x_a_off * y_a;
    					z_c -= z_c_off * y_a;
    					z_a -= z_a_off * y_a;
    					y_a = 0;
    				}
    				x_b <<= 16;
    				z_b <<= 15;
    				if (y_b < 0) {
    					x_b -= x_b_off * y_b;
    					z_b -= z_b_off * y_b;
    					y_b = 0;
    				}
    				if (y_a != y_b && x_c_off < x_a_off || y_a == y_b && x_c_off > x_b_off) {
    					y_c -= y_b;
    					y_b -= y_a;
    					for (y_a = lineOffsets[y_a]; --y_b >= 0; y_a += width) {
    						drawShadedLine(pixels, y_a, x_c >> 16, x_a >> 16, z_c >> 7, z_a >> 7);
    						x_c += x_c_off;
    						x_a += x_a_off;
    						z_c += z_c_off;
    						z_a += z_a_off;
    					}
    
    					while (--y_c >= 0) {
    						drawShadedLine(pixels, y_a, x_c >> 16, x_b >> 16, z_c >> 7, z_b >> 7);
    						x_c += x_c_off;
    						x_b += x_b_off;
    						z_c += z_c_off;
    						z_b += z_b_off;
    						y_a += width;
    					}
    					return;
    				}
    				y_c -= y_b;
    				y_b -= y_a;
    				for (y_a = lineOffsets[y_a]; --y_b >= 0; y_a += width) {
    					drawShadedLine(pixels, y_a, x_a >> 16, x_c >> 16, z_a >> 7, z_c >> 7);
    					x_c += x_c_off;
    					x_a += x_a_off;
    					z_c += z_c_off;
    					z_a += z_a_off;
    				}
    
    				while (--y_c >= 0) {
    					drawShadedLine(pixels, y_a, x_b >> 16, x_c >> 16, z_b >> 7, z_c >> 7);
    					x_c += x_c_off;
    					x_b += x_b_off;
    					z_c += z_c_off;
    					z_b += z_b_off;
    					y_a += width;
    				}
    				return;
    			}
    			x_b = x_a <<= 16;
    			z_b = z_a <<= 15;
    			if (y_a < 0) {
    				x_b -= x_c_off * y_a;
    				x_a -= x_a_off * y_a;
    				z_b -= z_c_off * y_a;
    				z_a -= z_a_off * y_a;
    				y_a = 0;
    			}
    			x_c <<= 16;
    			z_c <<= 15;
    			if (y_c < 0) {
    				x_c -= x_b_off * y_c;
    				z_c -= z_b_off * y_c;
    				y_c = 0;
    			}
    			if (y_a != y_c && x_c_off < x_a_off || y_a == y_c && x_b_off > x_a_off) {
    				y_b -= y_c;
    				y_c -= y_a;
    				for (y_a = lineOffsets[y_a]; --y_c >= 0; y_a += width) {
    					drawShadedLine(pixels, y_a, x_b >> 16, x_a >> 16, z_b >> 7, z_a >> 7);
    					x_b += x_c_off;
    					x_a += x_a_off;
    					z_b += z_c_off;
    					z_a += z_a_off;
    				}
    
    				while (--y_b >= 0) {
    					drawShadedLine(pixels, y_a, x_c >> 16, x_a >> 16, z_c >> 7, z_a >> 7);
    					x_c += x_b_off;
    					x_a += x_a_off;
    					z_c += z_b_off;
    					z_a += z_a_off;
    					y_a += width;
    				}
    				return;
    			}
    			y_b -= y_c;
    			y_c -= y_a;
    			for (y_a = lineOffsets[y_a]; --y_c >= 0; y_a += width) {
    				drawShadedLine(pixels, y_a, x_a >> 16, x_b >> 16, z_a >> 7, z_b >> 7);
    				x_b += x_c_off;
    				x_a += x_a_off;
    				z_b += z_c_off;
    				z_a += z_a_off;
    			}
    
    			while (--y_b >= 0) {
    				drawShadedLine(pixels, y_a, x_a >> 16, x_c >> 16, z_a >> 7, z_c >> 7);
    				x_c += x_b_off;
    				x_a += x_a_off;
    				z_c += z_b_off;
    				z_a += z_a_off;
    				y_a += width;
    			}
    			return;
    		}
    		if (y_b <= y_c) {
    			if (y_b >= Canvas2D.bottomY) {
    				return;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_a > Canvas2D.bottomY) {
    				y_a = Canvas2D.bottomY;
    			}
    			if (y_c < y_a) {
    				x_a = x_b <<= 16;
    				z_a = z_b <<= 15;
    				if (y_b < 0) {
    					x_a -= x_a_off * y_b;
    					x_b -= x_b_off * y_b;
    					z_a -= z_a_off * y_b;
    					z_b -= z_b_off * y_b;
    					y_b = 0;
    				}
    				x_c <<= 16;
    				z_c <<= 15;
    				if (y_c < 0) {
    					x_c -= x_c_off * y_c;
    					z_c -= z_c_off * y_c;
    					y_c = 0;
    				}
    				if (y_b != y_c && x_a_off < x_b_off || y_b == y_c && x_a_off > x_c_off) {
    					y_a -= y_c;
    					y_c -= y_b;
    					for (y_b = lineOffsets[y_b]; --y_c >= 0; y_b += width) {
    						drawShadedLine(pixels, y_b, x_a >> 16, x_b >> 16, z_a >> 7, z_b >> 7);
    						x_a += x_a_off;
    						x_b += x_b_off;
    						z_a += z_a_off;
    						z_b += z_b_off;
    					}
    
    					while (--y_a >= 0) {
    						drawShadedLine(pixels, y_b, x_a >> 16, x_c >> 16, z_a >> 7, z_c >> 7);
    						x_a += x_a_off;
    						x_c += x_c_off;
    						z_a += z_a_off;
    						z_c += z_c_off;
    						y_b += width;
    					}
    					return;
    				}
    				y_a -= y_c;
    				y_c -= y_b;
    				for (y_b = lineOffsets[y_b]; --y_c >= 0; y_b += width) {
    					drawShadedLine(pixels, y_b, x_b >> 16, x_a >> 16, z_b >> 7, z_a >> 7);
    					x_a += x_a_off;
    					x_b += x_b_off;
    					z_a += z_a_off;
    					z_b += z_b_off;
    				}
    
    				while (--y_a >= 0) {
    					drawShadedLine(pixels, y_b, x_c >> 16, x_a >> 16, z_c >> 7, z_a >> 7);
    					x_a += x_a_off;
    					x_c += x_c_off;
    					z_a += z_a_off;
    					z_c += z_c_off;
    					y_b += width;
    				}
    				return;
    			}
    			x_c = x_b <<= 16;
    			z_c = z_b <<= 15;
    			if (y_b < 0) {
    				x_c -= x_a_off * y_b;
    				x_b -= x_b_off * y_b;
    				z_c -= z_a_off * y_b;
    				z_b -= z_b_off * y_b;
    				y_b = 0;
    			}
    			x_a <<= 16;
    			z_a <<= 15;
    			if (y_a < 0) {
    				x_a -= x_c_off * y_a;
    				z_a -= z_c_off * y_a;
    				y_a = 0;
    			}
    			if (x_a_off < x_b_off) {
    				y_c -= y_a;
    				y_a -= y_b;
    				for (y_b = lineOffsets[y_b]; --y_a >= 0; y_b += width) {
    					drawShadedLine(pixels, y_b, x_c >> 16, x_b >> 16, z_c >> 7, z_b >> 7);
    					x_c += x_a_off;
    					x_b += x_b_off;
    					z_c += z_a_off;
    					z_b += z_b_off;
    				}
    
    				while (--y_c >= 0) {
    					drawShadedLine(pixels, y_b, x_a >> 16, x_b >> 16, z_a >> 7, z_b >> 7);
    					x_a += x_c_off;
    					x_b += x_b_off;
    					z_a += z_c_off;
    					z_b += z_b_off;
    					y_b += width;
    				}
    				return;
    			}
    			y_c -= y_a;
    			y_a -= y_b;
    			for (y_b = lineOffsets[y_b]; --y_a >= 0; y_b += width) {
    				drawShadedLine(pixels, y_b, x_b >> 16, x_c >> 16, z_b >> 7, z_c >> 7);
    				x_c += x_a_off;
    				x_b += x_b_off;
    				z_c += z_a_off;
    				z_b += z_b_off;
    			}
    
    			while (--y_c >= 0) {
    				drawShadedLine(pixels, y_b, x_b >> 16, x_a >> 16, z_b >> 7, z_a >> 7);
    				x_a += x_c_off;
    				x_b += x_b_off;
    				z_a += z_c_off;
    				z_b += z_b_off;
    				y_b += width;
    			}
    			return;
    		}
    		if (y_c >= Canvas2D.bottomY) {
    			return;
    		}
    		if (y_a > Canvas2D.bottomY) {
    			y_a = Canvas2D.bottomY;
    		}
    		if (y_b > Canvas2D.bottomY) {
    			y_b = Canvas2D.bottomY;
    		}
    		if (y_a < y_b) {
    			x_b = x_c <<= 16;
    			z_b = z_c <<= 15;
    			if (y_c < 0) {
    				x_b -= x_b_off * y_c;
    				x_c -= x_c_off * y_c;
    				z_b -= z_b_off * y_c;
    				z_c -= z_c_off * y_c;
    				y_c = 0;
    			}
    			x_a <<= 16;
    			z_a <<= 15;
    			if (y_a < 0) {
    				x_a -= x_a_off * y_a;
    				z_a -= z_a_off * y_a;
    				y_a = 0;
    			}
    			if (x_b_off < x_c_off) {
    				y_b -= y_a;
    				y_a -= y_c;
    				for (y_c = lineOffsets[y_c]; --y_a >= 0; y_c += width) {
    					drawShadedLine(pixels, y_c, x_b >> 16, x_c >> 16, z_b >> 7, z_c >> 7);
    					x_b += x_b_off;
    					x_c += x_c_off;
    					z_b += z_b_off;
    					z_c += z_c_off;
    				}
    
    				while (--y_b >= 0) {
    					drawShadedLine(pixels, y_c, x_b >> 16, x_a >> 16, z_b >> 7, z_a >> 7);
    					x_b += x_b_off;
    					x_a += x_a_off;
    					z_b += z_b_off;
    					z_a += z_a_off;
    					y_c += width;
    				}
    				return;
    			}
    			y_b -= y_a;
    			y_a -= y_c;
    			for (y_c = lineOffsets[y_c]; --y_a >= 0; y_c += width) {
    				drawShadedLine(pixels, y_c, x_c >> 16, x_b >> 16, z_c >> 7, z_b >> 7);
    				x_b += x_b_off;
    				x_c += x_c_off;
    				z_b += z_b_off;
    				z_c += z_c_off;
    			}
    
    			while (--y_b >= 0) {
    				drawShadedLine(pixels, y_c, x_a >> 16, x_b >> 16, z_a >> 7, z_b >> 7);
    				x_b += x_b_off;
    				x_a += x_a_off;
    				z_b += z_b_off;
    				z_a += z_a_off;
    				y_c += width;
    			}
    			return;
    		}
    		x_a = x_c <<= 16;
    		z_a = z_c <<= 15;
    		if (y_c < 0) {
    			x_a -= x_b_off * y_c;
    			x_c -= x_c_off * y_c;
    			z_a -= z_b_off * y_c;
    			z_c -= z_c_off * y_c;
    			y_c = 0;
    		}
    		x_b <<= 16;
    		z_b <<= 15;
    		if (y_b < 0) {
    			x_b -= x_a_off * y_b;
    			z_b -= z_a_off * y_b;
    			y_b = 0;
    		}
    		if (x_b_off < x_c_off) {
    			y_a -= y_b;
    			y_b -= y_c;
    			for (y_c = lineOffsets[y_c]; --y_b >= 0; y_c += width) {
    				drawShadedLine(pixels, y_c, x_a >> 16, x_c >> 16, z_a >> 7, z_c >> 7);
    				x_a += x_b_off;
    				x_c += x_c_off;
    				z_a += z_b_off;
    				z_c += z_c_off;
    			}
    
    			while (--y_a >= 0) {
    				drawShadedLine(pixels, y_c, x_b >> 16, x_c >> 16, z_b >> 7, z_c >> 7);
    				x_b += x_a_off;
    				x_c += x_c_off;
    				z_b += z_a_off;
    				z_c += z_c_off;
    				y_c += width;
    			}
    			return;
    		}
    		y_a -= y_b;
    		y_b -= y_c;
    		for (y_c = lineOffsets[y_c]; --y_b >= 0; y_c += width) {
    			drawShadedLine(pixels, y_c, x_c >> 16, x_a >> 16, z_c >> 7, z_a >> 7);
    			x_a += x_b_off;
    			x_c += x_c_off;
    			z_a += z_b_off;
    			z_c += z_c_off;
    		}
    
    		while (--y_a >= 0) {
    			drawShadedLine(pixels, y_c, x_c >> 16, x_b >> 16, z_c >> 7, z_b >> 7);
    			x_b += x_a_off;
    			x_c += x_c_off;
    			z_b += z_a_off;
    			z_c += z_c_off;
    			y_c += width;
    		}
    	}
    
    	private static void drawShadedLine(int dest[], int dest_off, int startX, int endX, int colorIndex, int grad)
    	{
    		//fixed the vertex blender
    		int color;
    		int loops;
    		int off = 0;
    		if(restrict_edges)
    		{
    			if(endX > Canvas2D.centerX)
    				endX = Canvas2D.centerX;
    			if(startX < 0)
    			{
    				colorIndex -= startX * off;
    				startX = 0;
    			}
    		}
    		if(startX >= endX)
    			return;
    		dest_off += startX;// - 1;//causes crashes if left as orig
    		colorIndex += off * startX;
    		int tmp;
    			if(notTextured)
    			{
    				loops = endX - startX >> 2;
    				//added code to get the grad working again
    				if(loops > 0)
    					off = (grad - colorIndex) * shadowDecay[loops] >> 15;
    				else
    					off = 0;
    
    				if(alpha == 0)
    				{
    					if(loops > 0)
    						do
    						{
    							color = hsl2rgb[colorIndex>>8];
    							colorIndex += off;
    							dest[dest_off++] = color;
    							dest[dest_off++] = color;
    							dest[dest_off++] = color;
    							dest[dest_off++] = color;
    						} while(--loops > 0);
    					loops = endX - startX & 3;
    					if(loops > 0)
    					{
    						color = hsl2rgb[colorIndex>>8];
    						do
    						{
    							dest[dest_off++] = color;
    						} while(--loops > 0);
    						return;
    					}
    				} else
    				{
    					int src_alpha = alpha;
    					int dest_alpha = 256 - alpha;
    					if(loops > 0)
    						do
    						{
    							color = hsl2rgb[colorIndex>>8];
    							colorIndex += off;
    							color = ((color & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((color & 0xff00) * dest_alpha >> 8 & 0xff00);
    							tmp = dest[dest_off];
    							dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    							tmp = dest[dest_off];
    							dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    							tmp = dest[dest_off];
    							dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    							tmp = dest[dest_off];
    							dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    
    						} while(--loops > 0);
    					loops = endX - startX & 3;
    					if(loops > 0)
    					{
    						color = hsl2rgb[colorIndex>>8];
    						color = ((color & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((color & 0xff00) * dest_alpha >> 8 & 0xff00);
    						do
    						{
    							tmp = dest[dest_off];
    							dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    
    						} while(--loops > 0);
    					}
    				}
    				return;
    			}
    			loops = endX - startX;
    			if(alpha == 0)
    			{
    				do
    				{
    
    						dest[dest_off++] = hsl2rgb[colorIndex>>8];
    
    					colorIndex += off;
    				} while(--loops > 0);
    				return;
    			}
    			int src_alpha = alpha;
    			int dest_alpha = 256 - alpha;
    			do
    			{
    
    					color = hsl2rgb[colorIndex>>8];
    					color = ((color & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((color & 0xff00) * dest_alpha >> 8 & 0xff00);
    					tmp = dest[dest_off];
    					dest[dest_off++] = color + ((tmp & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((tmp & 0xff00) * src_alpha >> 8 & 0xff00);
    
    
    				colorIndex += off;
    			} while(--loops > 0);
    			return;
    	}
    
    	public static int triangles = 0;
    
    
    	public static void drawFlatTriangle(int y_a, int y_b, int y_c, int x_a, int x_b, int x_c, int color) {
    		++triangles;
    		int x_a_off = 0;
    		if (y_b != y_a) {
    			x_a_off = (x_b - x_a << 16) / (y_b - y_a);
    		}
    		int x_b_off = 0;
    		if (y_c != y_b) {
    			x_b_off = (x_c - x_b << 16) / (y_c - y_b);
    		}
    		int x_c_off = 0;
    		if (y_c != y_a) {
    			x_c_off = (x_a - x_c << 16) / (y_a - y_c);
    		}
    		if (y_a <= y_b && y_a <= y_c) {
    			if (y_a >= Canvas2D.bottomY) {
    				return;
    			}
    			if (y_b > Canvas2D.bottomY) {
    				y_b = Canvas2D.bottomY;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_b < y_c) {
    				x_c = x_a <<= 16;
    				if (y_a < 0) {
    					x_c -= x_c_off * y_a;
    					x_a -= x_a_off * y_a;
    					y_a = 0;
    				}
    				x_b <<= 16;
    				if (y_b < 0) {
    					x_b -= x_b_off * y_b;
    					y_b = 0;
    				}
    				if (y_a != y_b && x_c_off < x_a_off || y_a == y_b && x_c_off > x_b_off) {
    					y_c -= y_b;
    					y_b -= y_a;
    					for (y_a = lineOffsets[y_a]; --y_b >= 0; y_a += width) {
    						drawScanLine(pixels, y_a, color, x_c >> 16, x_a >> 16);
    						x_c += x_c_off;
    						x_a += x_a_off;
    					}
    
    					while (--y_c >= 0) {
    						drawScanLine(pixels, y_a, color, x_c >> 16, x_b >> 16);
    						x_c += x_c_off;
    						x_b += x_b_off;
    						y_a += width;
    					}
    					return;
    				}
    				y_c -= y_b;
    				y_b -= y_a;
    				for (y_a = lineOffsets[y_a]; --y_b >= 0; y_a += width) {
    					drawScanLine(pixels, y_a, color, x_a >> 16, x_c >> 16);
    					x_c += x_c_off;
    					x_a += x_a_off;
    				}
    
    				while (--y_c >= 0) {
    					drawScanLine(pixels, y_a, color, x_b >> 16, x_c >> 16);
    					x_c += x_c_off;
    					x_b += x_b_off;
    					y_a += width;
    				}
    				return;
    			}
    			x_b = x_a <<= 16;
    			if (y_a < 0) {
    				x_b -= x_c_off * y_a;
    				x_a -= x_a_off * y_a;
    				y_a = 0;
    			}
    			x_c <<= 16;
    			if (y_c < 0) {
    				x_c -= x_b_off * y_c;
    				y_c = 0;
    			}
    			if (y_a != y_c && x_c_off < x_a_off || y_a == y_c && x_b_off > x_a_off) {
    				y_b -= y_c;
    				y_c -= y_a;
    				for (y_a = lineOffsets[y_a]; --y_c >= 0; y_a += width) {
    					drawScanLine(pixels, y_a, color, x_b >> 16, x_a >> 16);
    					x_b += x_c_off;
    					x_a += x_a_off;
    				}
    
    				while (--y_b >= 0) {
    					drawScanLine(pixels, y_a, color, x_c >> 16, x_a >> 16);
    					x_c += x_b_off;
    					x_a += x_a_off;
    					y_a += width;
    				}
    				return;
    			}
    			y_b -= y_c;
    			y_c -= y_a;
    			for (y_a = lineOffsets[y_a]; --y_c >= 0; y_a += width) {
    				drawScanLine(pixels, y_a, color, x_a >> 16, x_b >> 16);
    				x_b += x_c_off;
    				x_a += x_a_off;
    			}
    
    			while (--y_b >= 0) {
    				drawScanLine(pixels, y_a, color, x_a >> 16, x_c >> 16);
    				x_c += x_b_off;
    				x_a += x_a_off;
    				y_a += width;
    			}
    			return;
    		}
    		if (y_b <= y_c) {
    			if (y_b >= Canvas2D.bottomY) {
    				return;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_a > Canvas2D.bottomY) {
    				y_a = Canvas2D.bottomY;
    			}
    			if (y_c < y_a) {
    				x_a = x_b <<= 16;
    				if (y_b < 0) {
    					x_a -= x_a_off * y_b;
    					x_b -= x_b_off * y_b;
    					y_b = 0;
    				}
    				x_c <<= 16;
    				if (y_c < 0) {
    					x_c -= x_c_off * y_c;
    					y_c = 0;
    				}
    				if (y_b != y_c && x_a_off < x_b_off || y_b == y_c && x_a_off > x_c_off) {
    					y_a -= y_c;
    					y_c -= y_b;
    					for (y_b = lineOffsets[y_b]; --y_c >= 0; y_b += width) {
    						drawScanLine(pixels, y_b, color, x_a >> 16, x_b >> 16);
    						x_a += x_a_off;
    						x_b += x_b_off;
    					}
    
    					while (--y_a >= 0) {
    						drawScanLine(pixels, y_b, color, x_a >> 16, x_c >> 16);
    						x_a += x_a_off;
    						x_c += x_c_off;
    						y_b += width;
    					}
    					return;
    				}
    				y_a -= y_c;
    				y_c -= y_b;
    				for (y_b = lineOffsets[y_b]; --y_c >= 0; y_b += width) {
    					drawScanLine(pixels, y_b, color, x_b >> 16, x_a >> 16);
    					x_a += x_a_off;
    					x_b += x_b_off;
    				}
    
    				while (--y_a >= 0) {
    					drawScanLine(pixels, y_b, color, x_c >> 16, x_a >> 16);
    					x_a += x_a_off;
    					x_c += x_c_off;
    					y_b += width;
    				}
    				return;
    			}
    			x_c = x_b <<= 16;
    			if (y_b < 0) {
    				x_c -= x_a_off * y_b;
    				x_b -= x_b_off * y_b;
    				y_b = 0;
    			}
    			x_a <<= 16;
    			if (y_a < 0) {
    				x_a -= x_c_off * y_a;
    				y_a = 0;
    			}
    			if (x_a_off < x_b_off) {
    				y_c -= y_a;
    				y_a -= y_b;
    				for (y_b = lineOffsets[y_b]; --y_a >= 0; y_b += width) {
    					drawScanLine(pixels, y_b, color, x_c >> 16, x_b >> 16);
    					x_c += x_a_off;
    					x_b += x_b_off;
    				}
    
    				while (--y_c >= 0) {
    					drawScanLine(pixels, y_b, color, x_a >> 16, x_b >> 16);
    					x_a += x_c_off;
    					x_b += x_b_off;
    					y_b += width;
    				}
    				return;
    			}
    			y_c -= y_a;
    			y_a -= y_b;
    			for (y_b = lineOffsets[y_b]; --y_a >= 0; y_b += width) {
    				drawScanLine(pixels, y_b, color, x_b >> 16, x_c >> 16);
    				x_c += x_a_off;
    				x_b += x_b_off;
    			}
    
    			while (--y_c >= 0) {
    				drawScanLine(pixels, y_b, color, x_b >> 16, x_a >> 16);
    				x_a += x_c_off;
    				x_b += x_b_off;
    				y_b += width;
    			}
    			return;
    		}
    		if (y_c >= Canvas2D.bottomY) {
    			return;
    		}
    		if (y_a > Canvas2D.bottomY) {
    			y_a = Canvas2D.bottomY;
    		}
    		if (y_b > Canvas2D.bottomY) {
    			y_b = Canvas2D.bottomY;
    		}
    		if (y_a < y_b) {
    			x_b = x_c <<= 16;
    			if (y_c < 0) {
    				x_b -= x_b_off * y_c;
    				x_c -= x_c_off * y_c;
    				y_c = 0;
    			}
    			x_a <<= 16;
    			if (y_a < 0) {
    				x_a -= x_a_off * y_a;
    				y_a = 0;
    			}
    			if (x_b_off < x_c_off) {
    				y_b -= y_a;
    				y_a -= y_c;
    				for (y_c = lineOffsets[y_c]; --y_a >= 0; y_c += width) {
    					drawScanLine(pixels, y_c, color, x_b >> 16, x_c >> 16);
    					x_b += x_b_off;
    					x_c += x_c_off;
    				}
    
    				while (--y_b >= 0) {
    					drawScanLine(pixels, y_c, color, x_b >> 16, x_a >> 16);
    					x_b += x_b_off;
    					x_a += x_a_off;
    					y_c += width;
    				}
    				return;
    			}
    			y_b -= y_a;
    			y_a -= y_c;
    			for (y_c = lineOffsets[y_c]; --y_a >= 0; y_c += width) {
    				drawScanLine(pixels, y_c, color, x_c >> 16, x_b >> 16);
    				x_b += x_b_off;
    				x_c += x_c_off;
    			}
    
    			while (--y_b >= 0) {
    				drawScanLine(pixels, y_c, color, x_a >> 16, x_b >> 16);
    				x_b += x_b_off;
    				x_a += x_a_off;
    				y_c += width;
    			}
    			return;
    		}
    		x_a = x_c <<= 16;
    		if (y_c < 0) {
    			x_a -= x_b_off * y_c;
    			x_c -= x_c_off * y_c;
    			y_c = 0;
    		}
    		x_b <<= 16;
    		if (y_b < 0) {
    			x_b -= x_a_off * y_b;
    			y_b = 0;
    		}
    		if (x_b_off < x_c_off) {
    			y_a -= y_b;
    			y_b -= y_c;
    			for (y_c = lineOffsets[y_c]; --y_b >= 0; y_c += width) {
    				drawScanLine(pixels, y_c, color, x_a >> 16, x_c >> 16);
    				x_a += x_b_off;
    				x_c += x_c_off;
    			}
    
    			while (--y_a >= 0) {
    				drawScanLine(pixels, y_c, color, x_b >> 16, x_c >> 16);
    				x_b += x_a_off;
    				x_c += x_c_off;
    				y_c += width;
    			}
    			return;
    		}
    		y_a -= y_b;
    		y_b -= y_c;
    		for (y_c = lineOffsets[y_c]; --y_b >= 0; y_c += width) {
    			drawScanLine(pixels, y_c, color, x_c >> 16, x_a >> 16);
    			x_a += x_b_off;
    			x_c += x_c_off;
    		}
    
    		while (--y_a >= 0) {
    			drawScanLine(pixels, y_c, color, x_c >> 16, x_b >> 16);
    			x_b += x_a_off;
    			x_c += x_c_off;
    			y_c += width;
    		}
    	}
    
    	private static void drawScanLine(int dest[], int dest_off, int loops, int start_x, int end_x) {
    		int rgb;//was parameter
    		if (restrict_edges) {
    			if (end_x > Canvas2D.centerX) {
    				end_x = Canvas2D.centerX;
    			}
    			if (start_x < 0) {
    				start_x = 0;
    			}
    		}
    		if (start_x >= end_x) {
    			return;
    		}
    		dest_off += start_x;
    		rgb = end_x - start_x >> 2;
    		if (alpha == 0) {
    			while (--rgb >= 0) {
    				dest[dest_off++] = loops;
    				dest[dest_off++] = loops;
    				dest[dest_off++] = loops;
    				dest[dest_off++] = loops;
    			}
    			for (rgb = end_x - start_x & 3; --rgb >= 0; ) {
    				dest[dest_off++] = loops;
    			}
    
    			return;
    		}
    		int dest_alpha = alpha;
    		int src_alpha = 256 - alpha;
    		loops = ((loops & 0xff00ff) * src_alpha >> 8 & 0xff00ff) + ((loops & 0xff00) * src_alpha >> 8 & 0xff00);
    		  while (--rgb >= 0) {//alpha channel fix
    				dest[dest_off] = loops + ((dest[dest_off] & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((dest[dest_off] & 0xff00) * dest_alpha >> 8 & 0xff00);
    				dest_off++;
    				dest[dest_off] = loops + ((dest[dest_off] & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((dest[dest_off] & 0xff00) * dest_alpha >> 8 & 0xff00);
    				dest_off++;
    				dest[dest_off] = loops + ((dest[dest_off] & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((dest[dest_off] & 0xff00) * dest_alpha >> 8 & 0xff00);
    				dest_off++;
    				dest[dest_off] = loops + ((dest[dest_off] & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((dest[dest_off] & 0xff00) * dest_alpha >> 8 & 0xff00);
    				dest_off++;
    		  }
    			for (rgb = end_x - start_x & 3; --rgb >= 0; ) {
    				dest[dest_off] = loops + ((dest[dest_off] & 0xff00ff) * dest_alpha >> 8 & 0xff00ff) + ((dest[dest_off] & 0xff00) * dest_alpha >> 8 & 0xff00);
    				dest_off++;
    			}
    
    	}
    
    	public static boolean drawTexturedTriangle(int y_a, int y_b, int y_c, int x_a, int x_b, int x_c, int grad_a, int grad_b, int grad_c, int Px, int Mx, int Nx, int Pz, int Mz, int Nz, int Py, int My, int Ny, int t_id, int color, boolean force) {
    		if (t_id < 0 || t_id >= TextureDef.textures.length) {
    			drawShadedTriangle(y_a, y_b, y_c, x_a, x_b, x_c, grad_a, grad_b, grad_c);
    			return true;
    		}
    		TextureDef def = TextureDef.textures[t_id];
    		if (def == null || (!force && !def.aBoolean1223 && lowMem)) {
    			drawShadedTriangle(y_a, y_b, y_c, x_a, x_b, x_c, grad_a, grad_b, grad_c);
    			return true;
    		}
    		int texture[] = getTexturePixels(t_id);
    		if (texture == null) {
    			drawShadedTriangle(y_a, y_b, y_c, x_a, x_b, x_c, grad_a, grad_b, grad_c);
    			return false;
    		}
    		if (color >= 0xffff) {
    			color = -1;
    		}
    
    		if (color >= 0) {
    			color = hsl2rgb[color];
    		}
    
    		++triangles;
    		Mx = Px - Mx;
    		Mz = Pz - Mz;
    		My = Py - My;
    		Nx -= Px;
    		Nz -= Pz;
    		Ny -= Py;
    		int Oa = Nx * Pz - Nz * Px << 14;
    		int Ha = Nz * Py - Ny * Pz << 8;
    		int Va = Ny * Px - Nx * Py << 5;
    		int Ob = Mx * Pz - Mz * Px << 14;
    		int Hb = Mz * Py - My * Pz << 8;
    		int Vb = My * Px - Mx * Py << 5;
    		int Oc = Mz * Nx - Mx * Nz << 14;
    		int Hc = My * Nz - Mz * Ny << 8;
    		int Vc = Mx * Ny - My * Nx << 5;
    		int x_a_off = 0;
    		int grad_a_off = 0;
    		if (y_b != y_a) {
    			x_a_off = (x_b - x_a << 16) / (y_b - y_a);
    			grad_a_off = (grad_b - grad_a << 16) / (y_b - y_a);
    		}
    		int x_b_off = 0;
    		int grad_b_off = 0;
    		if (y_c != y_b) {
    			x_b_off = (x_c - x_b << 16) / (y_c - y_b);
    			grad_b_off = (grad_c - grad_b << 16) / (y_c - y_b);
    		}
    		int x_c_off = 0;
    		int grad_c_off = 0;
    		if (y_c != y_a) {
    			x_c_off = (x_a - x_c << 16) / (y_a - y_c);
    			grad_c_off = (grad_a - grad_c << 16) / (y_a - y_c);
    		}
    		if (y_a <= y_b && y_a <= y_c) {
    			if (y_a >= Canvas2D.bottomY) {
    				return true;
    			}
    			if (y_b > Canvas2D.bottomY) {
    				y_b = Canvas2D.bottomY;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_b < y_c) {
    				x_c = x_a <<= 16;
    				grad_c = grad_a <<= 16;
    				if (y_a < 0) {
    					x_c -= x_c_off * y_a;
    					x_a -= x_a_off * y_a;
    					grad_c -= grad_c_off * y_a;
    					grad_a -= grad_a_off * y_a;
    					y_a = 0;
    				}
    				x_b <<= 16;
    				grad_b <<= 16;
    				if (y_b < 0) {
    					x_b -= x_b_off * y_b;
    					grad_b -= grad_b_off * y_b;
    					y_b = 0;
    				}
    				int jA = y_a - centerY;
    				Oa += Va * jA;
    				Ob += Vb * jA;
    				Oc += Vc * jA;
    				/*if (y_a != y_b && x_c_off < x_a_off || y_a == y_b && x_c_off > x_b_off) {
    					y_c -= y_b;
    					y_b -= y_a;
    					y_a = lineOffsets[y_a];
    					while (--y_b >= 0) {
    						drawTexturedLine(pixels, texture, y_a, x_c >> 16, x_a >> 16, grad_c >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    						x_c += x_c_off;
    						x_a += x_a_off;
    						grad_c += grad_c_off;
    						grad_a += grad_a_off;
    						y_a += width;
    						Oa += Va;
    						Ob += Vb;
    						Oc += Vc;
    					}
    					while (--y_c >= 0) {
    						drawTexturedLine(pixels, texture, y_a, x_c >> 16, x_b >> 16, grad_c >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    						x_c += x_c_off;
    						x_b += x_b_off;
    						grad_c += grad_c_off;
    						grad_b += grad_b_off;
    						y_a += width;
    						Oa += Va;
    						Ob += Vb;
    						Oc += Vc;
    					}
    					return true;
    				}*/
    				y_c -= y_b;
    				y_b -= y_a;
    				y_a = lineOffsets[y_a];
    				while (--y_b >= 0) {
    					drawTexturedLine(pixels, texture, y_a, x_a >> 16, x_c >> 16, grad_a >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_c += x_c_off;
    					x_a += x_a_off;
    					grad_c += grad_c_off;
    					grad_a += grad_a_off;
    					y_a += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				while (--y_c >= 0) {
    					drawTexturedLine(pixels, texture, y_a, x_b >> 16, x_c >> 16, grad_b >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_c += x_c_off;
    					x_b += x_b_off;
    					grad_c += grad_c_off;
    					grad_b += grad_b_off;
    					y_a += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				return true;
    			}
    			x_b = x_a <<= 16;
    			grad_b = grad_a <<= 16;
    			if (y_a < 0) {
    				x_b -= x_c_off * y_a;
    				x_a -= x_a_off * y_a;
    				grad_b -= grad_c_off * y_a;
    				grad_a -= grad_a_off * y_a;
    				y_a = 0;
    			}
    			x_c <<= 16;
    			grad_c <<= 16;
    			if (y_c < 0) {
    				x_c -= x_b_off * y_c;
    				grad_c -= grad_b_off * y_c;
    				y_c = 0;
    			}
    			int l8 = y_a - centerY;
    			Oa += Va * l8;
    			Ob += Vb * l8;
    			Oc += Vc * l8;
    			/*if (y_a != y_c && x_c_off < x_a_off || y_a == y_c && x_b_off > x_a_off) {
    				y_b -= y_c;
    				y_c -= y_a;
    				y_a = lineOffsets[y_a];
    				while (--y_c >= 0) {
    					drawTexturedLine(pixels, texture, y_a, x_b >> 16, x_a >> 16, grad_b >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_b += x_c_off;
    					x_a += x_a_off;
    					grad_b += grad_c_off;
    					grad_a += grad_a_off;
    					y_a += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				while (--y_b >= 0) {
    					drawTexturedLine(pixels, texture, y_a, x_c >> 16, x_a >> 16, grad_c >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_c += x_b_off;
    					x_a += x_a_off;
    					grad_c += grad_b_off;
    					grad_a += grad_a_off;
    					y_a += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				return true;
    			}*/
    			y_b -= y_c;
    			y_c -= y_a;
    			y_a = lineOffsets[y_a];
    			while (--y_c >= 0) {
    				drawTexturedLine(pixels, texture, y_a, x_a >> 16, x_b >> 16, grad_a >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_b += x_c_off;
    				x_a += x_a_off;
    				grad_b += grad_c_off;
    				grad_a += grad_a_off;
    				y_a += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			while (--y_b >= 0) {
    				drawTexturedLine(pixels, texture, y_a, x_a >> 16, x_c >> 16, grad_a >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_c += x_b_off;
    				x_a += x_a_off;
    				grad_c += grad_b_off;
    				grad_a += grad_a_off;
    				y_a += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			return true;
    		}
    		if (y_b <= y_c) {
    			if (y_b >= Canvas2D.bottomY) {
    				return true;
    			}
    			if (y_c > Canvas2D.bottomY) {
    				y_c = Canvas2D.bottomY;
    			}
    			if (y_a > Canvas2D.bottomY) {
    				y_a = Canvas2D.bottomY;
    			}
    			if (y_c < y_a) {
    				x_a = x_b <<= 16;
    				grad_a = grad_b <<= 16;
    				if (y_b < 0) {
    					x_a -= x_a_off * y_b;
    					x_b -= x_b_off * y_b;
    					grad_a -= grad_a_off * y_b;
    					grad_b -= grad_b_off * y_b;
    					y_b = 0;
    				}
    				x_c <<= 16;
    				grad_c <<= 16;
    				if (y_c < 0) {
    					x_c -= x_c_off * y_c;
    					grad_c -= grad_c_off * y_c;
    					y_c = 0;
    				}
    				int i9 = y_b - centerY;
    				Oa += Va * i9;
    				Ob += Vb * i9;
    				Oc += Vc * i9;
    				/*if (y_b != y_c && x_a_off < x_b_off || y_b == y_c && x_a_off > x_c_off) {
    					y_a -= y_c;
    					y_c -= y_b;
    					y_b = lineOffsets[y_b];
    					while (--y_c >= 0) {
    						drawTexturedLine(pixels, texture, y_b, x_a >> 16, x_b >> 16, grad_a >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    						x_a += x_a_off;
    						x_b += x_b_off;
    						grad_a += grad_a_off;
    						grad_b += grad_b_off;
    						y_b += width;
    						Oa += Va;
    						Ob += Vb;
    						Oc += Vc;
    					}
    					while (--y_a >= 0) {
    						drawTexturedLine(pixels, texture, y_b, x_a >> 16, x_c >> 16, grad_a >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    						x_a += x_a_off;
    						x_c += x_c_off;
    						grad_a += grad_a_off;
    						grad_c += grad_c_off;
    						y_b += width;
    						Oa += Va;
    						Ob += Vb;
    						Oc += Vc;
    					}
    					return true;
    				}*/
    				y_a -= y_c;
    				y_c -= y_b;
    				y_b = lineOffsets[y_b];
    				//not these
    				while (--y_c >= 0) {
    					drawTexturedLine(pixels, texture, y_b, x_b >> 16, x_a >> 16, grad_b >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_a += x_a_off;
    					x_b += x_b_off;
    					grad_a += grad_a_off;
    					grad_b += grad_b_off;
    					y_b += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				while (--y_a >= 0) {
    					drawTexturedLine(pixels, texture, y_b, x_c >> 16, x_a >> 16, grad_c >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_a += x_a_off;
    					x_c += x_c_off;
    					grad_a += grad_a_off;
    					grad_c += grad_c_off;
    					y_b += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				return true;
    			}
    			x_c = x_b <<= 16;
    			grad_c = grad_b <<= 16;
    			if (y_b < 0) {
    				x_c -= x_a_off * y_b;
    				x_b -= x_b_off * y_b;
    				grad_c -= grad_a_off * y_b;
    				grad_b -= grad_b_off * y_b;
    				y_b = 0;
    			}
    			x_a <<= 16;
    			grad_a <<= 16;
    			if (y_a < 0) {
    				x_a -= x_c_off * y_a;
    				grad_a -= grad_c_off * y_a;
    				y_a = 0;
    			}
    			int j9 = y_b - centerY;
    			Oa += Va * j9;
    			Ob += Vb * j9;
    			Oc += Vc * j9;
    			/*if (x_a_off < x_b_off) {
    				y_c -= y_a;
    				y_a -= y_b;
    				y_b = lineOffsets[y_b];
    				while (--y_a >= 0) {
    					drawTexturedLine(pixels, texture, y_b, x_c >> 16, x_b >> 16, grad_c >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_c += x_a_off;
    					x_b += x_b_off;
    					grad_c += grad_a_off;
    					grad_b += grad_b_off;
    					y_b += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				while (--y_c >= 0) {
    					drawTexturedLine(pixels, texture, y_b, x_a >> 16, x_b >> 16, grad_a >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_a += x_c_off;
    					x_b += x_b_off;
    					grad_a += grad_c_off;
    					grad_b += grad_b_off;
    					y_b += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				return true;
    			}*/
    			y_c -= y_a;
    			y_a -= y_b;
    			y_b = lineOffsets[y_b];
    			//not these
    			while (--y_a >= 0) {
    				drawTexturedLine(pixels, texture, y_b, x_b >> 16, x_c >> 16, grad_b >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_c += x_a_off;
    				x_b += x_b_off;
    				grad_c += grad_a_off;
    				grad_b += grad_b_off;
    				y_b += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			while (--y_c >= 0) {
    				drawTexturedLine(pixels, texture, y_b, x_b >> 16, x_a >> 16, grad_b >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_a += x_c_off;
    				x_b += x_b_off;
    				grad_a += grad_c_off;
    				grad_b += grad_b_off;
    				y_b += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			return true;
    		}
    		if (y_c >= Canvas2D.bottomY) {
    			return true;
    		}
    		if (y_a > Canvas2D.bottomY) {
    			y_a = Canvas2D.bottomY;
    		}
    		if (y_b > Canvas2D.bottomY) {
    			y_b = Canvas2D.bottomY;
    		}
    		if (y_a < y_b) {
    			x_b = x_c <<= 16;
    			grad_b = grad_c <<= 16;
    			if (y_c < 0) {
    				x_b -= x_b_off * y_c;
    				x_c -= x_c_off * y_c;
    				grad_b -= grad_b_off * y_c;
    				grad_c -= grad_c_off * y_c;
    				y_c = 0;
    			}
    			x_a <<= 16;
    			grad_a <<= 16;
    			if (y_a < 0) {
    				x_a -= x_a_off * y_a;
    				grad_a -= grad_a_off * y_a;
    				y_a = 0;
    			}
    			int k9 = y_c - centerY;
    			Oa += Va * k9;
    			Ob += Vb * k9;
    			Oc += Vc * k9;
    			/*if (x_b_off < x_c_off) {
    				y_b -= y_a;
    				y_a -= y_c;
    				y_c = lineOffsets[y_c];
    				while (--y_a >= 0) {
    					drawTexturedLine(pixels, texture, y_c, x_b >> 16, x_c >> 16, grad_b >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_b += x_b_off;
    					x_c += x_c_off;
    					grad_b += grad_b_off;
    					grad_c += grad_c_off;
    					y_c += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				while (--y_b >= 0) {
    					drawTexturedLine(pixels, texture, y_c, x_b >> 16, x_a >> 16, grad_b >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    					x_b += x_b_off;
    					x_a += x_a_off;
    					grad_b += grad_b_off;
    					grad_a += grad_a_off;
    					y_c += width;
    					Oa += Va;
    					Ob += Vb;
    					Oc += Vc;
    				}
    				return true;
    			}*/
    			y_b -= y_a;
    			y_a -= y_c;
    			y_c = lineOffsets[y_c];
    			//not these
    			while (--y_a >= 0) {
    				drawTexturedLine(pixels, texture, y_c, x_c >> 16, x_b >> 16, grad_c >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_b += x_b_off;
    				x_c += x_c_off;
    				grad_b += grad_b_off;
    				grad_c += grad_c_off;
    				y_c += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			while (--y_b >= 0) {
    				drawTexturedLine(pixels, texture, y_c, x_a >> 16, x_b >> 16, grad_a >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_b += x_b_off;
    				x_a += x_a_off;
    				grad_b += grad_b_off;
    				grad_a += grad_a_off;
    				y_c += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			return true;
    		}
    		x_a = x_c <<= 16;
    		grad_a = grad_c <<= 16;
    		if (y_c < 0) {
    			x_a -= x_b_off * y_c;
    			x_c -= x_c_off * y_c;
    			grad_a -= grad_b_off * y_c;
    			grad_c -= grad_c_off * y_c;
    			y_c = 0;
    		}
    		x_b <<= 16;
    		grad_b <<= 16;
    		if (y_b < 0) {
    			x_b -= x_a_off * y_b;
    			grad_b -= grad_a_off * y_b;
    			y_b = 0;
    		}
    		int l9 = y_c - centerY;
    		Oa += Va * l9;
    		Ob += Vb * l9;
    		Oc += Vc * l9;
    		if (x_b_off < x_c_off) {
    			y_a -= y_b;
    			y_b -= y_c;
    			y_c = lineOffsets[y_c];
    			/*while (--y_b >= 0) {
    				drawTexturedLine(pixels, texture, y_c, x_a >> 16, x_c >> 16, grad_a >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_a += x_b_off;
    				x_c += x_c_off;
    				grad_a += grad_b_off;
    				grad_c += grad_c_off;
    				y_c += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}
    			while (--y_a >= 0) {
    				drawTexturedLine(pixels, texture, y_c, x_b >> 16, x_c >> 16, grad_b >> 8, grad_c >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    				x_b += x_a_off;
    				x_c += x_c_off;
    				grad_b += grad_a_off;
    				grad_c += grad_c_off;
    				y_c += width;
    				Oa += Va;
    				Ob += Vb;
    				Oc += Vc;
    			}*/
    			return true;
    		}
    		y_a -= y_b;
    		y_b -= y_c;
    		y_c = lineOffsets[y_c];
    		//not these
    		while (--y_b >= 0) {
    			drawTexturedLine(pixels, texture, y_c, x_c >> 16, x_a >> 16, grad_c >> 8, grad_a >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    			x_a += x_b_off;
    			x_c += x_c_off;
    			grad_a += grad_b_off;
    			grad_c += grad_c_off;
    			y_c += width;
    			Oa += Va;
    			Ob += Vb;
    			Oc += Vc;
    		}
    		while (--y_a >= 0) {
    			drawTexturedLine(pixels, texture, y_c, x_c >> 16, x_b >> 16, grad_c >> 8, grad_b >> 8, Oa, Ob, Oc, Ha, Hb, Hc, color, force);
    			x_b += x_a_off;
    			x_c += x_c_off;
    			grad_b += grad_a_off;
    			grad_c += grad_c_off;
    			y_c += width;
    			Oa += Va;
    			Ob += Vb;
    			Oc += Vc;
    		}
    		return true;
    	}
    
    	private static void drawTexturedLine(int dest[], int texture[], int dest_off, int start_x, int end_x, int shadeValue, int gradient, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12, int color, boolean force) {
    		//shadeValue = 500;//lol makes textures ultra bright and makes triangles visible - slightly wrong name.. meh
    		int rgb = 0;
    		int loops = 0;
    		if (start_x >= end_x) {
    			return;
    		}
    		int j3;
    		int k3;
    		if (restrict_edges) {
    			j3 = (gradient - shadeValue) / (end_x - start_x);
    			if (end_x > Canvas2D.centerX) {
    				end_x = Canvas2D.centerX;
    			}
    			if (start_x < 0) {
    				shadeValue -= start_x * j3;
    				start_x = 0;
    			}
    			if (start_x >= end_x) {
    				return;
    			}
    			k3 = end_x - start_x >> 3;
    			j3 <<= 12;
    			shadeValue <<= 9;
    		} else {
    			if (end_x - start_x > 7) {
    				k3 = end_x - start_x >> 3;
    				j3 = (gradient - shadeValue) * shadowDecay[k3] >> 6;
    			} else {
    				k3 = 0;
    				j3 = 0;
    			}
    			shadeValue <<= 9;
    		}
    		dest_off += start_x;
    		int j4 = 0;
    		int l4 = 0;
    		int l6 = start_x - centerX;
    		arg7 += (arg10 >> 3) * l6;
    		arg8 += (arg11 >> 3) * l6;
    		arg9 += (arg12 >> 3) * l6;
    		int l5 = arg9 >> 14;
    		if (l5 != 0) {
    			rgb = arg7 / l5;
    			loops = arg8 / l5;
    			if (rgb < 0) {
    				rgb = 0;
    			} else if (rgb > 16256) {
    				rgb = 16256;
    			}
    		}
    		arg7 += arg10;
    		arg8 += arg11;
    		arg9 += arg12;
    		l5 = arg9 >> 14;
    		if (l5 != 0) {
    			j4 = arg7 / l5;
    			l4 = arg8 / l5;
    			if (j4 < 7) {
    				j4 = 7;
    			} else if (j4 > 16256) {
    				j4 = 16256;
    			}
    		}
    		int j7 = j4 - rgb >> 3;
    		int l7 = l4 - loops >> 3;
    		rgb += shadeValue & 0x600000;
    		int glb_alpha = alpha;
    		if (glb_alpha < 0 || glb_alpha >= 0xff)
    			glb_alpha = 0;
    
    		int src;
    		int src_alpha;
    		int src_delta;
    		int dst;
    		while (k3-- > 0)
    		{
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			//rgb += j7;
    			//loops += l7;
    
    			rgb = j4;
    			loops = l4;
    			arg7 += arg10;
    			arg8 += arg11;
    			arg9 += arg12;
    			int i6 = arg9 >> 14;
    			if (i6 != 0) {
    				j4 = arg7 / i6;
    				l4 = arg8 / i6;
    				if (j4 < 7) {
    					j4 = 7;
    				} else if (j4 > 16256) {
    					j4 = 16256;
    				}
    			}
    			j7 = j4 - rgb >> 3;
    			l7 = l4 - loops >> 3;
    			shadeValue += j3;
    			rgb += shadeValue & 0x600000;
    		}
    		for (k3 = end_x - start_x & 7; k3-- > 0; ) {
    			src = texture[(loops & 0x3f80) + (rgb >> 7)];
    			src_alpha = src >>> 24;
    			if (src_alpha != 0 || force)
    			{
    				if (src_alpha != 0xff && color >= 0)
    				{
    					if (src_alpha == 0)
    						src = color;
    
    					else
    					{
    						src_delta = 0xff - src_alpha;
    						src = ((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (color & 0xff00) | src_delta * (color & 0xff00ff) & 0xff00ff00) >>> 8));
    					}
    					src_alpha = 0xff;
    				}
    				if (glb_alpha > 0)
    					src_alpha = (src_alpha * (glb_alpha + 1)) >>> 8;
    
    				if (src_alpha != 0)
    				{
    					if (src_alpha == 0xff)
    						dest[dest_off] = src & 0xffffff;
    
    					else
    					{
    						dst = dest[dest_off];
    						src_delta = 0xff - src_alpha;
    						dest[dest_off] = (((0xff00ff00 & (0xff00ff & src) * src_alpha | 0xff0000 & (src & 0xff00) * src_alpha) >>> 8) + (((0xff0000 & src_delta * (dst & 0xff00) | src_delta * (dst & 0xff00ff) & 0xff00ff00) >>> 8))) & 0xffffff;
    					}
    				}
    			}
    			dest_off++;
    			rgb += j7;
    			loops += l7;
    		}
    
    	}
    
    
    	//public static final int anInt1459 = -477; dummy never used
    	public static boolean lowMem = true;
    	static boolean restrict_edges;
    	public static boolean notTextured = true;
    	public static int alpha;
    	public static int centerX;
    	public static int centerY;
    	private static int[] shadowDecay;
    	public static final int[] lightDecay;
    	public static int SINE[];
    	public static int COSINE[];
    	public static int lineOffsets[];
    	private static int loadedTextureCount;
    	private static int textureTexelPoolPointer;
    	private static int[][] texelArrayPool;
    	private static int[][] texelCache;
    	public static int[] textureLastUsed;
    	public static int textureGetCount;
    	public static int hsl2rgb[] = new int[0x10000];
     
    	static {
    		shadowDecay = new int[512];
    		lightDecay = new int[2048];
    		SINE = new int[2048];
    		COSINE = new int[2048];
    		for (int i = 1; i < 512; i++) {
    			shadowDecay[i] = 32768 / i;//decay rate for shadows or some *profound* - super_
    		}
    
    		for (int i = 1; i < 2048; i++) {
    			lightDecay[i] = 0x10000 / i;
    		}
    
    		for (int i = 0; i < 2048; i++) {
    			SINE[i] = (int) (65536D * Math.sin((double) i * (Math.PI / 1024.0D)));
    			COSINE[i] = (int) (65536D * Math.cos((double) i * (Math.PI / 1024.0D)));
    		}
    
    	}
    }
    Code:
    package src;
    
    
    import java.util.Random;
    
    public final class RSFont extends Canvas2D {
    
    	public RSFont(boolean flag, String s, Archive streamLoader) {
    		data = new byte[256][];
    		charWidth = new int[256];
    		charHeight = new int[256];
    		offsetX = new int[256];
    		offsetY = new int[256];
    		drawWidth = new int[256];
    		random = new Random();
    		drawStrikeout = false;
    		JagexBuffer stream = new JagexBuffer(streamLoader.getData(s
    				+ ".dat"));
    		JagexBuffer stream_1 = new JagexBuffer(
    				streamLoader.getData("index.dat"));
    		stream_1.currentOffset = stream.readShort() + 4;
    		int k = stream_1.readUByte();
    		if (k > 0)
    			stream_1.currentOffset += 3 * (k - 1);
    		for (int l = 0; l < 256; l++) {
    			offsetX[l] = stream_1.readUByte();
    			offsetY[l] = stream_1.readUByte();
    			int i1 = charWidth[l] = stream_1.readShort();
    			int j1 = charHeight[l] = stream_1.readShort();
    			int k1 = stream_1.readUByte();
    			int l1 = i1 * j1;
    			data[l] = new byte[l1];
    			if (k1 == 0) {
    				for (int i2 = 0; i2 < l1; i2++)
    					data[l][i2] = stream.readByte();
    
    			} else if (k1 == 1) {
    				for (int j2 = 0; j2 < i1; j2++) {
    					for (int l2 = 0; l2 < j1; l2++)
    						data[l][j2 + l2 * i1] = stream
    								.readByte();
    				}
    			}
    			if (j1 > height && l < 128)
    				height = j1;
    			offsetX[l] = 1;
    			drawWidth[l] = i1 + 2;
    			int k2 = 0;
    			for (int i3 = j1 / 7; i3 < j1; i3++)
    				k2 += data[l][i3 * i1];
    			if (k2 <= j1 / 7) {
    				drawWidth[l]--;
    				offsetX[l] = 0;
    			}
    			k2 = 0;
    			for (int j3 = j1 / 7; j3 < j1; j3++)
    				k2 += data[l][(i1 - 1) + j3 * i1];
    			if (k2 <= j1 / 7)
    				drawWidth[l]--;
    		}
    		if (flag) {
    			drawWidth[32] = drawWidth[73];
    		} else {
    			drawWidth[32] = drawWidth[105];
    		}
    	}
    
    	public void drawRightAligned(String s, int i, int j, int k) {
    		draw(j, s, k, i - stringWidth(s));
    	}
    
    	public void drawText(int i, String s, int k, int l) {
    		draw(i, s, k, l - stringWidth(s) / 2);
    	}
    
    	public void drawTaggableCentered(int i, int j, String s, int l, boolean flag) {
    		drawTaggable(flag, j - getTextWidth(s) / 2, i, s, l);
    	}
    
    	public void drawChatInput(int i, int j, String s, int l, boolean flag) {
    		drawTaggable(flag, j, i, s, l);
    	}
    
    	public int getTextWidth(String s) {
    		if (s == null)
    			return 0;
    		int j = 0;
    		for (int k = 0; k < s.length(); k++)
    			if (s.charAt(k) == '@' && k + 4 < s.length()
    					&& s.charAt(k + 4) == '@')
    				k += 4;
    			else
    				j += drawWidth[s.charAt(k)];
    		return j;
    	}
    
    	public int stringWidth(String s) {
    		if (s == null)
    			return 0;
    		int j = 0;
    		for (int k = 0; k < s.length(); k++)
    			j += drawWidth[s.charAt(k)];
    		return j;
    	}
    
    	public void draw(int i, String s, int j, int l) {
    		if (s == null)
    			return;
    		j -= height;
    		for (int i1 = 0; i1 < s.length(); i1++) {
    			char c = s.charAt(i1);
    			if (c != ' ')
    				drawChar(data[c], l + offsetX[c], j
    						+ offsetY[c], charWidth[c],
    						charHeight[c], i);
    			l += drawWidth[c];
    		}
    	}
    
    	public void drawWave1Centered(int i, String s, int j, int k, int l) {
    		if (s == null)
    			return;
    		j -= stringWidth(s) / 2;
    		l -= height;
    		for (int i1 = 0; i1 < s.length(); i1++) {
    			char c = s.charAt(i1);
    			if (c != ' ')
    				drawChar(
    						data[c],
    						j + offsetX[c],
    						l
    								+ offsetY[c]
    								+ (int) (Math.sin((double) i1 / 2D + (double) k
    										/ 5D) * 5D), charWidth[c],
    						charHeight[c], i);
    			j += drawWidth[c];
    		}
    	}
    
    	public void drawWave2Centered(int i, String s, int j, int k, int l) {
    		if (s == null)
    			return;
    		i -= stringWidth(s) / 2;
    		k -= height;
    		for (int i1 = 0; i1 < s.length(); i1++) {
    			char c = s.charAt(i1);
    			if (c != ' ')
    				drawChar(
    						data[c],
    						i
    								+ offsetX[c]
    								+ (int) (Math.sin((double) i1 / 5D + (double) j
    										/ 5D) * 5D),
    						k
    								+ offsetY[c]
    								+ (int) (Math.sin((double) i1 / 3D + (double) j
    										/ 5D) * 5D), charWidth[c],
    						charHeight[c], l);
    			i += drawWidth[c];
    		}
    	}
    
    	public void drawShakeCentered(int i, String s, int j, int k, int l, int i1) {
    		if (s == null)
    			return;
    		double d = 7D - (double) i / 8D;
    		if (d < 0.0D)
    			d = 0.0D;
    		l -= stringWidth(s) / 2;
    		k -= height;
    		for (int k1 = 0; k1 < s.length(); k1++) {
    			char c = s.charAt(k1);
    			if (c != ' ')
    				drawChar(
    						data[c],
    						l + offsetX[c],
    						k
    								+ offsetY[c]
    								+ (int) (Math.sin((double) k1 / 1.5D
    										+ (double) j) * d), charWidth[c],
    						charHeight[c], i1);
    			l += drawWidth[c];
    		}
    	}
    
    	public void drawTaggable(boolean flag1, int i, int j, String s, int k) {
    		drawStrikeout = false;
    		int l = i;
    		if (s == null)
    			return;
    		k -= height;
    		for (int i1 = 0; i1 < s.length(); i1++)
    			if (s.charAt(i1) == '@' && i1 + 4 < s.length()
    					&& s.charAt(i1 + 4) == '@') {
    				int j1 = getTagRGB(s.substring(i1 + 1, i1 + 4));
    				if (j1 != -1)
    					j = j1;
    				i1 += 4;
    			} else {
    				char c = s.charAt(i1);
    				if (c != ' ') {
    					if (flag1)
    						drawChar(data[c], i + offsetX[c]
    								+ 1, k + offsetY[c] + 1,
    								charWidth[c], charHeight[c], 0);
    					drawChar(data[c], i + offsetX[c], k
    							+ offsetY[c], charWidth[c],
    							charHeight[c], j);
    				}
    				i += drawWidth[c];
    			}
    		if (drawStrikeout)
    			Canvas2D.drawHorizontalLine(k
    					+ (int) ((double) height * 0.69999999999999996D),
    					0x800000, i - l, l);
    	}
    
    	public void drawString(int i, int j, String s, int k, int i1) {
    		if (s == null)
    			return;
    		random.setSeed(k);
    		int j1 = 192 + (random.nextInt() & 0x1f);
    		i1 -= height;
    		for (int k1 = 0; k1 < s.length(); k1++)
    			if (s.charAt(k1) == '@' && k1 + 4 < s.length()
    					&& s.charAt(k1 + 4) == '@') {
    				int l1 = getTagRGB(s.substring(k1 + 1, k1 + 4));
    				if (l1 != -1)
    					j = l1;
    				k1 += 4;
    			} else {
    				char c = s.charAt(k1);
    				if (c != ' ') {
    					drawChar(192, i + offsetX[c] + 1,
    							data[c], charWidth[c], i1
    									+ offsetY[c] + 1, charHeight[c],
    							0);
    					drawChar(j1, i + offsetX[c],
    							data[c], charWidth[c], i1
    									+ offsetY[c], charHeight[c], j);
    				}
    				i += drawWidth[c];
    				if ((random.nextInt() & 3) == 0)
    					i++;
    			}
    	}
    
    	private int getTagRGB(String s) {
    		if (s.equals("369"))// color code, use as @###@
    			return 0x336699;// hex code
    		if (s.equals("mon"))
    			return 0x00ff80;
    		if (s.equals("red"))
    			return 0xff0000;
    		if (s.equals("gre"))
    			return 65280;
    		if (s.equals("blu"))
    			return 255;
    		if (s.equals("yel"))
    			return 0xffff00;
    		if (s.equals("cya"))
    			return 65535;
    		if (s.equals("mag"))
    			return 0xff00ff;
    		if (s.equals("whi"))
    			return 0xffffff;
    		if (s.equals("bla"))
    			return 0;
    		if (s.equals("lre"))
    			return 0xff9040;
    		if (s.equals("dre"))
    			return 0x800000;
    		if (s.equals("dbl"))
    			return 128;
    		if (s.equals("or1"))
    			return 0xffb000;
    		if (s.equals("or2"))
    			return 0xff7000;
    		if (s.equals("or3"))
    			return 0xff3000;
    		if (s.equals("gr1"))
    			return 0xc0ff00;
    		if (s.equals("gr2"))
    			return 0x80ff00;
    		if (s.equals("gr3"))
    			return 0x40ff00;
    		if (s.equals("str"))
    			drawStrikeout = true;
    		if (s.equals("end"))
    			drawStrikeout = false;
    		return -1;
    	}
    
    	private void drawChar(byte abyte0[], int i, int j, int k, int l, int i1) {
    		int j1 = i + j * width;
    		int k1 = width - k;
    		int l1 = 0;
    		int i2 = 0;
    		if (j < topY) {
    			int j2 = topY - j;
    			l -= j2;
    			j = topY;
    			i2 += j2 * k;
    			j1 += j2 * width;
    		}
    		if (j + l >= bottomY)
    			l -= ((j + l) - bottomY);
    		if (i < topX) {
    			int k2 = topX - i;
    			k -= k2;
    			i = topX;
    			i2 += k2;
    			j1 += k2;
    			l1 += k2;
    			k1 += k2;
    		}
    		if (i + k >= bottomX) {
    			int l2 = ((i + k) - bottomX);
    			k -= l2;
    			l1 += l2;
    			k1 += l2;
    		}
    		if (!(k <= 0 || l <= 0)) {
    			arraycopyIgnore0(pixels, abyte0, i1, i2, j1, k, l, k1, l1);
    		}
    	}
    
    	private void arraycopyIgnore0(int ai[], byte abyte0[], int i, int j, int k, int l,
    			int i1, int j1, int k1) {
    		int l1 = -(l >> 2);
    		l = -(l & 3);
    		for (int i2 = -i1; i2 < 0; i2++) {
    			for (int j2 = l1; j2 < 0; j2++) {
    				if (abyte0[j++] != 0)
    					ai[k++] = i;
    				else
    					k++;
    				if (abyte0[j++] != 0)
    					ai[k++] = i;
    				else
    					k++;
    				if (abyte0[j++] != 0)
    					ai[k++] = i;
    				else
    					k++;
    				if (abyte0[j++] != 0)
    					ai[k++] = i;
    				else
    					k++;
    			}
    			for (int k2 = l; k2 < 0; k2++)
    				if (abyte0[j++] != 0)
    					ai[k++] = i;
    				else
    					k++;
    
    			k += j1;
    			j += k1;
    		}
    	}
    
    	private void drawChar(int i, int j, byte abyte0[], int k, int l, int i1,
    			int j1) {
    		int k1 = j + l * width;
    		int l1 = width - k;
    		int i2 = 0;
    		int j2 = 0;
    		if (l < topY) {
    			int k2 = topY - l;
    			i1 -= k2;
    			l = topY;
    			j2 += k2 * k;
    			k1 += k2 * width;
    		}
    		if (l + i1 >= bottomY)
    			i1 -= ((l + i1) - bottomY);
    		if (j < topX) {
    			int l2 = topX - j;
    			k -= l2;
    			j = topX;
    			j2 += l2;
    			k1 += l2;
    			i2 += l2;
    			l1 += l2;
    		}
    		if (j + k >= bottomX) {
    			int i3 = ((j + k) - bottomX);
    			k -= i3;
    			i2 += i3;
    			l1 += i3;
    		}
    		if (k <= 0 || i1 <= 0)
    			return;
    		arraycopyAlpha(abyte0, i1, k1, pixels, j2, k, i2, l1, j1, i);
    	}
    
    	private void arraycopyAlpha(byte abyte0[], int i, int j, int ai[], int l,
    			int i1, int j1, int k1, int l1, int i2) {
    		l1 = ((l1 & 0xff00ff) * i2 & 0xff00ff00)
    				+ ((l1 & 0xff00) * i2 & 0xff0000) >> 8;
    		i2 = 256 - i2;
    		for (int j2 = -i; j2 < 0; j2++) {
    			for (int k2 = -i1; k2 < 0; k2++)
    				if (abyte0[l++] != 0) {
    					int l2 = ai[j];
    					ai[j++] = (((l2 & 0xff00ff) * i2 & 0xff00ff00)
    							+ ((l2 & 0xff00) * i2 & 0xff0000) >> 8)
    							+ l1;
    				} else {
    					j++;
    				}
    			j += k1;
    			l += j1;
    		}
    	}
    
    	public byte[][] data;
    	public int[] charWidth;
    	public int[] charHeight;
    	public int[] offsetX;
    	public int[] offsetY;
    	public int[] drawWidth;
    	public int height; //font overall height, not char
    	public Random random;
    	public boolean drawStrikeout;
    }


    Media:







    Download: https://mega.co.nz/#!VZdgjSBR!1eiVYR...VpxvTPOMNA7N-4

    Spoiler for 666 map icons:

    Quote Originally Posted by Vesia View Post
    Nothing too complicated felt like this was necessary. Here's the client with the 666 map icons:




    Keldagrim Client (w. Map icons)



    Credits:
    Dane - for Naming
    Me - Renaming & edits
    Original client release - http://www.rune-server.org/runescape...-come-end.html
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     


  2. #2  
    Banned

    Join Date
    Jun 2013
    Posts
    938
    Thanks given
    462
    Thanks received
    171
    Rep Power
    0
    nice bro!
    Reply With Quote  
     

  3. #3  
    The One & Only


    Join Date
    Oct 2013
    Posts
    2,572
    Thanks given
    422
    Thanks received
    1,620
    Rep Power
    5000
    Awesome release
    Attached image
    Spoiler for More Signatures:

    Attached image
    Credits to Niceman, Vippy and Dami for the awesome signatures
    Attached image
    Attached image


    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    May 2011
    Posts
    1,773
    Thanks given
    854
    Thanks received
    853
    Rep Power
    0
    Wouldnt recommend annyone to use this as performance is shit. Good job on your edits i suppose.
    Reply With Quote  
     

  5. Thankful users:


  6. #5  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    Thank you for the share, someone should get a clean Galkon client and refactor it even more, so new projects use it
    Attached image
    Reply With Quote  
     

  7. #6  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    Quote Originally Posted by Royal View Post
    Awesome release
    Thanks
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  8. #7  
    Respected Member

    Revil's Avatar
    Join Date
    Nov 2010
    Age
    30
    Posts
    4,860
    Thanks given
    3,715
    Thanks received
    2,228
    Rep Power
    5000
    Good work wiki
    Reply With Quote  
     

  9. #8  
    oof


    Join Date
    Aug 2012
    Posts
    3,150
    Thanks given
    2,847
    Thanks received
    857
    Rep Power
    2260
    Nice release.
    Reply With Quote  
     

  10. #9  
    強い者は生き残る
    Ashpire's Avatar
    Join Date
    Mar 2012
    Age
    27
    Posts
    2,721
    Thanks given
    914
    Thanks received
    1,897
    Rep Power
    2231
    Awesome mr wikikikikkikikikikikikikikikikikikikikikik.
    Attached image
    Reply With Quote  
     

  11. #10  
    Registered Member

    Join Date
    Feb 2013
    Posts
    1,682
    Thanks given
    401
    Thanks received
    402
    Rep Power
    446
    Release nice client
    Reply With Quote  
     

Page 1 of 3 123 LastLast

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. Edited RuneLimited Client [667 Data] v1.0
    By Mr House in forum Downloads
    Replies: 42
    Last Post: 12-02-2015, 12:20 PM
  2. Replies: 57
    Last Post: 02-23-2014, 07:04 PM
  3. Replies: 2
    Last Post: 02-19-2014, 04:33 PM
  4. Replies: 10
    Last Post: 10-20-2013, 01:00 AM
  5. Edited RuneLimited Client [667 Data]` Final
    By Mr House in forum Downloads
    Replies: 22
    Last Post: 08-02-2012, 10:42 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •