Skip to content

Commit

Permalink
Merge branch 'master' into 1.19_VBGalley_20241201
Browse files Browse the repository at this point in the history
  • Loading branch information
doofus-01 authored Dec 16, 2024
2 parents 05581cf + e642835 commit 456ed95
Show file tree
Hide file tree
Showing 383 changed files with 4,543 additions and 6,891 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
Checks: '-*,modernize-use-nullptr'
Checks: '-*,modernize-use-nullptr,performance-unnecessary-value-param'
WarningsAsErrors: true
...
2 changes: 1 addition & 1 deletion .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
build cdb
# disable all warnings since we have coverage on them in a standard build, and clang-tidy
# triggers false positive compiler warnings that clang itself won't
run-clang-tidy -use-color -j 2 -extra-arg="-w" '^(?!.*src/modules/|.*build/)'
run-clang-tidy -quiet -use-color -j 2 -extra-arg="-w" -warnings-as-errors='*' '^(?!.*src/modules/|.*build/)'
apt remove -y -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# set minimum version
# set minimum version
cmake_minimum_required(VERSION 3.14)

project(wesnoth)
Expand Down Expand Up @@ -480,7 +480,7 @@ if(NOT MSVC)
else()
set(CMAKE_CXX_FLAGS "/W3 /WX /wd4503 /wd4351 /wd4250 /wd4244 /wd4267 /we4239 /wd4275 /EHsc /utf-8 /Zc:__cplusplus" CACHE STRING "Global flags used by the CXX compiler during all builds." FORCE)
set(CMAKE_C_FLAGS "/WX" CACHE STRING "Global flags used by the C compiler during all builds." FORCE)
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG_LUA")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

Wesnoth requires a compiler with sufficient C++17 support such as GCC 8 and
Wesnoth requires a compiler with sufficient C++17 support such as GCC 11 and
later, or a version of Clang with equivalent support.

You'll need to have these libraries and their development headers installed in
Expand All @@ -19,6 +19,7 @@ order to build Wesnoth:
* System
* Coroutine
* Graph
* Charconv (This requires boost 1.85 or higher and is optional but reccomended especially for clang builds)
* SDL2 libraries:
* SDL2 >= 2.0.18 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2_image >= 2.0.2 (with PNG, JPEG, and WEBP support)
Expand Down
5 changes: 3 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ if env['ccache']: env.Tool('ccache')
if env['compile_db']:
env.Tool('compilation_db')
cdb = env.CompilationDatabase()
Alias('cdb', cdb)
Alias('cdb', cdb)

boost_version = "1.67"

Expand Down Expand Up @@ -385,6 +385,7 @@ if env["prereqs"]:
conf.CheckBoost("program_options", require_version = boost_version) & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoostCharconv() & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
Expand Down Expand Up @@ -671,7 +672,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])

if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0A00"])

