Compare commits

...

288 Commits

Author SHA1 Message Date
SmallJoker
71d9f1771c Bump version to 5.9.1 2024-09-13 18:54:36 +02:00
sfan5
96fbc52071 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-13 18:54:13 +02:00
sfan5
7556bf43a6 Fix RTT set before value is available 2024-09-13 18:52:07 +02:00
sfan5
722c0044b1 Nerf protocol window sizes 2024-09-13 18:51:09 +02:00
sfan5
b93cce11d8 Count duplicate packets as congestion indicator 2024-09-13 18:48:33 +02:00
grorp
6bdd5c6773 Only apply "touch_punch_gesture" when wielded item has no on_use callback (#15098) 2024-09-13 18:45:26 +02:00
Gregor Parzefall
a8e7e261b9 Revert "Set VBO hints in more places" 2024-09-12 19:28:37 +02:00
sfence
73c29e7763 macOS: make mute sound actually work (#15128) 2024-09-08 20:31:35 +02:00
sfan5
e27757fa3a Fix texture matrix handling in our shaders 2024-09-08 20:31:35 +02:00
Lars Müller
4e3b8db2b9 Fix upright sprite entities not animating 2024-09-08 20:31:35 +02:00
sfence
336f8d4dc7 Generate Minetest.app on macOS 12, so at least macOS 12 will be supported 2024-09-08 20:31:35 +02:00
Lars Müller
7737906d2e Remove no* prefixes from settingtypes possible flags (#15111) 2024-09-08 20:31:35 +02:00
Desour
a6f1242a11 Fix CMeshBuffer::append reallocating too eagerly (#14969) 2024-09-08 20:31:35 +02:00
red-001
53c2fbb4c4 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-09-08 20:31:35 +02:00
sfan5
1d042a977d Avoid unsafety with stack-allocated mesh buffer 2024-09-08 20:29:58 +02:00
grorp
166782040e Fix uninitialized SkyboxParams::fog_color 2024-09-08 20:19:31 +02:00
grorp
9e198fc22c TouchControls: Fix outdated player controls in TOSERVER_INTERACT 2024-09-08 20:19:31 +02:00
grorp
ecf535ee83 Restore proportional minimap scaling (#15022) 2024-09-08 20:19:31 +02:00
cx384
f79a51c265 Main menu: formspec escape world name (#15064) 2024-09-08 20:19:31 +02:00
sfan5
bd25a06f44 Fix VBO hint for transparent block parts 2024-09-08 20:17:43 +02:00
SmallJoker
1caf26f18b 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-09-08 20:17:32 +02:00
SmallJoker
5861192752 zstd: Fix minetest.decompress lockup when data ends too early 2024-09-08 20:16:52 +02:00
Lars Müller
02db521c80 Make getting bone overrides return the "same" euler angles (#15007) 2024-09-08 20:14:39 +02:00
sfan5
ba65eb953c Fix bounding box of clouds
fixes #15031
2024-09-08 20:14:39 +02:00
Zemtzov7
dbf2d26a85 Fix CSM help form using "/" instead of "." (#15034)
when copying commands to chat
2024-09-08 20:14:39 +02:00
rubenwardy
60694cbd30 Generate Android versionCode from Major.Minor.Patch (#14963) 2024-09-08 20:14:39 +02:00
Lars Müller
baafec9e9f Fix animations not being restartable (#15016) 2024-09-08 20:14:39 +02:00
rubenwardy
65d4335922 Fix Windows enabling touch controls due to existence of touchscreen (#15003)
We want to check for the form factor instead.
2024-09-08 20:14:39 +02:00
Lars Müller
5094838837 Revert empty form name deprecation warnings 2024-09-08 20:14:39 +02:00
sfan5
93ac2ed894 [no sq] Move shaders & remove dead Irrlicht tests (#15006)
* Move irrlicht shaders to correct place

* Remove unused Irrlicht tests
2024-09-08 20:14:39 +02:00
Dmitry Marakasov
c011fa0188 Include unistd.h for getpid() when _IRR_COMPILE_WITH_X11_ 2024-09-08 20:13:24 +02:00
rubenwardy
c2057eee4b Merge remote-tracking branch 'upstream/stable-5' into HEAD 2024-08-11 17:08:47 +01:00
Gregor Parzefall
d445638265 Bump version to 5.8.1 2024-05-06 20:58:14 +02:00
Gregor Parzefall
f61f6626b7 Fix Android build for 5.8.1 2024-05-06 20:58:14 +02:00
Gregor Parzefall
857ba25115 Android CI: Additionally make an AAB for uploading to the Play Store (#14584) 2024-05-06 20:58:14 +02:00
grorp
00774bc28b Fix some Game members not being freed after some startup errors (#14561) 2024-05-06 20:58:14 +02:00
Gregor Parzefall
f572266f19 Fix local server startup and shutdown blocking the main thread
Co-authored-by: sfan5 <sfan5@live.de>
2024-05-06 20:58:14 +02:00
Gregor Parzefall
c3893064a3 Fix all cached media being loaded at once on the main thread 2024-05-06 20:58:14 +02:00
grorp
4183443f02 Allow sync HTTP fetches to be interrupted to fix hanging (#14412)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2024-05-06 20:58:14 +02:00
sfan5
5715434d5e Skip Android deps download if they already exist
It's close to impossible to test locally built changes otherwise.
2024-05-06 20:58:14 +02:00
lhofhansl
ab2419db24 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-05-06 20:58:14 +02:00
David Heidelberg
35a83c3514 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-05-06 20:58:14 +02:00
sfan5
de09cac1e9 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-05-06 20:58:14 +02:00
sfan5
b64f4bdb3a Optimize fs::CopyFileContents on Linux and Windows 2024-05-06 20:58:14 +02:00
sfan5
008310aad9 Add unit tests for fs::CopyFileContents 2024-05-06 20:58:14 +02:00
sfan5
4d024d737c Bypass media transfer in single player 2024-05-06 20:58:14 +02:00
grorp
50edb30a18 Save the settings in more cases to avoid losing setting changes (especially on Android) (#14266) 2024-05-06 20:58:14 +02:00
Muhammad Rifqi Priyo Susanto
00f6bd0f08 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-05-06 20:58:14 +02:00
Maintainer_
81e40a1172 Fix GameUI text staying visible during shutdown. (#14197) 2024-05-06 20:58:14 +02:00
grorp
fe4f89f3fa Touchscreen: Make server-sent overrides of button textures work (#14145) 2024-05-06 20:58:14 +02:00
Gregor Parzefall
0d372250c1 Fix TouchScreenGUI ignoring server-sent pitch changes 2024-05-06 20:58:14 +02:00
Gregor Parzefall
367720020c 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.
2024-05-06 20:58:14 +02:00
grorp
0dab82085d Fix unittest failure for release versions (#14067) 2024-05-06 20:58:14 +02:00
SmallJoker
cb211d63cd Merge remote-tracking branch 'upstream/stable-5' into HEAD 2023-12-04 19:04:18 +01:00
sfan5
2e497cc471 Merge remote-tracking branch 'origin/stable-5' into HEAD 2023-04-08 19:32:11 +02:00
sfan5
587f6656a4 Bump version to 5.6.1 2022-09-19 21:05:10 +02:00
sfan5
4377c03168 Bump used IrrlichtMt version 2022-09-16 20:27:29 +02:00
savilli
1e0520074c 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 19:18:51 +02:00
DS
b9f6832347 Fix tooltips for dropdown, scrollbar and more (#12747) 2022-09-14 13:48:06 +02:00
Jude Melton-Houghton
f8bb0cd3d1 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-14 13:48:06 +02:00
Lars Mueller
129aef758e Serialize: Restore forward compatibility 2022-09-14 13:48:06 +02:00
Lars Mueller
94f55cf406 Serialize: Use numbers for refs to work around LuaJIT limits 2022-09-14 13:48:06 +02:00
sfan5
a20b758e19 Allow looped animation to be used safely with old clients
fixes #12657
2022-09-14 13:48:06 +02:00
pecksin
128842becf Chat weblink: remove comma as delimiter (#12730) 2022-09-14 13:48:06 +02:00
x2048
d51331f51f Convert entity glow value to color space before adding to the light 2022-09-14 13:48:06 +02:00
Niklp
4ef221a645 Fix incorrectly placed label in tab_online (#12732) 2022-09-14 13:48:06 +02:00
savilli
79010e972e Fix and enable x86 build for Android (#12700) 2022-09-14 13:48:06 +02:00
fluxionary
0ca530e251 Fix texture_min_size 2022-09-14 13:48:06 +02:00
Elliott Lester
57b4d46dbc Apply DPI Scaling to GUIModalMenu (#12693)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-14 13:48:06 +02:00
rubenwardy
50df5e2f59 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-09-14 13:48:06 +02:00
Fábio Rodrigues Ribeiro
b6db2c7262 Remove resolution of appstream screenshots (#12652)
resolves Appdata not valid #12597
2022-09-14 13:48:06 +02:00
sfan5
9441b69ad2 Move some CI jobs to newer compiler versions 2022-09-14 13:48:06 +02:00
x2048
08e3d16a58 Limit force shadow update to urgent blocks (#12692) 2022-09-14 13:48:06 +02:00
Lars Müller
3f3049fdba Check hp_max > 0 for entities (#12667) 2022-09-14 13:39:30 +02:00
Zughy
41fb7a8a7e Reassure previous nil behaviour for tiles and special_tiles (#12678)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-09-14 13:39:20 +02:00
Zughy
5b9828e094 Fix crash when crafting callbacks return strings (#12685)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-09-14 13:37:54 +02:00
Zughy
96e35585b0 Fix crash when stars are reset 2022-09-14 13:37:44 +02:00
sfan5
f035fe9336 Merge remote-tracking branch 'origin/stable-5' into HEAD 2022-08-04 22:54:13 +02:00
sfan5
44c2e33c78 Bump version to 5.5.1 2022-05-15 21:53:21 +02:00
rubenwardy
2785dcbbbf Fix broken dependency enabling due to missing enabled field 2022-05-14 18:24:46 +01:00
sfan5
9b03bd3243 Fix Docker build
prometheus-cpp switched to C++14 in April (after we did) so this issue only affects older branches.
2022-05-14 18:51:48 +02:00
Jude Melton-Houghton
8f30456ee3 Fix cooking and fuel crafts with aliases 2022-05-14 18:33:42 +02:00
Octavian
38557ff635 Fix possible unreliable behavior due to uninitialized variables 2022-05-14 18:33:42 +02:00
Lars Müller
7bc2cde4dd HUD: Update selection mesh every frame (#12270)
Fixes outdated selection boxes after entity property changes.
2022-05-14 18:33:42 +02:00
Lars Müller
f065d3a06b Fix Minetest blaming the wrong mod for errors (#12241)
Covers the case where mods insert their callbacks manually into "minetest.registered_<callbacks>" (often to achieve a particular order of execution).
2022-05-14 18:33:42 +02:00
Jude Melton-Houghton
21f7e3a987 Enable dependencies when enabling modpacks (#12202) 2022-05-14 18:33:42 +02:00
Jude Melton-Houghton
9f688bc433 Fix enabling of dependencies with identical names (#12253) 2022-05-14 18:33:42 +02:00
rubenwardy
6e9d31d4fb Fix mods not being recursively enabled
Fixes #12290
2022-05-14 18:33:42 +02:00
sfan5
e81c48526b Declare all bundled libs as static
Otherwise it can happen that these are built as shared depending on the
options passed to CMake, which obviously isn't intended.
2022-05-14 18:33:42 +02:00
SmallJoker
b405985b80 guiScalingFilter: Fix most memory leaks (#12256)
Calls to the cache function ended up creating a new texture regardless whether
the texture is already cached.
2022-05-14 18:33:42 +02:00
rubenwardy
8b010c5a9f ContentDB: Fix ungraceful crash on aliases when list download fails
Fixes #12267 and fixes #12154
2022-05-14 18:33:42 +02:00
sfan5
1e7b5d6fdb Fix synchronization issue at thread start
If a newly started thread immediately exits then m_running would
immediately be set to false again and the caller would be stuck
waiting for m_running to become true forever.
Since a mutex for synchronizing startup already exists we can
simply move the while loop into it.

see also: #5134 which introduced m_start_finished_mutex
2022-05-14 18:33:42 +02:00
sfan5
a55982e7f0 Fix password changing getting stuck if wrong password is entered once 2022-05-14 18:33:42 +02:00
sfan5
1ac378063e Apply disallow_empty_password to password changes too 2022-05-14 18:33:42 +02:00
sfan5
d497c92684 Fix race condition in registration leading to duplicate create_auth calls 2022-05-14 18:33:42 +02:00
paradust7
677dc2c155 Remove HW_buffer_counter after IrrlichtMt fix to remove HWBufferMap (#12232)
Keep code and use version check instead, for backwards compatibility
2022-05-14 18:33:42 +02:00
Alex
beea8deeb5 Fix invalid queued package element and path (#12218) 2022-05-14 18:33:42 +02:00
Giuseppe Bilotta
0d0f1a2fb2 Fix some textures not being sent correctly to older clients
Since b2eb44afc5, a texture defined as
`[combine:16x512:0,0=some_file.png;etc`
will not be sent correctly from a 5.5 server to a 5.4 client due to the
overeager detection of unsupported base modifier `[` introducing a
spurious `blank.png^` before the modifier.

Fix this by whitelisting which base modifiers can be passed through
unchanged to the client, and prefix `blank.png` for the others
(which at the moment is just [png:, but the list may grow larger
as new base modifiers are added.)
2022-05-14 18:33:42 +02:00
paradust7
439701ed7a Fix '[combine' when EVDF_TEXTURE_NPOT is disabled. (#12187)
Stop scaling images to POT immediately when loaded. The 'combine'
modifier hardcodes X and Y coordinates, and so behaves incorrectly
if applied to a scaled image. Images emitted by generateImage()
are already scaled to POT before being used as a texture, so
nothing should break.
2022-05-14 18:33:42 +02:00
ShadowNinja
d945d0129c Fix OOB read in trim("") 2022-05-14 18:33:42 +02:00
Dmitry Kostenko
cc91477308 Avoid negation of comparison operator (luacheck warning) 2022-05-14 18:33:42 +02:00
Daroc Alden
ac139ec03d Fix memory leak in EmergeManager
EmergeManager keeps a copy of the BiomeGen that it creates, but
never deletes it.
2022-05-14 18:33:42 +02:00
Gregor Parzefall
b4f0e834bf Fix footsteps for players whose collision box min y != 0 (#12110) 2022-05-14 18:33:42 +02:00
Daroc Alden
6e6cdc834f Fix undefined behavior in TileLayer (#12125)
Initialize the values properly
2022-05-14 18:33:42 +02:00
Daroc Alden
4b81ae1b35 Fix memory leak from SpatialAreaStore (#12120) 2022-05-14 18:33:42 +02:00
sfan5
d569dc45a8 Fix segfault with autoscale_mode (again)
closes #12100
This time add some asserts so there is no misunderstanding about the NULL-ness of layer->texture.
2022-05-14 18:33:42 +02:00
sfan5
23d49fda29 Clean up ClientReady packet handling
fixes #12073
2022-05-14 18:33:42 +02:00
pecksin
62ad2c3bc1 Use absolute value for bouncy in collision (#11969)
[backport: removed devtest change and protocol_version comparison]
2022-05-14 18:33:42 +02:00
sfan5
25373ad294 Remove awful Mingw32 workarounds
Instead a warning is triggered if an affected compiler is detected.
closes #12022
2022-05-12 11:36:50 +02:00
sfan5
26d0c0fd8d Fix broken server startup if curl is disabled (#12046) 2022-05-12 11:36:39 +02:00
Lars Mueller
3afffcd36b Fix builtin statbar backgrounds
see #12000
2022-05-12 11:36:11 +02:00
sfan5
5440de1785 Merge remote-tracking branch 'origin/stable-5' into HEAD 2022-01-30 23:10:56 +01:00
rubenwardy
25a56f11c8 Bump version to 5.4.2 2021-10-22 23:06:51 +01:00
rubenwardy
8271c6481f Fix manifest and various things 2021-10-20 15:27:30 +01:00
sfan5
83e26f839d Reserve vectors before pushing and other code quality changes (#11161) 2021-10-20 14:25:39 +01:00
sfan5
c3f7905d82 Remove broken timeout behaviour
Code that relies on `resend_count` was added in 7ea4a03 and 247a1eb, but never worked.
This was fixed in #11607 which caused the problem to surface.
Hence undo the first commit entirely and change the logic of the second.
2021-10-19 19:23:00 +01:00
sfan5
05b54a8d18 Shave off buffer copies in networking code (#11607) 2021-10-19 19:22:46 +01:00
rubenwardy
e5cfdd369e Update deps ref 2021-10-18 18:33:25 +01:00
rubenwardy
c61d8cfb85 Use scoped app storage on Android (#11466)
From November 2021, the Play Store will no longer be accepting
apps which use the deprecated getExternalStorageDirectory() API.

Therefore, this commit replaces uses of deprecated API with the new
scoped API (`getExternalFilesDir()` and `getExternalCacheDir()`).
It also provides a temporary migration to move user data from the
shared external directory to new storage.

Fixes #2097,  #11417 and #11118
2021-10-18 18:12:03 +01:00
NeroBurner
27f4195471 Move build/android directory to root of project (#11283) 2021-10-18 18:11:33 +01:00
sfan5
b2596eda32 Bump version to 5.4.1 2021-04-10 18:41:12 +02:00
waxtatect
9379440fcb Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Brian Gaucher
b7c502c8d1 Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Markus Mikkonen
3c16d2d9b4 Translated using Weblate (Finnish)
Currently translated at 3.2% (44 of 1356 strings)
2021-04-10 17:51:40 +02:00
Tviljan
6cbc03a418 Translated using Weblate (Finnish)
Currently translated at 3.2% (44 of 1356 strings)
2021-04-10 17:51:40 +02:00
Edward
15ecc0fa65 Translated using Weblate (Russian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
ssantos
7f2f8cdad1 Translated using Weblate (Portuguese)
Currently translated at 93.2% (1264 of 1356 strings)
2021-04-10 17:51:40 +02:00
waxtatect
a64646cb7b Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
David Leal
05f531c538 Translated using Weblate (Spanish)
Currently translated at 79.7% (1081 of 1356 strings)
2021-04-10 17:51:40 +02:00
François Delpierre
7ca335446b Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
waxtatect
99e96a6581 Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
BreadW
7200d8f90e Translated using Weblate (Japanese)
Currently translated at 99.8% (1354 of 1356 strings)
2021-04-10 17:51:40 +02:00
GnuPGを使うべきだ
7038837aca Translated using Weblate (Japanese)
Currently translated at 99.7% (1353 of 1356 strings)
2021-04-10 17:51:40 +02:00
ItsWidee
541dcc0e5a Translated using Weblate (French)
Currently translated at 98.0% (1330 of 1356 strings)
2021-04-10 17:51:40 +02:00
François Delpierre
1060b5aabf Translated using Weblate (French)
Currently translated at 96.6% (1311 of 1356 strings)
2021-04-10 17:51:40 +02:00
Dainis
6ea73c4982 Translated using Weblate (Latvian)
Currently translated at 28.6% (388 of 1356 strings)
2021-04-10 17:51:40 +02:00
Konstantin Yeliseyev
cff847273a Translated using Weblate (Russian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
ResuUman
e669f8db9b Translated using Weblate (Polish)
Currently translated at 72.4% (982 of 1356 strings)
2021-04-10 17:51:40 +02:00
Mateusz Mendel
461cc30842 Translated using Weblate (Polish)
Currently translated at 72.4% (982 of 1356 strings)
2021-04-10 17:51:40 +02:00
gnu-ewm
13d7cb957c Translated using Weblate (Polish)
Currently translated at 71.6% (972 of 1356 strings)
2021-04-10 17:51:40 +02:00
Alessandro Mandelli
47a439a905 Translated using Weblate (Italian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Hatlábú Farkas
053fb96694 Translated using Weblate (Hungarian)
Currently translated at 75.8% (1028 of 1356 strings)
2021-04-10 17:51:39 +02:00
ItsWidee
b72c1f7367 Translated using Weblate (French)
Currently translated at 96.5% (1309 of 1356 strings)
2021-04-10 17:51:39 +02:00
matiasC
e90738575f Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
Joaquín Villalba
35718eec9c Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
AnthonyDe
8285a53152 Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
Michalis
116fe7815b Translated using Weblate (Greek)
Currently translated at 8.8% (120 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yangjun Wang
4c2efd7da3 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1285 of 1356 strings)
2021-04-10 17:51:39 +02:00
Liu Tao
1a433e3185 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1285 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yangjun Wang
fa98a00916 Translated using Weblate (Chinese (Simplified))
Currently translated at 92.5% (1255 of 1356 strings)
2021-04-10 17:51:39 +02:00
David Leal
f4dd46ad60 Translated using Weblate (Spanish)
Currently translated at 79.0% (1072 of 1356 strings)
2021-04-10 17:51:39 +02:00
Joaquín Villalba
41825ccfbb Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
David Leal
4d1a5f12c0 Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
Agustin Calderon
cc58d56c6d Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
abidin toumi
683ef07312 Translated using Weblate (Arabic)
Currently translated at 25.7% (349 of 1356 strings)
2021-04-10 17:51:39 +02:00
Tirifto
c77c78cef5 Translated using Weblate (Esperanto)
Currently translated at 94.6% (1283 of 1356 strings)
2021-04-10 17:51:39 +02:00
Oğuz Ersen
88517030a4 Translated using Weblate (Turkish)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
THANOS SIOURDAKIS
45471e8e63 Translated using Weblate (Greek)
Currently translated at 8.8% (120 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
4e620beb75 Translated using Weblate (Malay)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
winniepee
e7ab875b47 Translated using Weblate (Chinese (Simplified))
Currently translated at 92.4% (1254 of 1356 strings)
2021-04-10 17:51:39 +02:00
Ayes
be74ed9ab6 Translated using Weblate (Estonian)
Currently translated at 39.5% (536 of 1356 strings)
2021-04-10 17:51:39 +02:00
Wuzzy
52b2eacd37 Translated using Weblate (German)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
Marian
6b4210a2ea Translated using Weblate (Slovak)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
narrnika
740d0da5ee Translated using Weblate (Russian)
Currently translated at 99.3% (1347 of 1356 strings)
2021-04-10 17:51:07 +02:00
Mateusz Mendel
34883d356e Translated using Weblate (Polish)
Currently translated at 71.2% (966 of 1356 strings)
2021-04-10 17:51:07 +02:00
Giov4
aeafcce314 Translated using Weblate (Italian)
Currently translated at 99.7% (1352 of 1356 strings)
2021-04-10 17:51:07 +02:00
savilli
ae1d82c325 Fix hud_change and hud_remove after hud_add (#10997) 2021-04-09 22:05:22 +02:00
Vitaliy
1c89a07226 Restore minimal normal texture support (for minimap shading) 2021-04-09 22:04:51 +02:00
sfan5
43e262f13e Don't apply connection timeout limit to locally hosted servers
fixes #11085
2021-04-05 16:02:47 +02:00
sfan5
e5f802ab5c Fix server favorites not saving when client/serverlist/ doesn't exist already (#11152) 2021-04-05 16:02:32 +02:00
Lars Müller
847860fc5c Block & report player self-interaction (#11137) 2021-04-05 16:01:27 +02:00
SmallJoker
77e936445f Protect dropping from far node inventories
Also changes if/if to switch/case
2021-04-05 16:01:21 +02:00
SmallJoker
41beb74ef7 Protect per-player detached inventory actions 2021-04-05 16:01:15 +02:00
Elias Fleckenstein
67be50b706 Make pkgmgr handle modpacks containing modpacks properly
fixes #10550
2021-04-05 16:01:10 +02:00
rubenwardy
cd840b7c9d pkgmgr: Fix crash when .conf release field is invalid
Fixes #10942
2021-04-05 16:01:03 +02:00
sfan5
07903949ec Merge remote-tracking branch 'origin/stable-5' into HEAD 2021-02-23 20:18:23 +01:00
sfan5
d2156ddaad Merge remote-tracking branch 'origin/stable-5' into HEAD 2020-07-09 22:21:48 +02:00
sfan5
a84ff4b3ff Merge remote-tracking branch 'origin/stable-5' into HEAD 2020-04-05 18:44:51 +02:00
rubenwardy
c02f13d33f Release 5.1.1 2020-01-11 18:29:02 +00:00
rubenwardy
f6490859fd Translated using Weblate (Japanese (Kansai))
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
4b7816dbf4 Translated using Weblate (Burmese)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
86ffbc3ec5 Translated using Weblate (Kazakh)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
67257f44a5 Translated using Weblate (Arabic)
Currently translated at 6.1% (78 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
3086f5567a Translated using Weblate (Vietnamese)
Currently translated at 2.5% (32 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
bb8acb095d Translated using Weblate (Portuguese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
24be3cbb5f Translated using Weblate (Basque)
Currently translated at 15.1% (193 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
9773191103 Translated using Weblate (Greek)
Currently translated at 1.4% (18 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
ddc703c3ec Translated using Weblate (Filipino)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
09ec204e4b Translated using Weblate (Thai)
Currently translated at 66.9% (852 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
8b6cafa0e0 Translated using Weblate (Lao)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
Osoitz
1ee8be9d43 Translated using Weblate (Basque)
Currently translated at 15.1% (192 of 1274 strings)
2020-01-10 18:57:47 +00:00
Dhimas Wnz
91bc190d21 Translated using Weblate (Indonesian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:47 +00:00
THANOS SIOURDAKIS
4dc833b642 Translated using Weblate (Greek)
Currently translated at 1.3% (17 of 1274 strings)
2020-01-10 18:57:47 +00:00
universales
895e9f8d5c Translated using Weblate (Spanish)
Currently translated at 61.9% (789 of 1274 strings)
2020-01-10 18:57:47 +00:00
Osoitz
12906ff631 Translated using Weblate (Basque)
Currently translated at 9.7% (123 of 1274 strings)
2020-01-10 18:57:47 +00:00
Osoitz
9c9bcff107 Added translation using Weblate (Basque) 2020-01-10 18:57:47 +00:00
Hotower
443ca5c63b Translated using Weblate (Chinese (Simplified))
Currently translated at 65.1% (830 of 1274 strings)
2020-01-10 18:57:47 +00:00
Stas Kies
1102b1fc4c Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:47 +00:00
abidin toumi
0d089eab21 Translated using Weblate (Arabic)
Currently translated at 6.0% (77 of 1274 strings)
2020-01-10 18:57:47 +00:00
zaoqi
b44fada29e Translated using Weblate (Chinese (Simplified))
Currently translated at 65.1% (830 of 1274 strings)
2020-01-10 18:57:47 +00:00
Yangjun Wang
859ea160e6 Translated using Weblate (Chinese (Simplified))
Currently translated at 63.2% (805 of 1274 strings)
2020-01-10 18:57:47 +00:00
Ács Zoltán
1c49e2ffc0 Translated using Weblate (Hungarian)
Currently translated at 61.9% (789 of 1274 strings)
2020-01-10 18:57:47 +00:00
Tirifto
140245c58d Translated using Weblate (Esperanto)
Currently translated at 97.2% (1238 of 1274 strings)
2020-01-10 18:57:47 +00:00
Petter Reinholdtsen
47adcced60 Translated using Weblate (Norwegian Bokmål)
Currently translated at 43.3% (552 of 1274 strings)
2020-01-10 18:57:47 +00:00
Luboš Nečas
a2054deb12 Translated using Weblate (Czech)
Currently translated at 48.8% (622 of 1274 strings)
2020-01-10 18:57:47 +00:00
Tirifto
30fdfd9ded Translated using Weblate (Esperanto)
Currently translated at 94.9% (1209 of 1274 strings)
2020-01-10 18:57:47 +00:00
ramon.venson
a87a86eb92 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.9% (1235 of 1274 strings)
2020-01-10 18:57:47 +00:00
Daniel Mancini
49dfbcfbc8 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.9% (1235 of 1274 strings)
2020-01-10 18:57:47 +00:00
Andrei Stepanov
c558a4f4f6 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4f49a2248f Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4e57da42c1 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4f6c9e206c Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
699e1d4b77 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Matej Mlinar
fa2978b3b9 Translated using Weblate (Slovenian)
Currently translated at 43.9% (559 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
ffcdf741fc Translated using Weblate (Arabic)
Currently translated at 5.7% (73 of 1274 strings)
2020-01-10 18:57:46 +00:00
Fixer
429d7f33d4 Translated using Weblate (Ukrainian)
Currently translated at 42.1% (536 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
b6a229775e Translated using Weblate (Russian)
Currently translated at 81.9% (1044 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
0a4580368a Translated using Weblate (Arabic)
Currently translated at 5.6% (71 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
e5b191e1f1 Translated using Weblate (Arabic)
Currently translated at 4.2% (53 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
a07acc067b Translated using Weblate (Russian)
Currently translated at 81.7% (1041 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
01e763f879 Added translation using Weblate (Arabic) 2020-01-10 18:57:46 +00:00
Viktar Vauchkevich
a95e75261a Translated using Weblate (Belarusian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Julien Maulny
dcaa7ac609 Translated using Weblate (French)
Currently translated at 97.0% (1236 of 1274 strings)
2020-01-10 18:57:46 +00:00
Jacques Lagrange
7d2ae10849 Translated using Weblate (Italian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
642cac3759 Translated using Weblate (Japanese (Kansai))
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
662af2edba Translated using Weblate (Dhivehi)
Currently translated at 8.2% (105 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
6f97e15a8f Translated using Weblate (Chinese (Simplified))
Currently translated at 63.0% (803 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
ab2fa2ca9d Translated using Weblate (Burmese)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
4666c99b27 Translated using Weblate (Kyrgyz)
Currently translated at 8.6% (110 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
e38415c56d Translated using Weblate (Slovenian)
Currently translated at 42.0% (535 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
3f3fce4664 Translated using Weblate (Kannada)
Currently translated at 3.0% (38 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
1407a7bc8a Translated using Weblate (Kazakh)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
1d268f4b83 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 31.2% (398 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
92aab79d27 Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
0823bb1276 Translated using Weblate (Hebrew)
Currently translated at 4.3% (55 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
18e42efa01 Translated using Weblate (Hungarian)
Currently translated at 61.9% (788 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
0ea16328df Translated using Weblate (Estonian)
Currently translated at 14.4% (183 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
b037efc5c6 Translated using Weblate (Esperanto)
Currently translated at 79.6% (1014 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
839bb71389 Translated using Weblate (Greek)
Currently translated at 1.1% (14 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
2ef7df5cfe Translated using Weblate (Danish)
Currently translated at 49.5% (631 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
f5d2d79f75 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.4% (1228 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
8e5fa96ffc Translated using Weblate (Filipino)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
6dbbe07d50 Translated using Weblate (Thai)
Currently translated at 66.8% (851 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
3c23410753 Translated using Weblate (Lithuanian)
Currently translated at 15.4% (196 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
8e35ab78b4 Translated using Weblate (Lao)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:45 +00:00
Allan Nordhøy
7f2911b7f0 Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mateusz Mendel
d877e90301 Translated using Weblate (Polish)
Currently translated at 81.1% (1033 of 1274 strings)
2020-01-10 18:57:45 +00:00
Vicente Carrasco Alvarez
93db4be726 Translated using Weblate (Spanish)
Currently translated at 61.5% (783 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mateusz Mendel
1f419ad19f Translated using Weblate (Polish)
Currently translated at 81.1% (1033 of 1274 strings)
2020-01-10 18:57:45 +00:00
Muhammad Nur Hidayat Yasuyoshi
3c7f6508ad Translated using Weblate (Malay)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mattias Münster
39449d4b63 Translated using Weblate (Swedish)
Currently translated at 32.7% (417 of 1274 strings)
2020-01-10 18:57:45 +00:00
Jacques Lagrange
28e05295fa Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Ács Zoltán
60c18d3550 Translated using Weblate (Hungarian)
Currently translated at 61.9% (788 of 1274 strings)
2020-01-10 18:57:45 +00:00
ssantos
482ab186a2 Translated using Weblate (Portuguese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
BreadW
4814195dc4 Translated using Weblate (Japanese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Wuzzy
d215b7a10e Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
nautilusx
0e52b78590 Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
monolifed
b3a9d607c4 Translated using Weblate (Turkish)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Oguz Ersen
c00081b62c Translated using Weblate (Turkish)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:44 +00:00
William Breathitt Gray
5e4739b460 Fix find_path for newer jsoncpp installations
The upstream JsonCpp project has renamed the `json/features.h` file to
`json/json_features.h`. This patch fixes the JsonCpp installation search
by looking for `json/allocator.h` which has not been renamed on newer
versions of JsonCpp.

Fixes: https://github.com/minetest/minetest/issues/9119
2019-12-31 21:39:16 +00:00
SmallJoker
0d8f598df2 Fix LocalPlayer-bound sound playback broken by 81c2370 2019-12-31 21:31:53 +00:00
Wuzzy
2ef04cc308 Fix item eat sound not played if last item (#9239) 2019-12-31 21:31:53 +00:00
rubenwardy
7a0884e2cd Fix spaces breaking formspec_version[] tag 2019-12-31 21:31:53 +00:00
ANAND
fa858530cc Use a safer implementation of gsub in core.chat_format_message (#9133)
This search-and-replace implementation does not use Lua pattern-matching
2019-12-31 21:31:53 +00:00
sfan5
1c61fe5ed9 Rework packet receiving in ServerThread
Notably it tries to receive all queued packets
between server steps, not just one.
2019-12-31 21:31:53 +00:00
Dmitry Marakasov
57409ef382 Fix build issue due to conflicting s64 type definitions (#9064)
See comment in irrlichttypes.h and https://sourceforge.net/p/irrlicht/bugs/433/
2019-12-31 21:31:52 +00:00
SmallJoker
06ba826803 Formspecs: Reset version number on rebuild 2019-12-26 17:24:27 +00:00
rubenwardy
6e6ef9489f Continue with 5.1.1-dev 2019-12-26 17:24:23 +00:00
Loic Blot
45bbe39d1f Add arm64-v8a but it's not sufficient for 64bit build 2019-11-09 12:50:53 +01:00
Loic Blot
6c9fc13083 Bump to version code 25 2019-11-09 11:37:46 +01:00
MoNTE48
4c8a642388 Android: build fixes & compat fixes 2019-11-09 11:23:31 +01:00
sfan5
6208c9d64f Merge remote-tracking branch 'origin/stable-5' into HEAD 2019-10-12 15:59:36 +02:00
sfan5
76325d0ba9 Bump version to 5.0.1 2019-03-31 22:57:45 +02:00
rubenwardy
cf1802a6de Prevent multi-line chat messages server-side (#8420) 2019-03-28 21:49:03 +00:00
sfan5
538a7b12bd Fix texture rotation for wallmounted nodeboxes
fixes #8358
2019-03-19 22:37:11 +01:00
sfan5
57e0f52aaa httpfetch: Disable IPv6 here too if requested by settings (#8399) 2019-03-19 02:18:34 +00:00
Paramat
1ae0335b62 num_emerge_threads: Initialise value to cope with setting syntax error (#8396) 2019-03-19 02:18:26 +00:00
paramat
ca1bff6b66 num_emerge_threads: Fix documentation of automatic selection 2019-03-19 02:18:17 +00:00
Paramat
10cc62d2ca num_emerge_threads: Warn of crashes when > 1 (#8357) 2019-03-14 17:58:19 +00:00
rubenwardy
dd451a8a00 Fix cast from const by accessing string data directly (#8354)
Fixes #8327
2019-03-12 20:25:55 +00:00
rubenwardy
444ec1e412 HPChange Reason: Fix push after free, and type being overwritten (#8359)
* HPChange Reason: Fix push after free, and type being overwritten

Fixes #8227 and #8344
2019-03-12 20:25:48 +00:00
Paramat
82739f4d7d Change 'num_emerge_threads' default to 1 (#8303) 2019-03-11 22:07:19 +00:00
sofar
19825d853e getS16NoEx() returns true unless syntactical error in conf. (#8304)
The getS16NoEx() handler will return true unless there is a
`[num_emerge_threads]` line in the `minetest.conf` at which
point the excption handler part is reached. Due to the fact that
`defaultsettings.cpp` has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep `nthreads = 0`. If that happens, the value is
changed to `1` and only 1 emerge thread will be used.

The default should be set to `1` instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this `hiding` bug instead.
2019-03-11 22:07:19 +00:00
rubenwardy
d8ece2e3e9 Fix serialization of std::time_t by casting to u64 first (#8353)
Fixes #8332
2019-03-11 22:07:19 +00:00
Paramat
bf4deb0ce6 Confirm registration GUI: Remove positional strings to fix Windows bug (#8258)
Positional strings don't work on some Windows builds.
Remove server address string, leave player name string present.
2019-03-11 22:07:19 +00:00
rubenwardy
da4739a26c Fix detach inventory serialisation (#8331) 2019-03-11 22:07:19 +00:00
rubenwardy
fc24bf0915 Fix incorrect string length check after cast 2019-03-11 22:07:19 +00:00
rubenwardy
9329b99cba Continue with 5.0.1-dev 2019-03-11 22:07:12 +00:00
94 changed files with 245 additions and 1540 deletions

View File

@@ -29,8 +29,8 @@ on:
jobs:
build:
# use macOS 13 since it's the last one that still runs on x86
runs-on: macos-13
# use lowest possible macOS running on x86_64 to support more users
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Install deps

View File

@@ -12,7 +12,7 @@ set(CLANG_MINIMUM_VERSION "7.0.1")
# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 9)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases

View File

@@ -8,7 +8,7 @@ android {
compileSdk 34
targetSdkVersion 34
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode
versionCode versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
}
buildFeatures {
@@ -116,18 +116,6 @@ clean {
delete new File("src/main/assets", "Minetest.zip")
}
// 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
}
}
dependencies {
implementation project(':native')
implementation 'androidx.appcompat:appcompat:1.6.1'

View File

@@ -2,12 +2,11 @@
project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 9) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
project.ext.set("versionPatch", 1) // Version Patch
// ^ keep in sync with cmake
project.ext.set("versionCode", 48) // Android Version Code
// 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
project.ext.set("versionBuild", 0) // Version Build
// ^ fourth version number to allow releasing Android-only fixes and beta versions
buildscript {
ext.ndk_version = '26.2.11394342'

View File

@@ -69,7 +69,7 @@ local function build_chatcommands_formspec(name, sel, copy)
description = cmds[2].description
if copy then
local msg = S("Command: @1 @2",
core.colorize("#0FF", "/" .. cmds[1]), cmds[2].params)
core.colorize("#0FF", (INIT == "client" and "." or "/") .. cmds[1]), cmds[2].params)
if INIT == "client" then
core.display_chat_message(msg)
else

View File

@@ -251,11 +251,16 @@ register_builtin_hud_element("minimap", {
position = {x = 1, y = 0},
alignment = {x = -1, y = 1},
offset = {x = -10, y = 10},
size = {x = 256, y = 256},
size = {x = 0, y = -25},
},
show_elem = function(player, flags)
local proto_ver = core.get_player_information(player:get_player_name()).protocol_version
-- Don't add a minimap for clients which already have it hardcoded in C++.
return flags.minimap and
core.get_player_information(player:get_player_name()).protocol_version >= 44
return flags.minimap and proto_ver >= 44
end,
update_def = function(player, elem_def)
local proto_ver = core.get_player_information(player:get_player_name()).protocol_version
-- Only use percentage when the client supports it.
elem_def.size = proto_ver >= 45 and {x = 0, y = -25} or {x = 256, y = 256}
end,
})

View File

@@ -126,7 +126,7 @@ local function get_formspec(data)
local retval =
"size[11.5,7.5,true]" ..
"label[0.5,0;" .. fgettext("World:") .. "]" ..
"label[1.75,0;" .. data.worldspec.name .. "]"
"label[1.75,0;" .. core.formspec_escape(data.worldspec.name) .. "]"
if mod.is_modpack or mod.type == "game" then
local info = core.formspec_escape(

View File

@@ -1014,7 +1014,7 @@ mapgen_limit (Map generation limit) int 31007 0 31007
# Global map generation attributes.
# In Mapgen v6 the 'decorations' flag controls all decorations except trees
# and jungle grass, in all other mapgens this flag controls all decorations.
mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes,ores caves,dungeons,light,decorations,biomes,ores,nocaves,nodungeons,nolight,nodecorations,nobiomes,noores
mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes,ores caves,dungeons,light,decorations,biomes,ores
[*Biome API]
@@ -1033,7 +1033,7 @@ mg_biome_np_humidity_blend (Humidity blend noise) noise_params_2d 0, 1.5, (8, 8,
[*Mapgen V5]
# Map generation attributes specific to Mapgen v5.
mgv5_spflags (Mapgen V5 specific flags) flags caverns caverns,nocaverns
mgv5_spflags (Mapgen V5 specific flags) flags caverns caverns
# Controls width of tunnels, a smaller value creates wider tunnels.
# Value >= 10.0 completely disables generation of tunnels and avoids the
@@ -1107,7 +1107,7 @@ mgv5_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2
# When the 'snowbiomes' flag is enabled jungles are automatically enabled and
# the 'jungles' flag is ignored.
# The 'temples' flag disables generation of desert temples. Normal dungeons will appear instead.
mgv6_spflags (Mapgen V6 specific flags) flags jungles,biomeblend,mudflow,snowbiomes,noflat,trees,temples jungles,biomeblend,mudflow,snowbiomes,flat,trees,temples,nojungles,nobiomeblend,nomudflow,nosnowbiomes,noflat,notrees,notemples
mgv6_spflags (Mapgen V6 specific flags) flags jungles,biomeblend,mudflow,snowbiomes,noflat,trees,temples jungles,biomeblend,mudflow,snowbiomes,flat,trees,temples
# Deserts occur when np_biome exceeds this value.
# When the 'snowbiomes' flag is enabled, this is ignored.
@@ -1163,7 +1163,7 @@ mgv6_np_apple_trees (Apple trees noise) noise_params_2d 0, 1, (100, 100, 100), 3
# 'ridges': Rivers.
# 'floatlands': Floating land masses in the atmosphere.
# 'caverns': Giant caves deep underground.
mgv7_spflags (Mapgen V7 specific flags) flags mountains,ridges,nofloatlands,caverns mountains,ridges,floatlands,caverns,nomountains,noridges,nofloatlands,nocaverns
mgv7_spflags (Mapgen V7 specific flags) flags mountains,ridges,nofloatlands,caverns mountains,ridges,floatlands,caverns
# Y of mountain density gradient zero level. Used to shift mountains vertically.
mgv7_mount_zero_level (Mountain zero level) int 0 -31000 31000
@@ -1297,7 +1297,7 @@ mgv7_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2
[*Mapgen Carpathian]
# Map generation attributes specific to Mapgen Carpathian.
mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns,norivers caverns,rivers,nocaverns,norivers
mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns,norivers caverns,rivers
# Defines the base ground level.
mgcarpathian_base_level (Base ground level) float 12.0
@@ -1406,7 +1406,7 @@ mgcarpathian_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 50
# Map generation attributes specific to Mapgen Flat.
# Occasional lakes and hills can be added to the flat world.
mgflat_spflags (Mapgen Flat specific flags) flags nolakes,nohills,nocaverns lakes,hills,caverns,nolakes,nohills,nocaverns
mgflat_spflags (Mapgen Flat specific flags) flags nolakes,nohills,nocaverns lakes,hills,caverns
# Y of flat ground.
mgflat_ground_level (Ground level) int 8 -31000 31000
@@ -1490,7 +1490,7 @@ mgflat_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0,
# Map generation attributes specific to Mapgen Fractal.
# 'terrain' enables the generation of non-fractal terrain:
# ocean, islands and underground.
mgfractal_spflags (Mapgen Fractal specific flags) flags terrain terrain,noterrain
mgfractal_spflags (Mapgen Fractal specific flags) flags terrain terrain
# Controls width of tunnels, a smaller value creates wider tunnels.
# Value >= 10.0 completely disables generation of tunnels and avoids the
@@ -1624,7 +1624,7 @@ mgfractal_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500),
# 'vary_river_depth': If enabled, low humidity and high heat causes rivers
# to become shallower and occasionally dry.
# 'altitude_dry': Reduces humidity with altitude.
mgvalleys_spflags (Mapgen Valleys specific flags) flags altitude_chill,humid_rivers,vary_river_depth,altitude_dry altitude_chill,humid_rivers,vary_river_depth,altitude_dry,noaltitude_chill,nohumid_rivers,novary_river_depth,noaltitude_dry
mgvalleys_spflags (Mapgen Valleys specific flags) flags altitude_chill,humid_rivers,vary_river_depth,altitude_dry altitude_chill,humid_rivers,vary_river_depth,altitude_dry
# The vertical distance over which heat drops by 20 if 'altitude_chill' is
# enabled. Also, the vertical distance over which humidity drops by 10 if

View File

@@ -1 +0,0 @@
../../irr/media/Shaders

View File

@@ -91,7 +91,7 @@ float directional_ambient(vec3 normal)
void main(void)
{
varTexCoord = (mTexture * inTexCoord0).st;
varTexCoord = (mTexture * vec4(inTexCoord0.xy, 1.0, 1.0)).st;
gl_Position = mWorldViewProj * inVertexPosition;
vPosition = gl_Position.xyz;

View File

@@ -1,4 +1,4 @@
Minetest Lua Client Modding API Reference 5.9.0
Minetest Lua Client Modding API Reference 5.9.1
================================================
* More information at <http://www.minetest.net/>
* Developer Wiki: <http://dev.minetest.net/>

View File

@@ -1802,6 +1802,11 @@ Displays a minimap on the HUD.
* `size`: Size of the minimap to display. Minimap should be a square to avoid
distortion.
* Negative values represent percentages of the screen. If either `x` or `y`
is specified as a percentage, the resulting pixel size will be used for
both `x` and `y`. Example: On a 1920x1080 screen, `{x = 0, y = -25}` will
result in a 270x270 minimap.
* Negative values are supported starting with protocol version 45.
* `alignment`: The alignment of the minimap.
* `offset`: offset in pixels from position.
@@ -6451,7 +6456,8 @@ Formspec
* `playername`: name of player to show formspec
* `formname`: name passed to `on_player_receive_fields` callbacks.
It should follow the `"modname:<whatever>"` naming convention.
`formname` must not be empty.
* `formname` must not be empty, unless you want to reshow
the inventory formspec without updating it for future opens.
* `formspec`: formspec to display
* `minetest.close_formspec(playername, formname)`
* `playername`: name of player to close formspec
@@ -9217,9 +9223,17 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
-- If specified as a table, the field to be used is selected according to
-- the current `pointed_thing`.
-- There are three possible TouchInteractionMode values:
-- * "user" (meaning depends on client-side settings)
-- * "long_dig_short_place" (long tap = dig, short tap = place)
-- * "short_dig_long_place" (short tap = dig, long tap = place)
-- * "user":
-- * For `pointed_object`: Equivalent to "short_dig_long_place" if the
-- client-side setting "touch_punch_gesture" is "short_tap" (the
-- default value) and the item is able to punch (i.e. has no on_use
-- callback defined).
-- Equivalent to "long_dig_short_place" otherwise.
-- * For `pointed_node` and `pointed_nothing`:
-- Equivalent to "long_dig_short_place".
-- * The behavior of "user" may change in the future.
-- The default value is "user".
sound = {

View File

@@ -1,4 +1,4 @@
Minetest Lua Mainmenu API Reference 5.9.0
Minetest Lua Mainmenu API Reference 5.9.1
=========================================
Introduction

View File

@@ -184,3 +184,23 @@ unittests.register("test_objects_in_area", function(_, pos)
return core.objects_in_area(pos:offset(-1, -1, -1), pos:offset(1, 1, 1))
end)
end, {map=true})
-- Tests that bone rotation euler angles are preserved (see #14992)
local function test_get_bone_rot(_, pos)
local obj = core.add_entity(pos, "unittests:dummy")
for _ = 1, 100 do
local function assert_similar(euler_angles)
local _, rot = obj:get_bone_position("bonename")
assert(euler_angles:distance(rot) < 1e-3)
local override = obj:get_bone_override("bonename")
assert(euler_angles:distance(override.rotation.vec:apply(math.deg)) < 1e-3)
end
local deg = 1e3 * vector.new(math.random(), math.random(), math.random())
obj:set_bone_position("bonename", vector.zero(), deg)
assert_similar(deg)
local rad = 3 * math.pi * vector.new(math.random(), math.random(), math.random())
obj:set_bone_override("bonename", {rotation = {vec = rad}})
assert_similar(rad:apply(math.deg))
end
end
unittests.register("test_get_bone_rot", test_get_bone_rot, {map=true})

View File

@@ -1,310 +0,0 @@
name: build
# build on c/cpp changes or workflow changes
on:
- push
- pull_request
jobs:
linux-gl:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
- name: Build
run: |
cmake . -DUSE_SDL2=OFF
make VERBOSE=1 -j2
- name: Test
run: |
ctest --output-on-failure
- name: Package
run: |
make DESTDIR=$PWD/_install install
tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
- uses: actions/upload-artifact@v4
with:
name: irrlicht-linux
path: ./irrlicht-linux.tar.gz
linux-gles:
# Xvfb test is broken on 20.04 for unknown reasons (not our bug)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=OFF -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
make -j2
- name: Test (headless)
run: |
cd bin/Linux
./AutomatedTest null
- name: Test (Xvfb)
run: |
cd bin/Linux
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
linux-sdl:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
- name: Build
run: |
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DCMAKE_BUILD_TYPE=Debug
make -j2
- name: Test (headless)
run: |
cd bin/Linux
./AutomatedTest null
linux-sdl-gl3:
# Xvfb test is broken on 20.04 for unknown reasons (not our bug)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON
make -j2
- name: Test (headless)
run: |
cd bin/Linux
./AutomatedTest null
- name: Test (Xvfb)
run: |
cd bin/Linux
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest opengl3
linux-sdl-gles2:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
make -j2
- name: Test (headless)
run: |
cd bin/Linux
./AutomatedTest null
- name: Test (Xvfb)
run: |
cd bin/Linux
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
mingw:
name: "MinGW ${{matrix.config.variant}}${{matrix.config.extras}}"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config:
- {variant: win32, arch: i686}
- {variant: win64, arch: x86_64}
- {variant: win32, arch: i686, extras: "-sdl"}
- {variant: win64, arch: x86_64, extras: "-sdl"}
steps:
- uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get update && sudo apt-get install cmake -qyy
./scripts/ci-get-mingw.sh
- name: Build
run: |
./scripts/ci-build-mingw.sh package
env:
CC: ${{matrix.config.arch}}-w64-mingw32-clang
CXX: ${{matrix.config.arch}}-w64-mingw32-clang++
extras: ${{matrix.config.extras}}
- uses: actions/upload-artifact@v4
with:
name: irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}
path: ./irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}.zip
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
brew update --auto-update
brew install cmake libpng jpeg
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Build
run: |
cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1
make -j3
- name: Test (headless)
run: |
./bin/OSX/AutomatedTest null
macos-sdl:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
brew update --auto-update
brew install cmake libpng jpeg sdl2
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Build
run: |
cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1 -DUSE_SDL2=1
make -j3
msvc:
name: VS 2019 ${{ matrix.config.arch }} ${{ matrix.sdl.label }}
runs-on: windows-2019
env:
VCPKG_VERSION: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
# 2023.10.19
vcpkg_packages: zlib libpng libjpeg-turbo
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
sdl:
-
use: FALSE
label: '(no SDL)'
vcpkg_packages: opengl-registry
-
use: TRUE
label: '(with SDL)'
vcpkg_packages: sdl2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{env.vcpkg_packages}} ${{matrix.sdl.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}} `
-DUSE_SDL2=${{matrix.sdl.use}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release .
- name: Build
run: cmake --build . --config Release
- name: Create artifact folder
run: |
mkdir artifact/
mkdir artifact/lib/
- name: Move dlls into artifact folder
run: move bin\Win32-VisualStudio\Release\* artifact\lib\
- name: Move includes into artifact folder
run: move include artifact/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: msvc-${{ matrix.config.arch }}-${{matrix.sdl.use}}
path: artifact/
android:
name: Android ${{ matrix.arch }}
runs-on: ubuntu-20.04
env:
ndk_version: "r25c"
ANDROID_NDK: ${{ github.workspace }}/android-ndk
strategy:
matrix:
arch: [armeabi-v7a, arm64-v8a, x86, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install deps
run: |
sudo rm /var/lib/man-db/auto-update
sudo apt-get update
sudo apt-get install -qyy wget unzip zip gcc-multilib make cmake
- name: Cache NDK
id: cache-ndk
uses: actions/cache@v4
with:
key: android-ndk-${{ env.ndk_version }}-linux
path: ${{ env.ANDROID_NDK }}
- name: Install NDK
run: |
wget --progress=bar:force "http://dl.google.com/android/repository/android-ndk-${ndk_version}-linux.zip"
unzip -q "android-ndk-${ndk_version}-linux.zip"
rm "android-ndk-${ndk_version}-linux.zip"
mv "android-ndk-${ndk_version}" "${ANDROID_NDK}"
if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }}
- name: Build
run: ./scripts/ci-build-android.sh ${{ matrix.arch }}
#- name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: irrlicht-android-${{ matrix.arch }}
# path: ${{ runner.temp }}/pkg/${{ matrix.arch }}

View File

@@ -11,14 +11,5 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
endif()
# FIXME: tests need to be moved to MT if we want to keep them
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
#enable_testing()
add_subdirectory(src)
#add_subdirectory(test)
#option(BUILD_EXAMPLES "Build example applications" FALSE)
#if(BUILD_EXAMPLES)
# add_subdirectory(examples)
#endif()

View File

@@ -1,154 +0,0 @@
#include <iostream>
#include <irrlicht.h>
#include "exampleHelper.h"
using namespace irr;
static IrrlichtDevice *device = nullptr;
static int test_fail = 0;
void test_irr_array();
void test_irr_string();
static video::E_DRIVER_TYPE chooseDriver(core::stringc arg_)
{
if (arg_ == "null")
return video::EDT_NULL;
if (arg_ == "ogles1")
return video::EDT_OGLES1;
if (arg_ == "ogles2")
return video::EDT_OGLES2;
if (arg_ == "opengl")
return video::EDT_OPENGL;
if (arg_ == "opengl3")
return video::EDT_OPENGL3;
std::cerr << "Unknown driver type: " << arg_.c_str() << ". Trying OpenGL." << std::endl;
return video::EDT_OPENGL;
}
static inline void check(bool ok, const char *msg)
{
if (!ok) {
test_fail++;
device->getLogger()->log((core::stringc("FAILED TEST: ") + msg).c_str(), ELL_ERROR);
}
}
void run_unit_tests()
{
std::cout << "Running unit tests:" << std::endl;
try {
test_irr_array();
test_irr_string();
} catch (const std::exception &e) {
std::cerr << e.what() << std::endl;
test_fail++;
}
std::cout << std::endl;
}
int main(int argc, char *argv[])
{
run_unit_tests();
SIrrlichtCreationParameters p;
p.DriverType = chooseDriver(argc > 1 ? argv[1] : "");
p.WindowSize = core::dimension2du(640, 480);
p.Vsync = true;
p.LoggingLevel = ELL_DEBUG;
device = createDeviceEx(p);
if (!device)
return 1;
{
u32 total = 0;
device->getOSOperator()->getSystemMemory(&total, nullptr);
core::stringc message = core::stringc("Total RAM in MiB: ") + core::stringc(total >> 10);
device->getLogger()->log(message.c_str(), ELL_INFORMATION);
check(total > 130 * 1024, "RAM amount");
}
device->setWindowCaption(L"Hello World!");
device->setResizable(true);
video::IVideoDriver *driver = device->getVideoDriver();
scene::ISceneManager *smgr = device->getSceneManager();
gui::IGUIEnvironment *guienv = device->getGUIEnvironment();
guienv->addStaticText(L"sample text", core::rect<s32>(10, 10, 110, 22), false);
gui::IGUIButton *button = guienv->addButton(
core::rect<s32>(10, 30, 110, 30 + 32), 0, -1, L"sample button",
L"sample tooltip");
gui::IGUIEditBox *editbox = guienv->addEditBox(L"",
core::rect<s32>(10, 70, 60, 70 + 16));
const io::path mediaPath = getExampleMediaPath();
auto mesh_file = device->getFileSystem()->createAndOpenFile(mediaPath + "coolguy_opt.x");
check(mesh_file, "mesh file loading");
scene::IAnimatedMesh *mesh = smgr->getMesh(mesh_file);
check(mesh, "mesh loading");
if (mesh_file)
mesh_file->drop();
if (mesh) {
video::ITexture *tex = driver->getTexture(mediaPath + "cooltexture.png");
check(tex, "texture loading");
scene::IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode(mesh);
if (node) {
node->forEachMaterial([tex](video::SMaterial &mat) {
mat.Lighting = false;
mat.setTexture(0, tex);
});
node->setFrameLoop(0, 29);
node->setAnimationSpeed(30);
}
}
smgr->addCameraSceneNode(0, core::vector3df(0, 4, 5), core::vector3df(0, 2, 0));
s32 n = 0;
SEvent event;
device->getTimer()->start();
while (device->run()) {
if (device->getTimer()->getTime() >= 1000) {
device->getTimer()->setTime(0);
++n;
if (n == 1) { // Tooltip display
bzero(&event, sizeof(SEvent));
event.EventType = irr::EET_MOUSE_INPUT_EVENT;
event.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
event.MouseInput.X = button->getAbsolutePosition().getCenter().X;
event.MouseInput.Y = button->getAbsolutePosition().getCenter().Y;
device->postEventFromUser(event);
} else if (n == 2) // Text input focus
guienv->setFocus(editbox);
else if (n == 3) { // Keypress for Text input
bzero(&event, sizeof(SEvent));
event.EventType = irr::EET_KEY_INPUT_EVENT;
event.KeyInput.Char = L'a';
event.KeyInput.Key = KEY_KEY_A;
event.KeyInput.PressedDown = true;
device->postEventFromUser(event);
event.KeyInput.PressedDown = false;
device->postEventFromUser(event);
} else
device->closeDevice();
}
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH,
video::SColor(255, 100, 100, 150));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
check(core::stringw(L"a") == editbox->getText(), "EditBox text");
device->getLogger()->log("Done.", ELL_INFORMATION);
device->drop();
return test_fail > 0 ? 1 : 0;
}

View File

@@ -1,138 +0,0 @@
#include <irrArray.h>
#include "test_helper.h"
using namespace irr;
using core::array;
static void test_basics()
{
array<int> v;
v.push_back(1); // 1
v.push_front(2); // 2, 1
v.insert(4, 0); // 4, 2, 1
v.insert(3, 1); // 4, 3, 2, 1
v.insert(0, 4); // 4, 3, 2, 1, 0
UASSERTEQ(v.size(), 5);
UASSERTEQ(v[0], 4);
UASSERTEQ(v[1], 3);
UASSERTEQ(v[2], 2);
UASSERTEQ(v[3], 1);
UASSERTEQ(v[4], 0);
array<int> w = v;
UASSERTEQ(w.size(), 5);
UASSERT(w == v);
w.clear();
UASSERTEQ(w.size(), 0);
UASSERTEQ(w.allocated_size(), 0);
UASSERT(w.empty());
w = v;
UASSERTEQ(w.size(), 5);
w.set_used(3);
UASSERTEQ(w.size(), 3);
UASSERTEQ(w[0], 4);
UASSERTEQ(w[1], 3);
UASSERTEQ(w[2], 2);
UASSERTEQ(w.getLast(), 2);
w.set_used(20);
UASSERTEQ(w.size(), 20);
w = v;
w.sort();
UASSERTEQ(w.size(), 5);
UASSERTEQ(w[0], 0);
UASSERTEQ(w[1], 1);
UASSERTEQ(w[2], 2);
UASSERTEQ(w[3], 3);
UASSERTEQ(w[4], 4);
w.erase(0);
UASSERTEQ(w.size(), 4);
UASSERTEQ(w[0], 1);
UASSERTEQ(w[1], 2);
UASSERTEQ(w[2], 3);
UASSERTEQ(w[3], 4);
w.erase(1, 2);
UASSERTEQ(w.size(), 2);
UASSERTEQ(w[0], 1);
UASSERTEQ(w[1], 4);
w.swap(v);
UASSERTEQ(w.size(), 5);
UASSERTEQ(v.size(), 2);
}
static void test_linear_searches()
{
// Populate the array with 0, 1, 2, ..., 100, 100, 99, 98, 97, ..., 0
array<int> arr;
for (int i = 0; i <= 100; i++)
arr.push_back(i);
for (int i = 100; i >= 0; i--)
arr.push_back(i);
s32 end = arr.size() - 1;
for (int i = 0; i <= 100; i++) {
s32 index = arr.linear_reverse_search(i);
UASSERTEQ(index, end - i);
}
for (int i = 0; i <= 100; i++) {
s32 index = arr.linear_search(i);
UASSERTEQ(index, i);
}
}
static void test_binary_searches()
{
const auto &values = {3, 5, 1, 2, 5, 10, 19, 9, 7, 1, 2, 5, 8, 15};
array<int> arr;
for (int value : values) {
arr.push_back(value);
}
// Test the const form first, it uses a linear search without sorting
const array<int> &carr = arr;
UASSERTEQ(carr.binary_search(20), -1);
UASSERTEQ(carr.binary_search(0), -1);
UASSERTEQ(carr.binary_search(1), 2);
// Sorted: 1, 1, 2, 2, 3, 5, 5, 5, 7, 8, 9, 10, 15, 19
UASSERTEQ(arr.binary_search(20), -1);
UASSERTEQ(arr.binary_search(0), -1);
for (int value : values) {
s32 i = arr.binary_search(value);
UASSERTNE(i, -1);
UASSERTEQ(arr[i], value);
}
s32 first, last;
first = arr.binary_search_multi(1, last);
UASSERTEQ(first, 0);
UASSERTEQ(last, 1);
first = arr.binary_search_multi(2, last);
UASSERTEQ(first, 2);
UASSERTEQ(last, 3);
first = arr.binary_search_multi(3, last);
UASSERTEQ(first, 4);
UASSERTEQ(last, 4);
first = arr.binary_search_multi(4, last);
UASSERTEQ(first, -1);
first = arr.binary_search_multi(5, last);
UASSERTEQ(first, 5);
UASSERTEQ(last, 7);
first = arr.binary_search_multi(7, last);
UASSERTEQ(first, 8);
UASSERTEQ(last, 8);
first = arr.binary_search_multi(19, last);
UASSERTEQ(first, 13);
UASSERTEQ(last, 13);
}
void test_irr_array()
{
test_basics();
test_linear_searches();
test_binary_searches();
std::cout << " test_irr_array PASSED" << std::endl;
}

View File

@@ -1,33 +0,0 @@
#pragma once
#include <exception>
#include <iostream>
class TestFailedException : public std::exception
{
};
// Asserts the comparison specified by CMP is true, or fails the current unit test
#define UASSERTCMP(CMP, actual, expected) \
do { \
const auto &a = (actual); \
const auto &e = (expected); \
if (!CMP(a, e)) { \
std::cout \
<< "Test assertion failed: " << #actual << " " << #CMP << " " \
<< #expected << std::endl \
<< " at " << __FILE__ << ":" << __LINE__ << std::endl \
<< " actual: " << a << std::endl \
<< " expected: " \
<< e << std::endl; \
throw TestFailedException(); \
} \
} while (0)
#define CMPEQ(a, e) (a == e)
#define CMPTRUE(a, e) (a)
#define CMPNE(a, e) (a != e)
#define UASSERTEQ(actual, expected) UASSERTCMP(CMPEQ, actual, expected)
#define UASSERTNE(actual, nexpected) UASSERTCMP(CMPNE, actual, nexpected)
#define UASSERT(actual) UASSERTCMP(CMPTRUE, actual, true)

View File

@@ -1,205 +0,0 @@
#include <irrString.h>
#include <cstring>
#include <clocale>
#include <vector>
#include "test_helper.h"
using namespace irr;
using namespace irr::core;
#define CMPSTR(a, b) (!strcmp(a, b))
#define UASSERTSTR(actual, expected) UASSERTCMP(CMPSTR, actual.c_str(), expected)
static void test_basics()
{
// ctor
stringc s;
UASSERTEQ(s.c_str()[0], '\0');
s = stringc(0.1234567);
UASSERTSTR(s, "0.123457");
s = stringc(0x1p+53);
UASSERTSTR(s, "9007199254740992.000000");
s = stringc(static_cast<int>(-102400));
UASSERTSTR(s, "-102400");
s = stringc(static_cast<unsigned int>(102400));
UASSERTSTR(s, "102400");
s = stringc(static_cast<long>(-1024000));
UASSERTSTR(s, "-1024000");
s = stringc(static_cast<unsigned long>(1024000));
UASSERTSTR(s, "1024000");
s = stringc("YESno", 3);
UASSERTSTR(s, "YES");
s = stringc(L"test", 4);
UASSERTSTR(s, "test");
s = stringc("Hello World!");
UASSERTSTR(s, "Hello World!");
// operator=
s = stringw(L"abcdef");
UASSERTSTR(s, "abcdef");
s = L"abcdef";
UASSERTSTR(s, "abcdef");
s = static_cast<const char *>(nullptr);
UASSERTSTR(s, "");
// operator+
s = s + stringc("foo");
UASSERTSTR(s, "foo");
s = s + L"bar";
UASSERTSTR(s, "foobar");
// the rest
s = "f";
UASSERTEQ(s[0], 'f');
const auto &sref = s;
UASSERTEQ(sref[0], 'f');
UASSERT(sref == "f");
UASSERT(sref == stringc("f"));
s = "a";
UASSERT(sref < stringc("aa"));
UASSERT(sref < stringc("b"));
UASSERT(stringc("Z") < sref);
UASSERT(!(sref < stringc("a")));
UASSERT(sref.lower_ignore_case("AA"));
UASSERT(sref.lower_ignore_case("B"));
UASSERT(!sref.lower_ignore_case("A"));
s = "dog";
UASSERT(sref != "cat");
UASSERT(sref != stringc("cat"));
}
static void test_methods()
{
stringc s;
const auto &sref = s;
s = "irrlicht";
UASSERTEQ(sref.size(), 8);
UASSERT(!sref.empty());
s.clear();
UASSERTEQ(sref.size(), 0);
UASSERT(sref.empty());
UASSERT(sref[0] == 0);
s = "\tAz#`";
s.make_lower();
UASSERTSTR(s, "\taz#`");
s.make_upper();
UASSERTSTR(s, "\tAZ#`");
UASSERT(sref.equals_ignore_case("\taz#`"));
UASSERT(sref.equals_substring_ignore_case("Z#`", 2));
s = "irrlicht";
UASSERT(sref.equalsn(stringc("irr"), 3));
UASSERT(sref.equalsn("irr", 3));
s = "fo";
s.append('o');
UASSERTSTR(s, "foo");
s.append("bar", 1);
UASSERTSTR(s, "foob");
s.append("ar", 999999);
UASSERTSTR(s, "foobar");
s = "nyan";
s.append(stringc("cat"));
UASSERTSTR(s, "nyancat");
s.append(stringc("sam"), 1);
UASSERTSTR(s, "nyancats");
s = "fbar";
s.insert(1, "ooXX", 2);
UASSERTSTR(s, "foobar");
UASSERTEQ(sref.findFirst('o'), 1);
UASSERTEQ(sref.findFirst('X'), -1);
UASSERTEQ(sref.findFirstChar("abff", 2), 3);
UASSERTEQ(sref.findFirstCharNotInList("fobb", 2), 3);
UASSERTEQ(sref.findLast('o'), 2);
UASSERTEQ(sref.findLast('X'), -1);
UASSERTEQ(sref.findLastChar("abrr", 2), 4);
UASSERTEQ(sref.findLastCharNotInList("rabb", 2), 3);
UASSERTEQ(sref.findNext('o', 2), 2);
UASSERTEQ(sref.findLast('o', 1), 1);
s = "ob-oob";
UASSERTEQ(sref.find("ob", 1), 4);
UASSERTEQ(sref.find("ob"), 0);
UASSERTEQ(sref.find("?"), -1);
s = "HOMEOWNER";
stringc s2 = sref.subString(2, 4);
UASSERTSTR(s2, "MEOW");
s2 = sref.subString(2, 4, true);
UASSERTSTR(s2, "meow");
s = "land";
s.replace('l', 's');
UASSERTSTR(s, "sand");
s = ">dog<";
s.replace("dog", "cat");
UASSERTSTR(s, ">cat<");
s.replace("cat", "horse");
UASSERTSTR(s, ">horse<");
s.replace("horse", "gnu");
UASSERTSTR(s, ">gnu<");
s = " h e l p ";
s.remove(' ');
UASSERTSTR(s, "help");
s.remove("el");
UASSERTSTR(s, "hp");
s = "irrlicht";
s.removeChars("it");
UASSERTSTR(s, "rrlch");
s = "\r\nfoo bar ";
s.trim();
UASSERTSTR(s, "foo bar");
s = "foxo";
s.erase(2);
UASSERTSTR(s, "foo");
s = "a";
s.append('\0');
s.append('b');
UASSERTEQ(s.size(), 3);
s.validate();
UASSERTEQ(s.size(), 1);
UASSERTEQ(s.lastChar(), 'a');
std::vector<stringc> res;
s = "a,,b,c";
s.split(res, ",aa", 1, true, false);
UASSERTEQ(res.size(), 3);
UASSERTSTR(res[0], "a");
UASSERTSTR(res[2], "c");
res.clear();
s.split(res, ",", 1, false, true);
UASSERTEQ(res.size(), 7);
UASSERTSTR(res[0], "a");
UASSERTSTR(res[2], "");
for (int i = 0; i < 3; i++)
UASSERTSTR(res[2 * i + 1], ",");
}
static void test_conv()
{
// locale-independent
stringw out;
utf8ToWString(out, "†††");
UASSERTEQ(out.size(), 3);
for (int i = 0; i < 3; i++)
UASSERTEQ(static_cast<u16>(out[i]), 0x2020);
stringc out2;
wStringToUTF8(out2, L"†††");
UASSERTEQ(out2.size(), 9);
for (int i = 0; i < 3; i++) {
UASSERTEQ(static_cast<u8>(out2[3 * i]), 0xe2);
UASSERTEQ(static_cast<u8>(out2[3 * i + 1]), 0x80);
UASSERTEQ(static_cast<u8>(out2[3 * i + 2]), 0xa0);
}
// locale-dependent
if (!setlocale(LC_CTYPE, "C.UTF-8"))
setlocale(LC_CTYPE, "UTF-8"); // macOS
stringw out3;
multibyteToWString(out3, "†††");
UASSERTEQ(out3.size(), 3);
for (int i = 0; i < 3; i++)
UASSERTEQ(static_cast<u16>(out3[i]), 0x2020);
}
void test_irr_string()
{
test_basics();
test_methods();
test_conv();
std::cout << " test_irr_string PASSED" << std::endl;
}

View File

@@ -1,17 +0,0 @@
set(IRREXAMPLES
# removed
)
if(UNIX)
list(APPEND IRREXAMPLES AutomatedTest)
endif()
foreach(exname IN ITEMS ${IRREXAMPLES})
file(GLOB sources "${CMAKE_CURRENT_SOURCE_DIR}/${exname}/*.cpp")
add_executable(${exname} ${sources})
target_include_directories(${exname} PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/${exname}
)
target_link_libraries(${exname} IrrlichtMt)
endforeach()

View File

@@ -170,16 +170,21 @@ class CMeshBuffer : public IMeshBuffer
return;
const u32 vertexCount = getVertexCount();
u32 i;
Vertices.reallocate(vertexCount + numVertices);
for (i = 0; i < numVertices; ++i) {
// Only reallocate if there are enough new vertices. Otherwise append()
// will be slow when called in a loop.
if (vertexCount + numVertices > Vertices.allocated_size() * 3 / 2)
Vertices.reallocate(vertexCount + numVertices);
for (u32 i = 0; i < numVertices; ++i) {
Vertices.push_back(static_cast<const T *>(vertices)[i]);
BoundingBox.addInternalPoint(static_cast<const T *>(vertices)[i].Pos);
}
Indices.reallocate(getIndexCount() + numIndices);
for (i = 0; i < numIndices; ++i) {
if (getIndexCount() + numIndices > Indices.allocated_size() * 3 / 2)
Indices.reallocate(getIndexCount() + numIndices);
for (u32 i = 0; i < numIndices; ++i) {
Indices.push_back(indices[i] + vertexCount);
}
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,123 +0,0 @@
#!/bin/bash -e
# NOTE: this code is mostly copied from minetest_android_deps
# <https://github.com/minetest/minetest_android_deps>
png_ver=1.6.40
jpeg_ver=3.0.1
download () {
get_tar_archive libpng "https://download.sourceforge.net/libpng/libpng-${png_ver}.tar.gz"
get_tar_archive libjpeg "https://download.sourceforge.net/libjpeg-turbo/libjpeg-turbo-${jpeg_ver}.tar.gz"
}
build () {
# Build libjpg and libpng first because Irrlicht needs them
mkdir -p libpng
pushd libpng
$srcdir/libpng/configure --host=$CROSS_PREFIX
make && make DESTDIR=$PWD install
popd
mkdir -p libjpeg
pushd libjpeg
cmake $srcdir/libjpeg "${CMAKE_FLAGS[@]}" -DENABLE_SHARED=OFF
make && make DESTDIR=$PWD install
popd
local libpng=$PWD/libpng/usr/local/lib/libpng.a
local libjpeg=$(echo $PWD/libjpeg/opt/libjpeg-turbo/lib*/libjpeg.a)
cmake $srcdir/irrlicht "${CMAKE_FLAGS[@]}" \
-DBUILD_SHARED_LIBS=OFF \
-DPNG_LIBRARY=$libpng \
-DPNG_PNG_INCLUDE_DIR=$(dirname "$libpng")/../include \
-DJPEG_LIBRARY=$libjpeg \
-DJPEG_INCLUDE_DIR=$(dirname "$libjpeg")/../include
make
cp -p lib/Android/libIrrlichtMt.a $libpng $libjpeg $pkgdir/
cp -a $srcdir/irrlicht/include $pkgdir/include
cp -a $srcdir/irrlicht/media/Shaders $pkgdir/Shaders
}
get_tar_archive () {
# $1: folder to extract to, $2: URL
local filename="${2##*/}"
[ -d "$1" ] && return 0
wget -c "$2" -O "$filename"
mkdir -p "$1"
tar -xaf "$filename" -C "$1" --strip-components=1
rm "$filename"
}
_setup_toolchain () {
local toolchain=$(echo "$ANDROID_NDK"/toolchains/llvm/prebuilt/*)
if [ ! -d "$toolchain" ]; then
echo "Android NDK path not specified or incorrect"; return 1
fi
export PATH="$toolchain/bin:$ANDROID_NDK:$PATH"
unset CFLAGS CPPFLAGS CXXFLAGS
TARGET_ABI="$1"
API=21
if [ "$TARGET_ABI" == armeabi-v7a ]; then
CROSS_PREFIX=armv7a-linux-androideabi
CFLAGS="-mthumb"
CXXFLAGS="-mthumb"
elif [ "$TARGET_ABI" == arm64-v8a ]; then
CROSS_PREFIX=aarch64-linux-android
elif [ "$TARGET_ABI" == x86 ]; then
CROSS_PREFIX=i686-linux-android
CFLAGS="-mssse3 -mfpmath=sse"
CXXFLAGS="-mssse3 -mfpmath=sse"
elif [ "$TARGET_ABI" == x86_64 ]; then
CROSS_PREFIX=x86_64-linux-android
else
echo "Invalid ABI given"; return 1
fi
export CC=$CROSS_PREFIX$API-clang
export CXX=$CROSS_PREFIX$API-clang++
export AR=llvm-ar
export RANLIB=llvm-ranlib
export CFLAGS="-fPIC ${CFLAGS}"
export CXXFLAGS="-fPIC ${CXXFLAGS}"
CMAKE_FLAGS=(
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake"
"-DANDROID_ABI=$TARGET_ABI" "-DANDROID_NATIVE_API_LEVEL=$API"
"-DCMAKE_BUILD_TYPE=Release"
)
# make sure pkg-config doesn't interfere
export PKG_CONFIG=/bin/false
export MAKEFLAGS="-j$(nproc)"
}
_run_build () {
local abi=$1
irrdir=$PWD
mkdir -p $RUNNER_TEMP/src
cd $RUNNER_TEMP/src
srcdir=$PWD
[ -d irrlicht ] || ln -s $irrdir irrlicht
download
builddir=$RUNNER_TEMP/build/irrlicht-$abi
pkgdir=$RUNNER_TEMP/pkg/$abi/Irrlicht
rm -rf "$pkgdir"
mkdir -p "$builddir" "$pkgdir"
cd "$builddir"
build
}
if [ $# -lt 1 ]; then
echo "Usage: ci-build-android.sh <ABI>"
exit 1
fi
_setup_toolchain $1
_run_build $1

View File

@@ -1,70 +0,0 @@
#!/bin/bash -e
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
[[ -z "$CC" || -z "$CXX" ]] && exit 255
variant=win32
[[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64
with_sdl=0
[[ "$extras" == *"-sdl"* ]] && with_sdl=1
#with_gl3=0
#[[ "$extras" == *"-gl3"* ]] && with_gl3=1
libjpeg_version=3.0.1
libpng_version=1.6.40
sdl2_version=2.28.5
zlib_version=1.3.1
download () {
local url=$1
local filename=${url##*/}
local foldername=${filename%%[.-]*}
[ -d "./$foldername" ] && return 0
[ -e "$filename" ] || wget "$url" -O "$filename"
sha256sum -w -c <(grep -F "$filename" "$topdir/sha256sums.txt")
unzip -o "$filename" -d "$foldername"
}
libs=$PWD/libs
mkdir -p libs
pushd libs
libhost="http://minetest.kitsunemimi.pw"
download "$libhost/llvm/libjpeg-$libjpeg_version-$variant.zip"
download "$libhost/llvm/libpng-$libpng_version-$variant.zip"
[ $with_sdl -eq 1 ] && download "$libhost/llvm/sdl2-$sdl2_version-$variant.zip"
download "$libhost/llvm/zlib-$zlib_version-$variant.zip"
popd
tmp=(
-DCMAKE_SYSTEM_NAME=Windows \
-DPNG_LIBRARY=$libs/libpng/lib/libpng.dll.a \
-DPNG_PNG_INCLUDE_DIR=$libs/libpng/include \
-DJPEG_LIBRARY=$libs/libjpeg/lib/libjpeg.dll.a \
-DJPEG_INCLUDE_DIR=$libs/libjpeg/include \
-DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \
-DZLIB_INCLUDE_DIR=$libs/zlib/include
)
if [ $with_sdl -eq 1 ]; then
tmp+=(
-DUSE_SDL2=ON
-DCMAKE_PREFIX_PATH=$libs/sdl2/lib/cmake
)
else
tmp+=(-DUSE_SDL2=OFF)
fi
#[ $with_gl3 -eq 1 ] && tmp+=(-DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON)
cmake . "${tmp[@]}"
make -j$(nproc)
if [ "$1" = "package" ]; then
make DESTDIR=$PWD/_install install
# strip library
"${CXX%-*}-strip" --strip-unneeded _install/usr/local/lib/*.dll
# bundle the DLLs that are specific to Irrlicht (kind of a hack)
shopt -s nullglob
cp -p $libs/*/bin/{libjpeg,libpng,SDL}*.dll _install/usr/local/lib/
# create a ZIP
(cd _install/usr/local; zip -9r "$OLDPWD/irrlicht-$variant$extras.zip" -- *)
fi
exit 0

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -e
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
name=llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz
wget "https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/$name" -O "$name"
sha256sum -w -c <(grep -F "$name" "$topdir/sha256sums.txt")
sudo tar -xaf "$name" -C /usr --strip-components=1
rm -f "$name"

View File

@@ -1,9 +0,0 @@
0f21ff3be90311092fe32e0e30878ef3ae9d9437b8d9ac25ef279e0d84e9bb8e llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz
53dfd31285f470fcf0dca88217c5cf9c557729af6d103afae5936e72ddc38d3c libjpeg-3.0.1-win32.zip
3d44e0740914e6878300e30653aad39e974821b5d7f6c2567e246b4eb04a5324 libjpeg-3.0.1-win64.zip
6baf4e819bfb3573760524b5dc9a04b5e479090d6d2046b86cf39a3107c0071f libpng-1.6.40-win32.zip
c02e029f01fce44baea7f4aecfd2564bd8a03507c0c6af8b03339ae0452c8b7d libpng-1.6.40-win64.zip
f9f890af960e92fd3f532f2e9ac00681c33bc67a722e000dfdaeb41b0064f1a0 sdl2-2.28.5-win32.zip
8dde2c6963544b7d8a2e87c128ebbdf51ad0e70c7e2df986ff4e963ce9996d9b sdl2-2.28.5-win64.zip
8af10515d57dbfee5d2106cd66cafa2adeb4270d4c6047ccbf7e8b5d2d50681c zlib-1.3.1-win32.zip
ad43f5d23052590c65633530743e5d622cc76b33c109072e6fd7b487aff56bca zlib-1.3.1-win64.zip

View File

@@ -45,9 +45,12 @@
#include <X11/Xcursor/Xcursor.h>
#endif
#if defined(_IRR_COMPILE_WITH_X11_) || defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
#include <unistd.h>
#endif
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
#include <fcntl.h>
#include <unistd.h>
#ifdef __FreeBSD__
#include <sys/joystick.h>

View File

@@ -1125,8 +1125,11 @@ void COpenGL3DriverBase::setMaterial(const SMaterial &material)
OverrideMaterial.apply(Material);
for (u32 i = 0; i < Feature.MaxTextureUnits; ++i) {
CacheHandler->getTextureCache().set(i, material.getTexture(i));
setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i));
auto *texture = material.getTexture(i);
CacheHandler->getTextureCache().set(i, texture);
if (texture) {
setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i));
}
}
}

View File

@@ -1,32 +0,0 @@
link_libraries(IrrlichtMt::IrrlichtMt)
add_executable(image_loader_test image_loader_test.cpp)
function(test_image_loader format expected input)
string(TOLOWER ${format} suffix)
add_test(NAME ImageLoader${format}-${input} COMMAND image_loader_test ${expected} data/sample_${input}.${suffix} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endfunction()
test_image_loader(BMP 16color-16bpp 4bpp_v3)
# test_image_loader(BMP 16color-16bpp 4bpp_v7)
# test_image_loader(BMP 16color-16bpp 4bpp_v3_rle)
# test_image_loader(BMP 16color-16bpp 4bpp_v7_rle)
test_image_loader(BMP 30color-16bpp 8bpp_v3)
# test_image_loader(BMP 30color-16bpp 8bpp_v7)
test_image_loader(BMP 30color-16bpp 8bpp_v3_rle)
# test_image_loader(BMP 30color-16bpp 8bpp_v7_rle)
# test_image_loader(BMP 30color-16bpp 16bpp_v3)
# test_image_loader(BMP 30color-16bpp 16bpp_v7)
test_image_loader(BMP 30color-24bpp 24bpp_v3)
test_image_loader(BMP 30color-24bpp 24bpp_v7)
test_image_loader(PNG 30color-24bpp 8bpp)
test_image_loader(PNG 30color-24bpp 24bpp)
test_image_loader(TGA 30color-32bpp 8bpp_up)
test_image_loader(TGA 30color-32bpp 8bpp_down)
# test_image_loader(TGA 30color-16bpp 8bpp_rle_up)
# test_image_loader(TGA 30color-16bpp 8bpp_rle_down)
test_image_loader(TGA 30color-24bpp 24bpp_up)
test_image_loader(TGA 30color-24bpp 24bpp_down)
test_image_loader(TGA 30color-24bpp 24bpp_rle_up)
test_image_loader(TGA 30color-24bpp 24bpp_rle_down)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

View File

@@ -1,162 +0,0 @@
#include <cstdio>
#include <initializer_list>
#include <stdexcept>
#include <vector>
#include <irrlicht.h>
using namespace irr;
struct ImageDesc
{
const char *name;
video::ECOLOR_FORMAT format;
std::vector<u8> data;
};
template <typename T>
std::vector<u8> to_byte_array(std::initializer_list<T> in_data)
{
std::vector<u8> data;
data.resize(sizeof(T) * in_data.size());
memcpy(data.data(), in_data.begin(), data.size());
return data;
}
static const ImageDesc test_images[] = {
{"16color-16bpp", video::ECF_A1R5G5B5, to_byte_array<u16>({
0xb6df, 0xb6df, 0xb6df, 0xb6df, 0xc23f, 0xc23f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xff16,
0xb6df, 0xb6df, 0xff3f, 0xff3f, 0xc23f, 0xf2df, 0xf2df, 0xf2df, 0xea3f, 0xda7f, 0xda7f, 0xfe5e, 0xfe7a, 0xc23f, 0xbe7f, 0xbe7f, 0xfeb5, 0xfeb5, 0xfb76,
0xb6df, 0xff9e, 0xc23f, 0xc23f, 0xc23f, 0xf2df, 0xd61f, 0xf2df, 0xea3f, 0xda7f, 0xfe5e, 0xda7f, 0xfe7a, 0xc23f, 0xfe97, 0xfeb5, 0xfeb5, 0xff16, 0xfb76,
0xb6df, 0xff9e, 0xbe7f, 0xc23f, 0xd61f, 0xfe7c, 0xd61f, 0xf2df, 0xfe5e, 0xf2df, 0xfe7c, 0xda7f, 0xfe7a, 0xda7f, 0xbe7f, 0xfeb5, 0xff16, 0xff16, 0xfb76,
0xb6df, 0xff9e, 0xc23f, 0xc23f, 0xd61f, 0xff3f, 0xd61f, 0xf2df, 0xfe5e, 0xda7f, 0xfe7c, 0xda7f, 0xfe7a, 0xc23f, 0xfeb5, 0xfeb5, 0xff16, 0xff16, 0xfb76,
0xb6df, 0xbe7f, 0xff9e, 0xff3f, 0xd61f, 0xff3f, 0xf2df, 0xf2df, 0xfe5e, 0xf2df, 0xda7f, 0xfe97, 0xfe97, 0xda7f, 0xc23f, 0xda7f, 0xfb76, 0xfb76, 0xfb76,
0xbe7f, 0xc23f, 0xc23f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7c, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xfeb5, 0xfb76, 0xfb76, 0xfb76,
0xbe7f, 0xc23f, 0xd61f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe97, 0xfe97, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76,
0xc23f, 0xff9e, 0xc23f, 0xd61f, 0xff3f, 0xea3f, 0xfe5e, 0xff3f, 0xfe7c, 0xfe7c, 0xf2df, 0xfe97, 0xfeb5, 0xfeb5, 0xda7f, 0xff16, 0xc23f, 0xc23f, 0xbe7f,
0xc23f, 0xff9e, 0xff9e, 0xd61f, 0xff9e, 0xea3f, 0xff3f, 0xfe5e, 0xff3f, 0xfe7a, 0xf2df, 0xf2df, 0xfeb5, 0xf2df, 0xda7f, 0xfb76, 0xc23f, 0xfb76, 0xfb76,
0xc23f, 0xff9e, 0xd61f, 0xff9e, 0xff9e, 0xfe5e, 0xff3f, 0xff3f, 0xff3f, 0xfe7a, 0xff3f, 0xfeb5, 0xf2df, 0xff16, 0xda7f, 0xfb76, 0xda7f, 0xda7f, 0xfb76,
0xc23f, 0xff9e, 0xea3f, 0xea3f, 0xff9e, 0xfe5e, 0xff9e, 0xfe7c, 0xff3f, 0xfe97, 0xf2df, 0xfeb5, 0xfeb5, 0xff16, 0xf2df, 0xfb76, 0xda7f, 0xfb76, 0xfb76,
0xd61f, 0xff9e, 0xd61f, 0xea3f, 0xff9e, 0xfe5e, 0xff9e, 0xfe7c, 0xff3f, 0xfe97, 0xff3f, 0xfeb5, 0xff16, 0xfb76, 0xda7f, 0xfb76, 0xda7f, 0xda7f, 0xc23f,
0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xea3f, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76,
0xd61f, 0xd61f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76,
})},
{"30color-16bpp", video::ECF_A1R5G5B5, to_byte_array<u16>({
0xbabf, 0xbabf, 0xbabf, 0xbabf, 0xbe3f, 0xbdff, 0xc9ff, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16,
0xbabf, 0xbabf, 0xff1f, 0xff1f, 0xbdff, 0xfaff, 0xf2df, 0xeabf, 0xee3f, 0xe27f, 0xda7f, 0xfe5e, 0xfe7b, 0xc25f, 0xbe7f, 0xbe7f, 0xfeb5, 0xfed5, 0xff56,
0xbabf, 0xff7e, 0xbe7f, 0xc25f, 0xbdff, 0xfaff, 0xda1f, 0xf2df, 0xee3f, 0xda7f, 0xfe5e, 0xce5f, 0xfe79, 0xce5f, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56,
0xbabf, 0xff7e, 0xbe7f, 0xbdff, 0xc9ff, 0xfaff, 0xda1f, 0xf2df, 0xfa5f, 0xeabf, 0xfe5e, 0xda7f, 0xfe79, 0xce5f, 0xc25f, 0xfeb5, 0xff16, 0xff16, 0xff76,
0xbabf, 0xff7e, 0xc25f, 0xbdff, 0xc9ff, 0xff1f, 0xda1f, 0xf2df, 0xfa5f, 0xeabf, 0xfe7c, 0xda7f, 0xfe79, 0xce5f, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97,
0xbabf, 0xbe7f, 0xff7e, 0xff5e, 0xda1f, 0xff1f, 0xfaff, 0xfaff, 0xfa5f, 0xf2df, 0xeabf, 0xfe79, 0xfe97, 0xda7f, 0xce5f, 0xce5f, 0xff56, 0xff76, 0xff97,
0xbe7f, 0xc25f, 0xbdff, 0xc9ff, 0xda1f, 0xda1f, 0xee3f, 0xfa5f, 0xfa5f, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xfed5, 0xff76, 0xff76, 0xff97,
0xbe7f, 0xbe3f, 0xc9ff, 0xc9ff, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe79, 0xfe97, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xff76, 0xff97, 0xff97,
0xbe3f, 0xffbe, 0xc9ff, 0xda1f, 0xff5e, 0xee3f, 0xfa5f, 0xff1f, 0xfe7c, 0xfe7b, 0xf2df, 0xfe97, 0xfeb5, 0xfeb5, 0xda7f, 0xff76, 0xce5f, 0xbe3f, 0xc25f,
0xbe3f, 0xffbe, 0xffbe, 0xda1f, 0xff7e, 0xfa5f, 0xff5e, 0xfe5e, 0xff1f, 0xfe79, 0xf2df, 0xf2df, 0xfeb5, 0xeabf, 0xda7f, 0xff76, 0xce5f, 0xff97, 0xff97,
0xbdff, 0xffbe, 0xda1f, 0xff7e, 0xff7e, 0xfa5f, 0xff5e, 0xff1f, 0xff1f, 0xfe79, 0xfaff, 0xfeb5, 0xf2df, 0xff16, 0xe27f, 0xff97, 0xda7f, 0xce5f, 0xff97,
0xbdff, 0xffbe, 0xda1f, 0xee3f, 0xffbe, 0xfa5f, 0xff7e, 0xfe7b, 0xff1f, 0xfe97, 0xfaff, 0xfeb5, 0xfed5, 0xff56, 0xeabf, 0xff97, 0xda7f, 0xff97, 0xff97,
0xc9ff, 0xffbe, 0xda1f, 0xee3f, 0xff7e, 0xfa5f, 0xff7e, 0xfe7c, 0xff5e, 0xfe97, 0xfaff, 0xfed5, 0xff16, 0xff56, 0xeabf, 0xff97, 0xda7f, 0xda7f, 0xce5f,
0xda1f, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe79, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97,
0xda1f, 0xda1f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97,
})},
{"30color-24bpp", video::ECF_R8G8B8, {
0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x7b, 0x8b, 0xff, 0x7a, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xfe, 0x96, 0xf0, 0xfd, 0x99, 0xe3, 0xfd, 0x9b, 0xda, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1,
0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0xff, 0xc6, 0xfc, 0xff, 0xc6, 0xfc, 0x7a, 0x7f, 0xff, 0xf7, 0xbe, 0xff, 0xe4, 0xb2, 0xfe, 0xd4, 0xa9, 0xff, 0xd9, 0x8c, 0xff, 0xc3, 0x98, 0xff, 0xb2, 0x9a, 0xff, 0xfe, 0x96, 0xf0, 0xfd, 0x9b, 0xda, 0x86, 0x93, 0xfe, 0x78, 0x9b, 0xff, 0x78, 0x9b, 0xff, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf8, 0xd2, 0xb3,
0x71, 0xaf, 0xff, 0xfe, 0xdc, 0xf3, 0x78, 0x9b, 0xff, 0x86, 0x93, 0xfe, 0x7a, 0x7f, 0xff, 0xf7, 0xbe, 0xff, 0xb6, 0x85, 0xff, 0xe4, 0xb2, 0xfe, 0xd9, 0x8c, 0xff, 0xb2, 0x9a, 0xff, 0xfe, 0x96, 0xf0, 0x9a, 0x91, 0xff, 0xfc, 0x9f, 0xca, 0x9a, 0x91, 0xff, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, 0xf8, 0xd2, 0xb3,
0x71, 0xaf, 0xff, 0xfe, 0xdc, 0xf3, 0x78, 0x9b, 0xff, 0x7a, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xf7, 0xbe, 0xff, 0xb6, 0x85, 0xff, 0xe4, 0xb2, 0xfe, 0xf4, 0x92, 0xfe, 0xd4, 0xa9, 0xff, 0xfe, 0x96, 0xf0, 0xb2, 0x9a, 0xff, 0xfc, 0x9f, 0xca, 0x9a, 0x91, 0xff, 0x86, 0x93, 0xfe, 0xfb, 0xa9, 0xab, 0xf9, 0xc6, 0xb1, 0xf9, 0xc6, 0xb1, 0xf8, 0xd8, 0xb5,
0x71, 0xaf, 0xff, 0xfe, 0xdc, 0xf3, 0x86, 0x93, 0xfe, 0x7a, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xff, 0xc6, 0xfc, 0xb6, 0x85, 0xff, 0xe4, 0xb2, 0xfe, 0xf4, 0x92, 0xfe, 0xd4, 0xa9, 0xff, 0xfd, 0x99, 0xe3, 0xb2, 0x9a, 0xff, 0xfc, 0x9f, 0xca, 0x9a, 0x91, 0xff, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, 0xf8, 0xd2, 0xb3, 0xf8, 0xe4, 0xb9,
0x71, 0xaf, 0xff, 0x78, 0x9b, 0xff, 0xfe, 0xdc, 0xf3, 0xff, 0xd0, 0xf7, 0xb6, 0x85, 0xff, 0xff, 0xc6, 0xfc, 0xf7, 0xbe, 0xff, 0xf7, 0xbe, 0xff, 0xf4, 0x92, 0xfe, 0xe4, 0xb2, 0xfe, 0xd4, 0xa9, 0xff, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xb2, 0x9a, 0xff, 0x9a, 0x91, 0xff, 0x9a, 0x91, 0xff, 0xf8, 0xd2, 0xb3, 0xf8, 0xd8, 0xb5, 0xf8, 0xe4, 0xb9,
0x78, 0x9b, 0xff, 0x86, 0x93, 0xfe, 0x7a, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xb6, 0x85, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xf4, 0x92, 0xfe, 0xfd, 0x99, 0xe3, 0xfd, 0x9b, 0xda, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xfa, 0xb6, 0xad, 0xf8, 0xd8, 0xb5, 0xf8, 0xd8, 0xb5, 0xf8, 0xe4, 0xb9,
0x78, 0x9b, 0xff, 0x7b, 0x8b, 0xff, 0x90, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xfe, 0x96, 0xf0, 0xfd, 0x99, 0xe3, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xf9, 0xc6, 0xb1, 0xf9, 0xc6, 0xb1, 0xf8, 0xd8, 0xb5, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9,
0x7b, 0x8b, 0xff, 0xff, 0xeb, 0xf2, 0x90, 0x7f, 0xff, 0xb6, 0x85, 0xff, 0xff, 0xd0, 0xf7, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xff, 0xc6, 0xfc, 0xfd, 0x99, 0xe3, 0xfd, 0x9b, 0xda, 0xe4, 0xb2, 0xfe, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfb, 0xa9, 0xab, 0xb2, 0x9a, 0xff, 0xf8, 0xd8, 0xb5, 0x9a, 0x91, 0xff, 0x7b, 0x8b, 0xff, 0x86, 0x93, 0xfe,
0x7b, 0x8b, 0xff, 0xff, 0xeb, 0xf2, 0xff, 0xeb, 0xf2, 0xb6, 0x85, 0xff, 0xfe, 0xdc, 0xf3, 0xf4, 0x92, 0xfe, 0xff, 0xd0, 0xf7, 0xfe, 0x96, 0xf0, 0xff, 0xc6, 0xfc, 0xfc, 0x9f, 0xca, 0xe4, 0xb2, 0xfe, 0xe4, 0xb2, 0xfe, 0xfb, 0xa9, 0xab, 0xd4, 0xa9, 0xff, 0xb2, 0x9a, 0xff, 0xf8, 0xd8, 0xb5, 0x9a, 0x91, 0xff, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9,
0x7a, 0x7f, 0xff, 0xff, 0xeb, 0xf2, 0xb6, 0x85, 0xff, 0xfe, 0xdc, 0xf3, 0xfe, 0xdc, 0xf3, 0xf4, 0x92, 0xfe, 0xff, 0xd0, 0xf7, 0xff, 0xc6, 0xfc, 0xff, 0xc6, 0xfc, 0xfc, 0x9f, 0xca, 0xf7, 0xbe, 0xff, 0xfb, 0xa9, 0xab, 0xe4, 0xb2, 0xfe, 0xf9, 0xc6, 0xb1, 0xc3, 0x98, 0xff, 0xf8, 0xe4, 0xb9, 0xb2, 0x9a, 0xff, 0x9a, 0x91, 0xff, 0xf8, 0xe4, 0xb9,
0x7a, 0x7f, 0xff, 0xff, 0xeb, 0xf2, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xff, 0xeb, 0xf2, 0xf4, 0x92, 0xfe, 0xfe, 0xdc, 0xf3, 0xfd, 0x9b, 0xda, 0xff, 0xc6, 0xfc, 0xfc, 0xa4, 0xbc, 0xf7, 0xbe, 0xff, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf8, 0xd2, 0xb3, 0xd4, 0xa9, 0xff, 0xf8, 0xe4, 0xb9, 0xb2, 0x9a, 0xff, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9,
0x90, 0x7f, 0xff, 0xff, 0xeb, 0xf2, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xfe, 0xdc, 0xf3, 0xf4, 0x92, 0xfe, 0xfe, 0xdc, 0xf3, 0xfd, 0x99, 0xe3, 0xff, 0xd0, 0xf7, 0xfc, 0xa4, 0xbc, 0xf7, 0xbe, 0xff, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, 0xf8, 0xd2, 0xb3, 0xd4, 0xa9, 0xff, 0xf8, 0xe4, 0xb9, 0xb2, 0x9a, 0xff, 0xb2, 0x9a, 0xff, 0x9a, 0x91, 0xff,
0xb6, 0x85, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xfe, 0x96, 0xf0, 0xfd, 0x99, 0xe3, 0xfc, 0x9f, 0xca, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, 0xf8, 0xd2, 0xb3, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9,
0xb6, 0x85, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xfe, 0x96, 0xf0, 0xfd, 0x99, 0xe3, 0xfd, 0x9b, 0xda, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, 0xf8, 0xd2, 0xb3, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9, 0xf8, 0xe4, 0xb9,
}},
{"30color-32bpp", video::ECF_A8R8G8B8, to_byte_array<u32>({
0xff71afff, 0xff71afff, 0xff71afff, 0xff71afff, 0xff7b8bff, 0xff7a7fff, 0xff907fff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1,
0xff71afff, 0xff71afff, 0xffffc6fc, 0xffffc6fc, 0xff7a7fff, 0xfff7beff, 0xffe4b2fe, 0xffd4a9ff, 0xffd98cff, 0xffc398ff, 0xffb29aff, 0xfffe96f0, 0xfffd9bda, 0xff8693fe, 0xff789bff, 0xff789bff, 0xfffba9ab, 0xfffab6ad, 0xfff8d2b3,
0xff71afff, 0xfffedcf3, 0xff789bff, 0xff8693fe, 0xff7a7fff, 0xfff7beff, 0xffb685ff, 0xffe4b2fe, 0xffd98cff, 0xffb29aff, 0xfffe96f0, 0xff9a91ff, 0xfffc9fca, 0xff9a91ff, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3,
0xff71afff, 0xfffedcf3, 0xff789bff, 0xff7a7fff, 0xff907fff, 0xfff7beff, 0xffb685ff, 0xffe4b2fe, 0xfff492fe, 0xffd4a9ff, 0xfffe96f0, 0xffb29aff, 0xfffc9fca, 0xff9a91ff, 0xff8693fe, 0xfffba9ab, 0xfff9c6b1, 0xfff9c6b1, 0xfff8d8b5,
0xff71afff, 0xfffedcf3, 0xff8693fe, 0xff7a7fff, 0xff907fff, 0xffffc6fc, 0xffb685ff, 0xffe4b2fe, 0xfff492fe, 0xffd4a9ff, 0xfffd99e3, 0xffb29aff, 0xfffc9fca, 0xff9a91ff, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9,
0xff71afff, 0xff789bff, 0xfffedcf3, 0xffffd0f7, 0xffb685ff, 0xffffc6fc, 0xfff7beff, 0xfff7beff, 0xfff492fe, 0xffe4b2fe, 0xffd4a9ff, 0xfffc9fca, 0xfffca4bc, 0xffb29aff, 0xff9a91ff, 0xff9a91ff, 0xfff8d2b3, 0xfff8d8b5, 0xfff8e4b9,
0xff789bff, 0xff8693fe, 0xff7a7fff, 0xff907fff, 0xffb685ff, 0xffb685ff, 0xffd98cff, 0xfff492fe, 0xfff492fe, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfffab6ad, 0xfff8d8b5, 0xfff8d8b5, 0xfff8e4b9,
0xff789bff, 0xff7b8bff, 0xff907fff, 0xff907fff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffc9fca, 0xfffca4bc, 0xfffca4bc, 0xfffba9ab, 0xfff9c6b1, 0xfff9c6b1, 0xfff8d8b5, 0xfff8e4b9, 0xfff8e4b9,
0xff7b8bff, 0xffffebf2, 0xff907fff, 0xffb685ff, 0xffffd0f7, 0xffd98cff, 0xfff492fe, 0xffffc6fc, 0xfffd99e3, 0xfffd9bda, 0xffe4b2fe, 0xfffca4bc, 0xfffba9ab, 0xfffba9ab, 0xffb29aff, 0xfff8d8b5, 0xff9a91ff, 0xff7b8bff, 0xff8693fe,
0xff7b8bff, 0xffffebf2, 0xffffebf2, 0xffb685ff, 0xfffedcf3, 0xfff492fe, 0xffffd0f7, 0xfffe96f0, 0xffffc6fc, 0xfffc9fca, 0xffe4b2fe, 0xffe4b2fe, 0xfffba9ab, 0xffd4a9ff, 0xffb29aff, 0xfff8d8b5, 0xff9a91ff, 0xfff8e4b9, 0xfff8e4b9,
0xff7a7fff, 0xffffebf2, 0xffb685ff, 0xfffedcf3, 0xfffedcf3, 0xfff492fe, 0xffffd0f7, 0xffffc6fc, 0xffffc6fc, 0xfffc9fca, 0xfff7beff, 0xfffba9ab, 0xffe4b2fe, 0xfff9c6b1, 0xffc398ff, 0xfff8e4b9, 0xffb29aff, 0xff9a91ff, 0xfff8e4b9,
0xff7a7fff, 0xffffebf2, 0xffb685ff, 0xffd98cff, 0xffffebf2, 0xfff492fe, 0xfffedcf3, 0xfffd9bda, 0xffffc6fc, 0xfffca4bc, 0xfff7beff, 0xfffba9ab, 0xfffab6ad, 0xfff8d2b3, 0xffd4a9ff, 0xfff8e4b9, 0xffb29aff, 0xfff8e4b9, 0xfff8e4b9,
0xff907fff, 0xffffebf2, 0xffb685ff, 0xffd98cff, 0xfffedcf3, 0xfff492fe, 0xfffedcf3, 0xfffd99e3, 0xffffd0f7, 0xfffca4bc, 0xfff7beff, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xffd4a9ff, 0xfff8e4b9, 0xffb29aff, 0xffb29aff, 0xff9a91ff,
0xffb685ff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffc9fca, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9,
0xffb685ff, 0xffb685ff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9,
})},
};
void printImageBytes(const video::IImage *img)
{
const auto *data = (u8 *)img->getData();
const auto w = img->getPitch();
const auto h = img->getDimension().Height;
for (int y = 0; y < h; y++) {
for (int k = 0; k < w; k++) {
std::printf("0x%02x, ", *data++);
}
std::printf("\n");
}
}
int main(int argc, char *argv[])
try {
if (argc != 3)
throw std::runtime_error("Invalid arguments. Expected sample ID and image file name");
const ImageDesc *sample = nullptr;
for (auto &&image : test_images) {
if (strcmp(argv[1], image.name) == 0)
sample = &image;
}
if (!sample)
throw std::runtime_error("Sample not found");
SIrrlichtCreationParameters p;
p.DriverType = video::EDT_NULL;
p.WindowSize = core::dimension2du(640, 480);
p.LoggingLevel = ELL_DEBUG;
auto *device = createDeviceEx(p);
if (!device)
throw std::runtime_error("Failed to create device");
auto *driver = device->getVideoDriver();
auto *img = driver->createImageFromFile(argv[2]);
if (!img)
throw std::runtime_error("Failed to load image");
if (img->getDimension() != core::dimension2du{19, 15})
throw std::runtime_error("Wrong image dimensions");
if (img->getColorFormat() != sample->format)
throw std::runtime_error("Wrong image format");
if (img->getImageDataSizeInBytes() != sample->data.size())
throw std::logic_error("Image data size not equal to sample size");
if (memcmp(img->getData(), sample->data.data(), sample->data.size()) != 0) {
printImageBytes(img);
throw std::runtime_error("Wrong image contents");
}
img->drop();
device->drop();
return 0;
} catch (const std::exception &e) {
std::printf("Test failed: %s\n", e.what());
return 1;
}

View File

@@ -149,6 +149,6 @@
<update_contact>celeron55@gmail.com</update_contact>
<releases>
<release date="2024-08-11" version="5.9.0"/>
<release date="2024-09-08" version="5.9.1"/>
</releases>
</component>

View File

@@ -96,6 +96,9 @@ struct BoneOverride
{
core::quaternion previous;
core::quaternion next;
// Redundantly store the euler angles serverside
// so that we can return them in the appropriate getters
v3f next_radians;
bool absolute = false;
f32 interp_timer = 0;
} rotation;

View File

@@ -133,8 +133,8 @@ class Clouds : public scene::ISceneNode
{
float height_bs = m_params.height * BS;
float thickness_bs = m_params.thickness * BS;
m_box = aabb3f(-BS * 1000000.0f, height_bs - BS * m_camera_offset.Y, -BS * 1000000.0f,
BS * 1000000.0f, height_bs + thickness_bs - BS * m_camera_offset.Y, BS * 1000000.0f);
m_box = aabb3f(-BS * 1000000.0f, height_bs, -BS * 1000000.0f,
BS * 1000000.0f, height_bs + thickness_bs, BS * 1000000.0f);
}
void updateMesh();

View File

@@ -817,18 +817,6 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
<<"\" not supported"<<std::endl;
}
/* Set VBO hint */
// - if shaders are disabled we modify the mesh often
// - sprites are also modified often
// - the wieldmesh sets its own hint
// - bone transformations do not need to modify the vertex data
if (m_enable_shaders && (m_meshnode || m_animated_meshnode)) {
if (m_meshnode)
m_meshnode->getMesh()->setHardwareMappingHint(scene::EHM_STATIC);
if (m_animated_meshnode)
m_animated_meshnode->getMesh()->setHardwareMappingHint(scene::EHM_STATIC);
}
/* don't update while punch texture modifier is active */
if (m_reset_textures_timer < 0)
updateTextures(m_current_texture_modifier);
@@ -1267,6 +1255,16 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
}
}
static void setMeshBufferTextureCoords(scene::IMeshBuffer *buf, const v2f *uv, u32 count)
{
assert(buf->getVertexType() == video::EVT_STANDARD);
assert(buf->getVertexCount() == count);
auto *vertices = static_cast<video::S3DVertex *>(buf->getVertices());
for (u32 i = 0; i < count; i++)
vertices[i].TCoords = uv[i];
buf->setDirty(scene::EBT_VERTEX);
}
void GenericCAO::updateTexturePos()
{
if(m_spritenode)
@@ -1526,9 +1524,8 @@ void GenericCAO::updateAnimation()
if (!m_animated_meshnode)
return;
if (m_animated_meshnode->getStartFrame() != m_animation_range.X ||
m_animated_meshnode->getEndFrame() != m_animation_range.Y)
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
// Note: This sets the current frame as well, (re)starting the animation.
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
if (m_animated_meshnode->getAnimationSpeed() != m_animation_speed)
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
m_animated_meshnode->setTransitionTime(m_animation_blend);

View File

@@ -1446,7 +1446,7 @@ void Game::copyServerClientCache()
{
// It would be possible to let the client directly read the media files
// from where the server knows they are. But aside from being more complicated
// it would also *not* fill the media cache and cause slower joining of
// it would also *not* fill the media cache and cause slower joining of
// remote servers.
// (Imagine that you launch a game once locally and then connect to a server.)
@@ -3349,8 +3349,12 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud)
infostream << "Pointing at " << pointed.dump() << std::endl;
if (g_touchscreengui) {
auto mode = selected_def.touch_interaction.getMode(pointed.type);
auto mode = selected_def.touch_interaction.getMode(selected_def, pointed.type);
g_touchscreengui->applyContextControls(mode);
// applyContextControls may change dig/place input.
// Update again so that TOSERVER_INTERACT packets have the correct controls set.
player->control.dig = isKeyDown(KeyType::DIG);
player->control.place = isKeyDown(KeyType::PLACE);
}
// Note that updating the selection mesh every frame is not particularly efficient,

View File

@@ -139,7 +139,6 @@ Hud::Hud(Client *client, LocalPlayer *player,
m_rotation_mesh_buffer.getMaterial().Lighting = false;
m_rotation_mesh_buffer.getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
m_rotation_mesh_buffer.setHardwareMappingHint(scene::EHM_STATIC);
}
void Hud::readScalingSetting()
@@ -544,14 +543,21 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
}
break; }
case HUD_ELEM_MINIMAP: {
if (e->size.X <= 0 || e->size.Y <= 0)
break;
if (!client->getMinimap())
break;
// Draw a minimap of size "size"
v2s32 dstsize(e->size.X * m_scale_factor,
e->size.Y * m_scale_factor);
// (no percent size as minimap would likely be anamorphosed)
// Only one percentage is supported to avoid distortion.
if (e->size.X < 0)
dstsize.X = dstsize.Y = m_screensize.X * (e->size.X * -0.01);
else if (e->size.Y < 0)
dstsize.X = dstsize.Y = m_screensize.Y * (e->size.Y * -0.01);
if (dstsize.X <= 0 || dstsize.Y <= 0)
return;
v2s32 offset((e->align.X - 1.0) * dstsize.X / 2,
(e->align.Y - 1.0) * dstsize.Y / 2);
core::rect<s32> rect(0, 0, dstsize.X, dstsize.Y);

View File

@@ -360,7 +360,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
collisionMoveResult result = collisionMoveSimple(env, m_client,
pos_max_d, m_collisionbox, player_stepheight, dtime,
&position, &m_speed, accel_f);
&position, &m_speed, accel_f, m_cao);
bool could_sneak = control.sneak && !free_move && !in_liquid &&
!is_climbing && physics_override.sneak;
@@ -444,7 +444,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
v3f check_pos = position;
check_pos.Y += y_diff * dtime * 22.0f + BS * 0.01f;
if (y_diff < BS * 0.6f || (physics_override.sneak_glitch
&& !collision_check_intersection(env, m_client, m_collisionbox, check_pos))) {
&& !collision_check_intersection(env, m_client, m_collisionbox, check_pos, m_cao))) {
// Smoothen the movement (based on 'position.Y = bmax.Y')
position.Y = std::min(check_pos.Y, bmax.Y);
m_speed.Y = 0.0f;
@@ -990,7 +990,7 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
collisionMoveResult result = collisionMoveSimple(env, m_client,
pos_max_d, m_collisionbox, player_stepheight, dtime,
&position, &m_speed, accel_f);
&position, &m_speed, accel_f, m_cao);
// Position was slightly changed; update standing node pos
if (touching_ground)
@@ -1254,7 +1254,7 @@ void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
// try at peak of jump, zero step height
collisionMoveResult jump_result = collisionMoveSimple(env, m_client, pos_max_d,
m_collisionbox, 0.0f, dtime, &jump_pos, &jump_speed, v3f(0.0f));
m_collisionbox, 0.0f, dtime, &jump_pos, &jump_speed, v3f(0.0f), m_cao);
// see if we can get a little bit farther horizontally if we had
// jumped

View File

@@ -783,12 +783,15 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
}
if (mesh) {
// Use VBO for mesh (this just would set this for ever buffer)
// Use VBO for mesh (this just would set this for every buffer)
mesh->setHardwareMappingHint(scene::EHM_STATIC);
}
}
//std::cout<<"added "<<fastfaces.getSize()<<" faces."<<std::endl;
// Transparent parts have changing indices
for (auto &it : m_transparent_triangles)
it.buffer->setHardwareMappingHint(scene::EHM_STREAM, scene::EBT_INDEX);
m_bsp_tree.buildTree(&m_transparent_triangles, data->side_length);
// Check if animation is required for this mesh

View File

@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "mesh.h"
#include "S3DVertex.h"
#include "debug.h"
#include "log.h"
#include <cmath>
@@ -197,15 +198,6 @@ void setMeshColor(scene::IMesh *mesh, const video::SColor &color)
setMeshBufferColor(mesh->getMeshBuffer(j), color);
}
void setMeshBufferTextureCoords(scene::IMeshBuffer *buf, const v2f *uv, u32 count)
{
const u32 stride = getVertexPitchFromType(buf->getVertexType());
assert(buf->getVertexCount() >= count);
u8 *vertices = (u8 *) buf->getVertices();
for (u32 i = 0; i < count; i++)
((video::S3DVertex*) (vertices + i * stride))->TCoords = uv[i];
}
template <typename F>
static void applyToMesh(scene::IMesh *mesh, const F &fn)
{

View File

@@ -59,13 +59,6 @@ void setMeshBufferColor(scene::IMeshBuffer *buf, const video::SColor &color);
*/
void setMeshColor(scene::IMesh *mesh, const video::SColor &color);
/*
Sets texture coords for vertices in the mesh buffer.
`uv[]` must have `count` elements
*/
void setMeshBufferTextureCoords(scene::IMeshBuffer *buf, const v2f *uv, u32 count);
/*
Set a constant color for an animated mesh
*/

View File

@@ -571,7 +571,6 @@ scene::SMeshBuffer *Minimap::getMinimapMeshBuffer()
buf->Indices[4] = 3;
buf->Indices[5] = 0;
buf->setHardwareMappingHint(scene::EHM_STATIC);
return buf;
}

View File

@@ -249,7 +249,7 @@ class MainShaderConstantSetter : public IShaderConstantSetter
m_world_view_proj.set(worldViewProj, services);
if (driver->getDriverType() == video::EDT_OGLES2 || driver->getDriverType() == video::EDT_OPENGL3) {
core::matrix4 texture = driver->getTransform(video::ETS_TEXTURE_0);
auto &texture = driver->getTransform(video::ETS_TEXTURE_0);
m_world_view.set(worldView, services);
m_texture.set(texture, services);
}
@@ -573,6 +573,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
} else {
shaders_header << "#version 100\n";
}
// cf. EVertexAttributes.h for the predefined ones
vertex_header = R"(
precision mediump float;
@@ -582,7 +583,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
attribute highp vec4 inVertexPosition;
attribute lowp vec4 inVertexColor;
attribute mediump vec4 inTexCoord0;
attribute mediump vec2 inTexCoord0;
attribute mediump vec3 inVertexNormal;
attribute mediump vec4 inVertexTangent;
attribute mediump vec4 inVertexBinormal;

View File

@@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "filesys.h"
#include "porting.h"
#include <limits>
namespace sound {
void OpenALSoundManager::stepStreams(f32 dtime)
@@ -347,6 +349,13 @@ void OpenALSoundManager::updateListener(const v3f &pos_, const v3f &vel_,
void OpenALSoundManager::setListenerGain(f32 gain)
{
#if defined(__APPLE__)
/* macOS OpenAL implementation ignore setting AL_GAIN to zero
* so we use smallest possible value
*/
if (gain == 0.0f)
gain = std::numeric_limits<f32>::min();
#endif
alListenerf(AL_GAIN, gain);
}

View File

@@ -273,7 +273,7 @@ static void add_object_boxes(Environment *env,
const v3f pos_f, const v3f speed_f, ActiveObject *self,
std::vector<NearbyCollisionInfo> &cinfo)
{
auto process_object = [&] (ActiveObject *object) {
auto process_object = [&cinfo] (ActiveObject *object) {
if (object && object->collideWithObjects()) {
aabb3f box;
if (object->getCollisionBox(&box))
@@ -292,7 +292,7 @@ static void add_object_boxes(Environment *env,
c_env->getActiveObjects(pos_f, distance, clientobjects);
for (auto &clientobject : clientobjects) {
// Do collide with everything but itself and the parent CAO
// Do collide with everything but itself and children
if (!self || (self != clientobject.obj &&
self != clientobject.obj->getParent())) {
process_object(clientobject.obj);
@@ -301,12 +301,12 @@ static void add_object_boxes(Environment *env,
// add collision with local player
LocalPlayer *lplayer = c_env->getLocalPlayer();
if (lplayer->getParent() == nullptr) {
auto *obj = (ClientActiveObject*) lplayer->getCAO();
if (!self || (self != obj && self != obj->getParent())) {
aabb3f lplayer_collisionbox = lplayer->getCollisionbox();
v3f lplayer_pos = lplayer->getPosition();
lplayer_collisionbox.MinEdge += lplayer_pos;
lplayer_collisionbox.MaxEdge += lplayer_pos;
auto *obj = (ActiveObject*) lplayer->getCAO();
cinfo.emplace_back(obj, 0, lplayer_collisionbox);
}
}
@@ -315,7 +315,7 @@ static void add_object_boxes(Environment *env,
{
ServerEnvironment *s_env = dynamic_cast<ServerEnvironment*>(env);
if (s_env) {
// search for objects which are not us, or we are not its parent.
// search for objects which are not us and not our children.
// we directly process the object in this callback to avoid useless
// looping afterwards.
auto include_obj_cb = [self, &process_object] (ServerActiveObject *obj) {
@@ -623,8 +623,10 @@ bool collision_check_intersection(Environment *env, IGameDef *gamedef,
Collision detection
*/
aabb3f checkbox = box_0;
checkbox.MinEdge += pos_f;
checkbox.MaxEdge += pos_f;
// aabbox3d::intersectsWithBox(box) returns true when the faces are touching perfectly.
// However, we do not want want a true-ish return value in that case. Add some tolerance.
checkbox.MinEdge += pos_f + (0.1f * BS);
checkbox.MaxEdge += pos_f - (0.1f * BS);
/*
Go through every node and object box

View File

@@ -65,7 +65,8 @@ struct collisionMoveResult
std::vector<CollisionInfo> collisions;
};
// Moves using a single iteration; speed should not exceed pos_max_d/dtime
/// @brief Moves using a single iteration; speed should not exceed pos_max_d/dtime
/// @param self (optional) ActiveObject to ignore in the collision detection.
collisionMoveResult collisionMoveSimple(Environment *env,IGameDef *gamedef,
f32 pos_max_d, const aabb3f &box_0,
f32 stepheight, f32 dtime,
@@ -73,7 +74,11 @@ collisionMoveResult collisionMoveSimple(Environment *env,IGameDef *gamedef,
v3f accel_f, ActiveObject *self=NULL,
bool collide_with_objects=true);
// check if box is in collision on actual position
/// @brief A simpler version of "collisionMoveSimple" that only checks whether
/// a collision occurs at the given position.
/// @param self (optional) ActiveObject to ignore in the collision detection.
/// @returns `true` when `box_0` truly intersects with a node or object.
/// Touching faces are not counted as intersection.
bool collision_check_intersection(Environment *env, IGameDef *gamedef,
const aabb3f &box_0, const v3f &pos_f, ActiveObject *self = nullptr,
bool collide_with_objects = true);

View File

@@ -76,13 +76,6 @@ static bool detect_touch()
return false;
}
return false;
#elif defined(_WIN32)
// 0x01 The device has an integrated touch digitizer
// 0x80 The device is ready to receive digitizer input.
if ((GetSystemMetrics(SM_DIGITIZER) & 0x81) == 0x81)
return true;
return false;
#else
// we don't know, return default

View File

@@ -1046,7 +1046,6 @@ void CGUITTFont::createSharedPlane()
buf->append(vertices, 4, indices, 6);
shared_plane_.addMeshBuffer( buf );
shared_plane_.setHardwareMappingHint(EHM_STATIC);
shared_plane_ptr_ = &shared_plane_;
buf->drop(); //the addMeshBuffer method will grab it, so we can drop this ptr.

View File

@@ -45,7 +45,8 @@ TouchInteraction::TouchInteraction()
pointed_object = TouchInteractionMode_USER;
}
TouchInteractionMode TouchInteraction::getMode(PointedThingType pointed_type) const
TouchInteractionMode TouchInteraction::getMode(const ItemDefinition &selected_def,
PointedThingType pointed_type) const
{
TouchInteractionMode result;
switch (pointed_type) {
@@ -63,7 +64,9 @@ TouchInteractionMode TouchInteraction::getMode(PointedThingType pointed_type) co
}
if (result == TouchInteractionMode_USER) {
if (pointed_type == POINTEDTHING_OBJECT)
if (pointed_type == POINTEDTHING_OBJECT && !selected_def.usable)
// Only apply when we're actually able to punch the object, i.e. when
// the selected item has no on_use callback defined.
result = g_settings->get("touch_punch_gesture") == "long_tap" ?
LONG_DIG_SHORT_PLACE : SHORT_DIG_LONG_PLACE;
else

View File

@@ -71,7 +71,8 @@ struct TouchInteraction
TouchInteraction();
// Returns the right mode for the pointed thing and resolves any occurrence
// of TouchInteractionMode_USER into an actual mode.
TouchInteractionMode getMode(PointedThingType pointed_type) const;
TouchInteractionMode getMode(const ItemDefinition &selected_def,
PointedThingType pointed_type) const;
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
};

View File

@@ -531,7 +531,6 @@ static bool setup_log_params(const Settings &cmd_args)
if (cmd_args.getFlag("trace")) {
dstream << _("Enabling trace level debug output") << std::endl;
g_logger.addOutput(&stderr_output, LL_TRACE);
socket_enable_debug_output = true;
}
return true;

View File

@@ -739,18 +739,19 @@ void Channel::UpdateTimers(float dtime)
if (packet_loss_counter > 1.0f) {
packet_loss_counter -= 1.0f;
unsigned int packet_loss = 11; /* use a neutral value for initialization */
unsigned int packets_successful = 0;
//unsigned int packet_too_late = 0;
unsigned int packet_loss;
unsigned int packets_successful;
unsigned int packet_too_late;
bool reasonable_amount_of_data_transmitted = false;
{
MutexAutoLock internal(m_internal_mutex);
packet_loss = current_packet_loss;
//packet_too_late = current_packet_too_late;
packet_too_late = current_packet_too_late;
packets_successful = current_packet_successful;
// has half the window even been used?
if (current_bytes_transfered > (unsigned int) (m_window_size*512/2)) {
reasonable_amount_of_data_transmitted = true;
}
@@ -759,6 +760,11 @@ void Channel::UpdateTimers(float dtime)
current_packet_successful = 0;
}
// Packets too late means either packet duplication along the way
// or we were too fast in resending it (which should be self-regulating).
// Count this a signal of congestion, like packet loss.
packet_loss = std::min(packet_loss + packet_too_late, packets_successful);
/* dynamic window size */
float successful_to_lost_ratio = 0.0f;
bool done = false;
@@ -989,19 +995,27 @@ bool UDPPeer::isTimedOut(float timeout, std::string &reason)
void UDPPeer::reportRTT(float rtt)
{
if (rtt < 0.0) {
if (rtt < 0)
return;
}
RTTStatistics(rtt,"rudp",MAX_RELIABLE_WINDOW_SIZE*10);
// use this value to decide the resend timeout
float timeout = getStat(AVG_RTT) * RESEND_TIMEOUT_FACTOR;
const float rtt_stat = getStat(AVG_RTT);
if (rtt_stat < 0)
return;
float timeout = rtt_stat * RESEND_TIMEOUT_FACTOR;
if (timeout < RESEND_TIMEOUT_MIN)
timeout = RESEND_TIMEOUT_MIN;
if (timeout > RESEND_TIMEOUT_MAX)
timeout = RESEND_TIMEOUT_MAX;
float timeout_old = getResendTimeout();
setResendTimeout(timeout);
if (std::abs(timeout - timeout_old) >= 0.001f) {
dout_con << m_connection->getDesc() << " set resend timeout " << timeout
<< " (rtt=" << rtt_stat << ") for peer id: " << id << std::endl;
}
}
bool UDPPeer::Ping(float dtime,SharedBuffer<u8>& data)
@@ -1121,7 +1135,7 @@ bool UDPPeer::processReliableSendCommand(
u16 packets_available = toadd.size();
/* we didn't get a single sequence number no need to fill queue */
if (!have_initial_sequence_number) {
LOG(derr_con << m_connection->getDesc() << "Ran out of sequence numbers!" << std::endl);
dout_con << m_connection->getDesc() << " No sequence numbers available!" << std::endl;
return false;
}

View File

@@ -329,15 +329,24 @@ struct ConnectionCommand
static ConnectionCommandPtr create(ConnectionCommandType type);
};
/* maximum window size to use, 0xFFFF is theoretical maximum. don't think about
/*
* Window sizes to use, in packets (not bytes!).
* 0xFFFF is theoretical maximum. don't think about
* touching it, the less you're away from it the more likely data corruption
* will occur
*
* Note: window sizes directly translate to maximum possible throughput, e.g.
* (2048 * 512 bytes) / 33ms = 15 MiB/s
*/
// Due to backwards compatibility we have different window sizes for what we'll
// accept from peers vs. what we use for sending.
#define MAX_RELIABLE_WINDOW_SIZE 0x8000
#define MAX_RELIABLE_WINDOW_SIZE_SEND 2048
/* starting value for window size */
#define START_RELIABLE_WINDOW_SIZE 0x400
#define START_RELIABLE_WINDOW_SIZE 64
/* minimum value for window size */
#define MIN_RELIABLE_WINDOW_SIZE 0x40
#define MIN_RELIABLE_WINDOW_SIZE 32
class Channel
{
@@ -405,7 +414,7 @@ class Channel
void setWindowSize(long size)
{
m_window_size = (u16)rangelim(size, MIN_RELIABLE_WINDOW_SIZE, MAX_RELIABLE_WINDOW_SIZE);
m_window_size = (u16)rangelim(size, MIN_RELIABLE_WINDOW_SIZE, MAX_RELIABLE_WINDOW_SIZE_SEND);
}
private:

View File

@@ -35,7 +35,6 @@ namespace con
#define PROFILE(a)
#undef DEBUG_CONNECTION_KBPS
#else
/* this mutex is used to achieve log message consistency */
#define PROFILE(a) a
//#define DEBUG_CONNECTION_KBPS
#undef DEBUG_CONNECTION_KBPS
@@ -211,7 +210,8 @@ void ConnectionSendThread::runTimeouts(float dtime, u32 peer_packet_quota)
}
float resend_timeout = udpPeer->getResendTimeout();
for (Channel &channel : udpPeer->channels) {
for (int ch = 0; ch < CHANNEL_COUNT; ch++) {
auto &channel = udpPeer->channels[ch];
// Remove timed out incomplete unreliable split packets
channel.incoming_splits.removeUnreliableTimedOuts(dtime, peer_timeout);
@@ -232,8 +232,8 @@ void ConnectionSendThread::runTimeouts(float dtime, u32 peer_packet_quota)
if (!timed_outs.empty()) {
dout_con << m_connection->getDesc() <<
"Skipping re-send of " << timed_outs.size() <<
" timed-out reliables to peer_id " << udpPeer->id
<< " (half-open)." << std::endl;
" timed-out reliables to peer_id=" << udpPeer->id
<< " channel=" << ch << " (half-open)." << std::endl;
}
continue;
}
@@ -246,7 +246,14 @@ void ConnectionSendThread::runTimeouts(float dtime, u32 peer_packet_quota)
for (const auto &k : timed_outs)
resendReliable(channel, k.get(), resend_timeout);
auto ws_old = channel.getWindowSize();
channel.UpdateTimers(dtime);
auto ws_new = channel.getWindowSize();
if (ws_old != ws_new) {
dout_con << m_connection->getDesc() <<
"Window size adjusted to " << ws_new << " for peer_id="
<< udpPeer->id << " channel=" << ch << std::endl;
}
}
/* send ping if necessary */
@@ -299,12 +306,12 @@ void ConnectionSendThread::rawSend(const BufferedPacket *p)
assert(p);
try {
m_connection->m_udpSocket.Send(p->address, p->data, p->size());
LOG(dout_con << m_connection->getDesc()
<< " rawSend: " << p->size()
<< " bytes sent" << std::endl);
//LOG(dout_con << m_connection->getDesc()
// << " rawSend: " << p->size()
// << " bytes sent" << std::endl);
} catch (SendFailedException &e) {
LOG(derr_con << m_connection->getDesc()
<< "Connection::rawSend(): SendFailedException: "
<< "SendFailedException: " << e.what() << " to "
<< p->address.serializeString() << std::endl);
}
}
@@ -317,6 +324,7 @@ void ConnectionSendThread::sendAsPacketReliable(BufferedPacketPtr &p, Channel *c
channel->outgoing_reliables_sent.insert(p,
(channel->readOutgoingSequenceNumber() - MAX_RELIABLE_WINDOW_SIZE)
% (MAX_RELIABLE_WINDOW_SIZE + 1));
// wtf is this calculation?? ^
}
catch (AlreadyExistsException &e) {
LOG(derr_con << m_connection->getDesc()
@@ -675,9 +683,9 @@ void ConnectionSendThread::sendPackets(float dtime, u32 peer_packet_quota)
PROFILE(ScopeProfiler
peerprofiler(g_profiler, peerIdentifier.str(), SPT_AVG));
LOG(dout_con << m_connection->getDesc()
<< " Handle per peer queues: peer_id=" << peerId
<< " packet quota: " << peer->m_increment_packets_remaining << std::endl);
//LOG(dout_con << m_connection->getDesc()
// << " Handle per peer queues: peer_id=" << peerId
// << " packet quota: " << peer->m_increment_packets_remaining << std::endl);
// first send queued reliable packets for all peers (if possible)
for (unsigned int i = 0; i < CHANNEL_COUNT; i++) {
@@ -1180,7 +1188,7 @@ SharedBuffer<u8> ConnectionReceiveThread::handlePacketType_Control(Channel *chan
// an overflow is quite unlikely but as it'd result in major
// rtt miscalculation we handle it here
if (current_time > p->absolute_send_time) {
float rtt = (current_time - p->absolute_send_time) / 1000.0;
float rtt = (current_time - p->absolute_send_time) / 1000.0f;
// Let peer calculate stuff according to it
// (avg_rtt and resend_timeout)
@@ -1325,12 +1333,6 @@ SharedBuffer<u8> ConnectionReceiveThread::handlePacketType_Reliable(Channel *cha
<< ", seqnum: " << seqnum << std::endl;)
m_connection->sendAck(peer->id, channelnum, seqnum);
// we already have this packet so this one was on wire at least
// the current timeout
// we don't know how long this packet was on wire don't do silly guessing
// dynamic_cast<UDPPeer*>(&peer)->
// reportRTT(dynamic_cast<UDPPeer*>(&peer)->getResendTimeout());
throw ProcessedSilentlyException("Retransmitting ack for old packet");
}
}

View File

@@ -224,9 +224,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Add TOCLIENT_MOVE_PLAYER_REL
Move default minimap from client-side C++ to server-side builtin Lua
[scheduled bump for 5.9.0]
PROTOCOL VERSION 45:
Minimap HUD element supports negative size values as percentages
[bump for 5.9.1]
*/
#define LATEST_PROTOCOL_VERSION 44
#define LATEST_PROTOCOL_VERSION 45
#define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION)
// Server's supported network protocol range

View File

@@ -50,9 +50,6 @@ typedef int socklen_t;
#define SOCKET_ERR_STR(e) strerror(e)
#endif
// Set to true to enable verbose debug output
bool socket_enable_debug_output = false; // yuck
static bool g_sockets_initialized = false;
// Initialize sockets
@@ -104,12 +101,6 @@ bool UDPSocket::init(bool ipv6, bool noExceptions)
m_addr_family = ipv6 ? AF_INET6 : AF_INET;
m_handle = socket(m_addr_family, SOCK_DGRAM, IPPROTO_UDP);
if (socket_enable_debug_output) {
tracestream << "UDPSocket(" << (int)m_handle
<< ")::UDPSocket(): ipv6 = " << (ipv6 ? "true" : "false")
<< std::endl;
}
if (m_handle < 0) {
if (noExceptions) {
return false;
@@ -135,11 +126,6 @@ bool UDPSocket::init(bool ipv6, bool noExceptions)
UDPSocket::~UDPSocket()
{
if (socket_enable_debug_output) {
tracestream << "UDPSocket( " << (int)m_handle << ")::~UDPSocket()"
<< std::endl;
}
if (m_handle >= 0) {
#ifdef _WIN32
closesocket(m_handle);
@@ -151,12 +137,6 @@ UDPSocket::~UDPSocket()
void UDPSocket::Bind(Address addr)
{
if (socket_enable_debug_output) {
tracestream << "UDPSocket(" << (int)m_handle
<< ")::Bind(): " << addr.serializeString() << ":"
<< addr.getPort() << std::endl;
}
if (addr.getFamily() != m_addr_family) {
const char *errmsg =
"Socket and bind address families do not match";
@@ -202,30 +182,6 @@ void UDPSocket::Send(const Address &destination, const void *data, int size)
if (INTERNET_SIMULATOR)
dumping_packet = myrand() % INTERNET_SIMULATOR_PACKET_LOSS == 0;
if (socket_enable_debug_output) {
// Print packet destination and size
tracestream << (int)m_handle << " -> ";
destination.print(tracestream);
tracestream << ", size=" << size;
// Print packet contents
tracestream << ", data=";
for (int i = 0; i < size && i < 20; i++) {
if (i % 2 == 0)
tracestream << " ";
unsigned int a = ((const unsigned char *)data)[i];
tracestream << std::hex << std::setw(2) << std::setfill('0') << a;
}
if (size > 20)
tracestream << "...";
if (dumping_packet)
tracestream << " (DUMPED BY INTERNET_SIMULATOR)";
tracestream << std::endl;
}
if (dumping_packet) {
// Lol let's forget it
tracestream << "UDPSocket::Send(): INTERNET_SIMULATOR: dumping packet."
@@ -302,26 +258,6 @@ int UDPSocket::Receive(Address &sender, void *data, int size)
sender = Address(address_ip, address_port);
}
if (socket_enable_debug_output) {
// Print packet sender and size
tracestream << (int)m_handle << " <- ";
sender.print(tracestream);
tracestream << ", size=" << received;
// Print packet contents
tracestream << ", data=";
for (int i = 0; i < received && i < 20; i++) {
if (i % 2 == 0)
tracestream << " ";
unsigned int a = ((const unsigned char *)data)[i];
tracestream << std::hex << std::setw(2) << std::setfill('0') << a;
}
if (received > 20)
tracestream << "...";
tracestream << std::endl;
}
return received;
}

View File

@@ -25,8 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes.h"
#include "networkexceptions.h"
extern bool socket_enable_debug_output;
void sockets_init();
void sockets_cleanup();

View File

@@ -561,8 +561,10 @@ int ObjectRef::l_set_bone_position(lua_State *L)
BoneOverride props;
if (!lua_isnoneornil(L, 3))
props.position.vector = check_v3f(L, 3);
if (!lua_isnoneornil(L, 4))
props.rotation.next = core::quaternion(check_v3f(L, 4) * core::DEGTORAD);
if (!lua_isnoneornil(L, 4)) {
props.rotation.next_radians = check_v3f(L, 4) * core::DEGTORAD;
props.rotation.next = core::quaternion(props.rotation.next_radians);
}
props.position.absolute = true;
props.rotation.absolute = true;
sao->setBoneOverride(bone, props);
@@ -584,9 +586,9 @@ int ObjectRef::l_get_bone_position(lua_State *L)
std::string bone = readParam<std::string>(L, 2, "");
BoneOverride props = sao->getBoneOverride(bone);
push_v3f(L, props.position.vector);
v3f euler_rot;
props.rotation.next.toEuler(euler_rot);
push_v3f(L, euler_rot * core::RADTODEG);
// In order to give modders back the euler angles they passed in,
// this **must not** compute equivalent euler angles from the quaternion
push_v3f(L, props.rotation.next_radians * core::RADTODEG);
return 2;
}
@@ -632,8 +634,10 @@ int ObjectRef::l_set_bone_override(lua_State *L)
lua_getfield(L, 3, "rotation");
if (!lua_isnil(L, -1)) {
lua_getfield(L, -1, "vec");
if (!lua_isnil(L, -1))
props.rotation.next = core::quaternion(check_v3f(L, -1));
if (!lua_isnil(L, -1)) {
props.rotation.next_radians = check_v3f(L, -1);
props.rotation.next = core::quaternion(props.rotation.next_radians);
}
lua_pop(L, 1);
read_prop_attrs(props.rotation);
@@ -671,9 +675,9 @@ static void push_bone_override(lua_State *L, const BoneOverride &props)
push_prop("position", props.position, props.position.vector);
v3f euler_rot;
props.rotation.next.toEuler(euler_rot);
push_prop("rotation", props.rotation, euler_rot);
// In order to give modders back the euler angles they passed in,
// this **must not** compute equivalent euler angles from the quaternion
push_prop("rotation", props.rotation, props.rotation.next_radians);
push_prop("scale", props.scale, props.scale.vector);

View File

@@ -426,18 +426,8 @@ int ModApiServer::l_show_formspec(lua_State *L)
NO_MAP_LOCK_REQUIRED;
const char *playername = luaL_checkstring(L, 1);
const char *formname = luaL_checkstring(L, 2);
if (*formname == '\0') {
log_deprecated(L, "Deprecated call to `minetest.show_formspec`:"
"`formname` must not be empty");
}
const char *formspec = luaL_checkstring(L, 3);
if(getServer(L)->showFormspec(playername,formspec,formname))
{
lua_pushboolean(L, true);
}else{
lua_pushboolean(L, false);
}
lua_pushboolean(L, getServer(L)->showFormspec(playername,formspec,formname));
return 1;
}

View File

@@ -262,6 +262,8 @@ void decompressZstd(std::istream &is, std::ostream &os)
is.read(input_buffer, bufsize);
input.size = is.gcount();
input.pos = 0;
if (input.size == 0)
throw SerializationError("decompressZstd: data ended too early");
}
ret = ZSTD_decompressStream(stream.get(), &output, &input);

View File

@@ -1071,6 +1071,8 @@ void Server::Receive(float timeout)
// and a faster server-step is better than busy waiting.
if (remaining_time_us() < 1000.0f)
break;
else
continue;
}
peer_id = pkt.getPeerId();

View File

@@ -55,10 +55,7 @@ const ItemGroupList &UnitSAO::getArmorGroups() const
void UnitSAO::setAnimation(
v2f frame_range, float frame_speed, float frame_blend, bool frame_loop)
{
if (std::tie(m_animation_range, m_animation_speed, m_animation_blend,
m_animation_loop) ==
std::tie(frame_range, frame_speed, frame_blend, frame_loop))
return; // no change
// Note: Always resend (even if parameters are unchanged) to restart animations.
m_animation_range = frame_range;
m_animation_speed = frame_speed;
m_animation_blend = frame_blend;

View File

@@ -46,7 +46,7 @@ struct SkyboxParams
float body_orbit_tilt { INVALID_SKYBOX_TILT };
s16 fog_distance { -1 };
float fog_start { -1.0f };
video::SColor fog_color; // override, only used if alpha > 0
video::SColor fog_color { 0 }; // override, only used if alpha > 0
};
struct SunParams

View File

@@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "SColor.h"
#include <matrix4.h>
#include <cmath>
#include <algorithm>
#define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d)))
#define myfloor(x) ((x) < 0.0 ? (int)(x) - 1 : (int)(x))

View File

@@ -16,20 +16,18 @@ prompt_for() {
}
# Reads current versions
# out: VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_IS_DEV CURRENT_VERSION ANDROID_VERSION_CODE
# out: VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_IS_DEV CURRENT_VERSION
read_versions() {
VERSION_MAJOR=$(grep -oE '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
VERSION_MINOR=$(grep -oE '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
VERSION_PATCH=$(grep -oE '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
VERSION_IS_DEV=$(grep -oE '^set\(DEVELOPMENT_BUILD [A-Z]+\)$' CMakeLists.txt)
ANDROID_VERSION_CODE=$(grep -oE '\("versionCode", [0-9]+\)' android/build.gradle | tr -dC 0-9)
# Make sure they all exist
[ -n "$VERSION_MAJOR" ]
[ -n "$VERSION_MINOR" ]
[ -n "$VERSION_PATCH" ]
[ -n "$VERSION_IS_DEV" ]
[ -n "$ANDROID_VERSION_CODE" ]
if echo "$VERSION_IS_DEV" | grep -q ' TRUE'; then
VERSION_IS_DEV=1
@@ -39,7 +37,6 @@ read_versions() {
CURRENT_VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
echo "Current Minetest version: $CURRENT_VERSION"
echo "Current Android version code: $ANDROID_VERSION_CODE"
}
# Retrieves protocol version from header
@@ -49,18 +46,6 @@ read_proto_ver() {
git show "$ref":src/network/networkprotocol.h | grep -oE 'LATEST_PROTOCOL_VERSION [0-9]+' | tr -dC 0-9
}
## Prompts for new android version code
# in: ANDROID_VERSION_CODE
# out: NEW_ANDROID_VERSION_CODE
bump_android_ver() {
# +1 for ARM and +1 for ARM64 APKs
NEW_ANDROID_VERSION_CODE=$(expr $ANDROID_VERSION_CODE + 2)
NEW_ANDROID_VERSION_CODE=$(prompt_for "Set android version code" '[0-9]+' $NEW_ANDROID_VERSION_CODE)
echo
echo "New android version code: $NEW_ANDROID_VERSION_CODE"
}
## Prompts for new version
# in: VERSION_{MAJOR,MINOR,PATCH} DO_PATCH_REL
# out: NEXT_VERSION NEXT_VERSION_{MAJOR,MINOR,PATCH}
@@ -108,14 +93,6 @@ set_dev_build() {
git add -f CMakeLists.txt android/build.gradle
}
## Writes new android version code
# in: NEW_ANDROID_VERSION_CODE
write_android_version() {
sed -i -re "s/\"versionCode\", [0-9]+/\"versionCode\", $NEW_ANDROID_VERSION_CODE/" android/build.gradle
git add -f android/build.gradle
}
## Writes new version to the right files
# in: NEXT_VERSION NEXT_VERSION_{MAJOR,MINOR,PATCH}
write_new_version() {
@@ -198,8 +175,6 @@ if [ "$DO_PATCH_REL" -eq 0 ]; then
exit 1
fi
bump_android_ver
write_android_version
set_dev_build 0
perform_release "$CURRENT_VERSION"
@@ -212,8 +187,6 @@ if [ "$DO_PATCH_REL" -eq 0 ]; then
else
# On a patch release the version moves from 5.7.0 -> 5.7.1 (new tag)
bump_android_ver
write_android_version
bump_version
write_new_version