File tree Expand file tree Collapse file tree 2 files changed +27
-9
lines changed
src/main/java/org/runejs/client/frame Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,18 @@ public static void drawWalkPath() {
58
58
}
59
59
}
60
60
61
- public static boolean clippingEnabled = false ;
61
+ public static int clippingRenderDistance = 0 ;
62
62
63
63
public static void drawClipping () {
64
- if (! clippingEnabled ) {
64
+ if (clippingRenderDistance == 0 ) {
65
65
return ;
66
66
}
67
67
68
- for (int x = 0 ; x < 104 ; x ++) {
69
- for (int y = 0 ; y < 104 ; y ++) {
68
+ int tileX = Player .localPlayer .worldX >> 7 ;
69
+ int tileY = Player .localPlayer .worldY >> 7 ;
70
+
71
+ for (int x = Math .max (0 , tileX - clippingRenderDistance ); x < Math .min (104 , tileX + clippingRenderDistance ); x ++) {
72
+ for (int y = Math .max (0 , tileY - clippingRenderDistance ); y < Math .min (104 , tileY + clippingRenderDistance ); y ++) {
70
73
int data = Landscape .currentCollisionMap [Player .worldLevel ].clippingData [x ][y ];
71
74
72
75
Point2d screenPos = MovedStatics .getProjectedScreenPosition (0 , y * 128 + 64 , x * 128 + 64 );
Original file line number Diff line number Diff line change @@ -11,11 +11,26 @@ public DebugClippingCommand() {
11
11
12
12
@ Override
13
13
public void execute (Console console , String [] cmdInput ) {
14
- DebugTools .clippingEnabled = !DebugTools .clippingEnabled ;
15
- if (DebugTools .clippingEnabled ) {
16
- console .log ("<col=00FF00>Clipping is now drawn.</col> <col=FF0000>Red = blocks walk.</col> <col=539FE9>Blue = blocks projectiles.</col>" );
17
- } else {
18
- console .log ("<col=FF0000>Clipping is now hidden</col>" );
14
+ boolean radiusProvided = cmdInput .length == 2 ;
15
+ int radius = radiusProvided ? Integer .parseInt (cmdInput [1 ]) : 10 ;
16
+
17
+ if (DebugTools .clippingRenderDistance != 0 ) {
18
+ if (!radiusProvided ) {
19
+ console .log ("<col=FF0000>Clipping is now hidden</col>" );
20
+ DebugTools .clippingRenderDistance = 0 ;
21
+ return ;
22
+ }
23
+
24
+ DebugTools .clippingRenderDistance = radius ;
25
+ console .log ("<col=FF0000>Radius updated to: " + radius + "</col>" );
26
+ return ;
27
+ }
28
+
29
+ DebugTools .clippingRenderDistance = radius ;
30
+ console .log ("<col=00FF00>Clipping is now drawn.</col> <col=FF0000>Red = blocks walk.</col> <col=539FE9>Blue = blocks projectiles.</col>" );
31
+
32
+ if (!radiusProvided ) {
33
+ console .log ("Using default radius: " + radius + ". You can use e.g. `debugclip 15` to increase radius to 15." );
19
34
}
20
35
}
21
36
}
You can’t perform that action at this time.
0 commit comments