Skip to content

Commit

Permalink
Update to 12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ldpl committed Apr 2, 2022
2 parents c310a1c + 8bed7c7 commit dc09cd9
Show file tree
Hide file tree
Showing 87 changed files with 1,697 additions and 559 deletions.
39 changes: 23 additions & 16 deletions .changelog
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
12.1 (2021-11-08)
12.2 (2022-04-02)
------------------------------------------------------------------------
Feature: Button to toggle showing advanced signal types (#9617)
Change: Don't show screenshot GUI in screenshots (#9674)
Change: Suppress panning in intro game, while user is interacting with the GUI (#9645)
Change: Draw rotor in cursor when dragging helicopters in depots (#9612)
Fix: Invalid memory access when loading a currency NewGRF (#9675)
Fix #9579: Object and HQ construction is Construction cost, not Property Maintenance (#9673)
Fix #9669: Ships exiting a blocked depot/lock could exit in the wrong direction (#9672)
Fix: Every 16th client never reconnects after server restart (#9666)
Fix #9643: Screenshots were always written as BMP files (#9644)
Fix #9630: Intro game could zoom in/out more than allowed by settings (#9633)
Fix #9626: Incorrect loading of script saved data (#9629)
Fix: Emergency crash save had the wrong NewGRF list saved in it (#9627)
Fix #9595: Always use plural forms of cargo for subsidy strings (#9619)
Fix #9614: Refresh rate dropdown was still active when vsync was enabled (#9618)
Fix: Don't use 'server address' string in server list when displaying an invite code (#9615)
Feature: Remember the last-used signal between games (#9792)
Change: [MacOS] Allow touchbar usage on all supported OS versions (#9776)
Change: Add a timestamp in name of crash files (#9761)
Fix #9736: Duplicate multiplayer window opens upon canceling password entry (#9842)
Fix: Removing long roads doesn't prioritise refusal of local authority over other errors (#9831)
Fix #9020: Glitchy station coverage highlight when changing selection (#9825)
Fix: Correct some Romanian town names (#9819)
Fix: Original music playback rate was slightly too fast (#9814)
Fix #9811: Use the NewGRF-defined vehicle center when dragging ships and aircraft (#9812)
Fix: Do not let shares in the company taking over another company disappear (#9808)
Fix #9802: Crash when using lots of NewGRF waypoint types (#9803)
Fix #9766: Don't write uninitialised data in config file (#9767)
Fix #9743: [MacOS] Don't try to render touchbar sprites with invalid zoom level (#9776)
Fix #9774: Building roadstop in estimation mode updates station acceptance (#9775)
Fix: If vehicles only refit to cargo-slots >= 32, the default cargo was wrong (#9744)
Fix #9735: Possible desync when replacing a depot on same tile (#9738)
Fix #9730: [Network] Connections can use an invalid socket due to a race condition (#9731)
Fix: Don't show sign edit window for GS-owned signs (#9716)
Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704)
Fix #9680: Crash when loading really old savegames with aircraft in certain places (#9699)
Fix: Update last servicing dates when using the date cheat (#9694)
Fix: Error message shows about missing glyphs while suitable fallback font is found (#9692)


2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2016]
os: [windows-latest, windows-2019]
arch: [x86, x64]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ jobs:
- container_image: "ubuntu:20.04"
bundle_name: "focal"
compiler: "g++"
- container_image: "ubuntu:20.10"
bundle_name: "groovy"
compiler: "g++"
- container_image: "debian:buster"
bundle_name: "buster"
compiler: "g++"
Expand Down
2 changes: 1 addition & 1 deletion .ottdrev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.1 20211108 0 17dfc6e28aac5ad2290e849b03893a416be97b03 1 1 2021
12.2 20220402 0 1893dba8a172636791dc79137a3331bd41cc50bc 1 1 2022
2 changes: 1 addition & 1 deletion .release_date
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021-11-08 20:00 UTC
2022-04-02 10:38 UTC
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.1
12.2
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(NOT BINARY_NAME)
endif()

project(${BINARY_NAME}
VERSION 12.1
VERSION 12.2
)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
Expand Down
2 changes: 1 addition & 1 deletion COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ that comes with vcpkg. After that, you can run something similar to this:
```powershell
mkdir build
cd build
cmake.exe .. -G'Visual Studio 16 2019' -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
cmake.exe .. -G"Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
```

Change `<location of vcpkg>` to where you have installed vcpkg. After this
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ git checkout upstream/master -b <topic-branch-name>
```

4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.

5. Locally rebase the upstream development branch into your topic branch:

Expand Down Expand Up @@ -265,5 +265,5 @@ If you would not like to accept this risk, please do either commit anonymously o

### Attribution of this Contributing Guide

This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE) terms for Bootstrap documentation.
This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/) terms for Bootstrap documentation.
The GDPR notice is adapted from [rsyslog](https://github.com/rsyslog/rsyslog/blob/master/CONTRIBUTING.md) under the [GNU General Public License](https://github.com/rsyslog/rsyslog/blob/master/COPYING).
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:

- https://www.openttd.org/downloads/opengfx-releases/ for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/ for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/ for OpenMSX
- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX

Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
Expand Down Expand Up @@ -163,7 +163,7 @@ If you want to compile OpenTTD from source, instructions can be found in [COMPIL

- [OpenTTD website](https://www.openttd.org)
- IRC chat using #openttd on irc.oftc.net [more info about our irc channel](https://wiki.openttd.org/en/Development/IRC%20channel)
- [OpenTTD on Github](https://github.com/openTTD/) for code repositories and for reporting issues
- [OpenTTD on Github](https://github.com/OpenTTD/) for code repositories and for reporting issues
- [forum.openttd.org](https://forum.openttd.org/) - the primary community forum site for discussing OpenTTD and related games
- [OpenTTD wiki](https://wiki.openttd.org/) community-maintained wiki, including topics like gameplay guide, detailed explanation of some game mechanics, how to use add-on content (mods) and much more

Expand Down
26 changes: 26 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
12.2 (2022-04-02)
------------------------------------------------------------------------
Feature: Remember the last-used signal between games (#9792)
Change: [MacOS] Allow touchbar usage on all supported OS versions (#9776)
Change: Add a timestamp in name of crash files (#9761)
Fix #9736: Duplicate multiplayer window opens upon canceling password entry (#9842)
Fix: Removing long roads doesn't prioritise refusal of local authority over other errors (#9831)
Fix #9020: Glitchy station coverage highlight when changing selection (#9825)
Fix: Correct some Romanian town names (#9819)
Fix: Original music playback rate was slightly too fast (#9814)
Fix #9811: Use the NewGRF-defined vehicle center when dragging ships and aircraft (#9812)
Fix: Do not let shares in the company taking over another company disappear (#9808)
Fix #9802: Crash when using lots of NewGRF waypoint types (#9803)
Fix #9766: Don't write uninitialised data in config file (#9767)
Fix #9743: [MacOS] Don't try to render touchbar sprites with invalid zoom level (#9776)
Fix #9774: Building roadstop in estimation mode updates station acceptance (#9775)
Fix: If vehicles only refit to cargo-slots >= 32, the default cargo was wrong (#9744)
Fix #9735: Possible desync when replacing a depot on same tile (#9738)
Fix #9730: [Network] Connections can use an invalid socket due to a race condition (#9731)
Fix: Don't show sign edit window for GS-owned signs (#9716)
Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704)
Fix #9680: Crash when loading really old savegames with aircraft in certain places (#9699)
Fix: Update last servicing dates when using the date cheat (#9694)
Fix: Error message shows about missing glyphs while suitable fallback font is found (#9692)


12.1 (2021-11-08)
------------------------------------------------------------------------
Feature: Button to toggle showing advanced signal types (#9617)
Expand Down
5 changes: 5 additions & 0 deletions cmake/CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ macro(compile_flags)
add_link_options(
"$<$<NOT:$<CONFIG:Debug>>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_link_options(
"$<$<CONFIG:Debug>:-Wl,--disable-dynamicbase,--disable-high-entropy-va,--default-image-base-low>" # ASLR somehow breaks linking for x64 Debug builds
)
endif()
endif()

# Prepare a generator that checks if we are not a debug, and don't have asserts
Expand Down
1 change: 1 addition & 0 deletions media/baseset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(BASESET_OTHER_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/openttd.grf
${CMAKE_CURRENT_SOURCE_DIR}/opntitle.dat
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd.32.bmp
)

# Done by the subdirectories, if nforenum / grfcodec is installed
Expand Down
2 changes: 1 addition & 1 deletion os/emscripten/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM emscripten/emsdk:2.0.31
FROM emscripten/emsdk:2.0.34

COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
2 changes: 1 addition & 1 deletion os/emscripten/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Next, build the game with emscripten:

```
mkdir build
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=$(pwd)/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j5
```

Expand Down
2 changes: 2 additions & 0 deletions os/macosx/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>LSMinimumSystemVersion</key>
<string>10.14.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion os/windows/sign.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM URL of the timestamp server
IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com)

REM Sign with SHA-1 for Windows 7 and below
"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% %1
"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% -fd sha1 %1

REM Sign with SHA-256 for Windows 8 and above
"%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1
2 changes: 2 additions & 0 deletions src/cheat_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "company_func.h"
#include "date_func.h"
#include "saveload/saveload.h"
#include "vehicle_base.h"
#include "textbuf_gui.h"
#include "window_gui.h"
#include "string_func.h"
Expand Down Expand Up @@ -106,6 +107,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
if (p1 == _cur_year) return _cur_year;

Date new_date = ConvertYMDToDate(p1, ymd.month, ymd.day);
for (auto v : Vehicle::Iterate()) v->ShiftDates(new_date - _date);
LinkGraphSchedule::instance.ShiftDates(new_date - _date);
SetDate(new_date, _date_fract);
EnginesMonthlyLoop();
Expand Down
62 changes: 32 additions & 30 deletions src/citymania/cm_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,38 @@

#include "../safeguards.h"


struct StringSpriteToDraw {
StringID string;
Colours colour;
int32 x;
int32 y;
uint64 params[2];
uint16 width;
};

struct TileSpriteToDraw {
SpriteID image;
PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x; ///< screen X coordinate of sprite
int32 y; ///< screen Y coordinate of sprite
};

struct ChildScreenSpriteToDraw {
SpriteID image;
PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x;
int32 y;
int next; ///< next child to draw (-1 at the end)
};

typedef std::vector<TileSpriteToDraw> TileSpriteToDrawVector;
typedef std::vector<ParentSpriteToDraw> ParentSpriteToDrawVector;
typedef std::vector<ChildScreenSpriteToDraw> ChildScreenSpriteToDrawVector;


namespace citymania {

extern SpriteID (*GetDefaultTrainSprite)(uint8, Direction); // train_cmd.cpp
Expand Down Expand Up @@ -303,36 +335,6 @@ void ExportOpenttdData(const std::string &filename) {
data_export::WriteEngineInfo(j);
}

struct StringSpriteToDraw {
StringID string;
Colours colour;
int32 x;
int32 y;
uint64 params[2];
uint16 width;
};

struct TileSpriteToDraw {
SpriteID image;
PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x; ///< screen X coordinate of sprite
int32 y; ///< screen Y coordinate of sprite
};

struct ChildScreenSpriteToDraw {
SpriteID image;
PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x;
int32 y;
int next; ///< next child to draw (-1 at the end)
};

typedef std::vector<TileSpriteToDraw> TileSpriteToDrawVector;
typedef std::vector<ParentSpriteToDraw> ParentSpriteToDrawVector;
typedef std::vector<ChildScreenSpriteToDraw> ChildScreenSpriteToDrawVector;

extern void ViewportExportDrawBegin(const Viewport *vp, int left, int top, int right, int bottom);
extern void ViewportExportDrawEnd();

Expand Down
15 changes: 8 additions & 7 deletions src/core/bitmath_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const uint8 _ffb_64[64] = {
};

/**
* Search the first set bit in a 32 bit variable.
* Search the first set bit in a 64 bit variable.
*
* This algorithm is a static implementation of a log
* congruence search algorithm. It checks the first half
Expand All @@ -34,19 +34,20 @@ const uint8 _ffb_64[64] = {
* @param x The value to search
* @return The position of the first bit set
*/
uint8 FindFirstBit(uint32 x)
uint8 FindFirstBit(uint64 x)
{
if (x == 0) return 0;
/* The macro FIND_FIRST_BIT is better to use when your x is
not more than 128. */

uint8 pos = 0;

if ((x & 0x0000ffff) == 0) { x >>= 16; pos += 16; }
if ((x & 0x000000ff) == 0) { x >>= 8; pos += 8; }
if ((x & 0x0000000f) == 0) { x >>= 4; pos += 4; }
if ((x & 0x00000003) == 0) { x >>= 2; pos += 2; }
if ((x & 0x00000001) == 0) { pos += 1; }
if ((x & 0xffffffffULL) == 0) { x >>= 32; pos += 32; }
if ((x & 0x0000ffffULL) == 0) { x >>= 16; pos += 16; }
if ((x & 0x000000ffULL) == 0) { x >>= 8; pos += 8; }
if ((x & 0x0000000fULL) == 0) { x >>= 4; pos += 4; }
if ((x & 0x00000003ULL) == 0) { x >>= 2; pos += 2; }
if ((x & 0x00000001ULL) == 0) { pos += 1; }

return pos;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/bitmath_func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static inline uint8 FindFirstBit2x64(const int value)
}
}

uint8 FindFirstBit(uint32 x);
uint8 FindFirstBit(uint64 x);
uint8 FindLastBit(uint64 x);

/**
Expand Down
Loading

0 comments on commit dc09cd9

Please sign in to comment.