Rename .inc files to .inc.cpp for better language detection by editors and Github

This commit is contained in:
Matthias Schiffer 2021-06-25 19:43:14 +02:00
parent bfc9fcafb9
commit 73e5c12cde
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
5 changed files with 5 additions and 5 deletions

View file

@ -10,7 +10,7 @@ work.
of two different versions of two different versions
- `extract.py`: Takes the block type information from `blocks.json` and texture data - `extract.py`: Takes the block type information from `blocks.json` and texture data
from an unpacked Minecraft JAR, storing the result in `colors.json` from an unpacked Minecraft JAR, storing the result in `colors.json`
- `generate.py`: Generates `BlockType.inc` from `colors.json` - `generate.py`: Generates `BlockType.inc.cpp` from `colors.json`
In addition to these scripts, the JSON processor *jq* is a useful tool to work In addition to these scripts, the JSON processor *jq* is a useful tool to work
with MinedMap's resource metadata. with MinedMap's resource metadata.
@ -63,7 +63,7 @@ with MinedMap's resource metadata.
7. Update the source code with the new block colors: 7. Update the source code with the new block colors:
```sh ```sh
./generate.py colors.json ../src/Resource/BlockType.inc ./generate.py colors.json ../src/Resource/BlockType.inc.cpp
``` ```
After the update, the new version should be tested with old savegames (both After the update, the new version should be tested with old savegames (both

View file

@ -6,7 +6,7 @@ import sys
if len(sys.argv) != 3: if len(sys.argv) != 3:
sys.exit('Usage: extract.py <colors.json> <BlockType.inc>') sys.exit('Usage: extract.py <colors.json> <BlockType.inc.cpp>')
with open(sys.argv[1]) as f: with open(sys.argv[1]) as f:
colors = json.load(f) colors = json.load(f)

View file

@ -32,7 +32,7 @@ namespace Resource {
const std::unordered_map<std::string, BlockType> BlockType::Types = { const std::unordered_map<std::string, BlockType> BlockType::Types = {
#include "BlockType.inc" #include "BlockType.inc.cpp"
}; };
@ -51,7 +51,7 @@ static constexpr LegacyBlockType simple(const char *t) {
static const LegacyBlockType LEGACY_BLOCK_TYPE_DATA[256] = { static const LegacyBlockType LEGACY_BLOCK_TYPE_DATA[256] = {
#include "LegacyBlockType.inc" #include "LegacyBlockType.inc.cpp"
}; };