if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI
Expand Down
123 changes: 74 additions & 49 deletions add_source_file
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ code_blocks_target_translations = {
# XCode #
#=======#

def add_to_xcode(filename, targets):
def modify_xcode(filename, targets, remove):
"""Add the given file to the specified targets.
"""
projectfile = rootdir.joinpath(
Expand Down Expand Up @@ -121,24 +121,29 @@ def add_to_xcode(filename, targets):
raise Exception(f"problem finding '{d}' group in '{groupname}'")
parent_group = found_groups[0]

# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return

# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
if remove :
# Remove from all targets if we want to remove
for file in project.get_files_by_name(filename.name, parent=parent_group):
project.remove_file_by_id(file.get_id())
else:
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return

# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)

# that's done, save the file
project.save()
Expand All @@ -148,7 +153,7 @@ def add_to_xcode(filename, targets):
# source_lists #
#==============#

def add_to_source_list(filename, source_list):
def modify_source_list(filename, source_list, remove):
source_list_file = rootdir.joinpath("source_lists", source_list)
sl_lines = open(source_list_file).readlines()
file_line = filename.as_posix() + '\n'
Expand All @@ -157,26 +162,35 @@ def add_to_source_list(filename, source_list):
if filename.suffix != ".cpp":
return

# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
if remove:
if file_line in sl_lines: sl_lines.remove(file_line)
else:
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return

sl_lines.append(file_line)

sl_lines.append(file_line)
sl_lines.sort()
open(source_list_file, 'w').writelines(sl_lines)

def add_to_source_lists(filename, targets):
translated_targets = [source_list_target_translations[t] for t in targets]
print(" source_list targets:", translated_targets)
for t in translated_targets:
add_to_source_list(filename, t)
modify_source_list(filename, t, False)

def remove_from_source_lists(filename):
# remove from all tagerts if -r was specified.
for t in source_list_target_translations.values():
modify_source_list(filename, t, True)

#==============#
# Code::Blocks #
#==============#

def add_to_code_blocks_target(filename, target):
def modify_code_blocks_target(filename, target, remove):
cbp_file = rootdir.joinpath(
"projectfiles",
"CodeBlocks",
Expand All @@ -190,30 +204,33 @@ def add_to_code_blocks_target(filename, target):

elem = f"\t\t<Unit filename=\"{filename_for_cbp}\" />\n"

# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return

# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
if remove:
if elem in cbp_lines: cbp_lines.remove(elem)
else:
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return

# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
break
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
break
index += 1
cbp_lines.insert(index, elem)
index += 1
cbp_lines.insert(index, elem)

open(cbp_file, 'w').writelines(cbp_lines)

def add_to_code_blocks(filename, targets):
translated_targets = [code_blocks_target_translations[t] for t in targets]
def modify_code_blocks(filename, targets, remove):
translated_targets = code_blocks_target_translations.values() if remove else [code_blocks_target_translations[t] for t in targets]
print(" code::blocks targets:", translated_targets)
for t in translated_targets:
add_to_code_blocks_target(filename, t)
modify_code_blocks_target(filename, t, remove)

def sanity_check_existing_cpp_hpp(filenames):
"""
Expand Down Expand Up @@ -285,6 +302,8 @@ if __name__ == "__main__":
help="which build targets to add the file to")
ap.add_argument("--no-checks", action="store_true",
help="do not check whether the files exist, etc")
ap.add_argument("-r", "--remove", action="store_true",
help="remove the specified files from projectfiles instead of adding them, --target is then ignored")
# By default, recognise --help too
options = ap.parse_args()

Expand All @@ -301,7 +320,13 @@ if __name__ == "__main__":
sanity_check_existing_cpp_hpp(filenames)

for filename in filenames:
print(f"adding '{filename}' to targets: {options.target}")
add_to_xcode(filename, options.target)
add_to_source_lists(filename, options.target)
add_to_code_blocks(filename, options.target)
if options.remove:
print(f"removing '{filename}' from all targets")
modify_xcode(filename, options.target, True)
remove_from_source_lists(filename)
modify_code_blocks(filename, options.target, True)
else:
print(f"adding '{filename}' to targets: {options.target}")
modify_xcode(filename, options.target, False)
add_to_source_lists(filename, options.target)
modify_code_blocks(filename, options.target, False)
26 changes: 13 additions & 13 deletions boost_test_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,20 @@ test_lexical_cast_throw<unsigned long long>
test_lexical_cast_throw<float>
test_lexical_cast_throw<double>
test_lexical_cast_throw<long double>
test_lexical_cast_signed<signed char>
test_lexical_cast_signed<short>
test_lexical_cast_signed<int>
test_lexical_cast_signed<long>
test_lexical_cast_long_long
test_lexical_cast_unsigned<unsigned char>
test_lexical_cast_unsigned<unsigned short>
test_lexical_cast_unsigned<unsigned int>
test_lexical_cast_unsigned<unsigned long>
test_lexical_cast_unsigned_long_long
test_lexical_arethmetic_signed<signed char>
test_lexical_arethmetic_signed<short>
test_lexical_arethmetic_signed<int>
test_lexical_arethmetic_signed<long>
test_lexical_arethmetic_signed<long long>
test_lexical_arethmetic_signed<unsigned char>
test_lexical_arethmetic_signed<unsigned short>
test_lexical_arethmetic_signed<unsigned int>
test_lexical_arethmetic_signed<unsigned long>
test_lexical_arethmetic_signed<unsigned long long>
test_lexical_arethmetic_signed<float>
test_lexical_arethmetic_signed<double>
test_lexical_arethmetic_signed<long double>
test_lexical_cast_bool
test_lexical_cast_floating_point<float>
test_lexical_cast_floating_point<double>
test_lexical_cast_floating_point<long double>
test_lexical_cast_result
test_map_location/map_location_characterization_test_radial_mode
test_map_location/reality_check_vector_negation
Expand Down
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
### Multiplayer
### Lua API
### Packaging
* Windows 10 or later is now required
### Terrain
### Translations
* Updated translations: Bengali, British English, Italian
* Updated translations: Bengali, British English, Chinese (Simplified), Czech, Hungarian, Italian
### Units
### User interface
* The `screen_pitch_microns` variable is no longer available for UI formulas
### WML Engine
* [stacked_widget] no longer accepts the long-deprecated [stack] tag
### Miscellaneous and Bug Fixes

## Version 1.19.6
Expand Down
2 changes: 2 additions & 0 deletions changelog_entries/dawarf-level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Units
* Dawarf - Decreased Cost from 17 to 12, Decreased Level from 1 to 0, and Decreased XP from 50 to 25
2 changes: 2 additions & 0 deletions changelog_entries/elvish-champion-honed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Units
* Elvish Champion: HP 72 -> 70, cost 61 -> 60, accuracy bonus is now explained via a weapon special
2 changes: 2 additions & 0 deletions changelog_entries/primary_authors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### WML Engine
* The author attribute is now again a display only attribute. Instead the primary_authors attribute should be used, which supports specifying multiple primary authors.
2 changes: 1 addition & 1 deletion data/campaigns/Delfadors_Memoirs/utils/sides.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
end
-- level the unit and give it a random amount of experience up to half of max
units[i].experience = units[i].max_experience
units[i]:advance( )
units[i]:advance(false)
units[i].experience = mathx.random ( 0, mathx.round( units[i].max_experience / 2 ) )
end
>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,31 +230,32 @@
[/effect]
[/modify_unit]
[/event]
[event] # manually set gold to 0
[event]
# if ravanal's low on units and ravanal_no_income is cleared, give him gold
# otherwise, clear Mal-Ravanal's gold so we don't go positive nor negative
name=side 7 turn refresh
first_time_only=no

[filter_condition]
{VARIABLE_CONDITIONAL ravanal_no_income equals yes}
[/filter_condition]

[modify_side]
side=7
gold=0
[/modify_side]
[/event]
[event] # manually set gold to 1000
name=side 1
first_time_only=no

[filter_condition]
[if]
{VARIABLE_CONDITIONAL ravanal_no_income not_equals yes}
[/filter_condition]

[modify_side]
side=7
gold=9999
[/modify_side]
[and]
[have_unit]
side=7
count=0-10
[/have_unit]
[/and]
[then]
[modify_side]
side=7
gold=500
[/modify_side]
[/then]
[else]
[modify_side]
side=7
gold=0
[/modify_side]
[/else]
[/if]
[/event]

#--------------------
Expand Down
Loading

0 comments on commit 456ed95

Please sign in to comment.