Commit Graph

259 Commits

Author SHA1 Message Date
cx384 aaf77025b6 Split up tile.cpp/h 2024-03-03 15:52:05 +01:00
sfan5 6ca214fefc
Introduce `std::string_view` into wider use (#14368) 2024-02-17 15:35:33 +01:00
fuzun 6cbb9193ea
Fix undefined behaviors (#14365)
* Initialize member `floats` in ContentFeatures

* Do not assign big double to u32

* Do not assign negative floating point number to unsigned integer
2024-02-15 11:05:42 +01:00
David Heidelberg eb52a149a0
Enable IPO/LTO by default except for debug builds (#14198)
Test case:

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

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

Also fixes various compiler warnings resulting from compilation using LTO.

---------

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-02-09 00:01:12 +01:00
cx384 5958714309
Tool specific pointing and blocking pointable type (#13992) 2024-01-22 18:27:08 +01:00
cx384 2ea8d9ca11
Fix out of range enum casts in deSerialize functions (#14090) 2024-01-17 20:05:46 +01:00
sfan5 d1a55e9ca4
Remove use_texture_alpha compatibility code for nodeboxes & meshes (#13929) 2023-12-13 13:15:59 +01:00
Desour ec7a1f02e7 Fix out-of-bounds access in NodeDefManager::nodeboxConnects 2023-10-30 21:23:47 +01:00
Desour 1d31533601 Reformat rot array in NodeDefManager::nodeboxConnects, to make it less magic 2023-10-30 21:23:47 +01:00
Gregor Parzefall aea9242a96
Allow nodes to have their post_effect_color affected by lighting (#13637)
Co-authored-by: DS <ds.desour@proton.me>
2023-08-24 20:16:36 +02:00
DS edcbfa31c9
Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Jude Melton-Houghton dafdb3edb4
Check for falling `float` nodes in liquid transform (#12862) 2022-10-18 18:03:05 -04:00
Jude Melton-Houghton 9676364c1f
Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
Wuzzy 3f801bc096
Fix liquid drawtype faces sometimes not rendering (#12807)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-26 19:27:47 -04:00
Wuzzy 1d04903c19
Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
Herman Semenov 038da00e79
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
fluxionary 0ab9bf926d
Fix texture_min_size 2022-08-24 22:38:14 +02:00
SmallJoker 023a1c2427
Textures: introduce world-align overrides (#12540)
Many games do not care about world align textures, however texture packs should have the capabilities to change that if they have suitable textures. This commmit now introduces a node property override for world-align in particular to force a certain scale on the selected override tiles.
2022-08-13 08:52:16 +02:00
SmallJoker 051181fa6e
Enforce limits of settings that could cause buggy behaviour (#12450)
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
2022-07-09 22:32:08 +02:00
SmallJoker a463620edb
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
2022-06-20 21:56:12 +02:00
sfan5 bccaf5fc2d Map opaque waving leaves to allfaces drawtype
fixes #9842
2022-05-29 14:00:19 +02:00
sfan5 8b74257bf3 Reduce size of ContentFeatures structure
On my system this is a reduction from 4664 to 3704 bytes.
This is not for the sake of saving RAM but ensuring
commonly used structures fit into caches better.
2022-05-26 15:49:12 +02:00
Giuseppe Bilotta 23f981c458 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-04-24 21:10:23 +02:00
sfan5 f2d1295fe6 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-03-02 17:49:45 +01:00
pecksin 5d0b18a0d0
Use absolute value for bouncy in collision (#11969)
* use abs(bouncy) in collision
* test case for negative bouncy
* send abs(bouncy) to old clients
2022-02-16 17:06:00 -05:00
SmallJoker b2eb44afc5
Fix NodeDef backwards compatibility to 5.3.0 (#11942)
1. Fixes crashes on older clients when [png is used as base image
2. Fixes liquid type assertion fails on debug builds
2022-01-12 18:49:14 +01:00
Wuzzy d4b89eb106 Fix no_texture.png activation w/ simple leaves 2021-10-22 11:01:42 +02:00
Wuzzy 86b44ecd82
Add no_texture.png as fallback for unspecified textures 2021-10-20 21:50:16 +02:00
Wuzzy 21113ad410
Split liquid_viscosity to liquid_viscosity and move_resistance (#10810) 2021-10-01 16:21:24 +02:00
Loic Blot 48d5abd5be refacto: remove get_gui_env & draw_load_screen from RenderingEngine singleton 2021-05-03 19:49:19 +02:00
Loic Blot 5a02c376ea refacto: RenderingEngine::get_scene_manager() is now not callable from singleton
This permits to make evidence that we have some bad object passing on various code parts. I fixed majority of them to reduce the scope of passed objects

Unfortunately, for some edge cases i should have to expose ISceneManager from client, this should be fixed in the future when our POO will be cleaner client side (we have a mix of rendering and processing in majority of the client objects, it works but it's not clean)
2021-05-03 19:49:19 +02:00
sfan5 f0bad0e2ba
Reserve vectors before pushing and other code quality changes (#11161) 2021-04-05 13:38:31 +02:00
Vitaliy 3b78a22371
Degrotate support for mesh nodes (#7840) 2021-03-30 00:25:11 +02:00
SmallJoker 05719913ac
Schematic: Properly deal with before/after node resolving and document (#11011)
This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration).
Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
2021-03-20 13:02:15 +01:00
sfan5 83229921e5 Rework use_texture_alpha to provide three opaque/clip/blend modes
The change that turns nodeboxes and meshes opaque when possible is kept,
as is the compatibility code that warns modders to adjust their nodedefs.
2021-01-29 17:34:41 +01:00
sfan5 edd8c3c664 Drop never documented 'alpha' property from nodedef
Includes minimal support code for practical reasons.
We'll need it for a slightly different purpose next commit.
2021-01-29 17:34:41 +01:00
Wuzzy 7f25823bd4
Allow "liquid" and "flowingliquid" drawtypes even if liquidtype=none (#10737) 2021-01-21 00:51:24 +01:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
Vitaliy ccbf8029ea
Cleanup shader generation code (#10663)
Shader generation is a mess. This commit cleans some parts up, including dropping remains of HLSL support which was never actually implemented.
2020-12-19 20:57:10 +01:00
Lars ed22260822 Remove all bump mapping and parallax occlusion related code. 2020-10-17 13:09:16 -07:00
SmallJoker 947466ab28 (se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.

Removes unused Wide String serialization functions
2020-10-01 09:52:59 +02:00
sfan5 fff0393187
Render nodeboxes with opaque material if possible (#10122) 2020-08-12 11:52:50 +02:00
Hugues Ross 93ecc589bc
Implement override.txt support for special tiles (#10140)
Add override targets for all special_tiles entries in node definitions, allowing texture packs to replace these textures. This makes overrides work properly with a variety of drawtypes.

The targets are named special1 through special6, covering the the current length of the special_tiles array.
2020-08-04 20:12:47 +02:00
sfan5 c6422e0872
Remove std::shared_ptr use in TileLayer (#10090) 2020-07-10 12:11:44 +02:00
sfan5 0e698e63b3 Fix autoscale_mode segfault if tile doesn't have texture
closes #9965
2020-06-01 21:19:35 +02:00
Vitaliy 82e4137893
Cache liquid alternative IDs (#8053) 2020-05-20 22:52:10 +01:00
Wuzzy c94d37827d
Rework functionality of leveled nodes (#9852)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2020-05-19 21:08:37 +02:00
sfan5 2062c80e21 Allow ObjDefManager instances to be cloned 2020-05-05 19:26:59 +02:00
Hugues Ross 5cf6318117
Refactor texture overrides and add new features (#9600)
* Refactor texture overrides, and add new features:

- Texture overrides can support multiple targets in one line
- Texture override files can have comment lines
- Item images/wield images can be overridden

* Formatting changes

* Address soime feedback

- Pass vectors by const reference
- Log syntax errors as warnings
- Remove 'C' prefix from TextureOverrideSource

* Simplify override target checks with an inline helper function

* make linter happy

* Apply feedback suggestions

Co-Authored-By: rubenwardy <rw@rubenwardy.com>

* Remove remaining != 0 checks

* Update copyright notice

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2020-04-14 20:41:29 +02:00