Merge remote-tracking branch 'upstream/1.11' into 1.11
This commit is contained in:
12
.github/workflows/ci-build.yml
vendored
12
.github/workflows/ci-build.yml
vendored
@@ -75,6 +75,9 @@ jobs:
|
|||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
cxxcompiler: g++
|
cxxcompiler: g++
|
||||||
libsdl: libsdl1.2-dev
|
libsdl: libsdl1.2-dev
|
||||||
|
- compiler: gcc
|
||||||
|
cxxcompiler: g++
|
||||||
|
extra-cmake-parameters: -DOPTION_DEDICATED=ON
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
@@ -97,7 +100,6 @@ jobs:
|
|||||||
libfontconfig-dev \
|
libfontconfig-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
liblzma-dev \
|
liblzma-dev \
|
||||||
libzstd-dev \
|
|
||||||
liblzo2-dev \
|
liblzo2-dev \
|
||||||
${{ matrix.libsdl }} \
|
${{ matrix.libsdl }} \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
@@ -130,7 +132,7 @@ jobs:
|
|||||||
cd build
|
cd build
|
||||||
|
|
||||||
echo "::group::CMake"
|
echo "::group::CMake"
|
||||||
cmake ..
|
cmake .. ${{ matrix.extra-cmake-parameters }}
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::Build"
|
echo "::group::Build"
|
||||||
@@ -170,7 +172,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /usr/local/share/vcpkg/installed
|
path: /usr/local/share/vcpkg/installed
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||||
|
|
||||||
@@ -178,7 +180,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
vcpkg install --triplet=${{ matrix.arch }}-osx \
|
vcpkg install --triplet=${{ matrix.arch }}-osx \
|
||||||
liblzma \
|
liblzma \
|
||||||
zstd \
|
|
||||||
libpng \
|
libpng \
|
||||||
lzo \
|
lzo \
|
||||||
zlib \
|
zlib \
|
||||||
@@ -253,7 +254,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: vcpkg/installed
|
path: vcpkg/installed
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||||
|
|
||||||
@@ -262,7 +263,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
||||||
liblzma \
|
liblzma \
|
||||||
zstd \
|
|
||||||
libpng \
|
libpng \
|
||||||
lzo \
|
lzo \
|
||||||
zlib \
|
zlib \
|
||||||
|
|||||||
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -297,7 +297,6 @@ jobs:
|
|||||||
SDL2-devel \
|
SDL2-devel \
|
||||||
wget \
|
wget \
|
||||||
xz-devel \
|
xz-devel \
|
||||||
libzstd-devel \
|
|
||||||
zlib-devel \
|
zlib-devel \
|
||||||
# EOF
|
# EOF
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
@@ -413,7 +412,6 @@ jobs:
|
|||||||
libfluidsynth-dev \
|
libfluidsynth-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
liblzma-dev \
|
liblzma-dev \
|
||||||
libzstd-dev \
|
|
||||||
liblzo2-dev \
|
liblzo2-dev \
|
||||||
libsdl2-dev \
|
libsdl2-dev \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
@@ -498,7 +496,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /usr/local/share/vcpkg/installed
|
path: /usr/local/share/vcpkg/installed
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
|
key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.key.outputs.image }}-vcpkg-release
|
${{ steps.key.outputs.image }}-vcpkg-release
|
||||||
${{ steps.key.outputs.image }}-vcpkg-x64
|
${{ steps.key.outputs.image }}-vcpkg-x64
|
||||||
@@ -508,8 +506,6 @@ jobs:
|
|||||||
vcpkg install \
|
vcpkg install \
|
||||||
liblzma:x64-osx \
|
liblzma:x64-osx \
|
||||||
liblzma:arm64-osx \
|
liblzma:arm64-osx \
|
||||||
zstd:x64-osx \
|
|
||||||
zstd:arm64-osx \
|
|
||||||
libpng:x64-osx \
|
libpng:x64-osx \
|
||||||
libpng:arm64-osx \
|
libpng:arm64-osx \
|
||||||
lzo:x64-osx \
|
lzo:x64-osx \
|
||||||
@@ -703,7 +699,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: vcpkg/installed
|
path: vcpkg/installed
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||||
|
|
||||||
@@ -712,7 +708,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
||||||
liblzma \
|
liblzma \
|
||||||
zstd \
|
|
||||||
libpng \
|
libpng \
|
||||||
lzo \
|
lzo \
|
||||||
zlib \
|
zlib \
|
||||||
@@ -869,7 +864,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
|
||||||
|
|
||||||
- name: Trigger 'New OpenTTD release'
|
- name: Trigger 'New OpenTTD release'
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v1
|
||||||
|
|||||||
@@ -120,28 +120,31 @@ find_package(LZO)
|
|||||||
find_package(ZSTD 1.4)
|
find_package(ZSTD 1.4)
|
||||||
find_package(PNG)
|
find_package(PNG)
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT OPTION_DEDICATED)
|
||||||
find_package(Allegro)
|
if(NOT WIN32)
|
||||||
if(NOT APPLE)
|
find_package(Allegro)
|
||||||
find_package(Freetype)
|
if(NOT APPLE)
|
||||||
find_package(SDL2)
|
find_package(Freetype)
|
||||||
if(NOT SDL2_FOUND)
|
find_package(SDL2)
|
||||||
find_package(SDL)
|
if(NOT SDL2_FOUND)
|
||||||
|
find_package(SDL)
|
||||||
|
endif()
|
||||||
|
find_package(Fluidsynth)
|
||||||
|
find_package(Fontconfig)
|
||||||
|
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
|
||||||
endif()
|
endif()
|
||||||
find_package(Fluidsynth)
|
|
||||||
find_package(Fontconfig)
|
|
||||||
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
|
|
||||||
else()
|
|
||||||
find_package(Iconv)
|
|
||||||
|
|
||||||
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
|
||||||
find_library(AUDIOUNIT_LIBRARY AudioUnit)
|
|
||||||
find_library(COCOA_LIBRARY Cocoa)
|
|
||||||
find_library(QUARTZCORE_LIBRARY QuartzCore)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(APPLE)
|
||||||
|
find_package(Iconv)
|
||||||
|
|
||||||
if(NOT EMSCRIPTEN)
|
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||||
|
find_library(AUDIOUNIT_LIBRARY AudioUnit)
|
||||||
|
find_library(COCOA_LIBRARY Cocoa)
|
||||||
|
find_library(QUARTZCORE_LIBRARY QuartzCore)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EMSCRIPTEN AND NOT OPTION_DEDICATED)
|
||||||
find_package(OpenGL COMPONENTS OpenGL)
|
find_package(OpenGL COMPONENTS OpenGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -219,7 +222,7 @@ if(MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/media/baseset)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/media)
|
||||||
|
|
||||||
add_dependencies(openttd
|
add_dependencies(openttd
|
||||||
find_version)
|
find_version)
|
||||||
@@ -227,6 +230,7 @@ add_dependencies(openttd
|
|||||||
target_link_libraries(openttd
|
target_link_libraries(openttd
|
||||||
openttd::languages
|
openttd::languages
|
||||||
openttd::settings
|
openttd::settings
|
||||||
|
openttd::media
|
||||||
openttd::basesets
|
openttd::basesets
|
||||||
openttd::script_api
|
openttd::script_api
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ add_subdirectory(table)
|
|||||||
add_subdirectory(video)
|
add_subdirectory(video)
|
||||||
add_subdirectory(widgets)
|
add_subdirectory(widgets)
|
||||||
|
|
||||||
|
|
||||||
add_files(
|
add_files(
|
||||||
viewport_sprite_sorter_sse4.cpp
|
viewport_sprite_sorter_sse4.cpp
|
||||||
CONDITION SSE_FOUND
|
CONDITION SSE_FOUND
|
||||||
|
|||||||
@@ -180,6 +180,21 @@ bool Packet::CanReadFromPacket(uint bytes_to_read)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* CityMania code begin */
|
||||||
|
bool Packet::CMCheckRead(uint bytes_to_read)
|
||||||
|
{
|
||||||
|
/* Don't allow reading from a quit client/client who send bad data */
|
||||||
|
if (this->cs->HasClientQuit()) return false;
|
||||||
|
|
||||||
|
/* Check if variable is within packet-size */
|
||||||
|
if (this->pos + bytes_to_read > this->size) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/* CityMania code end */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the packet size from the raw packet and stores it in the packet->size
|
* Reads the packet size from the raw packet and stores it in the packet->size
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
void PrepareToRead();
|
void PrepareToRead();
|
||||||
|
|
||||||
bool CanReadFromPacket (uint bytes_to_read);
|
bool CanReadFromPacket (uint bytes_to_read);
|
||||||
|
bool CMCheckRead (uint bytes_to_read); // CityMaina needs check that doesn't close connections
|
||||||
bool Recv_bool ();
|
bool Recv_bool ();
|
||||||
uint8 Recv_uint8 ();
|
uint8 Recv_uint8 ();
|
||||||
uint16 Recv_uint16();
|
uint16 Recv_uint16();
|
||||||
|
|||||||
@@ -925,7 +925,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet *p)
|
|||||||
p->Recv_string(name, sizeof(name));
|
p->Recv_string(name, sizeof(name));
|
||||||
playas = (Owner)p->Recv_uint8();
|
playas = (Owner)p->Recv_uint8();
|
||||||
client_lang = (NetworkLanguage)p->Recv_uint8();
|
client_lang = (NetworkLanguage)p->Recv_uint8();
|
||||||
uint8 savegame_formats = p->CanReadFromPacket(1) ? p->Recv_uint8() : 23u /* assume non-modded has everything but zstd */;
|
uint8 savegame_formats = p->CMCheckRead(1) ? p->Recv_uint8() : 23u /* assume non-modded has everything but zstd */;
|
||||||
|
|
||||||
if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
|
if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
|
||||||
|
|
||||||
@@ -934,6 +934,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet *p)
|
|||||||
if (!preset) return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
|
if (!preset) return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
|
||||||
this->cm_preset = *preset;
|
this->cm_preset = *preset;
|
||||||
|
|
||||||
|
DEBUG(sl, 2, "Using saveload preset '%s:%d' for client %d (mask %d)", this->cm_preset.format->name, (int)this->cm_preset.compression_level, (int)this->client_id, (int)savegame_formats);
|
||||||
|
|
||||||
/* join another company does not affect these values */
|
/* join another company does not affect these values */
|
||||||
switch (playas) {
|
switch (playas) {
|
||||||
case COMPANY_NEW_COMPANY: // New company
|
case COMPANY_NEW_COMPANY: // New company
|
||||||
|
|||||||
@@ -2540,11 +2540,10 @@ std::optional<SavePreset> FindCompatibleSavePreset(const std::string &server_for
|
|||||||
*/
|
*/
|
||||||
uint8 GetAvailableLoadFormats()
|
uint8 GetAvailableLoadFormats()
|
||||||
{
|
{
|
||||||
return 3;
|
|
||||||
uint8 res = 0;
|
uint8 res = 0;
|
||||||
for(auto &slf : _saveload_formats) {
|
for(auto &slf : _saveload_formats) {
|
||||||
if (slf.init_load != nullptr) {
|
if (slf.init_load != nullptr) {
|
||||||
res &= (1 << slf.id);
|
res |= (1 << slf.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@@ -2890,6 +2889,8 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
|
|||||||
SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, err_str);
|
SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, err_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEBUG(sl, 2, "Using saveload format '%s'", fmt->name);
|
||||||
|
|
||||||
_sl.lf = fmt->init_load(_sl.lf);
|
_sl.lf = fmt->init_load(_sl.lf);
|
||||||
_sl.reader = new ReadBuffer(_sl.lf);
|
_sl.reader = new ReadBuffer(_sl.lf);
|
||||||
_next_offs = 0;
|
_next_offs = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user