|
11 | 11 | * Circular buffer of game states. |
12 | 12 | */ |
13 | 13 | class FrameBuffer { |
14 | | - static final int STATICTILES_START = 3447004; // getGroundHeight, isWalkable, isBuildable |
15 | | - static final int STATICTILES_END = 4823260; |
16 | | - static final int REGION_START = 5085404; // getMapTileRegionId, ..., getRegions |
17 | | - static final int REGION_END = 10586480; |
18 | | - static final int STRINGSSHAPES_START = 10962632; // getStringCount, ... getShapes |
19 | | - static final int STRINGSHAPES_END = 32242636; |
20 | | - static final int UNITFINDER_START = 32962644; |
21 | | - |
22 | | - static final int DYNAMIC_SLICE1_SIZE = STATICTILES_START; // 3447004 |
23 | | - static final int DYNAMIC_SLICE2_SIZE = REGION_START - STATICTILES_END; // 262144 |
24 | | - static final int DYNAMIC_SLICE3_SIZE = STRINGSSHAPES_START - REGION_END; // 376152 |
25 | | - static final int DYNAMIC_SLICE4_SIZE = UNITFINDER_START - STRINGSHAPES_END; // 720008 |
26 | | - |
27 | | - static final int DEST_SLICE1_OFFSET = 0; |
28 | | - static final int DEST_SLICE2_OFFSET = DYNAMIC_SLICE1_SIZE; // 3447004 |
29 | | - static final int DEST_SLICE3_OFFSET = DEST_SLICE2_OFFSET + DYNAMIC_SLICE2_SIZE; // 3709148 |
30 | | - static final int DEST_SLICE4_OFFSET = DEST_SLICE3_OFFSET + DYNAMIC_SLICE3_SIZE; // 4085300 |
31 | | - |
32 | | - static final int BUFFER_SIZE = DEST_SLICE4_OFFSET + DYNAMIC_SLICE4_SIZE; // 4805308 |
| 14 | + static final int BUFFER_SIZE = AsyncClientData.BUFFER_SIZE; |
33 | 15 | private static final Unsafe unsafe = UnsafeTools.getUnsafe(); |
34 | 16 |
|
35 | 17 | private WrappedBuffer liveData; |
@@ -170,9 +152,9 @@ void dequeue() { |
170 | 152 | } |
171 | 153 |
|
172 | 154 | void copyBuffer(WrappedBuffer source, WrappedBuffer destination) { |
173 | | - unsafe.copyMemory(source.getAddress() + 0, destination.getAddress() + DEST_SLICE1_OFFSET, DYNAMIC_SLICE1_SIZE); |
174 | | - unsafe.copyMemory(source.getAddress() + STATICTILES_END, destination.getAddress() + DEST_SLICE2_OFFSET, DYNAMIC_SLICE2_SIZE); |
175 | | - unsafe.copyMemory(source.getAddress() + REGION_END, destination.getAddress() + DEST_SLICE3_OFFSET, DYNAMIC_SLICE3_SIZE); |
176 | | - unsafe.copyMemory(source.getAddress() + STRINGSHAPES_END, destination.getAddress() + DEST_SLICE4_OFFSET, DYNAMIC_SLICE4_SIZE); |
| 155 | + unsafe.copyMemory(source.getAddress() + 0, destination.getAddress() + AsyncClientData.DEST_SLICE1_OFFSET, AsyncClientData.DYNAMIC_SLICE1_SIZE); |
| 156 | + unsafe.copyMemory(source.getAddress() + AsyncClientData.STATICTILES_END, destination.getAddress() + AsyncClientData.DEST_SLICE2_OFFSET, AsyncClientData.DYNAMIC_SLICE2_SIZE); |
| 157 | + unsafe.copyMemory(source.getAddress() + AsyncClientData.REGION_END, destination.getAddress() + AsyncClientData.DEST_SLICE3_OFFSET, AsyncClientData.DYNAMIC_SLICE3_SIZE); |
| 158 | + unsafe.copyMemory(source.getAddress() + AsyncClientData.STRINGSHAPES_END, destination.getAddress() + AsyncClientData.DEST_SLICE4_OFFSET, AsyncClientData.DYNAMIC_SLICE4_SIZE); |
177 | 159 | } |
178 | 160 | } |
0 commit comments