Compare commits

...

2276 commits

Author SHA1 Message Date
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
sfan5
358658fa34 Fix cloud-related bugs
First, this reverts 56123b2fbe,
which un-fixes #15031 but fixes #15798 and #15854.

Then we disable culling for the cloud scene node which fixes #15031 again.
2025-03-04 19:53:01 +01:00
sfan5
68602b2eaf Fix shadow flicker on camera offset update (take 2)
The previous fix never did what it was supposed to, so let's do this.
2025-03-04 19:53:01 +01:00
sfan5
e84ac56e35 Don't try to update uninitialized shadow frustum 2025-03-04 19:53:01 +01:00
sfan5
47c000a293 Add unittest that lints builtin JSON files 2025-03-04 19:53:01 +01:00
sfan5
304ce4cd54 Fix syntax error in credits.json
reported at <https://forum.luanti.org/viewtopic.php?p=442729>

As it happens this didn't affect most users as jsoncpp allows trailing commas
by default since 2019.
2025-03-04 19:53:01 +01:00
sfan5
d54646d342 Improve error handling of map database creation 2025-03-04 19:53:01 +01:00
sfan5
7abaa8d4cd Make Irrlicht identity material const 2025-03-04 19:53:01 +01:00
sfan5
2796283550 Remove broken fall bobbing 2025-03-04 19:53:01 +01:00
sfan5
7602308835 Revert "Restrict relative mouse mode to Wayland users (#15697)"
see #15761
SDL is the only device that supports relative mode and
mouse input is actually somewhat broken if it's *not* enabled.

This reverts commit 45c5ef8798
and 88b007907a.
2025-03-04 19:53:01 +01:00
sfan5
bc43019467 Fix TerminalChatConsole crash
this setting was removed in #15633
2025-03-04 19:53:01 +01:00
sfan5
8449f5f6db Make devtest grass use overlay tiles 2025-03-04 19:53:01 +01:00
Medley
0eb047ca33
Disable debug-breaking locale workaround when debugging (#15859) 2025-03-03 20:33:42 +01:00
wrrrzr
98048cb06d
Fix missing includes in skyparams.h 2025-03-03 20:33:19 +01:00
Erich Schubert
6e995972bb check y limits early 2025-03-03 20:33:05 +01:00
Erich Schubert
08fad862aa Code cleanups. Function does not return deco count. 2025-03-03 20:33:05 +01:00
sfan5
c3477a4d08 Adjust Android default view range and mapblock limit 2025-03-01 22:40:10 +01:00
sfan5
062207e696 Enforce minimum client_mapblock_limit depending on view range 2025-03-01 22:40:10 +01:00
SmallJoker
24c1230c7b Client: fix disappearing node inventories on older servers
ee9258ce introduced a logic error, which caused clients to lose
node metadata when they should not and vice-versa.
See also: server.cpp / Server::sendAddNode
2025-03-01 21:05:17 +01:00
sfan5
eb79a76742
Android: update SDL support code (#15853) 2025-03-01 18:27:46 +01:00
millennIumAMbiguity
c0328e5363
Centered title in README.md and added icon 2025-03-01 12:27:43 +01:00
Joshua Gerrish
8d822d8231
Fix compile error with MSVC: string is not a member of std 2025-03-01 12:26:33 +01:00
y5nw
a11b25f3f5 Use fallback font correctly for fonts provided by the server 2025-03-01 12:25:24 +01:00
Lars Mueller
90121dc66f Fix & improve glTF loader matrix decomposition 2025-02-27 12:31:04 +01:00
Lars Mueller
d74af2f1a7 Use matrix4::getRotationRadians 2025-02-27 12:31:04 +01:00
Lars Mueller
b6c71b2379 Improve matrix4::getRotationDegrees a bit, radians 2025-02-27 12:31:04 +01:00
Lars Mueller
c261c26456 Add Irrlicht rotation consistency unit tests 2025-02-27 12:31:04 +01:00
Lars Mueller
5abf220979 Fix random usage in matrix4 tests 2025-02-27 12:31:04 +01:00
Lars Mueller
1ceeea34f4 Extend quaternion tests 2025-02-27 12:31:04 +01:00
Lars Mueller
3ae1fd459a Add quaternion conversion unit tests 2025-02-27 12:31:04 +01:00
Lars Mueller
0e86366324 Add test for matrix4::getRotationDegrees 2025-02-27 12:31:04 +01:00
Erich Schubert
58ad604a4b
Note that core.hash_node_position is not a hash function 2025-02-27 12:30:55 +01:00
guinea7pig
415e96184d
Update copyright date in README 2025-02-26 12:22:19 +01:00
sfan5
8654e16725 Disable shadow force updates with performance_tradeoffs 2025-02-26 12:22:06 +01:00
sfan5
eb8b449817 Fix shadow performance regression due to force update
broken by: b861f0c5c5
2025-02-26 12:22:06 +01:00
sfan5
22c81e5292 Print if sdl2-compat is in use 2025-02-26 12:21:57 +01:00
sfan5
42a35cec83 Allow looking straight up or down 2025-02-26 12:21:57 +01:00
sfan5
fc8c6742c4 Update Wireshark dissector 2025-02-26 12:21:57 +01:00
sfan5
ee9258cefd Clean up some packet-related code 2025-02-26 12:21:57 +01:00
grorp
5e89371ecd
TouchControls: touch_use_crosshair, dig/place simulation refactoring (#15800)
-   get rid of simulated mouse events for digging/placing, use keyboard events
    instead
    -   consistent with other simulated events, less code, no need for a
        pointer position
    -   more correct: touch controls no longer break if you have custom
        dig/place keybindings set
-   move reading of "touch_use_crosshair" setting from Game to TouchControls
2025-02-25 13:19:44 -05:00
Andrii Nemchenko
abcd2e0b81
Re-save active entities more often if they move a certain distance (#15605) 2025-02-22 16:19:19 +01:00
sfan5
d12ce68e64 Show unknown object visuals using unknown_object.png sprite 2025-02-22 16:19:04 +01:00
sfan5
83fd837d75 Clean up TileLayer::applyMaterialOptions 2025-02-22 16:19:04 +01:00
sfan5
7d3f0628c4 Use visual = "node" for builtin falling node entity
This greatly simplifies the code at the expense of some
falling nodes not showing up on older clients.
2025-02-22 16:19:04 +01:00
sfan5
27bbe3a873 CAO 'node' visual (#15683) 2025-02-22 16:19:04 +01:00
sfan5
5a8720a484 Change material sharing for CMeshSceneNode 2025-02-22 16:19:04 +01:00
Andrii Nemchenko
e51221d247
Implement metadata-aware version of InvRef:remove_item() (#15771) 2025-02-22 16:18:48 +01:00
DS
0890125962
SDL Irr device: Ignore +-0.0f y mouse wheel events (#15815)
our code often assumes that it's non-zero, e.g.: `event.MouseInput.Wheel < 0 ? -1 : 1`
2025-02-22 16:17:07 +01:00
DS
0667cbf5a2
Clang-Tidy config: Ignore performance-avoid-endl and performance-inefficient-string-concatenation 2025-02-22 16:16:41 +01:00
sfan5
ba62808fe8
Basic camera control API (#15796) 2025-02-19 18:45:45 +01:00
James Morey
50819ace8f
Move clickable_chat_weblinks to Advanced > Miscellaneous (#15799) 2025-02-19 18:45:31 +01:00
et
ef0219c2ed
Prevent accidental wallmounted_to_dir poisoning (#15810)
Prior to this commit, if you used a function like `core.wallmounted_to_dir`, and modified its output, it would modify all of the output in the future.
2025-02-18 21:51:33 +01:00
sfan5
f4bdf72aa4 Simplify SQLite3 schema types
see: <https://www.sqlite.org/datatype3.html>
2025-02-18 19:29:06 +01:00
sfan5
cc352f3b66 Add unit tests for MapDatabase implementations 2025-02-18 19:29:06 +01:00
sfan5
215b000793 Split blockpos into three columns in sqlite3 map database 2025-02-18 19:29:06 +01:00
sfan5
e8728acc5c Some cleanups in Database_SQLite3 2025-02-18 19:29:06 +01:00
Desour
166e02955e Decrease fps_max_unfocused from 20 to 10
This used to be the default for android.
There's not much issues now with using a lower value, so a lower default on all platforms
is reasonable.
The only downside I know of is that if you re-focus the window, it can up till the
next client step until it goes back to normal fps, but 10 Hz feels fast enough.
2025-02-15 18:21:01 +01:00
Desour
138111a542 Don't use fps_max_unfocused for server step time on non-singleplayer main-menu-hosted servers
It's unreasonable to change server step time when the hosting user unfocuses their window.
(m_is_paused is already not set if it's not singleplayer.)
2025-02-15 18:21:01 +01:00
Desour
191cb117f9 Don't use fps_max_unfocused for the pause menu
Nowadays, we have things like buttons that change appearance on hover, or scoll bars
in the pause menu. These do not work fine with low fps.
2025-02-15 18:21:01 +01:00
Miguel P.L
a57677120a
Correct keycode URL in settingtypes.txt/minetest.conf.example (#15784) 2025-02-15 18:20:45 +01:00
sfan5
75dcd94b90
Optimize add_area_node_boxes in collision code (#15719) 2025-02-15 12:19:17 +01:00
sfan5
d027fc9a88 Enable ipv6_server by default 2025-02-15 12:18:07 +01:00
sfan5
a11d526110 Rework socket IPV6_V6ONLY handling 2025-02-15 12:18:07 +01:00
siliconsniffer
eb797c502a
Tweak main menu server list behavior (#15736)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2025-02-15 12:17:56 +01:00
Erich Schubert
567b9a997a
Collision: more accurate computation with acceleration and long dtime (#15408)
Co-authored-by: SmallJoker <mk939@ymail.com>
2025-02-15 12:17:44 +01:00
Lars Müller
319e270664
Clean up Irrlicht matrices a bit more (#15733) 2025-02-15 12:17:30 +01:00
sfan5
d015944f6c Revert "Disable SDL2 for 5.11.0"
This reverts commit 29cfb6efff.
2025-02-15 12:14:12 +01:00
Lars Müller
b7f01b0cc7
Don't save load_mod_* = false lines in world.mt (#15758) 2025-02-14 22:25:39 +01:00
sfan5
54bf5d62f2
Fix fgettext call in dlg_settings.lua
(#15614)
2025-02-14 22:17:10 +01:00
sfan5
849a583f66 Continue with 5.12.0-dev 2025-02-14 19:38:30 +01:00
sfan5
0cb7735125 Bump version to 5.11.0 2025-02-14 19:38:27 +01:00
sfan5
028949beca Delete empty languages 2025-02-14 19:13:14 +01:00
ninjum
6bdeb10c16 Translated using Weblate (Galician)
Currently translated at 99.9% (1391 of 1392 strings)
2025-02-14 19:11:16 +01:00
BlackImpostor
44cbae8fad Translated using Weblate (Russian)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:16 +01:00
waxtatect
f7b2d4760f Translated using Weblate (French)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:16 +01:00
109247019824
1ec19c2ad2 Translated using Weblate (Bulgarian)
Currently translated at 51.7% (721 of 1392 strings)
2025-02-14 19:11:12 +01:00
Linerly
9bfd39f036 Translated using Weblate (Indonesian)
Currently translated at 99.6% (1387 of 1392 strings)
2025-02-14 19:11:12 +01:00
Miguel
cfff6c4fd7 Translated using Weblate (Spanish)
Currently translated at 97.9% (1363 of 1392 strings)
2025-02-14 19:11:12 +01:00
Wuzzy
147dd3d372 Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:12 +01:00
sfan5
cda3dc08ca
Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:10:19 +01:00
mineplayer
78b4f929ce
Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:10:19 +01:00
Desour
2c50066c16 Keep the game paused in pause menu settings
The button_exit[]s were replaced by regular button[]s, to avoid a very short unpause when you
click the btn_settings (probably because it uses ClientEvent stuff).
2025-02-14 16:31:57 +01:00
ROllerozxa
dd0070a6b8
Expose client version information in non-debug builds (#15708)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
2025-02-09 18:09:07 +01:00
updatepo.sh
e6cf08169e Update translation files 2025-02-09 13:23:37 +01:00
updatepo.sh
0549b6ed0d Update minetest.conf.example and settings_translation_file.cpp 2025-02-09 13:23:22 +01:00
Ilia
3f58def52f Translated using Weblate (Persian)
Currently translated at 9.0% (125 of 1383 strings)
2025-02-09 13:22:18 +01:00
Тарас Арт
0f8723b021 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Wuzzy
323b31b89d Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
alasa ala
e9574586ea Translated using Weblate (Korean)
Currently translated at 50.0% (692 of 1383 strings)
2025-02-09 13:22:18 +01:00
Negoitescu
584595a78b Translated using Weblate (Romanian)
Currently translated at 55.6% (769 of 1383 strings)
2025-02-09 13:22:18 +01:00
Mateusz Mendel
24452785c2 Translated using Weblate (Polish)
Currently translated at 92.6% (1282 of 1383 strings)
2025-02-09 13:22:18 +01:00
Balázs Kovács
c7dacec94b Translated using Weblate (Hungarian)
Currently translated at 92.9% (1286 of 1383 strings)
2025-02-09 13:22:18 +01:00
Miguel
4255ea42ac Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
36f904b705 Translated using Weblate (Tamil)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Matyáš Pilz
309a394e06 Translated using Weblate (Czech)
Currently translated at 90.4% (1251 of 1383 strings)
2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
4f855ae3fd Added translation using Weblate (Tamil) 2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
5fcd4bd7d0 Added translation using Weblate (Tamil) 2025-02-09 13:22:18 +01:00
Poesty Li
ae61c66dd2 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 95.1% (1316 of 1383 strings)
2025-02-09 13:22:18 +01:00
Ricky Tigg
4167dc7dfc Translated using Weblate (Finnish)
Currently translated at 24.4% (338 of 1383 strings)
2025-02-09 13:22:18 +01:00
Yof
8f29b8f2ae Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Yof
fca69a9b2a Added translation using Weblate (Ukrainian) 2025-02-09 13:22:18 +01:00
BlackImpostor
785b8a2400 Translated using Weblate (Russian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
mineplayer
5ed14fe8c4 Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Siber
fa6c61bd69 Translated using Weblate (Turkish)
Currently translated at 83.3% (1153 of 1383 strings)
2025-02-09 13:22:18 +01:00
liu lizhi
61d7dc91c7 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 92.1% (1275 of 1383 strings)
2025-02-09 13:22:18 +01:00
109247019824
2f95b14f09 Translated using Weblate (Bulgarian)
Currently translated at 39.9% (553 of 1383 strings)
2025-02-09 13:22:18 +01:00
Lukáš Lizák
23527b5263 Translated using Weblate (Slovak)
Currently translated at 92.2% (1276 of 1383 strings)
2025-02-09 13:22:18 +01:00
Emil Faltynek
4cd58b8b04 Translated using Weblate (Czech)
Currently translated at 90.3% (1250 of 1383 strings)
2025-02-09 13:22:18 +01:00
Hugo
ccccfa8d5e Translated using Weblate (Esperanto)
Currently translated at 80.9% (1119 of 1383 strings)
2025-02-09 13:22:18 +01:00
Hugo
fbc3094065 Translated using Weblate (Spanish (American))
Currently translated at 28.4% (394 of 1383 strings)
2025-02-09 13:22:18 +01:00
Kevin Hagen
0f8984be2d Translated using Weblate (Filipino)
Currently translated at 36.5% (506 of 1383 strings)
2025-02-09 13:22:18 +01:00
cat
0bea91a7f5 Translated using Weblate (Danish)
Currently translated at 49.0% (678 of 1383 strings)
2025-02-09 13:22:18 +01:00
reimu105
6adb8f92d4 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 91.3% (1263 of 1383 strings)
2025-02-09 13:22:18 +01:00
Muhammad Nuruddin
9bd650ada2 Translated using Weblate (Malay)
Currently translated at 96.6% (1337 of 1383 strings)
2025-02-09 13:22:17 +01:00
Linerly
0fbedf828d Translated using Weblate (Indonesian)
Currently translated at 96.3% (1332 of 1383 strings)
2025-02-09 13:22:17 +01:00
ninjum
5a790ad702 Translated using Weblate (Galician)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
Oleg
a7fe400db9 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
ROllerozxa
ea9f8a9349 Translated using Weblate (Swedish)
Currently translated at 64.5% (893 of 1383 strings)
2025-02-09 13:22:17 +01:00
Stepan Bazrov
0db69655e1 Translated using Weblate (Russian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
sfan5
2515a40fff Fix some setting descriptions 2025-02-09 13:22:17 +01:00
wrrrzr
045951b23c
Const correct Thread class (#15741) 2025-02-09 12:20:47 +01:00
sfence
9166b57c2a
Try to fix macOS signature problem 2025-02-09 12:20:30 +01:00
Lars Müller
fd8d04ff76
GUI inventory list: Do not render clipped slots (#15764) 2025-02-09 12:19:25 +01:00
Miguel P.L
6def21b5e3
Rename Minetest to Luanti in CONTRIBUTING.md 2025-02-09 12:19:16 +01:00
grorp
2fb9e4d18a Fix enum setting used as requirement 2025-02-06 19:20:44 +01:00
siliconsniffer
36c9742c0a
Main menu server list: Select first compatible search result (#15755)
Fixes a bug where an incompatible server would be selected instead due to being the "first" result before grouping.
2025-02-06 19:19:38 +01:00
Montandalar
ec83312540
Change main website domain to www.luanti.org (#15748)
Renames all remaining occurences of minetest.net except for the "MS Windows icon resource" file
2025-02-06 19:16:24 +01:00
sfan5
1548b2ae9e
Update credits for 5.11.0 (#15753) 2025-02-05 21:02:09 +01:00
sfan5
0fa56a9f7c Revert "Prefer GL3 driver over legacy GL driver"
This reverts commit 9f52f84f2b
and ded8c25e34.
2025-02-04 12:19:18 +01:00
sfan5
88b007907a
Enable relative mouse mode on Android (#15750)
fixes #15727
2025-02-04 12:19:09 +01:00
Lars Müller
a73e71510a
Clamp client-sent movement speed control (#15721)
Results in the `movement_x` and `movement_y` fields of `player:get_player_control()` being safe to use
(otherwise users would need to compute the length as `(x^2 + y^2)^0.5` and clamp that to 1 themselves).
2025-02-04 12:19:00 +01:00
SmallJoker
b2a6c3ba23 Server: undo inventory client prediction
The affected player inventory list is now marked as modified.
This way, it will also be re-sent if the server denies the action.
2025-02-02 19:05:09 +01:00
SmallJoker
8caf922df6 InvRef: deduplicate code 2025-02-02 19:05:09 +01:00
SmallJoker
5419345dff
PauseMenuScripting: resolve absolute 'builtin' path before substring check (#15720)
In 99% of the cases, this behaviour is identical to before.
With this commit, it is again possible to have 'builtin' a symlink that e.g.
points to the engine source directory, which is helpful for development purposes.
2025-02-02 19:04:50 +01:00
cx384
a8c4c55d58
Document that object properties colors field is unused (#15685) 2025-02-02 19:04:18 +01:00
wrrrzr
f17498b049
Delete irrlichttypes_extrabloated.h (#15723)
Co-authored-by: cx384 <cx384@proton.me>
2025-02-01 13:41:51 +01:00
Stefan Beller
63e9b01f7d COSOperator: Use NSPasteboardTypeString instead of NSStringPboardType
According to https://developer.apple.com/documentation/appkit/nsstringpboardtype?language=objc
we can replace it with NSPasteboardTypeString:

> In apps that adopt App Sandbox, use an NSURL object, a bookmark, or a
> filename pasteboard type instead. In a nonsandboxed app, you can also
> use the NSPasteboardTypeString pasteboard type.
2025-02-01 13:41:17 +01:00
cathanof
db97b2bd93
Updates some Minetest references to Luanti (#15712) 2025-02-01 13:40:45 +01:00
sfan5
c0422b18e7
Propagate peer ID change to outgoing reliables (#15680)
Otherwise a desync could ocurr since the server does strict checking.
fixes #15627
2025-02-01 13:23:00 +01:00
sfan5
29cfb6efff
Disable SDL2 for 5.11.0 (#15704)
see #14545
2025-01-26 19:18:18 +01:00
Mark Wiemer
ffb4a5b565
Rename dev.minetest.net to dev.luanti.org (#15718) 2025-01-26 19:17:36 +01:00
AFCMS
99a27b7495
Fix documentation for the official Docker image (#15713) 2025-01-26 19:17:26 +01:00
cx384
e9826f7819
Move EnumString to separate file and add enum_to_string (#15714) 2025-01-26 19:17:14 +01:00
Erich Schubert
bee541f378
Lua get_biome_data: calc heat and humidity only once (#15715) 2025-01-26 19:17:02 +01:00
sfan5
45c5ef8798
Restrict relative mouse mode to Wayland users (#15697) 2025-01-26 19:16:46 +01:00
Stefan Beller
282c81fe3a
filesys: replace goto by #else to avoid compiler warning 2025-01-25 10:48:15 +01:00
sfan5
b861f0c5c5
Fix shadow flicker on camera offset update (#15709) 2025-01-25 10:47:52 +01:00
Lars Müller
7c6ade0fc5
Restore proper rollback database indexing (#15707) 2025-01-24 16:50:59 +01:00
grorp
41dfac96c1
Add setting callbacks for Camera and TouchControls (#15700) 2025-01-24 16:50:51 +01:00
sfan5
b5e084c9a5
Update github URL references (#15705) 2025-01-24 16:50:39 +01:00
fineless71
f592b57dc6
Fixed serialization_version and version_string key name in docs (#15699) 2025-01-23 12:18:30 +01:00
sfan5
a99e985674
Centralize arbitrary area volume limit and raise it (#15696) 2025-01-23 12:18:20 +01:00
SFENCE
af3f696423 Code style fixes. 2025-01-21 16:29:12 +01:00
SFENCE
24e9db07ec Check for indent spaces and fixed found problems. Lib C/C++ code is not checked. 2025-01-21 16:29:12 +01:00
Lars Müller
547e1476bb
Allow overriding fonts via media files (#15606)
Co-authored-by: sfan5 <sfan5@live.de>
2025-01-19 20:42:40 +01:00
grorp
eeb6cab4c4
In-game settings menu using separate Lua environment (#15614) 2025-01-19 13:07:04 -05:00
sfan5
3cb07d5fb6 Add limited game auto-selection to dedicated server 2025-01-19 18:39:32 +01:00
sfan5
a262be6a47 Move camera offset to consistent point in game loop
fixes #10027
2025-01-19 18:39:32 +01:00
sfan5
e5f276ecee Apply some minor code cleanups 2025-01-19 18:39:32 +01:00
sfan5
94239153b5 Fix map rendering glitches on camera offset update
(regression)
2025-01-19 18:39:32 +01:00
Zughy
f6a0bf915d
Remove built-in knockback in next major release 2025-01-18 00:27:57 +01:00
Lars Müller
8719a816e7
Fix CMatrix<T>::getScale returning negative scale (#15687) 2025-01-18 00:27:27 +01:00
rubenwardy
c8b5e3b741
Update my email in SECURITY.md 2025-01-15 22:15:48 +01:00
sfan5
cf074dd271
Cache grouped sparse buffers (#15594)
continuation of #15531
2025-01-14 23:40:57 +01:00
cosin15
7053348e31
Fix buggy memcpy call in a template (#15672) 2025-01-14 20:26:29 +01:00
DS
2bfcd45b35
Fix always waving semitransparent liquid regression 2025-01-13 09:39:20 +01:00
sfan5
636a734d78
Resolve some quirks with (wield) item meshes for nodes (#15654) 2025-01-13 09:39:06 +01:00
cx384
464cc92521 Main menu server tab mods button (#15561)
Co-authored-by: Lars Müller <appgurulars@gmx.de>
2025-01-12 16:23:56 +01:00
cx384
5aeaf20849 CI png optimized check 2025-01-12 16:15:01 +01:00
cx384
1427a98c59 Optimize png files 2025-01-12 16:15:01 +01:00
sfan5
903d13ffff Make sure mod paths are always absolute 2025-01-12 14:49:25 +01:00
sfan5
d0d7c11fe1 Stop ServerThread immediately on errors 2025-01-12 14:49:25 +01:00
sfan5
9dd09d1056 Prevent VoxelManipulator size overflow 2025-01-12 14:49:25 +01:00
sfan5
2cdf3af1b8 Reduce size of SMaterial struct 2025-01-12 14:49:25 +01:00
Hanicef
be75e42d77
Improve sleep accuracy on FPS limiter (#15648) 2025-01-12 14:49:13 +01:00
chmodsayshello
d4a6df3389
Add chat console scrollbar (#15104) 2025-01-12 14:49:01 +01:00
lhofhansl
d15214af52
Remove shadow direction quantization, increase shadow update frames instead (#15665)
* This removes shadow direction quantization and defaults shadow_update_frames to 16 instead.
2025-01-11 16:41:50 -08:00
Desour
d044c27b5f MeshMakeData: Explain members, and add grid size and minimap flag 2025-01-11 16:43:37 +01:00
Desour
c0ce918d77 Meshgen: Handle enable_water_reflections like smooth_lighting 2025-01-11 16:43:37 +01:00
Desour
9a60b83061 Rename meshgen lighting variables 2025-01-11 16:43:37 +01:00
Desour
7ba5973108 Get rid of MapblockMeshGenerator::cur_node.light 2025-01-11 16:43:37 +01:00
Desour
c4bfa65201 Fix black plantlike_rooted without smoothlighting
There was code to take the light of the node above, but the color was not updated.
To reproduce, don't set paramtype="light", (i.e. not what all the devtest nodes do).
2025-01-11 16:43:37 +01:00
Desour
6a1b4a93c7 MapblockMeshGenerator: Move unsmooth lighting color out of useTile, and instead compute it once per node 2025-01-11 16:43:37 +01:00
Desour
3becbda0aa Get rid of MapblockMeshGenerator::cur_node.scale 2025-01-11 16:43:37 +01:00
Desour
a14b8d0976 Get rid of MapblockMeshGenerator::cur_node.tile
There is more than one tile per node, so it shouldn't be stored like this.
This makes MapblockMeshGenerator less stateful.
2025-01-11 16:43:37 +01:00
Desour
966abc85da transformNodeBox(): Rotate first by facedir 2025-01-11 16:43:37 +01:00
Desour
1e81c454c8 transformNodeBox(): Replace BOXESPUSHBACK macro with a lambda 2025-01-11 16:43:37 +01:00
Desour
cbc074feb5 Remove the unnecessary MeshCollector::append overload 2025-01-11 16:43:37 +01:00
DS
436b391a80
VoxelArea: Fix missing cacheExtent calls in helpers (#15657) 2025-01-11 16:43:20 +01:00
cosin15
37899f7a14
Fix CFileSystem::FileSystemType related UB (#15669) 2025-01-11 16:42:36 +01:00
sfan5
e5542e5b02
Remove or restrict some client settings (#15633) 2025-01-08 10:56:45 +01:00
sfan5
41f7031e49
Fix reduced bloom at 10 bits
forgotten in eb8beb335e
2025-01-08 10:56:28 +01:00
Lars Müller
7f1316236b
Silence failing raycast unit test (#15644)
The cause for the test failure is an edge case bug
in the raycast implementation (perfectly diagonal raycasts).

This is fixed by switching to a continuous random distribution
which makes it extremely unlikely that the buggy edge case occurs.

Additionally, devtest unit test failures now print their random seed
to be easier to reproduce in the future.
2025-01-08 10:56:05 +01:00
sfan5
c346612468
Fix falling nodes digging nodes they aren't supposed to (#15638) 2025-01-06 19:42:11 +01:00
DS
431c5c8b36
Fix wireframe mode in opengl3 driver (#15626)
`GL_LINES` isn't suitable, because it makes lines between pairs of 2 vertices,
not loops around 3 vertices.
Support for OpenGL ES isn't simple, as it has no `glPolygonMode`. And showing broken
wireframe (i.e. with `GL_LINES`) would cause confusion.
2025-01-06 19:39:17 +01:00
Lars Müller
f467bde6ac
Add unit test for raycasts falsely skipping nodes (#15555) 2025-01-05 16:32:09 +01:00
sfan5
06f39e1915 Fix missing bounding box for CAO 'wielditem' visual 2025-01-05 16:30:53 +01:00
sfan5
4774e65ed9 Implement polygon offset in GL3 driver 2025-01-05 16:30:53 +01:00
sfan5
5b14c03301 Use polygon offset to fix z-fighting for overlay tiles 2025-01-05 16:30:53 +01:00
wrrrzr
dfd7628950
Rename getGameMinetestConfig to getGameConfig 2025-01-05 13:20:37 +01:00
DS
4c4918b154
Fix show_debug setting causing inconsistency between debug control and shown debug info 2025-01-05 13:20:21 +01:00
sfan5
5bcb7983ec Fix missing bounding box for upright_sprite
(also simplifies the mesh building)
fixes #15616
2025-01-04 12:40:14 +01:00
sfan5
0614b175b5 Optimize draw3DBox generic case 2025-01-04 12:40:14 +01:00
sfan5
4e2ca05f08 Add debug mode that shows mesh buffer bounding boxes 2025-01-04 12:40:14 +01:00
sfan5
9554e3d43a Add support for glObjectLabel to aid debugging 2025-01-04 12:40:14 +01:00
wrrrzr
d2004d32f6
Move AutoExposure constructor to header 2025-01-04 12:39:52 +01:00
SmallJoker
e8f6127779
Reduce irrlicht_extrabloated.h includes in header files 2025-01-04 12:39:34 +01:00
sfan5
81f51492ff
Don't silence errorstream in tests (#15629) 2025-01-04 12:39:16 +01:00
JosiahWI
eb512cc36a
Eliminate superfluous null check in CGUIEnvironment::getNextElement 2025-01-04 12:38:38 +01:00
cx384
c4d624083d Main menu server tab search improvements 2025-01-02 15:22:49 +01:00
wozrer
a1b8d20f18 Rename getMapSettingNoiseParams to getNoiseParams 2025-01-02 14:59:19 +01:00
sfan5
0a67e6180d Disable failing unit test for the time being
see #15598
2025-01-02 12:42:19 +01:00
lhofhansl
2db4ad8c77
Fix MSAA and bloom flashing artifacts (#15610)
* Mark varColor and nightratio as centroids
* Leave old workaround in place for GLES
2025-01-01 14:18:05 -08:00
grorp
f54d209bc8
Remove normal map leftovers (#15609)
leftovers from #10487 / ed22260822
2024-12-31 19:28:57 +01:00
sfan5
a4d2633ac6 Minor improvements in ImageSource code 2024-12-31 14:47:46 +01:00
sfan5
f37f9a6f0b Optimize getImageAverageColor
also fixes a bug with non-square handling

before:
  getImageAverageColor [us] _____________________  804x  11.253

after:
  imageAverageColorInline [us] __________________  804x   0.557
2024-12-31 14:47:46 +01:00
sfan5
ded8c25e34 Change default post_processing_texture_bits to 10
Since the legacy GL driver is no longer the default,
we don't run into a situation where an unintended fallback to 8-bit happens.
2024-12-31 14:47:46 +01:00
sfan5
1a6ae148b7 Update texture_min_size description 2024-12-31 14:47:46 +01:00
sfan5
8c52d5f2dd Implement LODBias in GL3 driver
(currently unused)
2024-12-31 14:47:46 +01:00
sfan5
1ea8763259 Clean up Irrlicht shader API 2024-12-31 14:47:46 +01:00
sfan5
40afc84597 Replace data structure for HW buffer book-keeping
before
  time in endScene ÷ num hw buf ________________  199x   0.128
after
  time in endScene ÷ num hw buf ________________  199x   0.057
2024-12-31 14:47:46 +01:00
sfan5
a2058f7f3a Avoid some inefficiencies when handling ItemStack(Metadata) 2024-12-31 14:47:46 +01:00
sfan5
d884a1624f Show active HW buffers in profiler 2024-12-31 14:47:46 +01:00
grorp
b50b619be7
Add explanation to touchscreen item tooltip code (#15607)
this explains some cryptic inventory code I wrote in #14029 / 771da80bbb
2024-12-31 14:11:17 +01:00
grorp
27c3aade5d
TouchControls: More methods instead of static functions (#15602) 2024-12-30 19:03:32 +01:00
sfan5
f2b1cc3e61
Fix situation around aabbox3d default constructor (#15586)
Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
2024-12-29 14:36:30 +01:00
wrrrzr
cca65fde08
Controls: extract init_joysticks (#15597) 2024-12-28 22:05:01 +01:00
SmallJoker
35bc217ba8
IrrlichtMt: Move OpenGL 3+ transformation matrix to shaders (#15591)
This replaces annoying calculations on C++-side and eases the
implementation of 2D geometry batch rendering a lot.
2024-12-28 22:04:05 +01:00
Lars Müller
412cc96bc9
Fix some compiler warnings (#15596) 2024-12-26 11:29:00 +01:00
sfan5
d2a7875b5b Group sparse mesh buffers over entire scene for rendering 2024-12-24 15:27:08 +01:00
sfan5
612d4f9656 Improve quicktune feature a bit 2024-12-24 15:27:08 +01:00
sfan5
33b8307119 OpenGL: allow uploads of buffers to hardware ahead-of-time 2024-12-24 15:27:08 +01:00
sfan5
bb550158fc OpenGL: encapsulate VBOs into a class
internal only for now but this will be handy
2024-12-24 15:27:08 +01:00
Lars Müller
b087e2554f
Add glTF STEP interpolation support (#15525) 2024-12-24 15:25:07 +01:00
SmallJoker
d1dd044455
Reorder client initialization (#15554)
Previously, ServerEnv created a player instance before they're fully initialized.
This commit moves all initialization steps and callbacks into TOSERVER_CLIENT_READY
^ which includes StageTwoClientInit for player loading or creation
2024-12-24 15:24:56 +01:00
sfan5
c49ff76955
IGUIFont / CGUITTFont code cleanups (#15581) 2024-12-23 12:49:47 +01:00
sfan5
0bfd9bc09e Condense renderer information into a single string 2024-12-23 12:49:31 +01:00
sfan5
9f52f84f2b Prefer GL3 driver over legacy GL driver 2024-12-23 12:49:31 +01:00
cx384
83bc27d99d Move formspec code from game.cpp to separate file 2024-12-21 18:43:05 +01:00
sfan5
d4ccc8de79 Fix incorrect handling of skinned meshes as mesh nodes
fixes #15576
2024-12-20 19:04:56 +01:00
siliconsniffer
7bf0b1fc7e
Add server url button to main menu (#15536)
Co-authored-by: Zughy <63455151+Zughy@users.noreply.github.com>
2024-12-20 15:04:26 +01:00
sfan5
a6293b9861 Initial refactoring on shader usage and generation
`IShaderSource` was designed with the idea that if you want a shader,
you must want it for a node. So it depends heavily on being given a tile
material and the node drawtype. But this doesn't make sense neither in theory
nor in practice.
This commit takes a small step towards removing the incorrect abstraction.
2024-12-20 15:04:08 +01:00
sfan5
eb8beb335e Fix bloom with post_processing_texture_bits < 16 2024-12-20 15:04:08 +01:00
sfan5
7354cbe463 Fix core::array::reallocate when shrinking 2024-12-20 15:04:08 +01:00
cx384
f06383f78c
Minor API reference fixes 2024-12-20 15:03:55 +01:00
cx384
b172e67295
Remove game_ui from Client class 2024-12-20 15:03:45 +01:00
sfan5
10f1e142f6
Fix threshold value for imageCleanTransparent
fixes #15401
2024-12-20 15:03:30 +01:00
Lars Müller
a37bdbf8b7
Restore .x models to working state (#15550)
* Add "lava flan" (.x model) smoke test

* Fix double finalize in `.x` mesh loader

* Use reserve instead of resize again

The weights are added indirectly via `AnimatedMesh->addWeight`
2024-12-18 20:29:35 +01:00
Lars Müller
f99a1a7c7c Revert "Optimize raycast performance (#15233)"
This reverts commit f7a695c212.
2024-12-14 19:29:00 +01:00
Lars Müller
52a6673dab
Get rid of obsolete workaround for collision detection bugs (#15540) 2024-12-14 17:04:12 +01:00
Lars Müller
fef28aced9
Irrlicht: Get rid of obsolete setDebugName (#15541)
Co-authored-by: sfan5 <sfan5@live.de>
2024-12-14 17:03:08 +01:00
Lars Müller
23e502fa0e
Test & document conventions used by matrix4::setRotation* (#15542)
Also includes a minor `matrix4::transformVect` refactor to make testing easier.
2024-12-14 17:02:16 +01:00
sfence
f7a695c212
Optimize raycast performance (#15233)
by skipping nodes not on the ray with selection boxes smaller than 1x1x1 early on
2024-12-14 17:01:06 +01:00
Wuzzy
ba63c1505a
Docs: Change translation example from NS to PS (#15476)
The currently established convention uses `NS` for "translation no-ops", i.e., it will be collected by a string-collecting utility but not be translated by Luanti at this place.

We don't want to mislead modders with this example into using `NS` for plural forms instead, breaking with the established convention and making use of automated tools harder.

See also: https://github.com/minetest/modtools/pull/11
2024-12-14 16:59:29 +01:00
y5nw
ac7406c8a1
Fixup parsing for Plural-Forms (#15519) 2024-12-12 15:33:34 +01:00
Lars Müller
1e59b9a756
Refactor SkinnedMesh (#15522) 2024-12-12 15:33:08 +01:00
SmallJoker
d123bc0951
Main menu: show favorite removal button for offline servers (#15530)
This fixes a regression from 6c324cb871.
2024-12-12 15:31:48 +01:00
Timur1324
9f71e74158
Get server list over https (#15538) 2024-12-12 15:31:12 +01:00
DS
bcbee873e8
Use openssl's sha1 and sha256, optionally (#15472) 2024-12-10 22:00:43 +01:00
sfan5
4f800dd2b4 Change VoxelArea volume to be u32 2024-12-10 22:00:28 +01:00
sfan5
67126cbd1b Fix meaning of VoxelArea::hasEmptyExtent() 2024-12-10 22:00:28 +01:00
sfan5
8957739cdf Use appropriate sized type for VoxelArea extent 2024-12-10 22:00:28 +01:00
Lars Mueller
3c5e0d10fc Rotate meshnode normals correctly instead of recalculating 2024-12-10 22:00:18 +01:00
sfan5
21437090b8 Don't recalculate meshnode normals unnecessarily 2024-12-10 22:00:18 +01:00
siliconsniffer
eb6731bdc6
Main menu: Add server favorite button (#15486)
This adopts PR 13446.
2024-12-08 20:28:37 +01:00
SmallJoker
480eb7d816 Mapgen: Fix biome Y calculation regression
BiomeGen::getNextTransitionY(y) did not guarantee the condition (y < biome_y_min)
of the next loop because the function may return the value (biome_y_min - 1).
Hence, the biome was not updated until one Y coordinate after.
2024-12-08 20:27:33 +01:00
SmallJoker
50928b9759 Mapgen: Add rudimentary unittests 2024-12-08 20:27:33 +01:00
cx384
c7fe2ee5c9
Add core.spawn_tree_on_vmanip (#15415)
This function works like `core.spawn_tree`, but spawns an L-system tree onto a VoxelManip object instead on the map.
2024-12-08 20:27:22 +01:00
Lars Müller
8d43ad2522
Migrate rendered Lua API docs CNAME to api.luanti.org 2024-12-08 19:48:52 +01:00
Lars Müller
ae96a8d4fa
Fix mainmenu crash if no servers match search
fixes a regression caused by 6c324cb
2024-12-06 22:01:31 +01:00
veprogames
b857798848
Fix distorted Sun, Moon and Star visuals based on Orbit Tilt (#15459) 2024-12-06 22:00:06 +01:00
SmallJoker
5a8412dd23
Formspec: Move tooltip above cursor when lacking space (#15470) 2024-12-06 21:59:51 +01:00
cx384
88c845166c
Fix L-System trees fruit node regression (#15513) 2024-12-06 18:06:27 +01:00
Lars Müller
05d31222f7
Allow non-normalized weights in glTF models (#15310)
We are being lax here, but the glTF specification just requires that "when the weights are stored using float component type, their linear sum SHOULD be as close as reasonably possible to 1.0 for a given vertex"

In particular weights > 1 and weight sums well below or above 1 can be observed in models exported by Blender if they aren't manually normalized.
These fail the glTF validator but Irrlicht normalizes weights itself so we can support them just fine.

The docs have been updated to recommend normalizing weights (as well as documenting the status of interpolation support).

Weights < 0, most of them close to 0, also occur. Consistent with Irrlicht, we ignore them, but we also raise a warning.
2024-12-06 18:05:03 +01:00
Lars Müller
3e10d9ccf5
Refactor: Merge [IC]SkinnedMesh into SkinnedMesh (#15511) 2024-12-06 18:03:44 +01:00
sfan5
810f39767c Move SMaterial std::hash impl to its header 2024-12-04 18:20:34 +01:00
sfan5
a799a54894 Fix some issues with mt_opengl 2024-12-04 18:20:34 +01:00
sfan5
1fb7202028 GL: fix and clean up some code 2024-12-04 18:20:34 +01:00
sfan5
36edc3f161 Add 10-bit texture format and setting to chose PP color depth
(and move some settings to the advanced category)
2024-12-04 18:20:34 +01:00
AFCMS
e545e96d2b
Make string to v3f parsing consistent, replace core.setting_get_pos() by core.settings:get_pos() (#15438)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2024-12-04 18:19:46 +01:00
Lars Müller
18caf3a18d
Fix false positive compiler warning 2024-12-04 18:19:12 +01:00
HybridDog
a45b04ffb4
Less explicit memory management in Irrlicht image writer classes (#15493)
CImageWriterPNG::writeImage() and writeJPEGFile() explicitly allocate
and deallocate memory with `new` and `delete`, which is prone to programming errors.
The code also has non-functional error handling:
When memory allocation fails, `new` throws an `std::bad_alloc` exception
and never returns `nullptr`, so the check for `nullptr` is always false.

Co-authored-by: DS <ds.desour@proton.me>
2024-12-03 16:52:48 +01:00
JosiahWI
03813a5b5e
Use CMake list directives where appropriate
I think this communicates the intent a little better than using a `set`
directive, and it makes the code a little less verbose, too.
2024-12-03 16:52:15 +01:00
JosiahWI
818bca68d1
Use add_compile_options where appropriate 2024-12-03 16:51:53 +01:00
sfan5
a4d1b5b155
Fix script security path normalization in presence of links (#15481) 2024-12-03 16:51:34 +01:00
wrrrzr
e9080f91f2
Cleanup ban.cpp/h (#15496)
Make BanManager more const correctly
Delete unused includes
2024-12-01 20:52:13 +01:00
Kevin @ Sesam Solutions
7cc5a6ec68
Add Minetest keyword for backwards compatibility (#15491)
This helps people looking for `minetest`
2024-12-01 20:51:33 +01:00
JosiahWI
c3db9492a7
Update CMakeLists to use add_compile_definitions (#15483)
This is a newer feature introduced in CMake 3.12, which is now our
minimum version. It supercedes `add_definitions`. I've also replaced
some calls to set `CMAKE_<LANG>_FLAGS` that were used to set
definitions. This is a fairly trivial routine build maintenance that
is not intended to have any behavioral effects.
2024-11-29 12:02:48 +01:00
Lars Müller
d068f34753
Get rid of definitelyIdentityMatrix (#15480) 2024-11-29 12:00:09 +01:00
DS
df4e70b2c7
Add a setting to group transparency sorted triangles by buffer (#15115) 2024-11-28 14:22:53 +01:00
SmallJoker
c175046d30
Network: Fix serialization version checks (#15477)
This fixes some incorrect assumptions that the read and write version ranges are identical - whereas they're in fact not.
2024-11-27 18:39:57 +01:00
Lars Müller
6c324cb871
Main menu: Fix server selection (#15466)
Server selections are now always correct (no more arbitrarily changing selections if the order of the serverlist changes) and consistent with the address + port in the sidebar.
2024-11-27 18:39:28 +01:00
lhofhansl
8c56434bd3
Clamp pre-bloom color to valid range (#15453)
That avoids flashing artifacts when combining MSAA and bloom.
2024-11-25 11:56:32 -08:00
Lars Müller
b77ad82fb9
Sanitize invalid particle spawner time (#15465) 2024-11-24 19:23:53 +01:00
veprogames
11b19cd126
Doc: Add missing jpeg package for Arch Linux (#15461) 2024-11-24 19:23:32 +01:00
grorp
6a1d22b2c5
Implement an editor to customize the touchscreen controls (#14933)
- The editor is accessible via the pause menu and the settings menu.
- Buttons can be moved via drag & drop.
- Buttons can be added/removed. The grid menu added by #14918 is used to show
  all buttons not included in the layout.
- Custom layouts are responsive and adapt to changed screen size / DPI /
  hud_scaling.
- The layout is saved as JSON in the "touch_layout" setting.
2024-11-24 11:33:39 +01:00
luk3yx
4faa16fe0d
Clarify behaviour of core.hypertext_escape (#15464) 2024-11-22 17:56:35 +01:00
siliconsniffer
b6eaf7b5a4
Main menu: Player list for public servers (#15425) 2024-11-21 20:34:40 +01:00
Richard Try
946b3a4222
Typo in lua_api.md (#15440)
Duplicate text removed.
2024-11-20 18:36:35 +00:00
Christian Betancourt Dias
b63e988bd6
Fix naming conventions for CMatrix4::set(Inverse)RotationRadians() (#15204) 2024-11-19 13:38:19 +01:00
Lars Müller
15e8f9e6a0
Fix rendering regression with TGA type 1 files with BGRA8 color (#15402)
TGA uses BGR(A)8, stored in memory in that order. Irrlicht typically expects 0xAARRGGBB, which depends on endianness.
(This means that on little endian, no [B][G][R][A] -> 0xAARRGGBB conversion needs to be done, but Irrlicht was swapping the bytes.)

This makes both conversion functions consistently convert from [B][G][R]([A]) to 0xAARRGGBB (SColor), documents them properly and moves them to CImageLoaderTGA.cpp
so no poor soul shall be fooled by them in the near future.

---------

Co-authored-by: Ælla Chiana Moskopp <erle@dieweltistgarnichtso.net>
2024-11-19 13:37:05 +01:00
Lars Müller
138052adfc
Add particle blend mode "clip" (#15444)
This lets modders avoid alpha blending rendering bugs as well as potential (future) performance issues.
The appropriate blend modes are also used for node dig particles.

---------

Co-authored-by: sfan5 <sfan5@live.de>
2024-11-19 13:30:17 +01:00
sfan5
f493e73aeb Fix changing secure settings from mainmenu
forgotten in ea4ae55e24
closes #15454
2024-11-18 23:58:42 +01:00
grorp
9b6a399011
Implement support for FSAA in combination with post-processing (#15392)
- Actually it's MSAA I think, or perhaps the terms are equivalent
- I've made it fit into the existing Irrlicht architecture, but that has resulted in code duplication compared to my original "hacky" approach
- OpenGL 3.2+ and OpenGL ES 3.1+ are supported
- EDT_OPENGL3 is not required, EDT_OPENGL works too
- Helpful tutorial: https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing, section "Off-screen MSAA"
- This may be rough around the edges, but in general it works
2024-11-18 14:06:48 +01:00
veprogames
a8ea165042
Replace occurences of 'wiki.minetest.net' with 'wiki.luanti.org' 2024-11-18 00:04:32 +01:00
HybridDog
7295b6c88c
Remove unused and rarely used irrlicht color functions (#15442)
SColor.h contains many functions which are unused and/or perform linear
operations on non-linear 8 bit sRGB color values, such as the plus operator and
`SColor::getInterpolated()`, and there is no documentation about missing gamma
correction.
Some of these functions are not called or called only once:
* `getAverage(s16 color)`: Unused
* `SColor::getLightness()`: Unused
* `SColor::getAverage()`: Claims to determine a color's average intensity but
  calculates something significantly different since SColor represents
  non-linear sRGB values.
* `SColor::getInterpolated_quadratic()`: Claims to interpolate between colors
  but uses the sRGB color space, which is neither physically nor perceptually
  linear.
* `SColorf::getInterpolated_quadratic()`: Unused
* `SColorf::setColorComponentValue()`: Unused

Removing or inlining these functions can simplify the code and documenting
gamma-incorrect operations can reduce confusion about what the functions do.

This commit does the following:
* Remove the above-mentioned unused functions
* Inline `SColor::getAverage()` into
  `CIrrDeviceLinux::TextureToMonochromeCursor()`
* Rename `SColor::getLuminance()` into `SColor::getBrightness()` since it does
  not determine a color's luminance but calculates something which differs
  significantly from physical luminance since SColor represents non-linear sRGB
  values.
* Inline `SColor::getInterpolated_quadratic()` into `GameUI::update()`,
  where it is only used for the alpha value calculation for fading
* Document gamma-incorrect behaviour in docstrings
2024-11-18 00:02:53 +01:00
sfan5
8d2e770361 Minor corrections in gl3/gles2 drivers 2024-11-16 16:54:22 +01:00
sfan5
cc8c3d501c Don't keep a copy of all texture images around 2024-11-16 16:54:22 +01:00
sfan5
58ccf0ba82 Fix some smaller issues with texture/image handling 2024-11-16 16:54:22 +01:00
sfan5
4aae31ad5e Add support for ECF_D24 texture format
and prefer it over D32 for our depth buffer, this can have performance benefits
2024-11-16 16:54:22 +01:00
sfan5
3c42cc8684 Revive texture download code and fix it on GLES 2024-11-16 16:54:22 +01:00
sfan5
11837d4623
Remove BMP image support (#15434)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-11-15 12:21:30 +01:00
Erich Schubert
46f0baff09
Improve documentation of liquid_surface (#15012) 2024-11-15 12:19:41 +01:00
SmallJoker
8f03b70584 IrrlichtMt: Document Driver/Device compatibility 2024-11-15 12:18:48 +01:00
SmallJoker
4838eb2f7d Non-SDL: Add opengl3 support 2024-11-15 12:18:48 +01:00
SmallJoker
87ac32edea Dynamic shadows: whitelist the 'opengl3' driver 2024-11-15 12:18:48 +01:00
sfence
58dd42166d
Add some info to compiling README 2024-11-15 11:39:08 +01:00
grorp
a9fe83126a
Get rid of depth buffer workaround in the render pipeline code (#15407)
I originally wanted to get of the legacy IVideoDriver::setRenderTarget altogether,
but that ended up being too much work.
The remaining usage is in "dynamicshadowsrender.cpp".

Here's a comment I wrote about the workaround:

----------------------------------------

Use legacy call when there's single texture without depth texture
This means Irrlicht creates a depth texture for us and binds it to the FBO

This is currently necessary for a working depth buffer in the following cases:

- post-processing disabled, undersampling enabled
  (addUpscaling specifies no depth texture)

- post-processing disabled, 3d_mode = sidebyside / topbottom / crossview
  (populateSideBySidePipeline specifies no depth texture)

- post-processing disabled, 3d_mode = interlaced
  (probably, can't test since it's broken)
  (populateInterlacedPipeline specifies no depth texture)

With post-processing disabled, the world is rendered to the TextureBufferOutput
created in the functions listed above, so a depth buffer is needed
(-> this workaround is needed).
With post-processing enabled, only a fullscreen rectangle is rendered to
this TextureBufferOutput, so a depth buffer isn't actually needed.
But: These pipeline steps shouldn't rely on what ends up being rendered to
the TextureBufferOutput they provide, since that may change.

This workaround was added in 1e96403954 /
https://irc.minetest.net/minetest-dev/2022-10-04#i_6021940

This workaround should be replaced by explicitly configuring depth
textures where needed.

----------------------------------------
2024-11-15 11:38:56 +01:00
cx384
d4378a74d3
Fix register_ore ore_type error handling 2024-11-15 11:37:17 +01:00
sfan5
0c3117f9b3 Fix mainmenu settings crash caused by last commit
closes #15432
2024-11-13 18:39:10 +01:00
sfan5
794aea8e92
Drop fixed pipeline support code (#15421)
OpenGL 2.0 is now mandatory.
2024-11-13 14:24:01 +01:00
veprogames
0fde9ab7e8
Change minetest.net to luanti.org in 'Further documentation' 2024-11-13 14:23:39 +01:00
grorp
11e04ec113
Replace forgotten SEvent memset 2024-11-13 14:23:13 +01:00
sfan5
ea4ae55e24 Implement script sandboxing for main menu 2024-11-13 14:22:41 +01:00
sfan5
1fd4e0b82d Refactor ScriptApiSecurity for cleaner separation of concerns 2024-11-13 14:22:41 +01:00
Erich Schubert
4c44942a39
Add weights to biomes (#15142) 2024-11-12 10:53:17 +01:00
cx384
44b261d136
Luacheck: add VoxelManip to globals 2024-11-12 10:53:04 +01:00
sfan5
c00129360e Remove unused pos_max_d 2024-11-12 10:52:46 +01:00
sfan5
9a44d835d6 Remove redundant CollisionInfo::plane 2024-11-12 10:52:46 +01:00
sfan5
f916f5de78 Add basic unit tests for collisionMoveSimple 2024-11-12 10:52:46 +01:00
wrrrzr
1c92d6243f
MainMenuManager: fix FIXME (#15414) 2024-11-12 10:52:37 +01:00
grorp
af61de7777
Minor rendering code fixes (#15399)
* Fix line numbers in shader errors
* Fix uninitialized variables in shadow code
2024-11-12 10:52:20 +01:00
sfan5
a5e3fca40c Revert "Disable SDL2 for 5.10.0 (#15284)"
This reverts commit 6d7a519740.
2024-11-10 20:56:09 +01:00
sfan5
8503d8de5e Continue with 5.11.0-dev 2024-11-10 19:17:56 +01:00
sfan5
568f7a8e8f Bump version to 5.10.0 2024-11-10 19:17:53 +01:00
ROllerozxa
a983b72713
Add Fastlane metadata for F-Droid (#15411)
Co-authored-by: grorp <grorp@posteo.de>
2024-11-10 19:08:08 +01:00
sfence
e55ba9c390
Support generation of working Xcode project for signature purposes on MacOS (#15303) 2024-11-10 19:06:52 +01:00
sfan5
ec7738934b CI: fix workflows not running on translation update 2024-11-10 18:31:56 +01:00
chocomint
fbab80fced Translated using Weblate (Spanish (American))
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/es_US/
2024-11-10 18:15:45 +01:00
chocomint
3b2abbea70 Added translation using Weblate (Spanish (American)) 2024-11-10 18:15:45 +01:00
gallegonovato
998d1a2b8c Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
9a7471c5c0 Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
21c8c141aa Added translation using Weblate (Spanish) 2024-11-10 18:15:45 +01:00
waxtatect
c2e89c5b6f Translated using Weblate (French)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
Yof
cf76dac464 Translated using Weblate (Ukrainian)
Currently translated at 94.6% (1309 of 1383 strings)
2024-11-10 18:15:45 +01:00
ninjum
d9df06cda3 Translated using Weblate (Galician)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
grorp
66a5ddca25 Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
0be1fe11ca Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
812abba33b Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
2d6592a804 Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
e23c191232 Translated using Weblate (Spanish)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
58ebe0a58f Translated using Weblate (Spanish)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
000f0c78bc Translated using Weblate (Spanish)
Currently translated at 99.3% (1374 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
aaf4877730 Translated using Weblate (Spanish)
Currently translated at 99.3% (1374 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
0c61461b07 Translated using Weblate (Spanish)
Currently translated at 99.1% (1371 of 1383 strings)
2024-11-10 18:15:44 +01:00
gallegonovato
31c50c470c Translated using Weblate (Spanish)
Currently translated at 99.1% (1371 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
62bee9f502 Translated using Weblate (Spanish)
Currently translated at 98.7% (1366 of 1383 strings)
2024-11-10 18:15:44 +01:00
y5nw
112c0719cd Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 91.7% (1269 of 1383 strings)
2024-11-10 18:15:44 +01:00
gallegonovato
c96455b2e4 Translated using Weblate (Spanish)
Currently translated at 98.6% (1365 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
eed109c724 Translated using Weblate (Spanish)
Currently translated at 96.6% (1337 of 1383 strings)
2024-11-10 18:15:44 +01:00
BlackImpostor
f25eaf1261 Translated using Weblate (Russian)
Currently translated at 94.7% (1310 of 1383 strings)
2024-11-10 18:15:44 +01:00
BreadW
e1be22a6ff Translated using Weblate (Japanese)
Currently translated at 94.5% (1308 of 1383 strings)
2024-11-10 18:12:48 +01:00
Wuzzy
5891d0f5ec Translated using Weblate (German)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:12:48 +01:00
grorp
2424c64099
Translated using Weblate (German)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:11:40 +01:00
sfan5
8b27340b2e Work around Intel driver bug on Win 8.1 and older 2024-11-10 17:44:45 +01:00
sfan5
7557a287e5 Update credits for 5.10.0 2024-11-10 13:23:16 +01:00
sfan5
122b2d70d9 Re-fix CAO mesh lighting with shaders disabled
previously: 65af606729
2024-11-10 13:21:19 +01:00
SmallJoker
4bb9c8c61b
Revert "Fix collisions with long dtime, in particular with bouncing" (#15400)
This reverts commit cb6c8eb2f0.
2024-11-10 13:20:30 +01:00
Lars Mueller
0391d91e5d Improve error messages for failed mesh loading 2024-11-09 18:13:56 +01:00
Lars Müller
77e78193a0
Fix set_bone_override documentation (#15353) 2024-11-09 18:13:36 +01:00
Lars Müller
cce4fe5a3f
Fix wrongly documented glTF frame number restriction
The frame numbers can very well be floats since 06907aa
2024-11-09 17:57:37 +01:00
grorp
50b7523336 ogles 2 driver: Delete some dead code
grepping for IRR_COMPILE_GLES2_COMMON gives no other results

COGLESCoreExtensionHandler is only used through COpenGL3ExtensionHandler
2024-11-08 20:43:24 +01:00
grorp
fced6ff240 Fix ECF_D32 support in ogles2 video driver
OES_depth32 only talks about support for render buffers, not textures,
so it's not relevant here:
https://github.com/KhronosGroup/OpenGL-Registry/blob/main/extensions/OES/OES_depth32.txt

This fixes the scene being black with "video_driver = ogles2" and
"enable_post_processing = true" on my desktop computer.
2024-11-08 20:43:24 +01:00
grorp
bafc477919
Revert "2D rendering: Enable bilinear filter for downscaling textures" (#15385)
This reverts commit minetest/irrlicht@fb7a0e4298.
2024-11-08 11:17:15 +01:00
Ælla Chiana Moskopp
60cd1e4529 Correctly render transparency in TGA type 1 with color format A1R5G5B5
The branch removed in this patch handled color format A1R5G5B5 specially
when creating a texture from a TGA type 1 file, i.e. an image that has a
colormap. It did not handle the 1-bit alpha channel correctly, rendering
transparent pixels black instead.

Since the colormap is converted to A8R8G8B8 earlier anyways, the code
for the general case is able to handle this scenario already – at the
expense of making the created texture use twice as much GPU memory as
necessary.
2024-11-06 20:07:05 +01:00
Lars Müller
1fa4ca7c59
Switch to a more neutral ASCII art banner (#15356) 2024-11-06 20:06:39 +01:00
veprogames
db04964697 Content browser: Fix broken forum URLs
Repeated prepending would break these URLs.
This fix uses the freshly added `forum_url` field directly.
2024-11-06 20:06:26 +01:00
sfan5
294a30e445 Fix ScriptApiSecurity::checkPath mangling non-existent paths
bug introduced in 1c1c97cbd1
2024-11-03 19:27:08 +01:00
veprogames
9982c56373
Replace occurences of 'forum.minetest.net' with 'forum.luanti.org' (#15372) 2024-11-03 15:10:58 +01:00
SmallJoker
c884e7181f
JsonCPP: restore '1.0.0+' compatibility (#15368)
Previously, compiling on Ubuntu 20.04 would fail with the system-provided JsonCPP
version (1.7.4). Which would satisfy the documented requirement of "1.0.0+".
2024-11-03 15:10:39 +01:00
Lars Müller
3064f3ccb7
Fix model[] being lit wrongly if shaders are disabled (#15364) 2024-11-03 15:10:21 +01:00
Lars Müller
0e06590ffd
Apply "and" to server list & content search terms (#15365) 2024-11-03 15:09:47 +01:00
sfan5
e952a0807b
Use servers.luanti.org (#15369) 2024-11-02 20:40:45 +00:00
rubenwardy
ba370d9841
Use content.luanti.org (#15360) 2024-11-02 20:40:33 +00:00
sfan5
5c5538685e
Don't memset SEvent directly (#15359)
Fixes a compiler warning by manually zeroing the tag and the largest union member instead
2024-10-31 19:24:43 +01:00
grorp
8b85a62310
Fix some broken icons in the CDB dialog on Windows (#15363)
core.formspec_escape was missing
2024-10-31 19:23:02 +01:00
1F616EMO~nya
d1728199bb
Rename Minetest to Luanti in .github/ files (#15357) 2024-10-31 19:22:29 +01:00
grorp
3ad6aee9b2 Manually fix new Android translations for new name 2024-10-28 20:22:30 +01:00
updatepo.sh
8c0c8334c3 Run updaterepo.sh 2024-10-28 19:58:15 +01:00
updatepo.sh
47d551d780 Update minetest.conf.example and settings_translation_file.cpp 2024-10-28 19:57:02 +01:00
Unacceptium
67740b0e59 Translated using Weblate (Hungarian)
Currently translated at 97.2% (1298 of 1335 strings)
2024-10-28 19:54:11 +01:00
Unacceptium
2633f85473 Added translation using Weblate (Hungarian) 2024-10-28 19:54:11 +01:00
Jiri Grönroos
cb5723e409 Translated using Weblate (Finnish)
Currently translated at 25.6% (343 of 1335 strings)
2024-10-28 19:54:11 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
cd81b4db7e Translated using Weblate (Malay)
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/ms/
2024-10-28 19:54:11 +01:00
Muhammad Rifqi Priyo Susanto
9f910ab873 Translated using Weblate (Indonesian)
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/id/
2024-10-28 19:54:11 +01:00
Allan Nordhøy
8f2a6863a8 Translated using Weblate (Norwegian Bokmål)
Currently translated at 53.5% (715 of 1335 strings)
2024-10-28 19:54:11 +01:00
Allan Nordhøy
10b0d45ec9 Added translation using Weblate (Norwegian Bokmål) 2024-10-28 19:54:11 +01:00
Linerly
0cf3df7f3e Translated using Weblate (Indonesian)
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/id/
2024-10-28 19:54:11 +01:00
grorp
009e04fb63 Translated using Weblate (German)
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/de/
2024-10-28 19:54:11 +01:00
grorp
e7bb7b2fc1 Added translation using Weblate (German) 2024-10-28 19:54:11 +01:00
Honzapkcz
218f3da4b8 Translated using Weblate (Czech)
Currently translated at 94.1% (1257 of 1335 strings)
2024-10-28 19:54:11 +01:00
BlackImpostor
0f4f56d768 Translated using Weblate (Russian)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
5e17ce8c81 Translated using Weblate (Malay)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
alasa ala
c02c855b73 Translated using Weblate (Korean)
Currently translated at 52.2% (698 of 1335 strings)
2024-10-28 19:54:11 +01:00
Hugo
934f5ca87e Translated using Weblate (Esperanto)
Currently translated at 85.3% (1139 of 1335 strings)
2024-10-28 19:54:11 +01:00
gallegonovato
5ab12d33a4 Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
joserene-007
d37e6bc1de Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
Jordan Irwin
1fc4f22a7a Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
Jynweythek Vordhosbn
28c2e587e5 Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
ludemys
135f30913a Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
Luna
8ac443d650 Translated using Weblate (Danish)
Currently translated at 47.6% (636 of 1335 strings)
2024-10-28 19:54:11 +01:00
Pexauteau Santander
bf8655dfdc Translated using Weblate (Slovak)
Currently translated at 96.7% (1291 of 1335 strings)
2024-10-28 19:54:11 +01:00
Soupborshfe5e4d4ba7c349aa
076c1d1623 Translated using Weblate (Kazakh)
Currently translated at 4.1% (56 of 1335 strings)
2024-10-28 19:54:11 +01:00
Joaquín Villalba
e12f0c4216 Translated using Weblate (Catalan)
Currently translated at 21.7% (290 of 1335 strings)
2024-10-28 19:54:11 +01:00
Muhammad Rifqi Priyo Susanto
ac224bd82c Translated using Weblate (Indonesian)
Currently translated at 98.4% (1314 of 1335 strings)
2024-10-28 19:54:11 +01:00
Joaquín Villalba
375b21e81a Translated using Weblate (Spanish)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:11 +01:00
gallegonovato
a7249ba653 Translated using Weblate (Spanish)
Currently translated at 93.1% (1244 of 1335 strings)
2024-10-28 19:54:11 +01:00
Ari
7e9c4a9baa Translated using Weblate (Spanish)
Currently translated at 93.1% (1244 of 1335 strings)
2024-10-28 19:54:11 +01:00
Davi Lopes
1d251e0f13 Translated using Weblate (Portuguese (Brazil))
Currently translated at 87.4% (1168 of 1335 strings)
2024-10-28 19:54:11 +01:00
Davi Lopes
72a2cd2aab Translated using Weblate (Portuguese)
Currently translated at 89.5% (1195 of 1335 strings)
2024-10-28 19:54:11 +01:00
nauta-turbidus
458ac94fc4 Translated using Weblate (Polish)
Currently translated at 93.4% (1248 of 1335 strings)
2024-10-28 19:54:11 +01:00
gallegonovato
c3e8036bb9 Translated using Weblate (Spanish)
Currently translated at 91.9% (1228 of 1335 strings)
2024-10-28 19:54:11 +01:00
hugoalh
286b03aac1 Translated using Weblate (Chinese (Traditional))
Currently translated at 94.9% (1267 of 1335 strings)
2024-10-28 19:54:11 +01:00
bgo-eiu
6c8941c417 Translated using Weblate (Malay (Jawi))
Currently translated at 50.7% (677 of 1335 strings)
2024-10-28 19:54:11 +01:00
ninjum
86127c3609 Translated using Weblate (Galician)
Currently translated at 100.0% (1335 of 1335 strings)
2024-10-28 19:54:10 +01:00
rubenwardy
5e070a0d17 Translated using Weblate (Toki Pona)
Currently translated at 1.4% (19 of 1335 strings)
2024-10-28 19:54:10 +01:00
109247019824
33178a38b9 Translated using Weblate (Bulgarian)
Currently translated at 36.5% (488 of 1335 strings)
2024-10-28 19:54:10 +01:00
sfence
03cf7a8e05
Make Luanti buildable for macOS 10.15 also. (#15352) 2024-10-28 19:40:28 +01:00
Wuzzy
ad4b13a0e9
Luanti rename: builtin (#15324) 2024-10-28 19:40:18 +01:00
chmodsayshello
409e75b94d
Fix newline rejection and whitespace trimming for chat messages (#15290)
Co-authored-by: sfan5 <sfan5@live.de>
2024-10-28 19:39:59 +01:00
DS
c81cc4fa60
Improve menu_header.png slightly (#15346) 2024-10-28 16:10:17 +01:00
sfan5
38f4d11d53 Avoid VLA usage and prohibit it by compiler flag 2024-10-28 15:59:17 +01:00
sfan5
721e06451e Minor improvements to startup logging and related code 2024-10-28 15:59:17 +01:00
sfan5
8d648364c0 Remove handling of MT_LOGCOLOR env variable 2024-10-28 15:59:17 +01:00
sfan5
d60189915c Remove 'mesetint' gameid rewriting kludge 2024-10-28 15:59:17 +01:00
Lars Müller
88c7a54e08
Rename minetest.* to core.* in devtest 2024-10-28 15:57:54 +01:00
sfence
d849d51c2d
Replace licensing text in headers (LGPLv2.1) (#15321) 2024-10-28 15:57:39 +01:00
grorp
a450301686
Fix server steps shorter than dedicated_server_step since #13370 (#15330)
Co-authored-by: Desour <ds.desour@proton.me>
Co-authored-by: sfan5 <sfan5@live.de>
2024-10-28 15:57:22 +01:00
Nathanaëlle Courant
806fba6448
Fix missing rename 2024-10-28 11:02:59 +01:00
sfan5
0d85e826f4 Android: update used NDK and SDL support code 2024-10-27 14:16:39 +01:00
grorp
4b90e582b4
Rename to Luanti (#15294)
The new header intentionally isn't in MTG stone design (or any other MTG-esque design), since we want to distance Luanti and MTG from each other. The font "undefined medium" (https://undefined-medium.com/) was used. 

ASCII art generated by https://patorjk.com/software/taag/#p=display&f=Graffiti&t=luanti
https://github.com/minetest/minetest/pull/11952#issuecomment-1013364703

---------

Co-authored-by: sfan5 <sfan5@live.de>
2024-10-27 14:04:51 +01:00
cx384
b7073df68c
Move hud_hotbar_max_width setting to HUD section (#15335) 2024-10-26 17:40:39 +02:00
Wuzzy
4deb5b999c
DevTest: Change "Minetest" to "DevTest" (#15326) 2024-10-26 17:40:29 +02:00
BoySanic
6ead789509
Update documentation to reflect player constant values (#15308)
Co-authored-by: grorp <grorp@posteo.de>
2024-10-26 17:40:11 +02:00
Erich Schubert
cb6c8eb2f0
Fix collisions with long dtime, in particular with bouncing (#15029) 2024-10-26 17:39:45 +02:00
Ælla Chiana Moskopp
c3b5cc8611 Rename erle in credits (as requested by them) 2024-10-26 10:28:55 +03:00
DS
3f306a407c
core.after: Improve documentation details about how time is handled (#15316) 2024-10-24 17:52:27 +02:00
sfan5
2d135cc1bb
Revert "Use EGL over GLX" (#15315)
This reverts commit aa273119f2.
2024-10-24 17:52:06 +02:00
LoneWolfHT
e441b5d240
Fix spelling mistakes in player_sao.cpp 2024-10-23 10:52:28 +02:00
Zughy
d52e4cdbdb
DOCS: replace Minetest -> Luanti, minetest. -> core. (#15292)
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-10-22 23:05:41 +02:00
sfan5
aa273119f2
Irrlicht: Use EGL over GLX (#15286) 2024-10-22 23:04:46 +02:00
sfan5
d4daa9fd40 Fix build error due to missing include 2024-10-18 11:59:02 +02:00
DS
e5d321d286
Cleanup headers in irr/include/ (#15181) 2024-10-18 10:58:32 +02:00
ALi.w
f2ab887644
Fix getDimension throwing error if there is \r at end of line (#15299) 2024-10-17 19:39:11 +02:00
SmallJoker
4975afb5ff Clean up header includes related to settings.h 2024-10-17 19:38:49 +02:00
SmallJoker
e3813cf027 Settings: semi-automatic callback cleanup 2024-10-17 19:38:49 +02:00
grorp
9f43018df2
Better UX when touch events aren't supported by Irrlicht device (#15288) 2024-10-16 21:37:00 +02:00
grorp
24704b01d9 Fix wrong minimum for repeat_place_time in settingtypes.txt
rebase mistake from #14542
2024-10-16 21:35:30 +02:00
sfan5
b61c83a19d Move some more sources to shared target 2024-10-16 19:39:59 +02:00
sfan5
4e9aa7dc77 Make itemdef.h safe to include anywhere 2024-10-16 19:39:59 +02:00
sfan5
a18355e7e8 Introduce object target for shared sources 2024-10-16 19:39:59 +02:00
sfan5
37095f3e49 Change the preprocessor macro that differs server/client builds 2024-10-16 19:39:59 +02:00
Lars Mueller
e2ea359925 JSON: Support consistent larger max. depth of 1024 2024-10-15 12:19:49 +02:00
Lars Mueller
4c419c4020 Improve minetest.parse_json
Let modders handle parsing errors, get rid of two unnecessary copies.
2024-10-15 12:19:49 +02:00
Lars Müller
c7938ce81c
Improve glTF logging (#15274)
Also removes all animations but the first one from gltf_frog.gltf
to address the corresponding warning.

Catches some more possible exceptions (out of bounds, optional access)
which might be caused by a broken model to properly log them.
2024-10-15 12:19:19 +02:00
sfan5
6d7a519740
Disable SDL2 for 5.10.0 (#15284)
see #14545
2024-10-14 22:09:11 +02:00
Erich Schubert
6431ef7324
Trivial improvement to get_item_group (#15260)
One hash table lookup is enough, and this is even easier for the JIT to inline, optimize, etc.
2024-10-14 22:09:01 +02:00
grorp
7435ea0d4e
Show warning in the settings menu when shaders are disabled (#15272) 2024-10-14 09:43:29 +02:00
cx384
ecf8488406 Fix HUD inventory direction position 2024-10-13 18:40:29 +02:00
Lars Mueller
067a5b5ac3 Fix local animations not working (was broken in 06907aa) 2024-10-13 15:48:39 +02:00
y5nw
e3aa79cffb
Gettext and plural support for client-side translations (#14726)
---------

Co-authored-by: Ekdohibs <nathanael.courant@laposte.net>
Co-authored-by: y5nw <y5nw@protonmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2024-10-13 11:29:08 +02:00
sfan5
dbbe0ca065 Update jsoncpp copy to 1.9.6
note: the version number is different due to https://github.com/open-source-parsers/jsoncpp/issues/1571
2024-10-13 10:57:25 +02:00
sfan5
cbc741f464 Various improvements to push_json_value 2024-10-13 10:57:25 +02:00
sfan5
d95e916a42 Defer to read_from_map in VoxelManip ctor
concrete problem: the getEmergeThread safety check was missing there
2024-10-12 22:37:17 +02:00
sfan5
244f4f285a Alias MutexAutoLock to the simpler std::lock_guard 2024-10-12 22:37:17 +02:00
sfan5
99b6315c1a Make logging respect stream flushes
also add override keyword and fix overflow() behavior
2024-10-12 22:37:17 +02:00
sfan5
dbf103da32 Fix hexadecimal line number in abort msgs 2024-10-12 22:37:17 +02:00
sfan5
3778ed7466 Keep PlayerMetaRef via name not pointer 2024-10-12 22:37:17 +02:00
sfan5
c8dc9c2b8d Increase safety checks around ObjectRefs 2024-10-12 22:37:17 +02:00
sfan5
41091a147c Handle VOXELFLAG_NO_DATA when in VManip get_data() 2024-10-12 22:37:17 +02:00
sfan5
6d5103900f Some refactoring and fixes to VoxelArea and VoxelManip
In particular this validates the edges of VoxelArea and fixes
all the nonsense tests uncovered by it.
2024-10-12 22:37:17 +02:00
grorp
5532248cd7
Add missing setting callbacks for display_density_factor (#15273) 2024-10-12 22:34:39 +02:00
paradust7
2188adc0f9
Ensure that null C strings do not break logging (#15255) 2024-10-12 22:34:24 +02:00
cx384
4e6e8b7bf1 Fix hotbar alignment with hud_hotbar_max_width 2024-10-12 22:33:41 +02:00
Zemtzov7
1b2d24791a
Separate anticheat settings (#15040) 2024-10-11 12:01:22 +02:00
sfan5
d2b4c27f21 Implement minetest.ipc_poll() 2024-10-11 12:00:59 +02:00
sfan5
72801d0233 Implement minetest.ipc_cas() 2024-10-11 12:00:59 +02:00
sfan5
f1a436619f Add generic IPC mechanism between Lua envs 2024-10-11 12:00:59 +02:00
Lars Mueller
06907aa99b Support floating-point animation frame numbers 2024-10-10 21:39:57 +02:00
Lars Mueller
323fc0a798 Add glTF animation support 2024-10-10 21:39:57 +02:00
Lars Mueller
d8274af670 Refactor global inversed matrix usage (+ minor fix)
Thanks to GreenXenith and Josiah for spotting a bug here
2024-10-10 21:39:57 +02:00
Lars Mueller
224066c1d3 Implement glTF texture wrapping support 2024-10-10 21:02:05 +02:00
Lars Mueller
2fee37f31b Fix gltf / glb loader oversights
- Avoid an unnecessary copy
- Reject models requiring extensions

Co-authored-by: DS <ds.desour@proton.me>
2024-10-10 21:02:05 +02:00
Lars Mueller
521e678d39 Add binary glTF (.glb) support 2024-10-10 21:02:05 +02:00
Lars Mueller
7e4919c6ed Refactor matrix4.h
Sets the surprising row-major conventions used here straight.

Renames rotateVect to rotateAndScaleVect:
If the matrix also scales, that is applied as well by the method.
Obsolete rotateVect variants are removed.
The inverseRotateVect method is also renamed accordingly.
Note that this applies the transpose of the product
of the scale and rotation matrices, which inverts just the rotation.
2024-10-10 17:40:31 +02:00
sfan5
c8f1efebea
Use execvp in fs::RecursiveDelete() 2024-10-10 17:40:06 +02:00
grorp
3f5a58a4e5 Fix rebase mistake in #14840 after #14749
Old enable_touch was used instead of new touch_gui.
2024-10-09 18:46:21 +02:00
grorp
bd15f26c35 Disable automatic switching on Linux to avoid bug on X11 2024-10-09 18:26:19 +02:00
grorp
f5076723e8 Android: Fix camera jump when switching to mouse mode
Easy way to reproduce:

1. Connect a bluetooth mouse to your Android phone with Minetest installed
2. Play Minetest
3. Slowly move the mouse to the right so that the camera rotates continously
4. While still moving the mouse continously, tap the screen a few times per second

Before this commit: The camera jumps around randomly.
After this commit: The camera moves like it should.

This is a combination of two Irrlicht changes copied from MoNTE48/irrlicht
and one Minetest change authored by me. I have no idea why this works, but
it does work and I have spent way too much time on this bug already.
2024-10-09 18:26:19 +02:00
grorp
4952f17df4 Auto-toggle TouchControls in-game when receiving touch/mouse input 2024-10-09 18:26:19 +02:00
sfan5
3c5f05b284 Don't expose irrlicht internal headers as public 2024-10-09 16:25:02 +02:00
sfan5
87a42d62b2 Fix GLTF test depending on irrlicht internals & memory leaks
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-10-09 16:25:02 +02:00
paradust7
3a7c8279bf
Split log.h to speed up compilation (#15258) 2024-10-09 16:24:44 +02:00
grorp
07ff2a5c01
ContentDB dialog: React to window info changes immediately (#15248) 2024-10-09 15:08:15 +02:00
grorp
6ac4447134
Make bloom parameters server-controlled (#15231) 2024-10-09 15:08:03 +02:00
SmallJoker
13f533d490
scrollcontainer: Add automatic scrollbar calculation (#14623)
New parameter 'content padding'. When specified, the scrollbar
max value is calculated automatically. This aims to reduce manual
calculation functions.
2024-10-08 21:45:27 +02:00
Lars Müller
291c3ad0c1
Document performance cost of use_texture_alpha=blend (#15244) 2024-10-08 21:44:44 +02:00
rubenwardy
1037ee2a55 ContentDB redesign: Redesign package list dialog 2024-10-05 18:40:26 +01:00
rubenwardy
78aab8c95d ContentDB redesign: Add package dialog
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-10-05 18:40:26 +01:00
swagtoy
05cbd84ae0
Fix irrString use-after-free with char-like assignment (operator=) 2024-10-04 10:45:09 +02:00
sfence
84b9321977
Switch to macOS 13, because brew support for macOS 12 gone (#15232) 2024-10-04 10:44:14 +02:00
SmallJoker
95d7348a08
Client: upscale [mask or base image (#15205)
This improves texture pack compatibility. Masks are expected to be of the same
size as the base texture. This change upscales the smaller texture if needed.
The behaviour is now the same as a.png^b.png and a.png^[overlay:b.png (to mention a few).
2024-10-04 10:44:03 +02:00
sfence
a19d0033bc
Add forgotten lua_pop 2024-10-04 10:42:37 +02:00
Erich Schubert
57ca92e0eb
Simplify minetest.strip_param2_color 2024-10-04 10:42:25 +02:00
Erich Schubert
3397950a0e
Clarify bit meaning in param2 palette (#15225) 2024-10-04 10:42:09 +02:00
grorp
3eef1ca28f
Fix incorrect SMaterial::operator!= (regression from #15165) (#15226) 2024-10-03 11:37:14 +02:00
grorp
132e43346e
Setting structure improvements (#15218) 2024-10-03 11:37:04 +02:00
grorp
eefaef53b7
Fix hypertext action firing twice on touchscreen (#15217) 2024-10-03 11:36:48 +02:00
SmallJoker
3797ca52c4
Network: offload often changed constants to source file (#15207)
* Network: offload often changed constants to source file

This prevents unnecessary recompiling when using incremental builds.
There is also no need to have separate max proto version variables;
as they're subject to the handshake between client and server. The
code is also expected to support the same version (or higher).

Co-authored-by: sfan5 <sfan5@live.de>
2024-10-02 11:01:30 +02:00
grorp
22ef4c8be1
Expose analog joystick input to the Lua API (#14348) 2024-10-01 17:21:42 +02:00
swagtoy
6569fdd4d1
Add QT Creator and Windows dump files to .gitignore (#15214) 2024-09-30 22:57:18 +02:00
sfan5
53d949bd9f
Discourage disabling shaders (#15210) 2024-09-30 22:43:08 +02:00
swagtoy
c6fc694ea6
Fix deletePathFromFilename returning cutoff filenames (#15211) 2024-09-30 22:41:53 +02:00
sfan5
bca44574d5 Add test script for server error cases 2024-09-28 15:26:51 +02:00
sfan5
9e14f5f053 Apply some fixes to server destruction order
was broken by bc4ab8b99e
2024-09-28 15:26:51 +02:00
sfan5
d6da80fe24 Fix vertex color on OpenGL 3
closes #14985
2024-09-28 12:09:58 +02:00
sfan5
700fbc803d Minor improvements to metadata handling 2024-09-27 21:35:27 +02:00
sfence
610ddaba7c
Allow detection of damage greater than HP (#15160)
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-09-27 21:34:52 +02:00
grorp
fbb0e82679
Fix uninitialized shadow tint regression from #14610 (#15197)
* Fix uninitialized shadow tint

This resulted in shadows having a different, random color each time I started a game

* Fix formatting mistakes from the same PR
2024-09-27 11:08:35 +02:00
DragonWrangler1
65ec371b78
Allow allfaces drawtypes to have 6 textures (#15175) 2024-09-26 17:34:16 +02:00
sfence
d08d34d803
ABM without_neighbors (#14116) 2024-09-26 17:32:55 +02:00
sfan5
c1ea49940b Add questionable workaround for env lock contention 2024-09-26 17:31:49 +02:00
sfan5
5f308deb50 Switch env lock to fair mutex implementation 2024-09-26 17:31:49 +02:00
sfan5
0220d0d492 Encapsulate envlock 2024-09-26 17:31:49 +02:00
sfan5
588a0f83e9 Divorce map database locking from env lock (#15151) 2024-09-26 17:31:49 +02:00
grorp
526a2f7b8c
Dehardcode the death formspec (#15155)
Co-authored-by: Paul Ouellette <oue.paul18@gmail.com>
2024-09-24 22:37:44 +02:00
grorp
3c48671076
Fix -Winconsistent-missing-override in unit_sao.h (#15190) 2024-09-24 22:25:46 +02:00
Elias Åström
f65fe80e81
Add minetest.bulk_swap_node (#15043)
Co-authored-by: sfan5 <sfan5@live.de>
2024-09-24 22:25:34 +02:00
GefullteTaubenbrust2
d8f1daac25
Visual Effects Vol. 1 (#14610)
This PR adds a variety of effects to enhance the visual experience.

    "soft" clouds look
    Tinted shadows
    Crude water reflections (sky and sun) and waves
    Translucent foliage
    Node specular highlights
    Adjusted fog color (more saturated where the fog is lighter)
    Minor changes to volumetric lighting (crudely simulates the effect of depth)

Co-authored-by: sfan5 <sfan5@live.de>
2024-09-24 11:14:27 -07:00
Erich Schubert
4ac86db8e3
Simplify getGameTime function usage (#15187) 2024-09-20 15:05:51 +02:00
sfan5
811adf5d42 Bulk LBMs (#14954) 2024-09-20 15:05:26 +02:00
sfan5
7ae51382c8 Refactor ABM/LBM related code 2024-09-20 15:05:26 +02:00
sfan5
387856a1c3 Load mod profiler in one of the test workflows 2024-09-20 15:05:26 +02:00
Desour
24efd7dc91 Use smart ptrs for Minimap's member vars 2024-09-18 12:19:40 +02:00
Desour
9827f9df1b Use irr_ptr for MapBlockMesh::m_mesh 2024-09-18 12:19:40 +02:00
Desour
2b2f2dee20 Use make_irr instead of new + drop() in Game::handleCallbacks 2024-09-18 12:19:40 +02:00
Desour
b93ae33f85 Use irr_ptr for Game::sky 2024-09-18 12:19:40 +02:00
Desour
17c041a65c Use irr_ptr for Game::gui_chat_console 2024-09-18 12:19:40 +02:00
Desour
37b374cb92 Use irr_ptr for Game::clouds 2024-09-18 12:19:40 +02:00
Desour
ecf8c7696a Use irr_ptr for ClientEnvironment::m_map 2024-09-18 12:19:40 +02:00
Desour
e3efaa1733 Move irr_ptr.h too irr/include/ 2024-09-18 12:19:40 +02:00
Desour
6d01ed5d74 irr_ptr: Allow to use with forward-declared types
Also add [[nodiscard]] to ::grab() (because similar named irr_ptr::grab() returns void).
And use new std::is_convertible_v.
2024-09-18 12:19:40 +02:00
grorp
70e169f165
Drop fixed pipeline lighting stuff (#15165) 2024-09-18 12:18:28 +02:00
wrrrzr
6dfd61cba0
Fix TODO in joystick code (#15179) 2024-09-18 12:17:55 +02:00
sfan5
58ea11c2b3 Add some debug helpers around this area 2024-09-16 23:12:52 +02:00
sfan5
6f275e2ba0 Remove dead code in COpenGL3MaterialBaseCB 2024-09-16 23:12:52 +02:00
sfan5
cc26b5384c Mark buffer as dirty in mesh helpers
unclear if this fixes any actual bug
2024-09-16 23:12:52 +02:00
sfan5
0fdcba197f Fix VBO hint in content_cao 2024-09-16 23:12:52 +02:00
sfan5
65af606729 Fix CAO mesh lighting with shaders disabled
the 'Lighting' material flag does not have portable behavior
2024-09-16 23:12:52 +02:00
grorp
740dc0162e
Don't use fixed pipeline lighting for stars (#15164) 2024-09-16 10:16:55 +02:00
grorp
47f199e6cb
Avoid cloud jump when switching between mainmenu and loading screen (#15163)
... by using the same Clouds object for both.
The mainmenu clouds already used shaders before. I had to choose between
both or neither, so now both the mainmenu clouds and the loading screen
clouds use shaders if available.
2024-09-16 10:16:27 +02:00
DS
4aec4fbe6f
Add support for Tracy profiler (#15113) 2024-09-15 13:47:45 +02:00
sfan5
6f23de41fb Refresh windows toolchain and libs 2024-09-14 12:13:19 +02:00
Gregor Parzefall
7bab390413 Add time_to_day_night_ratio to the Lua API 2024-09-14 12:13:11 +02:00
Gregor Parzefall
f9c0354af1 Add colorspec_to_table to the Lua API 2024-09-14 12:13:11 +02:00
DS
c54f5a2137
Move std::tie out of headers 2024-09-14 12:10:11 +02:00
j-r
a6219ab955
Fix alignment in implicit client hotbar definition
Used when an older server doesn't send it.
2024-09-14 12:09:56 +02:00
1F616EMO~nya
38b4505ad7
Allow requesting reconnect when mods kick player (#14971) 2024-09-12 23:42:46 +02:00
nauta-turbidus
b12e67699a
Document negative saturation (#15062) 2024-09-12 23:42:33 +02:00
sfan5
72c306d920 Improve some protocol code log messages
also get rid of the very noisy socket debug message that are
useless in a world where Wireshark exists.
2024-09-12 23:41:56 +02:00
sfan5
f54f2c1601 Fix RTT set before value is available 2024-09-12 23:41:56 +02:00
sfan5
42af7cc1c5 Nerf protocol window sizes
Probably due to a unit misunderstanding a long time ago the window sizes
were quite insane (especially the default).
In practice this was sometimes hidden by other bugs, games trying their
best to be lightweight or didn't matter on high-quality internet connections.
2024-09-12 23:41:56 +02:00
sfan5
9c2b2c002c Count duplicate packets as congestion indicator 2024-09-12 23:41:56 +02:00
grorp
af67353f7a
Only apply "touch_punch_gesture" when wielded item has no on_use callback (#15098) 2024-09-12 23:41:47 +02:00
sfence
8617993386
Add SDL2 options to compiling README (#15136) 2024-09-12 23:40:03 +02:00
sfence
733a019bf5
macOS: make mute sound actually work (#15128) 2024-09-08 13:53:43 +02:00
Gregor Parzefall
2208fc0632 Move Minetest GUISkin -> Irrlicht CGUISkin 2024-09-08 13:53:33 +02:00
Gregor Parzefall
c8ebc2e5d0 Delete Irrlicht CGUISkin 2024-09-08 13:53:33 +02:00
sfan5
3feec87d52 Count global number of drawcalls too 2024-09-08 13:53:23 +02:00
sfan5
275bef0633 Remove unused leftovers from normal mapping 2024-09-07 14:23:37 +02:00
sfan5
e90ef85e7d Fix texture matrix handling in our shaders 2024-09-07 14:23:37 +02:00
Lars Müller
9e5d6bc162
Fix upright sprite entities not animating 2024-09-06 12:11:16 +02:00
grorp
041d67ceca
Improve formspec scaling (#14840) 2024-09-06 12:11:03 +02:00
red-001
1527cdf6a4 SRP remove custom memory allocator 2024-09-06 11:30:35 +02:00
red-001
197d09cc53 SRP switch to porting randomness source 2024-09-06 11:30:35 +02:00
sfence
4fd744cdf6
Generate Minetest.app on macOS 12, so at least macOS 12 will be supported 2024-09-06 11:30:27 +02:00
sfan5
3af226cb06
Refactor "Cavegen y biome check" 2024-09-06 11:30:10 +02:00
red-001
486dc3288d
VoxelManipulator code cleanup (#15114)
* Cache node in voxel area index when possible

The index function according to the MSVC profiler actually takes up a significant time slice (around ~5% of total time for the process) during normal game-play.
Might not be accurate but still good to not recalculate it twice.

* Remove `setNodeNoRef` from VM

* VM: remove old commented out print statement
2024-09-04 15:20:39 +02:00
Lars Müller
074700b35e
Remove no* prefixes from settingtypes possible flags (#15111) 2024-09-04 15:19:00 +02:00
grorp
8349846333
TouchControls: Fix setUseCrosshair not being called (#15100) 2024-09-04 15:18:45 +02:00
Gregor Parzefall
08de047033 TouchScreenGUI: Show status text above grid menu 2024-09-04 15:18:34 +02:00
Gregor Parzefall
88397c2908 TouchScreenGUI: Don't release pointers when toggling grid menu 2024-09-04 15:18:34 +02:00
Gregor Parzefall
2e567b7d40 Replace removed rare_controls.png in Devtest /test_formspec
removed by 013c6ee166 / #14918
2024-09-04 15:18:34 +02:00
red-001
d5d8fb629b
Simplify TOSERVER_INIT and TOCLIENT_HELLO
- Network compression support was never added.
- Client hasn't used the returned playername since at least 0.4-stable.
2024-09-02 21:50:43 +02:00
Zughy
2bc9dc54ff
Windows/vcpkg instructions: enable i18n by default 2024-09-02 21:50:28 +02:00
sfan5
e55fb6da71 Mark a bunch of classes as final 2024-09-02 21:50:13 +02:00
sfan5
3fb4049612 Prevent accidentally copy/move of refcounted objects 2024-09-02 21:50:13 +02:00
sfan5
62131fe295 Put all pieces together and clean up leftover code 2024-09-02 21:50:13 +02:00
sfan5
6b7fc1e9fe Handle vertex & index VBOs separately in GL drivers 2024-09-02 21:50:13 +02:00
sfan5
be9aa19208 Propagate changes to IMeshBuffer parent class 2024-09-02 21:50:13 +02:00
sfan5
435a89b5a4 Apply same changes to SSkinMeshBuffer 2024-09-02 21:50:13 +02:00
sfan5
47e4c33a50 Split CIndexBuffer from CMeshBuffer 2024-09-02 21:50:13 +02:00
sfan5
5d6e15bc49 Split CVertexBuffer from CMeshBuffer 2024-09-02 21:50:13 +02:00
sfan5
538b8b9b34 Avoid unsafety with stack-allocated mesh buffer 2024-09-02 21:50:13 +02:00
1F616EMO~nya
6105804f00
Show full texture string in "generateImage(): Failed to generate" errors (#15033) 2024-09-02 16:10:01 +02:00
DS
f23d7459b3
Allow to disable transparency sorting entirely (#15101) 2024-09-02 16:09:42 +02:00
SmallJoker
0c4f03d9a5
Reduce include count in headers 2024-09-02 16:09:32 +02:00
sfan5
b8b99d5cf1 Use std::string_view in logging code 2024-09-02 16:09:14 +02:00
JosiahWI
ac11a14509
Add static glTF support (#14557)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: jordan4ibanez <jordan4ibanez@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2024-09-02 14:50:30 +02:00
sfan5
8972c80d7d Warn if max_packets_per_iteration reduced 2024-08-31 20:47:38 +02:00
sfan5
1380bf9b88 Fix ordering issue with new server peers 2024-08-31 20:47:38 +02:00
sfan5
7afa78ec82 Remove obsolete client connection init workaround
m_connection_reinit_timer has a head-start of 0.1s and this code
only took effect for the very first game session so it was broken
anyway.
2024-08-31 20:47:38 +02:00
red-001
43363ee066
Disable CRT security warnings in MSVC (#15077)
MSVC by default warns if Annex-K style secure functions with additional parameter validation are not used. For better or worse, afaik other major compilers don't implement it, so it's not a very useful warning for a cross-platform project.
2024-08-31 20:47:29 +02:00
red-001
48e65ac846 Don't attempt to process packets when there are none
Under certain unlikely circumstances the main server loop could attempt to process packets even when the connection didn't return one. This would result in the default empty packet being processed resulting in spurious warnings about a missing client.
2024-08-31 20:46:27 +02:00
red-001
1b8b84bee8 connection: Remove unused timeout feature
Was only used for a unit test and incorrectly at that.
2024-08-31 20:46:27 +02:00
grorp
6608057971
Fix uninitialized SkyboxParams::fog_color 2024-08-31 20:46:14 +02:00
grorp
5c171f6d61
Basic unittest for HP change calculation 2024-08-31 20:45:53 +02:00
grorp
eae9a70385
TouchControls: Fix outdated player controls in TOSERVER_INTERACT 2024-08-31 20:45:32 +02:00
grorp
322a9c2f74
Restore proportional minimap scaling (#15022) 2024-08-31 18:11:56 +02:00
cx384
52376fd87a Add hotbar Lua HUD element and replace hardcoded hotbar 2024-08-31 16:04:14 +02:00
SmallJoker
efd7792add
Debloat IVideoDriver and IrrlichtDevice includes (#15080)
As the project grows, compile time will not go down unless the header mess
is cleaned up one by one to only include exactly what's needed.
2024-08-31 11:44:30 +02:00
kromka-chleba
a6ba5304c4
Add new vector utils (ceil, sign, abs, random_in_area) (#14807) 2024-08-31 11:43:52 +02:00
cx384
3971b6afcc
Main menu: formspec escape world name (#15064) 2024-08-28 21:32:31 +02:00
David Heidelberg
7f5a19792c enable option to toggle touch controls on Android
Signed-off-by: David Heidelberg <david@ixit.cz>
2024-08-28 21:32:00 +02:00
Gregor Parzefall
3a59fabefe split enable_touch to touch_controls (for touchscreen controls) and touch_gui
touch_gui provide adjustment to the interface, so it's more touch
friendly

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-08-28 21:32:00 +02:00
Gregor Parzefall
1977517d7a Rename TouchScreenGUI -> TouchControls
to avoid confusion between touchscreen-related settings that affect GUIs
(formspecs) and touchscreen-related settings that affect the touch controls
(TouchControls / formerly TouchScreenGUI)
2024-08-28 21:32:00 +02:00
sfan5
bf4d31227b
Delete OpenGL ES 1.0 driver (#15067) 2024-08-28 20:44:42 +02:00
sfan5
1298d6c020 Fix VBO hint for transparent block parts 2024-08-28 15:38:02 +02:00
sfan5
19a58745c9 Avoid copies when working with EnrichedString 2024-08-28 15:38:02 +02:00
sfan5
fa4529b4f1 Keep stats on hw buffer uploads 2024-08-28 15:38:02 +02:00
sfan5
39970fed38 Consolidate transparent buffers lazily 2024-08-28 15:38:02 +02:00
sfan5
c00fed20b7 Fix re-loading of settings in ClientMap 2024-08-28 15:38:02 +02:00
sfan5
c52a4369eb Fix vertex count accounting in ClientMap 2024-08-28 15:38:02 +02:00
Desour
0f7ee126de Fix transparency sorting and animation faraway check not using mesh chunk bounding sphere 2024-08-28 15:37:54 +02:00
Desour
2e883189c1 Improve block bounds HUD feature
* Use different material than selection box, so it doesn't break
  for non-default `node_highlighting` values.
* Add `show_block_bounds_radius_near` setting.
* Draw mesh chunk edges in a different color (red vs yellow).
2024-08-28 15:37:54 +02:00
Desour
04f0a4a1c6 Fix MeshGrid::isMeshPos()
`(1 + 1 + 0) % 2 = 0`, for example, so it had false positives.
Only minimap generation uses this function. It did useless work.
2024-08-28 15:37:54 +02:00
Zughy
3441fd6e04
Menu docs: clarify that image paths must be escaped to correctly render on Windows (#15072) 2024-08-28 15:37:43 +02:00
JosiahWI
c893e0b72b
Convert nodedef tests to Catch2 (#15045)
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2024-08-28 15:36:02 +02:00
Gregor Parzefall
5d18b6fcd0 Fix incorrect documentation of new-style particlespawner size property 2024-08-27 17:51:29 +02:00
SmallJoker
8109563a02
LocalPlayer: Restore 2u height sneak jump (#15015)
Fix 1: Do not consider LocalPlayer's CAO in the collision data.
Fix 2: work around the "aabbox3d::intersectsWithBox" edge-case.
2024-08-26 21:23:12 +02:00
Lars Müller
21ed680b10
Make getting bone overrides return the "same" euler angles (#15007) 2024-08-26 21:22:38 +02:00
SmallJoker
5583831c40 zstd: Fix minetest.decompress lockup when data ends too early 2024-08-26 18:32:59 +02:00
Desour
da1fc9a536 Meshgen: Don't get lights for not drawn solid faces
`drawCuboid()` doesn't call the face lighter function for masked
faces, so we don't need these values.
This is for performance.
2024-08-26 18:32:51 +02:00
wsor4035
df8afe3dc4
Reword CMake message for LuaJIT detection 2024-08-26 18:32:42 +02:00
sfan5
56123b2fbe Fix bounding box of clouds
fixes #15031
2024-08-23 18:46:12 +02:00
Zemtzov7
274c223d00
Fix CSM help form using "/" instead of "." (#15034)
when copying commands to chat
2024-08-22 23:15:55 +02:00
sfan5
7968ab6928 Move network protocol implementation behind an interface 2024-08-21 21:40:58 +02:00
sfan5
c6ef5ab259
Sanitize formspec fields server-side (#14878) 2024-08-21 21:34:46 +02:00
Gregor Parzefall
ab7af5d15a Fix trailing whitespace from #14179 2024-08-21 20:30:58 +02:00
grorp
66b3db3601
Fix mods folder being read twice with RUN_IN_PLACE=1 (#15024) 2024-08-21 20:25:58 +02:00
Zemtzov7
b2f6a65bc9
Sort clients in minetest.get_server_status and privs in minetest.privs_to_string (#15023) 2024-08-21 20:25:41 +02:00
rubenwardy
6cc0452503
Generate Android versionCode from Major.Minor.Patch (#14963) 2024-08-21 20:25:18 +02:00
wrrrzr
1bccb4e48c
Refactor tool.cpp (#14873)
Co-authored-by: sfan5 <sfan5@live.de>
2024-08-21 20:24:59 +02:00
sfence
f2c66b9ceb
Add possibility to easier override HP and breath engine logic by Lua (#14179)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-08-21 20:24:43 +02:00
Lars Müller
dc21924f31
Fix animations not being restartable (#15016) 2024-08-20 11:51:52 +02:00
rubenwardy
2664afd832
Fix Windows enabling touch controls due to existence of touchscreen (#15003)
We want to check for the form factor instead.
2024-08-20 11:50:29 +02:00
Lars Müller
9ccd9d341f
Revert empty form name deprecation warnings 2024-08-20 11:49:41 +02:00
Daniel Hajjar
ec115ffe2a
Make SecureRandom non-failable 2024-08-20 11:49:15 +02:00
sfan5
b010714426
[no sq] Move shaders & remove dead Irrlicht tests (#15006)
* Move irrlicht shaders to correct place

* Remove unused Irrlicht tests
2024-08-19 09:17:52 +02:00
cx384
48845de46e Fix trailing whitespace from #14945 2024-08-17 21:22:26 +02:00
cx384
03e600a721 Fix whitespaces 2024-08-17 21:02:54 +02:00
cx384
c65444c43b Add whitespace checks to ci 2024-08-17 21:02:54 +02:00
Lars
3df070f352 Remove SAO::onAttach() and SAO::onDetach() 2024-08-17 19:49:38 +02:00
sfan5
5d226268df
Irrlicht cleanups (mostly getting rid of core::array)
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2024-08-17 19:49:11 +02:00
1F616EMO~nya
5acc2736db
Translate access denied strings (#14842) 2024-08-17 19:48:54 +02:00
j-r
1fb49e9ca7
Add shared mods path to get_modpaths
...because the documentation implies it should be.
2024-08-17 19:48:40 +02:00
rubenwardy
b0ad9a6c33
Use JSON file for credits (#14956) 2024-08-17 15:49:53 +01:00
Zughy
792fb13ac6
Docs: Clarify rotation syntax of model formspec element (#14997)
There has been confusion over this in the past, with users wrongly supplying rotation as `{x,y}`.
2024-08-17 15:16:37 +02:00
Lars Mueller
d3ca269c79 Add minetest.is_valid_player_name utility 2024-08-16 22:13:16 +02:00
Lars Mueller
44db47e64a Fix .editorconfig mandating tabs for Markdown 2024-08-16 22:13:16 +02:00
Lars Mueller
6874c358ea Allow managing object observers
-----

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2024-08-16 22:13:16 +02:00
Lars Mueller
cc8e7a569e Switch player names to std::string 2024-08-16 22:13:16 +02:00
DS
603eb57943
Fix comment and alpha test node oopsies from #14852 2024-08-16 22:01:16 +02:00
Erich Schubert
9046379b30
Fix chance/probability wording in lua_api.md 2024-08-16 21:59:36 +02:00
Zughy
ea96f6e1e3
DOCS: state that initial_properties are shared between entity instances 2024-08-16 21:59:20 +02:00
1F616EMO~nya
dc7a7a0ed9
Add table.keyof() (#14910) 2024-08-13 18:39:50 +02:00
Dmitry Marakasov
a677d33bdf Include unistd.h for getpid() when _IRR_COMPILE_WITH_X11_ 2024-08-13 18:38:59 +02:00
Gregor Parzefall
0fb67ccb34 Add setting to disable smooth scrolling 2024-08-13 18:38:34 +02:00
Erich Schubert
e6f77b95f3
Add vector.random_direction() (#14784)
Generate a random vector of unit length. Useful for many mods.
2024-08-13 18:38:07 +02:00
Loïc Blot
cb0bbea2a5
refacto: rework the GUI element handler function (#14793)
We have a very very old way to perform this handling.
With this new method, we have a more proper and flexible way to extend our UI with comprehensible handlers with common interface parameters

In terms of performance, it took very few more more memory and scraping is more faster, using the unordered_map benefits
2024-08-12 18:52:33 +02:00
1F616EMO~nya
98e51a0159
Clamp hotbar selection to slots that exist (#14869) 2024-08-12 15:35:13 +02:00
sfan5
39c2af9710
Render clouds as flat when thickness is zero (#14897) 2024-08-12 15:35:00 +02:00
grorp
013c6ee166
TouchScreenGUI: Replace buttonbars with grid menu (#14918) 2024-08-12 15:34:50 +02:00
y5nw
a3838dd0e8
Show IME candidate list in Windows (#14942) 2024-08-12 15:34:37 +02:00
1F616EMO~nya
53a50e0b0d
Fix warning about getVertexTypeDescription reaching its end (#14806) 2024-08-12 15:34:25 +02:00
sfan5
85e717fcd1
Rework object attachment handling to fix bugs (#14825) 2024-08-12 15:32:18 +02:00
Loïc Blot
a0e33ba9ea
dev: add shell.nix (#14823)
This permit to have reproducible development environment across OS (Linuxes, but maybe Mac OSX too).

It makes minetest compilable directly in a nix-shell with Nix/Lix but also on NixOS
2024-08-12 11:41:27 +02:00
Zughy
c7642c3c6c
Docs: Explain how to create and remove inventory lists (#14927) 2024-08-12 02:49:14 +02:00
SmallJoker
e236ad8348
Lua API: fix OOB array access in find_nodes_near (#14948) 2024-08-11 20:21:12 +02:00
1F616EMO~nya
f04cdc00a6
Optionally hide player names on the serverlist (#14820)
This commit adds a setting to anonymize player names when sending data to the server list.
2024-08-11 20:19:53 +02:00
asrelo
cfa9c83d33
Improve fs::PathStartsWith to handle empty strings (#14877)
`""` does not refer to a proper path, and `fs::PathStartsWith(path, "")` should just return `false`. This is also the case in libraries in other languages where I looked, seems to be common.

The new behavior:
* check early, if `prefix` is empty - return if path is empty or not,
* no special processing for when `path` is empty, the function meets characters in `prefix` and returns false anyway.
2024-08-11 20:19:14 +02:00
Lars Müller
5b19d315b3
devtest: Add sam to testentities (#14882) 2024-08-11 20:18:30 +02:00
rubenwardy
c6c2c4f60f
Revert "Disable SDL2 for 5.9.0 (#14944)" (#14959)
This reverts commit ebaf3c8d77.
2024-08-11 20:18:11 +02:00
rubenwardy
1222750c50 Continue with 5.10.0-dev 2024-08-11 16:55:00 +01:00
rubenwardy
835dd01fa1 Bump version to 5.9.0 2024-08-11 16:54:55 +01:00
Lars Müller
20afc762cc
Fix empty tables / text lists emitting row events (#14955)
Also makes these elements no longer show a selected nonexisting row
2024-08-11 17:54:05 +02:00
updatepo.sh
dfb23c8db0 Update minetest.conf.example and settings_translation_file.cpp 2024-08-11 17:35:23 +02:00
nauta-turbidus
78e94b299d Translated using Weblate (Polish)
Currently translated at 88.9% (1187 of 1335 strings)
2024-08-11 17:16:07 +02:00
hugoalh
b52f7c76cd Translated using Weblate (Chinese (Traditional))
Currently translated at 94.9% (1267 of 1335 strings)
2024-08-11 17:16:07 +02:00
Mićadźoridź
2877e8e624 Translated using Weblate (Komi)
Currently translated at 28.0% (375 of 1335 strings)
2024-08-11 17:16:07 +02:00
BreadW
0f166aa7ec Translated using Weblate (Japanese)
Currently translated at 97.6% (1304 of 1335 strings)
2024-08-11 17:16:07 +02:00
Honzapkcz
a760faa3fa Translated using Weblate (Czech)
Currently translated at 90.0% (1202 of 1335 strings)
2024-08-11 17:16:07 +02:00
Yof
c0fd23e688 Translated using Weblate (Ukrainian)
Currently translated at 96.6% (1290 of 1335 strings)
2024-08-11 17:16:07 +02:00
reimu105
e558e44af4 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.6% (1223 of 1335 strings)
2024-08-11 17:16:07 +02:00
AlexTECPlayz
0dcf3c57c7 Translated using Weblate (Romanian)
Currently translated at 55.7% (744 of 1335 strings)
2024-08-11 17:16:07 +02:00
BlackImpostor
6c19e68d6b Translated using Weblate (Russian)
Currently translated at 100.0% (1335 of 1335 strings)
2024-08-11 17:16:07 +02:00
ninjum
5142f32878 Translated using Weblate (Galician)
Currently translated at 86.5% (1156 of 1335 strings)
2024-08-11 17:16:07 +02:00
gallegonovato
aeda08c109 Translated using Weblate (Spanish)
Currently translated at 91.9% (1227 of 1335 strings)
2024-08-11 17:16:07 +02:00
Yic95
3d556da8b8 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.3% (1220 of 1335 strings)
2024-08-11 17:16:07 +02:00
waxtatect
aa11c1a278 Translated using Weblate (French)
Currently translated at 100.0% (1335 of 1335 strings)
2024-08-11 17:16:07 +02:00
y5nw
1cd9591997 Translated using Weblate (Chinese (Simplified))
Currently translated at 96.1% (1283 of 1335 strings)
2024-08-11 17:16:07 +02:00
Jorge Rodríguez
4208022d55 Translated using Weblate (Spanish)
Currently translated at 89.2% (1191 of 1335 strings)
2024-08-11 17:16:07 +02:00
Wuzzy
4a4730be9b
Translated using Weblate (German)
Currently translated at 100.0% (1335 of 1335 strings)
2024-08-11 17:15:00 +02:00
Yuna
16c4ba599e
Add builtin pt_BR localization (#14902) 2024-08-11 13:38:26 +01:00
Athozus
b66aa9a954
Add builtin French localization (#14920) 2024-08-11 13:36:50 +01:00
rubenwardy
ebaf3c8d77
Disable SDL2 for 5.9.0 (#14944)
See #14545 and https://forum.minetest.net/viewtopic.php?t=30864
2024-08-11 13:27:41 +01:00
sfan5
62a8c5ca32 Update credits for 5.9.0 2024-08-09 11:19:56 +02:00
sfan5
f5a53647f9
Revert macOS workflow to run on x86 (#14937) 2024-08-09 11:18:56 +02:00
Luke aka SwissalpS
8ef2c42150
Fix some typos in docs (#14921)
---------

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-08-04 23:51:45 +02:00
Francesco Gazzetta
10fd41b4a8
Take screenshot from back buffer when using double buffering (#14904)
Fixes #14901 (black screenshots on Wayland)
2024-08-04 18:40:21 +02:00
grorp
95a0cc8f9a
Avoid infinite recursion with unhandled second touch (#14915) 2024-08-03 18:48:25 +02:00
cx384
c489cef875
Add version to override_item_remove_fields feature flag doc (#14917) 2024-08-02 20:05:50 +02:00
y5nw
8bff2f23c6
Rename minetest.register_async_metatable to minetest.register_portable_metatable (#14895) 2024-08-02 00:13:25 +02:00
rubenwardy
d566b0e280
Android SDK 34 (#14892) 2024-08-02 00:13:13 +02:00
SmallJoker
26deb26f17
Sounds: Partial revert of #14436 and #14341 (#14889)
This reverts functional changes of:
 * commit bf52d1e6 (#14436)
 * commit 63a98538 (#14341)
2024-07-30 21:25:50 +02:00
sfan5
2ba1d60ba5
Hide enable_touch setting on Android (#14891)
until #14749 is merged
2024-07-30 21:25:23 +02:00
Lars Müller
30dcd41d91
Mainmenu: Restore ability to enable flags in settings (#14896)
Fixes flags starting with "no" being hidden
2024-07-30 21:24:59 +02:00
Lars Mueller
90fccc15eb Document empty key in item stack metadata 2024-07-27 18:30:22 +02:00
JosiahWI
ac284e61b4
Clean up MSVC warnings in CIrrDeviceSDL.{h,cpp} (#14872)
The only changes are to add a number of `static_cast`s to make implicit
type conversions explicit.
2024-07-27 18:28:54 +02:00
Zughy
7625f88a0c
Move mod_translation_updater.py to minetest/modtools (#14865) 2024-07-22 21:34:07 +02:00
sfence
4e1661eded
Fix inventory items unresponsive after tab interaction (#14661)
This was a soft lock until LMB was clicked again.
2024-07-22 19:14:53 +02:00
rubenwardy
60f8c02e18
Add setting to disable Content tab update indicator (#14827) 2024-07-22 16:35:47 +02:00
DS
768fd4adee
Restore buggy texture overlay modifier (#14852)
Required because of backwards compatibility.
2024-07-22 16:35:36 +02:00
Yoruma
682b789dd5
Fix variable use-without-initialization error in MSVC debug build 2024-07-22 16:32:50 +02:00
sfan5
02f40e5b0d
Fix blockseed for on_generated in mapgen env 2024-07-22 16:31:46 +02:00
sfan5
a7a719261e
Minimize data sent in the default user agent (#14851) 2024-07-20 10:27:04 +02:00
1F616EMO~nya
eba0806d77
Warn contributors about not to run updatepo.sh manually (#14845) 2024-07-20 10:24:41 +02:00
1F616EMO~nya
b03e9ef1c7
Set SDL_HINT_APP_NAME to Minetest (#14862)
* Set SDL_HINT_APP_NAME to Minetest

* Check for SDL version

* Re-run docker-image check
2024-07-19 13:22:42 +02:00
AFCMS
8e59d8b682
Better AppStream metadata (#14648)
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-07-14 21:57:29 +02:00
Kazooo100
ecf6295b4a
Allow main menu gamebar scroll to loop (#14841) 2024-07-14 21:57:11 +02:00
sfan5
569df37442
Un-deprecate redis database backend (#14849)
This reverts commit 83bc362dac.
2024-07-14 21:56:55 +02:00
Gregor Parzefall
d733e1abea Don't allow sync. HTTP requests on the main thread anymore
Any sync. HTTP request on the main thread is a bug, don't allow introducing one again.
2024-07-12 22:33:17 +02:00
Gregor Parzefall
c3efcb3896 Remove the last remaining sync. HTTP requests on the main thread 2024-07-12 22:33:17 +02:00
Gregor Parzefall
1e7f554bcd Fix two typos
Co-authored-by: Wuzzy <Wuzzy@disroot.org
2024-07-11 19:34:39 +02:00
updatepo.sh
0e9fe7f194 Run updatepo.sh 2024-07-11 15:14:56 +02:00
updatepo.sh
f5716ef141 Update minetest.conf.example and settings_translation_file.cpp 2024-07-11 15:13:57 +02:00
Qimar
652a21ba8a Translated using Weblate (Lojban)
Currently translated at 21.1% (277 of 1310 strings)
2024-07-11 14:56:15 +02:00
BlackImpostor
4d39943d0f Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
lotigara
540ea34ade Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
Kisbenedek Márton
183a2b5579 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
Va Milushnikov
d2ece3c165 Translated using Weblate (Esperanto)
Currently translated at 88.3% (1158 of 1310 strings)
2024-07-11 14:56:15 +02:00
ninjum
a31d6b0886 Translated using Weblate (Galician)
Currently translated at 87.1% (1142 of 1310 strings)
2024-07-11 14:56:15 +02:00
SergioFLS
2e62025d7e Translated using Weblate (Toki Pona)
Currently translated at 1.4% (19 of 1310 strings)
2024-07-11 14:56:15 +02:00
SergioFLS
42522a277c Translated using Weblate (Spanish)
Currently translated at 91.4% (1198 of 1310 strings)
2024-07-11 14:56:15 +02:00
ROllerozxa
987ade361d Translated using Weblate (Swedish)
Currently translated at 64.4% (844 of 1310 strings)
2024-07-11 14:56:15 +02:00
Mićadźoridź
385df95ef4 Translated using Weblate (Komi)
Currently translated at 22.2% (292 of 1310 strings)
2024-07-11 14:56:15 +02:00
Mićadźoridź
5b9fb5ac02 Added translation using Weblate (Komi) 2024-07-11 14:56:15 +02:00
jhon game
c96f246200 Translated using Weblate (Hebrew)
Currently translated at 36.1% (474 of 1310 strings)
2024-07-11 14:56:15 +02:00
XqcD445
e55a8ab77a Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.4% (727 of 1310 strings)
2024-07-11 14:56:15 +02:00
EditaNEmilis
fe137c0941 Translated using Weblate (Lithuanian)
Currently translated at 16.1% (211 of 1310 strings)
2024-07-11 14:56:15 +02:00
Jamil Mohamad Alhussein
285a73cf0e Translated using Weblate (Arabic)
Currently translated at 35.4% (464 of 1310 strings)
2024-07-11 14:56:15 +02:00
Mateusz Malinowski
306a6f57f3 Translated using Weblate (Polish)
Currently translated at 82.3% (1079 of 1310 strings)
2024-07-11 14:56:15 +02:00
Just Playing
105f5ec092 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
Linerly
275e2d8ff8 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
Indigo Ray
ca33bcf2ab Translated using Weblate (Lojban)
Currently translated at 17.1% (225 of 1310 strings)
2024-07-11 14:56:15 +02:00
ElonSatoshi
386a249b0c Translated using Weblate (Toki Pona)
Currently translated at 0.7% (10 of 1310 strings)
2024-07-11 14:56:15 +02:00
Lars Müller
dd8b1680f5 Translated using Weblate (Romanian)
Currently translated at 53.7% (704 of 1310 strings)
2024-07-11 14:56:15 +02:00
sfan5
6acfa2babf Translated using Weblate (German)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
Oğuz Ersen
7025e9dff9 Translated using Weblate (Turkish)
Currently translated at 85.5% (1121 of 1310 strings)
2024-07-11 14:56:15 +02:00
Petter Reinholdtsen
67cdbb54bc Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.1% (722 of 1310 strings)
2024-07-11 14:56:15 +02:00
Wuzzy
2028a2c2f3 Translated using Weblate (German)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
BlackImpostor
570fdbf9fd Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
cora de la mouche
090a270246 Translated using Weblate (Toki Pona)
Currently translated at 0.7% (10 of 1310 strings)
2024-07-11 14:56:15 +02:00
cora de la mouche
fcb09f440f Added translation using Weblate (Toki Pona) 2024-07-11 14:56:15 +02:00
Unacceptium
ab2ad8aec1 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:15 +02:00
yue weikai
55334cfbc0 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:14 +02:00
Mivik
590273e2fd Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
Conight
a813e261b4 Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
IFRFSX
043961fc3e Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
Y.W
c85cefde67 Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
ferrumcccp
34326df680 Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
ZhiZe-ZG
6af09cb2ad Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
70fc175e74 Translated using Weblate (Chinese (Simplified))
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:14 +02:00
Deleted User
4fd4ed6ca3 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1241 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
9c6d5a8408 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1241 of 1310 strings)
2024-07-11 14:56:14 +02:00
ZhiZe-ZG
6079d4488a Translated using Weblate (Chinese (Simplified))
Currently translated at 94.3% (1236 of 1310 strings)
2024-07-11 14:56:14 +02:00
AISS
0163e0b099 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.3% (1236 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
ace8c56199 Translated using Weblate (Chinese (Simplified))
Currently translated at 93.6% (1227 of 1310 strings)
2024-07-11 14:56:14 +02:00
ZhiZe-ZG
abd05a38ad Translated using Weblate (Chinese (Simplified))
Currently translated at 91.9% (1205 of 1310 strings)
2024-07-11 14:56:14 +02:00
IFRFSX
e7c8346861 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.9% (1205 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
69dd8c61c9 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.9% (1205 of 1310 strings)
2024-07-11 14:56:14 +02:00
秘密の店
4e3185af88 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
ZhiZe-ZG
b69c02a824 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
AISS
606da069b4 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
607f473be2 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
Y.W
e283b6fb25 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
Lin Happy 666
da7e95a221 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.7% (1202 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
754842c6af Translated using Weblate (Chinese (Simplified))
Currently translated at 91.1% (1194 of 1310 strings)
2024-07-11 14:56:14 +02:00
秘密の店
675b6e9228 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.6% (1188 of 1310 strings)
2024-07-11 14:56:14 +02:00
yue weikai
070c5ee632 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.6% (1188 of 1310 strings)
2024-07-11 14:56:14 +02:00
Uko Koknevics
b78042fc2f Translated using Weblate (Latvian)
Currently translated at 22.5% (296 of 1310 strings)
2024-07-11 14:56:14 +02:00
gallegonovato
a55c689d7c Translated using Weblate (Spanish)
Currently translated at 90.2% (1182 of 1310 strings)
2024-07-11 14:56:14 +02:00
Blood Axe
f0a28c381b Translated using Weblate (Norwegian Bokmål)
Currently translated at 54.4% (713 of 1310 strings)
2024-07-11 14:56:14 +02:00
56 independent
3d9a5e6866 Translated using Weblate (Spanish)
Currently translated at 90.2% (1182 of 1310 strings)
2024-07-11 14:56:14 +02:00
Edward
857d5fe6a1 Translated using Weblate (Romanian)
Currently translated at 51.6% (677 of 1310 strings)
2024-07-11 14:56:14 +02:00
Adam Jagoda
1e485d5dbc Translated using Weblate (Polish)
Currently translated at 82.0% (1075 of 1310 strings)
2024-07-11 14:56:14 +02:00
Filippo Alfieri
20bc6d6789 Translated using Weblate (Italian)
Currently translated at 94.3% (1236 of 1310 strings)
2024-07-11 14:56:14 +02:00
Balázs Kovács
ed07a70327 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:14 +02:00
YearOfFuture
dfc10f4a32 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:14 +02:00
RRadler
64cc3b90c7 Translated using Weblate (Greek)
Currently translated at 26.4% (346 of 1310 strings)
2024-07-11 14:56:14 +02:00
Tirifto
02776f9768 Translated using Weblate (Esperanto)
Currently translated at 88.3% (1157 of 1310 strings)
2024-07-11 14:56:14 +02:00
dog
2ab6662a13 Translated using Weblate (Korean)
Currently translated at 54.3% (712 of 1310 strings)
2024-07-11 14:56:14 +02:00
Jaidyn Ann
be56413593 Translated using Weblate (Esperanto)
Currently translated at 86.1% (1129 of 1310 strings)
2024-07-11 14:56:14 +02:00
JUST PLAYING
f0de9c100d Translated using Weblate (Indonesian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:14 +02:00
Tianshu Feng
5693327ca1 Translated using Weblate (Chinese (Simplified))
Currently translated at 87.4% (1145 of 1310 strings)
2024-07-11 14:56:14 +02:00
Unacceptium
a1f82dcfb7 Translated using Weblate (Hungarian)
Currently translated at 99.4% (1303 of 1310 strings)
2024-07-11 14:56:14 +02:00
Giov4
2b7fd07150 Translated using Weblate (Italian)
Currently translated at 93.6% (1227 of 1310 strings)
2024-07-11 14:56:14 +02:00
Gaël Chrétien
9c197693d7 Translated using Weblate (French)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:14 +02:00
jhh
6afd79c771 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 39.8% (522 of 1310 strings)
2024-07-11 14:56:14 +02:00
Alexsandro Vítor
35485379bd Translated using Weblate (Portuguese)
Currently translated at 91.8% (1203 of 1310 strings)
2024-07-11 14:56:13 +02:00
Christian Elbrianno
da3deefae2 Translated using Weblate (Indonesian)
Currently translated at 99.9% (1309 of 1310 strings)
2024-07-11 14:56:13 +02:00
reimu105
1a53086f7c Translated using Weblate (Chinese (Traditional))
Currently translated at 84.7% (1110 of 1310 strings)
2024-07-11 14:56:13 +02:00
Jun Nogata
0ca6bb3a1f Translated using Weblate (Japanese)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
Marian
c5d461c379 Translated using Weblate (Slovak)
Currently translated at 95.8% (1255 of 1310 strings)
2024-07-11 14:56:13 +02:00
AISS
531e2b442d Translated using Weblate (Chinese (Traditional))
Currently translated at 84.5% (1108 of 1310 strings)
2024-07-11 14:56:13 +02:00
reimu105
7ead579c67 Translated using Weblate (Chinese (Traditional))
Currently translated at 84.5% (1108 of 1310 strings)
2024-07-11 14:56:13 +02:00
Tianshu Feng
2e91094afa Translated using Weblate (Chinese (Simplified))
Currently translated at 86.8% (1138 of 1310 strings)
2024-07-11 14:56:13 +02:00
Nanashi Mumei
b991941227 Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
65aa894749 Translated using Weblate (Malay)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
BreadW
3f478d8597 Translated using Weblate (Japanese)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
YearOfFuture
470f6742bc Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
waxtatect
3f2f38842c Translated using Weblate (French)
Currently translated at 100.0% (1310 of 1310 strings)
2024-07-11 14:56:13 +02:00
sfan5
a6121c7f67 Fix path traversal in mainmenu's extract_zip 2024-07-10 22:37:45 +02:00
rubenwardy
bb3f271a20
Set ContentDB updates detection cache time to 24 hours (#14837) 2024-07-09 22:07:26 +01:00
grorp
3de42f56c5
Fix and improve particle(spawner) documentation (#14804) 2024-07-06 18:02:31 +02:00
grorp
fcb4f258f5
GUITable: Scale images with display density / row height (#14709) 2024-07-02 20:57:43 +02:00
Lars Müller
8ed55b3aff
Help modders deal with object invalidation (#14769)
* Skip invalid objects in raycasts
* Add `ObjectRef:is_valid` method
* Add object inside radius / area iterators which skip invalid objects
* Update docs to clarify object invalidation and how to deal with it

---------

Co-authored-by: sfan5 <sfan5@live.de>
2024-07-01 20:50:38 +02:00
Erich Schubert
d5444e1172
Fix more missing newlines in lua_api.md (#14791)
Poor rendering in online documentation:
https://api.minetest.net/minetest-namespace-reference/#list-of-apis-available-in-the-mapgen-env
https://api.minetest.net/minetest-namespace-reference/#list-of-apis-available-in-an-async-environment
2024-07-01 20:49:00 +02:00
grorp
ea827e4c5d
Fix new texture properties not being sent for minetest.add_particle (#14760)
Co-authored-by: Lars Müller <appgurulars@gmx.de>
2024-07-01 20:41:54 +02:00
SmallJoker
95e77bd7cb Translation updater: Fix error when no translation strings were found 2024-07-01 18:29:53 +02:00
1F616EMO~nya
321b217feb
Log node/ore name when detecting deprecated fields (#14794) 2024-07-01 17:26:15 +02:00
grorp
3958c19f83
Remove enable_touch special case for C++ menu scaling (#14800) 2024-06-30 20:39:36 +02:00
grorp
7709d92289
Restore old inconsistent minimum digging time behavior (#14777)
and restore default of 0.16 for repeat_place_time since it was only changed to be in line with repeat_dig_time.
2024-06-30 20:39:28 +02:00
sfan5
868b548dd0 lua: add short readme 2024-06-30 20:38:22 +02:00
sfan5
837aab0e98 lua: apply patch for "read overflow in 'l_strcmp'"
<https://lua.org/bugs.html#5.4.6-1> (minimal port of changes)
2024-06-30 20:38:22 +02:00
sfan5
77ac20a66b lua: apply patch for "Parameter 'what' of 'debug.getinfo' cannot start with '>'"
<https://lua.org/bugs.html#5.4.2-2>
2024-06-30 20:38:22 +02:00
sfan5
7362ecb3b4 lua: apply patch for "Compiler can optimize away overflow check in table.unpack"
<https://lua.org/bugs.html#5.2.3-1>
2024-06-30 20:38:22 +02:00
sfan5
88ffe75b58 lua: apply patch for "Chunk with too many lines may crash Lua"
<https://lua.org/bugs.html#5.2.3-3>
2024-06-30 20:38:22 +02:00
sfan5
c1520c9e11 lua: apply patch for "Stack overflow in vararg functions with many fixed parameters called with few arguments"
known as CVE-2014-5461
<https://sources.debian.org/src/lua5.1/5.1.5-9/debian/patches/0004-Fix-stack-overflow-in-vararg-functions.patch/>
2024-06-30 20:38:22 +02:00
grorp
9a1501ae89
CIrrDeviceSDL: Fix numpad key events not having correct KeyInput.Char (#14780)
Allows you to change viewing range using numpad +/- again. This fix also works with the current unreleased version of SDL 3.

The keycodes for numpad keys (both SDL keycodes and Irrlicht keycodes) are not the same as the keycodes for the equivalent non-numpad keys and don't correspond to chars, so I mapped them to chars manually.

Since I think the resolution of https://github.com/minetest/minetest/issues/13770 was "just disable numlock", I made sure to only do this for the numpad number keys if numlock is enabled.
2024-06-27 14:44:44 +02:00
Erich Schubert
514e106414
Fix missing newline before Markdown list (#14783)
Renders incorrectly e.g. on https://api.minetest.net/spatial-vectors/
2024-06-26 22:21:18 +02:00
grorp
4c001bd248
Make button sprites (scrollbar arrows) DPI-aware (#14772) 2024-06-26 15:25:27 +02:00
1F616EMO~nya
fb6ceb2664
Properly escape Markdown markups at minetest.string_to_area (#14774)
Co-authored-by: DS <ds.desour@proton.me>
2024-06-24 22:14:16 +02:00
aminothere
50da26da91
Document alternative 'persist' key in noise parameter table (#14762) 2024-06-24 22:12:42 +02:00
kromka-chleba
28857841aa
Fix math.round floating point bug (#14757) 2024-06-24 20:57:06 +01:00
rubenwardy
157d129e30
Fix unnecessary content refreshing (#14705) 2024-06-24 20:56:37 +01:00
Yoruma
9ab447843b
Clarify "dtime" in API (#14758) 2024-06-22 10:59:58 +02:00
l-koehler
fe6da3a16b
Disallow formspec debug if the player does not have the debug privilege (#14753) 2024-06-17 15:59:49 +02:00
sfan5
fac9aac821
Move malloc_trim invocations to background thread (#14744) 2024-06-17 15:59:35 +02:00
grorp
d7f4ce6cff
Fix broken default sneak keybind on macOS with SDL (#14754) 2024-06-16 17:50:02 +02:00
grorp
a9cca5e76c
SDL2: Support highdpi (#14703)
and handle DPI changes at runtime
2024-06-16 17:49:42 +02:00
cx384
7a64527db5
Fix connected_players on_shutdown (#14739) 2024-06-15 16:00:33 +02:00
grorp
bc23a610d3
Fix two problems with toggling fullscreen at runtime (#14750) 2024-06-14 16:50:41 +02:00
Mikita Wiśniewski
9def45aa80
Add zstd to Void Linux dependencies (#14748) 2024-06-12 12:39:15 +02:00
grorp
85878d894a
Android: Fix back button sometimes not working as ESC (#14743) 2024-06-11 22:37:57 +02:00
Lars Mueller
ae4cd1ebf1 Corresponding code changes 2024-06-10 21:15:30 +02:00
minetest
781c7a800f Replace Catch2 with v3 amalgamation 2024-06-10 21:15:30 +02:00
sfan5
5133ae52df Update vcpkg used in CI 2024-06-10 18:49:43 +02:00
sfan5
3539af7d77 Set some useful SDL hints
fixes #14596
2024-06-10 18:49:43 +02:00
sfan5
c03894321a Fix file write warning in devtest
closes #14721
2024-06-10 18:49:43 +02:00
sfan5
b7e886a740 Rename sha256 header
fixes #14710
2024-06-10 18:49:43 +02:00
sfan5
8268c61b9f Make safeWriteToFile safe for thread-concurrent use 2024-06-10 18:49:43 +02:00
sfan5
fee6e8e11b Identify when compiled with openresty LuaJIT
Debian testing ships it
2024-06-10 18:49:43 +02:00
sfan5
558d749d54 A few clean ups in log.cpp 2024-06-10 18:49:43 +02:00
sfan5
27cb54c1db Stop misusing volatile keyword 2024-06-10 18:49:43 +02:00
cx384
4c9be808a7 Improve register_on_leaveplayer documentation 2024-06-09 13:21:54 +02:00
sfan5
71893807b3
Call malloc_trim() regularly to improve deallocation behavior (#14707) 2024-06-07 16:57:30 +02:00
SmallJoker
08485f6781 Chat: Remove tailing punctuation from clickable links 2024-06-05 20:11:47 +02:00
sfan5
87232358d3
Update some workflows to newer Ubuntu versions (#14668) 2024-06-03 20:39:02 +02:00
Lars Müller
ec9c000be9
Fix scrolling in scroll containers (#14702) 2024-06-03 20:38:09 +02:00
Alex
75f3a2183f
Fix and clarify skybox texture order documentation (#14680) 2024-06-03 12:40:34 +02:00
Lars Mueller
445e485fc5 Fix CI not running on Irrlicht-only PRs 2024-06-03 11:15:56 +02:00
grorp
508b5ccc63
Document keymap_toggle_block_bounds, remove unimplemented BLOCK_BOUNDS_MAX (#14722) 2024-06-02 21:05:35 +02:00
grorp
833bb542fc
Allow toggling fullscreen without restart and add keybind (#14714) 2024-06-02 21:05:16 +02:00
grorp
981d67324b
Mainmenu: Unify gamedata.errormessage and messagebox formspecs (#14716) 2024-06-01 17:03:06 +02:00
sfence
140b9e5a5a
Allow game to specify first and last mod in mod loading order (#14177)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
2024-06-01 16:36:20 +02:00
Lars Mueller
a4768d1638 Fix fog moon tint not working 2024-06-01 16:34:32 +02:00
rubenwardy
abf353c178
Update no games message to give more context (#14695) 2024-05-29 20:10:22 +02:00
SmallJoker
670bb32b2c Particles: fix crash caused by absent texture
Introduced in commit f8bff34. The related code does already expect that
'texture.ref' may be nullptr.
2024-05-29 19:46:24 +02:00
Desour
f836a47bc1 Sound loading: Fix issues where ov_read skips samples 2024-05-27 17:12:58 +02:00
Desour
43df39c4f7 Sound loading: Improve error handling 2024-05-27 17:12:58 +02:00
Desour
9da5c5e2d0 Add precompiled header support
Note: the <filesystem> header is not included in the default
precompiled_headers.txt, because we don't use it yet, and it might be big
2024-05-27 17:12:39 +02:00
Desour
cdbbac5b6d Move sha256.c to lib/
Precompiled headers don't work if we're not a pure C++ project.
2024-05-27 17:12:39 +02:00
Gregor Parzefall
3120558dd1 Make the CDB dependency dialog use more space 2024-05-26 19:49:48 +02:00
Gregor Parzefall
f3c91e4f96 Immediately apply gui_scaling changes to IGUISkin 2024-05-26 19:49:48 +02:00
grorp
b1fa430dad
Android: Don't crash if there is no web browser installed (#14683) 2024-05-26 19:49:32 +02:00
sfan5
83bc362dac
Mark Redis database backend as deprecated (#14679) 2024-05-26 14:28:30 +02:00
Muhammad Rifqi Priyo Susanto
a86baefda7
Translation updater: Add support for function call without parantheses (#14574)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-05-26 14:28:24 +02:00
AFCMS
82790b1556
Add documentation for IDE developer setup (#13935) 2024-05-26 14:28:12 +02:00
grorp
728f643ea7
Scale C++ menus down to fit the window (#14690) 2024-05-24 12:10:46 +02:00
grorp
d5fc040d2d
Consistent width for internal scrollbars of formspec elements (#14689)
also: Make sure that very short, wide scrollbars are still usable
2024-05-24 12:10:19 +02:00
grorp
6c0b8229ec
Fix artifacts with bloom + tonemapping on ogles2 (#14688) 2024-05-23 20:36:13 +02:00
grorp
bc60693a5d
Enable "FULL" debug info for Android build (#14684) 2024-05-23 20:36:01 +02:00
JosiahWI
1298374818
Upgrade client active object mgr tests to Catch2 (#14565)
* Upgrade client active object mgr tests to Catch2

In addition to invoking Catch2's test runner after Minetest's homemade
runner, this refactors the tests to follow the DRY principle, and gives
them expressive names and clear assertions. Catch2 is already bundled
with Minetest, so there are no added dependencies.

* Increment failed modules count for Catch2 tests

* Respect --test-module option for Catch2 tests

* Improve Catch2 --test-module behavior

This switches infostream to rawstream so that test runner output is
displayed, and returns the correct boolean depending on the results. The
tests are now found by setting the configuration instead of invoking the
command line parser.

* Test uniqueness of all IDS instead of just one

Co-Authored-By: Lars Müller <appgurulars@gmx.de>

* Include Catch2 test run in timing and logging

* Flush std::cout after printing Catch results

* Increment total tests run instead of hardcoding to 1

* Flush stderr before printing to stdout

It's necessary to flush stderr before printing to stdout in adition to
flushing stdout before printing to stderr, to make sure all output is
ordered correctly.

* Make Catch write to rawstream

---------

Co-authored-by: Lars Müller <appgurulars@gmx.de>
2024-05-22 18:39:53 +02:00
Xeno333
a078cfee3e
Rename "opaque_water" setting to "translucent_liquids" with inverted meaning (#14660)
The old setting will be migrated properly.

---------

Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-05-22 16:46:05 +02:00
Lars Mueller
bd4572cfd1 Fix broken CI 2024-05-21 18:10:09 +02:00
sfence
df8a600b22
Fix glitch through ceiling with Sneak Glitch (#14332) 2024-05-21 17:52:54 +02:00
Lars Mueller
567f85752d Fix broken unit test
Also makes devtest unit test results a bit more prominent
2024-05-21 16:31:05 +02:00
Lars Mueller
5009259473 Add unit test and feature flag for override_item 2024-05-21 15:46:33 +02:00
sfence
b21a974342
Fix inventory: Quickly picking up item and placing it again no longer works (#14657) 2024-05-21 15:38:12 +02:00
chmodsayshello
ab783b9bb2
Display background & moving progress bar on shutdown screen (#14597)
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-05-21 15:37:35 +02:00
sfan5
36d236c5e0
Update SDL for mingw builds (#14678) 2024-05-20 20:37:52 +02:00
Lars Müller
408faa11a1
Allow removal of item definition fields (#14675) 2024-05-20 20:37:40 +02:00
OgelGames
8972e829f2
Restore vector type check (#14663) 2024-05-20 20:36:44 +02:00
sfan5
c4703a7f19 Fix wrong collision axis in Lua moveresult
introduced by c24a04d246
2024-05-17 14:32:57 +02:00
grorp
f6cfe6b873
Enable RTTI for Irrlicht on MSVC (#14677) 2024-05-17 13:27:31 +02:00
Muhammad Rifqi Priyo Susanto
bceef8f529 Trivial fix (forget to remove semicolon) in gettext.cpp 2024-05-16 21:00:00 +07:00
AFCMS
b23042839b
Fixes to Docker GitHub Actions workflow 2024-05-15 19:56:50 +02:00
ROllerozxa
5625be70fa
Don't bundle Development Test on macOS 2024-05-15 19:56:41 +02:00
Lars Müller
5c187363b2
Fix some clang compiler warnings (#14654)
* Fix some clang compiler warnings

* Get rid of sdl_supports_primary_selection

* Fix draw2DImage hiding overloaded virtual function
2024-05-15 19:56:25 +02:00
sfan5
93f4844c9c Fix unintentional error message with dynamic media 2024-05-14 23:12:49 +02:00
sfan5
39fd9b93c3 Introduce proper error handling for file streams 2024-05-14 18:33:08 +02:00
sfan5
c38e0d05bf
Reenable fog toggle unless server restricts fog distance (#14634)
see comments in #14539
2024-05-14 18:31:51 +02:00
Josiah VanderZee
5a4d7fb0d6 Do not bother to assert that a u8 is >= 0
This fixes a warning seen in GCC 7 on CI about a comparison in
mapblock.h that is always true.
2024-05-14 16:21:30 +02:00
sfan5
6303334cc2 Deduplicate GL extension detection 2024-05-12 14:20:34 +02:00
sfan5
472742266b Fix invalid glDrawBuffer call on GLES
closes #14445
2024-05-12 14:20:34 +02:00
chmodsayshello
0889048cb5
Add option for random mod load order (#14637) 2024-05-12 14:20:18 +02:00
grorp
57b6e74abb
Fix crash if zip file cannot be opened (#14636)
Helped-by: savilli <78875209+savilli@users.noreply.github.com>
2024-05-12 11:46:39 +02:00
grorp
a8af0c0ca4
Close buttonbars when hiding TouchScreenGUI (#14630)
To open the inventory or the pause menu, you first need to open the buttonbar
containing the respective button. Before this commit, the buttonbar is still
open after closing the menu, so you have to tap twice before you can continue
playing. After this commit, the buttonbar is already closed after closing the
menu, so you only have to tap once before you can continue playing.
2024-05-10 18:54:22 +02:00
Benjamin Wheeler
07fe8d4481
Dockerfile: Use the default branch when cloning libspatialindex repository (#14621) 2024-05-10 17:00:15 +07:00
grorp
e0e1d0855d
Close formspecs with a single tap outside (#14605) 2024-05-09 19:16:08 +02:00
grorp
178591b6d5
Android CI: Additionally make an AAB for uploading to the Play Store (#14584) 2024-05-09 19:15:50 +02:00
sfan5
dd475d8af4 Add benchmarks for server::ActiveObjectMgr 2024-05-09 11:31:35 +02:00
Licaon_Kter
121d22f137
Cleanup Removed Java 17 Options (#14626)
ref: https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#removed-java-options
2024-05-09 11:31:22 +02:00
sfan5
59bf1d8cd9
Fix curl compatibility issues with colorize_url (#14615)
Also move the escape code safety check to guiOpenURL.
2024-05-09 11:31:10 +02:00
jordan4ibanez
780543f0a2 Add forgotten opensuse dependency
gcc-c++
2024-05-09 00:22:36 +02:00
sfan5
de78ffb551 Fix strings in modified_reason_strings
one was also missing
2024-05-09 00:19:24 +02:00
sfan5
1aba7f1fde
Add unit tests for MapBlock (de)serialization (#14560) 2024-05-05 22:54:40 +02:00
rubenwardy
3017b0213b
Allow quoting hypertext attribute values (#14550) 2024-05-05 14:27:17 +02:00
sfan5
d748c8c653 Gate disabling of fog or camera update behind 'debug' priv 2024-05-05 14:26:56 +02:00
grorp
af8cb63292
Add object's own position for each collision to moveresult (#14608) 2024-05-05 13:28:59 +02:00
grorp
d7f9da49eb
Fix shootline not being updated if press and release happen in the same step (#14606) 2024-05-05 13:28:50 +02:00
Lars Mueller
70bddcf318 Fix wrong name for bone override interpolation field 2024-05-04 02:09:35 +02:00
SmallJoker
f0bb5313d3 Chat console: Prevent input loss on double open 2024-05-03 16:29:33 +02:00
DS
c352fbf5c9
Warn on unknown CMAKE_BUILD_TYPE values (#14600) 2024-05-03 16:29:02 +02:00
sfan5
9c3c286aab Optimize code patterns around raycasting 2024-05-03 16:28:29 +02:00
sfan5
e10adf83d5 Reduce wasteful memory allocations in update_lighting_nodes() 2024-05-03 16:28:29 +02:00
sfan5
c24a04d246 Optimize pushing collision data for entity on_step
Since this is fixed overhead for every entity, this is important to optimize.
This optimizes one very common case.

before:
  push_collision_move_result [us] _____________ 64512x   3.562

after:
  push_collision_move_result [us] _____________ 72636x   0.831
2024-05-03 16:28:29 +02:00
sfan5
2e89529eef Optimize env access and structs in collisionMoveSimple 2024-05-03 16:28:29 +02:00
sfan5
92d03f3832 Trivially optimize iteration order in loops
Due to how node data is stored iterating X last provides better cache locality.
2024-05-03 16:28:29 +02:00
Lars Müller
2efd0996e6
Document empty string as form name (#14601) 2024-04-30 13:50:31 +02:00
sfan5
ac4f13e78f
Add minetest.get_gen_notify to mapgen env (#14568) 2024-04-30 13:50:18 +02:00
grorp
2bdd0a6bdb
Add physics overrides for walk speed and Fast Mode (#14475)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
2024-04-30 13:50:01 +02:00
SmallJoker
c044a3c1ca
Client: fix unknown texture upon shift-move to full inventory list (#14586)
Fixes a regression caused by 4245a760
'moveItemSomewhere' attempted to add a leftover stack to an empty stack, resulting
in an empty name with non-0 ItemStack count.
2024-04-28 19:45:09 +02:00
sfence
72cb4e9bea
Allow nil puncher in object:punch (#14319) 2024-04-28 17:55:04 +02:00
sfan5
fc0ac64277 Fix build errors with curl disabled 2024-04-28 12:31:15 +02:00
sfan5
df4c9e2903 Revert "Clean up some getServer() unsafety"
Turned out to not be a good idea.
This reverts commit 58eccc7a2a.
2024-04-28 00:24:22 +02:00
grorp
73dbd2f0ab
Smooth scrolling (#14562) 2024-04-28 00:14:31 +02:00
OgelGames
05d5dc4cec
Fix InvRef bugs and add unit tests (#14591) 2024-04-28 00:13:44 +02:00
Muhammad Rifqi Priyo Susanto
815b5cb086
Translation updater: Add comment propagation (#14416) 2024-04-28 00:12:30 +02:00
Lars Müller
0837d674eb
Fix set_fov-induced grayscreen 2024-04-28 00:12:15 +02:00
OgelGames
a7bde8e523
Hide internal detached inventory functions (#14594) 2024-04-28 00:07:45 +02:00
LoneWolfHT
c63c05b141
Fix crash when player leaves before breath removal job 2024-04-24 22:32:07 +02:00
sfan5
12ccbe6f12 Amend profiling documentation 2024-04-24 14:55:50 +02:00
Muhammad Rifqi Priyo Susanto
be540043ee
Do not make inventory_items_animations setting static thread_local (#14573)
This removes restart requirement when toggling the setting after the first play/run.
2024-04-24 09:00:04 +07:00
JosiahWI
de8d80dee0
Fix MSVC warning C4172 in ModifySafeMap::get (#14576) 2024-04-23 19:04:26 +02:00
sfan5
98fd5bd453
Formalize OS support policy (#14556) 2024-04-23 19:03:58 +02:00
cosin15
15b569fb71
Remove unnecessary copy of a big data structure 2024-04-23 19:03:50 +02:00
sfan5
58eccc7a2a Clean up some getServer() unsafety 2024-04-23 19:03:35 +02:00
sfan5
e39e47b21f Reduce needless copying of KeyPress 2024-04-23 19:03:35 +02:00
sfan5
e7f6e7d7b6 Fix Irrlicht log events not being passed through 2024-04-23 19:03:35 +02:00
sfan5
af27d97003 Log delays introduced by SDL_PollEvent 2024-04-23 19:03:35 +02:00
sfan5
c8e46749a4 Change some profiler values to microseconds 2024-04-23 19:03:35 +02:00
grorp
eb432d3da0
Fix some Game members not being freed after some startup errors (#14561) 2024-04-21 15:52:46 +02:00
David Heidelberg
4ab3c54f5b
Basic tablet/phone/watch autodetection (#14400)
Until we're able to detect touchscreen itself, let's have a detection
based on a form factor of the device.

Tablets and handhelds are usually equiped with touchscreens, so as a
default enable touchscreen GUI there.

 - Windows and Linux supports autodetection.
 - Android is hardcoded as touch-based.
 - MacOS staying same as before without detection.

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-04-21 15:51:58 +02:00
JosiahWI
de1d8ec070
Do not link /latomic on MSVC (#14564)
MSVC does not recognize /latomic, resulting in a warning upon configure.
2024-04-20 20:37:46 +02:00
SmallJoker
c8a41409d9
HUD: Text element color support (#14558) 2024-04-20 20:36:44 +02:00
Josiah VanderZee
d2a089ffd9 Remove <ctgmath> include from particles.h
The header is deprecated, and we don't even use it.
2024-04-20 18:01:25 +02:00
sfan5
3bd5169aee Fix profiler assertion failures
oops
2024-04-20 14:32:35 +02:00
sfan5
b7887a339d mod_translation_updater.py: fix @n being incorrectly rejected 2024-04-20 14:10:04 +02:00
sfan5
1b89d4d541 Simplify getBlockNodeIdMapping
since commit 0f9c78c3eb nodedef->get()
will never return an entry with empty name, so we can drop the related parts.
2024-04-20 13:03:42 +02:00
sfan5
d8190e1c5f Some globals (un-)init fixes 2024-04-20 13:03:42 +02:00
sfan5
2af5191070 Optimize MapNode::serializeBulk
before
  serializeBulk [us] __________________________ 9047x   9.363

after
  serializeBulk [us] __________________________ 8458x   1.214
2024-04-20 13:03:42 +02:00
sfan5
4027e08cc8 Print profiler at end of session 2024-04-20 13:03:42 +02:00
sfan5
72eeb9fecb Refactor profiler and related classes 2024-04-20 13:03:42 +02:00
DS
5a07f5a652
Fix inconsistent rounding in VoxelLineIterator::VoxelLineIterator (#14555)
floatToInt rounds 0.5 differently depending on sign.
2024-04-20 13:03:34 +02:00
sfan5
d767ab0890 Add runtime test to mingw CI 2024-04-17 16:58:31 +02:00
sfan5
df2fd399df Fix missing DLLs in Windows build 2024-04-17 16:58:31 +02:00
grorp
f2b5c35fa2
TouchScreenGUI dehardcoding refactor (#14472) 2024-04-17 15:59:52 +02:00
rubenwardy
b2057a5da7
Hypertext: Fix missing space after single letter word (#14551)
Fixes #11727
2024-04-16 08:48:16 +01:00
sfan5
38cacfa577 Try to fix macro definition order problem with OpenGL code 2024-04-15 19:27:05 +02:00
sfan5
13e271c6cb Improve error checks in COpenGL3DriverBase 2024-04-15 17:48:33 +02:00
sfan5
7a6ca85081 Expose OpenGL debugging as a normal setting 2024-04-15 17:48:33 +02:00
sfan5
ecfe9c5c2f lua_api: Clarify some environment API functions 2024-04-14 11:57:20 +02:00
Wuzzy
9f263319ca
Fix 4dir nodebox sometimes not rendering face (#14533) 2024-04-14 11:57:13 +02:00
paradust7
00ef597639
CI: Pin CMake to 3.28 because of regression in 3.29.1 2024-04-12 16:34:05 +02:00
sfan5
30e280b694 Use MT's string conversion inside Irrlicht 2024-04-10 15:31:59 +02:00
sfan5
b9adf244e5 Simplify Irrlicht CMake for static linking
removes any dynamic linking capability, which will stop being possible soon anyway.
2024-04-10 15:31:59 +02:00
cx384
8a5e49c856
Refactor builtin HUD (#14346) 2024-04-10 11:43:15 +02:00
rubenwardy
284f6d3682
Refactor ContentDB integration (#14507) 2024-04-09 21:18:40 +02:00
Gregor Parzefall
cc1bfc6d03 Improve SDL GL fallback code
It now works even if window creation succeeds and only context creation fails.
Adapted from https://github.com/MoNTE48/Irrlicht . This should be fine
license-wise since that repo still contains the original Irrlicht license
(this is no legal advice).
Original PR: https://github.com/MoNTE48/Irrlicht/pull/9

Co-authored-by: Deve <deveee@gmail.com>
2024-04-08 20:15:37 +02:00
Gregor Parzefall
07fdf7158d Migrate the Android port to SDL2 2024-04-08 20:15:37 +02:00
Gregor Parzefall
fca60e2a41 Add SDL2 Java code 2024-04-08 20:15:37 +02:00
DS
e12db0c182
Sounds: Queue more than two buffers if pitch is high (#14515)
Pitch changes playback speed. So always enqueuing 2 buffers did not suffice
(and it was unnecessary complicated).
2024-04-07 22:06:34 +02:00
DS
1d673ce075
Print filenames in irrlicht png warnings (#14525)
Makes warnings like this more informative:
`WARNING[Main]: Irrlicht: PNG warning: iCCP: known incorrect sRGB profile`
2024-04-07 22:06:13 +02:00
sfan5
7e4462e0ac Better handling of temporary folders 2024-04-06 12:10:21 +02:00
sfan5
f87994edc7 Use better randomseed for Lua too
see e985b7a0bf

This solves a concrete issue with async workers generating the same
random numbers (as discovered in #14518).
2024-04-06 12:10:21 +02:00
sfan5
ef0c19477c Fix HAVE_RECENT_LJ false-positives 2024-04-06 12:10:21 +02:00
grorp
9bee6d899b Fix invisible crosshair with effective HUD scaling < 1 2024-04-06 12:10:12 +02:00
1F616EMO~nya
2d8e4df7bc
Allow optional actor ObjectRef value in node interaction calls (#14505) 2024-04-05 13:00:50 +02:00
sfan5
4e1679d2a2
Keep empty servers at bottom of list (#14511) 2024-04-05 13:00:34 +02:00
Gregor Parzefall
fd8e02195e Fix local server startup and shutdown blocking the main thread
Co-authored-by: sfan5 <sfan5@live.de>
2024-04-05 13:00:21 +02:00
Gregor Parzefall
b2982a6f14 Fix all cached media being loaded at once on the main thread 2024-04-05 13:00:21 +02:00
sfan5
a9a0f1e129
Fix GLES shader precision issues (#14516) 2024-04-05 13:00:10 +02:00
Lars Müller
0ea1ec31fc
Misc. doc things (#14509)
* Improve `[sheet` docs

* Clarify that `self` is a luaentity in `self.name`

* Clarify `textures = {itemname}` deprecation

* Document global callback table names
2024-04-03 14:24:15 +02:00
sfan5
f8bff346f4
Batched rendering of particles (#14489)
Co-authored-by: x2048 <codeforsmile@gmail.com>
Co-authored-by: Desour <ds.desour@proton.me>
2024-04-03 13:56:49 +02:00
sfan5
ff88ed7c75 Add symlink for Irrlicht shaders 2024-04-03 13:56:27 +02:00
sfan5
57a737c417 Improve logging of driver probing 2024-04-03 13:56:27 +02:00
sfan5
eb8785a209 Fix segfault if SDL GL context fails 2024-04-03 13:56:27 +02:00
cx384
d4b10db998 Add LF config to .gitattributes 2024-03-31 21:02:47 +02:00
cx384
3a35db6e67 Turn dos files into unix files 2024-03-31 21:02:47 +02:00
Gregor Parzefall
e79587c934 Add shorthand form for touch_interaction 2024-03-30 11:40:50 +01:00
Gregor Parzefall
8935f2af3c Make long tap delay customizable and change default to 400ms 2024-03-30 11:40:50 +01:00
Gregor Parzefall
517f1602aa Re-add "long tap to punch" as a client-side setting 2024-03-30 11:40:50 +01:00
Muhammad Rifqi Priyo Susanto
e8a8525bcd
Fix path splitting in translation updater script 2024-03-30 11:08:18 +01:00
grorp
6e3246c5fd
Limit crosshair scaling to integer multiples to avoid distortion (#14501) 2024-03-30 11:07:36 +01:00
sfan5
97066bf795 Sanity-check reliable packet size at earlier point 2024-03-30 11:07:20 +01:00
sfan5
5df60d85f7 Cache iconv context per-thread 2024-03-30 11:07:02 +01:00
sfan5
008d6be900 Rework iconv encoding detection
WCHAR_T doesn't seem as portable as we thought, so it's just easier
to detect the right encoding using macros at this point.
2024-03-30 11:07:02 +01:00
sfan5
d1a1aed23e Reduce unnecessary include in serialize.h 2024-03-30 11:07:02 +01:00
cx384
673d2499e8 Refactor texturepaths.cpp and SourceImageCache 2024-03-30 11:06:44 +01:00
cx384
6ac053bbaa Extract image generation/cache from texturesource.cpp 2024-03-30 11:06:44 +01:00
sfan5
6c6e48f006
Move values the mainmenu caches to dedicated files (#14433) 2024-03-30 11:06:28 +01:00
Elias Åström
bb6782ca58
Add repeat_dig_time setting (#14295) 2024-03-30 11:05:58 +01:00
sfan5
d307d01b18 Fix tests that rely on UTF-8 literals
and the lowercase function
2024-03-28 16:22:04 +01:00
src-tinkerer
08284e420d
Disable default password check in single player (#14493) 2024-03-27 21:46:41 +00:00
sfan5
d53ef90a73 Remove Irrlicht versioning 2024-03-27 20:55:48 +01:00
rubenwardy
b487341c32
Deprecate writing to mod directories (#14486) 2024-03-27 18:32:05 +00:00
sfan5
6a7a613741 Update the CI run with multiplayer tests 2024-03-26 21:39:02 +01:00
Desour
9cee9bc279 Build with the imported IrrlichtMt at irr
Also remove the now useless options (like IRRLICHT_INCLUDE_DIR)
and update download instructions, CI and similar.

Co-authored-by: sfan5 <sfan5@live.de>
2024-03-26 21:39:02 +01:00
import
f638482fba Copy irrlichtmt to <root>/irr/ 2024-03-26 21:39:02 +01:00
grorp
a7908da968
Replace antipattern translation example in lua_api.md (#14482) 2024-03-24 18:56:41 +01:00
Elias Åström
20bfaba0b7
Update docs to allow non-liquid nodes to use "liquid" drawtype 2024-03-24 18:56:29 +01:00
AFCMS
5a27c05b6a
Docker image workflow (publish on ghcr.io) (#14230) 2024-03-24 18:54:09 +01:00
rubenwardy
24cc33e704
Add button_url[] and hypertext element to allow mods to open web pages (#13825)
Fixes #12500
2024-03-24 17:19:23 +00:00
rubenwardy
6c4a110679
Add world-independent storage directory for mods (#12315)
Fixes #4821
2024-03-24 17:18:58 +00:00
sfan5
b42b03bc40 Restrict lua_api_deploy workflow to main repo 2024-03-24 12:42:50 +01:00
sfan5
5727d74d37 Avoid including client headers on server builds 2024-03-20 16:37:32 +01:00
sfan5
bc4ab8b99e General code refactoring/improvements in server, treegen and connection 2024-03-20 16:37:32 +01:00
sfan5
24f2c38093 Split internal parts from connection.h 2024-03-20 16:37:32 +01:00
sfan5
dfba79f8ff Split servermap.cpp/h off from map.cpp/h 2024-03-20 16:37:32 +01:00
sfan5
0d817ff4ff Try to fix httpfetch method bug
see #14394
2024-03-20 16:37:32 +01:00
sfan5
178943b4b7 Improve ServerEnvironment::getRemovedActiveObjects() in many ways 2024-03-20 16:37:32 +01:00
Desour
751ede516b ProfilerGraph: Increase buffer size for min/max formatting
Fixes values being cut off, e.g. "1.0000e+06" to "1.0000e+0".
2024-03-20 15:28:37 +01:00
HybridDog
cda112493a
Faster blit_with_alpha() (#14448)
* Add test nodes for alpha compositing and the fill texture modifier

Texture test nodes can be helpful to test if `blit_with_alpha` works correctly.

The alpha compositing test node covers different cases where pixel colors are mixed with each other.
The test currently fails because `blitPixel` does not work correctly if a semi-transparent color
is drawn on top of another semi-transparent color.
The test nodes for the fill texture modifier show if the size and position arguments of the modifier work correctly.
They do not cover special cases such as very large or negative position or size values.

* Faster blit_with_alpha()

The `blit_with_alpha` function has a noticeable effect on the time it takes to join a game.

To reduce the join times, I replace the `blit_with_alpha` function with a new one:
* It does not uses floating-point numbers.
* It directly operates on the raw pixel data instead of using the comparatively
  slow `setPixel` and `getPixel` functions from Irrlicht.
  Only ECF_A8R8G8B8 base images are supported now.
  If the top image does not have the ECF_A8R8G8B8 color format, it is converted;
  I assume that this happens rarely.
* There are case distinctions for fully opaque, fully transparent and semi-transparent pixels.
  This empirically increases the performance since the mixing between two semi-transparent happens rarely.
* The new function no longer has the `src_pos` argument since it was always the zero vector.
* The function is only documented once where it is declared.

For backwards compatibility, `blit_with_alpha` still mixes colors without gamma correction.
`blit_with_alpha` nonetheless behaves slightly different than before:
If a semi-transparent pixel is drawn on top of another semi-transparent pixel,
the color is mixed in a way which we can consider to be more correct now.
2024-03-19 19:56:47 +01:00
goodusername123
fa072c1d2c
Update Lua BitOp's stdint.h check for MSVC
based on 3ece3a3e3a
2024-03-19 19:54:57 +01:00
SmallJoker
a862e4290c Script API: Fix invalid rotation of L-system trees
The MapNode struct fields param1 and param2 were previously
not initialized. This commit now sets them to a sane default.
2024-03-17 18:01:48 +01:00
cx384
234b01a8c2
Item meta pointing range (#14347) 2024-03-17 15:55:38 +01:00
sfan5
e3b9828f24 Add unit tests for SAO load / unload behaviour 2024-03-17 15:55:24 +01:00
sfan5
8339594206 Handle static_save changes at runtime and between restarts 2024-03-17 15:55:24 +01:00
sfan5
2386bfda7e Fix static_save=false not working & related cleanups 2024-03-17 15:55:24 +01:00
sfan5
ef0009aea7 Sort out server destruction order
fixes #14421
2024-03-17 15:55:24 +01:00
sfan5
4d24537590 Fix multiplayer test missing crashes at shutdown 2024-03-17 15:55:24 +01:00
Gregor Parzefall
4f84b01356 Touchscreen: Fix virtual joystick sometimes going backwards
This fixes a regression introduced by 34286d77c7 / #14075.
2024-03-17 15:00:37 +01:00
grorp
c8b615acc9
Remove excessive touchscreengui.h includes (#14466) 2024-03-17 14:59:50 +01:00
SmallJoker
61a5733692 Unittest: Add inventory callback tests 2024-03-16 20:14:05 +01:00
SmallJoker
4245a7604b Inventory: Fix order of callbacks when swapping items 2024-03-16 20:14:05 +01:00
sfan5
d5d6e36ae0
Create CACHEDIR.TAG in path_cache (#14458) 2024-03-15 11:24:08 +01:00
sfan5
658bc9fcc8 Fix infinite loop in Server::stopAttachedSounds 2024-03-13 21:24:50 +01:00
cx384
60810c2d37
Add L-system trees as decorations (#14355) 2024-03-12 20:10:28 +01:00
grorp
f07e1026ac
Allow sync HTTP fetches to be interrupted to fix hanging (#14412)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2024-03-12 20:09:43 +01:00
SmallJoker
32f68f35cf
Avoid packets getting sent to disconnected players (#14444)
Many functions expect RemotePlayer to have a valid peer ID,
this however is not the case immediately after disconnecting
where the object is still alive and pending for removal.

ServerEnvironment::getPlayer(const char *, bool) now only
returns players that are connected unless forced to.
2024-03-10 13:24:35 +01:00
SmallJoker
02a893d613 Client: fix failing assert on empty texture name 2024-03-10 10:50:04 +01:00
sfan5
f596c36f4f Update NDK 2024-03-09 11:28:12 +01:00
sfan5
8ff0e1da15 Amend Android dev documentation 2024-03-09 11:28:12 +01:00
sfan5
4660310db6 Update Gradle 2024-03-09 11:28:12 +01:00
sfan5
58bf4f04b1 Skip Android deps download if they already exist
It's close to impossible to test locally built changes otherwise.
2024-03-09 11:28:12 +01:00
sfan5
d88f0866b7 Reduce translations log spam 2024-03-06 22:33:32 +01:00
Lars Müller
bf52d1e624
Fix attached sounds stopping if objects are removed serverside (#14436)
Restores backwards compatibility for death sounds or other sounds that are not supposed to be "cut off" abruptly.

---------

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-03-06 20:36:02 +01:00
y5nw
fc80f65a6d
Try to preserve metatable when exchanging data with the async env (#14369)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-03-06 18:04:49 +01:00
sfan5
badd42789a Move PlayerSettings class to client code 2024-03-06 18:03:57 +01:00
sfan5
c524c52baa Fix some common SAO methods to not generate useless update packets 2024-03-06 18:03:57 +01:00
sfan5
585ca90ae0 Reorder ObjectProperties struct 2024-03-06 18:03:57 +01:00
sfan5
e734b3f0d8 Fix core.get_node_or_nil in emerge env
"ignore" does not mean unloaded, we have to properly check it.
2024-03-03 20:16:32 +01:00
sfan5
91ea47fddf Fix node callbacks unit test 2024-03-03 20:16:32 +01:00
sfan5
9b97147637 Fix assertion failure in clientlauncher.cpp 2024-03-03 19:11:37 +01:00
DS
d4d4712361
Implement get_node with a get_node_raw (#14384)
Add /bench_bulk_get_node
Considerably improves the execution speed of core.get_node
2024-03-03 15:53:23 +01:00
cx384
879f7e9f03 Refactor tile.cpp/h parts except texturesource.cpp 2024-03-03 15:52:05 +01:00
cx384
aaf77025b6 Split up tile.cpp/h 2024-03-03 15:52:05 +01:00
Desour
cdce33dd05 Fix some narrowing warnings 2024-03-02 01:56:25 +01:00
Desour
b10797b3d5 Add missing include in container.h
BUILD_BENCHMAKRS builds were broken.
2024-03-02 01:47:03 +01:00
sfan5
e73e562a63 Allow curl to use all content encodings 2024-03-01 18:22:59 +01:00
grorp
e40417f687
Allow giving "pointabilities" to Lua raycasts (#14390) 2024-03-01 17:12:13 +01:00
Gregor Parzefall
aac616fcc5 Avoid visible camera jumps because of touchscreen_threshold 2024-03-01 17:11:46 +01:00
Gregor Parzefall
fa0745f7da Adjust touchscreen_sensitivity to display density 2024-03-01 17:11:46 +01:00
Gregor Parzefall
00a3e6bbd7 Touchscreen: Allow camera movement while digging without touch_use_crosshair 2024-03-01 17:11:46 +01:00
sfan5
bb7f57b095 VBO-related optimizations and improvements (#14395) 2024-02-29 17:20:57 +01:00
sfan5
d85c842ce9 Refactor fog shader to reuse Irrlicht values 2024-02-29 17:20:50 +01:00
sfan5
dce166dc93 Support deleting shader materials 2024-02-29 17:20:50 +01:00
sfan5
13a0e5fb4a Share FpsControl code between game and menu 2024-02-29 17:20:50 +01:00
sfan5
0c3a4cc7b9 Improve ergonomics of CachedShaderSetting 2024-02-29 17:20:49 +01:00
sfan5
e9ab5bc223 Factor shadow constants out of MainShaderConstantSetter 2024-02-29 17:20:49 +01:00
sfan5
5da18d34ba Properly warn that shader queue is unimplemented 2024-02-29 17:20:49 +01:00
sfan5
09d542dfe0 Drop enable_vbo setting
Consistently applying this setting requires some code work,
because Irrlicht does not provide a global toggle.
At the same time I don't see any reason for someone to disable this.
2024-02-29 17:20:49 +01:00
sfan5
5280863300 Set VBO hints in more places 2024-02-29 17:20:49 +01:00
sfan5
fbec378869 Fix more type promotion mistakes
Someone of these are probably actual bugs and gcc totally doesn't care to warn about them, wtf?
This issue seems to be new with the IrrlichtMt update.
2024-02-26 22:07:40 +01:00
sfan5
9fcd7f2dc0 Fix clang-tidy type promotion errors 2024-02-26 20:47:47 +01:00
sfan5
229389b7f6 Use newer IrrlichtMt 2024-02-26 20:47:47 +01:00
sfan5
5d8a22066c
Change how max_lag is calculated and reported (#14378)
-Change how max_lag is calculated and reported

- Cap singleplayer step at 60Hz

- Clarify dedicated_server_step
2024-02-26 20:46:57 +01:00
sfence
63a9853811
Remove attached sounds when the active object is removed (#14341) 2024-02-25 22:10:39 +00:00
kotek900
39b1311a1b
Add padding to settings tab buttons (#14408) 2024-02-25 22:10:07 +00:00
rubenwardy
f4eba3bfba
Add support for ContentDB package translation (#14410) 2024-02-25 22:09:52 +00:00
sfan5
4caf0e4cb9
Update LTO exclusion list (#14407) 2024-02-25 20:58:42 +01:00
sfan5
762fca538c
Expose SHA256 algorithm to Lua (#14403)
Co-authored-by: chmodsayshello <chmodsayshello@hotmail.com>
2024-02-25 18:12:23 +01:00
SmallJoker
fa1d80b53b
MetaData: restore undocumented set_string behaviour (#14396) 2024-02-25 16:03:05 +01:00
rubenwardy
b4be483d3e
Add support for translating content titles and descriptions (#12208) 2024-02-24 19:13:07 +00:00
grorp
57de599a29
Restore pre-5.9.0-dev behavior of touch_use_crosshair=false shootline (#14389)
* Fix incorrect shootline after releasing pointer if touch_use_crosshair=false

This happened because Android reuses pointer IDs.
Also includes a refactor to merge "m_known_ids" and "m_pointer_pos".

* Restore pre-5.9.0-dev behavior of shootline when !m_has_move_id
2024-02-24 13:12:53 +01:00
sfan5
492aab20fe Fix compiler warnings 2024-02-24 12:39:12 +01:00
ShadowRoi
6952bab519
Mark jpeg-turbo as the default library for compiling in macOS 2024-02-23 21:31:24 +01:00
Muhammad Rifqi Priyo Susanto
87fa4de59c Use forward-slash (/) for path separator in translation files
The lstrip (left trim) call is to make sure that there are no slashes at the beginning of file paths.
2024-02-23 21:30:34 +01:00
lhofhansl
0d4b489545
Detect air-only blocks instead of day/night differences (#14264)
* Detect air-only blocks instead day/night differences

* Write !is_air into the former day-night-diff bit on disk, so that old server can still read maps written by new servers

* Only set is_air bit when reading from disk
2024-02-22 21:47:42 -08:00
numzero
0d30a3071a Add meshgen tests 2024-02-22 15:45:17 +00:00
numzero
753f03ff6a Add mesh comparison functions, for tests 2024-02-22 15:45:17 +00:00
numzero
bf2098c07f Decouple MeshMakeData from Client 2024-02-22 15:45:17 +00:00
numzero
2f35b121a4 Const correctness 2024-02-22 15:45:17 +00:00
David Heidelberg
34286d77c7
Allow toggling touchscreen mode at runtime (#14075)
Signed-off-by: David Heidelberg <david@ixit.cz>
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-02-22 15:44:49 +00:00
sfan5
e3cc26cb7c
Irrlicht support changes (#14383) 2024-02-19 21:14:47 +01:00
Gregor Parzefall
84dd812da4 Fix hud_elem_type warning triggered by builtin minimap
Fixes a deprecation warning introduced by adaa4cc2f3.
2024-02-19 19:04:43 +01:00
Lars Müller
4acbd59162
Support absent scene node names (#14330)
Contains a hack to support IrrlichtMT revision 14 for now (until we release revision 15)
2024-02-18 11:39:16 +01:00
DS
1e316a9704
Don't use a reference for RaycastState::m_pointabilities (#14376) 2024-02-17 18:36:20 +01:00
sfan5
6ca214fefc
Introduce std::string_view into wider use (#14368) 2024-02-17 15:35:33 +01:00
wsor4035
fa47af737f
Upgrade CI actions (#14377) 2024-02-17 15:34:40 +01:00
sfan5
0f2517070e Update Docker image base 2024-02-17 12:40:18 +01:00
sfan5
f483d10c95
Switch to LLVM-based MinGW toolchain (#14329) 2024-02-16 21:36:19 +01:00
sfan5
8c3a6a819e Adjust bug report template 2024-02-16 12:34:40 +01:00
sfan5
933432e62d Annotate Lua packer with more comments 2024-02-16 12:34:40 +01:00
sfan5
2b97fead9e Fix some potential iterator invalidation issues 2024-02-16 12:34:40 +01:00
cx384
9ac6d330b4
Fix minimap textures overwrite (#14349) 2024-02-15 21:52:41 +01:00
DS
4843890c56
Inline g/setPixel in imageCleanTransparent (#14323) 2024-02-15 19:38:23 +01:00
lhofhansl
c81e0b7433
Allow shaders with disabled post processing pipeline (#14338)
- Allow disabling of the post processing pipeline while leaving shaders enabled
- Also disable post processing on Android by default
2024-02-15 08:25:33 -08:00
sfan5
ce97210eb1 Refactor how script api reads current mod name
This is to prevent future mistakes and make it clearer whether
the mod name can be trusted depending on how it is retrieved.
2024-02-15 11:06:21 +01:00
sfan5
cb5fa56e17 Remove insecure environment from async and emerge environment 2024-02-15 11:06:21 +01:00
fuzun
6cbb9193ea
Fix undefined behaviors (#14365)
* Initialize member `floats` in ContentFeatures

* Do not assign big double to u32

* Do not assign negative floating point number to unsigned integer
2024-02-15 11:05:42 +01:00
sfan5
3cac17d23e
Lua on each mapgen thread (#13092) 2024-02-13 22:47:30 +01:00
sfan5
d4b107e2e8 Enable dynamic_add_media to take the file data instead of a path 2024-02-13 22:44:10 +01:00
sfan5
c90ebad46b Allow specifying name for dynamic media files 2024-02-13 22:44:10 +01:00
sfan5
af69d4f7a9 Allow dynamic_add_media at mod load time 2024-02-13 22:44:10 +01:00
kromka-chleba
6c8ae2b72a
Fix liquid falling if in "float" group (#13789)
* Make falling liquid source nodes replace flowing nodes

This makes falling liquid source nodes in group:float replace
flowing nodes on the ground instead of being placed above
the flowing node.

* Make flowing liquids "fall through" for source nodes

This makes liquids in float and falling_node groups fall through
flowing liquid nodes instead of being supported by them in the air.

---------

Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-02-12 23:24:54 +01:00
cx384
7901087466
Rename MINETEST_SUBGAME_PATH to MINETEST_GAME_PATH (#14351) 2024-02-12 23:21:19 +01:00
paradust7
e2ccd14c05
Allow using VBOs for meshes all the way down to 4 vertices (#14366)
This may improve performance substantially if there are many meshes with "few" vertices that would otherwise be retransmitted to the GPU every frame. In testing, this does not seem to decrease performance, even if as few as 4 vertices are used (e.g. particles).
2024-02-12 23:20:48 +01:00
Lars Mueller
a14320fc44 Improve deprecation error messages 2024-02-12 22:58:26 +01:00
David Heidelberg
eb52a149a0
Enable IPO/LTO by default except for debug builds (#14198)
Test case:

```
$ cmake . -DRUN_IN_PLACE=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=TRUE -DENABLE_TOUCH=FALSE

         minetest minetestserver
W/o LTO:      13M           7.3M
W/  LTO:      11M           5.9M
difference:   15%            19%
```

Also fixes various compiler warnings resulting from compilation using LTO.

---------

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-02-09 00:01:12 +01:00
cx384
adaa4cc2f3
Move hard coded minimap to builtin (#14071) 2024-02-07 20:13:23 +01:00
grorp
f2b99332d9
Add Lua API function to resolve node/collision/selection boxes (#13964) 2024-02-06 20:45:16 +01:00
Lars Müller
4859cf44ce
Fix translation updater script: Handle nested modpacks, support games (#14340) 2024-02-05 20:57:30 +01:00
sfence
83f779c52d
Fix active object adding to not generated block (#14311) 2024-02-04 21:24:08 +01:00
sfan5
c9e10e1dd9 Drop valgrind from CI and instead enable ASan
The recently added ioctl use is reported as a false-positive by valgrind.
I tried moving it to different compilers/versions two times and only
hit further issues that were valgrind's fault.

Also includes a tiny fix.
2024-02-04 21:23:05 +01:00
sfan5
4259ac96ea Optimize fs::CopyFileContents on Linux and Windows 2024-02-04 21:23:05 +01:00
sfan5
714c9361ea Add unit tests for fs::CopyFileContents 2024-02-04 21:23:05 +01:00
sfan5
93381014a0 Bypass media transfer in single player 2024-02-04 21:23:05 +01:00
someone-aka-sum1
16aaef097a
Make the protocol dissector heuristic (#14335) 2024-02-04 21:21:23 +01:00
Lars Müller
1d9c9710d7
Fix short raycasts missing large objects (#14339)
Increases the tolerance from one node to five nodes.
Also optimizes the "sphere" used for pre-filtering entities
to start in the middle of the line segment rather than at the start.
2024-02-04 14:04:05 +01:00
SmallJoker
e7dbd325d2
RemotePlayer: make peer ID always reflect the validity of PlayerSAO (#14317)
Upon disconnect, RemotePlayer still had a peer ID assigned even though
the PlayerSAO object was maked as gone (for removal). This commit makes
that the following always holds true:

	(!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)
2024-02-02 22:13:24 +01:00
Zemtzov7
893594d81a
Add help formspec for CSM commands (#13937) 2024-02-02 22:12:59 +01:00
techno-sam
176e674a51
Add wear bar color API (#13328)
---------

Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-02-02 21:21:00 +01:00
sfan5
e10d8080ba
Add flag to control mgv6 temple generation (#14293) 2024-01-30 21:52:04 +01:00
sfan5
9da1354f3a
Fix missing limit check for block y pos (#14320) 2024-01-30 21:51:51 +01:00
sfan5
e1f6108789 Revert class forward declaration in {client,server}opcodes.h
closes #14324
2024-01-30 17:04:12 +01:00
Lars Mueller
40bf88ac74 Performance: Limit blitting work to overlapping area 2024-01-28 13:01:54 +01:00
sfan5
ffec698d3e Change how [combine parameters are checked
the old checks were too strict
2024-01-28 13:01:54 +01:00
Lars Mueller
b1ee137177 Minor documentation fixes 2024-01-28 13:01:54 +01:00
grorp
fbec168e91
Only pause rendering if the Android activity is stopped (#14211) 2024-01-27 14:37:00 +01:00
sfan5
89f3502b56 Move Server ban check to different point 2024-01-27 10:33:32 +01:00
sfan5
5dbc1d4c08 Move some files to src/server/ 2024-01-27 10:33:32 +01:00
sfan5
c0f852e016 Change NetworkPacket to reserve instead of resize
also make the bool serialization clearer and move the constructor
to the header file
2024-01-27 10:33:32 +01:00
sfan5
397682a5b0 Clean up client and server command sending / tables 2024-01-27 10:33:32 +01:00
grorp
2b99dabdac
Touchscreen: Abort ongoing short taps if touch interaction mode changes (#14305) 2024-01-26 23:19:06 +01:00
Bradley Pierce
df9975f35d
Add markdown admonition extension (#14303) 2024-01-26 22:10:57 +01:00
sfan5
4158759265 Move mtevent.h to src/client/ 2024-01-26 22:10:36 +01:00
sfan5
8927e7caf6 Handle some edge cases in tile images 2024-01-26 22:10:36 +01:00
sfan5
a46fe79939 Reduce code duplication in tile.cpp 2024-01-26 22:10:36 +01:00
lhofhansl
2ef080a51b
Slight simplification of RemoteClient::getNextBlocks(...) (#14302) 2024-01-25 11:32:18 -08:00
Sokomine
4468813d47
Show more lines in chat scrollback buffer (#14290) 2024-01-24 19:41:29 +01:00
Lars Mueller
6a2eb4da07 Restore pointability backwards compatibility 2024-01-23 23:30:28 +01:00
sfan5
731b84d725 Reduce some instances of useless data shuffling 2024-01-23 22:34:36 +01:00
sfan5
362e4505e8 Minor improvements to media request / announce code
I had to throw away the code switching sendRequestedMedia to
a bin packing algorithm because it actually performed worse. :(
2024-01-23 22:34:36 +01:00
sfan5
13013d1b8b Fix client loading not aborting correctly in certain cases 2024-01-23 22:34:36 +01:00
sfan5
6df0de565f Check media requests on the server more carefully 2024-01-23 22:34:36 +01:00
sfan5
89eabb5803 Drop speed tests and some other unused code from clientlauncher.cpp 2024-01-23 22:34:36 +01:00
sfan5
6aa4f14a28 Drop some unneeded MOD_REASONs 2024-01-23 22:34:36 +01:00
sfan5
be7844192b Don't save blocks asap for only lighting updates 2024-01-23 22:34:36 +01:00
sfan5
9e3a11534f
Allow fog color to be overriden properly (#14296) 2024-01-23 22:33:33 +01:00
grorp
a29d3cf074
Save the settings in more cases to avoid losing setting changes (especially on Android) (#14266) 2024-01-23 21:33:27 +01:00
Lars Mueller
f6ecd931dc Minor documentation formatting fixes 2024-01-22 22:41:33 +01:00
Lars Mueller
f0180ad488 Fix revoke callbacks being run for false values passed to set_privileges 2024-01-22 22:24:32 +01:00
Lars Müller
afc48cf224
Address set_player_privs footgun (#14297)
---------

Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-01-22 20:06:03 +01:00
cx384
5958714309
Tool specific pointing and blocking pointable type (#13992) 2024-01-22 18:27:08 +01:00
Lars Mueller
fb461d21a5 Fix waypoint precision wraparound, add bounds check 2024-01-21 21:00:09 +01:00
grorp
404a063fdf
Touchscreen: Allow mods to swap the meaning of short and long taps (punch with single tap) (#14087)
This works through a new field "touch_interaction" in item definitions.
The two most important use cases are:
 - Punching players/entities with short tap instead of long tap (enabled by default)
 - Making items usable that require holding the place button (e.g. bows and shields in MC-like games)
2024-01-21 17:44:08 +01:00
sfan5
8cbd629010
Fix bugs in ModifySafeMap (#14276) 2024-01-20 15:37:30 +01:00
DS
e9233bc169
Fix typo in minimap bumpmapping shader (#14280) 2024-01-20 15:36:53 +01:00
Jaidyn Ann
bec080be8d
Add Esperanto builtin translation (#14215) 2024-01-20 15:36:42 +01:00
David Heidelberg
371b9a7fc2
Move check for strlcpy before config.h generation
Fixes: 225aa107f6 ("Define strlcpy only on platforms where it's not available")
2024-01-19 22:48:43 +01:00
sfan5
699d1bf27c Use newer IrrlichtMt
now with SDL2
2024-01-19 11:54:40 +01:00
David Heidelberg
225aa107f6 Define strlcpy only on platforms where it's not available
Linux musl-libc and recent glibc > 2.38 have it.

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-01-19 11:53:08 +01:00
DS
e416c99419
Fix signed overflow UB in PseudoRandom::next() 2024-01-19 11:52:53 +01:00
Lars
7c9706fdcf Remove unused meshgen_block_cache_size setting 2024-01-19 11:52:39 +01:00
HybridDog
f08e4bb27d
Return to the main menu if a shader compilation fails (#14256)
Before this change, if the shaders are broken, only an error message is shown and the player enters the world nonetheless, where he/she sees broken graphics.
2024-01-19 11:51:46 +01:00
savilli
432988a4ad
Fix multiple password changes in one session 2024-01-19 11:50:55 +01:00
Lars Müller
a8cf10b0b5
Docs: Recommend against using PseudoRandom 2024-01-17 21:48:17 +01:00
sfan5
e985b7a0bf Initialize random with better seed 2024-01-17 20:06:26 +01:00
sfan5
6caa06eaed Remove mistaken exec mode from three files 2024-01-17 20:06:26 +01:00
sfan5
02fa33252a Ignore MSVC unit test failures for now
Spending time to investigate and fix all them was not part of my plan.
2024-01-17 20:06:26 +01:00
sfan5
2211f4f8f7 Run unit tests in MSVC CI job 2024-01-17 20:06:26 +01:00
sfan5
5ceb327e55 Replace SHA256 implementation with one from LibreSSL
They have cleaner code than OpenSSL :)

from here: https://github.com/libressl/openbsd/tree/master/src/lib/libcrypto
and https://github.com/libressl/portable
2024-01-17 20:06:26 +01:00
sfan5
b0f76d82c5 Remove references to SHA1 and SHA512 from SRP code 2024-01-17 20:06:26 +01:00
sfan5
2bcebc4e4e Update mini-gmp to 6.3.0 2024-01-17 20:06:26 +01:00
sfan5
cd55a533e8 Update catch2 copy to 2.13.10 2024-01-17 20:06:26 +01:00
sfan5
021eddac73 Update jsoncpp copy to 1.9.5 2024-01-17 20:06:26 +01:00
sfan5
5756d6262e Minor improvements and fixes in httpfetch.cpp 2024-01-17 20:06:11 +01:00
sfan5
56943bef48 Use modern libcurl poll/wait methods 2024-01-17 20:06:11 +01:00
sfan5
ee727eb65e Migrate UDPSocket to use poll() 2024-01-17 20:06:11 +01:00
sfan5
e8008c1b21 Sanitize lang_code and full_version received from client
fixes #14262
2024-01-17 20:05:57 +01:00
sfan5
bdc124ba41 Require client to consistently use peer ID 2024-01-17 20:05:57 +01:00
sfan5
f27f701251 Make server disconnect lingering clients 2024-01-17 20:05:57 +01:00
sfan5
b2f0a37b18 Rate-limit client connection attempts 2024-01-17 20:05:57 +01:00
sfan5
050152eb90 Do not allocate packet quota to half-open connections 2024-01-17 20:05:57 +01:00
sfan5
3987318f09 Time out when reliables can't be delivered
If one of the channels stalls for whatever reason we can't pretend the connection is fine.
2024-01-17 20:05:57 +01:00
sfan5
9f684eac92 Remove weird command procession limit
it was set to 1 too, wtf?!
2024-01-17 20:05:57 +01:00
sfan5
abf3142b26 Send initial dummy packet as empty
No functional change and no compatibility implicatons
but this better matches what is documented everywhere.
2024-01-17 20:05:57 +01:00
sfan5
eeb873b23c Minor code corrections 2024-01-17 20:05:57 +01:00
sfan5
84d4647329 Scale resend timeout exponentially 2024-01-17 20:05:57 +01:00
sfan5
7acb14f7a1 Use fixed, lower timeout for half-open connections 2024-01-17 20:05:57 +01:00
sfan5
2587302987 Assign peer IDs randomly 2024-01-17 20:05:57 +01:00
sfan5
db88d24ff8 Track connection half-open state 2024-01-17 20:05:57 +01:00
cx384
2ea8d9ca11
Fix out of range enum casts in deSerialize functions (#14090) 2024-01-17 20:05:46 +01:00
sfan5
0383c44f0d
Custom data structure for active objects to get performance *and* safety (#13880) 2024-01-17 20:04:56 +01:00
Wuzzy
08ee6d8d4b
Add rotation support for wallmounted nodes in 'ceiling' or 'floor' mode (#11073) 2024-01-17 17:47:06 +01:00
Jude Melton-Houghton
e7dd9737bd Reduce minetest.after time complexity and provide ordering guarantee
---------

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-01-16 23:46:43 +01:00
sfence
ceaa7e2fb0
Add API for restoring PseudoRandom and PcgRandom state (#14123) 2024-01-16 23:20:52 +01:00
Vitaliy
8093044f07
Support OpenGL 3 (#13321) 2024-01-16 21:09:18 +01:00
AFCMS
9cca12ff0b
Fix language setting description in settingtypes.txt (#14048)
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-01-15 19:27:24 +01:00
sfan5
1b0d2a37bb Set low active_block_range in test_multiplayer.sh 2024-01-15 11:44:26 +01:00
cx384
92c55c27cf
Add function to get all HUD elements (#14042) 2024-01-14 17:46:29 +01:00
SmallJoker
ed7d4037b2 Client: fix possible division by zero in [crack modifier 2024-01-14 16:28:03 +01:00
sfan5
dd094d7606 Write down some developer documentation
I think it's better suited here than in the wiki.
2024-01-14 13:17:53 +01:00
sfan5
1ba26d67bd Remove excessive includes from porting.h 2024-01-14 13:17:53 +01:00
sfan5
e824e9023f Simplify LuaPseudoRandom::l_next and fix docs
Also extends the allowed range on the C++ side. This has no side-effects.
2024-01-14 13:17:53 +01:00
sfan5
d20f1182f2 Fix Lua PseudoRandom seeds being mangled
closes #14237
2024-01-14 13:17:53 +01:00
sfan5
e83530d40b Use explicit types on PseudoRandom implementation 2024-01-14 13:17:53 +01:00
sfan5
6f494a968d Move setenv compat code to porting.h 2024-01-14 13:17:53 +01:00
sfan5
133f706bf3 Make unittests less reliant on files in the source distribution 2024-01-14 13:17:53 +01:00
sfan5
863c9b55b4 Remove broken MINETEST_SUBGAME_PATH test
The path being tested for is in the default search path for games,
so it would still pass if the env var was not working.
2024-01-14 13:17:53 +01:00
sfan5
45561b89a4 Make sure unittests don't try to write to cwd 2024-01-14 13:17:53 +01:00
grorp
6b9250e4ef
Document settings API behavior regarding default values (#14247) 2024-01-13 20:01:50 +01:00
Muhammad Rifqi Priyo Susanto
5089e8342f
Android: Use the correct value for notification (#14209)
The notification channel creation is moved into MainActivity.
The notification channel ID string is stored into a static variable.
The name and description of the notification channel are stored into the strings resource file.

Co-authored-by: sfan5 <sfan5@live.de>
2024-01-13 20:01:35 +01:00
grorp
b12be0498e
Don't enable relative mouse mode if in touchscreen mode (#14118) 2024-01-13 20:01:10 +01:00
lhofhansl
59abf1bb42
Allow active blocks to be generated (#14185) 2024-01-13 10:27:41 -08:00
lhofhansl
518ecd7f4e
Slight optimizations in ClientMap (#14251) 2024-01-12 16:53:08 -08:00
Lars Mueller
025516a005 Remove redundant and/or outdated client API docs 2024-01-12 16:24:15 +01:00
HybridDog
345e93d19c Code style: Use non-static member initialisation instead of member initialiser lists for shader uniform names
Before this change,
the member type and member name are at one place,
and the member name and uniform name are at another place.
If the uniform name is written directly at the member declaration,
the member type, member name and uniform name are all at one place,
which leads to shorter code and may be easier to read.
2024-01-11 20:04:42 +01:00
rubenwardy
d98ea7fdb6 Remove GitLab CI and redirect GitLab pages to api.minetest.net 2024-01-10 20:52:08 +00:00
SmallJoker
a7eaee77ca
ContentCAO: Fix threshold of alpha channel textures (#14213)
With disabled shaders, the material EMT_TRANSPARENT_ALPHA_CHANNEL uses the
parameter as an alpha threshold to decide whether to draw the texture.
Thus lowering this limit fixes the issue of vanishing textures below alpha 128.
2024-01-10 19:34:52 +01:00
Muhammad Rifqi Priyo Susanto
0d41996562 MSVC: Fix locale workaround code 2024-01-10 19:33:04 +01:00
Lars Müller
7bae8ab838
Fix HUD image (waypoint) docs 2024-01-10 19:32:49 +01:00
lhofhansl
4bf95703a0
Allow access into MapSector::m_blocks (#14232)
* New API to allow access into MapSector::m_blocks
* Use this API on ClientMap::touchMapBlocks(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow() to speed them up
2024-01-10 09:17:26 -08:00
cx384
2766c70ad3
Fix dividing by zero crashes in texture modifiers 2024-01-07 21:49:26 +01:00
sfan5
2c390b5473 Rework client connecting and enable fallback address use 2024-01-07 21:49:05 +01:00
sfan5
20692d54de Some minor cleanups for UDPSocket class 2024-01-07 21:49:05 +01:00
sfan5
dc7fb26921 Extend capabilities of Address class 2024-01-07 21:49:05 +01:00
Muhammad Rifqi Priyo Susanto
171f911237
Android: Add selection dialog (drop down/combo box) (#13814)
- The handling of IGUIComboBox uses the new setAndSendSelected() method.
- getDialogState() is now getInputDialogState() and returns the state of the input dialog.
- getLastDialogType() is added and returns current/last shown dialog's type.
- getInputDialogState() now returns an enum instead of int.
- getAndroidUIInput() now returns void instead of bool.
- New data types (enum) are added:
  (1) GameActivity.DialogType (Java) and porting::AndroidDialogType (C++)
  (2) GameActivity.DialogState (Java) and porting::AndroidDialogState (C++)
- When showing a text input dialog, there is no custom accept button text any more.
- showDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- showInputDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- getDialogValue()/getInputDialogValue() is now getDialogMessage()/getInputDialogMessage().


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2024-01-07 19:00:04 +07:00
lhofhansl
bd42cc2c77
Ensure deterministic client occlusion culling and minor improvements (#14212)
* Ensure deterministic client occlusion culling
* Increase culling optimize distance slightly
* More accurate culling when sampling
2024-01-06 18:43:46 -08:00
sfan5
8db4ba9e58 Fix some console window behavior on Windows 2024-01-06 15:38:09 +01:00
sfan5
7c7ae79f9f Fix native thread handle usage on win32 2024-01-06 15:38:09 +01:00
sfan5
8674dc831d Avoid unused argument spam with MinGW-clang 2024-01-06 15:38:09 +01:00
sfan5
3fbe42c3a2 Add unittest to check thread_local destructor brokenness 2024-01-06 15:38:09 +01:00
sfan5
6550bc252f Fix logic in porting::attachOrCreateConsole()
No functional change but now the comment is actually correct.
2024-01-06 15:38:09 +01:00
Artem
e04f618979
Add "--needed" to Arch command to avoid reinstalling packages 2024-01-06 15:35:51 +01:00
Zughy
c2c8d4d410
Remove controls listed in the pause menu (no touchscreen) (#13282) 2024-01-05 20:10:07 +00:00
sfan5
15f73258fd
Don't run CDB update_detector more than once (#14214) 2024-01-05 00:40:11 +01:00
Maintainer_
34ce86a8f5
Fix GameUI text staying visible during shutdown. (#14197) 2024-01-05 00:39:56 +01:00
grorp
05a53cd330
Touchscreen: Recognize double-taps as double-clicks (#14187) 2024-01-05 00:39:40 +01:00
Muhammad Rifqi Priyo Susanto
e17455cb22
Remove server's address and port from pause menu (#14082) 2024-01-05 00:39:11 +01:00
grorp
995c192874
Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (#14206) 2024-01-03 21:58:58 +01:00
DS
c9cd0d20ef
Use AL_SOFT_direct_channels_remix extension for non-positional stereo sounds (#14195) 2024-01-03 21:57:00 +01:00
DS
3eab5e9002
Replace clientmap's MeshBufListList with a hashmap 2024-01-03 21:56:38 +01:00
fluxionary
a22b1700a4
Legible Lua profiler (#14142) 2024-01-03 21:56:07 +01:00
ROllerozxa
8e9d7611ae Apply saturation even if tonemapping is disabled 2024-01-03 21:55:53 +01:00
ROllerozxa
de4cc5c20a Fix tonemapping effect 2024-01-03 21:55:53 +01:00
sfan5
0b423dd061 Remove reference to defunct gitlab docker image
see #14164
2024-01-03 17:02:51 +01:00
Lars Müller
2c44620e5e
Comply with base64 license terms (#14199) 2024-01-01 22:49:12 +01:00
sfence
d0753dddb1
Method add_pos for object/player (#14126) 2024-01-01 22:48:56 +01:00
Alfred Wingate
c9ab61aa8c Add missing header for gcc-14
https://gcc.gnu.org/gcc-14/porting_to.html

Signed-off-by: Alfred Wingate <parona@protonmail.com>
2023-12-31 19:26:33 +01:00
sfan5
431444ba9f Extend sanity checks in ActiveBlockList::update
also fixes the space indentation
2023-12-30 00:31:03 +01:00
lhofhansl
c99196d363
Do not emerge blocks in the active_object_send_range_blocks range (#14152)
The active object range is about active objects (not blocks). Activate blocks (and hence any object "in" them) in the cone define by the active object range (and fov) when they are loaded (i.e. visible), otherwise ignore them.
2023-12-29 14:18:06 -08:00
lhofhansl
22a1653702
Perform server occlusion check before a block is loaded or generated (#14148) 2023-12-29 21:53:27 +01:00
sfan5
edd947b645 Enable some runtime hardening on win32 2023-12-29 21:52:08 +01:00
sfan5
b8dc349099 Clean up gettext initialization 2023-12-29 21:52:08 +01:00
sfan5
93c2aff2cf Clean up OS-specific initialization 2023-12-29 21:52:08 +01:00
Desour
ad5e9aa5e3 Fix AsyncRunStep() skipping steps when dtime < 1 ms 2023-12-29 21:51:19 +01:00
cx384
467d3a8c62
Rename hud_elem_type to type (#14065) 2023-12-29 21:51:02 +01:00
lhofhansl
bc336480e6
Avoid short overflow with large viewing ranges (#14175) 2023-12-28 09:10:11 -08:00
grorp
32e492837c
Support both mouse and touch input in GUIs in a single binary (#14146) 2023-12-27 22:37:36 +01:00
superfloh247
4f1dbb127a
Update CMakeLists.txt to fix MacOS build (#14160)
Co-authored-by: sfan5 <sfan5@live.de>
2023-12-27 22:19:56 +01:00
sfan5
93dfa8a6d8
Optimize and improve built-in PNG writer (#14020) 2023-12-27 11:56:48 +01:00
Simon Boehm
5054918efc
MacOS: Add codesigning instructions to docs (#14060) 2023-12-27 11:44:54 +01:00
Gregor Parzefall
335af393f0 Make the loading screen progress bar respect "gui_scaling" 2023-12-26 20:21:15 +01:00
Gregor Parzefall
524721ee27 Remove non-existent textures from texture_packs.md
These textures were removed 5 years ago by 326eeca306.
2023-12-26 12:01:46 +01:00
sfan5
5405a558fd Fix minor issue with log_deprecated() 2023-12-25 19:47:34 +01:00
sfan5
094c433e58 Update clang-tidy workflow 2023-12-25 10:07:28 +01:00
sfan5
961652c2e9 Address some clang-tidy warnings 2023-12-25 10:07:28 +01:00
Desour
322c4a5b2b Rework server stepping and dtime calculation 2023-12-25 10:07:03 +01:00
Desour
b6c7c5a7ab Link with -latomic 2023-12-25 10:07:03 +01:00
grorp
46c930cf70
Touchscreen: Make server-sent overrides of button textures work (#14145) 2023-12-23 14:39:42 +01:00
Lars
e0d4a9d575 Make volumetric light effect strength server controllable
- Make volumetric light effect strength server controllable
- Separate volumetric and bloom shader pipeline
- Require bloom to be enable, scale godrays with bloom
2023-12-21 16:21:01 -08:00
x2048
04f0d545da Initial implementation of 'Godrays' 2023-12-21 16:21:01 -08:00
Lars Müller
cad8e895f2
Fix set_bone_position regression (error on passing none) 2023-12-21 18:55:12 +01:00
sfan5
cb38b841af Split windows from linux CI workflows 2023-12-21 18:54:57 +01:00
Lars Mueller
d58cc7fb7a Fix on_(grant|revoke) not being run by mods 2023-12-21 18:54:50 +01:00
Warr1024
7e143cb33d
Manually configurable minimum protocol version (#14054)
Partially address #13483.  Server operators can set a minimum
protocol version to match the game requirements (or any other
restriction they may want), and it's applied as an additional
constraint on top of the baseline compatibility range, optional
strict_protocol_version_checking, and any kick-on-join used by
the game/mods.
2023-12-21 18:53:30 +01:00
Gregor Parzefall
04dc4a10f0 Fix TouchScreenGUI ignoring server-sent pitch changes 2023-12-20 21:24:10 +01:00
sfan5
47e557b96a Enable segment heap on Windows 2023-12-20 21:23:08 +01:00
Gregor Parzefall
3b346fd3c9 Fix touch input on Linux
The code relied on touch IDs being consecutive. This is true on Android, but not on Linux.
Therefore, touch input on Linux was broken since 53886dcdb5.
2023-12-20 21:22:15 +01:00
Lars Müller
0d61598d8a
Extend bone override capabilities (#12388) 2023-12-20 21:21:53 +01:00
sfan5
61d0f613df
Hand roll UTF-16 conversion in CGUITTFont (#14121) 2023-12-19 20:18:43 +01:00
grorp
00d9d96e48
Android: Pause rendering while the app is paused (#14058) 2023-12-19 20:18:28 +01:00
HybridDog
b1aec1b5c8
Add dithering (#9014) 2023-12-19 20:18:11 +01:00
sfan5
5d3e830176 MinGW toolchain refresh 2023-12-17 20:47:26 +01:00
grorp
91ba02449b
Add touch_controls boolean to get_player_window_information() (#14092) 2023-12-17 20:47:07 +01:00
JosiahWI
7162b536eb
Extract Game::drawScene from Game::updateFrame 2023-12-17 20:44:45 +01:00
lhofhansl
ca1a723890
Allow cheaper culling checks at a distance (#14073)
* Allow cheaper culling checks at a distance
* Pick a random ray, so that far missing block will eventually be shown
2023-12-16 15:04:21 -08:00
superfloh247
16c22477c2
Update porting.h to fix build errors on macOS 14 / Xcode 15 2023-12-16 12:52:07 +01:00
sfan5
128ed87dd8 Reorder members of MapBlock for performance
Before and after as obtained via `pahole -C MapBlock bin/minetest`:
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 4, sum holes: 7 */
vs.
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 2, sum holes: 7 */

There is not much to be gained by packing but I made sure
to move the most important data (mainly for the client) into
the first cache line.
2023-12-16 12:51:42 +01:00
sfan5
9408a1a025 Reduce size of some MapBlock members
Also adds assertions to catch refcounting errors (on a debug build).
2023-12-16 12:51:42 +01:00
sfan5
777dca7043 Elide MapBlock::contents_cached 2023-12-16 12:51:42 +01:00
sfan5
f5b35a074f Get rid of parent pointer in MapBlock 2023-12-16 12:51:42 +01:00
sfan5
c6cf90f67b Change MapBlock content cache to a vector 2023-12-16 12:51:42 +01:00
sfan5
cb6e3ac6e1 Allocate data seperately from MapBlock class again
This effectively reverts commit b3503e7853.
2023-12-16 12:51:42 +01:00
sfan5
2c2bc4a427 Try to benchmark common MapBlock usage 2023-12-16 12:51:42 +01:00
sfan5
e5a6048eec Allow running individual benchmarks
mirrors and reuses the option from 2f6a9d12f1
2023-12-16 12:51:42 +01:00
Gregor Parzefall
3c60d359ed Remove usage of removed "PP" macro
This fixes a compilation error introduced by e7be135.
2023-12-15 10:28:07 +01:00
SmallJoker
94a54375e2
Inventory: prevent item loss when stacking oversized ItemStacks (#14072) 2023-12-15 10:24:04 +01:00
sfan5
c871b6dd4e Hash-check buildbot dependencies 2023-12-15 10:23:52 +01:00
sfan5
62c6667b0b Get rid of VERSION_EXTRA for buildbot
This is probably a leftover of when CMake didn't automatically
detect the revision from git.
2023-12-15 10:23:52 +01:00
sfan5
704b5d88b9 Upload artifacts in MinGW CI 2023-12-15 10:23:52 +01:00
sfan5
a292cc42aa Fix Windows architecture reporting in sysinfo 2023-12-15 10:23:52 +01:00
Gary Miguel
da832a295e
Delete clang-format files and comments (#14079) 2023-12-15 10:23:44 +01:00
Vitaliy
64b59184d1
Reduce test framework macrosity 2023-12-15 10:23:32 +01:00
sfan5
bd06466d3a Improve clock_gettime usage
- correctly use value of _POSIX_MONOTONIC_CLOCK
- drop special path for macOS: it supports clock_gettime since macOS 10.12
2023-12-15 10:23:19 +01:00
sfan5
d4123a387c Clean up porting.h a bit 2023-12-15 10:23:19 +01:00
mazes-80
e7be135b78
Warning: inform about entity name when bug detected about attachement (#13354) 2023-12-15 10:22:58 +01:00
sfan5
d1a55e9ca4
Remove use_texture_alpha compatibility code for nodeboxes & meshes (#13929) 2023-12-13 13:15:59 +01:00
Gary Miguel
6eb9269741
Try to fix safeWriteToFile producing empty files on Windows (#14085)
Use win32 APIs to write the temporary file before copying to the final
destination. Because we've observed the final file being empty, we
suspect that std::ostream::flush is not flushing.

Also add a test for it.
2023-12-13 13:15:37 +01:00
lhofhansl
a98200bb4c
Avoid movement jitter (#13093)
This allows the client and server to agree on the position of objects and attached players even when there is lag.
2023-12-10 19:12:37 +01:00
Muhammad Rifqi Priyo Susanto
55fafb7d25
Add sound volume when unfocused setting (#14083)
This adds a new setting to set sound volume multiplier when Minetest window is unfocused/inactive (sound_volume_unfocused, located in Settings > Graphics and Audio > Audio > Volume when unfocused).

If the window is not focused, the sound volume will be multiplied by sound_volume_unfocused setting. The sound volume will be set back to sound_volume again when the window is focused.
2023-12-10 19:11:39 +01:00
SmallJoker
321bcf5c44
GUIFormspecMenu: Fix race condition between quit event and cleanup in Game (#14010)
To not instantly free GUIFormSpec upon close/quit, Game periodically
cleans up the remaining instance on the next frame.

When a new formspec is received and processed after closing the previous formspec
but before the cleanup in Game, the formspec would be closed regardless.
This now re-creates the formspec when the old one is already pending for removal.
2023-12-10 19:09:51 +01:00
grorp
689aaf50b3
Fix unittest failure for release versions (#14067) 2023-12-08 21:13:33 +01:00
ZenonSeth
2ec3325381
Check if liquid can flow into empty node before picking it as source (#14057) 2023-12-08 21:13:18 +01:00
Gary Miguel
634e49b961
Improve Irrlicht instructions (#14055)
Specify the version when cloning.
Move instructions from CMakeLists to docs/compiling/.
2023-12-08 21:11:54 +01:00
rubenwardy
55f40a7f8d Continue with 5.9.0-dev 2023-12-04 17:15:43 +00:00
rubenwardy
49ce5a2de6 Bump version to 5.8.0 2023-12-04 17:15:36 +00:00
updatepo.sh
30769589bf Remove junk translation file 2023-12-03 19:11:32 +01:00
updatepo.sh
6cf9b7472a Run mod_translation_updater.py 2023-12-03 19:03:45 +01:00
updatepo.sh
4be8b77598 Run updatepo.sh 2023-12-03 18:48:54 +01:00
updatepo.sh
bae9f65411 Update from builtin/settingtypes.txt 2023-12-03 18:47:50 +01:00
Krock
0a20d30f83 Various little translation fixups 2023-12-03 18:41:15 +01:00
Nisa Syazwani
7245bcc614 Translated using Weblate (Malay)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
chocomint
51136780d6 Translated using Weblate (Spanish)
Currently translated at 89.6% (1174 of 1310 strings)
2023-12-03 18:41:15 +01:00
gallegonovato
ea6eb0dfc8 Translated using Weblate (Spanish)
Currently translated at 89.6% (1174 of 1310 strings)
2023-12-03 18:41:15 +01:00
nyommer
ab88fc6835 Translated using Weblate (Hungarian)
Currently translated at 96.7% (1268 of 1310 strings)
2023-12-03 18:41:15 +01:00
AlexTECPlayz
30b28280eb Translated using Weblate (Romanian)
Currently translated at 49.3% (647 of 1310 strings)
2023-12-03 18:41:15 +01:00
BreadW
e5672111d2 Translated using Weblate (Japanese)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
Spurnita
ce0aca49c2 Translated using Weblate (Catalan)
Currently translated at 22.5% (296 of 1310 strings)
2023-12-03 18:41:15 +01:00
Muhammad Rifqi Priyo Susanto
0d3b71564f Translated using Weblate (Javanese)
Currently translated at 12.9% (170 of 1310 strings)
2023-12-03 18:41:15 +01:00
Ritwik
0a51fde971 Translated using Weblate (Hindi)
Currently translated at 29.8% (391 of 1310 strings)
2023-12-03 18:41:15 +01:00
milewood
a13a165e9b Translated using Weblate (Chinese (Simplified))
Currently translated at 84.0% (1101 of 1310 strings)
2023-12-03 18:41:15 +01:00
Wuzzy
8a7d3d07de Translated using Weblate (German)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
Giov4
0977728ea0 Translated using Weblate (Italian)
Currently translated at 93.7% (1228 of 1310 strings)
2023-12-03 18:41:15 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
92eb63c867 Translated using Weblate (Malay + Jawi) 2023-12-03 18:41:07 +01:00
YearOfFuture
0c4a15fa16 Translated using Weblate (Ukrainian)
Currently translated at 75.4% (989 of 1310 strings)
2023-12-03 18:39:34 +01:00
Nanashi Mumei
01ac9e15ef Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
Muhammad Rifqi Priyo Susanto
dd3fc83777 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
waxtatect
6a5e480a58 Translated using Weblate (French)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
Lars Müller
419d971891
Translated using Weblate (German)
Currently translated at 99.0% (1297 of 1310 strings)
2023-12-03 18:17:42 +01:00
sfan5
9e62cb5c04
Translated using Weblate (German)
Currently translated at 99.0% (1297 of 1310 strings)
2023-12-03 18:17:42 +01:00
Desour
bf53e7e1ca Fix anticheat false positives whith speed physics override 2023-12-03 12:23:17 +01:00
AFCMS
91134015e7
Document minetest.get_gametime() returning nil at init time (#14047)
Co-authored-by: sfan5 <sfan5@live.de>
2023-12-03 15:00:29 +07:00
Muhammad Rifqi Priyo Susanto
047520d91e
Inventory: Add remaining items into the source slot directly (#14021)
Remaining items are added into the source slot directly when left-dragging over the source slot.
2023-12-03 15:00:07 +07:00
DS
6106e4e72b
Fix sound and particlespawner id generation (#14059)
* Fix server sound ids being reused to early

* Fix particlespawner id generation

It always returned 0.
Also, now the ids always grow, to make a conflict with ids in lua unlikely.
2023-12-01 00:09:53 +01:00
SmallJoker
a7e5456099
Server: avoid re-use of recent ParticleSpawner and Sound IDs (#14045)
This improves the reliability when removing and re-adding handles quickly.
Looping through the entire ID range avoids collisions caused by any race condition.
2023-11-29 21:10:19 +01:00
sfan5
d6a8b546e4 Enable clean transparent filter in more cases
It was determined that this fixes scaling artifacts that can happen with bilinear,
trilinear or anisotropic filtering alone.
Since the previous commit did not bring back the relevant setting, we fix this
shortcoming by just enabling it in all cases where it is known to help.
2023-11-29 21:09:21 +01:00
sfan5
7f9326805c Return texture filter settings to previous state
This partially reverts commit 72ef90885d.

fixes #14007
2023-11-29 21:09:21 +01:00
sfan5
36f4953502
Update credits for 5.8.0 release (#14017) 2023-11-28 23:11:29 +01:00
grorp
dc6452db1b
Don't copy user texture packs into Android bundle (#14053) 2023-11-28 21:02:56 +01:00
grorp
cfe1953c2d
Take aliases into account for automatic package installation (#14052) 2023-11-28 21:02:41 +01:00
Wuzzy
dfe00f88e1
Fix missing word in German builtin translation (#14051) 2023-11-28 21:02:19 +01:00
Muhammad Rifqi Priyo Susanto
53886dcdb5
Formspec: Pass the second-touch event as is (#13872)
The second-touch event is passed to the GUIFormSpecMenu::OnEvent() function as a touch event.
There are two types of event for inventory formspec: (1) mouse event and (2) touch event.
The touch event is just a modifier of the mouse event.


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-11-28 07:00:07 +07:00
grorp
771da80bbb
Make it possible again to see item tooltips on Android (#14029)
This change is a quick fix so that item tooltips show again on Android.
2023-11-25 17:07:07 +01:00
Zughy
0f3ac7c956
Update Italian builtin translation (#13997) 2023-11-25 17:05:07 +01:00
Muhammad Rifqi Priyo Susanto
71490a417e
Update Indonesian translation of builtin (#13996)
U+0020 (Space) is changed to U+00A0 (No-Break Space) to match the original string.
2023-11-25 17:04:44 +01:00
grorp
4255ac3022
Mainmenu: Avoid the header being displayed behind the formspec (#13924)
This change keeps the current header placement code, but adds additional code to make sure the header doesn't end up behind the formspec.
2023-11-25 17:04:33 +01:00
ZenonSeth
6783734612
Wireshark dissector: Made sure var 'pos' was only assigned locally to function (#14027) 2023-11-23 18:26:00 +01:00
Wuzzy
61db32beee
Fix mod translation updater bugs (#13974) 2023-11-19 20:46:52 +01:00
MisterE123
31ee7af3ab
lua_api.md: Add tick marks to position HUD element 2023-11-19 20:46:40 +01:00
jordan4ibanez
72edfe3d04
Fix openSUSE build dependencies
They were incomplete.
2023-11-19 20:46:03 +01:00
Desour
7199ee4ff8 Devtest: Fix testnodes bouncy color calculation
Values were out of range.
2023-11-19 20:45:18 +01:00
Desour
585e6aa80b Clamp values in read_ARGB8 2023-11-19 20:45:18 +01:00
Desour
1bc74b0ba1 Fix undefined inf to s32 cast in GUIScrollBar::setPos 2023-11-19 20:45:18 +01:00
Desour
73e85b2ebb Fix cached wanted_range and camera_fov being written with out-of-range value 2023-11-19 20:45:18 +01:00
sfan5
0e4de28988 Try to fix VS build failures 2023-11-19 16:22:20 +01:00
Muhammad Rifqi Priyo Susanto
aa912e90a7
Make text containers wider in the Volume Change dialog (#13995)
These containers are widened to account for translations.
2023-11-15 07:00:03 +07:00
DS
8cf76e004f
Add new flags to minetest.features for 5.8.0 features (#13978) 2023-11-12 20:08:57 +01:00
superfloh247
7cb20dd6c2
Fix undefined behaviour in modulo360f (#13976)
Resolves a crash on macOS/arm64 by no longer depending on UB.
2023-11-12 20:08:33 +01:00
updatepo.sh
2bc0d76f63 Update translation files 2023-11-11 12:11:09 +01:00
updatepo.sh
8abb5796ed Update example conf and settings translations 2023-11-11 12:09:35 +01:00
YearOfFuture
7a658c1a6a Translated using Weblate (Ukrainian)
Currently translated at 76.3% (1023 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
1b0a34b9d1 Translated using Weblate (Ukrainian)
Currently translated at 72.4% (971 of 1340 strings)
2023-11-11 12:06:10 +01:00
YearOfFuture
8b5fc7f23a Translated using Weblate (Ukrainian)
Currently translated at 72.4% (971 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
ee35d7df58 Translated using Weblate (Ukrainian)
Currently translated at 69.8% (936 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
8d1f1b4704 Translated using Weblate (Ukrainian)
Currently translated at 67.3% (902 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
50f48ce9df Translated using Weblate (Ukrainian)
Currently translated at 67.2% (901 of 1340 strings)
2023-11-11 12:06:10 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
e14f905299 Translated using Weblate (Malay (Jawi))
Currently translated at 53.9% (723 of 1340 strings)
2023-11-11 12:06:10 +01:00
Nanashi Mumei
6980f516d4 Translated using Weblate (Russian)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
52e66b6dfe Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
645e4abf52 Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
b0932ef458 Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
Muhammad Rifqi Priyo Susanto
330aee974e Translated using Weblate (Javanese)
Currently translated at 0.0% (0 of 1340 strings)
2023-11-11 12:06:10 +01:00
Timur Seber
a1d7c25587 Translated using Weblate (Tatar)
Currently translated at 7.6% (103 of 1340 strings)
2023-11-11 12:06:10 +01:00
109247019824
6c4352eaf9 Translated using Weblate (Bulgarian)
Currently translated at 32.5% (436 of 1340 strings)
2023-11-11 12:06:10 +01:00
Spurnita
2f279d2403 Translated using Weblate (Catalan)
Currently translated at 18.6% (250 of 1340 strings)
2023-11-11 12:06:10 +01:00
chocomint
842b2bbd36 Translated using Weblate (Spanish)
Currently translated at 90.8% (1218 of 1340 strings)
2023-11-11 12:06:10 +01:00
BreadW
d056bb3ee7 Translated using Weblate (Japanese)
Currently translated at 94.4% (1265 of 1340 strings)
2023-11-11 12:06:10 +01:00
waxtatect
adf9a3953b Translated using Weblate (French)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
Ярослав Рукавицын
c7dd8c18ed Translated using Weblate (Russian)
Currently translated at 94.1% (1262 of 1340 strings)
2023-11-11 12:06:10 +01:00
Lemente
d8c8bf1897 Translated using Weblate (French)
Currently translated at 96.9% (1299 of 1340 strings)
2023-11-11 12:06:10 +01:00
waxtatect
b0c92e885e Translated using Weblate (French)
Currently translated at 96.9% (1299 of 1340 strings)
2023-11-11 12:06:10 +01:00
ROllerozxa
80ae408eb9 Translated using Weblate (Swedish)
Currently translated at 65.5% (879 of 1340 strings)
2023-11-11 12:06:10 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
9720eb50b3 Translated using Weblate (Malay)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
Bas Huis
1efa3a165e Translated using Weblate (Dutch)
Currently translated at 83.9% (1125 of 1340 strings)
2023-11-11 12:06:10 +01:00
ROllerozxa
b730c0aa9a Translated using Weblate (Norwegian Bokmål)
Currently translated at 52.4% (703 of 1340 strings)
2023-11-11 12:06:10 +01:00
Muhammad Rifqi Priyo Susanto
bc26bdc2bf Translated using Weblate (Indonesian)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:09 +01:00
Translator
3187aca3c9 Translated using Weblate (French)
Currently translated at 94.4% (1265 of 1340 strings)
2023-11-11 12:06:09 +01:00
Janar Leas
c4b7876a1a Translated using Weblate (Estonian)
Currently translated at 44.7% (600 of 1340 strings)
2023-11-11 12:06:09 +01:00
Wuzzy
904dbe730d Translated using Weblate (German)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:09 +01:00
Gregor Parzefall
8bf2031310 Get rid of hidden settings in settings_translation_file.cpp 2023-11-11 11:59:38 +01:00
Wuzzy
af474d10a4
Fix bad translation function names in builtin (#13977) 2023-11-10 07:00:17 +07:00
MisterE123
fe8d04d0b3
Fix misrendered fall_damage_add_percent calculation formula (#13969)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-11-09 19:55:26 +01:00
Gregor Parzefall
394450758e
Fix auto_install_spec being used as a table (#13970)
(It's a string since #13906.)
2023-11-09 19:54:47 +01:00
JosiahWI
56902745c8
Extract updateClouds method from updateFrame (#13939)
Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-11-08 07:00:59 +07:00
corpserot
9e952603b2
Lump MT_LOGCOLOR env together with other color env (#13887) 2023-11-08 07:00:36 +07:00
Thresher
80c4c260ae
Refactor and move world_format.txt to world_format.md (#13504)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-11-08 07:00:04 +07:00
ROllerozxa
570fc90bf6
Debundle Minetest Game (#13818) 2023-11-07 22:18:26 +01:00
Muhammad Rifqi Priyo Susanto
7213ff7a00
Resolves some warnings for Android version (#13862) 2023-11-05 19:02:01 +01:00
Gregor Parzefall
adec16790b
Offer ContentDB updates for leftover bundled Minetest Game (#13906) 2023-11-05 19:01:19 +01:00
Zughy
726326924d
Clarify get_translated_string string argument (#13948)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-11-05 19:00:32 +01:00
Muhammad Rifqi Priyo Susanto
4d2227cfa5
Rename mtt_update to mod_translation_updater (#13952)
Clarifies the purpose of the translation update script by giving it a more explanatory name.
2023-11-05 09:11:30 +01:00
Nils Dagsson Moskopp
2025dcffbd Revert "Don't trigger a key event if a key with the same associated char was pressed (#13773)"
This partially reverts commit d57c936b08.

The reverted commit prevented recognition of key combinations.
It correctly changed a test case to no longer use “KEY_NUMPAD_5”.

Several keyboard layouts use a key combination to input a “+” (e.g. Neo2);
therefore some users could no longer input “+” to increase the view range.

Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
2023-10-30 21:23:59 +01:00
Desour
ec7a1f02e7 Fix out-of-bounds access in NodeDefManager::nodeboxConnects 2023-10-30 21:23:47 +01:00
Desour
1d31533601 Reformat rot array in NodeDefManager::nodeboxConnects, to make it less magic 2023-10-30 21:23:47 +01:00
Desour
64104585c5 Devtest: Add more connected nodebox test nodes 2023-10-30 21:23:47 +01:00
Gregor Parzefall
96197025b9
Fix hypertext[] sometimes calculating incorrect scrollbar height (#13943) 2023-10-29 17:54:31 +01:00
Muhammad Rifqi Priyo Susanto
1363059416
Fix issues in Minetest's English texts (#13913)
Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: Desour <ds.desour@proton.me>
Co-authored-by: sfan5 <sfan5@live.de>
2023-10-29 12:24:39 +01:00
Desour
b3988d964a Sounds: Do not fade paused sounds 2023-10-29 00:40:07 +02:00
Desour
2ad17136dc Sounds: Fix dtime being in milliseconds 2023-10-29 00:40:07 +02:00
Desour
b2aa5d9261 Sounds: Don't pause new sounds when paused 2023-10-29 00:39:38 +02:00
rubenwardy
4ee32c5441
Add package update detection on Content tab (#13807) 2023-10-28 17:33:44 +01:00
sfan5
ddce858c34 Speed up macOS CI
- skip nonsense during package installation
- use actual number of available cores
2023-10-27 20:22:40 +02:00
sfan5
00be802c5c Use macos-latest for CI
Old versions lose support relatively quickly and then silently degrade
to e.g. compiling all dependencies from source which takes a long time.
2023-10-27 20:22:40 +02:00
sfan5
8d2e1289a4 Use newer IrrlichtMt 2023-10-27 19:00:04 +02:00
Desour
454eb3901d Inventory: Fix deleted inventory being used for regaining locked lists 2023-10-27 18:47:07 +02:00
Desour
a464b41d99 Inventory: Release resizes-locked lists on all on_-callbacks 2023-10-27 18:47:07 +02:00
ROllerozxa
1a562ca144 Prevent Windows Defender warnings in singleplayer (Bind singleplayer server to 127.0.0.1) 2023-10-27 12:03:43 +02:00
sfan5
03ba9370b9 Deprecate .bmp format 2023-10-27 11:05:27 +02:00
Nils Dagsson Moskopp
2f16227302
Set color of scrollbar/dropdown button symbols and checkmarks to white
Before this patch, the symbols were rendered black on dark background.

Previous images were edited like this:

1. The colors were inverted with GIMP's “linear inversion” method.
2. Image files were optimized using “optipng -o7 -zm1-9 -strip all”.

Co-authored-by: ROllerozxa <rollerozxa@voxelmanip.se>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-10-27 11:05:00 +02:00
sfan5
15c3fb7b7a Amend list of planned breakages 2023-10-24 18:17:18 +02:00
Gregor Parzefall
2ce14ce4eb
Use hypertext[] for credits so that long lines are wrapped (#13914) 2023-10-22 15:32:14 +02:00
SmallJoker
906417cc0d
GUI: Autofocus newly opened GUIModalMenu instances (#13911)
This in particular fixes incorrect event propagation to menus that
are no longer shown, such as the key change menu when opened within
the settings tab.
2023-10-22 15:31:42 +02:00
SmallJoker
2fbf5f4250
CSM: Fix duplicate player names (#13910) 2023-10-22 15:31:29 +02:00
Alexander Chibrikin
3491509b21
Add Russian translation of builtin (#13896)
Co-authored-by: Zemtzov7 <72821250+zmv7@users.noreply.github.com>
2023-10-22 15:31:11 +02:00
DS
7e8831a414
Inventory: Don't throw resize lock exception in destructor (#13894)
... of nodemeta inventories.
2023-10-22 15:30:11 +02:00
Cora de la Mouche
341e53f2e2
Remove deprecation mark on TGA texture format (#13877) 2023-10-22 15:29:28 +02:00
Muhammad Rifqi Priyo Susanto
c9655e54ce
Change some keys to be triggered once every key press (#13883)
Those keys are below:
- KeyType::CAMERA_MODE
- KeyType::SCREENSHOT
- KeyType::TOGGLE_BLOCK_BOUNDS
- KeyType::TOGGLE_HUD
- KeyType::MINIMAP
- KeyType::TOGGLE_CHAT
- KeyType::TOGGLE_FOG
- KeyType::TOGGLE_DEBUG
- KeyType::TOGGLE_PROFILER
- KeyType::RANGESELECT


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-10-22 02:00:08 +07:00
updatepo.sh
8a9855241c Update translation files 2023-10-20 23:14:25 +02:00
updatepo.sh
72fc564758 Update example conf and settings translations 2023-10-20 23:12:43 +02:00
BRN Systems
81fee2207e Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:05 +02:00
gallegonovato
425db09ede Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:05 +02:00
Gábriel
0f2b196b32 Translated using Weblate (Hungarian)
Currently translated at 98.2% (1331 of 1355 strings)
2023-10-20 22:54:05 +02:00
watilin
bb7c0ceea0 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:05 +02:00
Jorge Batista Ramos Junior
24c2ef2996 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.0% (1342 of 1355 strings)
2023-10-20 22:54:04 +02:00
Filippo Alfieri
f7775640d5 Translated using Weblate (Italian)
Currently translated at 99.5% (1349 of 1355 strings)
2023-10-20 22:54:04 +02:00
Christian Elbrianno
3127dd902a Added translation using Weblate (Javanese) 2023-10-20 22:54:04 +02:00
Wuzzy
6445fbaadc Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Tirifto
4a4861c26f Translated using Weblate (Esperanto)
Currently translated at 85.9% (1164 of 1355 strings)
2023-10-20 22:54:04 +02:00
Farooq Karimi Zadeh
332f1af325 Translated using Weblate (Persian)
Currently translated at 0.1% (1 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Douglas
520cfaf13e Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Farooq Karimi Zadeh
7b14b867f5 Added translation using Weblate (Persian) 2023-10-20 22:54:04 +02:00
Marco Ciampa
8ab517d242 Translated using Weblate (Esperanto)
Currently translated at 85.2% (1155 of 1355 strings)
2023-10-20 22:54:04 +02:00
Claybiokiller
c0f0770f65 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.0% (1234 of 1355 strings)
2023-10-20 22:54:04 +02:00
Linerly
28e06f7d9c Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Nanashi Mumei
77f2c94395 Translated using Weblate (Russian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Emmily
17e0ec27eb Translated using Weblate (Esperanto)
Currently translated at 84.7% (1149 of 1355 strings)
2023-10-20 22:54:04 +02:00
yue weikai
d62abbc938 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.4% (1226 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
00b7208b5a Translated using Weblate (Irish)
Currently translated at 1.7% (24 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
92248e8018 Translated using Weblate (Gaelic)
Currently translated at 11.1% (151 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yic95
78aad07be9 Translated using Weblate (Chinese (Traditional))
Currently translated at 70.9% (961 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
50cdf0e9bf Added translation using Weblate (Irish) 2023-10-20 22:54:04 +02:00
Muhammad Rifqi Priyo Susanto
a644e8c70a Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Hugo Carvalho
2e96f99e9c Translated using Weblate (Portuguese)
Currently translated at 98.8% (1339 of 1355 strings)
2023-10-20 22:54:04 +02:00
Milan Šalka
57cc054bb3 Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Hugo Rosa
8df315378d Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Jynweythek Vordhosbn
bcfd1fcdba Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
Joaquín Villalba
6f93853e65 Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
joserene-007
c8b98d1eeb Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
Skrripy
356ee9d2a9 Translated using Weblate (Ukrainian)
Currently translated at 55.2% (749 of 1355 strings)
2023-10-20 22:54:04 +02:00
Ács Zoltán
db5a15e14c Translated using Weblate (Hungarian)
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Salif Mehmed
e2ab89d253 Translated using Weblate (Bulgarian)
Currently translated at 34.2% (464 of 1355 strings)
2023-10-20 22:54:04 +02:00
Jakub Z
85884c15e7 Translated using Weblate (Polish)
Currently translated at 87.3% (1183 of 1355 strings)
2023-10-20 22:54:04 +02:00
Dominik Gęgotek
fc5ff8d8c7 Translated using Weblate (Polish)
Currently translated at 87.3% (1183 of 1355 strings)
2023-10-20 22:54:04 +02:00
Janar Leas
34e566f726 Translated using Weblate (Estonian)
Currently translated at 46.8% (635 of 1355 strings)
2023-10-20 22:54:04 +02:00
MikeL
a18be49827 Translated using Weblate (Maori)
Currently translated at 0.8% (11 of 1355 strings)
2023-10-20 22:54:04 +02:00
MikeL
2871a9fee8 Added translation using Weblate (Maori) 2023-10-20 22:54:04 +02:00
ROllerozxa
2817b9d84b Translated using Weblate (Swedish)
Currently translated at 66.6% (903 of 1355 strings)
2023-10-20 22:54:04 +02:00
Timur Seber
4cc05906bd Translated using Weblate (Tatar)
Currently translated at 0.9% (13 of 1355 strings)
2023-10-20 22:54:04 +02:00
facilitas
d04c1b5d73 Added translation using Weblate (Interlingua) 2023-10-20 22:54:04 +02:00
Артём Котлубай
2a518d8661 Translated using Weblate (Russian)
Currently translated at 99.3% (1346 of 1355 strings)
2023-10-20 22:54:04 +02:00
Application-maker
9b71b2f5d9 Translated using Weblate (Russian)
Currently translated at 99.3% (1346 of 1355 strings)
2023-10-20 22:54:04 +02:00
Robinson
261bf52440 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Pexauteau Santander
9b76946540 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Martin Šimek
9c0b546942 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Roland Meier
ac3bb40692 Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Vít Skalický
54a39e3c4e Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Martin Šimek
def9db9d16 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Nicolae Crefelean
ed1c6b432c Translated using Weblate (Romanian)
Currently translated at 53.5% (725 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
dc88e6f927 Translated using Weblate (Malay (Jawi))
Currently translated at 59.0% (800 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
ce53230ab2 Translated using Weblate (Malay)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Muñoz
cd17caab7e Translated using Weblate (Spanish)
Currently translated at 89.6% (1215 of 1355 strings)
2023-10-20 22:54:04 +02:00
nyommer
d5bf34271f Translated using Weblate (Hungarian)
Currently translated at 97.6% (1323 of 1355 strings)
2023-10-20 22:54:04 +02:00
Sharpik
941896ef28 Translated using Weblate (Czech)
Currently translated at 68.2% (925 of 1355 strings)
2023-10-20 22:54:04 +02:00
Furkan Baytekin
f362ed0880 Translated using Weblate (Turkish)
Currently translated at 89.0% (1207 of 1355 strings)
2023-10-20 22:54:04 +02:00
Sava Kujundžić
be1c441157 Translated using Weblate (Serbian (latin))
Currently translated at 7.4% (101 of 1355 strings)
2023-10-20 22:54:04 +02:00
Pexauteau Santander
8c3b8b7b4c Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Mimi Kush
be1e781399 Translated using Weblate (Spanish)
Currently translated at 89.6% (1215 of 1355 strings)
2023-10-20 22:54:04 +02:00
Šimon Brandner
b10fe4ddd6 Translated using Weblate (Czech)
Currently translated at 68.1% (924 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Muñoz
d54d4b4618 Translated using Weblate (Spanish)
Currently translated at 88.5% (1200 of 1355 strings)
2023-10-20 22:54:04 +02:00
jolesh
09104e17a0 Translated using Weblate (Esperanto)
Currently translated at 84.3% (1143 of 1355 strings)
2023-10-20 22:54:04 +02:00
Walter Bulbazor
7a5247cc33 Translated using Weblate (Occitan)
Currently translated at 24.3% (330 of 1355 strings)
2023-10-20 22:54:04 +02:00
Tor Egil Hoftun Kvæstad
475809ed40 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 43.2% (586 of 1355 strings)
2023-10-20 22:54:04 +02:00
Артём Котлубай
2f9742c64f Translated using Weblate (Russian)
Currently translated at 99.1% (1344 of 1355 strings)
2023-10-20 22:54:03 +02:00
Tsaqib Fadhlurrahman Soka
85c9c27e42 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Marian
8c9a4d9a05 Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Ács Zoltán
1b2396ee9e Translated using Weblate (Hungarian)
Currently translated at 97.0% (1315 of 1355 strings)
2023-10-20 22:54:03 +02:00
Alexandros Koutroulis
dd587aa30d Translated using Weblate (Greek)
Currently translated at 27.8% (377 of 1355 strings)
2023-10-20 22:54:03 +02:00
waxtatect
9ccc0bd27e Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Gregor Parzefall
b1dec37adb
Clean up and improve mainmenu theme / game theme code (#13885) 2023-10-18 20:18:50 +02:00
JosiahWI
62eb6cfed0
Extract updatePauseState from Game::run (#13893) 2023-10-18 20:17:30 +02:00
DS
6026003508
Warn only once about positional stereo sounds (#13895) 2023-10-18 20:16:45 +02:00
Gregor Parzefall
6fdc7e0dad
Make hypertext[] respect font size settings (#13858) 2023-10-16 20:47:16 +02:00
DS
3c41195986
Inventory: Fix picking up items via drop and pickup doubleclick (#13891) 2023-10-16 20:46:57 +02:00
Desour
5e0f14266d Fix forgotten CLANG_MINIMUM_VERSION update 2023-10-14 13:23:17 +02:00
DS
12e98678f6
Particle cleanup (#13394) 2023-10-11 17:07:30 +02:00
Thresher
352a403bd0
Optimize PNG files (#13509) 2023-10-09 17:13:44 +02:00
Muhammad Rifqi Priyo Susanto
7e678b5686
Prevent early respawns caused by up/down button in the death screen (#13870) 2023-10-09 17:13:33 +02:00
sfan5
b270c2bd68 Don't print ASCII art when using ncurses 2023-10-09 17:13:18 +02:00
DS
11ec75c2ad
ActiveObjectMgr fixes (#13560) 2023-10-09 17:13:04 +02:00
Loïc Blot
929a13a9a0
build: Allow disabling documentation build + print more build flags (#13871)
* build: permit to disable documentation build

* build: add a message about some BUILD_* flags
2023-10-09 15:35:12 +02:00
Wuzzy
2c74797d34
Add script to update/generate mod translations (#13739) 2023-10-08 16:47:11 +01:00
Gregor Parzefall
d05da513be
Notify users to reinstall MTG if worlds exist (#13850) 2023-10-08 16:47:00 +01:00
Gregor Parzefall
26bb397852
Add advanced settings checkbox and hide advanced settings by default (#13861)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-10-07 21:34:59 +02:00
sfan5
01d26c0e0e Warn when ignoring bind_address 2023-10-05 17:29:49 +02:00
sfan5
e02bf9fb1a Log timeout when a httpfetch times out 2023-10-05 17:29:49 +02:00
sfan5
9ec40ce8e9 Enforce minimum for curl(_file_download)_timeout 2023-10-05 17:29:49 +02:00
rvenson
ac8a9f9502
Update range values of meta set functions in the documentation 2023-10-05 17:29:26 +02:00
Muhammad Rifqi Priyo Susanto
c60d971bc4
Move unsupported language list into a separate file (#13865) 2023-10-05 17:29:02 +02:00
DS
8db4381304
MapblockMeshGenerator: Use more verbose member names (#13244) 2023-10-04 00:28:43 +02:00
corpserot
5a5697273b
lua_api_deploy: fix code blocks parsing (#13847) 2023-10-03 20:34:24 +02:00
sfan5
de0036f4c1 Document air_equivalent as deprecated 2023-10-02 13:44:12 +02:00
Gregor Parzefall
33cc29bbda
Allow setting custom third person front view camera offset (#13686)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2023-10-02 13:44:03 +02:00
Caleb Butler
3a4bf14c20
Replace all core::unicode::ustring with std::u32string (#13775) 2023-10-02 13:43:38 +02:00
Gregor Parzefall
56965bc814
Android: Add field_enter_after_edit[] formspec element (#13836) 2023-10-01 11:20:50 +02:00
Gregor Parzefall
94eba15c34
Misc. mainmenu fixes (#13859)
* settingstypes.txt: Fix wrong default value for profiler.report_path

* Disable Irrlicht file picker on Android
  (It doesn't work.)

* Join Game tab: Fix server description textarea being misaligned with background

* Reduce distance between tab and gamebar on Android
  Allows using a higher gui_scaling value without the gamebar going off-screen.

Co-authored-by: ROllerozxa <rollerozxa@voxelmanip.se>
2023-10-01 11:19:52 +02:00
Desour
c90c545d33 Put the internal sound definitions into a new sound namespace 2023-09-30 18:54:26 +02:00
Desour
bbc64a2eb5 Split sound_openal_internal into serval files 2023-09-30 18:54:26 +02:00
Desour
606215fae9 Move sound_openal and sound_openal_internal into new src/client/sound directory 2023-09-30 18:54:26 +02:00
Desour
8fa2ea71ef Move soundmanager into its own thread
Fixes sound queues running empty on client step hiccups.
2023-09-26 22:10:57 +02:00
Desour
591e45657f Bump minimum clang version to 7.0.1
std::variant is broken in clang < 7.0.1 with libstdc++
see: https://github.com/llvm/llvm-project/issues/32569
2023-09-26 22:10:57 +02:00
sfan5
b0d5cedeb6 Fix missing initialization for m_game_focused 2023-09-24 16:46:18 +02:00
sfan5
d113636a43 Fix UB in NetworkPacket class 2023-09-24 16:46:18 +02:00
sfan5
5109fa7eda Fix crash when processing empty mesh buffers 2023-09-24 16:46:18 +02:00
Gregor Parzefall
ff87be6e5f
Remove unused "mNormal" uniform to fix crash on GLES2 with shaders 2023-09-24 16:46:05 +02:00
Gregor Parzefall
4cf900c779
Fix error when enabling texture packs (#13829) 2023-09-23 18:20:23 +02:00
ROllerozxa
c247761213
Escape package description in content tab 2023-09-22 21:25:58 +02:00
savilli
d57c936b08
Don't trigger a key event if a key with the same associated char was pressed (#13773) 2023-09-22 21:25:13 +02:00
David Leal
9f47e123d2
animaition -> animation (#13827)
Also changed `range` to `frame_range`,
2023-09-22 18:41:33 +02:00
sfan5
c3114132d3
Improve readability and infos in verbose log (#13828) 2023-09-22 18:41:10 +02:00
ROllerozxa
5949172735
Build MkDocs Lua API docs using GitHub CI, deploy to api.minetest.net (#13675)
* Build MkDocs Lua API documentation using GitHub CI and Pages instead

* Remove Lua highlight hack as codeblocks are correctly marked as Lua now

* fix line endings
2023-09-18 19:17:18 +03:00
x2048
e36b2226b9
Skip face culling in shadows for double-sided materials (e.g. plantlike) (#13500)
* Skip face culling in shadows for double-sided materials (e.g. plantlike)

* Keep previous face culling for transparent surfaces e.g. water
2023-09-17 21:42:14 +02:00
ROllerozxa
a88e61c2cf
Improve UX when no game exists and drop default_game (#13550) 2023-09-17 18:45:28 +01:00
Gregor Parzefall
5bfc5d44c0
Two ContentDB GUI fixes (#13806) 2023-09-16 18:36:28 +02:00
Gregor Parzefall
4f735fba05
Settings GUI: Noise parameter setting fixes (#13797) 2023-09-16 18:35:35 +02:00
Wuzzy
8ebaf753d3
New physics overrides (#11465) 2023-09-15 20:10:08 +02:00
sfan5
2479d51cc6 Fix double-free of minimap textures 2023-09-13 15:27:07 +02:00
sfan5
033128d8dc Show better description to users when std::bad_alloc happens 2023-09-13 13:58:59 +02:00
SmallJoker
4ef93fe25f
Allow place_param2 = 0 node placement predictions (#13787)
The placement prediction value 0 was accidentally ignored
and made the clients fall back to automatic rotation based
on the node paramtype2 value.

This now changes the internal representation to properly
indicate the disabled state (e.g. 'nil' in Lua).
2023-09-13 13:57:57 +02:00
Gregor Parzefall
833c324498
Make the crosshair DPI-aware (#13772) 2023-09-11 18:59:32 +02:00
rubenwardy
48ab1835da Replace settings tab with button 2023-09-09 18:49:33 +02:00
Zughy
798b9eae4a Add settings button icon 2023-09-09 18:49:33 +02:00
Desour
010d08f6a4 Fix -Wmissing-braces warnings in mapblock_mesh.cpp 2023-09-09 18:48:56 +02:00
Desour
7897450b27 Fix -Winconsistent-missing-override warnings 2023-09-09 18:48:56 +02:00
Desour
2ad4c9e0ce Fix -Wunused-but-set-variable warnings 2023-09-09 18:48:56 +02:00
Gregor Parzefall
95056f9783
Higher default graphics settings on Android (#13780) 2023-09-07 17:55:11 +02:00
Gregor Parzefall
1a568cc491
Fix that negative integer values for float settings don't get a ".0" suffix (#13779) 2023-09-05 15:36:05 +02:00
Gregor Parzefall
83b85ba16a
Rewrite the gamebar (#13768) 2023-09-02 23:02:02 +02:00
chmodsayshello
294ad98776
Send ever lasting particle spawners to all players (#13774) 2023-09-02 22:58:11 +02:00
sfan5
f080aa29b5 Remove usage of obsolete HighPrecisionFPU field 2023-09-01 12:46:36 +02:00
Gregor Parzefall
4252f9d4d5
Restore the appearance of the "Start Game" tab after #13761 (#13769) 2023-08-30 14:45:44 +02:00
rubenwardy
0cbf96cc83
Use formspec version 6 in the main menu (#13761) 2023-08-28 22:36:54 +01:00
Gregor Parzefall
7b56daa236
Small setting-related fixes (#13755) 2023-08-27 20:18:41 +02:00
savilli
852d6a7976
Fix potential freeze in core.check_for_falling 2023-08-27 20:12:53 +02:00
SmallJoker
bf9f831cb2 Inventory: skip redundant stack movement
The list of dragged stacks includes the source stack, which
however does not need to be moved onto itself.
This is an optimization.
2023-08-27 20:12:10 +02:00
SmallJoker
0ba899e239 Inventory: Fix assertion caused by a no-op stack movement 2023-08-27 20:12:10 +02:00
Rising Leaf
660151572f
Do not render objects that are invisble into the shadow map 2023-08-26 20:12:17 +02:00
1F616EMO~nya
54eacca287
Use issue templates for creating issues (#13222) 2023-08-25 22:00:05 +07:00
Desour
f47b00426a Revert "Get rid of guiroot"
This reverts commit 45e7a80057.
2023-08-24 22:14:44 +02:00
Desour
7e4dccb3b5 Revert "Get rid of global guienv variable"
This reverts commit 16da954bd7.
2023-08-24 22:14:44 +02:00
Desour
f98726c516 Revert "Use our GUIButton in touchscreengui"
This reverts commit f7f3aaf43c.
Fixes #13743.
2023-08-24 22:14:44 +02:00
Gregor Parzefall
aea9242a96
Allow nodes to have their post_effect_color affected by lighting (#13637)
Co-authored-by: DS <ds.desour@proton.me>
2023-08-24 20:16:36 +02:00
Gregor Parzefall
92b6ff4721
TouchScreenGUI: Fix only 9 hotbar slots being usable (#13698)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-08-24 17:45:51 +02:00
Gregor Parzefall
72ef90885d
Clean up texture filtering settings (#13683) 2023-08-24 10:50:47 +02:00
gamefreq0
d0ee63c766
Enable shift-click crafting (#13729) 2023-08-24 12:00:54 +07:00
fluxionary
587e2b2526
Set item description as infotext for item entities (#13728) 2023-08-24 12:00:18 +07:00
rubenwardy
a65cdbe66e
Settings GUI: Use language names rather than codes (#13752) 2023-08-24 00:33:23 +01:00
Montandalar
7b3ed32003
Persist text inputs in mainmenu local tab
Co-authored-by: archfan <33993466+archfan7411@users.noreply.github.com>
2023-08-14 18:17:53 +02:00
sfan5
2c987b66c1 Move implementations of some LuaVoxelManip functions to l_mapgen 2023-08-14 18:16:36 +02:00
sfan5
e48f15c135 Skip liquid updates in MapgenSinglenode if not applicable 2023-08-14 18:16:36 +02:00
sfan5
bf36a90579 Optimize Mapgen::updateLiquid()
-55% runtime in singlenode usage, which is the best case
2023-08-14 18:16:36 +02:00
sfan5
43c9c38a28 Fix itemdef defaults not being applied in async env 2023-08-14 18:16:36 +02:00
sfan5
f6bddc4e8d Fix registered_craftitems not populated in async env 2023-08-14 18:16:36 +02:00
sfan5
f9c881eb5a Add two missing classes to async environment 2023-08-14 18:16:36 +02:00
Desour
16da954bd7 Get rid of global guienv variable
(It can already be accessed via the renderingengine.)
2023-08-14 18:13:47 +02:00
Desour
45e7a80057 Get rid of guiroot
The guienvironment already provides a root gui element, we don't need to add another one.
(For CGUIEnvironment, the env itself is the root element.)
2023-08-14 18:13:47 +02:00
Desour
7e7aceb8c1 Replace all actual uses of irrlicht CGUIStaticText with our StaticText 2023-08-14 18:13:47 +02:00
Desour
d75c956dbc Remove ugly hack in static_text.h
Just use the root element, like GUIButton:add().
2023-08-14 18:13:47 +02:00
Desour
f7f3aaf43c Use our GUIButton in touchscreengui 2023-08-14 18:13:47 +02:00
Desour
91c0439922 Use our GUIButton in our GUIScrollBar
Note that GUIScrollBar needs an ISimpleTextureSource now due to button styling.
2023-08-14 18:13:47 +02:00
Desour
9d62abbe46 Replace any uses of CGUIScrollBar and IGUIScrollBar with GUIScrollBar 2023-08-14 18:13:47 +02:00
Desour
124d064015 GUIButton: Default BgColor to white, as opposed to unintialized
(Same as what CGUIButton uses (via colors=0).)
2023-08-14 18:13:47 +02:00
Desour
2903f692ba GUIButton: Use default member initializers 2023-08-14 18:13:47 +02:00
Desour
7f9de5db0b Make touchscreengui compile 2023-08-14 18:13:47 +02:00
jordan4ibanez
14441a289e
Document openSUSE Required Packages 2023-08-14 18:13:36 +02:00
rubenwardy
137e4ce866
Fix hypertext in the mainmenu (#13731) 2023-08-13 13:28:33 +01:00
Gregor Parzefall
526c5f2348
ContentDB GUI: Load package list asynchronously (#13551) 2023-08-13 13:28:24 +01:00
ROllerozxa
e4bedc7ea8
Make content tab use real coordinates and minor cleanups (#13719) 2023-08-13 13:28:16 +01:00
rubenwardy
c6a0ead72d
Add warning for initial properties directly inside definition (#9650) 2023-08-13 00:19:03 +01:00
Zughy
98f097dc2f
Warn about unsupported file extensions for media 2023-08-06 14:16:00 +02:00
ROllerozxa
c816aa5374
Settings GUI: Fix path settings on Windows 2023-08-06 14:15:49 +02:00
Zughy
4d9a67682d
DOCS: state that get_wielded_item returns a copy of the item 2023-08-06 14:15:34 +02:00
rubenwardy
d16d1a1341
Settings GUI: Add setting dependencies (#13704) 2023-08-05 17:55:27 +01:00
rubenwardy
752ce1a1b2
Settings GUI: Move shadow presets to Shaders, remove Most Used (#13713) 2023-08-05 17:33:18 +01:00
JosiahWI
28fce8aad5
Add dev stage to docker image (#13573) 2023-07-30 15:29:25 +01:00
Nikita K
e0948f42ab
Add Void Linux specifics to build documentation (#13693) 2023-07-30 14:55:06 +01:00
Joachim Stolberg
21ecdd5681
Fix textarea scrollbar inside border=false (#13678) 2023-07-30 14:54:52 +01:00
Wuzzy
20e9969313
Improve object documentation in lua_api.md (#13239)
Co-authored-by: DS <ds.desour@proton.me>
2023-07-30 14:54:01 +01:00
OgelGames
3f2a10bb4b
Fix decode_base64 returning nothing instead of nil (#13697) 2023-07-30 14:53:47 +01:00
doxygen-spammer
9f25378ddd
Add performance test nodes, using complex meshes. (#13161) 2023-07-30 14:53:08 +01:00
Gregor Parzefall
cc8280426f
Minor additions to the VoxelManip docs 2023-07-28 00:40:01 +02:00
Stvk imension
ba6de431a2
Android: Remove Migration Code (#13590)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-07-27 14:09:17 +02:00
Gregor Parzefall
c14e4d1795
Increase the resolution of the logo shown on the about tab 2023-07-22 17:20:12 +02:00
Desour
e0192e256f Fix incorrect rounding in GUIInventoryList::getItemIndexAtPos 2023-07-22 17:19:57 +02:00
ndren
53c594abe0
Introduce and start using microsecond sleep on Linux (#13445) 2023-07-22 17:19:49 +02:00
sfan5
72ed8514c5 Use newer IrrlichtMt 2023-07-20 22:15:47 +02:00
Gregor Parzefall
6f0d36c41a Fixes and improvements 2023-07-20 22:15:47 +02:00
Gregor Parzefall
7473e4cafd Expose all OpenGL filtering modes, use OpenGL names for them
Because of a review comment on the Irrlicht PR by numberZero.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
6bf63d4b41 Rename SMaterial::TextureLayer -> SMaterial::TextureLayers
It's not the "texture layer" of the material, but an array of texture layers.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
05ebe2418b Rename E_MATERIAL_FLAG -> E_MATERIAL_PROP
The enum values don't reference material flags, but material properties.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
9bef3c136a Split up texture filtering properties of SMaterialLayer into MinFilter and MagFilter
You can	now set	the filter used	when scaling textures down and the filter used when scaling textures up separately.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
307e380f30 Refactor the way you set material properties
Instead of using SMaterial::setFlag, you now set them directly on SMaterial or SMaterialLayer.
2023-07-20 22:15:47 +02:00
SmallJoker
128d22e6ee
GUI: Automatic scaling of checkboxes and scrollbars (#13666)
Mainly helpful on high-DPI screens or when 'gui_scaling' is changed
2023-07-17 20:46:15 +02:00
Nekobit
50234b8e5c
Fix string conversion for FreeBSD (#13648) 2023-07-17 20:46:06 +02:00
Gregor Parzefall
3552537fc4
Fix that transparent text still draws a text shadow (#13649)
Makes fade out animations of text more pleasant to look at.
2023-07-17 20:45:56 +02:00
DS
f41e9e3e0f
Add Irrlicht device info to the mainmenu About tab (#13636) 2023-07-17 20:44:54 +02:00
archfan
9b310a6e6f
Decrease sneak margin to combat phasing through thin walls (#13607)
A 1/16th-node-thick wall is 0.625 meters thick, and the previous margin of 0.1 meters meant that these walls could be phased through by sneaking against them. A margin lower than 0.625 prevents this.
2023-07-17 20:44:33 +02:00
Muhammad Rifqi Priyo Susanto
2061984313 Simplifies code by using Irrlicht's operator overloads
New variables are added to replace in-place calculations.
2023-07-14 21:00:29 +07:00
Muhammad Rifqi Priyo Susanto
3a47559e86 Fix some memory leaks and code style issues
Maximum line length is 95 characters.
Some members' name are changed.
Struct initialisations use brace syntax; eliminating the usage of the memset function.
Iterations use for-each-loop instead of while-loop+iterator.
char * -> std::string
button_info * -> std::shared_ptr<button_info>
2023-07-14 21:00:29 +07:00
Desour
8e09077de8 Fix sound manager not being stepped by GUIEngine 2023-07-14 14:42:00 +02:00
Gregor Parzefall
1837a11c22
Improve messages when changing viewing range and exceeding server-set limit (#13647) 2023-07-14 14:41:45 +02:00
sfan5
bf987bf58a Handle blit_back_with_light with empty area
fixes #13306
2023-07-13 20:42:39 +02:00
sfan5
4a14a18799 Fix mapgen_v6 crashing
this variable was accidentally shadowed in 20b10b569
2023-07-09 20:59:57 +02:00
lhofhansl
136a93f628
Reverse eye-offset Z-coordinate in 3rd person front view (#13369) 2023-07-08 12:00:15 +07:00
Gregor Parzefall
0218963f1b
Fix max_formspec_size not taking gui_scaling into account (#13493) 2023-07-07 21:42:43 +02:00
SmallJoker
078bd95a49
Formspec: prevent infinite loop caused by negative background9[] size (#13624) 2023-07-07 21:42:10 +02:00
lhofhansl
869df17ddf
Server enforcement for fog_distance (#13448) to block cheating (#13643)
This enforces the fog_distance (if set) at the server, so that a hacked client could not cheat and retrieve blocks beyond the set distance.
2023-07-06 09:36:46 -07:00
Gregor Parzefall
26453df2f7
Don't crash if a Lua error occurs inside get_staticdata 2023-07-03 20:34:02 +02:00
ROllerozxa
d71872af23
Fix texture paths for system-installed builds
* window icon
* custom touchscreen checkbox sprites
2023-07-03 20:31:03 +02:00
Lars Müller
25ef8f3934
Fix local animations not resetting
Converts `LocalPlayerAnimation` to a scoped enum to prevent such bugs in the future
2023-07-02 12:47:18 +02:00
Muhammad Rifqi Priyo Susanto
ff498fc206
Android: Reliably showing an IME for text input dialog (#13521)
This commit is inspired by this blog post: https://developer.squareup.com/blog/showing-the-android-keyboard-reliably/
2023-07-01 14:00:30 +07:00
lhofhansl
0ade097e99
Allow the server to control fog_distance and fog_start via the sky-api (#13448) 2023-06-30 19:11:17 -07:00
numzero
dde8f0e20a Replace a non-aligned cuboid with a cylinder in client::ActiveObjectMgr::getActiveSelectableObjects 2023-06-29 18:58:10 +02:00
numzero
21035bf5d4 Add unit test on client::ActiveObjectMgr::getActiveSelectableObjects 2023-06-29 18:58:10 +02:00
numzero
d7291e0600 Update client::ActiveObjectMgr::getActiveSelectableObjects API 2023-06-29 18:58:10 +02:00
AFCMS
aaae9d5a77
Fix .clang-format file config values 2023-06-29 18:57:55 +02:00
x2048
c09a3a52ac
Add antialiasing filters (FXAA, SSAA) (#13253) 2023-06-28 05:30:08 +02:00
sfan5
442d5fc75c Add unit tests for isBlockInSight() 2023-06-26 22:51:49 +02:00
numzero
3b74cc4a41 Replace PP with direct printing 2023-06-26 22:51:32 +02:00
numzero
de77fe8ade Allow printing irr::core::vector[23]d directly to an std::ostream 2023-06-26 22:51:32 +02:00
Vitaliy
2f6a9d12f1
Allow running individual unit tests 2023-06-25 11:13:48 +02:00
Vitaliy
aada2403c9
Try all known video drivers if the requested one fails to initialize 2023-06-25 11:13:23 +02:00
LoneWolfHT
35ad3dabab
Fix MSVC github action 2023-06-24 20:38:31 +02:00
s20
4fb6754903
Adding gettext in the compilation dependency packages list 2023-06-24 20:38:11 +02:00
Gregor Parzefall
7e51e2dea6 Fix compiler error on MSVC with ENABLE_TOUCH=TRUE 2023-06-24 20:37:59 +02:00
sfan5
84fb663d6c Add VoxelArea::intersect() 2023-06-23 09:05:26 +02:00
sfan5
659828b142 Rename ModApiEnvMod and ModApiItemMod
The 'mod' could have meant module in the past but no other classes do this.
2023-06-23 09:05:26 +02:00
sfan5
610578e3e2 Use swapNode for set_node_level and add_node_level
While this is a behaviour change I don't think the old one made any sense.
It's possible that someone hit this before and wrote a workaround for it,
they won't be affected by this change.
It only makes things work that didn't before.
2023-06-23 09:05:26 +02:00
sfan5
62629939ff Genericize find_node_near and find_node_in implementations in C++ 2023-06-23 09:05:26 +02:00
sfan5
20b10b5691 Refactor EmergeParams owner 2023-06-23 09:05:26 +02:00
sfan5
32ff832108 Save Lua globals after mod loading
These are used for the async env currently and will be needed elsewhere soon.
2023-06-23 09:05:26 +02:00
sfan5
4fdd2dec59 Move core.run_callbacks and related to common folder 2023-06-23 09:05:26 +02:00
sfan5
524d446757 Minor script api fixes/cleanups 2023-06-23 09:05:26 +02:00
wsor4035
5b6bc8a12b
Remove unsupported media formats from client.cpp 2023-06-22 17:52:48 +02:00
LoneWolfHT
6a328197a5
MSVC CI job: Compile with gettext and LuaJIT 2023-06-22 17:52:35 +02:00
Gregor Parzefall
03ffc2618c
TouchScreenGUI: Add an exit / "ESC" button to the rare controls bar (#13574) 2023-06-22 17:50:36 +02:00
numzero
7c26cb1c35 Drop unused tile rotations 2023-06-22 17:50:20 +02:00
numzero
1102f92dac Use a enum for tile rotation 2023-06-22 17:50:20 +02:00
numzero
729671d6ae In getNodeTile, use a descriptive struct for the lookup table 2023-06-22 17:50:20 +02:00
numzero
d676520526 Optimize trigonometry out of MapblockMeshGenerator::drawCuboid 2023-06-22 17:50:20 +02:00
numzero
c29d897854 Optimize trigonometry out of MapblockMeshGenerator::drawLiquidTop 2023-06-22 17:50:09 +02:00
numzero
b8ddde0a96 Store liquid data as dimensionless fractions instead of BS multiplies 2023-06-22 17:50:09 +02:00
Vitaliy
43c9647fe5
Use absolute URL for the roadmap (#13617) 2023-06-21 16:00:04 +07:00
Desour
03dda13910 OpenALSoundManager: Fix a buffer overflow 2023-06-20 20:54:39 +02:00
AFCMS
531122ee86
Add .fleet folder to gitignore (#13611) 2023-06-20 22:00:15 +07:00
lhofhansl
8f25f487fe
Instrument touchMapBlocks and block loading/deserialization. (#13314) 2023-06-19 16:59:08 -07:00
Vitaliy
f1feeb319c
Cull liquid back face on liquid-glasslike interface (#13594) 2023-06-18 13:52:14 -07:00
DS
edcbfa31c9
Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
Wuzzy
8e1af25738 DevTest: Add example nodes for disable_descend 2023-06-16 20:14:08 +02:00
Wuzzy
6b3deaa170 Add disable_descend to disable active node sinking 2023-06-16 20:14:08 +02:00
Muhammad Rifqi Priyo Susanto
a4e69d6843
TouchScreenGUI: Read coordinates directly for virtual joystick (#13567)
The movement's direction and speed are calculated directly from the button's relative screen coordinate. The previous method was to trigger the movement using a keyboard event.
The only virtual joystick status left is Aux1 button.

---------

Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2023-06-16 22:40:16 +07:00
Desour
c549e84abb Silence a -Wsign-compare warning for invlist indices 2023-06-15 13:55:20 +02:00
Desour
dade95e142 Fix curl deprecation warnings, and set minimum curl version to 7.56.0 2023-06-15 13:55:20 +02:00
Desour
f947e2afec Fix some gcc -Wself-move warnings 2023-06-15 13:55:20 +02:00
Desour
6a05d63993 Use [[noreturn]] 2023-06-15 10:38:44 +02:00
Desour
5e6d144567 Enable -Wimplicit-fallthrough and use [[fallthrough]] attribute 2023-06-15 10:38:44 +02:00
Desour
9c348d057e Replace the old STATIC_ASSERT macro with static_assert 2023-06-15 10:38:44 +02:00
Desour
8b108ed5f2 Use nicer syntax for nested namespace definitions 2023-06-15 10:38:44 +02:00
Desour
e700182f44 Replace Optional with std::optional 2023-06-15 10:38:44 +02:00
Desour
34ad551efc Use MutexAutoLock for Thread::m_start_finished_mutex 2023-06-15 10:38:44 +02:00
Desour
5d863d7e9c Bump C++ std to 17 2023-06-15 10:38:44 +02:00
Desour
28766d1879 Bump minimum gcc and clang versions 2023-06-15 10:38:44 +02:00
Pascal Abresch
ba80d1ce1f Implement check_offset for decorations 2023-06-15 10:36:46 +02:00
DS
c91182e1b3
Move the platform-dependent stuff in renderingengine.cpp to irrlicht (#13348) 2023-06-11 14:17:39 +02:00
DS
553dc02deb
Fix some memleaks from GUIButtonImage (#13564)
* `m_foreground_image` was grabbed, but not dropped in the destructor.
* `m_image` was created with new. It is grabbed by itself and by the env (not only by the env!, so it's an owning ptr). This owning ptr also was never dropped.
2023-06-06 19:01:32 +02:00
Desour
1b51ff333a Use unique_ptr for ServerInventoryManager::DetachedInventory::inventory 2023-06-05 20:43:33 +02:00
Desour
1780d1bbde Use unique_ptrs for MapSector::m_blocks 2023-06-05 20:43:33 +02:00
Desour
08ea467bfe Use unique_ptr for g_httpfetch_thread 2023-06-05 20:43:33 +02:00
Desour
cfb1b879e0 Use unique_ptrs for CurlFetchThread::m_all_ongoing 2023-06-05 20:43:33 +02:00
Desour
d0bcdff5ce Use unique_ptrs for leveldb db and iterators 2023-06-05 20:43:33 +02:00
Zughy
8445c5fe60
Extend roadmap approval time from one week to one month 2023-06-05 12:02:59 +02:00
Gregor Parzefall
a1463263b5
Auto-detect locale on Android (#13561) 2023-06-05 12:02:10 +02:00
Gregor Parzefall
a857c46e6e
Make the settings GUI more usable on Android (#13543) 2023-06-05 12:01:54 +02:00
Desour
d9f478cbfb Remove a misleading MutexAutoLock in l_to_table
The temporary is immediately destructed, so the mutex isn't locked
after the line.
Removed the lock, because the Settings member-functions used by
push_settings_table lock the mutex and are thread-safe, but would
cause a dead-lock.
2023-06-05 12:01:08 +02:00
OgelGames
252c79d53a
Inventory mouse shortcut improvements (#13146)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-06-05 12:00:32 +02:00
mazes-80
23f7aab354
Item Entity: prevent moveresult assert when attached (#13353) 2023-06-05 12:00:11 +02:00
Gregor Parzefall
e5a5d5a672 Fix various cases of double-escaped error messages 2023-06-05 11:59:37 +02:00
Riley Adams
29b7aea38b
Cavegen y biome check (#13472) 2023-06-05 11:59:22 +02:00
sfan5
1ef9fc9d1f Bump used IrrlichtMt version 2023-06-04 20:36:46 +02:00
Muhammad Rifqi Priyo Susanto
7221de6ede Option to invert direction or disable mouse wheel for hotbar item selection
More changed callbacks for the settings are added in readSettings(). Those are also deregistered when the Game object is destroyed.
2023-05-31 12:40:00 +07:00
Treer
8cd1296049
Add additional texture modifiers (#10100)
* Adjust hue, saturation, and lightness
* Colorize using hue, saturation, and lightness
* Adjust contrast & brightness
* Hard light
* Overlay
* Screen
* Create texture of a given size and color
2023-05-29 20:17:39 +01:00
lhofhansl
a8ec6092e2
Load blocks and objects behind player when in third-persion front-view (#13431) 2023-05-29 10:26:42 -07:00
Gregor Parzefall
fc3d6c1dd9
Place nodes with single tap on Android (+ bugfix) (#13187)
Don't place nodes when closing button bars.
Update docs (also in-game).
Rename "Default controls" -> "Controls" in Android pause menu since players can't change them (normally), so calling them "default" doesn't make sense.
2023-05-29 12:30:30 +07:00
lhofhansl
6832bf044e
Avoid jittering when player is attached (#12439)
* Avoid very jittering when player is attached.

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Vitaliy <numzer0@yandex.ru>
2023-05-28 11:36:34 -07:00
ROllerozxa
394dd9ffa5
Fix settings dialog not resetting filter when closed (#13513) 2023-05-27 15:35:01 +01:00
sfan5
8cccd75e81
Android build via CMake (#13528)
* the thing

* the thing 2
2023-05-26 15:21:23 +02:00
Thresher
00c647e4cc
Convert spaces to tabs (#13506)
* Convert spaces to tabs

* Desour reviews 1-3 fix

* Desour fixes

* Undo alignment changes
2023-05-26 15:13:57 +02:00
ROllerozxa
f4cb16cc2d
Disable desynchronize_mapblock_texture_animation by default (#13514) 2023-05-26 13:48:37 +02:00
Zughy
d6eb6ff973
Reset player lighting when passing no arguments (#13525)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2023-05-26 13:47:16 +02:00
Zughy
b60d38b7f9
Reset day/night ratio even when passing no arguments (#13524)
* reset day_night_ratio when passing zero fields

* Update lua_api.md

---------

Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2023-05-26 13:45:42 +02:00
Thresher
180ec92ef9
Remove trailing whitespace (#13505) 2023-05-18 20:34:18 +02:00
SmallJoker
95a9f4ab7c
Inventory: Allow InvRef:set_list with new_size >= old_size (#13497)
Fixes a regression introduced by enforced checks to work with
valid pointers within inventory actions.
2023-05-18 20:32:55 +02:00
Gregor Parzefall
f393214fef
Settings menu improvements regarding default values (#13489)
The reset button now removes the setting from minetest.conf instead of setting it to its default value.
The reset button is now shown whenever a value is present in minetest.conf
Float settings now get a .0 suffix if they have no decimal places.
2023-05-18 20:32:26 +02:00
savilli
5ba70cf5ef
Fix crash on handling wallmounted nodes with invalid param2 (#13487) 2023-05-18 20:31:04 +02:00
Zemtzov7
35112f2453
Disable vertical movement when both jump and sneak keys are pressed (#13426) 2023-05-18 20:30:21 +02:00
Gregor Parzefall
15fb4cab15
Fix Android segfault when game exits before TouchScreenGUI is initalized 2023-05-11 22:51:16 +02:00
sfan5
15445a0fbe Raise and clean up _WIN32_WINNT constant 2023-05-11 22:51:01 +02:00
Wuzzy
80574cdbe8
Fix rotation of 4dir in schematic placement (#13432) 2023-05-11 22:50:52 +02:00
Stvk imension
3de54039ae
Document Android controls (#13061) 2023-05-11 22:50:38 +02:00
Buckaroo Banzai
65692ad1b5
Add min/max protocol version to minetest.get_version() (#13482) 2023-05-06 16:16:21 +01:00
rubenwardy
bc4fc6d648
Fix shadows dropdown and clean up shader settings (#13481) 2023-05-03 22:28:02 +01:00
rubenwardy
ad37df7f2e Fix crash when multiple mods with the same name provide settings 2023-05-01 21:39:12 +01:00
rubenwardy
d35672e78e Redesign/unify mainmenu settings interface 2023-05-01 17:11:41 +01:00
Zughy
a421a1d764 Add setting icons 2023-05-01 17:11:41 +01:00
DS
bec9c68bf3
Release invlist resizelock while doing the recursive callback in move_somewhere mode (#13470)
Fixes a crash in popular creative inventory mods that set the list when you put
something into trash.
2023-04-30 18:20:48 +02:00
lhofhansl
b35aa10579
Guarantee ActiveObjectMgr::m_active_object is not modified while iterating (#13468)
Currently if a mod creates new active objects in on_deactivate the server could crash.
2023-04-28 11:17:48 -07:00
Desour
7f6b09dce8 Use json forward-declarations 2023-04-27 18:50:33 +02:00
Desour
8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
Desour
e9e8eed360 GUIChatConsole: Use primary selection 2023-04-27 18:50:17 +02:00
Desour
062b4d036a GUIEditBox: Use primary selection 2023-04-27 18:50:17 +02:00
AFCMS
d197ff0f9d
Use Lua code blocks in lua_api.md 2023-04-26 20:09:08 +02:00
rubenwardy
9c90358912
Split compilation instructions from README.md (#13457) 2023-04-25 21:02:02 +01:00
SmallJoker
0fb6dbab36
InventoryManager: Disallow resizing or deleting inventory lists that are in use (#13360)
Naive solution to prevent InventoryList UAF and OOB ItemStack access caused by shrink/clear operations on InventoryLists within callbacks of an inventory action.

Co-authored-by: Desour <ds.desour@proton.me>
2023-04-22 17:42:36 +02:00
rubenwardy
4158b72971
Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
rubenwardy
8c2c7fadbf Add lua_api.txt to point to new file 2023-04-16 20:23:53 +01:00
rubenwardy
b1786e88ac Use .md extension for markdown files
Linking to line numbers is brittle, linking to sections/headings is better.

If you still want to link to a line number, you can append ?plain=1 to GitHub's URL
2023-04-16 20:23:53 +01:00
rubenwardy
5cd6a22dd3
Update settingtypes (#13428)
* Move settings to correct sections
* Improve titles and descriptions
* Make defaults in settingtypes.txt and defaultsettings.cpp match

Fixes #9002
2023-04-14 22:32:25 +01:00
rubenwardy
b89077187b Fix ContentDB page not being reset when changing type
Fixes #13362
2023-04-14 20:34:03 +01:00
rubenwardy
c5fb50298a
Prevent installing mods when there is no base game (#13429) 2023-04-14 20:23:25 +01:00
Desour
ccd696c49a Throw Hocroft-Karp onto shapeless recipes 2023-04-14 21:10:09 +02:00
Desour
50e91b882c Add some simple unittests for shapeless recipes
Note: devtest also has craft unittests (see devtest/mods/unittests/crafting.lua),
      but those aren't run at load-time.
2023-04-14 21:10:09 +02:00
DS
ae7271b725
Fix background[] pos-offset lower-right-corner being at least (1,1) (#13320)
IGUIElement has a MinSize for the RelativeRect, which is at least (1,1).
This means a pos offset of (0,0) will cause a seemingly off-by-1 error at the
lower right corner, and (0.1,0.1) for example will just not work on the lower
right corner.
Ergo, we can't use the AbsoluteRect for storing the pos offset.
2023-04-14 21:05:09 +02:00
DS
d49d80a4a0
Store whether window is maximized (#12861) 2023-04-14 21:04:03 +02:00
cat-master21
0b08e1b1d2
AppImageBuilder.yml: add script section and update to Jammy (#13078) 2023-04-14 13:00:20 +01:00
Lars
f9b1176fa9 Track server's max AsyncRunStep 2023-04-14 00:09:48 +01:00
Lars
3d232e2345 Add MAX profiler option 2023-04-14 00:09:48 +01:00
rubenwardy
9d1ae80e89
Add focused styling to buttons (#13414) 2023-04-14 00:09:29 +01:00
Gregor Parzefall
2a1bc82887
Fix black loading screen background if menu_clouds = false (#13322) 2023-04-13 18:12:48 +01:00
Wuzzy
d1e5dbefc7
Clarify documentation of punch key (#13238) 2023-04-13 18:12:26 +01:00
Desour
fc116ec950 Play object footstep sound at feet 2023-04-13 18:12:13 +01:00
Desour
7283d2495f Devtest: Add bigfoot for footstep sounds 2023-04-13 18:12:13 +01:00
Zardshard
e139749b5c
Simulate all keys being released when when game loses focus (#13336) 2023-04-13 18:06:21 +02:00
sfan5
fe75ec8d0d Update dependency libraries in buildbot 2023-04-13 18:05:39 +02:00
AFCMS
68f81ace97
Add vector.in_area() utility function (#13390) 2023-04-12 10:46:26 +01:00
rubenwardy
2fc7eb3ea2
Remove formspec_default_bg_color/opacity settings (#13419)
These settings are unnecessary. They only apply when formspecs don't have a background/bgcolor set. In practice, most games do theme their GUIs. Removing low value settings simplifies code and improves UX by decluttering the settings menu

Split out from #12140
2023-04-11 19:57:36 +01:00
Desour
1dd13da37d Get rid of global dummySoundManager
There is no need for this to be globally unique.
2023-04-11 20:06:15 +02:00
Desour
b201c03625 Use smart-ptrs in GUIEngine 2023-04-11 20:06:15 +02:00
Desour
ceec560779 Add make_irr 2023-04-11 20:06:15 +02:00
Stvk imension
d39a07efea
Android: Minor Code Improvements (#13342) 2023-04-10 23:05:01 +01:00
Riley Adams
73391013f7
Add node pos to node damage HP change reason (#13196) 2023-04-10 23:04:52 +01:00
David Leal
1d88d85f1c
Add progress_bar.png and progress_bar_bg.png to LICENSE file 2023-04-10 19:57:41 +02:00
Lars
4a742be73e Do not call updateDrawList, updateDrawListShadow, and touchMapBlocks in the same frame 2023-04-09 07:10:17 -10:00
Lars
8982998681 Add a default direction light for shadows 2023-04-09 07:10:17 -10:00
sfan5
9d736e8b8b Drop ENABLE_GLES option
ENABLE_GLES predates forking Irrlicht. Its primary use was to distinguish Irrlicht-ogles from upstream version as Minetest could be compiled with either.
That's not necessary anymore and gets in the way sometimes.
2023-04-08 20:19:35 +02:00
sfan5
c26e122485 Move video_driver default selection to runtime 2023-04-08 20:19:35 +02:00
Desour
67068cfaf4 Get rid of wgettext 2023-04-08 20:17:50 +02:00
Vitaliy
35929d27e3
Remove fast faces (#13216)
Co-authored-by: Lars <larsh@apache.org>
2023-04-08 20:17:15 +02:00
sfan5
c2a9ac24ac Continue with 5.8.0-dev 2023-04-08 18:05:03 +02:00
sfan5
1b95998d11 Bump version to 5.7.0 2023-04-08 18:04:52 +02:00
Артём Котлубай
cc29bb473d Translated using Weblate (Russian)
Currently translated at 99.1% (1343 of 1355 strings)
2023-04-08 17:37:31 +02:00
Денис Савченко
bdebacd3a5 Translated using Weblate (Ukrainian)
Currently translated at 54.8% (743 of 1355 strings)
2023-04-08 17:37:31 +02:00
Timofey Bezruchenko
036d08fb70 Translated using Weblate (Russian)
Currently translated at 99.1% (1343 of 1355 strings)
2023-04-08 17:37:31 +02:00
waxtatect
803a57a490 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:31 +02:00
dreigiau
f2433c7b63 Translated using Weblate (Welsh)
Currently translated at 17.4% (237 of 1355 strings)
2023-04-08 17:37:31 +02:00
Walter Bulbazor
f9376ac763 Translated using Weblate (Occitan)
Currently translated at 23.6% (320 of 1355 strings)
2023-04-08 17:37:30 +02:00
109247019824
6885fd4fd0 Translated using Weblate (Bulgarian)
Currently translated at 33.1% (449 of 1355 strings)
2023-04-08 17:37:30 +02:00
Marian
cee1c5d11d Translated using Weblate (Slovak)
Currently translated at 99.3% (1346 of 1355 strings)
2023-04-08 17:37:30 +02:00
Артём Котлубай
22041c5e8a Translated using Weblate (Russian)
Currently translated at 99.0% (1342 of 1355 strings)
2023-04-08 17:37:30 +02:00
Julien Maulny
f0fcc150d0 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
dreigiau
469a2eb4a4 Added translation using Weblate (Welsh) 2023-04-08 17:37:30 +02:00
Rodion Borisov
7ae5c91d62 Translated using Weblate (Russian)
Currently translated at 98.9% (1341 of 1355 strings)
2023-04-08 17:37:30 +02:00
waxtatect
051102cde0 Translated using Weblate (Spanish)
Currently translated at 88.4% (1199 of 1355 strings)
2023-04-08 17:37:30 +02:00
Giov4
76b61f07c9 Translated using Weblate (Italian)
Currently translated at 96.1% (1303 of 1355 strings)
2023-04-08 17:37:30 +02:00
Wuzzy
52956464a5 Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
grreby
046ca78dfa Translated using Weblate (Czech)
Currently translated at 68.1% (924 of 1355 strings)
2023-04-08 17:37:30 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
aa28084604 Translated using Weblate (Malay (Jawi))
Currently translated at 58.2% (789 of 1355 strings)
2023-04-08 17:37:30 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
a3a4640257 Translated using Weblate (Malay)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
BreadW
87b3e9cc5f Translated using Weblate (Japanese)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
Muhammad Rifqi Priyo Susanto
4083fcf93a Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
waxtatect
1036c2a639 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
sfan5
7bfea9b0fe Disable ubuntu-18.04 CI workflows
the base image has been removed by Github, we can see how to fix these later
2023-04-08 17:27:28 +02:00
SmallJoker
ba2fee0751 Particle spawner: Fix missing parameters
The changes done to clientpackethandler.cpp and server.cpp move the
compatibility code into a protocol version check so that older code
parts can easily be removed in the future (e.g. bump of minimal version).
2023-04-08 17:23:17 +02:00
SmallJoker
f8e0778fc9 Particle spawner: Move definitions to source
Long functions were moved to the source file to keep the header
short to speed up compiling. This has no functional change.
2023-04-08 17:23:17 +02:00
SmallJoker
9c9309cdbb
Lua API: Catch serialization error for chat messages (#13337)
Prevents server errors caused by too long chat messages from the Lua API.
2023-04-07 12:49:35 +02:00
SmallJoker
d975ebdcb9
Limit formspec fields to 640K (#13380)
Fixes an issue where long inputs could cause issues when dealing with formspecs.
The expected data is usually below 1 KiB, however that's not a technical limit.
2023-04-07 12:49:23 +02:00
Lars
7048fc25dd Take mesh-bounding-sphere into account in updateDrawListShadow 2023-04-03 13:57:05 -07:00
Lars
b01f85d573 Revert "Add mesh-holding blocks to shadow drawlist. (#13203)"
This reverts commit 2a8becd650.
2023-04-03 13:57:05 -07:00
SmallJoker
1c1f1b1615 Revert "Enable connected glass by default (#13242)"
This reverts commit a93f3542d9 for
the upcoming 5.7.0 release.

See https://github.com/minetest/minetest/issues/8290 for a detailed discussion.
2023-04-02 20:56:31 +02:00
x2048
6c0a6925fc
Corrections to loops and BFS cullers (#13375)
* Reset usage timers in loops culler
* Correctly touch map blocks when using bfs culler
* Align use of variables
* Report statistics when using loop culler
2023-04-01 22:41:00 +02:00
sfan5
819e9fc615 Do not rely on ZSTD_CLEVEL_DEFAULT define 2023-04-01 22:06:03 +02:00
lhofhansl
48fc286a95
Restart map-send cycle if visible blocks are soon to be unloaded. (#13277)
* Restart map-send cycle if visible blocks are soon to be unloaded.
* Reset completion timer when camera or position changed.

Co-authored-by: sfan5 <sfan5@live.de>
2023-03-30 09:19:13 -07:00
x2048
93898957b6
Return 'loops' occlusion culler under a setting (#13352)
* Add occlusion_culler setting to minetest.conf.example
* Add raytraced occlusion culling to 'loops' algorithm

---------

Co-authored-by: sfan5 <sfan5@live.de>
2023-03-30 00:10:23 +02:00
sfan5
bd88d299b9 Bump protocol version
and correct documentation of previous version
2023-03-29 23:19:39 +02:00
sfan5
0a698d92c3 Update credits tab and mailmap 2023-03-29 23:19:11 +02:00
DS
0f496f1ed2
Always build locale files in CMAKE_SOURCE_DIR if building RUN_IN_PLACE (#13272) 2023-03-27 20:02:48 +02:00
DS
ea095d3f69
Fix core.item_eat for same-item replace_with_item and split stacks before dropping (#13286)
The replace_with_item can be added to the slot of the wield item, which
is afterwards overwritten. This causes item loss.
2023-03-27 20:02:23 +02:00
DS
2180dc14ef
Fix safeLoadFile() skipping 2 chars too much from the shebang (#13310) 2023-03-27 20:01:05 +02:00
Muhammad Rifqi Priyo Susanto
baf99f826c
Add Indonesian translation of builtin 2023-03-24 12:35:12 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48)
9c07bf68f1
Add Malay translation of builtin 2023-03-24 12:34:58 +01:00
DS
ed632f3854
Safely handle block deletion (#13315)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2023-03-24 12:34:44 +01:00
x2048
f3b198e490
Return shadow_sky_body_orbit_tilt setting
Used as a default value when the game does not change the value via API (e.g. legacy server)
2023-03-24 12:34:21 +01:00
x2048
9af587c54e
Move rendering engine reset after deletion of game objects 2023-03-20 11:42:16 +01:00
x2048
6cd2eea487
Move drawing of wield tool into a dedicated step of the pipeline (#13338) 2023-03-19 21:31:15 +01:00
Wuzzy
09342c0811
Clarify documentation of inventory actions (#13181)
The text was not clear enough on what these do exactly. It was written in a way that sounded like this allows you to capture ALL inventory changes of the player inventory. However, this is not true: It only captures inventory changes within the player inventory or when the item was exchanged with another inventory.
2023-03-19 20:25:08 +01:00
Wuzzy
0050f12b32
Various smaller lua_api documentation updates (#13240)
This fixes several smaller documentation issues at once because posting one PR for every tiny documentation fix is a nightmare.
2023-03-19 20:24:37 +01:00
luk3yx
5fa63a0b0c
Fix server-side formspec state keeping issue (#13332) 2023-03-19 20:23:11 +01:00
x2048
6fe9bc8ae1
Remove obsolete rendering core init code (#13341)
Also removes duplicate call to shadow render step
2023-03-19 20:22:45 +01:00
Gregor Parzefall
38e005294f
Remove default keybind for pitchmove (#13319) 2023-03-16 14:57:44 +01:00
olive
b1c8a7d055
Fix empty port assertion error in 'Join Game' menu
Pressing "Register" when the port field was empty led to an assertion error inside `create_register_dialog`, it was simply checking the port was a number.
2023-03-16 14:57:20 +01:00
x2048
2bed338ef7
Fix occasional black screen on startup 2023-03-16 14:56:27 +01:00
Jude Melton-Houghton
b7359f5fa9 Update nodes in LBM loop 2023-03-13 18:17:07 +01:00
DS
cac1dca95b
Improvement of #12974: better linear independent vector (#12979) 2023-03-13 18:16:07 +01:00
DS
02346819f9
Fix rendertarget size being saved as screensize (#13313) 2023-03-12 19:56:49 +01:00
lhofhansl
3e148e2810
Fix infinite viewing_range (#13225)
Use a simplified version of the old loops culler for infinite viewing range.
2023-03-12 09:37:47 -07:00
DS
b1ed0ef721
Fix ChatPrompt crash in very narrow windows (#13305)
In very narrow windows, `m_cols` can be small (i.e. 0).
Hence, `m_view <= m_line.size() + 1 - m_cols` does not guarantee
`m_view <= m_line.size()`.
`std::string::substr(pos, npos)` requires `pos <= size()`.
2023-03-11 17:46:49 +01:00
Wuzzy
1aeb0280df Update German translation of builtin 2023-03-11 17:46:09 +01:00
Wuzzy
e73a4ea506 Update builtin locale 2023-03-11 17:46:09 +01:00
x2048
705195b43e
Scale culler steps proportionally to the mesh sizes (#13250) 2023-03-11 14:10:26 +01:00
x2048
1de8a1e962
Fix missing shadows when sun tilt is zero 2023-03-11 13:49:40 +01:00
updatepo.sh
ad41d0af9d Run updatepo.sh 2023-03-09 15:57:12 +01:00
updatepo.sh
c77f3d4dc4 Update minetest.conf.example and translation file 2023-03-09 15:38:46 +01:00
Muhammad Rifqi Priyo Susanto
225659f6e0 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Fábio Rodrigues Ribeiro
ad203b75e1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.4% (1315 of 1350 strings)
2023-03-09 15:31:35 +01:00
ssantos
37f4d6e447 Translated using Weblate (Portuguese)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:35 +01:00
unacceptium core
b12eb5e490 Translated using Weblate (Hungarian)
Currently translated at 97.6% (1318 of 1350 strings)
2023-03-09 15:31:35 +01:00
Guih48
a32bbc8941 Translated using Weblate (Hungarian)
Currently translated at 97.6% (1318 of 1350 strings)
2023-03-09 15:31:35 +01:00
W K
0263069255 Translated using Weblate (Polish)
Currently translated at 87.2% (1178 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jakub Z
8ac5c45da5 Translated using Weblate (Polish)
Currently translated at 87.2% (1178 of 1350 strings)
2023-03-09 15:31:35 +01:00
Giov4
7dd28f0751 Translated using Weblate (Italian)
Currently translated at 93.1% (1258 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jynweythek Vordhosbn
0f50d2d329 Translated using Weblate (Spanish)
Currently translated at 88.2% (1192 of 1350 strings)
2023-03-09 15:31:35 +01:00
Matheus Bastos
306b86ee91 Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.4% (1315 of 1350 strings)
2023-03-09 15:31:35 +01:00
Ghurir
ff22d650ed Translated using Weblate (Arabic)
Currently translated at 38.5% (521 of 1350 strings)
2023-03-09 15:31:35 +01:00
Matheus Vinicius
be5710810b Translated using Weblate (Portuguese)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:35 +01:00
Ghurir
8d691e6633 Translated using Weblate (Dutch)
Currently translated at 90.0% (1216 of 1350 strings)
2023-03-09 15:31:35 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
6f53af2416 Translated using Weblate (Malay (Jawi))
Currently translated at 55.7% (753 of 1350 strings)
2023-03-09 15:31:35 +01:00
gnu-ewm
7e22d472a3 Translated using Weblate (Polish)
Currently translated at 83.3% (1125 of 1350 strings)
2023-03-09 15:31:35 +01:00
Pexauteau Santander
ecb1bd7ac8 Translated using Weblate (Slovak)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jakub Z
78d5c95006 Translated using Weblate (Polish)
Currently translated at 83.3% (1125 of 1350 strings)
2023-03-09 15:31:35 +01:00
ROllerozxa
36c5ea2d5d Translated using Weblate (Swedish)
Currently translated at 66.2% (894 of 1350 strings)
2023-03-09 15:31:35 +01:00
waxtatect
cd0801a4fa Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
fb7bfb62d8 Translated using Weblate (Danish)
Currently translated at 52.8% (713 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
bc2d863492 Translated using Weblate (Danish)
Currently translated at 52.5% (710 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
87d3c773bf Translated using Weblate (Danish)
Currently translated at 52.5% (710 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
22350290c5 Translated using Weblate (Danish)
Currently translated at 51.7% (698 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
9cb12e3565 Translated using Weblate (Danish)
Currently translated at 51.4% (695 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
34097e3a6f Translated using Weblate (Danish)
Currently translated at 50.1% (677 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
cbe35af9c9 Translated using Weblate (Danish)
Currently translated at 50.1% (677 of 1350 strings)
2023-03-09 15:31:35 +01:00
Gao Tiesuan
1ca1ea2ca9 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.5% (1222 of 1350 strings)
2023-03-09 15:31:35 +01:00
AFCMS
bf7478b0a8 Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
BreadW
611f6b0cff Translated using Weblate (Japanese)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Apika Luca
c1d2c0d4ec Translated using Weblate (Spanish)
Currently translated at 86.3% (1166 of 1350 strings)
2023-03-09 15:31:35 +01:00
CouldBeMathijs
1e4b6ba1a3 Translated using Weblate (Dutch)
Currently translated at 89.7% (1212 of 1350 strings)
2023-03-09 15:31:35 +01:00
109247019824
880c2ecb3b Translated using Weblate (Bulgarian)
Currently translated at 32.5% (440 of 1350 strings)
2023-03-09 15:31:34 +01:00
Marian
a5a991576f Translated using Weblate (Slovak)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:34 +01:00
Linerly
b37886375f Translated using Weblate (Indonesian)
Currently translated at 98.1% (1325 of 1350 strings)
2023-03-09 15:31:34 +01:00
waxtatect
7fa9dbccf3 Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
0fbdc58303 Translated using Weblate (Malay)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
Артём Котлубай
15239d1449 Translated using Weblate (Russian)
Currently translated at 99.7% (1347 of 1350 strings)
2023-03-09 15:31:34 +01:00
Wuzzy
6fd412c745 Translated using Weblate (German)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
lhofhansl
1f0d042377
Reduce server CPU consumed by occlusion culling. (#13260)
Cache blocks already occluded at a specific distance. The RemoteClient typically visits the same distance multiple time - especially at larger distances, so this saves significant CPU from recalculating the occlusion state of blocks.
2023-03-05 21:33:41 -08:00
sfan5
9ef3c8ce38 Increase used IrrlichtMt version 2023-03-05 22:00:27 +01:00
Thomas Laubrock
4f06df719d
Kubernetes: Deployments are stable since v1.16
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#deployment-v116
K8s Version v1.16 doesn't allow `extensions/v1beta1` as API version.
2023-03-05 15:10:22 +01:00
ROllerozxa
c91f3f99fd
Minor adjustments now that OpenGLES 2 is the default driver on Android (#12391) 2023-03-05 15:07:40 +01:00
SmallJoker
847ed04e0a Tile: Fix segfault caused by invalid PNG data 2023-03-05 14:41:55 +01:00
Lars
e66e583f5e Remove accidental emacs files. 2023-03-03 17:51:45 -08:00
lhofhansl
dcf6a6a67b
Log server map send cycle time. (#13259)
* Measure server map send time per player.
2023-03-03 17:41:30 -08:00
sfan5
915befecc5 Re-enable verbose logging on Android
Without recompiling, there's no way to see it in logcat otherwise.
2023-03-02 19:57:18 +01:00
sfan5
fee2e3ee27 Fix task ordering and more in Gradle Android build 2023-03-02 19:57:18 +01:00
PrairieWind
a93f3542d9
Enable connected glass by default (#13242) 2023-03-02 19:56:55 +01:00
lynx197
8c7276c9d4
Add git installation steps for Arch/Alpine to README 2023-03-01 09:09:58 +01:00
DS
514bf3582c
Document that item_image_button[] name is non-optional 2023-03-01 09:09:29 +01:00
numzero
d6be6682ec Drop dependency on IrrCompileConfig
The only remaining thing is IRRLICHT_SDK_VERSION via irrlicht.h
2023-03-01 09:06:23 +01:00
rubenwardy
39f4d26177
Add minetest.get_player_window_information() (#12367) 2023-02-27 22:58:41 +00:00
lhofhansl
fbbdae93ee
Fix for #13255: Check if client has a block even if the server has unloaded it. (#13256) 2023-02-27 09:57:03 -08:00
lhofhansl
fe3ea090d1
Don't expire blocks visible to the client. (#13255) 2023-02-26 14:18:18 -08:00
sofar
2083252c05
Sky: transmit body_orbit_tilt to client. (#13193)
This obsoletes the current client-side setting entirely. The server can
transmit the tilt to the client directly and will send 0.0f as default
value.

Co-authored-by: x2048 <codeforsmile@gmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-26 01:08:33 +01:00
DS
6e1c70e02b
Fix a -Wreorder warning 2023-02-22 11:06:48 +01:00
lhofhansl
63c378fb5b
Reduce client's packet processing budget per iteration from 100 to 10ms. (#13237) 2023-02-21 16:33:21 -08:00
x2048
2553db5c81
Fix rounding errors when slicing the shadow draw list (#13226) 2023-02-20 21:01:05 +01:00
Alex
af4009d924
Add chat HUD flag (#13189) 2023-02-20 21:00:37 +01:00
sofar
cf19167e99
Add jpeg and png libraries to the Fedora DNF install hint. (#13191)
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-19 00:52:30 +00:00
paradust7
aa5dc0968b
Fix typo and missing entry in serveropcodes 2023-02-18 16:47:08 +01:00
sfan5
3bafbaac49 Remove dead code behind Irrlicht version checks 2023-02-18 16:46:51 +01:00
Vitra Suchovich
2dafce6206
Say /setpassword is insecure 2023-02-18 00:04:52 +01:00
jordan4ibanez
0e721f7571
lua_api.txt: Explain what a float range is 2023-02-18 00:03:50 +01:00
Muhammad Rifqi Priyo Susanto
c1e430ef68
Android: Increase minimum SDK version to 21
Target/compiled SDK version is increased to 33.
Build Tools, NDK, and Gradle are also updated.
2023-02-18 00:03:28 +01:00
20kdc
75e6cc190a
Source image tracking in tile generation (#12514) 2023-02-18 00:03:03 +01:00
lhofhansl
2a8becd650
Add mesh-holding blocks to shadow drawlist. (#13203)
When mesh chunking and shadows are enabled, make sure that the mesh-holding blocks are added to the shadow drawlist.
Otherwise those portions of the shadows will not be rendered.
2023-02-16 15:43:08 -10:00
x2048
4cd6b773bb
Fix no color values on bloom texture (#13197)
Align meaning of 'exposure' variable across different stages
Put 'exposure' variable behind ENABLE_AUTO_EXPOSURE
2023-02-10 21:04:37 +01:00
lhofhansl
d3a6ee00e6
Generalize mesh chunking, and make it configurable. (#13179)
* Generalize mesh chunking. Set 3x3x3 chunks.

* Make mesh chunk size configurable... Default to 1 (off).

* Extract all mesh grid maths into a dedicated class

---------

Co-authored-by: x2048 <codeforsmile@gmail.com>
2023-02-08 13:42:12 -08:00
lhofhansl
56d2567b5d
Separate drawlist from non-rendered blocks. (#13176) 2023-02-01 08:41:23 -08:00
kab0u
8bbb673c0b
Improve the documentation for chat command definition in lua_api.txt (#13168) 2023-01-31 17:31:48 +01:00
x2048
69fc206109
8x block meshes (#13133)
Reduce the number of drawcalls by generating a mesh per 8 blocks (2x2x2). Only blocks with even coordinates (lowest bit set to 0) will get a mesh.

Note: This also removes the old 'loops' algorithm for building the draw list, because it produces visual artifacts and cannot be made compatible with the approach of having a mesh for every 8th block without hurting performance.

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
Co-authored-by: Lars <larsh@apache.org>
Co-authored-by: sfan5 <sfan5@live.de>
2023-01-31 17:30:59 +01:00
lhofhansl
cded6a3945
Display whole profiler numbers up to 999999 without scientific notation. (#13155) 2023-01-24 17:40:23 -08:00
x2048
b8aaad4f1e
Remove the 'loops' occlusion culler (#13169) 2023-01-23 10:58:29 +01:00
DS
8478796226
Decrease minimum for repeat_place_time (#13165) 2023-01-23 00:20:12 +01:00
sfan5
87d509e462
Implement --debugger option to improve UX when debugging crashes (#13157) 2023-01-23 00:19:30 +01:00
x2048
6f5703baf1
Clear exposure compensation state textures on creation (#13151) 2023-01-23 00:18:48 +01:00
veprogames
cf5add1472
Use default values from cpp_api/s_env.cpp for register_abm in lua_api.txt (#13163) 2023-01-21 09:43:20 +01:00
maxchen32
47c8b5d57a
Fix a README mistake on option SPATIAL_LIBRARY (#13162) 2023-01-21 09:42:55 +01:00
x2048
ca13c51024
Fix concurrency in texture source (#13150) 2023-01-19 21:44:27 +01:00
Wuzzy
e21d5613a6
Change DevTest header (font = "undefined medium") (#13147)
Font downloaded from https://undefined-medium.com/
2023-01-16 20:16:45 +01:00
SmallJoker
ecd6d61697
Revisit F6 statistics formatting (#13126) 2023-01-16 20:16:23 +01:00
Muhammad Rifqi Priyo Susanto
a2a280691c
Fix Enter key after creating a new world (#12997)
Prevents Enter key or "double-click" event to play the world just after creating a new world
2023-01-16 20:16:08 +01:00
Jude Melton-Houghton
2f9f0c0900
Improve chat history (#12975) 2023-01-14 16:14:37 -05:00
sfan5
8fded9d990
Disable Prometheus in singleplayer mode 2023-01-14 13:11:15 +01:00
Jude Melton-Houghton
3992a13f24
Improve MetaDataRef:{get,set}_float precision (#13130) 2023-01-12 15:40:34 -05:00
Jude Melton-Houghton
5f2925c59c
Increase ftos precision (#13141) 2023-01-12 14:12:31 -05:00
Jude Melton-Houghton
956026bb6b
Break long lines of option help (#13136) 2023-01-12 14:12:05 -05:00
Jude Melton-Houghton
ab1fe80150
Error when string.split is given empty separator (#13132) 2023-01-10 09:25:48 -05:00
Wuzzy
a3177b89d8
DevTest: chest_of_everything mod: Add search, bag, improve formspec (#13064) 2023-01-09 21:40:41 +01:00
x2048
139db66901
Remove mapblock cache for mesh generation. (#13124)
Reduces memory consumption and improves performance
2023-01-09 21:40:08 +01:00
Jude Melton-Houghton
d69cb4fb5d
Always set globals in __newindex (#13131) 2023-01-09 15:00:49 -05:00
ROllerozxa
d0b6f217ae
Add option to exclude Development Test from release packages (#13081)
* `INSTALL_DEVTEST` is the option name
2023-01-09 20:34:13 +01:00
ROllerozxa
390b5caaaa
Fix crash on Android with IrrlichtMt9 (#13123)
Caused by mouse control
2023-01-08 14:04:17 +01:00
iliekprogrammar
fb28ca463e
Clamp player wieldindex when processing hotbar item selection (#13098) 2023-01-08 14:03:16 +01:00
lhofhansl
55804c56e9
Report collisionMoveSimple for client and server. (#13105) 2023-01-07 16:31:31 -08:00
David Leal
d82d18bfb1
Replace minetest_game with "Minetest Game" where appropriate 2023-01-07 12:58:16 +01:00
Desour
d603619ad3 Devtest: Add jukebox 2023-01-06 22:38:35 +01:00
Desour
4685849f89 Devtest: Rename soundstuff init.lua 2023-01-06 22:38:35 +01:00
Desour
07624125ef Devtest: Add branding iron
Allows giving names to objects.
2023-01-06 22:38:35 +01:00
ROllerozxa
bb74da5903
Remove old rollback migration code (#13082) 2023-01-06 22:35:20 +01:00
x2048
6d45c243f8
Add dynamic exposure correction (#12959)
* Add uniform for frame delta time
* Adjust exposure in logarithmic (EV) space
* Add network support and LUA API
* Add testing mod
2023-01-06 22:33:25 +01:00
x2048
2715cc8bf6
Occlusion culling algorithm based on recursive descend (#13104)
Co-authored-by: DS <vorunbekannt75@web.de>
2023-01-06 22:31:06 +01:00
sfan5
059f62d7d6 Use consistent optimization flags for *BSD
This was added for seemingly no reason in c410e9182d (2014)
2023-01-05 23:09:51 +01:00
Awkanimus
0dbb20fd63
Document mod storage psql settings in world_format.txt 2023-01-05 21:59:08 +01:00
sfan5
6377ce921d Bump used IrrlichtMt version 2022-12-31 12:48:53 +01:00
x2048
89e7f72c92
Use multiple threads for mesh generation (#13062)
Co-authored-by: sfan5 <sfan5@live.de>
2022-12-27 18:44:18 +01:00
SmallJoker
03e710160f
Lua API: Document shader dependencies of set_lighting() (#13079) 2022-12-26 21:59:55 +01:00
lhofhansl
1e7804aaf6
Allow saturation to be controlled by the server. (#13075) 2022-12-25 16:15:32 -08:00
ROllerozxa
afd5caa26a
Fully remove pageflip 3D mode (#13074) 2022-12-25 10:57:39 -05:00
ROllerozxa
7f01471141
Fix join game tab being slightly shorter than the others (#13073) 2022-12-25 10:57:21 -05:00
Jean-Patrick Guerrero
33363c2a7e
Fix progress bar look on HiDPI displays (#13055) 2022-12-24 12:26:56 -05:00
Jude Melton-Houghton
d13b12b791
Store MapEditEvent blocks in a vector (#13071) 2022-12-24 12:21:59 -05:00
Jude Melton-Houghton
5c248c2d7d Add callback on_mapblocks_changed 2022-12-24 08:24:59 -05:00
Jude Melton-Houghton
7701e70dc9 Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
2022-12-24 08:24:59 -05:00
ndren
62ee02b8ba
Set and unset relative mouse mode where necessary (#12636)
* Set and unset relative mouse mode where necessary

Co-authored-by: sfan5 <sfan5@live.de>
2022-12-24 09:38:30 +01:00
Gregor Parzefall
475f85fc91
Document the gain of auto-selected dig sounds 2022-12-21 13:29:43 +01:00
Jude Melton-Houghton
0fc97a1483
Use a Lua error handler that calls tostring (#11913) 2022-12-15 07:37:49 -05:00
Jude Melton-Houghton
1f3b5e553b
Fix plantlike_rooted world-aligned node base textures (#12994)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
2022-12-12 08:45:09 -05:00
updatepo.sh
981d79157a Update translation files 2022-12-10 15:38:30 +01:00
updatepo.sh
111d047b0a Update minetest.conf.example 2022-12-10 15:35:46 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
024c99fc47 Translated using Weblate (Malay)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Артём Котлубай
219904dc54 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Emmily
0bff85f7b0 Translated using Weblate (Esperanto)
Currently translated at 88.2% (1290 of 1462 strings)
2022-12-10 15:30:43 +01:00
runs
b30e0681a0 Translated using Weblate (Galician)
Currently translated at 97.2% (1422 of 1462 strings)
2022-12-10 15:30:43 +01:00
Mikitko
8cba08d423 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
waxtatect
6ae870b27d Translated using Weblate (Spanish)
Currently translated at 88.6% (1296 of 1462 strings)
2022-12-10 15:30:43 +01:00
Muhammad Rifqi Priyo Susanto
f004432ec2 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Nicolae Crefelean
5cfe76bb60 Translated using Weblate (Romanian)
Currently translated at 46.5% (680 of 1462 strings)
2022-12-10 15:30:43 +01:00
LL Productions FR
866fbf9149 Translated using Weblate (Esperanto)
Currently translated at 87.8% (1285 of 1462 strings)
2022-12-10 15:30:43 +01:00
Tianshu Feng
8660f90868 Translated using Weblate (Chinese (Simplified))
Currently translated at 93.7% (1371 of 1462 strings)
2022-12-10 15:30:43 +01:00
Nyuh Nyash
569c83a8e7 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
runs
4a1ca5e16c Translated using Weblate (Spanish)
Currently translated at 88.5% (1295 of 1462 strings)
2022-12-10 15:30:43 +01:00
Темак
49183e3555 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Kisjuhász Attila
1fb1a9e211 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Wuzzy
f858bb9a75 Translated using Weblate (German)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Alex B
fbe97a1b08 Translated using Weblate (Italian)
Currently translated at 96.2% (1407 of 1462 strings)
2022-12-10 15:30:43 +01:00
Gao Tiesuan
d1055aa8d8 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.5% (1339 of 1462 strings)
2022-12-10 15:30:43 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
1dde03dfec Translated using Weblate (Malay (Jawi))
Currently translated at 61.1% (894 of 1462 strings)
2022-12-10 15:30:43 +01:00
Abdou-31
5240febeef Translated using Weblate (Arabic)
Currently translated at 38.6% (565 of 1462 strings)
2022-12-10 15:30:43 +01:00
109247019824
c6aea54497 Translated using Weblate (Bulgarian)
Currently translated at 29.5% (432 of 1462 strings)
2022-12-10 15:30:43 +01:00
tryvseu
15aac97790 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 37.4% (547 of 1462 strings)
2022-12-10 15:30:43 +01:00
Bright Geyser
68493bd14a Translated using Weblate (Lithuanian)
Currently translated at 15.5% (228 of 1462 strings)
2022-12-10 15:30:43 +01:00
Ács Zoltán
41960c0019 Translated using Weblate (Hungarian)
Currently translated at 98.7% (1443 of 1462 strings)
2022-12-10 15:30:43 +01:00
Ritwik
eb6c88f8c0 Translated using Weblate (Hindi)
Currently translated at 29.7% (435 of 1462 strings)
2022-12-10 15:30:43 +01:00
Hraponssi
928b6d659c Translated using Weblate (Finnish)
Currently translated at 23.4% (343 of 1462 strings)
2022-12-10 15:30:43 +01:00
Jiri Grönroos
058bf1e6ec Translated using Weblate (Finnish)
Currently translated at 23.4% (343 of 1462 strings)
2022-12-10 15:30:43 +01:00
daudiffa
7e793438a3 Translated using Weblate (Indonesian)
Currently translated at 98.2% (1437 of 1462 strings)
2022-12-10 15:30:43 +01:00
Văn Chí
c476bc3772 Translated using Weblate (Vietnamese)
Currently translated at 42.2% (618 of 1462 strings)
2022-12-10 15:30:43 +01:00
Davide Giuliano
5a9982b7e0 Translated using Weblate (Italian)
Currently translated at 96.3% (1408 of 1462 strings)
2022-12-10 15:30:43 +01:00
Yic95
08279a7565 Translated using Weblate (Chinese (Traditional))
Currently translated at 75.5% (1104 of 1462 strings)
2022-12-10 15:30:43 +01:00
Simone Starace
baac5459c4 Translated using Weblate (Italian)
Currently translated at 95.2% (1393 of 1462 strings)
2022-12-10 15:30:43 +01:00
Pietro Cappuccino
4f77005614 Translated using Weblate (Italian)
Currently translated at 95.2% (1393 of 1462 strings)
2022-12-10 15:30:42 +01:00
Muhammad Rifqi Priyo Susanto
ee2d3bc293 Translated using Weblate (Indonesian)
Currently translated at 98.2% (1436 of 1462 strings)
2022-12-10 15:30:42 +01:00
ahdplayer
8797c5bea4 Translated using Weblate (Turkish)
Currently translated at 92.4% (1351 of 1462 strings)
2022-12-10 15:30:42 +01:00
Ian giestas pauli
9d6a2bda24 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Giov4
1cdd690630 Translated using Weblate (Italian)
Currently translated at 93.6% (1369 of 1462 strings)
2022-12-10 15:30:42 +01:00
Batkhuyag Bavuudorj
692163275d Translated using Weblate (Mongolian)
Currently translated at 2.3% (35 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
042c7490ed Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Kauã Maia
c1aed7b4d3 Translated using Weblate (Portuguese)
Currently translated at 98.4% (1439 of 1462 strings)
2022-12-10 15:30:42 +01:00
marcin
bebf1d1f3e Translated using Weblate (Polish)
Currently translated at 80.6% (1179 of 1462 strings)
2022-12-10 15:30:42 +01:00
Adam Jagoda
db7151be53 Translated using Weblate (Polish)
Currently translated at 80.6% (1179 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
e160505595 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
9bfbe80d06 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
4159b2860f Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
c86adf87ae Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Batkhuyag Bavuudorj
fb738ae85a Added translation using Weblate (Mongolian) 2022-12-10 15:30:42 +01:00
Walter Bulbazor
0aae94ba7e Translated using Weblate (Occitan)
Currently translated at 14.3% (210 of 1462 strings)
2022-12-10 15:30:42 +01:00
Conight
73c8e1f03a Translated using Weblate (Chinese (Simplified))
Currently translated at 91.4% (1337 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
3cd99d8e6d Translated using Weblate (Russian)
Currently translated at 96.1% (1405 of 1462 strings)
2022-12-10 15:30:42 +01:00
Hugo Carvalho
3e6098f5c6 Translated using Weblate (Portuguese)
Currently translated at 97.7% (1429 of 1462 strings)
2022-12-10 15:30:42 +01:00
Artur Adamczyk
56fc164fdd Translated using Weblate (Polish)
Currently translated at 77.5% (1134 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrés Morgensen
8f881b04f4 Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
Valentino
80c9c66e16 Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
waxtatect
5d68026c2d Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
waxtatect
ed8dce4e72 Translated using Weblate (French)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Adam Jagoda
af8151d827 Translated using Weblate (Polish)
Currently translated at 76.2% (1115 of 1462 strings)
2022-12-10 15:30:42 +01:00
Jude Melton-Houghton
c18c082059
Prevent air acceleration with 0 jump speed (#13036) 2022-12-10 09:08:50 -05:00
Jude Melton-Houghton
1798ad0ec4
Avoid out-of-bounds memory access in attached node placement prediction (#13038) 2022-12-10 09:00:27 -05:00
sfan5
504e43e0da
Remove Irrlicht documentation URL from key settings (#13010) 2022-12-04 12:35:28 +01:00
sfan5
37386b9c3c
Expose dtime_s to LBM handler 2022-12-04 12:35:14 +01:00
Tamara Schmitz
aa3505a9e4
Add missing optional dependencies to Container Image (#12914) 2022-12-04 12:35:03 +01:00
Jude Melton-Houghton
b85831e389
Fix startup after removing last game (#13015) 2022-12-03 11:35:38 -05:00
Jude Melton-Houghton
291c42ed57
Let mods choose a forceload limit (#13002) 2022-12-03 10:41:45 -05:00
Jude Melton-Houghton
f80ea73bfb
Let mods choose a forceload limit (#13002) 2022-12-03 10:41:34 -05:00
Jude Melton-Houghton
b3ffc4b327
Add minetest.get_mapgen_edges (#12999) 2022-12-03 10:40:46 -05:00
lhofhansl
e84d259ec7
Remove shader caching hack. (#12991) 2022-11-30 13:56:14 -08:00
Muhammad Rifqi Priyo Susanto
281f9a9f88
Android: Segmentation fault fix, PendingIntent flag, and other fixes (#12960)
* Android: Segmentation fault fix, PendingIntent flag, and other fixes

- Information about the crosshair is sent after camera initialization.
- Since API 31, PendingIntent requires mutability flag.
- super (class) is called in onRequestPermissionsResult().
- GameActivity suppresses "unused" warning since most of its methods are called from native code.
- Non-null safety is added for nullable function calls.
- Warning/error logging is added for various function calls' return value.

* Move utility functions into Utils.java

- Some nullable functions are changed to be non-null functions.
- Some null checking outside it is removed.
- More annotations are added to functions and parameters.
2022-11-30 10:50:06 -05:00
Jude Melton-Houghton
055fc69c11
Handle num lock in chat (#12984) 2022-11-30 10:43:12 -05:00
Jude Melton-Houghton
3ff8adf599
Avoid resetting music when dialog opens (#13003) 2022-11-30 10:42:30 -05:00
Jude Melton-Houghton
da4a4086cf
Fix /help privs checks (#13008) 2022-11-29 18:25:47 -05:00
Jude Melton-Houghton
aac1635bf7
Have minetest.debug call tostring (#13004) 2022-11-29 07:12:08 -05:00
Jude Melton-Houghton
38169db765
Wrap debug text on screen (#12978) 2022-11-28 12:17:36 -05:00
Jude Melton-Houghton
d0a118f5b1
Add minetest.get_game_info and allow reading game.conf (#12989)
Co-authored-by: sfan5 <sfan5@live.de>
2022-11-28 07:21:43 -05:00
Jude Melton-Houghton
3fd5bff128
Abort active ABM iteration when content changes (#12998) 2022-11-27 15:55:10 -05:00
Muhammad Rifqi Priyo Susanto
40a45b8c99
Virtual joystick: Use s32 when using m_screensize as a subtrahend (#12814)
If still uses u32, m_screensize will yield a big value (underflow) when used as a subtrahend.
ETIE_MOVED is allowed to be run if joystick's ID is available and virtual joystick is fixed.
Add .0f for some float values.
2022-11-26 09:16:14 -05:00
savilli
f04d4d0291 Fix touchscreen crash due to missing rangeselect 2022-11-25 19:57:03 +01:00
Jude Melton-Houghton
8b26bab37d Remove unnecessary bool return types 2022-11-24 17:58:25 -05:00
Jude Melton-Houghton
7c21347a40 Rename "mod metadata" to "mod storage" everywhere 2022-11-24 17:58:25 -05:00
Jude Melton-Houghton
8817af07fb
Deprecate special handling of ${key} syntax in metadata values (#12970) 2022-11-24 17:56:43 -05:00
Wuzzy
3c7f26d937
Add support for attached facedir/4dir nodes (#11432) 2022-11-24 17:56:07 -05:00
x2048
1c10988d6a
Fix entity visiblity in bright artificial light (#12906) 2022-11-23 22:40:26 +01:00
Jude Melton-Houghton
9527cc3fa0
avoid clearChildAttachments iterator invalidation (#12987) 2022-11-23 14:48:12 -05:00
Jude Melton-Houghton
386bfcda2b
Fix reading schematics after their resolution (#12985) 2022-11-23 11:53:21 -05:00
Jude Melton-Houghton
4da8a18c8c
Check specific outputs for isatty (#12980) 2022-11-21 12:08:40 -05:00
x2048
70a82b0784
Avoid shadow flicker at certain angles (#12961)
Change the way look direction and camera position are quantized when calculating light frustum
2022-11-20 21:28:01 +01:00
DS
5f24a3c0c7
Object selection: Improve distance checks (#12974) 2022-11-20 21:27:47 +01:00
Jude Melton-Houghton
475005012a
Improve ABM and LBM registration error handling (#12969) 2022-11-20 21:26:54 +01:00
lhofhansl
7bf64fc61a
Add configurable saturation (#12865)
* Add configurable saturation

Co-authored-by: Pevernow <3450354617@qq.com>
Co-authored-by: x2048 <codeforsmile@gmail.com>

Author:    Lars <larsh@apache.org>
2022-11-18 11:49:52 -08:00
Abdou-31
dac05a500e
Fix menu_lua_api.txt formatting (#12971) 2022-11-18 11:45:16 -05:00
Jude Melton-Houghton
b89eb605b7
Warn about potential infinite loop in on_construct (#12967)
Co-authored-by: sfan5 <sfan5@live.de>
2022-11-16 13:11:36 -05:00
StrajnarFilip
6b6cd42ce4
Added copy of LGPL-2.1 (#12950) 2022-11-16 13:09:53 -05:00
Riceball LEE
6bf662cb9e
set_nametag_attributes: don't reset nametags if text param is not touched
fixes #12901
2022-11-15 16:46:26 +01:00
SmallJoker
8de9e2ac84
game.conf: Add setting to use volatile a map backend (#12956) 2022-11-15 16:45:48 +01:00
Jude Melton-Houghton
cd8a7fe472
Add MetaDataRef:get_keys (#12841) 2022-11-15 16:45:12 +01:00
lhofhansl
1a045da0dd
Reduce active mgmt interval for a bit when a player joins. (#12925) 2022-11-10 15:25:38 -08:00
Jude Melton-Houghton
00eb65915f Add PostgreSQL helper pg_to_string 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
f8c781b46c Test PostgreSQL in CI 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
aaa05f901a Add mod storage PostgreSQL backend 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
9dbac989bd Improve testListMods 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
408af9d17d Test metadata value changing 2022-11-10 18:56:48 +01:00
Gregor Parzefall
88b04eadc9
Fix get_tool_wear_after_use for one use (insta-break) (#12945) 2022-11-09 11:58:53 -05:00
olive
042f7917e7
Flip player_back.png (#12940) 2022-11-09 11:58:21 -05:00
x2048
81bfc9c7a2
Resize hotbar immediately before drawing (#12930) 2022-11-09 11:57:55 -05:00
Abdou-31
d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Tamara Schmitz
6191bafcad
Dockerfile: refactoring and addition of entrypoint (#12939)
Previously source files were copied first, then build dependencies were
installed, then libraries cloned and built.
This was reordered to be:
1. install dependencies
2. clone and build libraries
3. Pull in minetest source and minetest_game
4. Build minetest

In addition the peristent volumes are now declared.
Also an entrypoint added making it possible to append command line
parameters.
2022-11-08 16:34:58 +01:00
Loïc Blot
322c8cf270
Reduce exposure of various internals (#12885)
* refactoring(StaticObjectList): don't expose m_active and m_stored anymore

This prevents our old crap code where anyone can access to StaticObjectList. use proper modifiers. It also permits to do a short cleanup on MapBlock using a helper

* refactoring(MapBlock): reduce a bit exposed m_active_blocks variable

* refactoring: MapBlock::m_node_timers is now private

We already had various helpers to perform this privatization, just use it. Also factorize the MapBlock stepping code for timers using already existing code and importing them from ServerEnvironment to MapBlock.

It's currently done pretty straight forward without any inheritance as MapBlock is just used everywhere, maybe in a future we'll have ServerMapBlock over MapBlock. Currently for a simple function let's just use proper objects and add a comment warning

* refactoring(Server): fix duplicated function for add/remove node

* refactoring(guiFormSpecMenu): add removeAll function to prevent duplicated code

* refactoring(ShadowRenderer) + perf: code quality  + increase performance

* All callers are already using the point and we should never test a function with nullptr node, it's a bug. Removed workaround which was hacky and fix the bug
* Drop clientmap lookup from shadowrendered, just use directly its
  pointer and forbid to push it in the generic list
* Reduce memory pressure on the renderShadowObject by preventing
  deallocating and reallocating multiple vectors on each node

* refactoring(MapBlock): reduce exposure of MapBlock::m_static_objects

It's not complete as some parts of the code are pretty nested, but it's better than before :)

* fix: better working on new functions & drop unwanted 2 lines

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-11-03 17:35:31 +01:00
x2048
957a3e52fe Return correct variable when debugging bloom.
Fixes #12922
2022-11-03 08:43:31 +01:00
x2048
9b24041394
Improve bloom effect (#12916)
* Remove the built-in exposure factor of 2.5
* Add physics-based bloom (https://learnopengl.com/Guest-Articles/2022/Phys.-Based-Bloom)
* Add luminance scaling for bloom layer to simulate HDR
* Add setting to control bloom strength
2022-11-02 09:09:48 +01:00
Muhammad Rifqi Priyo Susanto
fb3085a2c5
Android: Increase target/compiled SDK version to 32 (#12911)
Build Tools, NDK, and Gradle are also updated.
Repositories is changed from jcenter() to mavenCentral().
2022-10-31 14:19:30 +01:00
Muhammad Rifqi Priyo Susanto
987277de52
Send crosshair setting after the touch screen GUI has been initialized (#12910) 2022-10-31 14:17:50 +01:00
Lars Mueller
88af36dd10 Fix node placement regression 2022-10-31 14:17:28 +01:00
x2048
260de1c2b5
Enable negative values for sun/moon orbit tilt (Northern hemisphere) (#12904) 2022-10-30 16:54:06 +01:00
x2048
485b3b1203 Add comments explaining use of entity glow 2022-10-30 16:53:45 +01:00
x2048
bf1cc1bb84 Apply entity glow before translating to color space 2022-10-30 16:53:45 +01:00
x2048
3e7ee499d6 Always add increment when getting node interior light 2022-10-30 16:53:45 +01:00
x2048
a075d83752 Use the same light level for non-solid draw types as for solid 2022-10-30 16:53:45 +01:00
DS
fcd670e6f7
Add a worlds_here.txt file in the worlds folder and update .gitignore (#12720) 2022-10-30 16:53:31 +01:00
Lars Müller
077627181e
Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
lhofhansl
b829231992
Fix incorrect culling introduced by ##12710 (#12887) 2022-10-28 09:52:54 -07:00
lhofhansl
9aaed75eea
Safety check the map's blocksize (#12895) 2022-10-27 19:31:42 -07:00
x2048
88820cd31c
Shadow list improvements (#12898)
* Remove redundant checks when attaching SM texture to entities.
  Some of the checks were broken, leading to crashes when shadow intensity is set to 0
* Avoid memory leak in shadow casters list when wield mesh changes item stacks
2022-10-26 22:26:09 +02:00
Jean-Patrick Guerrero
16266397ed
GUIInventoryList: Keep item size while moving (#12896) 2022-10-24 13:58:56 +02:00
Wuzzy
02c293ec63
Fix some outdated stuff about falling node docs 2022-10-23 21:59:24 +02:00
Jude Melton-Houghton
e86d23daed
Check sizeof(int) and sizeof(size_t) 2022-10-23 21:59:12 +02:00
Wuzzy
0a82cb4072 DevTest: Colorize 2 nodebox nodes 2022-10-23 21:58:56 +02:00
Wuzzy
7a8ac00f9c DevTest: Cleanup callback logging 2022-10-23 21:58:56 +02:00
Wuzzy
9e186a42bd DevTest: Fix rendering of 2 texture test nodes 2022-10-23 21:58:56 +02:00
Wuzzy
c73d79841c DevTest: More node textures to tell them apart 2022-10-23 21:58:56 +02:00
Wuzzy
11d1a9cc37 DevTest: Use 4dir for chests 2022-10-23 21:58:56 +02:00
Wuzzy
9f11753930 DevTest: Restore callback item descriptions 2022-10-23 21:58:56 +02:00
Wuzzy
fd1930142e DevTest: Fix callback item textures 2022-10-23 21:58:56 +02:00
Wuzzy
a852ebe993 Remove credits for 2 images no longer in use 2022-10-23 21:58:56 +02:00
Wuzzy
0152d39215 DevTest: Refactor testhud features 2022-10-23 21:58:56 +02:00
Wuzzy
c761aa268d DevTest: Move 2 HUD commands to testhud & improve 2022-10-23 21:58:56 +02:00
Wuzzy
72b83acadc DevTest: No use privatizer on chest of everything 2022-10-23 21:58:56 +02:00
Wuzzy
998e50725c DevTest: Remove experimental mod 2022-10-23 21:58:56 +02:00
Wuzzy
a23701b5e6 DevTest: Move detached inv tests to chest mod 2022-10-23 21:58:56 +02:00
Wuzzy
c1e732448c DevTest: /test_place_node skips dummy/cb nodes 2022-10-23 21:58:56 +02:00
Wuzzy
23ef0d0916 DevTest: Clean up callback textures 2022-10-23 21:58:56 +02:00
Wuzzy
2da92ed81e DevTest: Move callback entities to callbacks mod 2022-10-23 21:58:56 +02:00
Wuzzy
cb7b96fc90 DevTest: Move callback items to callbacks mod 2022-10-23 21:58:56 +02:00
Wuzzy
68df0fb2ea DevTest: Move experimental items to other mods 2022-10-23 21:58:56 +02:00
Wuzzy
3a7fffc587 DevTest: Move more logging to log mod 2022-10-23 21:58:56 +02:00
Wuzzy
48530ccbc0 DevTest: Move benchmark commands to new mod 2022-10-23 21:58:56 +02:00
Wuzzy
6b9984b7e7 DevTest: Move /test_place_nodes to testnodes mod 2022-10-23 21:58:56 +02:00
Wuzzy
97a80b4816 DevTest: Move chat command logging to separate mod 2022-10-23 21:58:56 +02:00
Jude Melton-Houghton
8f1593e4e8
Add VoxelArea() constructor (#12886) 2022-10-22 08:05:45 -04:00
Abdou-31
7e11b8eb72
Fix typos and en_US/en_GB inconsistency in files inside doc directory (#12882) 2022-10-21 17:12:39 +02:00
Jude Melton-Houghton
c78d565e01 Fix use of unassigned global "check" 2022-10-21 17:12:21 +02:00
Riceball LEE
8bdedd2bcf
guiChatConsole: fix the unicode characters crowded together on prompt (#12867)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-10-21 17:12:07 +02:00
DS
7153cb8a0b
Fix formspec focus (#12795) 2022-10-21 17:11:41 +02:00
sfan5
9f0d88407d
Revise bump_version.sh script to address shortcomings (#12789) 2022-10-21 17:09:44 +02:00
Jude Melton-Houghton
dafdb3edb4
Check for falling float nodes in liquid transform (#12862) 2022-10-18 18:03:05 -04:00
Jude Melton-Houghton
b38ffdec27
Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-18 18:01:44 -04:00
sfan5
23e9f5db43 Fix list sorting behaviour with missing geoip 2022-10-17 20:16:39 +02:00
Abdou-31
862419c76f Fix en_US/en_GB inconsistency in lua_api.txt 2022-10-17 07:56:52 -04:00
Abdou-31
4586f3342f Fix typos in lua_api.txt 2022-10-17 07:56:52 -04:00
sfan5
87051fca26
Take geographic distance into account for server list ordering (#12790) 2022-10-17 07:56:28 -04:00
SmallJoker
5d8a4917c5
LocalPlayer: Fix sneaking on nodes with large collisionboxes (#12626) 2022-10-17 07:56:04 -04:00
sfan5
25c5400250 Exclude MSVC from new Lua sanity check 2022-10-15 12:02:02 +02:00
sfan5
f680d10259 Other minor CMake improvements 2022-10-13 23:02:11 +02:00
sfan5
e8ee4cb40d Defer searching for libintl to CMake
resolves #12800
2022-10-13 23:02:11 +02:00
sfan5
af38bae57f Get rid of LuaJIT linking workarounds
...and replace them with a cautionary warning message if someone uses an old version.
The detection is kind of a hack but no choice as upstream is not interested in version numbering.
2022-10-13 23:02:11 +02:00
sfan5
558cbd89fb Add extra check in case someone tries to unbundle Lua 2022-10-13 23:02:11 +02:00
Jude Melton-Houghton
cb725a4555 Speed up find_nodes_in_area (#12845) 2022-10-13 09:35:19 -04:00
fluxionary
6b6f886bcd
object ids are u16, not s16 (#12848) 2022-10-13 08:46:48 -04:00
Jude Melton-Houghton
f7ae70c3d9 Use enum to define custom registry indices 2022-10-13 08:46:16 -04:00
Jude Melton-Houghton
f073e37d2f Test on-lighting node param1 in lighting test 2022-10-13 08:46:16 -04:00
Jude Melton-Houghton
b3503e7853 Embed data directly in mapblocks 2022-10-09 13:43:48 -04:00
Jude Melton-Houghton
8f996e4a7c Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
sfan5
7a28f2c4fa Fix tone mapping being always enabled
broke in 579fc93c24
2022-10-09 19:11:04 +02:00
Jude Melton-Houghton
9676364c1f
Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
fluxionary
440d966b93
add an 'equals' method to ItemStack and compatibility w/ lua '==' (#12771)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-09 08:06:09 -04:00
Wuzzy
b2a3f53b29
Improve documentation for liquid_alternative_* (#12810) 2022-10-09 08:05:40 -04:00
Wuzzy
c1c68775b2
DevTest: Explain purpose of most items in tooltips (#12833) 2022-10-09 08:05:22 -04:00
Wuzzy
804a318189
DevTest: Change texture for node-aligned node (#12831) 2022-10-06 17:25:40 +01:00
ROllerozxa
be5c675263
Only set quicktune keybinds in debug builds (#12779) 2022-10-06 17:07:57 +01:00
x2048
1e96403954 Use legacy call when rendering to a single texture
Fixes depth buffer in when undersampling > 1
2022-10-04 21:02:42 +02:00
x2048
579fc93c24
Make bloom shaders compatible with GLES2 (#12834)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2022-10-04 13:52:56 +01:00
Jude Melton-Houghton
7632af3c73
Consolidate API object code (#12728)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
Jude Melton-Houghton
b21fb18379
Disable -ffinite-math-only (#12832) 2022-10-03 12:13:35 -04:00
Wuzzy
b10d6542db
DevTest: Reject buggy "/hp inf" command (#12830) 2022-10-03 12:13:23 -04:00
DS
22cbc05808
Add an item pick up callback (2) (#7712)
Co-authored-by: SmallJoker <mk939@ymail.com>
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-10-01 15:21:06 -04:00
Wuzzy
977f656e09
Improve crafting recipe documentation (#12806) 2022-10-01 15:20:28 -04:00
sfan5
525fc3833c Implement tool use sounds 2022-09-30 14:02:14 +02:00
sfan5
bbdb1929c6 Clean up Game::handleDigging() and some related parts 2022-09-30 14:02:14 +02:00
Muhammad Rifqi Priyo Susanto
13a8948edd
Improve double tap for jump detection (#12793) 2022-09-30 14:02:06 +02:00
Jude Melton-Houghton
e832cee1e6
Avert collision static detection rounding error (#12822) 2022-09-30 06:31:24 -04:00
Wuzzy
6eb7d57ed3
Fix inconsistent craft replacements (#9250) (#12819) 2022-09-30 06:30:39 -04:00
Wuzzy
5e7ea0664a
Fix error msg if craft replacement w/ full inv (#12820) 2022-09-29 20:34:51 +02:00
x2048
9df79a4b2d
Bloom (#12791)
Adds configurable light exposure control and bloom effect (light bleeding) with client-side settings.
2022-09-29 20:34:05 +02:00
Muhammad Rifqi Priyo Susanto
3978b9b8ed
Add crosshair support for Android (#7865)
If enabled, a crosshair will be shown to select object.
This will give Android players a way to play like they play on desktop.
On third-person back camera mode, player is forced to use crosshair.
On third-person front camera mode, player is unable to select anything.

Co-authored-by: ROllerozxa <temporaryemail4meh+github@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2022-09-29 20:30:33 +02:00
20kdc
b1233056b7
Add zstd compression support (#12515) 2022-09-28 09:06:14 -04:00
DS
0251b01da6
Pause shader animation timer in singleplayer pause menu (#12766)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-27 16:23:07 -04:00
pecksin
6ac38aa2c8
Restore and enhance bouncy behavior (#11939) 2022-09-27 16:22:36 -04:00
savilli
907dcdcf7b
Add unittests for item movement code (#11885) 2022-09-27 16:22:11 -04:00
Wuzzy
3f801bc096
Fix liquid drawtype faces sometimes not rendering (#12807)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-26 19:27:47 -04:00
Jude Melton-Houghton
f4a01f3a5d
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00
Jude Melton-Houghton
03428d9825
Modify PUC Lua to wrap C++ exceptions (#12445) 2022-09-26 07:23:48 -04:00
Jude Melton-Houghton
f916398a54
Add lighting test and benchmark (#12802) 2022-09-26 06:49:08 -04:00
Lars Mueller
8dec3a5ecb Fix double escape in update checker dialog 2022-09-25 13:45:37 +02:00
Tobias Frost
7069d99aa6
Fix two spelling mistakes
Co-authored-by: Tobias Frost <tobi@debian.org>
2022-09-25 13:45:27 +02:00
Aritz Erkiaga
5ced5c9b27
Briefly explain how facedir rotations work (#11934) 2022-09-25 13:45:02 +02:00
Lars Müller
1317cd12d7
Fix formula used for acceleration (#12353) 2022-09-20 10:55:51 +02:00
DS
11905a6db6
Rename a variable in localplayer.h, resolves a TODO 2022-09-20 10:55:11 +02:00
ndren
2c3f641e0b
Simplify bit flip in sha1.cpp 2022-09-20 10:54:35 +02:00
Wuzzy
9acf2d3db7
Document minetest.parse_relative_number (#12576) 2022-09-18 18:38:55 +02:00
Jude Melton-Houghton
310b12b5ed
Content ID caching in Lua (#12444)
* Cache content IDs in Lua

Co-authored-by: sfan5 <sfan5@live.de>
2022-09-18 17:46:48 +02:00
Jude Melton-Houghton
006d974c58 Catch exceptions in SQLite3 callback 2022-09-18 17:39:09 +02:00
Jude Melton-Houghton
b89608c624 Compile bitop library as C++ 2022-09-18 17:39:09 +02:00
Jude Melton-Houghton
6f5a68b7f7
Allow getmetatable in CSM (#12776) 2022-09-18 17:32:18 +02:00
DS
c9ed059d91
Client map: do frustum culling via planes (#12710) 2022-09-18 15:28:53 +02:00
sfan5
a428a0cf37 Bump used IrrlichtMt version 2022-09-16 19:54:59 +02:00
savilli
9428917870
Fix UAF in craft recipes (#12763)
If you call minetest.clear_craft after minetest.register_alias_force, the craft definition reference may not be removed from m_output_craft_definitions leading to UAF.
2022-09-16 13:20:14 +02:00
William Breathitt Gray
19e936362a
Add support for MINETEST_USERDATA environment variable (#12639)
The MINETEST_USER_PATH environment variable can be used to define a
custom path for Minetest user data. If MINETEST_USER_PATH is empty or
unset, the HOME (or APPDATA on Windows) environment variable is used as
the default user data path; this ensures backwards compatibility with
existing user setups.
2022-09-16 13:19:44 +02:00
Wuzzy
1d04903c19
Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
SmallJoker
b5e7280708 Content tab: Fix content download broken by bc3dccc 2022-09-16 13:01:23 +02:00
DS
f3f3b752f2
Fix tooltips for dropdown, scrollbar and more (#12747) 2022-09-13 12:48:28 +01:00
SmallJoker
cea5fd56a4
Content tab: Change uninstall icon to trash bin (#12761)
A red cross might indicate 'cancel download' whereas the trash bin is generally a symbol for deletion.
2022-09-12 19:25:34 +02:00
wsor4035
482cc99b2c
Fix trivial get_armor_groups documentation issue (#12760) 2022-09-12 19:25:25 +02:00
SmallJoker
bc3dccca5c
Mainmenu: Properly sort mods and games (#12758)
This also removes trivial and unused pkgmgr functions
Fixes a bug caused by sorting in 2133fc8
2022-09-12 19:24:54 +02:00
Jude Melton-Houghton
fe13f9dfd1
Fix potential use-after-free with item metadata (#12729)
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-11 19:28:37 +02:00
Lars Mueller
7486f184c3 Serialize: Restore forward compatibility 2022-09-11 19:27:18 +02:00
Lars Mueller
6c24dc4e23 Serialize: Use numbers for refs to work around LuaJIT limits 2022-09-11 19:27:02 +02:00
sfan5
c607bee19e Allow looped animation to be used safely with old clients
fixes #12657
2022-09-10 12:21:29 +02:00
pecksin
adb03ccc6d
Chat weblink: remove comma as delimiter (#12730) 2022-09-10 12:21:15 +02:00
ROllerozxa
2133fc84c4
Fix texture pack sorting in content tab (#12727)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-10 12:20:33 +02:00
DS
643971c948
Add documentation of sun/moon orientation/scale differences (#12145) 2022-09-06 11:21:55 +01:00
Herman Semenov
038da00e79
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
x2048
ff6dcfea82
Implement rendering pipeline and post-processing (#12465)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: lhofhansl <lhofhansl@yahoo.com>
2022-09-06 08:25:18 +02:00
x2048
464043b8ab Convert entity glow value to color space before adding to the light 2022-09-04 16:00:13 +02:00
Niklp
2854c19792
Fix incorrectly placed label in tab_online (#12732) 2022-09-02 01:05:40 +01:00
savilli
75d88dcae2
Fix and enable x86 build for Android (#12700) 2022-08-25 22:48:49 +01:00
fluxionary
0ab9bf926d
Fix texture_min_size 2022-08-24 22:38:14 +02:00
rubenwardy
2d10fa7867
Prevent loading a world with unresolved dependencies (#12542) 2022-08-19 12:31:36 +01:00
x2048
8c29c4f620
Use Sky class to obtain directional light source position for shadows (#12662)
* Also remove unused Sky::getSkyBodyOrbitTilt method

Fixes misalignment of sun position and shadow direction at high tilt values.
2022-08-17 16:30:05 +02:00
celeron55
3f67215df9
Log sockets into tracestream instead of dstream (#12701) 2022-08-16 15:18:11 +01:00
rubenwardy
c4ffe630f1
Add package title to ContentDB error messages (#12705) 2022-08-16 13:46:11 +01:00
Elliott Lester
7c5e3cac6a
Apply DPI Scaling to GUIModalMenu (#12693)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-15 21:19:47 +01:00
rubenwardy
adc89f7977 Add unit tests for pkgmgr.install_dir 2022-08-15 21:19:24 +01:00
rubenwardy
db612c10ee Refactor pkgmgr.install_dir to simplify logic 2022-08-15 21:19:24 +01:00
rubenwardy
0090446ccf Fix crash when trying to overwrite a package
Before #11646, core.copy_dir would overwrite the target if it exists. Adding core.delete_dir restores the exact same behaviour

Fixes #12303
2022-08-15 21:19:24 +01:00
sfan5
cae7ec1eb4
Cut back on Gitlab-ci & misc pipeline updates 2022-08-15 10:47:47 +02:00
Fábio Rodrigues Ribeiro
bce1078ced
Remove resolution of appstream screenshots (#12652)
resolves Appdata not valid #12597
2022-08-15 10:47:09 +02:00
x2048
aa2fdc6ef6
Limit force shadow update to urgent blocks (#12692) 2022-08-14 20:29:20 +02:00
Lion
2690585e99
Add handling of environment variables to control terminal/logging colors (#12641) 2022-08-14 20:27:28 +02:00
Zughy
760242c076
Docs: add "flip moon texture" into breakage file (#12417) 2022-08-14 20:25:52 +02:00
sfan5
c7059c4981 Move some CI jobs to newer compiler versions 2022-08-14 00:18:15 +02:00
x2048
d1cbb4bd8a
Reduce the use of porting::getTimeMs() when rendering frames (#12679)
* Avoid calling TimeTaker too frequently in renderMapXXX
* Calculate animation timer once per frame
* Remove code that breaks rendering frame at 2000ms

Co-authored-by: sfan5 <sfan5@live.de>

Co-authored-by: sfan5 <sfan5@live.de>
2022-08-13 22:33:26 +02:00
Lars Müller
0e439b2fa3
Check hp_max > 0 for entities (#12667) 2022-08-13 15:35:41 +01:00
Zughy
3132efcc01
Reassure previous nil behaviour for tiles and special_tiles (#12678)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-08-13 15:35:28 +01:00
Jude Melton-Houghton
ab8dfb45b4
Allow buffer argument to VoxelManip:get_light_data (#12682) 2022-08-13 08:53:47 +02:00
fluxionary
59601eb922
Remove default keybind for range select (#12632)
Reason: accidental key presses, few use-cases.
2022-08-13 08:53:30 +02:00
SmallJoker
023a1c2427
Textures: introduce world-align overrides (#12540)
Many games do not care about world align textures, however texture packs should have the capabilities to change that if they have suitable textures. This commmit now introduces a node property override for world-align in particular to force a certain scale on the selected override tiles.
2022-08-13 08:52:16 +02:00
Zughy
8bf1609ccc
Fix crash when crafting callbacks return strings (#12685)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-08-12 10:17:37 +01:00
SmallJoker
c8ee755c05
Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-12 10:17:02 +01:00
DS
df1d215f48
Node vertex shader: Properly use the waved world position (#12665) 2022-08-10 18:04:12 +02:00
Zughy
bcc56803d7
Fix crash when stars are reset 2022-08-10 18:03:57 +02:00
sfan5
4fbcc33ee0 Enable C++ stdlib assertions in debug flags 2022-08-05 13:04:01 +02:00
sfan5
ec778508df Continue with 5.7.0-dev 2022-08-04 22:46:02 +02:00
1878 changed files with 459420 additions and 228439 deletions

View file

@ -1,33 +0,0 @@
BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Always
TabWidth: 4
BreakBeforeBraces: Custom
Standard: Cpp11
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
FixNamespaceComments: false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AccessModifierOffset: -4
ColumnLimit: 90
AllowShortFunctionsOnASingleLine: InlineOnly
SortIncludes: false
IncludeCategories:
- Regex: '^".*'
Priority: 2
- Regex: '^<.*'
Priority: 1
AlignAfterOpenBracket: DontAlign
ContinuationIndentWidth: 8
ConstructorInitializerIndentWidth: 8
BreakConstructorInitializers: AfterColon
AlwaysBreakTemplateDeclarations: Yes

View file

@ -1,4 +1,4 @@
Checks: '-*,modernize-use-emplace,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,performance-*'
Checks: '-*,modernize-use-emplace,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,performance-*,-performance-avoid-endl,performance-inefficient-string-concatenation'
WarningsAsErrors: '-*,modernize-use-emplace,performance-type-promotion-in-math-fn,performance-faster-string-find,performance-implicit-cast-in-loop'
CheckOptions:
- key: performance-unnecessary-value-param.AllowedTypes

11
.editorconfig Executable file → Normal file
View file

@ -1,9 +1,16 @@
[*]
end_of_line = lf
[*.{cpp,h,lua,txt,glsl,md,c,cmake,java,gradle}]
charset = utf8
[*.{cpp,h,lua,txt,glsl,c,cmake,java,gradle}]
charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

6
.gitattributes vendored
View file

@ -1,2 +1,8 @@
# Forces all files which git considers text files to use LF line endings
* text=auto eol=lf
*.cpp diff=cpp
*.h diff=cpp
*.gltf binary
*.x binary

View file

@ -14,28 +14,31 @@ Contributions are welcome! Here's how you can help:
[clone](https://help.github.com/articles/cloning-a-repository/) your fork.
2. Before you start coding, consider opening an
[issue at Github](https://github.com/minetest/minetest/issues) to discuss the
[issue on Github](https://github.com/luanti-org/luanti/issues) to discuss the
suitability and implementation of your intended contribution with the core
developers.
Any Pull Request that isn't a bug fix and isn't covered by
[the roadmap](../doc/direction.md) will be closed within a week unless it
[the roadmap](../doc/direction.md) will be closed within a month unless it
receives a concept approval from a Core Developer. For this reason, it is
recommended that you open an issue for any such pull requests before doing
the work, to avoid disappointment.
You may also benefit from discussing on our IRC development channel
[#minetest-dev](http://www.minetest.net/irc/). Note that a proper IRC client
[#luanti-dev](http://www.luanti.org/irc/). Note that a proper IRC client
is required to speak on this channel.
3. Start coding!
- Refer to the
[Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt),
[Developer Wiki](http://dev.minetest.net/Main_Page) and other
[documentation](https://github.com/minetest/minetest/tree/master/doc).
- Follow the [C/C++](http://dev.minetest.net/Code_style_guidelines) and
[Lua](http://dev.minetest.net/Lua_code_style_guidelines) code style guidelines.
[Lua API](https://github.com/luanti-org/luanti/blob/master/doc/lua_api.md),
[Developer Wiki](https://dev.luanti.org/) and other
[documentation](https://github.com/luanti-org/luanti/tree/master/doc).
- Follow the [C/C++](https://dev.luanti.org/Code_style_guidelines) and
[Lua](https://dev.luanti.org/Lua_code_style_guidelines) code style guidelines.
- Check your code works as expected and document any changes to the Lua API.
- To avoid conflicting changes between contributions, do not do the following manually. They will be done before each release.
- Run `updatepo.sh` or update `luanti.po{,t}` even if your code adds new translatable strings.
- Update `minetest.conf.example` and `settings_translation_file.cpp` even if your code adds new core settings.
4. Commit & [push](https://help.github.com/articles/pushing-to-a-remote/) your changes to a new branch (not `master`, one change per branch)
- Commit messages should:
@ -50,7 +53,7 @@ Contributions are welcome! Here's how you can help:
- The following lines should describe the commit, starting a new line for each point.
5. Once you are happy with your changes, submit a pull request.
- Open the [pull-request form](https://github.com/minetest/minetest/pull/new/master).
- Open the [pull-request form](https://github.com/luanti-org/luanti/pull/new/master).
- Add a description explaining what you've done (or if it's a
work-in-progress - what you need to do).
- Make sure to fill out the pull request template.
@ -61,40 +64,26 @@ Contributions are welcome! Here's how you can help:
picture of the project.
2. It works.
3. It follows the code style for
[C/C++](http://dev.minetest.net/Code_style_guidelines) or
[Lua](http://dev.minetest.net/Lua_code_style_guidelines).
[C/C++](https://dev.luanti.org/Code_style_guidelines) or
[Lua](https://dev.luanti.org/Lua_code_style_guidelines).
4. The code's interfaces are well designed, regardless of other aspects that
might need more work in the future.
5. It uses protocols and formats which include the required compatibility.
### Important note about automated GitHub checks
When you submit a pull request, GitHub automatically runs checks on the Minetest
Engine combined with your changes. One of these checks is called 'cpp lint /
clang format', which checks code formatting. Because formatting for readability
requires human judgement this check often fails and often makes unsuitable
formatting requests which make code readability worse.
If this check fails, look at the details to check for any clear mistakes and
correct those. However, you should not apply everything ClangFormat requests.
Ignore requests that make code readability worse and any other clearly
unsuitable requests. Discuss in the pull request with a core developer about how
to progress.
## Issues
If you experience an issue, we would like to know the details - especially when
a stable release is on the way.
1. Do a quick search on GitHub to check if the issue has already been reported.
2. Is it an issue with the Minetest *engine*? If not, report it
[elsewhere](http://www.minetest.net/development/#reporting-issues).
3. [Open an issue](https://github.com/minetest/minetest/issues/new) and describe
2. Is it an issue with the Luanti *engine*? If not, report it
[elsewhere](http://www.luanti.org/development/#reporting-issues).
3. [Open an issue](https://github.com/luanti-org/luanti/issues/new) and describe
the issue you are having - you could include:
- Error logs (check the bottom of the `debug.txt` file).
- Screenshots.
- Ways you have tried to solve the issue, and whether they worked or not.
- Your Minetest version and the content (games, mods or texture packs) you have installed.
- Your Luanti version and the content (games, mods or texture packs) you have installed.
- Your platform (e.g. Windows 10 or Ubuntu 15.04 x64).
After reporting you should aim to answer questions or clarifications as this
@ -110,35 +99,35 @@ possible.
## Translations
The core translations of Minetest are performed using Weblate. You can access
The core translations of Luanti are performed using Weblate. You can access
the project page with a list of current languages
[here](https://hosted.weblate.org/projects/minetest/minetest/).
Builtin (the component which contains things like server messages, chat command
descriptions, privilege descriptions) is translated separately; it needs to be
translated by editing a `.tr` text file. See
[Translation](https://dev.minetest.net/Translation) for more information.
[Translation](https://dev.luanti.org/Translation) for more information.
## Donations
If you'd like to monetarily support Minetest development, you can find donation
methods on [our website](http://www.minetest.net/development/#donate).
If you'd like to monetarily support Luanti development, you can find donation
methods on [our website](http://www.luanti.org/development/#donate).
# Maintaining
* This is a concise version of the
[Rules & Guidelines](http://dev.minetest.net/Category:Rules_and_Guidelines) on the developer wiki.*
[Rules & Guidelines](https://dev.luanti.org/engine-dev-process/) on the developer wiki.*
These notes are for those who have push access Minetest (core developers / maintainers).
These notes are for those who have push access Luanti (core developers / maintainers).
- See the [project organisation](http://dev.minetest.net/Organisation) for the people involved.
- See the [project organisation](https://dev.luanti.org/Organisation) for the people involved.
## Concept approvals and roadmaps
If a Pull Request is not a bug fix:
* If it matches a goal in [the roadmap](../doc/direction.md), then the PR should
be labelled as "Roadmap" and the goal stated by number in the description.
be labeled as "Roadmap" and the goal stated by number in the description.
* If it doesn't match a goal, then it needs to receive a concept approval within
a week of being opened to remain open. This 1 week deadline does not apply to
PRs opened before the roadmap was adopted; instead, they may remain open or be
@ -170,14 +159,14 @@ Submit a :+1: (+1) or "Looks good" comment to show you believe the pull-request
- The title should follow the commit guidelines (title starts with a capital letter, present tense, descriptive).
- Don't modify history older than 10 minutes.
- Use rebase, not merge to get linear history:
- `curl https://github.com/minetest/minetest/pull/1.patch | git am`
- `curl -Ls https://github.com/luanti-org/luanti/pull/1.patch | git am`
## Reviewing issues and feature requests
- If an issue does not get a response from its author within 1 month (when requiring more details), it can be closed.
- When an issue is a duplicate, refer to the first ones and close the later ones.
- Tag issues with the appropriate [labels](https://github.com/minetest/minetest/labels) for devices, platforms etc.
- Tag issues with the appropriate [labels](https://github.com/luanti-org/luanti/labels) for devices, platforms etc.
## Releasing a new version
*Refer to [dev.minetest.net/Releasing_Minetest](http://dev.minetest.net/Releasing_Minetest)*
*Refer to [dev.luanti.org/Releasing_Luanti](https://dev.luanti.org/Releasing_Luanti)*

View file

@ -1,32 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Unconfirmed bug
assignees: ''
---
##### Minetest version
<!--
Paste Minetest version between quotes below.
If you are on a devel version, please add git commit hash.
You can use `minetest --version` to find it.
-->
```
```
##### OS / Hardware
<!-- General information about your hardware and operating system -->
Operating system:
CPU:
<!-- For graphical issues only -->
GPU model:
OpenGL version:
##### Summary
<!-- Describe your problem here -->
##### Steps to reproduce
<!-- Explain how the problem has happened, providing a minimal test (i.e. a code snippet reduced to the bone) where possible -->

79
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View file

@ -0,0 +1,79 @@
name: Bug report
description: Create a report to help us improve
labels: ["Unconfirmed bug"]
body:
- type: markdown
attributes:
value: |
Please note the following:
1. **Please update Luanti to the latest stable or dev version** before submitting bug reports. Make sure the bug is still reproducible on the latest version.
2. This page is for reporting the bugs of **the engine itself**. For bugs in a particular game, please [search for the game in the ContentDB](https://content.luanti.org/packages/?type=game) and submit a bug report in their issue trackers.
* For example, you can submit issues about the Minetest Game [in its own repository](https://github.com/luanti-org/minetest_game/issues).
3. Please provide as many details as possible for us to spot the problem quicker.
- type: textarea
attributes:
label: Luanti version
description: |
Paste the Luanti version below.
If you are on a dev version, please also indicate the git commit hash.
Refer to the "About" tab of the menu or run `luanti --version` on the command line.
placeholder: |
Example:
Luanti 5.10.0-3ad6aee9b (Linux)
Using LuaJIT 2.1.1727870382
Built by GCC 14.2
Running on Linux/6.11.5 x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=1
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="."
STATIC_LOCALEDIR="locale"
render: "true"
validations:
required: true
- type: input
attributes:
label: Operating system and version
description: It is recommended to upgrade your operating system to see if the problem persists.
placeholder: "Example: Ubuntu 22.04"
validations:
required: true
- type: input
attributes:
label: CPU model
description: Usually found in OS/system settings.
placeholder: "Example: Intel Core i5-2410M"
validations:
required: false
- type: markdown
attributes:
value: The GPU model and renderer can be omitted if the bug is not a graphical issue.
- type: input
attributes:
label: GPU model
description: Usually found in OS/system settings.
placeholder: "Example: NVIDIA GeForce GTX 1660"
validations:
required: false
- type: input
attributes:
label: Active renderer
description: You can find this in the "About" tab in the main menu.
placeholder: "Example: ES 3.2 / ogles2 / X11"
validations:
required: false
- type: textarea
attributes:
label: Summary
description: Describe your problem here.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Explain how the problem has happened, providing a minimal test (e.g. a minimized code snippet) where possible.
validations:
required: true

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Submit issues about Minetest Game
url: https://github.com/luanti-org/minetest_game/issues/new
about: Only submit issues of the engine in this repository's issue tracker. Submit those of Minetest Game in its own issue tracker.
- name: Search for issue trackers of third-party games
url: https://content.luanti.org/packages/?type=game
about: For issues of third-party games, search for the game in the ContentDB and then submit an issue in their issue tracker.

View file

@ -1,25 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature request
assignees: ''
---
## Problem
A clear and concise description of what the problem is.
ie: Why is this needed?
Ex. I'm always frustrated when [...]
## Solutions
A clear and concise description of what you want to happen.
## Alternatives
A clear and concise description of any alternative solutions or features you've considered.
## Additional context
Add any other context or screenshots about the feature request here.

View file

@ -0,0 +1,39 @@
name: Feature request
description: Suggest an idea for this project
labels: ["Feature request"]
body:
- type: markdown
attributes:
value: |
Please note the following:
1. Only submit a feature request if the feature does not exist on the latest dev version.
2. This page is for suggesting changes to **the engine itself**. To suggest changes to games, please [search for the game in the ContentDB](https://content.luanti.org/packages/?type=game) and submit a feature request in their issue trackers.
- type: textarea
attributes:
label: Problem
description: |
A clear and concise description of the problem, i.e. "Why is this needed?"
Example: I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Solutions
description: |
A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: |
Add any other context or screenshots about the feature request here.
validations:
required: false

View file

@ -3,7 +3,7 @@ Add compact, short information about your PR for easier understanding:
- Goal of the PR
- How does the PR work?
- Does it resolve any reported issue?
- Does this relate to a goal in [the roadmap](../doc/direction.md)?
- Does this relate to a goal in [the roadmap](https://github.com/luanti-org/luanti/blob/master/doc/direction.md)?
- If not a bug fix, why is this PR needed? What usecases does it solve?
## To do

6
.github/SECURITY.md vendored
View file

@ -3,7 +3,7 @@
## Supported Versions
We only support the latest stable version for security issues.
See the [releases page](https://github.com/minetest/minetest/releases).
See the [releases page](https://github.com/luanti-org/luanti/releases).
## Reporting a Vulnerability
@ -11,10 +11,10 @@ We ask that you report vulnerabilities privately, by contacting a core developer
to give us time to fix them. You can do that by emailing one of the following addresses:
* celeron55@gmail.com
* rubenwardy@minetest.net
* rw@rubenwardy.com
Depending on severity, we will either create a private issue for the vulnerability
and release a patch version of Minetest, or give you permission to file the issue publicly.
and release a patch version of Luanti, or give you permission to file the issue publicly.
For more information on the justification of this policy, see
[Responsible Disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure).

View file

@ -8,6 +8,11 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'android/**'
- '.github/workflows/android.yml'
pull_request:
@ -16,27 +21,56 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'android/**'
- '.github/workflows/android.yml'
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext openjdk-11-jdk-headless
- name: Build with Gradle
run: cd android; ./gradlew assemblerelease
- name: Save armeabi artifact
uses: actions/upload-artifact@v3
sudo apt-get install -y --no-install-recommends gettext
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
name: Minetest-armeabi-v7a.apk
distribution: 'temurin'
java-version: '17'
- name: Build AAB with Gradle
# We build an AAB as well for uploading to the the Play Store.
run: cd android; ./gradlew bundlerelease
- name: Build APKs with Gradle
# "assemblerelease" is very fast after "bundlerelease".
run: cd android; ./gradlew assemblerelease
- name: Save AAB artifact
uses: actions/upload-artifact@v4
with:
name: Luanti-release.aab
path: android/app/build/outputs/bundle/release/app-release.aab
- name: Save armeabi artifact
uses: actions/upload-artifact@v4
with:
name: Luanti-armeabi-v7a.apk
path: android/app/build/outputs/apk/release/app-armeabi-v7a-release-unsigned.apk
- name: Save arm64 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Minetest-arm64-v8a.apk
name: Luanti-arm64-v8a.apk
path: android/app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk
- name: Save x86 artifact
uses: actions/upload-artifact@v4
with:
name: Luanti-x86.apk
path: android/app/build/outputs/apk/release/app-x86-release-unsigned.apk
- name: Save x86_64 artifact
uses: actions/upload-artifact@v4
with:
name: Luanti-x86_64.apk
path: android/app/build/outputs/apk/release/app-x86_64-release-unsigned.apk

View file

@ -1,272 +0,0 @@
name: build
# build on c/cpp changes or workflow changes
on:
push:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/buildbot/**'
- 'util/ci/**'
- '.github/workflows/**.yml'
- 'Dockerfile'
- '.dockerignore'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/buildbot/**'
- 'util/ci/**'
- '.github/workflows/**.yml'
- 'Dockerfile'
- '.dockerignore'
jobs:
# Older gcc version (should be close to our minimum supported version)
gcc_5:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-5
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-5
CXX: g++-5
- name: Test
run: |
./bin/minetest --run-unittests
# Current gcc version
gcc_10:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-10
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-10
CXX: g++-10
- name: Test
run: |
./bin/minetest --run-unittests
# Older clang version (should be close to our minimum supported version)
clang_3_9:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-3.9 gdb
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-3.9
CXX: clang++-3.9
- name: Unittest
run: |
./bin/minetest --run-unittests
- name: Integration test + devtest
run: |
./util/test_multiplayer.sh
# Current clang version
clang_10:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-10 valgrind libluajit-5.1-dev
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-10
CXX: clang++-10
CMAKE_FLAGS: "-DREQUIRE_LUAJIT=1"
- name: Test
run: |
./bin/minetest --run-unittests
- name: Valgrind
run: |
valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
# Build with prometheus-cpp (server-only)
clang_9_prometheus:
name: "clang_9 (PROMETHEUS=1)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-9
- name: Build prometheus-cpp
run: |
./util/ci/build_prometheus_cpp.sh
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-9
CXX: clang++-9
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0"
- name: Test
run: |
./bin/minetestserver --run-unittests
docker:
name: "Docker image"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build docker image
run: |
docker build . -t minetest:latest
docker run --rm minetest:latest /usr/local/bin/minetestserver --version
win32:
name: "MinGW cross-compiler (32-bit)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install compiler
run: |
sudo apt-get update && sudo apt-get install -y gettext
wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
sudo tar -xaf mingw.tar.xz -C /usr
- name: Build
run: |
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild
env:
NO_MINETEST_GAME: 1
NO_PACKAGE: 1
win64:
name: "MinGW cross-compiler (64-bit)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install compiler
run: |
sudo apt-get update && sudo apt-get install -y gettext
wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
sudo tar -xaf mingw.tar.xz -C /usr
- name: Build
run: |
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild
env:
NO_MINETEST_GAME: 1
NO_PACKAGE: 1
msvc:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
VCPKG_VERSION: 5cf60186a241e84e8232641ee973395d4fde90e1
# 2022.02
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry
strategy:
fail-fast: false
matrix:
config:
- {
arch: x86,
generator: "-G'Visual Studio 16 2019' -A Win32",
vcpkg_triplet: x86-windows
}
- {
arch: x64,
generator: "-G'Visual Studio 16 2019' -A x64",
vcpkg_triplet: x64-windows
}
type: [portable]
# type: [portable, installer]
# The installer type is working, but disabled, to save runner jobs.
# Enable it, when working on the installer.
steps:
- uses: actions/checkout@v3
- name: Checkout IrrlichtMt
run: |
$ref = @(Get-Content misc\irrlichtmt_tag.txt)
git clone https://github.com/minetest/irrlicht lib\irrlichtmt --depth 1 -b $ref[0]
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{env.vcpkg_packages}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
- name: Minetest CMake
run: |
cmake ${{matrix.config.generator}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release `
-DENABLE_POSTGRESQL=OFF `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
- name: Build Minetest
run: cmake --build . --config Release
- name: CPack
run: |
If ($env:TYPE -eq "installer")
{
cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
}
ElseIf($env:TYPE -eq "portable")
{
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
}
env:
TYPE: ${{matrix.type}}
- name: Package Clean
run: rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
- uses: actions/upload-artifact@v3
with:
name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
path: .\Package\

View file

@ -8,6 +8,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
@ -18,37 +20,25 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
- '.github/workflows/**.yml'
env:
CLANG_TIDY: clang-tidy-15
jobs:
# clang_format:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# - name: Install clang-format
# run: |
# sudo apt-get update
# sudo apt-get install -y clang-format-9
#
# - name: Run clang-format
# run: |
# source ./util/ci/clang-format.sh
# check_format
# env:
# CLANG_FORMAT: clang-format-9
clang_tidy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-tidy-9
install_linux_deps $CLANG_TIDY
- name: Run clang-tidy
run: |

98
.github/workflows/docker_image.yml vendored Normal file
View file

@ -0,0 +1,98 @@
---
name: docker_image
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
# https://docs.docker.com/build/ci/github-actions/multi-platform
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
on:
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ "*" ]
pull_request:
# Build docker image on pull requests. (but do not publish)
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
- 'misc/irrlichtmt_tag.txt'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/docker_image.yml'
workflow_dispatch:
inputs:
use_cache:
description: "Use build cache"
required: true
type: boolean
default: true
env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.0.0
# Login against the Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.5.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.title=Luanti
org.opencontainers.image.vendor=Luanti
org.opencontainers.image.licenses=LGPL-2.1-only
# Build and push Docker image
# https://github.com/docker/build-push-action
# No arm support for now. Require cross-compilation support in Dockerfile to not use QEMU.
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
no-cache: ${{ (github.event_name == 'workflow_dispatch' && !inputs.use_cache) || startsWith(github.ref, 'refs/tags/') }}
- name: Test Docker Image
run: |
docker run --rm $(cut -d, -f1 <<<"$DOCKER_METADATA_OUTPUT_TAGS") luantiserver --version
shell: bash

159
.github/workflows/linux.yml vendored Normal file
View file

@ -0,0 +1,159 @@
name: linux
# build on c/cpp changes or workflow changes
on:
push:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- '.github/workflows/linux.yml'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- '.github/workflows/linux.yml'
env:
MINETEST_POSTGRESQL_CONNECT_STRING: 'host=localhost user=minetest password=minetest dbname=minetest'
jobs:
# Older gcc version (should be close to our minimum supported version)
gcc_7:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-7
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-7
CXX: g++-7
# Test fallback SHA implementations
CMAKE_FLAGS: '-DENABLE_OPENSSL=0'
- name: Test
run: |
./bin/luanti --run-unittests
# Current gcc version
gcc_14:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-14 libluajit-5.1-dev
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-14
CXX: g++-14
- name: Test
run: |
mkdir nowrite
chmod a-w nowrite
cd nowrite
../bin/luanti --run-unittests
# Older clang version (should be close to our minimum supported version)
clang_7:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-7 llvm-7
- 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"'
- 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 clang version
clang_18:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-18 lldb
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-18
CXX: clang++-18
- name: Test
run: |
./bin/luanti --run-unittests
- name: Integration test + devtest
run: |
./util/test_multiplayer.sh
# Build with prometheus-cpp (server-only)
clang_11_prometheus:
name: "clang_11 (PROMETHEUS=1)"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-11
- name: Build prometheus-cpp
run: ./util/ci/build_prometheus_cpp.sh
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-11
CXX: clang++-11
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0 -DENABLE_CURSES=0"
- name: Test
run: |
./bin/luantiserver --run-unittests

View file

@ -14,47 +14,43 @@ on:
- '.github/workflows/**.yml'
jobs:
# Note that the integration tests are also run build.yml, but only when C++ code is changed.
# Note that the integration tests are also run in build.yml, but only when C++ code is changed.
integration_tests:
name: "Compile and run multiplayer tests"
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-10 gdb libluajit-5.1-dev
install_linux_deps clang gdb libluajit-5.1-dev
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-10
CXX: clang++-10
CMAKE_FLAGS: "-DENABLE_GETTEXT=0 -DBUILD_SERVER=0"
CC: clang
CXX: clang++
CMAKE_FLAGS: "-DENABLE_GETTEXT=0 -DBUILD_SERVER=0 -DBUILD_UNITTESTS=0"
- name: Integration test + devtest
run: |
./util/test_multiplayer.sh
serverconf="profiler.load=true" ./util/test_multiplayer.sh
luacheck:
name: "Builtin Luacheck and Unit Tests"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v9
- uses: actions/checkout@v4
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "5.1.5"
- uses: leafo/gh-actions-luarocks@v4
- uses: leafo/gh-actions-luarocks@v4.3.0
- name: Install LuaJIT
run: |
cd $HOME
git clone https://github.com/LuaJIT/LuaJIT/
cd LuaJIT
make -j$(nproc)
run: ./util/ci/build_luajit.sh
- name: Install luarocks tools
run: |

48
.github/workflows/lua_api_deploy.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: lua_api_deploy
permissions:
contents: read
pages: write
id-token: write
on:
push:
paths:
- '.github/workflows/lua_api_deploy.yml'
- 'doc/lua_api.md'
- 'doc/mkdocs/'
branches:
- master
jobs:
build:
if: github.repository == 'luanti-org/luanti'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install mkdocs
run: |
pip install -U -r doc/mkdocs/requirements.txt
- name: Build documentation
run: |
cd doc/mkdocs/
./build.sh
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'public/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -8,8 +8,12 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- '.github/workflows/macos.yml'
pull_request:
paths:
@ -17,55 +21,93 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- '.github/workflows/macos.yml'
env:
MINETEST_GAME_REPO: https://github.com/minetest/minetest_game.git
MINETEST_GAME_BRANCH: master
MINETEST_GAME_NAME: minetest_game
jobs:
build:
runs-on: macos-10.15
build-intel-macos:
# use lowest possible macOS running on x86_64 supported by brew to support more users
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install deps
run: |
pkgs=(cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd)
brew update
brew install ${pkgs[@]}
brew unlink $(brew ls --formula)
brew link ${pkgs[@]}
source ./util/ci/common.sh
install_macos_deps
- name: Build
run: |
git clone -b $MINETEST_GAME_BRANCH $MINETEST_GAME_REPO games/$MINETEST_GAME_NAME
git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE \
-DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE
make -j2
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
-DINSTALL_DEVTEST=TRUE
cmake --build . -j$(sysctl -n hw.logicalcpu)
make install
- name: Test
run: |
./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
./build/macos/luanti.app/Contents/MacOS/luanti --run-unittests
# Zipping the built .app preserves permissions on the contained files,
# which the GitHub artifact pipeline would otherwise strip away.
- name: CPack
run: |
cd build
rm -rf macos
cmake .. -DINSTALL_DEVTEST=FALSE
cpack -G ZIP -B macos
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: minetest-macos
name: luanti-macos
path: ./build/macos/*.zip
build-arm-macos-xcode:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_macos_deps
# brew jsoncpp do not include libjsoncpp.a, and if installed header conflict caused build failure
brew uninstall jsoncpp
- name: Build with Cmake
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
-DENABLE_SYSTEM_JSONCPP=OFF
cmake --build . -j$(sysctl -n hw.logicalcpu)
make install
- name: Build and Archive with Xcode
run: |
mkdir build_xcode
cd build_xcode
../util/ci/build_xcode.sh
- name: Tests
run: |
mkdir -p "${HOME}/Library/Application Support/minetest/games/"
ln -s "${PWD}/games/devtest" "${HOME}/Library/Application Support/minetest/games/"
./build/macos/luanti.app/Contents/MacOS/luanti --run-unittests
./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/MacOS/luanti --run-unittests
- name: Diff Resources
run: |
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/build/Release/luanti.app/Contents/Resources || exit 1
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/Resources || exit 1

26
.github/workflows/png_file_checks.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: png_file_checks
# Check whether all png files are in a valid format
on:
push:
paths:
- '**.png'
- '.github/workflows/**.yml'
pull_request:
paths:
- '**.png'
- '.github/workflows/**.yml'
jobs:
png_optimized:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt install -y optipng
- name: Check whether all png files are optimized
run: |
./util/ci/check_png_optimized.sh

118
.github/workflows/whitespace_checks.yml vendored Normal file
View file

@ -0,0 +1,118 @@
name: whitespace_checks
# Check whitespaces of the following file types
# Not checked: .lua, .yml, .properties, .conf, .java, .py, .svg, .gradle, .xml, ...
# (luacheck already checks .lua files)
on:
push:
paths:
- '**.txt'
- '**.md'
- '**.[ch]'
- '**.cpp'
- '**.hpp'
- '**.sh'
- '**.cmake'
- '**.glsl'
- '**.lua'
pull_request:
paths:
- '**.txt'
- '**.md'
- '**.[ch]'
- '**.cpp'
- '**.hpp'
- '**.sh'
- '**.cmake'
- '**.glsl'
- '**.lua'
jobs:
trailing_whitespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Line endings are already ensured by .gitattributes
- name: Check trailing whitespaces
run: |
if git ls-files |\
grep -E '\.txt$|\.md$|\.[ch]$|\.cpp$|\.hpp$|\.sh$|\.cmake$|\.glsl$' |\
xargs grep -n '\s$';\
then\
echo -e "\033[0;31mFound trailing whitespace";\
(exit 1);\
else\
(exit 0);\
fi
indent_spaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Line endings are already ensured by .gitattributes
# Multiple multline comments in one line is not supported by this check
# and there is no reason to use them
# So lines like: "/* */ /*" or "*/ a = 5; /*" will result in error
- name: Check for unsupported multiline comments
run: |
if git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$' |\
xargs grep -n '\*/.*/\*';\
then
echo -e "\033[0;31mUnsupported combination of multiline comments. New multiline comment should begin on new line.";\
(exit 1);\
else\
(exit 0);\
fi
if git ls-files |\
grep -E '\.lua$' |\
xargs grep -n -e '\]\].*--\[\[';\
then
echo -e "\033[0;31mUnsupported combination of multiline comments. New multiline comment should begin on new line.";\
(exit 1);\
else\
(exit 0);\
fi
# This prepare files for final check
# See python script ./util/ci/indent_tab_preprocess.py for details.
- name: Preprocess files
run: |
git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$' |\
xargs -L 1 -P $(($(nproc) + 1)) \
python3 ./util/ci/indent_tab_preprocess.py "/*" "*/"
git ls-files |\
grep -E '\.lua$' |\
xargs -L 1 -P $(($(nproc) + 1)) \
python3 ./util/ci/indent_tab_preprocess.py "--[[" "]]"
# Check for bad indent.
# This runs over preprocessed files.
# If there is any remaining space on line beginning or after tab,
# error is generated
- name: Check indent spaces
run: |
if git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$|\.lua' |\
xargs grep -n -P '^\t*[ ]';\
then\
echo -e "\033[0;31mFound incorrect indent whitespaces";\
(exit 1);\
else\
(exit 0);\
fi
tabs_lua_api_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Some files should not contain tabs
- name: Check tabs in Lua API files
run: |
if grep -n $'\t' doc/lua_api.md doc/client_lua_api.md;\
then\
echo -e "\033[0;31mFound tab in markdown file";\
(exit 1);\
else\
(exit 0);\
fi

146
.github/workflows/windows.yml vendored Normal file
View file

@ -0,0 +1,146 @@
name: windows
# build on c/cpp changes or workflow changes
on:
push:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*.manifest'
- '.github/workflows/windows.yml'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*.manifest'
- '.github/workflows/windows.yml'
jobs:
mingw:
name: "MinGW cross-compiler (${{ matrix.bits }}-bit)"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
bits: [32, 64]
steps:
- uses: actions/checkout@v4
- name: Install compiler
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext wine wine${{ matrix.bits }}
sudo ./util/buildbot/download_toolchain.sh /usr
- name: Build
run: |
EXISTING_MINETEST_DIR=$PWD \
./util/buildbot/buildwin${{ matrix.bits }}.sh B
# Check that the resulting binary can run (DLLs etc.)
- name: Runtime test
run: |
dest=$(mktemp -d)
unzip -q -d "$dest" B/build/*.zip
cd "$dest"/luanti-*-win*
wine bin/luanti.exe --version
- uses: actions/upload-artifact@v4
with:
name: "mingw${{ matrix.bits }}"
path: B/build/*.zip
if-no-files-found: error
msvc:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
VCPKG_VERSION: 01f602195983451bc83e72f4214af2cbc495aa94
# 2024.05.24
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp sdl2
strategy:
fail-fast: false
matrix:
config:
- {
arch: x86,
generator: "-G'Visual Studio 16 2019' -A Win32",
vcpkg_triplet: x86-windows
}
- {
arch: x64,
generator: "-G'Visual Studio 16 2019' -A x64",
vcpkg_triplet: x64-windows
}
type: [portable]
# type: [portable, installer]
# The installer type is working, but disabled, to save runner jobs.
# Enable it, when working on the installer.
steps:
- uses: actions/checkout@v4
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{env.vcpkg_packages}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
- name: CMake
run: |
cmake ${{matrix.config.generator}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release `
-DENABLE_POSTGRESQL=OFF `
-DENABLE_LUAJIT=TRUE `
-DREQUIRE_LUAJIT=TRUE `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
- name: Build
run: cmake --build . --config Release
- name: Unittests
# need this workaround for stdout to work
run: |
$proc = start .\bin\Release\luanti.exe --run-unittests -NoNewWindow -Wait -PassThru
exit $proc.ExitCode
continue-on-error: true # FIXME!!
- name: CPack
run: |
If ($env:TYPE -eq "installer")
{
cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
}
ElseIf($env:TYPE -eq "portable")
{
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
}
rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
env:
TYPE: ${{matrix.type}}
- uses: actions/upload-artifact@v4
with:
name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
path: .\Package\
if-no-files-found: error

47
.gitignore vendored
View file

@ -1,5 +1,8 @@
## Editors and development environments
*~
.cmake
CMakeUserPresets.json
Testing/*
*.swp
*.bak*
*.orig
@ -23,45 +26,61 @@ tags
!tags/
gtags.files
.idea
.qtcreator/
# Codelite
*.project
# Visual Studio Code & plugins
.vscode/
.vscode/*
!.vscode/extensions.json
build/.cmake/
# Fleet
.fleet
# Gradle
.gradle
# Clang
.cache
# AppImage
*.AppImage
*.zsync
appimage-build
AppDir
# Direnv
.direnv/
# Nix
/result
## Files related to Minetest development cycle
## Files related to Luanti development cycle
/*.patch
*.diff
# GNU Patch reject file
*.rej
## Non-static Minetest directories or symlinks to these
## Non-static Luanti directories or symlinks to these
/bin/
/games/*
!/games/devtest/
/games/devtest/mods/soundstuff/sounds/gitignored_sounds/*
!/games/devtest/mods/soundstuff/sounds/gitignored_sounds/custom_sounds_here.txt
/cache
/textures/*
!/textures/base/
/screenshots
/sounds
/mods/*
!/mods/minetest/
/mods/minetest/*
!/mods/minetest/mods_here.txt
/worlds
/world/
!/mods/mods_here.txt
/worlds/*
!/worlds/worlds_here.txt
/clientmods/*
!/clientmods/preview/
/client/mod_storage/
/mod_data
## Configuration/log files
minetest.conf
debug.txt
debug.txt.1
## Other files generated by Minetest
## Other files generated by Luanti
screenshot_*.png
testbm.txt
@ -83,24 +102,26 @@ cmake_install.cmake
CMakeCache.txt
CPackConfig.cmake
CPackSourceConfig.cmake
src/test_config.h
src/cmake_config.h
src/cmake_config_githash.h
src/unittest/test_world/world.mt
games/devtest/mods/testnodes/textures/testnodes_generated_*.png
/locale/
.directory
*.cbp
*.layout
*.o
*.a
*.dump
*.dmp
*.ninja
.ninja*
*.gch
*.iml
test_config.h
cmake-build-debug/
cmake-build-minsizerel/
cmake-build-release/
cmake-build-relwithdebinfo/
cmake-build-default/
cmake_config.h
cmake_config_githash.h
CMakeDoxy*
@ -112,7 +133,7 @@ compile_commands.json
*.sln
.vs/
# Optional user provided library folder
# Old irrlichtmt. Still ignored to make bisecting easier.
lib/irrlichtmt
# Generated mod storage database

View file

@ -3,287 +3,14 @@
# https://gitlab.com/minetest/minetest
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines
stages:
- build
- package
- deploy
variables:
MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
.build_template:
stage: build
before_script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libleveldb-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev
script:
- git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
- make -j $(($(nproc) + 1))
- make install
artifacts:
when: on_success
expire_in: 1h
paths:
- artifact/*
.debpkg_template:
stage: package
before_script:
- apt-get update
- apt-get install -y git
- mkdir -p build/deb/minetest/DEBIAN/
- cp misc/debpkg-control build/deb/minetest/DEBIAN/control
- cp -a artifact/minetest/usr build/deb/minetest/
script:
- git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest_game
- rm -rf build/deb/minetest/usr/share/minetest/games/minetest/.git
- sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/JPEG_PLACEHOLDER/'$JPEG_PKG'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/JSONCPP_PLACEHOLDER/'$JSONCPP_PKG'/g' build/deb/minetest/DEBIAN/control
- cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
artifacts:
expire_in: 90 day
paths:
- ./*.deb
.debpkg_install:
stage: deploy
before_script:
- apt-get update -qy
script:
- apt-get install -y ./*.deb
- minetest --version
##
## Debian
##
# Stretch
build:debian-9:
extends: .build_template
image: debian:9
package:debian-9:
extends: .debpkg_template
image: debian:9
needs:
- build:debian-9
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1v5
JPEG_PKG: libjpeg62-turbo
deploy:debian-9:
extends: .debpkg_install
image: debian:9
needs:
- package:debian-9
# Buster
build:debian-10:
extends: .build_template
image: debian:10
package:debian-10:
extends: .debpkg_template
image: debian:10
needs:
- build:debian-10
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg62-turbo
deploy:debian-10:
extends: .debpkg_install
image: debian:10
needs:
- package:debian-10
# Bullseye
build:debian-11:
extends: .build_template
image: debian:11
package:debian-11:
extends: .debpkg_template
image: debian:11
needs:
- build:debian-11
variables:
JSONCPP_PKG: libjsoncpp24
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg62-turbo
deploy:debian-11:
extends: .debpkg_install
image: debian:11
needs:
- package:debian-11
##
## Ubuntu
##
# Bionic
build:ubuntu-18.04:
extends: .build_template
image: ubuntu:bionic
package:ubuntu-18.04:
extends: .debpkg_template
image: ubuntu:bionic
needs:
- build:ubuntu-18.04
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1v5
JPEG_PKG: libjpeg-turbo8
deploy:ubuntu-18.04:
extends: .debpkg_install
image: ubuntu:bionic
needs:
- package:ubuntu-18.04
# Focal
build:ubuntu-20.04:
extends: .build_template
image: ubuntu:focal
package:ubuntu-20.04:
extends: .debpkg_template
image: ubuntu:focal
needs:
- build:ubuntu-20.04
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg-turbo8
deploy:ubuntu-20.04:
extends: .debpkg_install
image: ubuntu:focal
needs:
- package:ubuntu-20.04
##
## Fedora
##
# Fedora 28 <-> RHEL 8
build:fedora-28:
extends: .build_template
image: fedora:28
before_script:
- dnf -y install make git gcc gcc-c++ kernel-devel cmake libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel libzstd-devel
##
## MinGW for Windows
##
.generic_win_template:
image: ubuntu:focal
before_script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y wget xz-utils unzip git cmake gettext
- wget -nv http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
- tar -xaf mingw.tar.xz -C /usr
.build_win_template:
extends: .generic_win_template
stage: build
artifacts:
expire_in: 90 day
paths:
- minetest-*-win*/*
build:win32:
extends: .build_win_template
script:
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh build
- unzip -q build/build/*.zip
variables:
WIN_ARCH: "i686"
build:win64:
extends: .build_win_template
script:
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh build
- unzip -q build/build/*.zip
variables:
WIN_ARCH: "x86_64"
##
## Docker
##
package:docker:
stage: package
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
- docker push ${CONTAINER_IMAGE}/server:latest
##
## Gitlab Pages (Lua API documentation)
##
pages:
stage: deploy
image: python:3.8
before_script:
- pip install git+https://github.com/Python-Markdown/markdown.git
- pip install git+https://github.com/mkdocs/mkdocs.git
- pip install pygments
script:
- cd doc/mkdocs && ./build.sh
- ./misc/make_redirects.sh
artifacts:
paths:
- public
only:
- master
##
## AppImage
##
package:appimage-client:
stage: package
image: appimagecrafters/appimage-builder
needs:
- build:ubuntu-18.04
before_script:
- apt-get update -y
- apt-get install -y git
# Collect files
- mkdir AppDir
- cp -a artifact/minetest/usr/ AppDir/usr/
- rm AppDir/usr/bin/minetestserver
- cp -a clientmods AppDir/usr/share/minetest
script:
- git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
- rm -rf AppDir/usr/share/minetest/games/minetest/.git
- export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
# Remove PrefersNonDefaultGPU property due to validation errors
- sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
- appimage-builder --skip-test
artifacts:
expire_in: 90 day
paths:
- ./*.AppImage

View file

@ -10,16 +10,19 @@ ignore = {
read_globals = {
"ItemStack",
"INIT",
"PLATFORM",
"DIR_DELIM",
"dump", "dump2",
"fgettext", "fgettext_ne",
"vector",
"VoxelArea",
"VoxelManip",
"profiler",
"Settings",
"PerlinNoise", "PerlinNoiseMap",
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn", "indexof", "insert_all"}},
table = {fields = {"copy", "getn", "indexof", "keyof", "insert_all"}},
math = {fields = {"hypot", "round"}},
}
@ -36,6 +39,12 @@ files["builtin/client/register.lua"] = {
}
}
files["builtin/common/math.lua"] = {
globals = {
"math",
},
}
files["builtin/common/misc_helpers.lua"] = {
globals = {
"dump", "dump2", "table", "math", "string",
@ -45,7 +54,7 @@ files["builtin/common/misc_helpers.lua"] = {
}
files["builtin/common/vector.lua"] = {
globals = { "vector" },
globals = { "vector", "math" },
}
files["builtin/game/voxelarea.lua"] = {
@ -67,10 +76,6 @@ files["builtin/mainmenu"] = {
globals = {
"gamedata",
},
read_globals = {
"PLATFORM",
},
}
files["builtin/common/tests"] = {

View file

@ -37,7 +37,7 @@ numzero <numzer0@yandex.ru> <silverunicorn2011@yandex.ru>
Jean-Patrick Guerrero <kilbith@users.noreply.github.com>
Jean-Patrick Guerrero <kilbith@users.noreply.github.com> <jeanpatrick.guerrero@gmail.com>
HybridDog <3192173+HybridDog@users.noreply.github.com> <ovvv@web.de>
srfqi <muhammadrifqipriyosusanto@gmail.com>
srifqi <muhammadrifqipriyosusanto@gmail.com>
Dániel Juhász <juhdanad@gmail.com>
rubenwardy <rw@rubenwardy.com>
rubenwardy <rw@rubenwardy.com> <rubenwardy@gmail.com>
@ -48,7 +48,8 @@ ClobberXD <ClobberXD@gmail.com> <ClobberXD@protonmail.com>
ClobberXD <ClobberXD@gmail.com> <36130650+ClobberXD@users.noreply.github.com>
Auke Kok <sofar+github@foo-projects.org>
Auke Kok <sofar+github@foo-projects.org> <sofar@foo-projects.org>
Desour <vorunbekannt75@web.de>
DS <ds.desour@proton.me>
DS <ds.desour@proton.me> <vorunbekannt75@web.de>
Nathanaëlle Courant <Ekdohibs@users.noreply.github.com> <nathanael.courant@laposte.net>
Ezhh <owlecho@live.com>
paramat <paramat@users.noreply.github.com>
@ -67,3 +68,8 @@ gregorycu <gregory.currie@gmail.com>
Rogier <rogier777@gmail.com>
Rogier <rogier777@gmail.com> <Rogier-5@users.noreply.github.com>
x2048 <codeforsmile@gmail.com>
Lars Müller <appgurulars@gmx.de>
Lars Müller <appgurulars@gmx.de> <34514239+appgurueu@users.noreply.github.com>
ROllerozxa <rollerozxa@voxelmanip.se>
ROllerozxa <rollerozxa@voxelmanip.se> <temporaryemail4meh+github@gmail.com>
Ælla Chiana Moskopp <erle@dieweltistgarnichtso.net> <nils@dieweltistgarnichtso.net>

5
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"recommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View file

@ -1,54 +0,0 @@
version: 1
AppDir:
path: ./AppDir
app_info:
id: minetest
name: Minetest
icon: minetest
version: !ENV ${VERSION}
exec: usr/bin/minetest
exec_args: $@
runtime:
env:
APPDIR_LIBRARY_PATH: $APPDIR/usr/lib/x86_64-linux-gnu
apt:
arch: amd64
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic main universe
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-backports main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe
include:
- libc6
- libcurl3-gnutls
- libfreetype6
- libgl1
- libjpeg-turbo8
- libjsoncpp1
- libleveldb1v5
- libopenal1
- libpng16-16
- libsqlite3-0
- libstdc++6
- libvorbisfile3
- libx11-6
- libxxf86vm1
- zlib1g
files:
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
AppImage:
update-information: None
sign-key: None
arch: x86_64

View file

@ -1,29 +1,22 @@
cmake_minimum_required(VERSION 3.5)
# Set policies up to 3.9 since we want to enable the IPO option
if(${CMAKE_VERSION} VERSION_LESS 3.9)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.9)
endif()
cmake_minimum_required(VERSION 3.12)
# This can be read from ${PROJECT_NAME} after project() is called
project(minetest)
set(PROJECT_NAME_CAPITALIZED "Minetest")
project(luanti)
set(PROJECT_NAME_CAPITALIZED "Luanti")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(GCC_MINIMUM_VERSION "5.1")
set(CLANG_MINIMUM_VERSION "3.5")
set(GCC_MINIMUM_VERSION "7.5")
set(CLANG_MINIMUM_VERSION "7.0.1")
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 6)
set(VERSION_MINOR 12)
set(VERSION_PATCH 0)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases
set(DEVELOPMENT_BUILD FALSE)
set(DEVELOPMENT_BUILD TRUE)
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(VERSION_EXTRA)
@ -37,10 +30,37 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(VERSION_STRING "${VERSION_STRING}-debug")
endif()
message(STATUS "*** Will build version ${VERSION_STRING} ***")
# Configuration options
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
set(BUILD_UNITTESTS TRUE CACHE BOOL "Build unittests")
set(BUILD_BENCHMARKS FALSE CACHE BOOL "Build benchmarks")
set(BUILD_DOCUMENTATION TRUE CACHE BOOL "Build documentation")
set(DEFAULT_ENABLE_LTO TRUE)
# by default don't enable on Debug builds to get faster builds
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(DEFAULT_ENABLE_LTO FALSE)
endif()
#### LTO testing list ####
# - Linux: seems to work always
# - win32/msvc: works
# - win32/gcc: fails to link
# - win32/clang: works
# - macOS on x86: seems to be fine
# - macOS on ARM: crashes, see <https://github.com/luanti-org/luanti/issues/14397>
# Note: since CMake has no easy architecture detection disabling for Mac entirely
#### ####
if((WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR APPLE)
set(DEFAULT_ENABLE_LTO FALSE)
endif()
set(ENABLE_LTO ${DEFAULT_ENABLE_LTO} CACHE BOOL "Use Link Time Optimization")
set(BUILD_WITH_TRACY FALSE CACHE BOOL
"Fetch and build with the Tracy profiler client")
set(FETCH_TRACY_GIT_TAG "master" CACHE STRING
"Git tag for fetching Tracy client. Match with your server (gui) version")
set(DEFAULT_RUN_IN_PLACE FALSE)
if(WIN32)
set(DEFAULT_RUN_IN_PLACE TRUE)
@ -48,11 +68,13 @@ endif()
set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
"Run directly in source directory structure")
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
set(BUILD_UNITTESTS TRUE CACHE BOOL "Build unittests")
set(BUILD_BENCHMARKS FALSE CACHE BOOL "Build benchmarks")
message(STATUS "*** Will build version ${VERSION_STRING} ***")
message(STATUS "BUILD_CLIENT: " ${BUILD_CLIENT})
message(STATUS "BUILD_SERVER: " ${BUILD_SERVER})
message(STATUS "BUILD_UNITTESTS: " ${BUILD_UNITTESTS})
message(STATUS "BUILD_BENCHMARKS: " ${BUILD_BENCHMARKS})
message(STATUS "BUILD_DOCUMENTATION: " ${BUILD_DOCUMENTATION})
message(STATUS "RUN_IN_PLACE: " ${RUN_IN_PLACE})
set(WARN_ALL TRUE CACHE BOOL "Enable -Wall for Release build")
@ -67,27 +89,17 @@ set(ENABLE_UPDATE_CHECKER (NOT ${DEVELOPMENT_BUILD}) CACHE BOOL
# Included stuff
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Load default options for Android
if(ANDROID)
cmake_minimum_required(VERSION 3.20)
include(AndroidLibs)
endif()
set(IRRLICHTMT_BUILD_DIR "" CACHE PATH "Path to IrrlichtMt build directory.")
if(NOT "${IRRLICHTMT_BUILD_DIR}" STREQUAL "")
find_package(IrrlichtMt QUIET
PATHS "${IRRLICHTMT_BUILD_DIR}"
NO_DEFAULT_PATH
)
if(NOT TARGET IrrlichtMt::IrrlichtMt)
# find_package() searches certain subdirectories. ${PATH}/cmake is not
# the only one, but it is the one where IrrlichtMt is supposed to export
# IrrlichtMtConfig.cmake
message(FATAL_ERROR "Could not find IrrlichtMtConfig.cmake in ${IRRLICHTMT_BUILD_DIR}/cmake.")
endif()
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt")
message(STATUS "Using user-provided IrrlichtMt at subdirectory 'lib/irrlichtmt'")
if(TRUE)
message(STATUS "Using imported IrrlichtMt at subdirectory 'irr'")
if(BUILD_CLIENT)
# tell IrrlichtMt to create a static library
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library" FORCE)
add_subdirectory(lib/irrlichtmt EXCLUDE_FROM_ALL)
unset(BUILD_SHARED_LIBS CACHE)
add_subdirectory(irr EXCLUDE_FROM_ALL)
if(NOT TARGET IrrlichtMt)
message(FATAL_ERROR "IrrlichtMt project is missing a CMake target?!")
@ -95,48 +107,36 @@ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt")
else()
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
set_target_properties(IrrlichtMt::IrrlichtMt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include")
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/irr/include")
endif()
endif()
if (ENABLE_LTO OR CMAKE_INTERPROCEDURAL_OPTIMIZATION)
include(CheckIPOSupported)
check_ipo_supported(RESULT lto_supported OUTPUT lto_output)
if(lto_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
message(STATUS "LTO/IPO is enabled")
else()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
message(STATUS "LTO/IPO was requested but is not supported by the compiler: ${lto_output}")
endif()
else()
find_package(IrrlichtMt QUIET)
if(NOT TARGET IrrlichtMt::IrrlichtMt)
string(CONCAT explanation_msg
"The Minetest team has forked Irrlicht to make their own customizations. "
"It can be found here: https://github.com/minetest/irrlicht\n"
"For example use: git clone --depth=1 https://github.com/minetest/irrlicht lib/irrlichtmt\n")
if(BUILD_CLIENT)
message(FATAL_ERROR "IrrlichtMt is required to build the client, but it was not found.\n${explanation_msg}")
endif()
include(MinetestFindIrrlichtHeaders)
if(NOT IRRLICHT_INCLUDE_DIR)
message(FATAL_ERROR "IrrlichtMt headers are required to build the server, but none found.\n${explanation_msg}")
endif()
message(STATUS "Found IrrlichtMt headers: ${IRRLICHT_INCLUDE_DIR}")
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
# Note that we can't use target_include_directories() since that doesn't work for IMPORTED targets before CMake 3.11
set_target_properties(IrrlichtMt::IrrlichtMt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${IRRLICHT_INCLUDE_DIR}")
endif()
message(STATUS "LTO/IPO is not enabled")
endif()
if(BUILD_CLIENT AND TARGET IrrlichtMt::IrrlichtMt)
# retrieve version somehow
if(NOT IrrlichtMt_VERSION)
get_target_property(IrrlichtMt_VERSION IrrlichtMt VERSION)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GCC_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient gcc version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${GCC_MINIMUM_VERSION} or higher is required.")
endif()
message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}")
set(TARGET_VER_S 1.9.0mt7)
string(REPLACE "mt" "." TARGET_VER ${TARGET_VER_S})
if(IrrlichtMt_VERSION VERSION_LESS ${TARGET_VER})
message(FATAL_ERROR "At least IrrlichtMt ${TARGET_VER_S} is required to build")
elseif(NOT DEVELOPMENT_BUILD AND IrrlichtMt_VERSION VERSION_GREATER ${TARGET_VER})
message(FATAL_ERROR "IrrlichtMt ${TARGET_VER_S} is required to build")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${CLANG_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient clang version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${CLANG_MINIMUM_VERSION} or higher is required.")
endif()
endif()
# Installation
if(WIN32)
@ -161,7 +161,7 @@ elseif(UNIX) # Linux, BSD etc
set(EXAMPLE_CONF_DIR ".")
set(MANDIR "unix/man")
set(XDG_APPS_DIR "unix/applications")
set(APPDATADIR "unix/metainfo")
set(METAINFODIR "unix/metainfo")
set(ICONDIR "unix/icons")
set(LOCALEDIR "locale")
else()
@ -172,7 +172,7 @@ elseif(UNIX) # Linux, BSD etc
set(MANDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_MANDIR}")
set(EXAMPLE_CONF_DIR ${DOCDIR})
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications")
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/metainfo")
set(METAINFODIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/metainfo")
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/icons")
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALEDIR}")
endif()
@ -236,10 +236,12 @@ if(RUN_IN_PLACE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
endif()
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINETEST_GAME" OPTIONAL PATTERN ".git*" EXCLUDE )
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/devtest" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE )
set(INSTALL_DEVTEST FALSE CACHE BOOL "Install Development Test")
if(INSTALL_DEVTEST)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/devtest" DESTINATION "${SHAREDIR}/games/"
PATTERN ".git*" EXCLUDE )
endif()
if(BUILD_CLIENT)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/client/shaders" DESTINATION "${SHAREDIR}/client")
@ -251,59 +253,51 @@ if(BUILD_CLIENT)
endif()
install(FILES "README.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/client_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/client_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/menu_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
if(UNIX AND NOT APPLE)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
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.appdata.xml" DESTINATION "${APPDATADIR}")
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
install(FILES "misc/minetest-xorg-icon-128.png"
install(FILES "misc/net.minetest.minetest.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"
RENAME "minetest.png")
RENAME "luanti.png")
endif()
if(APPLE)
install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}")
install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
install(FILES "misc/luanti-icon.icns" DESTINATION "${SHAREDIR}")
install(FILES "${CMAKE_BINARY_DIR}/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
endif()
if(CMAKE_GENERATOR STREQUAL "Xcode")
set(client_RESOURCES "${CMAKE_SOURCE_DIR}/misc/luanti-icon.icns")
endif()
# Library pack
find_package(GMP REQUIRED)
find_package(Json REQUIRED)
find_package(Json 1.0.0 REQUIRED)
find_package(Lua REQUIRED)
if(NOT USE_LUAJIT)
set(LUA_BIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/bitop)
set(LUA_BIT_LIBRARY bitop)
add_subdirectory(lib/bitop)
endif()
add_subdirectory(lib/sha256)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GCC_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient gcc version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${GCC_MINIMUM_VERSION} or higher is required.")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${CLANG_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient clang version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${CLANG_MINIMUM_VERSION} or higher is required.")
endif()
endif()
if(BUILD_BENCHMARKS)
if(BUILD_UNITTESTS OR BUILD_BENCHMARKS)
add_subdirectory(lib/catch2)
endif()
add_subdirectory(lib/tiniergltf)
# Subdirectories
# Be sure to add all relevant definitions above this
add_subdirectory(src)
# CPack
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A free open-source voxel game engine with easy modding and game creation.")
@ -317,28 +311,11 @@ include(CPackComponent)
cpack_add_component(Docs
DISPLAY_NAME "Documentation"
DESCRIPTION "Documentation about Minetest and Minetest modding"
)
cpack_add_component(SUBGAME_MINETEST_GAME
DISPLAY_NAME "Minetest Game"
DESCRIPTION "The default game bundled in the Minetest engine. Mainly used as a modding base."
GROUP "Games"
)
cpack_add_component(SUBGAME_MINIMAL
DISPLAY_NAME "Development Test"
DESCRIPTION "A basic testing environment used for engine development and sometimes for testing mods."
DISABLED #DISABLED does not mean it is disabled, and is just not selected by default.
GROUP "Games"
)
cpack_add_component_group(Subgames
DESCRIPTION "Games for the Minetest engine."
DESCRIPTION "Documentation about ${PROJECT_NAME_CAPITALIZED} and ${PROJECT_NAME_CAPITALIZED} modding"
)
if(WIN32)
# Include all dynamically linked runtime libaries such as MSVCRxxx.dll
# Include all dynamically linked runtime libraries such as MSVCRxxx.dll
include(InstallRequiredSystemLibraries)
if(RUN_IN_PLACE)
@ -358,7 +335,7 @@ if(WIN32)
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
set(CPACK_PACKAGING_INSTALL_PREFIX "/${PROJECT_NAME_CAPITALIZED}")
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/misc/minetest-icon.ico")
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/misc/luanti-icon.ico")
# Supported languages can be found at
# http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html
#set(CPACK_WIX_CULTURES "ar-SA,bg-BG,ca-ES,hr-HR,cs-CZ,da-DK,nl-NL,en-US,et-EE,fi-FI,fr-FR,de-DE")
@ -390,13 +367,31 @@ include(CPack)
# Add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
if(BUILD_DOCUMENTATION)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
endif()
# Fetch Tracy
if(BUILD_WITH_TRACY)
include(FetchContent)
message(STATUS "Fetching Tracy (${FETCH_TRACY_GIT_TAG})...")
FetchContent_Declare(
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG ${FETCH_TRACY_GIT_TAG}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(tracy)
message(STATUS "Fetching Tracy - done")
endif()

41
CMakePresets.json Normal file
View file

@ -0,0 +1,41 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 12
},
"configurePresets": [
{
"name": "Debug",
"displayName": "Debug",
"description": "Debug preset with debug symbols and no optimizations",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "Release",
"displayName": "Release",
"description": "Release preset with optimizations and no debug symbols",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "RelWithDebInfo",
"displayName": "RelWithDebInfo",
"description": "Release with debug symbols",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "MinSizeRel",
"displayName": "MinSizeRel",
"description": "Release with minimal code size",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
}
]
}

1
CNAME Normal file
View file

@ -0,0 +1 @@
api.luanti.org

502
COPYING.LESSER Normal file
View file

@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,71 +1,82 @@
ARG DOCKER_IMAGE=alpine:3.14
FROM $DOCKER_IMAGE AS builder
ARG DOCKER_IMAGE=alpine:3.19
FROM $DOCKER_IMAGE AS dev
ENV MINETEST_GAME_VERSION master
ENV IRRLICHT_VERSION master
ENV LUAJIT_VERSION v2.1
COPY .git /usr/src/minetest/.git
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
COPY README.md /usr/src/minetest/README.md
COPY minetest.conf.example /usr/src/minetest/minetest.conf.example
COPY builtin /usr/src/minetest/builtin
COPY cmake /usr/src/minetest/cmake
COPY doc /usr/src/minetest/doc
COPY fonts /usr/src/minetest/fonts
COPY lib /usr/src/minetest/lib
COPY misc /usr/src/minetest/misc
COPY po /usr/src/minetest/po
COPY src /usr/src/minetest/src
COPY textures /usr/src/minetest/textures
WORKDIR /usr/src/minetest
RUN apk add --no-cache git build-base cmake sqlite-dev curl-dev zlib-dev zstd-dev \
gmp-dev jsoncpp-dev postgresql-dev ninja luajit-dev ca-certificates && \
git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
rm -fr ./games/minetest_game/.git
RUN apk add --no-cache git build-base cmake curl-dev zlib-dev zstd-dev \
sqlite-dev postgresql-dev hiredis-dev leveldb-dev \
gmp-dev jsoncpp-dev ninja ca-certificates
WORKDIR /usr/src/
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
cd prometheus-cpp && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 \
-GNinja && \
cmake --build build && \
cmake --install build
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp && \
cd prometheus-cpp && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 \
-GNinja && \
cmake --build build && \
cmake --install build && \
cd /usr/src/ && \
git clone --recursive https://github.com/libspatialindex/libspatialindex && \
cd libspatialindex && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local && \
cmake --build build && \
cmake --install build && \
cd /usr/src/ && \
git clone --recursive https://luajit.org/git/luajit.git -b ${LUAJIT_VERSION} && \
cd luajit && \
make amalg && make install && \
cd /usr/src/
RUN git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
cp -r irrlicht/include /usr/include/irrlichtmt
FROM dev as builder
WORKDIR /usr/src/minetest
COPY .git /usr/src/luanti/.git
COPY CMakeLists.txt /usr/src/luanti/CMakeLists.txt
COPY README.md /usr/src/luanti/README.md
COPY minetest.conf.example /usr/src/luanti/minetest.conf.example
COPY builtin /usr/src/luanti/builtin
COPY cmake /usr/src/luanti/cmake
COPY doc /usr/src/luanti/doc
COPY fonts /usr/src/luanti/fonts
COPY lib /usr/src/luanti/lib
COPY misc /usr/src/luanti/misc
COPY po /usr/src/luanti/po
COPY src /usr/src/luanti/src
COPY irr /usr/src/luanti/irr
COPY textures /usr/src/luanti/textures
WORKDIR /usr/src/luanti
RUN cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SERVER=TRUE \
-DENABLE_PROMETHEUS=TRUE \
-DBUILD_UNITTESTS=FALSE \
-DBUILD_UNITTESTS=FALSE -DBUILD_BENCHMARKS=FALSE \
-DBUILD_CLIENT=FALSE \
-GNinja && \
cmake --build build && \
cmake --install build
ARG DOCKER_IMAGE=alpine:3.14
FROM $DOCKER_IMAGE AS runtime
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit jsoncpp zstd-libs && \
RUN apk add --no-cache curl gmp libstdc++ libgcc libpq jsoncpp zstd-libs \
sqlite-libs postgresql hiredis leveldb && \
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
chown -R minetest:minetest /var/lib/minetest
WORKDIR /var/lib/minetest
COPY --from=builder /usr/local/share/minetest /usr/local/share/minetest
COPY --from=builder /usr/local/bin/minetestserver /usr/local/bin/minetestserver
COPY --from=builder /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
COPY --from=builder /usr/local/share/luanti /usr/local/share/luanti
COPY --from=builder /usr/local/bin/luantiserver /usr/local/bin/luantiserver
COPY --from=builder /usr/local/share/doc/luanti/minetest.conf.example /etc/minetest/minetest.conf
COPY --from=builder /usr/local/lib/libspatialindex* /usr/local/lib/
COPY --from=builder /usr/local/lib/libluajit* /usr/local/lib/
USER minetest:minetest
EXPOSE 30000/udp 30000/tcp
VOLUME /var/lib/minetest/ /etc/minetest/
CMD ["/usr/local/bin/minetestserver", "--config", "/etc/minetest/minetest.conf"]
ENTRYPOINT ["/usr/local/bin/luantiserver"]
CMD ["--config", "/etc/minetest/minetest.conf"]

View file

@ -1,8 +1,8 @@
License of Minetest textures and sounds
License of Luanti textures and sounds
---------------------------------------
This applies to textures and sounds contained in the main Minetest
This applies to textures and sounds contained in the main Luanti
distribution.
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
@ -14,6 +14,12 @@ https://www.apache.org/licenses/LICENSE-2.0.html
Textures by Zughy are under CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/
Textures by cx384 are under CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/
Media files by DS are under CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/
textures/base/pack/server_public.png is under CC-BY 4.0, taken from Twitter's Twemoji set
https://creativecommons.org/licenses/by/4.0/
@ -26,7 +32,6 @@ ShadowNinja:
textures/base/pack/smoke_puff.png
paramat:
textures/base/pack/menu_header.png
textures/base/pack/next_icon.png
textures/base/pack/prev_icon.png
textures/base/pack/clear.png
@ -36,10 +41,10 @@ rubenwardy, paramat:
textures/base/pack/start_icon.png
textures/base/pack/end_icon.png
erlehmann:
misc/minetest-icon-24x24.png
misc/minetest-icon.ico
misc/minetest.svg
erle:
misc/luanti-icon-24x24.png
misc/luanti-icon.ico
misc/luanti.svg
textures/base/pack/logo.png
JRottm:
@ -54,30 +59,56 @@ srifqi:
textures/base/pack/minimap_btn.png
Zughy:
textures/base/pack/cdb_add.png
textures/base/pack/cdb_clear.png
textures/base/pack/cdb_downloading.png
textures/base/pack/cdb_queued.png
textures/base/pack/cdb_update.png
textures/base/pack/cdb_viewonline.png
textures/base/pack/cdb_update_cropped.png
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
textures/base/pack/server_url.png
textures/base/pack/server_url_unavailable.png
textures/base/pack/server_view_clients.png
textures/base/pack/server_view_clients_unavailable.png
cx384:
textures/base/pack/server_view_mods.png
textures/base/pack/server_view_mods_unavailable.png
appgurueu:
textures/base/pack/server_incompatible.png
erlehmann, Warr1024, rollerozxa:
erle, Warr1024, rollerozxa:
textures/base/pack/no_screenshot.png
kilbith:
textures/base/pack/server_favorite.png
textures/base/pack/progress_bar.png
textures/base/pack/progress_bar_bg.png
SmallJoker
SmallJoker:
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)
License of Minetest source code
DS:
games/devtest/mods/soundstuff/textures/soundstuff_bigfoot.png
games/devtest/mods/soundstuff/textures/soundstuff_jukebox.png
games/devtest/mods/soundstuff/textures/soundstuff_racecar.png
games/devtest/mods/soundstuff/sounds/soundstuff_sinus.ogg
games/devtest/mods/testtools/textures/testtools_branding_iron.png
grorp:
textures/base/pack/exit_btn.png
textures/base/pack/menu_header.png
using the font "undefined medium" (https://undefined-medium.com/),
which is licensed under the SIL Open Font License, Version 1.1
modified by DS
License of Luanti source code
-------------------------------
Minetest
Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
Luanti
Copyright (C) 2010-2024 celeron55, Perttu Ahola <celeron55@gmail.com>
and contributors (see source file comments and the version control log)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -96,7 +127,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Irrlicht
---------------
This program uses IrrlichtMt, Minetest's fork of
This program uses IrrlichtMt, Luanti's fork of
the Irrlicht Engine. http://irrlicht.sourceforge.net/
The Irrlicht Engine License

384
README.md
View file

@ -1,21 +1,17 @@
Minetest
========
<div align="center">
<img src="textures/base/pack/logo.png" width="32%">
<h1>Luanti (formerly Minetest)</h1>
<img src="https://github.com/luanti-org/luanti/workflows/build/badge.svg" alt="Build Status">
<a href="https://hosted.weblate.org/engage/minetest/?utm_source=widget"><img src="https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg" alt="Translation status"></a>
<a href="https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html"><img src="https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg" alt="License"></a>
</div>
<br><br>
![Build Status](https://github.com/minetest/minetest/workflows/build/badge.svg)
[![Translation status](https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg)](https://hosted.weblate.org/engage/minetest/?utm_source=widget)
[![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
Luanti is a free open-source voxel game engine with easy modding and game creation.
Minetest is a free open-source voxel game engine with easy modding and game creation.
Copyright (C) 2010-2022 Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2010-2025 Perttu Ahola <celeron55@gmail.com>
and contributors (see source file comments and the version control log)
In case you downloaded the source code
--------------------------------------
If you downloaded the Minetest Engine source code in which this file is
contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/)
project too. See its README.txt for more information.
Table of Contents
------------------
@ -31,11 +27,11 @@ Table of Contents
Further documentation
----------------------
- Website: https://minetest.net/
- Wiki: https://wiki.minetest.net/
- Developer wiki: https://dev.minetest.net/
- Forum: https://forum.minetest.net/
- GitHub: https://github.com/minetest/minetest/
- Website: https://www.luanti.org/
- Wiki: https://wiki.luanti.org/
- Forum: https://forum.luanti.org/
- GitHub: https://github.com/luanti-org/luanti/
- [Developer documentation](doc/developing/)
- [doc/](doc/) directory of source distribution
Default controls
@ -51,7 +47,7 @@ Some can be changed in the key config dialog in the settings tab.
| Shift | Sneak/move down |
| Q | Drop itemstack |
| Shift + Q | Drop single item |
| Left mouse button | Dig/punch/take item |
| Left mouse button | Dig/punch/use |
| Right mouse button | Place/use |
| Shift + right mouse button | Build (without using) |
| I | Inventory menu |
@ -61,11 +57,9 @@ 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) |
| R | Enable/disable full range view |
| + | Increase view range |
| - | Decrease view range |
| K | Enable/disable fly mode (needs fly privilege) |
| P | Enable/disable pitch move mode |
| J | Enable/disable fast mode (needs fast privilege) |
| H | Enable/disable noclip mode (needs noclip privilege) |
| E | Aux1 (Move fast in fast mode. Games may add special features) |
@ -98,15 +92,15 @@ Where each location is on each platform:
* Windows installed:
* `bin` = `C:\Program Files\Minetest\bin (Depends on the install location)`
* `share` = `C:\Program Files\Minetest (Depends on the install location)`
* `user` = `%APPDATA%\Minetest`
* `user` = `%APPDATA%\Minetest` or `%MINETEST_USER_PATH%`
* Linux installed:
* `bin` = `/usr/bin`
* `share` = `/usr/share/minetest`
* `user` = `~/.minetest`
* `user` = `~/.minetest` or `$MINETEST_USER_PATH`
* macOS:
* `bin` = `Contents/MacOS`
* `share` = `Contents/Resources`
* `user` = `Contents/User OR ~/Library/Application Support/minetest`
* `user` = `Contents/User` or `~/Library/Application Support/minetest` or `$MINETEST_USER_PATH`
Worlds can be found as separate folders in: `user/worlds/`
@ -114,7 +108,7 @@ Configuration file
------------------
- Default location:
`user/minetest.conf`
- This file is created by closing Minetest for the first time.
- This file is created by closing Luanti for the first time.
- A specific file can be specified on the command line:
`--config <path-to-file>`
- A run-in-place build will look for the configuration file in
@ -126,343 +120,17 @@ Command-line options
Compiling
---------
### Compiling on GNU/Linux
#### Dependencies
| Dependency | Version | Commentary |
|------------|---------|------------|
| GCC | 5.1+ | or Clang 3.5+ |
| CMake | 3.5+ | |
| IrrlichtMt | - | Custom version of Irrlicht, see https://github.com/minetest/irrlicht |
| Freetype | 2.0+ | |
| SQLite3 | 3+ | |
| Zstd | 1.0+ | |
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
| GMP | 5.0.0+ | Bundled mini-GMP is used if not present |
| JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present |
For Debian/Ubuntu users:
sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev
For Fedora users:
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libvorbis-devel libXi-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel libzstd-devel
For Arch users:
sudo pacman -S base-devel libcurl-gnutls cmake libxi libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd
For Alpine users:
sudo apk add build-base cmake libpng-dev jpeg-dev libxi-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev zstd-dev
#### Download
You can install Git for easily keeping your copy up to date.
If you dont want Git, read below on how to get the source without Git.
This is an example for installing Git on Debian/Ubuntu:
sudo apt install git
For Fedora users:
sudo dnf install git
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
git clone --depth 1 https://github.com/minetest/minetest.git
cd minetest
Download minetest_game (otherwise only the "Development Test" game is available) using Git:
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
Download IrrlichtMt to `lib/irrlichtmt`, it will be used to satisfy the IrrlichtMt dependency that way:
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt
Download source, without using Git:
wget https://github.com/minetest/minetest/archive/master.tar.gz
tar xf master.tar.gz
cd minetest-master
Download minetest_game, without using Git:
cd games/
wget https://github.com/minetest/minetest_game/archive/master.tar.gz
tar xf master.tar.gz
mv minetest_game-master minetest_game
cd ..
Download IrrlichtMt, without using Git:
cd lib/
wget https://github.com/minetest/irrlicht/archive/master.tar.gz
tar xf master.tar.gz
mv irrlicht-master irrlichtmt
cd ..
#### Build
Build a version that runs directly from the source directory:
cmake . -DRUN_IN_PLACE=TRUE
make -j$(nproc)
Run it:
./bin/minetest
- 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`.
- You can build a bare server by specifying `-DBUILD_SERVER=TRUE`.
- You can disable the client build by specifying `-DBUILD_CLIENT=FALSE`.
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
- Debug build is slower, but gives much more useful output in a debugger.
- If you build a bare server you don't need to compile IrrlichtMt, just the headers suffice.
- In that case use `-DIRRLICHT_INCLUDE_DIR=/some/where/irrlichtmt/include`.
- Minetest will use the IrrlichtMt package that is found first, given by the following order:
1. Specified `IRRLICHTMT_BUILD_DIR` CMake variable
2. `${PROJECT_SOURCE_DIR}/lib/irrlichtmt` (if existent)
3. Installation of IrrlichtMt in the system-specific library paths
4. For server builds with disabled `BUILD_CLIENT` variable, the headers from `IRRLICHT_INCLUDE_DIR` will be used.
- NOTE: Changing the IrrlichtMt build directory (includes system installs) requires regenerating the CMake cache (`rm CMakeCache.txt`)
### CMake options
General options and their default values:
BUILD_CLIENT=TRUE - Build Minetest client
BUILD_SERVER=FALSE - Build Minetest server
BUILD_UNITTESTS=TRUE - Build unittest sources
BUILD_BENCHMARKS=FALSE - Build benchmark sources
CMAKE_BUILD_TYPE=Release - Type of build (Release vs. Debug)
Release - Release build
Debug - Debug build
SemiDebug - Partially optimized debug build
RelWithDebInfo - Release build with debug information
MinSizeRel - Release build with -Os passed to compiler to make executable as small as possible
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
ENABLE_GLES=OFF - Enable extra support code for OpenGL ES (requires support by IrrlichtMt)
ENABLE_LEVELDB=ON - Build with LevelDB; Enables use of LevelDB map backend
ENABLE_POSTGRESQL=ON - Build with libpq; Enables use of PostgreSQL map backend (PostgreSQL 9.5 or greater recommended)
ENABLE_REDIS=ON - Build with libhiredis; Enables use of Redis map backend
ENABLE_SPATIAL=ON - Build with LibSpatial; Speeds up AreaStores
ENABLE_SOUND=ON - Build with OpenAL, libogg & libvorbis; in-game sounds
ENABLE_LUAJIT=ON - Build with LuaJIT (much faster than non-JIT Lua)
ENABLE_PROMETHEUS=OFF - Build with Prometheus metrics exporter (listens on tcp/30000 by default)
ENABLE_SYSTEM_GMP=ON - Use GMP from system (much faster than bundled mini-gmp)
ENABLE_SYSTEM_JSONCPP=ON - Use JsonCPP from system
RUN_IN_PLACE=FALSE - Create a portable install (worlds, settings etc. in current directory)
ENABLE_UPDATE_CHECKER=TRUE - Whether to enable update checks by default
USE_GPROF=FALSE - Enable profiling using GProf
VERSION_EXTRA= - Text to append to version (e.g. VERSION_EXTRA=foobar -> Minetest 0.4.9-foobar)
ENABLE_TOUCH=FALSE - Enable Touchscreen support (requires support by IrrlichtMt)
Library specific options:
CURL_DLL - Only if building with cURL on Windows; path to libcurl.dll
CURL_INCLUDE_DIR - Only if building with cURL; directory where curl.h is located
CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib
EGL_INCLUDE_DIR - Only if building with GLES; directory that contains egl.h
EGL_LIBRARY - Only if building with GLES; path to libEGL.a/libEGL.so
EXTRA_DLL - Only on Windows; optional paths to additional DLLs that should be packaged
FREETYPE_INCLUDE_DIR_freetype2 - Directory that contains files such as ftimage.h
FREETYPE_INCLUDE_DIR_ft2build - Directory that contains ft2build.h
FREETYPE_LIBRARY - Path to libfreetype.a/libfreetype.so/freetype.lib
FREETYPE_DLL - Only on Windows; path to libfreetype-6.dll
GETTEXT_DLL - Only when building with gettext on Windows; paths to libintl + libiconv DLLs
GETTEXT_INCLUDE_DIR - Only when building with gettext; directory that contains iconv.h
GETTEXT_LIBRARY - Only when building with gettext on Windows; path to libintl.dll.a
GETTEXT_MSGFMT - Only when building with gettext; path to msgfmt/msgfmt.exe
IRRLICHT_DLL - Only on Windows; path to IrrlichtMt.dll
IRRLICHT_INCLUDE_DIR - Directory that contains IrrCompileConfig.h (usable for server build only)
LEVELDB_INCLUDE_DIR - Only when building with LevelDB; directory that contains db.h
LEVELDB_LIBRARY - Only when building with LevelDB; path to libleveldb.a/libleveldb.so/libleveldb.dll.a
LEVELDB_DLL - Only when building with LevelDB on Windows; path to libleveldb.dll
PostgreSQL_INCLUDE_DIR - Only when building with PostgreSQL; directory that contains libpq-fe.h
PostgreSQL_LIBRARY - Only when building with PostgreSQL; path to libpq.a/libpq.so/libpq.lib
REDIS_INCLUDE_DIR - Only when building with Redis; directory that contains hiredis.h
REDIS_LIBRARY - Only when building with Redis; path to libhiredis.a/libhiredis.so
SPATIAL_INCLUDE_DIR - Only when building with LibSpatial; directory that contains spatialindex/SpatialIndex.h
SPATIAL_LIBRARY - Only when building with LibSpatial; path to libspatialindex_c.so/spatialindex-32.lib
LUA_INCLUDE_DIR - Only if you want to use LuaJIT; directory where luajit.h is located
LUA_LIBRARY - Only if you want to use LuaJIT; path to libluajit.a/libluajit.so
OGG_DLL - Only if building with sound on Windows; path to libogg.dll
OGG_INCLUDE_DIR - Only if building with sound; directory that contains an ogg directory which contains ogg.h
OGG_LIBRARY - Only if building with sound; path to libogg.a/libogg.so/libogg.dll.a
OPENAL_DLL - Only if building with sound on Windows; path to OpenAL32.dll
OPENAL_INCLUDE_DIR - Only if building with sound; directory where al.h is located
OPENAL_LIBRARY - Only if building with sound; path to libopenal.a/libopenal.so/OpenAL32.lib
SQLITE3_INCLUDE_DIR - Directory that contains sqlite3.h
SQLITE3_LIBRARY - Path to libsqlite3.a/libsqlite3.so/sqlite3.lib
VORBISFILE_LIBRARY - Only if building with sound; path to libvorbisfile.a/libvorbisfile.so/libvorbisfile.dll.a
VORBIS_DLL - Only if building with sound on Windows; paths to vorbis DLLs
VORBIS_INCLUDE_DIR - Only if building with sound; directory that contains a directory vorbis with vorbisenc.h inside
VORBIS_LIBRARY - Only if building with sound; path to libvorbis.a/libvorbis.so/libvorbis.dll.a
ZLIB_DLL - Only on Windows; path to zlib1.dll
ZLIB_INCLUDE_DIR - Directory that contains zlib.h
ZLIB_LIBRARY - Path to libz.a/libz.so/zlib.lib
ZSTD_DLL - Only on Windows; path to libzstd.dll
ZSTD_INCLUDE_DIR - Directory that contains zstd.h
ZSTD_LIBRARY - Path to libzstd.a/libzstd.so/ztd.lib
### Compiling on Windows using MSVC
### Requirements
- [Visual Studio 2015 or newer](https://visualstudio.microsoft.com)
- [CMake](https://cmake.org/download/)
- [vcpkg](https://github.com/Microsoft/vcpkg)
- [Git](https://git-scm.com/downloads)
### Compiling and installing the dependencies
It is highly recommended to use vcpkg as package manager.
After you successfully built vcpkg you can easily install the required libraries:
```powershell
vcpkg install zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry --triplet x64-windows
```
- **Don't forget about IrrlichtMt.** The easiest way is to clone it to `lib/irrlichtmt` as described in the Linux section.
- `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store.
- `openal-soft`, `libvorbis` and `libogg` are optional, but required to use sound.
- `luajit` is optional, it replaces the integrated Lua interpreter with a faster just-in-time interpreter.
- `gmp` and `jsoncpp` are optional, otherwise the bundled versions will be compiled
There are other optional libraries, but they are not tested if they can build and link correctly.
Use `--triplet` to specify the target triplet, e.g. `x64-windows` or `x86-windows`.
### Compile Minetest
#### a) Using the vcpkg toolchain and CMake GUI
1. Start up the CMake GUI
2. Select **Browse Source...** and select DIR/minetest
3. Select **Browse Build...** and select DIR/minetest-build
4. Select **Configure**
5. Choose the right visual Studio version and target platform. It has to match the version of the installed dependencies
6. Choose **Specify toolchain file for cross-compiling**
7. Click **Next**
8. Select the vcpkg toolchain file e.g. `D:/vcpkg/scripts/buildsystems/vcpkg.cmake`
9. Click Finish
10. Wait until cmake have generated the cash file
11. If there are any errors, solve them and hit **Configure**
12. Click **Generate**
13. Click **Open Project**
14. Compile Minetest inside Visual studio.
#### b) Using the vcpkg toolchain and the commandline
Run the following script in PowerShell:
```powershell
cmake . -G"Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=OFF -DENABLE_CURSES=OFF
cmake --build . --config Release
```
Make sure that the right compiler is selected and the path to the vcpkg toolchain is correct.
### Windows Installer using WiX Toolset
Requirements:
* [Visual Studio 2017](https://visualstudio.microsoft.com/)
* [WiX Toolset](https://wixtoolset.org/)
In the Visual Studio 2017 Installer select **Optional Features -> WiX Toolset**.
Build the binaries as described above, but make sure you unselect `RUN_IN_PLACE`.
Open the generated project file with Visual Studio. Right-click **Package** and choose **Generate**.
It may take some minutes to generate the installer.
### Compiling on MacOS
#### Requirements
- [Homebrew](https://brew.sh/)
- [Git](https://git-scm.com/downloads)
Install dependencies with homebrew:
```
brew install cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd
```
#### Download
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
```bash
git clone --depth 1 https://github.com/minetest/minetest.git
cd minetest
```
Download minetest_game (otherwise only the "Development Test" game is available) using Git:
```
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
```
Download Minetest's fork of Irrlicht:
```
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt
```
#### Build
```bash
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE
make -j$(sysctl -n hw.logicalcpu)
make install
```
#### Run
```
open ./build/macos/minetest.app
```
- [Compiling - common information](doc/compiling/README.md)
- [Compiling on GNU/Linux](doc/compiling/linux.md)
- [Compiling on Windows](doc/compiling/windows.md)
- [Compiling on MacOS](doc/compiling/macos.md)
Docker
------
We provide Minetest server Docker images using the GitLab mirror registry.
Images are built on each commit and available using the following tag scheme:
* `registry.gitlab.com/minetest/minetest/server:latest` (latest build)
* `registry.gitlab.com/minetest/minetest/server:<branch/tag>` (current branch or current tag)
* `registry.gitlab.com/minetest/minetest/server:<commit-id>` (current commit id)
If you want to test it on a Docker server you can easily run:
sudo docker run registry.gitlab.com/minetest/minetest/server:<docker tag>
If you want to use it in a production environment you should use volumes bound to the Docker host
to persist data and modify the configuration:
sudo docker create -v /home/minetest/data/:/var/lib/minetest/ -v /home/minetest/conf/:/etc/minetest/ registry.gitlab.com/minetest/minetest/server:master
Data will be written to `/home/minetest/data` on the host, and configuration will be read from `/home/minetest/conf/minetest.conf`.
**Note:** If you don't understand the previous commands please read the official Docker documentation before use.
You can also host your Minetest server inside a Kubernetes cluster. See our example implementation in [`misc/kubernetes.yml`](misc/kubernetes.yml).
- [Developing minetestserver with Docker](doc/developing/docker.md)
- [Running a server with Docker](doc/docker_server.md)
Version scheme
--------------

View file

@ -0,0 +1,17 @@
diff --git a/android/app/src/main/java/org/libsdl/app/SDLActivity.java b/android/app/src/main/java/org/libsdl/app/SDLActivity.java
--- a/android/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -1345,7 +1345,12 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
}
- if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
+ if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE ||
+ /*
+ * CUSTOM ADDITION FOR LUANTI
+ * should be upstreamed
+ */
+ (source & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE) {
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
// they are ignored here because sending them as mouse input to SDL is messy
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {

View file

@ -1,14 +1,18 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
ndkVersion "$ndk_version"
defaultConfig {
applicationId 'net.minetest.minetest'
minSdkVersion 16
targetSdkVersion 30
minSdkVersion 21
compileSdk 34
targetSdkVersion 34
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode
versionCode versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
}
buildFeatures {
buildConfig true
}
// load properties
@ -40,7 +44,7 @@ android {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
@ -48,69 +52,71 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'net.minetest.minetest'
}
task prepareAssets() {
def assetsFolder = "build/assets"
def projRoot = "../.."
def gameToCopy = "minetest_game"
def projRoot = rootDir.parent
copy {
from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
// See issue #4638
def unsupportedLanguages = new File("${projRoot}/src/unsupported_language_list.txt").text.readLines()
doFirst {
logger.lifecycle('Preparing assets at {}', assetsFolder)
}
copy {
from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}"
}
copy {
from "${projRoot}/builtin" into "${assetsFolder}/builtin"
}
copy {
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
}
copy {
from "../native/deps/armeabi-v7a/Irrlicht/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
}
copy {
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
}
copy {
from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}"
}
fileTree("${projRoot}/po").include("**/*.po").forEach { poFile ->
def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
file(moPath).mkdirs()
exec {
commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile
doLast {
copy {
from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
}
}
copy {
from "${projRoot}/textures" into "${assetsFolder}/textures"
copy {
from "${projRoot}/doc/lgpl-2.1.txt" into assetsFolder
}
copy {
from "${projRoot}/builtin" into "${assetsFolder}/builtin"
}
copy {
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
}
copy {
from "${projRoot}/irr/media/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
}
copy {
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
}
copy {
from "${projRoot}/textures/base/pack" into "${assetsFolder}/textures/base/pack"
}
// compile translations
fileTree("${projRoot}/po").include("**/*.po").grep {
it.parentFile.name !in unsupportedLanguages
}.forEach { poFile ->
def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
file(moPath).mkdirs()
exec {
commandLine 'msgfmt', '-o', "${moPath}/luanti.mo", poFile
}
}
file("${assetsFolder}/.nomedia").text = ""
}
file("${assetsFolder}/.nomedia").text = "";
task zipAssets(type: Zip) {
archiveName "Minetest.zip"
from "${assetsFolder}"
destinationDir file("src/main/assets")
task zipAssets(dependsOn: prepareAssets, type: Zip) {
archiveFileName = "assets.zip"
from assetsFolder
destinationDirectory = file("src/main/assets")
}
}
preBuild.dependsOn zipAssets
prepareAssets.dependsOn ':native:getDeps'
// Map for the version code that gives each ABI a value.
import com.android.build.OutputFile
def abiCodes = ['armeabi-v7a': 0, 'arm64-v8a': 1]
android.applicationVariants.all { variant ->
variant.outputs.each {
output ->
def abiName = output.getFilter(OutputFile.ABI)
output.versionCodeOverride = abiCodes.get(abiName, 0) + variant.versionCode
}
clean {
delete new File("src/main/assets", "assets.zip")
}
dependencies {
implementation project(':native')
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
}

View file

@ -1,23 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.minetest.minetest"
android:installLocation="auto">
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--
`android:requestLegacyExternalStorage="true"` is workaround for using `/sdcard`
instead of the `getFilesDir()` patch for assets. Check link below for more information:
https://developer.android.com/training/data-storage/compatibility
-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-feature android:glEsVersion="0x00020000" />
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/label"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="false"
tools:ignore="UnusedAttribute">
@ -50,9 +43,6 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="Minetest" />
</activity>
<service

View file

@ -2,6 +2,8 @@
Minetest
Copyright (C) 2014-2020 MoNTE48, Maksim Gamarnik <MoNTE48@mail.ua>
Copyright (C) 2014-2020 ubulem, Bektur Mambetov <berkut87@gmail.com>
Copyright (C) 2023 srifqi, Muhammad Rifqi Priyo Susanto
<muhammadrifqipriyosusanto@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -29,17 +31,52 @@ import androidx.appcompat.widget.AppCompatEditText;
import java.util.Objects;
public class CustomEditText extends AppCompatEditText {
private int editType = 2; // single line text input as default
private boolean wantsToShowKeyboard = false;
public CustomEditText(Context context) {
super(context);
}
public CustomEditText(Context context, int _editType) {
super(context);
editType = _editType;
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// For multi-line, do not close the dialog after pressing back button
if (editType != 1 && keyCode == KeyEvent.KEYCODE_BACK) {
InputMethodManager mgr = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
Objects.requireNonNull(mgr).hideSoftInputFromWindow(this.getWindowToken(), 0);
}
return false;
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
tryShowKeyboard();
}
public void requestFocusTryShow() {
requestFocus();
wantsToShowKeyboard = true;
tryShowKeyboard();
}
private void tryShowKeyboard() {
if (hasWindowFocus() && wantsToShowKeyboard) {
if (isFocused()) {
CustomEditText that = this;
post(() -> {
final InputMethodManager imm = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(that, 0);
});
}
wantsToShowKeyboard = false;
}
}
}

View file

@ -20,10 +20,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
package net.minetest.minetest;
import android.app.NativeActivity;
import org.libsdl.app.SDLActivity;
import android.content.Intent;
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
@ -32,87 +33,85 @@ import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
import android.content.res.Configuration;
import androidx.annotation.Keep;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.FileProvider;
import java.io.File;
import java.util.Locale;
import java.util.Objects;
// Native code finds these methods by name (see porting_android.cpp).
// This annotation prevents the minifier/Proguard from mangling them.
@Keep
public class GameActivity extends NativeActivity {
static {
System.loadLibrary("c++_shared");
System.loadLibrary("Minetest");
@SuppressWarnings("unused")
public class GameActivity extends SDLActivity {
@Override
protected String getMainSharedObject() {
return getContext().getApplicationInfo().nativeLibraryDir + "/libluanti.so";
}
private int messageReturnCode = -1;
@Override
protected String getMainFunction() {
return "SDL_Main";
}
@Override
protected String[] getLibraries() {
return new String[] {
"luanti"
};
}
// Prevent SDL from changing orientation settings since we already set the
// correct orientation in our AndroidManifest.xml
@Override
public void setOrientationBis(int w, int h, boolean resizable, String hint) {}
enum DialogType { TEXT_INPUT, SELECTION_INPUT }
enum DialogState { DIALOG_SHOWN, DIALOG_INPUTTED, DIALOG_CANCELED }
private DialogType lastDialogType = DialogType.TEXT_INPUT;
private DialogState inputDialogState = DialogState.DIALOG_CANCELED;
private String messageReturnValue = "";
private int selectionReturnValue = 0;
public static native void putMessageBoxResult(String text);
private native void saveSettings();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
protected void onStop() {
super.onStop();
// Avoid losing setting changes in case the app is onDestroy()ed later.
// Saving stuff in onStop() is recommended in the Android activity
// lifecycle documentation.
saveSettings();
}
private void makeFullScreen() {
if (Build.VERSION.SDK_INT >= 19)
this.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
public void showTextInputDialog(String hint, String current, int editType) {
runOnUiThread(() -> showTextInputDialogUI(hint, current, editType));
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus)
makeFullScreen();
public void showSelectionInputDialog(String[] optionList, int selectedIdx) {
runOnUiThread(() -> showSelectionInputDialogUI(optionList, selectedIdx));
}
@Override
protected void onResume() {
super.onResume();
makeFullScreen();
}
@Override
public void onBackPressed() {
// Ignore the back press so Minetest can handle it
}
public void showDialog(String acceptButton, String hint, String current, int editType) {
runOnUiThread(() -> showDialogUI(hint, current, editType));
}
private void showDialogUI(String hint, String current, int editType) {
private void showTextInputDialogUI(String hint, String current, int editType) {
lastDialogType = DialogType.TEXT_INPUT;
inputDialogState = DialogState.DIALOG_SHOWN;
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
LinearLayout container = new LinearLayout(this);
container.setOrientation(LinearLayout.VERTICAL);
builder.setView(container);
AlertDialog alertDialog = builder.create();
EditText editText;
// For multi-line, do not close the dialog after pressing back button
if (editType == 1) {
editText = new EditText(this);
} else {
editText = new CustomEditText(this);
}
CustomEditText editText = new CustomEditText(this, editType);
container.addView(editText);
editText.setMaxLines(8);
editText.requestFocus();
editText.setHint(hint);
editText.setText(current);
final InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
Objects.requireNonNull(imm).toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
if (editType == 1)
editText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_FLAG_MULTI_LINE);
@ -121,12 +120,13 @@ public class GameActivity extends NativeActivity {
InputType.TYPE_TEXT_VARIATION_PASSWORD);
else
editText.setInputType(InputType.TYPE_CLASS_TEXT);
editText.setSelection(editText.getText().length());
editText.setSelection(Objects.requireNonNull(editText.getText()).length());
final InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
editText.setOnKeyListener((view, keyCode, event) -> {
// For multi-line, do not submit the text after pressing Enter key
if (keyCode == KeyEvent.KEYCODE_ENTER && editType != 1) {
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
messageReturnCode = 0;
inputDialogState = DialogState.DIALOG_INPUTTED;
messageReturnValue = editText.getText().toString();
alertDialog.dismiss();
return true;
@ -140,28 +140,55 @@ public class GameActivity extends NativeActivity {
doneButton.setText(R.string.ime_dialog_done);
doneButton.setOnClickListener((view -> {
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
messageReturnCode = 0;
inputDialogState = DialogState.DIALOG_INPUTTED;
messageReturnValue = editText.getText().toString();
alertDialog.dismiss();
}));
}
alertDialog.show();
alertDialog.setOnCancelListener(dialog -> {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
inputDialogState = DialogState.DIALOG_CANCELED;
messageReturnValue = current;
messageReturnCode = -1;
});
alertDialog.show();
editText.requestFocusTryShow();
}
public int getDialogState() {
return messageReturnCode;
public void showSelectionInputDialogUI(String[] optionList, int selectedIdx) {
lastDialogType = DialogType.SELECTION_INPUT;
inputDialogState = DialogState.DIALOG_SHOWN;
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setSingleChoiceItems(optionList, selectedIdx, (dialog, selection) -> {
inputDialogState = DialogState.DIALOG_INPUTTED;
selectionReturnValue = selection;
dialog.dismiss();
});
builder.setOnCancelListener(dialog -> {
inputDialogState = DialogState.DIALOG_CANCELED;
selectionReturnValue = selectedIdx;
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
public String getDialogValue() {
messageReturnCode = -1;
public int getLastDialogType() {
return lastDialogType.ordinal();
}
public int getInputDialogState() {
return inputDialogState.ordinal();
}
public String getDialogMessage() {
inputDialogState = DialogState.DIALOG_CANCELED;
return messageReturnValue;
}
public int getDialogSelection() {
inputDialogState = DialogState.DIALOG_CANCELED;
return selectionReturnValue;
}
public float getDensity() {
return getResources().getDisplayMetrics().density;
}
@ -176,7 +203,11 @@ public class GameActivity extends NativeActivity {
public void openURI(String uri) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(browserIntent);
try {
startActivity(browserIntent);
} catch (ActivityNotFoundException e) {
runOnUiThread(() -> Toast.makeText(this, R.string.no_web_browser, Toast.LENGTH_SHORT).show());
}
}
public String getUserDataPath() {
@ -204,4 +235,32 @@ public class GameActivity extends NativeActivity {
Intent shareIntent = Intent.createChooser(intent, null);
startActivity(shareIntent);
}
public String getLanguage() {
String langCode = Locale.getDefault().getLanguage();
// getLanguage() still uses old language codes to preserve compatibility.
// List of code changes in ISO 639-2:
// https://www.loc.gov/standards/iso639-2/php/code_changes.php
switch (langCode) {
case "in":
langCode = "id"; // Indonesian
break;
case "iw":
langCode = "he"; // Hebrew
break;
case "ji":
langCode = "yi"; // Yiddish
break;
case "jw":
langCode = "jv"; // Javanese
break;
}
return langCode;
}
public boolean hasPhysicalKeyboard() {
return getContext().getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
}
}

View file

@ -20,38 +20,31 @@ with this program; if not, write to the Free Software Foundation, Inc.,
package net.minetest.minetest;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static net.minetest.minetest.UnzipService.*;
public class MainActivity extends AppCompatActivity {
public static final String NOTIFICATION_CHANNEL_ID = "Minetest channel";
private final static int versionCode = BuildConfig.VERSION_CODE;
private final static int PERMISSIONS = 1;
private static final String[] REQUIRED_SDK_PERMISSIONS =
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE};
private static final String SETTINGS = "MinetestSettings";
private static final String TAG_VERSION_CODE = "versionCode";
@ -91,63 +84,30 @@ public class MainActivity extends AppCompatActivity {
}
};
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter filter = new IntentFilter(ACTION_UPDATE);
registerReceiver(myReceiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(myReceiver, filter, RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(myReceiver, filter);
}
mProgressBar = findViewById(R.id.progressBar);
mTextView = findViewById(R.id.textView);
sharedPreferences = getSharedPreferences(SETTINGS, Context.MODE_PRIVATE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
checkPermission();
else
checkAppVersion();
}
checkAppVersion();
private void checkPermission() {
final List<String> missingPermissions = new ArrayList<>();
for (final String permission : REQUIRED_SDK_PERMISSIONS) {
final int result = ContextCompat.checkSelfPermission(this, permission);
if (result != PackageManager.PERMISSION_GRANTED)
missingPermissions.add(permission);
}
if (!missingPermissions.isEmpty()) {
final String[] permissions = missingPermissions
.toArray(new String[0]);
ActivityCompat.requestPermissions(this, permissions, PERMISSIONS);
} else {
final int[] grantResults = new int[REQUIRED_SDK_PERMISSIONS.length];
Arrays.fill(grantResults, PackageManager.PERMISSION_GRANTED);
onRequestPermissionsResult(PERMISSIONS, REQUIRED_SDK_PERMISSIONS, grantResults);
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == PERMISSIONS) {
for (int grantResult : grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, R.string.not_granted, Toast.LENGTH_LONG).show();
finish();
return;
}
}
checkAppVersion();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
createNotificationChannel();
}
private void checkAppVersion() {
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
Toast.makeText(this, R.string.no_external_storage, Toast.LENGTH_LONG).show();
finish();
return;
}
if (UnzipService.getIsRunning()) {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true);
@ -172,6 +132,28 @@ public class MainActivity extends AppCompatActivity {
startActivity(intent);
}
@RequiresApi(Build.VERSION_CODES.O)
private void createNotificationChannel() {
NotificationManager notifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (notifyManager == null)
return;
NotificationChannel notifyChannel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID,
getString(R.string.notification_channel_name),
NotificationManager.IMPORTANCE_LOW
);
notifyChannel.setDescription(getString(R.string.notification_channel_description));
// Configure the notification channel without sound set
notifyChannel.setSound(null, null);
notifyChannel.enableLights(false);
notifyChannel.enableVibration(false);
// It is fine to always create the notification channel because creating a channel
// with the same ID is the same as overriding it (only its name and description).
notifyManager.createNotificationChannel(notifyChannel);
}
@Override
public void onBackPressed() {
// Prevent abrupt interruption when copy game files from assets

View file

@ -22,17 +22,15 @@ package net.minetest.minetest;
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Environment;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import java.io.File;
@ -59,9 +57,11 @@ public class UnzipService extends IntentService {
private String failureMessage;
private static boolean isRunning = false;
public static synchronized boolean getIsRunning() {
return isRunning;
}
private static synchronized void setIsRunning(boolean v) {
isRunning = v;
}
@ -73,13 +73,10 @@ public class UnzipService extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
Notification.Builder notificationBuilder = createNotification();
final File zipFile = new File(getCacheDir(), "Minetest.zip");
final File zipFile = new File(getCacheDir(), "assets.zip");
try {
setIsRunning(true);
File userDataDirectory = Utils.getUserDataDirectory(this);
if (userDataDirectory == null) {
throw new IOException("Unable to find user data directory");
}
try (InputStream in = this.getAssets().open(zipFile.getName())) {
try (OutputStream out = new FileOutputStream(zipFile)) {
@ -91,39 +88,25 @@ public class UnzipService extends IntentService {
}
}
migrate(notificationBuilder, userDataDirectory);
unzip(notificationBuilder, zipFile, userDataDirectory);
} catch (IOException e) {
isSuccess = false;
failureMessage = e.getLocalizedMessage();
} finally {
setIsRunning(false);
zipFile.delete();
if (!zipFile.delete()) {
Log.w("UnzipService", "Minetest installation ZIP cannot be deleted");
}
}
}
@NonNull
private Notification.Builder createNotification() {
String name = "net.minetest.minetest";
String channelId = "Minetest channel";
String description = "notifications from Minetest";
Notification.Builder builder;
if (mNotifyManager == null)
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel mChannel = null;
if (mNotifyManager != null)
mChannel = mNotifyManager.getNotificationChannel(channelId);
if (mChannel == null) {
mChannel = new NotificationChannel(channelId, name, importance);
mChannel.setDescription(description);
// Configure the notification channel, NO SOUND
mChannel.setSound(null, null);
mChannel.enableLights(false);
mChannel.enableVibration(false);
mNotifyManager.createNotificationChannel(mChannel);
}
builder = new Notification.Builder(this, channelId);
builder = new Notification.Builder(this, MainActivity.NOTIFICATION_CHANNEL_ID);
} else {
builder = new Notification.Builder(this);
}
@ -131,12 +114,16 @@ public class UnzipService extends IntentService {
Intent notificationIntent = new Intent(this, MainActivity.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, 0);
notificationIntent, pendingIntentFlag);
builder.setContentTitle(getString(R.string.notification_title))
builder.setContentTitle(getString(R.string.unzip_notification_title))
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText(getString(R.string.notification_description))
.setContentText(getString(R.string.unzip_notification_description))
.setContentIntent(intent)
.setOngoing(true)
.setProgress(0, 0, true);
@ -179,9 +166,9 @@ public class UnzipService extends IntentService {
try {
Process p = new ProcessBuilder("/system/bin/mv",
src.getAbsolutePath(), dst.getAbsolutePath()).start();
int exitcode = p.waitFor();
if (exitcode != 0)
throw new IOException("Move failed with exit code " + exitcode);
int exitCode = p.waitFor();
if (exitCode != 0)
throw new IOException("Move failed with exit code " + exitCode);
} catch (InterruptedException e) {
throw new IOException("Move operation interrupted");
}
@ -197,42 +184,9 @@ public class UnzipService extends IntentService {
}
}
/**
* Migrates user data from deprecated external storage to app scoped storage
*/
private void migrate(Notification.Builder notificationBuilder, File newLocation) throws IOException {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
return;
}
File oldLocation = new File(Environment.getExternalStorageDirectory(), "Minetest");
if (!oldLocation.isDirectory())
return;
publishProgress(notificationBuilder, R.string.migrating, 0);
newLocation.mkdir();
String[] dirs = new String[] { "worlds", "games", "mods", "textures", "client" };
for (int i = 0; i < dirs.length; i++) {
publishProgress(notificationBuilder, R.string.migrating, 100 * i / dirs.length);
File dir = new File(oldLocation, dirs[i]), dir2 = new File(newLocation, dirs[i]);
if (dir.isDirectory() && !dir2.isDirectory()) {
moveFileOrDir(dir, dir2);
}
}
for (String filename : new String[] { "minetest.conf" }) {
File file = new File(oldLocation, filename), file2 = new File(newLocation, filename);
if (file.isFile() && !file2.isFile()) {
moveFileOrDir(file, file2);
}
}
recursivelyDeleteDirectory(oldLocation);
}
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
Intent intentUpdate = new Intent(ACTION_UPDATE);
intentUpdate.setPackage(getPackageName());
intentUpdate.putExtra(ACTION_PROGRESS, progress);
intentUpdate.putExtra(ACTION_PROGRESS_MESSAGE, message);
if (!isSuccess)

View file

@ -1,37 +1,43 @@
package net.minetest.minetest;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.File;
import java.util.Objects;
public class Utils {
public static @NonNull File createDirs(File root, String dir) {
@NonNull
public static File createDirs(@NonNull File root, @NonNull String dir) {
File f = new File(root, dir);
if (!f.isDirectory())
f.mkdirs();
if (!f.mkdirs())
Log.e("Utils", "Directory " + dir + " cannot be created");
return f;
}
public static @Nullable File getUserDataDirectory(Context context) {
File extDir = context.getExternalFilesDir(null);
if (extDir == null) {
return null;
}
@NonNull
public static File getUserDataDirectory(@NonNull Context context) {
File extDir = Objects.requireNonNull(
context.getExternalFilesDir(null),
"Cannot get external file directory"
);
return createDirs(extDir, "Minetest");
}
public static @Nullable File getCacheDirectory(Context context) {
return context.getCacheDir();
@NonNull
public static File getCacheDirectory(@NonNull Context context) {
return Objects.requireNonNull(
context.getCacheDir(),
"Cannot get cache directory"
);
}
public static boolean isInstallValid(Context context) {
public static boolean isInstallValid(@NonNull Context context) {
File userDataDirectory = getUserDataDirectory(context);
return userDataDirectory != null && userDataDirectory.isDirectory() &&
new File(userDataDirectory, "games").isDirectory() &&
return userDataDirectory.isDirectory() &&
new File(userDataDirectory, "builtin").isDirectory() &&
new File(userDataDirectory, "client").isDirectory() &&
new File(userDataDirectory, "textures").isDirectory();

View file

@ -0,0 +1,22 @@
package org.libsdl.app;
import android.hardware.usb.UsbDevice;
interface HIDDevice
{
public int getId();
public int getVendorId();
public int getProductId();
public String getSerialNumber();
public int getVersion();
public String getManufacturerName();
public String getProductName();
public UsbDevice getDevice();
public boolean open();
public int sendFeatureReport(byte[] report);
public int sendOutputReport(byte[] report);
public boolean getFeatureReport(byte[] report);
public void setFrozen(boolean frozen);
public void close();
public void shutdown();
}

View file

@ -0,0 +1,650 @@
package org.libsdl.app;
import android.content.Context;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothGattService;
import android.hardware.usb.UsbDevice;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.os.*;
//import com.android.internal.util.HexDump;
import java.lang.Runnable;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.UUID;
class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDevice {
private static final String TAG = "hidapi";
private HIDDeviceManager mManager;
private BluetoothDevice mDevice;
private int mDeviceId;
private BluetoothGatt mGatt;
private boolean mIsRegistered = false;
private boolean mIsConnected = false;
private boolean mIsChromebook = false;
private boolean mIsReconnecting = false;
private boolean mFrozen = false;
private LinkedList<GattOperation> mOperations;
GattOperation mCurrentOperation = null;
private Handler mHandler;
private static final int TRANSPORT_AUTO = 0;
private static final int TRANSPORT_BREDR = 1;
private static final int TRANSPORT_LE = 2;
private static final int CHROMEBOOK_CONNECTION_CHECK_INTERVAL = 10000;
static public final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3");
static public final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3");
static public final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3");
static private final byte[] enterValveMode = new byte[] { (byte)0xC0, (byte)0x87, 0x03, 0x08, 0x07, 0x00 };
static class GattOperation {
private enum Operation {
CHR_READ,
CHR_WRITE,
ENABLE_NOTIFICATION
}
Operation mOp;
UUID mUuid;
byte[] mValue;
BluetoothGatt mGatt;
boolean mResult = true;
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
}
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
mValue = value;
}
public void run() {
// This is executed in main thread
BluetoothGattCharacteristic chr;
switch (mOp) {
case CHR_READ:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Reading characteristic " + chr.getUuid());
if (!mGatt.readCharacteristic(chr)) {
Log.e(TAG, "Unable to read characteristic " + mUuid.toString());
mResult = false;
break;
}
mResult = true;
break;
case CHR_WRITE:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Writing characteristic " + chr.getUuid() + " value=" + HexDump.toHexString(value));
chr.setValue(mValue);
if (!mGatt.writeCharacteristic(chr)) {
Log.e(TAG, "Unable to write characteristic " + mUuid.toString());
mResult = false;
break;
}
mResult = true;
break;
case ENABLE_NOTIFICATION:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Writing descriptor of " + chr.getUuid());
if (chr != null) {
BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));
if (cccd != null) {
int properties = chr.getProperties();
byte[] value;
if ((properties & BluetoothGattCharacteristic.PROPERTY_NOTIFY) == BluetoothGattCharacteristic.PROPERTY_NOTIFY) {
value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE;
} else if ((properties & BluetoothGattCharacteristic.PROPERTY_INDICATE) == BluetoothGattCharacteristic.PROPERTY_INDICATE) {
value = BluetoothGattDescriptor.ENABLE_INDICATION_VALUE;
} else {
Log.e(TAG, "Unable to start notifications on input characteristic");
mResult = false;
return;
}
mGatt.setCharacteristicNotification(chr, true);
cccd.setValue(value);
if (!mGatt.writeDescriptor(cccd)) {
Log.e(TAG, "Unable to write descriptor " + mUuid.toString());
mResult = false;
return;
}
mResult = true;
}
}
}
}
public boolean finish() {
return mResult;
}
private BluetoothGattCharacteristic getCharacteristic(UUID uuid) {
BluetoothGattService valveService = mGatt.getService(steamControllerService);
if (valveService == null)
return null;
return valveService.getCharacteristic(uuid);
}
static public GattOperation readCharacteristic(BluetoothGatt gatt, UUID uuid) {
return new GattOperation(gatt, Operation.CHR_READ, uuid);
}
static public GattOperation writeCharacteristic(BluetoothGatt gatt, UUID uuid, byte[] value) {
return new GattOperation(gatt, Operation.CHR_WRITE, uuid, value);
}
static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid) {
return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid);
}
}
public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {
mManager = manager;
mDevice = device;
mDeviceId = mManager.getDeviceIDForIdentifier(getIdentifier());
mIsRegistered = false;
mIsChromebook = mManager.getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
mOperations = new LinkedList<GattOperation>();
mHandler = new Handler(Looper.getMainLooper());
mGatt = connectGatt();
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.checkConnectionForChromebookIssue();
// }
// }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}
public String getIdentifier() {
return String.format("SteamController.%s", mDevice.getAddress());
}
public BluetoothGatt getGatt() {
return mGatt;
}
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
private BluetoothGatt connectGatt(boolean managed) {
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
try {
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
} catch (Exception e) {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
} else {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
}
private BluetoothGatt connectGatt() {
return connectGatt(false);
}
protected int getConnectionState() {
Context context = mManager.getContext();
if (context == null) {
// We are lacking any context to get our Bluetooth information. We'll just assume disconnected.
return BluetoothProfile.STATE_DISCONNECTED;
}
BluetoothManager btManager = (BluetoothManager)context.getSystemService(Context.BLUETOOTH_SERVICE);
if (btManager == null) {
// This device doesn't support Bluetooth. We should never be here, because how did
// we instantiate a device to start with?
return BluetoothProfile.STATE_DISCONNECTED;
}
return btManager.getConnectionState(mDevice, BluetoothProfile.GATT);
}
public void reconnect() {
if (getConnectionState() != BluetoothProfile.STATE_CONNECTED) {
mGatt.disconnect();
mGatt = connectGatt();
}
}
protected void checkConnectionForChromebookIssue() {
if (!mIsChromebook) {
// We only do this on Chromebooks, because otherwise it's really annoying to just attempt
// over and over.
return;
}
int connectionState = getConnectionState();
switch (connectionState) {
case BluetoothProfile.STATE_CONNECTED:
if (!mIsConnected) {
// We are in the Bad Chromebook Place. We can force a disconnect
// to try to recover.
Log.v(TAG, "Chromebook: We are in a very bad state; the controller shows as connected in the underlying Bluetooth layer, but we never received a callback. Forcing a reconnect.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
}
else if (!isRegistered()) {
if (mGatt.getServices().size() > 0) {
Log.v(TAG, "Chromebook: We are connected to a controller, but never got our registration. Trying to recover.");
probeService(this);
}
else {
Log.v(TAG, "Chromebook: We are connected to a controller, but never discovered services. Trying to recover.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
}
}
else {
Log.v(TAG, "Chromebook: We are connected, and registered. Everything's good!");
return;
}
break;
case BluetoothProfile.STATE_DISCONNECTED:
Log.v(TAG, "Chromebook: We have either been disconnected, or the Chromebook BtGatt.ContextMap bug has bitten us. Attempting a disconnect/reconnect, but we may not be able to recover.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
case BluetoothProfile.STATE_CONNECTING:
Log.v(TAG, "Chromebook: We're still trying to connect. Waiting a bit longer.");
break;
}
final HIDDeviceBLESteamController finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.checkConnectionForChromebookIssue();
}
}, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}
private boolean isRegistered() {
return mIsRegistered;
}
private void setRegistered() {
mIsRegistered = true;
}
private boolean probeService(HIDDeviceBLESteamController controller) {
if (isRegistered()) {
return true;
}
if (!mIsConnected) {
return false;
}
Log.v(TAG, "probeService controller=" + controller);
for (BluetoothGattService service : mGatt.getServices()) {
if (service.getUuid().equals(steamControllerService)) {
Log.v(TAG, "Found Valve steam controller service " + service.getUuid());
for (BluetoothGattCharacteristic chr : service.getCharacteristics()) {
if (chr.getUuid().equals(inputCharacteristic)) {
Log.v(TAG, "Found input characteristic");
// Start notifications
BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));
if (cccd != null) {
enableNotification(chr.getUuid());
}
}
}
return true;
}
}
if ((mGatt.getServices().size() == 0) && mIsChromebook && !mIsReconnecting) {
Log.e(TAG, "Chromebook: Discovered services were empty; this almost certainly means the BtGatt.ContextMap bug has bitten us.");
mIsConnected = false;
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
private void finishCurrentGattOperation() {
GattOperation op = null;
synchronized (mOperations) {
if (mCurrentOperation != null) {
op = mCurrentOperation;
mCurrentOperation = null;
}
}
if (op != null) {
boolean result = op.finish(); // TODO: Maybe in main thread as well?
// Our operation failed, let's add it back to the beginning of our queue.
if (!result) {
mOperations.addFirst(op);
}
}
executeNextGattOperation();
}
private void executeNextGattOperation() {
synchronized (mOperations) {
if (mCurrentOperation != null)
return;
if (mOperations.isEmpty())
return;
mCurrentOperation = mOperations.removeFirst();
}
// Run in main thread
mHandler.post(new Runnable() {
@Override
public void run() {
synchronized (mOperations) {
if (mCurrentOperation == null) {
Log.e(TAG, "Current operation null in executor?");
return;
}
mCurrentOperation.run();
// now wait for the GATT callback and when it comes, finish this operation
}
}
});
}
private void queueGattOperation(GattOperation op) {
synchronized (mOperations) {
mOperations.add(op);
}
executeNextGattOperation();
}
private void enableNotification(UUID chrUuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid);
queueGattOperation(op);
}
public void writeCharacteristic(UUID uuid, byte[] value) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.writeCharacteristic(mGatt, uuid, value);
queueGattOperation(op);
}
public void readCharacteristic(UUID uuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.readCharacteristic(mGatt, uuid);
queueGattOperation(op);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////////// BluetoothGattCallback overridden methods
//////////////////////////////////////////////////////////////////////////////////////////////////////
public void onConnectionStateChange(BluetoothGatt g, int status, int newState) {
//Log.v(TAG, "onConnectionStateChange status=" + status + " newState=" + newState);
mIsReconnecting = false;
if (newState == 2) {
mIsConnected = true;
// Run directly, without GattOperation
if (!isRegistered()) {
mHandler.post(new Runnable() {
@Override
public void run() {
mGatt.discoverServices();
}
});
}
}
else if (newState == 0) {
mIsConnected = false;
}
// Disconnection is handled in SteamLink using the ACTION_ACL_DISCONNECTED Intent.
}
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onServicesDiscovered status=" + status);
if (status == 0) {
if (gatt.getServices().size() == 0) {
Log.v(TAG, "onServicesDiscovered returned zero services; something has gone horribly wrong down in Android's Bluetooth stack.");
mIsReconnecting = true;
mIsConnected = false;
gatt.disconnect();
mGatt = connectGatt(false);
}
else {
probeService(this);
}
}
}
public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicRead status=" + status + " uuid=" + characteristic.getUuid());
if (characteristic.getUuid().equals(reportCharacteristic) && !mFrozen) {
mManager.HIDDeviceFeatureReport(getId(), characteristic.getValue());
}
finishCurrentGattOperation();
}
public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicWrite status=" + status + " uuid=" + characteristic.getUuid());
if (characteristic.getUuid().equals(reportCharacteristic)) {
// Only register controller with the native side once it has been fully configured
if (!isRegistered()) {
Log.v(TAG, "Registering Steam Controller with ID: " + getId());
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0);
setRegistered();
}
}
finishCurrentGattOperation();
}
public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
// Enable this for verbose logging of controller input reports
//Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue()));
if (characteristic.getUuid().equals(inputCharacteristic) && !mFrozen) {
mManager.HIDDeviceInputReport(getId(), characteristic.getValue());
}
}
public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
//Log.v(TAG, "onDescriptorRead status=" + status);
}
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
BluetoothGattCharacteristic chr = descriptor.getCharacteristic();
//Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid());
if (chr.getUuid().equals(inputCharacteristic)) {
boolean hasWrittenInputDescriptor = true;
BluetoothGattCharacteristic reportChr = chr.getService().getCharacteristic(reportCharacteristic);
if (reportChr != null) {
Log.v(TAG, "Writing report characteristic to enter valve mode");
reportChr.setValue(enterValveMode);
gatt.writeCharacteristic(reportChr);
}
}
finishCurrentGattOperation();
}
public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onReliableWriteCompleted status=" + status);
}
public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
//Log.v(TAG, "onReadRemoteRssi status=" + status);
}
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
//Log.v(TAG, "onMtuChanged status=" + status);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////// Public API
//////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public int getId() {
return mDeviceId;
}
@Override
public int getVendorId() {
// Valve Corporation
final int VALVE_USB_VID = 0x28DE;
return VALVE_USB_VID;
}
@Override
public int getProductId() {
// We don't have an easy way to query from the Bluetooth device, but we know what it is
final int D0G_BLE2_PID = 0x1106;
return D0G_BLE2_PID;
}
@Override
public String getSerialNumber() {
// This will be read later via feature report by Steam
return "12345";
}
@Override
public int getVersion() {
return 0;
}
@Override
public String getManufacturerName() {
return "Valve Corporation";
}
@Override
public String getProductName() {
return "Steam Controller";
}
@Override
public UsbDevice getDevice() {
return null;
}
@Override
public boolean open() {
return true;
}
@Override
public int sendFeatureReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted sendFeatureReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return -1;
}
// We need to skip the first byte, as that doesn't go over the air
byte[] actual_report = Arrays.copyOfRange(report, 1, report.length - 1);
//Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(actual_report));
writeCharacteristic(reportCharacteristic, actual_report);
return report.length;
}
@Override
public int sendOutputReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted sendOutputReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return -1;
}
//Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(report));
writeCharacteristic(reportCharacteristic, report);
return report.length;
}
@Override
public boolean getFeatureReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted getFeatureReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return false;
}
//Log.v(TAG, "getFeatureReport");
readCharacteristic(reportCharacteristic);
return true;
}
@Override
public void close() {
}
@Override
public void setFrozen(boolean frozen) {
mFrozen = frozen;
}
@Override
public void shutdown() {
close();
BluetoothGatt g = mGatt;
if (g != null) {
g.disconnect();
g.close();
mGatt = null;
}
mManager = null;
mIsRegistered = false;
mIsConnected = false;
mOperations.clear();
}
}

View file

@ -0,0 +1,698 @@
package org.libsdl.app;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.os.Build;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.hardware.usb.*;
import android.os.Handler;
import android.os.Looper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public class HIDDeviceManager {
private static final String TAG = "hidapi";
private static final String ACTION_USB_PERMISSION = "org.libsdl.app.USB_PERMISSION";
private static HIDDeviceManager sManager;
private static int sManagerRefCount = 0;
public static HIDDeviceManager acquire(Context context) {
if (sManagerRefCount == 0) {
sManager = new HIDDeviceManager(context);
}
++sManagerRefCount;
return sManager;
}
public static void release(HIDDeviceManager manager) {
if (manager == sManager) {
--sManagerRefCount;
if (sManagerRefCount == 0) {
sManager.close();
sManager = null;
}
}
}
private Context mContext;
private HashMap<Integer, HIDDevice> mDevicesById = new HashMap<Integer, HIDDevice>();
private HashMap<BluetoothDevice, HIDDeviceBLESteamController> mBluetoothDevices = new HashMap<BluetoothDevice, HIDDeviceBLESteamController>();
private int mNextDeviceId = 0;
private SharedPreferences mSharedPreferences = null;
private boolean mIsChromebook = false;
private UsbManager mUsbManager;
private Handler mHandler;
private BluetoothManager mBluetoothManager;
private List<BluetoothDevice> mLastBluetoothDevices;
private final BroadcastReceiver mUsbBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDeviceAttached(usbDevice);
} else if (action.equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDeviceDetached(usbDevice);
} else if (action.equals(HIDDeviceManager.ACTION_USB_PERMISSION)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDevicePermission(usbDevice, intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false));
}
}
};
private final BroadcastReceiver mBluetoothBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// Bluetooth device was connected. If it was a Steam Controller, handle it
if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.d(TAG, "Bluetooth device connected: " + device);
if (isSteamController(device)) {
connectBluetoothDevice(device);
}
}
// Bluetooth device was disconnected, remove from controller manager (if any)
if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.d(TAG, "Bluetooth device disconnected: " + device);
disconnectBluetoothDevice(device);
}
}
};
private HIDDeviceManager(final Context context) {
mContext = context;
HIDDeviceRegisterCallback();
mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);
mIsChromebook = mContext.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
// if (shouldClear) {
// SharedPreferences.Editor spedit = mSharedPreferences.edit();
// spedit.clear();
// spedit.commit();
// }
// else
{
mNextDeviceId = mSharedPreferences.getInt("next_device_id", 0);
}
}
public Context getContext() {
return mContext;
}
public int getDeviceIDForIdentifier(String identifier) {
SharedPreferences.Editor spedit = mSharedPreferences.edit();
int result = mSharedPreferences.getInt(identifier, 0);
if (result == 0) {
result = mNextDeviceId++;
spedit.putInt("next_device_id", mNextDeviceId);
}
spedit.putInt(identifier, result);
spedit.commit();
return result;
}
private void initializeUSB() {
mUsbManager = (UsbManager)mContext.getSystemService(Context.USB_SERVICE);
if (mUsbManager == null) {
return;
}
/*
// Logging
for (UsbDevice device : mUsbManager.getDeviceList().values()) {
Log.i(TAG,"Path: " + device.getDeviceName());
Log.i(TAG,"Manufacturer: " + device.getManufacturerName());
Log.i(TAG,"Product: " + device.getProductName());
Log.i(TAG,"ID: " + device.getDeviceId());
Log.i(TAG,"Class: " + device.getDeviceClass());
Log.i(TAG,"Protocol: " + device.getDeviceProtocol());
Log.i(TAG,"Vendor ID " + device.getVendorId());
Log.i(TAG,"Product ID: " + device.getProductId());
Log.i(TAG,"Interface count: " + device.getInterfaceCount());
Log.i(TAG,"---------------------------------------");
// Get interface details
for (int index = 0; index < device.getInterfaceCount(); index++) {
UsbInterface mUsbInterface = device.getInterface(index);
Log.i(TAG," ***** *****");
Log.i(TAG," Interface index: " + index);
Log.i(TAG," Interface ID: " + mUsbInterface.getId());
Log.i(TAG," Interface class: " + mUsbInterface.getInterfaceClass());
Log.i(TAG," Interface subclass: " + mUsbInterface.getInterfaceSubclass());
Log.i(TAG," Interface protocol: " + mUsbInterface.getInterfaceProtocol());
Log.i(TAG," Endpoint count: " + mUsbInterface.getEndpointCount());
// Get endpoint details
for (int epi = 0; epi < mUsbInterface.getEndpointCount(); epi++)
{
UsbEndpoint mEndpoint = mUsbInterface.getEndpoint(epi);
Log.i(TAG," ++++ ++++ ++++");
Log.i(TAG," Endpoint index: " + epi);
Log.i(TAG," Attributes: " + mEndpoint.getAttributes());
Log.i(TAG," Direction: " + mEndpoint.getDirection());
Log.i(TAG," Number: " + mEndpoint.getEndpointNumber());
Log.i(TAG," Interval: " + mEndpoint.getInterval());
Log.i(TAG," Packet size: " + mEndpoint.getMaxPacketSize());
Log.i(TAG," Type: " + mEndpoint.getType());
}
}
}
Log.i(TAG," No more devices connected.");
*/
// Register for USB broadcasts and permission completions
IntentFilter filter = new IntentFilter();
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
filter.addAction(HIDDeviceManager.ACTION_USB_PERMISSION);
mContext.registerReceiver(mUsbBroadcast, filter);
for (UsbDevice usbDevice : mUsbManager.getDeviceList().values()) {
handleUsbDeviceAttached(usbDevice);
}
}
UsbManager getUSBManager() {
return mUsbManager;
}
private void shutdownUSB() {
try {
mContext.unregisterReceiver(mUsbBroadcast);
} catch (Exception e) {
// We may not have registered, that's okay
}
}
private boolean isHIDDeviceInterface(UsbDevice usbDevice, UsbInterface usbInterface) {
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_HID) {
return true;
}
if (isXbox360Controller(usbDevice, usbInterface) || isXboxOneController(usbDevice, usbInterface)) {
return true;
}
return false;
}
private boolean isXbox360Controller(UsbDevice usbDevice, UsbInterface usbInterface) {
final int XB360_IFACE_SUBCLASS = 93;
final int XB360_IFACE_PROTOCOL = 1; // Wired
final int XB360W_IFACE_PROTOCOL = 129; // Wireless
final int[] SUPPORTED_VENDORS = {
0x0079, // GPD Win 2
0x044f, // Thrustmaster
0x045e, // Microsoft
0x046d, // Logitech
0x056e, // Elecom
0x06a3, // Saitek
0x0738, // Mad Catz
0x07ff, // Mad Catz
0x0e6f, // PDP
0x0f0d, // Hori
0x1038, // SteelSeries
0x11c9, // Nacon
0x12ab, // Unknown
0x1430, // RedOctane
0x146b, // BigBen
0x1532, // Razer Sabertooth
0x15e4, // Numark
0x162e, // Joytech
0x1689, // Razer Onza
0x1949, // Lab126, Inc.
0x1bad, // Harmonix
0x20d6, // PowerA
0x24c6, // PowerA
0x2c22, // Qanba
0x2dc8, // 8BitDo
0x9886, // ASTRO Gaming
};
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
usbInterface.getInterfaceSubclass() == XB360_IFACE_SUBCLASS &&
(usbInterface.getInterfaceProtocol() == XB360_IFACE_PROTOCOL ||
usbInterface.getInterfaceProtocol() == XB360W_IFACE_PROTOCOL)) {
int vendor_id = usbDevice.getVendorId();
for (int supportedVid : SUPPORTED_VENDORS) {
if (vendor_id == supportedVid) {
return true;
}
}
}
return false;
}
private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterface) {
final int XB1_IFACE_SUBCLASS = 71;
final int XB1_IFACE_PROTOCOL = 208;
final int[] SUPPORTED_VENDORS = {
0x03f0, // HP
0x044f, // Thrustmaster
0x045e, // Microsoft
0x0738, // Mad Catz
0x0b05, // ASUS
0x0e6f, // PDP
0x0f0d, // Hori
0x10f5, // Turtle Beach
0x1532, // Razer Wildcat
0x20d6, // PowerA
0x24c6, // PowerA
0x2dc8, // 8BitDo
0x2e24, // Hyperkin
0x3537, // GameSir
};
if (usbInterface.getId() == 0 &&
usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
usbInterface.getInterfaceSubclass() == XB1_IFACE_SUBCLASS &&
usbInterface.getInterfaceProtocol() == XB1_IFACE_PROTOCOL) {
int vendor_id = usbDevice.getVendorId();
for (int supportedVid : SUPPORTED_VENDORS) {
if (vendor_id == supportedVid) {
return true;
}
}
}
return false;
}
private void handleUsbDeviceAttached(UsbDevice usbDevice) {
connectHIDDeviceUSB(usbDevice);
}
private void handleUsbDeviceDetached(UsbDevice usbDevice) {
List<Integer> devices = new ArrayList<Integer>();
for (HIDDevice device : mDevicesById.values()) {
if (usbDevice.equals(device.getDevice())) {
devices.add(device.getId());
}
}
for (int id : devices) {
HIDDevice device = mDevicesById.get(id);
mDevicesById.remove(id);
device.shutdown();
HIDDeviceDisconnected(id);
}
}
private void handleUsbDevicePermission(UsbDevice usbDevice, boolean permission_granted) {
for (HIDDevice device : mDevicesById.values()) {
if (usbDevice.equals(device.getDevice())) {
boolean opened = false;
if (permission_granted) {
opened = device.open();
}
HIDDeviceOpenResult(device.getId(), opened);
}
}
}
private void connectHIDDeviceUSB(UsbDevice usbDevice) {
synchronized (this) {
int interface_mask = 0;
for (int interface_index = 0; interface_index < usbDevice.getInterfaceCount(); interface_index++) {
UsbInterface usbInterface = usbDevice.getInterface(interface_index);
if (isHIDDeviceInterface(usbDevice, usbInterface)) {
// Check to see if we've already added this interface
// This happens with the Xbox Series X controller which has a duplicate interface 0, which is inactive
int interface_id = usbInterface.getId();
if ((interface_mask & (1 << interface_id)) != 0) {
continue;
}
interface_mask |= (1 << interface_id);
HIDDeviceUSB device = new HIDDeviceUSB(this, usbDevice, interface_index);
int id = device.getId();
mDevicesById.put(id, device);
HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol());
}
}
}
}
private void initializeBluetooth() {
Log.d(TAG, "Initializing Bluetooth");
if (Build.VERSION.SDK_INT >= 31 /* Android 12 */ &&
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH_CONNECT, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH_CONNECT");
return;
}
if (Build.VERSION.SDK_INT <= 30 /* Android 11.0 (R) */ &&
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
return;
}
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18 /* Android 4.3 (JELLY_BEAN_MR2) */)) {
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
return;
}
// Find bonded bluetooth controllers and create SteamControllers for them
mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
if (mBluetoothManager == null) {
// This device doesn't support Bluetooth.
return;
}
BluetoothAdapter btAdapter = mBluetoothManager.getAdapter();
if (btAdapter == null) {
// This device has Bluetooth support in the codebase, but has no available adapters.
return;
}
// Get our bonded devices.
for (BluetoothDevice device : btAdapter.getBondedDevices()) {
Log.d(TAG, "Bluetooth device available: " + device);
if (isSteamController(device)) {
connectBluetoothDevice(device);
}
}
// NOTE: These don't work on Chromebooks, to my undying dismay.
IntentFilter filter = new IntentFilter();
filter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
mContext.registerReceiver(mBluetoothBroadcast, filter);
if (mIsChromebook) {
mHandler = new Handler(Looper.getMainLooper());
mLastBluetoothDevices = new ArrayList<BluetoothDevice>();
// final HIDDeviceManager finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.chromebookConnectionHandler();
// }
// }, 5000);
}
}
private void shutdownBluetooth() {
try {
mContext.unregisterReceiver(mBluetoothBroadcast);
} catch (Exception e) {
// We may not have registered, that's okay
}
}
// Chromebooks do not pass along ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED properly.
// This function provides a sort of dummy version of that, watching for changes in the
// connected devices and attempting to add controllers as things change.
public void chromebookConnectionHandler() {
if (!mIsChromebook) {
return;
}
ArrayList<BluetoothDevice> disconnected = new ArrayList<BluetoothDevice>();
ArrayList<BluetoothDevice> connected = new ArrayList<BluetoothDevice>();
List<BluetoothDevice> currentConnected = mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT);
for (BluetoothDevice bluetoothDevice : currentConnected) {
if (!mLastBluetoothDevices.contains(bluetoothDevice)) {
connected.add(bluetoothDevice);
}
}
for (BluetoothDevice bluetoothDevice : mLastBluetoothDevices) {
if (!currentConnected.contains(bluetoothDevice)) {
disconnected.add(bluetoothDevice);
}
}
mLastBluetoothDevices = currentConnected;
for (BluetoothDevice bluetoothDevice : disconnected) {
disconnectBluetoothDevice(bluetoothDevice);
}
for (BluetoothDevice bluetoothDevice : connected) {
connectBluetoothDevice(bluetoothDevice);
}
final HIDDeviceManager finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.chromebookConnectionHandler();
}
}, 10000);
}
public boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {
Log.v(TAG, "connectBluetoothDevice device=" + bluetoothDevice);
synchronized (this) {
if (mBluetoothDevices.containsKey(bluetoothDevice)) {
Log.v(TAG, "Steam controller with address " + bluetoothDevice + " already exists, attempting reconnect");
HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);
device.reconnect();
return false;
}
HIDDeviceBLESteamController device = new HIDDeviceBLESteamController(this, bluetoothDevice);
int id = device.getId();
mBluetoothDevices.put(bluetoothDevice, device);
mDevicesById.put(id, device);
// The Steam Controller will mark itself connected once initialization is complete
}
return true;
}
public void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {
synchronized (this) {
HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);
if (device == null)
return;
int id = device.getId();
mBluetoothDevices.remove(bluetoothDevice);
mDevicesById.remove(id);
device.shutdown();
HIDDeviceDisconnected(id);
}
}
public boolean isSteamController(BluetoothDevice bluetoothDevice) {
// Sanity check. If you pass in a null device, by definition it is never a Steam Controller.
if (bluetoothDevice == null) {
return false;
}
// If the device has no local name, we really don't want to try an equality check against it.
if (bluetoothDevice.getName() == null) {
return false;
}
return bluetoothDevice.getName().equals("SteamController") && ((bluetoothDevice.getType() & BluetoothDevice.DEVICE_TYPE_LE) != 0);
}
private void close() {
shutdownUSB();
shutdownBluetooth();
synchronized (this) {
for (HIDDevice device : mDevicesById.values()) {
device.shutdown();
}
mDevicesById.clear();
mBluetoothDevices.clear();
HIDDeviceReleaseCallback();
}
}
public void setFrozen(boolean frozen) {
synchronized (this) {
for (HIDDevice device : mDevicesById.values()) {
device.setFrozen(frozen);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
private HIDDevice getDevice(int id) {
synchronized (this) {
HIDDevice result = mDevicesById.get(id);
if (result == null) {
Log.v(TAG, "No device for id: " + id);
Log.v(TAG, "Available devices: " + mDevicesById.keySet());
}
return result;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////// JNI interface functions
//////////////////////////////////////////////////////////////////////////////////////////////////////
public boolean initialize(boolean usb, boolean bluetooth) {
Log.v(TAG, "initialize(" + usb + ", " + bluetooth + ")");
if (usb) {
initializeUSB();
}
if (bluetooth) {
initializeBluetooth();
}
return true;
}
public boolean openDevice(int deviceID) {
Log.v(TAG, "openDevice deviceID=" + deviceID);
HIDDevice device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return false;
}
// Look to see if this is a USB device and we have permission to access it
UsbDevice usbDevice = device.getDevice();
if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {
HIDDeviceOpenPending(deviceID);
try {
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
int flags;
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
flags = FLAG_MUTABLE;
} else {
flags = 0;
}
if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) {
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
intent.setPackage(mContext.getPackageName());
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
} else {
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
}
} catch (Exception e) {
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
HIDDeviceOpenResult(deviceID, false);
}
return false;
}
try {
return device.open();
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return false;
}
public int sendOutputReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "sendOutputReport deviceID=" + deviceID + " length=" + report.length);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return -1;
}
return device.sendOutputReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return -1;
}
public int sendFeatureReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "sendFeatureReport deviceID=" + deviceID + " length=" + report.length);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return -1;
}
return device.sendFeatureReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return -1;
}
public boolean getFeatureReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "getFeatureReport deviceID=" + deviceID);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return false;
}
return device.getFeatureReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return false;
}
public void closeDevice(int deviceID) {
try {
Log.v(TAG, "closeDevice deviceID=" + deviceID);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return;
}
device.close();
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////// Native methods
//////////////////////////////////////////////////////////////////////////////////////////////////////
private native void HIDDeviceRegisterCallback();
private native void HIDDeviceReleaseCallback();
native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol);
native void HIDDeviceOpenPending(int deviceID);
native void HIDDeviceOpenResult(int deviceID, boolean opened);
native void HIDDeviceDisconnected(int deviceID);
native void HIDDeviceInputReport(int deviceID, byte[] report);
native void HIDDeviceFeatureReport(int deviceID, byte[] report);
}

View file

@ -0,0 +1,309 @@
package org.libsdl.app;
import android.hardware.usb.*;
import android.os.Build;
import android.util.Log;
import java.util.Arrays;
class HIDDeviceUSB implements HIDDevice {
private static final String TAG = "hidapi";
protected HIDDeviceManager mManager;
protected UsbDevice mDevice;
protected int mInterfaceIndex;
protected int mInterface;
protected int mDeviceId;
protected UsbDeviceConnection mConnection;
protected UsbEndpoint mInputEndpoint;
protected UsbEndpoint mOutputEndpoint;
protected InputThread mInputThread;
protected boolean mRunning;
protected boolean mFrozen;
public HIDDeviceUSB(HIDDeviceManager manager, UsbDevice usbDevice, int interface_index) {
mManager = manager;
mDevice = usbDevice;
mInterfaceIndex = interface_index;
mInterface = mDevice.getInterface(mInterfaceIndex).getId();
mDeviceId = manager.getDeviceIDForIdentifier(getIdentifier());
mRunning = false;
}
public String getIdentifier() {
return String.format("%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);
}
@Override
public int getId() {
return mDeviceId;
}
@Override
public int getVendorId() {
return mDevice.getVendorId();
}
@Override
public int getProductId() {
return mDevice.getProductId();
}
@Override
public String getSerialNumber() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
try {
result = mDevice.getSerialNumber();
}
catch (SecurityException exception) {
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
}
}
if (result == null) {
result = "";
}
return result;
}
@Override
public int getVersion() {
return 0;
}
@Override
public String getManufacturerName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
result = mDevice.getManufacturerName();
}
if (result == null) {
result = String.format("%x", getVendorId());
}
return result;
}
@Override
public String getProductName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
result = mDevice.getProductName();
}
if (result == null) {
result = String.format("%x", getProductId());
}
return result;
}
@Override
public UsbDevice getDevice() {
return mDevice;
}
public String getDeviceName() {
return getManufacturerName() + " " + getProductName() + "(0x" + String.format("%x", getVendorId()) + "/0x" + String.format("%x", getProductId()) + ")";
}
@Override
public boolean open() {
mConnection = mManager.getUSBManager().openDevice(mDevice);
if (mConnection == null) {
Log.w(TAG, "Unable to open USB device " + getDeviceName());
return false;
}
// Force claim our interface
UsbInterface iface = mDevice.getInterface(mInterfaceIndex);
if (!mConnection.claimInterface(iface, true)) {
Log.w(TAG, "Failed to claim interfaces on USB device " + getDeviceName());
close();
return false;
}
// Find the endpoints
for (int j = 0; j < iface.getEndpointCount(); j++) {
UsbEndpoint endpt = iface.getEndpoint(j);
switch (endpt.getDirection()) {
case UsbConstants.USB_DIR_IN:
if (mInputEndpoint == null) {
mInputEndpoint = endpt;
}
break;
case UsbConstants.USB_DIR_OUT:
if (mOutputEndpoint == null) {
mOutputEndpoint = endpt;
}
break;
}
}
// Make sure the required endpoints were present
if (mInputEndpoint == null || mOutputEndpoint == null) {
Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());
close();
return false;
}
// Start listening for input
mRunning = true;
mInputThread = new InputThread();
mInputThread.start();
return true;
}
@Override
public int sendFeatureReport(byte[] report) {
int res = -1;
int offset = 0;
int length = report.length;
boolean skipped_report_id = false;
byte report_number = report[0];
if (report_number == 0x0) {
++offset;
--length;
skipped_report_id = true;
}
res = mConnection.controlTransfer(
UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_OUT,
0x09/*HID set_report*/,
(3/*HID feature*/ << 8) | report_number,
mInterface,
report, offset, length,
1000/*timeout millis*/);
if (res < 0) {
Log.w(TAG, "sendFeatureReport() returned " + res + " on device " + getDeviceName());
return -1;
}
if (skipped_report_id) {
++length;
}
return length;
}
@Override
public int sendOutputReport(byte[] report) {
int r = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);
if (r != report.length) {
Log.w(TAG, "sendOutputReport() returned " + r + " on device " + getDeviceName());
}
return r;
}
@Override
public boolean getFeatureReport(byte[] report) {
int res = -1;
int offset = 0;
int length = report.length;
boolean skipped_report_id = false;
byte report_number = report[0];
if (report_number == 0x0) {
/* Offset the return buffer by 1, so that the report ID
will remain in byte 0. */
++offset;
--length;
skipped_report_id = true;
}
res = mConnection.controlTransfer(
UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_IN,
0x01/*HID get_report*/,
(3/*HID feature*/ << 8) | report_number,
mInterface,
report, offset, length,
1000/*timeout millis*/);
if (res < 0) {
Log.w(TAG, "getFeatureReport() returned " + res + " on device " + getDeviceName());
return false;
}
if (skipped_report_id) {
++res;
++length;
}
byte[] data;
if (res == length) {
data = report;
} else {
data = Arrays.copyOfRange(report, 0, res);
}
mManager.HIDDeviceFeatureReport(mDeviceId, data);
return true;
}
@Override
public void close() {
mRunning = false;
if (mInputThread != null) {
while (mInputThread.isAlive()) {
mInputThread.interrupt();
try {
mInputThread.join();
} catch (InterruptedException e) {
// Keep trying until we're done
}
}
mInputThread = null;
}
if (mConnection != null) {
UsbInterface iface = mDevice.getInterface(mInterfaceIndex);
mConnection.releaseInterface(iface);
mConnection.close();
mConnection = null;
}
}
@Override
public void shutdown() {
close();
mManager = null;
}
@Override
public void setFrozen(boolean frozen) {
mFrozen = frozen;
}
protected class InputThread extends Thread {
@Override
public void run() {
int packetSize = mInputEndpoint.getMaxPacketSize();
byte[] packet = new byte[packetSize];
while (mRunning) {
int r;
try
{
r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
}
catch (Exception e)
{
Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);
break;
}
if (r < 0) {
// Could be a timeout or an I/O error
}
if (r > 0) {
byte[] data;
if (r == packetSize) {
data = packet;
} else {
data = Arrays.copyOfRange(packet, 0, r);
}
if (!mFrozen) {
mManager.HIDDeviceInputReport(mDeviceId, data);
}
}
}
}
}
}

View file

@ -0,0 +1,90 @@
package org.libsdl.app;
import android.content.Context;
import java.lang.Class;
import java.lang.reflect.Method;
/**
SDL library initialization
*/
public class SDL {
// This function should be called first and sets up the native code
// so it can call into the Java classes
public static void setupJNI() {
SDLActivity.nativeSetupJNI();
SDLAudioManager.nativeSetupJNI();
SDLControllerManager.nativeSetupJNI();
}
// This function should be called each time the activity is started
public static void initialize() {
setContext(null);
SDLActivity.initialize();
SDLAudioManager.initialize();
SDLControllerManager.initialize();
}
// This function stores the current activity (SDL or not)
public static void setContext(Context context) {
SDLAudioManager.setContext(context);
mContext = context;
}
public static Context getContext() {
return mContext;
}
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
loadLibrary(libraryName, mContext);
}
public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
if (libraryName == null) {
throw new NullPointerException("No library name provided.");
}
try {
// Let's see if we have ReLinker available in the project. This is necessary for
// some projects that have huge numbers of local libraries bundled, and thus may
// trip a bug in Android's native library loader which ReLinker works around. (If
// loadLibrary works properly, ReLinker will simply use the normal Android method
// internally.)
//
// To use ReLinker, just add it as a dependency. For more information, see
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
//
Class<?> relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
Class<?> relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
Class<?> contextClass = context.getClassLoader().loadClass("android.content.Context");
Class<?> stringClass = context.getClassLoader().loadClass("java.lang.String");
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
// they've changed during updates.
Method forceMethod = relinkClass.getDeclaredMethod("force");
Object relinkInstance = forceMethod.invoke(null);
Class<?> relinkInstanceClass = relinkInstance.getClass();
// Actually load the library!
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
loadMethod.invoke(relinkInstance, context, libraryName, null, null);
}
catch (final Throwable e) {
// Fall back
try {
System.loadLibrary(libraryName);
}
catch (final UnsatisfiedLinkError ule) {
throw ule;
}
catch (final SecurityException se) {
throw se;
}
}
}
protected static Context mContext;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,514 @@
package org.libsdl.app;
import android.content.Context;
import android.media.AudioDeviceCallback;
import android.media.AudioDeviceInfo;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.AudioTrack;
import android.media.MediaRecorder;
import android.os.Build;
import android.util.Log;
import java.util.Arrays;
public class SDLAudioManager {
protected static final String TAG = "SDLAudio";
protected static AudioTrack mAudioTrack;
protected static AudioRecord mAudioRecord;
protected static Context mContext;
private static final int[] NO_DEVICES = {};
private static AudioDeviceCallback mAudioDeviceCallback;
public static void initialize() {
mAudioTrack = null;
mAudioRecord = null;
mAudioDeviceCallback = null;
if(Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */)
{
mAudioDeviceCallback = new AudioDeviceCallback() {
@Override
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
}
@Override
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
}
};
}
}
public static void setContext(Context context) {
mContext = context;
if (context != null) {
registerAudioDeviceCallback();
}
}
public static void release(Context context) {
unregisterAudioDeviceCallback(context);
}
// Audio
protected static String getAudioFormatString(int audioFormat) {
switch (audioFormat) {
case AudioFormat.ENCODING_PCM_8BIT:
return "8-bit";
case AudioFormat.ENCODING_PCM_16BIT:
return "16-bit";
case AudioFormat.ENCODING_PCM_FLOAT:
return "float";
default:
return Integer.toString(audioFormat);
}
}
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
int channelConfig;
int sampleSize;
int frameSize;
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
/* On older devices let's use known good settings */
if (Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
if (desiredChannels > 2) {
desiredChannels = 2;
}
}
/* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
if (Build.VERSION.SDK_INT < 22 /* Android 5.1 (LOLLIPOP_MR1) */) {
if (sampleRate < 8000) {
sampleRate = 8000;
} else if (sampleRate > 48000) {
sampleRate = 48000;
}
}
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
int minSDKVersion = (isCapture ? 23 /* Android 6.0 (M) */ : 21 /* Android 5.0 (LOLLIPOP) */);
if (Build.VERSION.SDK_INT < minSDKVersion) {
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
}
}
switch (audioFormat)
{
case AudioFormat.ENCODING_PCM_8BIT:
sampleSize = 1;
break;
case AudioFormat.ENCODING_PCM_16BIT:
sampleSize = 2;
break;
case AudioFormat.ENCODING_PCM_FLOAT:
sampleSize = 4;
break;
default:
Log.v(TAG, "Requested format " + audioFormat + ", getting ENCODING_PCM_16BIT");
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
sampleSize = 2;
break;
}
if (isCapture) {
switch (desiredChannels) {
case 1:
channelConfig = AudioFormat.CHANNEL_IN_MONO;
break;
case 2:
channelConfig = AudioFormat.CHANNEL_IN_STEREO;
break;
default:
Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");
desiredChannels = 2;
channelConfig = AudioFormat.CHANNEL_IN_STEREO;
break;
}
} else {
switch (desiredChannels) {
case 1:
channelConfig = AudioFormat.CHANNEL_OUT_MONO;
break;
case 2:
channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
break;
case 3:
channelConfig = AudioFormat.CHANNEL_OUT_STEREO | AudioFormat.CHANNEL_OUT_FRONT_CENTER;
break;
case 4:
channelConfig = AudioFormat.CHANNEL_OUT_QUAD;
break;
case 5:
channelConfig = AudioFormat.CHANNEL_OUT_QUAD | AudioFormat.CHANNEL_OUT_FRONT_CENTER;
break;
case 6:
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
break;
case 7:
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
break;
case 8:
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
} else {
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
desiredChannels = 6;
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
}
break;
default:
Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");
desiredChannels = 2;
channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
break;
}
/*
Log.v(TAG, "Speaker configuration (and order of channels):");
if ((channelConfig & 0x00000004) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT");
}
if ((channelConfig & 0x00000008) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT");
}
if ((channelConfig & 0x00000010) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_CENTER");
}
if ((channelConfig & 0x00000020) != 0) {
Log.v(TAG, " CHANNEL_OUT_LOW_FREQUENCY");
}
if ((channelConfig & 0x00000040) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_LEFT");
}
if ((channelConfig & 0x00000080) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_RIGHT");
}
if ((channelConfig & 0x00000100) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT_OF_CENTER");
}
if ((channelConfig & 0x00000200) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT_OF_CENTER");
}
if ((channelConfig & 0x00000400) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_CENTER");
}
if ((channelConfig & 0x00000800) != 0) {
Log.v(TAG, " CHANNEL_OUT_SIDE_LEFT");
}
if ((channelConfig & 0x00001000) != 0) {
Log.v(TAG, " CHANNEL_OUT_SIDE_RIGHT");
}
*/
}
frameSize = (sampleSize * desiredChannels);
// Let the user pick a larger buffer if they really want -- but ye
// gods they probably shouldn't, the minimums are horrifyingly high
// latency already
int minBufferSize;
if (isCapture) {
minBufferSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
} else {
minBufferSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);
}
desiredFrames = Math.max(desiredFrames, (minBufferSize + frameSize - 1) / frameSize);
int[] results = new int[4];
if (isCapture) {
if (mAudioRecord == null) {
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, sampleRate,
channelConfig, audioFormat, desiredFrames * frameSize);
// see notes about AudioTrack state in audioOpen(), above. Probably also applies here.
if (mAudioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
Log.e(TAG, "Failed during initialization of AudioRecord");
mAudioRecord.release();
mAudioRecord = null;
return null;
}
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
mAudioRecord.setPreferredDevice(getOutputAudioDeviceInfo(deviceId));
}
mAudioRecord.startRecording();
}
results[0] = mAudioRecord.getSampleRate();
results[1] = mAudioRecord.getAudioFormat();
results[2] = mAudioRecord.getChannelCount();
} else {
if (mAudioTrack == null) {
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
/* Try again, with safer values */
Log.e(TAG, "Failed during initialization of Audio Track");
mAudioTrack.release();
mAudioTrack = null;
return null;
}
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
mAudioTrack.setPreferredDevice(getInputAudioDeviceInfo(deviceId));
}
mAudioTrack.play();
}
results[0] = mAudioTrack.getSampleRate();
results[1] = mAudioTrack.getAudioFormat();
results[2] = mAudioTrack.getChannelCount();
}
results[3] = desiredFrames;
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", got " + results[3] + " frames of " + results[2] + " channel " + getAudioFormatString(results[1]) + " audio at " + results[0] + " Hz");
return results;
}
private static AudioDeviceInfo getInputAudioDeviceInfo(int deviceId) {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS))
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
.findFirst()
.orElse(null);
} else {
return null;
}
}
private static AudioDeviceInfo getOutputAudioDeviceInfo(int deviceId) {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS))
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
.findFirst()
.orElse(null);
} else {
return null;
}
}
private static void registerAudioDeviceCallback() {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
}
}
private static void unregisterAudioDeviceCallback(Context context) {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
}
}
/**
* This method is called by SDL using JNI.
*/
public static int[] getAudioOutputDevices() {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
} else {
return NO_DEVICES;
}
}
/**
* This method is called by SDL using JNI.
*/
public static int[] getAudioInputDevices() {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
} else {
return NO_DEVICES;
}
}
/**
* This method is called by SDL using JNI.
*/
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
}
/**
* This method is called by SDL using JNI.
*/
public static void audioWriteFloatBuffer(float[] buffer) {
if (mAudioTrack == null) {
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
return;
}
if (android.os.Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
Log.e(TAG, "Attempted to make an incompatible audio call with uninitialized audio! (floating-point output is supported since Android 5.0 Lollipop)");
return;
}
for (int i = 0; i < buffer.length;) {
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w(TAG, "SDL audio: error return from write(float)");
return;
}
}
}
/**
* This method is called by SDL using JNI.
*/
public static void audioWriteShortBuffer(short[] buffer) {
if (mAudioTrack == null) {
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
return;
}
for (int i = 0; i < buffer.length;) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w(TAG, "SDL audio: error return from write(short)");
return;
}
}
}
/**
* This method is called by SDL using JNI.
*/
public static void audioWriteByteBuffer(byte[] buffer) {
if (mAudioTrack == null) {
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
return;
}
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w(TAG, "SDL audio: error return from write(byte)");
return;
}
}
}
/**
* This method is called by SDL using JNI.
*/
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
}
/** This method is called by SDL using JNI. */
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
return 0;
} else {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
}
/** This method is called by SDL using JNI. */
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
return mAudioRecord.read(buffer, 0, buffer.length);
} else {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
}
/** This method is called by SDL using JNI. */
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
return mAudioRecord.read(buffer, 0, buffer.length);
} else {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
}
/** This method is called by SDL using JNI. */
public static void audioClose() {
if (mAudioTrack != null) {
mAudioTrack.stop();
mAudioTrack.release();
mAudioTrack = null;
}
}
/** This method is called by SDL using JNI. */
public static void captureClose() {
if (mAudioRecord != null) {
mAudioRecord.stop();
mAudioRecord.release();
mAudioRecord = null;
}
}
/** This method is called by SDL using JNI. */
public static void audioSetThreadPriority(boolean iscapture, int device_id) {
try {
/* Set thread name */
if (iscapture) {
Thread.currentThread().setName("SDLAudioC" + device_id);
} else {
Thread.currentThread().setName("SDLAudioP" + device_id);
}
/* Set thread priority */
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
} catch (Exception e) {
Log.v(TAG, "modify thread properties failed " + e.toString());
}
}
public static native int nativeSetupJNI();
public static native void removeAudioDevice(boolean isCapture, int deviceId);
public static native void addAudioDevice(boolean isCapture, int deviceId);
}

View file

@ -0,0 +1,856 @@
package org.libsdl.app;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import android.content.Context;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.util.Log;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
public class SDLControllerManager
{
public static native int nativeSetupJNI();
public static native int nativeAddJoystick(int device_id, String name, String desc,
int vendor_id, int product_id,
boolean is_accelerometer, int button_mask,
int naxes, int axis_mask, int nhats, int nballs);
public static native int nativeRemoveJoystick(int device_id);
public static native int nativeAddHaptic(int device_id, String name);
public static native int nativeRemoveHaptic(int device_id);
public static native int onNativePadDown(int device_id, int keycode);
public static native int onNativePadUp(int device_id, int keycode);
public static native void onNativeJoy(int device_id, int axis,
float value);
public static native void onNativeHat(int device_id, int hat_id,
int x, int y);
protected static SDLJoystickHandler mJoystickHandler;
protected static SDLHapticHandler mHapticHandler;
private static final String TAG = "SDLControllerManager";
public static void initialize() {
if (mJoystickHandler == null) {
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
mJoystickHandler = new SDLJoystickHandler_API19();
} else {
mJoystickHandler = new SDLJoystickHandler_API16();
}
}
if (mHapticHandler == null) {
if (Build.VERSION.SDK_INT >= 26 /* Android 8.0 (O) */) {
mHapticHandler = new SDLHapticHandler_API26();
} else {
mHapticHandler = new SDLHapticHandler();
}
}
}
// Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance
public static boolean handleJoystickMotionEvent(MotionEvent event) {
return mJoystickHandler.handleMotionEvent(event);
}
/**
* This method is called by SDL using JNI.
*/
public static void pollInputDevices() {
mJoystickHandler.pollInputDevices();
}
/**
* This method is called by SDL using JNI.
*/
public static void pollHapticDevices() {
mHapticHandler.pollHapticDevices();
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticRun(int device_id, float intensity, int length) {
mHapticHandler.run(device_id, intensity, length);
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticStop(int device_id)
{
mHapticHandler.stop(device_id);
}
// Check if a given device is considered a possible SDL joystick
public static boolean isDeviceSDLJoystick(int deviceId) {
InputDevice device = InputDevice.getDevice(deviceId);
// We cannot use InputDevice.isVirtual before API 16, so let's accept
// only nonnegative device ids (VIRTUAL_KEYBOARD equals -1)
if ((device == null) || (deviceId < 0)) {
return false;
}
int sources = device.getSources();
/* This is called for every button press, so let's not spam the logs */
/*
if ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
Log.v(TAG, "Input device " + device.getName() + " has class joystick.");
}
if ((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) {
Log.v(TAG, "Input device " + device.getName() + " is a dpad.");
}
if ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
Log.v(TAG, "Input device " + device.getName() + " is a gamepad.");
}
*/
return ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ||
((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) ||
((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
);
}
}
class SDLJoystickHandler {
/**
* Handles given MotionEvent.
* @param event the event to be handled.
* @return if given event was processed.
*/
public boolean handleMotionEvent(MotionEvent event) {
return false;
}
/**
* Handles adding and removing of input devices.
*/
public void pollInputDevices() {
}
}
/* Actual joystick functionality available for API >= 12 devices */
class SDLJoystickHandler_API16 extends SDLJoystickHandler {
static class SDLJoystick {
public int device_id;
public String name;
public String desc;
public ArrayList<InputDevice.MotionRange> axes;
public ArrayList<InputDevice.MotionRange> hats;
}
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
@Override
public int compare(InputDevice.MotionRange arg0, InputDevice.MotionRange arg1) {
// Some controllers, like the Moga Pro 2, return AXIS_GAS (22) for right trigger and AXIS_BRAKE (23) for left trigger - swap them so they're sorted in the right order for SDL
int arg0Axis = arg0.getAxis();
int arg1Axis = arg1.getAxis();
if (arg0Axis == MotionEvent.AXIS_GAS) {
arg0Axis = MotionEvent.AXIS_BRAKE;
} else if (arg0Axis == MotionEvent.AXIS_BRAKE) {
arg0Axis = MotionEvent.AXIS_GAS;
}
if (arg1Axis == MotionEvent.AXIS_GAS) {
arg1Axis = MotionEvent.AXIS_BRAKE;
} else if (arg1Axis == MotionEvent.AXIS_BRAKE) {
arg1Axis = MotionEvent.AXIS_GAS;
}
// Make sure the AXIS_Z is sorted between AXIS_RY and AXIS_RZ.
// This is because the usual pairing are:
// - AXIS_X + AXIS_Y (left stick).
// - AXIS_RX, AXIS_RY (sometimes the right stick, sometimes triggers).
// - AXIS_Z, AXIS_RZ (sometimes the right stick, sometimes triggers).
// This sorts the axes in the above order, which tends to be correct
// for Xbox-ish game pads that have the right stick on RX/RY and the
// triggers on Z/RZ.
//
// Gamepads that don't have AXIS_Z/AXIS_RZ but use
// AXIS_LTRIGGER/AXIS_RTRIGGER are unaffected by this.
//
// References:
// - https://developer.android.com/develop/ui/views/touch-and-input/game-controllers/controller-input
// - https://www.kernel.org/doc/html/latest/input/gamepad.html
if (arg0Axis == MotionEvent.AXIS_Z) {
arg0Axis = MotionEvent.AXIS_RZ - 1;
} else if (arg0Axis > MotionEvent.AXIS_Z && arg0Axis < MotionEvent.AXIS_RZ) {
--arg0Axis;
}
if (arg1Axis == MotionEvent.AXIS_Z) {
arg1Axis = MotionEvent.AXIS_RZ - 1;
} else if (arg1Axis > MotionEvent.AXIS_Z && arg1Axis < MotionEvent.AXIS_RZ) {
--arg1Axis;
}
return arg0Axis - arg1Axis;
}
}
private final ArrayList<SDLJoystick> mJoysticks;
public SDLJoystickHandler_API16() {
mJoysticks = new ArrayList<SDLJoystick>();
}
@Override
public void pollInputDevices() {
int[] deviceIds = InputDevice.getDeviceIds();
for (int device_id : deviceIds) {
if (SDLControllerManager.isDeviceSDLJoystick(device_id)) {
SDLJoystick joystick = getJoystick(device_id);
if (joystick == null) {
InputDevice joystickDevice = InputDevice.getDevice(device_id);
joystick = new SDLJoystick();
joystick.device_id = device_id;
joystick.name = joystickDevice.getName();
joystick.desc = getJoystickDescriptor(joystickDevice);
joystick.axes = new ArrayList<InputDevice.MotionRange>();
joystick.hats = new ArrayList<InputDevice.MotionRange>();
List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
Collections.sort(ranges, new RangeComparator());
for (InputDevice.MotionRange range : ranges) {
if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
if (range.getAxis() == MotionEvent.AXIS_HAT_X || range.getAxis() == MotionEvent.AXIS_HAT_Y) {
joystick.hats.add(range);
} else {
joystick.axes.add(range);
}
}
}
mJoysticks.add(joystick);
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
getVendorId(joystickDevice), getProductId(joystickDevice), false,
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, 0);
}
}
}
/* Check removed devices */
ArrayList<Integer> removedDevices = null;
for (SDLJoystick joystick : mJoysticks) {
int device_id = joystick.device_id;
int i;
for (i = 0; i < deviceIds.length; i++) {
if (device_id == deviceIds[i]) break;
}
if (i == deviceIds.length) {
if (removedDevices == null) {
removedDevices = new ArrayList<Integer>();
}
removedDevices.add(device_id);
}
}
if (removedDevices != null) {
for (int device_id : removedDevices) {
SDLControllerManager.nativeRemoveJoystick(device_id);
for (int i = 0; i < mJoysticks.size(); i++) {
if (mJoysticks.get(i).device_id == device_id) {
mJoysticks.remove(i);
break;
}
}
}
}
}
protected SDLJoystick getJoystick(int device_id) {
for (SDLJoystick joystick : mJoysticks) {
if (joystick.device_id == device_id) {
return joystick;
}
}
return null;
}
@Override
public boolean handleMotionEvent(MotionEvent event) {
int actionPointerIndex = event.getActionIndex();
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_MOVE) {
SDLJoystick joystick = getJoystick(event.getDeviceId());
if (joystick != null) {
for (int i = 0; i < joystick.axes.size(); i++) {
InputDevice.MotionRange range = joystick.axes.get(i);
/* Normalize the value to -1...1 */
float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
}
for (int i = 0; i < joystick.hats.size() / 2; i++) {
int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
}
}
}
return true;
}
public String getJoystickDescriptor(InputDevice joystickDevice) {
String desc = joystickDevice.getDescriptor();
if (desc != null && !desc.isEmpty()) {
return desc;
}
return joystickDevice.getName();
}
public int getProductId(InputDevice joystickDevice) {
return 0;
}
public int getVendorId(InputDevice joystickDevice) {
return 0;
}
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
return -1;
}
public int getButtonMask(InputDevice joystickDevice) {
return -1;
}
}
class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
@Override
public int getProductId(InputDevice joystickDevice) {
return joystickDevice.getProductId();
}
@Override
public int getVendorId(InputDevice joystickDevice) {
return joystickDevice.getVendorId();
}
@Override
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
// For compatibility, keep computing the axis mask like before,
// only really distinguishing 2, 4 and 6 axes.
int axis_mask = 0;
if (ranges.size() >= 2) {
// ((1 << SDL_GAMEPAD_AXIS_LEFTX) | (1 << SDL_GAMEPAD_AXIS_LEFTY))
axis_mask |= 0x0003;
}
if (ranges.size() >= 4) {
// ((1 << SDL_GAMEPAD_AXIS_RIGHTX) | (1 << SDL_GAMEPAD_AXIS_RIGHTY))
axis_mask |= 0x000c;
}
if (ranges.size() >= 6) {
// ((1 << SDL_GAMEPAD_AXIS_LEFT_TRIGGER) | (1 << SDL_GAMEPAD_AXIS_RIGHT_TRIGGER))
axis_mask |= 0x0030;
}
// Also add an indicator bit for whether the sorting order has changed.
// This serves to disable outdated gamecontrollerdb.txt mappings.
boolean have_z = false;
boolean have_past_z_before_rz = false;
for (InputDevice.MotionRange range : ranges) {
int axis = range.getAxis();
if (axis == MotionEvent.AXIS_Z) {
have_z = true;
} else if (axis > MotionEvent.AXIS_Z && axis < MotionEvent.AXIS_RZ) {
have_past_z_before_rz = true;
}
}
if (have_z && have_past_z_before_rz) {
// If both these exist, the compare() function changed sorting order.
// Set a bit to indicate this fact.
axis_mask |= 0x8000;
}
return axis_mask;
}
@Override
public int getButtonMask(InputDevice joystickDevice) {
int button_mask = 0;
int[] keys = new int[] {
KeyEvent.KEYCODE_BUTTON_A,
KeyEvent.KEYCODE_BUTTON_B,
KeyEvent.KEYCODE_BUTTON_X,
KeyEvent.KEYCODE_BUTTON_Y,
KeyEvent.KEYCODE_BACK,
KeyEvent.KEYCODE_MENU,
KeyEvent.KEYCODE_BUTTON_MODE,
KeyEvent.KEYCODE_BUTTON_START,
KeyEvent.KEYCODE_BUTTON_THUMBL,
KeyEvent.KEYCODE_BUTTON_THUMBR,
KeyEvent.KEYCODE_BUTTON_L1,
KeyEvent.KEYCODE_BUTTON_R1,
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_LEFT,
KeyEvent.KEYCODE_DPAD_RIGHT,
KeyEvent.KEYCODE_BUTTON_SELECT,
KeyEvent.KEYCODE_DPAD_CENTER,
// These don't map into any SDL controller buttons directly
KeyEvent.KEYCODE_BUTTON_L2,
KeyEvent.KEYCODE_BUTTON_R2,
KeyEvent.KEYCODE_BUTTON_C,
KeyEvent.KEYCODE_BUTTON_Z,
KeyEvent.KEYCODE_BUTTON_1,
KeyEvent.KEYCODE_BUTTON_2,
KeyEvent.KEYCODE_BUTTON_3,
KeyEvent.KEYCODE_BUTTON_4,
KeyEvent.KEYCODE_BUTTON_5,
KeyEvent.KEYCODE_BUTTON_6,
KeyEvent.KEYCODE_BUTTON_7,
KeyEvent.KEYCODE_BUTTON_8,
KeyEvent.KEYCODE_BUTTON_9,
KeyEvent.KEYCODE_BUTTON_10,
KeyEvent.KEYCODE_BUTTON_11,
KeyEvent.KEYCODE_BUTTON_12,
KeyEvent.KEYCODE_BUTTON_13,
KeyEvent.KEYCODE_BUTTON_14,
KeyEvent.KEYCODE_BUTTON_15,
KeyEvent.KEYCODE_BUTTON_16,
};
int[] masks = new int[] {
(1 << 0), // A -> A
(1 << 1), // B -> B
(1 << 2), // X -> X
(1 << 3), // Y -> Y
(1 << 4), // BACK -> BACK
(1 << 6), // MENU -> START
(1 << 5), // MODE -> GUIDE
(1 << 6), // START -> START
(1 << 7), // THUMBL -> LEFTSTICK
(1 << 8), // THUMBR -> RIGHTSTICK
(1 << 9), // L1 -> LEFTSHOULDER
(1 << 10), // R1 -> RIGHTSHOULDER
(1 << 11), // DPAD_UP -> DPAD_UP
(1 << 12), // DPAD_DOWN -> DPAD_DOWN
(1 << 13), // DPAD_LEFT -> DPAD_LEFT
(1 << 14), // DPAD_RIGHT -> DPAD_RIGHT
(1 << 4), // SELECT -> BACK
(1 << 0), // DPAD_CENTER -> A
(1 << 15), // L2 -> ??
(1 << 16), // R2 -> ??
(1 << 17), // C -> ??
(1 << 18), // Z -> ??
(1 << 20), // 1 -> ??
(1 << 21), // 2 -> ??
(1 << 22), // 3 -> ??
(1 << 23), // 4 -> ??
(1 << 24), // 5 -> ??
(1 << 25), // 6 -> ??
(1 << 26), // 7 -> ??
(1 << 27), // 8 -> ??
(1 << 28), // 9 -> ??
(1 << 29), // 10 -> ??
(1 << 30), // 11 -> ??
(1 << 31), // 12 -> ??
// We're out of room...
0xFFFFFFFF, // 13 -> ??
0xFFFFFFFF, // 14 -> ??
0xFFFFFFFF, // 15 -> ??
0xFFFFFFFF, // 16 -> ??
};
boolean[] has_keys = joystickDevice.hasKeys(keys);
for (int i = 0; i < keys.length; ++i) {
if (has_keys[i]) {
button_mask |= masks[i];
}
}
return button_mask;
}
}
class SDLHapticHandler_API26 extends SDLHapticHandler {
@Override
public void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
Log.d("SDL", "Rtest: Vibe with intensity " + intensity + " for " + length);
if (intensity == 0.0f) {
stop(device_id);
return;
}
int vibeValue = Math.round(intensity * 255);
if (vibeValue > 255) {
vibeValue = 255;
}
if (vibeValue < 1) {
stop(device_id);
return;
}
try {
haptic.vib.vibrate(VibrationEffect.createOneShot(length, vibeValue));
}
catch (Exception e) {
// Fall back to the generic method, which uses DEFAULT_AMPLITUDE, but works even if
// something went horribly wrong with the Android 8.0 APIs.
haptic.vib.vibrate(length);
}
}
}
}
class SDLHapticHandler {
static class SDLHaptic {
public int device_id;
public String name;
public Vibrator vib;
}
private final ArrayList<SDLHaptic> mHaptics;
public SDLHapticHandler() {
mHaptics = new ArrayList<SDLHaptic>();
}
public void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.vibrate(length);
}
}
public void stop(int device_id) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.cancel();
}
}
public void pollHapticDevices() {
final int deviceId_VIBRATOR_SERVICE = 999999;
boolean hasVibratorService = false;
int[] deviceIds = InputDevice.getDeviceIds();
// It helps processing the device ids in reverse order
// For example, in the case of the XBox 360 wireless dongle,
// so the first controller seen by SDL matches what the receiver
// considers to be the first controller
for (int i = deviceIds.length - 1; i > -1; i--) {
SDLHaptic haptic = getHaptic(deviceIds[i]);
if (haptic == null) {
InputDevice device = InputDevice.getDevice(deviceIds[i]);
Vibrator vib = device.getVibrator();
if (vib != null) {
if (vib.hasVibrator()) {
haptic = new SDLHaptic();
haptic.device_id = deviceIds[i];
haptic.name = device.getName();
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
}
}
}
/* Check VIBRATOR_SERVICE */
Vibrator vib = (Vibrator) SDL.getContext().getSystemService(Context.VIBRATOR_SERVICE);
if (vib != null) {
hasVibratorService = vib.hasVibrator();
if (hasVibratorService) {
SDLHaptic haptic = getHaptic(deviceId_VIBRATOR_SERVICE);
if (haptic == null) {
haptic = new SDLHaptic();
haptic.device_id = deviceId_VIBRATOR_SERVICE;
haptic.name = "VIBRATOR_SERVICE";
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
}
}
/* Check removed devices */
ArrayList<Integer> removedDevices = null;
for (SDLHaptic haptic : mHaptics) {
int device_id = haptic.device_id;
int i;
for (i = 0; i < deviceIds.length; i++) {
if (device_id == deviceIds[i]) break;
}
if (device_id != deviceId_VIBRATOR_SERVICE || !hasVibratorService) {
if (i == deviceIds.length) {
if (removedDevices == null) {
removedDevices = new ArrayList<Integer>();
}
removedDevices.add(device_id);
}
} // else: don't remove the vibrator if it is still present
}
if (removedDevices != null) {
for (int device_id : removedDevices) {
SDLControllerManager.nativeRemoveHaptic(device_id);
for (int i = 0; i < mHaptics.size(); i++) {
if (mHaptics.get(i).device_id == device_id) {
mHaptics.remove(i);
break;
}
}
}
}
}
protected SDLHaptic getHaptic(int device_id) {
for (SDLHaptic haptic : mHaptics) {
if (haptic.device_id == device_id) {
return haptic;
}
}
return null;
}
}
class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
// Generic Motion (mouse hover, joystick...) events go here
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
float x, y;
int action;
switch ( event.getSource() ) {
case InputDevice.SOURCE_JOYSTICK:
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
default:
break;
}
break;
default:
break;
}
// Event was not managed
return false;
}
public boolean supportsRelativeMouse() {
return false;
}
public boolean inRelativeMode() {
return false;
}
public boolean setRelativeMouseEnabled(boolean enabled) {
return false;
}
public void reclaimRelativeMouseModeIfNeeded()
{
}
public float getEventX(MotionEvent event) {
return event.getX(0);
}
public float getEventY(MotionEvent event) {
return event.getY(0);
}
}
class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API12 {
// Generic Motion (mouse hover, joystick...) events go here
private boolean mRelativeModeEnabled;
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
// Handle relative mouse mode
if (mRelativeModeEnabled) {
if (event.getSource() == InputDevice.SOURCE_MOUSE) {
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_HOVER_MOVE) {
float x = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
float y = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
}
}
}
// Event was not managed, call SDLGenericMotionListener_API12 method
return super.onGenericMotion(v, event);
}
@Override
public boolean supportsRelativeMouse() {
return true;
}
@Override
public boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
mRelativeModeEnabled = enabled;
return true;
}
@Override
public float getEventX(MotionEvent event) {
if (mRelativeModeEnabled) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
} else {
return event.getX(0);
}
}
@Override
public float getEventY(MotionEvent event) {
if (mRelativeModeEnabled) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
} else {
return event.getY(0);
}
}
}
class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
// Generic Motion (mouse hover, joystick...) events go here
private boolean mRelativeModeEnabled;
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
float x, y;
int action;
switch ( event.getSource() ) {
case InputDevice.SOURCE_JOYSTICK:
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
// DeX desktop mouse cursor is a separate non-standard input type.
case InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN:
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
default:
break;
}
break;
case InputDevice.SOURCE_MOUSE_RELATIVE:
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
default:
break;
}
break;
default:
break;
}
// Event was not managed
return false;
}
@Override
public boolean supportsRelativeMouse() {
return (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */);
}
@Override
public boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
if (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */) {
if (enabled) {
SDLActivity.getContentView().requestPointerCapture();
} else {
SDLActivity.getContentView().releasePointerCapture();
}
mRelativeModeEnabled = enabled;
return true;
} else {
return false;
}
}
@Override
public void reclaimRelativeMouseModeIfNeeded()
{
if (mRelativeModeEnabled && !SDLActivity.isDeXMode()) {
SDLActivity.getContentView().requestPointerCapture();
}
}
@Override
public float getEventX(MotionEvent event) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getX(0);
}
@Override
public float getEventY(MotionEvent event) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getY(0);
}
}

View file

@ -0,0 +1,405 @@
package org.libsdl.app;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
/**
SDLSurface. This is what we draw on, so we need to know when it's created
in order to do anything useful.
Because of this, that's where we set up the SDL thread
*/
public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
// Sensors
protected SensorManager mSensorManager;
protected Display mDisplay;
// Keep track of the surface size to normalize touch events
protected float mWidth, mHeight;
// Is SurfaceView ready for rendering
public boolean mIsSurfaceReady;
// Startup
public SDLSurface(Context context) {
super(context);
getHolder().addCallback(this);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
setOnGenericMotionListener(SDLActivity.getMotionListener());
// Some arbitrary defaults to avoid a potential division by zero
mWidth = 1.0f;
mHeight = 1.0f;
mIsSurfaceReady = false;
}
public void handlePause() {
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
public void handleResume() {
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
}
public Surface getNativeSurface() {
return getHolder().getSurface();
}
// Called when we have a valid drawing surface
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.v("SDL", "surfaceCreated()");
SDLActivity.onNativeSurfaceCreated();
}
// Called when we lose the surface
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()");
// Transition to pause, if needed
SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;
SDLActivity.handleNativeState();
mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();
}
// Called when the surface is resized
@Override
public void surfaceChanged(SurfaceHolder holder,
int format, int width, int height) {
Log.v("SDL", "surfaceChanged()");
if (SDLActivity.mSingleton == null) {
return;
}
mWidth = width;
mHeight = height;
int nDeviceWidth = width;
int nDeviceHeight = height;
try
{
if (Build.VERSION.SDK_INT >= 17 /* Android 4.2 (JELLY_BEAN_MR1) */) {
DisplayMetrics realMetrics = new DisplayMetrics();
mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels;
}
} catch(Exception ignored) {
}
synchronized(SDLActivity.getContext()) {
// In case we're waiting on a size change after going fullscreen, send a notification.
SDLActivity.getContext().notifyAll();
}
Log.v("SDL", "Window size: " + width + "x" + height);
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, mDisplay.getRefreshRate());
SDLActivity.onNativeResize();
// Prevent a screen distortion glitch,
// for instance when the device is in Landscape and a Portrait App is resumed.
boolean skip = false;
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {
if (mWidth > mHeight) {
skip = true;
}
} else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
if (mWidth < mHeight) {
skip = true;
}
}
// Special Patch for Square Resolution: Black Berry Passport
if (skip) {
double min = Math.min(mWidth, mHeight);
double max = Math.max(mWidth, mHeight);
if (max / min < 1.20) {
Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");
skip = false;
}
}
// Don't skip in MultiWindow.
if (skip) {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
Log.v("SDL", "Don't skip in Multi-Window");
skip = false;
}
}
}
if (skip) {
Log.v("SDL", "Skip .. Surface is not ready.");
mIsSurfaceReady = false;
return;
}
/* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
SDLActivity.onNativeSurfaceChanged();
/* Surface is ready */
mIsSurfaceReady = true;
SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
SDLActivity.handleNativeState();
}
// Key events
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
return SDLActivity.handleKeyEvent(v, keyCode, event, null);
}
// Touch events
@Override
public boolean onTouch(View v, MotionEvent event) {
/* Ref: http://developer.android.com/training/gestures/multi.html */
int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
int action = event.getActionMasked();
int pointerFingerId;
int i = -1;
float x,y,p;
/*
* Prevent id to be -1, since it's used in SDL internal for synthetic events
* Appears when using Android emulator, eg:
* adb shell input mouse tap 100 100
* adb shell input touchscreen tap 100 100
*/
if (touchDevId < 0) {
touchDevId -= 1;
}
// 12290 = Samsung DeX mode desktop mouse
// 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
// 0x2 = SOURCE_CLASS_POINTER
if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {
int mouseButton = 1;
try {
Object object = event.getClass().getMethod("getButtonState").invoke(event);
if (object != null) {
mouseButton = (Integer) object;
}
} catch(Exception ignored) {
}
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
// if we are. We'll leverage our existing mouse motion listener
SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
x = motionListener.getEventX(event);
y = motionListener.getEventY(event);
SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
} else {
switch(action) {
case MotionEvent.ACTION_MOVE:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_DOWN:
// Primary pointer up/down, the index is always zero
i = 0;
/* fallthrough */
case MotionEvent.ACTION_POINTER_UP:
case MotionEvent.ACTION_POINTER_DOWN:
// Non primary pointer up/down
if (i == -1) {
i = event.getActionIndex();
}
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
break;
case MotionEvent.ACTION_CANCEL:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
}
break;
default:
break;
}
}
return true;
}
// Sensor events
public void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(sensortype),
SensorManager.SENSOR_DELAY_GAME, null);
} else {
mSensorManager.unregisterListener(this,
mSensorManager.getDefaultSensor(sensortype));
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// TODO
}
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
// We thus should check here.
int newOrientation;
float x, y;
switch (mDisplay.getRotation()) {
case Surface.ROTATION_90:
x = -event.values[1];
y = event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;
break;
case Surface.ROTATION_270:
x = event.values[1];
y = -event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
break;
case Surface.ROTATION_180:
x = -event.values[0];
y = -event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
break;
case Surface.ROTATION_0:
default:
x = event.values[0];
y = event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;
break;
}
if (newOrientation != SDLActivity.mCurrentOrientation) {
SDLActivity.mCurrentOrientation = newOrientation;
SDLActivity.onNativeOrientationChanged(newOrientation);
}
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
y / SensorManager.GRAVITY_EARTH,
event.values[2] / SensorManager.GRAVITY_EARTH);
}
}
// Captured pointer events for API 26.
public boolean onCapturedPointerEvent(MotionEvent event)
{
int action = event.getActionMasked();
float x, y;
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
case MotionEvent.ACTION_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
case MotionEvent.ACTION_BUTTON_PRESS:
case MotionEvent.ACTION_BUTTON_RELEASE:
// Change our action value to what SDL's code expects.
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
action = MotionEvent.ACTION_DOWN;
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
action = MotionEvent.ACTION_UP;
}
x = event.getX(0);
y = event.getY(0);
int button = event.getButtonState();
SDLActivity.onNativeMouse(button, action, x, y, true);
return true;
}
return false;
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Lädt…</string>
<string name="unzip_notification_title">Luanti lädt</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="notification_channel_name">Allgemeine Benachrichtigung</string>
<string name="notification_channel_description">Benachrichtigungen von Luanti</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Hecho</string>
<string name="no_web_browser">No se encontró ningún navegador web</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_name">Notificación General</string>
<string name="label">Luanti</string>
<string name="notification_channel_description">Notificaciones de Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="no_web_browser">No se encontró ningún navegador web</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_description">Notificaciones de Luanti</string>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Hecho</string>
<string name="label">Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
<string name="notification_channel_name">Notificación General</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_description">کمتر از 1 دقیقه…</string>
<string name="loading">در حال بارگذاری…</string>
<string name="ime_dialog_done">انجام شد</string>
<string name="label">لوآنتی</string>
<string name="unzip_notification_title">در حال بارگذاری لوآنتی</string>
<string name="notification_channel_name">نوتیفیکیشن عمومی</string>
<string name="notification_channel_description">نوتیفیکیشن از لوآنتی</string>
<string name="no_web_browser">هیچ مرورگری یافت نشد</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Chargement…</string>
<string name="notification_channel_name">Notification générale</string>
<string name="notification_channel_description">Notifications de Luanti</string>
<string name="unzip_notification_title">Chargement de Luanti</string>
<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>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_name">Notificación xeral</string>
<string name="notification_channel_description">Notificacións de Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Feito</string>
<string name="no_web_browser">Non se atopou ningún navegador web</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loading">Betöltés…</string>
<string name="notification_channel_name">Általános értesítés</string>
<string name="notification_channel_description">Értesítések a Luanti-től</string>
<string name="unzip_notification_title">Luanti betöltése…</string>
<string name="ime_dialog_done">Kész</string>
<string name="no_web_browser">Nem található webböngésző</string>
<string name="label">Luanti</string>
<string name="unzip_notification_description">Kevesebb, mint 1 perc…</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="no_web_browser">Tidak ditemukan peramban web</string>
<string name="ime_dialog_done">Selesai</string>
<string name="label">Luanti</string>
<string name="loading">Memuat…</string>
<string name="notification_channel_name">Pemberitahuan umum</string>
<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>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="notification_channel_description">Pemberitahuan dari Luanti</string>
<string name="unzip_notification_title">Memuatkan Luanti…</string>
<string name="unzip_notification_description">Kurang dari 1 minit…</string>
<string name="no_web_browser">Tiada pelayar sesawang dijumpai</string>
<string name="loading">Memuatkan…</string>
<string name="notification_channel_name">Pemberitahuan umum</string>
<string name="ime_dialog_done">Selesai</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Laster inn …</string>
<string name="notification_channel_name">Generell merknad</string>
<string name="notification_channel_description">Merknader fra Luanti</string>
<string name="unzip_notification_description">Mindre enn ett minutt …</string>
<string name="ime_dialog_done">Ferdig</string>
<string name="no_web_browser">Fant ingen nettleser</string>
<string name="unzip_notification_title">Laster inn Luanti …</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_title">Загрузка Luanti</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>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<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="unzip_notification_title">Laddar Luanti</string>
</resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="no_web_browser">Браузерів не знайдено</string>
<string name="loading">Завантаження…</string>
<string name="notification_channel_name">Загальні сповіщення</string>
<string name="unzip_notification_title">Luanti завантажується</string>
<string name="unzip_notification_description">Менше за 1 хвилину…</string>
<string name="ime_dialog_done">Готово</string>
<string name="notification_channel_description">Сповіщення від Luanti</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">加载中…</string>
<string name="notification_channel_name">一般通知</string>
<string name="notification_channel_description">Luanti 的通知</string>
<string name="unzip_notification_title">加载 Luanti 中</string>
<string name="unzip_notification_description">不到1分钟…</string>
<string name="ime_dialog_done">完成</string>
<string name="no_web_browser">未找到网页浏览器</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loading">載入中…</string>
<string name="notification_channel_name">一般通知</string>
<string name="notification_channel_description">Luanti 的通知</string>
<string name="unzip_notification_description">不到1分鐘…</string>
<string name="ime_dialog_done">完畢</string>
<string name="no_web_browser">未找到任何網頁瀏覽器</string>
<string name="label">Luanti</string>
<string name="unzip_notification_title">載入Luanti中</string>
</resources>

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Minetest</string>
<string name="label">Luanti</string>
<string name="loading">Loading&#8230;</string>
<string name="migrating">Migrating save data from old install&#8230; (this may take a while)</string>
<string name="not_granted">Required permission wasn\'t granted, Minetest can\'t run without it</string>
<string name="notification_title">Loading Minetest</string>
<string name="notification_description">Less than 1 minute&#8230;</string>
<string name="notification_channel_name">General notification</string>
<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="ime_dialog_done">Done</string>
<string name="no_external_storage">External storage isn\'t available. If you use an SDCard, please reinsert it. Otherwise, try restarting your phone or contacting the Minetest developers</string>
<string name="no_web_browser">No web browser found</string>
</resources>

View file

@ -1,23 +1,21 @@
// 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", 6) // Version Minor
project.ext.set("versionMinor", 12) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
project.ext.set("versionExtra", "") // Version Extra
project.ext.set("versionCode", 40) // Android Version Code
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
// NOTE: +2 after each release!
// +1 for ARM and +1 for ARM64 APK's, because
// each APK must have a larger `versionCode` than the previous
// ^ keep in sync with cmake
project.ext.set("versionBuild", 0) // Version Build
// ^ fourth version number to allow releasing Android-only fixes and beta versions
buildscript {
ext.ndk_version = '23.2.8568313'
ext.ndk_version = '27.2.12479018'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:8.5.1'
classpath 'de.undercouch:gradle-download-task:4.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -27,11 +25,10 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
delete 'native/deps'
}

View file

@ -1,11 +1,13 @@
<#if isLowMemory>
org.gradle.jvmargs=-Xmx4G -XX:MaxPermSize=2G -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
<#else>
org.gradle.jvmargs=-Xmx16G -XX:MaxPermSize=8G -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx16G -XX:+HeapDumpOnOutOfMemoryError
</#if>
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.parallel.threads=8
org.gradle.configureondemand=true
android.enableJetifier=true
android.enableJetifier=false
android.useAndroidX=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

Binary file not shown.

View file

@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

295
android/gradlew vendored
View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,78 +17,111 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -97,92 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
command -v java >/dev/null || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

100
android/gradlew.bat vendored
View file

@ -1,100 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

111
android/icons/exit_btn.svg Normal file
View file

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg8"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
sodipodi:docname="exit_btn.svg"
inkscape:export-filename="../../textures/base/pack/exit_btn.png"
inkscape:export-xdpi="24.000002"
inkscape:export-ydpi="24.000002"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs10" />
<sodipodi:namedview
id="base"
pagecolor="#404040"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.84958349"
inkscape:cx="-94.752312"
inkscape:cy="291.31922"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="false"
inkscape:snap-grids="true"
inkscape:snap-page="true"
showguides="false"
inkscape:showpageshadow="2"
inkscape:deskcolor="#404040">
<inkscape:grid
type="xygrid"
id="grid16"
spacingx="0.26458333"
spacingy="0.26458333"
empspacing="4"
color="#40ff40"
opacity="0.1254902"
empcolor="#40ff40"
empopacity="0.25098039" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<path
id="rect5028"
style="display:inline;fill:none;stroke:#ffffff;stroke-width:5.99996;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none"
d="m 78.052082,90.48746 v 17.4625 l -50.535415,4e-5 V 27.516667 l 50.535415,3.7e-5 v 17.462423"
sodipodi:nodetypes="cccccc" />
<path
style="display:inline;fill:none;stroke:#ffffff;stroke-width:5.99996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 101.49853,55.033202 12.69966,12.700052 -12.69966,12.699942"
id="path4737"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="display:inline;fill:none;stroke:#ffffff;stroke-width:6;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 113.36416,67.733332 H 59.484405"
id="path4729"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -1,194 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg8"
inkscape:version="0.92.1 r15371"
sodipodi:docname="gear_icon.svg"
inkscape:export-filename="/home/stu/Desktop/icons/png/gear_icon.png"
inkscape:export-xdpi="24"
inkscape:export-ydpi="24">
<defs
id="defs2">
<marker
style="overflow:visible"
refY="0.0"
refX="0.0"
orient="auto"
id="DistanceX">
<path
id="path4687"
style="stroke:#000000; stroke-width:0.5"
d="M 3,-3 L -3,3 M 0,-5 L 0,5" />
</marker>
<pattern
y="0"
x="0"
width="8"
patternUnits="userSpaceOnUse"
id="Hatch"
height="8">
<path
id="path4690"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M8 4 l-4,4" />
<path
id="path4692"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M6 2 l-4,4" />
<path
id="path4694"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M4 0 l-4,4" />
</pattern>
<marker
style="overflow:visible"
refY="0.0"
refX="0.0"
orient="auto"
id="DistanceX-3">
<path
id="path4756"
style="stroke:#000000; stroke-width:0.5"
d="M 3,-3 L -3,3 M 0,-5 L 0,5" />
</marker>
<pattern
y="0"
x="0"
width="8"
patternUnits="userSpaceOnUse"
id="Hatch-6"
height="8">
<path
id="path4759"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M8 4 l-4,4" />
<path
id="path4761"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M6 2 l-4,4" />
<path
id="path4763"
stroke-width="0.25"
stroke="#000000"
linecap="square"
d="M4 0 l-4,4" />
</pattern>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#404040"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.5"
inkscape:cx="-308.644"
inkscape:cy="171.10144"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="false"
inkscape:snap-page="true"
inkscape:snap-grids="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-to-guides="false"
inkscape:showpageshadow="false"
inkscape:snap-smooth-nodes="true"
inkscape:object-nodes="false">
<inkscape:grid
type="xygrid"
id="grid16"
spacingx="2.1166666"
spacingy="2.1166666"
empspacing="2"
color="#40ff40"
opacity="0.1254902"
empcolor="#40ff40"
empopacity="0.25098039" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-161.53332)">
<g
id="g4792"
transform="matrix(0.68725287,0,0,0.65623884,67.477909,-509.24679)"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.74041259;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<g
id="g4772"
inkscape:label="OpenJsCad"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.74041259;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 256,80.943359 -8.28125,0.72461 -3.63477,5.410156 -5.61328,12.685547 -2.28906,9.259768 -0.35156,5.1875 0.0937,0.86133 0.70703,2.44726 0.60547,9.80664 -2.66602,5.47461 -21.5957,5.78711 -5.04492,-3.40625 -4.37696,-8.79687 -0.61132,-2.47071 -0.35157,-0.79297 -2.89648,-4.31836 -6.60938,-6.87304 -11.20507,-8.17969 -5.84961,-2.86719 -7.53516,3.51367 -6.80859,4.76954 -0.44336,6.50195 1.48047,13.79297 2.64453,9.16406 2.28906,4.66992 0.51172,0.69922 1.83398,1.76563 5.42774,8.18945 0.42773,6.07422 -15.81054,15.81445 -6.07032,-0.42773 -8.18945,-5.42969 -1.76367,-1.83399 -0.69922,-0.51171 -4.66992,-2.28907 -9.15821,-2.64843 -13.79297,-1.47852 -6.5,0.44141 -4.76757,6.8125 -3.51367,7.53515 2.86914,5.85157 8.17382,11.20703 6.87305,6.61132 4.31641,2.90039 0.79297,0.34961 2.4707,0.61133 8.79492,4.37696 3.4043,5.04687 -5.78516,21.60156 -5.47265,2.66602 -9.80469,-0.60547 -2.44727,-0.70703 -0.85937,-0.0918 -5.1875,0.35156 -9.257816,2.28907 -12.68164,5.61523 -5.408203,3.63281 -0.72461,8.28516 0.72461,8.28516 5.408203,3.63281 12.68164,5.61523 9.257816,2.28907 5.1875,0.35156 0.85937,-0.0918 2.44727,-0.70703 9.80469,-0.60547 5.47265,2.66602 5.78516,21.60156 -3.4043,5.04687 -8.79492,4.37696 -2.4707,0.61133 -0.79297,0.34961 -4.31641,2.90039 -6.87305,6.61132 -8.17382,11.20703 -2.86914,5.85157 3.51367,7.53515 4.76757,6.8125 6.5,0.44141 13.79297,-1.47852 9.15821,-2.64843 4.66992,-2.28907 0.69922,-0.50976 1.76367,-1.83594 8.18945,-5.42969 6.07032,-0.42773 15.81054,15.81445 -0.42773,6.07422 -5.42774,8.18945 -1.83398,1.76563 -0.51172,0.69922 -2.28906,4.66992 -2.64453,9.16406 -1.48047,13.79297 0.44336,6.50195 6.80859,4.76758 7.53516,3.51758 5.84961,-2.86914 11.20507,-8.17969 6.60938,-6.87304 2.89648,-4.31836 0.35157,-0.79297 0.61132,-2.47071 4.37696,-8.79687 5.04492,-3.40625 21.5957,5.78711 2.66602,5.47461 -0.60547,9.80664 -0.70703,2.44726 -0.0937,0.85938 0.35156,5.18945 2.28906,9.25977 5.61328,12.68555 3.63477,5.41015 8.28125,0.72461 8.28125,-0.72461 3.63477,-5.41015 5.61328,-12.68555 2.28906,-9.25977 0.35156,-5.18945 -0.0937,-0.85938 -0.70703,-2.44726 -0.60547,-9.80664 2.66602,-5.47461 21.5957,-5.78711 5.04492,3.40625 4.37696,8.79687 0.61132,2.47071 0.35157,0.79297 2.89648,4.31836 6.60938,6.87304 11.20507,8.17969 5.84961,2.86914 7.53516,-3.51758 6.80859,-4.76758 0.44336,-6.50195 -1.48047,-13.79297 -2.64453,-9.16406 -2.28906,-4.66992 -0.51172,-0.69922 -1.83398,-1.76563 -5.42774,-8.18945 -0.42773,-6.07422 15.81054,-15.81445 6.07032,0.42773 8.18945,5.42969 1.76367,1.83594 0.69922,0.50976 4.66992,2.28907 9.15821,2.64843 13.79297,1.47852 6.5,-0.44141 v -0.002 l 4.76757,-6.81055 3.51367,-7.53711 -2.86914,-5.85156 -8.17382,-11.20508 -6.87305,-6.61328 -4.31641,-2.89843 -0.79297,-0.34961 -2.4707,-0.61133 -8.79492,-4.37891 -3.4043,-5.04492 5.78516,-21.60352 5.47265,-2.66797 9.80469,0.60938 2.44727,0.70703 0.85937,0.0918 5.1875,-0.35156 9.25782,-2.28907 12.68164,-5.61718 5.4082,-3.63282 0.72461,-8.28515 -0.72461,-8.28321 -5.4082,-3.63476 -12.68164,-5.61524 -9.25782,-2.28711 -5.1875,-0.35351 -0.85937,0.0937 -2.44727,0.70508 -9.80469,0.60937 -5.47265,-2.66797 -5.78516,-21.59961 3.4043,-5.04882 8.79492,-4.37696 2.4707,-0.61133 0.79297,-0.35156 4.31641,-2.89844 6.87305,-6.61132 8.17382,-11.20703 2.86914,-5.85157 -3.51367,-7.53711 -4.76757,-6.81054 -6.5,-0.44336 -13.79297,1.48047 -9.15821,2.64648 -4.66992,2.28906 -0.69922,0.51172 -1.76367,1.83594 -8.18945,5.42773 -6.07032,0.42774 -15.81054,-15.81446 0.42773,-6.07226 5.42774,-8.18945 1.83398,-1.76563 0.51172,-0.69922 2.28906,-4.67187 2.64453,-9.16016 1.48047,-13.79492 -0.44336,-6.50195 -6.80859,-4.76954 -7.53516,-3.51562 -5.84961,2.87109 -11.20507,8.17578 -6.60938,6.875 -2.89648,4.31836 -0.35157,0.79102 -0.61132,2.47266 -4.37696,8.79687 -5.04492,3.4082 -21.5957,-5.79101 -2.66602,-5.47266 0.60547,-9.80664 0.70703,-2.44726 0.0937,-0.85938 -0.35156,-5.19141 -2.28906,-9.259761 -5.61328,-12.683594 -3.63477,-5.412109 z m 0,97.111331 A 77.946197,77.946197 0 0 1 333.94531,256 77.946197,77.946197 0 0 1 256,333.94531 77.946197,77.946197 0 0 1 178.05469,256 77.946197,77.946197 0 0 1 256,178.05469 Z"
transform="matrix(0.38495268,0,0,0.40318156,-98.176247,1022.1341)"
id="path4768"
inkscape:connector-curvature="0" />
</g>
<g
id="g4774"
inkscape:label="0"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.74041259;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.7 KiB

View file

@ -2,23 +2,23 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256"
width="512"
height="512"
viewBox="0 0 67.73333 135.46667"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg8"
inkscape:version="0.92.1 r15371"
sodipodi:docname="rare_controls.svg"
inkscape:export-filename="/home/stu/Desktop/icons/png/rare_controls.png"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
sodipodi:docname="overflow_btn.svg"
inkscape:export-filename="../../textures/base/pack/overflow_btn.png"
inkscape:export-xdpi="24.000002"
inkscape:export-ydpi="24.000002">
inkscape:export-ydpi="24.000002"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs2">
<filter
@ -397,22 +397,24 @@
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="-59.862018"
inkscape:cy="260.34663"
inkscape:zoom="0.98994949"
inkscape:cx="41.921331"
inkscape:cy="163.13964"
inkscape:document-units="mm"
inkscape:current-layer="layer2"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="false"
inkscape:snap-grids="true"
inkscape:snap-page="true"
showguides="false">
showguides="false"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid16"
@ -422,7 +424,11 @@
color="#40ff40"
opacity="0.1254902"
empcolor="#40ff40"
empopacity="0.25098039" />
empopacity="0.25098039"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata5">
@ -432,7 +438,6 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
@ -496,26 +501,27 @@
x="264.65997"
y="124.10143"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-opacity:1" /></flowRegion><flowPara
id="flowPara4724" /></flowRoot> <rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect5231-9"
width="25.4"
height="25.400003"
x="21.166666"
y="101.6" />
id="flowPara4724" /></flowRoot>
<rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect5231-9-7"
width="25.4"
height="25.400003"
x="21.166666"
y="55.033333" />
<rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:5.38756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect5231-9-5"
width="25.4"
height="25.400003"
x="21.166664"
y="8.4666681" />
width="96.212502"
height="0.61243516"
x="19.62678"
y="33.575779" />
<rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:5.38755;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect5231-9-5-7"
width="96.212448"
height="0.6124543"
x="19.627108"
y="67.442772" />
<rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:5.38755;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect5231-9-5-7-5"
width="96.212448"
height="0.6124543"
x="19.627108"
y="101.30978" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -2,27 +2,24 @@ apply plugin: 'com.android.library'
apply plugin: 'de.undercouch.download'
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
ndkVersion "$ndk_version"
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
minSdkVersion 21
compileSdk 34
targetSdkVersion 34
externalNativeBuild {
ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors(),
"versionMajor=${versionMajor}",
"versionMinor=${versionMinor}",
"versionPatch=${versionPatch}",
"versionExtra=${versionExtra}",
"developmentBuild=${developmentBuild}"
cmake {
arguments "-DANDROID_STL=c++_shared",
"-DENABLE_CURL=1", "-DENABLE_SOUND=1",
"-DENABLE_GETTEXT=1",
"-DBUILD_UNITTESTS=0", "-DENABLE_UPDATE_CHECKER=0"
}
}
}
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
cmake {
path file("../../CMakeLists.txt")
}
}
@ -31,39 +28,45 @@ android {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'//, 'x86'
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildTypes {
release {
externalNativeBuild {
ndkBuild {
arguments 'NDEBUG=1'
}
}
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
debugSymbolLevel 'FULL'
}
}
}
namespace 'net.minetest'
}
// get precompiled deps
def depsDir = new File(buildDir.parent, 'deps')
if (new File(depsDir, 'armeabi-v7a').exists()) {
task getDeps {
doLast { logger.lifecycle('Using existing deps from {}', depsDir) }
}
} else {
task downloadDeps(type: Download) {
def depsZip = new File(buildDir, 'deps.zip')
src 'https://github.com/luanti-org/luanti_android_deps/releases/download/latest/deps-lite.zip'
dest depsZip
overwrite false
task getDeps(dependsOn: downloadDeps, type: Copy) {
depsDir.mkdir()
from zipTree(depsZip)
into depsDir
doFirst { logger.lifecycle('Extracting to {}', depsDir) }
}
}
}
// get precompiled deps
task downloadDeps(type: Download) {
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
dest new File(buildDir, 'deps.zip')
overwrite false
}
task getDeps(dependsOn: downloadDeps, type: Copy) {
def deps = new File(buildDir.parent, 'deps')
if (!deps.exists()) {
deps.mkdir()
from zipTree(downloadDeps.dest)
into deps
}
}
preBuild.dependsOn getDeps
clean {
delete new File(buildDir.parent, 'deps')
}

View file

@ -1,291 +0,0 @@
LOCAL_PATH := $(call my-dir)/..
#LOCAL_ADDRESS_SANITIZER:=true
#USE_BUILTIN_LUA:=true
include $(CLEAR_VARS)
LOCAL_MODULE := Curl
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libcurl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedcrypto
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedcrypto.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedtls
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedtls.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedx509
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedx509.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Freetype
LOCAL_SRC_FILES := deps/$(APP_ABI)/Freetype/libfreetype.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Iconv
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libiconv.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libcharset
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libcharset.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := deps/$(APP_ABI)/Irrlicht/libIrrlichtMt.a
include $(PREBUILT_STATIC_LIBRARY)
ifndef USE_BUILTIN_LUA
include $(CLEAR_VARS)
LOCAL_MODULE := LuaJIT
LOCAL_SRC_FILES := deps/$(APP_ABI)/LuaJIT/libluajit.a
include $(PREBUILT_STATIC_LIBRARY)
endif
include $(CLEAR_VARS)
LOCAL_MODULE := OpenAL
LOCAL_SRC_FILES := deps/$(APP_ABI)/OpenAL-Soft/libopenal.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Gettext
LOCAL_SRC_FILES := deps/$(APP_ABI)/Gettext/libintl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := SQLite3
LOCAL_SRC_FILES := deps/$(APP_ABI)/SQLite/libsqlite3.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Vorbis
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbis.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libvorbisfile
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbisfile.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libogg
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libogg.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Zstd
LOCAL_SRC_FILES := deps/$(APP_ABI)/Zstd/libzstd.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Minetest
LOCAL_CFLAGS += \
-DJSONCPP_NO_LOCALE_SUPPORT \
-DHAVE_TOUCHSCREENGUI \
-DENABLE_GLES=1 \
-DUSE_CURL=1 \
-DUSE_SOUND=1 \
-DUSE_LEVELDB=0 \
-DUSE_GETTEXT=1 \
-DVERSION_MAJOR=${versionMajor} \
-DVERSION_MINOR=${versionMinor} \
-DVERSION_PATCH=${versionPatch} \
-DVERSION_EXTRA=${versionExtra} \
-DDEVELOPMENT_BUILD=${developmentBuild} \
$(GPROF_DEF)
ifdef USE_BUILTIN_LUA
LOCAL_CFLAGS += -DUSE_LUAJIT=0
else
LOCAL_CFLAGS += -DUSE_LUAJIT=1
endif
ifdef NDEBUG
LOCAL_CFLAGS += -DNDEBUG=1
endif
ifdef GPROF
GPROF_DEF := -DGPROF
PROFILER_LIBS := android-ndk-profiler
LOCAL_CFLAGS += -pg
endif
LOCAL_C_INCLUDES := \
../../src \
../../src/script \
../../lib/gmp \
../../lib/jsoncpp \
deps/$(APP_ABI)/Curl/include \
deps/$(APP_ABI)/Freetype/include/freetype2 \
deps/$(APP_ABI)/Irrlicht/include \
deps/$(APP_ABI)/Gettext/include \
deps/$(APP_ABI)/Iconv/include \
deps/$(APP_ABI)/OpenAL-Soft/include \
deps/$(APP_ABI)/SQLite/include \
deps/$(APP_ABI)/Vorbis/include \
deps/$(APP_ABI)/Zstd/include
ifdef USE_BUILTIN_LUA
LOCAL_C_INCLUDES += \
../../lib/lua/src \
../../lib/bitop
else
LOCAL_C_INCLUDES += deps/$(APP_ABI)/LuaJIT/include
endif
LOCAL_SRC_FILES := \
$(wildcard ../../src/client/*.cpp) \
$(wildcard ../../src/client/*/*.cpp) \
$(wildcard ../../src/content/*.cpp) \
../../src/database/database.cpp \
../../src/database/database-dummy.cpp \
../../src/database/database-files.cpp \
../../src/database/database-sqlite3.cpp \
$(wildcard ../../src/gui/*.cpp) \
$(wildcard ../../src/irrlicht_changes/*.cpp) \
$(wildcard ../../src/mapgen/*.cpp) \
$(wildcard ../../src/network/*.cpp) \
$(wildcard ../../src/script/*.cpp) \
$(wildcard ../../src/script/*/*.cpp) \
$(wildcard ../../src/server/*.cpp) \
$(wildcard ../../src/threading/*.cpp) \
$(wildcard ../../src/util/*.c) \
$(wildcard ../../src/util/*.cpp) \
../../src/ban.cpp \
../../src/chat.cpp \
../../src/clientiface.cpp \
../../src/collision.cpp \
../../src/content_mapnode.cpp \
../../src/content_nodemeta.cpp \
../../src/convert_json.cpp \
../../src/craftdef.cpp \
../../src/debug.cpp \
../../src/defaultsettings.cpp \
../../src/emerge.cpp \
../../src/environment.cpp \
../../src/face_position_cache.cpp \
../../src/filesys.cpp \
../../src/gettext.cpp \
../../src/httpfetch.cpp \
../../src/hud.cpp \
../../src/inventory.cpp \
../../src/inventorymanager.cpp \
../../src/itemdef.cpp \
../../src/itemstackmetadata.cpp \
../../src/light.cpp \
../../src/log.cpp \
../../src/main.cpp \
../../src/map.cpp \
../../src/map_settings_manager.cpp \
../../src/mapblock.cpp \
../../src/mapnode.cpp \
../../src/mapsector.cpp \
../../src/metadata.cpp \
../../src/modchannels.cpp \
../../src/nameidmapping.cpp \
../../src/nodedef.cpp \
../../src/nodemetadata.cpp \
../../src/nodetimer.cpp \
../../src/noise.cpp \
../../src/objdef.cpp \
../../src/object_properties.cpp \
../../src/particles.cpp \
../../src/pathfinder.cpp \
../../src/player.cpp \
../../src/porting.cpp \
../../src/porting_android.cpp \
../../src/profiler.cpp \
../../src/raycast.cpp \
../../src/reflowscan.cpp \
../../src/remoteplayer.cpp \
../../src/rollback.cpp \
../../src/rollback_interface.cpp \
../../src/serialization.cpp \
../../src/server.cpp \
../../src/serverenvironment.cpp \
../../src/serverlist.cpp \
../../src/settings.cpp \
../../src/staticobject.cpp \
../../src/texture_override.cpp \
../../src/tileanimation.cpp \
../../src/tool.cpp \
../../src/translation.cpp \
../../src/version.cpp \
../../src/voxel.cpp \
../../src/voxelalgorithms.cpp
# Built-in Lua
ifdef USE_BUILTIN_LUA
LOCAL_SRC_FILES += \
../../lib/lua/src/lapi.c \
../../lib/lua/src/lauxlib.c \
../../lib/lua/src/lbaselib.c \
../../lib/lua/src/lcode.c \
../../lib/lua/src/ldblib.c \
../../lib/lua/src/ldebug.c \
../../lib/lua/src/ldo.c \
../../lib/lua/src/ldump.c \
../../lib/lua/src/lfunc.c \
../../lib/lua/src/lgc.c \
../../lib/lua/src/linit.c \
../../lib/lua/src/liolib.c \
../../lib/lua/src/llex.c \
../../lib/lua/src/lmathlib.c \
../../lib/lua/src/lmem.c \
../../lib/lua/src/loadlib.c \
../../lib/lua/src/lobject.c \
../../lib/lua/src/lopcodes.c \
../../lib/lua/src/loslib.c \
../../lib/lua/src/lparser.c \
../../lib/lua/src/lstate.c \
../../lib/lua/src/lstring.c \
../../lib/lua/src/lstrlib.c \
../../lib/lua/src/ltable.c \
../../lib/lua/src/ltablib.c \
../../lib/lua/src/ltm.c \
../../lib/lua/src/lundump.c \
../../lib/lua/src/lvm.c \
../../lib/lua/src/lzio.c \
../../lib/bitop/bit.c
endif
# GMP
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
# JSONCPP
LOCAL_SRC_FILES += ../../lib/jsoncpp/jsoncpp.cpp
LOCAL_STATIC_LIBRARIES += \
Curl libmbedcrypto libmbedtls libmbedx509 \
Freetype \
Iconv libcharset \
Irrlicht \
OpenAL \
Gettext \
SQLite3 \
Vorbis libvorbisfile libogg \
Zstd
ifndef USE_BUILTIN_LUA
LOCAL_STATIC_LIBRARIES += LuaJIT
endif
LOCAL_STATIC_LIBRARIES += android_native_app_glue $(PROFILER_LIBS)
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
include $(BUILD_SHARED_LIBRARY)
ifdef GPROF
$(call import-module,android-ndk-profiler)
endif
$(call import-module,android/native_app_glue)

View file

@ -1,32 +0,0 @@
APP_PLATFORM := ${APP_PLATFORM}
APP_ABI := ${TARGET_ABI}
APP_STL := c++_shared
NDK_TOOLCHAIN_VERSION := clang
APP_SHORT_COMMANDS := true
APP_MODULES := Minetest
APP_CPPFLAGS := -O2 -fvisibility=hidden
ifeq ($(APP_ABI),armeabi-v7a)
APP_CPPFLAGS += -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
endif
ifeq ($(APP_ABI),x86)
APP_CPPFLAGS += -mssse3 -mfpmath=sse -funroll-loops
endif
ifndef NDEBUG
APP_CPPFLAGS := -g -Og -fno-omit-frame-pointer
endif
APP_CFLAGS := $(APP_CPPFLAGS) -Wno-inconsistent-missing-override -Wno-parentheses-equality
APP_CXXFLAGS := $(APP_CPPFLAGS) -fexceptions -frtti -std=gnu++14
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
ifeq ($(APP_ABI),arm64-v8a)
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections
endif
ifndef NDEBUG
APP_LDFLAGS :=
endif

View file

@ -1 +1 @@
<manifest package="net.minetest" />
<manifest />

View file

@ -1,2 +1,2 @@
rootProject.name = "Minetest"
rootProject.name = "Luanti"
include ':app', ':native'

View file

@ -13,9 +13,12 @@ end
-- Import a bunch of individual files from builtin/game/
local gamepath = core.get_builtin_path() .. "game" .. DIR_DELIM
local commonpath = core.get_builtin_path() .. "common" .. DIR_DELIM
local builtin_shared = {}
dofile(gamepath .. "constants.lua")
dofile(gamepath .. "item_s.lua")
assert(loadfile(commonpath .. "item_s.lua"))(builtin_shared)
dofile(gamepath .. "misc_s.lua")
dofile(gamepath .. "features.lua")
dofile(gamepath .. "voxelarea.lua")
@ -33,11 +36,16 @@ do
setmetatable(v, {__newindex = {}})
-- Reassemble the other tables
if v.type == "node" then
getmetatable(v).__index = all.nodedef_default
all.registered_nodes[k] = v
elseif v.type == "craftitem" then
elseif v.type == "craft" then
getmetatable(v).__index = all.craftitemdef_default
all.registered_craftitems[k] = v
elseif v.type == "tool" then
getmetatable(v).__index = all.tooldef_default
all.registered_tools[k] = v
else
getmetatable(v).__index = all.noneitemdef_default
end
end
@ -57,3 +65,5 @@ setmetatable(core.registered_items, alias_metatable)
setmetatable(core.registered_nodes, alias_metatable)
setmetatable(core.registered_craftitems, alias_metatable)
setmetatable(core.registered_tools, alias_metatable)
builtin_shared.cache_content_ids()

View file

@ -1,5 +1,3 @@
-- Minetest: builtin/client/chatcommands.lua
core.register_on_sending_chat_message(function(message)
if message:sub(1,2) == ".." then
return false

View file

@ -1,15 +0,0 @@
-- CSM death formspec. Only used when clientside modding is enabled, otherwise
-- handled by the engine.
core.register_on_death(function()
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
"label[4.85,1.35;" .. fgettext("You died") ..
"]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
core.show_formspec("bultin:death", formspec)
end)
core.register_on_formspec_input(function(formname, fields)
if formname == "bultin:death" then
core.send_respawn()
end
end)

View file

@ -1,12 +1,15 @@
-- Minetest: builtin/client/init.lua
local scriptpath = core.get_builtin_path()
local clientpath = scriptpath.."client"..DIR_DELIM
local commonpath = scriptpath.."common"..DIR_DELIM
dofile(clientpath .. "register.lua")
local builtin_shared = {}
assert(loadfile(commonpath .. "register.lua"))(builtin_shared)
assert(loadfile(clientpath .. "register.lua"))(builtin_shared)
dofile(commonpath .. "after.lua")
dofile(commonpath .. "mod_storage.lua")
dofile(commonpath .. "chatcommands.lua")
dofile(commonpath .. "information_formspecs.lua")
dofile(clientpath .. "chatcommands.lua")
dofile(clientpath .. "death_formspec.lua")
dofile(clientpath .. "misc.lua")
assert(loadfile(commonpath .. "item_s.lua"))({}) -- Just for push/read node functions

View file

@ -5,3 +5,14 @@ function core.setting_get_pos(name)
end
return core.string_to_pos(value)
end
-- old non-method sound functions
function core.sound_stop(handle, ...)
return handle:stop(...)
end
function core.sound_fade(handle, ...)
return handle:fade(...)
end

View file

@ -1,68 +1,6 @@
core.callback_origins = {}
local builtin_shared = ...
local getinfo = debug.getinfo
debug.getinfo = nil
--- Runs given callbacks.
--
-- Note: this function is also called from C++
-- @tparam table callbacks a table with registered callbacks, like `core.registered_on_*`
-- @tparam number mode a RunCallbacksMode, as defined in src/script/common/c_internal.h
-- @param ... arguments for the callback
-- @return depends on mode
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks
if cb_len == 0 then
if mode == 2 or mode == 3 then
return true
elseif mode == 4 or mode == 5 then
return false
end
end
local ret
for i = 1, cb_len do
local cb_ret = callbacks[i](...)
if mode == 0 and i == 1 or mode == 1 and i == cb_len then
ret = cb_ret
elseif mode == 2 then
if not cb_ret or i == 1 then
ret = cb_ret
end
elseif mode == 3 then
if cb_ret then
return cb_ret
end
ret = cb_ret
elseif mode == 4 then
if (cb_ret and not ret) or i == 1 then
ret = cb_ret
end
elseif mode == 5 and cb_ret then
return cb_ret
end
end
return ret
end
--
-- Callback registration
--
local function make_registration()
local t = {}
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = getinfo(1, "n").name or "??"
}
--local origin = core.callback_origins[func]
--print(origin.name .. ": " .. origin.mod .. " registering cbk " .. tostring(func))
end
return t, registerfunc
end
local make_registration = builtin_shared.make_registration
core.registered_globalsteps, core.register_globalstep = make_registration()
core.registered_on_mods_loaded, core.register_on_mods_loaded = make_registration()

View file

@ -1,4 +1,116 @@
local jobs = {}
-- This is an implementation of a job sheduling mechanism. It guarantees that
-- coexisting jobs will execute primarily in order of least expiry, and
-- secondarily in order of first registration.
-- These functions implement an intrusive singly linked list of one or more
-- elements where the first element has a pointer to the last. The next pointer
-- is stored with key list_next. The pointer to the last is with key list_end.
local function list_init(first)
first.list_end = first
end
local function list_append(first, append)
first.list_end.list_next = append
first.list_end = append
end
local function list_append_list(first, first_append)
first.list_end.list_next = first_append
first.list_end = first_append.list_end
end
-- The jobs are stored in a map from expiration times to linked lists of jobs
-- as above. The expiration times are also stored in an array representing a
-- binary min heap, which is a particular arrangement of binary tree. A parent
-- at index i has children at indices i*2 and i*2+1. Out-of-bounds indices
-- represent nonexistent children. A parent is never greater than its children.
-- This structure means that, if there is at least one job, the next expiration
-- time is the first item in the array.
-- Push element on a binary min-heap,
-- "bubbling up" the element by swapping with larger parents.
local function heap_push(heap, element)
local index = #heap + 1
while index > 1 do
local parent_index = math.floor(index / 2)
local parent = heap[parent_index]
if element < parent then
heap[index] = parent
index = parent_index
else
break
end
end
heap[index] = element
end
-- Pop smallest element from the heap,
-- "sinking down" the last leaf on the last layer of the heap
-- by swapping with the smaller child.
local function heap_pop(heap)
local removed_element = heap[1]
local length = #heap
local element = heap[length]
heap[length] = nil
length = length - 1
if length > 0 then
local index = 1
while true do
local old_index = index
local smaller_element = element
local left_index = index * 2
local right_index = index * 2 + 1
if left_index <= length then
local left_element = heap[left_index]
if left_element < smaller_element then
index = left_index
smaller_element = left_element
end
end
if right_index <= length then
if heap[right_index] < smaller_element then
index = right_index
end
end
if old_index ~= index then
heap[old_index] = heap[index]
else
break
end
end
heap[index] = element
end
return removed_element
end
local job_map = {}
local expiries = {}
-- Adds an individual job with the given expiry.
-- The worst-case complexity is O(log n), where n is the number of distinct
-- expiration times.
local function add_job(expiry, job)
local list = job_map[expiry]
if list then
list_append(list, job)
else
list_init(job)
job_map[expiry] = job
heap_push(expiries, expiry)
end
end
-- Removes the next expiring jobs and returns the linked list of them.
-- The worst-case complexity is O(log n), where n is the number of distinct
-- expiration times.
local function remove_first_jobs()
local removed_expiry = heap_pop(expiries)
local removed = job_map[removed_expiry]
job_map[removed_expiry] = nil
return removed
end
local time = 0.0
local time_next = math.huge
@ -9,42 +121,54 @@ core.register_globalstep(function(dtime)
return
end
time_next = math.huge
-- Remove the expired jobs.
local expired = remove_first_jobs()
-- Iterate backwards so that we miss any new timers added by
-- a timer callback.
for i = #jobs, 1, -1 do
local job = jobs[i]
if time >= job.expire then
core.set_last_run_mod(job.mod_origin)
job.func(unpack(job.arg))
local jobs_l = #jobs
jobs[i] = jobs[jobs_l]
jobs[jobs_l] = nil
elseif job.expire < time_next then
time_next = job.expire
-- Remove other expired jobs and append them to the list.
while true do
time_next = expiries[1] or math.huge
if time_next > time then
break
end
list_append_list(expired, remove_first_jobs())
end
-- Run the callbacks afterward to prevent infinite loops with core.after(0, ...).
local last_expired = expired.list_end
while true do
core.set_last_run_mod(expired.mod_origin)
expired.func(unpack(expired.args, 1, expired.args.n))
if expired == last_expired then
break
end
expired = expired.list_next
end
end)
function core.after(after, func, ...)
assert(tonumber(after) and type(func) == "function",
"Invalid minetest.after invocation")
local expire = time + after
local new_job = {
func = func,
expire = expire,
arg = {...},
mod_origin = core.get_last_run_mod(),
}
local job_metatable = {__index = {}}
jobs[#jobs + 1] = new_job
time_next = math.min(time_next, expire)
return {
cancel = function()
new_job.func = function() end
new_job.args = {}
end
}
local function dummy_func() end
function job_metatable.__index:cancel()
self.func = dummy_func
self.args = {n = 0}
end
function core.after(after, func, ...)
assert(tonumber(after) and not core.is_nan(after) and type(func) == "function",
"Invalid core.after invocation")
local new_job = {
mod_origin = core.get_last_run_mod(),
func = func,
args = {
n = select("#", ...),
...
},
}
local expiry = time + after
add_job(expiry, new_job)
time_next = math.min(time_next, expiry)
return setmetatable(new_job, job_metatable)
end

View file

@ -1,5 +1,3 @@
-- Minetest: builtin/common/chatcommands.lua
-- For server-side translations (if INIT == "game")
-- Otherwise, use core.gettext
local S = core.get_translator("__builtin")
@ -89,7 +87,7 @@ local function do_help_cmd(name, param)
if #args > 1 then
return false, S("Too many arguments, try using just /help <command>")
end
local use_gui = INIT ~= "client" and core.get_player_by_name(name)
local use_gui = INIT == "client" or core.get_player_by_name(name)
use_gui = use_gui and not opts:find("t")
if #args == 0 and not use_gui then
@ -163,8 +161,8 @@ end
if INIT == "client" then
core.register_chatcommand("help", {
params = core.gettext("[all | <cmd>]"),
description = core.gettext("Get help for commands"),
params = core.gettext("[all | <cmd>] [-t]"),
description = core.gettext("Get help for commands (-t: output in chat)"),
func = function(param)
return do_help_cmd(nil, param)
end,

View file

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify
@ -20,8 +20,8 @@
-- TODO code cleanup --
-- Generic implementation of a filter/sortable list --
-- Usage: --
-- Filterlist needs to be initialized on creation. To achieve this you need to --
-- pass following functions: --
-- Filterlist needs to be initialized on creation. To achieve this you need --
-- to pass following functions: --
-- raw_fct() (mandatory): --
-- function returning a table containing the elements to be filtered --
-- compare_fct(element1,element2) (mandatory): --
@ -31,7 +31,7 @@
-- filter_fct(element,filtercriteria) (optional) --
-- function returning true/false if filtercriteria met to element --
-- fetch_param (optional) --
-- parameter passed to raw_fct to aquire correct raw data --
-- parameter passed to raw_fct to acquire correct raw data --
-- --
--------------------------------------------------------------------------------
filterlist = {}

View file

@ -22,6 +22,7 @@ local LIST_FORMSPEC_DESCRIPTION = [[
local F = core.formspec_escape
local S = core.get_translator("__builtin")
local check_player_privs = core.check_player_privs
-- CHAT COMMANDS FORMSPEC
@ -57,19 +58,23 @@ local function build_chatcommands_formspec(name, sel, copy)
.. "any entry in the list.").. "\n" ..
S("Double-click to copy the entry to the chat history.")
local privs = core.get_player_privs(name)
for i, data in ipairs(mod_cmds) do
rows[#rows + 1] = COLOR_BLUE .. ",0," .. F(data[1]) .. ","
for j, cmds in ipairs(data[2]) do
local has_priv = privs[cmds[2].privs]
local has_priv = INIT == "client" or check_player_privs(name, cmds[2].privs)
rows[#rows + 1] = ("%s,1,%s,%s"):format(
has_priv and COLOR_GREEN or COLOR_GRAY,
cmds[1], F(cmds[2].params))
if sel == #rows then
description = cmds[2].description
if copy then
core.chat_send_player(name, S("Command: @1 @2",
core.colorize("#0FF", "/" .. cmds[1]), cmds[2].params))
local msg = S("Command: @1 @2",
core.colorize("#0FF", (INIT == "client" and "." or "/") .. cmds[1]), cmds[2].params)
if INIT == "client" then
core.display_chat_message(msg)
else
core.chat_send_player(name, msg)
end
end
end
end
@ -111,26 +116,46 @@ end
-- DETAILED CHAT COMMAND INFORMATION
if INIT == "client" then
core.register_on_formspec_input(function(formname, fields)
if formname ~= "__builtin:help_cmds" or fields.quit then
return
end
core.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "__builtin:help_cmds" or fields.quit then
return
end
local event = core.explode_table_event(fields.list)
if event.type ~= "INV" then
core.show_formspec("__builtin:help_cmds",
build_chatcommands_formspec(nil, event.row, event.type == "DCL"))
end
end)
else
core.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "__builtin:help_cmds" or fields.quit then
return
end
local event = core.explode_table_event(fields.list)
if event.type ~= "INV" then
local name = player:get_player_name()
core.show_formspec(name, "__builtin:help_cmds",
build_chatcommands_formspec(name, event.row, event.type == "DCL"))
end
end)
local event = core.explode_table_event(fields.list)
if event.type ~= "INV" then
local name = player:get_player_name()
core.show_formspec(name, "__builtin:help_cmds",
build_chatcommands_formspec(name, event.row, event.type == "DCL"))
end
end)
end
function core.show_general_help_formspec(name)
core.show_formspec(name, "__builtin:help_cmds",
build_chatcommands_formspec(name))
if INIT == "client" then
core.show_formspec("__builtin:help_cmds",
build_chatcommands_formspec(name))
else
core.show_formspec(name, "__builtin:help_cmds",
build_chatcommands_formspec(name))
end
end
function core.show_privs_help_formspec(name)
core.show_formspec(name, "__builtin:help_privs",
build_privs_formspec(name))
if INIT ~= "client" then
function core.show_privs_help_formspec(name)
core.show_formspec(name, "__builtin:help_privs",
build_privs_formspec(name))
end
end

View file

@ -1,9 +1,10 @@
-- Minetest: builtin/item_s.lua
-- The distinction of what goes here is a bit tricky, basically it's everything
-- that does not (directly or indirectly) need access to ServerEnvironment,
-- Server or writable access to IGameDef on the engine side.
-- (The '_s' stands for standalone.)
local builtin_shared = ...
--
-- Item definition helpers
--
@ -89,7 +90,27 @@ local facedir_to_dir_map = {
1, 4, 3, 2,
}
function core.facedir_to_dir(facedir)
return facedir_to_dir[facedir_to_dir_map[facedir % 32]]
return vector.copy(facedir_to_dir[facedir_to_dir_map[facedir % 32]])
end
function core.dir_to_fourdir(dir)
if math.abs(dir.x) > math.abs(dir.z) then
if dir.x < 0 then
return 3
else
return 1
end
else
if dir.z < 0 then
return 2
else
return 0
end
end
end
function core.fourdir_to_dir(fourdir)
return vector.copy(facedir_to_dir[facedir_to_dir_map[fourdir % 4]])
end
function core.dir_to_wallmounted(dir)
@ -122,9 +143,11 @@ local wallmounted_to_dir = {
vector.new(-1, 0, 0),
vector.new( 0, 0, 1),
vector.new( 0, 0, -1),
vector.new( 0, 1, 0),
vector.new( 0, -1, 0),
}
function core.wallmounted_to_dir(wallmounted)
return wallmounted_to_dir[wallmounted % 8]
return vector.copy(wallmounted_to_dir[wallmounted % 8])
end
function core.dir_to_yaw(dir)
@ -137,20 +160,80 @@ end
function core.is_colored_paramtype(ptype)
return (ptype == "color") or (ptype == "colorfacedir") or
(ptype == "colorwallmounted") or (ptype == "colordegrotate")
(ptype == "color4dir") or (ptype == "colorwallmounted") or
(ptype == "colordegrotate")
end
function core.strip_param2_color(param2, paramtype2)
if not core.is_colored_paramtype(paramtype2) then
if paramtype2 == "color" then
return param2
elseif paramtype2 == "colorfacedir" then
return math.floor(param2 / 32) * 32
elseif paramtype2 == "color4dir" then
return math.floor(param2 / 4) * 4
elseif paramtype2 == "colorwallmounted" then
return math.floor(param2 / 8) * 8
elseif paramtype2 == "colordegrotate" then
return math.floor(param2 / 32) * 32
else
return nil
end
if paramtype2 == "colorfacedir" then
param2 = math.floor(param2 / 32) * 32
elseif paramtype2 == "colorwallmounted" then
param2 = math.floor(param2 / 8) * 8
elseif paramtype2 == "colordegrotate" then
param2 = math.floor(param2 / 32) * 32
end
-- paramtype2 == "color" requires no modification.
return param2
end
-- Content ID caching
local old_get_content_id = core.get_content_id
local old_get_name_from_content_id = core.get_name_from_content_id
local name2content = setmetatable({}, {
__index = function(self, name)
return old_get_content_id(name)
end,
})
local content2name = setmetatable({}, {
__index = function(self, id)
return old_get_name_from_content_id(id)
end,
})
function core.get_content_id(name)
return name2content[name]
end
function core.get_name_from_content_id(id)
return content2name[id]
end
-- Cache content IDs after they have stopped changing.
function builtin_shared.cache_content_ids()
for name in pairs(core.registered_nodes) do
local id = old_get_content_id(name)
name2content[name] = id
content2name[id] = name
end
-- unknown is not in the registered node list.
local unknown_name = old_get_name_from_content_id(core.CONTENT_UNKNOWN)
name2content[unknown_name] = core.CONTENT_UNKNOWN
content2name[core.CONTENT_UNKNOWN] = unknown_name
for name in pairs(core.registered_aliases) do
if core.registered_nodes[name] then
name2content[name] = old_get_content_id(name)
end
end
end
if core.set_read_node and core.set_push_node then
local function read_node(node)
return name2content[node.name], node.param1, node.param2
end
core.set_read_node(read_node)
core.set_read_node = nil
local function push_node(content, param1, param2)
return {name = content2name[content], param1 = param1, param2 = param2}
end
core.set_push_node(push_node)
core.set_push_node = nil
end

41
builtin/common/math.lua Normal file
View file

@ -0,0 +1,41 @@
--[[
Math utils.
--]]
function math.hypot(x, y)
return math.sqrt(x * x + y * y)
end
function math.sign(x, tolerance)
tolerance = tolerance or 0
if x > tolerance then
return 1
elseif x < -tolerance then
return -1
end
return 0
end
function math.factorial(x)
assert(x % 1 == 0 and x >= 0, "factorial expects a non-negative integer")
if x >= 171 then
-- 171! is greater than the biggest double, no need to calculate
return math.huge
end
local v = 1
for k = 2, x do
v = v * k
end
return v
end
function math.round(x)
if x < 0 then
local int = math.ceil(x)
local frac = x - int
return int - ((frac <= -0.5) and 1 or 0)
end
local int = math.floor(x)
local frac = x - int
return int + ((frac >= 0.5) and 1 or 0)
end

View file

@ -0,0 +1,19 @@
-- Registered metatables, used by the C++ packer
local known_metatables = {}
function core.register_portable_metatable(name, mt)
assert(type(name) == "string", ("attempt to use %s value as metatable name"):format(type(name)))
assert(type(mt) == "table", ("attempt to register a %s value as metatable"):format(type(mt)))
assert(known_metatables[name] == nil or known_metatables[name] == mt,
("attempt to override metatable %s"):format(name))
known_metatables[name] = mt
known_metatables[mt] = name
end
core.known_metatables = known_metatables
function core.register_async_metatable(...)
core.log("deprecated", "core.register_async_metatable is deprecated. " ..
"Use core.register_portable_metatable instead.")
return core.register_portable_metatable(...)
end
core.register_portable_metatable("__builtin:vector", vector.metatable)

View file

@ -1,8 +1,7 @@
-- Minetest: builtin/misc_helpers.lua
--------------------------------------------------------------------------------
-- Localize functions to avoid table lookups (better performance).
local string_sub, string_find = string.sub, string.find
local math = math
--------------------------------------------------------------------------------
local function basic_dump(o)
@ -170,6 +169,9 @@ end
--------------------------------------------------------------------------------
function string.split(str, delim, include_empty, max_splits, sep_is_pattern)
delim = delim or ","
if delim == "" then
error("string.split separator is empty", 2)
end
max_splits = max_splits or -2
local items = {}
local pos, len = 1, #str
@ -202,59 +204,42 @@ function table.indexof(list, val)
return -1
end
--------------------------------------------------------------------------------
function table.keyof(tb, val)
for k, v in pairs(tb) do
if v == val then
return k
end
end
return nil
end
--------------------------------------------------------------------------------
function string:trim()
return self:match("^%s*(.-)%s*$")
end
--------------------------------------------------------------------------------
function math.hypot(x, y)
return math.sqrt(x * x + y * y)
end
--------------------------------------------------------------------------------
function math.sign(x, tolerance)
tolerance = tolerance or 0
if x > tolerance then
return 1
elseif x < -tolerance then
return -1
end
return 0
end
--------------------------------------------------------------------------------
function math.factorial(x)
assert(x % 1 == 0 and x >= 0, "factorial expects a non-negative integer")
if x >= 171 then
-- 171! is greater than the biggest double, no need to calculate
return math.huge
end
local v = 1
for k = 2, x do
v = v * k
end
return v
end
function math.round(x)
if x >= 0 then
return math.floor(x + 0.5)
end
return math.ceil(x - 0.5)
end
local formspec_escapes = {
["\\"] = "\\\\",
["["] = "\\[",
["]"] = "\\]",
[";"] = "\\;",
[","] = "\\,"
[","] = "\\,",
["$"] = "\\$",
}
function core.formspec_escape(text)
-- Use explicit character set instead of dot here because it doubles the performance
return text and string.gsub(text, "[\\%[%];,]", formspec_escapes)
return text and string.gsub(text, "[\\%[%];,$]", formspec_escapes)
end
local hypertext_escapes = {
["\\"] = "\\\\",
["<"] = "\\<",
[">"] = "\\>",
}
function core.hypertext_escape(text)
return text and text:gsub("[\\<>]", hypertext_escapes)
end
@ -486,6 +471,9 @@ end
function table.insert_all(t, other)
if table.move then -- LuaJIT
return table.move(other, 1, #other, #t + 1, t)
end
for i=1, #other do
t[#t + 1] = other[i]
end
@ -519,18 +507,6 @@ end
--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------
if INIT == "mainmenu" then
function core.get_game(index)
local games = core.get_games()
if index > 0 and index <= #games then
return games[index]
end
return nil
end
end
if core.gettext then -- for client and mainmenu
function fgettext_ne(text, ...)
text = core.gettext(text)
@ -596,12 +572,14 @@ function core.strip_colors(str)
return (str:gsub(ESCAPE_CHAR .. "%([bc]@[^)]+%)", ""))
end
function core.translate(textdomain, str, ...)
local function translate(textdomain, str, num, ...)
local start_seq
if textdomain == "" then
if textdomain == "" and num == "" then
start_seq = ESCAPE_CHAR .. "T"
else
elseif num == "" then
start_seq = ESCAPE_CHAR .. "(T@" .. textdomain .. ")"
else
start_seq = ESCAPE_CHAR .. "(T@" .. textdomain .. "@" .. num .. ")"
end
local arg = {n=select('#', ...), ...}
local end_seq = ESCAPE_CHAR .. "E"
@ -632,8 +610,31 @@ function core.translate(textdomain, str, ...)
return start_seq .. translated .. end_seq
end
function core.translate(textdomain, str, ...)
return translate(textdomain, str, "", ...)
end
function core.translate_n(textdomain, str, str_plural, n, ...)
assert (type(n) == "number")
assert (n >= 0)
assert (math.floor(n) == n)
-- Truncate n if too large
local max = 1000000
if n >= 2 * max then
n = n % max + max
end
if n == 1 then
return translate(textdomain, str, "1", ...)
else
return translate(textdomain, str_plural, tostring(n), ...)
end
end
function core.get_translator(textdomain)
return function(str, ...) return core.translate(textdomain or "", str, ...) end
return
(function(str, ...) return core.translate(textdomain or "", str, ...) end),
(function(str, str_plural, n, ...) return core.translate_n(textdomain or "", str, str_plural, n, ...) end)
end
--------------------------------------------------------------------------------
@ -694,6 +695,7 @@ function core.privs_to_string(privs, delim)
list[#list + 1] = priv
end
end
table.sort(list)
return table.concat(list, delim)
end

View file

@ -0,0 +1,76 @@
local builtin_shared = ...
do
local default = {mod = "??", name = "??"}
core.callback_origins = setmetatable({}, {
__index = function()
return default
end
})
end
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks
if cb_len == 0 then
if mode == 2 or mode == 3 then
return true
elseif mode == 4 or mode == 5 then
return false
end
end
local ret = nil
for i = 1, cb_len do
local origin = core.callback_origins[callbacks[i]]
core.set_last_run_mod(origin.mod)
local cb_ret = callbacks[i](...)
if mode == 0 and i == 1 then
ret = cb_ret
elseif mode == 1 and i == cb_len then
ret = cb_ret
elseif mode == 2 then
if not cb_ret or i == 1 then
ret = cb_ret
end
elseif mode == 3 then
if cb_ret then
return cb_ret
end
ret = cb_ret
elseif mode == 4 then
if (cb_ret and not ret) or i == 1 then
ret = cb_ret
end
elseif mode == 5 and cb_ret then
return cb_ret
end
end
return ret
end
function builtin_shared.make_registration()
local t = {}
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
return t, registerfunc
end
function builtin_shared.make_registration_reverse()
local t = {}
local registerfunc = function(func)
table.insert(t, 1, func)
core.callback_origins[func] = {
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
return t, registerfunc
end

View file

@ -8,7 +8,7 @@ local next, rawget, pairs, pcall, error, type, setfenv, loadstring
local table_concat, string_dump, string_format, string_match, math_huge
= table.concat, string.dump, string.format, string.match, math.huge
-- Recursively counts occurences of objects (non-primitives including strings) in a table.
-- Recursively counts occurrences of objects (non-primitives including strings) in a table.
local function count_objects(value)
local counts = {}
if value == nil then
@ -61,17 +61,21 @@ end
-- Serializes Lua nil, booleans, numbers, strings, tables and even functions
-- Tables are referenced by reference, strings are referenced by value. Supports circular tables.
local function serialize(value, write)
local reference, refnum = "r1", 1
-- [object] = reference string
local reference, refnum = "1", 1
-- [object] = reference
local references = {}
-- Circular tables that must be filled using `table[key] = value` statements
local to_fill = {}
for object, count in pairs(count_objects(value)) do
local type_ = type(object)
-- Object must appear more than once. If it is a string, the reference has to be shorter than the string.
if count >= 2 and (type_ ~= "string" or #reference + 2 < #object) then
if count >= 2 and (type_ ~= "string" or #reference + 5 < #object) then
if refnum == 1 then
write"local _={};" -- initialize reference table
end
write"_["
write(reference)
write("=")
write("]=")
if type_ == "table" then
write("{}")
elseif type_ == "function" then
@ -85,7 +89,7 @@ local function serialize(value, write)
to_fill[object] = reference
end
refnum = refnum + 1
reference = ("r%X"):format(refnum)
reference = ("%d"):format(refnum)
end
end
-- Used to decide whether we should do "key=..."
@ -105,12 +109,22 @@ local function serialize(value, write)
end
local type_ = type(value)
if type_ == "number" then
return write(string_format("%.17g", value))
if value ~= value then -- nan
return write"0/0"
elseif value == math_huge then
return write"1/0"
elseif value == -math_huge then
return write"-1/0"
else
return write(string_format("%.17g", value))
end
end
-- Reference types: table, function and string
local ref = references[value]
if ref then
return write(ref)
write"_["
write(ref)
return write"]"
end
if type_ == "string" then
return write(quote(value))
@ -156,7 +170,9 @@ local function serialize(value, write)
-- Write the statements to fill circular tables
for table, ref in pairs(to_fill) do
for k, v in pairs(table) do
write("_[")
write(ref)
write("]")
if use_short_key(k) then
write(".")
write(k)
@ -185,24 +201,22 @@ end
local function dummy_func() end
local nan = (0/0)^1 -- +nan
function core.deserialize(str, safe)
-- Backwards compatibility
if str == nil then
core.log("deprecated", "minetest.deserialize called with nil (expected string).")
core.log("deprecated", "core.deserialize called with nil (expected string).")
return nil, "Invalid type: Expected a string, got nil"
end
local t = type(str)
if t ~= "string" then
error(("minetest.deserialize called with %s (expected string)."):format(t))
error(("core.deserialize called with %s (expected string)."):format(t))
end
local func, err = loadstring(str)
if not func then return nil, err end
-- math.huge is serialized to inf, NaNs are serialized to nan by Lua
local env = {inf = math_huge, nan = nan}
-- math.huge was serialized to inf and NaNs to nan by Lua in engine version 5.6, so we have to support this here
local env = {inf = math_huge, nan = 0/0}
if safe then
env.loadstring = dummy_func
else

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