Commit Graph

43 Commits

Author SHA1 Message Date
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
Niels Martin Hansen 13962a8475 Change: Framerate window can now scroll and resize 2019-02-23 14:29:07 +01:00
Niels Martin Hansen 7e1e2756d4 Add: Show performance of AI and GS in framerate window 2019-02-23 14:29:07 +01:00
PeterN 5ff0c24993 Fix #6780: Some windows didn't get updated from OnTick() (#7048) 2019-01-12 23:23:23 +00:00
Niels Martin Hansen 9e30fbab34 Fix #6864: Normalise colour use in Frame rate window 2018-11-25 17:27:53 +01:00
Niels Martin Hansen cb1fcc4765 Doc: More notes for developers adding new PerformanceElements 2018-11-25 00:49:33 +01:00
J0an Josep 8975318286 Fix 2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad: Expose widgets and windows to scripts and fix documentation. 2018-07-23 20:32:18 +02:00
Niels Martin Hansen 2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2018-07-19 21:17:07 +02:00