17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00
Commit Graph

42 Commits

Author SHA1 Message Date
jerrrrycho
adfad8016e refactor(sonar): take read-only string parameters as std::string_view (cpp:S6009)
The Windows messaging helpers keep std::string, they need c_str().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:28:41 +02:00
jerrrrycho
ec8a333753 refactor(sonar): drop const_cast on string literals passed to the Python C API (cpp:S859)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:24:04 +02:00
jerrrrycho
2ba33e8e63 refactor(sonar): use transparent comparators for string-keyed maps (cpp:S6045)
std::unordered_map instances and map types exposed in headers used by
other modules are left as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:21:07 +02:00
jerrrrycho
5d33d89225 refactor(sonar): pass expensive-to-copy parameters by const reference (cpp:S1238)
Signatures declared in files touched by PR 206 (Driver.h, EU07.cpp) and
virtual overrides are left unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:16:40 +02:00
jerrrrycho
0a7c42c4a9 refactor(sonar): take read-only pointer and reference parameters as const (cpp:S995)
TTrain command handlers keep their signature, it is fixed by the handler table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:08:45 +02:00
jerrrrycho
d7edea6fac refactor(sonar): make read-only local references and pointers const (cpp:S5350)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:05:09 +02:00
jerrrrycho
3a6f21eb2d refactor(sonar): initialise members in initialiser lists or declarations (cpp:S3230)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:03:17 +02:00
jerrrrycho
1cc9890197 refactor(sonar): mark converting constructors explicit (cpp:S1709)
sound_source and the gl::object conversion operators stay implicit; they
are relied upon by copy-list-initialisation and GL calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:55:10 +02:00
jerrrrycho
8afb232f2a refactor(sonar): reduce enum qualification with using enum (cpp:S6177)
Applied only where no unqualified name in the block could be captured by
the introduced enumerators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:49:01 +02:00
jerrrrycho
a47c2a6ea0 refactor(sonar): rename locals that shadow outer declarations (cpp:S1117)
Only local variables and definition parameters are renamed; shadowing
struct fields and enumerators in headers are left for a separate change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:45:39 +02:00
jerrrrycho
319815cb0b refactor(sonar): drop top-level const from by-value return types (cpp:S5951)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:29:47 +02:00
jerrrrycho
6445ef728a refactor(sonar): add default cases to switch statements (cpp:S3562)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:22:01 +02:00
jerrrrycho
b6349b76e3 refactor(sonar): use structured bindings for pair access (cpp:S6005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:06:32 +02:00
jerrrrycho
ce786c22ce refactor(sonar): remove dead stores (cpp:S1854)
Side effects (e.g. LISTLINE++) are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:58:05 +02:00
jerrrrycho
5a806223e7 refactor(sonar): document intentionally empty functions (cpp:S1186)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:56:34 +02:00
jerrrrycho
8f89dcefcd refactor(sonar): use auto where the type is spelled out on the right (cpp:S5827)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:52:25 +02:00
jerrrrycho
95bc9bd511 refactor(sonar): use try_emplace for map insertion (cpp:S6030)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:51:29 +02:00
jerrrrycho
9b89a5d887 refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:44:18 +02:00
jerrrrycho
3198cabc78 refactor(sonar): declare non-mutating member functions const (cpp:S5817)
Virtual functions are left untouched so overrides keep matching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:26:48 +02:00
jerrrrycho
1f256e9593 refactor(sonar): mark unused parameters (cpp:S1172)
Unused names are commented out; parameters used only on some platforms
are marked [[maybe_unused]].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:18:45 +02:00
jerrrrycho
8c23c1fe2b refactor(sonar): make narrowing conversions explicit (cpp:S5276)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:16:28 +02:00
jerrrrycho
80464d0bc1 refactor(sonar): construct elements in place with emplace_back (cpp:S6003)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:06:57 +02:00
jerrrrycho
789e391420 refactor(sonar): use std::scoped_lock instead of std::lock_guard (cpp:S5997)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:06:48 +02:00
jerrrrycho
1806f029cc refactor(sonar): use nullptr literal (cpp:S4962)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:05:47 +02:00
jerrrrycho
65ded920d2 refactor(sonar): remove empty statements, one declaration per statement (cpp:S1116, cpp:S1659)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:03:30 +02:00
Mateusz Włodarczyk
fd4c112436 scripting: make CWD-local packages importable in embedded Python
Embedded CPython builds sys.path from PYTHONHOME only. Unlike the python
CLI it does not prepend the working directory, and unlike Windows'
getpathp.c it does not add the executable's directory either, so on POSIX
"from scripts import ..." (the asset-side scripts package used by texture
and screen renderers) fails to import.

Insert "." at the front of sys.path after interpreter init, matching how
the engine resolves every other asset (relative to CWD). Idempotent and
harmless on Windows.
2026-07-06 20:07:08 +02:00
jerrrrycho
d85096f64d reformat: remove redundant parentheses 2026-06-30 21:19:46 +02:00
31bebf6088 Add python fallback for cp1250 characters and utf8 compativility 2026-06-28 02:41:47 +02:00
b46a1d8cbf Change deprecated Py_SetPythonHome to PyConfig 2026-06-27 16:13:54 +02:00
maj00r
3786ecd98f Python 3.14 build and CI updates
Squashes the last five commits: migrate to Python 3.14 (CMake, AppVeyor, Azure, README), vcpkg/setup-ci fixes, CMake adjustments, remove bundled ref/python 2.7, and related scripting/static file updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 18:21:12 +02:00
docentYT
5367cb9940 Merge remote-tracking branch 'upstream/master' into utilities-simplification 2026-05-05 23:08:43 +02:00
docentYT
13c7317f6e Do not allow implicit cast for inline std::string to_string(bool Value) and change to_string to std::string for non boolean values 2026-05-03 15:49:29 +02:00
da67acc993 Potential fix for hanging python threads 2026-05-01 23:35:35 +02:00
docentYT
9c27b54960 Simplify len_common_prefix 2026-05-01 13:57:33 +02:00
jakubg1
5d5264a8f3 Prefix error messages
When a Lua code fails to execute and throws an error, the log line now starts from `lua: Runtime error: `.
2026-04-01 16:06:17 +02:00
jakubg1
3a600334a7 Add an index parameter to lua::get_memcell_values()
We could have done away with it just because the memcell values are always the last parameter. However, this might not always be the case in the future. Also, it's better for consistency reasons.
2026-04-01 02:43:25 +02:00
jakubg1
2a9343149f Fix Lua memcell API
- Fixed the `api.memcell_update` and `api.memcell_update_n` functions to accept the `memcell_values` structure instead of three separate values.
  - Additionally, also fixed the error message for when the memcell is not found.
2026-04-01 02:37:58 +02:00
jakubg1
686cab8184 Fix a segfault when calling api.dynobj_putvalues()
An undocumented change from the previous commit:
- When the Lua script is not able to find an object, the message is now printed to `errors.txt`, not just to `log.txt`.
2026-04-01 02:13:30 +02:00
jakubg1
ca8e4aae71 Refactor Lua bindings to not use FFI anymore
- Lua bindings are no longer using FFI in favor of the "classic" Lua C API.
  - This makes it work properly on native Linux builds.
- Changed the Lua API slightly:
  - Removed the `api.event_preparefunc()` function because it is no longer necessary. Instead, you can pass any function you want without preparing it first.
  - Added an `api.event_exists()` function. Takes a single `name` argument.
  - Any `api.find_*()` functions return `nil` instead of an userdata representing a null pointer when the requested object is not found.
2026-04-01 01:42:54 +02:00
0715437108 Fix include directives 2026-03-14 20:51:11 +01:00
copilot-swe-agent[bot]
7e49aa8740 Rewrite #includes to use explicit subdirectory paths
Co-authored-by: Hirek193 <23196899+Hirek193@users.noreply.github.com>
2026-03-14 19:16:48 +00:00
copilot-swe-agent[bot]
0531086bb9 Reorganize source files into logical subdirectories
Co-authored-by: Hirek193 <23196899+Hirek193@users.noreply.github.com>
2026-03-14 19:01:57 +00:00