Commit graph

792 commits

Author SHA1 Message Date
alexei-zebra
b5416d1219
Fix the issues found while reviewing the Wayland frame work
A review of the branch turned up a number of defects, gaps and leftovers;
this commit addresses all of them.

Defects:
- the shadow uniform array held seven entries while eight locations were
  written, so the last one landed outside the object;
- CursorShape::LAST stayed in the middle of the enum after the new corner
  shapes were appended, which made the GLFW cursor table read out of
  bounds; the extra shapes are now mapped onto the ones GLFW knows, and
  the table is only filled for those;
- GlStateGuard asked glIsEnabled for an attribute pname, so it always got
  GL_INVALID_ENUM and never restored the vertex attribute arrays;
- the early returns in wayland_window_initialize left the global window
  and input pointers dangling when falling back to GLFW;
- the icon textures were listed nowhere, so none of them ever loaded;
- a shader failure disabled the shadow after the surface had already been
  sized for it, and VOXEL_DECORATIONS outlived the switch cleanup.

Behavior:
- the keyboard now releases every pressed key when it loses focus, and a
  repeat rate of zero means no repeat;
- the fourth UTF-8 lead byte is decoded with the right mask, control
  characters no longer reach text fields, and a vanished clipboard offer
  clears the cached text;
- compositor side decorations disable ours again instead of leaving two
  titles, the window destructor releases the rest of the state, and the
  content inset is computed before the GUI acts so the HUD and the
  container never disagree for a frame; the HUD clamps it;
- the window controls fall back to minimize, maximize and close, and the
  icons are drawn from textures only.

Cleanups: one monotonic timer instead of three, one vertex shader shared
by both renderers with a link check, one button layout parser, the inset
rule moved into Screen, the scissor stack moved into the base Window
(about 110 duplicated lines), named shadow and evdev constants, trimmed
includes, a README note about the Wayland dependencies, and the long
lines introduced by this branch wrapped.
2026-10-10 12:23:42 +03:00
alexei-zebra
6c2192b5d8
Draw the window title bar by the engine
The native Wayland backend had no window controls: no title, no close
button, no way to move or resize the window, and the fullscreen toggle
could throw the window to another monitor. GNOME does not implement
zxdg_decoration_manager_v1, so there is nobody to draw a frame for us:
the backend now falls back to its own decorations when the compositor
offers no server side ones, and the engine draws the visible part.

The bar itself is drawn by the engine (WindowBar.cpp) through the usual
batch and font, so it uses the same assets as the rest of the UI and the
backend only owns the behaviour: hit zones, cursor shapes, click
interception and the xdg-shell requests. Its geometry follows the
desktop's button layout, read and subscribed through
xdg-desktop-portal over sd-bus (libsystemd is an optional dependency,
gsettings is only a startup fallback).

Controls behave like they do elsewhere:
- pressing anywhere on the bar starts a move once the pointer leaves a
  5 px radius, so dragging works from the buttons as well;
- a button acts on release, only if the pointer stayed on it;
- a double click on the bar toggles maximize;
- the top edge and the top corners resize, the top 8 px of the sides,
  the sides and the bottom are 8 px wide resize strips;
- right and middle clicks and the scroll wheel over the bar never reach
  the game.

The in-game user interface is offset below the bar while menus keep the
whole window, so the translucent bar shows the menu background through
itself and never covers the HUD. The HUD lays its elements out against
the content height and the cursor is translated once, which fixes items
following the mouse one row above the pointer in game.

The window size is now written to the settings when the window is
resized in windowed mode and applied on the first configure, so the
window opens with the size it was left with, and leaving fullscreen or
borderless mode restores it instead of overwriting the settings with the
fullscreen size (an unconditional unmaximize made the compositor restore
the maximized geometry).

Measured: menu layout unchanged (706 bright pixels in the same place),
gui viewport 1123x751 in menus against 1123x721 in game, 1123x751 ->
2560x1080 -> 1123x751 round trip keeps the settings, a saved 1000x640
opens as 1000x640, no errors in the log.
2026-10-10 12:23:41 +03:00
MihailRis
5060a8635d fix locked cursor if world was closed with menu hidden 2026-10-07 23:09:40 +03:00
zaveshaa
515e27b402 fix typos in comments and log messages 2026-08-29 19:47:01 +03:00
Neveix
3b3bf8e878
Inventory enhancements #897: 2, 5, 9, 11, 12 (#931)
* implement a bit

* change shift to ctrl

* add enhancement #2

* add ctrl-interaction with content access

* fix libinventory.move bug (none checking)

* fix p.5

* move shareinv logic into inventory_utils

* add inventory utils

* small refactor

* fix iframe.src = ""

---------

