Commit Graph

84 Commits

Author SHA1 Message Date
Patric Stout 37e2f99c09
Change: store crash logs in JSON format (#11232) 2023-09-14 20:13:27 +02:00
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 2023-09-13 16:11:34 +02:00
Patric Stout a3d631ffed
Change: make nlohmann a mandatory library to build OpenTTD (#11235) 2023-08-28 19:04:36 +02:00
Patric Stout b00e483b0f
Change: recover when possible from crashes during a crash (#11238) 2023-08-27 21:54:05 +02:00
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.
2023-08-20 17:16:08 +02:00
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.
2023-08-19 00:52:58 +02:00
Rubidium d5c75bd655 Codechange: use std::string instead of a temporary buffer for iconv calls 2023-06-30 19:15:21 +02:00
Rubidium 69d5b9d326 Cleanup: unused NO_THREADS #ifdefs 2023-06-28 19:07:10 +02:00
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.
2023-06-27 12:30:46 +01:00
Rubidium 09f585b772 Codechange: use std::string over stredup+free for splitting font name 2023-06-18 18:32:20 +02:00
Owen Rudge 1a3d1bca59 Remove: OS/2 port 2023-06-16 14:29:14 +01:00
PeterN f249715db3
Fix #10964: Missing FontConfig format for language. (#10965) 2023-06-06 22:38:11 +00:00
PeterN eda3defcb5
Codechange: Pass language for font detection as std::string. (#10964) 2023-06-06 20:55:56 +00:00
PeterN 7a0b6b7ddf
Codechange: Remove Freetype bits on Win32/OSX. (#10960)
These platforms have their own specific font rendering.
2023-06-06 19:43:27 +01:00
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.
2023-06-03 19:09:02 +00:00
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.
2023-06-03 19:07:56 +00:00
Rubidium d68b5c9162 Codechange: replace buffer + strecpy with std::string for getting clipboard contents 2023-06-03 20:14:33 +02:00
Rubidium 324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 2023-05-31 10:56:33 +02:00
Rubidium f2e704b9a7 Codechange: use std::string for FiosIsRoot 2023-05-31 10:56:33 +02:00
Rubidium 13789d1703 Codechange: use std::string for FiosIsValidFile 2023-05-31 10:56:33 +02:00
PeterN d086f288cd
Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
2023-05-29 14:29:00 +01:00
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.
2023-05-26 18:56:13 +00:00
Rubidium 19304bd3d5 Codechange: replace seprintf with fmt::format for filling the crash log data 2023-05-25 05:42:10 +02:00
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.
2023-05-22 14:42:18 +02:00
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Rubidium c518293135 Codechange: replace printf with fmt::print 2023-05-21 15:12:02 +02:00
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
2023-05-14 23:22:02 +02:00
Peter Nelson 00bf42353a Codechange: Place gamelog into its own class, along with internal data.
Data is now stored in vectors to avoid manual memory management and
passing lengths around.
2023-05-02 19:47:55 +01:00
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Rubidium f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
Rubidium 9b56505fec Codechange: split building into a library and executable 2023-04-16 18:58:21 +02:00
Rubidium 9e89eb5726 Codechange: move main function(s) to separate files 2023-04-16 18:58:21 +02:00
Rubidium d51d08ddcb Codechange: put stack variables in global variables for gamelog/crashlog 2023-01-28 17:23:30 +01:00
Peter Nelson f6ad8e1c9c Change: Rename some freetype things to fontcache.
The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
2022-09-25 18:34:24 +01:00
Rubidium f904aef176 Cleanup: use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Patric Stout ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 2021-04-07 09:31:47 +02:00
Michael Lutz 13011e00c6 Fix #8860: [Win32] Crashlog window wasn't reliably shown for crashes not on the main thread. 2021-03-13 22:09:05 +01:00
Michael Lutz 63ed3f3575 Codechange: Move Fontconfig-specific code to a seperate file. 2021-02-13 20:09:14 +01:00
embeddedt 6c8f2227cd
Fix: [Emscripten] open links in browser (#8655) 2021-02-08 19:18:30 +01:00
Michael Lutz 9ccef816f9 Codechange: [OSX] Re-arrange the OSX video driver code by combining all drawing code and moving the window/event handling to a different file.
This is just a code move/rename, not a functionality change.
2021-01-03 13:25:32 +01:00
TechGeekNZ 716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
2020-07-03 09:08:46 +02:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
LCD 47 7f693ce497 Fix: [SDL2] support pasting from clipboard on Linux 2020-02-15 19:38:25 +00:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz 967b27a2c1 Codechange: C++11 STL has a function for getting the number of CPU cores. 2019-04-06 11:27:39 +02:00
Michael Lutz ae748166d0 Codechange: Use platform independent C++11 function for sleeping on a thread. 2019-04-06 11:27:39 +02:00
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00