Merge branches 'crashlog_improvements', 'save_ext', 'version_utils' into jgrpp

pull/59/head
Jonathan G Rennison 6 years ago
commit 1fe0bb76b9

@ -0,0 +1,9 @@
root = true
[*]
insert_final_newline = true
trim_trailing_whitespace = true
[*.{c,cpp,h,hpp}]
indent_style = tab
charset = utf-8

1
.gitignore vendored

@ -18,6 +18,7 @@ bin/scripts/*
!bin/scripts/*.example
!bin/scripts/readme.txt
*.aps
bundle/*
bundles/*
docs/aidocs/*

@ -1,6 +1,7 @@
syntax: glob
.svn
*.aps
bin/baseset/openttd.32.bmp
bin/lang/*
bin/openttd*

@ -0,0 +1,170 @@
# Contributing to OpenTTD
Looking to contribute something to OpenTTD? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
## Using the issue tracker
The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
* Please **do not** use the issue tracker for help playing or using OpenTTD. Please try [irc](https://wiki.openttd.org/IRC_channel), or the [forums](https://www.tt-forums.net/)
* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
* Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead. We reserve the right to delete comments which violate this rule.
* Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc. These are created by third-parties. Please try [irc](https://wiki.openttd.org/IRC_channel) or the [forums](https://www.tt-forums.net/) to discuss these.
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:
0. Please don't report issues with games where you changed NewGRFs.
1. Please don't report issues with modified versions of OpenTTD (patchpacks and similar).
2. **Use the GitHub issue search** --- check if the issue has already been
reported.
3. **Check if the issue has been fixed** --- try to reproduce it using the latest `nightly` build of OpenTTD, available from https://www.openttd.org
4. **Isolate the problem** --- ideally create reproduceable steps with an attached savegame and screenshots. Try to use few or no NewGRFs, AIs etc if possible.
A good bug report shouldn't leave others needing to chase you up for more information.
Please try to be as detailed as possible in your report.
* What is your environment?
* What steps will reproduce the issue?
* Which operating system(s) experience the problem?
* What would you expect to be the outcome?
All these details will help people to fix any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> Attached savegame
> Attached screenshots showing the issue
> Crashlogs if the bug causes a crash
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
## Feature requests
Before opening a feature request, please take a moment to find out whether your idea fits with the scope and aims of the project.
It's up to *you* to make a strong case to convince the project's developers of the merits of this feature.
Please provide as much detail and context as possible. This means don't request for a solution, but describe the problem you see and how/why you think it should be fixed.
For feature request we have a strict policy.
Keeping issues around with "a good idea" or "not really a bug but we should maybe fix it" turns out to have the reversed effect: nobody looks at it anymore.
Although we really appreciate feedback and ideas, we will close feature requests that we don't expect to fulfill in the next year.
Many of those ideas etc do have a place on the [forums](https://www.tt-forums.net); and if enough people like it, someone will stand up and make it.
It's usually best discuss in [irc](https://wiki.openttd.org/IRC_channel) before opening a feature request or working on a large feature in a fork.
Discussion in irc can take time, but it can be productive and avoid disappointment :)
## Pull requests
Good pull requests—patches, improvements, new features—are a fantastic help.
They should remain focused in scope and avoid containing unrelated commits.
**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
Please adhere to the [coding guidelines](#code-guidelines) used throughout the project (indentation, accurate comments, etc.) and any other requirements (such as test coverage).
Adhering to the following process is the best way to get your work included in the project:
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
```bash
git clone https://github.com/<your-username>/OpenTTD.git openttd
git clone https://github.com/OpenTTD/OpenTTD-git-hooks.git openttd_hooks
cd openttd
git remote add upstream https://github.com/OpenTTD/OpenTTD.git
cd .git/hooks
ln -s -t . ../../../openttd_hooks/hooks/*
```
2. If you cloned a while ago, get the latest changes from upstream:
```bash
git fetch upstream
```
3. Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix:
```bash
git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/Commit_style#Commit_message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
```bash
git fetch upstream
git rebase upstream/master
```
6. Push your topic branch up to your fork the first time:
```bash
git push --set-upstream origin <topic-branch-name>
```
And any time after that:
```bash
git push
```
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch.
**IMPORTANT**: By submitting a patch, you agree to the [License](#license).
### Pull request validation
Continuous integration (CI) tools monitor pull requests, and help us identify build and code quality issues.
The results of the CI tests will show on your pull request.
By clicking on Details you can further zoom in; in case of a failure it will show you why it failed. In case of success it will report how awesome you were.
## Code guidelines
[Code style](https://wiki.openttd.org/Coding_style) must be adhered to for pull requests to be accepted
## License
By contributing your code, you agree to license your contribution under the [GPL v2](https://github.com/OpenTTD/OpenTTD/blob/master/COPYING).
### Attribution of this Contributing Guide
This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE) terms for Bootstrap documentation.

@ -1,5 +1,5 @@
This is the license which applies to OpenTTD with the exception of some
3rd party modules. See readme.txt for details
3rd party modules. See README.md for details
GNU GENERAL PUBLIC LICENSE

75
Jenkinsfile vendored

@ -0,0 +1,75 @@
#!/usr/bin/env groovy
// The stages we run one by one
// Please don't add more than 2 items in a single stage; this hurts performance
def ci_stages = [
"Checkers": [
"commit-checker": "openttd/compile-farm-ci:commit-checker",
],
"Compilers": [
"linux-amd64-gcc-6": "openttd/compile-farm-ci:linux-amd64-gcc-6",
"linux-amd64-clang-3.8": "openttd/compile-farm-ci:linux-amd64-clang-3.8",
],
"Archs": [
"linux-i386-gcc-6": "openttd/compile-farm-ci:linux-i386-gcc-6",
],
"OS": [
"osx-10.9": "openttd/compile-farm-ci:osx-10.9",
],
]
def generateStage(targets) {
return targets.collectEntries{ key, target ->
["${key}": generateCI(key, target)]
}
}
def generateCI(display_name, image_name) {
return {
githubNotify context: 'openttd/' + display_name, description: 'This commit is being built', status: 'PENDING'
try {
dir("${display_name}") {
unstash "source"
docker.image("${image_name}").pull()
docker.image("${image_name}").withRun("--volumes-from ${hostname} --workdir " + pwd()) { c ->
sh "docker logs --follow ${c.id}; exit `docker wait ${c.id}`"
}
}
githubNotify context: 'openttd/' + display_name, description: 'The commit looks good', status: 'SUCCESS'
}
catch (error) {
githubNotify context: 'openttd/' + display_name, description: 'The commit cannot be built', status: 'FAILURE'
throw error
}
}
}
node {
ansiColor('xterm') {
stage("Checkout") {
checkout scm
// Ensure user.email and user.name is set, otherwise rebase cannot work
sh "git config user.email 'info@openttd.org'"
sh "git config user.name 'OpenTTD CI'"
// Ensure we also have origin/master available
sh "git fetch --no-tags origin master:refs/remotes/origin/master"
// Try to rebase to origin/master; if this fails, fail the CI
sh "git rebase origin/master"
stash name: "source", useDefaultExcludes: false
}
ci_stages.each { ci_stage ->
stage(ci_stage.key) {
parallel generateStage(ci_stage.value)
}
}
}
}

@ -12,15 +12,15 @@
# The revision is needed for the bundle name and creating an OSX application bundle.
# Detect the revision
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
# Make sure we have something in REV
ifeq ($(REV),)
REV := norev000
# Make sure we have something in VERSION
ifeq ($(VERSION),)
VERSION := norev000
endif
ifndef BUNDLE_NAME
BUNDLE_NAME = openttd-custom-$(REV)-$(OS)
BUNDLE_NAME = openttd-custom-$(VERSION)-$(OS)
ifeq ($(OS),MINGW)
BUNDLE_NAME := $(BUNDLE_NAME)-win$(CPU_TYPE)
endif
@ -73,7 +73,7 @@ endif
$(Q)cp "$(BIN_DIR)/baseset/opntitle.dat" "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/"*.obm "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/lang/"*.lng "$(LANG_DIR)/"
$(Q)cp "$(ROOT_DIR)/readme.txt" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/README.md" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/COPYING" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/known-bugs.txt" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/docs/multiplayer.txt" "$(BUNDLE_DIR)/docs/"
@ -95,7 +95,7 @@ ifdef MENU_DIR
$(Q)sed s/=openttd/=$(BINARY_NAME)/g "$(BUNDLE_DIR)/media/openttd.desktop" > "$(ROOT_DIR)/media/openttd.desktop.install"
endif
ifeq ($(TTD), openttd.exe)
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/readme.txt" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt" "$(BUNDLE_DIR)/"*.md
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt" "$(BUNDLE_DIR)/"*.md
ifeq ($(OS), DOS)
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
ifndef STRIP
@ -166,7 +166,7 @@ bundle_dmg: bundle
bundle_exe: all
@echo '[BUNDLE] Creating $(BUNDLE_NAME).exe'
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)unix2dos "$(ROOT_DIR)/docs/"*.txt "$(ROOT_DIR)/readme.txt" "$(ROOT_DIR)/COPYING" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt" "$(ROOT_DIR)/"*.md
$(Q)unix2dos "$(ROOT_DIR)/docs/"*.txt "$(ROOT_DIR)/COPYING" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt" "$(ROOT_DIR)/"*.md
$(Q)cd $(ROOT_DIR)/os/windows/installer && makensis.exe //DVERSION_INCLUDE=version_$(PLATFORM).txt install.nsi
$(Q)mv $(ROOT_DIR)/os/windows/installer/*$(PLATFORM).exe "$(BUNDLES_DIR)/$(BUNDLE_NAME).exe"
@ -196,7 +196,7 @@ endif
$(Q)install -m 644 "$(BUNDLE_DIR)/scripts/"* "$(INSTALL_DATA_DIR)/scripts"
ifndef DO_NOT_INSTALL_DOCS
$(Q)install -d "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/readme.txt" "$(BUNDLE_DIR)/known-bugs.txt" "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/known-bugs.txt" "$(INSTALL_DOC_DIR)"
endif
ifndef DO_NOT_INSTALL_CHANGELOG
$(Q)install -d "$(INSTALL_DOC_DIR)"

@ -96,15 +96,15 @@ VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d' ')
# Use autodetected revisions
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
REV_NR := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
ISODATE := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
# Make sure we have something in REV and REV_NR
ifeq ($(REV),)
REV := norev000
# Make sure we have something in VERSION and ISODATE
ifeq ($(VERSION),)
VERSION := norev000
endif
ifeq ($(REV_NR),)
REV_NR := 0
ifeq ($(ISODATE),)
ISODATE := 00000000
endif
# This helps to recompile if flags change
@ -115,7 +115,7 @@ RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORC
# If there is a change in the source-file-list, make sure we recheck the deps
RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi )
# If there is a change in the revision, make sure we recompile rev.cpp
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV) $(REV_NR) $(MODIFIED)" ]; then echo "$(REV) $(REV_NR) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(VERSION) $(MODIFIED)" ]; then echo "$(VERSION) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi )
# If there is a change in the configure invocation, make sure we recompile rev.cpp
RES := $(shell if [ "`cat $(CONFIG_CACHE_INVOCATION) 2>/dev/null`" != "$(CONFIGURE_INVOCATION)" ]; then echo "$(CONFIGURE_INVOCATION)" > $(CONFIG_CACHE_INVOCATION); fi )
@ -297,10 +297,10 @@ $(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
# Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(CONFIG_CACHE_INVOCATION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@\!\!CONFIGURE_INVOCATION\!\!@$(CONFIGURE_INVOCATION)@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@\!\!CONFIGURE_INVOCATION\!\!@$(CONFIGURE_INVOCATION)@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@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!DATE!!@`date +%d.%m.%y`@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" > $(SRC_DIR)/os/windows/ottdres.rc
FORCE:

@ -10,11 +10,11 @@ game as closely as possible while extending it with new features.
OpenTTD is licensed under the GNU General Public License version 2.0,
but includes some 3rd party software under different licenses. See the
section "Licensing" in readme.txt for details.
section "Licensing" below for details,
* * *
See [readme.txt](readme.txt) for the original OpenTTD readme.
See [below](#openttd) for the original OpenTTD readme.
The thread for this patchpack can be found [here](http://www.tt-forums.net/viewtopic.php?f=33&t=73469).
@ -257,3 +257,771 @@ The minimum supported compiler versions are:
* clang: 3.3
Sufficienty up-to-date versions of other compiler toolchains including MSVC and ICC should also work.
* * *
* * *
# OpenTTD
## Table of contents
- 1.0) [About](#10-about)
- 2.0) [Contacting](#20-contacting)
- 2.1) [Reporting bugs](#21-reporting-bugs)
- 2.2) [Reporting desyncs](#22-reporting-desyncs)
- 3.0) [Supported platforms](#30-supported-platforms)
- 4.0) [Installing and running OpenTTD](#40-installing-and-running-openttd)
- 4.1) [(Required) 3rd party files](#41-required-3rd-party-files)
- 4.2) [OpenTTD directories](#42-openttd-directories)
- 4.3) [Portable installations (portable media)](#43-portable-installations-portable-media)
- 4.4) [Files in tar (archives)](#44-files-in-tar-archives)
- 5.0) [OpenTTD features](#50-openttd-features)
- 5.1) [Logging of potentially dangerous actions](#51-logging-of-potentially-dangerous-actions)
- 6.0) [Configuration file](#60-configuration-file)
- 7.0) [Compiling](#70-compiling)
- 7.1) [Required/optional libraries](#71-requiredoptional-libraries)
- 7.2) [Supported compilers](#72-supported-compilers)
- 7.3) [Compilation of base sets](#73-compilation-of-base-sets)
- 8.0) [Translating](#80-translating)
- 8.1) [Translation](#81-translation)
- 8.2) [Previewing](#82-previewing)
- 9.0) [Troubleshooting](#90-troubleshooting)
- 10.0) [Licensing](#100-licensing)
- X.X) [Credits](#xx-credits)
## 1.0) About
OpenTTD is a transport simulation game based upon the popular game Transport
Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original
game as closely as possible while extending it with new features.
OpenTTD is licensed under the GNU General Public License version 2.0,
but includes some 3rd party software under different licenses. See the
section "Licensing" below for details.
## 2.0) Contacting
The easiest way to contact the OpenTTD team is by submitting bug reports or
posting comments in our forums. You can also chat with us on IRC (#openttd
on irc.oftc.net).
The OpenTTD homepage is [http://www.openttd.org/](http://www.openttd.org/).
You can also find the OpenTTD forums at [http://forum.openttd.org/](http://forum.openttd.org/).
### 2.1) Reporting bugs
First of all, check whether the bug is not already known. Do this by looking
through the file called 'known-bugs.txt' which is distributed with OpenTTD
like this readme.
For tracking our bugs we are using Githubs issue tracker. You can find
the tracker at [https://github.com/OpenTTD/OpenTTD/issues](https://github.com/OpenTTD/OpenTTD/issues). Before actually reporting take a look
through the already reported bugs there to see if the bug is already known.
The 'known-bugs.txt' file might be a bit outdated at the moment you are
reading it as only bugs known before the release are documented there. Also
look through the recently closed bugs.
When you are sure it is not already reported you should:
- Make sure you are running a recent version, i.e. run the latest stable or
nightly based on where you found the bug.
- Make sure you are not running a non-official binary, like a patch pack.
When you are playing with a patch pack you should report any bugs to the
forum thread related to that patch pack.
- Make it reproducible for the developers. In other words, create a savegame
in which you can reproduce the issue once loaded. It is very useful to give
us the crash.dmp, crash.sav, crash.log and crash screenshot which are
created on crashes.
- Check whether the bug is already reported on our bug tracker. This includes
searching for recently closed bug reports as the bug might already be fixed.
After you have done all that you can report the bug. Please include the
following information in your bug report:
- OpenTTD version (PLEASE test the latest SVN/nightly build)
- Bug details, including instructions how to reproduce it
- Platform (Windows, Linux, FreeBSD, …) and compiler (including version) if
you compiled OpenTTD yourself.
- The processor architecture of your OS (32 bits Windows, 64 bits Windows,
Linux on an ARM, Mac OS X on a PowerPC, …)
- Attach a saved game **and** a screenshot if possible
- If this bug only occurred recently please note the last version without
the bug and the first version including the bug. That way we can fix it
quicker by looking at the changes made.
- Attach crash.dmp, crash.log and crash.sav. These files are usually created
next to your openttd.cfg. The crash handler will tell you the location.
### 2.2) Reporting desyncs
As desyncs are hard to make reproducible OpenTTD has the ability to log all
actions done by clients so we can replay the whole game in an effort to make
desyncs better reproducible. You need to turn this ability on. When turned
on an automatic savegame will be made once the map has been constructed in
the 'save/autosave' directory, see OpenTTD directories to know where to find
this directory. Furthermore the log file 'commands-out.log' will be created
and all actions will be written to there.
To enable the desync debugging you need to set the debug level for 'desync'
to at least 1. You do this by starting OpenTTD with '`-d desync=<level>`' as
parameter or by typing '`debug_level desync=<level>`' in OpenTTD's internal
console.
The desync debug levels are:
- 0: nothing.
- 1: dumping of commands to 'commands-out.log'.
- 2: same as 1 plus checking vehicle caches and dumping that too.
- 3: same as 2 plus monthly saves in autosave.
- 4 and higher: same as 3
Restarting OpenTTD will overwrite 'commands-out.log'. OpenTTD will not remove
the savegames (dmp_cmds_*.sav) made by the desync debugging system, so you
have to occasionally remove them yourself!
The naming format of the desync savegames is as follows:
dmp_cmds_XXXXXXXX_YYYYYYYY.sav. The XXXXXXXX is the hexadecimal representation
of the generation seed of the game and YYYYYYYY is the hexadecimal
representation of the date of the game. This sorts the savegames by game and
then by date making it easier to find the right savegames.
When a desync has occurred with the desync debugging turned on you should file
a bug report with the following files attached:
- commands-out.log as it contains all the commands that were done
- the last saved savegame (search for the last line beginning with
'save: dmp_cmds_' in commands-out.log). We use this savegame to check
whether we can quickly reproduce the desync. Otherwise we will need …
- the first saved savegame (search for the first line beginning with 'save'
where the first part, up to the last underscore '_', is the same). We need
this savegame to be able to reproduce the bug when the last savegame is not
old enough. If you loaded a scenario or savegame you need to attach that.
- optionally you can attach the savegames from around 50%, 75%, 85%, 90% and
95% of the game's progression. We can use these savegames to speed up the
reproduction of the desync, but we should be able to reproduce these
savegames based on the first savegame and commands-out.log.
- in case you use any NewGRFs you should attach the ones you used unless
we can easily find them ourselves via bananas or when they are in the
#openttdcoop pack.
Do NOT remove the dmp_cmds savegames of a desync you have reported until the
desync has been fixed; if you, by accident, send us the wrong savegames we
will not be able to reproduce the desync and thus will be unable to fix it.
## 3.0) Supported platforms
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)
- Linux (SDL or Allegro)
- MacOS X (universal) (Cocoa video and sound drivers)
- MorphOS (SDL)
- OpenBSD (SDL)
- OS/2 (SDL)
- Windows (Win32 GDI (faster) or SDL or Allegro)
## 4.0) Installing and running OpenTTD
Installing OpenTTD is fairly straightforward. Either you have downloaded an
archive which you have to extract to a directory where you want OpenTTD to
be installed, or you have downloaded an installer, which will automatically
extract OpenTTD in the given directory.
OpenTTD looks in multiple locations to find the required data files (described
in section 4.2). Installing any 3rd party files into a 'shared' location has
the advantage that you only need to do this step once, rather than copying the
data files into all OpenTTD versions you have.
Savegames, screenshots, etc are saved relative to the config file (openttd.cfg)
currently being used. This means that if you use a config file in one of the
shared directories, savegames will reside in the save/ directory next to the
openttd.cfg file there.
If you want savegames and screenshots in the directory where the OpenTTD binary
resides, simply have your config file in that location. But if you remove this
config file, savegames will still be in this directory (see notes in
section 4.2 'OpenTTD directories')
OpenTTD comes without AIs, so if you want to play with AIs you have to download
them. The easiest way is via the 'Check Online Content' button in the main menu.
You can select some AIs that you think are compatible with your playing style.
Another way is manually downloading the AIs from the forum although then you
need to make sure that you install all the required AI libraries too; they get
automatically selected (and downloaded) if you get the AIs via the 'Check
Online Content'. If you do not have an AI but have configured OpenTTD to start
an AI a message will be shown that the 'dummy' AI has been started.
### 4.1) (Required) 3rd party files
Before you run OpenTTD, you need to put the game's data files into a baseset/
directory which can be located in various places addressed in the following
section.
For OpenTTD you need to acquire some third party data files. For this you have
the choice of using the original Transport Tycoon Deluxe data files or a set
of free data files.
Do NOT copy files included with OpenTTD into 'shared' directories (explained in
the following sections) as sooner or later you will run into graphical glitches
when using other versions of the game.
#### 4.1.1) Free graphics and sound files
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- [http://www.openttd.org/download-opengfx](http://www.openttd.org/download-opengfx) for OpenGFX
- [http://www.openttd.org/download-opensfx](http://www.openttd.org/download-opensfx) for OpenSFX
- [http://www.openttd.org/download-openmsx](http://www.openttd.org/download-openmsx) for OpenMSX
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
#### 4.1.2) Original Transport Tycoon Deluxe graphics and sound files
If you want to play with the original Transport Tycoon Deluxe data files you
have to copy the data files from the CD-ROM into the baseset/ directory. It
does not matter whether you copy them from the DOS or Windows version of
Transport Tycoon Deluxe. The Windows install can optionally copy these files.
You need to copy the following files:
- sample.cat
- trg1r.grf or TRG1.GRF
- trgcr.grf or TRGC.GRF
- trghr.grf or TRGH.GRF
- trgir.grf or TRGI.GRF
- trgtr.grf or TRGT.GRF
#### 4.1.3) Original Transport Tycoon Deluxe music
If you want the Transport Tycoon Deluxe music, copy the files from the gm/
folder from the Windows version of Transport Tycoon Deluxe to the baseset
folder in your OpenTTD folder (also explained in the following sections).
The music from the DOS version as well as the original Transport Tycoon does
not work.
#### 4.1.4) AIs
If you want AIs use the in-game content downloader. If for some reason that is
not possible or you want to use an AI that has not been uploaded to the content
download system download the tar file and place it in the ai/ directory. If the
AI needs libraries you will have to download those too and put them in the
ai/library/ directory. All AIs and AI Libraries that have been uploaded to
the content download system can be found at http://noai.openttd.org/downloads/
The AIs and libraries can be found their in the form of .tar.gz packages.
OpenTTD can read inside tar files but it does not extract .tar.gz files by
itself.
To figure out which libraries you need for an AI you have to start the AI and
wait for an error message to pop up. The error message will tell you
'could not find library "lib-name"'. Download that library and try again.
#### 4.1.5) Game scripts
If you want an extra challenge in OpenTTD you can download so-called game
scripts via the in-game content downloader. These game scripts have varying
functionality, though they can generally influence town growth, subsidies, add
goals to reach or provide a different ranking system.
If you download a game script manually you have to follow the same rules as for
AIs, except that game scripts are placed in the game/ directory instead of the
ai/ directory.
### 4.2) OpenTTD directories
OpenTTD uses its own directory to store its required 3rd party base set files
(see section 4.1 'Required 3rd party files') and non-compulsory extension and
configuration files. See below for their proper place within this OpenTTD main
data directory.
The main OpenTTD directories can be found in various locations, depending on
your operating system:
1. The current working directory (from where you started OpenTTD)
For non-Windows operating systems OpenTTD will not scan for files in this
directory if it is your personal directory, i.e. '~/', or when it is the
root directory, i.e. '/'.
2. Your personal directory
- Windows:
- `C:\My Documents\OpenTTD` (95, 98, ME)
- `C:\Documents and Settings\<username>\My Documents\OpenTTD` (2000, XP)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7)
- Mac OSX: `~/Documents/OpenTTD`
- Linux: `$XDG_DATA_HOME/openttd` which is usually `~/.local/share/openttd`
when built with XDG base directory support, otherwise `~/.openttd`
3. The shared directory
- Windows:
- `C:\Documents and Settings\All Users\Shared Documents\OpenTTD` (2000, XP)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7)
- Mac OSX: `/Library/Application Support/OpenTTD`
- Linux: not available
4. The binary directory (where the OpenTTD executable is)
- Windows: `C:\Program Files\OpenTTD`
- Linux: `/usr/games`
5. The installation directory (Linux only)
- Linux: `/usr/share/games/openttd`
6. The application bundle (Mac OSX only)
It includes the OpenTTD files (grf+lng) and it will work as long as they
are not touched
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 | |
The (automatically created) directory content_download is for OpenTTD's internal
use and no files should be added to it or its subdirectories manually.
#### Notes:
- Linux in the previous list means .deb, but most paths should be similar for
others.
- The previous search order is also used for NewGRFs and openttd.cfg.
- If openttd.cfg is not found, then it will be created using the 2, 4, 1, 3,
5 order. When built with XDG base directory support, openttd.cfg will be
created in $XDG_CONFIG_HOME/openttd which is usually ~/.config/openttd.
- Savegames will be relative to the config file only if there is no save/
directory in paths with higher priority than the config file path, but
autosaves and screenshots will always be relative to the config file.
Unless the configuration file is in $XDG_CONFIG_HOME/openttd, then all
other files will be saved under $XDG_DATA_HOME/openttd.
#### The preferred setup:
Place 3rd party files in shared directory (or in personal directory if you do
not have write access on shared directory) and have your openttd.cfg config
file in personal directory (where the game will then also place savegames and
screenshots).
### 4.3) Portable installations (portable media)
You can install OpenTTD on external media so you can take it with you, i.e.
using a USB key, or a USB HDD, etc.
Create a directory where you shall store the game in (i.e. OpenTTD/).
Copy the binary (OpenTTD.exe, OpenTTD.app, openttd, etc), baseset/ and your
openttd.cfg to this directory.
You can copy binaries for any operating system into this directory, which will
allow you to play the game on nearly any computer you can attach the external
media to.
As always - additional grf files are stored in the newgrf/ dir (for details,
again, see section 4.1).
### 4.4) Files in tar (archives)
OpenTTD can read files that are in an uncompressed tar (archive), which
makes it easy to bundle files belonging to the same script, NewGRF or base
set. Music sets are the only exception as they cannot be stored in a tar
file due to being played by external applications.
OpenTTD sees each tar archive as the 'root' of its search path. This means that
having a file with the same path in two different tar files means that one
cannot be opened, after all only one file will be found first. As such it is
advisable to put an uniquely named folder in the root of the tar and put all the
content in that folder. For example, all downloaded content has a path that
concatenates the name of the content and the version, which makes the path
unique. For custom tar files it is advised to do this as well.
The normal files are also referred to by their relative path from the search
directory, this means that also normal files could hide files in a tar as
long as the relative path from the search path of the normal file is the
same as the path in the tar file. Again it is advised to have an unique path
to the normal file so they do not collide with the files from other tar
files.
## 5.0) OpenTTD features
OpenTTD has a lot of features going beyond the original Transport Tycoon Deluxe
emulation. Unfortunately, there is currently no comprehensive list of features,
but there is a basic features list on the web, and some optional features can be
controlled through the Advanced Settings dialog. We also implement some
features known from [TTDPatch](http://www.ttdpatch.net/).
Several important non-standard controls:
- Ctrl modifies many commands and makes them more powerful. For example Ctrl
clicking on signals with the build signal tool changes their behaviour, holding
Ctrl while the track build tool is activated changes it to the track removal
tool, and so on. See [http://wiki.openttd.org/Hidden_features](http://wiki.openttd.org/Hidden_features)
for a non-comprehensive list or look at the tooltips.
- Ingame console. More information at
[http://wiki.openttd.org/index.php/Console](http://wiki.openttd.org/index.php/Console)
- Hovering over a GUI element shows tooltips. This can be changed to right click
via the advanced settings.
### 5.1) Logging of potentially dangerous actions
OpenTTD is a complex program, and together with NewGRF, it may show a buggy
behaviour. But not only bugs in code can cause problems. There are several
ways to affect game state possibly resulting in program crash or multiplayer
desyncs.
Easier way would be to forbid all these unsafe actions, but that would affect
game usability for many players. We certainly do not want that.
However, we receive bug reports because of this. To reduce time spent with
solving these problems, these potentially unsafe actions are logged in
the savegame (including crash.sav). Log is stored in crash logs, too.
Information logged:
- Adding / removing / changing order of NewGRFs
- Changing NewGRF parameters, loading compatible NewGRF
- Changing game mode (scenario editor <-> normal game)
- Loading game saved in a different OpenTTD / TTDPatch / Transport Tycoon Deluxe /
original Transport Tycoon version
- Running a modified OpenTTD build
- Changing settings affecting NewGRF behaviour (non-network-safe settings)
- Triggering NewGRF bugs
No personal information is stored.
You can show the game log by typing 'gamelog' in the console or by running
OpenTTD in debug mode.
## 6.0) Configuration file
The configuration file for OpenTTD (openttd.cfg) is in a simple Windows-like
.INI format. It is mostly undocumented. Almost all settings can be changed
ingame by using the 'Advanced Settings' window.
When you cannot find openttd.cfg you should look in the directories as
described in section 4.2. If you do not have an openttd.cfg OpenTTD will
create one after closing.
## 7.0) Compiling
### Windows:
You need Microsoft Visual Studio .NET. Open the project file
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) and ZLIB (WITH_ZLIB) support is enabled by default. For these
to work you need their development files. For best results, download the
openttd-useful.zip file from [http://www.openttd.org/download-openttd-useful](http://www.openttd.org/download-openttd-useful)
Put the header files into your compiler's include/ directory and the
library (.lib) files into the lib/ directory.
For more help with VS see docs/Readme_Windows_MSVC.txt.
You can also build it using the Makefile with MSYS/MinGW or Cygwin/MinGW.
Please read the Makefile for more information.
### Solaris, FreeBSD, OpenBSD:
Use '`gmake`', but do a '`./configure`' before the first build.
### Linux/Unix:
OpenTTD can be built with GNU '`make`'. On non-GNU systems it is called '`gmake`'.
However, for the first build one has to do a '`./configure`' first.
### MacOS X:
Use '`make`' or Xcode (which will then call make for you)
This will give you a binary for your CPU type (PPC/Intel)
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:
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:
- libSDL/liballegro: hardware access (video, sound, mouse)
- zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- liblzo2: (de)compressing of old (pre 0.3.0) savegames
- liblzma: (de)compressing of savegames (1.1.0 and later)
- libpng: making screenshots and loading heightmaps
- libfreetype: loading generic fonts and rendering them
- libfontconfig: searching for fonts, resolving font names to actual fonts
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
natural sorting of strings.
OpenTTD does not require any of the libraries to be present, but without
liblzma you cannot open most recent savegames and without zlib you cannot
open most older savegames or use the content downloading system.
Without libSDL/liballegro on non-Windows and non-MacOS X machines you have
no graphical user interface; you would be building a dedicated server.
### 7.2) Supported compilers
The following compilers are known to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2005, 2008 and 2010.
Version 2005 gives bogus warnings about scoping issues.
- GNU Compiler Collection (GCC) 3.3 - 4.4, 4.6 - 4.8.
- Versions 4.1 and earlier give bogus warnings about uninitialised variables.
- Versions 4.4, 4.6 give bogus warnings about freeing non-heap objects.
- Versions 4.6 and later give invalid warnings when lto is enabled.
- Intel C++ Compiler (ICC) 12.0.
- Clang/LLVM 2.9 - 3.0
Version 2.9 gives bogus warnings about code nonconformity.
The following compilers are known not to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2003 and earlier.
- GNU Compiler Collection (GCC) 3.2 and earlier.
These old versions fail due to OpenTTD's template usage.
- GNU Compiler Collection (GCC) 4.5. It optimizes enums too aggressively.
See http://bugs.openttd.org/task/5513 and references therein.
- Intel C++ Compiler (ICC) 11.1 and earlier.
- Version 10.0 and earlier fail a configure check and fail with recent
system headers.
- Version 10.1 fails to compile station_gui.cpp.
- Version 11.1 fails with an internal error when compiling network.cpp.
- Clang/LLVM 2.8 and earlier.
- (Open) Watcom.
If any of these compilers can compile OpenTTD again, please let us know.
Patches to support more compilers are welcome.
### 7.3) Compilation of base sets
To recompile the extra graphics needed to play with the original Transport
Tycoon Deluxe graphics you need GRFCodec (which includes NFORenum) as well.
GRFCodec can be found at: [http://www.openttd.org/download-grfcodec](http://www.openttd.org/download-grfcodec)
The compilation of these extra graphics does generally not happen, unless
you remove the graphics file using '`make maintainer-clean`'.
Re-compilation of the base sets, thus also use of '`--maintainer-clean`' can
leave the repository in a modified state as different grfcodec versions can
cause binary differences in the resulting grf. Also translations might have
been added for the base sets which are not yet included in the base set
information files. Use the configure option '`--without-grfcodec`' to avoid
modification of the base set files by the build process.
## 8.0) Translating
See [http://www.openttd.org/development](http://www.openttd.org/development) for up-to-date information.
The use of the online Translator service, located at
[http://translator.openttd.org/](http://translator.openttd.org/), is highly
encouraged. For getting an account simply follow the guidelines in the FAQ of
the translator website.
If for some reason the website is down for a longer period of time, the
information below might be of help.
Please contact the translations manager ([http://www.openttd.org/contact](http://www.openttd.org/contact))
before beginning the translation process! This avoids double work, as
someone else may have already started translating to the same language.
### 8.1) Translation
So, now that you have notified the development team about your intention to
translate (You did, right? Of course you did.) you can pick up english.txt
(found in the SVN repository under /src/lang) and translate.
You must change the first two lines of the file appropriately:
##name English-Name-Of-Language
##ownname Native-Name-Of-Language
Note: Do not alter the following parts of the file:
- String identifiers (the first word on each line)
- Parts of the strings which are in curly braces (such as {STRING})
- Lines beginning with ## (such as ##id), other than the first two lines of
the file
### 8.2) Previewing
In order to view the translation in the game, you need to compile your language
file with the strgen utility. As this utility is tailored to a specific OpenTTD
version, you need to compile it yourself. Just take the normal OpenTTD sources
and build that. During the build process the strgen utility will be made.
strgen is a command-line utility. It takes the language filename as parameter.
Example:
strgen lang/german.txt
This results in compiling german.txt and produces another file named german.lng.
Any missing strings are replaced with the English strings. Note that it looks
for english.txt in the lang subdirectory, which is where your language file
should also be.
That is all! You should now be able to select the language in the game options.
## 9.0) Troubleshooting
To see all startup options available to you, start OpenTTD with the
'`./openttd -h`' option. This might help you tweak some of the settings.
If the game is acting strange and you feel adventurous you can try the
'`-d [[<name>=]<level>]`' flag, where the higher levels will give you more
debugging output. The 'name' variable can help you to display only some type of
debugging messages. This is mostly undocumented so best is to look in the
source code file debug.c for the various debugging types. For more information
look at [http://wiki.openttd.org/index.php/Command_line](http://wiki.openttd.org/index.php/Command_line).
The most frequent problem is missing data files. Please install OpenGFX and
possibly OpenSFX and OpenMSX. See section 4.1.1 for more information.
Under certain circumstance, especially on Ubuntu OpenTTD can be extremely slow
and/or freeze. See known-bugs.txt for more information and how to solve this
problem on your computer.
Under Windows 98 and lower it is impossible to use a dedicated server; it will
fail to start. Perhaps this is for the better because those OSes are not known
for their stability.
With the added support for font-based text selecting a non-latin language can
result in lots of question marks ('?') being shown on screen. Please open your
configuration file (openttd.cfg - see Section 4.2 for where to find it)
and add a suitable font for the small, medium and / or large font, e.g.:
small_font = "Tahoma"
medium_font = "Tahoma"
large_font = "Tahoma"
You should use a font name like 'Tahoma' or a path to the desired font.
Any NewGRF file used in a game is stored inside the savegame and will refuse
to load if you do not have that NewGRF file available. A list of missing files
can be viewed in the NewGRF window accessible from the file load dialogue window.
You can try to obtain the missing files from that NewGRF dialogue or if they
are not available online you can search manually through our [forum's graphics
development section](http://www.tt-forums.net/viewforum.php?f=66) or GrfCrawler
(http://grfcrawler.tt-forums.net/). Put the NewGRF files in OpenTTD's newgrf folder
(see section 4.2 'OpenTTD directories') and rescan the list of available NewGRFs.
Once you have all missing files, you are set to go.
## 10.0) Licensing
OpenTTD is licensed under the GNU General Public License version 2.0. For
the complete license text, see the file 'COPYING'. This license applies
to all files in this distribution, except as noted below.
The squirrel implementation in src/3rdparty/squirrel is licensed under
the Zlib license. See src/3rdparty/squirrel/COPYRIGHT for the complete
license text.
The md5 implementation in src/3rdparty/md5 is licensed under the Zlib
license. See the comments in the source files in src/3rdparty/md5 for
the complete license text.
The implementations of Posix getaddrinfo and getnameinfo for OS/2 in
src/3rdparty/os2 are distributed partly under the GNU Lesser General Public
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](http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi5s.zip)
## X.X) Credits
### The OpenTTD team (in alphabetical order):
- Grzegorz Duczyński (adf88) - General coding (since 1.7.2)
- Albert Hofkamp (Alberth) - GUI expert (since 0.7)
- Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
- Ulf Hermann (fonsinchen) - Cargo Distribution (since 1.3)
- Christoph Elsenhans (frosch) - General coding (since 0.6)
- Loïc Guilloux (glx) - Windows Expert (since 0.4.5)
- Michael Lutz (michi_cc) - Path based signals (since 0.7)
- Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
- Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
- Ingo von Borstel (planetmaker) - General coding, Support (since 1.1)
- Remko Bijker (Rubidium) - Lead coder and way more (since 0.4.5)
- José Soler (Terkhen) - General coding (since 1.0)
- Leif Linse (Zuu) - AI/Game Script (since 1.2)
### Inactive Developers:
- Jean-François Claeys (Belugas) - GUI, newindustries and more (0.4.5 - 1.0)
- Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles (0.3 - 0.7)
- Victor Fischer (Celestar) - Programming everywhere you need him to (0.3 - 0.6)
- Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;) (0.4.5 - 0.6)
- Jonathan Coome (Maedhros) - High priest of the NewGRF Temple (0.5 - 0.6)
- Attila Bán (MiHaMiX) - WebTranslator 1 and 2 (0.3 - 0.5)
- Zdeněk Sojka (SmatZ) - Bug finder and fixer (0.6 - 1.3)
- Christoph Mallon (Tron) - Programmer, code correctness police (0.3 - 0.5)
- Patric Stout (TrueBrain) - NoProgrammer (0.3 - 1.2), sys op (active)
- Thijs Marinussen (Yexo) - AI Framework, General (0.6 - 1.3)
### Retired Developers:
- Tamás Faragó (Darkvater) - Ex-Lead coder (0.3 - 0.5)
- Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3 - 0.3)
- Emil Djupfeld (egladil) - MacOSX port (0.4 - 0.6)
- Simon Sasburg (HackyKid) - Bug fixer (0.4 - 0.4.5)
- Ludvig Strigeus (ludde) - Original author of OpenTTD, main coder (0.1 - 0.3)
- Cian Duffy (MYOB) - BeOS port / manual writing (0.1 - 0.3)
- Petr Baudiš (pasky) - Many patches, newgrf support, etc. (0.3 - 0.3)
- Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker (0.6 - 0.7)
- Serge Paquet (vurlix) - 2nd contributor after ludde (0.1 - 0.3)
### Thanks to:
- Josef Drexler - For his great work on TTDPatch.
- Marcin Grzegorczyk - For his TTDPatch work and documentation of Transport Tycoon Deluxe internals and track foundations
- Stefan Meißner (sign_de) - For his work on the console
- Mike Ragsdale - OpenTTD installer
- Christian Rosentreter (tokai) - MorphOS / AmigaOS port
- Richard Kempton (RichK67) - Additional airports, initial TGP implementation
- Alberto Demichelis - Squirrel scripting language
- L. Peter Deutsch - MD5 implementation
- Michael Blunck - For revolutionizing TTD with awesome graphics
- George - Canal graphics
- Andrew Parkhouse (andythenorth) - River graphics
- David Dallaston (Pikka) - Tram tracks
- All Translators - For their support to make OpenTTD a truly international game
- Bug Reporters - Thanks for all bug reports
- Chris Sawyer - For an amazing game!

@ -7,4 +7,4 @@
* 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.7 API compatibility in effect.");
AILog.Info("1.7 API compatibility in effect.");

@ -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.8 API compatibility in effect.");

@ -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,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.8"; }
function GetAPIVersion() { return "1.9"; }
function GetDate() { return "2007-03-18"; }
function CreateInstance() { return "Regression"; }
}

Binary file not shown.

@ -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.8 API compatibility in effect.");

@ -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/>.
*/

