Commit Graph

45 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison a1c7d1bd30 Remove non-owning string pointer from StringParameter
(For the time being)

See: https://github.com/OpenTTD/OpenTTD/issues/11922
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 fd073a2810 Remove: replace custom span with std::span 4 months ago
Jonathan G Rennison f034714559 Use StringBuilder for GetString/GetStringWithArgs, as per upstream
Update dependent code as required
5 months ago
Jonathan G Rennison 8832ab8e5d Add StringBuilder class from upstream 5 months ago
Jonathan G Rennison 7f6b1d6b94 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/company_func.h
#	src/core/overflowsafe_type.hpp
#	src/engine.cpp
#	src/music/midifile.cpp
#	src/network/network_command.cpp
#	src/newgrf_debug_gui.cpp
#	src/newgrf_roadstop.h
#	src/newgrf_spritegroup.cpp
#	src/os/macosx/crashlog_osx.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/road_gui.cpp
#	src/saveload/engine_sl.cpp
#	src/script/api/script_depotlist.cpp
#	src/script/api/script_roadtypelist.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/strings.cpp
#	src/table/settings/game_settings.ini
5 months ago
Peter Nelson 7482f71692
Change: Don't handle 'missing' string parameters as 0. (#11673)
If not enough parameters are supplied for a string, then a value of 0 was used, which could result in incorrect information being displayed.

Instead, throw an exception and include an error in the string.
5 months ago
Jonathan G Rennison e2a79f0f32 Codechange: No longer advance parent offset in StringParameters parent mode
Add method to manually advance offset
5 months ago
Rubidium e3f49ee7a0 Codechange: coding style fixes 5 months ago
Jonathan G Rennison 03e0ec8276 Strong typedef: Use strong typedefs for date, date tick, minutes types
Add delta types
Adjust/add type conversion functions
Add various utility methods on types
Remove the various minute macros
Fix some minute conversion inconsistencies
5 months ago
rubidium42 ae4ba00313 Fix #11521, e404ba0: size for remaining span determined incorrectly
(cherry picked from commit 33ba609290)
6 months ago
rubidium42 33ba609290 Fix #11521, e404ba0: size for remaining span determined incorrectly 6 months ago
Jonathan G Rennison 1de1af08b9
Codechange: Replace AllocatedStringParameters with ArrayStringParameters (#11452)
All uses of AllocatedStringParameters are with a compile-time fixed
constant.
Use of a dynamically allocated buffer on the heap is unnecessary and
increases overhead, particularly due to frequent use as a temporary.
6 months ago
Jonathan G Rennison c4f7794597 Fix ArrayStringParameters with move assignment/construction 6 months ago
Jonathan G Rennison 48e700bc32 Fix type issues with string parameter structs 6 months ago
Jonathan G Rennison 3436e0a781 Merge branch 'master' into jgrpp
# Conflicts:
#	src/error.h
#	src/error_gui.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/misc_gui.cpp
#	src/newgrf_gui.cpp
#	src/news_gui.cpp
#	src/rail_cmd.cpp
#	src/saveload/gamelog_sl.cpp
#	src/script/api/script_text.cpp
#	src/script/script_instance.cpp
#	src/statusbar_gui.cpp
#	src/strings.cpp
#	src/strings_func.h
#	src/strings_internal.h
#	src/table/settings/gui_settings.ini
#	src/table/settings/linkgraph_settings.ini
#	src/textbuf_gui.h
6 months ago
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
7 months ago
frosch c6f5b57f13
Fix #11297, 4e9a871: SCC_GENDER_LIST tried to determine the gender from the wrong sub-string. (#11299) 8 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 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
Rubidium 3e488465f8 Codechange: allow string temporaries in a StringParameter 11 months ago
Rubidium 4654b2b0aa Codechange: separate integer and string usage in StringParameters 11 months ago
Rubidium 7ad487eeee Cleanup: remove now unused GetInt32/64 functions 11 months ago
Rubidium e7937efb01 Codechange: add clearer named function to get the next (string) parameter 11 months ago
Rubidium 4e9a871718 Codechange: merge multiple string parameter arrays to single array of structs 11 months ago
Rubidium fa8c50758b Codechange: replace memcpy when copying DParams 11 months ago
Rubidium 7a785a4224 Codechange: simplify StringParameters now type cannot be nullptr 11 months ago
Rubidium 428333aeba Codechange: let AllocatedStringParameters allocated types too 11 months ago
Rubidium 88138c55f8 Codechange: make offset protected and guard against invalid offsets 11 months ago
Rubidium 9c3c90effa Codechange: rename ClearTypeInformation so it can be used for preparing for the next run 11 months ago
Rubidium 01abcdfcac Codechange: make StringParameters#next_type only writable from outside the class 11 months ago
Rubidium 3e8f8c55c2 Codechange: make creating temporary StringParameters easier 11 months ago
Rubidium 381e8b69d2 Codechange: make size and offset size_t 11 months ago
Rubidium e404ba0631 Codechange: generify GetRemainingParameters to allow custom offsets 11 months ago
Rubidium 1d902a97ce Codechange: move StringParameters to strings_internal.h 11 months ago
Rubidium 0a5e58451b Codechange: pass string parameters by reference 11 months ago
Rubidium aba0d27a28 Codechange: use StringParameters for remapping the NewGRF string control codes 11 months ago
Rubidium edb21620ea Cleanup: remove unneeded checks on remaining buffer size 12 months ago
Rubidium affceea0ae Codechange: switch StringBuilder to use std::string as backend 12 months ago
Rubidium 4e39a58c59 Codechange: let town name generation use StringBuilder 12 months ago
rubidium42 bfcb027cb9
Fix 2dffa7d: fmt::format_to copies the iterator, so some text does not remain during formatting (#10940) 12 months ago
Rubidium 6a519f5d89 Cleanup: strecat has no uses anymore 12 months ago
Rubidium 36aaa9d683 Codechange: let GetStringWithArgs use StringBuilder 12 months ago
Rubidium 2dffa7d0c6 Codechange: let FormatString use StringBuilder 12 months ago
Rubidium ed51cf117a Add: helper output iterator for formatting strings 12 months ago