1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Merge branch 'luanti-org:master' into skybox

This commit is contained in:
Mircea Kitsune 2025-05-31 19:11:45 +03:00 committed by GitHub
commit 79f46800f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
282 changed files with 72639 additions and 24769 deletions

View file

@ -34,28 +34,32 @@ env:
jobs:
# Older gcc version (should be close to our minimum supported version)
gcc_7:
runs-on: ubuntu-20.04
gcc_9:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-7
install_linux_deps g++-9
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-7
CXX: g++-7
# Test fallback SHA implementations
CMAKE_FLAGS: '-DENABLE_OPENSSL=0'
CC: gcc-9
CXX: g++-9
CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'
- name: Test
- name: Unittest
run: |
./bin/luanti --run-unittests
# Do this here because we have ASan and error paths are sensitive to dangling pointers
- name: Test error cases
run: |
./util/test_error_cases.sh
# Current gcc version
gcc_14:
runs-on: ubuntu-24.04
@ -81,32 +85,28 @@ jobs:
../bin/luanti --run-unittests
# Older clang version (should be close to our minimum supported version)
clang_7:
runs-on: ubuntu-20.04
clang_11:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-7 llvm-7
install_linux_deps clang-11
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-7
CXX: clang++-7
CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'
CC: clang-11
CXX: clang++-11
# Test fallback SHA implementations
CMAKE_FLAGS: '-DENABLE_OPENSSL=0'
- name: Unittest
- name: Test
run: |
./bin/luanti --run-unittests
# Do this here because we have ASan and error paths are sensitive to dangling pointers
- name: Test error cases
run: |
./util/test_error_cases.sh
# Current clang version
clang_18:
runs-on: ubuntu-24.04
@ -132,16 +132,16 @@ jobs:
run: |
./util/test_multiplayer.sh
# Build with prometheus-cpp (server-only)
clang_11_prometheus:
name: "clang_11 (PROMETHEUS=1)"
runs-on: ubuntu-22.04
# Build with prometheus-cpp (server-only), also runs on ARM64
clang_prometheus_arm:
name: "clang (with Prometheus, ARM64)"
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-11
install_linux_deps --headless clang libluajit-5.1-dev
- name: Build prometheus-cpp
run: ./util/ci/build_prometheus_cpp.sh
@ -150,8 +150,8 @@ jobs:
run: |
./util/ci/build.sh
env:
CC: clang-11
CXX: clang++-11
CC: clang
CXX: clang++
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0 -DENABLE_CURSES=0"
- name: Test

View file

@ -45,7 +45,7 @@ jobs:
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=13 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \

View file

@ -92,7 +92,7 @@ jobs:
- name: Check indent spaces
run: |
if git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$|\.lua' |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$|\.lua$' |\
xargs grep -n -P '^\t*[ ]';\
then\
echo -e "\033[0;31mFound incorrect indent whitespaces";\

View file