@ -1236,12 +1236,15 @@ make_compiler_cflags() {
# $4 - name of the ldflags variable
# $5 - name of the features variable
# Get the compiler to tell us who it is
compiler="`$1 --version | head -n1 | cut -d' ' -f1`"
eval eval "flags=\\\$$2"
eval eval "cxxflags=\\\$$3"
eval eval "ldflags=\\\$$4"
eval eval "features=\\\$$5"
if [ `basename $1 | cut -c 1-3` = "icc" ]; then
if [ "$compiler" = "icc" ]; then
# Enable some things only for certain ICC versions
cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g`
@ -1333,7 +1336,7 @@ make_compiler_cflags() {
features="$features lto"
fi
fi
elif [ `basename $1 | grep 'clang'` ]; then
elif [ "$compiler" = "clang" ]; then
# Enable some things only for certain clang versions
cc_version="`$1 -v 2>&1 | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"
@ -1393,6 +1396,8 @@ make_compiler_cflags() {
# rdynamic is used to get useful stack traces from crash reports.
ldflags="$ldflags -rdynamic"
# Assume gcc, since it just uses argv[0] in its --version output
else
# Enable some things only for certain GCC versions
# cc_version = major_version * 100 + minor_version
@ -1544,21 +1549,27 @@ EOL
make_cflags_and_ldflags() {
# General CFlags for BUILD
CFLAGS_BUILD="$CFLAGS_BUILD"
CFLAGS_BUILD_ENV="$CFLAGS_BUILD"
CFLAGS_BUILD=""
# Special CXXFlags for BUILD
CXXFLAGS_BUILD="$CXXFLAGS_BUILD"
CXXFLAGS_BUILD_ENV="$CXXFLAGS_BUILD"
CXXFLAGS_BUILD=""
# LDFLAGS for BUILD
LDFLAGS_BUILD="$LDFLAGS_BUILD"
LDFLAGS_BUILD_ENV="$LDFLAGS_BUILD"
LDFLAGS_BUILD=""
# FEATURES for BUILD (lto)
FEATURES_BUILD=""
# General CFlags for HOST
CFLAGS="$CFLAGS"
CFLAGS_ENV="$CFLAGS"
CFLAGS=""
# Special CXXFlags for HOST
CXXFLAGS="$CXXFLAGS"
CXXFLAGS_ENV="$CXXFLAGS"
CXXFLAGS=""
# Libs to compile. In fact this is just LDFLAGS
LIBS="-lstdc++"
# LDFLAGS used for HOST
LDFLAGS="$LDFLAGS"
LDFLAGS_ENV="$LDFLAGS"
LDFLAGS=""
# FEATURES for HOST (lto)
FEATURES=""
@ -2208,6 +2219,14 @@ EOL
fi
fi
# All flags to be extended via the env
CFLAGS_BUILD="$CFLAGS_BUILD $CFLAGS_BUILD_ENV"
CXXFLAGS_BUILD="$CXXFLAGS_BUILD $CXXFLAGS_BUILD_ENV"
LDFLAGS_BUILD="$LDFLAGS_BUILD $LDFLAGS_BUILD_ENV"
CFLAGS="$CFLAGS $CFLAGS_ENV"
CXXFLAGS="$CXXFLAGS $CXXFLAGS_ENV"
LDFLAGS="$LDFLAGS $LDFLAGS_ENV"
log 1 "using CFLAGS_BUILD... $CFLAGS_BUILD"
log 1 "using CXXFLAGS_BUILD... $CXXFLAGS_BUILD"
log 1 "using LDFLAGS_BUILD... $LDFLAGS_BUILD"
@ -2258,7 +2277,22 @@ check_compiler() {
# $8 - "0" gcc, "1" g++, "2" windres, "3" strip, "4" lipo
# $9 - What the command is to check for
if [ -n "$3" ]; then
if [ -n "$4" ]; then
# Check for manual compiler
machine=`$4 $9 2>/dev/null`
ret=$?
eval "$2=\"$4\""
log 2 "executing $4 $9"
log 2 " returned $machine"
log 2 " exit code $ret"
if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
log 1 "checking $1... $4 not found"
log 1 "the selected binary doesn't seem to be a $6 binary"
exit 1
fi
elif [ -n "$3" ]; then
# Check for system
for val in $6; do
if [ -z "$6" ]; then
@ -2306,21 +2340,6 @@ check_compiler() {
log 1 "the compiler suggests it doesn't build code for the machine you specified"
exit 1
fi
elif [ -n "$4" ]; then
# Check for manual compiler
machine=`$4 $9 2>/dev/null`
ret=$?
eval "$2=\"$4\""
log 2 "executing $4 $9"
log 2 " returned $machine"
log 2 " exit code $ret"
if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
log 1 "checking $1... $4 not found"
log 1 "the selected binary doesn't seem to be a $6 binary"
exit 1
fi
else
# Nothing given, autodetect
@ -2388,26 +2407,14 @@ check_compiler() {
}
check_build() {
if [ "$os" = "FREEBSD" ]; then
# FreeBSD's C compiler does not support dump machine.
# However, removing C support is not possible because PSP must be linked with the C compiler.
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CXX" "$default_cxx" "c++" "0" "-dumpmachine"
else
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "$default_cc" "cc" "0" "-dumpmachine"
fi
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "$default_cc" "cc" "0" "-dumpmachine"
}
check_host() {
# By default the host is the build
if [ -z "$host" ]; then host="$build"; fi
if [ "$os" = "FREEBSD" ]; then
# FreeBSD's C compiler does not support dump machine.
# However, removing C support is not possible because PSP must be linked with the C compiler.
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CXX" "$default_cxx" "c++" "0" "-dumpmachine"
else
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "$default_cc" "cc" "0" "-dumpmachine"
fi
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "$default_cc" "cc" "0" "-dumpmachine"
}
check_cxx_build() {

@ -76,7 +76,7 @@ list, above all others, otherwise compilation will most likely fail!!
3) TTD GRAPHICS FILES
---------------------
See section 4.1 of readme.txt for the required 3rdparty files and how to install them.
See section 4.1 of README.md for the required 3rdparty files and how to install them.
4) COMPILING

@ -14,42 +14,31 @@ if [ "$#" != "0" ]; then
Usage: ./findversion.sh
Finds the current revision and if the code is modified.
Output: <REV>\t<REV_NR>\t<MODIFIED>\t<CLEAN_REV>
REV
Output: <VERSION>\t<ISODATE>\t<MODIFIED>\t<HASH>
VERSION
a string describing what version of the code the current checkout is
based on. The exact format of this string depends on the version
control system in use, but it tries to identify the revision used as
close as possible (using the svn revision number or hg/git hash).
This also includes an indication of whether the checkout was
modified and which branch was checked out. This value is not
based on.
This also includes the commit date, an indication of whether the checkout
was modified and which branch was checked out. This value is not
guaranteed to be sortable, but is mainly meant for identifying the
revision and user display.
If no revision identifier could be found, this is left empty.
REV_NR
the revision number of the svn revision this checkout is based on.
This can be used to determine which functionality is present in this
checkout. For trunk svn checkouts and hg/git branches based upon it,
this number should be accurate. For svn branch checkouts, this
number is mostly meaningless, at least when comparing with the
REV_NR from other branches or trunk.
This number should be sortable. Within a given branch or trunk, a
higher number means a newer version. However, when using git or hg,
this number will not increase on new commits.
If no revision number could be found, this is left empty.
ISODATE
the commit date of the revision this checkout is based on.
The commit date may differ from the author date.
This can be used to decide upon the age of the source.
If no timestamp could be found, this is left empty.
MODIFIED
Whether (the src directory of) this checkout is modified or not. A
value of 0 means not modified, a value of 2 means it was modified.
Modification is determined in relation to the commit identified by
REV, so not in relation to the svn revision identified by REV_NR.
A value of 1 means that the modified status is unknown, because this
is not an svn/git/hg checkout for example.
is not an git checkout for example.
CLEAN_REV
the same as REV but without branch name
HASH
the git revision hash
By setting the AWK environment variable, a caller can determine which
version of "awk" is used. If nothing is set, this script defaults to
@ -78,74 +67,37 @@ if [ -d "$ROOT_DIR/.git" ]; then
MODIFIED="2"
fi
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
REV="g`echo $HASH | cut -c1-8`"
BRANCH="`git symbolic-ref -q HEAD 2>/dev/null | sed 's@.*/@@;s@^master$@@'`"
REV_NR=`LC_ALL=C git log --pretty=format:%s --grep="^(svn r[0-9]*)" -1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
if [ -z "$REV_NR" ]; then
# No rev? Maybe it is a custom git-svn clone
REV_NR=`LC_ALL=C git log --pretty=format:%b --grep="git-svn-id:.*@[0-9]*" -1 | sed "s@.*\@\([0-9]*\).*@\1@"`
fi
SHORTHASH=`echo ${HASH} | cut -c1-8`
ISODATE=`LC_ALL=C git show -s --pretty='format:%ci' HEAD | "$AWK" '{ gsub("-", "", $1); print $1 }'`
BRANCH="`git symbolic-ref -q HEAD 2>/dev/null | sed 's@.*/@@'`"
TAG="`git describe --tags 2>/dev/null`"
if [ -n "$TAG" ]; then
BRANCH=""
REV="$TAG"
VERSION="${TAG}"
elif [ "${BRANCH}" = "master" ]; then
VERSION="${ISODATE}-g${SHORTHASH}"
else
VERSION="${ISODATE}-${BRANCH}-g${SHORTHASH}"
fi
elif [ -f "$ROOT_DIR/.ottdrev-vc" ]; then
VERSION_DATA="`cat "$ROOT_DIR/.ottdrev-vc" | sed -n -e '1 p;'`"
HASH_DATA="`cat "$ROOT_DIR/.ottdrev-vc" | sed -n -e '2 p;'`"
REV="`echo "$VERSION_DATA" | cut -f 1 -d' '`"
REV_NR="`echo "$VERSION_DATA" | cut -f 2 -d' '`"
VERSION="`echo "$VERSION_DATA" | cut -f 1 -d' '`"
ISODATE="`echo "$VERSION_DATA" | cut -f 2 -d' '`"
MODIFIED="`echo "$VERSION_DATA" | cut -f 3 -d' '`"
CLEAN_REV="`echo "$VERSION_DATA" | cut -f 4 -d' '`"
HASH="`echo "$VERSION_DATA" | cut -f 4 -d' '`"
if [ "$MODIFIED" = "2" ]; then
CLEAN_REV="`echo "$CLEAN_REV" | sed -e 's/M$//'`"
VERSION="`echo "$VERSION" | sed -e 's/M$//'`"
fi
BRANCH="`echo "$REV" | sed -n -e "s|^${CLEAN_REV}M\?-\(.\+\)$|\1|p"`"
REV="$CLEAN_REV"
if ! $ROOT_DIR/version_utils.sh -o; then
MODIFIED="1"
else
CURRENT_HASH="`$ROOT_DIR/version_utils.sh -s`"
if [ "$CURRENT_HASH" != "$HASH_DATA" ]; then
MODIFIED="2"
if [ -n "$BRANCH" ]; then
BRANCH="$BRANCH-"
fi
BRANCH="${BRANCH}H`echo "$CURRENT_HASH" | cut -c 1-8`"
VERSION="${VERSION}-H`echo "$CURRENT_HASH" | cut -c 1-8`"
fi
fi
elif [ -d "$ROOT_DIR/.svn" ] || [ -d "$ROOT_DIR/../.svn" ]; then
# We are an svn checkout
if [ -n "`svnversion | grep 'M'`" ]; then
MODIFIED="2"
fi
# Find the revision like: rXXXXM-branch
BRANCH=`LC_ALL=C svn info | "$AWK" '/^URL:.*branches/ { split($2, a, "/"); for(i in a) if (a[i]=="branches") { print a[i+1]; break } }'`
TAG=`LC_ALL=C svn info | "$AWK" '/^URL:.*tags/ { split($2, a, "/"); for(i in a) if (a[i]=="tags") { print a[i+1]; break } }'`
REV_NR=`LC_ALL=C svn info | "$AWK" '/^Last Changed Rev:/ { print $4 }'`
if [ -n "$TAG" ]; then
REV=$TAG
else
REV="r$REV_NR"
fi
elif [ -d "$ROOT_DIR/.hg" ]; then
# We are a hg checkout
if [ -n "`HGPLAIN= hg status | grep -v '^?'`" ]; then
MODIFIED="2"
fi
HASH=`LC_ALL=C HGPLAIN= hg id -i | cut -c1-12`
REV="h`echo $HASH | cut -c1-8`"
BRANCH="`HGPLAIN= hg branch | sed 's@^default$@@'`"
TAG="`HGPLAIN= hg id -t | grep -v 'tip$'`"
if [ -n "$TAG" ]; then
BRANCH=""
REV="$TAG"
fi
REV_NR=`LC_ALL=C HGPLAIN= hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
if [ -z "$REV_NR" ]; then
# No rev? Maybe it is a custom hgsubversion clone
REV_NR=`LC_ALL=C HGPLAIN= hg parent --template="{svnrev}"`
fi
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev
@ -153,19 +105,16 @@ elif [ -f "$ROOT_DIR/.ottdrev" ]; then
else
# We don't know
MODIFIED="1"
HASH=""
SHORTHASH=""
BRANCH=""
REV=""
REV_NR=""
ISODATE=""
TAG=""
VERSION=""
fi
if [ "$MODIFIED" -eq "2" ]; then
REV="${REV}M"
fi
CLEAN_REV=${REV}
if [ -n "$BRANCH" ]; then
REV="${REV}-$BRANCH"
VERSION="${VERSION}M"
fi
echo "$REV $REV_NR $MODIFIED $CLEAN_REV"
echo "$VERSION $ISODATE $MODIFIED $HASH"

@ -453,3 +453,12 @@ Some houses and industries are not affected by transparency [FS#5817]:
This is a bug of the original graphics, and unfortunately cannot be
fixed with OpenGFX for the sake of maintaining compatibility with the
original graphics.
Involuntary cargo exchange with cargodist via neutral station [FS#6114]:
When two players serve a neutral station at an industry, a cross-company
chain for cargo flow can and will be established which can only be
interrupted if one of the players stops competing for the ressources of
that industry. There is an easy fix for this: If you are loading at the
shared station make the order "no unload" and if you're unloading make
it "no load". Cargodist will then figure out that it should not create
such a route.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.8.0
set OPENTTD_VERSION=1.9.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.8.beta1
Version: 1.9.beta1
Release: 0
%define srcver 1.8.0-beta1
%define srcver 1.9.0-beta1
Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe
License: GPL-2.0
Group: Amusements/Games/Strategy/Other

@ -1,6 +1,6 @@
# Version numbers to update
!define APPV_MAJOR 1
!define APPV_MINOR 8
!define APPV_MINOR 9
!define APPV_MAINT 0
!define APPV_BUILD 0
!define APPV_EXTRA "-beta1"
@ -89,7 +89,7 @@ Page custom SelectCDEnter SelectCDExit ": TTD folder"
!define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for more information"
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.md"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack
@ -139,7 +139,7 @@ Section "!OpenTTD" Section1
; Copy the scripts
SetOutPath "$INSTDIR\scripts\"
File ${PATH_ROOT}bin\scripts\*.*
Push "$INSTDIR\scripts\readme.txt"
Push "$INSTDIR\scripts\README.md"
Call unix2dos
; Copy some documention files
@ -158,8 +158,8 @@ Section "!OpenTTD" Section1
File ${PATH_ROOT}COPYING
Push "$INSTDIR\COPYING"
Call unix2dos
File ${PATH_ROOT}readme.txt
Push "$INSTDIR\readme.txt"
File ${PATH_ROOT}README.md
Push "$INSTDIR\README.md"
Call unix2dos
File ${PATH_ROOT}known-bugs.txt
Push "$INSTDIR\known-bugs.txt"
@ -213,13 +213,13 @@ Section "!OpenTTD" Section1
CreateDirectory "$SMPROGRAMS\$SHORTCUTS"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\README.md"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt"
CreateDirectory "$SMPROGRAMS\$SHORTCUTS\Docs"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Docs\Multiplayer.lnk" "$INSTDIR\docs\multiplayer.txt"
CreateDirectory "$SMPROGRAMS\$SHORTCUTS\Scripts"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Scripts\Readme.lnk" "$INSTDIR\scripts\readme.txt"
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Scripts\Readme.lnk" "$INSTDIR\scripts\README.md"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
@ -387,7 +387,7 @@ Section "Uninstall"
; Clean up OpenTTD dir
Delete "$INSTDIR\changelog.txt"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\README.md"
Delete "$INSTDIR\known-bugs.txt"
Delete "$INSTDIR\openttd.exe"
Delete "$INSTDIR\COPYING"

@ -1,5 +1,5 @@
!define APPBITS 32 ; Define number of bits for the architecture
!define EXTRA_VERSION "95, 98, ME, 2000 and XP without SP3"
!define APPARCH "win9x" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}bin"
!define BINARY_DIR "${PATH_ROOT}objs\release"
InstallDir "$PROGRAMFILES32\OpenTTD\"

@ -21,313 +21,133 @@ Sub FindReplaceInFile(filename, to_find, replacement)
file.Close
End Sub
Sub UpdateFile(modified, revision, version, cur_date, filename)
Sub UpdateFile(modified, isodate, version, cur_date, filename)
FSO.CopyFile filename & ".in", filename
FindReplaceInFile filename, "!!MODIFIED!!", modified
FindReplaceInFile filename, "!!REVISION!!", revision
FindReplaceInFile filename, "!!ISODATE!!", isodate
FindReplaceInFile filename, "!!VERSION!!", version
FindReplaceInFile filename, "!!DATE!!", cur_date
FindReplaceInFile filename, "!!CONFIGURE_INVOCATION!!", ""
End Sub
Sub UpdateFiles(version)
Dim modified, revision, cur_date
Dim modified, isodate, cur_date
cur_date = DatePart("D", Date) & "." & DatePart("M", Date) & "." & DatePart("YYYY", Date)
If InStr(version, Chr(9)) Then
revision = Mid(version, InStr(version, Chr(9)) + 1)
modified = Mid(revision, InStr(revision, Chr(9)) + 1)
revision = Mid(revision, 1, InStr(revision, Chr(9)) - 1)
isodate = Mid(version, InStr(version, Chr(9)) + 1)
modified = Mid(isodate, InStr(isodate, Chr(9)) + 1)
isodate = Mid(isodate, 1, InStr(isodate, Chr(9)) - 1)
modified = Mid(modified, 1, InStr(modified, Chr(9)) - 1)
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
Else
revision = 0
isodate = 0
modified = 1
End If
UpdateFile modified, revision, version, cur_date, "../src/rev.cpp"
UpdateFile modified, revision, version, cur_date, "../src/os/windows/ottdres.rc"
UpdateFile modified, isodate, version, cur_date, "../src/rev.cpp"
UpdateFile modified, isodate, version, cur_date, "../src/os/windows/ottdres.rc"
End Sub
Function ReadRegistryKey(shive, subkey, valuename, architecture)
Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
' First, get the Registry Provider for the requested architecture
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objReg = objServices.Get("StdRegProv")
' Check the hive and give it the right value
Select Case shive
Case "HKCR", "HKEY_CLASSES_ROOT"
hiveKey = &h80000000
Case "HKCU", "HKEY_CURRENT_USER"
hiveKey = &H80000001
Case "HKLM", "HKEY_LOCAL_MACHINE"
hiveKey = &h80000002
Case "HKU", "HKEY_USERS"
hiveKey = &h80000003
Case "HKCC", "HKEY_CURRENT_CONFIG"
hiveKey = &h80000005
Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
hiveKey = &h80000006
Case Else
MsgBox "Hive not valid (ReadRegistryKey)"
End Select
Set Inparams = objReg.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = hiveKey
Inparams.Ssubkeyname = subkey
Inparams.Svaluename = valuename
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
ReadRegistryKey = Outparams.SValue
End Function
Function DetermineSVNVersion()
Dim WshShell, version, branch, modified, revision, clean_rev, url, oExec, line, hash
Function DetermineVersion()
Dim WshShell, branch, tag, modified, isodate, oExec, line, hash, shorthash
Set WshShell = CreateObject("WScript.Shell")
On Error Resume Next
revision = 0
' Try TortoiseSVN
' Get the directory where TortoiseSVN (should) reside(s)
Dim sTortoise
' First, try with 32-bit architecture
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 32)
If sTortoise = "" Or IsNull(sTortoise) Then
' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 64)
End If
' If TortoiseSVN is installed, try to get the revision number
If sTortoise <> "" Then
Dim SubWCRev
Set SubWCRev = WScript.CreateObject("SubWCRev.object")
SubWCRev.GetWCInfo FSO.GetAbsolutePathName("../"), 0, 0
revision = SubWCRev.Revision
version = "r" & revision
modified = 0
if SubWCRev.HasModifications then modified = 2
url = SubWCRev.Url
End If
' Looks like there is no TortoiseSVN installed either. Then we don't know it.
If revision = 0 Then
' Reset error and version
Err.Clear
version = "norev000"
modified = 0
' Set the environment to english
WshShell.Environment("PROCESS")("LANG") = "en"
' Do we have subversion installed? Check immediatelly whether we've got a modified WC.
Set oExec = WshShell.Exec("svnversion ../")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
modified = 1
hash = ""
shorthash = ""
branch = ""
isodate = ""
tag = ""
' Set the environment to english
WshShell.Environment("PROCESS")("LANG") = "en"
Set oExec = WshShell.Exec("git rev-parse --verify HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 0 Then
hash = oExec.StdOut.ReadLine()
shorthash = Mid(hash, 1, 8)
' Make sure index is in sync with disk
Set oExec = WshShell.Exec("git update-index --refresh")
If Err.Number = 0 Then
' StdOut and StdErr share a 4kB buffer so prevent it from filling up as we don't care about the output
oExec.StdOut.Close
oExec.StdErr.Close
' Wait till the application is finished ...
Do While oExec.Status = 0
WScript.Sleep 10
Loop
End If
Set oExec = WshShell.Exec("git diff-index --exit-code --quiet HEAD ../")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
line = OExec.StdOut.ReadLine()
If line <> "exported" Then
If InStr(line, "M") Then
If oExec.ExitCode = 1 Then
modified = 2
End If
End If ' oExec.ExitCode = 1
' And use svn info to get the correct revision and branch information.
Set oExec = WshShell.Exec("svn info ../")
If Err.Number = 0 Then
Do
line = OExec.StdOut.ReadLine()
If InStr(line, "URL") Then
url = line
End If
If InStr(line, "Last Changed Rev") Then
revision = Mid(line, 19)
version = "r" & revision
End If
Loop While Not OExec.StdOut.atEndOfStream
Set oExec = WshShell.Exec("git show -s --pretty=format:%ci")
if Err.Number = 0 Then
isodate = Mid(oExec.StdOut.ReadLine(), 1, 10)
isodate = Replace(isodate, "-", "")
End If ' Err.Number = 0
End If ' line <> "exported"
End If ' Err.Number = 0
End If ' InStr(version, "$")
If version <> "norev000" Then
If InStr(url, "branches") Then
branch = Mid(url, InStr(url, "branches/") + 9)
End If
If InStr(url, "tags") Then
version = Mid(url, InStr(url, "tags/") + 5)
End If
Else ' version <> "norev000"
' svn detection failed, reset error and try git
Err.Clear
Set oExec = WshShell.Exec("git rev-parse --verify HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 0 Then
hash = oExec.StdOut.ReadLine()
version = "g" & Mid(hash, 1, 8)
' Make sure index is in sync with disk
Set oExec = WshShell.Exec("git update-index --refresh")
' Check branch
Err.Clear
Set oExec = WshShell.Exec("git symbolic-ref HEAD")
If Err.Number = 0 Then
' StdOut and StdErr share a 4kB buffer so prevent it from filling up as we don't care about the output
oExec.StdOut.Close
oExec.StdErr.Close
' Wait till the application is finished ...
Do While oExec.Status = 0
WScript.Sleep 10
Loop
End If
Set oExec = WshShell.Exec("git diff-index --exit-code --quiet HEAD ../")
line = oExec.StdOut.ReadLine()
branch = Mid(line, InStrRev(line, "/") + 1)
End If ' Err.Number = 0
' Check if a tag is currently checked out
Err.Clear
Set oExec = WshShell.Exec("git name-rev --name-only --tags --no-undefined HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 1 Then
modified = 2
End If ' oExec.ExitCode = 1
Set oExec = WshShell.Exec("git symbolic-ref HEAD")
If Err.Number = 0 Then
line = oExec.StdOut.ReadLine()
line = Mid(line, InStrRev(line, "/") + 1)
If line <> "master" Then
branch = line
End If ' line <> "master"
End If ' Err.Number = 0
Set oExec = WshShell.Exec("git log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1")
if Err.Number = 0 Then
revision = Mid(oExec.StdOut.ReadLine(), 7)
revision = Mid(revision, 1, InStr(revision, ")") - 1)
End If ' Err.Number = 0
If revision = "" Then
' No revision? Maybe it is a custom git-svn clone
' Reset error number as WshShell.Exec will not do that on success
Err.Clear
Set oExec = WshShell.Exec("git log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1")
If Err.Number = 0 Then
revision = oExec.StdOut.ReadLine()
revision = Mid(revision, InStr(revision, "@") + 1)
revision = Mid(revision, 1, InStr(revision, " ") - 1)
End If ' Err.Number = 0
End If ' revision = ""
' Check if a tag is currently checked out
Err.Clear
Set oExec = WshShell.Exec("git name-rev --name-only --tags --no-undefined HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 0 Then
version = oExec.StdOut.ReadLine()
If Right(version, 2) = "^0" Then
version = Left(version, Len(version) - 2)
End If
branch = ""
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0
If oExec.ExitCode = 0 Then
tag = oExec.StdOut.ReadLine()
If Right(tag, 2) = "^0" Then
tag = Left(tag, Len(tag) - 2)
End If
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0
If version = "norev000" Then
' git detection failed, reset error and try mercurial (hg)
Err.Clear
Set oExec = WshShell.Exec("hg id -i")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 0 Then
line = OExec.StdOut.ReadLine()
hash = Left(line, 12)
version = "h" & Mid(hash, 1, 8)
' Check if a tag is currently checked out
Err.Clear
Set oExec = WshShell.Exec("hg id -t")
If Err.Number = 0 Then
line = oExec.StdOut.ReadLine()
If Len(line) > 0 And Right(line, 3) <> "tip" Then
version = line
branch = ""
End If ' Len(line) > 0 And Right(line, 3) <> "tip"
End If ' Err.Number = 0
Err.Clear
Set oExec = WshShell.Exec("hg status ../")
If Err.Number = 0 Then
Do
line = OExec.StdOut.ReadLine()
If Len(line) > 0 And Mid(line, 1, 1) <> "?" Then
modified = 2
Exit Do
End If ' Len(line) > 0 And Mid(line, 1, 1) <> "?"
Loop While Not OExec.StdOut.atEndOfStream
Set oExec = WshShell.Exec("hg branch")
If Err.Number = 0 Then
line = OExec.StdOut.ReadLine()
If line <> "default" Then
branch = line
End If ' line <> "default"
End If ' Err.Number = 0
Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc|firstline}\n" & Chr(34) & " --cwd ../")
If Err.Number = 0 Then
line = oExec.StdOut.ReadLine()
If Left(line, 6) = "(svn r" Then
revision = Mid(line, 7)
revision = Mid(revision, 1, InStr(revision, ")") - 1)
End If 'Left(line, 6) = "(svn r"
End If ' Err.Number = 0
If revision = "" Then
' No rev? Maybe it is a custom hgsubversion clone
Err.Clear
Set oExec = WshShell.Exec("hg parent --template=" & Chr(34) & "{svnrev}" & Chr(34))
If Err.Number = 0 Then
revision = oExec.StdOut.ReadLine()
End If ' Err.Number = 0
End If ' revision = ""
End If ' Err.Number = 0
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0
End If ' version = "norev000"
End If ' version <> "norev000"
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0
If version = "norev000" And FSO.FileExists("../.ottdrev") Then
If hash = "" And FSO.FileExists("../.ottdrev") Then
Dim rev_file
Set rev_file = FSO.OpenTextFile("../.ottdrev", 1, True, 0)
DetermineSVNVersion = rev_file.ReadLine()
DetermineVersion = rev_file.ReadLine()
rev_file.Close()
ElseIf hash = "" Then
DetermineVersion = "norev000"
Else
If modified = 2 Then
version = version & "M"
Dim version
If tag <> "" Then
version = tag
ElseIf branch = "master" Then
version = isodate & "-g" & shorthash
Else
version = isodate & "-" & branch & "-g" & shorthash
End If
clean_rev = version
If branch <> "" Then
version = version & "-" & branch
If modified = 2 Then
version = version & "M"
End If
If version <> "norev000" Then
DetermineSVNVersion = version & Chr(9) & revision & Chr(9) & modified & Chr(9) & clean_rev
Else
DetermineSVNVersion = version
End If
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash
End If
End Function
@ -360,7 +180,7 @@ Function CheckFile(filename)
End Function
Dim version
version = DetermineSVNVersion
version = DetermineVersion
If Not (IsCachedVersion(version) And CheckFile("../src/rev.cpp") And CheckFile("../src/os/windows/ottdres.rc")) Then
UpdateFiles version
End If

@ -146,8 +146,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -192,8 +195,11 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -251,8 +257,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -299,8 +308,11 @@
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\tbtr_template_gui_main.cpp" />
@ -1063,6 +1075,8 @@
<ClInclude Include="..\src\script\api\script_cargo.hpp" />
<ClInclude Include="..\src\script\api\script_cargolist.hpp" />
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp" />
<ClInclude Include="..\src\script\api\script_client.hpp" />
<ClInclude Include="..\src\script\api\script_clientlist.hpp" />
<ClInclude Include="..\src\script\api\script_company.hpp" />
<ClInclude Include="..\src\script\api\script_companymode.hpp" />
<ClInclude Include="..\src\script\api\script_controller.hpp" />
@ -1128,6 +1142,8 @@
<ClCompile Include="..\src\script\api\script_cargo.cpp" />
<ClCompile Include="..\src\script\api\script_cargolist.cpp" />
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp" />
<ClCompile Include="..\src\script\api\script_client.cpp" />
<ClCompile Include="..\src\script\api\script_clientlist.cpp" />
<ClCompile Include="..\src\script\api\script_company.cpp" />
<ClCompile Include="..\src\script\api\script_companymode.cpp" />
<ClCompile Include="..\src\script\api\script_controller.cpp" />
@ -1354,7 +1370,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs100.vcxproj">

@ -2385,6 +2385,12 @@
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_client.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_clientlist.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_company.hpp">
<Filter>Script API</Filter>
</ClInclude>
@ -2580,6 +2586,12 @@
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_client.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_clientlist.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_company.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
@ -3252,6 +3264,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -8,6 +8,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -146,8 +146,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -192,8 +195,11 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -251,8 +257,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -299,15 +308,18 @@
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>dpi_aware.manifest</AdditionalManifestFiles>
<AdditionalManifestFiles>dpi_aware.manifest;os_versions.manifest</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
!!FILES!!
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs100.vcxproj">

@ -152,8 +152,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -202,8 +206,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -264,8 +272,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -316,8 +328,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\tbtr_template_gui_main.cpp" />
@ -1080,6 +1096,8 @@
<ClInclude Include="..\src\script\api\script_cargo.hpp" />
<ClInclude Include="..\src\script\api\script_cargolist.hpp" />
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp" />
<ClInclude Include="..\src\script\api\script_client.hpp" />
<ClInclude Include="..\src\script\api\script_clientlist.hpp" />
<ClInclude Include="..\src\script\api\script_company.hpp" />
<ClInclude Include="..\src\script\api\script_companymode.hpp" />
<ClInclude Include="..\src\script\api\script_controller.hpp" />
@ -1145,6 +1163,8 @@
<ClCompile Include="..\src\script\api\script_cargo.cpp" />
<ClCompile Include="..\src\script\api\script_cargolist.cpp" />
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp" />
<ClCompile Include="..\src\script\api\script_client.cpp" />
<ClCompile Include="..\src\script\api\script_clientlist.cpp" />
<ClCompile Include="..\src\script\api\script_company.cpp" />
<ClCompile Include="..\src\script\api\script_companymode.cpp" />
<ClCompile Include="..\src\script\api\script_controller.cpp" />
@ -1371,7 +1391,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs140.vcxproj">

@ -2385,6 +2385,12 @@
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_client.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_clientlist.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_company.hpp">
<Filter>Script API</Filter>
</ClInclude>
@ -2580,6 +2586,12 @@
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_client.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_clientlist.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_company.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
@ -3252,6 +3264,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -8,6 +8,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -152,8 +152,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -202,8 +206,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -264,8 +272,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -316,15 +328,19 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
!!FILES!!
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs140.vcxproj">

@ -152,8 +152,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -202,8 +206,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -264,8 +272,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -316,8 +328,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\tbtr_template_gui_main.cpp" />
@ -1080,6 +1096,8 @@
<ClInclude Include="..\src\script\api\script_cargo.hpp" />
<ClInclude Include="..\src\script\api\script_cargolist.hpp" />
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp" />
<ClInclude Include="..\src\script\api\script_client.hpp" />
<ClInclude Include="..\src\script\api\script_clientlist.hpp" />
<ClInclude Include="..\src\script\api\script_company.hpp" />
<ClInclude Include="..\src\script\api\script_companymode.hpp" />
<ClInclude Include="..\src\script\api\script_controller.hpp" />
@ -1145,6 +1163,8 @@
<ClCompile Include="..\src\script\api\script_cargo.cpp" />
<ClCompile Include="..\src\script\api\script_cargolist.cpp" />
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp" />
<ClCompile Include="..\src\script\api\script_client.cpp" />
<ClCompile Include="..\src\script\api\script_clientlist.cpp" />
<ClCompile Include="..\src\script\api\script_company.cpp" />
<ClCompile Include="..\src\script\api\script_companymode.cpp" />
<ClCompile Include="..\src\script\api\script_controller.cpp" />
@ -1371,7 +1391,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs141.vcxproj">

@ -2385,6 +2385,12 @@
<ClInclude Include="..\src\script\api\script_cargomonitor.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_client.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_clientlist.hpp">
<Filter>Script API</Filter>
</ClInclude>
<ClInclude Include="..\src\script\api\script_company.hpp">
<Filter>Script API</Filter>
</ClInclude>
@ -2580,6 +2586,12 @@
<ClCompile Include="..\src\script\api\script_cargomonitor.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_client.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_clientlist.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
<ClCompile Include="..\src\script\api\script_company.cpp">
<Filter>Script API Implementation</Filter>
</ClCompile>
@ -3252,6 +3264,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -8,6 +8,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
</Project>

@ -152,8 +152,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@ -202,8 +206,12 @@
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
@ -264,8 +272,12 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
@ -316,15 +328,19 @@
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
<Manifest>
<AdditionalManifestFiles>os_versions.manifest</AdditionalManifestFiles>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
<PostBuildEvent>
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
!!FILES!!
</ItemGroup>
<ItemGroup>
<None Include="..\media\openttd.ico" />
<None Include="..\readme.txt" />
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="langs_vs141.vcxproj">

@ -122,6 +122,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -217,6 +219,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -327,6 +331,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -425,6 +431,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
</Configurations>
@ -3538,6 +3546,14 @@
RelativePath=".\..\src\script\api\script_cargomonitor.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_client.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_clientlist.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_company.hpp"
>
@ -3802,6 +3818,14 @@
RelativePath=".\..\src\script\api\script_cargomonitor.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_client.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_clientlist.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_company.cpp"
>
@ -4764,7 +4788,7 @@
>
</File>
<File
RelativePath=".\..\readme.txt"
RelativePath=".\..\README.md"
>
</File>
</Files>

@ -122,6 +122,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -217,6 +219,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -327,6 +331,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -425,6 +431,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
</Configurations>
@ -437,7 +445,7 @@
>
</File>
<File
RelativePath=".\..\readme.txt"
RelativePath=".\..\README.md"
>
</File>
</Files>

@ -121,6 +121,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -215,6 +217,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -324,6 +328,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -422,6 +428,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
</Configurations>
@ -3535,6 +3543,14 @@
RelativePath=".\..\src\script\api\script_cargomonitor.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_client.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_clientlist.hpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_company.hpp"
>
@ -3799,6 +3815,14 @@
RelativePath=".\..\src\script\api\script_cargomonitor.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_client.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_clientlist.cpp"
>
</File>
<File
RelativePath=".\..\src\script\api\script_company.cpp"
>
@ -4761,7 +4785,7 @@
>
</File>
<File
RelativePath=".\..\readme.txt"
RelativePath=".\..\README.md"
>
</File>
</Files>

@ -121,6 +121,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -215,6 +217,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -324,6 +328,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
<Configuration
@ -422,6 +428,8 @@
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine="copy &quot;$(OutDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)..\bin\$(TargetName)$(TargetExt)&quot;"
/>
</Configuration>
</Configurations>
@ -434,7 +442,7 @@
>
</File>
<File
RelativePath=".\..\readme.txt"
RelativePath=".\..\README.md"
>
</File>
</Files>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" >
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows Vista functionality -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--This Id value indicates the application supports Windows 7 functionality-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--This Id value indicates the application supports Windows 8 functionality-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--This Id value indicates the application supports Windows 8.1 functionality-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!--This Id value indicates the application supports Windows 10 functionality-->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>

@ -1,735 +0,0 @@
Last updated: 2016-07-01
Release version: 1.6.1
------------------------------------------------------------------------
Table of contents
-----------------
1.0) About
2.0) Contacting
* 2.1) Reporting bugs
* 2.2) Reporting desyncs
3.0) Supported platforms
4.0) Installing and running OpenTTD
* 4.1) (Required) 3rd party files
* 4.2) OpenTTD directories
* 4.3) Portable installations (portable media)
* 4.4) Files in tar (archives)
5.0) OpenTTD features
* 5.1) Logging of potentially dangerous actions
6.0) Configuration file
7.0) Compiling
* 7.1) Required/optional libraries
* 7.2) Supported compilers
* 7.3) Compilation of base sets
8.0) Translating
* 8.1) Translation
* 8.2) Previewing
9.0) Troubleshooting
10.0) Licensing
X.X) Credits
1.0) About
---- -----
OpenTTD is a transport simulation game based upon the popular game Transport
Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original
game as closely as possible while extending it with new features.
OpenTTD is licensed under the GNU General Public License version 2.0,
but includes some 3rd party software under different licenses. See the
section "Licensing" below for details.
2.0) Contacting
---- ----------
The easiest way to contact the OpenTTD team is by submitting bug reports or
posting comments in our forums. You can also chat with us on IRC (#openttd
on irc.oftc.net).
The OpenTTD homepage is http://www.openttd.org/.
You can also find the OpenTTD forums at
http://forum.openttd.org/
2.1) Reporting bugs
---- --------------
First of all, check whether the bug is not already known. Do this by looking
through the file called 'known-bugs.txt' which is distributed with OpenTTD
like this readme.
For tracking our bugs we are using a bug tracker called Flyspray. You can find
the tracker at http://bugs.openttd.org/. Before actually reporting take a look
through the already reported bugs there to see if the bug is already known.
The 'known-bugs.txt' file might be a bit outdated at the moment you are
reading it as only bugs known before the release are documented there. Also
look through the recently closed bugs.
When you are sure it is not already reported you should:
* Make sure you are running a recent version, i.e. run the latest stable or
nightly based on where you found the bug.
* Make sure you are not running a non-official binary, like a patch pack.
When you are playing with a patch pack you should report any bugs to the
forum thread related to that patch pack.
* Make it reproducible for the developers. In other words, create a savegame
in which you can reproduce the issue once loaded. It is very useful to give
us the crash.dmp, crash.sav, crash.log and crash screenshot which are
created on crashes.
* Check whether the bug is already reported on our bug tracker. This includes
searching for recently closed bug reports as the bug might already be fixed.
After you have done all that you can report the bug. Please include the
following information in your bug report:
* OpenTTD version (PLEASE test the latest SVN/nightly build)
* Bug details, including instructions how to reproduce it
* Platform (Windows, Linux, FreeBSD, ...) and compiler (including version) if
you compiled OpenTTD yourself.
* The processor architecture of your OS (32 bits Windows, 64 bits Windows,
Linux on an ARM, Mac OS X on a PowerPC, ...)
* Attach a saved game *and* a screenshot if possible
* If this bug only occurred recently please note the last version without
the bug and the first version including the bug. That way we can fix it
quicker by looking at the changes made.
* Attach crash.dmp, crash.log and crash.sav. These files are usually created
next to your openttd.cfg. The crash handler will tell you the location.
2.2) Reporting desyncs
---- -----------------
As desyncs are hard to make reproducible OpenTTD has the ability to log all
actions done by clients so we can replay the whole game in an effort to make
desyncs better reproducible. You need to turn this ability on. When turned
on an automatic savegame will be made once the map has been constructed in
the 'save/autosave' directory, see OpenTTD directories to know where to find
this directory. Furthermore the log file 'commands-out.log' will be created
and all actions will be written to there.
To enable the desync debugging you need to set the debug level for 'desync'
to at least 1. You do this by starting OpenTTD with '-d desync=<level>' as
parameter or by typing 'debug_level desync=<level>' in OpenTTD's internal
console.
The desync debug levels are:
0: nothing.
1: dumping of commands to 'commands-out.log'.
2: same as 1 plus checking vehicle caches and dumping that too.
3: same as 2 plus monthly saves in autosave.
4 and higher: same as 3
Restarting OpenTTD will overwrite 'commands-out.log'. OpenTTD will not remove
the savegames (dmp_cmds_*.sav) made by the desync debugging system, so you
have to occasionally remove them yourself!
The naming format of the desync savegames is as follows:
dmp_cmds_XXXXXXXX_YYYYYYYY.sav. The XXXXXXXX is the hexadecimal representation
of the generation seed of the game and YYYYYYYY is the hexadecimal
representation of the date of the game. This sorts the savegames by game and
then by date making it easier to find the right savegames.
When a desync has occurred with the desync debugging turned on you should file
a bug report with the following files attached:
- commands-out.log as it contains all the commands that were done
- the last saved savegame (search for the last line beginning with
'save: dmp_cmds_' in commands-out.log). We use this savegame to check
whether we can quickly reproduce the desync. Otherwise we will need...
- the first saved savegame (search for the first line beginning with 'save'
where the first part, up to the last underscore '_', is the same). We need
this savegame to be able to reproduce the bug when the last savegame is not
old enough. If you loaded a scenario or savegame you need to attach that.
- optionally you can attach the savegames from around 50%, 75%, 85%, 90% and
95% of the game's progression. We can use these savegames to speed up the
reproduction of the desync, but we should be able to reproduce these
savegames based on the first savegame and commands-out.log.
- in case you use any NewGRFs you should attach the ones you used unless
we can easily find them ourselves via bananas or when they are in the
#openttdcoop pack.
Do NOT remove the dmp_cmds savegames of a desync you have reported until the
desync has been fixed; if you, by accident, send us the wrong savegames we
will not be able to reproduce the desync and thus will be unable to fix it.
3.0) Supported platforms
---- -------------------
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
Linux - SDL or Allegro
MacOS X (universal) - Cocoa video and sound drivers
MorphOS - SDL
OpenBSD - SDL
OS/2 - SDL
Windows - Win32 GDI (faster) or SDL or Allegro
4.0) Installing and running OpenTTD
---- ------------------------------
Installing OpenTTD is fairly straightforward. Either you have downloaded an
archive which you have to extract to a directory where you want OpenTTD to
be installed, or you have downloaded an installer, which will automatically
extract OpenTTD in the given directory.
OpenTTD looks in multiple locations to find the required data files (described
in section 4.2). Installing any 3rd party files into a 'shared' location has
the advantage that you only need to do this step once, rather than copying the
data files into all OpenTTD versions you have.
Savegames, screenshots, etc are saved relative to the config file (openttd.cfg)
currently being used. This means that if you use a config file in one of the
shared directories, savegames will reside in the save/ directory next to the
openttd.cfg file there.
If you want savegames and screenshots in the directory where the OpenTTD binary
resides, simply have your config file in that location. But if you remove this
config file, savegames will still be in this directory (see notes in
section 4.2 'OpenTTD directories')
OpenTTD comes without AIs, so if you want to play with AIs you have to download
them. The easiest way is via the 'Check Online Content' button in the main menu.
You can select some AIs that you think are compatible with your playing style.
Another way is manually downloading the AIs from the forum although then you
need to make sure that you install all the required AI libraries too; they get
automatically selected (and downloaded) if you get the AIs via the 'Check
Online Content'. If you do not have an AI but have configured OpenTTD to start
an AI a message will be shown that the 'dummy' AI has been started.
4.1) (Required) 3rd party files
---- --------------------------
Before you run OpenTTD, you need to put the game's data files into a baseset/
directory which can be located in various places addressed in the following
section.
For OpenTTD you need to acquire some third party data files. For this you have
the choice of using the original Transport Tycoon Deluxe data files or a set
of free data files.
Do NOT copy files included with OpenTTD into 'shared' directories (explained in
the following sections) as sooner or later you will run into graphical glitches
when using other versions of the game.
4.1.1) Free graphics and sound files
------ -----------------------------
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- http://www.openttd.org/download-opengfx for OpenGFX
- http://www.openttd.org/download-opensfx for OpenSFX
- http://www.openttd.org/download-openmsx for OpenMSX
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
4.1.2) Original Transport Tycoon Deluxe graphics and sound files
------ ---------------------------------------------------------
If you want to play with the original Transport Tycoon Deluxe data files you
have to copy the data files from the CD-ROM into the baseset/ directory. It
does not matter whether you copy them from the DOS or Windows version of
Transport Tycoon Deluxe. The Windows install can optionally copy these files.
You need to copy the following files:
- sample.cat
- trg1r.grf or TRG1.GRF
- trgcr.grf or TRGC.GRF
- trghr.grf or TRGH.GRF
- trgir.grf or TRGI.GRF
- trgtr.grf or TRGT.GRF
4.1.3) Original Transport Tycoon Deluxe music
------ --------------------------------------
If you want the Transport Tycoon Deluxe music, copy the files from the gm/
folder from the Windows version of Transport Tycoon Deluxe to the baseset
folder in your OpenTTD folder (also explained in the following sections).
The music from the DOS version as well as the original Transport Tycoon does
not work.
4.1.4) AIs
------ ---
If you want AIs use the in-game content downloader. If for some reason that is
not possible or you want to use an AI that has not been uploaded to the content
download system download the tar file and place it in the ai/ directory. If the
AI needs libraries you will have to download those too and put them in the
ai/library/ directory. All AIs and AI Libraries that have been uploaded to
the content download system can be found at http://noai.openttd.org/downloads/
The AIs and libraries can be found their in the form of .tar.gz packages.
OpenTTD can read inside tar files but it does not extract .tar.gz files by
itself.
To figure out which libraries you need for an AI you have to start the AI and
wait for an error message to pop up. The error message will tell you
'could not find library "lib-name"'. Download that library and try again.
4.1.5) Game scripts
------ ------------
If you want an extra challenge in OpenTTD you can download so-called game
scripts via the in-game content downloader. These game scripts have varying
functionality, though they can generally influence town growth, subsidies, add
goals to reach or provide a different ranking system.
If you download a game script manually you have to follow the same rules as for
AIs, except that game scripts are placed in the game/ directory instead of the
ai/ directory.
4.2) OpenTTD directories
---- -------------------
OpenTTD uses its own directory to store its required 3rd party base set files
(see section 4.1 'Required 3rd party files') and non-compulsory extension and
configuration files. See below for their proper place within this OpenTTD main
data directory.
The main OpenTTD directories can be found in various locations, depending on
your operating system:
1. The current working directory (from where you started OpenTTD)
For non-Windows operating systems OpenTTD will not scan for files in this
directory if it is your personal directory, i.e. '~/', or when it is the
root directory, i.e. '/'.
2. Your personal directory
Windows: C:\My Documents\OpenTTD (95, 98, ME)
C:\Documents and Settings\<username>\My Documents\OpenTTD (2000, XP)
C:\Users\<username>\Documents\OpenTTD (Vista, 7)
Mac OSX: ~/Documents/OpenTTD
Linux: $XDG_DATA_HOME/openttd which is usually ~/.local/share/openttd when
built with XDG base directory support, otherwise ~/.openttd
3. The shared directory
Windows: C:\Documents and Settings\All Users\Shared Documents\OpenTTD (2000, XP)
C:\Users\Public\Documents\OpenTTD (Vista, 7)
Mac OSX: /Library/Application Support/OpenTTD
Linux: not available
4. The binary directory (where the OpenTTD executable is)
Windows: C:\Program Files\OpenTTD
Linux: /usr/games
5. The installation directory (Linux only)
Linux: /usr/share/games/openttd
6. The application bundle (Mac OSX only)
It includes the OpenTTD files (grf+lng) and it will work as long as they
are not touched
Different types of data or extensions go into different subdirectories of the
chosen main OpenTTD directory:
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.
Notes:
- Linux in the previous list means .deb, but most paths should be similar for
others.
- The previous search order is also used for NewGRFs and openttd.cfg.
- If openttd.cfg is not found, then it will be created using the 2, 4, 1, 3,
5 order. When built with XDG base directory support, openttd.cfg will be
created in $XDG_CONFIG_HOME/openttd which is usually ~/.config/openttd.
- Savegames will be relative to the config file only if there is no save/
directory in paths with higher priority than the config file path, but
autosaves and screenshots will always be relative to the config file.
Unless the configuration file is in $XDG_CONFIG_HOME/openttd, then all
other files will be saved under $XDG_DATA_HOME/openttd.
The preferred setup:
Place 3rd party files in shared directory (or in personal directory if you do
not have write access on shared directory) and have your openttd.cfg config
file in personal directory (where the game will then also place savegames and
screenshots).
4.3) Portable installations (portable media)
---- ---------------------------------------
You can install OpenTTD on external media so you can take it with you, i.e.
using a USB key, or a USB HDD, etc.
Create a directory where you shall store the game in (i.e. OpenTTD/).
Copy the binary (OpenTTD.exe, OpenTTD.app, openttd, etc), baseset/ and your
openttd.cfg to this directory.
You can copy binaries for any operating system into this directory, which will
allow you to play the game on nearly any computer you can attach the external
media to.
As always - additional grf files are stored in the newgrf/ dir (for details,
again, see section 4.1).
4.4) Files in tar (archives)
---- -----------------------
OpenTTD can read files that are in an uncompressed tar (archive), which
makes it easy to bundle files belonging to the same script, NewGRF or base
set. Music sets are the only exception as they cannot be stored in a tar
file due to being played by external applications.
OpenTTD sees each tar archive as the 'root' of its search path. This means that
having a file with the same path in two different tar files means that one
cannot be opened, after all only one file will be found first. As such it is
advisable to put an uniquely named folder in the root of the tar and put all the
content in that folder. For example, all downloaded content has a path that
concatenates the name of the content and the version, which makes the path
unique. For custom tar files it is advised to do this as well.
The normal files are also referred to by their relative path from the search
directory, this means that also normal files could hide files in a tar as
long as the relative path from the search path of the normal file is the
same as the path in the tar file. Again it is advised to have an unique path
to the normal file so they do not collide with the files from other tar
files.
5.0) OpenTTD features
---- ----------------
OpenTTD has a lot of features going beyond the original Transport Tycoon Deluxe
emulation. Unfortunately, there is currently no comprehensive list of features,
but there is a basic features list on the web, and some optional features can be
controlled through the Advanced Settings dialog. We also implement some
features known from TTDPatch (http://www.ttdpatch.net/).
Several important non-standard controls:
* Ctrl modifies many commands and makes them more powerful. For example Ctrl
clicking on signals with the build signal tool changes their behaviour, holding
Ctrl while the track build tool is activated changes it to the track removal
tool, and so on. See http://wiki.openttd.org/Hidden_features for a non-
comprehensive list or look at the tooltips.
* Ingame console. More information at
http://wiki.openttd.org/index.php/Console
* Hovering over a GUI element shows tooltips. This can be changed to right click
via the advanced settings.
5.1) Logging of potentially dangerous actions
---- ----------------------------------------
OpenTTD is a complex program, and together with NewGRF, it may show a buggy
behaviour. But not only bugs in code can cause problems. There are several
ways to affect game state possibly resulting in program crash or multiplayer
desyncs.
Easier way would be to forbid all these unsafe actions, but that would affect
game usability for many players. We certainly do not want that.
However, we receive bug reports because of this. To reduce time spent with
solving these problems, these potentially unsafe actions are logged in
the savegame (including crash.sav). Log is stored in crash logs, too.
Information logged:
* Adding / removing / changing order of NewGRFs
* Changing NewGRF parameters, loading compatible NewGRF
* Changing game mode (scenario editor <-> normal game)
* Loading game saved in a different OpenTTD / TTDPatch / Transport Tycoon Deluxe /
original Transport Tycoon version
* Running a modified OpenTTD build
* Changing settings affecting NewGRF behaviour (non-network-safe settings)
* Triggering NewGRF bugs
No personal information is stored.
You can show the game log by typing 'gamelog' in the console or by running
OpenTTD in debug mode.
6.0) Configuration file
---- ------------------
The configuration file for OpenTTD (openttd.cfg) is in a simple Windows-like
.INI format. It is mostly undocumented. Almost all settings can be changed
ingame by using the 'Advanced Settings' window.
When you cannot find openttd.cfg you should look in the directories as
described in section 4.2. If you do not have an openttd.cfg OpenTTD will
create one after closing.
7.0) Compiling
---- ---------
Windows:
You need Microsoft Visual Studio .NET. Open the project file
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) and ZLIB (WITH_ZLIB) support is enabled by default. For these
to work you need their development files. For best results, download the
openttd-useful.zip file from http://www.openttd.org/download-openttd-useful
Put the header files into your compiler's include/ directory and the
library (.lib) files into the lib/ directory.
For more help with VS see docs/Readme_Windows_MSVC.txt.
You can also build it using the Makefile with MSYS/MinGW or Cygwin/MinGW.
Please read the Makefile for more information.
Solaris, FreeBSD, OpenBSD:
Use 'gmake', but do a './configure' before the first build.
Linux/Unix:
OpenTTD can be built with GNU 'make'. On non-GNU systems it is called 'gmake'.
However, for the first build one has to do a './configure' first.
MacOS X:
Use 'make' or Xcode (which will then call make for you)
This will give you a binary for your CPU type (PPC/Intel)
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:
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:
- libSDL/liballegro: hardware access (video, sound, mouse)
- zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- liblzo2: (de)compressing of old (pre 0.3.0) savegames
- liblzma: (de)compressing of savegames (1.1.0 and later)
- libpng: making screenshots and loading heightmaps
- libfreetype: loading generic fonts and rendering them
- libfontconfig: searching for fonts, resolving font names to actual fonts
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
natural sorting of strings.
OpenTTD does not require any of the libraries to be present, but without
liblzma you cannot open most recent savegames and without zlib you cannot
open most older savegames or use the content downloading system.
Without libSDL/liballegro on non-Windows and non-MacOS X machines you have
no graphical user interface; you would be building a dedicated server.
7.2) Supported compilers
---- -------------------
The following compilers are known to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2005, 2008 and 2010.
Version 2005 gives bogus warnings about scoping issues.
- GNU Compiler Collection (GCC) 3.3 - 4.4, 4.6 - 4.8.
Versions 4.1 and earlier give bogus warnings about uninitialised variables.
Versions 4.4, 4.6 give bogus warnings about freeing non-heap objects.
Versions 4.6 and later give invalid warnings when lto is enabled.
- Intel C++ Compiler (ICC) 12.0.
- Clang/LLVM 2.9 - 3.0
Version 2.9 gives bogus warnings about code nonconformity.
The following compilers are known not to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2003 and earlier.
- GNU Compiler Collection (GCC) 3.2 and earlier.
These old versions fail due to OpenTTD's template usage.
- GNU Compiler Collection (GCC) 4.5. It optimizes enums too aggressively.
See http://bugs.openttd.org/task/5513 and references therein.
- Intel C++ Compiler (ICC) 11.1 and earlier.
Version 10.0 and earlier fail a configure check and fail with recent system
headers.
Version 10.1 fails to compile station_gui.cpp.
Version 11.1 fails with an internal error when compiling network.cpp.
- Clang/LLVM 2.8 and earlier.
- (Open) Watcom.
If any of these compilers can compile OpenTTD again, please let us know.
Patches to support more compilers are welcome.
7.3) Compilation of base sets
-----------------------------
To recompile the extra graphics needed to play with the original Transport
Tycoon Deluxe graphics you need GRFCodec (which includes NFORenum) as well.
GRFCodec can be found at: http://www.openttd.org/download-grfcodec
The compilation of these extra graphics does generally not happen, unless
you remove the graphics file using 'make maintainer-clean'.
Re-compilation of the base sets, thus also use of --maintainer-clean can
leave the repository in a modified state as different grfcodec versions can
cause binary differences in the resulting grf. Also translations might have
been added for the base sets which are not yet included in the base set
information files. Use the configure option --without-grfcodec to avoid
modification of the base set files by the build process.
8.0) Translating
---- -----------
See http://www.openttd.org/development for up-to-date information.
The use of the online Translator service, located at
http://translator.openttd.org/, is highly encouraged. For getting an account
simply follow the guidelines in the FAQ of the translator website.
If for some reason the website is down for a longer period of time, the
information below might be of help.
Please contact the translations manager (http://www.openttd.org/contact)
before beginning the translation process! This avoids double work, as
someone else may have already started translating to the same language.
8.1) Translation
---- -----------
So, now that you have notified the development team about your intention to
translate (You did, right? Of course you did.) you can pick up english.txt
(found in the SVN repository under /src/lang) and translate.
You must change the first two lines of the file appropriately:
##name English-Name-Of-Language
##ownname Native-Name-Of-Language
Note: Do not alter the following parts of the file:
* String identifiers (the first word on each line)
* Parts of the strings which are in curly braces (such as {STRING})
* Lines beginning with ## (such as ##id), other than the first two lines of
the file
8.2) Previewing
---- ----------
In order to view the translation in the game, you need to compile your language
file with the strgen utility. As this utility is tailored to a specific OpenTTD
version, you need to compile it yourself. Just take the normal OpenTTD sources
and build that. During the build process the strgen utility will be made.
strgen is a command-line utility. It takes the language filename as parameter.
Example:
strgen lang/german.txt
This results in compiling german.txt and produces another file named german.lng.
Any missing strings are replaced with the English strings. Note that it looks
for english.txt in the lang subdirectory, which is where your language file
should also be.
That is all! You should now be able to select the language in the game options.
9.0) Troubleshooting
---- ---------------
To see all startup options available to you, start OpenTTD with the
'./openttd -h' option. This might help you tweak some of the settings.
If the game is acting strange and you feel adventurous you can try the
'-d [[<name>=]<level>]' flag, where the higher levels will give you more
debugging output. The 'name' variable can help you to display only some type of
debugging messages. This is mostly undocumented so best is to look in the
source code file debug.c for the various debugging types. For more information
look at http://wiki.openttd.org/index.php/Command_line.
The most frequent problem is missing data files. Please install OpenGFX and
possibly OpenSFX and OpenMSX. See section 4.1.1 for more information.
Under certain circumstance, especially on Ubuntu OpenTTD can be extremely slow
and/or freeze. See known-bugs.txt for more information and how to solve this
problem on your computer.
Under Windows 98 and lower it is impossible to use a dedicated server; it will
fail to start. Perhaps this is for the better because those OSes are not known
for their stability.
With the added support for font-based text selecting a non-latin language can
result in lots of question marks ('?') being shown on screen. Please open your
configuration file (openttd.cfg - see Section 4.2 for where to find it)
and add a suitable font for the small, medium and / or large font, e.g.:
small_font = "Tahoma"
medium_font = "Tahoma"
large_font = "Tahoma"
You should use a font name like 'Tahoma' or a path to the desired font.
Any NewGRF file used in a game is stored inside the savegame and will refuse
to load if you do not have that NewGRF file available. A list of missing files
can be viewed in the NewGRF window accessible from the file load dialogue window.
You can try to obtain the missing files from that NewGRF dialogue or - if they
are not available online - you can search manually through our forum's graphics
development section (http://www.tt-forums.net/viewforum.php?f=66) or GrfCrawler
(http://grfcrawler.tt-forums.net/). Put the NewGRF files in OpenTTD's newgrf folder
(see section 4.2 'OpenTTD directories') and rescan the list of available NewGRFs.
Once you have all missing files, you are set to go.
10.0) Licensing
----- ---------
OpenTTD is licensed under the GNU General Public License version 2.0. For
the complete license text, see the file 'COPYING'. This license applies
to all files in this distribution, except as noted below.
The squirrel implementation in src/3rdparty/squirrel is licensed under
the Zlib license. See src/3rdparty/squirrel/COPYRIGHT for the complete
license text.
The md5 implementation in src/3rdparty/md5 is licensed under the Zlib
license. See the comments in the source files in src/3rdparty/md5 for
the complete license text.
The implementations of Posix getaddrinfo and getnameinfo for OS/2 in
src/3rdparty/os2 are distributed partly under the GNU Lesser General Public
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
X.X) Credits
---- -------
The OpenTTD team (in alphabetical order):
Grzegorz Duczyński (adf88) - General coding (since 1.7.2)
Albert Hofkamp (Alberth) - GUI expert (since 0.7)
Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
Ulf Hermann (fonsinchen) - Cargo Distribution (since 1.3)
Christoph Elsenhans (frosch) - General coding (since 0.6)
Loïc Guilloux (glx) - Windows Expert (since 0.4.5)
Michael Lutz (michi_cc) - Path based signals (since 0.7)
Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
Ingo von Borstel (planetmaker) - General coding, Support (since 1.1)
Remko Bijker (Rubidium) - Lead coder and way more (since 0.4.5)
José Soler (Terkhen) - General coding (since 1.0)
Leif Linse (Zuu) - AI/Game Script (since 1.2)
Inactive Developers:
Jean-François Claeys (Belugas) - GUI, newindustries and more (0.4.5 - 1.0)
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles (0.3 - 0.7)
Victor Fischer (Celestar) - Programming everywhere you need him to (0.3 - 0.6)
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;) (0.4.5 - 0.6)
Jonathan Coome (Maedhros) - High priest of the NewGRF Temple (0.5 - 0.6)
Attila Bán (MiHaMiX) - WebTranslator 1 and 2 (0.3 - 0.5)
Zdeněk Sojka (SmatZ) - Bug finder and fixer (0.6 - 1.3)
Christoph Mallon (Tron) - Programmer, code correctness police (0.3 - 0.5)
Patric Stout (TrueBrain) - NoProgrammer (0.3 - 1.2), sys op (active)
Thijs Marinussen (Yexo) - AI Framework, General (0.6 - 1.3)
Retired Developers:
Tamás Faragó (Darkvater) - Ex-Lead coder (0.3 - 0.5)
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3 - 0.3)
Emil Djupfeld (egladil) - MacOSX port (0.4 - 0.6)
Simon Sasburg (HackyKid) - Bug fixer (0.4 - 0.4.5)
Ludvig Strigeus (ludde) - Original author of OpenTTD, main coder (0.1 - 0.3)
Cian Duffy (MYOB) - BeOS port / manual writing (0.1 - 0.3)
Petr Baudiš (pasky) - Many patches, newgrf support, etc. (0.3 - 0.3)
Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker (0.6 - 0.7)
Serge Paquet (vurlix) - 2nd contributor after ludde (0.1 - 0.3)
Thanks to:
Josef Drexler - For his great work on TTDPatch.
Marcin Grzegorczyk - For his TTDPatch work and documentation of Transport Tycoon Deluxe internals and track foundations
Stefan Meißner (sign_de) - For his work on the console
Mike Ragsdale - OpenTTD installer
Christian Rosentreter (tokai) - MorphOS / AmigaOS port
Richard Kempton (RichK67) - Additional airports, initial TGP implementation
Alberto Demichelis - Squirrel scripting language
L. Peter Deutsch - MD5 implementation
Michael Blunck - For revolutionizing TTD with awesome graphics
George - Canal graphics
Andrew Parkhouse (andythenorth) - River graphics
David Dallaston (Pikka) - Tram tracks
All Translators - For their support to make OpenTTD a truly international game
Bug Reporters - Thanks for all bug reports
Chris Sawyer - For an amazing game!