Co-authored-by: MihailRis <mexaruc@gmail.com>
2026-08-14 21:25:42 +03:00
neveix
953a920e00 add middleclick item dropping/duping 2026-08-14 01:14:54 +05:00
neveix
c2f7f33bbf revert creation of clickOutside 2026-08-14 00:59:55 +05:00
neveix
7c97966377 switch to inventory drop area 2026-08-14 00:43:40 +05:00
MihailRis
61b601f95a Merge branch 'main' into refactor-world-renderer 2026-08-02 20:05:42 +03:00
MihailRis
53a9d47905 Merge branch 'environments' into refactor-world-renderer 2026-07-26 23:56:40 +03:00
MihailRis
e0be7a8d8c fix custom model blocks render (with some conditions) 2026-07-26 21:46:03 +03:00
MihailRis
c73b036099 cleanup World references 2026-06-20 22:17:27 +03:00
MihailRis
ac00c561ee move weather from WorldRenderer to LevelFrontend 2026-06-19 00:01:45 +03:00
MihailRis
22f09d3659 start splitting render pipelines & remove the obsolete world fog parameter 2026-06-19 00:01:14 +03:00
MihailRis
089bcbbb64 fix document events & breaking: document events removed from 'events' library temporary 2026-06-03 21:50:36 +03:00
MihailRis
bb135d33b5 add on_destroy layout event 2026-06-02 23:57:22 +03:00
MihailRis
025e32eec1
Merge pull request #843 from MihailRis/common-vc-funcs
new functions and settings
2026-06-01 00:27:11 +03:00
MihailRis
b1974405c6 fix gui.load_document environment extension 2026-05-31 22:09:14 +03:00
clasher113
e6ac30143c particles fix 2026-05-29 11:28:08 +03:00
MihailRis
91b14f4264 fix LevelScreen::saveWorldPreview 2026-04-11 19:11:46 +03:00
Xertis
e049f4ae0c
Merge branch 'MihailRis:main' into main 2026-03-16 00:54:38 +03:00
MihailRis
dbc7cd56bd feat: solid entity material support & minor refactor 2026-03-05 20:52:45 +03:00
Xertis
8e2d915dd7
Merge branch 'MihailRis:main' into main 2026-03-02 20:48:35 +03:00
ChancellorIkseew
cb2b901985
PlayerContoroller and LevelScreen refactoring (#806) 2026-03-02 01:18:47 +03:00
Xertis
9ad21460a2 added hud.is_player_inventory_open 2026-02-28 22:34:52 +03:00
Xertis
cb1b113181 added hud.get_second_inventory 2026-02-28 22:23:47 +03:00
clasher113
0cc8c70a17 fix blocks variants 2026-02-28 15:59:04 +02:00
MihailRis
8ee2edef5c update gui.create_frame return value 2026-02-06 17:55:57 +03:00
MihailRis
8468ab184d add gui.get_active_frame, set_active_frame & update cursor lock behavior 2026-02-06 14:16:30 +03:00
MihailRis
2475a7e8f5 cleanup 2026-02-03 14:00:58 +03:00
MihailRis
5380bcf013 refactor world renderer a bit 2026-02-02 22:40:54 +03:00
MihailRis
b2df0a7e91 Merge branch 'main' into volume-renderer 2026-01-18 22:53:07 +03:00
MihailRis
42c4716be2 change: skeletons are assets now, not content units 2026-01-16 01:01:15 +03:00
MihailRis
b8bf249d1b Merge branch 'main' into volume-renderer 2025-12-28 20:05:13 +03:00
clasher113
dba10805f8 fix: inventory interaction on "disablePlayerInventory = true" 2025-12-28 18:01:02 +02:00
clasher113
a1549983f8 Revert "fix: inventory interaction on "disablePlayerInventory = true""
This reverts commit a58ec5a29c.
2025-12-28 17:58:12 +02:00
clasher113
a58ec5a29c fix: inventory interaction on "disablePlayerInventory = true" 2025-12-28 17:08:06 +02:00
MihailRis
d14f5d6dfd Merge branch 'main' into volume-renderer 2025-12-25 21:08:57 +03:00
MihailRis
52a7449ee9 update fps display refresh interval & reduce memory allocations 2025-12-25 20:52:18 +03:00
alexei-zebra
4026c5bd41 fix: debug panel: set specific length for drawCallsStr 2025-12-24 23:03:53 +03:00
alexei-zebra
dc309c5fb3 update: debug panel: change avg calc method to fps 2025-12-24 22:54:40 +03:00
alexei-zebra
881253708c update: debug panel: draw calls 2025-12-24 01:13:17 +03:00
alexei-zebra
ecbccd4b54 fix: debug panel 2025-12-23 22:12:58 +03:00
alexei-zebra
21815a4fab fix: debug panel 2025-12-23 22:10:54 +03:00
alexei-zebra
36efc9aa49 remove: debug panel: fpsAvgFast 2025-12-23 22:07:12 +03:00
alexei-zebra
84462643ac update: move back avg consts 2025-12-23 22:05:17 +03:00
alexei-zebra
bb885acb7f add: debug panel: draw-calls avg/min/max 2025-12-23 18:31:10 +03:00
alexei-zebra
976a9ff350 update: move avg consts into constants 2025-12-23 18:22:14 +03:00
alexei-zebra
79e46a1017 update: debug panel: smooth min/max fps 2025-12-23 18:04:04 +03:00
alexei-zebra
60f2ad2323 add: debug panel: fps avg 2025-12-23 17:59:29 +03:00