main
Last change
on this file since c52dd7b was c52dd7b, checked in by PulkoMandy <pulkomandy@…>, 8 weeks ago |
Add rehex scripts in easy to use form
This is more convenient than having them on the wiki
|
-
Property mode
set to
100644
|
File size:
513 bytes
|
Line | |
---|
1 | LittleEndian();
|
---|
2 |
|
---|
3 | // Simple string chunks are defined by a size (self-including) and a
|
---|
4 | // string (NULL terminated)
|
---|
5 | struct lenstring
|
---|
6 | {
|
---|
7 | uint16_t len;
|
---|
8 | local uint16_t realLen = len - 2;
|
---|
9 | char string[realLen];
|
---|
10 | };
|
---|
11 |
|
---|
12 | // Room chunks have a size and are filled by string chunks
|
---|
13 | struct ROOM
|
---|
14 | {
|
---|
15 | local uint16_t start = FTell();
|
---|
16 |
|
---|
17 | uint16_t sizeInBytes;
|
---|
18 |
|
---|
19 | struct lenstring substrings[0];
|
---|
20 | while (FTell() - start < sizeInBytes)
|
---|
21 | {
|
---|
22 | ArrayExtend(substrings);
|
---|
23 | }
|
---|
24 | };
|
---|
25 |
|
---|
26 | struct ROOM rooms[0];
|
---|
27 |
|
---|
28 | while(!FEof())
|
---|
29 | {
|
---|
30 | ArrayExtend(rooms);
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.