Skip to content

Commit d786c11

Browse files
authored
Merge pull request #191 from runejs/minimap
refactor: refactoring around minimap/frame drawing
2 parents 536e719 + b3ccbdc commit d786c11

File tree

4 files changed

+191
-199
lines changed

4 files changed

+191
-199
lines changed

src/main/java/org/runejs/client/Game.java

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ public static void setConfigToDefaults() {
644644
ChatBox.chatMessages[i] = null;
645645
GameInterface.itemCurrentlySelected = 0;
646646
MovedStatics.destinationX = 0;
647-
MovedStatics.anInt1985 = -1;
647+
Minimap.minimapLevel = -1;
648648
Player.npcCount = 0;
649649
SoundSystem.reset();
650650
widgetSelected = 0;
@@ -937,17 +937,37 @@ public static void drawGameScreen() {
937937
ChatBox.redrawChatbox = true;
938938
}
939939
}
940+
941+
if(GameInterface.tabAreaInterfaceId != -1) {
942+
boolean bool = GameInterface.handleSequences(GameInterface.tabAreaInterfaceId);
943+
if(bool) {
944+
GameInterface.redrawTabArea = true;
945+
}
946+
}
947+
948+
if(GameInterface.chatboxInterfaceId != -1) {
949+
boolean bool = GameInterface.handleSequences(GameInterface.chatboxInterfaceId);
950+
if(bool) {
951+
ChatBox.redrawChatbox = true;
952+
}
953+
}
954+
955+
if(ChatBox.dialogueId != -1) {
956+
boolean bool = GameInterface.handleSequences(ChatBox.dialogueId);
957+
if(bool) {
958+
ChatBox.redrawChatbox = true;
959+
}
960+
}
961+
962+
if(flashingTabId != -1) {
963+
GameInterface.drawTabIcons = true;
964+
}
965+
940966
if(ScreenController.frameMode == ScreenMode.FIXED) {
941967

942968
if(MovedStatics.menuOpen && MovedStatics.menuScreenArea == 1) {
943969
GameInterface.redrawTabArea = true;
944970
}
945-
if(GameInterface.tabAreaInterfaceId != -1) {
946-
boolean bool = GameInterface.handleSequences(GameInterface.tabAreaInterfaceId);
947-
if(bool) {
948-
GameInterface.redrawTabArea = true;
949-
}
950-
}
951971
method353();
952972

953973
if(GameInterface.atInventoryInterfaceType == -3) {
@@ -958,18 +978,6 @@ public static void drawGameScreen() {
958978
}
959979
MovedStatics.drawTabArea();
960980

961-
if(GameInterface.chatboxInterfaceId != -1) {
962-
boolean bool = GameInterface.handleSequences(GameInterface.chatboxInterfaceId);
963-
if(bool) {
964-
ChatBox.redrawChatbox = true;
965-
}
966-
}
967-
if(ChatBox.dialogueId != -1) {
968-
boolean bool = GameInterface.handleSequences(ChatBox.dialogueId);
969-
if(bool) {
970-
ChatBox.redrawChatbox = true;
971-
}
972-
}
973981
if(GameInterface.atInventoryInterfaceType == 3) {
974982
ChatBox.redrawChatbox = true;
975983
}
@@ -990,10 +998,6 @@ public static void drawGameScreen() {
990998

991999
Minimap.renderMinimap();
9921000

993-
994-
if(flashingTabId != -1) {
995-
GameInterface.drawTabIcons = true;
996-
}
9971001
if(GameInterface.drawTabIcons) {
9981002
if(flashingTabId != -1 && flashingTabId == currentTabId) {
9991003
flashingTabId = -1;
@@ -1013,30 +1017,14 @@ public static void drawGameScreen() {
10131017
MovedStatics.anInt199 = 0;
10141018

10151019
} else {
1016-
1017-
1018-
if(GameInterface.tabAreaInterfaceId != -1) {
1019-
GameInterface.handleSequences(GameInterface.tabAreaInterfaceId);
1020-
}
1021-
1022-
if(GameInterface.chatboxInterfaceId != -1) {
1023-
GameInterface.handleSequences(GameInterface.chatboxInterfaceId);
1024-
}
1025-
1026-
if(ChatBox.dialogueId != -1) {
1027-
GameInterface.handleSequences(ChatBox.dialogueId);
1028-
}
10291020
method353();
10301021
ChatBox.renderChatbox();
10311022

10321023
MovedStatics.drawTabArea();
10331024

1034-
Minimap.renderMinimap();
1035-
1025+
// this render is handled in `ResizableFrameRenderer`
1026+
//Minimap.renderMinimap();
10361027

1037-
if(flashingTabId != -1) {
1038-
GameInterface.drawTabIcons = true;
1039-
}
10401028
if(GameInterface.drawTabIcons) {
10411029
if(flashingTabId != -1 && flashingTabId == currentTabId) {
10421030
flashingTabId = -1;
@@ -1920,9 +1908,9 @@ public static void method910() {
19201908
if(true) {
19211909
if (VertexNormal.lowMemory && MovedStatics.onBuildTimePlane != Player.worldLevel)
19221910
MovedStatics.method789(Player.localPlayer.pathY[0], MovedStatics.regionY, MovedStatics.regionX, Player.localPlayer.pathX[0], Player.worldLevel);
1923-
else if (MovedStatics.anInt1985 != Player.worldLevel) {
1924-
MovedStatics.anInt1985 = Player.worldLevel;
1925-
Minimap.method299(Player.worldLevel);
1911+
else if (Minimap.minimapLevel != Player.worldLevel) {
1912+
Minimap.minimapLevel = Player.worldLevel;
1913+
Minimap.createMinimap(Player.worldLevel);
19261914
}
19271915
}
19281916
}

src/main/java/org/runejs/client/MovedStatics.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ public class MovedStatics {
335335
*/
336336
public static int anInt2480 = 0;
337337
public static ImageRGB[] aClass40_Sub5_Sub14_Sub4Array2474;
338-
public static int anInt1985 = -1;
339338
public static int anInt1987 = 0;
340339
public static IndexedImage tabTopBack;
341340
/**
@@ -3734,7 +3733,7 @@ public static void method789(int chunkLocalX, int chunkY, int chunkX, int chunkL
37343733
if(obj.x < 0 || obj.y < 0 || obj.x >= 104 || obj.y >= 104)
37353734
obj.unlink();
37363735
}
3737-
anInt1985 = -1;
3736+
Minimap.minimapLevel = -1;
37383737
if(destinationX != 0) {
37393738
destinationX -= i_34_;
37403739
Game.destinationY -= i_35_;

src/main/java/org/runejs/client/cache/media/ImageRGB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ public void method722(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5
782782
}
783783
}
784784

785-
public void method723() {
785+
public void prepareRasterizer() {
786786
Rasterizer.prepare(pixels, imageWidth, imageHeight);
787787
}
788788

0 commit comments

Comments
 (0)