@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.12)
if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW)
endif()
# This can be read from ${PROJECT_NAME} after project() is called
project(luanti)
@ -11,7 +14,7 @@ set(CLANG_MINIMUM_VERSION "7.0.1")
# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 12)
set(VERSION_MINOR 13)
set(VERSION_PATCH 0)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
@ -262,8 +265,8 @@ install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
if(UNIX AND NOT APPLE)
install(FILES "doc/luanti.6" "doc/luantiserver.6" DESTINATION "${MANDIR}/man6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "misc/net.minetest.minetest.metainfo.xml" DESTINATION "${METAINFODIR}")
install(FILES "misc/org.luanti.luanti.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "misc/org.luanti.luanti.metainfo.xml" DESTINATION "${METAINFODIR}")
install(FILES "misc/luanti.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
install(FILES "misc/luanti-xorg-icon-128.png"
DESTINATION "${ICONDIR}/hicolor/128x128/apps"

View file

@ -57,7 +57,7 @@ Some can be changed in the key config dialog in the settings tab.
| T | Chat |
| / | Command |
| Esc | Pause menu/abort/exit (pauses only singleplayer game) |
| Ctrl + Esc | Exit directly to main menu from anywhere, bypassing pause menu |
| Shift + Esc | Exit directly to main menu from anywhere, bypassing pause menu |
| + | Increase view range |
| - | Decrease view range |
| K | Enable/disable fly mode (needs fly privilege) |

View file

@ -22,14 +22,19 @@ package net.minetest.minetest;
import org.libsdl.app.SDLActivity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.text.InputType;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
@ -91,6 +96,9 @@ public class GameActivity extends SDLActivity {
saveSettings();
}
private NotificationManager mNotifyManager;
private boolean gameNotificationShown = false;
public void showTextInputDialog(String hint, String current, int editType) {
runOnUiThread(() -> showTextInputDialogUI(hint, current, editType));
}
@ -263,4 +271,67 @@ public class GameActivity extends SDLActivity {
public boolean hasPhysicalKeyboard() {
return getContext().getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
}
// TODO: share code with UnzipService.createNotification
private void updateGameNotification() {
if (mNotifyManager == null) {
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
if (!gameNotificationShown) {
mNotifyManager.cancel(MainActivity.NOTIFICATION_ID_GAME);
return;
}
Notification.Builder builder;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder = new Notification.Builder(this, MainActivity.NOTIFICATION_CHANNEL_ID);
} else {
builder = new Notification.Builder(this);
}
Intent notificationIntent = new Intent(this, GameActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
int pendingIntentFlag = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentFlag = PendingIntent.FLAG_MUTABLE;
}
PendingIntent intent = PendingIntent.getActivity(this, 0,
notificationIntent, pendingIntentFlag);
builder.setContentTitle(getString(R.string.game_notification_title))
.setSmallIcon(R.mipmap.ic_launcher)
.setContentIntent(intent)
.setOngoing(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// This avoids a stuck notification if the app is killed while
// in-game: (1) if the user closes the app from the "Recents" screen
// or (2) if the system kills the app while it is in background.
// onStop is called too early to remove the notification and
// onDestroy is often not called at all, so there's this hack instead.
builder.setTimeoutAfter(16000);
// Replace the notification just before it expires as long as the app is
// running (and we're still in-game).
final Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (gameNotificationShown) {
updateGameNotification();
}
}
}, 15000);
}
mNotifyManager.notify(MainActivity.NOTIFICATION_ID_GAME, builder.build());
}
public void setPlayingNowNotification(boolean show) {
gameNotificationShown = show;
updateGameNotification();
}
}

View file

@ -43,6 +43,8 @@ import static net.minetest.minetest.UnzipService.*;
public class MainActivity extends AppCompatActivity {
public static final String NOTIFICATION_CHANNEL_ID = "Minetest channel";
public static final int NOTIFICATION_ID_UNZIP = 1;
public static final int NOTIFICATION_ID_GAME = 2;
private final static int versionCode = BuildConfig.VERSION_CODE;
private static final String SETTINGS = "MinetestSettings";

View file

@ -51,7 +51,6 @@ public class UnzipService extends IntentService {
public static final int SUCCESS = -1;
public static final int FAILURE = -2;
public static final int INDETERMINATE = -3;
private final int id = 1;
private NotificationManager mNotifyManager;
private boolean isSuccess = true;
private String failureMessage;
@ -100,11 +99,14 @@ public class UnzipService extends IntentService {
}
}
// TODO: share code with GameActivity.updateGameNotification
@NonNull
private Notification.Builder createNotification() {
Notification.Builder builder;
if (mNotifyManager == null)
if (mNotifyManager == null) {
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
Notification.Builder builder;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder = new Notification.Builder(this, MainActivity.NOTIFICATION_CHANNEL_ID);
} else {
@ -128,7 +130,7 @@ public class UnzipService extends IntentService {
.setOngoing(true)
.setProgress(0, 0, true);
mNotifyManager.notify(id, builder.build());
mNotifyManager.notify(MainActivity.NOTIFICATION_ID_UNZIP, builder.build());
return builder;
}
@ -200,14 +202,14 @@ public class UnzipService extends IntentService {
} else {
notificationBuilder.setProgress(100, progress, false);
}
mNotifyManager.notify(id, notificationBuilder.build());
mNotifyManager.notify(MainActivity.NOTIFICATION_ID_UNZIP, notificationBuilder.build());
}
}
@Override
public void onDestroy() {
super.onDestroy();
mNotifyManager.cancel(id);
mNotifyManager.cancel(MainActivity.NOTIFICATION_ID_UNZIP);
publishProgress(null, R.string.loading, isSuccess ? SUCCESS : FAILURE);
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_title">O kargañ Luanti</string>
<string name="label">Luanti</string>
<string name="loading">O kargañ…</string>
<string name="notification_channel_description">Evezhiadennoù gant Luanti</string>
<string name="unzip_notification_description">Nebeutoc\'h eget ur vunutenn…</string>
<string name="ime_dialog_done">Graet</string>
<string name="no_web_browser">Merdeer web ebet bet kavet</string>
<string name="notification_channel_name">Evezhiadennoù hollek</string>
</resources>

View file

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Lädt</string>
<string name="loading">Laden </string>
<string name="unzip_notification_title">Luanti lädt</string>
<string name="unzip_notification_description">Weniger als 1 Minute…</string>
<string name="unzip_notification_description">Weniger als 1 Minute </string>
<string name="ime_dialog_done">Fertig</string>
<string name="no_web_browser">Kein Web-Browser gefunden</string>
<string name="no_web_browser">Keinen Web-Browser gefunden</string>
<string name="notification_channel_name">Allgemeine Benachrichtigung</string>
<string name="notification_channel_description">Benachrichtigungen von Luanti</string>
<string name="game_notification_title">Luanti läuft</string>
</resources>

View file

@ -8,4 +8,5 @@
<string name="unzip_notification_description">Moins d\'une minute…</string>
<string name="ime_dialog_done">Terminé</string>
<string name="no_web_browser">Aucun navigateur web trouvé</string>
<string name="game_notification_title">Luanti est en cours d\'exécution</string>
</resources>

View file

@ -8,4 +8,5 @@
<string name="unzip_notification_description">Kurang dari 1 menit…</string>
<string name="notification_channel_description">Pemberitahuan dari Luanti</string>
<string name="unzip_notification_title">Memuat Luanti…</string>
<string name="game_notification_title">Luanti sedang berjalan</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Se încarcă…</string>
<string name="notification_channel_name">Notificare generală</string>
<string name="notification_channel_description">Notificări de la Luanti</string>
<string name="unzip_notification_title">Luanti pornește</string>
<string name="unzip_notification_description">Sub 1 minut…</string>
<string name="ime_dialog_done">Gata</string>
<string name="no_web_browser">Niciun navigator web găsit</string>
</resources>

View file

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_title">Загрузка Luanti</string>
<string name="unzip_notification_description">Меньше чам за 1 минуту</string>
<string name="unzip_notification_description">Менее 1 минуты</string>
<string name="ime_dialog_done">Готово</string>
<string name="label">Luаnti</string>
<string name="notification_channel_description">Уведомления от Luanti</string>
<string name="notification_channel_name">Основные уведомления</string>
<string name="loading">Загрузка…</string>
<string name="no_web_browser">Не найдено веб-браузера</string>
<string name="game_notification_title">Luanti запущено</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="no_web_browser">Ni bil najden spletni brskalnik</string>
<string name="notification_channel_name">Glavno obvestilo</string>
<string name="loading">Nalaganje …</string>
<string name="unzip_notification_description">Manj kot 1 minuta …</string>
<string name="label">Luanti</string>
<string name="notification_channel_description">Obvestilo od Luantia</string>
<string name="ime_dialog_done">Končano!l</string>
<string name="unzip_notification_title">Nalaganje Luantia</string>
</resources>

View file

@ -4,8 +4,9 @@
<string name="loading">Laddar…</string>
<string name="unzip_notification_description">Mindre än 1 minut…</string>
<string name="ime_dialog_done">Färdig</string>
<string name="no_web_browser">Ingen webbläsare kunde hittas</string>
<string name="notification_channel_name">Generell notis</string>
<string name="notification_channel_description">Notiser från Luanti</string>
<string name="no_web_browser">Ingen webbläsare hittades</string>
<string name="notification_channel_name">Allmän notifikation</string>
<string name="notification_channel_description">Notifikationer från Luanti</string>
<string name="unzip_notification_title">Laddar Luanti</string>
<string name="game_notification_title">Luanti är igång</string>
</resources>

View file

@ -6,6 +6,7 @@
<string name="notification_channel_description">Notifications from Luanti</string>
<string name="unzip_notification_title">Loading Luanti</string>
<string name="unzip_notification_description">Less than 1 minute&#8230;</string>
<string name="game_notification_title">Luanti is running</string>
<string name="ime_dialog_done">Done</string>
<string name="no_web_browser">No web browser found</string>
</resources>

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 12) // Version Minor
project.ext.set("versionMinor", 13) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
// ^ keep in sync with cmake

View file

@ -9,3 +9,7 @@ mt_color_green = "#72FF63"
mt_color_dark_green = "#25C191"
mt_color_orange = "#FF8800"
mt_color_red = "#FF3300"
function core.are_keycodes_equal(k1, k2)
return core.normalize_keycode(k1) == core.normalize_keycode(k2)
end

View file

@ -7,18 +7,21 @@ local math = math
local function basic_dump(o)
local tp = type(o)
if tp == "number" then
return tostring(o)
local s = tostring(o)
if tonumber(s) == o then
return s
end
-- Prefer an exact representation over a compact representation.
-- e.g. basic_dump(0.3) == "0.3",
-- but basic_dump(0.1 + 0.2) == "0.30000000000000004"
-- so the user can see that 0.1 + 0.2 ~= 0.3
return string.format("%.17g", o)
elseif tp == "string" then
return string.format("%q", o)
elseif tp == "boolean" then
return tostring(o)
elseif tp == "nil" then
return "nil"
-- Uncomment for full function dumping support.
-- Not currently enabled because bytecode isn't very human-readable and
-- dump's output is intended for humans.
--elseif tp == "function" then
-- return string.format("loadstring(%q)", string.dump(o))
elseif tp == "userdata" then
return tostring(o)
else
@ -105,65 +108,141 @@ function dump2(o, name, dumped)
return string.format("%s = {}\n%s", name, table.concat(t))
end
--------------------------------------------------------------------------------
-- This dumps values in a one-statement format.
-- This dumps values in a human-readable expression format.
-- If possible, the resulting string should evaluate to an equivalent value if loaded and executed.
-- For example, {test = {"Testing..."}} becomes:
-- [[{
-- test = {
-- "Testing..."
-- }
-- }]]
-- This supports tables as keys, but not circular references.
-- It performs poorly with multiple references as it writes out the full
-- table each time.
-- The indent field specifies a indentation string, it defaults to a tab.
-- Use the empty string to disable indentation.
-- The dumped and level arguments are internal-only.
function dump(o, indent, nested, level)
local t = type(o)
if not level and t == "userdata" then
-- when userdata (e.g. player) is passed directly, print its metatable:
return "userdata metatable: " .. dump(getmetatable(o))
end
if t ~= "table" then
return basic_dump(o)
end
-- Contains table -> true/nil of currently nested tables
nested = nested or {}
if nested[o] then
return "<circular reference>"
end
nested[o] = true
function dump(value, indent)
indent = indent or "\t"
level = level or 1
local newline = indent == "" and "" or "\n"
local ret = {}
local dumped_indexes = {}
for i, v in ipairs(o) do
ret[#ret + 1] = dump(v, indent, nested, level + 1)
dumped_indexes[i] = true
end
for k, v in pairs(o) do
if not dumped_indexes[k] then
if type(k) ~= "string" or not is_valid_identifier(k) then
k = "["..dump(k, indent, nested, level + 1).."]"
end
v = dump(v, indent, nested, level + 1)
ret[#ret + 1] = k.." = "..v
local rope = {}
local write
do
-- Keeping the length of the table as a local variable is *much*
-- faster than invoking the length operator.
-- See https://gitspartv.github.io/LuaJIT-Benchmarks/#test12.
local i = 0
function write(str)
i = i + 1
rope[i] = str
end
end
nested[o] = nil
if indent ~= "" then
local indent_str = "\n"..string.rep(indent, level)
local end_indent_str = "\n"..string.rep(indent, level - 1)
return string.format("{%s%s%s}",
indent_str,
table.concat(ret, ","..indent_str),
end_indent_str)
local n_refs = {}
local function count_refs(val)
if type(val) ~= "table" then
return
end
return "{"..table.concat(ret, ", ").."}"
local tbl = val
if n_refs[tbl] then
n_refs[tbl] = n_refs[tbl] + 1
return
end
n_refs[tbl] = 1
for k, v in pairs(tbl) do
count_refs(k)
count_refs(v)
end
end
count_refs(value)
local refs = {}
local cur_ref = 1
local function write_value(val, level)
if type(val) ~= "table" then
write(basic_dump(val))
return
end
local tbl = val
if refs[tbl] then
write(refs[tbl])
return
end
if n_refs[val] > 1 then
refs[val] = ("getref(%d)"):format(cur_ref)
write(("setref(%d)"):format(cur_ref))
cur_ref = cur_ref + 1
end
write("{")
if next(tbl) == nil then
write("}")
return
end
write(newline)
local function write_entry(k, v)
write(indent:rep(level))
write("[")
write_value(k, level + 1)
write("] = ")
write_value(v, level + 1)
write(",")
write(newline)
end
local keys = {string = {}, number = {}}
for k in pairs(tbl) do
local t = type(k)
if keys[t] then
table.insert(keys[t], k)
end
end
-- Write string-keyed entries
table.sort(keys.string)
for _, k in ipairs(keys.string) do
local v = val[k]
if is_valid_identifier(k) then
write(indent:rep(level))
write(k)
write(" = ")
write_value(v, level + 1)
write(",")
write(newline)
else
write_entry(k, v)
end
end
-- Write number-keyed entries
local len = 0
for i in ipairs(tbl) do
len = i
end
if #keys.number == len then -- table is a list
for _, v in ipairs(tbl) do
write(indent:rep(level))
write_value(v, level + 1)
write(",")
write(newline)
end
else -- table harbors arbitrary number keys
table.sort(keys.number)
for _, k in ipairs(keys.number) do
write_entry(k, tbl[k])
end
end
-- Write all remaining entries
for k, v in pairs(val) do
if not keys[type(k)] then
write_entry(k, v)
end
end
write(indent:rep(level - 1))
write("}")
end
write_value(value, 1)
return table.concat(rope)
end
--------------------------------------------------------------------------------
@ -555,6 +634,10 @@ if core.gettext then -- for client and mainmenu
function fgettext(text, ...)
return core.formspec_escape(fgettext_ne(text, ...))
end
function hgettext(text, ...)
return core.hypertext_escape(fgettext_ne(text, ...))
end
end
local ESCAPE_CHAR = string.char(0x1b)

View file

@ -190,11 +190,41 @@ local function serialize(value, write)
dump(value)
end
-- Whether `value` recursively contains a function
local function contains_function(value)
local seen = {}
local function check(val)
if type(val) == "function" then
return true
end
if type(val) == "table" then
if seen[val] then
return false
end
seen[val] = true
for k, v in pairs(val) do
if check(k) or check(v) then
return true
end
end
end
return false
end
return check(value)
end
function core.serialize(value)
if contains_function(value) then
core.log("deprecated", "Support for dumping functions in `core.serialize` is deprecated.")
end
local rope = {}
-- Keeping the length of the table as a local variable is *much*
-- faster than invoking the length operator.
-- See https://gitspartv.github.io/LuaJIT-Benchmarks/#test12.
local i = 0
serialize(value, function(text)
-- Faster than table.insert(rope, text) on PUC Lua 5.1
rope[#rope + 1] = text
i = i + 1
rope[i] = text
end)
return table_concat(rope)
end

View file

@ -518,7 +518,7 @@ local function get_formspec(dialogdata)
("button[0,%f;%f,0.8;back;%s]"):format(
tabsize.height + 0.2, back_w,
INIT == "pause_menu" and fgettext("Exit") or fgettext("Back")),
fgettext("Back")),
("box[%f,%f;%f,0.8;#0000008C]"):format(
back_w + 0.2, tabsize.height + 0.2, checkbox_w),
@ -778,11 +778,11 @@ end
if INIT == "mainmenu" then
function create_settings_dlg()
function create_settings_dlg(page_id)
load()
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
dlg.data.page_id = update_filtered_pages("")
dlg.data.page_id = page_id or update_filtered_pages("")
return dlg
end

View file

@ -61,7 +61,7 @@ local function create_minetest_conf_example(settings)
end
end
if entry.type == "key" then
local line = "See https://github.com/luanti-org/luanti/blob/master/irr/include/Keycodes.h"
local line = "See https://docs.luanti.org/for-players/controls/"
insert(result, "# " .. line .. "\n")
end
insert(result, "# type: " .. entry.type)
@ -102,7 +102,7 @@ end
local translation_file_header = [[
// This file is automatically generated
// It contains a bunch of fake gettext calls, to tell xgettext about the strings in config files
// To update it, refer to the bottom of builtin/mainmenu/dlg_settings_advanced.lua
// To update it, refer to the bottom of builtin/common/settings/init.lua
fake_function() {]]
@ -110,15 +110,15 @@ local function create_translation_file(settings)
local result = { translation_file_header }
for _, entry in ipairs(settings) do
if entry.type == "category" then
insert(result, sprintf("\tgettext(%q);", entry.name))
insert(result, sprintf("\t/* xgettext:no-c-format */ gettext(%q);", entry.name))
else
if entry.readable_name then
insert(result, sprintf("\tgettext(%q);", entry.readable_name))
insert(result, sprintf("\t/* xgettext:no-c-format */ gettext(%q);", entry.readable_name))
end
if entry.comment ~= "" then
local comment_escaped = entry.comment:gsub("\n", "\\n")
comment_escaped = comment_escaped:gsub("\"", "\\\"")
insert(result, "\tgettext(\"" .. comment_escaped .. "\");")
insert(result, "\t/* xgettext:no-c-format */ gettext(\"" .. comment_escaped .. "\");")
end
end
end

View file

@ -472,8 +472,6 @@ function settingtypes.parse_config_file(read_all, parse_mods)
-- TODO: Support game/mod settings in the pause menu too
-- Note that this will need to work different from how it's done in the
-- mainmenu:
-- * ~~Only if in singleplayer / on local server, not on remote servers~~
-- (done now: context annotations)
-- * Only show settings for the active game and mods
-- (add API function to get them, can return nil if on a remote server)
-- (names are probably not enough, will need paths for uniqueness)

View file

@ -19,6 +19,7 @@ function meta:__newindex(name, value)
return
end
local info = getinfo(2, "Sl")
if info ~= nil then
local desc = ("%s:%d"):format(info.short_src, info.currentline)
local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name)
if not warned[warn_key] and info.what ~= "main" and info.what ~= "C" then
@ -26,6 +27,7 @@ function meta:__newindex(name, value)
:format(name, desc))
warned[warn_key] = true
end
end
declared[name] = true
end
@ -35,6 +37,9 @@ function meta:__index(name)
return
end
local info = getinfo(2, "Sl")
if info == nil then
return
end
local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name)
if not warned[warn_key] and info.what ~= "C" then
core.log("warning", ("Undeclared global variable %q accessed at %s:%s")

View file

@ -230,3 +230,124 @@ describe("math", function()
assert.equal(0, math.round(-0.49999999999999994))
end)
end)
describe("dump", function()
local function test_expression(expr)
local chunk = assert(loadstring("return " .. expr))
local refs = {}
setfenv(chunk, {
setref = function(id)
refs[id] = {}
return function(fields)
for k, v in pairs(fields) do
refs[id][k] = v
end
return refs[id]
end
end,
getref = function(id)
return assert(refs[id])
end,
})
assert.equal(expr, dump(chunk()))
end
it("nil", function()
test_expression("nil")
end)
it("booleans", function()
test_expression("false")
test_expression("true")
end)
describe("numbers", function()
it("formats integers nicely", function()
test_expression("42")
end)
it("avoids misleading rounding", function()
test_expression("0.3")
assert.equal("0.30000000000000004", dump(0.1 + 0.2))
end)
end)
it("strings", function()
test_expression('"hello world"')
test_expression([["hello \"world\""]])
end)
describe("tables", function()
it("empty", function()
test_expression("{}")
end)
it("lists", function()
test_expression([[
{
false,
true,
"foo",
1,
2,
}]])
end)
it("number keys", function()
test_expression([[
{
[0.5] = false,
[1.5] = true,
[2.5] = "foo",
}]])
end)
it("dicts", function()
test_expression([[{
a = 1,
b = 2,
c = 3,
}]])
end)
it("mixed", function()
test_expression([[{
a = 1,
b = 2,
c = 3,
["d e"] = true,
"foo",
"bar",
}]])
end)
it("nested", function()
test_expression([[{
a = {
1,
{},
},
b = "foo",
c = {
[0.5] = 0.1,
[1.5] = 0.2,
},
}]])
end)
it("circular references", function()
test_expression([[setref(1){
child = {
parent = getref(1),
},
other_child = {
parent = getref(1),
},
}]])
end)
it("supports variable indent", function()
assert.equal('{1,2,3,{foo = "bar",},}', dump({1, 2, 3, {foo = "bar"}}, ""))
assert.equal('{\n "x",\n "y",\n}', dump({"x", "y"}, " "))
end)
end)
end)

View file

@ -93,7 +93,16 @@ describe("serialize", function()
assert_preserves(test_in)
end)
it("strips functions in safe mode", function()
describe("safe mode", function()
setup(function()
assert(not core.log)
-- logging a deprecation warning will be attempted
function core.log() end
end)
teardown(function()
core.log = nil
end)
it("functions are stripped", function()
local test_in = {
func = function(a, b)
error("test")
@ -109,6 +118,25 @@ describe("serialize", function()
assert.is_nil(test_out.func)
assert.equals(test_out.foo, "bar")
end)
end)
describe("deprecation warnings", function()
before_each(function()
assert(not core.log)
core.log = spy.new(function(level)
assert(level == "deprecated")
end)
end)
after_each(function()
core.log = nil
end)
it("dumping functions", function()
local t = {f = function() end, g = function() end}
t.t = t
core.serialize(t)
assert.spy(core.log).was.called(1) -- should have been called exactly *once*
end)
end)
it("vectors work", function()
local v = vector.new(1, 2, 3)

View file

@ -166,6 +166,10 @@ end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
core.button_handler = function(fields)
if fields["try_quit"] and not fields["key_enter"] then
core.event_handler("MenuQuit")
return
end
if fields["btn_reconnect_yes"] then
gamedata.reconnect_requested = false
gamedata.errormessage = nil

View file

@ -46,6 +46,7 @@ core.features = {
biome_weights = true,
particle_blend_clip = true,
remove_item_match_meta = true,
httpfetch_additional_methods = true,
}
function core.has_feature(arg)

View file

@ -21,7 +21,6 @@ function check_cache_age(key, max_age)
end
function core.on_before_close()
-- called before the menu is closed, either exit or to join a game
cache_settings:write()
end

View file

@ -170,14 +170,16 @@ function contentdb.get_package_by_id(id)
end
function contentdb.calculate_package_id(type, author, name)
local id = author:lower() .. "/"
local function strip_game_suffix(type, name)
if (type == nil or type == "game") and #name > 5 and name:sub(#name - 4) == "_game" then
id = id .. name:sub(1, #name - 5)
return name:sub(1, #name - 5)
else
id = id .. name
return name
end
return id
end
function contentdb.calculate_package_id(type, author, name)
return author:lower() .. "/" .. strip_game_suffix(type, name)
end
@ -427,7 +429,7 @@ function contentdb.set_packages_from_api(packages)
-- We currently don't support name changing
local suffix = "/" .. package.name
if alias:sub(-#suffix) == suffix then
contentdb.aliases[alias:lower()] = package.id
contentdb.aliases[strip_game_suffix(packages.type, alias:lower())] = package.id
end
end
end

View file

@ -47,22 +47,20 @@
],
"#": "For updating active/previous contributors, see the script in ./util/gather_git_credits.py",
"contributors": [
"JosiahWI",
"Erich Schubert",
"wrrrzr",
"1F616EMO",
"red-001 <red-001@outlook.ie>",
"veprogames",
"paradust7",
"AFCMS",
"siliconsniffer",
"Wuzzy",
"Zemtzov7"
"JosiahWI",
"veprogames",
"Miguel P.L",
"AFCMS"
],
"previous_contributors": [
"Ælla Chiana Moskopp (erle) <erle@dieweltistgarnichtso.net> [Logo]",
"numzero",
"red-001 <red-001@outlook.ie>",
"Giuseppe Bilotta",
"HybridDog",
"ClobberXD",
"Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
"MirceaKitsune <mirceakitsune@gmail.com>",
@ -75,6 +73,7 @@
"stujones11",
"Rogier <rogier777@gmail.com>",
"Gregory Currie (gregorycu)",
"paradust7",
"JacobF",
"Jeija <jeija@mesecons.net>"
]

View file

@ -0,0 +1,108 @@
-- Luanti
-- SPDX-License-Identifier: LGPL-2.1-or-later
-- Modified based on dlg_reinstall_mtg.lua
-- Note that this is only needed for migrating from <5.11 to 5.12.
local doc_url = "https://docs.luanti.org/for-players/controls/"
local SETTING_NAME = "no_keycode_migration_warning"
local function get_formspec(dialogdata)
local markup = table.concat({
"<big>" .. hgettext("Keybindings changed") .. "</big>",
hgettext("The input handling system was reworked in Luanti 5.12.0."),
hgettext("As a result, your keybindings may have been changed."),
hgettext("Check out the key settings or refer to the documentation:"),
("<action name='doc_url'><style color='cyan' hovercolor='orangered'>%s</style></action>"):format(doc_url),
}, "\n")
return table.concat({
"formspec_version[6]",
"size[12,7]",
"hypertext[0.5,0.5;11,4.7;text;", core.formspec_escape(markup), "]",
"container[0.5,5.7]",
"button[0,0;4,0.8;dismiss;", fgettext("Close"), "]",
"button[4.5,0;6.5,0.8;reconfigure;", fgettext("Open settings"), "]",
"container_end[]",
})
end
local function close_dialog(this)
cache_settings:set_bool(SETTING_NAME, true)
this:delete()
end
local function buttonhandler(this, fields)
if fields.reconfigure then
close_dialog(this)
local maintab = ui.find_by_name("maintab")
local dlg = create_settings_dlg("controls_keyboard_and_mouse")
dlg:set_parent(maintab)
maintab:hide()
dlg:show()
return true
end
if fields.dismiss then
close_dialog(this)
return true
end
if fields.text == "action:doc_url" then
core.open_url(doc_url)
end
end
local function eventhandler(event)
if event == "DialogShow" then
mm_game_theme.set_engine()
return true
elseif event == "MenuQuit" then
-- Don't allow closing the dialog with ESC, but still allow exiting
-- Luanti
core.close()
return true
end
return false
end
local function create_rebind_keys_dlg()
local dlg = dialog_create("dlg_rebind_keys", get_formspec,
buttonhandler, eventhandler)
return dlg
end
function migrate_keybindings()
-- Show migration dialog if the user upgraded from an earlier version
-- and this has not yet been shown before, *or* if keys settings had to be changed
if core.is_first_run then
cache_settings:set_bool(SETTING_NAME, true)
end
local has_migration = not cache_settings:get_bool(SETTING_NAME)
-- normalize all existing key settings, this converts them from KEY_KEY_C to SYSTEM_SCANCODE_6
local settings = core.settings:to_table()
for name, value in pairs(settings) do
if name:match("^keymap_") then
local normalized = core.normalize_keycode(value)
if value ~= normalized then
has_migration = true
core.settings:set(name, normalized)
end
end
end
if not has_migration then
return
end
local maintab = ui.find_by_name("maintab")
local dlg = create_rebind_keys_dlg()
dlg:set_parent(maintab)
maintab:hide()
dlg:show()
ui.update()
end

View file

@ -54,10 +54,10 @@ end
local function get_formspec(dialogdata)
local markup = table.concat({
"<big>", fgettext("Minetest Game is no longer installed by default"), "</big>\n",
fgettext("For a long time, Luanti shipped with a default game called \"Minetest Game\". " ..
"<big>", hgettext("Minetest Game is no longer installed by default"), "</big>\n",
hgettext("For a long time, Luanti shipped with a default game called \"Minetest Game\". " ..
"Since version 5.8.0, Luanti ships without a default game."), "\n",
fgettext("If you want to continue playing in your Minetest Game worlds, you need to reinstall Minetest Game."),
hgettext("If you want to continue playing in your Minetest Game worlds, you need to reinstall Minetest Game."),
})
return table.concat({

View file

@ -35,6 +35,7 @@ dofile(menupath .. DIR_DELIM .. "dlg_register.lua")
dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
dofile(menupath .. DIR_DELIM .. "dlg_version_info.lua")
dofile(menupath .. DIR_DELIM .. "dlg_reinstall_mtg.lua")
dofile(menupath .. DIR_DELIM .. "dlg_rebind_keys.lua")
dofile(menupath .. DIR_DELIM .. "dlg_clients_list.lua")
dofile(menupath .. DIR_DELIM .. "dlg_server_list_mods.lua")
@ -112,6 +113,7 @@ local function init_globals()
ui.update()
check_reinstall_mtg()
migrate_keybindings()
check_new_version()
end

View file

@ -183,24 +183,24 @@ invert_hotbar_mouse_wheel (Hotbar: Invert mouse wheel direction) bool false
[**Keybindings]
# Key for moving the player forward.
keymap_forward (Move forward) key KEY_KEY_W
keymap_forward (Move forward) key SYSTEM_SCANCODE_26
# Key for moving the player backward.
# Will also disable autoforward, when active.
keymap_backward (Move backward) key KEY_KEY_S
keymap_backward (Move backward) key SYSTEM_SCANCODE_22
# Key for moving the player left.
keymap_left (Move left) key KEY_KEY_A
keymap_left (Move left) key SYSTEM_SCANCODE_4
# Key for moving the player right.
keymap_right (Move right) key KEY_KEY_D
keymap_right (Move right) key SYSTEM_SCANCODE_7
# Key for jumping.
keymap_jump (Jump) key KEY_SPACE
keymap_jump (Jump) key SYSTEM_SCANCODE_44
# Key for sneaking.
# Also used for climbing down and descending in water if aux1_descends is disabled.
keymap_sneak (Sneak) key KEY_LSHIFT
keymap_sneak (Sneak) key SYSTEM_SCANCODE_225
# Key for digging, punching or using something.
# (Note: The actual meaning might vary on a per-game basis.)
@ -211,43 +211,43 @@ keymap_dig (Dig/punch/use) key KEY_LBUTTON
keymap_place (Place/use) key KEY_RBUTTON
# Key for opening the inventory.
keymap_inventory (Open inventory) key KEY_KEY_I
keymap_inventory (Open inventory) key SYSTEM_SCANCODE_12
# Key for moving fast in fast mode.
keymap_aux1 (Aux1) key KEY_KEY_E
keymap_aux1 (Aux1) key SYSTEM_SCANCODE_8
# Key for opening the chat window.
keymap_chat (Open chat) key KEY_KEY_T
keymap_chat (Open chat) key SYSTEM_SCANCODE_23
# Key for opening the chat window to type commands.
keymap_cmd (Command) key /
keymap_cmd (Command) key SYSTEM_SCANCODE_56
# Key for opening the chat window to type local commands.
keymap_cmd_local (Local command) key .
keymap_cmd_local (Local command) key SYSTEM_SCANCODE_55
# Key for toggling unlimited view range.
keymap_rangeselect (Range select) key
# Key for toggling flying.
keymap_freemove (Toggle fly) key KEY_KEY_K
keymap_freemove (Toggle fly) key SYSTEM_SCANCODE_14
# Key for toggling pitch move mode.
keymap_pitchmove (Toggle pitchmove) key
# Key for toggling fast mode.
keymap_fastmove (Toggle fast) key KEY_KEY_J
keymap_fastmove (Toggle fast) key SYSTEM_SCANCODE_13
# Key for toggling noclip mode.
keymap_noclip (Toggle noclip) key KEY_KEY_H
keymap_noclip (Toggle noclip) key SYSTEM_SCANCODE_11
# Key for selecting the next item in the hotbar.
keymap_hotbar_next (Hotbar: select next item) key KEY_KEY_N
keymap_hotbar_next (Hotbar: select next item) key SYSTEM_SCANCODE_17
# Key for selecting the previous item in the hotbar.
keymap_hotbar_previous (Hotbar: select previous item) key KEY_KEY_B
keymap_hotbar_previous (Hotbar: select previous item) key SYSTEM_SCANCODE_5
# Key for muting the game.
keymap_mute (Mute) key KEY_KEY_M
keymap_mute (Mute) key SYSTEM_SCANCODE_16
# Key for increasing the volume.
keymap_increase_volume (Increase volume) key
@ -262,79 +262,79 @@ keymap_autoforward (Toggle automatic forward) key
keymap_cinematic (Toggle cinematic mode) key
# Key for toggling display of minimap.
keymap_minimap (Toggle minimap) key KEY_KEY_V
keymap_minimap (Toggle minimap) key SYSTEM_SCANCODE_25
# Key for taking screenshots.
keymap_screenshot (Screenshot) key KEY_F12
keymap_screenshot (Screenshot) key SYSTEM_SCANCODE_69
# Key for toggling fullscreen mode.
keymap_fullscreen (Toggle fullscreen) key KEY_F11
keymap_fullscreen (Toggle fullscreen) key SYSTEM_SCANCODE_68
# Key for dropping the currently selected item.
keymap_drop (Drop item) key KEY_KEY_Q
keymap_drop (Drop item) key SYSTEM_SCANCODE_20
# Key to use view zoom when possible.
keymap_zoom (Zoom) key KEY_KEY_Z
keymap_zoom (Zoom) key SYSTEM_SCANCODE_29
# Key for toggling the display of the HUD.
keymap_toggle_hud (Toggle HUD) key KEY_F1
keymap_toggle_hud (Toggle HUD) key SYSTEM_SCANCODE_58
# Key for toggling the display of chat.
keymap_toggle_chat (Toggle chat log) key KEY_F2
keymap_toggle_chat (Toggle chat log) key SYSTEM_SCANCODE_59
# Key for toggling the display of the large chat console.
keymap_console (Large chat console) key KEY_F10
keymap_console (Large chat console) key SYSTEM_SCANCODE_67
# Key for toggling the display of fog.
keymap_toggle_fog (Toggle fog) key KEY_F3
keymap_toggle_fog (Toggle fog) key SYSTEM_SCANCODE_60
# Key for toggling the display of debug info.
keymap_toggle_debug (Toggle debug info) key KEY_F5
keymap_toggle_debug (Toggle debug info) key SYSTEM_SCANCODE_62
# Key for toggling the display of the profiler. Used for development.
keymap_toggle_profiler (Toggle profiler) key KEY_F6
keymap_toggle_profiler (Toggle profiler) key SYSTEM_SCANCODE_63
# Key for toggling the display of mapblock boundaries.
keymap_toggle_block_bounds (Toggle block bounds) key
# Key for switching between first- and third-person camera.
keymap_camera_mode (Toggle camera mode) key KEY_KEY_C
keymap_camera_mode (Toggle camera mode) key SYSTEM_SCANCODE_6
# Key for increasing the viewing range.
keymap_increase_viewing_range_min (Increase view range) key +
keymap_increase_viewing_range_min (Increase view range) key SYSTEM_SCANCODE_46
# Key for decreasing the viewing range.
keymap_decrease_viewing_range_min (Decrease view range) key -
keymap_decrease_viewing_range_min (Decrease view range) key SYSTEM_SCANCODE_45
# Key for selecting the first hotbar slot.
keymap_slot1 (Hotbar slot 1) key KEY_KEY_1
keymap_slot1 (Hotbar slot 1) key SYSTEM_SCANCODE_30
# Key for selecting the second hotbar slot.
keymap_slot2 (Hotbar slot 2) key KEY_KEY_2
keymap_slot2 (Hotbar slot 2) key SYSTEM_SCANCODE_31
# Key for selecting the third hotbar slot.
keymap_slot3 (Hotbar slot 3) key KEY_KEY_3
keymap_slot3 (Hotbar slot 3) key SYSTEM_SCANCODE_32
# Key for selecting the fourth hotbar slot.
keymap_slot4 (Hotbar slot 4) key KEY_KEY_4
keymap_slot4 (Hotbar slot 4) key SYSTEM_SCANCODE_33
# Key for selecting the fifth hotbar slot.
keymap_slot5 (Hotbar slot 5) key KEY_KEY_5
keymap_slot5 (Hotbar slot 5) key SYSTEM_SCANCODE_34
# Key for selecting the sixth hotbar slot.
keymap_slot6 (Hotbar slot 6) key KEY_KEY_6
keymap_slot6 (Hotbar slot 6) key SYSTEM_SCANCODE_35
# Key for selecting the seventh hotbar slot.
keymap_slot7 (Hotbar slot 7) key KEY_KEY_7
keymap_slot7 (Hotbar slot 7) key SYSTEM_SCANCODE_36
# Key for selecting the eighth hotbar slot.
keymap_slot8 (Hotbar slot 8) key KEY_KEY_8
keymap_slot8 (Hotbar slot 8) key SYSTEM_SCANCODE_37
# Key for selecting the ninth hotbar slot.
keymap_slot9 (Hotbar slot 9) key KEY_KEY_9
keymap_slot9 (Hotbar slot 9) key SYSTEM_SCANCODE_38
# Key for selecting the tenth hotbar slot.
keymap_slot10 (Hotbar slot 10) key KEY_KEY_0
keymap_slot10 (Hotbar slot 10) key SYSTEM_SCANCODE_39
# Key for selecting the 11th hotbar slot.
keymap_slot11 (Hotbar slot 11) key
@ -872,11 +872,6 @@ enable_volumetric_lighting (Volumetric lighting) bool false
# Requires: enable_dynamic_shadows
enable_translucent_foliage (Translucent foliage) bool false
# Apply specular shading to nodes.
#
# Requires: enable_dynamic_shadows
enable_node_specular (Node specular) bool false
# When enabled, liquid reflections are simulated.
#
# Requires: enable_waving_water, enable_dynamic_shadows
@ -2241,9 +2236,10 @@ lighting_boost_spread (Light curve boost spread) float 0.2 0.0 0.4
enable_ipv6 (IPv6) [common] bool true
# Prometheus listener address.
# If Luanti is compiled with ENABLE_PROMETHEUS option enabled,
# enable metrics listener for Prometheus on that address.
# Metrics can be fetched on http://127.0.0.1:30000/metrics
# If Luanti is compiled with Prometheus support, this setting
# enables the metrics listener for Prometheus on that address.
# By default you can fetch metrics from http://127.0.0.1:30000/metrics.
# An empty value disables the metrics listener.
prometheus_listener_address (Prometheus listener address) [server] string 127.0.0.1:30000
# Maximum size of the client's outgoing chat queue.

View file

@ -23,3 +23,6 @@ This list is largely advisory and items may be reevaluated once the time comes.
* stop reading initial properties from bare entity def
* change particle default blend mode to `clip`
* remove built-in knockback and related functions entirely
* remove `safe` parameter from `core.serialize`, always enforce `safe = true`.
possibly error when `loadstring` calls are encountered in `core.deserialize`.
* introduce strict type checking for all instances of `v3s16` / `v3f` read from Lua

View file

@ -1,12 +1,15 @@
Luanti Lua Client Modding API Reference 5.12.0
Luanti Lua Client Modding API Reference 5.13.0
==============================================
**WARNING**: if you're looking for the `minetest` namespace (e.g. `minetest.something`),
it's now called `core` due to the renaming of Luanti (formerly Minetest).
`minetest` will keep existing as an alias, so that old code won't break.
Note that `core` has already existed since version 0.4.10, so you can use it
safely without breaking backwards compatibility.
* More information at <http://www.luanti.org/>
* Developer Wiki: <https://dev.luanti.org/>
* Additional documentation: <https://docs.luanti.org/>
Introduction
------------

View file

@ -23,6 +23,7 @@ General options and their default values:
PRECOMPILE_HEADERS=FALSE - Precompile some headers (experimental; requires CMake 3.16 or later)
PRECOMPILED_HEADERS_PATH= - Path to a file listing all headers to precompile (default points to src/precompiled_headers.txt)
USE_SDL2=TRUE - Build with SDL2; Enables IrrlichtMt device SDL2
USE_SDL2_STATIC=TRUE - Links with SDL2::SDL2-static instead of SDL2::SDL2
ENABLE_CURL=ON - Build with cURL; Enables use of online mod repo, public serverlist and remote media fetching via http
ENABLE_CURSES=ON - Build with (n)curses; Enables a server side terminal (command line option: --terminal)
ENABLE_GETTEXT=ON - Build with Gettext; Allows using translations

View file

@ -90,6 +90,10 @@ Run it:
./bin/luanti
Run unit tests:
./bin/luanti --run-unittests
- Use `cmake . -LH` to see all CMake options and their current state.
- If you want to install it system-wide (or are making a distribution package),
you will want to use `-DRUN_IN_PLACE=FALSE`.

View file

@ -5,7 +5,7 @@
The long-term roadmaps, aims, and guiding philosophies are set out using the
following documents:
* [What is Minetest?](http://c55.me/blog/?p=1491)
* [What is Minetest? (archived)](https://web.archive.org/web/20160328054721/http://c55.me/blog/?p=1491)
* [celeron55's roadmap](https://forum.luanti.org/viewtopic.php?t=9177)
* [celeron55's comment in "A clear mission statement for Minetest is missing"](https://github.com/luanti-org/luanti/issues/3476#issuecomment-167399287)
* [Core developer to-do/wish lists](https://forum.luanti.org/viewforum.php?f=7)

View file

@ -5,8 +5,11 @@ Luanti Lua Modding API Reference
it's now called `core` due to the renaming of Luanti (formerly Minetest).
`minetest` will keep existing as an alias, so that old code won't break.
Note that `core` has already existed since version 0.4.10, so you can use it
safely without breaking backwards compatibility.
* More information at <http://www.luanti.org/>
* Developer Wiki: <https://dev.luanti.org/>
* Additional documentation: <https://docs.luanti.org/>
* (Unofficial) Minetest Modding Book by rubenwardy: <https://rubenwardy.com/minetest_modding_book/>
* Modding tools: <https://github.com/luanti-org/modtools>
@ -4162,9 +4165,11 @@ Helper functions
* `obj`: arbitrary variable
* `name`: string, default: `"_"`
* `dumped`: table, default: `{}`
* `dump(obj, dumped)`: returns a string which makes `obj` human-readable
* `obj`: arbitrary variable
* `dumped`: table, default: `{}`
* `dump(value, indent)`: returns a string which makes `value` human-readable
* `value`: arbitrary value
* Circular references are supported. Every table is dumped only once.
* `indent`: string to use for indentation, default: `"\t"`
* `""` disables indentation & line breaks (compact output)
* `math.hypot(x, y)`
* Get the hypotenuse of a triangle with legs x and y.
Useful for distance calculation.
@ -4579,11 +4584,13 @@ and offset the noise variation.
The final fractal value noise variation is created as follows:
```
noise = offset + scale * (octave1 +
octave2 * persistence +
octave3 * persistence ^ 2 +
octave4 * persistence ^ 3 +
...)
```
Noise Parameters
----------------
@ -4697,11 +4704,13 @@ with restraint.
The absolute value of each octave's noise variation is used when combining the
octaves. The final value noise variation is created as follows:
```
noise = offset + scale * (abs(octave1) +
abs(octave2) * persistence +
abs(octave3) * persistence ^ 2 +
abs(octave4) * persistence ^ 3 +
...)
```
### Format example
@ -4996,7 +5005,8 @@ A VoxelManip object can be created any time using either:
If the optional position parameters are present for either of these routines,
the specified region will be pre-loaded into the VoxelManip object on creation.
Otherwise, the area of map you wish to manipulate must first be loaded into the
VoxelManip object using `VoxelManip:read_from_map()`.
VoxelManip object using `VoxelManip:read_from_map()`, or an empty one created
with `VoxelManip:initialize()`.
Note that `VoxelManip:read_from_map()` returns two position vectors. The region
formed by these positions indicate the minimum and maximum (respectively)
@ -5007,14 +5017,14 @@ be queried any time after loading map data with `VoxelManip:get_emerged_area()`.
Now that the VoxelManip object is populated with map data, your mod can fetch a
copy of this data using either of two methods. `VoxelManip:get_node_at()`,
which retrieves an individual node in a MapNode formatted table at the position
requested is the simplest method to use, but also the slowest.
requested. This is the simplest method to use, but also the slowest.
Nodes in a VoxelManip object may also be read in bulk to a flat array table
using:
* `VoxelManip:get_data()` for node content (in Content ID form, see section
[Content IDs]),
* `VoxelManip:get_light_data()` for node light levels, and
* `VoxelManip:get_light_data()` for node param (usually light levels), and
* `VoxelManip:get_param2_data()` for the node type-dependent "param2" values.
See section [Flat array format] for more details.
@ -5029,17 +5039,16 @@ internal state unless otherwise explicitly stated.
Once the bulk data has been edited to your liking, the internal VoxelManip
state can be set using:
* `VoxelManip:set_data()` for node content (in Content ID form, see section
[Content IDs]),
* `VoxelManip:set_light_data()` for node light levels, and
* `VoxelManip:set_param2_data()` for the node type-dependent `param2` values.
* `VoxelManip:set_data()` or
* `VoxelManip:set_light_data()` or
* `VoxelManip:set_param2_data()`
The parameter to each of the above three functions can use any table at all in
the same flat array format as produced by `get_data()` etc. and is not required
to be a table retrieved from `get_data()`.
Once the internal VoxelManip state has been modified to your liking, the
changes can be committed back to the map by calling `VoxelManip:write_to_map()`
changes can be committed back to the map by calling `VoxelManip:write_to_map()`.
### Flat array format
@ -5171,15 +5180,22 @@ inside the VoxelManip.
Methods
-------
* `read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object
* `read_from_map(p1, p2)`: Loads a part of the map into the VoxelManip object
containing the region formed by `p1` and `p2`.
* returns actual emerged `pmin`, actual emerged `pmax`
* returns actual emerged `pmin`, actual emerged `pmax` (MapBlock-aligned)
* Note that calling this multiple times will *add* to the area loaded in the
VoxelManip, and not reset it.
* `initialize(p1, p2, [node])`: Clears and resizes the VoxelManip object to
comprise the region formed by `p1` and `p2`.
* **No data** is read from the map, so you can use this to treat `VoxelManip`
objects as general containers of node data.
* `node`: if present the data will be filled with this node; if not it will
be uninitialized
* returns actual emerged `pmin`, actual emerged `pmax` (MapBlock-aligned)
* (introduced in 5.13.0)
* `write_to_map([light])`: Writes the data loaded from the `VoxelManip` back to
the map.
* **important**: data must be set using `VoxelManip:set_data()` before
calling this.
* **important**: you should call `set_data()` before this, or nothing will change.
* if `light` is true, then lighting is automatically recalculated.
The default value is true.
If `light` is false, no light calculations happen, and you should correct
@ -5240,6 +5256,15 @@ Methods
where the engine will keep the map and the VM in sync automatically.
* Note: this doesn't do what you think it does and is subject to removal. Don't use it!
* `get_emerged_area()`: Returns actual emerged minimum and maximum positions.
* "Emerged" does not imply that this region was actually loaded from the map,
if `initialize()` has been used.
* `close()`: Frees the data buffers associated with the VoxelManip object.
It will become empty.
* Since Lua's garbage collector is not aware of the potentially significant
memory behind a VoxelManip, frequent VoxelManip usage can cause the server to
run out of RAM. Therefore it's recommend to call this method once you're done
with the VoxelManip.
* (introduced in 5.13.0)
`VoxelArea`
-----------
@ -5595,7 +5620,6 @@ provided by the Luanti engine and can be used by mods:
* `fly`: can use "fly mode" to move freely above the ground without falling.
* `noclip`: can use "noclip mode" to fly through solid nodes (e.g. walls).
* `teleport`: can use `/teleport` command to move to any point in the world.
* `creative`: can access creative inventory.
* `bring`: can teleport other players to oneself.
* `give`: can use `/give` and `/giveme` commands to give any item
in the game to oneself or others.
@ -5781,6 +5805,8 @@ Utilities
particle_blend_clip = true,
-- The `match_meta` optional parameter is available for `InvRef:remove_item()` (5.12.0)
remove_item_match_meta = true,
-- The HTTP API supports the HEAD and PATCH methods (5.12.0)
httpfetch_additional_methods = true,
}
```
@ -6559,13 +6585,10 @@ Environment access
* The actual seed used is the noiseparams seed plus the world seed.
* `core.get_value_noise(seeddiff, octaves, persistence, spread)`
* Deprecated: use `core.get_value_noise(noiseparams)` instead.
* Return world-specific value noise
* `core.get_perlin(noiseparams)`
* Deprecated: use `core.get_value_noise(noiseparams)` instead.
* Return world-specific value noise (was not Perlin noise)
* Deprecated: renamed to `core.get_value_noise` in version 5.12.0.
* `core.get_perlin(seeddiff, octaves, persistence, spread)`
* Deprecated: use `core.get_value_noise(noiseparams)` instead.
* Return world-specific value noise (was not Perlin noise)
* Deprecated: renamed to `core.get_value_noise` in version 5.12.0.
* `core.get_voxel_manip([pos1, pos2])`
* Return voxel manipulator object.
* Loads the manipulator from the map if positions are passed.
@ -7610,16 +7633,22 @@ Misc.
* Example: `write_json({10, {a = false}})`,
returns `'[10, {"a": false}]'`
* `core.serialize(table)`: returns a string
* Convert a table containing tables, strings, numbers, booleans and `nil`s
into string form readable by `core.deserialize`
* Convert a value into string form readable by `core.deserialize`.
* Supports tables, strings, numbers, booleans and `nil`.
* Support for dumping function bytecode is **deprecated**.
* Note: To obtain a human-readable representation of a value, use `dump` instead.
* Example: `serialize({foo="bar"})`, returns `'return { ["foo"] = "bar" }'`
* `core.deserialize(string[, safe])`: returns a table
* Convert a string returned by `core.serialize` into a table
* `string` is loaded in an empty sandbox environment.
* Will load functions if safe is false or omitted. Although these functions
cannot directly access the global environment, they could bypass this
restriction with maliciously crafted Lua bytecode if mod security is
disabled.
* Will load functions if `safe` is `false` or omitted.
Although these functions cannot directly access the global environment,
they could bypass this restriction with maliciously crafted Lua bytecode
if mod security is disabled.
* Will silently strip functions embedded via calls to `loadstring`
(typically bytecode dumped by `core.serialize`) if `safe` is `true`.
You should not rely on this if possible.
* Example: `core.deserialize("return loadstring('')", true)` will be `nil`.
* This function should not be used on untrusted data, regardless of the
value of `safe`. It is fine to serialize then deserialize user-provided
data, but directly providing user input to deserialize is always unsafe.
@ -8162,8 +8191,8 @@ of the `${k}` syntax in formspecs is not deprecated.
The value will be converted into a string when stored.
* `get_int(key)`: Returns `0` if key not present.
* `set_float(key, value)`
* The range for the value is system-dependent (usually 32 bits).
The value will be converted into a string when stored.
* Store a number (a 64-bit float) exactly.
* The value will be converted into a string when stored.
* `get_float(key)`: Returns `0` if key not present.
* `get_keys()`: returns a list of all keys in the metadata.
* `to_table()`:
@ -9054,78 +9083,6 @@ offering very strong randomness.
* `get_state()`: return generator state encoded in string
* `set_state(state_string)`: restore generator state from encoded string
`ValueNoise`
-------------
A value noise generator.
It can be created via `ValueNoise()` or `core.get_value_noise()`.
For legacy reasons, it can also be created via `PerlinNoise()` or `core.get_perlin()`,
but the implemented noise is not Perlin noise.
For `core.get_value_noise()`, the actual seed used is the noiseparams seed
plus the world seed, to create world-specific noise.
* `ValueNoise(noiseparams)
* `ValueNoise(seed, octaves, persistence, spread)` (Deprecated)
* `PerlinNoise(noiseparams)` (Deprecated)
* `PerlinNoise(seed, octaves, persistence, spread)` (Deprecated)
* `core.get_value_noise(noiseparams)`
* `core.get_value_noise(seeddiff, octaves, persistence, spread)` (Deprecated)
* `core.get_perlin(noiseparams)` (Deprecated)
* `core.get_perlin(seeddiff, octaves, persistence, spread)` (Deprecated)
### Methods
* `get_2d(pos)`: returns 2D noise value at `pos={x=,y=}`
* `get_3d(pos)`: returns 3D noise value at `pos={x=,y=,z=}`
`ValueNoiseMap`
----------------
A fast, bulk noise generator.
It can be created via `ValueNoiseMap(noiseparams, size)` or
`core.get_value_noise_map(noiseparams, size)`.
For legacy reasons, it can also be created via `PerlinNoiseMap(noiseparams, size)`
or `core.get_perlin_map(noiseparams, size)`, but it is not Perlin noise.
For `core.get_value_noise_map()`, the actual seed used is the noiseparams seed
plus the world seed, to create world-specific noise.
Format of `size` is `{x=dimx, y=dimy, z=dimz}`. The `z` component is omitted
for 2D noise, and it must be larger than 1 for 3D noise (otherwise
`nil` is returned).
For each of the functions with an optional `buffer` parameter: If `buffer` is
not nil, this table will be used to store the result instead of creating a new
table.
### Methods
* `get_2d_map(pos)`: returns a `<size.x>` times `<size.y>` 2D array of 2D noise
with values starting at `pos={x=,y=}`
* `get_3d_map(pos)`: returns a `<size.x>` times `<size.y>` times `<size.z>`
3D array of 3D noise with values starting at `pos={x=,y=,z=}`.
* `get_2d_map_flat(pos, buffer)`: returns a flat `<size.x * size.y>` element
array of 2D noise with values starting at `pos={x=,y=}`
* `get_3d_map_flat(pos, buffer)`: Same as `get2dMap_flat`, but 3D noise
* `calc_2d_map(pos)`: Calculates the 2d noise map starting at `pos`. The result
is stored internally.
* `calc_3d_map(pos)`: Calculates the 3d noise map starting at `pos`. The result
is stored internally.
* `get_map_slice(slice_offset, slice_size, buffer)`: In the form of an array,
returns a slice of the most recently computed noise results. The result slice
begins at coordinates `slice_offset` and takes a chunk of `slice_size`.
E.g., to grab a 2-slice high horizontal 2d plane of noise starting at buffer
offset y = 20:
`noisevals = noise:get_map_slice({y=20}, {y=2})`
It is important to note that `slice_offset` offset coordinates begin at 1,
and are relative to the starting position of the most recently calculated
noise.
To grab a single vertical column of noise starting at map coordinates
x = 1023, y=1000, z = 1000:
`noise:calc_3d_map({x=1000, y=1000, z=1000})`
`noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})`
`PlayerMetaRef`
---------------
@ -9177,14 +9134,17 @@ end
The map is loaded as the ray advances. If the map is modified after the
`Raycast` is created, the changes may or may not have an effect on the object.
It can be created via `Raycast(pos1, pos2, objects, liquids)` or
`core.raycast(pos1, pos2, objects, liquids)` where:
It can be created via `Raycast(pos1, pos2, objects, liquids, pointabilities)`
or `core.raycast(pos1, pos2, objects, liquids, pointabilities)` where:
* `pos1`: start of the ray
* `pos2`: end of the ray
* `objects`: if false, only nodes will be returned. Default is true.
* `objects`: if false, only nodes will be returned. Default is `true`.
* `liquids`: if false, liquid nodes (`liquidtype ~= "none"`) won't be
returned. Default is false.
returned. Default is `false`.
* `pointabilities`: Allows overriding the `pointable` property of
nodes and objects. Uses the same format as the `pointabilities` property
of item definitions. Default is `nil`.
### Limitations
@ -9290,7 +9250,7 @@ The settings have the format `key = value`. Example:
`StorageRef`
------------
Mod metadata: per mod metadata, saved automatically.
Mod metadata: per mod and world metadata, saved automatically.
Can be obtained via `core.get_mod_storage()` during load time.
WARNING: This storage backend is incapable of saving raw binary data due
@ -9300,6 +9260,81 @@ to restrictions of JSON.
* All methods in MetaDataRef
`ValueNoise`
-------------
A value noise generator.
It can be created via `ValueNoise()` or `core.get_value_noise()`.
For `core.get_value_noise()`, the actual seed used is the noiseparams seed
plus the world seed, to create world-specific noise.
* `ValueNoise(noiseparams)`
* `ValueNoise(seed, octaves, persistence, spread)` (deprecated)
* `core.get_value_noise(noiseparams)`
* `core.get_value_noise(seeddiff, octaves, persistence, spread)` (deprecated)
These were previously called `PerlinNoise()` and `core.get_perlin()`, but the
implemented noise was not Perlin noise. They were renamed in 5.12.0. The old
names still exist as aliases.
### Methods
* `get_2d(pos)`: returns 2D noise value at `pos={x=,y=}`
* `get_3d(pos)`: returns 3D noise value at `pos={x=,y=,z=}`
`ValueNoiseMap`
----------------
A fast, bulk noise generator.
It can be created via `ValueNoiseMap(noiseparams, size)` or
`core.get_value_noise_map(noiseparams, size)`.
For `core.get_value_noise_map()`, the actual seed used is the noiseparams seed
plus the world seed, to create world-specific noise.
These were previously called `PerlinNoiseMap()` and `core.get_perlin_map()`,
but the implemented noise was not Perlin noise. They were renamed in 5.12.0.
The old names still exist as aliases.
Format of `size` is `{x=dimx, y=dimy, z=dimz}`. The `z` component is omitted
for 2D noise, and it must be larger than 1 for 3D noise (otherwise
`nil` is returned).
For each of the functions with an optional `buffer` parameter: If `buffer` is
not nil, this table will be used to store the result instead of creating a new
table.
### Methods
* `get_2d_map(pos)`: returns a `<size.x>` times `<size.y>` 2D array of 2D noise
with values starting at `pos={x=,y=}`
* `get_3d_map(pos)`: returns a `<size.x>` times `<size.y>` times `<size.z>`
3D array of 3D noise with values starting at `pos={x=,y=,z=}`.
* `get_2d_map_flat(pos, buffer)`: returns a flat `<size.x * size.y>` element
array of 2D noise with values starting at `pos={x=,y=}`
* `get_3d_map_flat(pos, buffer)`: Same as `get2dMap_flat`, but 3D noise
* `calc_2d_map(pos)`: Calculates the 2d noise map starting at `pos`. The result
is stored internally.
* `calc_3d_map(pos)`: Calculates the 3d noise map starting at `pos`. The result
is stored internally.
* `get_map_slice(slice_offset, slice_size, buffer)`: In the form of an array,
returns a slice of the most recently computed noise results. The result slice
begins at coordinates `slice_offset` and takes a chunk of `slice_size`.
E.g., to grab a 2-slice high horizontal 2d plane of noise starting at buffer
offset `y = 20`:
```lua
noisevals = noise:get_map_slice({y=20}, {y=2})
```
It is important to note that `slice_offset` offset coordinates begin at 1,
and are relative to the starting position of the most recently calculated
noise.
To grab a single vertical column of noise starting at map coordinates
`x = 1023, y=1000, z = 1000`:
```lua
noise:calc_3d_map({x=1000, y=1000, z=1000})
noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})
```
@ -9391,7 +9426,8 @@ Player properties need to be saved manually.
-- to scale the entity along both horizontal axes.
mesh = "model.obj",
-- File name of mesh when using "mesh" visual
-- File name of mesh when using "mesh" visual.
-- For legacy reasons, this uses a 10x scale for meshes: 10 units = 1 node.
textures = {},
-- Number of required textures depends on visual:
@ -10163,6 +10199,13 @@ Used by `core.register_node`.
mesh = "",
-- File name of mesh when using "mesh" drawtype
-- The center of the node is the model origin.
-- For legacy reasons, this uses a different scale depending on the mesh:
-- 1. For glTF models: 10 units = 1 node (consistent with the scale for entities).
-- 2. For obj models: 1 unit = 1 node.
-- 3. For b3d and x models: 1 unit = 1 node if static, otherwise 10 units = 1 node.
-- Using static glTF or obj models is recommended.
-- You can use the `visual_scale` multiplier to achieve the expected scale.
selection_box = {
-- see [Node boxes] for possibilities
@ -10469,6 +10512,16 @@ table format. The accepted parameters are listed below.
Recipe input items can either be specified by item name (item count = 1)
or by group (see "Groups in crafting recipes" for details).
Only the item name (and groups) matter for matching a recipe, i.e. meta and count
are ignored.
If multiple recipes match the input of a craft grid, one of them is chosen by the
following priority rules:
* Shaped recipes are preferred over shapeless recipes, which in turn are preferred
over tool repair.
* Otherwise, recipes without groups are preferred over recipes with groups.
* Otherwise, earlier registered recipes are preferred.
The following sections describe the types and syntaxes of recipes.
@ -10488,6 +10541,10 @@ For example, for a 3x3 recipe, the `recipes` table must have
In order to craft the recipe, the players' crafting grid must
have equal or larger dimensions (both width and height).
Empty slots outside of the recipe's extents are ignored, e.g. a 3x3
recipe where only the bottom right 2x2 slots are filled is the same
as the corresponding 2x2 recipe without the empty slots.
Parameters:
* `type = "shaped"`: (optional) specifies recipe type as shaped
@ -11808,22 +11865,22 @@ Used by `HTTPApiTable.fetch` and `HTTPApiTable.fetch_async`.
```lua
{
url = "http://example.org",
url = "https://example.org",
timeout = 10,
-- Timeout for request to be completed in seconds. Default depends on engine settings.
method = "GET", "POST", "PUT" or "DELETE"
method = "GET", "HEAD", "POST", "PUT", "PATCH" or "DELETE"
-- The http method to use. Defaults to "GET".
data = "Raw request data string" OR {field1 = "data1", field2 = "data2"},
-- Data for the POST, PUT or DELETE request.
data = "Raw request data string" or {field1 = "data1", field2 = "data2"},
-- Data for the POST, PUT, PATCH or DELETE request.
-- Accepts both a string and a table. If a table is specified, encodes
-- table as x-www-form-urlencoded key-value pairs.
user_agent = "ExampleUserAgent",
-- Optional, if specified replaces the default Luanti user agent with
-- given string
-- given string.
extra_headers = { "Accept-Language: en-us", "Accept-Charset: utf-8" },
-- Optional, if specified adds additional headers to the HTTP request.
@ -11833,7 +11890,7 @@ Used by `HTTPApiTable.fetch` and `HTTPApiTable.fetch_async`.
multipart = boolean
-- Optional, if true performs a multipart HTTP request.
-- Default is false.
-- Post only, data must be array
-- Not allowed for GET or HEAD method and `data` must be a table.
post_data = "Raw POST request data string" OR {field1 = "data1", field2 = "data2"},
-- Deprecated, use `data` instead. Forces `method = "POST"`.
@ -11861,7 +11918,8 @@ Passed to `HTTPApiTable.fetch` callback. Returned by
code = 200,
-- HTTP status code
data = "response"
data = "",
-- Response body
}
```

View file

@ -1,4 +1,4 @@
Luanti Lua Mainmenu API Reference 5.12.0
Luanti Lua Mainmenu API Reference 5.13.0
========================================
Introduction
@ -23,8 +23,10 @@ Callbacks
* `core.button_handler(fields)`: called when a button is pressed.
* `fields` = `{name1 = value1, name2 = value2, ...}`
* `core.event_handler(event)`
* `event`: `"MenuQuit"`, `"KeyEnter"`, `"ExitButton"`, `"EditBoxEnter"` or
`"FullscreenChange"`
* `event`: `"MenuQuit"` (derived from `quit`) or `"FullscreenChange"`
The main menu may issue custom events, such as `"Refresh"` (server list).
* `core.on_before_close()`: called before the menu is closed, either to exit or
to join a game
Gamedata

View file

@ -0,0 +1,280 @@
local S = core.get_translator("testeditor")
local F = core.formspec_escape
local function val_to_lua_str(v)
if type(v) == "string" then
return "\"" .. v .. "\""
elseif type(v) == "table" then
return tostring(dump(v)):gsub("\n", "")
else
return tostring(v)
end
end
local editor_formspecs = {}
--- Updates the fields `.index_to_key` and `.list` based on `.data`
local function update_formspec_list(formspec)
assert(formspec)
-- Get sorted keys of the formspec fields in `formspec.data`
local datalist = {}
for k,_ in pairs(formspec.data) do
table.insert(datalist, k)
end
table.sort(datalist)
-- Build list of table values
local props = {}
for i, k in ipairs(datalist) do
local v = formspec.data[k]
props[#props + 1] = F(("%s = %s"):format(k, val_to_lua_str(v)))
end
formspec.index_to_key = datalist
formspec.list = table.concat(props, ",")
end
local function show_editor_formspec(playername)
local formspec = editor_formspecs[playername]
local sel = formspec.selindex or ""
local key = formspec.index_to_key[sel]
local value = ""
if formspec.data[key] ~= nil then
value = val_to_lua_str(formspec.data[key])
end
local title = formspec.title
if not formspec.actual then
title = S("@1 - NOT APPLIED CHANGES", title)
end
core.show_formspec(playername, "testeditor:editor",
"size[11,9]"..
"label[0,0;"..F(title).."]"..
"textlist[0,0.5;11,6.5;editor_data;"..formspec.list..";"..sel..";false]"..
"field[0.2,7.75;7,1;key;"..F(S("Key"))..";"..F(formspec.key).."]"..
"field_close_on_enter[key;false]"..
"field[0.2,8.75;8,1;value;"..F(S("Value"))..";"..F(value).."]"..
"button[8,7.5;3,1;submit_key;"..F(S("Add/Change key")).."]"..
"field_close_on_enter[value;false]"..
"button[8,8.5;3,1;submit_value;"..F(S("Submit and apply")).."]"
)
end
local function editor_formspec_create(playername, wrapper)
local data = wrapper.read_cb(playername)
editor_formspecs[playername] = {
title = wrapper.title,
read_cb = wrapper.read_cb,
write_cb = wrapper.write_cb,
data = data,
key = "",
actual = true,
}
update_formspec_list(editor_formspecs[playername])
show_editor_formspec(playername)
end
-- Use loadstring to parse param as a Lua value
local function use_loadstring(param, player)
-- For security reasons, require 'server' priv, just in case
-- someone is actually crazy enough to run this on a public server.
local privs = core.get_player_privs(player:get_player_name())
if not privs.server then
return false, "You need 'server' privilege to change object properties!"
end
if not param then
return false, "Failed: parameter is nil"
end
--[[ DANGER ZONE ]]
-- Interpret string as Lua value
local func, errormsg = loadstring("return (" .. param .. ")")
if not func then
return false, "loadstring failed: " .. errormsg
end
-- Apply sandbox here using setfenv
setfenv(func, {})
-- Run it
local good, errOrResult = pcall(func)
if not good then
-- A Lua error was thrown
return false, "pcall failed: " .. errOrResult
end
-- errOrResult will be the value
return true, errOrResult
end
core.register_on_player_receive_fields(function(player, formname, fields)
if not (player and player:is_player()) then
return
end
if formname ~= "testeditor:editor" then
return
end
local name = player:get_player_name()
local formspec = editor_formspecs[name]
if not formspec then
return
end
if fields.editor_data then
local expl = core.explode_textlist_event(fields.editor_data)
if expl.type == "DCL" or expl.type == "CHG" then
formspec.selindex = expl.index
formspec.key = formspec.index_to_key[expl.index]
show_editor_formspec(name)
return
end
end
if fields.key_enter_field == "key" or fields.submit_key then
local success, str = use_loadstring(fields.value, player)
if success then
local key = fields.key
formspec.data[key] = str
update_formspec_list(formspec)
formspec.actual = false
else
core.chat_send_player(name, str)
return
end
show_editor_formspec(name)
if fields.submit_value then
formspec.write_cb(name, formspec.data)
end
return
end
if fields.key_enter_field == "value" or fields.submit_value then
local success, str = use_loadstring(fields.value, player)
if success then
local key = formspec.index_to_key[formspec.selindex]
formspec.data[key] = str
update_formspec_list(formspec)
formspec.actual = false
else
core.chat_send_player(name, str)
return
end
show_editor_formspec(name)
if fields.submit_value then
formspec.write_cb(name, formspec.data)
formspec.data = formspec.read_cb(name)
update_formspec_list(formspec)
formspec.actual = true
end
return
end
end)
local function create_read_cb(func)
return
function(name)
local player = core.get_player_by_name(name)
if player then
return player[func](player)
end
return {}
end
end
local function create_write_cb(func)
return
function(name, data)
local player = core.get_player_by_name(name)
if player then
return player[func](player, data)
end
end
end
local wrappers = {
armor = {
title = S("Properties editor of armor groups (get_armor_groups/set_armor_groups)"),
read_cb = create_read_cb("get_armor_groups"),
write_cb = create_write_cb("set_armor_groups")
},
nametag = {
title = S("Properties editor of nametag (get_nametag/set_nametag)"),
read_cb = create_read_cb("get_nametag_attributes"),
write_cb = create_write_cb("set_nametag_attributes")
},
physics = {
title = S("Properties editor of physics_override (get_physics_override/set_physics_override)"),
read_cb = create_read_cb("get_physics_override"),
write_cb = create_write_cb("set_physics_override")
},
hud_flags = {
title = S("Properties editor of hud_flags (hud_get_flags/hud_set_flags)"),
read_cb = create_read_cb("hud_get_flags"),
write_cb = create_write_cb("hud_set_flags")
},
sky = {
title = S("Properties editor of sky (get_sky/set_sky)"),
read_cb =
function(name)
local player = core.get_player_by_name(name)
if player then
return player:get_sky(true)
end
return {}
end,
write_cb = create_write_cb("set_sky")
},
sun = {
title = S("Properties editor of sun (get_sun/set_sun)"),
read_cb = create_read_cb("get_sun"),
write_cb = create_write_cb("set_sun")
},
moon = {
title = S("Properties editor of moon (get_moon/set_moon)"),
read_cb = create_read_cb("get_moon"),
write_cb = create_write_cb("set_moon")
},
stars = {
title = S("Properties editor of stars (get_stars/set_stars)"),
read_cb = create_read_cb("get_stars"),
write_cb = create_write_cb("set_stars")
},
clouds = {
title = S("Properties editor of clouds (get_clouds/set_clouds)"),
read_cb = create_read_cb("get_clouds"),
write_cb = create_write_cb("set_clouds")
},
lighting = {
title = S("Properties editor of lighting (get_lighting/set_lighting)"),
read_cb = create_read_cb("get_lighting"),
write_cb = create_write_cb("set_lighting")
},
flags = {
title = S("Properties editor of flags (get_flags/set_flags)"),
read_cb = create_read_cb("get_flags"),
write_cb = create_write_cb("set_flags")
}
}
local editor_params
do
local params = {}
for key, _ in pairs(wrappers) do
params[#params + 1] = key
end
editor_params = table.concat(params, "|")
end
core.register_chatcommand("player_editor", {
params = "<"..editor_params..">",
description = "Open editor for some player data",
func = function(name, param)
local player = core.get_player_by_name(name)
if not player then
return false, "No player."
end
if wrappers[param] then
editor_formspec_create(name, wrappers[param])
else
return false, S("Use with @1.", editor_params)
end
return true
end,
})

View file

@ -0,0 +1,2 @@
name = testeditor
description = Commands for create formspec for edit some things like sky etc.

View file

@ -8,6 +8,8 @@ compare_meta:from_table({
c = "3",
d = "4",
e = "e",
["0.3"] = "0.29999999999999999",
["0.1+0.2"] = "0.30000000000000004",
},
})
@ -21,6 +23,9 @@ local function test_metadata(meta)
meta:set_string("", "!")
meta:set_string("", "")
meta:set_float("0.3", 0.3)
meta:set_float("0.1+0.2", 0.1 + 0.2)
assert(meta:equals(compare_meta))
local tab = meta:to_table()
@ -29,6 +34,8 @@ local function test_metadata(meta)
assert(tab.fields.c == "3")
assert(tab.fields.d == "4")
assert(tab.fields.e == "e")
assert(tab.fields["0.3"] == "0.29999999999999999")
assert(tab.fields["0.1+0.2"] == "0.30000000000000004")
local keys = meta:get_keys()
assert(table.indexof(keys, "a") > 0)
@ -36,7 +43,7 @@ local function test_metadata(meta)
assert(table.indexof(keys, "c") > 0)
assert(table.indexof(keys, "d") > 0)
assert(table.indexof(keys, "e") > 0)
assert(#keys == 5)
assert(#keys == 7)
assert(not meta:contains(""))
assert(meta:contains("a"))
@ -55,6 +62,8 @@ local function test_metadata(meta)
assert(meta:get_float("a") == 1.0)
assert(meta:get_int("e") == 0)
assert(meta:get_float("e") == 0.0)
assert(meta:get_float("0.3") == 0.3)
assert(meta:get_float("0.1+0.2") == 0.1 + 0.2)
meta:set_float("f", 1.1)
meta:set_string("g", "${f}")

View file

@ -67,18 +67,6 @@ local function test_dynamic_media(cb, player)
end
unittests.register("test_dynamic_media", test_dynamic_media, {async=true, player=true})
local function test_v3f_metatable(player)
assert(vector.check(player:get_pos()))
end
unittests.register("test_v3f_metatable", test_v3f_metatable, {player=true})
local function test_v3s16_metatable(player, pos)
local node = core.get_node(pos)
local found_pos = core.find_node_near(pos, 0, node.name, true)
assert(vector.check(found_pos))
end
unittests.register("test_v3s16_metatable", test_v3s16_metatable, {map=true})
local function test_clear_meta(_, pos)
local ref = core.get_meta(pos)

View file

@ -21,6 +21,4 @@ Copyright (C) 2002-2012 Nikolaus Gebhardt
the Irrlicht Engine in your product, you must acknowledge somewhere in your
documentation that you've used the IJPG code. It would also be nice to mention
that you use the Irrlicht Engine, the zlib, libPng and aesGladman. See the
corresponding license files for further informations. It is also possible to disable
usage of those additional libraries by defines in the IrrCompileConfig.h header and
recompiling the engine.
corresponding license files for further informations.

View file

@ -1,32 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
namespace irr
{
namespace io
{
//! Types of attributes available for IAttributes
enum E_ATTRIBUTE_TYPE
{
// integer attribute
EAT_INT = 0,
// float attribute
EAT_FLOAT,
// boolean attribute
EAT_BOOL,
// known attribute type count
EAT_COUNT,
// unknown attribute
EAT_UNKNOWN
};
} // end namespace io
} // end namespace irr

View file

@ -24,9 +24,6 @@ enum EGUI_ELEMENT_TYPE
//! A combo box (IGUIComboBox)
EGUIET_COMBO_BOX,
//! A context menu (IGUIContextMenu)
EGUIET_CONTEXT_MENU,
//! A menu (IGUIMenu)
EGUIET_MENU,
@ -36,54 +33,30 @@ enum EGUI_ELEMENT_TYPE
//! A file open dialog (IGUIFileOpenDialog)
EGUIET_FILE_OPEN_DIALOG,
//! A color select open dialog (IGUIColorSelectDialog)
EGUIET_COLOR_SELECT_DIALOG,
//! A in/out fader (IGUIInOutFader)
EGUIET_IN_OUT_FADER,
//! An image (IGUIImage)
EGUIET_IMAGE,
//! A list box (IGUIListBox)
EGUIET_LIST_BOX,
//! A mesh viewer (IGUIMeshViewer)
EGUIET_MESH_VIEWER,
//! A message box (IGUIWindow)
EGUIET_MESSAGE_BOX,
//! A modal screen
EGUIET_MODAL_SCREEN,
//! A scroll bar (IGUIScrollBar)
EGUIET_SCROLL_BAR,
//! A spin box (IGUISpinBox)
EGUIET_SPIN_BOX,
//! A static text (IGUIStaticText)
EGUIET_STATIC_TEXT,
//! A table (GUITable)
EGUIET_TABLE,
//! A tab (IGUITab)
EGUIET_TAB,
//! A tab control
EGUIET_TAB_CONTROL,
//! A Table
EGUIET_TABLE,
//! A tool bar (IGUIToolBar)
EGUIET_TOOL_BAR,
//! A Tree View
EGUIET_TREE_VIEW,
//! A window
EGUIET_WINDOW,
//! Unknown type.
EGUIET_ELEMENT,
@ -98,36 +71,5 @@ enum EGUI_ELEMENT_TYPE
};
//! Names for built-in element types
const c8 *const GUIElementTypeNames[] = {
"button",
"checkBox",
"comboBox",
"contextMenu",
"menu",
"editBox",
"fileOpenDialog",
"colorSelectDialog",
"inOutFader",
"image",
"listBox",
"meshViewer",
"messageBox",
"modalScreen",
"scrollBar",
"spinBox",
"staticText",
"tab",
"tabControl",
"table",
"toolBar",
"treeview",
"window",
"element",
"root",
"profiler",
0,
};
} // end namespace gui
} // end namespace irr

View file

@ -1,87 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include "IReferenceCounted.h"
#include "EAttributes.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace io
{
//! Provides a generic interface for attributes and their values and the possibility to serialize them
class IAttributes : public virtual IReferenceCounted
{
public:
//! Returns the type of an attribute
//! \param attributeName: Name for the attribute
virtual E_ATTRIBUTE_TYPE getAttributeType(const c8 *attributeName) const = 0;
//! Returns if an attribute with a name exists
virtual bool existsAttribute(const c8 *attributeName) const = 0;
//! Removes all attributes
virtual void clear() = 0;
/*
Integer Attribute
*/
//! Adds an attribute as integer
virtual void addInt(const c8 *attributeName, s32 value) = 0;
//! Sets an attribute as integer value
virtual void setAttribute(const c8 *attributeName, s32 value) = 0;
//! Gets an attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
virtual s32 getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound = 0) const = 0;
/*
Float Attribute
*/
//! Adds an attribute as float
virtual void addFloat(const c8 *attributeName, f32 value) = 0;
//! Sets a attribute as float value
virtual void setAttribute(const c8 *attributeName, f32 value) = 0;
//! Gets an attribute as float value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
virtual f32 getAttributeAsFloat(const c8 *attributeName, irr::f32 defaultNotFound = 0.f) const = 0;
/*
Bool Attribute
*/
//! Adds an attribute as bool
virtual void addBool(const c8 *attributeName, bool value) = 0;
//! Sets an attribute as boolean value
virtual void setAttribute(const c8 *attributeName, bool value) = 0;
//! Gets an attribute as boolean value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
virtual bool getAttributeAsBool(const c8 *attributeName, bool defaultNotFound = false) const = 0;
};
} // end namespace io
} // end namespace irr

View file

@ -19,7 +19,6 @@ namespace io
class IReadFile;
class IWriteFile;
class IFileList;
class IAttributes;
//! The FileSystem manages files and archives and provides access to them.
/** It manages where files are, so that modules which use the the IO do not

View file

@ -662,13 +662,6 @@ public:
return type == Type;
}
//! Returns the type name of the gui element.
/** This is needed serializing elements. */
virtual const c8 *getTypeName() const
{
return GUIElementTypeNames[Type];
}
//! Returns the name of the element.
/** \return Name as character string. */
virtual const c8 *getName() const

View file

@ -130,26 +130,18 @@ public:
//! Sets a new GUI Skin
/** You can use this to change the appearance of the whole GUI
Environment. You can set one of the built-in skins or implement your
own class derived from IGUISkin and enable it using this method.
To set for example the built-in Windows classic skin, use the following
code:
\code
gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
environment->setSkin(newskin);
newskin->drop();
\endcode
Environment.
\param skin New skin to use.
*/
virtual void setSkin(IGUISkin *skin) = 0;
//! Creates a new GUI Skin based on a template.
//! Creates a new GUI Skin.
/** Use setSkin() to set the created skin.
\param type The type of the new skin.
\return Pointer to the created skin.
If you no longer need it, you should call IGUISkin::drop().
See IReferenceCounted::drop() for more information. */
virtual IGUISkin *createSkin(EGUI_SKIN_TYPE type) = 0;
virtual IGUISkin *createSkin() = 0;
//! Creates the image list from the given texture.
/** \param texture Texture to split into images

View file

@ -17,42 +17,6 @@ class IGUIFont;
class IGUISpriteBank;
class IGUIElement;
//! Enumeration of available default skins.
/** To set one of the skins, use the following code, for example to set
the Windows classic skin:
\code
gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
environment->setSkin(newskin);
newskin->drop();
\endcode
*/
enum EGUI_SKIN_TYPE
{
//! Default windows look and feel
EGST_WINDOWS_CLASSIC = 0,
//! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons
EGST_WINDOWS_METALLIC,
//! Burning's skin
EGST_BURNING_SKIN,
//! An unknown skin, not serializable at present
EGST_UNKNOWN,
//! this value is not used, it only specifies the number of skin types
EGST_COUNT
};
//! Names for gui element types
const c8 *const GUISkinTypeNames[EGST_COUNT + 1] = {
"windowsClassic",
"windowsMetallic",
"burning",
"unknown",
0,
};
//! Enumeration for skin colors
enum EGUI_DEFAULT_COLOR
{
@ -570,9 +534,6 @@ public:
If the pointer is null, no clipping will be performed. */
virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color,
const core::rect<s32> &pos, const core::rect<s32> *clip = 0) = 0;
//! get the type of this skin
virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
};
} // end namespace gui

View file

@ -10,7 +10,6 @@
#include "dimension2d.h"
#include "SColor.h"
#include "ESceneNodeTypes.h"
#include "SceneParameters.h" // IWYU pragma: export
namespace irr
{
@ -20,7 +19,6 @@ struct SEvent;
namespace io
{
class IReadFile;
class IAttributes;
class IWriteFile;
class IFileSystem;
} // end namespace io
@ -373,11 +371,6 @@ public:
/** All scene nodes are removed. */
virtual void clear() = 0;
//! Get interface to the parameters set in this scene.
/** String parameters can be used by plugins and mesh loaders.
See COLLADA_CREATE_SCENE_INSTANCES and DMF_USE_MATERIALS_DIRS */
virtual io::IAttributes *getParameters() = 0;
//! Get current render pass.
/** All scene nodes are being rendered in a specific order.
First lights, cameras, sky boxes, solid geometry, and then transparent

View file

@ -25,7 +25,6 @@ namespace irr
{
namespace io
{
class IAttributes;
class IReadFile;
class IWriteFile;
} // end namespace io
@ -127,23 +126,6 @@ public:
\param flag When true the feature is disabled, otherwise it is enabled. */
virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag = true) = 0;
//! Get attributes of the actual video driver
/** The following names can be queried for the given types:
MaxTextures (int) The maximum number of simultaneous textures supported by the driver. This can be less than the supported number of textures of the driver. Use _IRR_MATERIAL_MAX_TEXTURES_ to adapt the number.
MaxSupportedTextures (int) The maximum number of simultaneous textures supported by the fixed function pipeline of the (hw) driver. The actual supported number of textures supported by the engine can be lower.
MaxAnisotropy (int) Number of anisotropy levels supported for filtering. At least 1, max is typically at 16 or 32.
MaxAuxBuffers (int) Special render buffers, which are currently not really usable inside Irrlicht. Only supported by OpenGL
MaxMultipleRenderTargets (int) Number of render targets which can be bound simultaneously. Rendering to MRTs is done via shaders.
MaxIndices (int) Number of indices which can be used in one render call (i.e. one mesh buffer).
MaxTextureSize (int) Dimension that a texture may have, both in width and height.
MaxGeometryVerticesOut (int) Number of vertices the geometry shader can output in one pass. Only OpenGL so far.
MaxTextureLODBias (float) Maximum value for LOD bias. Is usually at around 16, but can be lower on some systems.
Version (int) Version of the driver. Should be Major*100+Minor
ShaderLanguageVersion (int) Version of the high level shader language. Should be Major*100+Minor.
AntiAlias (int) Number of Samples the driver uses for each pixel. 0 and 1 means anti aliasing is off, typical values are 2,4,8,16,32
*/
virtual const io::IAttributes &getDriverAttributes() const = 0;
//! Sets transformation matrices.
/** \param state Transformation type to be set, e.g. view,
world, or projection.
@ -190,7 +172,7 @@ public:
\return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual ITexture *getTexture(const io::path &filename) = 0;
[[deprecated]] virtual ITexture *getTexture(const io::path &filename) = 0;
//! Get access to a named texture.
/** Loads the texture from disk if it is not
@ -202,7 +184,7 @@ public:
\return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual ITexture *getTexture(io::IReadFile *file) = 0;
[[deprecated]] virtual ITexture *getTexture(io::IReadFile *file) = 0;
//! Returns amount of textures currently loaded
/** \return Amount of textures currently loaded */
@ -1132,7 +1114,6 @@ public:
//! Only used by the engine internally.
/** Passes the global material flag AllowZWriteOnTransparent.
Use the SceneManager attribute to set this value from your app.
\param flag Default behavior is to disable ZWrite, i.e. false. */
virtual void setAllowZWriteOnTransparent(bool flag) = 0;

View file

@ -1,11 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
// these are obsolete and never pre-defined
#define IRRCALLCONV
#define IRRLICHT_API

View file

@ -13,7 +13,6 @@
#include "ITimer.h"
#include "IOSOperator.h"
#include "irrArray.h"
#include "IrrCompileConfig.h"
#include "position2d.h"
#include "SColor.h" // video::ECOLOR_FORMAT
#include <string>
@ -45,7 +44,7 @@ class IContextManager;
class IImage;
class ITexture;
class IVideoDriver;
extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver);
extern "C" bool isDriverSupported(E_DRIVER_TYPE driver);
} // end namespace video
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().

View file

@ -10,7 +10,6 @@
#include "EMaterialTypes.h" // IWYU pragma: export
#include "EMaterialProps.h" // IWYU pragma: export
#include "SMaterialLayer.h"
#include "IrrCompileConfig.h" // for IRRLICHT_API
namespace irr
{
@ -472,7 +471,7 @@ public:
};
//! global const identity Material
IRRLICHT_API extern const SMaterial IdentityMaterial;
extern const SMaterial IdentityMaterial;
} // end namespace video
} // end namespace irr

View file

@ -1,50 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include "irrTypes.h"
/*! \file SceneParameters.h
\brief Header file containing all scene parameters for modifying mesh loading etc.
This file includes all parameter names which can be set using ISceneManager::getParameters()
to modify the behavior of plugins and mesh loaders.
*/
namespace irr
{
namespace scene
{
//! Name of the parameter for changing how Irrlicht handles the ZWrite flag for transparent (blending) materials
/** The default behavior in Irrlicht is to disable writing to the
z-buffer for all really transparent, i.e. blending materials. This
avoids problems with intersecting faces, but can also break renderings.
If transparent materials should use the SMaterial flag for ZWriteEnable
just as other material types use this attribute.
Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
\endcode
**/
const c8 *const ALLOW_ZWRITE_ON_TRANSPARENT = "Allow_ZWrite_On_Transparent";
//! Flag to avoid loading group structures in .obj files
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true);
\endcode
**/
const c8 *const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups";
//! Flag to avoid loading material .mtl file for .obj files
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true);
\endcode
**/
const c8 *const OBJ_LOADER_IGNORE_MATERIAL_FILES = "OBJ_IgnoreMaterialFiles";
} // end namespace scene
} // end namespace irr

View file

@ -26,12 +26,21 @@ class ISceneManager;
class SkinnedMesh : public IAnimatedMesh
{
public:
enum class SourceFormat {
B3D,
X,
GLTF,
OTHER,
};
//! constructor
SkinnedMesh() :
SkinnedMesh(SourceFormat src_format) :
EndFrame(0.f), FramesPerSecond(25.f),
LastAnimatedFrame(-1), SkinnedLastFrame(false),
HasAnimation(false), PreparedForSkinning(false),
AnimateNormals(true), HardwareSkinning(false)
AnimateNormals(true), HardwareSkinning(false),
SrcFormat(src_format)
{
SkinningBuffers = &LocalBuffers;
}
@ -39,6 +48,10 @@ public:
//! destructor
virtual ~SkinnedMesh();
//! The source (file) format the mesh was loaded from.
//! Important for legacy reasons pertaining to different mesh loader behavior.
SourceFormat getSourceFormat() const { return SrcFormat; }
//! If the duration is 0, it is a static (=non animated) mesh.
f32 getMaxFrameNumber() const override;
@ -382,12 +395,14 @@ protected:
bool PreparedForSkinning;
bool AnimateNormals;
bool HardwareSkinning;
SourceFormat SrcFormat;
};
// Interface for mesh loaders
class SkinnedMeshBuilder : public SkinnedMesh {
public:
SkinnedMeshBuilder() : SkinnedMesh() {}
SkinnedMeshBuilder(SourceFormat src_format) : SkinnedMesh(src_format) {}
//! loaders should call this after populating the mesh
// returns *this, so do not try to drop the mesh builder instance

View file

@ -1,21 +0,0 @@
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include "path.h"
namespace irr
{
static io::path getExampleMediaPath()
{
#ifdef IRR_MOBILE_PATHS
return io::path("media/");
#else
return io::path("../../media/");
#endif
}
} // end namespace irr

View file

@ -34,7 +34,6 @@
#include "IEventReceiver.h"
#include "irrTypes.h"
#include "SIrrCreationParameters.h"
#include "IrrCompileConfig.h" // for IRRLICHT_API and IRRCALLCONV
//! Everything in the Irrlicht Engine can be found in this namespace.
namespace irr
@ -56,7 +55,7 @@ for the vertical retrace period, otherwise not.
\return Returns pointer to the created IrrlichtDevice or null if the
device could not be created.
*/
extern "C" IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(
extern "C" IrrlichtDevice *createDevice(
video::E_DRIVER_TYPE driverType = video::EDT_OPENGL,
// parentheses are necessary for some compilers
const core::dimension2d<u32> &windowSize = (core::dimension2d<u32>(640, 480)),
@ -74,7 +73,7 @@ handle in which the device should be created.
See irr::SIrrlichtCreationParameters for details.
\return Returns pointer to the created IrrlichtDevice or null if the
device could not be created. */
extern "C" IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDeviceEx(
extern "C" IrrlichtDevice *createDeviceEx(
const SIrrlichtCreationParameters &parameters);
// THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES

View file

@ -11,7 +11,6 @@
#include "plane3d.h"
#include "aabbox3d.h"
#include "rect.h"
#include "IrrCompileConfig.h" // for IRRLICHT_API
#include <cassert>
namespace irr
@ -1899,7 +1898,7 @@ inline CMatrix4<T> operator*(const T scalar, const CMatrix4<T> &mat)
typedef CMatrix4<f32> matrix4;
//! global const identity matrix
IRRLICHT_API extern const matrix4 IdentityMatrix;
extern const matrix4 IdentityMatrix;
} // end namespace core
} // end namespace irr

View file

@ -5,7 +5,6 @@
#include <string>
#include <unordered_set>
#include "IrrCompileConfig.h" // for IRRLICHT_API
#include "IContextManager.h"
#include <KHR/khrplatform.h>
@ -3199,4 +3198,4 @@ public:
};
// Global GL procedures object.
IRRLICHT_API extern OpenGLProcedures GL;
extern OpenGLProcedures GL;

View file

@ -349,7 +349,6 @@ f:write[[
#include <string>
#include <unordered_set>
#include "IrrCompileConfig.h" // for IRRLICHT_API
#include "IContextManager.h"
#include <KHR/khrplatform.h>
@ -415,7 +414,7 @@ f:write[[
]];
f:write( "};\n" );
f:write( "\n// Global GL procedures object.\n" );
f:write( "IRRLICHT_API extern OpenGLProcedures GL;\n" );
f:write( "extern OpenGLProcedures GL;\n" );
f:close();
-- Write loader implementation

View file

@ -1,141 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CAttributes.h"
namespace irr
{
namespace io
{
/*
Basic types, check documentation in IAttribute.h to see how they generally work.
*/
// Attribute implemented for boolean values
class CBoolAttribute : public IAttribute
{
public:
CBoolAttribute(const char *name, bool value)
{
Name = name;
setBool(value);
}
s32 getInt() const override
{
return BoolValue ? 1 : 0;
}
f32 getFloat() const override
{
return BoolValue ? 1.0f : 0.0f;
}
bool getBool() const override
{
return BoolValue;
}
void setInt(s32 intValue) override
{
BoolValue = (intValue != 0);
}
void setFloat(f32 floatValue) override
{
BoolValue = (floatValue != 0);
}
void setBool(bool boolValue) override
{
BoolValue = boolValue;
}
E_ATTRIBUTE_TYPE getType() const override
{
return EAT_BOOL;
}
bool BoolValue;
};
// Attribute implemented for integers
class CIntAttribute : public IAttribute
{
public:
CIntAttribute(const char *name, s32 value)
{
Name = name;
setInt(value);
}
s32 getInt() const override
{
return Value;
}
f32 getFloat() const override
{
return (f32)Value;
}
void setInt(s32 intValue) override
{
Value = intValue;
}
void setFloat(f32 floatValue) override
{
Value = (s32)floatValue;
};
E_ATTRIBUTE_TYPE getType() const override
{
return EAT_INT;
}
s32 Value;
};
// Attribute implemented for floats
class CFloatAttribute : public IAttribute
{
public:
CFloatAttribute(const char *name, f32 value)
{
Name = name;
setFloat(value);
}
s32 getInt() const override
{
return (s32)Value;
}
f32 getFloat() const override
{
return Value;
}
void setInt(s32 intValue) override
{
Value = (f32)intValue;
}
void setFloat(f32 floatValue) override
{
Value = floatValue;
}
E_ATTRIBUTE_TYPE getType() const override
{
return EAT_FLOAT;
}
f32 Value;
};
} // end namespace io
} // end namespace irr

View file

@ -1,121 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CAttributes.h"
#include "CAttributeImpl.h"
#include "ITexture.h"
#include "IVideoDriver.h"
namespace irr
{
namespace io
{
CAttributes::CAttributes() {}
CAttributes::~CAttributes()
{
clear();
}
//! Removes all attributes
void CAttributes::clear()
{
for (auto it : Attributes)
delete it.second;
Attributes.clear();
}
//! Sets a attribute as boolean value
void CAttributes::setAttribute(const c8 *attributeName, bool value)
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setBool(value);
} else {
Attributes[attributeName] = new CBoolAttribute(attributeName, value);
}
}
//! Gets a attribute as boolean value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute() as bool
//! or 0 if attribute is not set.
bool CAttributes::getAttributeAsBool(const c8 *attributeName, bool defaultNotFound) const
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getBool();
else
return defaultNotFound;
}
//! Sets a attribute as integer value
void CAttributes::setAttribute(const c8 *attributeName, s32 value)
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setInt(value);
} else {
Attributes[attributeName] = new CIntAttribute(attributeName, value);
}
}
//! Gets a attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute() as integer
//! or 0 if attribute is not set.
s32 CAttributes::getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound) const
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getInt();
else
return defaultNotFound;
}
//! Sets a attribute as float value
void CAttributes::setAttribute(const c8 *attributeName, f32 value)
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setFloat(value);
} else {
Attributes[attributeName] = new CFloatAttribute(attributeName, value);
}
}
//! Gets a attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute() as float value
//! or 0 if attribute is not set.
f32 CAttributes::getAttributeAsFloat(const c8 *attributeName, irr::f32 defaultNotFound) const
{
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getFloat();
else
return defaultNotFound;
}
//! Returns the type of an attribute
E_ATTRIBUTE_TYPE CAttributes::getAttributeType(const c8 *attributeName) const
{
E_ATTRIBUTE_TYPE ret = EAT_UNKNOWN;
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
ret = it->second->getType();
return ret;
}
//! Returns if an attribute with a name exists
bool CAttributes::existsAttribute(const c8 *attributeName) const
{
return Attributes.find(attributeName) != Attributes.end();
}
} // end namespace io
} // end namespace irr

View file

@ -1,102 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include <map>
#include <string>
#include "IAttributes.h"
#include "IAttribute.h"
namespace irr
{
namespace io
{
//! Implementation of the IAttributes interface
class CAttributes : public IAttributes
{
public:
CAttributes();
~CAttributes();
//! Returns the type of an attribute
//! \param attributeName: Name for the attribute
E_ATTRIBUTE_TYPE getAttributeType(const c8 *attributeName) const override;
//! Returns if an attribute with a name exists
bool existsAttribute(const c8 *attributeName) const override;
//! Removes all attributes
void clear() override;
/*
Integer Attribute
*/
//! Adds an attribute as integer
void addInt(const c8 *attributeName, s32 value) override {
setAttribute(attributeName, value);
}
//! Sets an attribute as integer value
void setAttribute(const c8 *attributeName, s32 value) override;
//! Gets an attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
s32 getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound = 0) const override;
/*
Float Attribute
*/
//! Adds an attribute as float
void addFloat(const c8 *attributeName, f32 value) override {
setAttribute(attributeName, value);
}
//! Sets a attribute as float value
void setAttribute(const c8 *attributeName, f32 value) override;
//! Gets an attribute as float value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
f32 getAttributeAsFloat(const c8 *attributeName, irr::f32 defaultNotFound = 0.f) const override;
/*
Bool Attribute
*/
//! Adds an attribute as bool
void addBool(const c8 *attributeName, bool value) override {
setAttribute(attributeName, value);
}
//! Sets an attribute as boolean value
void setAttribute(const c8 *attributeName, bool value) override;
//! Gets an attribute as boolean value
//! \param attributeName: Name of the attribute to get.
//! \param defaultNotFound Value returned when attributeName was not found
//! \return Returns value of the attribute previously set by setAttribute()
bool getAttributeAsBool(const c8 *attributeName, bool defaultNotFound = false) const override;
protected:
typedef std::basic_string<c8> string;
// specify a comparator so we can directly look up in the map with const c8*
// (works since C++14)
std::map<string, IAttribute*, std::less<>> Attributes;
};
} // end namespace io
} // end namespace irr

View file

@ -48,7 +48,7 @@ IAnimatedMesh *CB3DMeshFileLoader::createMesh(io::IReadFile *file)
return 0;
B3DFile = file;
AnimatedMesh = new scene::SkinnedMeshBuilder();
AnimatedMesh = new scene::SkinnedMeshBuilder(SkinnedMesh::SourceFormat::B3D);
ShowWarning = true; // If true a warning is issued if too many textures are used
VerticesStart = 0;

View file

@ -347,7 +347,8 @@ IAnimatedMesh* SelfType::createMesh(io::IReadFile* file)
const char *filename = file->getFileName().c_str();
try {
tiniergltf::GlTF model = parseGLTF(file);
irr_ptr<SkinnedMeshBuilder> mesh(new SkinnedMeshBuilder());
irr_ptr<SkinnedMeshBuilder> mesh(new SkinnedMeshBuilder(
SkinnedMesh::SourceFormat::GLTF));
MeshExtractor extractor(std::move(model), mesh.get());
try {
extractor.load();
@ -364,18 +365,6 @@ IAnimatedMesh* SelfType::createMesh(io::IReadFile* file)
return nullptr;
}
static void transformVertices(std::vector<video::S3DVertex> &vertices, const core::matrix4 &transform)
{
for (auto &vertex : vertices) {
// Apply scaling, rotation and rotation (in that order) to the position.
transform.transformVect(vertex.Pos);
// For the normal, we do not want to apply the translation.
vertex.Normal = transform.rotateAndScaleVect(vertex.Normal);
// Renormalize (length might have been affected by scaling).
vertex.Normal.normalize();
}
}
static void checkIndices(const std::vector<u16> &indices, const std::size_t nVerts)
{
for (u16 index : indices) {
@ -425,9 +414,6 @@ void SelfType::MeshExtractor::addPrimitive(
if (n_vertices >= std::numeric_limits<u16>::max())
throw std::runtime_error("too many vertices");
// Apply the global transform along the parent chain.
transformVertices(*vertices, parent->GlobalMatrix);
auto maybeIndices = getIndices(primitive);
std::vector<u16> indices;
if (maybeIndices.has_value()) {
@ -438,10 +424,9 @@ void SelfType::MeshExtractor::addPrimitive(
indices = generateIndices(vertices->size());
}
m_irr_model->addMeshBuffer(
new SSkinMeshBuffer(std::move(*vertices), std::move(indices)));
auto *meshbuf = new SSkinMeshBuffer(std::move(*vertices), std::move(indices));
m_irr_model->addMeshBuffer(meshbuf);
const auto meshbufNr = m_irr_model->getMeshBufferCount() - 1;
auto *meshbuf = m_irr_model->getMeshBuffer(meshbufNr);
if (primitive.material.has_value()) {
const auto &material = m_gltf_model.materials->at(*primitive.material);
@ -460,17 +445,17 @@ void SelfType::MeshExtractor::addPrimitive(
}
}
if (!skinIdx.has_value()) {
// No skin => all vertices belong entirely to their parent
for (std::size_t v = 0; v < n_vertices; ++v) {
auto *weight = m_irr_model->addWeight(parent);
weight->buffer_id = meshbufNr;
weight->vertex_id = v;
weight->strength = 1.0f;
}
if (!skinIdx) {
// Apply the global transform along the parent chain.
meshbuf->Transformation = parent->GlobalMatrix;
// Set up rigid animation
parent->AttachedMeshes.push_back(meshbufNr);
return;
}
// Otherwise: "Only the joint transforms are applied to the skinned mesh;
// the transform of the skinned mesh node MUST be ignored."
const auto &skin = m_gltf_model.skins->at(*skinIdx);
const auto &attrs = primitive.attributes;

View file

@ -52,7 +52,7 @@ CGUIEnvironment::CGUIEnvironment(io::IFileSystem *fs, video::IVideoDriver *drive
loadBuiltInFont();
IGUISkin *skin = createSkin(gui::EGST_WINDOWS_METALLIC);
IGUISkin *skin = createSkin();
setSkin(skin);
skin->drop();
@ -584,13 +584,13 @@ void CGUIEnvironment::setSkin(IGUISkin *skin)
CurrentSkin->grab();
}
//! Creates a new GUI Skin based on a template.
//! Creates a new GUI Skin.
/** \return Returns a pointer to the created skin.
If you no longer need the skin, you should call IGUISkin::drop().
See IReferenceCounted::drop() for more information. */
IGUISkin *CGUIEnvironment::createSkin(EGUI_SKIN_TYPE type)
IGUISkin *CGUIEnvironment::createSkin()
{
IGUISkin *skin = new CGUISkin(type, Driver);
IGUISkin *skin = new CGUISkin(Driver);
IGUIFont *builtinfont = getBuiltInFont();
IGUIFontBitmap *bitfont = 0;

View file

@ -56,11 +56,11 @@ public:
//! Sets a new GUI Skin
void setSkin(IGUISkin *skin) override;
//! Creates a new GUI Skin based on a template.
//! Creates a new GUI Skin.
/** \return Returns a pointer to the created skin.
If you no longer need the skin, you should call IGUISkin::drop().
See IReferenceCounted::drop() for more information. */
IGUISkin *createSkin(EGUI_SKIN_TYPE type) override;
IGUISkin *createSkin() override;
//! Creates the image list from the given texture.
virtual IGUIImageList *createImageList(video::ITexture *texture,

View file

@ -10,21 +10,18 @@
#include "IGUISpriteBank.h"
#include "IGUIElement.h"
#include "IVideoDriver.h"
#include "IAttributes.h"
namespace irr
{
namespace gui
{
CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
: SpriteBank(0), Driver(driver), Type(type)
CGUISkin::CGUISkin(video::IVideoDriver* driver)
: SpriteBank(0), Driver(driver)
{
if ((Type == EGST_WINDOWS_CLASSIC) || (Type == EGST_WINDOWS_METALLIC))
{
Colors[EGDC_3D_DARK_SHADOW] = video::SColor(101,50,50,50);
Colors[EGDC_3D_SHADOW] = video::SColor(101,130,130,130);
Colors[EGDC_3D_FACE] = video::SColor(220,100,100,100);
Colors[EGDC_3D_FACE] = video::SColor(185,85,85,85);
Colors[EGDC_3D_HIGH_LIGHT] = video::SColor(101,255,255,255);
Colors[EGDC_3D_LIGHT] = video::SColor(101,210,210,210);
Colors[EGDC_ACTIVE_BORDER] = video::SColor(101,16,14,115);
@ -63,53 +60,6 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 2;
Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 0;
}
else
{
//0x80a6a8af
Colors[EGDC_3D_DARK_SHADOW] = 0x60767982;
//Colors[EGDC_3D_FACE] = 0xc0c9ccd4; // tab background
Colors[EGDC_3D_FACE] = 0xc0cbd2d9; // tab background
Colors[EGDC_3D_SHADOW] = 0x50e4e8f1; // tab background, and left-top highlight
Colors[EGDC_3D_HIGH_LIGHT] = 0x40c7ccdc;
Colors[EGDC_3D_LIGHT] = 0x802e313a;
Colors[EGDC_ACTIVE_BORDER] = 0x80404040; // window title
Colors[EGDC_ACTIVE_CAPTION] = 0xffd0d0d0;
Colors[EGDC_APP_WORKSPACE] = 0xc0646464; // unused
Colors[EGDC_BUTTON_TEXT] = 0xd0161616;
Colors[EGDC_GRAY_TEXT] = 0x3c141414;
Colors[EGDC_HIGH_LIGHT] = 0x6c606060;
Colors[EGDC_HIGH_LIGHT_TEXT] = 0xd0e0e0e0;
Colors[EGDC_INACTIVE_BORDER] = 0xf0a5a5a5;
Colors[EGDC_INACTIVE_CAPTION] = 0xffd2d2d2;
Colors[EGDC_TOOLTIP] = 0xf00f2033;
Colors[EGDC_TOOLTIP_BACKGROUND] = 0xc0cbd2d9;
Colors[EGDC_SCROLLBAR] = 0xf0e0e0e0;
Colors[EGDC_WINDOW] = 0xf0f0f0f0;
Colors[EGDC_WINDOW_SYMBOL] = 0xd0161616;
Colors[EGDC_ICON] = 0xd0161616;
Colors[EGDC_ICON_HIGH_LIGHT] = 0xd0606060;
Colors[EGDC_GRAY_WINDOW_SYMBOL] = 0x3c101010;
Colors[EGDC_EDITABLE] = 0xf0ffffff;
Colors[EGDC_GRAY_EDITABLE] = 0xf0cccccc;
Colors[EGDC_FOCUSED_EDITABLE] = 0xf0fffff0;
Sizes[EGDS_SCROLLBAR_SIZE] = 14;
Sizes[EGDS_MENU_HEIGHT] = 48;
Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;
Sizes[EGDS_CHECK_BOX_WIDTH] = 18;
Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;
Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;
Sizes[EGDS_BUTTON_WIDTH] = 80;
Sizes[EGDS_BUTTON_HEIGHT] = 30;
Sizes[EGDS_TEXT_DISTANCE_X] = 3;
Sizes[EGDS_TEXT_DISTANCE_Y] = 2;
Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 3;
Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 2;
}
Sizes[EGDS_MESSAGE_BOX_GAP_SPACE] = 15;
Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH] = 0;
Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH] = 500;
@ -157,8 +107,6 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
for (u32 i=0; i<EGDF_COUNT; ++i)
Fonts[i] = 0;
UseGradient = (Type == EGST_WINDOWS_METALLIC) || (Type == EGST_BURNING_SKIN) ;
}
@ -320,18 +268,6 @@ void CGUISkin::drawColored3DButtonPaneStandard(IGUIElement* element,
core::rect<s32> rect = r;
if ( Type == EGST_BURNING_SKIN )
{
rect.UpperLeftCorner.X -= 1;
rect.UpperLeftCorner.Y -= 1;
rect.LowerRightCorner.X += 1;
rect.LowerRightCorner.Y += 1;
draw3DSunkenPane(element,
colors[ EGDC_WINDOW ].getInterpolated( 0xFFFFFFFF, 0.9f )
,false, true, rect, clip);
return;
}
Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);
rect.LowerRightCorner.X -= 1;
@ -345,16 +281,7 @@ void CGUISkin::drawColored3DButtonPaneStandard(IGUIElement* element,
rect.LowerRightCorner.X -= 1;
rect.LowerRightCorner.Y -= 1;
if (!UseGradient)
{
Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
}
else
{
const video::SColor c1 = colors[EGDC_3D_FACE];
const video::SColor c2 = c1.getInterpolated(colors[EGDC_3D_DARK_SHADOW], 0.4f);
Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
}
}
// END PATCH
@ -394,16 +321,8 @@ void CGUISkin::drawColored3DButtonPanePressed(IGUIElement* element,
rect.UpperLeftCorner.X += 1;
rect.UpperLeftCorner.Y += 1;
if (!UseGradient)
{
Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
}
else
{
const video::SColor c1 = colors[EGDC_3D_FACE];
const video::SColor c2 = c1.getInterpolated(colors[EGDC_3D_DARK_SHADOW], 0.4f);
Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
}
}
// END PATCH
@ -596,25 +515,9 @@ core::rect<s32> CGUISkin::drawColored3DWindowBackground(IGUIElement* element,
}
if ( !checkClientArea )
{
if (!UseGradient)
{
Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
}
else if ( Type == EGST_BURNING_SKIN )
{
const video::SColor c1 = colors[EGDC_WINDOW].getInterpolated ( 0xFFFFFFFF, 0.9f );
const video::SColor c2 = colors[EGDC_WINDOW].getInterpolated ( 0xFFFFFFFF, 0.8f );
Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
}
else
{
const video::SColor c2 = colors[EGDC_3D_SHADOW];
const video::SColor c1 = colors[EGDC_3D_FACE];
Driver->draw2DRectangle(rect, c1, c1, c1, c2, clip);
}
}
// title bar
rect = r;
@ -632,19 +535,7 @@ core::rect<s32> CGUISkin::drawColored3DWindowBackground(IGUIElement* element,
else
{
// draw title bar
//if (!UseGradient)
// Driver->draw2DRectangle(titleBarColor, rect, clip);
//else
if ( Type == EGST_BURNING_SKIN )
{
const video::SColor c = titleBarColor.getInterpolated( video::SColor(titleBarColor.getAlpha(),255,255,255), 0.8f);
Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip);
}
else
{
const video::SColor c = titleBarColor.getInterpolated(video::SColor(titleBarColor.getAlpha(),0,0,0), 0.2f);
Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip);
}
Driver->draw2DRectangle(titleBarColor, rect, clip);
}
}
@ -675,13 +566,6 @@ void CGUISkin::drawColored3DMenuPane(IGUIElement* element,
core::rect<s32> rect = r;
if ( Type == EGST_BURNING_SKIN )
{
rect.UpperLeftCorner.Y -= 3;
draw3DButtonPaneStandard(element, rect, clip);
return;
}
// in this skin, this is exactly what non pressed buttons look like,
// so we could simply call
// draw3DButtonPaneStandard(element, rect, clip);
@ -727,14 +611,7 @@ void CGUISkin::drawColored3DMenuPane(IGUIElement* element,
rect.LowerRightCorner.X -= 2;
rect.LowerRightCorner.Y -= 2;
if (!UseGradient)
Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
else
{
const video::SColor c1 = colors[EGDC_3D_FACE];
const video::SColor c2 = colors[EGDC_3D_SHADOW];
Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
}
}
// END PATCH
@ -769,25 +646,7 @@ void CGUISkin::drawColored3DToolBar(IGUIElement* element,
rect = r;
rect.LowerRightCorner.Y -= 1;
if (!UseGradient)
{
Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
}
else
if ( Type == EGST_BURNING_SKIN )
{
const video::SColor c1 = 0xF0000000 | colors[EGDC_3D_FACE].color;
const video::SColor c2 = 0xF0000000 | colors[EGDC_3D_SHADOW].color;
rect.LowerRightCorner.Y += 1;
Driver->draw2DRectangle(rect, c1, c2, c1, c2, clip);
}
else
{
const video::SColor c1 = colors[EGDC_3D_FACE];
const video::SColor c2 = colors[EGDC_3D_SHADOW];
Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
}
}
// END PATCH
@ -961,14 +820,7 @@ void CGUISkin::drawColored3DTabBody(IGUIElement* element, bool border, bool back
//tr.UpperLeftCorner.X += 1;
}
if (!UseGradient)
Driver->draw2DRectangle(colors[EGDC_3D_FACE], tr, clip);
else
{
video::SColor c1 = colors[EGDC_3D_FACE];
video::SColor c2 = colors[EGDC_3D_SHADOW];
Driver->draw2DRectangle(tr, c1, c1, c2, c2, clip);
}
}
}
// END PATCH
@ -1004,12 +856,6 @@ void CGUISkin::drawColoredIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
// END PATCH
EGUI_SKIN_TYPE CGUISkin::getType() const
{
return Type;
}
//! draws a 2d rectangle.
void CGUISkin::draw2DRectangle(IGUIElement* element,
const video::SColor &color, const core::rect<s32>& pos,

View file

@ -21,7 +21,7 @@ namespace gui
{
public:
CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver);
CGUISkin(video::IVideoDriver* driver);
//! destructor
virtual ~CGUISkin();
@ -288,10 +288,6 @@ namespace gui
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
const core::rect<s32>& pos, const core::rect<s32>* clip = 0);
//! get the type of this skin
virtual EGUI_SKIN_TYPE getType() const;
//! gets the colors
virtual void getColors(video::SColor* colors); // ::PATCH:
@ -305,9 +301,6 @@ namespace gui
IGUISpriteBank* SpriteBank;
core::stringw Texts[EGDT_COUNT];
video::IVideoDriver* Driver;
bool UseGradient;
EGUI_SKIN_TYPE Type;
};
} // end namespace gui

View file

@ -13,7 +13,6 @@
#include "CTimer.h"
#include "CLogger.h"
#include "irrString.h"
#include "IrrCompileConfig.h" // for IRRLICHT_SDK_VERSION
namespace irr
{

View file

@ -1,11 +1,9 @@
# When enabling SDL2 by default on macOS, don't forget to change
# "NSHighResolutionCapable" to true in "Info.plist".
if(NOT APPLE)
set(DEFAULT_SDL2 ON)
endif()
set(DEFAULT_SDL2 ON)
option(USE_SDL2 "Use the SDL2 backend" ${DEFAULT_SDL2})
option(USE_SDL2_STATIC "Link with SDL2 static libraries" FALSE)
# Compiler flags
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@ -228,7 +226,11 @@ endif()
if(ENABLE_OPENGL)
find_package(OpenGL REQUIRED)
endif()
set(USE_SDL2_SHARED FALSE)
if(USE_SDL2)
if(NOT USE_SDL2_STATIC)
set(USE_SDL2_SHARED TRUE)
endif()
if(NOT ANDROID)
find_package(SDL2 REQUIRED)
else()
@ -364,14 +366,14 @@ endif()
if(ENABLE_OPENGL3)
set(IRRDRVROBJ
${IRRDRVROBJ}
OpenGL3/Driver.cpp
OpenGL3/DriverGL3.cpp
)
endif()
if(ENABLE_GLES2)
set(IRRDRVROBJ
${IRRDRVROBJ}
OpenGLES2/Driver.cpp
OpenGLES2/DriverGLES2.cpp
)
endif()
@ -399,7 +401,6 @@ add_library(IRRIOOBJ OBJECT
CReadFile.cpp
CWriteFile.cpp
CZipReader.cpp
CAttributes.cpp
)
add_library(IRROTHEROBJ OBJECT
@ -505,7 +506,8 @@ target_link_libraries(IrrlichtMt PRIVATE
${ZLIB_LIBRARY}
${JPEG_LIBRARY}
${PNG_LIBRARY}
"$<$<BOOL:${USE_SDL2}>:SDL2::SDL2>"
"$<$<BOOL:${USE_SDL2_SHARED}>:SDL2::SDL2>"
"$<$<BOOL:${USE_SDL2_STATIC}>:SDL2::SDL2-static>"
"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
${EGL_LIBRARY}

View file

@ -3,9 +3,10 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CNullDriver.h"
#include "IVideoDriver.h"
#include "SMaterial.h"
#include "os.h"
#include "CImage.h"
#include "CAttributes.h"
#include "IReadFile.h"
#include "IWriteFile.h"
#include "IImageLoader.h"
@ -55,20 +56,6 @@ CNullDriver::CNullDriver(io::IFileSystem *io, const core::dimension2d<u32> &scre
ViewPort(0, 0, 0, 0), ScreenSize(screenSize), MinVertexCountForVBO(500),
TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false)
{
DriverAttributes = new io::CAttributes();
DriverAttributes->addInt("MaxTextures", MATERIAL_MAX_TEXTURES);
DriverAttributes->addInt("MaxSupportedTextures", MATERIAL_MAX_TEXTURES);
DriverAttributes->addInt("MaxAnisotropy", 1);
// DriverAttributes->addInt("MaxAuxBuffers", 0);
DriverAttributes->addInt("MaxMultipleRenderTargets", 1);
DriverAttributes->addInt("MaxIndices", -1);
DriverAttributes->addInt("MaxTextureSize", -1);
// DriverAttributes->addInt("MaxGeometryVerticesOut", 0);
// DriverAttributes->addFloat("MaxTextureLODBias", 0.f);
DriverAttributes->addInt("Version", 1);
// DriverAttributes->addInt("ShaderLanguageVersion", 0);
// DriverAttributes->addInt("AntiAlias", 0);
setFog();
setTextureCreationFlag(ETCF_ALWAYS_32_BIT, true);
@ -113,9 +100,6 @@ CNullDriver::CNullDriver(io::IFileSystem *io, const core::dimension2d<u32> &scre
//! destructor
CNullDriver::~CNullDriver()
{
if (DriverAttributes)
DriverAttributes->drop();
if (FileSystem)
FileSystem->drop();
@ -236,12 +220,6 @@ bool CNullDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
return false;
}
//! Get attributes of the actual video driver
const io::IAttributes &CNullDriver::getDriverAttributes() const
{
return *DriverAttributes;
}
//! sets transformation
void CNullDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat)
{

View file

@ -9,7 +9,6 @@
#include "IGPUProgrammingServices.h"
#include "irrArray.h"
#include "irrString.h"
#include "IAttributes.h"
#include "IMesh.h"
#include "IMeshBuffer.h"
#include "IMeshSceneNode.h"
@ -50,9 +49,6 @@ public:
//! queries the features of the driver, returns true if feature is available
bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const override;
//! Get attributes of the actual video driver
const io::IAttributes &getDriverAttributes() const override;
//! sets transformation
void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat) override;
@ -717,8 +713,6 @@ protected:
SColor FogColor;
SExposedVideoData ExposedData;
io::IAttributes *DriverAttributes;
SOverrideMaterial OverrideMaterial;
SMaterial OverrideMaterial2D;
SMaterial InitMaterial2D;

View file

@ -9,7 +9,6 @@
#include "SMeshBuffer.h"
#include "SAnimatedMesh.h"
#include "IReadFile.h"
#include "IAttributes.h"
#include "fast_atof.h"
#include "coreutil.h"
#include "os.h"
@ -74,8 +73,6 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
const c8 *bufPtr = buf;
core::stringc grpName, mtlName;
bool mtlChanged = false;
bool useGroups = !SceneManager->getParameters()->getAttributeAsBool(OBJ_LOADER_IGNORE_GROUPS);
bool useMaterials = !SceneManager->getParameters()->getAttributeAsBool(OBJ_LOADER_IGNORE_MATERIAL_FILES);
[[maybe_unused]] irr::u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors
core::array<int> faceCorners;
faceCorners.reallocate(32); // should be large enough
@ -85,15 +82,7 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
while (bufPtr != bufEnd) {
switch (bufPtr[0]) {
case 'm': // mtllib (material)
{
if (useMaterials) {
c8 name[WORD_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(name, bufPtr, WORD_BUFFER_LENGTH, bufEnd);
#ifdef _IRR_DEBUG_OBJ_LOADER_
os::Printer::log("Ignoring material file", name);
#endif
}
} break;
break; // not supported
case 'v': // v, vn, vt
switch (bufPtr[1]) {
@ -127,12 +116,7 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
#ifdef _IRR_DEBUG_OBJ_LOADER_
os::Printer::log("Loaded group start", grp, ELL_DEBUG);
#endif
if (useGroups) {
if (0 != grp[0])
grpName = grp;
else
grpName = "default";
}
grpName = ('\0' != grp[0]) ? grp : "default";
mtlChanged = true;
} break;

View file

@ -116,18 +116,6 @@ bool COpenGLDriver::genericDriverInit()
os::Printer::log("GLSL version", buf, ELL_INFORMATION);
} else
os::Printer::log("GLSL not available.", ELL_INFORMATION);
DriverAttributes->setAttribute("MaxTextures", (s32)Feature.MaxTextureUnits);
DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.MaxTextureUnits);
DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy);
DriverAttributes->setAttribute("MaxAuxBuffers", MaxAuxBuffers);
DriverAttributes->setAttribute("MaxMultipleRenderTargets", (s32)Feature.MultipleRenderTarget);
DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices);
DriverAttributes->setAttribute("MaxTextureSize", (s32)MaxTextureSize);
DriverAttributes->setAttribute("MaxGeometryVerticesOut", (s32)MaxGeometryVerticesOut);
DriverAttributes->setAttribute("MaxTextureLODBias", MaxTextureLODBias);
DriverAttributes->setAttribute("Version", Version);
DriverAttributes->setAttribute("ShaderLanguageVersion", ShaderLanguageVersion);
DriverAttributes->setAttribute("AntiAlias", AntiAlias);
glPixelStorei(GL_PACK_ALIGNMENT, 1);

View file

@ -42,7 +42,7 @@ CSceneManager::CSceneManager(video::IVideoDriver *driver,
ISceneNode(0, 0),
Driver(driver),
CursorControl(cursorControl),
ActiveCamera(0), Parameters(0),
ActiveCamera(0),
MeshCache(cache), CurrentRenderPass(ESNRP_NONE)
{
// root node's scene manager
@ -60,9 +60,6 @@ CSceneManager::CSceneManager(video::IVideoDriver *driver,
else
MeshCache->grab();
// set scene parameters
Parameters = new io::CAttributes();
// create collision manager
CollisionManager = new CSceneCollisionManager(this, Driver);
@ -105,9 +102,6 @@ CSceneManager::~CSceneManager()
if (MeshCache)
MeshCache->drop();
if (Parameters)
Parameters->drop();
// remove all nodes before dropping the driver
// as render targets may be destroyed twice
@ -472,8 +466,7 @@ void CSceneManager::drawAll()
Driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
for (u32 i = video::ETS_COUNT - 1; i >= video::ETS_TEXTURE_0; --i)
Driver->setTransform((video::E_TRANSFORMATION_STATE)i, core::IdentityMatrix);
// TODO: This should not use an attribute here but a real parameter when necessary (too slow!)
Driver->setAllowZWriteOnTransparent(Parameters->getAttributeAsBool(ALLOW_ZWRITE_ON_TRANSPARENT));
Driver->setAllowZWriteOnTransparent(true);
// do animations and other stuff.
OnAnimate(os::Timer::getTime());
@ -743,12 +736,6 @@ void CSceneManager::clear()
removeAll();
}
//! Returns interface to the parameters set in this scene.
io::IAttributes *CSceneManager::getParameters()
{
return Parameters;
}
//! Returns current render pass.
E_SCENE_NODE_RENDER_PASS CSceneManager::getSceneNodeRenderPass() const
{
@ -775,7 +762,7 @@ ISceneManager *CSceneManager::createNewSceneManager(bool cloneContent)
//! Get a skinned mesh, which is not available as header-only code
SkinnedMesh *CSceneManager::createSkinnedMesh()
{
return new SkinnedMesh();
return new SkinnedMesh(SkinnedMesh::SourceFormat::OTHER);
}
// creates a scenemanager

View file

@ -11,7 +11,6 @@
#include "irrString.h"
#include "irrArray.h"
#include "IMeshLoader.h"
#include "CAttributes.h"
namespace irr
{
@ -158,9 +157,6 @@ public:
//! Removes all children of this scene node
void removeAll() override;
//! Returns interface to the parameters set in this scene.
io::IAttributes *getParameters() override;
//! Returns current render pass.
E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const override;
@ -266,10 +262,6 @@ private:
ICameraSceneNode *ActiveCamera;
core::vector3df camWorldPos; // Position of camera for transparent nodes.
//! String parameters
// NOTE: Attributes are slow and should only be used for debug-info and not in release
io::CAttributes *Parameters;
//! Mesh cache
IMeshCache *MeshCache;

View file

@ -54,7 +54,7 @@ IAnimatedMesh *CXMeshFileLoader::createMesh(io::IReadFile *file)
u32 time = os::Timer::getRealTime();
#endif
AnimatedMesh = new SkinnedMeshBuilder();
AnimatedMesh = new SkinnedMeshBuilder(SkinnedMesh::SourceFormat::X);
SkinnedMesh *res = nullptr;
if (load(file)) {

View file

@ -1,35 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include "irrTypes.h"
#include "irrString.h"
#include "EAttributes.h"
namespace irr
{
namespace io
{
class IAttribute
{
public:
virtual ~IAttribute(){};
virtual s32 getInt() const { return 0; }
virtual f32 getFloat() const { return 0; }
virtual bool getBool() const { return false; }
virtual void setInt(s32 intValue){};
virtual void setFloat(f32 floatValue){};
virtual void setBool(bool boolValue){};
core::stringc Name;
virtual E_ATTRIBUTE_TYPE getType() const = 0;
};
} // end namespace io
} // end namespace irr

View file

@ -27,7 +27,7 @@ static const char *const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Geb
namespace irr
{
//! stub for calling createDeviceEx
IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(video::E_DRIVER_TYPE driverType,
IrrlichtDevice *createDevice(video::E_DRIVER_TYPE driverType,
const core::dimension2d<u32> &windowSize,
u32 bits, bool fullscreen,
bool stencilbuffer, bool vsync, IEventReceiver *res)
@ -46,7 +46,7 @@ IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(video::E_DRIVER_TYPE drive
return createDeviceEx(p);
}
extern "C" IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters &params)
extern "C" IrrlichtDevice *createDeviceEx(const SIrrlichtCreationParameters &params)
{
IrrlichtDevice *dev = 0;
@ -90,7 +90,7 @@ namespace video
{
const SMaterial IdentityMaterial;
extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver)
extern "C" bool isDriverSupported(E_DRIVER_TYPE driver)
{
switch (driver) {
case EDT_NULL:

View file

@ -261,16 +261,6 @@ bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32> &screenS
StencilBuffer = stencilBuffer;
DriverAttributes->setAttribute("MaxTextures", (s32)Feature.MaxTextureUnits);
DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.MaxTextureUnits);
DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy);
DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices);
DriverAttributes->setAttribute("MaxTextureSize", (s32)MaxTextureSize);
DriverAttributes->setAttribute("MaxArrayTextureLayers", (s32)MaxArrayTextureLayers);
DriverAttributes->setAttribute("MaxTextureLODBias", MaxTextureLODBias);
DriverAttributes->setAttribute("Version", 100 * Version.Major + Version.Minor);
DriverAttributes->setAttribute("AntiAlias", AntiAlias);
GL.PixelStorei(GL_PACK_ALIGNMENT, 1);
for (s32 i = 0; i < ETS_COUNT; ++i)

View file

@ -2,7 +2,7 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#include "Driver.h"
#include "DriverGL3.h"
#include <cassert>
#include <stdexcept>
#include "mt_opengl.h"

View file

@ -2,7 +2,7 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#include "Driver.h"
#include "DriverGLES2.h"
#include <stdexcept>
#include <cassert>
#include "mt_opengl.h"

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ version: 1
AppDir:
path: AppDir
app_info:
id: net.minetest.minetest
id: org.luanti.luanti
name: Luanti
icon: luanti
version: !ENV ${VERSION}
@ -56,5 +56,3 @@ script: |
# Is a backup icon location in case
mkdir -p AppDir/usr/share/luanti/misc
cp AppDir/usr/share/icons/hicolor/128x128/apps/luanti.png AppDir/usr/share/luanti/misc/luanti-xorg-icon-128.png
# Validation issues
sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop

View file

@ -21,6 +21,6 @@
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>NSHighResolutionCapable</key>
<false/>
<true/>
</dict>
</plist>

View file

@ -7,7 +7,7 @@ Comment[fr]=Plate-forme de jeu multijoueurs à base de blocs
Exec=luanti
Icon=luanti
Terminal=false
PrefersNonDefaultGPU=true
# Note: don't add PrefersNonDefaultGPU here, see #16095
Type=Application
Categories=Game;Simulation;
StartupNotify=false

View file

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.luanti.luanti</id>
<provides>
<id>net.minetest.minetest</id>
</provides>
<replaces>
<id>net.minetest.minetest</id>
</replaces>
<name>Luanti</name>
<summary>Block-based multiplayer game platform</summary>
@ -10,7 +16,7 @@
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.1+ AND CC-BY-SA-3.0 AND MIT AND Apache-2.0</project_license>
<developer id="net.minetest">
<developer id="org.luanti">
<name>Luanti Team</name>
</developer>
@ -119,7 +125,7 @@
</ul>
</description>
<launchable type="desktop-id">net.minetest.minetest.desktop</launchable>
<launchable type="desktop-id">org.luanti.luanti.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://www.luanti.org/media/gallery/1.jpg</image>
@ -168,6 +174,6 @@
<update_contact>celeron55@gmail.com</update_contact>
<releases>
<release date="2025-02-14" version="5.11.0"/>
<release date="2025-05-23" version="5.12.0"/>
</releases>
</component>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more