Skip to content

Commit c3eeee9

Browse files
committed
Fix markdown files
1 parent bad259a commit c3eeee9

File tree

2 files changed

+62
-34
lines changed

2 files changed

+62
-34
lines changed

README.md

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
66

77
# libsiedler2 - Library for reading and writing 'The Settlers II' file formats
88

9-
### Current Build Info
9+
## Current Build Info
1010

1111
- Github Actions: ![Unit tests](https://github.com/Return-To-The-Roots/libsiedler2/workflows/Unit%20tests/badge.svg)
1212

@@ -16,62 +16,80 @@ SPDX-License-Identifier: GPL-2.0-or-later
1616
[![Coveralls Status](https://coveralls.io/repos/github/Return-To-The-Roots/libsiedler2/badge.svg?branch=master)](https://coveralls.io/github/Return-To-The-Roots/libsiedler2?branch=master)
1717
[![Codecov Status](https://codecov.io/gh/Return-To-The-Roots/libsiedler2/branch/master/graph/badge.svg)](https://codecov.io/gh/Return-To-The-Roots/libsiedler2)
1818

19+
## Prerequisites
1920

20-
### Prerequisites:
21-
22-
- boost ( http://www.boost.org )
21+
- boost ( <http://www.boost.org> )
2322
- libutil
2423
- libendian
2524

26-
### Installation:
25+
## Installation
2726

28-
```
27+
```bash
2928
mkdir build && cd build
3029
cmake ..
3130
make install
3231
```
3332

34-
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.
3535

36-
### Texture format
36+
## Texture format
3737

3838
The bitmaps can be stored in memory in ARGB or paletted format.
3939

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.
4142

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.
4345
That is the alpha value is the most significant byte.
4446

4547
The used format can be set with `setTextureFormat`.
4648

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.
4851

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.
5054
So using a paletted format may result in failure while loading ARGB bitmaps.
5155

52-
### Palettes
56+
## Palettes
5357

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.
5560

5661
- 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.
5864

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.)
6067

6168
For the usage the following applies:
6269

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).
7289
It will create a bitmap with the same format as the buffer.
7390
A palette is required and stored for paletted formats.
74-
75-
### Additional information
7691

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:
95+
<https://www.siedler25.org/formate> (in German)

examples/README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,28 @@ SPDX-License-Identifier: GPL-2.0-or-later
77
# RTTR Utilities for The Settlers 2
88

99
## LstPacker
10+
1011
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.
1316

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.
1520

1621
## 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.
1825
With this tool you can change the index to another index.
1926

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.
2129

2230
## 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.
2434
Is is only kept for reference and no longer actually used.

0 commit comments

Comments
 (0)