Commit Graph

54 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison 18a42664fc Merge branch 'master' into jgrpp
Remove 'byte' typedef
1 week ago
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2 months ago
Jonathan G Rennison 041e71ec05 Merge branch 'master' into jgrpp
# Conflicts:
#	src/crashlog.cpp
#	src/gfx.cpp
#	src/network/network_client.cpp
#	src/openttd.cpp
#	src/openttd.h
#	src/saveload/saveload.cpp
#	src/survey.cpp
2 months ago
Ivan Fefer 23d733be95
Add: Basic autocompletion on tab for console commands (#12163) 2 months ago
Jonathan G Rennison cc2521ddf5 Add helper function for unsigned saturating add 2 months ago
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2 months ago
Jonathan G Rennison 838b166726 Merge branch 'master' into jgrpp
# Conflicts:
#	src/cheat_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/company_base.h
#	src/debug.cpp
#	src/debug.h
#	src/economy.cpp
#	src/engine_type.h
#	src/graph_gui.cpp
#	src/misc_cmd.cpp
#	src/misc_cmd.h
#	src/network/core/os_abstraction.cpp
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/settings_type.h
#	src/ship_cmd.cpp
#	src/stdafx.h
#	src/tests/bitmath_func.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
3 months ago
Jonathan G Rennison 86a6f63e2f Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/codeql.yml
#	.github/workflows/commit-checker.yml
#	.github/workflows/release-linux-legacy.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows-store.yml
#	.github/workflows/release-windows.yml
#	.github/workflows/upload-cdn.yml
#	.github/workflows/upload-gog.yml
#	.github/workflows/upload-steam.yml
#	src/console_cmds.cpp
#	src/core/math_func.hpp
#	src/fios.cpp
#	src/fios.h
#	src/intro_gui.cpp
#	src/network/network_server.cpp
#	src/openttd.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_table.cpp
#	src/settings_type.h
#	src/table/settings.h.preamble
#	src/table/settings/company_settings.ini
#	src/table/settings/currency_settings.ini
#	src/table/settings/difficulty_settings.ini
#	src/table/settings/economy_settings.ini
#	src/table/settings/game_settings.ini
#	src/table/settings/gui_settings.ini
#	src/table/settings/linkgraph_settings.ini
#	src/table/settings/locale_settings.ini
#	src/table/settings/misc_settings.ini
#	src/table/settings/multimedia_settings.ini
#	src/table/settings/network_private_settings.ini
#	src/table/settings/network_settings.ini
#	src/table/settings/news_display_settings.ini
#	src/table/settings/old_gameopt_settings.ini
#	src/table/settings/pathfinding_settings.ini
#	src/table/settings/script_settings.ini
#	src/table/settings/win32_settings.ini
#	src/table/settings/window_settings.ini
#	src/table/settings/world_settings.ini
#	src/viewport.cpp
#	src/viewport_func.h
#	src/window.cpp
3 months ago
Jonathan G Rennison cfebbfac8c Merge branch 'master' into jgrpp
# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/company_base.h
#	src/company_gui.cpp
#	src/cpu.cpp
#	src/debug.h
#	src/group.h
#	src/group_cmd.cpp
#	src/house.h
#	src/industry.h
#	src/newgrf_house.cpp
#	src/news_type.h
#	src/openttd.cpp
#	src/saveload/company_sl.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/story.cpp
#	src/table/town_land.h
#	src/viewport.cpp
3 months ago
Jonathan G Rennison c0b8e58404 Codechange: Simplify SetBitIterator
Use FindFirstBit and KillFirstBit, allowing simpler iterator equality
Add simple test
4 months ago
Jonathan G Rennison be469405df Bitmath: Add utility functions for calculating bit masks
Add tests
4 months ago
Jonathan G Rennison f9321686a7 Remove old reference to FindLastBit64 from tests 4 months ago
Jonathan G Rennison c26ca5369e Unconditionally use FindFirstBit in SetBitIterator
Add simple tests
4 months ago
Jonathan G Rennison 5404be172c Merge branch 'master' into jgrpp
# Conflicts:
#	src/core/bitmath_func.cpp
#	src/core/bitmath_func.hpp
#	src/core/geometry_type.hpp
#	src/game/game_text.hpp
#	src/graph_gui.cpp
#	src/pathfinder/npf/npf.cpp
#	src/script/api/script_text.cpp
#	src/spritecache.cpp
#	src/track_func.h
4 months ago
Jonathan G Rennison 822ecae85d Merge branch 'master' into jgrpp
# Conflicts:
#	src/cargotype.h
#	src/core/CMakeLists.txt
#	src/core/span_type.hpp
#	src/fileio.cpp
#	src/fios.cpp
#	src/misc/endian_buffer.hpp
#	src/misc_gui.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/screenshot.cpp
#	src/settings.cpp
#	src/settings_internal.h
#	src/stdafx.h
#	src/string_func.h
#	src/strings.cpp
#	src/strings_func.h
#	src/strings_internal.h
4 months ago
Patric Stout 75f21065c9
Codechange: refactor DecodeHexText to a generic purpose ConvertHexToBytes (#11866)
DecodeHexText() does more than just decoding hex. ConvertHexToBytes()
now only does pure hex decoding. This required a bit of refactoring
for the code using DecodeHexText().
4 months ago
Rubidium 4c51534b6a Remove: LeastCommonMultiple / GreatestCommonDivisor
Use std::lcm / std::gcd instead.
4 months ago
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 4 months ago
Jonathan G Rennison d7b75614bb Merge branch 'master' into jgrpp
# Conflicts:
#	media/baseset/CMakeLists.txt
#	src/build_vehicle_gui.cpp
#	src/console.cpp
#	src/debug.cpp
#	src/fontcache/freetypefontcache.cpp
#	src/network/network.cpp
#	src/openttd.cpp
#	src/os/macosx/font_osx.cpp
#	src/os/windows/font_win32.cpp
#	src/settings_gui.cpp
#	src/video/sdl2_v.cpp
#	src/widgets/settings_widget.h
#	src/window_gui.h
4 months ago
Michael Lutz 6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 4 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
4 months ago
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
5 months ago
Peter Nelson 7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 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
Jonathan G Rennison 2b914c7a2f Fix: Memory leak in WindowDescTestsFixture 5 months ago
Jonathan G Rennison 43936575e6 Test: Avoid leaking widget tree in WindowDescTestsFixture 5 months ago
Jonathan G Rennison 34668bff87 Test: Add upstream tests 5 months ago
Jonathan G Rennison 79b5699e82 Fix test compilation on MacOS 6 months ago
Peter Nelson b1eb5533eb Add: WindowDesc unit test to validate NWidgetPart lists. 6 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.
6 months ago
Peter Nelson 46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 6 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.
7 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.
7 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 7 months ago
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 8 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
8 months ago
Patric Stout 00f13282a9
Codechange: keep how we convert string <-> JSON private (#11269) 8 months ago
Patric Stout 5f9b8aaa95
Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 8 months ago
Jonathan G Rennison 20ece8025e Test: Add tests for FindLastBit function 9 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.
9 months ago
Rubidium 6635f809dd Fix #11181: attempting to read string as int triggers assertion 9 months ago
Jonathan G Rennison 0c634edef5 Ring buffer: Add erase 9 months ago
Jonathan G Rennison 877e301c5a Ring buffer: Add multi-value insert 9 months ago
Jonathan G Rennison 8d3a90425c Test: Add tests for ring buffer functionality 9 months ago
Rubidium 73d7052732 Add: unit test functionality using catch2
(cherry picked from commit 43a7e54067)
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
10 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>
12 months 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