Commit Graph

125 Commits

Author SHA1 Message Date
AnyOldName3 372e5aa5f8 Format 2025-09-24 00:01:52 +01:00
AnyOldName3 b6f699d513 First batch of GCC/Ubuntu 24.04 warnings 2025-09-23 00:14:53 +01:00
Evil Eye f7292680d6 Fix most conversion warnings in components 2025-09-18 22:00:55 +02:00
elsid d121b606b6
Fix and enforce local variable naming 2025-08-05 21:27:48 +02:00
psi29a 2ffc44c31f Merge branch 'filenameexceptions' into 'master'
Remove file name naming convention check exceptions (#7249)

Closes #7249

See merge request OpenMW/openmw!4551
2025-07-01 20:45:33 +00:00
AnyOldName3 a5a6f33578 Manual reformatting that wasn't done automatically on my machine 2025-04-11 17:41:40 +01:00
AnyOldName3 d74a0edb82 Format 2025-04-11 17:37:55 +01:00
AnyOldName3 396cd1c727 Fix Windows Debug build
This was a regression from https://gitlab.com/OpenMW/openmw/-/merge_requests/4596

Also move more things into the anonymous namespace because there's not really a reason not to and I had to rearrange things anyway.
2025-04-11 17:33:19 +01:00
elsid 51258662b5
Support max log level for Recast via env variable
Do not write to log if log message level is greater than one speficied
in the OPENMW_RECAST_MAX_LOG_LEVEL env variable. Use Error by default.
2025-03-21 15:34:47 +01:00
Alexei Kotov fc850cfe69 Rename components/crashcatcher files to follow naming conventions 2025-02-23 00:18:07 +03:00
AnyOldName3 95a1183ad3 Fix OpenGL debug groups 2024-09-25 16:10:18 +01:00
elsid 6a67263d6b
Separate the log level and the flag for writing the log level 2024-07-13 11:15:34 +02:00
elsid 98a8dcbdbf
Limit log buffer size 2024-07-13 11:15:34 +02:00
elsid c83acac32c
Add a function to get debug level 2024-07-13 11:15:34 +02:00
elsid 0749cc4dac
Remove unused include 2024-07-13 11:15:34 +02:00
elsid 1bdc01273e
Move "debugging" function into Debug namespace 2024-07-13 11:15:33 +02:00
elsid ea84d1ce0c
Remove unused mode argument 2024-07-13 11:14:56 +02:00
elsid 89bb04e8fd
Exit with fatal error on duplicated instruction code
Instead of causing SIGABRT which is more confusing.
2024-06-28 22:24:24 +02:00
elsid 38f0533bcf
Write to log file records captured before configs are loaded 2024-05-13 01:17:26 +02:00
elsid 4ab5871dc4
Split Tee logic into different types 2024-05-13 01:17:24 +02:00
AnyOldName3 83e3718bed . c l a n g - f o r m a t 2024-04-16 13:14:36 +01:00
AnyOldName3 61364c874f Warn future me off wasting their time again 2024-04-16 01:14:20 +01:00
AnyOldName3 a7021bf9cc Clear std stream errors when reopening
Prior errors are no longer relevant.

Shouldn't make a difference unless you've tried printing something before the streams were set up.
2024-04-16 01:10:39 +01:00
AnyOldName3 1930bfeabb Support coloured terminal output on Windows
First try the modern Windowsy way, where we can directly query if escape sequences will be processed.
The function is available as far back as Windows 2000, but it just won't return the right flag until the Windows version is new enough.

If that fails, fall back to the Unixy way, as not all colour-supporting terminal emulators for Windows use the Win32 API to declare that capability.
The implementation isn't identical as isatty wasn't available without adding more headers, and we already have Windows.h in this file, so I might as well use the Win32 API instead of its POSIX-compatibility layer.
2024-04-13 17:09:48 +01:00
AnyOldName3 9638fbabb4 https://www.youtube.com/watch?v=2_6U9gkQeqY 2024-03-15 00:11:19 +00:00
AnyOldName3 ff3ffa13b6 Auto format 2024-03-14 23:54:22 +00:00
AnyOldName3 28131fd62b Fixes for a whole bunch of warnings
These warnings were always enabled, but we didn't see them due to https://gitlab.com/OpenMW/openmw/-/issues/7882.
I do not fully understand the cause of 7822 as I can't repro it in a minimal CMake project.

Some of these fixes are thought through.
Some are sensible best guesses.
Some are kind of a stab in the dark as I don't know whether there was a
possible bug the warning was telling me about that I've done nothing to
help by introducing a static_cast.

Nearly all of these warnings were about some kind of narrowing
conversion, so I'm not sure why they weren't firing with GCC and Clang,
which have -Wall -Wextra -pedantic set, which should imply -Wnarrowing,
and they can't have been affected by 7882.

There were also some warnings being triggered from Boost code.
The vast majority of library headers that do questionable things weren't
firing warnings off, but for some reason, /external:I wasn't putting
these Boost headers into external mode.

We need these warnings dealt with one way or another so we can switch
the default Windows CI from MSBuild (which doesn't do ccache) to Ninja
(which does).
I have the necessary magic for that on a branch, but the branch won't
build because of these warnings.
2024-03-14 23:39:33 +00:00
Andrei Kortunov fc1f244627 Add missing initialization 2024-02-23 17:01:59 +04:00
Alexei Kotov d9ee54ae98 DebugCustomDraw: Correct PerContextProgram use, clean up drawImplementation 2024-02-16 14:43:16 +03:00
Alexei Kotov 4df62d53db Fix OSG boilerplate macro for DebugCustomDraw 2024-02-10 01:25:15 +03:00
Alexei Kotov 6a96cdaa31 Make DebugDrawer a Node 2024-02-09 22:16:46 +03:00
Alexei Kotov 9531b6983a Don't reallocate debug line primitives 2024-02-09 22:16:32 +03:00
Alexei Kotov f9498e6ea4 Make DebugDrawer a LightManager child, don't use VAO for lines
Fixes terrain lighting but currently breaks non-line primitive rendering in exteriors
2024-02-09 20:50:33 +03:00
Alexei Kotov 38ab09a52e Try to uncursify DebugDrawer scene representation 2024-02-09 20:49:40 +03:00
elsid 55501a02c0
Define only one crashCatcherInstall function 2024-01-19 21:00:32 +01:00
AnyOldName3 2ed584428c Add missing headers to components/CMakeLists.txt
Otherwise, they won't show up as part of the project in IDEs.
2023-10-15 15:44:24 +01:00
psi29a c86eecb2ea Merge branch 'movable_objects' into 'master'
Move objects instead of copying where possible

See merge request OpenMW/openmw!3289
2023-08-01 10:43:44 +00:00
Andrei Kortunov 35561450f1 Do not copy osg::ref_ptr when possible 2023-07-31 20:43:46 +04:00
elsid 798f3cc385
Support ESM4 record FullName, CellFlags, X, Y fields by esmtool 2023-07-30 18:20:10 +02:00
AnyOldName3 1bdcb5d6d9 Share the dump directory for crash and freeze dumps
This means the shared memory struct is just 255 bytes longer than a few
commits ago instead of 32K.

Also introduce a function for putting path strings in the shared memory
as there was too much copied and pasted code and it was error-prone.

Also free some handles once we're done with them so they don't leak.
2023-07-11 22:22:26 +01:00
AnyOldName3 48368f79b6 Update Windows crash dump path once we know where we're logging
Manual rewrite of 5102f4b11d
2023-07-05 20:38:46 +01:00
AnyOldName3 72d99237e3 This would never have happened had clang format not tried making this function wrogn in the first place 2023-07-05 20:34:34 +01:00
AnyOldName3 1bcbc4f53f Undo clang format change because clang format in CI disagrees with clang format on my computer 2023-07-05 20:29:18 +01:00
AnyOldName3 3bb3f58c73 Don't put crash dumps in Temp on Windows
Well... unless we fail to get the user profile directory.

Also put freeze dumps in a more appropriately-named file.

Discussed in https://gitlab.com/OpenMW/openmw/-/issues/7455

Manual rewrite of c21695c951

As well as that, I found a bug where the crash dump path was being converted from a std::filesystem::path to a utf8-encoded std::string, then passed to the crash catcher, which converted it to a std::filesystem::path implicitly, but using the system eight-bit code page, which wouldn't usually be UTF-8. That's now fixed by passing the function that expects a path a path instead of a string.
2023-07-05 20:25:22 +01:00
Shi Han a90e3b8c3b Move from std::atoi to std::from_char 2023-03-18 09:30:48 +00:00
Cody Glassman ac4787aeec shade refactor 2023-02-25 11:03:39 -08:00
elsid 627bed09ee
Remove redundant operator<< overloads from Log 2023-02-06 21:18:35 +01:00
Andrei Kortunov 8925f854e7 Fix non-ASCII path logging 2023-02-06 15:12:24 +04:00
elsid c44bc5ade5
Setup logging with properly initialized configuration manager
Default constructed instance may provide different paths from initialized one.
2023-01-30 09:30:55 +01:00
elsid 007ad4e4d1
Write crash log to temporary directory
To make sure current user has rights to do so.
2023-01-30 09:30:55 +01:00