Skip to content

Commit c7c31b6

Browse files
committed
refactor: move randomiserHue to Landscape
1 parent ff5ab42 commit c7c31b6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class Landscape {
4949
public static int[] terrainDataIds;
5050
public static int[][][] tile_height = new int[4][105][105];
5151
public static int randomiserLightness = -16 + (int) (Math.random() * 33.0);
52+
public static int randomiserHue = -8 + (int) (17.0 * Math.random());
5253
private static int lowestPlane = 99;
5354

5455
public static void loadRegion() {
@@ -380,12 +381,12 @@ private static void createRegion(Scene scene, CollisionMap[] collisionMaps) {
380381
}
381382
}
382383
}
383-
MovedStatics.randomiserHue += (int) (5.0 * Math.random()) + -2;
384+
randomiserHue += (int) (5.0 * Math.random()) + -2;
384385
randomiserLightness += -2 + (int) (5.0 * Math.random());
385-
if(MovedStatics.randomiserHue < -8)
386-
MovedStatics.randomiserHue = -8;
387-
if(MovedStatics.randomiserHue > 8)
388-
MovedStatics.randomiserHue = 8;
386+
if(randomiserHue < -8)
387+
randomiserHue = -8;
388+
if(randomiserHue > 8)
389+
randomiserHue = 8;
389390
if(randomiserLightness < -16)
390391
randomiserLightness = -16;
391392
if(randomiserLightness > 16)
@@ -487,7 +488,7 @@ private static void createRegion(Scene scene, CollisionMap[] collisionMaps) {
487488
int l = lightness / direction;
488489
hslBitsetOriginal = generateHslBitset(s, l, h);
489490
l += randomiserLightness;
490-
h = h + MovedStatics.randomiserHue & 0xff;
491+
h = h + randomiserHue & 0xff;
491492
if(l >= 0) {
492493
if(l > 255)
493494
l = 255;
@@ -523,7 +524,7 @@ private static void createRegion(Scene scene, CollisionMap[] collisionMaps) {
523524
overlayMinimapColour = -2;
524525
} else {
525526
hslBitset = generateHslBitset(overlayDefinition.lightness, overlayDefinition.saturation, overlayDefinition.hue);
526-
int h = MovedStatics.randomiserHue + overlayDefinition.hue & 0xff;
527+
int h = randomiserHue + overlayDefinition.hue & 0xff;
527528
int s = randomiserLightness + overlayDefinition.saturation;
528529
if(s < 0)
529530
s = 0;
@@ -535,7 +536,7 @@ else if(s > 255)
535536
if(overlayMinimapColour != -2)
536537
rgb = Rasterizer3D.hsl2rgb[MovedStatics.mixLightnessSigned(overlayMinimapColour, 96)];
537538
if(overlayDefinition.secondaryColor != -1) {
538-
int i_54_ = 0xff & MovedStatics.randomiserHue + overlayDefinition.otherHue;
539+
int i_54_ = 0xff & randomiserHue + overlayDefinition.otherHue;
539540
int i_55_ = overlayDefinition.otherSaturation + randomiserLightness;
540541
if(i_55_ >= 0) {
541542
if(i_55_ > 255)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ public class MovedStatics {
260260
public static boolean showIconsRedrawnText = false;
261261
public static IndexedImage[] tabIcons;
262262
public static boolean lastItemDragged = false;
263-
public static int randomiserHue = -8 + (int) (17.0 * Math.random());
264263
public static ProducingGraphicsBuffer mapBackRight;
265264
public static IndexedImage chatboxBackgroundImage;
266265
/**

0 commit comments

Comments
 (0)