diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 1bf5d0d..66fdede 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -61,8 +61,8 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} labels: | - org.opencontainers.image.title=Minetest Mapper - org.opencontainers.image.vendor=Minetest + org.opencontainers.image.title=Minetestmapper + org.opencontainers.image.vendor=Luanti org.opencontainers.image.licenses=BSD 2-Clause # Build and push Docker image diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a179ba..fc4b4bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ if(WIN32) set(BINDIR ".") set(DOCDIR ".") else() - set(SHAREDIR "share/minetest") # reuse Minetest share dir + set(SHAREDIR "share/luanti") # reuse engine share dir set(BINDIR "bin") set(DOCDIR "share/doc/${PROJECT_NAME}") set(MANDIR "share/man") @@ -209,7 +209,7 @@ if(UNIX) install(FILES "minetestmapper.6" DESTINATION "${MANDIR}/man6") endif() -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Overview mapper for Minetest") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Overview mapper for Luanti") set(CPACK_PACKAGE_VENDOR "celeron55") set(CPACK_PACKAGE_CONTACT "Perttu Ahola ") diff --git a/Dockerfile b/Dockerfile index b46109c..9a0add2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG DOCKER_IMAGE=alpine:3.19 +ARG DOCKER_IMAGE=alpine:3.20 FROM $DOCKER_IMAGE AS builder RUN apk add --no-cache build-base cmake \ @@ -17,7 +17,7 @@ FROM $DOCKER_IMAGE AS runtime RUN apk add --no-cache libstdc++ libgcc libpq \ gd sqlite-libs postgresql hiredis leveldb -COPY --from=builder /usr/local/share/minetest /usr/local/share/minetest +COPY --from=builder /usr/local/share/luanti /usr/local/share/luanti COPY --from=builder /usr/local/bin/minetestmapper /usr/local/bin/minetestmapper COPY COPYING /usr/local/share/minetest/minetestmapper.COPYING diff --git a/README.rst b/README.rst index 55f30ac..f9d045e 100644 --- a/README.rst +++ b/README.rst @@ -4,10 +4,11 @@ Minetest Mapper C++ .. image:: https://github.com/minetest/minetestmapper/workflows/build/badge.svg :target: https://github.com/minetest/minetestmapper/actions/workflows/build.yml -Minetestmapper generates an overview image from a Minetest map. +Minetestmapper generates an overview image from a Luanti map. -A port of minetestmapper.py to C++ from https://github.com/minetest/minetest/tree/0.4.17/util. -This version is both faster and provides more features than the now obsolete Python script. +A port of minetestmapper.py to C++ from `the obsolete Python script +`_. +This version is both faster and provides more features. Minetestmapper ships with a colors.txt file for Minetest Game, if you use a different game or have many mods installed you should generate a matching colors.txt for better results. @@ -39,7 +40,7 @@ for Windows: Minetestmapper for Windows can be downloaded `from the Releases section `_. -After extracting the archive, it can be invoked from cmd.exe: +After extracting the archive, it can be invoked from cmd.exe or PowerShell: :: cd C:\Users\yourname\Desktop\example\path @@ -116,7 +117,7 @@ zoom: Apply zoom to drawn nodes by enlarging them to n*n squares, e.g. ``--zoom 4`` colors: - Override auto-detected path to colors.txt, e.g. ``--colors ../minetest/mycolors.txt`` + Override auto-detected path to colors.txt, e.g. ``--colors ../world/mycolors.txt`` scales: Draw scales on specified image edges (letters *t b l r* meaning top, bottom, left and right), e.g. ``--scales tbr`` diff --git a/include/config.h b/include/config.h index 99c23e9..353f3eb 100644 --- a/include/config.h +++ b/include/config.h @@ -7,9 +7,5 @@ #ifdef USE_CMAKE_CONFIG_H #include "cmake_config.h" #else -#define USE_POSTGRESQL 0 -#define USE_LEVELDB 0 -#define USE_REDIS 0 - -#define SHAREDIR "/usr/share/minetest" +#error missing config #endif diff --git a/mapper.cpp b/mapper.cpp index da44d84..3b061c8 100644 --- a/mapper.cpp +++ b/mapper.cpp @@ -39,7 +39,7 @@ static void usage() }; const char *top_text = "minetestmapper -i -o [options]\n" - "Generate an overview image of a Minetest map.\n" + "Generate an overview image of a Luanti map.\n" "\n" "Options:\n"; const char *bottom_text = diff --git a/minetestmapper.6 b/minetestmapper.6 index c7ced36..4e20ff5 100644 --- a/minetestmapper.6 +++ b/minetestmapper.6 @@ -1,6 +1,6 @@ .TH MINETESTMAPPER 6 .SH NAME -minetestmapper \- generate an overview image of a Minetest map +minetestmapper \- generate an overview image of a Luanti map .SH SYNOPSIS .B minetestmapper \fB\-i\fR \fIworld_path\fR @@ -9,9 +9,9 @@ minetestmapper \- generate an overview image of a Minetest map See additional optional parameters below. .SH DESCRIPTION .B minetestmapper -generates an overview image of a minetest map. This is a port of +generates an overview image of a Luanti map. This is a port of the original minetestmapper.py to C++, that is both faster and -provides more functionality than the deprecated Python script. +provides more functionality than the obsolete Python script. .SH MANDATORY PARAMETERS .TP .BR \-i " " \fIworld_path\fR @@ -86,7 +86,7 @@ Zoom the image by using more than one pixel per node, e.g. "--zoom 4" .TP .BR \-\-colors " " \fIpath\fR -Forcefully set path to colors.txt file (it's autodetected otherwise), e.g. "--colors ../minetest/mycolors.txt" +Forcefully set path to colors.txt file (autodetected otherwise), e.g. "--colors ../world/mycolors.txt" .TP .BR \-\-scales " " \fIedges\fR diff --git a/util/build-mingw.sh b/util/build-mingw.sh index 0e1df54..9b8bc7e 100755 --- a/util/build-mingw.sh +++ b/util/build-mingw.sh @@ -7,7 +7,7 @@ variant=win32 [[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64 ####### -# this expects unpacked libraries similar to what Minetest's buildbot uses +# this expects unpacked libraries similar to what Luanti's buildbot uses # $extradlls will typically point to the DLLs for libgcc, libstdc++ and libpng libgd_dir= zlib_dir= diff --git a/util/dumpnodes/init.lua b/util/dumpnodes/init.lua index 850e379..1ef452c 100644 --- a/util/dumpnodes/init.lua +++ b/util/dumpnodes/init.lua @@ -15,7 +15,7 @@ local function pairs_s(dict) return ipairs(keys) end -minetest.register_chatcommand("dumpnodes", { +core.register_chatcommand("dumpnodes", { description = "Dump node and texture list for use with minetestmapper", func = function() local ntbl = {} @@ -30,7 +30,7 @@ minetest.register_chatcommand("dumpnodes", { ntbl[prefix][name] = true end end - local out, err = io.open(minetest.get_worldpath() .. "/nodes.txt", 'wb') + local out, err = io.open(core.get_worldpath() .. "/nodes.txt", 'wb') if not out then return true, err end @@ -39,7 +39,7 @@ minetest.register_chatcommand("dumpnodes", { out:write('# ' .. prefix .. '\n') for _, name in pairs_s(ntbl[prefix]) do local nn = prefix .. ":" .. name - local nd = minetest.registered_nodes[nn] + local nd = core.registered_nodes[nn] local tiles = nd.tiles or nd.tile_images if tiles == nil or nd.drawtype == 'airlike' then print("ignored(2): " .. nn) diff --git a/util/generate_colorstxt.py b/util/generate_colorstxt.py index ee7bfcb..96995fc 100755 --- a/util/generate_colorstxt.py +++ b/util/generate_colorstxt.py @@ -13,14 +13,14 @@ except: ############ ############ # Instructions for generating a colors.txt file for custom games and/or mods: -# 1) Add the dumpnodes mod to a Minetest world with the chosen game and mods enabled. +# 1) Add the dumpnodes mod to a Luanti world with the chosen game and mods enabled. # 2) Join ingame and run the /dumpnodes chat command. # 3) Run this script and poin it to the installation path of the game using -g, # the path(s) where mods are stored using -m and the nodes.txt in your world folder. # Example command line: -# ./util/generate_colorstxt.py --game /usr/share/minetest/games/minetest_game \ +# ./util/generate_colorstxt.py --game /usr/share/luanti/games/minetest_game \ # -m ~/.minetest/mods ~/.minetest/worlds/my_world/nodes.txt -# 4) Copy the resulting colors.txt file to your world folder or to any other places +# 4) Copy the resulting colors.txt file to your world folder or to any other place # and use it with minetestmapper's --colors option. ########### ###########