@ -836,6 +836,8 @@ script/api/script_bridgelist.hpp
script/api/script_cargo.hpp
script/api/script_cargolist.hpp
script/api/script_cargomonitor.hpp
script/api/script_client.hpp
script/api/script_clientlist.hpp
script/api/script_company.hpp
script/api/script_companymode.hpp
script/api/script_controller.hpp
@ -903,6 +905,8 @@ script/api/script_bridgelist.cpp
script/api/script_cargo.cpp
script/api/script_cargolist.cpp
script/api/script_cargomonitor.cpp
script/api/script_client.cpp
script/api/script_clientlist.cpp
script/api/script_company.cpp
script/api/script_companymode.cpp
script/api/script_controller.cpp

@ -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.8") == 0 || strcmp(api_version, "1.9") == 0;
}
#if defined(WIN32)

@ -11,17 +11,14 @@
#include "stdafx.h"
#include "core/alloc_func.hpp"
#include "core/smallvec_type.hpp"
#include "tile_cmd.h"
#include "viewport_func.h"
#include "safeguards.h"
/** The table/list with animated tiles. */
TileIndex *_animated_tile_list = NULL;
/** The number of animated tiles in the current state. */
uint _animated_tile_count = 0;
/** The number of slots for animated tiles allocated currently. */
uint _animated_tile_allocated = 0;
SmallVector<TileIndex, 256> _animated_tiles;
/**
* Removes the given tile from the animated tile table.
@ -29,17 +26,11 @@ uint _animated_tile_allocated = 0;
*/
void DeleteAnimatedTile(TileIndex tile)
{
for (TileIndex *ti = _animated_tile_list; ti < _animated_tile_list + _animated_tile_count; ti++) {
if (tile == *ti) {
/* Remove the hole
* The order of the remaining elements must stay the same, otherwise the animation loop
* may miss a tile; that's why we must use memmove instead of just moving the last element.
*/
memmove(ti, ti + 1, (_animated_tile_list + _animated_tile_count - (ti + 1)) * sizeof(*ti));
_animated_tile_count--;
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
return;
}
TileIndex *to_remove = _animated_tiles.Find(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);
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
}
}
@ -51,19 +42,7 @@ void DeleteAnimatedTile(TileIndex tile)
void AddAnimatedTile(TileIndex tile)
{
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
for (const TileIndex *ti = _animated_tile_list; ti < _animated_tile_list + _animated_tile_count; ti++) {
if (tile == *ti) return;
}
/* Table not large enough, so make it larger */
if (_animated_tile_count == _animated_tile_allocated) {
_animated_tile_allocated *= 2;
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, _animated_tile_allocated);
}
_animated_tile_list[_animated_tile_count] = tile;
_animated_tile_count++;
_animated_tiles.Include(tile);
}
/**
@ -71,8 +50,8 @@ void AddAnimatedTile(TileIndex tile)
*/
void AnimateAnimatedTiles()
{
const TileIndex *ti = _animated_tile_list;
while (ti < _animated_tile_list + _animated_tile_count) {
const TileIndex *ti = _animated_tiles.Begin();
while (ti < _animated_tiles.End()) {
const TileIndex curr = *ti;
AnimateTile(curr);
/* During the AnimateTile call, DeleteAnimatedTile could have been called,
@ -93,7 +72,5 @@ void AnimateAnimatedTiles()
*/
void InitializeAnimatedTiles()
{
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, 256);
_animated_tile_count = 0;
_animated_tile_allocated = 256;
_animated_tiles.Clear();
}

@ -219,6 +219,11 @@ public:
static bool HasSet(const ContentInfo *ci, bool md5sum);
};
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
/**
* Check whether there's a base set matching some information.
* @param ci The content info to compare it to.

@ -17,11 +17,6 @@
#include "ini_type.h"
#include "string_func.h"
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
/**
* Try to read a single piece of metadata and return false if it doesn't exist.
* @param name the name of the item to fetch.

@ -27,6 +27,8 @@
#define MARGIN_NORMAL_THRESHOLD (zoom == ZOOM_LVL_OUT_32X ? 8 : 4) ///< Minimum width to use margins with BM_NORMAL.
#define MARGIN_REMAP_THRESHOLD 4 ///< Minimum width to use margins with BM_COLOUR_REMAP.
#undef ALIGN
#ifdef _MSC_VER
#define ALIGN(n) __declspec(align(n))
#else

@ -264,6 +264,6 @@ bool HandleBootstrap()
/* Failure to get enough working to get a graphics set. */
failure:
usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD. See section 4.1 of readme.txt.");
usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD. See section 4.1 of README.md.");
return false;
}

