@@ -8,20 +8,18 @@ namespace MHFQuestEditor
8
8
{
9
9
class JPKEncoder
10
10
{
11
- public static byte m_flag ;
12
- public static int m_shiftIndex ;
13
- public static int m_ind ;
14
- public static byte [ ] m_inp ;
15
- public static int m_level = 280 ;
16
- public static int m_maxdist = 0x300 ; //0x1fff;
17
- public static Stream m_outstream ;
18
- public static byte [ ] m_towrite = new byte [ 1000 ] ;
19
- public static int m_itowrite ;
11
+ public byte m_flag ;
12
+ public int m_shiftIndex ;
13
+ public int m_ind ;
14
+ public byte [ ] m_inp ;
15
+ public int m_level = 280 ;
16
+ public int m_maxdist = 0x300 ; //0x1fff;
17
+ public Stream m_outstream ;
18
+ public byte [ ] m_towrite = new byte [ 1000 ] ;
19
+ public int m_itowrite ;
20
20
21
- public static void JPKEncode ( byte [ ] data , UInt16 atype , string otPath , int level )
21
+ public void JPKEncode ( byte [ ] data , UInt16 atype , string otPath , int level )
22
22
{
23
- Directory . CreateDirectory ( "output" ) ;
24
-
25
23
UInt16 type = atype ;
26
24
byte [ ] buffer = data ;
27
25
int insize = buffer . Length ;
@@ -44,7 +42,7 @@ public static void JPKEncode(byte[] data, UInt16 atype, string otPath, int level
44
42
fsot . Close ( ) ;
45
43
}
46
44
47
- public static unsafe int FindRep ( int ind , out uint ofs )
45
+ public unsafe int FindRep ( int ind , out uint ofs )
48
46
{
49
47
int nlen = Math . Min ( m_level , m_inp . Length - ind ) ;
50
48
ofs = 0 ;
@@ -78,7 +76,7 @@ public static unsafe int FindRep(int ind, out uint ofs)
78
76
return len ;
79
77
}
80
78
}
81
- public static void flushflag ( bool final )
79
+ public void flushflag ( bool final )
82
80
{
83
81
if ( ! final || m_itowrite > 0 )
84
82
WriteByte ( m_outstream , m_flag ) ;
@@ -87,7 +85,7 @@ public static void flushflag(bool final)
87
85
WriteByte ( m_outstream , m_towrite [ i ] ) ;
88
86
m_itowrite = 0 ;
89
87
}
90
- public static void SetFlag ( byte b )
88
+ public void SetFlag ( byte b )
91
89
{
92
90
m_shiftIndex -- ;
93
91
if ( m_shiftIndex < 0 )
@@ -97,14 +95,14 @@ public static void SetFlag(byte b)
97
95
}
98
96
m_flag |= ( byte ) ( b << m_shiftIndex ) ;
99
97
}
100
- public static void SetFlagsL ( byte b , int cnt )
98
+ public void SetFlagsL ( byte b , int cnt )
101
99
{
102
100
for ( int i = cnt - 1 ; i >= 0 ; i -- )
103
101
{
104
102
SetFlag ( ( byte ) ( ( b >> i ) & 1 ) ) ;
105
103
}
106
104
}
107
- public static void ProcessOnEncode ( byte [ ] inBuffer , Stream outStream , int level = 1000 )
105
+ public void ProcessOnEncode ( byte [ ] inBuffer , Stream outStream , int level = 1000 )
108
106
{
109
107
long perc , perc0 = 0 ;
110
108
long percbord = 0 ;
@@ -172,7 +170,7 @@ public static void ProcessOnEncode(byte[] inBuffer, Stream outStream, int level
172
170
}
173
171
flushflag ( true ) ;
174
172
}
175
- public static void WriteByte ( Stream s , byte b )
173
+ public void WriteByte ( Stream s , byte b )
176
174
{
177
175
s . WriteByte ( b ) ;
178
176
}
0 commit comments