Merge branch 'cpp-11' into save_ext

# Conflicts:
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
save_ext
Jonathan G Rennison 5 years ago
commit 7f80884047

3
.gitignore vendored

@ -13,6 +13,9 @@ bin/baseset/*
!bin/baseset/no_sound.obs
!bin/baseset/no_music.obm
!bin/baseset/orig_*.obm
!bin/game
bin/game/*
!bin/game/compat*.nut
!bin/scripts
bin/scripts/*
!bin/scripts/*.example

@ -289,16 +289,15 @@ EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = ENABLE_NETWORK \
WITH_ZLIB \
PREDEFINED = WITH_ZLIB \
WITH_LZO \
WITH_LZMA \
WITH_LIBLZMA \
WITH_SDL \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \
WITH_ICU_SORT \
WITH_ICU_LAYOUT \
WITH_ICU_I18N \
WITH_ICU_LX \
UNICODE \
_UNICODE \
_GNU_SOURCE \

@ -89,12 +89,6 @@ ifdef MENU_DIR
endif
ifeq ($(TTD), openttd.exe)
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
ifeq ($(OS), DOS)
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
ifndef STRIP
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.exe" "$(TTD_DIR)/"
endif
endif
endif
### Packing the current bundle into several compressed file formats ###

@ -92,6 +92,7 @@ VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
ISODATE := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
GITHASH := $(shell echo "$(VERSIONS)" | cut -f 4 -d' ')
ISTAG := $(shell echo "$(VERSIONS)" | cut -f 5 -d' ')
ISSTABLETAG := $(shell echo "$(VERSIONS)" | cut -f 6 -d' ')
# Make sure we have something in VERSION and ISODATE
ifeq ($(VERSION),)
@ -138,7 +139,7 @@ $(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.rc=%.rc)'
@ -248,7 +249,7 @@ $(filter %sse4.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)$(CC_HOST) $(CFLAGS) -c -o $@ $<
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
$(OBJS_RC): %.o: $(SRC_DIR)/%.rc $(FILE_DEP)
$(E) '$(STAGE) Compiling resource $(<:$(SRC_DIR)/%.rc=%.rc)'
@ -269,18 +270,14 @@ $(TTD): $(OBJS) $(CONFIG_CACHE_LINKER)
ifdef STRIP
$(Q)$(STRIP) $@
endif
ifeq ($(OS), DOS)
$(E) '$(STAGE) Adding CWSDPMI stub to $@'
$(Q)$(ROOT_DIR)/os/dos/make_dos_binary_selfcontained.sh $(SRC_OBJS_DIR)/$@
endif
# Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g" > $(SRC_DIR)/rev.cpp
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/rev.cpp
$(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in
$(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc
$(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc
FORCE:

@ -152,12 +152,10 @@ OpenTTD has been ported to several platforms and operating systems. It should
not be very difficult to port it to a new platform. The currently working
platforms are:
- BeOS (SDL or Allegro)
- DOS (Allegro)
- FreeBSD (SDL)
- Haiku (SDL)
- Linux (SDL or Allegro)
- macOS (universal) (Cocoa video and sound drivers)
- MorphOS (SDL)
- OpenBSD (SDL)
- OS/2 (SDL)
- Windows (Win32 GDI (faster) or SDL or Allegro)
@ -310,22 +308,22 @@ your operating system:
Different types of data or extensions go into different subdirectories of the
chosen main OpenTTD directory:
| data type | directory | additional info |
| --- | --- | --- |
| Config File | (no subdirectory) | |
| Screenshots | screenshot | |
| Base Graphics | baseset | (or a subdirectory thereof) |
| Sound Sets | baseset | (or a subdirectory thereof) |
| NewGRFs | newgrf | (or a subdirectory thereof) |
| 32bpp Sets | newgrf | (or a subdirectory thereof) |
| Music Sets | baseset | (or a subdirectory thereof) |
| AIs | ai | (or a subdirectory thereof) |
| AI Libraries | ai/library | (or a subdirectory thereof) |
| Game Scripts (GS) | game | (or a subdirectory thereof) |
| GS Libraries | game/library | (or a subdirectory thereof) |
| Savegames | save | |
| Automatic Savegames | save/autosave | |
| Scenarios | scenario | |
| data type | directory | additional info |
| ------------------- | ----------------- | --------------------------- |
| Config File | (no subdirectory) | |
| Screenshots | screenshot | |
| Base Graphics | baseset | (or a subdirectory thereof) |
| Sound Sets | baseset | (or a subdirectory thereof) |
| NewGRFs | newgrf | (or a subdirectory thereof) |
| 32bpp Sets | newgrf | (or a subdirectory thereof) |
| Music Sets | baseset | (or a subdirectory thereof) |
| AIs | ai | (or a subdirectory thereof) |
| AI Libraries | ai/library | (or a subdirectory thereof) |
| Game Scripts (GS) | game | (or a subdirectory thereof) |
| GS Libraries | game/library | (or a subdirectory thereof) |
| Savegames | save | |
| Automatic Savegames | save/autosave | |
| Scenarios | scenario | |
The (automatically created) directory content_download is for OpenTTD's internal
use and no files should be added to it or its subdirectories manually.
@ -476,6 +474,12 @@ The following is an explanation of the different statistics:
- *World ticks* - Time spent on other world/landscape processing. This
includes towns growing, building animations, updates of farmland and trees,
and station rating updates.
- *GS/AI total*, *Game script*, and *AI players* - Time spent running logic
for game scripts and AI players. The total may show as less than the current
sum of the individual scripts, this is because AI players at lower
difficulty settings do not run every game tick, and hence contribute less
to the average across all ticks. Keep in mind that the "Current" figure is
also an average, just only over short term.
- *Link graph delay* - Time overruns of the cargo distribution link graph
update thread. Usually the link graph is updated in a background thread,
but these updates need to synchronise with the main game loop occasionally,
@ -516,7 +520,7 @@ and it should build automatically. In case you want to build with SDL support
you need to add WITH_SDL to the project settings.
PNG (WITH_PNG), ZLIB (WITH_ZLIB), LZO (WITH_LZO), Freetype (WITH_FREETYPE) and
LZMA (WITH_LZMA) support is enabled by default. For these to work you need their
libLZMA (WITH_LIBLZMA) support is enabled by default. For these to work you need their
development files. To get them just use vcpkg from https://github.com/Microsoft/vcpkg
using x86-windows-static and x64-windows-static triplets.
For more help with VS see docs/Readme_Windows_MSVC.md.
@ -541,33 +545,15 @@ However, for the first build one has to do a '`./configure`' first.
To make a universal binary type '`./configure --enabled-universal`'
instead of '`./configure`'.
### BeOS:
### Haiku:
Use '`make`', but do a '`./configure`' before the first build.
### MorphOS:
Use '`make`'. However, for the first build one has to do a '`./configure`'
first. Note that you need the MorphOS SDK, latest libnix updates (else C++
parts of OpenTTD will not build) and the powersdl.library SDK. Optionally libz,
libpng and freetype2 developer files.
### OS/2:
A comprehensive GNU build environment is required to build the OS/2 version.
See the docs/Readme_OS2.txt file for more information.
### DOS:
A build environment with DJGPP is needed as well as libraries such as
Allegro, zlib and libpng, which all can be downloaded from the DJGPP
website. Compilation is straight forward: use '`make`', but do a '`./configure`'
before the first build. The build binary will need cwsdpmi.exe to be in
the same directory as the openttd executable. cwsdpmi.exe can be found in
the os/dos/cwsdpmi subdirectory. If you compile with stripping turned on a
binary will be generated that does not need cwsdpmi.exe by adding the
cswdstub.exe to the created OpenTTD binary.
### 7.1) Required/optional libraries
The following libraries are used by OpenTTD for:
@ -754,16 +740,6 @@ License 2.1, and partly under the (3-clause) BSD license. The exact licensing
terms can be found in src/3rdparty/os2/getaddrinfo.c resp.
src/3rdparty/os2/getnameinfo.c.
The exe2coff implementation in os/dos/exe2coff is available under the
GPL, with a number of additional terms. See os/dos/exe2coff/copying and
os/dos/exe2coff/copying.dj for the exact licensing terms.
The CWSDPMI implementation in os/dos/cwsdpmi is distributed under a
custom binary-only license that prohibits modification. The exact
licensing terms can be found in os/dos/cwsdpmi/cwsdpmi.txt. The sources
for these files can be downloaded at its author site, at
http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi5s.zip.
CONTRIBUTING.md is adapted from
[Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
under the [Creative Commons Attribution 3.0 Unported

@ -1,7 +1,9 @@
trigger:
- master
- release/*
pr:
- master
- release/*
jobs:
- job: windows
@ -55,6 +57,9 @@ jobs:
pool:
vmImage: 'macOS-10.13'
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: azure-pipelines/templates/ci-git-rebase.yml
- template: azure-pipelines/templates/osx-dependencies.yml

@ -1,9 +1,10 @@
steps:
# Rebase to origin/master for every PR. This means users don't have to
# rebase every time master changes. As long as the PR applies cleanly, we
# Rebase to target branch for every PR. This means users don't have to
# rebase every time target branch changes. As long as the PR applies cleanly, we
# will validate it.
- script: |
- bash: |
git config user.email 'info@openttd.org'
git config user.name 'OpenTTD CI'
git rebase origin/master
displayName: 'Rebase to master'
git rebase origin/${SYSTEM_PULLREQUEST_TARGETBRANCH}
displayName: 'Rebase to target branch'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

@ -4,11 +4,27 @@ parameters:
ContainerCommand: ''
steps:
# 'envVars' in the 'Docker@1' task is a bit funky. When you want to use a
# variable, you have to quote it. But the quote is also sent directly to
# Docker and ends up in the variable, which you don't want. To work around
# this, we set the correct variable first (which becomes an env-variable), and
# pass that env-variable through to Docker. We cannot use the normal
# 'variables' entry, as we are a template. So that results in this bit of
# Bash code. Not because it is pretty, but it is the only way we found that
# works.
- bash: |
echo "##vso[task.setvariable variable=TARGET_BRANCH]${SYSTEM_PULLREQUEST_TARGETBRANCH}"
echo "Target branch is ${SYSTEM_PULLREQUEST_TARGETBRANCH}"
displayName: "Set target branch"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- task: Docker@1
${{ if eq(parameters.Image, 'compile-farm') }}:
displayName: 'Build'
${{ if eq(parameters.Image, 'compile-farm-ci') }}:
displayName: 'Build and test'
# Run the commit-checker only if it is a Pull Request
condition: and(succeeded(), or(ne(variables['Agent.JobName'], 'commit-checker'), eq(variables['Build.Reason'], 'PullRequest')))
inputs:
command: 'Run an image'
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
@ -16,3 +32,5 @@ steps:
workingDirectory: '$(Build.SourcesDirectory)'
containerCommand: ${{ parameters.ContainerCommand }}
runInBackground: false
envVars: |
TARGET_BRANCH

@ -1,11 +1,12 @@
steps:
- script: |
set -ex
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng freetype
# Remove the dynamic libraries of these libraries, to ensure we use
# the static versions. That is important, as it is unlikely any
# end-user has these brew libraries installed.
rm /usr/local/Cellar/lzo/*/lib/*.dylib
rm /usr/local/Cellar/xz/*/lib/*.dylib
rm /usr/local/Cellar/libpng/*/lib/*.dylib
rm /usr/local/Cellar/freetype/*/lib/*.dylib
displayName: 'Install dependencies'

@ -135,6 +135,9 @@ jobs:
vmImage: 'macOS-10.13'
dependsOn: source
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: release-fetch-source.yml
- template: osx-dependencies.yml

@ -1,10 +1,14 @@
steps:
- bash: |
set -ex
curl -L https://github.com/OpenTTD/CompileFarm/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip
unzip windows-dependencies.zip
rm -f windows-dependencies.zip
displayName: 'Download dependencies'
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install
mv windows-dependencies/installed /c/vcpkg/
rm -rf windows-dependencies
displayName: 'Install dependencies'
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: c:\vcpkg\vcpkg.exe integrate install
displayName: 'Integrate vcpkg'

@ -374,3 +374,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -126,3 +126,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -63,3 +63,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -0,0 +1,8 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -15,3 +15,10 @@ AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

@ -6,3 +6,5 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.9 API compatibility in effect.");

@ -6,7 +6,7 @@ class Regression extends AIInfo {
function GetShortName() { return "REGR"; }
function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
function GetVersion() { return 1; }
function GetAPIVersion() { return "1.9"; }
function GetAPIVersion() { return "1.10"; }
function GetDate() { return "2007-03-18"; }
function CreateInstance() { return "Regression"; }
}

@ -574,7 +574,7 @@ function Regression::Group()
local vehicle = AIVehicle.BuildVehicle(10000, 116);
print(" AIVehicle.BuildVehicle(): " + vehicle);
print(" GetNumEngines(): " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
local group = AIGroup.CreateGroup(AIVehicle.VT_ROAD);
local group = AIGroup.CreateGroup(AIVehicle.VT_ROAD, AIGroup.GROUP_INVALID);
print(" CreateGroup(): " + group);
print(" MoveVehicle(): " + AIGroup.MoveVehicle(group, vehicle));
print(" GetNumEngines(): " + AIGroup.GetNumEngines(group, 116));
@ -1704,6 +1704,19 @@ function Regression::Vehicle()
print(" GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17 3));
print(" GetWagonAge(): " + AIVehicle.GetWagonAge(17, 3));
print(" --Refit--");
print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 255));
print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 0));
print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 9));
print(" BuildVehicleWithRefit(): " + AIVehicle.BuildVehicleWithRefit(28479, 211, 9));
print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9));
print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5));
print(" GetRefitCapacity(): " + AIVehicle.GetRefitCapacity(20, 5));
print(" RefitVehicle(): " + AIVehicle.RefitVehicle(20, 5));
print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9));
print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5));
print(" SellVehicle(): " + AIVehicle.SellVehicle(20));
print(" --Errors--");
print(" RefitVehicle(): " + AIVehicle.RefitVehicle(12, 0));
print(" GetLastErrorString(): " + AIError.GetLastErrorString());

@ -8536,7 +8536,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
--TileList_IndustryProducing--
Count(): 92
Location ListDump:
46920 => 1
46919 => 1
46918 => 1
46917 => 1
@ -8545,7 +8544,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
46914 => 1
46913 => 1
46912 => 1
46911 => 1
46664 => 1
46663 => 1
46662 => 1
@ -8628,6 +8626,8 @@ ERROR: IsEnd() is invalid as Begin() is never called
44353 => 1
44352 => 1
44351 => 1
46920 => 0
46911 => 0
--TileList_StationType--
Count(): 4
@ -9128,6 +9128,18 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetWagonAge(): 0
GetWagonEngineType(): 65535
GetWagonAge(): -1
--Refit--
GetBuildWithRefitCapacity(): -1
GetBuildWithRefitCapacity(): 0
GetBuildWithRefitCapacity(): 160
BuildVehicleWithRefit(): 20
GetCapacity(): 160
GetCapacity(): 0
GetRefitCapacity(): 160
RefitVehicle(): true
GetCapacity(): 0
GetCapacity(): 160
SellVehicle(): true
--Errors--
RefitVehicle(): false
GetLastErrorString(): ERR_VEHICLE_NOT_IN_DEPOT
@ -9175,7 +9187,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
13 => 5489
12 => 5489
CurrentSpeed ListDump:
12 => 21
12 => 27
17 => 0
16 => 0
14 => 0

@ -0,0 +1,8 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

@ -6,3 +6,5 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.9 API compatibility in effect.");

@ -1,8 +1,66 @@
1.9.0-beta2 (2018-02-09)
1.9.0 (2019-04-01)
------------------------------------------------------------------------
- Fix #7411: Use industry production callback (if used) on initial industry cargo generation (#7412)
1.9.0-RC2 (2019-03-24)
------------------------------------------------------------------------
- Fix #7400: WaterClass for tree tiles was not converted for old saves preventing industry creation (#7405)
- Fix: Filtered file list did not scroll properly (#7402)
- Fix #7391: Don't invalidate go to depot orders of non-aircraft when invalidating hangar orders that happen to share IDs (#7392)
- Fix #7386: Measurement tooltip for tunnels, aqueducts & docks did not display or flickered (#7389)
- Fix: Wrong company performance rating when money exceeds INT_MAX (#7382)
- Fix: Permit loading of industry production callback with invalid cargo type (#7364)
- Fix: Spelling for a few real town names (#7338)
- Fix: Runway too short for large aircraft message should not depend on plane crashes setting (#7325)
- Fix #7334: Ship lost after crossing bridge due to path cache not being consumed while on final bridge end (#7335)
1.9.0-RC1 (2019-03-03)
------------------------------------------------------------------------
- Add: Various AI/GS functions for vehicle groups (#7225)
- Change: Synchronise introduction date and reliability randomness across vehicles with the same base introduction date (#7147)
- Change: Allow towns to build bridges over rails and one-way roads (#7291)
- Fix: Detection of coast tiles with trees on them (#7309)
- Fix: Emergency netsave saved the title game instead of the broken game in question (#7298)
- Fix: Company livery window showed incorrect groups when opened in multiplayer (#7288)
- Fix: Unable to select last group in open livery window (#7283)
- Fix: Goto hangar orders were not invalidated when rebuilding airports (#7100)
1.9.0-beta3 (2019-02-24)
------------------------------------------------------------------------
- Feature: Option to adjust font size separately from GUI size (#7003)
- Feature: Increase maximum number of orders from 64000 to ~16.7m (#7220)
- Add: Show performance of AI and GS in framerate window
- Add: News menu entry and shortcut for deleting all messages (#7240)
- Change: [OSX] Improved scrolling behaviour when using touchpads
- Change: Add scrollbar to cargo legend in cargo payment rates window
- Change: Owner of vehicle with exclusive transport rights may now load cargo from neutral stations (#7256)
- Change: Improved UI behaviour when dragging sound volume sliders with the mouse (#7227)
- Change: Use selected vehicle group as parent when creating a new group (#7224)
- Change: Use SlErrorCorrupt() on pool index error when loading a savegame, instead of terminating (#7219)
- Change: Skip reliability decay if servicing is disabled
- Fix: Remove desert around lakes upon generation
- Fix: Re-sorting file list did not update filtered rows
- Fix #7159: Waiting time at red one-way signals was too short
- Fix #7189: Fluidsynth volume gain too high
- Fix #7004: Cargo flow legend was not properly refreshed after zooming (#7265)
- Fix: Possibility to modify wrong AI/GS settings when switching AI/GS scripts around (#7090, #7091)
- Fix: Use more descriptive "spectator" strings for story book and goal dropdown menus
- Fix #6599: Disable build and rename button in build vehicle window when no vehicle is selected
- Fix: Do not mangle tagged revision strings for network revision strings
- Fix #7151: AI start date deviation was still applied when not set to a random AI (#7223)
- Fix #7197: Invalidate depot buttons when necessary (#7212)
- Doc: [AI] UnshareOrders empties the orders list of the vehicle
1.9.0-beta2 (2019-02-09)
------------------------------------------------------------------------
- Fix: Non-Windows builds did not get correct git hash
1.9.0-beta1 (2018-02-09)
1.9.0-beta1 (2019-02-09)
------------------------------------------------------------------------
Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbers have been replaced with Pull Requests and Issue numbers
- Feature: Group liveries, and livery window usability enhancements (#7108)

@ -52,7 +52,6 @@ set_default() {
enable_profiling="0"
enable_lto="0"
enable_dedicated="0"
enable_network="1"
enable_static="1"
enable_translator="0"
enable_unicode="1"
@ -82,7 +81,6 @@ set_default() {
with_iconv="1"
with_midi=""
with_midi_arg=""
with_libtimidity="1"
with_fluidsynth="1"
with_freetype="1"
with_fontconfig="1"
@ -131,7 +129,6 @@ set_default() {
enable_profiling
enable_lto
enable_dedicated
enable_network
enable_static
enable_translator
enable_unicode
@ -160,7 +157,6 @@ set_default() {
with_iconv
with_midi
with_midi_arg
with_libtimidity
with_fluidsynth
with_freetype
with_fontconfig
@ -291,9 +287,6 @@ detect_params() {
--enable-ipo=*) enable_lto="$optarg";;
--enable-dedicated) enable_dedicated="1";;
--enable-dedicated=*) enable_dedicated="$optarg";;
--enable-network) enable_network="2";;
--enable-network=*) enable_network="$optarg";;
--disable-network) enable_network="0";;
--disable-static) enable_static="0";;
--enable-static) enable_static="2";;
--enable-static=*) enable_static="$optarg";;
@ -370,10 +363,6 @@ detect_params() {
--without-libpng) with_png="0";;
--with-libpng=*) with_png="$optarg";;
--with-libtimidity) with_libtimidity="2";;
--without-libtimidity) with_libtimidity="0";;
--with-libtimidity=*) with_libtimidity="$optarg";;
--with-fluidsynth) with_fluidsynth="2";;
--without-fluidsynth) with_fluidsynth="0";;
--with-fluidsynth=*) with_fluidsynth="$optarg";;
@ -559,10 +548,10 @@ check_params() {
# Check if all params have valid values
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS)$'`" ]; then
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, and OS2
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2)$'`" ]; then
log 1 "configure: error: invalid option --os=$os"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS]"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2]"
exit 1
fi
# cpu_type can be either 32 or 64
@ -629,7 +618,7 @@ check_params() {
detect_sse_capable_architecture
if [ "$enable_static" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
enable_static="2"
else
enable_static="0"
@ -639,8 +628,8 @@ check_params() {
if [ "$enable_static" != "0" ]; then
log 1 "checking static... yes"
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "DOS" ]; then
log 1 "WARNING: static is only known to work on Windows, DOS, MacOSX and MorphOS"
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ]; then
log 1 "WARNING: static is only known to work on Windows, and MacOSX"
log 1 "WARNING: use static at your own risk on this platform"
sleep 5
@ -650,7 +639,7 @@ check_params() {
fi
if [ "$enable_unicode" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
enable_unicode="2"
else
enable_unicode="0"
@ -755,11 +744,6 @@ check_params() {
if [ "$enable_dedicated" != "0" ]; then
log 1 "checking GDI video driver... dedicated server, skipping"
log 1 "checking dedicated... found"
if [ "$enable_network" = "0" ]; then
log 1 "configure: error: building a dedicated server without network support is pointless"
exit 1
fi
else
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
log 1 "checking GDI video driver... found"
@ -790,15 +774,6 @@ check_params() {
log 1 "checking console application... enabled"
fi
if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then
log 1 "checking network... DOS, skipping"
enable_network=0
elif [ "$enable_network" != "0" ]; then
log 1 "checking network... found"
else
log 1 "checking network... disabled"
fi
log 1 "checking squirrel... found"
SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
@ -820,7 +795,7 @@ check_params() {
pre_detect_with_zlib=$with_zlib
detect_zlib
if [ "$with_zlib" = "0" ] || [ -z "$zlib-config" ]; then
if [ "$with_zlib" = "0" ] || [ -z "$zlib_config" ]; then
log 1 "WARNING: zlib was not detected or disabled"
log 1 "WARNING: OpenTTD doesn't require zlib, but it does mean that many features"
log 1 "WARNING: (like loading most old savegames/scenarios, loading heightmaps,"
@ -895,7 +870,6 @@ check_params() {
detect_fontconfig
detect_icu_layout
detect_icu_sort
detect_libtimidity
detect_fluidsynth
if [ "$with_direct_music" != "0" ]; then
@ -939,9 +913,7 @@ check_params() {
fi
if [ "$enable_debug" = "0" ] && [ "$enable_profiling" = "0" ] && [ "$enable_strip" != "0" ]; then
if [ "$os" = "MORPHOS" ]; then
strip_arg="--strip-all --strip-unneeded --remove-section .comment"
elif [ "$os" = "OSX" ]; then
if [ "$os" = "OSX" ]; then
strip_arg=""
elif [ "$os" = "OS2" ]; then
strip_arg=""
@ -1032,10 +1004,6 @@ check_params() {
grfcodec=""
fi
if [ "$os" = "DOS" ]; then
with_threads="0"
fi
if [ "$os" != "OSX" ] && [ "$with_application_bundle" != "0" ]; then
if [ "$with_application_bundle" = "1" ]; then
with_application_bundle="0"
@ -1138,7 +1106,7 @@ check_params() {
fi
if [ "$personal_dir" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ] || [ "$os" = "HAIKU" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "HAIKU" ]; then
personal_dir="OpenTTD"
elif [ "$os" = "OSX" ]; then
personal_dir="Documents/OpenTTD"
@ -1360,6 +1328,9 @@ make_compiler_cflags() {
# it happens when using the FOR_ALL_WINDOWS_FROM_BACK_FROM macro
flags="$flags -Wno-self-assign"
# warning: <something> is a C++11 extension
flags="$flags -Wno-c++11-extensions"
if [ "$cc_version" -lt "300" ]; then
# warning: equality comparison with extraneous parentheses
flags="$flags -Wno-parentheses"
@ -1541,10 +1512,6 @@ make_cflags_and_ldflags() {
if [ "$enable_debug" = "0" ]; then
# No debug, add default stuff
OBJS_SUBDIR="release"
if [ "$os" = "MORPHOS" ]; then
CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
LDFLAGS="$LDFLAGS -noixemul"
fi
if [ "$enable_profiling" = "0" ]; then
# -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
@ -1633,19 +1600,14 @@ make_cflags_and_ldflags() {
fi
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "OS2" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread"
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ]; then
LIBS="$LIBS -lc"
fi
if [ "$os" = "MORPHOS" ]; then
# -Wstrict-prototypes generates much noise because of system headers
CFLAGS="$CFLAGS -Wno-strict-prototypes"
fi
if [ "$os" = "OPENBSD" ]; then
LIBS="$LIBS -pthread"
fi
@ -1669,12 +1631,12 @@ make_cflags_and_ldflags() {
fi
fi
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ]; then
if [ "$os" = "HAIKU" ]; then
LIBS="$LIBS -lmidi -lbe"
fi
# Most targets act like UNIX, just with some additions
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
if [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
CFLAGS="$CFLAGS -DUNIX"
fi
# And others like Windows
@ -1698,12 +1660,10 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_SDL"
# SDL must not add _GNU_SOURCE as it breaks many platforms
CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`"
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then
if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$sdl_config --static-libs`"
else
LIBS="$LIBS `$sdl_config --libs`"
fi
if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$sdl_config --static --libs`"
else
LIBS="$LIBS `$sdl_config --libs`"
fi
fi
@ -1731,7 +1691,7 @@ make_cflags_and_ldflags() {
fi
if [ -n "$lzma_config" ]; then
CFLAGS="$CFLAGS -DWITH_LZMA"
CFLAGS="$CFLAGS -DWITH_LIBLZMA"
CFLAGS="$CFLAGS `$lzma_config --cflags | tr '\n\r' ' '`"
if [ "$enable_static" != "0" ]; then
@ -1802,7 +1762,7 @@ make_cflags_and_ldflags() {
fi
if [ -n "$icu_layout_config" ]; then
CFLAGS="$CFLAGS -DWITH_ICU_LAYOUT"
CFLAGS="$CFLAGS -DWITH_ICU_LX"
CFLAGS="$CFLAGS `$icu_layout_config --cflags | tr '\n\r' ' '`"
if [ "$static_icu" != "0" ]; then
@ -1813,7 +1773,7 @@ make_cflags_and_ldflags() {
fi
if [ -n "$icu_sort_config" ]; then
CFLAGS="$CFLAGS -DWITH_ICU_SORT"
CFLAGS="$CFLAGS -DWITH_ICU_I18N"
CFLAGS="$CFLAGS `$icu_sort_config --cflags | tr '\n\r' ' '`"
if [ "$static_icu" != "0" ]; then
@ -1842,17 +1802,6 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_XAUDIO2"
fi
if [ -n "$libtimidity_config" ]; then
CFLAGS="$CFLAGS -DLIBTIMIDITY"
CFLAGS="$CFLAGS `$libtimidity_config --cflags | tr '\n\r' ' '`"
if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$libtimidity_config --libs --static | tr '\n\r' ' '`"
else
LIBS="$LIBS `$libtimidity_config --libs | tr '\n\r' ' '`"
fi
fi
if [ -n "$fluidsynth" ]; then
LIBS="$LIBS -lfluidsynth"
CFLAGS="$CFLAGS -DFLUIDSYNTH"
@ -1888,20 +1837,12 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"
fi
if [ "$enable_network" != "0" ]; then
CFLAGS="$CFLAGS -DENABLE_NETWORK"
if [ "$os" = "BEOS" ]; then
LDFLAGS="$LDFLAGS -lbind -lsocket"
fi
if [ "$os" = "HAIKU" ]; then
LDFLAGS="$LDFLAGS -lnetwork"
fi
if [ "$os" = "HAIKU" ]; then
LDFLAGS="$LDFLAGS -lnetwork"
fi
if [ "$os" = "SUNOS" ]; then
LDFLAGS="$LDFLAGS -lnsl -lsocket"
fi
if [ "$os" = "SUNOS" ]; then
LDFLAGS="$LDFLAGS -lnsl -lsocket"
fi
if [ "$enable_static" != "0" ]; then
@ -2380,7 +2321,7 @@ detect_awk() {
detect_os() {
if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and DOS
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, and OS2
# Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
@ -2391,15 +2332,12 @@ detect_os() {
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/haiku/ { print "HAIKU"; exit}
/sunos/ { print "SUNOS"; exit}
/solaris/ { print "SUNOS"; exit}
/cygwin/ { print "CYGWIN"; exit}
/mingw/ { print "MINGW"; exit}
/os2/ { print "OS2"; exit}
/dos/ { print "DOS"; exit}
'`
if [ -z "$os" ]; then
@ -2411,8 +2349,6 @@ detect_os() {
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/haiku/ { print "HAIKU"; exit}
/sunos/ { print "SUNOS"; exit}
/cygwin/ { print "CYGWIN"; exit}
@ -2425,7 +2361,7 @@ detect_os() {
if [ -z "$os" ]; then
log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --os=OS to force one"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, and OS2"
exit 1
fi
@ -2790,10 +2726,6 @@ detect_lzo2() {
detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h"
}
detect_libtimidity() {
detect_pkg_config "$with_libtimidity" "libtimidity" "libtimidity_config" "0.1" "1"
}
detect_fluidsynth() {
detect_library "$with_fluidsynth" "fluidsynth" "" "" "fluidsynth.h"
}
@ -3528,8 +3460,8 @@ showhelp() {
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
echo " NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
echo " MINGW/OS2/DOS/HAIKU"
echo " NETBSD/HPUX/SUNOS/CYGWIN/"
echo " MINGW/OS2/HAIKU"
echo ""
echo "Paths:"
echo " --prefix-dir=dir specifies the prefix for all installed"
@ -3583,7 +3515,6 @@ showhelp() {
echo " --enable-console compile as a console application instead of as a GUI application."
echo " If this setting is active, debug output will appear in the same"
echo " console instead of opening a new window. (Win32 ONLY)"
echo " --disable-network disable network support"
echo " --disable-assert disable asserts (continue on errors)"
echo " --enable-strip enable any possible stripping"
echo " --without-osx-sysroot disable the automatic adding of sysroot "
@ -3598,8 +3529,6 @@ showhelp() {
echo " --with-midi=midi define which midi-player to use"
echo " --with-midi-arg=arg define which args to use for the"
echo " midi-player"
echo " --with-libtimidity[=\"pkg-config libtimidity\"]"
echo " enables libtimidity support"
echo " --with-fluidsynth enables fluidsynth support"
echo " --with-allegro[=\"pkg-config allegro\"]"
echo " enables Allegro video driver support"

13
configure vendored

@ -75,7 +75,7 @@ save_params
make_cflags_and_ldflags
EXE=""
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then
EXE=".exe"
fi
@ -116,18 +116,15 @@ AWKCOMMAND='
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
if ($0 == "BEOS" && "'$os'" != "BEOS" &&
"'$os'" != "HAIKU") { next; }
if ($0 == "HAIKU" && "'$os'" != "HAIKU") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
if ($0 == "MORPHOS" && "'$os'" != "MORPHOS") { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
if ($0 == "FLUIDSYNTH" && "'$fluidsynth'" == "" ) { next; }
if ($0 == "HAVE_THREAD" && "'$with_threads'" == "0") { next; }
if ($0 == "SSE" && "'$with_sse'" != "1") { next; }
if ($0 == "USE_XAUDIO2" && "'$with_xaudio2'" == "0") { next; }
if ($0 == "USE_THREADS" && "'$with_threads'" == "0") { next; }
if ($0 == "USE_SSE" && "'$with_sse'" != "1") { next; }
skip += 1;

@ -759,6 +759,7 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bits 6..5: water class (sea or land)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
<li>m2 bits 8..6: ground
<table>

@ -194,7 +194,7 @@ the array so you can quickly see what is used and what is not.
<td class="caption">trees</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">O</span>XX<span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
<td class="bits"><span class="option">~~</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>

@ -83,9 +83,15 @@ if [ -d "$ROOT_DIR/.git" ]; then
if [ -n "$TAG" ]; then
VERSION="${TAG}"
ISTAG="1"
if [ -n "`echo \"${TAG}\" | grep \"^[0-9.]*$\"`" ]; then
ISSTABLETAG="1"
else
ISSTABLETAG="0"
fi
else
VERSION="${ISODATE}-${BRANCH}${hashprefix}${SHORTHASH}"
ISTAG="0"
ISSTABLETAG="0"
fi
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
@ -102,6 +108,7 @@ else
TAG=""
VERSION=""
ISTAG="0"
ISSTABLETAG="0"
fi
echo "$VERSION $ISODATE $MODIFIED $HASH $ISTAG"
echo "$VERSION $ISODATE $MODIFIED $HASH $ISTAG $ISSTABLETAG"

@ -1,6 +1,6 @@
OpenTTD's known bugs
Last updated: 2019-02-09
Release version: 1.9.0-beta2
Last updated: 2019-02-24
Release version: 1.9.0-beta3
------------------------------------------------------------------------

@ -1,3 +1,27 @@
openttd (1.9.0-0) unstable; urgency=low
* New upstream release 1.9.0
-- OpenTTD <info@openttd.org> Mon, 01 Apr 2019 00:00:00 +0200
openttd (1.9.0~RC2-0) unstable; urgency=low
* New upstream release 1.9.0-RC2
-- OpenTTD <info@openttd.org> Sun, 24 Mar 2019 23:00:00 +0000
openttd (1.9.0~RC1-0) unstable; urgency=low
* New upstream release 1.9.0-RC1
-- OpenTTD <info@openttd.org> Sun, 3 Mar 2019 23:00:00 +0000
openttd (1.9.0~beta3-0) unstable; urgency=low
* New upstream release 1.9.0-beta3
-- OpenTTD <info@openttd.org> Sun, 24 Feb 2019 23:00:00 +0000
openttd (1.9.0~beta2-0) unstable; urgency=low
* New upstream release 1.9.0-beta2

@ -1,3 +0,0 @@
The files in this directory are not licensed under the same terms as the
rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt
and in this directory or subdirectories as well.

Binary file not shown.

@ -1,173 +0,0 @@
CWSDPMI is Copyright (C) 1995-2000 Charles W Sandmann (sandmann@clio.rice.edu)
1206 Braelinn, Sugar Land, TX 77479
This is release 5. The files in this binary distribution may be redistributed
under the GPL (with source) or without the source code provided:
* CWSDPMI.EXE or CWSDPR0.EXE are not modified in any way except via CWSPARAM.
* CWSDSTUB.EXE internal contents are not modified in any way except via
CWSPARAM or STUBEDIT. It may have a COFF image plus data appended to it.
* Notice to users that they have the right to receive the source code and/or
binary updates for CWSDPMI. Distributors should indicate a site for the
source in their documentation.
-------------------------------------------------------------------------------
CWSDPMI was written to provide DPMI services for V2 of DJGPP. It currently
does not support 16-bit DPMI applications, or DPMI applications requiring a
built in extender. It does support virtual memory and hardware interrupt
reflection from real mode to protected mode. DJGPP V1.1x and RSX applications
will also run using this server, which can be used to provide enhanced control
over hardware interrupts. Some DPMI 1.0 extensions (0x506, 0x507, 0x508) have
been implemented.
CWSDPR0.EXE is an alternate version which runs at ring 0 with virtual memory
disabled. It may be used if access to ring-0 features are desired. It
currently does not switch stacks on HW interrupts, so some DJGPP features
such as SIGINT and SIGFPE are not supported and will generate a double fault
or stack fault error (to be fixed someday).
CWSDSTUB.EXE is a stub loader image for DJGPP which includes CWSDPMI. This
allows single executable image distributions. You can use the EXE2COFF
program and COPY /B CWSDSTUB.EXE+yourimage yourimage.exe to create a
standalone executable image.
Some of the internal tuning and configuration parameters may be modified
in the image using CWSPARAM.EXE (see CWSPARAM.DOC).
If you want to use CWSDPMI with DJGPP, you expand the distribution into the
DJGPP directory tree. CWSDPMI.EXE will be put in the BIN directory with your
DJGPP images and it will automatically be loaded when they run.
Directions for use (server can be used in either of two different ways):
1) "cwsdpmi" alone with no parameters will terminate and stay resident
FOR A SINGLE DPMI PROCESS. This means it unloads itself when your
DPMI application exits. This mode is useful in software which needs
DPMI services, since CWSDPMI can be exec'ed and then will unload on exit.
2) "cwsdpmi -p" will terminate and stay resident until you remove it.
It can be loaded into UMBs with LH. "cwsdpmi -u" will unload the TSR.
3) The file used for virtual memory swapping, if desired, is controlled
by the "-sc:\cwsdpmi.swp" syntax on the command line. You must specify
either a file with full disk/directory syntax, or "-s-" which disables
virtual memory.
4) The default swap file name is c:\cwsdpmi.swp, but this can be changed
with the CWSPARAM image, as can some other parameters.
5) You can disable the DPMI 1.0 extensions by starting the image with the
"cwsdpmi -x" syntax. This feature allows you to run programs developed
under other DPMI providers which do not behave properly with these
extensions enabled (typically use of NULL pointers).
I would like to give special thanks to DJ Delorie who wrote the original
GO32 code on which CWSDPMI is based. Morten Welinder also provided and
improved much of the code in this program.
-------------------------------------------------------------------------------
This section contains a list of the error messages you might see out of
CWSDPMI and some details on what they mean.
Exceptions are only handled by CWSDPMI if the application does not establish
an exception handler, exceptions nest 5 deep, or the error is particularly bad:
"Page fault" -
1) an illegal page fault happens in a RMCB or HW interrupt, (lock all pages!)
2) all available pages have been locked,
3) the application is using non-committed pages for null pointer protection.
"Double Fault" - multiple exceptions occurred
"Invalid TSS" - typically due to RMCB or HW interrupt being called after the
selectors/memory have been deallocated (remember to reset the mouse)
"General Protection Fault" - bad parameter sent to a DPMI call
"80386 required."
Since 80286 and lesser processors don't have the hardware necessary to
run CWSDPMI. No workaround, upgrade.
"DOS 3 required."
A few interrupts are used which need DOS 3.0 or higher. I don't expect to
ever see this message, since 80386 machines were introduced after DOS 3.0
and that check is made first.
"CWSDPMI V0.90+ (r5) Copyright (C) 2000 CW Sandmann ABSOLUTELY NO WARRANTY"
An informational message displayed if the program is not run in one-pass mode.
"Protected mode not accessible."
This message should only be displayed if running CWSDPMI in a protected
environment with no access to protected mode. In this case, DPMI should
already be available and CWSDPMI would not be needed. This might happen if
a 16-bit DPMI client is loaded and a DJGPP image attempts to load CWSDPMI
to provide 32-bit DPMI services under Windows.
"Warning: cannot open swap file c:\cwsdpmi.swp"
Maybe you are out of file handles, or the swap file name is incorrectly
specified in the image (change the name with cwsparam).
"No swap space!"
This message means you tried to use more paging file than CWSDPMI was
configured to handle. Since this is protected against in the memory
allocation code, you should never see this message.
"Swap disk full!"
This means the paging file could not be expanded when trying to page
memory out to disk. This would normally not be seen, unless you are
writing output to the same disk which holds the paging file. Decrease
the amount of memory your DPMI application is using or free up disk space.
"Interrupt 0x??"
Your application tried to call an interrupt from protected mode which
normally shouldn't be called (something like a data pointer). If the
request was allowed to continue it would likely hang your machine. If you
see this message and think the interrupt should be allowed to continue, let
me know.
"Error: Using XMS switched CPU into V86 mode."
This message might be seen if you have your memory manager in AUTO mode. The
only workaround in this case is to stop using AUTO mode.
"Error: could not allocate page table memory"
The page table memory (a minimum of 16Kb) is allocated from conventional
memory (either in the 640Kb region or UMBs). If CWSDPMI cannot allocate the
minimum necessary memory, you would see this message. Free up some
conventional memory. You may also see this message if a page directory needs
to be faulted in, and there are no available pages. This means too many pages
have been locked for the allocated page tables available. While CWSDPMI
tries to dynamically allocate these if needed, this effort failed. You need
to increase the number of page tables with CWSPARAM, or increase the amount
of free conventional memory if it is low. If the application which calls
CWSDPMI internally manages all the DOS memory, the page tables may need to
be pre-allocated at DPMI startup time (if this is needed, try using the
run option flag 2 in cwsparam).
"16-bit DPMI unsupported."
CWSDPMI is a 32-bit only DPMI server. Ideally, on the request to enter DPMI's
PM with a 16-bit request, we would just fail the call setting the carry bit
like the DPMI specification describes. Some buggy 16-bit compiler tools don't
check the return status and will hang the machine in this case. So, I issue
an error message and exit the image instead.
"Descriptors exhausted."
An attempt to nest a DPMI client failed in the setup phase due to insufficient
free selectors in the LDT.
"CWSDPMI not removed"
When the -u parameter is specified, if DPMI is not detected this message is
printed. Informational.

Binary file not shown.

@ -1,3 +0,0 @@
The files in this directory are not licensed under the same terms as the
rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt
and in this directory or subdirectories as well.

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -1,48 +0,0 @@
This is the file "copying.dj". It does NOT apply to any sources or
binaries copyrighted by UCB Berkeley, the Free Software Foundation, or
any other agency besides DJ Delorie and others who have agreed to
allow their sources to be distributed under these terms.
Copyright Information for sources and executables that are marked
Copyright (C) DJ Delorie
7 Kim Lane
Rochester NH 03867-2954
This document is Copyright (C) DJ Delorie and may be distributed
verbatim, but changing it is not allowed.
Source code copyright DJ Delorie is distributed under the terms of the
GNU General Public Licence, with the following exceptions:
* Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and
libemu.a are distributed under the terms of the GNU Library General
Public License, rather than the GNU GPL.
* Any existing copyright or authorship information in any given source
file must remain intact. If you modify a source file, a notice to that
effect must be added to the authorship information in the source file.
* Runtime binaries, as provided by DJ in DJGPP, may be distributed
without sources ONLY if the recipient is given sufficient information
to obtain a copy of djgpp themselves. This primarily applies to
go32-v2.exe, emu387.dxe, and stubedit.exe.
* Runtime objects and libraries, as provided by DJ in DJGPP, when
linked into an application, may be distributed without sources ONLY
if the recipient is given sufficient information to obtain a copy of
djgpp themselves. This primarily applies to crt0.o and libc.a.
-----
Changes to source code copyright BSD, FSF, or others, by DJ Delorie
fall under the terms of the original copyright. Such files usually
have multiple copyright notices in them.
A copy of the files "COPYING" and "COPYING.LIB" are included with this
document. If you did not receive a copy of these files, you may
obtain one from whence this document was obtained, or by writing:
Free Software Foundation
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA

@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

@ -1,94 +0,0 @@
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* Updated 2008 to use fread/fopen and friends instead of read/open so it compiles with GCC on Unix (Rubidium) */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
static void
exe2aout(char *fname)
{
unsigned short header[3];
FILE *ifile;
FILE *ofile;
char buf[4096];
int rbytes;
char *dot = strrchr(fname, '.');
if (!dot || strlen(dot) != 4
|| tolower(dot[1]) != 'e'
|| tolower(dot[2]) != 'x'
|| tolower(dot[3]) != 'e')
{
fprintf(stderr, "%s: Arguments MUST end with a .exe extension\n", fname);
return;
}
ifile = fopen(fname, "rb");
if (!ifile)
{
perror(fname);
return;
}
fread(header, sizeof(header), 1, ifile);
if (header[0] == 0x5a4d)
{
long header_offset = (long)header[2]*512L;
if (header[1])
header_offset += (long)header[1] - 512L;
fseek(ifile, header_offset, SEEK_SET);
header[0] = 0;
fread(header, sizeof(header), 1, ifile);
if ((header[0] != 0x010b) && (header[0] != 0x014c))
{
fprintf(stderr, "`%s' does not have a COFF/AOUT program appended to it\n", fname);
return;
}
fseek(ifile, header_offset, SEEK_SET);
}
else
{
fprintf(stderr, "`%s' is not an .EXE file\n", fname);
return;
}
*dot = 0;
ofile = fopen(fname, "w+b");
if (!ofile)
{
perror(fname);
return;
}
while ((rbytes=fread(buf, 1, 4096, ifile)) > 0)
{
int wb = fwrite(buf, 1, rbytes, ofile);
if (wb < 0)
{
perror(fname);
break;
}
if (wb < rbytes)
{
fprintf(stderr, "`%s': disk full\n", fname);
exit(1);
}
}
fclose(ifile);
fclose(ofile);
}
int
main(int argc, char **argv)
{
int i;
if (argc == 1) printf("Usage: %s <exename>", argv[0]);
for (i=1; i<argc; i++)
exe2aout(argv[i]);
return 0;
}