@ -175,6 +175,7 @@ CommandProc CmdSetStoryPageDate;
CommandProc CmdShowStoryPage;
CommandProc CmdRemoveStoryPage;
CommandProc CmdRemoveStoryPageElement;
CommandProc CmdScrollViewport;
CommandProc CmdLevelLand;
@ -384,6 +385,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdShowStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SHOW_STORY_PAGE
DEF_CMD(CmdRemoveStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_PAGE
DEF_CMD(CmdRemoveStoryPageElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_ELEMENT_PAGE
DEF_CMD(CmdScrollViewport, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SCROLL_VIEWPORT
DEF_CMD(CmdLevelLand, CMD_ALL_TILES | CMD_NO_TEST | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once

@ -313,6 +313,8 @@ enum Commands {
CMD_SHOW_STORY_PAGE, ///< show a story page
CMD_REMOVE_STORY_PAGE, ///< remove a story page
CMD_REMOVE_STORY_PAGE_ELEMENT, ///< remove a story page element
CMD_SCROLL_VIEWPORT, ///< scroll main viewport of players
CMD_LEVEL_LAND, ///< level land
CMD_BUILD_LOCK, ///< build a lock

@ -183,9 +183,9 @@ public:
inline void Push(const Titem &item)
{
if (this->value != Tinvalid) {
Tindex new_item = _pool.Create();
Tindex new_item = SmallStack::GetPool().Create();
if (new_item != Tmax_size) {
PooledSmallStack &pushed = _pool.Get(new_item);
PooledSmallStack &pushed = SmallStack::GetPool().Get(new_item);
pushed.value = this->value;
pushed.next = this->next;
pushed.branch_count = 0;
@ -205,14 +205,14 @@ public:
if (this->next == Tmax_size) {
this->value = Tinvalid;
} else {
PooledSmallStack &popped = _pool.Get(this->next);
PooledSmallStack &popped = SmallStack::GetPool().Get(this->next);
this->value = popped.value;
if (popped.branch_count == 0) {
_pool.Destroy(this->next);
SmallStack::GetPool().Destroy(this->next);
} else {
--popped.branch_count;
if (popped.next != Tmax_size) {
++(_pool.Get(popped.next).branch_count);
++(SmallStack::GetPool().Get(popped.next).branch_count);
}
}
/* Accessing popped here is no problem as the pool will only set
@ -245,7 +245,7 @@ public:
const SmallStack *in_list = this;
do {
in_list = static_cast<const SmallStack *>(
static_cast<const Item *>(&_pool.Get(in_list->next)));
static_cast<const Item *>(&SmallStack::GetPool().Get(in_list->next)));
if (in_list->value == item) return true;
} while (in_list->next != Tmax_size);
}
@ -253,7 +253,11 @@ public:
}
protected:
static SmallStackPool _pool;
static SmallStackPool &GetPool()
{
static SmallStackPool pool;
return pool;
}
/**
* Create a branch in the pool if necessary.
@ -261,7 +265,7 @@ protected:
inline void Branch()
{
if (this->next != Tmax_size) {
++(_pool.Get(this->next).branch_count);
++(SmallStack::GetPool().Get(this->next).branch_count);
}
}
};

@ -158,6 +158,23 @@ public:
}
}
/**
* Insert a new item at a specific position into the vector, moving all following items.
* @param item Position at which the new item should be inserted
* @return pointer to the new item
*/
inline T *Insert(T *item)
{
assert(item >= this->Begin() && item <= this->End());
size_t to_move = this->End() - item;
size_t start = item - this->Begin();
this->Append();
if (to_move > 0) MemMoveT(this->Begin() + start + 1, this->Begin() + start, to_move);
return this->Begin() + start;
}
/**
* Search for the first occurrence of an item.
* The '!=' operator of T is used for comparison.
@ -232,13 +249,24 @@ public:
* @param count Number of consecutive items to remove.
*/
void ErasePreservingOrder(uint pos, uint count = 1)
{
ErasePreservingOrder(this->data + pos, count);
}
/**
* Remove items from the vector while preserving the order of other items.
* @param item First item to remove.
* @param count Number of consecutive items to remove.
*/
inline void ErasePreservingOrder(T *item, uint count = 1)
{
if (count == 0) return;
assert(pos < this->items);
assert(pos + count <= this->items);
assert(item >= this->Begin());
assert(item + count <= this->End());
this->items -= count;
uint to_move = this->items - pos;
if (to_move > 0) MemMoveT(this->data + pos, this->data + pos + count, to_move);
ptrdiff_t to_move = this->End() - item;
if (to_move > 0) MemMoveT(item, item + count, to_move);
}
/**

@ -28,6 +28,7 @@
#include "network/network.h"
#include "language.h"
#include "fontcache.h"
#include "news_gui.h"
#include "scope_info.h"
#include "command_func.h"
#include "thread/thread.h"
@ -329,6 +330,27 @@ char *CrashLog::LogGamelog(char *buffer, const char *last) const
return CrashLog::gamelog_buffer + seprintf(CrashLog::gamelog_buffer, last, "\n");
}
/**
* Writes any recent news messages to the buffer.
* @param buffer The begin where to write at.
* @param last The last position in the buffer to write to.
* @return the position of the \c '\0' character after the buffer.
*/
char *CrashLog::LogRecentNews(char *buffer, const char *last) const
{
buffer += seprintf(buffer, last, "Recent news messages:\n");
for (NewsItem *news = _oldest_news; news != NULL; news = news->next) {
YearMonthDay ymd;
ConvertDateToYMD(news->date, &ymd);
buffer += seprintf(buffer, last, "(%i-%02i-%02i) StringID: %u, Type: %u, Ref1: %u, %u, Ref2: %u, %u\n",
ymd.year, ymd.month + 1, ymd.day, news->string_id, news->type,
news->reftype1, news->ref1, news->reftype2, news->ref2);
}
buffer += seprintf(buffer, last, "\n");
return buffer;
}
/**
* Writes the command log data to the buffer.
* @param buffer The begin where to write at.
@ -384,6 +406,7 @@ char *CrashLog::FillCrashLog(char *buffer, const char *last) const
buffer = this->LogLibraries(buffer, last);
buffer = this->LogModules(buffer, last);
buffer = this->LogGamelog(buffer, last);
buffer = this->LogRecentNews(buffer, last);
buffer = this->LogCommandLog(buffer, last);
buffer += seprintf(buffer, last, "*** End of OpenTTD Crash Report ***\n");

@ -103,6 +103,7 @@ protected:
char *LogConfiguration(char *buffer, const char *last) const;
char *LogLibraries(char *buffer, const char *last) const;
char *LogGamelog(char *buffer, const char *last) const;
char *LogRecentNews(char *buffer, const char *list) const;
char *LogCommandLog(char *buffer, const char *last) const;
public:

@ -110,8 +110,6 @@ char *DumpDebugFacilityNames(char *buf, char *last)
return buf;
}
#if !defined(NO_DEBUG_MESSAGES)
/**
* Internal function for outputting the debug line.
* @param dbg Debug category.
@ -208,7 +206,6 @@ void CDECL debug(const char *dbg, const char *format, ...)
debug_print(dbg, buf);
}
#endif /* NO_DEBUG_MESSAGES */
/**
* Set debugging levels by parsing the text in \a s.

@ -28,40 +28,36 @@
* 6.. - extremely detailed spamming
*/
#ifdef NO_DEBUG_MESSAGES
#define DEBUG(name, level, ...) { }
#else /* NO_DEBUG_MESSAGES */
/**
* Output a line of debugging information.
* @param name Category
* @param level Debugging level, higher levels means more detailed information.
*/
#define DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__)
extern int _debug_driver_level;
extern int _debug_grf_level;
extern int _debug_map_level;
extern int _debug_misc_level;
extern int _debug_net_level;
extern int _debug_sprite_level;
extern int _debug_oldloader_level;
extern int _debug_npf_level;
extern int _debug_yapf_level;
extern int _debug_freetype_level;
extern int _debug_script_level;
extern int _debug_sl_level;
extern int _debug_gamelog_level;
extern int _debug_desync_level;
extern int _debug_yapfdesync_level;
extern int _debug_console_level;
extern int _debug_linkgraph_level;
extern int _debug_sound_level;
/**
* Output a line of debugging information.
* @param name Category
* @param level Debugging level, higher levels means more detailed information.
*/
#define DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__)
extern int _debug_driver_level;
extern int _debug_grf_level;
extern int _debug_map_level;
extern int _debug_misc_level;
extern int _debug_net_level;
extern int _debug_sprite_level;
extern int _debug_oldloader_level;
extern int _debug_npf_level;
extern int _debug_yapf_level;
extern int _debug_freetype_level;
extern int _debug_script_level;
extern int _debug_sl_level;
extern int _debug_gamelog_level;
extern int _debug_desync_level;
extern int _debug_yapfdesync_level;
extern int _debug_console_level;
extern int _debug_linkgraph_level;
extern int _debug_sound_level;
#ifdef RANDOM_DEBUG
extern int _debug_random_level;
extern int _debug_random_level;
#endif
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
#endif /* NO_DEBUG_MESSAGES */
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
char *DumpDebugFacilityNames(char *buf, char *last);
void SetDebugString(const char *s);

@ -382,38 +382,67 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
FT_Error err = FT_Err_Cannot_Open_Resource;
/* Get font reference from name. */
UInt8 file_path[PATH_MAX];
OSStatus os_err = -1;
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, font_name, kCFStringEncodingUTF8);
ATSFontRef font = ATSFontFindFromName(name, kATSOptionFlagsDefault);
CFRelease(name);
if (font == kInvalidFont) return err;
/* Get a file system reference for the font. */
FSRef ref;
OSStatus os_err = -1;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
os_err = ATSFontGetFileReference(font, &ref);
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
if (MacOSVersionIsAtLeast(10, 6, 0)) {
/* Simply creating the font using CTFontCreateWithNameAndSize will *always* return
* something, no matter the name. As such, we can't use it to check for existance.
* We instead query the list of all font descriptors that match the given name which
* does not do this stupid name fallback. */
CTFontDescriptorRef name_desc = CTFontDescriptorCreateWithNameAndSize(name, 0.0);
CFSetRef mandatory_attribs = CFSetCreate(kCFAllocatorDefault, (const void **)&kCTFontNameAttribute, 1, &kCFTypeSetCallBacks);
CFArrayRef descs = CTFontDescriptorCreateMatchingFontDescriptors(name_desc, mandatory_attribs);
CFRelease(mandatory_attribs);
CFRelease(name_desc);
CFRelease(name);
/* Loop over all matches until we can get a path for one of them. */
for (CFIndex i = 0; descs != NULL && i < CFArrayGetCount(descs) && os_err != noErr; i++) {
CTFontRef font = CTFontCreateWithFontDescriptor((CTFontDescriptorRef)CFArrayGetValueAtIndex(descs, i), 0.0, NULL);
CFURLRef fontURL = (CFURLRef)CTFontCopyAttribute(font, kCTFontURLAttribute);
if (CFURLGetFileSystemRepresentation(fontURL, true, file_path, lengthof(file_path))) os_err = noErr;
CFRelease(font);
CFRelease(fontURL);
}
if (descs != NULL) CFRelease(descs);
} else
#endif
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
ATSFontRef font = ATSFontFindFromName(name, kATSOptionFlagsDefault);
CFRelease(name);
if (font == kInvalidFont) return err;
/* Get a file system reference for the font. */
FSRef ref;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
os_err = ATSFontGetFileReference(font, &ref);
} else
#endif
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(__LP64__)
/* This type was introduced with the 10.5 SDK. */
/* This type was introduced with the 10.5 SDK. */
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
#define ATSFSSpec FSSpec
#define ATSFSSpec FSSpec
#endif
FSSpec spec;
os_err = ATSFontGetFileSpecification(font, (ATSFSSpec *)&spec);
if (os_err == noErr) os_err = FSpMakeFSRef(&spec, &ref);
#endif
FSSpec spec;
os_err = ATSFontGetFileSpecification(font, (ATSFSSpec *)&spec);
if (os_err == noErr) os_err = FSpMakeFSRef(&spec, &ref);
}
/* Get unix path for file. */
if (os_err == noErr) os_err = FSRefMakePath(&ref, file_path, sizeof(file_path));
#endif
}
if (os_err == noErr) {
/* Get unix path for file. */
UInt8 file_path[PATH_MAX];
if (FSRefMakePath(&ref, file_path, sizeof(file_path)) == noErr) {
DEBUG(freetype, 3, "Font path for %s: %s", font_name, file_path);
err = FT_New_Face(_library, (const char *)file_path, 0, face);
}
DEBUG(freetype, 3, "Font path for %s: %s", font_name, file_path);
err = FT_New_Face(_library, (const char *)file_path, 0, face);
}
return err;
@ -496,6 +525,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
} else
#endif
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
/* Create a font iterator and iterate over all fonts that
* are available to the application. */
ATSFontIterator itr;
@ -529,6 +559,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
}
}
ATSFontIteratorRelease(&itr);
#endif
}
if (!result) {

@ -55,7 +55,7 @@ public:
/**
* Resume execution of the Game Script. This function will not actually execute
* the script, but set a flag so that the script is executed my the usual
* the script, but set a flag so that the script is executed by the usual
* mechanism that executes the script.
*/
static void Unpause();

@ -26,7 +26,7 @@ static bool CheckAPIVersion(const char *api_version)
{
return 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.8") == 0 || strcmp(api_version, "1.9") == 0;
}
#if defined(WIN32)

@ -34,6 +34,8 @@
#include "../script/api/game/game_cargo.hpp.sq"
#include "../script/api/game/game_cargolist.hpp.sq"
#include "../script/api/game/game_cargomonitor.hpp.sq"
#include "../script/api/game/game_client.hpp.sq"
#include "../script/api/game/game_clientlist.hpp.sq"
#include "../script/api/game/game_company.hpp.sq"
#include "../script/api/game/game_companymode.hpp.sq"
#include "../script/api/game/game_controller.hpp.sq"
@ -122,6 +124,9 @@ void GameInstance::RegisterAPI()
SQGSCargoList_IndustryProducing_Register(this->engine);
SQGSCargoList_StationAccepting_Register(this->engine);
SQGSCargoMonitor_Register(this->engine);
SQGSClient_Register(this->engine);
SQGSClientList_Register(this->engine);
SQGSClientList_Company_Register(this->engine);
SQGSCompany_Register(this->engine);
SQGSCompanyMode_Register(this->engine);
SQGSDate_Register(this->engine);

@ -594,12 +594,12 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str,
break;
} else if (c >= SCC_BLUE && c <= SCC_BLACK) {
state.SetColour((TextColour)(c - SCC_BLUE));
} else if (c == SCC_PREVIOUS_COLOUR) { // Revert to the previous colour.
state.SetPreviousColour();
} else if (c == SCC_TINYFONT) {
state.SetFontSize(FS_SMALL);
} else if (c == SCC_BIGFONT) {
state.SetFontSize(FS_LARGE);
} else if (c == SCC_PUSH_COLOUR) {
state.PushColour();
} else if (c == SCC_POP_COLOUR) {
state.PopColour();
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
} else {
/* Filter out text direction characters that shouldn't be drawn, and
* will not be handled in the fallback non ICU case because they are

@ -18,6 +18,7 @@
#include <map>
#include <string>
#include <stack>
#ifdef WITH_ICU_LAYOUT
#include "layout/ParagraphLayout.h"
@ -33,10 +34,11 @@
struct FontState {
FontSize fontsize; ///< Current font size.
TextColour cur_colour; ///< Current text colour.
TextColour prev_colour; ///< Text colour from before the last colour switch.
FontState() : fontsize(FS_END), cur_colour(TC_INVALID), prev_colour(TC_INVALID) {}
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour), prev_colour(colour) {}
std::stack<TextColour> colour_stack; ///< Stack of colours to assist with colour switching.
FontState() : fontsize(FS_END), cur_colour(TC_INVALID) {}
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour) {}
/**
* Switch to new colour \a c.
@ -45,14 +47,25 @@ struct FontState {
inline void SetColour(TextColour c)
{
assert(c >= TC_BLUE && c <= TC_BLACK);
this->prev_colour = this->cur_colour;
this->cur_colour = c;
}
/** Switch to previous colour. */
inline void SetPreviousColour()
/**
* Switch to and pop the last saved colour on the stack.
*/
inline void PopColour()
{
if (colour_stack.empty()) return;
SetColour(colour_stack.top());
colour_stack.pop();
}
/**
* Push the current colour on to the stack.
*/
inline void PushColour()
{
Swap(this->cur_colour, this->prev_colour);
colour_stack.push(this->cur_colour);
}
/**
@ -149,7 +162,7 @@ class Layouter : public AutoDeleteSmallVector<const ParagraphLayouter::Line *, 4
{
if (this->state_before.fontsize != other.state_before.fontsize) return this->state_before.fontsize < other.state_before.fontsize;
if (this->state_before.cur_colour != other.state_before.cur_colour) return this->state_before.cur_colour < other.state_before.cur_colour;
if (this->state_before.prev_colour != other.state_before.prev_colour) return this->state_before.prev_colour < other.state_before.prev_colour;
if (this->state_before.colour_stack != other.state_before.colour_stack) return this->state_before.colour_stack < other.state_before.colour_stack;
return this->str < other.str;
}
};

@ -150,7 +150,7 @@ void CheckExternalFiles()
if (used_set->GetNumInvalid() != 0) {
/* Not all files were loaded successfully, see which ones */
add_pos += seprintf(add_pos, last, "Trying to load graphics set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of readme.txt.\n\nThe following files are corrupted or missing:\n", used_set->name);
add_pos += seprintf(add_pos, last, "Trying to load graphics set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of README.md.\n\nThe following files are corrupted or missing:\n", used_set->name);
for (uint i = 0; i < GraphicsSet::NUM_FILES; i++) {
MD5File::ChecksumResult res = GraphicsSet::CheckMD5(&used_set->files[i], BASESET_DIR);
if (res != MD5File::CR_MATCH) add_pos += seprintf(add_pos, last, "\t%s is %s (%s)\n", used_set->files[i].filename, res == MD5File::CR_MISMATCH ? "corrupt" : "missing", used_set->files[i].missing_warning);
@ -160,7 +160,7 @@ void CheckExternalFiles()
const SoundsSet *sounds_set = BaseSounds::GetUsedSet();
if (sounds_set->GetNumInvalid() != 0) {
add_pos += seprintf(add_pos, last, "Trying to load sound set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of readme.txt.\n\nThe following files are corrupted or missing:\n", sounds_set->name);
add_pos += seprintf(add_pos, last, "Trying to load sound set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of README.md.\n\nThe following files are corrupted or missing:\n", sounds_set->name);
assert_compile(SoundsSet::NUM_FILES == 1);
/* No need to loop each file, as long as there is only a single

@ -598,7 +598,7 @@ STR_SORT_BY_TYPE :Тып
STR_SORT_BY_TRANSPORTED :Вывезена
STR_SORT_BY_NUMBER :Нумар
STR_SORT_BY_PROFIT_LAST_YEAR :Прыбытак летась
STR_SORT_BY_PROFIT_THIS_YEAR :Прыбытак у бягучым годзе
STR_SORT_BY_PROFIT_THIS_YEAR :Прыбытак сёлета
STR_SORT_BY_AGE :Узрост
STR_SORT_BY_RELIABILITY :Надзейнасьць
STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE :Умяшчальнасьць грузу
@ -1685,6 +1685,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :выключа
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Скролінг па кліку левай кнопкай мышы: {STRING}
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Уключыць пракручваньне мапы цягненьнем з націснутай левай кнопкай мышы. Гэта асабліва зручна пры выкарыстоўваньні сэнсарнага экрана.
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Зачыняць вокны пстрычкай ПКМ: {STRING}
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Зачыняць акно пстрычкай правай кнопкай мышы ў яго межах. Пры гэтым адключаецца з'яўленне падказак па правай кнопцы.
STR_CONFIG_SETTING_AUTOSAVE :Аўтазахаваньні: {STRING}
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Азначце інтэрвал паміж аўтаматычнымі захаваньнямі
@ -2074,6 +2076,7 @@ STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Прав
STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Зьмяніць наладкі ШІ ды гульнёвага скрыпту
STR_INTRO_TOOLTIP_QUIT :{BLACK}Выйсьці з OpenTTD
STR_INTRO_BASESET :{BLACK}У абраным наборы базавай графікі адсутнічае {NUM} спрайт{P "" а аў}. Калі ласка, абнавіце набор графікі.
STR_INTRO_TRANSLATION :{BLACK}На гэту мову не перакладзен{P 0 ы ы а} {NUM} рад{P ок кі коў}. Вы можаце дапамагчы праекту, калi зарэґіструецеся як перакладчык. Інструкцыі ў файле readme.txt.
# Quit window
@ -2920,6 +2923,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Зона
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Прымае: {LTBLUE}
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Тып чыгуначнага палатна: {LTBLUE}{STRING}
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Макс. хуткасьць чыгункi: {LTBLUE}{VELOCITY}
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Макс. хуткасьць аўтамабіляў: {LTBLUE}{VELOCITY}
@ -2932,29 +2936,29 @@ STR_LAI_CLEAR_DESCRIPTION_FIELDS :Палi
STR_LAI_CLEAR_DESCRIPTION_SNOW_COVERED_LAND :Засьнежаная зямля
STR_LAI_CLEAR_DESCRIPTION_DESERT :Пустэльня
STR_LAI_RAIL_DESCRIPTION_TRACK :Чыгунка рэйкi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Чыгунка рэйкi са звычайнымі сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :Чыгунка рэйкi з уваходнымі прэсыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :Чыгунка рэйкi з выхаднымi сыґналамi (прэсыґналамі)
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :Чыгунка рэйкi з камбаванымi сыґналамi (прэсыґналамі)
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :Чыгунка рэйкi з маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :Чыгунка рэйкi з аднабаковымi маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :Чыгунка рэйкi са звычайнымi й уваходнымі прэсыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :Чыгунка рэйкi са звычайнымi й выхаднымi сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :Чыгунка рэйкi са звычайнымi й камбаванымi сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :Чыгунка рэйкi са звычайнымi й маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :Чыгунка рэйкi са звычайнымi й аднабаковымi маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :Чыгунка рэйкi з уваходнымi (прэcыгналамi) ды выхаднымi сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды камбаванымi сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды аднабаковымi маршрутнымi (PMS) сыґналамi
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :Чыгунка рэйкi з выхаднымi й камбінаванымі прэсыґналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :Чыгунка рэйкі з выхаднымі (прэсыґналамі) ды маршрутнымі (PMS) сыґналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :Чыгунка рэйкі з выхаднымі (прэсыґналамі) ды аднабаковымі маршрутнымі (PMS) сыґналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :Чыгунка рэйкі з камбінаванымі (прэсыґналамі) ды маршрутнымі (PMS) сыґналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :Чыгунка рэйкі з камбінаванымі (прэсыґналамі) ды аднабаковымі маршрутнымі (PMS) сыґналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :Чыгунка рэйкі з маршрутнымі (PMS) ды аднабаковымі маршрутнымі сыґналамі
STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :Чыгунка чыгуначнае дэпо
STR_LAI_RAIL_DESCRIPTION_TRACK :Чыгуначны пуць
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Чыгуначны пуць з сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :Чыгуначны пуць з уваходнымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :Чыгуначны пуць з выходнымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :Чыгуначны пуць з камбінаванымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :Чыгуначны пуць з маршрутнымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :Чыгуначны пуць з аднабаковымі маршрутнымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :Чыгуначны пуць са звычайным і ўваходным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :Чыгуначны пуць са звычайным і выходным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :Чыгуначны пуць са звычайнымі й камбінаванымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :Чыгуначны пуць са звычайнымі і маршрутнымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :Чыгуначны пуць са звычайным і аднабаковым маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :Чыгуначны пуць з уваходным і выходным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :Чыгуначны пуць з уваходным і камбінаваным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :Чыгуначны пуць з выходным і маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :Чыгуначны пуць з уваходным і аднабаковым маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :Чыгуначны пуць з выходнымі й камбінаванымі сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :Чыгуначны пуць з выходным і маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :Чыгуначны пуць з выходным і аднабаковым маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :Чыгуначны пуць з камбінаваным і маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :Чыгуначны пуць з камбінаваным і аднабаковым маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :Чыгуначны пуць з маршрутным і аднабаковым маршрутным сігналамі
STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :Чыгуначнае дэпо
STR_LAI_ROAD_DESCRIPTION_ROAD :Дарога
STR_LAI_ROAD_DESCRIPTION_ROAD_WITH_STREETLIGHTS :Дарога з вулічным асьвятленьнем
@ -3625,6 +3629,9 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Патр
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Патрабуецца: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
############ range for requires ends
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Патрабуецца:
STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING}
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} чакае{STRING}
############ range for produces starts
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Вырабляе: {YELLOW}{STRING}{STRING}
@ -3645,7 +3652,7 @@ STR_VEHICLE_LIST_ROAD_VEHICLE_TOOLTIP :{BLACK}Аўта
STR_VEHICLE_LIST_SHIP_TOOLTIP :{BLACK}Караблi: клікніце для атрыманьня даведкі
STR_VEHICLE_LIST_AIRCRAFT_TOOLTIP :{BLACK}Самалёты: клікніце для атрыманьня даведкі
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прыбытак у гэтым годзе: {CURRENCY_LONG} (летась: {CURRENCY_LONG})
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прыбытак сёлета: {CURRENCY_LONG} (летась: {CURRENCY_LONG})
STR_VEHICLE_LIST_AVAILABLE_TRAINS :Даступныя цягнiкi
STR_VEHICLE_LIST_AVAILABLE_ROAD_VEHICLES :Даступныя аўтамабiлi
@ -3693,6 +3700,10 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Выдаліц
STR_GROUP_RENAME_CAPTION :{BLACK}Перайменаваць групу
STR_GROUP_PROFIT_THIS_YEAR :Прыбытак сёлета:
STR_GROUP_PROFIT_LAST_YEAR :Прыбытак летась:
STR_GROUP_OCCUPANCY :Сярэдняя загрузка ТС:
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
# Build vehicle window
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Новы цягнік
@ -3725,6 +3736,7 @@ STR_PURCHASE_INFO_ALL_TYPES :Усе тыпы
STR_PURCHASE_INFO_ALL_BUT :Усё, акрамя {CARGO_LIST}
STR_PURCHASE_INFO_MAX_TE :{BLACK}Макс. цягавае намаганьне: {GOLD}{FORCE}
STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Далёкасьць: {GOLD}{COMMA} клет{P ка кi ак}
STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Тып паветр. судна: {GOLD}{STRING}
STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Сьпіс лакаматываў і вагонаў - пстрыкніце для атрыманьня інфармацыі. Ctrl+пстрычка схавае/пакажа ТС.
STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Сьпіс аўтатранспарту - пстрыкніце для атрыманьня інфармацыі. Ctrl+пстрычка схавае/пакажа выбраны аўтамабіль.
@ -3871,6 +3883,10 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE.acc :магніта
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Кошт: {CURRENCY_LONG} Вага: {WEIGHT_SHORT}{}Хуткасьць: {VELOCITY} Магутнасьць: {POWER}{}Кошт абслуг.: {CURRENCY_LONG}/год{}Ёмістасьць: {CARGO_LONG}
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Кошт: {CURRENCY_LONG} Вага: {WEIGHT_SHORT}{}Хуткасьць: {VELOCITY} Магутнасьць: {POWER} Макс. ЦН: {6:FORCE}{}Кошт абслуг.: {4:CURRENCY_LONG}/год{}Ёмістасьць: {5:CARGO_LONG}
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасьць: {VELOCITY}{}Ёмістасьць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING}{}Ёмістасць: {CARGO_LONG}, {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING}{}Ёмістасць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING} Далёкасць: {COMMA} клетак{}Ёмістасць: {CARGO_LONG}, {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING} Далёкасць: {COMMA} клетак{}Ёмістасць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
# Autoreplace window
STR_REPLACE_VEHICLES_WHITE :{WHITE}Замена {STRING.gen} — {STRING}
@ -3908,6 +3924,7 @@ STR_REPLACE_HELP_STOP_BUTTON :{BLACK}Спын
STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Пераключэньне паміж вокнамі замены лякаматываў і ваґонаў
STR_REPLACE_ENGINES :Лякаматывы
STR_REPLACE_WAGONS :Ваґоны
STR_REPLACE_ALL_RAILTYPE :Увесь чыгуначны транспарт
STR_REPLACE_HELP_RAILTYPE :{BLACK}Выберыце тып чыгуначнага транспарту, цягнікі якога жадаеце замяніць
STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}На які транспарт адбываецца замена
@ -4000,10 +4017,12 @@ STR_VEHICLE_INFO_AGE :{COMMA} г{P о
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} г{P од ады адоў} ({COMMA})
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Макс. хуткасьць: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Макс. хуткасць: {LTBLUE}{VELOCITY} {BLACK}Тып паветр. судна: {LTBLUE}{STRING}
STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Макс. хуткасць: {LTBLUE}{VELOCITY} {BLACK}Тып: {LTBLUE}{STRING} {BLACK}Далёкасць: {LTBLUE}{COMMA} клетак
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Вага: {LTBLUE}{WEIGHT_SHORT} {BLACK}Магутнасьць: {LTBLUE}{POWER}{BLACK} Макс. хуткасьць: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Вага: {LTBLUE}{WEIGHT_SHORT} {BLACK}Магутнасьць: {LTBLUE}{POWER}{BLACK} Макс. хуткасьць: {LTBLUE}{VELOCITY} {BLACK}Макс. ЦН: {LTBLUE}{FORCE}
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Прыбытак ў гэтым годзе: {LTBLUE}{CURRENCY_LONG} (летась: {CURRENCY_LONG})
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Прыбытак сёлета: {LTBLUE}{CURRENCY_LONG} (летась: {CURRENCY_LONG})
STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Надзейнасьць: {LTBLUE}{COMMA}% {BLACK}Паломак з апошняга агляду: {LTBLUE}{COMMA}
STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Пабудаваны ў: {LTBLUE}{NUM} г.{BLACK} Кошт: {LTBLUE}{CURRENCY_LONG}

@ -473,9 +473,9 @@ STR_ABOUT_MENU_SCREENSHOT :Screenshot
STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Напълно увеличен в кадъра.
STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Увеличение по подразбиране
STR_ABOUT_MENU_GIANT_SCREENSHOT :Огромен Screenshot
STR_ABOUT_MENU_ABOUT_OPENTTD :За 'OpenTTD'
STR_ABOUT_MENU_ABOUT_OPENTTD :Относно 'OpenTTD'
STR_ABOUT_MENU_SPRITE_ALIGNER :Подравнител на спрайтове
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Превключва слепване на прозците
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Активиране слепване на прозорците
STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Превключва оцветяване на замърсените блокове
############ range ends here
@ -755,6 +755,7 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}Пока
STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}Показване/скриване на височинна карта
STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}Скриване на собствеността на компанията от картата
STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES :{BLACK}Показване на цялата собственост на компанията на картата
STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Покажи всички товари на картата
# Status bar messages
STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}Покажи последното съобщение или отчет на новините
@ -1282,6 +1283,7 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Показва
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Дебелина на линиите в графиките: {STRING}
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Дебелина на линиите в графиките. Тънките линии са по-лесни за разчитане, но по-дебелите се забелязват и разграничават по-лесно.
STR_CONFIG_SETTING_LANDSCAPE :Пейзаж: {STRING}
STR_CONFIG_SETTING_LAND_GENERATOR :Генератор на земя: {STRING}
STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL :оригинален
STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS :тера-генезис
@ -1293,6 +1295,7 @@ STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :много по
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :полегат
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :стръмен
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :много стръмен
STR_CONFIG_SETTING_RIVER_AMOUNT :Количество на реките: {STRING}
STR_CONFIG_SETTING_TREE_PLACER :Алгоритъм за поставяне на дървета: {STRING}
STR_CONFIG_SETTING_TREE_PLACER_NONE :без дървета
STR_CONFIG_SETTING_TREE_PLACER_ORIGINAL :оригинален
@ -1584,6 +1587,7 @@ STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Без
STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Множител за големината на града: {STRING}
STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Относителен размер на мегаполисите в сравнение с градовете в началото на играта
STR_CONFIG_SETTING_DEMAND_SIZE :Количество на връщания товар при симетричнен режим: {STRING}
STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :Единици за скорост: {STRING}
STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Всеки път при показване на скорости, да бъдат изписвани в избраните мерни единици
@ -1624,9 +1628,11 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m)
STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Позициониране
STR_CONFIG_SETTING_SOUND :{ORANGE}Звукови ефекти
STR_CONFIG_SETTING_INTERFACE :{ORANGE}Интерфейс
STR_CONFIG_SETTING_INTERFACE_GENERAL :{ORANGE}Основни
STR_CONFIG_SETTING_INTERFACE_CONSTRUCTION :{ORANGE}Строене
STR_CONFIG_SETTING_VEHICLES :{ORANGE}Автомобили
STR_CONFIG_SETTING_VEHICLES_ROUTING :{ORANGE}Маршрутизация
STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :{ORANGE}Права
STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :{ORANGE}Градове
STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Индустрии
STR_CONFIG_SETTING_AI :{ORANGE}Съперници
@ -2528,6 +2534,7 @@ STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF:
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Приет товар: {LTBLUE}
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Ограничение на скоростта на линията: {LTBLUE}{VELOCITY}
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Макс. скорост на пътя: {LTBLUE}{VELOCITY}
# Description of land area of different tiles
STR_LAI_CLEAR_DESCRIPTION_ROCKS :Скали
@ -3008,6 +3015,7 @@ STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING
STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Натисни върху услугата за да се фокусира върху индустрията/града. Ctrl отваря нов изглед към индустрията/града
# Story book window
STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Прескочи до определена страница чрез избирането й в дроп-даун листата.
STR_STORY_BOOK_NEXT_PAGE :{BLACK}Следваща
STR_STORY_BOOK_NEXT_PAGE_TOOLTIP :{BLACK}Отиди на следващата страница
STR_STORY_BOOK_INVALID_GOAL_REF :{RED}Невалидна цел
@ -3214,6 +3222,7 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Нужд
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Нуждае се от: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
############ range for requires ends
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} чакащ{STRING}
############ range for produces starts
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Произвежда: {YELLOW}{STRING}{STRING}
@ -3274,12 +3283,16 @@ STR_GROUP_DELETE_TOOLTIP :{BLACK}Изтр
STR_GROUP_RENAME_TOOLTIP :{BLACK}Преименувай избраната група
STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Щракни да защитиш тази група от глобална автоматична замяна
STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Изтрий група
STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Сигурен ли си, че искаш да изтриеш тази група и нейните производни?
STR_GROUP_ADD_SHARED_VEHICLE :Добави споделени превозни средства
STR_GROUP_REMOVE_ALL_VEHICLES :Премахни всички превозни средсва
STR_GROUP_RENAME_CAPTION :{BLACK}Преименовай група
STR_GROUP_OCCUPANCY :Използва се за:
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
# Build vehicle window
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Нови Машини за Двурелсов път
@ -3446,6 +3459,7 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :локомот
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Цена: {CURRENCY_LONG} Тегло: {WEIGHT_SHORT}{}Скорост: {VELOCITY} Мощност: {POWER}{}Разход: {CURRENCY_LONG}/г.{}Капацитет: {CARGO_LONG}
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Цена: {CURRENCY_LONG} Тегло: {WEIGHT_SHORT}{}Скорост: {VELOCITY} Мощност: {POWER} Макс. Т.С.: {6:FORCE}{}Експлоатационни разходи: {4:CURRENCY_LONG}/год.{}Вместимост: {5:CARGO_LONG}
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Цена: {CURRENCY_LONG} Макс. Скорост: {VELOCITY}{}Вместимост: {CARGO_LONG}{}Експлоатационни разходи: {CURRENCY_LONG}/год.
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Цена: {CURRENCY_LONG} Макс.скорост: {VELOCITY}{}Тип самолет: {STRING}{}Вместимост: {CARGO_LONG}{}Оперативни разходи: {CURRENCY_LONG}/yr
# Autoreplace window
STR_REPLACE_VEHICLES_WHITE :{WHITE}Замяна {STRING} - {STRING}
@ -3475,6 +3489,7 @@ STR_REPLACE_HELP_STOP_BUTTON :{BLACK}Нати
STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Превключване между замяна на локомотиви и вагони
STR_REPLACE_ENGINES :Двигатели
STR_REPLACE_WAGONS :Вагони
STR_REPLACE_ALL_RAILTYPE :Всички ЖП композиции
STR_REPLACE_HELP_RAILTYPE :{BLACK}Избор на ЖП линия с която да се заменят локомотивите
STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Показване с кой двигател се заменя ляво избрания, ако има
@ -4268,6 +4283,7 @@ STR_ERROR_YOU_ALREADY_OWN_IT :{WHITE}... ви
STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Групата неможе да бъде създадена...
STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Тази група неможе да бъде изтрита...
STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Групата неможе да бъде преименована...
STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Не може да избере горна група....
STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Всички превозни средства немогат да бъдат премахнати от тази група...
STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Превозното средство неможе да се добави към тази група...
STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Поделени превозни средсва немогат да бъдат добавени към групата...

@ -1372,6 +1372,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :Non-aktifkan
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Geser dgn klik-kiri: {STRING}
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Aktifkan penggeseran peta dengan menyeret menggunakan tombol kiri mouse. Hal ini sangat berguna apabila menggunakan layar sentuh.
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Tutup jendela dengan klik kanan: {STRING}
STR_CONFIG_SETTING_AUTOSAVE :Simpan otomatis: {STRING}
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Memilih jarak waktu antara menyimpan data game
@ -2587,6 +2588,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Nama are
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Muatan diterima: {LTBLUE}
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Tipe Rel: {LTBLUE}{STRING}
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Batasan kecepatan rel: {LTBLUE}{VELOCITY}
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Batasan kecepatan jalan: {LTBLUE}{VELOCITY}
@ -3356,6 +3358,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Jual semua
STR_GROUP_RENAME_CAPTION :{BLACK}Ubah nama kelompok
STR_GROUP_PROFIT_THIS_YEAR :Keuntungan tahun ini:
# Build vehicle window
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Kereta Baru
@ -3643,6 +3646,7 @@ STR_VEHICLE_INFO_AGE :{COMMA} tahun (
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} tahun ({COMMA})
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Kec. Max: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Kecepatan Maks.: {LTBLUE}{VELOCITY} {BLACK}Jenis pesawat: {LTBLUE}{STRING}
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Berat: {LTBLUE}{WEIGHT_SHORT} {BLACK}Tenaga: {LTBLUE}{POWER}{BLACK} Kec. Max: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Berat: {LTBLUE}{WEIGHT_SHORT} {BLACK}Tenaga: {LTBLUE}{POWER}{BLACK} Kec. Max: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}

@ -301,7 +301,7 @@ STR_SORT_BY_WAITING_TOTAL :Cargamento tota
STR_SORT_BY_WAITING_AVAILABLE :Cargamento disponible en espera
STR_SORT_BY_RATING_MAX :Valoración más alta de cargamento
STR_SORT_BY_RATING_MIN :Valoración más baja de cargamento
STR_SORT_BY_ENGINE_ID :EngineID (classic sort)Id. locomotora (orden clásico)
STR_SORT_BY_ENGINE_ID :Id. locomotora (orden clásico)
STR_SORT_BY_COST :Costo
STR_SORT_BY_POWER :Potencia
STR_SORT_BY_TRACTIVE_EFFORT :Fuerza de tracción
@ -1108,7 +1108,7 @@ STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Tipo:
STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT :{BLACK}Mostrar lista con opciones predeterminadas
STR_CONFIG_SETTING_RESTRICT_BASIC :Básico (mostrar solo las opciones más esenciales)
STR_CONFIG_SETTING_RESTRICT_ADVANCED :Avanzado (mostrar la mayoría de las opciones)
STR_CONFIG_SETTING_RESTRICT_ALL :Experto (mostrar todas las opciones, hasta las más extrañas)
STR_CONFIG_SETTING_RESTRICT_ALL :Experto (mostrar todas las opciones, incluso las avanzadas)
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT :Opciones con un valor diferente al predeterminado
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_NEW :Opciones con un valor diferente a las opciones de partida nueva
@ -1344,8 +1344,8 @@ STR_CONFIG_SETTING_SMOOTH_SCROLLING :Desplazamiento
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Forma en la que la vista principal se mueve a una ubicación específica al hacer clic en el minimapa o tras una orden de moverse a un objeto determinado del mapa. Si se activa, la vista se mueve de forma suave. Si se desactiva, la vista se mueve instantáneamente al sitio indicado
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Mostrar información de medidas al usar las herramientas de construcción: {STRING}
STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :Mostrar distancias en número de casillas y las diferencias de altura cuando se realicen labores de construcción
STR_CONFIG_SETTING_LIVERIES :Mostrar diseño de colores según el tipo de vehículo: {STRING}
STR_CONFIG_SETTING_LIVERIES_HELPTEXT :Controlar el uso de diseños de colores específicos para vehículos en lugar de los específicos de cada empresa
STR_CONFIG_SETTING_LIVERIES :Mostrar cromáticas por tipo de vehículo: {STRING}
STR_CONFIG_SETTING_LIVERIES_HELPTEXT :Controlar el uso de cromáticas por vehículo y no por empresa
STR_CONFIG_SETTING_LIVERIES_NONE :Ninguno
STR_CONFIG_SETTING_LIVERIES_OWN :Mi empresa
STR_CONFIG_SETTING_LIVERIES_ALL :Todas las empresas
@ -3214,7 +3214,7 @@ STR_COMPANY_VIEW_CAPTION :{WHITE}{COMPANY
STR_COMPANY_VIEW_PRESIDENT_MANAGER_TITLE :{WHITE}{PRESIDENT_NAME}{}{GOLD}(Presidente)
STR_COMPANY_VIEW_INAUGURATED_TITLE :{GOLD}Inaugurada: {WHITE}{NUM}
STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Diseño de colores:
STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Cromática:
STR_COMPANY_VIEW_VEHICLES_TITLE :{GOLD}Vehículos:
STR_COMPANY_VIEW_TRAINS :{WHITE}{COMMA} tren{P "" es}
STR_COMPANY_VIEW_ROAD_VEHICLES :{WHITE}{COMMA} vehículo{P "" s} de carretera
@ -3243,8 +3243,8 @@ STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Dar dine
STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Nueva cara
STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Elegir nueva cara para el presidente
STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Diseño de colores
STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Cambiar el diseño de colores corporativos de la empresa
STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Cromática
STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Cambiar la cromática (colores corporativos) de los vehículos
STR_COMPANY_VIEW_COMPANY_NAME_BUTTON :{BLACK}Nombre empresa
STR_COMPANY_VIEW_COMPANY_NAME_TOOLTIP :{BLACK}Cambiar el nombre de la empresa
STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON :{BLACK}Nombre presidente

@ -1372,6 +1372,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :I ffwrdd
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Sgrolio Clic-chwith: {STRING}
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Galluogi sgrolio ar y map drwy ei lusgo gyda botwm chwith y llygoden. Mae hyn yn arbennig o ddefnyddiol pan yn defnyddio sgrin-gyffwrdd ar gyfer sgrolio
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Cau ffenest wrth dde-glicio: {STRING}
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Cau ffenest wrth dde-glicio tu fewn iddo. Mae hyn yn analluogi dangos gwybodaeth ar dde-clicio!
STR_CONFIG_SETTING_AUTOSAVE :Awtogadw: {STRING}
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Dewis pa mor aml y dylid awtogadw gemau
@ -1761,6 +1763,7 @@ STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Gwirio a
STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Dangos gosodiadau AI a sgript Gêm
STR_INTRO_TOOLTIP_QUIT :{BLACK}Gadael 'OpenTTD'
STR_INTRO_BASESET :{BLACK}Mae {NUM} corlun ar goll o'r set raffeg sylfaenol a ddewiswyd. Gwiriwch am ddiweddariadau i'r set raffeg.
STR_INTRO_TRANSLATION :{BLACK}Mae'r cyfieithiad yma'n brin o {NUM} llinyn. Helpwch wella OpenTTD drwy ymaelodi fel cyfieithydd. Gweler readme.txt am fanylion.
# Quit window
@ -3098,7 +3101,7 @@ STR_STATION_LIST_STATION :{YELLOW}{STATIO
STR_STATION_LIST_WAYPOINT :{YELLOW}{WAYPOINT}
STR_STATION_LIST_NONE :{YELLOW}- Dim -
STR_STATION_LIST_SELECT_ALL_FACILITIES :{BLACK}Dewis pob cyfleuster
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Dewis pob math llwyth (gan gynnwys llwythi dim aros)
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Dewis pob math llwyth (gan gynnwys llwythi lle nad oes dim yn disgwyl)
STR_STATION_LIST_NO_WAITING_CARGO :{BLACK}Nid oes llwyth o unrhyw fath yn disgwyl
# Station view window
@ -3293,6 +3296,9 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Angen: {
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Angen: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
############ range for requires ends
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Angen:
STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING}
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} yn disgwyl{STRING}
############ range for produces starts
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Cynhyrchu: {YELLOW}{STRING}{STRING}
@ -3361,6 +3367,10 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Dileu pob cerby
STR_GROUP_RENAME_CAPTION :{BLACK}Ailenwi grŵp
STR_GROUP_PROFIT_THIS_YEAR :Elw eleni:
STR_GROUP_PROFIT_LAST_YEAR :Elw llynedd:
STR_GROUP_OCCUPANCY :Defnydd presennol:
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
# Build vehicle window
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Cerbydau Rheilffordd Newydd
@ -3393,6 +3403,7 @@ STR_PURCHASE_INFO_ALL_TYPES :Pob math o lwyt
STR_PURCHASE_INFO_ALL_BUT :Popeth ond{CARGO_LIST}
STR_PURCHASE_INFO_MAX_TE :{BLACK}Grym Tynnu Uchaf: {GOLD}{FORCE}
STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Pellter cyrhaeddiad: {GOLD}{COMMA} teil
STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Math awyren: {GOLD}{STRING}
STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Rhestr dewis trenau. Cliciwch ar gerbyd am wybodaeth. Mae Ctrl+Clicio'n toglu cuddio'r math cerbyd
STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Rhestr dewis cerbydau ffordd. Cliciwch ar gerbyd am wybodaeth. Mae Ctrl+Clicio'n toglu cuddio'r math cerbyd
@ -3527,6 +3538,10 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :trên maglef
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Côst: {CURRENCY_LONG} Pwysau: {WEIGHT_SHORT}{}Cyflymder: {VELOCITY} Pŵer: {POWER}{}Côst Rhedeg: {CURRENCY_LONG}/bl{}Gallu cludo: {CARGO_LONG}
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Cost: {CURRENCY_LONG} Pwysau: {WEIGHT_SHORT}{}Cyflymder: {VELOCITY} Pŵer: {POWER} Grym Uchaf: {6:FORCE}{}Cost Rhedeg: {4:CURRENCY_LONG}/bl{}Cynhwysedd: {5:CARGO_LONG}
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING}{}Cynhwysedd: {CARGO_LONG}, {CARGO_LONG}{}Cost rhedeg: {CURRENCY_LONG}/bl
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING}{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING} Pellter hedfan: {COMMA} teil{}Cynhwysedd: {CARGO_LONG}, {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING} Pellter hedfan: {COMMA} teil{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
# Autoreplace window
STR_REPLACE_VEHICLES_WHITE :{WHITE}Disodli {STRING} - {STRING}
@ -3649,6 +3664,8 @@ STR_VEHICLE_INFO_AGE :{COMMA} blwyddy
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} blwyddyn ({COMMA})
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}cyflymder uchaf: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Cyflym. uchaf: {LTBLUE}{VELOCITY} {BLACK}Math awyren: {LTBLUE}{STRING}
STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Cyflym. uchaf: {LTBLUE}{VELOCITY} {BLACK}Math awyren: {LTBLUE}{STRING} {BLACK}Pellter hedfan: {LTBLUE}{COMMA} teil
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Pwys: {LTBLUE}{WEIGHT_SHORT} {BLACK}Pŵer: {LTBLUE}{POWER}{BLACK} Cyflym. Max: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Pwys: {LTBLUE}{WEIGHT_SHORT} {BLACK}Pŵer: {LTBLUE}{POWER}{BLACK} Cyflym. Max: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}

@ -105,7 +105,7 @@ extern LanguageList _languages;
extern const LanguageMetadata *_current_language;
#ifdef WITH_ICU_SORT
extern Collator *_current_collator;
extern icu::Collator *_current_collator;
#endif /* WITH_ICU_SORT */
bool ReadLanguagePack(const LanguageMetadata *lang);

@ -99,7 +99,6 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
int port = GetDriverParamInt(parm, "port", -1);
#ifndef NO_DEBUG_MESSAGES
if (_debug_driver_level > 0) {
/* Print all valid output ports. */
char desc[DMUS_MAX_DESCRIPTION];
@ -116,7 +115,6 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
}
}
}
#endif
IDirectMusicPort *music_port = NULL; // NULL means 'use default port'.

@ -1976,12 +1976,12 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
if (length == 0 || number == 0) break;
if (length > statspec->lengths) {
byte diff_length = length - statspec->lengths;
statspec->platforms = ReallocT(statspec->platforms, length);
memset(statspec->platforms + statspec->lengths, 0, length - statspec->lengths);
memset(statspec->platforms + statspec->lengths, 0, diff_length);
statspec->layouts = ReallocT(statspec->layouts, length);
memset(statspec->layouts + statspec->lengths, 0,
(length - statspec->lengths) * sizeof(*statspec->layouts));
memset(statspec->layouts + statspec->lengths, 0, diff_length * sizeof(*statspec->layouts));
statspec->lengths = length;
}

@ -42,10 +42,10 @@
const NewsItem *_statusbar_news_item = NULL;
static uint MIN_NEWS_AMOUNT = 30; ///< preferred minimum amount of news messages
static uint _total_news = 0; ///< current number of news items
static NewsItem *_oldest_news = NULL; ///< head of news items queue
static NewsItem *_latest_news = NULL; ///< tail of news items queue
static uint MIN_NEWS_AMOUNT = 30; ///< preferred minimum amount of news messages
static uint _total_news = 0; ///< current number of news items
NewsItem *_oldest_news = NULL; ///< head of news items queue
static NewsItem *_latest_news = NULL; ///< tail of news items queue
/**
* Forced news item.

@ -12,7 +12,11 @@
#ifndef NEWS_GUI_H
#define NEWS_GUI_H
#include "news_type.h"
void ShowLastNewsMessage();
void ShowMessageHistory();
extern NewsItem *_oldest_news;
#endif /* NEWS_GUI_H */

@ -870,7 +870,7 @@ int openttd_main(int argc, char *argv[])
if (sounds_set == NULL && BaseSounds::ini_set != NULL) sounds_set = stredup(BaseSounds::ini_set);
if (!BaseSounds::SetSet(sounds_set)) {
if (StrEmpty(sounds_set) || !BaseSounds::SetSet(NULL)) {
usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of readme.txt.");
usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of README.md.");
} else {
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_SOUNDS_NOT_FOUND);
msg.SetDParamStr(0, sounds_set);
@ -883,7 +883,7 @@ int openttd_main(int argc, char *argv[])
if (music_set == NULL && BaseMusic::ini_set != NULL) music_set = stredup(BaseMusic::ini_set);
if (!BaseMusic::SetSet(music_set)) {
if (StrEmpty(music_set) || !BaseMusic::SetSet(NULL)) {
usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of readme.txt.");
usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of README.md.");
} else {
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_MUSIC_NOT_FOUND);
msg.SetDParamStr(0, music_set);

@ -38,4 +38,6 @@ static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
bool IsMonospaceFont(CFStringRef name);
void MacOSSetThreadName(const char *name);
#endif /* MACOS_H */

@ -14,6 +14,7 @@
#include "../../rev.h"
#include "macos.h"
#include "../../string_func.h"
#include <pthread.h>
#define Rect OTTDRect
#define Point OTTDPoint
@ -21,12 +22,26 @@
#undef Rect
#undef Point
#ifndef __clang__
#define __bridge
#endif
/*
* This file contains objective C
* Apple uses objective C instead of plain C to interact with OS specific/native functions
*/
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
typedef struct {
NSInteger majorVersion;
NSInteger minorVersion;
NSInteger patchVersion;
} OTTDOperatingSystemVersion;
#define NSOperatingSystemVersion OTTDOperatingSystemVersion
#endif
/**
* Get the version of the MacOS we are running under. Code adopted
* from http://www.cocoadev.com/index.pl?DeterminingOSVersion
@ -40,6 +55,19 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
*return_major = -1;
*return_minor = -1;
*return_bugfix = -1;
if ([[ NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion) ]) {
IMP sel = [ [ NSProcessInfo processInfo] methodForSelector:@selector(operatingSystemVersion) ];
NSOperatingSystemVersion ver = ((NSOperatingSystemVersion (*)(id, SEL))sel)([ NSProcessInfo processInfo], @selector(operatingSystemVersion));
*return_major = (int)ver.majorVersion;
*return_minor = (int)ver.minorVersion;
*return_bugfix = (int)ver.patchVersion;
return;
}
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10)
SInt32 systemVersion, version_major, version_minor, version_bugfix;
if (Gestalt(gestaltSystemVersion, &systemVersion) == noErr) {
if (systemVersion >= 0x1040) {
@ -52,6 +80,7 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
*return_bugfix = (int)GB(systemVersion, 0, 4);
}
}
#endif
}
#ifdef WITH_SDL
@ -182,7 +211,7 @@ uint GetCPUCoreCount()
uint count = 1;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
count = [ [ NSProcessInfo processInfo ] activeProcessorCount ];
count = (uint)[ [ NSProcessInfo processInfo ] activeProcessorCount ];
} else
#endif
{
@ -201,7 +230,25 @@ uint GetCPUCoreCount()
*/
bool IsMonospaceFont(CFStringRef name)
{
NSFont *font = [ NSFont fontWithName:(NSString *)name size:0.0f ];
NSFont *font = [ NSFont fontWithName:(__bridge NSString *)name size:0.0f ];
return font != NULL ? [ font isFixedPitch ] : false;
}
/**
* Set the name of the current thread for the debugger.
* @param name The new name of the current thread.
*/
void MacOSSetThreadName(const char *name)
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
if (MacOSVersionIsAtLeast(10, 6, 0)) {
pthread_setname_np(name);
}
#endif
NSThread *cur = [ NSThread currentThread ];
if (cur != NULL && [ cur respondsToSelector:@selector(setName:) ]) {
[ cur performSelector:@selector(setName:) withObject:[ NSString stringWithUTF8String:name ] ];
}
}

@ -54,6 +54,13 @@
#define MAC_OS_X_VERSION_10_9 1090
#endif
#ifndef MAC_OS_X_VERSION_10_10
#define MAC_OS_X_VERSION_10_10 101000
#endif
#ifndef MAC_OS_X_VERSION_10_11
#define MAC_OS_X_VERSION_10_11 101100
#endif
#define __STDC_LIMIT_MACROS
#include <stdint.h>

@ -79,8 +79,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,8,0,!!REVISION!!
PRODUCTVERSION 1,8,0,!!REVISION!!
FILEVERSION 1,9,0,!!ISODATE!!
PRODUCTVERSION 1,9,0,!!ISODATE!!
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L

@ -276,7 +276,6 @@ static uint NPFReservedTrackCost(AyStarNode *current)
*/
static void NPFMarkTile(TileIndex tile)
{
#ifndef NO_DEBUG_MESSAGES
if (_debug_npf_level < 1 || _networking) return;
switch (GetTileType(tile)) {
case MP_RAILWAY:
@ -297,7 +296,6 @@ static void NPFMarkTile(TileIndex tile)
default:
break;
}
#endif
}
static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)

@ -122,10 +122,8 @@ public:
{
m_veh = v;
#ifndef NO_DEBUG_MESSAGES
CPerformanceTimer perf;
perf.Start();
#endif /* !NO_DEBUG_MESSAGES */
Yapf().PfSetStartupNodes();
bool bDestFound = true;
@ -154,7 +152,6 @@ public:
bDestFound &= (m_pBestDestNode != NULL);
#ifndef NO_DEBUG_MESSAGES
perf.Stop();
if (_debug_yapf_level >= 2) {
int t = perf.Get(1000000);
@ -174,7 +171,6 @@ public:
);
}
}
#endif /* !NO_DEBUG_MESSAGES */
return bDestFound;
}

