-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flo.java
executable file
·172 lines (164 loc) · 3.41 KB
/
Flo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
public final class Flo {
public static void unpackConfig(StreamLoader streamLoader)
{
Stream stream = new Stream(streamLoader.getDataForName("flo.dat"));
int cacheSize = stream.readUnsignedWord();
if(cache == null)
cache = new Flo[cacheSize];
for(int j = 0; j < cacheSize; j++)
{
if(cache[j] == null)
cache[j] = new Flo();
cache[j].readValues(stream);
}
}
private void readValues(Stream stream)
{
do
{
int i = stream.readUnsignedByte();
boolean dummy;
if(i == 0)
return;
else
if(i == 1)
{
anInt390 = stream.read3Bytes();
method262(anInt390);
} else
if(i == 2)
anInt391 = stream.readUnsignedByte();
else
if(i == 3)
dummy = true;
else
if(i == 5)
aBoolean393 = false;
else
if(i == 6)
stream.readString();
else
if(i == 7)
{
int j = anInt394;
int k = anInt395;
int l = anInt396;
int i1 = anInt397;
int j1 = stream.read3Bytes();
method262(j1);
anInt394 = j;
anInt395 = k;
anInt396 = l;
anInt397 = i1;
anInt398 = i1;
} else
{
System.out.println("Error unrecognised config code: " + i);
}
} while(true);
}
private void method262(int i)
{
double d = (double)(i >> 16 & 0xff) / 256D;
double d1 = (double)(i >> 8 & 0xff) / 256D;
double d2 = (double)(i & 0xff) / 256D;
double d3 = d;
if(d1 < d3)
d3 = d1;
if(d2 < d3)
d3 = d2;
double d4 = d;
if(d1 > d4)
d4 = d1;
if(d2 > d4)
d4 = d2;
double d5 = 0.0D;
double d6 = 0.0D;
double d7 = (d3 + d4) / 2D;
if(d3 != d4)
{
if(d7 < 0.5D)
d6 = (d4 - d3) / (d4 + d3);
if(d7 >= 0.5D)
d6 = (d4 - d3) / (2D - d4 - d3);
if(d == d4)
d5 = (d1 - d2) / (d4 - d3);
else
if(d1 == d4)
d5 = 2D + (d2 - d) / (d4 - d3);
else
if(d2 == d4)
d5 = 4D + (d - d1) / (d4 - d3);
}
d5 /= 6D;
anInt394 = (int)(d5 * 256D);
anInt395 = (int)(d6 * 256D);
anInt396 = (int)(d7 * 256D);
if(anInt395 < 0)
anInt395 = 0;
else
if(anInt395 > 255)
anInt395 = 255;
if(anInt396 < 0)
anInt396 = 0;
else
if(anInt396 > 255)
anInt396 = 255;
if(d7 > 0.5D)
anInt398 = (int)((1.0D - d7) * d6 * 512D);
else
anInt398 = (int)(d7 * d6 * 512D);
if(anInt398 < 1)
anInt398 = 1;
anInt397 = (int)(d5 * (double)anInt398);
int k = (anInt394 + (int)(Math.random() * 16D)) - 8;
if(k < 0)
k = 0;
else
if(k > 255)
k = 255;
int l = (anInt395 + (int)(Math.random() * 48D)) - 24;
if(l < 0)
l = 0;
else
if(l > 255)
l = 255;
int i1 = (anInt396 + (int)(Math.random() * 48D)) - 24;
if(i1 < 0)
i1 = 0;
else
if(i1 > 255)
i1 = 255;
anInt399 = method263(k, l, i1);
}
private int method263(int i, int j, int k)
{
if(k > 179)
j /= 2;
if(k > 192)
j /= 2;
if(k > 217)
j /= 2;
if(k > 243)
j /= 2;
return (i / 4 << 10) + (j / 32 << 7) + k / 2;
}
private Flo()
{
anInt391 = -1;
aBoolean393 = true;
}
public static Flo cache[];
public int anInt390;
public int anInt391;
public boolean aBoolean393;
public int anInt394;
public int anInt395;
public int anInt396;
public int anInt397;
public int anInt398;
public int anInt399;
}