Commit Graph

33 Commits (42c8f50551d7a7bdd33dfa68578c6ba45dce2bb9)

Author SHA1 Message Date
Jonathan G Rennison 42c8f50551 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	.gitignore
#	COMPILING.md
#	src/company_gui.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/engine_func.h
#	src/fileio.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/order_gui.cpp
#	src/osk_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/script/api/script_event_types.hpp
#	src/sl/oldloader_sl.cpp
#	src/smallmap_gui.cpp
#	src/station_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_func.h
#	src/widgets/dropdown_type.h
#	src/widgets/group_widget.h
#	src/widgets/vehicle_widget.h
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
6 months ago
Peter Nelson 7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 6 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.
6 months ago
Jonathan G Rennison 2b914c7a2f Fix: Memory leak in WindowDescTestsFixture 6 months ago
Jonathan G Rennison 43936575e6 Test: Avoid leaking widget tree in WindowDescTestsFixture 6 months ago
Jonathan G Rennison 34668bff87 Test: Add upstream tests 6 months ago
Jonathan G Rennison 79b5699e82 Fix test compilation on MacOS 7 months ago
Peter Nelson b1eb5533eb Add: WindowDesc unit test to validate NWidgetPart lists. 7 months ago
Peter Nelson 1c94fb0389 Add: Mock sprite cache intialization.
This fills up the sprite cache with SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT zero-size sprites, to
allow GetSpriteSize() calls to continue from unit-tests.
7 months ago
Peter Nelson 46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 7 months ago
Peter Nelson ce6e739491 Codechange: Add unit-test to check if nested widget parts of properly closed.
Properly closed means exactly one EndContainer for every Container widget.
8 months ago
Peter Nelson e563057478 Add: WindowDesc unit test to validate ini-key value.
ini-key must be present if WWT_DEFSIZEBOX or WWT_STICKYBOX is present.
This was previously enforced by a workflow, however that parsed the source
code with regex which turned out to be error-prone.
8 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 9 months ago
Jonathan G Rennison 1b61dfabe3 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_gui.cpp
#	src/core/math_func.hpp
#	src/highscore.cpp
#	src/tests/math_func.cpp
9 months ago
Patric Stout 00f13282a9
Codechange: keep how we convert string <-> JSON private (#11269) 9 months ago
Patric Stout 5f9b8aaa95
Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 9 months ago
Jonathan G Rennison 20ece8025e Test: Add tests for FindLastBit function 10 months ago
Patric Stout 7afd686541
Codechange: add tests for GS <-> AdminPort JSON conversion (#11252)
While at it, fix a bug where booleans were made integers.
10 months ago
Rubidium 6635f809dd Fix #11181: attempting to read string as int triggers assertion 10 months ago
Jonathan G Rennison 0c634edef5 Ring buffer: Add erase 10 months ago
Jonathan G Rennison 877e301c5a Ring buffer: Add multi-value insert 10 months ago
Jonathan G Rennison 8d3a90425c Test: Add tests for ring buffer functionality 10 months ago
Rubidium 73d7052732 Add: unit test functionality using catch2
(cherry picked from commit 43a7e54067)
10 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
Patric Stout 0f3dd9c796
Fix: crash when window can't be placed on low resolution screens. (#10932)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Rubidium 969a3dc0f3 Codechange: introduce generic ClampTo function to clamp to the range of a type 1 year ago
Rubidium b5f96808a1 Fix: FormatArrayAsHex returns gibberish instead of a hex array 1 year ago
Rubidium 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 1 year ago
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 1 year ago
Rubidium 43a7e54067 Add: unit test functionality using catch2 1 year ago
Rubidium c6ff7dad68 Add: compile time "unit tests" for GetPartialZ consistent 1 year ago