Skip to content

Commit

Permalink
Apply Luanti rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Nov 11, 2024
1 parent dd5c4e5 commit 1c16c40
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 <[email protected]>")

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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

Expand Down
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
<https://github.com/minetest/minetest/tree/0.4.17/util>`_.
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.
Expand Down Expand Up @@ -39,7 +40,7 @@ for Windows:
Minetestmapper for Windows can be downloaded `from the Releases section
<https://github.com/minetest/minetestmapper/releases>`_.

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
Expand Down Expand Up @@ -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``
Expand Down
6 changes: 1 addition & 5 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void usage()
};
const char *top_text =
"minetestmapper -i <world_path> -o <output_image.png> [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 =
Expand Down
8 changes: 4 additions & 4 deletions minetestmapper.6
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion util/build-mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions util/dumpnodes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions util/generate_colorstxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
############
############
# 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.
###########
###########
Expand Down

0 comments on commit 1c16c40

Please sign in to comment.