Commit Graph

211 Commits (bab5a8a78713299a4ea6be0ac6b94830c031fd57)

Author SHA1 Message Date
Rubidium bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 3 months ago
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 4 months ago
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.
5 months ago
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.
5 months ago
Peter Nelson b86182ab84 Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
5 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
7 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 7 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Rubidium 3a2509198f Codechange: use better location for the "invalid" action sentinel value
It used to be a random sentinel for end-of-(widget-)list that was used to tell
that no action has taken place yet. Since the last action is practically the
widget that was pressed, add the sentinel to that enumeration.
9 months ago
Rubidium 7ef22af2bb Codechange: introduce and use function to raise and dirty a set of widgets when they are lowered 9 months ago
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.
9 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
11 months ago
PeterN f814c86389
Codechange: Reorganise hotkey initialisation. (#10951)
Hotkeys are now initialized inline, and use std::vector instead of
separate static C-arrays and std::string instead of char *. The list end
marker is no longer required.
1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Tyler Trahan f7eb0ffc37 Feature: Purchase land multiple tiles at a time 2 years ago
Michael Lutz c521b965bd Codechange: Don't use a global for the terrforming error tile. 2 years ago
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 2 years ago
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 2 years ago
Michael Lutz eab18f06a4 Codechange: Pass additional data as byte stream to command callbacks. 2 years ago
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2 years ago
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2 years ago
Michael Lutz 4fc055d6e9 Codechange: Align parameter order of command callbacks to command handlers. 2 years ago
Michael Lutz 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 2 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2 years ago
Loïc Guilloux ddb6024bc6
Codechange: Don't explicitly unset _generating_world outside of genworld.cpp (#9418) 3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 3 years ago
frosch d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 5 years ago
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
glx22 b3fd787959 Fix #7188: check the validity of command callback for scripts (#7701) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch 9aa33862a7 (svn r27571) -Codechange: Consistent naming for command callbacks which play a sound effect. 8 years ago
alberth 4cbfe940cb (svn r27397) -Fix(r27346)[FS#6370]: Fix object editing crash in scenario editor (based on work by adf88) 9 years ago
alberth 4f49d636c1 (svn r27346) -Feature: Make the object placement gui an independent window. 9 years ago
frosch a8080b6256 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 9 years ago
alberth edea2ce96d (svn r27084) -Doc: Improve documentation of AllocateWindowDescFront. 10 years ago
peter1138 a573b94867 (svn r26961) -Codechange: GUI-scale for landscape editor terraform window. 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
frosch 5370613924 (svn r26422) -Fix [FS#5946]: Some road constructions used the rail sound effect. Rename the enum items to properly reflect their purpose. 10 years ago
frosch fef30983e6 (svn r25414) -Codechange: Move handling of global hotkeys to HotkeyList. 11 years ago
frosch 5cb174c6b8 (svn r25412) -Codechange: Make use of Window::OnHotkey 11 years ago
frosch 1b8b1f3f6c (svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member. 11 years ago