@ -26,18 +26,16 @@ bool IsReleasedVersion()
/**
* The text version of OpenTTD's revision.
* This will be either "<major>.<minor>.<build>[-RC<rc>]",
* "r<revision number>[M][-<branch>]" or "norev000".
* This will be either
* - "<tag>", like "<major>.<minor>.<build>[-RC<rc>]",
* - "<commitdate>-g<shorthash><modified>" in "master",
* - "<commitdate>-<branch>-g<shorthash><modified>" in other branches, or
* - "norev000", if the version is unknown.
*
* The major, minor and build are the numbers that describe releases of
* OpenTTD (like 0.5.3). "-RC" is used to flag release candidates.
*
* The revision number is fairly straight forward. The M is to show that
* the binary is made from modified source code. The branch shows the
* branch the revision is of and will not be there when it is trunk.
*
* norev000 is for non-releases that are made on systems without
* subversion or sources that are not a checkout of subversion.
* <modified> shows a "M", if the binary is made from modified source code.
*/
const char _openttd_revision[] = "!!VERSION!!";
@ -72,13 +70,13 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
* 24-27 minor version
* 20-23 build
* 19 1 if it is a release, 0 if it is not.
* 0-18 revision number; 0 for releases and when the revision is unknown.
* 0-18 used to be the SVN revision, currently unused
*
* The 19th bit is there so the development/betas/alpha, etc. leading to a
* final release will always have a lower version number than the released
* version, thus making comparisons on specific revisions easy.
*/
const uint32 _openttd_newgrf_version = 1 << 28 | 8 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 0 << 20 | 0 << 19;
#ifdef __MORPHOS__
/**

@ -2342,22 +2342,21 @@ bool AfterLoadGame()
/* Animated tiles would sometimes not be actually animated or
* in case of old savegames duplicate. */
extern TileIndex *_animated_tile_list;
extern uint _animated_tile_count;
extern SmallVector<TileIndex, 256> _animated_tiles;
for (uint i = 0; i < _animated_tile_count; /* Nothing */) {
for (TileIndex *tile = _animated_tiles.Begin(); tile < _animated_tiles.End(); /* Nothing */) {
/* Remove if tile is not animated */
bool remove = _tile_type_procs[GetTileType(_animated_tile_list[i])]->animate_tile_proc == NULL;
bool remove = _tile_type_procs[GetTileType(*tile)]->animate_tile_proc == NULL;
/* and remove if duplicate */
for (uint j = 0; !remove && j < i; j++) {
remove = _animated_tile_list[i] == _animated_tile_list[j];
for (TileIndex *j = _animated_tiles.Begin(); !remove && j < tile; j++) {
remove = *tile == *j;
}
if (remove) {
DeleteAnimatedTile(_animated_tile_list[i]);
DeleteAnimatedTile(*tile);
} else {
i++;
tile++;
}
}
}

@ -12,22 +12,21 @@
#include "../stdafx.h"
#include "../tile_type.h"
#include "../core/alloc_func.hpp"
#include "../core/smallvec_type.hpp"
#include "saveload.h"
#include "../safeguards.h"
extern TileIndex *_animated_tile_list;
extern uint _animated_tile_count;
extern uint _animated_tile_allocated;
extern SmallVector<TileIndex, 256> _animated_tiles;
/**
* Save the ANIT chunk.
*/
static void Save_ANIT()
{
SlSetLength(_animated_tile_count * sizeof(*_animated_tile_list));
SlArray(_animated_tile_list, _animated_tile_count, SLE_UINT32);
SlSetLength(_animated_tiles.Length() * sizeof(*_animated_tiles.Begin()));
SlArray(_animated_tiles.Begin(), _animated_tiles.Length(), SLE_UINT32);
}
/**
@ -38,22 +37,20 @@ static void Load_ANIT()
/* Before version 80 we did NOT have a variable length animated tile table */
if (IsSavegameVersionBefore(80)) {
/* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */
SlArray(_animated_tile_list, 256, IsSavegameVersionBefore(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
TileIndex anim_list[256];
SlArray(anim_list, 256, IsSavegameVersionBefore(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
if (_animated_tile_list[_animated_tile_count] == 0) break;
for (int i = 0; i < 256; i++) {
if (anim_list[i] == 0) break;
*_animated_tiles.Append() = anim_list[i];
}
return;
}
_animated_tile_count = (uint)SlGetFieldLength() / sizeof(*_animated_tile_list);
/* Determine a nice rounded size for the amount of allocated tiles */
_animated_tile_allocated = 256;
while (_animated_tile_allocated < _animated_tile_count) _animated_tile_allocated *= 2;
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, _animated_tile_allocated);
SlArray(_animated_tile_list, _animated_tile_count, SLE_UINT32);
uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin());
_animated_tiles.Clear();
_animated_tiles.Append(count);
SlArray(_animated_tiles.Begin(), count, SLE_UINT32);
}
/**

@ -28,6 +28,7 @@
#include "../engine_func.h"
#include "../company_base.h"
#include "../disaster_vehicle.h"
#include "../core/smallvec_type.hpp"
#include "saveload_internal.h"
#include "oldloader.h"
@ -490,8 +491,7 @@ static inline uint RemapOrderIndex(uint x)
return _savegame_type == SGT_TTO ? (x - 0x1AC4) / 2 : (x - 0x1C18) / 2;
}
extern TileIndex *_animated_tile_list;
extern uint _animated_tile_count;
extern SmallVector<TileIndex, 256> _animated_tiles;
extern char *_old_name_array;
static uint32 _old_town_index;
@ -640,22 +640,18 @@ static bool LoadOldOrder(LoadgameState *ls, int num)
static bool LoadOldAnimTileList(LoadgameState *ls, int num)
{
/* This is slightly hackish - we must load a chunk into an array whose
* address isn't static, but instead pointed to by _animated_tile_list.
* To achieve that, create an OldChunks list on the stack on the fly.
* The list cannot be static because the value of _animated_tile_list
* can change between calls. */
TileIndex anim_list[256];
const OldChunks anim_chunk[] = {
OCL_VAR ( OC_TILE, 256, _animated_tile_list ),
OCL_VAR ( OC_TILE, 256, anim_list ),
OCL_END ()
};
if (!LoadChunk(ls, NULL, anim_chunk)) return false;
/* Update the animated tile counter by counting till the first zero in the array */
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
if (_animated_tile_list[_animated_tile_count] == 0) break;
/* The first zero in the loaded array indicates the end of the list. */
for (int i = 0; i < 256; i++) {
if (anim_list[i] == 0) break;
*_animated_tiles.Append() = anim_list[i];
}
return true;

@ -272,7 +272,7 @@
* 194 26881 1.5.x, 1.6.0
* 195 27572 1.6.x
* 196 27778 1.7.x
* 197 27978
* 197 27978 1.8.x
*/
extern const uint16 SAVEGAME_VERSION = 197; ///< Current savegame version of OpenTTD.
const uint16 SAVEGAME_VERSION_EXT = 0x8000; ///< Savegame extension indicator mask

@ -21,15 +21,16 @@ void SQAICompany_Register(Squirrel *engine)
SQAICompany.PreRegister(engine);
SQAICompany.AddConstructor<void (ScriptCompany::*)(), 1>(engine, "x");
SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER, "CURRENT_QUARTER");
SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST, "COMPANY_FIRST");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");
SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER, "CURRENT_QUARTER");
SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST, "COMPANY_FIRST");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SPECTATOR, "COMPANY_SPECTATOR");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");
SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::IsMine, "IsMine", 2, ".i");

