Commit graph

3 commits

Author SHA1 Message Date
Vadim Peretokin
b6738dd8c2
infrastructure: Apply clang-format to all CPP files (#8804)
#### Brief overview of PR changes/additions
Ran clang-format on all 134 CPP files in src/ using the project's
.clang-format config

#### Motivation for adding to Mudlet
Ensures consistent code formatting across the codebase.

#### Other info (issues closed, discussion etc)
None

**Test case:** Build the project and verify it compiles successfully.
2026-01-19 18:10:44 +01:00
Vadim Peretokin
745c4a5b59
Infrastructure: Remove else-after-return anti-pattern (#8575)
<!-- Keep the title short & concise so anyone non-technical can
understand it,
     the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Remove unnecessary else blocks following return statements throughout
the codebase.
#### Motivation for adding to Mudlet
Better code readability 
#### Other info (issues closed, discussion etc)
Other anti patterns are visible in this PR thanks to this, but let's
keep this PR focused on one pattern only.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-25 18:10:28 +01:00
Vadim Peretokin
387fb0bd9b
Improve: add a new, experimental 3D mapper (#8087)
<!-- Keep the title short & concise so anyone non-technical can
understand it,
     the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
This adds an experimental, new 3D mapper that uses shaders, more modern
openGL, and a far better code reorganization that makes it an easier
foundation to build upon.

The new 3D mapper is here side by side with the original and can be
toggled on for experimentation. There's a lot of work to be done, so I'd
rather merge it early instead of making a mega-PR.
#### Motivation for adding to Mudlet
So we have a new foundation to build upon and improve.
#### Other info (issues closed, discussion etc)
Old and new mapper can be toggled dynamically with:
```lua
-- this can be a keybinding
setConfig("experiment.3dmap.modernmapper", not getConfig("experiment.3dmap.modernmapper"))
```

Smooth movement is one experiment in the new mapper, and it can be
enabled with:
```lua
lua setConfig("experiment.rendering.smooth-camera", true)
```

As you notice an experiments system has been added so we can implement
things at once and experiment to choose the one that works best. This
system can be used in other places in Mudlet as well.

<details><summary>Details</summary>
<p>

 ## Experiments System

  ### Overview
Allows enabling/disabling experimental features via
`setConfig`/`getConfig` with validation against a predefined
  whitelist.

  ### Usage
  ```lua
  -- Enable experiment
  setConfig("experiment.rendering.more-transparent", true)

  -- Check if enabled
local enabled = getConfig("experiment.rendering.more-transparent") --
returns true/false

  -- Get active experiment in group
local active = getConfig("experiment.rendering.active") -- returns
"more-transparent"

  -- List all valid experiments
local experiments = getConfig("experiment.list") -- returns table of
valid keys
```

### Behavior

  - Grouped experiments: Mutually exclusive (enabling one disables others in same group)
  - Validation: Only predefined experiments allowed, invalid keys return errors
  - Persistence: Experiment states saved/loaded with profiles


  ### Adding New Experiments

  Edit Host::mValidExperiments in src/Host.cpp:
```cpp
  const QSet<QString> Host::mValidExperiments = {
      qsl("experiment.rendering.originalish"),
      qsl("experiment.rendering.more-transparent"),
      qsl("experiment.newfeature.option1"),  // Add here
  };
```

  ### Current Experiments

  - experiment.rendering.originalish
  - experiment.rendering.more-transparent


</p>
</details>

---------

Co-authored-by: Vadim Peretokin <vadi2@users.noreply.github.com>
2025-08-29 12:15:48 +02:00