@ -1,11 +0,0 @@
#!/bin/sh
# $Id$
cd `dirname $0`
cc -o exe2coff/exe2coff exe2coff/exe2coff.c || exit
cp $1 binary.exe || exit
./exe2coff/exe2coff binary.exe || exit
cat cwsdpmi/cwsdstub.exe binary > binary.exe || exit
mv binary.exe $1
rm binary exe2coff/exe2coff

@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.9.0
set OPENTTD_VERSION=1.10.0
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=1.2.0

@ -17,9 +17,9 @@
#
Name: openttd
Version: 1.9.beta2
Version: 1.10.beta1
Release: 0
%define srcver 1.9.0-beta2
%define srcver 1.10.0-beta1
Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe
License: GPL-2.0
Group: Amusements/Games/Strategy/Other

@ -1,9 +1,9 @@
# Version numbers to update
!define APPV_MAJOR 1
!define APPV_MINOR 9
!define APPV_MINOR 10
!define APPV_MAINT 0
!define APPV_BUILD 1
!define APPV_EXTRA "-beta2"
!define APPV_BUILD 0
!define APPV_EXTRA "-beta1"
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
@ -24,6 +24,7 @@
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "top.bmp"
ManifestDPIAware true
BrandingText "OpenTTD Installer"
SetCompressor LZMA