@ -15,6 +15,10 @@
* functions may still be available if you return an older API version
* in GetAPIVersion() in info.nut.
*
* \b 1.9.0
*
* 1.9.0 is not yet released. The following changes are not set in stone yet.
*
* \b 1.8.0
*
* 1.8.0 is not yet released. The following changes are not set in stone yet.

@ -0,0 +1,34 @@
/* $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/>.
*/
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
#include "../script_client.hpp"
#include "../template/template_client.hpp.sq"
template <> const char *GetClassName<ScriptClient, ST_GS>() { return "GSClient"; }
void SQGSClient_Register(Squirrel *engine)
{
DefSQClass<ScriptClient, ST_GS> SQGSClient("GSClient");
SQGSClient.PreRegister(engine);
SQGSClient.AddConstructor<void (ScriptClient::*)(), 1>(engine, "x");
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_INVALID, "CLIENT_INVALID");
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_SERVER, "CLIENT_SERVER");
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_FIRST, "CLIENT_FIRST");
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::ResolveClientID, "ResolveClientID", 2, ".i");
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetName, "GetName", 2, ".i");
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetCompany, "GetCompany", 2, ".i");
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetJoinDate, "GetJoinDate", 2, ".i");
SQGSClient.PostRegister(engine);
}

@ -0,0 +1,37 @@
/* $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/>.
*/
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
#include "../script_clientlist.hpp"
#include "../template/template_clientlist.hpp.sq"
template <> const char *GetClassName<ScriptClientList, ST_GS>() { return "GSClientList"; }
void SQGSClientList_Register(Squirrel *engine)
{
DefSQClass<ScriptClientList, ST_GS> SQGSClientList("GSClientList");
SQGSClientList.PreRegister(engine, "GSList");
SQGSClientList.AddConstructor<void (ScriptClientList::*)(), 1>(engine, "x");
SQGSClientList.PostRegister(engine);
}
template <> const char *GetClassName<ScriptClientList_Company, ST_GS>() { return "GSClientList_Company"; }
void SQGSClientList_Company_Register(Squirrel *engine)
{
DefSQClass<ScriptClientList_Company, ST_GS> SQGSClientList_Company("GSClientList_Company");
SQGSClientList_Company.PreRegister(engine, "GSList");
SQGSClientList_Company.AddConstructor<void (ScriptClientList_Company::*)(ScriptCompany::CompanyID company), 2>(engine, "xi");
SQGSClientList_Company.PostRegister(engine);
}

