A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

further refactoring

+154 -156
+132 -132
src/main/java/com/jagex/runescape/Game.java
··· 206 206 private int drawY = -1; 207 207 private int lastSoundType = -1; 208 208 private String chatboxInputMessage = ""; 209 - private int anInt939; 210 - private int anInt940 = 50; 211 - private int[] anIntArray941 = new int[anInt940]; 212 - private int[] anIntArray942 = new int[anInt940]; 213 - private int[] anIntArray943 = new int[anInt940]; 214 - private int[] anIntArray944 = new int[anInt940]; 215 - private int[] anIntArray945 = new int[anInt940]; 216 - private int[] anIntArray946 = new int[anInt940]; 217 - private int[] anIntArray947 = new int[anInt940]; 218 - private String[] aStringArray948 = new String[anInt940]; 209 + private int spokenCount; 210 + private int spokenMax = 50; 211 + private int[] spokenX = new int[spokenMax]; 212 + private int[] spokenY = new int[spokenMax]; 213 + private int[] spokenOffsetY = new int[spokenMax]; 214 + private int[] spokenOffsetX = new int[spokenMax]; 215 + private int[] spokenColour = new int[spokenMax]; 216 + private int[] spokenEffect = new int[spokenMax]; 217 + private int[] spokenCycle = new int[spokenMax]; 218 + private String[] spoken = new String[spokenMax]; 219 219 private String inputInputMessage = ""; 220 220 private boolean drawTabIcons = false; 221 221 private int tickDelta; ··· 226 226 private int fullscreenWidgetChildId = -1; 227 227 private int thisPlayerServerId = -1; 228 228 private Buffer outBuffer = Buffer.allocate(1); 229 - private IndexedImage anIndexedImage1052; 230 - private IndexedImage anIndexedImage1053; 231 - private IndexedImage anIndexedImage1054; 232 - private int anInt968 = 2048; 233 - private int thisPlayerId = 2047; 234 - private Player[] players = new Player[anInt968]; 229 + private IndexedImage bottomChatBack; 230 + private IndexedImage tabBottomBack; 231 + private IndexedImage tabTopBack; 232 + private int maxPlayerCount = 2048; 233 + private int maxPlayerIndex = 2047; 234 + private Player[] players = new Player[maxPlayerCount]; 235 235 private int localPlayerCount; 236 - private int[] playerList = new int[anInt968]; 236 + private int[] playerList = new int[maxPlayerCount]; 237 237 private int updatedPlayerCount; 238 - private int[] updatedPlayers = new int[anInt968]; 239 - private Buffer[] cachedAppearances = new Buffer[anInt968]; 238 + private int[] updatedPlayers = new int[maxPlayerCount]; 239 + private Buffer[] cachedAppearances = new Buffer[maxPlayerCount]; 240 240 private IndexedImage[] tabIcon = new IndexedImage[13]; 241 241 private int loginScreenFocus; 242 242 private int[] firstMenuOperand = new int[500]; ··· 257 257 private int anInt995; 258 258 private int anInt996; 259 259 private int anInt997; 260 - private int anInt998; 260 + private int showChatEffects; 261 261 private int[] chatboxLineOffsets; 262 262 private int[] sidebarOffsets; 263 263 private int[] viewportOffsets; ··· 319 319 private int minimapHintCount; 320 320 private int[] minimapHintX = new int[1000]; 321 321 private int[] minimapHintY = new int[1000]; 322 - private ImageRGB[] aClass50_Sub1_Sub1_Sub1Array1079 = new ImageRGB[32]; 322 + private ImageRGB[] headiconsPrayer = new ImageRGB[32]; 323 323 private int anInt1080 = 0x4d4233; 324 324 private int lastPasswordChangeTime; 325 325 private int[] anIntArray1084; ··· 382 382 private String selectedItemName; 383 383 private int otherPlayerId; 384 384 private int anInt1152; 385 - private IndexedImage[] aClass50_Sub1_Sub1_Sub3Array1153 = new IndexedImage[100]; 385 + private IndexedImage[] mapIcons = new IndexedImage[100]; 386 386 private boolean lastItemDragged = false; 387 387 private ProducingGraphicsBuffer tabImageProducer; 388 388 private ProducingGraphicsBuffer aClass18_1157; ··· 401 401 private int[] anIntArray1177; 402 402 private int lastSoundPosition; 403 403 private int[] anIntArray1180 = new int[33]; 404 - private ImageRGB[] aClass50_Sub1_Sub1_Sub1Array1182 = new ImageRGB[20]; 404 + private ImageRGB[] hitmarks = new ImageRGB[20]; 405 405 private int menuActionRow; 406 406 private String[] menuActionTexts = new String[500]; 407 407 private IndexedImage inventoryBackgroundImage; ··· 487 487 private boolean loadingError = false; 488 488 private int anInt1284; 489 489 private int[] anIntArray1286 = new int[33]; 490 - private ImageRGB[] aClass50_Sub1_Sub1_Sub1Array1288 = new ImageRGB[32]; 490 + private ImageRGB[] headiconsPk = new ImageRGB[32]; 491 491 private int secondaryCameraVertical; 492 492 private int[] anIntArray1290 = {17, 24, 34, 40}; 493 493 private IndexedImage titleboxImage; ··· 922 922 if (mouseCapturer != null) 923 923 mouseCapturer.capturing = false; 924 924 mouseCapturer = null; 925 - anIndexedImage1052 = null; 926 - anIndexedImage1053 = null; 927 - anIndexedImage1054 = null; 925 + bottomChatBack = null; 926 + tabBottomBack = null; 927 + tabTopBack = null; 928 928 aClass18_910 = null; 929 929 aClass18_911 = null; 930 930 aClass18_912 = null; ··· 941 941 aClass18_1199 = null; 942 942 aClass18_1200 = null; 943 943 minimapCompass = null; 944 - aClass50_Sub1_Sub1_Sub1Array1182 = null; 945 - aClass50_Sub1_Sub1_Sub1Array1288 = null; 946 - aClass50_Sub1_Sub1_Sub1Array1079 = null; 944 + hitmarks = null; 945 + headiconsPk = null; 946 + headiconsPrayer = null; 947 947 imageHeadIcons = null; 948 948 cursorCross = null; 949 949 stopMidi(); ··· 970 970 npcIds = null; 971 971 aByteArray1245 = null; 972 972 chatBuffer = null; 973 - aClass50_Sub1_Sub1_Sub3Array1153 = null; 973 + mapIcons = null; 974 974 worldMapHintIcons = null; 975 975 tileRenderCount = null; 976 976 tabIcon = null; ··· 2849 2849 } 2850 2850 } 2851 2851 2852 - for (int id = 0; id < anInt968; id++) { 2852 + for (int id = 0; id < maxPlayerCount; id++) { 2853 2853 Player player = players[id]; 2854 2854 if (player != null) { 2855 2855 for (int pos = 0; pos < 10; pos++) { ··· 3556 3556 3557 3557 3558 3558 if (moveType == MovementType.NONE) { 3559 - updatedPlayers[updatedPlayerCount++] = thisPlayerId; 3559 + updatedPlayers[updatedPlayerCount++] = maxPlayerIndex; 3560 3560 return; 3561 3561 } 3562 3562 ··· 3568 3568 int blockUpdateRequired = buffer.getBits(1); 3569 3569 3570 3570 if (blockUpdateRequired == 1) 3571 - updatedPlayers[updatedPlayerCount++] = thisPlayerId; 3571 + updatedPlayers[updatedPlayerCount++] = maxPlayerIndex; 3572 3572 return; 3573 3573 } 3574 3574 ··· 3584 3584 int blockUpdateRequired = buffer.getBits(1); 3585 3585 3586 3586 if (blockUpdateRequired == 1) 3587 - updatedPlayers[updatedPlayerCount++] = thisPlayerId; 3587 + updatedPlayers[updatedPlayerCount++] = maxPlayerIndex; 3588 3588 return; 3589 3589 } 3590 3590 ··· 3596 3596 int blockUpdateRequired = buffer.getBits(1); 3597 3597 3598 3598 if (blockUpdateRequired == 1) 3599 - updatedPlayers[updatedPlayerCount++] = thisPlayerId; 3599 + updatedPlayers[updatedPlayerCount++] = maxPlayerIndex; 3600 3600 3601 3601 localPlayer.setPosition(localX, localY, discardWalkingQueue == 1); 3602 3602 } ··· 5106 5106 inventoryBackgroundImage = new IndexedImage(archiveMedia, "invback", 0); 5107 5107 chatboxBackgroundImage = new IndexedImage(archiveMedia, "chatback", 0); 5108 5108 minimapBackgroundImage = new IndexedImage(archiveMedia, "mapback", 0); 5109 - anIndexedImage1052 = new IndexedImage(archiveMedia, "backbase1", 0); 5110 - anIndexedImage1053 = new IndexedImage(archiveMedia, "backbase2", 0); 5111 - anIndexedImage1054 = new IndexedImage(archiveMedia, "backhmid1", 0); 5109 + bottomChatBack = new IndexedImage(archiveMedia, "backbase1", 0); 5110 + tabBottomBack = new IndexedImage(archiveMedia, "backbase2", 0); 5111 + tabTopBack = new IndexedImage(archiveMedia, "backhmid1", 0); 5112 5112 5113 5113 for (int i = 0; i < 13; i++) 5114 5114 tabIcon[i] = new IndexedImage(archiveMedia, "sideicons", i); ··· 5118 5118 minimapEdge.trim(); 5119 5119 5120 5120 for (int i = 0; i < 72; i++) 5121 - aClass50_Sub1_Sub1_Sub3Array1153[i] = new IndexedImage(archiveMedia, "mapscene", i); 5121 + mapIcons[i] = new IndexedImage(archiveMedia, "mapscene", i); 5122 5122 5123 5123 for (int i = 0; i < 70; i++) 5124 5124 worldMapHintIcons[i] = new ImageRGB(archiveMedia, "mapfunction", i); 5125 5125 5126 5126 for (int i = 0; i < 5; i++) 5127 - aClass50_Sub1_Sub1_Sub1Array1182[i] = new ImageRGB(archiveMedia, "hitmarks", i); 5127 + hitmarks[i] = new ImageRGB(archiveMedia, "hitmarks", i); 5128 5128 5129 5129 for (int i = 0; i < 6; i++) 5130 - aClass50_Sub1_Sub1_Sub1Array1288[i] = new ImageRGB(archiveMedia, "headicons_pk", i); 5130 + headiconsPk[i] = new ImageRGB(archiveMedia, "headicons_pk", i); 5131 5131 5132 5132 for (int i = 0; i < 9; i++) 5133 - aClass50_Sub1_Sub1_Sub1Array1079[i] = new ImageRGB(archiveMedia, "headicons_prayer", i); 5133 + headiconsPrayer[i] = new ImageRGB(archiveMedia, "headicons_prayer", i); 5134 5134 5135 5135 for (int i = 0; i < 6; i++) 5136 5136 imageHeadIcons[i] = new ImageRGB(archiveMedia, "headicons_hint", i); ··· 5223 5223 if (worldMapHintIcons[i] != null) 5224 5224 worldMapHintIcons[i].adjustRGB(red, green, blue); 5225 5225 5226 - if (aClass50_Sub1_Sub1_Sub3Array1153[i] != null) 5227 - aClass50_Sub1_Sub1_Sub3Array1153[i].mixPalette(red, green, blue); 5226 + if (mapIcons[i] != null) 5227 + mapIcons[i].mixPalette(red, green, blue); 5228 5228 } 5229 5229 5230 5230 drawLoadingText(83, "Unpacking textures"); ··· 5800 5800 if (actor.faceActor >= 32768) { 5801 5801 int playerIndex = actor.faceActor - 32768; 5802 5802 if (playerIndex == thisPlayerServerId) 5803 - playerIndex = thisPlayerId; 5803 + playerIndex = maxPlayerIndex; 5804 5804 Player player = players[playerIndex]; 5805 5805 if (player != null) { 5806 5806 int dx = actor.worldX - player.worldX; ··· 6036 6036 } 6037 6037 drawTabIcons = false; 6038 6038 aClass18_1110.createRasterizer(); 6039 - anIndexedImage1054.drawImage(0, 0); 6039 + tabTopBack.drawImage(0, 0); 6040 6040 if (tabAreaOverlayWidgetId == -1) { 6041 6041 if (tabWidgetIds[currentTabId] != -1) { 6042 6042 if (currentTabId == 0) ··· 6071 6071 } 6072 6072 aClass18_1110.drawGraphics(516, 160, super.gameGraphics); 6073 6073 aClass18_1109.createRasterizer(); 6074 - anIndexedImage1053.drawImage(0, 0); 6074 + tabBottomBack.drawImage(0, 0); 6075 6075 if (tabAreaOverlayWidgetId == -1) { 6076 6076 if (tabWidgetIds[currentTabId] != -1) { 6077 6077 if (currentTabId == 7) ··· 6109 6109 if (redrawChatMode) { 6110 6110 redrawChatMode = false; 6111 6111 aClass18_1108.createRasterizer(); 6112 - anIndexedImage1052.drawImage(0, 0); 6112 + bottomChatBack.drawImage(0, 0); 6113 6113 fontNormal.drawStringCenter("Public chat", 55, 28, 0xffffff, true); 6114 6114 if (publicChatMode == 0) 6115 6115 fontNormal.drawStringCenter("On", 55, 41, 65280, true); ··· 6425 6425 localPlayerCount = 0; 6426 6426 npcCount = 0; 6427 6427 6428 - for (int i2 = 0; i2 < anInt968; i2++) { 6428 + for (int i2 = 0; i2 < maxPlayerCount; i2++) { 6429 6429 players[i2] = null; 6430 6430 cachedAppearances[i2] = null; 6431 6431 } ··· 6433 6433 for (int k2 = 0; k2 < 16384; k2++) 6434 6434 npcs[k2] = null; 6435 6435 6436 - localPlayer = players[thisPlayerId] = new Player(); 6436 + localPlayer = players[maxPlayerIndex] = new Player(); 6437 6437 6438 6438 projectileQueue.clear(); 6439 6439 gameAnimableObjectQueue.clear(); ··· 7140 7140 7141 7141 private void processActorOverheadText() { 7142 7142 for (int i = -1; i < localPlayerCount; i++) { 7143 - int index = i == -1 ? thisPlayerId : playerList[i]; 7143 + int index = i == -1 ? maxPlayerIndex : playerList[i]; 7144 7144 Player player = players[index]; 7145 7145 7146 7146 if (player != null && player.textCycle > 0) { ··· 7249 7249 if (mmBackgroundPixels[i] == 0) 7250 7250 rasterPixels[i] = 0; 7251 7251 7252 - minimapCompass.shapeImageToPixels(0, 33, 25, 33, anIntArray1286, 0, cameraHorizontal, 256, 7252 + minimapCompass.shapeImageToPixels(0, 0, 33, 33, 256, 25, anIntArray1286, cameraHorizontal, 7253 7253 anIntArray1180, 25); 7254 7254 gameScreenImageProducer.createRasterizer(); 7255 7255 ··· 7261 7261 int centerX = 48 + localPlayer.worldX / 32; 7262 7262 int centerY = 464 - localPlayer.worldY / 32; 7263 7263 7264 - minimapImage.shapeImageToPixels(5, 151, centerX, 146, anIntArray920, 7265 - 25, angle, 256 + mapZoomOffset, anIntArray1019, centerY); 7266 - minimapCompass.shapeImageToPixels(0, 33, 25, 33, anIntArray1286, 7267 - 0, cameraHorizontal, 256, anIntArray1180, 25); 7264 + minimapImage.shapeImageToPixels(25, 5, 146, 151, 256 + mapZoomOffset, centerX, anIntArray920, 7265 + angle, anIntArray1019, centerY); 7266 + minimapCompass.shapeImageToPixels(0, 0, 33, 33, 256, 25, anIntArray1286, 7267 + cameraHorizontal, anIntArray1180, 25); 7268 7268 7269 7269 for (int i = 0; i < minimapHintCount; i++) { 7270 7270 int hintX = (minimapHintX[i] * 4 + 2) - localPlayer.worldX / 32; ··· 7938 7938 for (int i = -1; i < localPlayerCount; i++) { 7939 7939 int index; 7940 7940 if (i == -1) { 7941 - index = thisPlayerId; 7941 + index = maxPlayerIndex; 7942 7942 } else { 7943 7943 index = playerList[i]; 7944 7944 } ··· 8301 8301 if (action == 5) 8302 8302 oneMouseButton = config; 8303 8303 if (action == 6) 8304 - anInt998 = config; 8304 + showChatEffects = config; 8305 8305 if (action == 8) { 8306 8306 anInt1223 = config; 8307 8307 redrawChatbox = true; ··· 8923 8923 int hash; 8924 8924 if (priority) { 8925 8925 player = localPlayer; 8926 - hash = thisPlayerId << 14; 8926 + hash = maxPlayerIndex << 14; 8927 8927 } else { 8928 8928 player = players[playerList[p]]; 8929 8929 hash = playerList[p] << 14; ··· 9288 9288 if (action == Actions.CLOSE_WIDGETS) 9289 9289 closeWidgets(); 9290 9290 if (action == 918) { 9291 - Player class50_sub1_sub4_sub3_sub2_4 = players[clicked]; 9292 - if (class50_sub1_sub4_sub3_sub2_4 != null) { 9293 - walk(false, false, class50_sub1_sub4_sub3_sub2_4.pathY[0], 9291 + Player clickedPlayer = players[clicked]; 9292 + if (clickedPlayer != null) { 9293 + walk(false, false, clickedPlayer.pathY[0], 9294 9294 localPlayer.pathY[0], 1, 1, 2, 0, 9295 - class50_sub1_sub4_sub3_sub2_4.pathX[0], 0, 0, 9295 + clickedPlayer.pathX[0], 0, 0, 9296 9296 localPlayer.pathX[0]); 9297 9297 crossX = super.clickX; 9298 9298 crossY = super.clickY; ··· 9779 9779 } 9780 9780 9781 9781 private void drawScene2d(boolean flag) { 9782 - anInt939 = 0; 9782 + spokenCount = 0; 9783 9783 for (int i = -1; i < localPlayerCount + npcCount; i++) { 9784 9784 Object obj; 9785 9785 if (i == -1) ··· 9791 9791 if (obj == null || !((Actor) (obj)).isVisible()) 9792 9792 continue; 9793 9793 if (obj instanceof Npc) { 9794 - ActorDefinition class37 = ((Npc) obj).npcDefinition; 9795 - if (class37.childrenIds != null) 9796 - class37 = class37.getChildDefinition(); 9797 - if (class37 == null) 9794 + ActorDefinition npc = ((Npc) obj).npcDefinition; 9795 + if (npc.childrenIds != null) 9796 + npc = npc.getChildDefinition(); 9797 + if (npc == null) 9798 9798 continue; 9799 9799 } 9800 9800 if (i < localPlayerCount) { 9801 9801 int k = 30; 9802 - Player class50_sub1_sub4_sub3_sub2 = (Player) obj; 9803 - if (class50_sub1_sub4_sub3_sub2.isSkulled != -1 || class50_sub1_sub4_sub3_sub2.headIcon != -1) { 9802 + Player otherPlayer = (Player) obj; 9803 + if (otherPlayer.isSkulled != -1 || otherPlayer.headIcon != -1) { 9804 9804 setDrawXY(((Actor) (obj)), ((Actor) (obj)).modelHeight + 15); 9805 9805 if (drawX > -1) { 9806 - if (class50_sub1_sub4_sub3_sub2.isSkulled != -1) { 9807 - aClass50_Sub1_Sub1_Sub1Array1288[class50_sub1_sub4_sub3_sub2.isSkulled].drawImage(drawX - 12, drawY 9806 + if (otherPlayer.isSkulled != -1) { 9807 + headiconsPk[otherPlayer.isSkulled].drawImage(drawX - 12, drawY 9808 9808 - k); 9809 9809 k += 25; 9810 9810 } 9811 - if (class50_sub1_sub4_sub3_sub2.headIcon != -1) { 9812 - aClass50_Sub1_Sub1_Sub1Array1079[class50_sub1_sub4_sub3_sub2.headIcon].drawImage(drawX - 12, drawY 9811 + if (otherPlayer.headIcon != -1) { 9812 + headiconsPrayer[otherPlayer.headIcon].drawImage(drawX - 12, drawY 9813 9813 - k); 9814 9814 k += 25; 9815 9815 } ··· 9822 9822 } 9823 9823 } else { 9824 9824 ActorDefinition class37_1 = ((Npc) obj).npcDefinition; 9825 - if (class37_1.headIcon >= 0 && class37_1.headIcon < aClass50_Sub1_Sub1_Sub1Array1079.length) { 9825 + if (class37_1.headIcon >= 0 && class37_1.headIcon < headiconsPrayer.length) { 9826 9826 setDrawXY(((Actor) (obj)), ((Actor) (obj)).modelHeight + 15); 9827 9827 if (drawX > -1) 9828 - aClass50_Sub1_Sub1_Sub1Array1079[class37_1.headIcon].drawImage(drawX - 12, drawY - 30 9828 + headiconsPrayer[class37_1.headIcon].drawImage(drawX - 12, drawY - 30 9829 9829 ); 9830 9830 } 9831 9831 if (headIconDrawType == 1 && anInt1226 == npcIds[i - localPlayerCount] && pulseCycle % 20 < 10) { ··· 9838 9838 && (i >= localPlayerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 9839 9839 && hasFriend(((Player) obj).playerName))) { 9840 9840 setDrawXY(((Actor) (obj)), ((Actor) (obj)).modelHeight); 9841 - if (drawX > -1 && anInt939 < anInt940) { 9842 - anIntArray944[anInt939] = fontBold.getDisplayedWidth(((Actor) (obj)).forcedChat 9841 + if (drawX > -1 && spokenCount < spokenMax) { 9842 + spokenOffsetX[spokenCount] = fontBold.getDisplayedWidth(((Actor) (obj)).forcedChat 9843 9843 ) / 2; 9844 - anIntArray943[anInt939] = fontBold.characterDefaultHeight; 9845 - anIntArray941[anInt939] = drawX; 9846 - anIntArray942[anInt939] = drawY; 9847 - anIntArray945[anInt939] = ((Actor) (obj)).textColour; 9848 - anIntArray946[anInt939] = ((Actor) (obj)).textEffect; 9849 - anIntArray947[anInt939] = ((Actor) (obj)).textCycle; 9850 - aStringArray948[anInt939++] = ((Actor) (obj)).forcedChat; 9851 - if (anInt998 == 0 && ((Actor) (obj)).textEffect >= 1 && ((Actor) (obj)).textEffect <= 3) { 9852 - anIntArray943[anInt939] += 10; 9853 - anIntArray942[anInt939] += 5; 9844 + spokenOffsetY[spokenCount] = fontBold.characterDefaultHeight; 9845 + spokenX[spokenCount] = drawX; 9846 + spokenY[spokenCount] = drawY; 9847 + spokenColour[spokenCount] = ((Actor) (obj)).textColour; 9848 + spokenEffect[spokenCount] = ((Actor) (obj)).textEffect; 9849 + spokenCycle[spokenCount] = ((Actor) (obj)).textCycle; 9850 + spoken[spokenCount++] = ((Actor) (obj)).forcedChat; 9851 + if (showChatEffects == 0 && ((Actor) (obj)).textEffect >= 1 && ((Actor) (obj)).textEffect <= 3) { 9852 + spokenOffsetY[spokenCount] += 10; 9853 + spokenY[spokenCount] += 5; 9854 9854 } 9855 - if (anInt998 == 0 && ((Actor) (obj)).textEffect == 4) 9856 - anIntArray944[anInt939] = 60; 9857 - if (anInt998 == 0 && ((Actor) (obj)).textEffect == 5) 9858 - anIntArray943[anInt939] += 5; 9855 + if (showChatEffects == 0 && ((Actor) (obj)).textEffect == 4) 9856 + spokenOffsetX[spokenCount] = 60; 9857 + if (showChatEffects == 0 && ((Actor) (obj)).textEffect == 5) 9858 + spokenOffsetY[spokenCount] += 5; 9859 9859 } 9860 9860 } 9861 9861 if (((Actor) (obj)).endCycle > pulseCycle) { ··· 9882 9882 drawX += 15; 9883 9883 drawY -= 10; 9884 9884 } 9885 - aClass50_Sub1_Sub1_Sub1Array1182[((Actor) (obj)).hitTypes[i1]].drawImage( 9885 + hitmarks[((Actor) (obj)).hitTypes[i1]].drawImage( 9886 9886 drawX - 12, drawY - 12); 9887 9887 fontSmall.drawStringLeft(String 9888 9888 .valueOf(((Actor) (obj)).hitDamages[i1]), drawX, drawY + 4, 0); ··· 9893 9893 9894 9894 } 9895 9895 9896 - for (int j = 0; j < anInt939; j++) { 9897 - int j1 = anIntArray941[j]; 9898 - int k1 = anIntArray942[j]; 9899 - int l1 = anIntArray944[j]; 9900 - int i2 = anIntArray943[j]; 9896 + for (int j = 0; j < spokenCount; j++) { 9897 + int j1 = spokenX[j]; 9898 + int k1 = spokenY[j]; 9899 + int l1 = spokenOffsetX[j]; 9900 + int i2 = spokenOffsetY[j]; 9901 9901 boolean flag1 = true; 9902 9902 while (flag1) { 9903 9903 flag1 = false; 9904 9904 for (int j2 = 0; j2 < j; j2++) 9905 - if (k1 + 2 > anIntArray942[j2] - anIntArray943[j2] && k1 - i2 < anIntArray942[j2] + 2 9906 - && j1 - l1 < anIntArray941[j2] + anIntArray944[j2] 9907 - && j1 + l1 > anIntArray941[j2] - anIntArray944[j2] 9908 - && anIntArray942[j2] - anIntArray943[j2] < k1) { 9909 - k1 = anIntArray942[j2] - anIntArray943[j2]; 9905 + if (k1 + 2 > spokenY[j2] - spokenOffsetY[j2] && k1 - i2 < spokenY[j2] + 2 9906 + && j1 - l1 < spokenX[j2] + spokenOffsetX[j2] 9907 + && j1 + l1 > spokenX[j2] - spokenOffsetX[j2] 9908 + && spokenY[j2] - spokenOffsetY[j2] < k1) { 9909 + k1 = spokenY[j2] - spokenOffsetY[j2]; 9910 9910 flag1 = true; 9911 9911 } 9912 9912 9913 9913 } 9914 - drawX = anIntArray941[j]; 9915 - drawY = anIntArray942[j] = k1; 9916 - String s = aStringArray948[j]; 9917 - if (anInt998 == 0) { 9914 + drawX = spokenX[j]; 9915 + drawY = spokenY[j] = k1; 9916 + String s = spoken[j]; 9917 + if (showChatEffects == 0) { 9918 9918 int k2 = 0xffff00; 9919 - if (anIntArray945[j] < 6) 9920 - k2 = spokenPalette[anIntArray945[j]]; 9921 - if (anIntArray945[j] == 6) 9919 + if (spokenColour[j] < 6) 9920 + k2 = spokenPalette[spokenColour[j]]; 9921 + if (spokenColour[j] == 6) 9922 9922 k2 = renderCount % 20 >= 10 ? 0xffff00 : 0xff0000; 9923 - if (anIntArray945[j] == 7) 9923 + if (spokenColour[j] == 7) 9924 9924 k2 = renderCount % 20 >= 10 ? 65535 : 255; 9925 - if (anIntArray945[j] == 8) 9925 + if (spokenColour[j] == 8) 9926 9926 k2 = renderCount % 20 >= 10 ? 0x80ff80 : 45056; 9927 - if (anIntArray945[j] == 9) { 9928 - int l2 = 150 - anIntArray947[j]; 9927 + if (spokenColour[j] == 9) { 9928 + int l2 = 150 - spokenCycle[j]; 9929 9929 if (l2 < 50) 9930 9930 k2 = 0xff0000 + 1280 * l2; 9931 9931 else if (l2 < 100) ··· 9933 9933 else if (l2 < 150) 9934 9934 k2 = 65280 + 5 * (l2 - 100); 9935 9935 } 9936 - if (anIntArray945[j] == 10) { 9937 - int i3 = 150 - anIntArray947[j]; 9936 + if (spokenColour[j] == 10) { 9937 + int i3 = 150 - spokenCycle[j]; 9938 9938 if (i3 < 50) 9939 9939 k2 = 0xff0000 + 5 * i3; 9940 9940 else if (i3 < 100) ··· 9942 9942 else if (i3 < 150) 9943 9943 k2 = (255 + 0x50000 * (i3 - 100)) - 5 * (i3 - 100); 9944 9944 } 9945 - if (anIntArray945[j] == 11) { 9946 - int j3 = 150 - anIntArray947[j]; 9945 + if (spokenColour[j] == 11) { 9946 + int j3 = 150 - spokenCycle[j]; 9947 9947 if (j3 < 50) 9948 9948 k2 = 0xffffff - 0x50005 * j3; 9949 9949 else if (j3 < 100) ··· 9951 9951 else if (j3 < 150) 9952 9952 k2 = 0xffffff - 0x50000 * (j3 - 100); 9953 9953 } 9954 - if (anIntArray946[j] == 0) { 9954 + if (spokenEffect[j] == 0) { 9955 9955 fontBold.drawStringLeft(s, drawX, drawY + 1, 0); 9956 9956 fontBold.drawStringLeft(s, drawX, drawY, k2); 9957 9957 } 9958 - if (anIntArray946[j] == 1) { 9958 + if (spokenEffect[j] == 1) { 9959 9959 fontBold.drawCenteredStringWaveY(s, drawX, drawY + 1, renderCount, 0); 9960 9960 fontBold.drawCenteredStringWaveY(s, drawX, drawY, renderCount, k2); 9961 9961 } 9962 - if (anIntArray946[j] == 2) { 9962 + if (spokenEffect[j] == 2) { 9963 9963 fontBold.drawCeneteredStringWaveXY(s, drawX, drawY + 1, renderCount, 0); 9964 9964 fontBold.drawCeneteredStringWaveXY(s, drawX, drawY, renderCount, k2); 9965 9965 } 9966 - if (anIntArray946[j] == 3) { 9967 - fontBold.drawCenteredStringWaveXYMove(s, drawX, drawY + 1, renderCount, 150 - anIntArray947[j], 0 9966 + if (spokenEffect[j] == 3) { 9967 + fontBold.drawCenteredStringWaveXYMove(s, drawX, drawY + 1, renderCount, 150 - spokenCycle[j], 0 9968 9968 ); 9969 - fontBold.drawCenteredStringWaveXYMove(s, drawX, drawY, renderCount, 150 - anIntArray947[j], k2 9969 + fontBold.drawCenteredStringWaveXYMove(s, drawX, drawY, renderCount, 150 - spokenCycle[j], k2 9970 9970 ); 9971 9971 } 9972 - if (anIntArray946[j] == 4) { 9972 + if (spokenEffect[j] == 4) { 9973 9973 int k3 = fontBold.getDisplayedWidth(s); 9974 - int i4 = ((150 - anIntArray947[j]) * (k3 + 100)) / 150; 9974 + int i4 = ((150 - spokenCycle[j]) * (k3 + 100)) / 150; 9975 9975 Rasterizer.setCoordinates(0, drawX - 50, 334, drawX + 50); 9976 9976 fontBold.drawString(s, (drawX + 50) - i4, drawY + 1, 0); 9977 9977 fontBold.drawString(s, (drawX + 50) - i4, drawY, k2); 9978 9978 Rasterizer.resetCoordinates(); 9979 9979 } 9980 - if (anIntArray946[j] == 5) { 9981 - int l3 = 150 - anIntArray947[j]; 9980 + if (spokenEffect[j] == 5) { 9981 + int l3 = 150 - spokenCycle[j]; 9982 9982 int j4 = 0; 9983 9983 if (l3 < 25) 9984 9984 j4 = l3 - 25; ··· 11603 11603 int i5 = k1 >> 14 & 0x7fff; 11604 11604 GameObjectDefinition gameObjectDefinition = GameObjectDefinition.getDefinition(i5); 11605 11605 if (gameObjectDefinition.anInt795 != -1) { 11606 - IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[gameObjectDefinition.anInt795]; 11606 + IndexedImage indexedImage = mapIcons[gameObjectDefinition.anInt795]; 11607 11607 if (indexedImage != null) { 11608 11608 int i6 = (gameObjectDefinition.sizeX * 4 - indexedImage.width) / 2; 11609 11609 int j6 = (gameObjectDefinition.sizeY * 4 - indexedImage.height) / 2; ··· 11674 11674 int l3 = k1 >> 14 & 0x7fff; 11675 11675 GameObjectDefinition gameObjectDefinition = GameObjectDefinition.getDefinition(l3); 11676 11676 if (gameObjectDefinition.anInt795 != -1) { 11677 - IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[gameObjectDefinition.anInt795]; 11677 + IndexedImage indexedImage = mapIcons[gameObjectDefinition.anInt795]; 11678 11678 if (indexedImage != null) { 11679 11679 int j5 = (gameObjectDefinition.sizeX * 4 - indexedImage.width) / 2; 11680 11680 int k5 = (gameObjectDefinition.sizeY * 4 - indexedImage.height) / 2; ··· 11705 11705 int j2 = k1 >> 14 & 0x7fff; 11706 11706 GameObjectDefinition class47 = GameObjectDefinition.getDefinition(j2); 11707 11707 if (class47.anInt795 != -1) { 11708 - IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[class47.anInt795]; 11708 + IndexedImage indexedImage = mapIcons[class47.anInt795]; 11709 11709 if (indexedImage != null) { 11710 11710 int i4 = (class47.sizeX * 4 - indexedImage.width) / 2; 11711 11711 int j4 = (class47.sizeY * 4 - indexedImage.height) / 2;
+22 -24
src/main/java/com/jagex/runescape/cache/media/ImageRGB.java
··· 339 339 340 340 } 341 341 342 - public void shapeImageToPixels(int i, int k, int l, int i1, int[] ai, int j1, int k1, int l1, int[] ai1, int i2) { 342 + public void shapeImageToPixels(int x, int y, int width, int height, int zoom, int l, int[] ai, int k1, int[] ai1, int i2) { 343 343 try { 344 - int j2 = -i1 / 2; 345 - int k2 = -k / 2; 346 - int l2 = (int) (Math.sin(k1 / 326.11000000000001D) * 65536D); 347 - int i3 = (int) (Math.cos(k1 / 326.11000000000001D) * 65536D); 348 - l2 = l2 * l1 >> 8; 349 - i3 = i3 * l1 >> 8; 350 - int j3 = (l << 16) + (k2 * l2 + j2 * i3); 351 - int k3 = (i2 << 16) + (k2 * i3 - j2 * l2); 352 - int l3 = j1 + i * Rasterizer.width; 353 - for (i = 0; i < k; i++) { 354 - int i4 = ai1[i]; 355 - int j4 = l3 + i4; 356 - int k4 = j3 + i3 * i4; 357 - int l4 = k3 - l2 * i4; 358 - for (j1 = -ai[i]; j1 < 0; j1++) { 359 - Rasterizer.pixels[j4++] = pixels[(k4 >> 16) + (l4 >> 16) * width]; 360 - k4 += i3; 361 - l4 -= l2; 344 + int centerX = -width / 2; 345 + int centerY = -height / 2; 346 + int sine = (int) (Math.sin(k1 / 326.11000000000001D) * 65536D); 347 + int cosine = (int) (Math.cos(k1 / 326.11000000000001D) * 65536D); 348 + sine = sine * zoom >> 8; 349 + cosine = cosine * zoom >> 8; 350 + int sourceOffsetX = (l << 16) + (centerY * sine + centerX * cosine); 351 + int sourceOffsetY = (i2 << 16) + (centerY * cosine - centerX * sine); 352 + int destinationOffset = x + y * Rasterizer.width; 353 + for (y = 0; y < height; y++) { 354 + int i4 = ai1[y]; 355 + int j4 = destinationOffset + i4; 356 + int k4 = sourceOffsetX + cosine * i4; 357 + int l4 = sourceOffsetY - sine * i4; 358 + for (x = -ai[y]; x < 0; x++) { 359 + Rasterizer.pixels[j4++] = pixels[(k4 >> 16) + (l4 >> 16) * this.width]; 360 + k4 += cosine; 361 + l4 -= sine; 362 362 } 363 363 364 - j3 += l2; 365 - k3 += i3; 366 - l3 += Rasterizer.width; 364 + sourceOffsetX += sine; 365 + sourceOffsetY += cosine; 366 + destinationOffset += Rasterizer.width; 367 367 } 368 368 369 - return; 370 369 } catch (Exception _ex) { 371 - return; 372 370 } 373 371 } 374 372