@ -21,7 +21,7 @@ Sub FindReplaceInFile(filename, to_find, replacement)
file.Close
End Sub
Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, filename)
Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, isstabletag, filename)
FSO.CopyFile filename & ".in", filename
FindReplaceInFile filename, "!!MODIFIED!!", modified
FindReplaceInFile filename, "!!ISODATE!!", isodate
@ -29,10 +29,11 @@ Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, filename)
FindReplaceInFile filename, "!!DATE!!", cur_date
FindReplaceInFile filename, "!!GITHASH!!", githash
FindReplaceInFile filename, "!!ISTAG!!", istag
FindReplaceInFile filename, "!!ISSTABLETAG!!", isstabletag
End Sub
Sub UpdateFiles(version)
Dim modified, isodate, cur_date, githash, istag
Dim modified, isodate, cur_date, githash, istag, isstabletag
cur_date = DatePart("D", Date) & "." & DatePart("M", Date) & "." & DatePart("YYYY", Date)
If InStr(version, Chr(9)) Then
@ -41,20 +42,23 @@ Sub UpdateFiles(version)
modified = Mid(isodate, InStr(isodate, Chr(9)) + 1)
githash = Mid(modified, InStr(modified, Chr(9)) + 1)
istag = Mid(githash, InStr(githash, Chr(9)) + 1)
isstabletag = Mid(istag, InStr(istag, Chr(9)) + 1)
' Remove tails from fields
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
isodate = Mid(isodate, 1, InStr(isodate, Chr(9)) - 1)
modified = Mid(modified, 1, InStr(modified, Chr(9)) - 1)
githash = Mid(githash, 1, InStr(githash, Chr(9)) - 1)
istag = Mid(istag, 1, InStr(istag, Chr(9)) - 1)
Else
isodate = 0
modified = 1
githash = ""
istag = 0
isstabletag = 0
End If
UpdateFile modified, isodate, version, cur_date, githash, istag, "../src/rev.cpp"
UpdateFile modified, isodate, version, cur_date, githash, istag, "../src/os/windows/ottdres.rc"
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, "../src/rev.cpp"
UpdateFile modified, isodate, version, cur_date, githash, istag, isstabletag, "../src/os/windows/ottdres.rc"
End Sub
Function DetermineVersion()
@ -143,7 +147,7 @@ Function DetermineVersion()
DetermineVersion = "norev000"
modified = 1
Else
Dim version, hashprefix, istag
Dim version, hashprefix, istag, isstabletag
If modified = 0 Then
hashprefix = "-g"
ElseIf modified = 2 Then
@ -155,12 +159,21 @@ Function DetermineVersion()
If tag <> "" Then
version = tag
istag = 1
Set stable_regexp = New RegExp
stable_regexp.Pattern = "^[0-9.]*$"
If stable_regexp.Test(tag) Then
isstabletag = 1
Else
isstabletag = 0
End If
Else
version = isodate & "-" & branch & hashprefix & shorthash
istag = 0
isstabletag = 0
End If
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash & Chr(9) & istag
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash & Chr(9) & istag & Chr(9) & isstabletag
End If
End Function

