Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.3.1 #27

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ if (TARGET wzmaplib)
message(DEBUG "wzmaplib is already available - no need to use FetchContent")
else()
message(STATUS "maptools: wzmaplib must be fetched")
set(_cmake_min_ver_supported 3.11) # CMake 3.11 is the minimum version for FetchContent
# CMake 3.11 is the minimum version for FetchContent
# CMake 3.14 is the minimum version for FetchContent_MakeAvailable, CMake 3.18 is required for "SOURCE_SUBDIR" to work with it, and CMake 3.28 is required for EXCLUDE_FROM_ALL to work with it
set(_cmake_min_ver_supported 3.11)
endif()

cmake_minimum_required(VERSION ${_cmake_min_ver_supported}...3.24)
Expand Down Expand Up @@ -47,16 +49,23 @@ if(NOT TARGET wzmaplib)
FetchContent_Declare(
warzone2100_repo
GIT_REPOSITORY https://github.com/Warzone2100/warzone2100.git
GIT_TAG 85310b635635955e453901c308c343667b6f0a35
GIT_TAG 6847a6500248bffbbaaa786f1a9b122d22307a15
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
SOURCE_SUBDIR "lib/wzmaplib"
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(warzone2100_repo)
if(NOT warzone2100_repo_POPULATED)
FetchContent_Populate(warzone2100_repo)
if(NOT CMAKE_VERSION VERSION_LESS 3.28)
FetchContent_MakeAvailable(warzone2100_repo)
message(STATUS "maptools: Added wzmaplib")
else()
FetchContent_GetProperties(warzone2100_repo)
if(NOT warzone2100_repo_POPULATED)
FetchContent_Populate(warzone2100_repo)
endif()
message(STATUS "maptools: Adding wzmaplib")
add_subdirectory("${warzone2100_repo_SOURCE_DIR}/lib/wzmaplib" "lib/wzmaplib" EXCLUDE_FROM_ALL)
endif()
message(STATUS "maptools: Adding wzmaplib")
add_subdirectory("${warzone2100_repo_SOURCE_DIR}/lib/wzmaplib" "lib/wzmaplib" EXCLUDE_FROM_ALL)
endif()

find_package(PNG 1.2 REQUIRED)
Expand Down
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2025-01-29: Version 1.3.1:
* Update wzmaplib to 1.3.1

2025-01-28: Version 1.3.0:
* Update wzmaplib to 1.3.0
* Fix loading script-generated maps
* Add --map-seed option

2024-08-01: Version 1.2.7:
* Update wzmaplib to 1.2.7
* Add --layers option for genpreview command
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Convert a map from one format to another
| `--preserve-mods` | Copy other files from the original map package (i.e. the extra files / modifications in a map-mod) | | |
| `--output-uncompressed` | Output uncompressed to a folder (not in a .wz file) | | |
| `--set-name` | Set / override the map name when converting | | |
| `--map-seed` | Specify the script-generated map seed | uint32_t | DEFAULTS to `rand()` |

> Note: When converting a script-generated map:
> - If the output format is `jsonv2` (or later) the map script will be preserved
Expand All @@ -76,6 +77,8 @@ Generate a map preview PNG
| `-o`,`--output` | Output PNG filename (+ path) | TEXT:PATH | REQUIRED <sup>(may also be specified as positional parameter)</sup> |
| `-c`,`--playercolors` | Player colors | ENUM:value in {`simple`, `wz`} | DEFAULTS to `simple` |
| `--scavcolor` | Specify the scavengers hex color | RGB hex color code | DEFAULTS to `#800000` (maroon) |
| `--layers` | Specify layers to draw | Either `all` or a comma-separated list of any of: {`terrain`, `structures`, `oil`} | DEFAULTS to `all` |
| `--map-seed` | Specify the script-generated map seed | uint32_t | DEFAULTS to `rand()` |

## `maptools package info`

Expand All @@ -90,6 +93,7 @@ Extract info / stats from a map package to JSON
| `-h`,`--help` | Print help message and exit | | |
| `-i`,`--input` | Input map package (.wz package, or extracted package folder) | TEXT:PATH | REQUIRED <sup>(may also be specified as positional parameter)</sup> |
| `-o`,`--output` | Output filename (+ path) | TEXT:PATH | |
| `--map-seed` | Specify the script-generated map seed | uint32_t | DEFAULTS to `rand()` |

> If `--output` is not specified, the JSON result is output to stdout

Expand All @@ -116,6 +120,7 @@ Both `inputmapdir` and `outputmapdir` must exist.
| `-f`,`--format` | [Output map format](#output-map-formats) | ENUM:value in { `bjo`, `json`, `jsonv2`, `latest`} | REQUIRED |
| `-i`,`--input` | Input map directory | TEXT:DIR | REQUIRED <sup>(may also be specified as positional parameter)</sup> |
| `-o`,`--output` | Output map directory | TEXT:DIR | REQUIRED <sup>(may also be specified as positional parameter)</sup> |
| `--map-seed` | Specify the script-generated map seed | uint32_t | DEFAULTS to `rand()` |

## `maptools map genpreview`

Expand All @@ -133,6 +138,7 @@ Both `inputmapdir` and the parent directory for the output filename (`output`) m
| `-c`,`--playercolors` | Player colors | ENUM:value in {`simple`, `wz`} | DEFAULTS to `simple` |
| `--scavcolor` | Specify the scavengers hex color | RGB hex color code | DEFAULTS to `#800000` (maroon) |
| `--layers` | Specify layers to draw | Either `all` or a comma-separated list of any of: {`terrain`, `structures`, `oil`} | DEFAULTS to `all` |
| `--map-seed` | Specify the script-generated map seed | uint32_t | DEFAULTS to `rand()` |

# Output Level Info Formats
| [format] | Description | flaME | WZ < 3.4 | WZ 3.4+ | WZ 4.1+ | WZ 4.3+ |
Expand Down
2 changes: 1 addition & 1 deletion VERSION.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.7
1.3.1
Loading