Commit Graph

363 Commits (d6e8e83052ab75e8ed0fe8124ae72b689c04d051)

Author SHA1 Message Date
Peter Nelson b85ecf9ac2
Codechange: Replace pointer to Sprite array with reference to SpriteCollection. (#11580)
Add `SpriteLoader::SpriteCollection` type which is an array of `SpriteLoad::Sprite`.

This removes the ambiguity of what `SpriteLoader::Sprite *` is pointing to,
and cleans up mismatches using both dereference -> and array access [] for the
same object.
6 months ago
rubidium42 27082f9efa Codechange: pass std::string references to OpenBrowser 7 months ago
Peter Nelson 1071acb483
Codechange: Redundant use of char * and c_str(). (#11454) 8 months ago
Peter Nelson d4008850e3 Codechange: Ensure function opening `{` is on new line. 8 months ago
Michael Lutz 86e28e79fb Fix #11402: Make string filter locale-aware. 8 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
Rubidium f16399f4c9 Codechange: replace x.size() > 0 with !x.empty() 8 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 8 months ago
Loïc Guilloux 0458c15060
Cleanup: [MacOS] Remove unneeded WITH_SDL checks (#11360) 9 months ago
frosch 55da426d44 Codechange: All ParagraphLayoutFactory::AppendToBuffer assume that the buffer has at least some space.
Assert on that.
9 months ago
frosch 5733145c59 Cleanup: Remove unneeded parameters. 9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
frosch a3f661cb66
Fix: compilation failed on gcc 10.2 due to missing include. (#11300)
'_exit' is defined in 'unistd.h'.
10 months ago
Patric Stout 37e2f99c09
Change: store crash logs in JSON format (#11232) 10 months ago
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 10 months ago
Patric Stout a3d631ffed
Change: make nlohmann a mandatory library to build OpenTTD (#11235) 10 months ago
Patric Stout b0d7cfaa3d
Change: [Win32] don't allocate 192KiB of memory on the stack on crash (#11240)
Heap is out of the question, as it might be corrupted.
Allocating this much on stack is silly.

So instead, allocate virtual pages to write the information in.
10 months ago
Patric Stout d4312c59a4
Codechange: [MacOS] use backtrace() instead of our custom variant (#11233)
As mentioned in the comment, we only did it ourselves as we once
were compatible with versions before 10.5. But that time has long
gone. So let's update the code to a bit more modern approach.
10 months ago
Patric Stout b00e483b0f
Change: recover when possible from crashes during a crash (#11238) 10 months ago
Patric Stout 29a37c2e0b
Change: [Win32] unify the crashlog handler with the other OSes (#11236)
While at it, make the crash text a bit more readable, and sync
this with MacOS.
10 months ago
Patric Stout 45cc3acaf5
Codechange: [Win32] unify AppendDecodedStacktrace and LogStacktrace (#11220)
AppendDecodedStacktrace was already doing the same as LogStacktrace,
just with a different name.
10 months ago
Patric Stout 352ac264a5
Remove: [Win32] module-list from crash.log (#11219)
Only Windows implemented this, and it opens the files to read them
to get a CRC. Doing this in a crash-handler is strange at best.

Lastly, nobody has actually ever used this information to come to
some sort of conclusion. The module-list is used in combination
with the crash.dmp, but this information is already embedded in
there.
10 months ago
Patric Stout f120d2beb8
Add: use breakpad to create crash.dmp on MacOS / Linux too (#11202)
Normally only the Windows platform could create a crash.dmp, making
analysing crash-reports from MacOS / Linux rather tricky.
10 months ago
Patric Stout 8f6df242c4
Remove: [Win32] (pointer-only) stack trace in crash.log (#11211)
It only contains pointers, which nobody can decipher anyway.
So instead, just report "Not supported", like other targets do
when they can't print a sane stack trace.
10 months ago
Patric Stout a5aebeb1b5
Remove: [Win32] register values in crash.log (#11212) 10 months ago
Patric Stout cd10ddf9ae
Remove: last remnants of SunOS (#11210)
We have no evidence SunOS has been tried in the last few years,
and the code is awkward enough to just remove.
11 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
12 months ago
Rubidium d5c75bd655 Codechange: use std::string instead of a temporary buffer for iconv calls 1 year ago
Rubidium 69d5b9d326 Cleanup: unused NO_THREADS #ifdefs 1 year ago
PeterN 8465559488
Codechange: Pass face index as font os_handle for FreeType fonts. (#11073)
This allows fallback font detection to test the specific face within the
font rather instead of only the first.
1 year ago
Rubidium 714ff35e9d Codechange: move to std::string over stredup + free 1 year ago
Rubidium 09f585b772 Codechange: use std::string over stredup+free for splitting font name 1 year ago
Owen Rudge 1a3d1bca59 Remove: OS/2 port 1 year ago
Rubidium b2a8d8aea4 Codechange: use std::string for Windows' ISO code mangling 1 year ago
PeterN f249715db3
Fix #10964: Missing FontConfig format for language. (#10965) 1 year ago
PeterN eda3defcb5
Codechange: Pass language for font detection as std::string. (#10964) 1 year ago
PeterN 7a0b6b7ddf
Codechange: Remove Freetype bits on Win32/OSX. (#10960)
These platforms have their own specific font rendering.
1 year ago
Patric Stout cd751a598a
Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Basically, we haven't been a good neighbour. Turns out you shouldn't
actually call FcFini when you are done, as some library might still
want to use FontConfig. And they use a shared instance for their
administration.

The idea is that you call FcInit once, and use FcConfigReference
after that to get an instance, you can release. This entry is
ref-counted, and things happen automatically based on that.

At least, I think.
1 year ago
Patric Stout 21adfa7567
Fix: track "memory installed" for surveys less precisely (#10910)
It turns out, for Windows and Linux having the exact memory allows
for easy tracing of an individual. That is exactly against the idea
of the survey. And honestly, we don't need this precision.
1 year ago
Rubidium d68b5c9162 Codechange: replace buffer + strecpy with std::string for getting clipboard contents 1 year ago
Rubidium 324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 1 year ago
Rubidium f2e704b9a7 Codechange: use std::string for FiosIsRoot 1 year ago
Rubidium 13789d1703 Codechange: use std::string for FiosIsValidFile 1 year ago
PeterN d086f288cd
Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
1 year ago
Peter Nelson 9976293c1e Codechange: Return fontcache font name as std::string. 1 year ago
PeterN 876871157f
Fix: Ask FontConfig for the face index when opening fonts. (#10878)
This allows selection of the correct face in truetype fonts containing
multiple faces.
1 year ago
Rubidium 30b9e02dd9 Codechange: replace crashlog filenames with std::string in Crashlog 1 year ago
Rubidium 19304bd3d5 Codechange: replace seprintf with fmt::format for filling the crash log data 1 year ago
Rubidium 6f2f38b3ed Codechange: fmt (and std::format) do explicitly not support enums out-of-the-box
That it works for the version we have packaged it pure coincidence, as that is
one of the few versions that due to a bug allow it. So add the appropriate
template specialisations to support it out-of-the-box within OpenTTD.
1 year ago
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 1 year ago