-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.simba
More file actions
51 lines (43 loc) · 1.84 KB
/
Copy pathcache.simba
File metadata and controls
51 lines (43 loc) · 1.84 KB
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
(*
# CacheReader
Suite of tools to read the cache files of a popular MMORPG.
Include this file to get all of it. Reading anything starts with {ref}`TCacheReader.Create`,
which fills the global `CacheReader`; from there {ref}`TCacheIndex.Cache` unpacks an index and
the definition types decode what comes out of it. {ref}`TMapChunkLoader` renders maps and
{ref}`TItemSprite` renders inventory icons.
Range checks are off by default, since the decoders are hot loops over trusted data. Define
`ENABLE_CACHEREADER_RANGE_CHECKS` before including this to turn them back on while developing.
Example:
```pascal
{$I WaspLib/utils/cache-reader/cache.simba}
begin
CacheReader := TCacheReader.Create();
CacheReader.Indices[ECacheIndex.CONFIGS].Cache();
end.
```
*)
{$DEFINE WL_CACHEREADER_INCLUDED}
{$IFNDEF ENABLE_CACHEREADER_RANGE_CHECKS}
{$R-}
{$ELSE}
begin
WriteLn('CacheReader: Range checks are on!');
end;
{$ENDIF}
{$IFNDEF WL_CACHE_READER_INCLUDED} {$INCLUDE_ONCE reader/reader.simba}
{$IFNDEF WL_CACHE_DEFINITION_ITEMS_INCLUDED} {$INCLUDE_ONCE definitions/items.simba}
{$IFNDEF WL_CACHE_DEFINITION_FONTS_INCLUDED} {$INCLUDE_ONCE definitions/fonts.simba}
{$IFNDEF WL_CACHE_DEFINITION_ENUMS_INCLUDED} {$INCLUDE_ONCE definitions/enums.simba}
{$IFNDEF WL_CACHE_DEFINITION_INTERFACES_INCLUDED} {$INCLUDE_ONCE definitions/interfaces.simba}
{$IFNDEF WL_ITEM_SPRITE_INCLUDED} {$INCLUDE_ONCE render/itemsprite.simba}
{$IFNDEF WL_CACHE_LOADER_FONTS_INCLUDED} {$INCLUDE_ONCE loaders/fontloader.simba}
{$IFNDEF WL_CACHE_LOADER_MAPCHUNK_INCLUDED} {$INCLUDE_ONCE loaders/map/mapchunk.simba}
{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}
begin
ColorUtils.SetBrightness(TColorUtils.BRIGHTNESS_MAX);
ColorUtils.SetupHeightColors();
CircularAngle.Setup();
HeightCalc.Setup();
TileShapes.Setup();
end;
{$R+}