You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run all tests (`make test`) you need to put the original Settlers II folders (DATA and GFX) in the testFiles directory.
33
+
To run all tests (`make test`) you need to put the original Settlers II folders
34
+
(DATA and GFX) in the testFiles directory.
35
35
36
-
###Texture format
36
+
## Texture format
37
37
38
38
The bitmaps can be stored in memory in ARGB or paletted format.
39
39
40
-
The ARGB format is byte BGRA, so 4 bytes define 1 pixel with blue first and alpha last.
40
+
The ARGB format is byte BGRA, so 4 bytes define 1 pixel with blue first
41
+
and alpha last.
41
42
42
-
If this is interpreted as a 32bit word on a little endian machine than it is (word) ARGB format.
43
+
If this is interpreted as a 32bit word on a little endian machine than it is
44
+
(word) ARGB format.
43
45
That is the alpha value is the most significant byte.
44
46
45
47
The used format can be set with `setTextureFormat`.
46
48
47
-
All bitmaps loaded **after** this call will be in the given format with conversion beeing used if required.
49
+
All bitmaps loaded **after** this call will be in the given format with
50
+
conversion beeing used if required.
48
51
49
-
*Note:* While it is possible to convert paletted -> ARGB in all cases the reverse is not always possible.
52
+
*Note:* While it is possible to convert paletted -> ARGB in all cases the
53
+
reverse is not always possible.
50
54
So using a paletted format may result in failure while loading ARGB bitmaps.
51
55
52
-
###Palettes
56
+
## Palettes
53
57
54
-
As some files may contain embedded palettes (i.e LBM files): Be careful when reading, writing or using them.
58
+
As some files may contain embedded palettes (i.e LBM files):
59
+
Be careful when reading, writing or using them.
55
60
56
61
- If the bitmap is paletted, the loaded result contains a palette.
57
-
- If it is ARGB, it may contain a palette and this palette may be invalid (not contain all colors) which can result in errors when converting to paletted.
62
+
- If it is ARGB, it may contain a palette and this palette may be invalid
63
+
(not contain all colors) which can result in errors when converting to paletted.
58
64
59
-
Use `checkPalette` to make sure the palette is valid. (Trivially true for paletted bitmaps.)
65
+
Use `checkPalette` to make sure the palette is valid.
66
+
(Trivially true for paletted bitmaps.)
60
67
61
68
For the usage the following applies:
62
69
63
-
1. No palette is required or used when no conversion occurs (Read/Write, Create/Print to from file/buffer with same format)
64
-
2. Loading: If the file contains a palette, it is stored in the bitmap and used.
65
-
If the file does not contain a palette the passed palette is used, but only stored with the bitmap if it is paletted.
66
-
3. Writing: If the file format contains a palette and the bitmap contains one, it is used instead of the passed palette.
67
-
Otherwise the palette passed is used with the bitmaps palette as a fallback.
68
-
It is an error not to pass a palette when conversion is required unless the bitmap contains one.
69
-
If the file format supports paletted and unpalleted images then the paletted format is used, if (and only if) the bitmap is paletted or contains a palette.
70
-
4. Drawing: The `print` function will prefer the passed palette for conversion from ARGB and the contained palette for conversion to ARGB.
71
-
5. Creating: The `create` function resets the bitmap completely (size, palette, format, data).
70
+
1. No palette is required or used when no conversion occurs
71
+
(Read/Write, Create/Print to from file/buffer with same format)
72
+
2. Loading: If the file contains a palette,
73
+
it is stored in the bitmap and used.
74
+
If the file does not contain a palette the passed palette is used,
75
+
but only stored with the bitmap if it is paletted.
76
+
3. Writing: If the file format contains a palette and the bitmap contains one,
77
+
it is used instead of the passed palette.
78
+
Otherwise the palette passed is used with the bitmaps palette as
79
+
a fallback.
80
+
It is an error not to pass a palette when conversion is required
81
+
unless the bitmap contains one.
82
+
If the file format supports paletted and unpalleted images then the
83
+
paletted format is used, if (and only if) the bitmap is paletted
84
+
or contains a palette.
85
+
4. Drawing: The `print` function will prefer the passed palette for conversion
86
+
from ARGB and the contained palette for conversion to ARGB.
87
+
5. Creating: The `create` function resets the bitmap completely
88
+
(size, palette, format, data).
72
89
It will create a bitmap with the same format as the buffer.
73
90
A palette is required and stored for paletted formats.
74
-
75
-
### Additional information
76
91
77
-
A detailed description of the file formats are here: https://www.siedler25.org/formate/ (in German)
92
+
## Additional information
93
+
94
+
A detailed description of the file formats are here:
Packs and unpacks file archives from The Settlers 2.
11
-
This is mostly meant for use with LST files, which are simple collections of (mainly) images.
12
-
But it also works for other archive-like files, like Font-, Sound- and Palette-Files.
12
+
This is mostly meant for use with LST files, which are simple collections of
13
+
(mainly) images.
14
+
But it also works for other archive-like files, like Font-, Sound- and
15
+
Palette-Files.
13
16
14
-
See `lstpacker --help` for details on usage but mostly it is `lstpacker <foo.lst>` for unpacking and `lstpacker <foo>` for packing a folder into a lst file.
17
+
See `lstpacker --help` for details on usage
18
+
but mostly it is `lstpacker <foo.lst>` for unpacking
19
+
and `lstpacker <foo>` for packing a folder into a lst file.
15
20
16
21
## ChTransparentIdx
17
-
The image files have a special palette index that is used as the transparent color.
22
+
23
+
The image files have a special palette index that is used as
24
+
the transparent color.
18
25
With this tool you can change the index to another index.
19
26
20
-
Use `chTransparentIdx --from <254> --to <255> <foo.lst>` to change all images in that lst file.
27
+
Use `chTransparentIdx --from <254> --to <255> <foo.lst>` to change
28
+
all images in that lst file.
21
29
22
30
## Outline
23
-
This is an internal helper tool to extract the fonts from the `RESOURCE.DAT` file and convert it into a font file usable by RTTR.
31
+
32
+
This is an internal helper tool to extract the fonts from the `RESOURCE.DAT`
33
+
file and convert it into a font file usable by RTTR.
24
34
Is is only kept for reference and no longer actually used.
0 commit comments