@ -132,14 +132,14 @@ load_main_data() {
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
if ($0 == "BEOS" && "'$os'" != "BEOS") { next; }
if ($0 == "HAIKU" && "'$os'" != "HAIKU") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$enable_directmusic'" != "1") { next; }
if ($0 == "FLUIDSYNTH" && "'$enable_fluidsynth'" != "1") { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
if ($0 == "HAVE_THREAD" && "'$with_threads'" == "0") { next; }
if ($0 == "USE_XAUDIO2" && "'$with_xaudio2'" == "0") { next; }
if ($0 == "USE_THREADS" && "'$with_threads'" == "0") { next; }
skip += 1;

@ -179,8 +179,9 @@ Sub load_main_data(filename, ByRef vcxproj, ByRef filters, ByRef files)
line = "MSVC" Or _
line = "DIRECTMUSIC" Or _
line = "AI" Or _
line = "SSE" Or _
line = "HAVE_THREAD" _
line = "USE_SSE" Or _
line = "USE_XAUDIO2" Or _
line = "USE_THREADS" _
) Then skip = skip + 1
deep = deep + 1
Case "#"

@ -10,7 +10,6 @@
<ProjectName>generate</ProjectName>
<ProjectGuid>{2F31FD79-D1AC-43C4-89F3-B0D5E4E53E34}</ProjectGuid>
<RootNamespace>generate</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -410,7 +410,6 @@
<ClCompile Include="..\src\road.cpp" />
<ClCompile Include="..\src\roadstop.cpp" />
<ClCompile Include="..\src\screenshot.cpp" />
<ClCompile Include="..\src\sdl.cpp" />
<ClCompile Include="..\src\settings.cpp" />
<ClCompile Include="..\src\signal.cpp" />
<ClCompile Include="..\src\signs.cpp" />
@ -449,6 +448,7 @@
<ClInclude Include="..\src\base_media_base.h" />
<ClInclude Include="..\src\base_media_func.h" />
<ClInclude Include="..\src\base_station_base.h" />
<ClInclude Include="..\src\bitmap_type.h" />
<ClInclude Include="..\src\bmp.h" />
<ClInclude Include="..\src\bridge.h" />
<ClInclude Include="..\src\cargo_type.h" />
@ -624,7 +624,6 @@
<ClInclude Include="..\src\safeguards.h" />
<ClInclude Include="..\src\scope.h" />
<ClInclude Include="..\src\screenshot.h" />
<ClInclude Include="..\src\sdl.h" />
<ClInclude Include="..\src\sound\sdl_s.h" />
<ClInclude Include="..\src\video\sdl_v.h" />
<ClInclude Include="..\src\settings_func.h" />
@ -648,6 +647,7 @@
<ClInclude Include="..\src\station_base.h" />
<ClInclude Include="..\src\station_func.h" />
<ClInclude Include="..\src\station_gui.h" />
<ClInclude Include="..\src\station_kdtree.h" />
<ClInclude Include="..\src\station_type.h" />
<ClInclude Include="..\src\statusbar_gui.h" />
<ClInclude Include="..\src\stdafx.h" />
@ -682,6 +682,7 @@
<ClInclude Include="..\src\toolbar_gui.h" />
<ClInclude Include="..\src\town.h" />
<ClInclude Include="..\src\town_type.h" />
<ClInclude Include="..\src\town_kdtree.h" />
<ClInclude Include="..\src\townname_func.h" />
<ClInclude Include="..\src\townname_type.h" />
<ClInclude Include="..\src\track_func.h" />
@ -698,6 +699,7 @@
<ClInclude Include="..\src\vehicle_type.h" />
<ClInclude Include="..\src\vehiclelist.h" />
<ClInclude Include="..\src\viewport_func.h" />
<ClInclude Include="..\src\viewport_kdtree.h" />
<ClInclude Include="..\src\viewport_sprite_sorter.h" />
<ClInclude Include="..\src\viewport_type.h" />
<ClInclude Include="..\src\water.h" />
@ -728,6 +730,7 @@
<ClCompile Include="..\src\core\geometry_func.cpp" />
<ClInclude Include="..\src\core\geometry_func.hpp" />
<ClInclude Include="..\src\core\geometry_type.hpp" />
<ClInclude Include="..\src\core\kdtree.hpp" />
<ClCompile Include="..\src\core\math_func.cpp" />
<ClInclude Include="..\src\core\math_func.hpp" />
<ClInclude Include="..\src\core\mem_func.hpp" />
@ -1294,8 +1297,6 @@
<ClCompile Include="..\src\network\core\udp.cpp" />
<ClInclude Include="..\src\network\core\udp.h" />
<ClInclude Include="..\src\pathfinder\follow_track.hpp" />
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp" />
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_func.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_type.h" />
<ClInclude Include="..\src\pathfinder\pf_performance_timer.hpp" />
@ -1339,8 +1340,7 @@
<ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\string_uniscribe.cpp" />
<ClCompile Include="..\src\os\windows\win32.cpp" />
<ClInclude Include="..\src\thread\thread.h" />
<ClCompile Include="..\src\thread\thread_win32.cpp" />
<ClInclude Include="..\src\thread.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -318,9 +318,6 @@
<ClCompile Include="..\src\screenshot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -435,6 +432,9 @@
<ClInclude Include="..\src\base_station_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bitmap_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bmp.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -960,9 +960,6 @@
<ClInclude Include="..\src\screenshot.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sdl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sound\sdl_s.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1032,6 +1029,9 @@
<ClInclude Include="..\src\station_gui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_type.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1134,6 +1134,9 @@
<ClInclude Include="..\src\town_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\town_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\townname_func.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1182,6 +1185,9 @@
<ClInclude Include="..\src\viewport_func.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_sprite_sorter.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1272,6 +1278,9 @@
<ClInclude Include="..\src\core\geometry_type.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\kdtree.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClCompile Include="..\src\core\math_func.cpp">
<Filter>Core Source Code</Filter>
</ClCompile>
@ -2970,12 +2979,6 @@
<ClInclude Include="..\src\pathfinder\follow_track.hpp">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp">
<Filter>Pathfinder</Filter>
</ClCompile>
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClInclude Include="..\src\pathfinder\pathfinder_func.h">
<Filter>Pathfinder</Filter>
</ClInclude>
@ -3105,12 +3108,9 @@
<ClCompile Include="..\src\os\windows\win32.cpp">
<Filter>Windows files</Filter>
</ClCompile>
<ClInclude Include="..\src\thread\thread.h">
<ClInclude Include="..\src\thread.h">
<Filter>Threading</Filter>
</ClInclude>
<ClCompile Include="..\src\thread\thread_win32.cpp">
<Filter>Threading</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -410,7 +410,6 @@
<ClCompile Include="..\src\road.cpp" />
<ClCompile Include="..\src\roadstop.cpp" />
<ClCompile Include="..\src\screenshot.cpp" />
<ClCompile Include="..\src\sdl.cpp" />
<ClCompile Include="..\src\settings.cpp" />
<ClCompile Include="..\src\signal.cpp" />
<ClCompile Include="..\src\signs.cpp" />
@ -449,6 +448,7 @@
<ClInclude Include="..\src\base_media_base.h" />
<ClInclude Include="..\src\base_media_func.h" />
<ClInclude Include="..\src\base_station_base.h" />
<ClInclude Include="..\src\bitmap_type.h" />
<ClInclude Include="..\src\bmp.h" />
<ClInclude Include="..\src\bridge.h" />
<ClInclude Include="..\src\cargo_type.h" />
@ -624,7 +624,6 @@
<ClInclude Include="..\src\safeguards.h" />
<ClInclude Include="..\src\scope.h" />
<ClInclude Include="..\src\screenshot.h" />
<ClInclude Include="..\src\sdl.h" />
<ClInclude Include="..\src\sound\sdl_s.h" />
<ClInclude Include="..\src\video\sdl_v.h" />
<ClInclude Include="..\src\settings_func.h" />
@ -648,6 +647,7 @@
<ClInclude Include="..\src\station_base.h" />
<ClInclude Include="..\src\station_func.h" />
<ClInclude Include="..\src\station_gui.h" />
<ClInclude Include="..\src\station_kdtree.h" />
<ClInclude Include="..\src\station_type.h" />
<ClInclude Include="..\src\statusbar_gui.h" />
<ClInclude Include="..\src\stdafx.h" />
@ -682,6 +682,7 @@
<ClInclude Include="..\src\toolbar_gui.h" />
<ClInclude Include="..\src\town.h" />
<ClInclude Include="..\src\town_type.h" />
<ClInclude Include="..\src\town_kdtree.h" />
<ClInclude Include="..\src\townname_func.h" />
<ClInclude Include="..\src\townname_type.h" />
<ClInclude Include="..\src\track_func.h" />
@ -698,6 +699,7 @@
<ClInclude Include="..\src\vehicle_type.h" />
<ClInclude Include="..\src\vehiclelist.h" />
<ClInclude Include="..\src\viewport_func.h" />
<ClInclude Include="..\src\viewport_kdtree.h" />
<ClInclude Include="..\src\viewport_sprite_sorter.h" />
<ClInclude Include="..\src\viewport_type.h" />
<ClInclude Include="..\src\water.h" />
@ -728,6 +730,7 @@
<ClCompile Include="..\src\core\geometry_func.cpp" />
<ClInclude Include="..\src\core\geometry_func.hpp" />
<ClInclude Include="..\src\core\geometry_type.hpp" />
<ClInclude Include="..\src\core\kdtree.hpp" />
<ClCompile Include="..\src\core\math_func.cpp" />
<ClInclude Include="..\src\core\math_func.hpp" />
<ClInclude Include="..\src\core\mem_func.hpp" />
@ -1292,8 +1295,6 @@
<ClCompile Include="..\src\network\core\udp.cpp" />
<ClInclude Include="..\src\network\core\udp.h" />
<ClInclude Include="..\src\pathfinder\follow_track.hpp" />
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp" />
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_func.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_type.h" />
<ClInclude Include="..\src\pathfinder\pf_performance_timer.hpp" />
@ -1337,8 +1338,7 @@
<ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\string_uniscribe.cpp" />
<ClCompile Include="..\src\os\windows\win32.cpp" />
<ClInclude Include="..\src\thread\thread.h" />
<ClCompile Include="..\src\thread\thread_win32.cpp" />
<ClInclude Include="..\src\thread.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -318,9 +318,6 @@
<ClCompile Include="..\src\screenshot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -435,6 +432,9 @@
<ClInclude Include="..\src\base_station_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bitmap_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bmp.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -960,9 +960,6 @@
<ClInclude Include="..\src\screenshot.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sdl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sound\sdl_s.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1032,6 +1029,9 @@
<ClInclude Include="..\src\station_gui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_type.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1134,6 +1134,9 @@
<ClInclude Include="..\src\town_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\town_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\townname_func.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1182,6 +1185,9 @@
<ClInclude Include="..\src\viewport_func.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_sprite_sorter.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1272,6 +1278,9 @@
<ClInclude Include="..\src\core\geometry_type.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\kdtree.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClCompile Include="..\src\core\math_func.cpp">
<Filter>Core Source Code</Filter>
</ClCompile>
@ -2964,12 +2973,6 @@
<ClInclude Include="..\src\pathfinder\follow_track.hpp">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp">
<Filter>Pathfinder</Filter>
</ClCompile>
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClInclude Include="..\src\pathfinder\pathfinder_func.h">
<Filter>Pathfinder</Filter>
</ClInclude>
@ -3099,12 +3102,9 @@
<ClCompile Include="..\src\os\windows\win32.cpp">
<Filter>Windows files</Filter>
</ClCompile>
<ClInclude Include="..\src\thread\thread.h">
<ClInclude Include="..\src\thread.h">
<Filter>Threading</Filter>
</ClInclude>
<ClCompile Include="..\src\thread\thread_win32.cpp">
<Filter>Threading</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -410,7 +410,6 @@
<ClCompile Include="..\src\road.cpp" />
<ClCompile Include="..\src\roadstop.cpp" />
<ClCompile Include="..\src\screenshot.cpp" />
<ClCompile Include="..\src\sdl.cpp" />
<ClCompile Include="..\src\settings.cpp" />
<ClCompile Include="..\src\signal.cpp" />
<ClCompile Include="..\src\signs.cpp" />
@ -449,6 +448,7 @@
<ClInclude Include="..\src\base_media_base.h" />
<ClInclude Include="..\src\base_media_func.h" />
<ClInclude Include="..\src\base_station_base.h" />
<ClInclude Include="..\src\bitmap_type.h" />
<ClInclude Include="..\src\bmp.h" />
<ClInclude Include="..\src\bridge.h" />
<ClInclude Include="..\src\cargo_type.h" />
@ -622,8 +622,8 @@
<ClInclude Include="..\src\roadstop_base.h" />
<ClInclude Include="..\src\roadveh.h" />
<ClInclude Include="..\src\safeguards.h" />
<ClInclude Include="..\src\scope.h" />
<ClInclude Include="..\src\screenshot.h" />
<ClInclude Include="..\src\sdl.h" />
<ClInclude Include="..\src\sound\sdl_s.h" />
<ClInclude Include="..\src\video\sdl_v.h" />
<ClInclude Include="..\src\settings_func.h" />
@ -647,6 +647,7 @@
<ClInclude Include="..\src\station_base.h" />
<ClInclude Include="..\src\station_func.h" />
<ClInclude Include="..\src\station_gui.h" />
<ClInclude Include="..\src\station_kdtree.h" />
<ClInclude Include="..\src\station_type.h" />
<ClInclude Include="..\src\statusbar_gui.h" />
<ClInclude Include="..\src\stdafx.h" />
@ -681,6 +682,7 @@
<ClInclude Include="..\src\toolbar_gui.h" />
<ClInclude Include="..\src\town.h" />
<ClInclude Include="..\src\town_type.h" />
<ClInclude Include="..\src\town_kdtree.h" />
<ClInclude Include="..\src\townname_func.h" />
<ClInclude Include="..\src\townname_type.h" />
<ClInclude Include="..\src\track_func.h" />
@ -697,6 +699,7 @@
<ClInclude Include="..\src\vehicle_type.h" />
<ClInclude Include="..\src\vehiclelist.h" />
<ClInclude Include="..\src\viewport_func.h" />
<ClInclude Include="..\src\viewport_kdtree.h" />
<ClInclude Include="..\src\viewport_sprite_sorter.h" />
<ClInclude Include="..\src\viewport_type.h" />
<ClInclude Include="..\src\water.h" />
@ -719,12 +722,15 @@
<ClInclude Include="..\src\core\backup_type.hpp" />
<ClCompile Include="..\src\core\bitmath_func.cpp" />
<ClInclude Include="..\src\core\bitmath_func.hpp" />
<ClInclude Include="..\src\core\container_func.hpp" />
<ClInclude Include="..\src\core\dyn_arena_alloc.hpp" />
<ClInclude Include="..\src\core\endian_func.hpp" />
<ClInclude Include="..\src\core\endian_type.hpp" />
<ClInclude Include="..\src\core\enum_type.hpp" />
<ClCompile Include="..\src\core\geometry_func.cpp" />
<ClInclude Include="..\src\core\geometry_func.hpp" />
<ClInclude Include="..\src\core\geometry_type.hpp" />
<ClInclude Include="..\src\core\kdtree.hpp" />
<ClCompile Include="..\src\core\math_func.cpp" />
<ClInclude Include="..\src\core\math_func.hpp" />
<ClInclude Include="..\src\core\mem_func.hpp" />
@ -1288,8 +1294,6 @@
<ClCompile Include="..\src\network\core\udp.cpp" />
<ClInclude Include="..\src\network\core\udp.h" />
<ClInclude Include="..\src\pathfinder\follow_track.hpp" />
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp" />
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_func.h" />
<ClInclude Include="..\src\pathfinder\pathfinder_type.h" />
<ClInclude Include="..\src\pathfinder\pf_performance_timer.hpp" />
@ -1333,8 +1337,7 @@
<ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\string_uniscribe.cpp" />
<ClCompile Include="..\src\os\windows\win32.cpp" />
<ClInclude Include="..\src\thread\thread.h" />
<ClCompile Include="..\src\thread\thread_win32.cpp" />
<ClInclude Include="..\src\thread.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -318,9 +318,6 @@
<ClCompile Include="..\src\screenshot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -435,6 +432,9 @@
<ClInclude Include="..\src\base_station_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bitmap_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bmp.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -954,10 +954,10 @@
<ClInclude Include="..\src\safeguards.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\screenshot.h">
<ClInclude Include="..\src\scope.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sdl.h">
<ClInclude Include="..\src\screenshot.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sound\sdl_s.h">
@ -1029,6 +1029,9 @@
<ClInclude Include="..\src\station_gui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\station_type.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1131,6 +1134,9 @@
<ClInclude Include="..\src\town_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\town_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\townname_func.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1179,6 +1185,9 @@
<ClInclude Include="..\src\viewport_func.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_kdtree.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\viewport_sprite_sorter.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1245,6 +1254,12 @@
<ClInclude Include="..\src\core\bitmath_func.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\container_func.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\dyn_arena_alloc.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\endian_func.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
@ -1263,6 +1278,9 @@
<ClInclude Include="..\src\core\geometry_type.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClInclude Include="..\src\core\kdtree.hpp">
<Filter>Core Source Code</Filter>
</ClInclude>
<ClCompile Include="..\src\core\math_func.cpp">
<Filter>Core Source Code</Filter>
</ClCompile>
@ -2952,12 +2970,6 @@
<ClInclude Include="..\src\pathfinder\follow_track.hpp">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClCompile Include="..\src\pathfinder\opf\opf_ship.cpp">
<Filter>Pathfinder</Filter>
</ClCompile>
<ClInclude Include="..\src\pathfinder\opf\opf_ship.h">
<Filter>Pathfinder</Filter>
</ClInclude>
<ClInclude Include="..\src\pathfinder\pathfinder_func.h">
<Filter>Pathfinder</Filter>
</ClInclude>
@ -3087,12 +3099,9 @@
<ClCompile Include="..\src\os\windows\win32.cpp">
<Filter>Windows files</Filter>
</ClCompile>
<ClInclude Include="..\src\thread\thread.h">
<ClInclude Include="..\src\thread.h">
<Filter>Threading</Filter>
</ClInclude>
<ClCompile Include="..\src\thread\thread_win32.cpp">
<Filter>Threading</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />

@ -107,7 +107,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -172,7 +172,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -230,7 +230,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -293,7 +293,7 @@
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LIBLZMA;WITH_PNG;WITH_FREETYPE;WITH_UNISCRIBE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>

@ -10,7 +10,6 @@
<ProjectName>settingsgen</ProjectName>
<ProjectGuid>{E9548DE9-F089-49B7-93A6-30BE2CC311C7}</ProjectGuid>
<RootNamespace>settings</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

@ -10,7 +10,6 @@
<ProjectName>strgen</ProjectName>
<ProjectGuid>{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}</ProjectGuid>
<RootNamespace>strgen</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

@ -71,9 +71,6 @@ rev.cpp
road.cpp
roadstop.cpp
screenshot.cpp
#if SDL
sdl.cpp
#end
settings.cpp
signal.cpp
signs.cpp
@ -113,8 +110,8 @@ townname.cpp
vehicle.cpp
vehiclelist.cpp
viewport.cpp
#if SSE
viewport_sprite_sorter_sse4.cpp
#if USE_SSE
viewport_sprite_sorter_sse4.cpp
#end
waypoint.cpp
widget.cpp
@ -138,6 +135,7 @@ autoslope.h
base_media_base.h
base_media_func.h
base_station_base.h
bitmap_type.h
bmp.h
bridge.h
cargo_type.h
@ -313,7 +311,6 @@ roadveh.h
safeguards.h
scope.h
screenshot.h
sdl.h
sound/sdl_s.h
video/sdl_v.h
settings_func.h
@ -337,6 +334,7 @@ spritecache.h
station_base.h
station_func.h
station_gui.h
station_kdtree.h
station_type.h
statusbar_gui.h
stdafx.h
@ -372,6 +370,7 @@ timetable.h
toolbar_gui.h
town.h
town_type.h
town_kdtree.h
townname_func.h
townname_type.h
track_func.h
@ -388,6 +387,7 @@ vehicle_gui_base.h
vehicle_type.h
vehiclelist.h
viewport_func.h
viewport_kdtree.h
viewport_sprite_sorter.h
viewport_type.h
water.h
@ -406,20 +406,19 @@ zoom_func.h
zoom_type.h
#if WIN32
#else
music/bemidi.h
music/cocoa_m.h
music/extmidi.h
music/libtimidity.h
music/fluidsynth.h
music/os2_m.h
music/qtmidi.h
os/macosx/macos.h
os/macosx/osx_stdafx.h
os/macosx/splash.h
os/macosx/string_osx.h
sound/cocoa_s.h
video/cocoa/cocoa_keys.h
video/cocoa/cocoa_v.h
music/bemidi.h
music/cocoa_m.h
music/extmidi.h
music/fluidsynth.h
music/os2_m.h
music/qtmidi.h
os/macosx/macos.h
os/macosx/osx_stdafx.h
os/macosx/splash.h
os/macosx/string_osx.h
sound/cocoa_s.h
video/cocoa/cocoa_keys.h
video/cocoa/cocoa_v.h
#end
# Core Source Code
@ -437,6 +436,7 @@ core/enum_type.hpp
core/geometry_func.cpp
core/geometry_func.hpp
core/geometry_type.hpp
core/kdtree.hpp
core/math_func.cpp
core/math_func.hpp
core/mem_func.hpp
@ -924,36 +924,36 @@ script/api/script_window.cpp
# Blitters
#if DEDICATED
#else
blitter/32bpp_anim.cpp
blitter/32bpp_anim.hpp
#if SSE
blitter/32bpp_anim_sse2.cpp
blitter/32bpp_anim_sse2.hpp
blitter/32bpp_anim_sse4.cpp
blitter/32bpp_anim_sse4.hpp
#end
blitter/32bpp_base.cpp
blitter/32bpp_base.hpp
blitter/32bpp_optimized.cpp
blitter/32bpp_optimized.hpp
blitter/32bpp_simple.cpp
blitter/32bpp_simple.hpp
#if SSE
blitter/32bpp_sse_func.hpp
blitter/32bpp_sse_type.h
blitter/32bpp_sse2.cpp
blitter/32bpp_sse2.hpp
blitter/32bpp_sse4.cpp
blitter/32bpp_sse4.hpp
blitter/32bpp_ssse3.cpp
blitter/32bpp_ssse3.hpp
#end
blitter/8bpp_base.cpp
blitter/8bpp_base.hpp
blitter/8bpp_optimized.cpp
blitter/8bpp_optimized.hpp
blitter/8bpp_simple.cpp
blitter/8bpp_simple.hpp
blitter/32bpp_anim.cpp
blitter/32bpp_anim.hpp
#if USE_SSE
blitter/32bpp_anim_sse2.cpp
blitter/32bpp_anim_sse2.hpp
blitter/32bpp_anim_sse4.cpp
blitter/32bpp_anim_sse4.hpp
#end
blitter/32bpp_base.cpp
blitter/32bpp_base.hpp
blitter/32bpp_optimized.cpp
blitter/32bpp_optimized.hpp
blitter/32bpp_simple.cpp
blitter/32bpp_simple.hpp
#if USE_SSE
blitter/32bpp_sse_func.hpp
blitter/32bpp_sse_type.h
blitter/32bpp_sse2.cpp
blitter/32bpp_sse2.hpp
blitter/32bpp_sse4.cpp
blitter/32bpp_sse4.hpp
blitter/32bpp_ssse3.cpp
blitter/32bpp_ssse3.hpp
#end
blitter/8bpp_base.cpp
blitter/8bpp_base.hpp
blitter/8bpp_optimized.cpp
blitter/8bpp_optimized.hpp
blitter/8bpp_simple.cpp
blitter/8bpp_simple.hpp
#end
blitter/base.hpp
blitter/common.hpp
@ -1056,8 +1056,6 @@ network/core/udp.h
# Pathfinder
pathfinder/follow_track.hpp
pathfinder/opf/opf_ship.cpp
pathfinder/opf/opf_ship.h
pathfinder/pathfinder_func.h
pathfinder/pathfinder_type.h
pathfinder/pf_performance_timer.hpp
@ -1095,67 +1093,60 @@ video/dedicated_v.cpp
video/null_v.cpp
#if DEDICATED
#else
#if ALLEGRO
video/allegro_v.cpp
#end
#if SDL
video/sdl_v.cpp
#end
#if WIN32
video/win32_v.cpp
#end
#if ALLEGRO
video/allegro_v.cpp
#end
#if SDL
video/sdl_v.cpp
#end
#if WIN32
video/win32_v.cpp
#end
#end
# Music
#if DEDICATED
#else
#if ALLEGRO
music/allegro_m.cpp
#end
#if DIRECTMUSIC
music/dmusic.cpp
#end
#if ALLEGRO
music/allegro_m.cpp
#end
#if DIRECTMUSIC
music/dmusic.cpp
#end
#end
music/null_m.cpp
music/midifile.cpp
#if DEDICATED
#else
#if WIN32
music/win32_m.cpp
#else
#if DOS
#if WIN32
music/win32_m.cpp
#else
#if MORPHOS
#else
music/extmidi.cpp
#end
music/extmidi.cpp
#end
#if HAIKU
music/bemidi.cpp
#end
#if FLUIDSYNTH
music/fluidsynth.cpp
#end
#end
#if BEOS
music/bemidi.cpp
#end
#if LIBTIMIDITY
music/libtimidity.cpp
#end
#if FLUIDSYNTH
music/fluidsynth.cpp
#end
#end
# Sound
sound/null_s.cpp
#if DEDICATED
#else
#if ALLEGRO
sound/allegro_s.cpp
#end
#if SDL
sound/sdl_s.cpp
#end
#if WIN32
sound/win32_s.cpp
sound/xaudio2_s.cpp
#end
#if ALLEGRO
sound/allegro_s.cpp
#end
#if SDL
sound/sdl_s.cpp
#end
#if WIN32
sound/win32_s.cpp
#if USE_XAUDIO2
sound/xaudio2_s.cpp
#end
#end
#end
#if OSX
@ -1189,21 +1180,4 @@ sound/null_s.cpp
#end
# Threading
thread/thread.h
#if HAVE_THREAD
#if WIN32
thread/thread_win32.cpp
#else
#if OS2
thread/thread_os2.cpp
#else
#if MORPHOS
thread/thread_morphos.cpp
#else
thread/thread_pthread.cpp
#end
#end
#end
#else
thread/thread_none.cpp
#end
thread.h

@ -164,11 +164,9 @@ public:
/** Gets the ScriptScanner instance that is used to find AI Libraries */
static AIScannerLibrary *GetScannerLibrary();
#if defined(ENABLE_NETWORK)
/** Wrapper function for AIScanner::HasAI */
static bool HasAI(const struct ContentInfo *ci, bool md5sum);
static bool HasAILibrary(const ContentInfo *ci, bool md5sum);
#endif
private:
static uint frame_counter; ///< Tick counter for the AI code
static class AIScannerInfo *scanner_info; ///< ScriptScanner instance that is used to find AIs

@ -30,9 +30,9 @@ public:
class AIInfo *GetInfo() const;
/* virtual */ int GetSetting(const char *name) const;
/* virtual */ void SetSetting(const char *name, int value);
/* virtual */ void AddRandomDeviation();
int GetSetting(const char *name) const override;
void SetSetting(const char *name, int value) override;
void AddRandomDeviation() override;
/**
* When ever the AI Scanner is reloaded, all infos become invalid. This
@ -45,9 +45,9 @@ public:
bool ResetInfo(bool force_exact_match);
protected:
/* virtual */ void PushExtraConfigList();
/* virtual */ void ClearConfigList();
/* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
void PushExtraConfigList() override;
void ClearConfigList() override;
ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override;
};
#endif /* AI_CONFIG_HPP */

@ -16,6 +16,7 @@
#include "../company_func.h"
#include "../network/network.h"
#include "../window_func.h"
#include "../framerate_type.h"
#include "ai_scanner.hpp"
#include "ai_instance.hpp"
#include "ai_config.hpp"
@ -79,8 +80,11 @@
const Company *c;
FOR_ALL_COMPANIES(c) {
if (c->is_ai) {
PerformanceMeasurer framerate((PerformanceElement)(PFE_AI0 + c->index));
cur_company.Change(c->index);
c->ai_instance->GameLoop();
} else {
PerformanceMeasurer::SetInactive((PerformanceElement)(PFE_AI0 + c->index));
}
}
cur_company.Restore();
@ -101,6 +105,7 @@
/* static */ void AI::Stop(CompanyID company)
{
if (_networking && !_network_server) return;
PerformanceMeasurer::SetInactive((PerformanceElement)(PFE_AI0 + company));
Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
Company *c = Company::Get(company);
@ -357,8 +362,6 @@
InvalidateWindowClassesData(WC_AI_SETTINGS);
}
#if defined(ENABLE_NETWORK)
/**
* Check whether we have an AI (library) with the exact characteristics as ci.
* @param ci the characteristics to search on (shortname and md5sum)
@ -375,8 +378,6 @@
return AI::scanner_library->HasScript(ci, md5sum);
}
#endif /* defined(ENABLE_NETWORK) */
/* static */ AIScannerInfo *AI::GetScannerInfo()
{
return AI::scanner_info;

@ -98,7 +98,7 @@ struct AIListWindow : public Window {
}
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_AIL_CAPTION:
@ -107,7 +107,7 @@ struct AIListWindow : public Window {
}
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget == WID_AIL_LIST) {
this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
@ -118,7 +118,7 @@ struct AIListWindow : public Window {
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_AIL_LIST: {
@ -183,7 +183,7 @@ struct AIListWindow : public Window {
DeleteWindowByClass(WC_QUERY_STRING);
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_AIL_LIST: { // Select one of the AIs
@ -211,7 +211,7 @@ struct AIListWindow : public Window {
}
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_AIL_LIST);
}
@ -221,7 +221,7 @@ struct AIListWindow : public Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) {
delete this;
@ -317,7 +317,7 @@ struct AISettingsWindow : public Window {
this->RebuildVisibleSettings();
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_AIS_CAPTION:
@ -346,7 +346,7 @@ struct AISettingsWindow : public Window {
this->vscroll->SetCount((int)this->visible_settings.size());
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget == WID_AIS_BACKGROUND) {
this->line_height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
@ -357,7 +357,7 @@ struct AISettingsWindow : public Window {
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (widget != WID_AIS_BACKGROUND) return;
@ -421,7 +421,7 @@ struct AISettingsWindow : public Window {
}
}
virtual void OnPaint()
void OnPaint() override
{
if (this->closing_dropdown) {
this->closing_dropdown = false;
@ -430,7 +430,7 @@ struct AISettingsWindow : public Window {
this->DrawWidgets();
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_AIS_BACKGROUND: {
@ -481,7 +481,7 @@ struct AISettingsWindow : public Window {
DropDownList *list = new DropDownList();
for (int i = config_item.min_value; i <= config_item.max_value; i++) {
*list->Append() = new DropDownListCharStringItem(config_item.labels->Find(i)->second, i, false);
list->push_back(new DropDownListCharStringItem(config_item.labels->Find(i)->second, i, false));
}
ShowDropDownListAt(this, list, old_val, -1, wi_rect, COLOUR_ORANGE, true);
@ -530,7 +530,7 @@ struct AISettingsWindow : public Window {
}
}
virtual void OnQueryTextFinished(char *str)
void OnQueryTextFinished(char *str) override
{
if (StrEmpty(str)) return;
VisibleSettingsList::const_iterator it = this->visible_settings.begin();
@ -542,7 +542,7 @@ struct AISettingsWindow : public Window {
this->SetDirty();
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
assert(this->clicked_dropdown);
VisibleSettingsList::const_iterator it = this->visible_settings.begin();
@ -553,7 +553,7 @@ struct AISettingsWindow : public Window {
this->SetDirty();
}
virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close)
void OnDropdownClose(Point pt, int widget, int index, bool instant_close) override
{
/* We cannot raise the dropdown button just yet. OnClick needs some hint, whether
* the same dropdown button was clicked again, and then not open the dropdown again.
@ -564,12 +564,12 @@ struct AISettingsWindow : public Window {
this->SetDirty();
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_AIS_BACKGROUND);
}
virtual void OnRealtimeTick(uint delta_ms)
void OnRealtimeTick(uint delta_ms) override
{
if (this->timeout.Elapsed(delta_ms)) {
this->clicked_button = -1;
@ -582,9 +582,11 @@ struct AISettingsWindow : public Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
this->RebuildVisibleSettings();
HideDropDownMenu(this);
DeleteChildWindows(WC_QUERY_STRING);
}
private:
@ -644,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR);
}
/* virtual */ void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);
@ -741,7 +743,7 @@ struct AIConfigWindow : public Window {
DeleteWindowByClass(WC_AI_SETTINGS);
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_AIC_NUMBER:
@ -765,7 +767,7 @@ struct AIConfigWindow : public Window {
}
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_AIC_GAMELIST:
@ -817,7 +819,7 @@ struct AIConfigWindow : public Window {
return slot < max_slot;
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_AIC_GAMELIST: {
@ -856,7 +858,7 @@ struct AIConfigWindow : public Window {
}
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
if (widget >= WID_AIC_TEXTFILE && widget < WID_AIC_TEXTFILE + TFT_END) {
if (this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot) == NULL) return;
@ -926,9 +928,7 @@ struct AIConfigWindow : public Window {
if (!_network_available) {
ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR);
} else {
#if defined(ENABLE_NETWORK)
ShowNetworkContentListWindow(NULL, CONTENT_TYPE_AI, CONTENT_TYPE_GAME);
#endif
}
break;
}
@ -939,7 +939,7 @@ struct AIConfigWindow : public Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!IsEditable(this->selected_slot)) {
this->selected_slot = INVALID_COMPANY;
@ -1096,7 +1096,7 @@ struct AIDebugWindow : public Window {
this->InvalidateData(-1);
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget == WID_AID_LOG_PANEL) {
resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
@ -1104,7 +1104,7 @@ struct AIDebugWindow : public Window {
}
}
virtual void OnPaint()
void OnPaint() override
{
this->SelectValidDebugCompany();
@ -1182,7 +1182,7 @@ struct AIDebugWindow : public Window {
this->last_vscroll_pos = this->vscroll->GetPosition();
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_AID_NAME_TEXT:
@ -1205,7 +1205,7 @@ struct AIDebugWindow : public Window {
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (ai_debug_company == INVALID_COMPANY) return;
@ -1264,7 +1264,7 @@ struct AIDebugWindow : public Window {
this->last_vscroll_pos = this->vscroll->GetPosition();
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
/* Also called for hotkeys, so check for disabledness */
if (this->IsWidgetDisabled(widget)) return;
@ -1282,7 +1282,7 @@ struct AIDebugWindow : public Window {
case WID_AID_RELOAD_TOGGLE:
if (ai_debug_company == OWNER_DEITY) break;
/* First kill the company of the AI, then start a new one. This should start the current AI again */
DoCommandP(0, CCA_DELETE | ai_debug_company << 16, CRR_MANUAL, CMD_COMPANY_CTRL);
DoCommandP(0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL);
DoCommandP(0, CCA_NEW_AI | ai_debug_company << 16, 0, CMD_COMPANY_CTRL);
break;
@ -1334,7 +1334,7 @@ struct AIDebugWindow : public Window {
}
}
virtual void OnEditboxChanged(int wid)
void OnEditboxChanged(int wid) override
{
if (wid == WID_AID_BREAK_STR_EDIT_BOX) {
/* Save the current string to static member so it can be restored next time the window is opened. */
@ -1349,7 +1349,7 @@ struct AIDebugWindow : public Window {
* This is the company ID of the AI/GS which wrote a new log message, or -1 in other cases.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
/* If the log message is related to the active company tab, check the break string.
* This needs to be done in gameloop-scope, so the AI is suspended immediately. */
@ -1406,7 +1406,7 @@ struct AIDebugWindow : public Window {
(ai_debug_company == OWNER_DEITY ? !Game::IsPaused() : !AI::IsPaused(ai_debug_company)));
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_AID_LOG_PANEL);
}

@ -29,7 +29,7 @@ static bool CheckAPIVersion(const char *api_version)
return strcmp(api_version, "0.7") == 0 || strcmp(api_version, "1.0") == 0 || strcmp(api_version, "1.1") == 0 ||
strcmp(api_version, "1.2") == 0 || strcmp(api_version, "1.3") == 0 || strcmp(api_version, "1.4") == 0 ||
strcmp(api_version, "1.5") == 0 || strcmp(api_version, "1.6") == 0 || strcmp(api_version, "1.7") == 0 ||
strcmp(api_version, "1.8") == 0 || strcmp(api_version, "1.9") == 0;
strcmp(api_version, "1.8") == 0 || strcmp(api_version, "1.9") == 0 || strcmp(api_version, "1.10") == 0;
}
#if defined(_WIN32)

@ -25,14 +25,14 @@ public:
*/
void Initialize(class AIInfo *info);
/* virtual */ int GetSetting(const char *name);
/* virtual */ ScriptInfo *FindLibrary(const char *library, int version);
int GetSetting(const char *name) override;
ScriptInfo *FindLibrary(const char *library, int version) override;
private:
/* virtual */ void RegisterAPI();
/* virtual */ void Died();
/* virtual */ CommandCallback *GetDoCommandCallback();
/* virtual */ void LoadDummyScript();
void RegisterAPI() override;
void Died() override;
CommandCallback *GetDoCommandCallback() override;
void LoadDummyScript() override;
};
#endif /* AI_INSTANCE_HPP */

@ -19,7 +19,7 @@ public:
AIScannerInfo();
~AIScannerInfo();
/* virtual */ void Initialize();
void Initialize() override;
/**
* Select a random AI.
@ -42,11 +42,11 @@ public:
void SetDummyAI(class AIInfo *info);
protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
/* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return AI_DIR; }
/* virtual */ const char *GetScannerName() const { return "AIs"; }
/* virtual */ void RegisterAPI(class Squirrel *engine);
void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
const char *GetFileName() const override { return PATHSEP "info.nut"; }
Subdirectory GetDirectory() const override { return AI_DIR; }
const char *GetScannerName() const override { return "AIs"; }
void RegisterAPI(class Squirrel *engine) override;
private:
AIInfo *info_dummy; ///< The dummy AI.
@ -54,7 +54,7 @@ private:
class AIScannerLibrary : public ScriptScanner {
public:
/* virtual */ void Initialize();
void Initialize() override;
/**
* Find a library in the pool.
@ -65,11 +65,11 @@ public:
class AILibrary *FindLibrary(const char *library, int version);
protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
/* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; }
/* virtual */ const char *GetScannerName() const { return "AI Libraries"; }
/* virtual */ void RegisterAPI(class Squirrel *engine);
void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
const char *GetFileName() const override { return PATHSEP "library.nut"; }
Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; }
const char *GetScannerName() const override { return "AI Libraries"; }
void RegisterAPI(class Squirrel *engine) override;
};
#endif /* AI_SCANNER_HPP */

@ -783,6 +783,7 @@ int GetAircraftFlightLevel(T *v, bool takeoff)
}
template int GetAircraftFlightLevel(DisasterVehicle *v, bool takeoff);
template int GetAircraftFlightLevel(Aircraft *v, bool takeoff);
/**
* Find the entry point to an airport depending on direction which
@ -1309,18 +1310,17 @@ static void CrashAirplane(Aircraft *v)
*/
static void MaybeCrashAirplane(Aircraft *v)
{
if (_settings_game.vehicle.plane_crashes == 0) return;
Station *st = Station::Get(v->targetairport);
/* FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports */
uint32 prob = (0x4000 << _settings_game.vehicle.plane_crashes);
uint32 prob;
if ((st->airport.GetFTA()->flags & AirportFTAClass::SHORT_STRIP) &&
(AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) &&
!_cheats.no_jetcrash.value) {
prob /= 20;
prob = 3276;
} else {
prob /= 1500;
if (_settings_game.vehicle.plane_crashes == 0) return;
prob = (0x4000 << _settings_game.vehicle.plane_crashes) / 1500;
}
if (GB(Random(), 0, 22) > prob) return;
@ -2103,7 +2103,19 @@ void UpdateAirplanesOnNewStation(const Station *st)
FOR_ALL_AIRCRAFT(v) {
if (!v->IsNormalAircraft() || v->targetairport != st->index) continue;
assert(v->state == FLYING);
Order *o = &v->current_order;
/* The aircraft is heading to a hangar, but the new station doesn't have one,
* or the aircraft can't land on the new station. Cancel current order. */
if (o->IsType(OT_GOTO_DEPOT) && !(o->GetDepotOrderType() & ODTFB_PART_OF_ORDERS) && o->GetDestination() == st->index &&
(!st->airport.HasHangar() || !CanVehicleUseStation(v, st))) {
o->MakeDummy();
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
}
v->pos = v->previous_pos = AircraftGetEntryPoint(v, ap, rotation);
UpdateAircraftCache(v);
}
/* Heliports don't have a hangar. Invalidate all go to hangar orders from all aircraft. */
if (!st->airport.HasHangar()) RemoveOrderFromAllVehicles(OT_GOTO_DEPOT, st->index, true);
}

@ -87,14 +87,14 @@ struct BuildAirToolbarWindow : Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!gui_scope) return;
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) delete this;
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_AT_AIRPORT:
@ -114,7 +114,7 @@ struct BuildAirToolbarWindow : Window {
}
virtual void OnPlaceObject(Point pt, TileIndex tile)
void OnPlaceObject(Point pt, TileIndex tile) override
{
switch (this->last_user_action) {
case WID_AT_AIRPORT:
@ -129,19 +129,19 @@ struct BuildAirToolbarWindow : Window {
}
}
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
{
VpSelectTilesWithMethod(pt.x, pt.y, select_method);
}
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override
{
if (pt.x != -1 && select_proc == DDSP_DEMOLISH_AREA) {
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
}
}
virtual void OnPlaceObjectAbort()
void OnPlaceObjectAbort() override
{
this->RaiseButtons();
@ -219,7 +219,7 @@ class BuildAirportWindow : public PickerWindowBase {
DropDownList *list = new DropDownList();
for (uint i = 0; i < AirportClass::GetClassCount(); i++) {
*list->Append() = new DropDownListStringItem(AirportClass::Get((AirportClassID)i)->name, i, false);
list->push_back(new DropDownListStringItem(AirportClass::Get((AirportClassID)i)->name, i, false));
}
return list;
@ -268,7 +268,7 @@ public:
DeleteWindowById(WC_SELECT_STATION, 0);
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_AP_CLASS_DROPDOWN:
@ -293,7 +293,7 @@ public:
}
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_AP_CLASS_DROPDOWN: {
@ -357,7 +357,7 @@ public:
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_AP_AIRPORT_LIST: {
@ -394,7 +394,7 @@ public:
}
}
virtual void OnPaint()
void OnPaint() override
{
this->DrawWidgets();
@ -462,7 +462,7 @@ public:
}
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_AP_CLASS_DROPDOWN:
@ -535,7 +535,7 @@ public:
this->SelectOtherAirport(-1);
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
assert(widget == WID_AP_CLASS_DROPDOWN);
_selected_airport_class = (AirportClassID)index;
@ -543,7 +543,7 @@ public:
this->SelectFirstAvailableAirport(false);
}
virtual void OnRealtimeTick(uint delta_ms)
void OnRealtimeTick(uint delta_ms) override
{
CheckRedrawStationCoverage(this);
}

@ -19,7 +19,7 @@
#include "safeguards.h"
/** The table/list with animated tiles. */
SmallVector<TileIndex, 256> _animated_tiles;
std::vector<TileIndex> _animated_tiles;
/**
* Removes the given tile from the animated tile table.
@ -27,10 +27,10 @@ SmallVector<TileIndex, 256> _animated_tiles;
*/
void DeleteAnimatedTile(TileIndex tile)
{
TileIndex *to_remove = _animated_tiles.Find(tile);
if (to_remove != _animated_tiles.End()) {
auto to_remove = std::find(_animated_tiles.begin(), _animated_tiles.end(), tile);
if (to_remove != _animated_tiles.end()) {
/* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */
_animated_tiles.ErasePreservingOrder(to_remove);
_animated_tiles.erase(to_remove);
MarkTileDirtyByTile(tile);
}
}
@ -43,7 +43,7 @@ void DeleteAnimatedTile(TileIndex tile)
void AddAnimatedTile(TileIndex tile)
{
MarkTileDirtyByTile(tile);
_animated_tiles.Include(tile);
include(_animated_tiles, tile);
}
/**
@ -53,8 +53,8 @@ void AnimateAnimatedTiles()
{
PerformanceAccumulator framerate(PFE_GL_LANDSCAPE);
const TileIndex *ti = _animated_tiles.Begin();
while (ti < _animated_tiles.End()) {
const TileIndex *ti = _animated_tiles.data();
while (ti < _animated_tiles.data() + _animated_tiles.size()) {
const TileIndex curr = *ti;
AnimateTile(curr);
/* During the AnimateTile call, DeleteAnimatedTile could have been called,
@ -75,5 +75,5 @@ void AnimateAnimatedTiles()
*/
void InitializeAnimatedTiles()
{
_animated_tiles.Clear();
_animated_tiles.clear();
}

@ -168,16 +168,16 @@ CargoArray GetCapacityOfArticulatedParts(EngineID engine)
* @param engine Model to investigate.
* @param[out] cargoes Total amount of units that can be transported, summed by cargo.
* @param[out] refits Whether a (possibly partial) refit for each cargo is possible.
* @param cargo_type Selected refitted cargo type
* @param cargo_capacity Capacity of selected refitted cargo type
*/
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits)
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits, CargoID cargo_type, uint16 cargo_capacity)
{
cargoes->Clear();
*refits = 0;
const Engine *e = Engine::Get(engine);
CargoID cargo_type;
uint16 cargo_capacity = GetVehicleDefaultCapacity(engine, &cargo_type);
if (cargo_type < NUM_CARGO && cargo_capacity > 0) {
(*cargoes)[cargo_type] += cargo_capacity;
if (IsEngineRefittable(engine)) SetBit(*refits, cargo_type);

@ -294,7 +294,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic
if (refit_cargo == CT_INVALID) return CommandCost(); // incompatible cargoes
/* Build the new vehicle */
cost = DoCommand(old_veh->tile, e, 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh));
cost = DoCommand(old_veh->tile, e | (CT_INVALID << 24), 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh));
if (cost.Failed()) return cost;
Vehicle *new_veh = Vehicle::Get(_new_vehicle_id);

@ -123,7 +123,7 @@ class ReplaceVehicleWindow : public Window {
byte side = draw_left ? 0 : 1;
GUIEngineList *list = &this->engines[side];
list->Clear();
list->clear();
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, type) {
@ -140,7 +140,7 @@ class ReplaceVehicleWindow : public Window {
if (!CheckAutoreplaceValidity(this->sel_engine[0], eid, _local_company)) continue;
}
*list->Append() = eid;
list->push_back(eid);
if (eid == this->sel_engine[side]) selected_engine = eid; // The selected engine is still in the list
}
this->sel_engine[side] = selected_engine; // update which engine we selected (the same or none, if it's not in the list anymore)
@ -160,8 +160,8 @@ class ReplaceVehicleWindow : public Window {
if (this->engines[0].NeedRebuild()) {
/* We need to rebuild the left engines list */
this->GenerateReplaceVehList(true);
this->vscroll[0]->SetCount(this->engines[0].Length());
if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].Length() != 0) {
this->vscroll[0]->SetCount((uint)this->engines[0].size());
if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].size() != 0) {
this->sel_engine[0] = this->engines[0][0];
}
}
@ -170,7 +170,7 @@ class ReplaceVehicleWindow : public Window {
/* Either we got a request to rebuild the right engines list, or the left engines list selected a different engine */
if (this->sel_engine[0] == INVALID_ENGINE) {
/* Always empty the right engines list when nothing is selected in the left engines list */
this->engines[1].Clear();
this->engines[1].clear();
this->sel_engine[1] = INVALID_ENGINE;
} else {
if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) {
@ -180,11 +180,11 @@ class ReplaceVehicleWindow : public Window {
}
/* Regenerate the list on the right. Note: This resets sel_engine[1] to INVALID_ENGINE, if it is no longer available. */
this->GenerateReplaceVehList(false);
this->vscroll[1]->SetCount(this->engines[1].Length());
this->vscroll[1]->SetCount((uint)this->engines[1].size());
if (this->reset_sel_engine && this->sel_engine[1] != INVALID_ENGINE) {
int position = 0;
for (EngineID *it = this->engines[1].Begin(); it != this->engines[1].End(); ++it) {
if (*it == this->sel_engine[1]) break;
for (EngineID &eid : this->engines[1]) {
if (eid == this->sel_engine[1]) break;
++position;
}
this->vscroll[1]->ScrollTowards(position);
@ -237,7 +237,7 @@ public:
this->sel_group = id_g;
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_RV_SORT_ASCENDING_DESCENDING: {
@ -316,7 +316,7 @@ public:
}
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_RV_CAPTION:
@ -353,7 +353,7 @@ public:
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_RV_SORT_ASCENDING_DESCENDING:
@ -384,7 +384,7 @@ public:
case WID_RV_RIGHT_MATRIX: {
int side = (widget == WID_RV_LEFT_MATRIX) ? 0 : 1;
EngineID start = this->vscroll[side]->GetPosition(); // what is the offset for the start (scrolling)
EngineID end = min(this->vscroll[side]->GetCapacity() + start, this->engines[side].Length());
EngineID end = min(this->vscroll[side]->GetCapacity() + start, (uint)this->engines[side].size());
/* Do the actual drawing */
DrawEngineList((VehicleType)this->window_number, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP,
@ -394,7 +394,7 @@ public:
}
}
virtual void OnPaint()
void OnPaint() override
{
if (this->engines[0].NeedRebuild() || this->engines[1].NeedRebuild()) this->GenerateLists();
@ -423,9 +423,16 @@ public:
/* Draw details panels. */
for (int side = 0; side < 2; side++) {
if (this->sel_engine[side] != INVALID_ENGINE) {
/* Use default engine details without refitting */
const Engine *e = Engine::Get(this->sel_engine[side]);
TestedEngineDetails ted;
ted.cost = 0;
ted.cargo = e->GetDefaultCargoType();
ted.capacity = e->GetDisplayDefaultCapacity(&ted.mail_capacity);
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? WID_RV_LEFT_DETAILS : WID_RV_RIGHT_DETAILS);
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side]);
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side], ted);
needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
}
}
@ -437,7 +444,7 @@ public:
}
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_RV_SORT_ASCENDING_DESCENDING:
@ -461,8 +468,8 @@ public:
case WID_RV_TRAIN_ENGINEWAGON_DROPDOWN: {
DropDownList *list = new DropDownList();
*list->Append() = new DropDownListStringItem(STR_REPLACE_ENGINES, 1, false);
*list->Append() = new DropDownListStringItem(STR_REPLACE_WAGONS, 0, false);
list->push_back(new DropDownListStringItem(STR_REPLACE_ENGINES, 1, false));
list->push_back(new DropDownListStringItem(STR_REPLACE_WAGONS, 0, false));
ShowDropDownList(this, list, this->replace_engines ? 1 : 0, WID_RV_TRAIN_ENGINEWAGON_DROPDOWN);
break;
}
@ -501,7 +508,7 @@ public:
click_side = 1;
}
uint i = this->vscroll[click_side]->GetScrolledRowFromWidget(pt.y, this, widget);
size_t engine_count = this->engines[click_side].Length();
size_t engine_count = this->engines[click_side].size();
EngineID e = engine_count > i ? this->engines[click_side][i] : INVALID_ENGINE;
if (e == this->sel_engine[click_side]) break; // we clicked the one we already selected
@ -516,7 +523,7 @@ public:
}
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
switch (widget) {
case WID_RV_SORT_DROPDOWN:
@ -557,7 +564,7 @@ public:
}
}
virtual void OnResize()
void OnResize() override
{
this->vscroll[0]->SetCapacityFromWidget(this, WID_RV_LEFT_MATRIX);
this->vscroll[1]->SetCapacityFromWidget(this, WID_RV_RIGHT_MATRIX);
@ -568,7 +575,7 @@ public:
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (data != 0) {
/* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */

@ -76,9 +76,9 @@ struct BaseSet {
{
free(this->name);
for (TranslatedStrings::iterator iter = this->description.Begin(); iter != this->description.End(); iter++) {
free(iter->first);
free(iter->second);
for (auto &pair : this->description) {
free(pair.first);
free(pair.second);
}
for (uint i = 0; i < NUM_FILES; i++) {
@ -122,16 +122,16 @@ struct BaseSet {
{
if (isocode != NULL) {
/* First the full ISO code */
for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) {
if (strcmp(iter->first, isocode) == 0) return iter->second;
for (const auto &pair : this->description) {
if (strcmp(pair.first, isocode) == 0) return pair.second;
}
/* Then the first two characters */
for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) {
if (strncmp(iter->first, isocode, 2) == 0) return iter->second;
for (const auto &pair : this->description) {
if (strncmp(pair.first, isocode, 2) == 0) return pair.second;
}
}
/* Then fall back */
return this->description.Begin()->second;
return this->description.front().second;
}
/**
@ -176,7 +176,7 @@ protected:
static Tbase_set *duplicate_sets; ///< All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded.
static const Tbase_set *used_set; ///< The currently used set
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/**
* Get the extension that is used to identify this set.

@ -277,7 +277,6 @@ template <class Tbase_set>
return p;
}
#if defined(ENABLE_NETWORK)
#include "network/network_content.h"
template <class Tbase_set> const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s)
@ -307,22 +306,6 @@ template <class Tbase_set>
(TryGetBaseSetFile(ci, md5sum, BaseMedia<Tbase_set>::duplicate_sets) != NULL);
}
#else
template <class Tbase_set>
const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s)
{
return NULL;
}
template <class Tbase_set>
/* static */ bool BaseMedia<Tbase_set>::HasSet(const ContentInfo *ci, bool md5sum)
{
return false;
}
#endif /* ENABLE_NETWORK */
/**
* Count the number of available graphics sets.
* @return the number of sets

@ -110,6 +110,12 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
*/
virtual void UpdateVirtCoord() = 0;
virtual void MoveSign(TileIndex new_xy)
{
this->xy = new_xy;
this->UpdateVirtCoord();
}
/**
* Get the tile area for a given station type.
* @param ta tile area to fill.

@ -0,0 +1,120 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file bitmap_type.hpp Bitmap functions. */
#ifndef BITMAP_TYPE_HPP
#define BITMAP_TYPE_HPP
#include <vector>
/** Represents a tile area containing containing individually set tiles.
* Each tile must be contained within the preallocated area.
* A std::vector<bool> is used to mark which tiles are contained.
*/
class BitmapTileArea : public TileArea {
protected:
std::vector<bool> data;
inline uint Index(uint x, uint y) const { return y * this->w + x; }
inline uint Index(TileIndex tile) const { return Index(TileX(tile) - TileX(this->tile), TileY(tile) - TileY(this->tile)); }
public:
BitmapTileArea()
{
this->tile = INVALID_TILE;
this->w = 0;
this->h = 0;
}
/**
* Reset and clear the BitmapTileArea.
*/
void Reset()
{
this->tile = INVALID_TILE;
this->w = 0;
this->h = 0;
this->data.clear();
}
/**
* Initialize the BitmapTileArea with the specified Rect.
* @param rect Rect to use.
*/
void Initialize(Rect r)
{
this->tile = TileXY(r.left, r.top);
this->w = r.right - r.left + 1;
this->h = r.bottom - r.top + 1;
this->data.clear();
this->data.resize(Index(w, h));
}
/**
* Add a tile as part of the tile area.
* @param tile Tile to add.
*/
inline void SetTile(TileIndex tile)
{
assert(this->Contains(tile));
this->data[Index(tile)] = true;
}
/**
* Clear a tile from the tile area.
* @param tile Tile to clear
*/
inline void ClrTile(TileIndex tile)
{
assert(this->Contains(tile));
this->data[Index(tile)] = false;
}
/**
* Test if a tile is part of the tile area.
* @param tile Tile to check
*/
inline bool HasTile(TileIndex tile) const
{
return this->Contains(tile) && this->data[Index(tile)];
}
};
/** Iterator to iterate over all tiles belonging to a bitmaptilearea. */
class BitmapTileIterator : public OrthogonalTileIterator {
protected:
const BitmapTileArea *bitmap;
public:
/**
* Construct the iterator.
* @param bitmap BitmapTileArea to iterate.
*/
BitmapTileIterator(const BitmapTileArea &bitmap) : OrthogonalTileIterator(bitmap), bitmap(&bitmap)
{
if (!this->bitmap->HasTile(TileIndex(this->tile))) ++(*this);
}
inline TileIterator& operator ++()
{
(*this).OrthogonalTileIterator::operator++();
while (this->tile != INVALID_TILE && !this->bitmap->HasTile(TileIndex(this->tile))) {
(*this).OrthogonalTileIterator::operator++();
}
return *this;
}
virtual TileIterator *Clone() const
{
return new BitmapTileIterator(*this);
}
};
#endif /* BITMAP_TYPE_HPP */

@ -37,21 +37,21 @@ public:
~Blitter_32bppAnim();
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
/* virtual */ int BufferSize(int width, int height);
/* virtual */ void PaletteAnimate(const Palette &palette);
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
void SetPixel(void *video, int x, int y, uint8 colour) override;
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
void DrawRect(void *video, int width, int height, uint8 colour) override;
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;
/* virtual */ const char *GetName() { return "32bpp-anim"; }
/* virtual */ int GetBytesPerPixel() { return 6; }
/* virtual */ void PostResize();
const char *GetName() override { return "32bpp-anim"; }
int GetBytesPerPixel() override { return 6; }
void PostResize() override;
/**
* Look up the colour in the current palette.
@ -77,7 +77,7 @@ public:
class FBlitter_32bppAnim : public BlitterFactory {
public:
FBlitter_32bppAnim() : BlitterFactory("32bpp-anim", "32bpp Animation Blitter (palette animation)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
Blitter *CreateInstance() override { return new Blitter_32bppAnim(); }
};
#endif /* BLITTER_32BPP_ANIM_HPP */

@ -28,15 +28,15 @@
/** A partially 32 bpp blitter with palette animation. */
class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim {
public:
/* virtual */ void PaletteAnimate(const Palette &palette);
/* virtual */ const char *GetName() { return "32bpp-sse2-anim"; }
void PaletteAnimate(const Palette &palette) override;
const char *GetName() override { return "32bpp-sse2-anim"; }
};
/** Factory for the partially 32bpp blitter with animation. */
class FBlitter_32bppSSE2_Anim : public BlitterFactory {
public:
FBlitter_32bppSSE2_Anim() : BlitterFactory("32bpp-sse2-anim", "32bpp partially SSE2 Animation Blitter (palette animation)", HasCPUIDFlag(1, 3, 26)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2_Anim(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE2_Anim(); }
};
#endif /* WITH_SSE */

@ -35,19 +35,19 @@ private:
public:
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent, bool animated>
/* virtual */ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
/* virtual */ const char *GetName() { return "32bpp-sse4-anim"; }
const char *GetName() override { return "32bpp-sse4-anim"; }
};
/** Factory for the SSE4 32 bpp blitter (with palette animation). */
class FBlitter_32bppSSE4_Anim: public BlitterFactory {
public:
FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); }
};
#endif /* WITH_SSE */

@ -20,19 +20,19 @@
/** Base for all 32bpp blitters. */
class Blitter_32bppBase : public Blitter {
public:
/* virtual */ uint8 GetScreenDepth() { return 32; }
/* virtual */ void *MoveTo(void *video, int x, int y);
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
/* virtual */ int BufferSize(int width, int height);
/* virtual */ void PaletteAnimate(const Palette &palette);
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
/* virtual */ int GetBytesPerPixel() { return 4; }
uint8 GetScreenDepth() override { return 32; }
void *MoveTo(void *video, int x, int y) override;
void SetPixel(void *video, int x, int y, uint8 colour) override;
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
void DrawRect(void *video, int width, int height, uint8 colour) override;
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;
int GetBytesPerPixel() override { return 4; }
/**
* Look up the colour in the current palette.

@ -23,10 +23,10 @@ public:
byte data[]; ///< Data, all zoomlevels.
};
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
/* virtual */ const char *GetName() { return "32bpp-optimized"; }
const char *GetName() override { return "32bpp-optimized"; }
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
};
@ -35,7 +35,7 @@ public:
class FBlitter_32bppOptimized : public BlitterFactory {
public:
FBlitter_32bppOptimized() : BlitterFactory("32bpp-optimized", "32bpp Optimized Blitter (no palette animation)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppOptimized(); }
Blitter *CreateInstance() override { return new Blitter_32bppOptimized(); }
};
#endif /* BLITTER_32BPP_OPTIMIZED_HPP */

@ -26,18 +26,18 @@ class Blitter_32bppSimple : public Blitter_32bppBase {
uint8 v; ///< Brightness-channel
};
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
/* virtual */ const char *GetName() { return "32bpp-simple"; }
const char *GetName() override { return "32bpp-simple"; }
};
/** Factory for the simple 32 bpp blitter. */
class FBlitter_32bppSimple : public BlitterFactory {
public:
FBlitter_32bppSimple() : BlitterFactory("32bpp-simple", "32bpp Simple Blitter (no palette animation)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSimple(); }
Blitter *CreateInstance() override { return new Blitter_32bppSimple(); }
};
#endif /* BLITTER_32BPP_SIMPLE_HPP */

@ -82,22 +82,22 @@ DECLARE_ENUM_AS_BIT_SET(Blitter_32bppSSE_Base::SpriteFlags);
/** The SSE2 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
/* virtual */ const char *GetName() { return "32bpp-sse2"; }
const char *GetName() override { return "32bpp-sse2"; }
};
/** Factory for the SSE2 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE2 : public BlitterFactory {
public:
FBlitter_32bppSSE2() : BlitterFactory("32bpp-sse2", "32bpp SSE2 Blitter (no palette animation)", HasCPUIDFlag(1, 3, 26)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE2(); }
};
#endif /* WITH_SSE */

@ -27,17 +27,17 @@
/** The SSE4 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ const char *GetName() { return "32bpp-sse4"; }
const char *GetName() override { return "32bpp-sse4"; }
};
/** Factory for the SSE4 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE4: public BlitterFactory {
public:
FBlitter_32bppSSE4() : BlitterFactory("32bpp-sse4", "32bpp SSE4 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 19)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE4(); }
};
#endif /* WITH_SSE */

@ -27,17 +27,17 @@
/** The SSSE3 32 bpp blitter (without palette animation). */
class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ const char *GetName() { return "32bpp-ssse3"; }
const char *GetName() override { return "32bpp-ssse3"; }
};
/** Factory for the SSSE3 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSSE3: public BlitterFactory {
public:
FBlitter_32bppSSSE3() : BlitterFactory("32bpp-ssse3", "32bpp SSSE3 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 9)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSSE3(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSSE3(); }
};
#endif /* WITH_SSE */

@ -17,20 +17,20 @@
/** Base for all 8bpp blitters. */
class Blitter_8bppBase : public Blitter {
public:
/* virtual */ uint8 GetScreenDepth() { return 8; }
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
/* virtual */ void *MoveTo(void *video, int x, int y);
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
/* virtual */ int BufferSize(int width, int height);
/* virtual */ void PaletteAnimate(const Palette &palette);
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
/* virtual */ int GetBytesPerPixel() { return 1; }
uint8 GetScreenDepth() override { return 8; }
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
void *MoveTo(void *video, int x, int y) override;
void SetPixel(void *video, int x, int y, uint8 colour) override;
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
void DrawRect(void *video, int width, int height, uint8 colour) override;
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;
int GetBytesPerPixel() override { return 1; }
};
#endif /* BLITTER_8BPP_BASE_HPP */

@ -24,17 +24,17 @@ public:
byte data[]; ///< Data, all zoomlevels.
};
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
/* virtual */ const char *GetName() { return "8bpp-optimized"; }
const char *GetName() override { return "8bpp-optimized"; }
};
/** Factory for the 8bpp blitter optimised for speed. */
class FBlitter_8bppOptimized : public BlitterFactory {
public:
FBlitter_8bppOptimized() : BlitterFactory("8bpp-optimized", "8bpp Optimized Blitter (compression + all-ZoomLevel cache)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_8bppOptimized(); }
Blitter *CreateInstance() override { return new Blitter_8bppOptimized(); }
};
#endif /* BLITTER_8BPP_OPTIMIZED_HPP */

@ -18,17 +18,17 @@
/** Most trivial 8bpp blitter. */
class Blitter_8bppSimple FINAL : public Blitter_8bppBase {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
/* virtual */ const char *GetName() { return "8bpp-simple"; }
const char *GetName() override { return "8bpp-simple"; }
};
/** Factory for the most trivial 8bpp blitter. */
class FBlitter_8bppSimple : public BlitterFactory {
public:
FBlitter_8bppSimple() : BlitterFactory("8bpp-simple", "8bpp Simple Blitter (relative slow, but never wrong)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_8bppSimple(); }
Blitter *CreateInstance() override { return new Blitter_8bppSimple(); }
};
#endif /* BLITTER_8BPP_SIMPLE_HPP */

@ -17,31 +17,31 @@
/** Blitter that does nothing. */
class Blitter_Null : public Blitter {
public:
/* virtual */ uint8 GetScreenDepth() { return 0; }
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {};
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ void *MoveTo(void *video, int x, int y) { return NULL; };
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) {};
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {};
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {};
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {};
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {};
/* virtual */ int BufferSize(int width, int height) { return 0; };
/* virtual */ void PaletteAnimate(const Palette &palette) { };
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; };
/* virtual */ const char *GetName() { return "null"; }
/* virtual */ int GetBytesPerPixel() { return 0; }
uint8 GetScreenDepth() override { return 0; }
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
void *MoveTo(void *video, int x, int y) override { return NULL; };
void SetPixel(void *video, int x, int y, uint8 colour) override {};
void DrawRect(void *video, int width, int height, uint8 colour) override {};
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {};
void CopyFromBuffer(void *video, const void *src, int width, int height) override {};
void CopyToBuffer(const void *video, void *dst, int width, int height) override {};
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {};
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {};
int BufferSize(int width, int height) override { return 0; };
void PaletteAnimate(const Palette &palette) override { };
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
const char *GetName() override { return "null"; }
int GetBytesPerPixel() override { return 0; }
};
/** Factory for the blitter that does nothing. */
class FBlitter_Null : public BlitterFactory {
public:
FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_Null(); }
Blitter *CreateInstance() override { return new Blitter_Null(); }
};
#endif /* BLITTER_NULL_HPP */

@ -13,7 +13,7 @@
#include "base_media_base.h"
#include "blitter/factory.hpp"
#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE)
#if defined(WITH_FREETYPE)
#include "core/geometry_func.hpp"
#include "fontcache.h"
@ -56,7 +56,7 @@ public:
ResizeWindow(this, _screen.width, _screen.height);
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
GfxFillRect(r.left, r.top, r.right, r.bottom, 4, FILLRECT_OPAQUE);
GfxFillRect(r.left, r.top, r.right, r.bottom, 0, FILLRECT_CHECKER);
@ -88,7 +88,7 @@ public:
{
}
virtual void OnDownloadComplete(ContentID cid)
void OnDownloadComplete(ContentID cid) override
{
/* We have completed downloading. We can trigger finding the right set now. */
BaseGraphics::FindSets();
@ -142,7 +142,7 @@ public:
_network_content_client.RemoveCallback(this);
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
/* We cache the button size. This is safe as no reinit can happen here. */
if (this->button_size.width == 0) {
@ -165,14 +165,14 @@ public:
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (widget != 0) return;
DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMETEXT_TOP, r.bottom - WD_FRAMETEXT_BOTTOM, STR_MISSING_GRAPHICS_SET_MESSAGE, TC_FROMSTRING, SA_CENTER);
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_BAFD_YES:
@ -189,13 +189,13 @@ public:
}
}
virtual void OnConnect(bool success)
void OnConnect(bool success) override
{
/* Once connected, request the metadata. */
_network_content_client.RequestContentList(CONTENT_TYPE_BASE_GRAPHICS);
}
virtual void OnReceiveContentInfo(const ContentInfo *ci)
void OnReceiveContentInfo(const ContentInfo *ci) override
{
/* And once the meta data is received, start downloading it. */
_network_content_client.Select(ci->id);
@ -204,7 +204,7 @@ public:
}
};
#endif /* defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) */
#endif /* defined(WITH_FREETYPE) */
/**
* Handle all procedures for bootstrapping OpenTTD without a base graphics set.
@ -220,7 +220,7 @@ bool HandleBootstrap()
if (BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure;
/* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */
#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(_WIN32) || defined(__APPLE__))
#if defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(_WIN32) || defined(__APPLE__))
if (!_network_available) goto failure;
/* First tell the game we're bootstrapping. */

@ -113,11 +113,11 @@ private:
void BuildBridge(uint8 i)
{
switch ((TransportType)(this->type >> 15)) {
case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->Get(i)->index; break;
case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->Get(i)->index; break;
case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->at(i).index; break;
case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break;
default: break;
}
DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->Get(i)->index,
DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->at(i).index,
CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge);
}
@ -153,7 +153,7 @@ public:
this->bridges->NeedResort();
this->SortBridgeList();
this->vscroll->SetCount(bl->Length());
this->vscroll->SetCount((uint)bl->size());
}
~BuildBridgeWindow()
@ -163,7 +163,7 @@ public:
delete bridges;
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_BBS_DROPDOWN_ORDER: {
@ -186,11 +186,11 @@ public:
case WID_BBS_BRIDGE_LIST: {
Dimension sprite_dim = {0, 0}; // Biggest bridge sprite dimension
Dimension text_dim = {0, 0}; // Biggest text dimension
for (int i = 0; i < (int)this->bridges->Length(); i++) {
const BridgeSpec *b = this->bridges->Get(i)->spec;
for (int i = 0; i < (int)this->bridges->size(); i++) {
const BridgeSpec *b = this->bridges->at(i).spec;
sprite_dim = maxdim(sprite_dim, GetSpriteSize(b->sprite));
SetDParam(2, this->bridges->Get(i)->cost);
SetDParam(2, this->bridges->at(i).cost);
SetDParam(1, b->speed);
SetDParam(0, b->material);
text_dim = maxdim(text_dim, GetStringBoundingBox(_game_mode == GM_EDITOR ? STR_SELECT_BRIDGE_SCENEDIT_INFO : STR_SELECT_BRIDGE_INFO));
@ -207,7 +207,7 @@ public:
}
}
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
{
/* Position the window so hopefully the first bridge from the list is under the mouse pointer. */
NWidgetBase *list = this->GetWidget<NWidgetBase>(WID_BBS_BRIDGE_LIST);
@ -217,7 +217,7 @@ public:
return corner;
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_BBS_DROPDOWN_ORDER:
@ -226,10 +226,10 @@ public:
case WID_BBS_BRIDGE_LIST: {
uint y = r.top;
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->Length(); i++) {
const BridgeSpec *b = this->bridges->Get(i)->spec;
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->size(); i++) {
const BridgeSpec *b = this->bridges->at(i).spec;
SetDParam(2, this->bridges->Get(i)->cost);
SetDParam(2, this->bridges->at(i).cost);
SetDParam(1, b->speed);
SetDParam(0, b->material);
@ -243,10 +243,10 @@ public:
}
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
EventState OnKeyPress(WChar key, uint16 keycode) override
{
const uint8 i = keycode - '1';
if (i < 9 && i < this->bridges->Length()) {
if (i < 9 && i < this->bridges->size()) {
/* Build the requested bridge */
this->BuildBridge(i);
delete this;
@ -255,13 +255,13 @@ public:
return ES_NOT_HANDLED;
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
default: break;
case WID_BBS_BRIDGE_LIST: {
uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BBS_BRIDGE_LIST);
if (i < this->bridges->Length()) {
if (i < this->bridges->size()) {
this->BuildBridge(i);
delete this;
}
@ -279,7 +279,7 @@ public:
}
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
if (widget == WID_BBS_DROPDOWN_CRITERIA && this->bridges->SortType() != index) {
this->bridges->SetSortType(index);
@ -288,7 +288,7 @@ public:
}
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_BBS_BRIDGE_LIST);
}
@ -416,17 +416,18 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
if (CheckBridgeAvailability(brd_type, bridge_len).Succeeded()) {
/* bridge is accepted, add to list */
BuildBridgeData *item = bl->Append();
item->index = brd_type;
item->spec = GetBridgeSpec(brd_type);
/*C++17: BuildBridgeData &item = */ bl->emplace_back();
BuildBridgeData &item = bl->back();
item.index = brd_type;
item.spec = GetBridgeSpec(brd_type);
/* Add to terraforming & bulldozing costs the cost of the
* bridge itself (not computed with DC_QUERY_COST) */
item->cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item->spec->price) >> 8) + infra_cost;
item.cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item.spec->price) >> 8) + infra_cost;
}
}
}
if (bl != NULL && bl->Length() != 0) {
if (bl != NULL && bl->size() != 0) {
new BuildBridgeWindow(&_build_bridge_desc, start, end, type, bl);
} else {
delete bl;

@ -532,11 +532,11 @@ static GUIEngineList::FilterFunction * const _filter_funcs[] = {
&CargoFilter,
};
static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine)
static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine, TestedEngineDetails &te)
{
CargoArray cap;
CargoTypes refits;
GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits);
GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits, te.cargo, te.capacity);
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (cap[c] == 0) continue;
@ -552,19 +552,25 @@ static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine)
}
/* Draw rail wagon specific details */
static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi)
static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
/* Purchase cost */
SetDParam(0, e->GetCost());
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT);
} else {
SetDParam(0, e->GetCost());
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
}
y += FONT_HEIGHT_NORMAL;
/* Wagon weight - (including cargo) */
uint weight = e->GetDisplayWeight();
SetDParam(0, weight);
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16 : 0);
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(te.cargo)->weight * te.capacity / 16 : 0);
SetDParam(1, cargo_weight + weight);
DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
y += FONT_HEIGHT_NORMAL;
@ -590,14 +596,21 @@ static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine
}
/* Draw locomotive specific details */
static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi)
static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
/* Purchase Cost - Engine weight */
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayWeight());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
SetDParam(2, e->GetDisplayWeight());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_WEIGHT);
} else {
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayWeight());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT);
}
y += FONT_HEIGHT_NORMAL;
/* Max speed - Engine power */
@ -632,20 +645,26 @@ static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engin
}
/* Draw road vehicle specific details */
static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_number)
static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) {
/* Purchase Cost */
SetDParam(0, e->GetCost());
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT);
} else {
SetDParam(0, e->GetCost());
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
}
y += FONT_HEIGHT_NORMAL;
/* Road vehicle weight - (including cargo) */
int16 weight = e->GetDisplayWeight();
SetDParam(0, weight);
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16 : 0);
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(te.cargo)->weight * te.capacity / 16 : 0);
SetDParam(1, cargo_weight + weight);
DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
y += FONT_HEIGHT_NORMAL;
@ -662,9 +681,16 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n
y += FONT_HEIGHT_NORMAL;
} else {
/* Purchase cost - Max speed */
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
SetDParam(2, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED);
} else {
SetDParam(0, e->GetCost());
SetDParam(2, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
}
y += FONT_HEIGHT_NORMAL;
}
@ -677,7 +703,7 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n
}
/* Draw ship specific details */
static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable)
static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
@ -686,13 +712,27 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb
uint ocean_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, true);
uint canal_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, false);
SetDParam(0, e->GetCost());
if (ocean_speed == canal_speed) {
SetDParam(1, ocean_speed);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
SetDParam(2, ocean_speed);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED);
} else {
SetDParam(0, e->GetCost());
SetDParam(1, ocean_speed);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
}
y += FONT_HEIGHT_NORMAL;
} else {
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT);
} else {
SetDParam(0, e->GetCost());
DrawString(left, right, y, STR_PURCHASE_INFO_COST);
}
y += FONT_HEIGHT_NORMAL;
SetDParam(0, ocean_speed);
@ -705,8 +745,8 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb
}
/* Cargo type + capacity */
SetDParam(0, e->GetDefaultCargoType());
SetDParam(1, e->GetDisplayDefaultCapacity());
SetDParam(0, te.cargo);
SetDParam(1, te.capacity);
SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY);
DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
y += FONT_HEIGHT_NORMAL;
@ -728,31 +768,35 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb
* @param refittable If set, the aircraft can be refitted.
* @return Bottom of the used area.
*/
static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable)
static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
CargoID cargo = e->GetDefaultCargoType();
/* Purchase cost - Max speed */
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
if (te.cost != 0) {
SetDParam(0, e->GetCost() + te.cost);
SetDParam(1, te.cost);
SetDParam(2, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED);
} else {
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
}
y += FONT_HEIGHT_NORMAL;
/* Cargo capacity */
uint16 mail_capacity;
uint capacity = e->GetDisplayDefaultCapacity(&mail_capacity);
if (mail_capacity > 0) {
SetDParam(0, cargo);
SetDParam(1, capacity);
if (te.mail_capacity > 0) {
SetDParam(0, te.cargo);
SetDParam(1, te.capacity);
SetDParam(2, CT_MAIL);
SetDParam(3, mail_capacity);
SetDParam(3, te.mail_capacity);
DrawString(left, right, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY);
} else {
/* Note, if the default capacity is selected by the refit capacity
* callback, then the capacity shown is likely to be incorrect. */
SetDParam(0, cargo);
SetDParam(1, capacity);
SetDParam(0, te.cargo);
SetDParam(1, te.capacity);
SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY);
DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
}
@ -809,7 +853,7 @@ static uint ShowAdditionalText(int left, int right, int y, EngineID engine)
* @param engine_number the engine of which to draw the info of
* @return y after drawing all the text
*/
int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number)
int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te)
{
const Engine *e = Engine::Get(engine_number);
YearMonthDay ymd;
@ -821,30 +865,30 @@ int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number)
default: NOT_REACHED();
case VEH_TRAIN:
if (e->u.rail.railveh_type == RAILVEH_WAGON) {
y = DrawRailWagonPurchaseInfo(left, right, y, engine_number, &e->u.rail);
y = DrawRailWagonPurchaseInfo(left, right, y, engine_number, &e->u.rail, te);
} else {
y = DrawRailEnginePurchaseInfo(left, right, y, engine_number, &e->u.rail);
y = DrawRailEnginePurchaseInfo(left, right, y, engine_number, &e->u.rail, te);
}
articulated_cargo = true;
break;
case VEH_ROAD:
y = DrawRoadVehPurchaseInfo(left, right, y, engine_number);
y = DrawRoadVehPurchaseInfo(left, right, y, engine_number, te);
articulated_cargo = true;
break;
case VEH_SHIP:
y = DrawShipPurchaseInfo(left, right, y, engine_number, refittable);
y = DrawShipPurchaseInfo(left, right, y, engine_number, refittable, te);
break;
case VEH_AIRCRAFT:
y = DrawAircraftPurchaseInfo(left, right, y, engine_number, refittable);
y = DrawAircraftPurchaseInfo(left, right, y, engine_number, refittable, te);
break;
}
if (articulated_cargo) {
/* Cargo type + capacity, or N/A */
int new_y = DrawCargoCapacityInfo(left, right, y, engine_number);
int new_y = DrawCargoCapacityInfo(left, right, y, engine_number, te);
if (new_y == y) {
SetDParam(0, CT_INVALID);
@ -896,7 +940,7 @@ void DrawEngineList(VehicleType type, int l, int r, int y, const GUIEngineList *
static const int sprite_y_offsets[] = { -1, -1, -2, -2 };
/* Obligatory sanity checks! */
assert(max <= eng_list->Length());
assert(max <= eng_list->size());
bool rtl = _current_text_dir == TD_RTL;
int step_size = GetEngineListHeight(type);
@ -988,6 +1032,23 @@ struct BuildVehicleWindow : Window {
byte cargo_filter_criteria; ///< Selected cargo filter
int details_height; ///< Minimal needed height of the details panels (found so far).
Scrollbar *vscroll;
TestedEngineDetails te; ///< Tested cost and capacity after refit.
void SetBuyVehicleText()
{
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_BUILD);
bool refit = this->sel_engine != INVALID_ENGINE && this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE;
if (refit) refit = Engine::Get(this->sel_engine)->GetDefaultCargoType() != this->cargo_filter[this->cargo_filter_criteria];
if (refit) {
widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON + this->vehicle_type;
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP + this->vehicle_type;
} else {
widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + this->vehicle_type;
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP + this->vehicle_type;
}
}
BuildVehicleWindow(WindowDesc *desc, TileIndex tile, VehicleType type) : Window(desc)
{
@ -1031,10 +1092,6 @@ struct BuildVehicleWindow : Window {
widget = this->GetWidget<NWidgetCore>(WID_BV_SHOW_HIDE);
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_HIDE_SHOW_TOGGLE_TOOLTIP + type;
widget = this->GetWidget<NWidgetCore>(WID_BV_BUILD);
widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + type;
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP + type;
widget = this->GetWidget<NWidgetCore>(WID_BV_RENAME);
widget->widget_data = STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON + type;
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_RENAME_TOOLTIP + type;
@ -1053,7 +1110,11 @@ struct BuildVehicleWindow : Window {
this->eng_list.ForceRebuild();
this->GenerateBuildList(); // generate the list, since we need it in the next line
/* Select the first engine in the list as default when opening the window */
if (this->eng_list.Length() > 0) this->sel_engine = this->eng_list[0];
if (this->eng_list.size() > 0) {
this->SelectEngine(this->eng_list[0]);
} else {
this->SelectEngine(INVALID_ENGINE);
}
}
/** Populate the filter list and set the cargo filter criteria. */
@ -1100,7 +1161,42 @@ struct BuildVehicleWindow : Window {
this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY);
}
void OnInit()
void SelectEngine(EngineID engine)
{
CargoID cargo = this->cargo_filter[this->cargo_filter_criteria];
if (cargo == CF_ANY) cargo = CF_NONE;
this->sel_engine = engine;
this->SetBuyVehicleText();
if (this->sel_engine == INVALID_ENGINE) return;
const Engine *e = Engine::Get(this->sel_engine);
if (!e->CanCarryCargo()) {
this->te.cost = 0;
this->te.cargo = CT_INVALID;
return;
}
if (!this->listview_mode) {
/* Query for cost and refitted capacity */
CommandCost ret = DoCommand(this->window_number, this->sel_engine | (cargo << 24), 0, DC_QUERY_COST, GetCmdBuildVeh(this->vehicle_type), NULL);
if (ret.Succeeded()) {
this->te.cost = ret.GetCost() - e->GetCost();
this->te.capacity = _returned_refit_capacity;
this->te.mail_capacity = _returned_mail_refit_capacity;
this->te.cargo = (cargo == CT_INVALID) ? e->GetDefaultCargoType() : cargo;
return;
}
}
/* Purchase test was not possible or failed, fill in the defaults instead. */
this->te.cost = 0;
this->te.capacity = e->GetDisplayDefaultCapacity(&this->te.mail_capacity);
this->te.cargo = e->GetDefaultCargoType();
}
void OnInit() override
{
this->SetCargoFilterArray();
}
@ -1109,10 +1205,10 @@ struct BuildVehicleWindow : Window {
void FilterEngineList()
{
this->eng_list.Filter(this->cargo_filter[this->cargo_filter_criteria]);
if (0 == this->eng_list.Length()) { // no engine passed through the filter, invalidate the previously selected engine
this->sel_engine = INVALID_ENGINE;
} else if (!this->eng_list.Contains(this->sel_engine)) { // previously selected engine didn't pass the filter, select the first engine of the list
this->sel_engine = this->eng_list[0];
if (0 == this->eng_list.size()) { // no engine passed through the filter, invalidate the previously selected engine
this->SelectEngine(INVALID_ENGINE);
} else if (std::find(this->eng_list.begin(), this->eng_list.end(), this->sel_engine) == this->eng_list.end()) { // previously selected engine didn't pass the filter, select the first engine of the list
this->SelectEngine(this->eng_list[0]);
}
}
@ -1132,7 +1228,7 @@ struct BuildVehicleWindow : Window {
this->filter.railtype = (this->listview_mode) ? RAILTYPE_END : GetRailType(this->window_number);
this->eng_list.Clear();
this->eng_list.clear();
/* Make list of all available train engines and wagons.
* Also check to see if the previously selected engine is still available,
@ -1150,7 +1246,7 @@ struct BuildVehicleWindow : Window {
/* Filter now! So num_engines and num_wagons is valid */
if (!FilterSingleEngine(eid)) continue;
*this->eng_list.Append() = eid;
this->eng_list.push_back(eid);
if (rvi->railveh_type != RAILVEH_WAGON) {
num_engines++;
@ -1161,7 +1257,7 @@ struct BuildVehicleWindow : Window {
if (eid == this->sel_engine) sel_id = eid;
}
this->sel_engine = sel_id;
this->SelectEngine(sel_id);
/* make engines first, and then wagons, sorted by selected sort_criteria */
_engine_sort_direction = false;
@ -1180,7 +1276,7 @@ struct BuildVehicleWindow : Window {
{
EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear();
this->eng_list.clear();
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
@ -1188,29 +1284,29 @@ struct BuildVehicleWindow : Window {
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue;
if (!HasBit(this->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue;
*this->eng_list.Append() = eid;
this->eng_list.push_back(eid);
if (eid == this->sel_engine) sel_id = eid;
}
this->sel_engine = sel_id;
this->SelectEngine(sel_id);
}
/* Figure out what ship EngineIDs to put in the list */
void GenerateBuildShipList()
{
EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear();
this->eng_list.clear();
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) {
if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue;
*this->eng_list.Append() = eid;
this->eng_list.push_back(eid);
if (eid == this->sel_engine) sel_id = eid;
}
this->sel_engine = sel_id;
this->SelectEngine(sel_id);
}
/* Figure out what aircraft EngineIDs to put in the list */
@ -1218,7 +1314,7 @@ struct BuildVehicleWindow : Window {
{
EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear();
this->eng_list.clear();
const Station *st = this->listview_mode ? NULL : Station::GetByTile(this->window_number);
@ -1234,11 +1330,11 @@ struct BuildVehicleWindow : Window {
/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
if (!this->listview_mode && !CanVehicleUseStation(eid, st)) continue;
*this->eng_list.Append() = eid;
this->eng_list.push_back(eid);
if (eid == this->sel_engine) sel_id = eid;
}
this->sel_engine = sel_id;
this->SelectEngine(sel_id);
}
/* Generate the list of vehicles */
@ -1249,7 +1345,7 @@ struct BuildVehicleWindow : Window {
default: NOT_REACHED();
case VEH_TRAIN:
this->GenerateBuildTrainList();
this->eng_list.Compact();
this->eng_list.shrink_to_fit();
this->eng_list.RebuildDone();
return; // trains should not reach the last sorting
case VEH_ROAD:
@ -1268,11 +1364,11 @@ struct BuildVehicleWindow : Window {
_engine_sort_direction = this->descending_sort_order;
EngList_Sort(&this->eng_list, _engine_sort_functions[this->vehicle_type][this->sort_criteria]);
this->eng_list.Compact();
this->eng_list.shrink_to_fit();
this->eng_list.RebuildDone();
}
void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_BV_SORT_ASCENDING_DESCENDING:
@ -1292,8 +1388,8 @@ struct BuildVehicleWindow : Window {
case WID_BV_LIST: {
uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BV_LIST);
size_t num_items = this->eng_list.Length();
this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE;
size_t num_items = this->eng_list.size();
this->SelectEngine((i < num_items) ? this->eng_list[i] : INVALID_ENGINE);
this->SetDirty();
if (_ctrl_pressed) {
this->OnClick(pt, WID_BV_SHOW_HIDE, 1);
@ -1323,7 +1419,9 @@ struct BuildVehicleWindow : Window {
EngineID sel_eng = this->sel_engine;
if (sel_eng != INVALID_ENGINE) {
CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle;
DoCommandP(this->window_number, sel_eng, 0, GetCmdBuildVeh(this->vehicle_type), callback);
CargoID cargo = this->cargo_filter[this->cargo_filter_criteria];
if (cargo == CF_ANY) cargo = CF_NONE;
DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback);
}
break;
}
@ -1345,7 +1443,7 @@ struct BuildVehicleWindow : Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!gui_scope) return;
/* When switching to original acceleration model for road vehicles, clear the selected sort criteria if it is not available now. */
@ -1358,7 +1456,7 @@ struct BuildVehicleWindow : Window {
this->eng_list.ForceRebuild();
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_BV_CAPTION:
@ -1390,7 +1488,7 @@ struct BuildVehicleWindow : Window {
}
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_BV_LIST:
@ -1411,6 +1509,13 @@ struct BuildVehicleWindow : Window {
break;
}
case WID_BV_BUILD:
*size = GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + this->vehicle_type);
*size = maxdim(*size, GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON + this->vehicle_type));
size->width += padding.width;
size->height += padding.height;
break;
case WID_BV_SHOW_HIDE:
*size = GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON + this->vehicle_type);
*size = maxdim(*size, GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_SHOW_TOGGLE_BUTTON + this->vehicle_type));
@ -1420,11 +1525,11 @@ struct BuildVehicleWindow : Window {
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_BV_LIST:
DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll->GetPosition(), min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->eng_list.Length()), this->sel_engine, false, DEFAULT_GROUP);
DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll->GetPosition(), min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)this->eng_list.size()), this->sel_engine, false, DEFAULT_GROUP);
break;
case WID_BV_SORT_ASCENDING_DESCENDING:
@ -1433,12 +1538,12 @@ struct BuildVehicleWindow : Window {
}
}
virtual void OnPaint()
void OnPaint() override
{
this->GenerateBuildList();
this->vscroll->SetCount(this->eng_list.Length());
this->vscroll->SetCount((uint)this->eng_list.size());
this->SetWidgetDisabledState(WID_BV_SHOW_HIDE, this->sel_engine == INVALID_ENGINE);
this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD, WID_BV_RENAME, WIDGET_LIST_END);
this->DrawWidgets();
@ -1448,7 +1553,7 @@ struct BuildVehicleWindow : Window {
if (this->sel_engine != INVALID_ENGINE) {
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(WID_BV_PANEL);
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine);
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine, this->te);
needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
}
if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
@ -1460,14 +1565,14 @@ struct BuildVehicleWindow : Window {
}
}
virtual void OnQueryTextFinished(char *str)
void OnQueryTextFinished(char *str) override
{
if (str == NULL) return;
DoCommandP(0, this->rename_engine, 0, CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), NULL, str);
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
switch (widget) {
case WID_BV_SORT_DROPDOWN:
@ -1485,13 +1590,14 @@ struct BuildVehicleWindow : Window {
/* deactivate filter if criteria is 'Show All', activate it otherwise */
this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY);
this->eng_list.ForceRebuild();
this->SelectEngine(this->sel_engine);
}
break;
}
this->SetDirty();
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_BV_LIST);
}