@ -27,6 +27,7 @@ void SQGSCompany_Register(Squirrel *engine)
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_SPECTATOR, "COMPANY_SPECTATOR");
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");

@ -21,7 +21,10 @@ void SQGSViewport_Register(Squirrel *engine)
SQGSViewport.PreRegister(engine);
SQGSViewport.AddConstructor<void (ScriptViewport::*)(), 1>(engine, "x");
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollTo, "ScrollTo", 2, ".i");
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollTo, "ScrollTo", 2, ".i");
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollEveryoneTo, "ScrollEveryoneTo", 2, ".i");
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollCompanyClientsTo, "ScrollCompanyClientsTo", 3, ".ii");
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollClientTo, "ScrollClientTo", 3, ".ii");
SQGSViewport.PostRegister(engine);
}

@ -15,9 +15,20 @@
* functions may still be available if you return an older API version
* in GetAPIVersion() in info.nut.
*
* \b 1.9.0
*
* 1.9.0 is not yet released. The following changes are not set in stone yet.
* API additions:
* \li GSClient
* \li GSClientList
* \li GSClientList_Company
* \li GSViewport::ScrollEveryoneTo
* \li GSViewport::ScrollCompanyClientsTo
* \li GSViewport::ScrollClientTo
*
* \b 1.8.0
*
* 1.8.0 is not yet released. The following changes are not set in stone yet.
* No changes
*
* \b 1.7.0 - 1.7.2
*

