1
0
Fork 0
Commit Graph

57 Commits (5d026ef1185bfb7b796fee2fe6bd997d5eea2e74)

Author SHA1 Message Date
Peter Nelson 5d026ef118
Codechange: Use parameterised GetString() for framerate window. (#13688) 2025-03-01 22:17:48 +00:00
Rubidium 0afae7c546 Codechange: explicitly initialise member variables of Windows 2025-02-23 14:53:42 +01:00
Rubidium 8f72a478f0 Codechange: change 'return existing window' to a template parameter
This change is made to make it possible to pass arbitrary other parameters
to the constructor of the window instances.
2025-02-02 15:57:18 +01:00
Peter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson b653f875b0
Codechange: Space between `template` and `<` (#13278)
Make it all consistent so it matches CODINGSTYLE.
2025-01-04 17:56:14 +00:00
Rubidium ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidium 3196e0709d Codechange: replace internal SetDataTips with appropriate variants 2025-01-03 11:09:49 +01:00
Rubidium 4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Peter Nelson 448d6ede4a
Codechange: Use STR_NULL (or {}) instead of literal 0. (#13222) 2025-01-01 20:17:20 +00:00
Peter Nelson 98e980c478
Codechange: WWT_TEXT, WWT_LABEL and WWT_EMPTY don't use colour. (#13218)
Set colour for these widget types to INVALID_COLOUR to avoid giving the impression that the colour has a purpose.

A runtime exception is added to catch this the existing widget unit test.
2025-01-01 15:38:19 +00:00
Peter Nelson 8b00661b22 Change: Add sound memory usage to framerate window. 2024-12-06 18:41:35 +00:00
Peter Nelson 333e8e590e
Codefix: Don't assume 9 is the widest digit (#12870)
Use `SetDParamMaxDigit()` instead of `SetDParam()` with a large number.
2024-07-19 19:00:21 +01:00
Peter Nelson 55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
Peter Nelson 4cf6d1dd79
Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
Peter Nelson f267b37a33
Codechange: Use std::initializer_list/array in framerate window. (#12441) 2024-04-19 22:07:56 +01:00
Peter Nelson de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00
Peter Nelson 830c9e2de8 Codechange: Simplify iteration of framerate performance elements. 2024-04-06 19:28:51 +01:00
Rubidium d09b5aaeba Codechange: use int32_t instead of uint16_t for scroll bar position/size/capacity 2024-03-24 08:30:38 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Jonathan G Rennison fd0528a9b4 Fix: Excessive switching of horizontal scale for FPS graph 60 Hz categories 2024-01-17 06:34:17 +01:00
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
2023-12-30 00:23:57 +00:00
Peter Nelson c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
2023-11-21 19:04:24 +00:00
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
Peter Nelson f78c2c9810 Fix: Incorrect title on framerate windows for AIs. 2023-10-25 19:35:42 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Peter Nelson e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
2023-09-04 10:20:45 +01:00
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
2023-07-19 19:30:14 +02:00
Rubidium 55dfca1936 Codechange: replace seprintf with C++ style formatting 2023-06-05 23:25:59 +02:00
Rubidium ab51175db2 Codechange: use std::string for script config 2023-05-14 22:54:10 +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 0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
2023-04-15 13:58:55 +02:00
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Jonathan G Rennison 64b437fa89 Fix: Data race with mixer thread performance measurements 2022-11-11 23:48:24 +01:00
Niels Martin Hansen 5a0dd7e322 Fix #9971: Don't assert that time moves forward 2022-08-27 22:59:36 +02:00
Niels Martin Hansen 4253db28fa Fix #9972: Add some missing fill/resize flags on Framerate window widgets 2022-08-27 22:20:01 +02:00
rubidium42 eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
2021-06-13 15:25:31 +02:00
rubidium42 de49727ae8 Change: not performing a command is worthy of an error, not a warning
If a command cannot be executed for whatever reason, it makes no sense to call it a warning. Something has been done wrong.
Also make writing of these error message consistent while changing their "type".
2021-06-13 15:25:31 +02:00
Peter Nelson 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
Charles Pigott 64686b53ff Change: Zero out the gameloop timers when the game is paused 2021-03-01 21:55:51 +00:00
Charles Pigott ef5cea0e06 Change: De-limit framerate window's framerate 2021-03-01 21:55:51 +00:00
Patric Stout fa170b9ace Feature: configurable refresh-rate and change default to 60fps
Most modern games run on 60 fps, and for good reason. This gives
a much smoother experiences.

As some people have monitors that can do 144Hz or even 240Hz, allow
people to configure the refresh rate. Of course, the higher you
set the value, the more time the game spends on drawing pixels
instead of simulating the game, which has an effect on simulation
speed.

The simulation will still always run at 33.33 fps, and is not
influences by this setting.
2021-02-19 10:43:15 +01:00
Patric Stout 7bdb2e79ed
Fix: framerate window showed a slightly higher rate than actually measured (#8682)
The first point was counted, but also initialized as "last". As
such, it didn't add to "total", but did add to "count", which made
the "count" 1 more than the total actually represents.
2021-02-16 20:37:58 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Niels Martin Hansen e7f6f07599 Add: Show memory allocations by GS and AI in framerate window 2019-05-11 15:34:33 +02:00
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00