Commit Graph

155 Commits

Author SHA1 Message Date
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 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
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
Peter Nelson 9976293c1e Codechange: Return fontcache font name as std::string. 2023-05-27 20:40:25 +01:00
Rubidium 30b9e02dd9 Codechange: replace crashlog filenames with std::string in Crashlog 2023-05-25 05:42:10 +02:00
Rubidium 19304bd3d5 Codechange: replace seprintf with fmt::format for filling the crash log data 2023-05-25 05:42:10 +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 0850193a38
Fix: survey result on crash only worked on Linux (#10855)
Every OS-specific crashlog handler has their own MakeCrashLog
in some form. In result, only Linux was calling the generic one.
2023-05-21 12:57:32 +02:00
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01: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
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +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 c829930440 Codechange: replace strnatcmp with C++ string capable version 2023-04-29 12:07:45 +02:00
Rubidium f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
Rubidium f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01: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
PeterN 2376112c77
Fix #10477: Not enough space for text due to rounding down (OSX) (#10489) 2023-02-18 05:50:20 -05:00
Rubidium d51d08ddcb Codechange: put stack variables in global variables for gamelog/crashlog 2023-01-28 17:23:30 +01:00
Rubidium b951332def Codechange: use smart pointers when creating StringIterators 2023-01-13 21:09:40 +01:00
Rubidium 752cd5c0da Cleanup 84b71f7: remove G5 detector as it's not referenced anymore
The last supported Mac OS X for G5 is 10.5.8 and support for < 10.7 has already been removed.
2023-01-04 22:42:23 +01:00
glx22 af3df959c2 Codechange: reduce code duplication 2022-12-23 23:23:03 +01:00
Peter Nelson daaa058493 Change: Vertically centre sprite font relative to TrueType font. 2022-12-18 11:46:01 -05:00
Peter Nelson 8599041ce4 Fix: GetDefaultFontHeight() is static, don't use -> 2022-12-18 11:46:01 -05:00
Peter Nelson 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2022-11-12 18:28:39 +00:00
Peter Nelson 062ea68422 Change: Scale position of font shadow. 2022-11-12 18:28:39 +00:00
Peter Nelson 2cdd8b7429 Change: Separate fontcache implementations. 2022-09-25 18:34:24 +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
glx22 b6c5f49379 Change: add a timestamp in name of crash files 2022-02-02 21:32:01 +01:00
Danny de Bruijne 753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 2021-09-23 21:03:00 +02:00
Michael Lutz 0d5d3083bd Codechange: [OSX] Use more exact enum names where introduced with the 10.12 SDK.
The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.
2021-06-22 21:09:37 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Patric Stout bcd7a7aafe
Codechange: rename _SQ64 into POINTER_IS_64BIT (#9313) 2021-05-30 10:40:03 +02:00
rubidium42 77330d09fd Codechange: move font settings to std::string 2021-05-13 23:13:17 +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 6776229047 Codechange: Make the simple Malloc sprite allocator globally usable. 2021-02-22 22:16:07 +01:00
Michael Lutz 70aa3b4011 Codechange: Give sprite encoders a hint which colour components of a sprite are filled with useful information. 2021-02-22 22:16:07 +01:00
Michael Lutz b66e977acd Change: [OSX] When auto-detecting a font, try for sans-serif first.
On a display, especially with small fonts or low pixel sizes, sans-serif
fonts are usually easier to read than serif fonts.
2021-02-14 11:48:58 +01:00
Michael Lutz 6755ff63e1 Add: [OSX] Native font rendering without using FreeType. 2021-02-14 11:48:58 +01:00
Michael Lutz 23389e9491 Remove: [OSX] Startup splash screen.
It wasn't displayed anyway as it was never copied to the bundle.
2021-02-13 22:21:17 +01:00
Michael Lutz f2294851e6 Codechange: [OSX] Move OSX-specific font code to a separate file. 2021-02-13 20:09:14 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Michael Lutz 6ad5489d01 Codechange: [OSX] Silence some annoying warnings. 2021-01-03 13:25:32 +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
Michael Lutz 8c24b2b6ce Fix: [OSX] Fonts loaded directly from a file have to be registered with CoreText for proper text layout. 2021-01-03 01:00:28 +01:00