@ -0,0 +1,74 @@
/* $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 script_client.cpp Implementation of ScriptClient. */
#include "../../stdafx.h"
#include "script_client.hpp"
#include "../../network/network.h"
#include "../../network/network_base.h"
#include "../../safeguards.h"
#ifdef ENABLE_NETWORK
/**
* Finds NetworkClientInfo given client-identifier,
* is used by other methods to resolve client-identifier.
* @param client The client to get info structure for
* @return A pointer to corresponding CI struct or NULL when not found.
*/
static NetworkClientInfo *FindClientInfo(ScriptClient::ClientID client)
{
if (client == ScriptClient::CLIENT_INVALID) return NULL;
if (!_networking) return NULL;
return NetworkClientInfo::GetByClientID((::ClientID)client);
}
#endif
/* static */ ScriptClient::ClientID ScriptClient::ResolveClientID(ScriptClient::ClientID client)
{
#ifdef ENABLE_NETWORK
return (FindClientInfo(client) == NULL ? ScriptClient::CLIENT_INVALID : client);
#else
return CLIENT_INVALID;
#endif
}
/* static */ char *ScriptClient::GetName(ScriptClient::ClientID client)
{
#ifdef ENABLE_NETWORK
NetworkClientInfo *ci = FindClientInfo(client);
if (ci == NULL) return NULL;
return stredup(ci->client_name);
#else
return NULL;
#endif
}
/* static */ ScriptCompany::CompanyID ScriptClient::GetCompany(ScriptClient::ClientID client)
{
#ifdef ENABLE_NETWORK
NetworkClientInfo *ci = FindClientInfo(client);
if (ci == NULL) return ScriptCompany::COMPANY_INVALID;
return (ScriptCompany::CompanyID)ci->client_playas;
#else
return ScriptCompany::COMPANY_INVALID;
#endif
}
/* static */ ScriptDate::Date ScriptClient::GetJoinDate(ScriptClient::ClientID client)
{
#ifdef ENABLE_NETWORK
NetworkClientInfo *ci = FindClientInfo(client);
if (ci == NULL) return ScriptDate::DATE_INVALID;
return (ScriptDate::Date)ci->join_date;
#else
return ScriptDate::DATE_INVALID;
#endif
}

@ -0,0 +1,70 @@
/* $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 script_client.hpp Everything to query a network client's information */
#ifndef SCRIPT_CLIENT_HPP
#define SCRIPT_CLIENT_HPP
#include "script_text.hpp"
#include "script_date.hpp"
#include "script_company.hpp"
#include "../../network/network_type.h"
/**
* Class that handles all client related functions.
*
* @api game
*/
class ScriptClient : public ScriptObject {
public:
/** Different constants related to ClientID. */
enum ClientID {
CLIENT_INVALID = 0, ///< Client is not part of anything
CLIENT_SERVER = 1, ///< Servers always have this ID
CLIENT_FIRST = 2, ///< The first client ID
};
/**
* Resolves the given client id to the correct index for the client.
* If the client with the given id does not exist it will
* return CLIENT_INVALID.
* @param client The client id to resolve.
* @return The resolved client id.
*/
static ClientID ResolveClientID(ClientID client);
/**
* Get the name of the given client.
* @param client The client to get the name for.
* @pre ResolveClientID(client) != CLIENT_INVALID.
* @return The name of the given client.
*/
static char *GetName(ClientID client);
/**
* Get the company in which the given client is playing.
* @param client The client to get company for.
* @pre ResolveClientID(client) != CLIENT_INVALID.
* @return The company in which client is playing or COMPANY_SPECTATOR.
*/
static ScriptCompany::CompanyID GetCompany(ClientID client);
/**
* Get the game date when the given client has joined.
* @param client The client to get joining date for.
* @pre ResolveClientID(client) != CLIENT_INVALID.
* @return The date when client has joined.
*/
static ScriptDate::Date GetJoinDate(ClientID client);
};
#endif /* SCRIPT_CLIENT_HPP */

@ -0,0 +1,49 @@
/* $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 script_clientlist.cpp Implementation of ScriptClientList and friends. */
#include "../../stdafx.h"
#include "script_company.hpp"
#include "script_clientlist.hpp"
#include "../../network/network.h"
#include "../../network/network_base.h"
#include "../../safeguards.h"
ScriptClientList::ScriptClientList()
{
#ifdef ENABLE_NETWORK
if (!_networking) return;
NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
this->AddItem(ci->client_id);
}
#endif
}
ScriptClientList_Company::ScriptClientList_Company(ScriptCompany::CompanyID company)
{
#ifdef ENABLE_NETWORK
if (!_networking) return;
CompanyID c;
if (company == ScriptCompany::COMPANY_SPECTATOR) {
c = ::COMPANY_SPECTATOR;
} else {
company = ScriptCompany::ResolveCompanyID(company);
if (company == ScriptCompany::COMPANY_INVALID) return;
c = (CompanyID)company;
}
NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
if (ci->client_playas == c) this->AddItem(ci->client_id);
}
#endif
}

@ -0,0 +1,42 @@
/* $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 script_clientlist.hpp List all the TODO. */
#ifndef SCRIPT_CLIENTLIST_HPP
#define SCRIPT_CLIENTLIST_HPP
#include "script_list.hpp"
#include "script_company.hpp"
/**
* Creates a list of clients that are currently in game.
* @api game
* @ingroup ScriptList
*/
class ScriptClientList : public ScriptList {
public:
ScriptClientList();
};
/**
* Creates a list of clients that are playing in the company.
* @api game
* @ingroup ScriptList
*/
class ScriptClientList_Company : public ScriptList {
public:
/**
* @param company_id The company to list clients for.
*/
ScriptClientList_Company(ScriptCompany::CompanyID company);
};
#endif /* SCRIPT_CIENTLIST_HPP */

@ -30,12 +30,13 @@ public:
/** Different constants related to CompanyID. */
enum CompanyID {
/* Note: these values represent part of the in-game Owner enum */
COMPANY_FIRST = ::COMPANY_FIRST, ///< The first available company.
COMPANY_LAST = ::MAX_COMPANIES, ///< The last available company.
COMPANY_FIRST = ::COMPANY_FIRST, ///< The first available company.
COMPANY_LAST = ::MAX_COMPANIES, ///< The last available company.
/* Custom added value, only valid for this API */
COMPANY_INVALID = -1, ///< An invalid company.
COMPANY_SELF = 254, ///< Constant that gets resolved to the correct company index for your company.
COMPANY_INVALID = -1, ///< An invalid company.
COMPANY_SELF = 254, ///< Constant that gets resolved to the correct company index for your company.
COMPANY_SPECTATOR = 255, ///< Constant indicating that player is spectating (gets resolved to COMPANY_INVALID)
};
/** Possible genders for company presidents. */

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

Loading…
Cancel
Save