@ -117,8 +117,9 @@ int32 GetPickupAmount(CargoMonitorID monitor, bool keep_monitoring)
* @param src_type type of \a src.
* @param src index of source.
* @param st station where the cargo is delivered to.
* @param dest industry index where the cargo is delivered to.
*/
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, SourceType src_type, SourceID src, const Station *st)
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, SourceType src_type, SourceID src, const Station *st, IndustryID dest)
{
if (amount == 0) return;
@ -150,8 +151,9 @@ void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, Sour
if (iter != _cargo_deliveries.end()) iter->second += amount;
/* Industry delivery. */
for (const Industry * const *ip = st->industries_near.Begin(); ip != st->industries_near.End(); ip++) {
CargoMonitorID num = EncodeCargoIndustryMonitor(company, cargo_type, (*ip)->index);
for (Industry *ind : st->industries_near) {
if (ind->index != dest) continue;
CargoMonitorID num = EncodeCargoIndustryMonitor(company, cargo_type, ind->index);
CargoMonitorMap::iterator iter = _cargo_deliveries.find(num);
if (iter != _cargo_deliveries.end()) iter->second += amount;
}

@ -149,6 +149,6 @@ void ClearCargoPickupMonitoring(CompanyID company = INVALID_OWNER);
void ClearCargoDeliveryMonitoring(CompanyID company = INVALID_OWNER);
int32 GetDeliveryAmount(CargoMonitorID monitor, bool keep_monitoring);
int32 GetPickupAmount(CargoMonitorID monitor, bool keep_monitoring);
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, SourceType src_type, SourceID src, const Station *st);
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, SourceType src_type, SourceID src, const Station *st, IndustryID dest = INVALID_INDUSTRY);
#endif /* CARGOMONITOR_H */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save