mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-13 09:39:10 +00:00
Compare commits
48 Commits
1.9.0-beta
...
0.6.2
Author | SHA1 | Date | |
---|---|---|---|
|
4729a88e52 | ||
|
5f7f86e3be | ||
|
9878c58727 | ||
|
39f8e1085f | ||
|
467de8942b | ||
|
6054758c1d | ||
|
22cda2f1b8 | ||
|
a0f6275c3a | ||
|
c29c7f7932 | ||
|
6097389437 | ||
|
bafea078f2 | ||
|
5c97e3307c | ||
|
3cd7a5959f | ||
|
7da596b92d | ||
|
fbbd7bef6d | ||
|
b95eb99c55 | ||
|
a68eee5f31 | ||
|
4f76d929c6 | ||
|
94ae5be42a | ||
|
808f15e43f | ||
|
71144d1a98 | ||
|
44a476c946 | ||
|
76a2221dbb | ||
|
966c2fe4b9 | ||
|
f4d1d082ab | ||
|
391127bfaf | ||
|
ee7bad769f | ||
|
9e966f9cd0 | ||
|
942a752e2a | ||
|
9e03a7b23a | ||
|
e114133d18 | ||
|
9241c4649d | ||
|
f126c2e66f | ||
|
c973bd87ce | ||
|
4cb6a89e81 | ||
|
7bf1737a66 | ||
|
fb0afc9cca | ||
|
9f65c1b8f0 | ||
|
1a495b0b1c | ||
|
5294075ad4 | ||
|
ed4ae53e8a | ||
|
c53f9fc2a2 | ||
|
cbd426059e | ||
|
624549464f | ||
|
1f9dce4697 | ||
|
185c30b6bf | ||
|
8df7a53652 | ||
|
9d47454105 |
@@ -1,13 +0,0 @@
|
||||
notifications:
|
||||
push:
|
||||
irc:
|
||||
- openttd
|
||||
- openttd.notice
|
||||
pull-request:
|
||||
irc:
|
||||
- openttd
|
||||
- openttd.notice
|
||||
issue:
|
||||
irc:
|
||||
- openttd
|
||||
- openttd.notice
|
@@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{c,cpp,h,hpp}]
|
||||
indent_style = tab
|
||||
charset = utf-8
|
7
.github/ISSUE_TEMPLATE.md
vendored
7
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,7 +0,0 @@
|
||||
## Version of OpenTTD
|
||||
|
||||
## Expected result
|
||||
|
||||
## Actual result
|
||||
|
||||
## Steps to reproduce
|
34
.github/stale.yml
vendored
34
.github/stale.yml
vendored
@@ -1,34 +0,0 @@
|
||||
daysUntilClose: 7
|
||||
staleLabel: stale
|
||||
closeComment: false
|
||||
exemptMilestones: true
|
||||
exemptAssignees: true
|
||||
|
||||
issues:
|
||||
daysUntilStale: 60
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- "good first issue"
|
||||
- regression
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had any activity in the last two months.
|
||||
|
||||
If you believe the issue is still relevant, please test on the latest nightly and report back.
|
||||
|
||||
It will be closed if no further activity occurs within 7 days.
|
||||
|
||||
Thank you for your contributions.
|
||||
|
||||
pulls:
|
||||
daysUntilStale: 30
|
||||
exemptLabels:
|
||||
- pinned
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not had any activity in the last month.
|
||||
|
||||
Please feel free to give a status update now, ping for review, or re-open when it's ready.
|
||||
|
||||
It will be closed if no further activity occurs within 7 days.
|
||||
|
||||
Thank you for your contributions.
|
57
.gitignore
vendored
57
.gitignore
vendored
@@ -1,52 +1,11 @@
|
||||
Makefile*
|
||||
bin/*
|
||||
!bin/ai
|
||||
bin/ai/*
|
||||
!bin/ai/compat*.nut
|
||||
!bin/ai/regression
|
||||
!bin/data
|
||||
bin/baseset/*
|
||||
!bin/baseset/openttd.grf
|
||||
!bin/baseset/opntitle.dat
|
||||
!bin/baseset/orig_extra.grf
|
||||
!bin/baseset/orig_*.obg
|
||||
!bin/baseset/orig_*.obs
|
||||
!bin/baseset/no_sound.obs
|
||||
!bin/baseset/no_music.obm
|
||||
!bin/baseset/orig_*.obm
|
||||
!bin/scripts
|
||||
bin/scripts/*
|
||||
!bin/scripts/*.example
|
||||
!bin/scripts/readme.txt
|
||||
|
||||
*.aps
|
||||
bundle/*
|
||||
bundles/*
|
||||
docs/aidocs/*
|
||||
docs/gamedocs/*
|
||||
docs/source/*
|
||||
.kdev4
|
||||
.kdev4/*
|
||||
*.kdev4
|
||||
media/openttd.desktop
|
||||
media/openttd.desktop.install
|
||||
!bin/data/chars.grf
|
||||
!bin/data/openttdd.grf
|
||||
!bin/data/openttdw.grf
|
||||
!bin/data/opntitle.grf
|
||||
!bin/scenario/README
|
||||
!bin/scripts*
|
||||
config.*
|
||||
objs/*
|
||||
projects/.vs
|
||||
projects/Debug
|
||||
projects/Release
|
||||
projects/*.ncb
|
||||
projects/*.suo
|
||||
projects/*.sdf
|
||||
projects/*.opensdf
|
||||
projects/*.vcproj.*.user
|
||||
projects/*.vcxproj.user
|
||||
projects/*.VC.db
|
||||
projects/*.VC.opendb
|
||||
src/rev.cpp
|
||||
src/os/windows/ottdres.rc
|
||||
|
||||
/Makefile*
|
||||
!/Makefile.msvc
|
||||
/config.*
|
||||
!/config.lib
|
||||
!*.in
|
||||
*.tmp
|
||||
|
34
.hgignore
34
.hgignore
@@ -1,34 +0,0 @@
|
||||
syntax: glob
|
||||
|
||||
.svn
|
||||
*.aps
|
||||
bin/baseset/openttd.32.bmp
|
||||
bin/lang/*
|
||||
bin/openttd*
|
||||
bin/*.cfg
|
||||
bundle/*
|
||||
bundles/*
|
||||
config.cache*
|
||||
config.log
|
||||
config.pwd
|
||||
docs/aidocs/*
|
||||
docs/gamedocs/*
|
||||
docs/source/*
|
||||
.kdev4
|
||||
.kdev4/*
|
||||
*.kdev4
|
||||
Makefile
|
||||
Makefile.am
|
||||
Makefile.bundle
|
||||
media/openttd.desktop
|
||||
media/openttd.desktop.install
|
||||
objs/*
|
||||
projects/.vs
|
||||
projects/*.ncb
|
||||
projects/*.suo
|
||||
projects/*.sdf
|
||||
projects/*.opensdf
|
||||
projects/*.vcproj.*.user
|
||||
projects/*.vcxproj.user
|
||||
src/rev.cpp
|
||||
src/os/windows/ottdres.rc
|
181
CONTRIBUTING.md
181
CONTRIBUTING.md
@@ -1,181 +0,0 @@
|
||||
|
||||
# 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 ../../../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).
|
||||
|
||||
### Privacy Notice
|
||||
|
||||
We would like to make you aware that contributing to OpenTTD via git will permanently store the name and email address you provide as well as the actual changes and the time and date you made it inside git's version history.
|
||||
|
||||
This is inevitable, because it is a main feature of git. If you are concerned about your privacy, we strongly recommend to use "Anonymous <anonymous@openttd.org>" as the git commit author. We might refuse anonymous contributions if malicious intent is suspected.
|
||||
|
||||
Please note that the contributor identity, once given, is used for copyright verification and to provide proof should a malicious commit be made. As such, the [EU GDPR](https://www.eugdpr.org/key-changes.html) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
|
||||
|
||||
Please also note that your commit is public and as such will potentially be processed by many third-parties. Git's distributed nature makes it impossible to track where exactly your commit, and thus your personal data, will be stored and be processed. If you would not like to accept this risk, please do either commit anonymously or refrain from contributing to the OpenTTD project.
|
||||
|
||||
### 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.
|
||||
The GDPR notice is adapted from [rsyslog](https://github.com/rsyslog/rsyslog/blob/master/CONTRIBUTING.md) under the [GNU General Public License](https://github.com/rsyslog/rsyslog/blob/master/COPYING).
|
4
COPYING
4
COPYING
@@ -1,7 +1,3 @@
|
||||
This is the license which applies to OpenTTD with the exception of some
|
||||
3rd party modules. See README.md for details
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
194
Doxyfile
194
Doxyfile
@@ -1,21 +1,9 @@
|
||||
# $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/>.
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = OpenTTD
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_LOGO =
|
||||
PROJECT_NAME = openttd
|
||||
OUTPUT_DIRECTORY = docs/source/
|
||||
CREATE_SUBDIRS = YES
|
||||
ALLOW_UNICODE_NAMES = NO
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
@@ -37,42 +25,23 @@ STRIP_FROM_PATH = ./
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 2
|
||||
ALIASES =
|
||||
TCL_SUBST =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
EXTENSION_MAPPING =
|
||||
MARKDOWN_SUPPORT = YES
|
||||
TOC_INCLUDE_HEADINGS = 0
|
||||
AUTOLINK_SUPPORT = YES
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
IDL_PROPERTY_SUPPORT = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
GROUP_NESTED_COMPOUNDS = NO
|
||||
SUBGROUPING = YES
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_PACKAGE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = YES
|
||||
EXTRACT_ANON_NSPACES = YES
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
@@ -80,17 +49,11 @@ HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
HIDE_COMPOUND_REFERENCE= NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
SHOW_GROUPED_MEMB_INC = NO
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
STRICT_PROTO_MATCHING = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
@@ -98,69 +61,58 @@ GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE =
|
||||
CITE_BIB_FILES =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to warning and progress messages
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_AS_ERROR = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the input files
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ./src/
|
||||
INPUT_ENCODING = UTF-8
|
||||
INPUT = ./
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.h \
|
||||
*.hpp
|
||||
*.hpp \
|
||||
table/*.h
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = */3rdparty \
|
||||
*/script/api
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH = ./docs/
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to source browsing
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the alphabetical class index
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the HTML output
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
@@ -168,58 +120,19 @@ HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
HTML_EXTRA_FILES =
|
||||
HTML_COLORSTYLE_HUE = 220
|
||||
HTML_COLORSTYLE_SAT = 100
|
||||
HTML_COLORSTYLE_GAMMA = 80
|
||||
HTML_TIMESTAMP = NO
|
||||
HTML_DYNAMIC_MENUS = YES
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
HTML_INDEX_NUM_ENTRIES = 100
|
||||
GENERATE_DOCSET = NO
|
||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
||||
DOCSET_PUBLISHER_NAME = Publisher
|
||||
GENERATE_HTMLHELP = NO
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = YES
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
CHM_INDEX_ENCODING =
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = YES
|
||||
GENERATE_QHP = NO
|
||||
QCH_FILE =
|
||||
QHP_NAMESPACE = org.doxygen.Project
|
||||
QHP_VIRTUAL_FOLDER = doc
|
||||
QHP_CUST_FILTER_NAME =
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
QHG_LOCATION =
|
||||
GENERATE_ECLIPSEHELP = NO
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
DISABLE_INDEX = NO
|
||||
GENERATE_TREEVIEW = YES
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 250
|
||||
EXT_LINKS_IN_WINDOW = NO
|
||||
FORMULA_FONTSIZE = 10
|
||||
FORMULA_TRANSPARENT = YES
|
||||
USE_MATHJAX = NO
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_CODEFILE =
|
||||
SEARCHENGINE = NO
|
||||
SERVER_BASED_SEARCH = NO
|
||||
EXTERNAL_SEARCH = NO
|
||||
SEARCHENGINE_URL =
|
||||
SEARCHDATA_FILE = searchdata.xml
|
||||
EXTERNAL_SEARCH_ID =
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the LaTeX output
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
@@ -229,18 +142,12 @@ COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
LATEX_FOOTER =
|
||||
LATEX_EXTRA_STYLESHEET =
|
||||
LATEX_EXTRA_FILES =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
LATEX_SOURCE_CODE = NO
|
||||
LATEX_BIB_STYLE = plain
|
||||
LATEX_TIMESTAMP = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the RTF output
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
@@ -248,33 +155,27 @@ COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
RTF_SOURCE_CODE = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the man page output
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
GENERATE_MAN = YES
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_SUBDIR =
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the XML output
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the DOCBOOK output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_DOCBOOK = NO
|
||||
DOCBOOK_OUTPUT = docbook
|
||||
DOCBOOK_PROGRAMLISTING = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options for the AutoGen Definitions output
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the Perl module output
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
@@ -289,67 +190,42 @@ EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = ENABLE_NETWORK \
|
||||
WITH_ZLIB \
|
||||
WITH_LZO \
|
||||
WITH_LZMA \
|
||||
WITH_SDL \
|
||||
WITH_PNG \
|
||||
WITH_FONTCONFIG \
|
||||
WITH_FREETYPE \
|
||||
WITH_ICU_SORT \
|
||||
WITH_ICU_LAYOUT \
|
||||
UNICODE \
|
||||
_UNICODE \
|
||||
_GNU_SOURCE \
|
||||
FINAL=
|
||||
EXPAND_AS_DEFINED =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED = DEF_COMMAND
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to external references
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = objs/openttd.tag
|
||||
GENERATE_TAGFILE = openttd.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
EXTERNAL_PAGES = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
MSCGEN_PATH =
|
||||
DIA_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
DOT_NUM_THREADS = 0
|
||||
DOT_FONTNAME = Helvetica
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_FONTPATH =
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
UML_LIMIT_NUM_FIELDS = 10
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
INTERACTIVE_SVG = NO
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MSCFILE_DIRS =
|
||||
DIAFILE_DIRS =
|
||||
PLANTUML_JAR_PATH =
|
||||
PLANTUML_CFG_FILE =
|
||||
PLANTUML_INCLUDE_PATH =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
|
@@ -1,229 +0,0 @@
|
||||
# $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/>.
|
||||
|
||||
#
|
||||
# Creation of bundles
|
||||
#
|
||||
|
||||
# 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")
|
||||
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
|
||||
|
||||
# Make sure we have something in VERSION
|
||||
ifeq ($(VERSION),)
|
||||
VERSION := norev000
|
||||
endif
|
||||
|
||||
ifndef BUNDLE_NAME
|
||||
BUNDLE_NAME = openttd-custom-$(VERSION)-$(OS)
|
||||
endif
|
||||
|
||||
# An OSX application bundle needs the data files, lang files and openttd executable in a different location.
|
||||
ifdef OSXAPP
|
||||
AI_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/ai
|
||||
GAME_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/game
|
||||
BASESET_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/baseset
|
||||
LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
|
||||
TTD_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
|
||||
else
|
||||
AI_DIR = $(BUNDLE_DIR)/ai
|
||||
GAME_DIR = $(BUNDLE_DIR)/game
|
||||
BASESET_DIR = $(BUNDLE_DIR)/baseset
|
||||
LANG_DIR = $(BUNDLE_DIR)/lang
|
||||
TTD_DIR = $(BUNDLE_DIR)
|
||||
endif
|
||||
|
||||
bundle: all
|
||||
@echo '[BUNDLE] Constructing bundle'
|
||||
$(Q)rm -rf "$(BUNDLE_DIR)"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/docs"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/media"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/scripts"
|
||||
$(Q)mkdir -p "$(TTD_DIR)"
|
||||
$(Q)mkdir -p "$(AI_DIR)"
|
||||
$(Q)mkdir -p "$(GAME_DIR)"
|
||||
$(Q)mkdir -p "$(BASESET_DIR)"
|
||||
$(Q)mkdir -p "$(LANG_DIR)"
|
||||
ifdef OSXAPP
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources"
|
||||
$(Q)echo "APPL????" > "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo"
|
||||
$(Q)cp "$(ROOT_DIR)/os/macosx/openttd.icns" "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns"
|
||||
$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "$(BUNDLE_DIR)/$(OSXAPP)" "$(VERSION)"
|
||||
$(Q)cp "$(ROOT_DIR)/os/macosx/splash.png" "$(BASESET_DIR)"
|
||||
endif
|
||||
ifeq ($(OS),UNIX)
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.32.bmp" "$(BASESET_DIR)/"
|
||||
endif
|
||||
$(Q)cp "$(BIN_DIR)/$(TTD)" "$(TTD_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/ai/"compat_*.nut "$(AI_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/game/"compat_*.nut "$(GAME_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/baseset/"*.grf "$(BASESET_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/baseset/"*.obg "$(BASESET_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/baseset/"*.obs "$(BASESET_DIR)/"
|
||||
$(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.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/"
|
||||
$(Q)cp "$(ROOT_DIR)/changelog.txt" "$(BUNDLE_DIR)/"
|
||||
ifdef MAN_DIR
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/man/"
|
||||
$(Q)cp "$(ROOT_DIR)/docs/openttd.6" "$(BUNDLE_DIR)/man/"
|
||||
$(Q)gzip -9 "$(BUNDLE_DIR)/man/openttd.6"
|
||||
endif
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.32.xpm" "$(BUNDLE_DIR)/media/"
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd."*.png "$(BUNDLE_DIR)/media/"
|
||||
$(Q)cp "$(BIN_DIR)/scripts/"* "$(BUNDLE_DIR)/scripts/"
|
||||
ifdef MENU_DIR
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.desktop" "$(BUNDLE_DIR)/media/"
|
||||
$(Q)$(AWK) -f "$(ROOT_DIR)/media/openttd.desktop.translation.awk" "$(SRC_DIR)/lang/"*.txt | LC_ALL=C $(SORT) | $(AWK) -f "$(ROOT_DIR)/media/openttd.desktop.filter.awk" >> "$(BUNDLE_DIR)/media/openttd.desktop"
|
||||
$(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.md" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
|
||||
ifeq ($(OS), DOS)
|
||||
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
|
||||
ifndef STRIP
|
||||
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.exe" "$(TTD_DIR)/"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
### Packing the current bundle into several compressed file formats ###
|
||||
#
|
||||
# Zips & dmgs do not contain a root folder, i.e. they have files in the root of the zip/dmg.
|
||||
# gzip, bzip2 and lha archives have a root folder, with the same name as the bundle.
|
||||
#
|
||||
# One can supply a custom name by adding BUNDLE_NAME:=<name> to the make command.
|
||||
#
|
||||
bundle_zip: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).zip'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)"
|
||||
$(Q)cd "$(BUNDLE_DIR)" && zip -r $(shell if test -z "$(VERBOSE)"; then echo '-q'; fi) "$(BUNDLES_DIR)/$(BUNDLE_NAME).zip" .
|
||||
|
||||
bundle_7z: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).7z'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)"
|
||||
$(Q)cd "$(BUNDLE_DIR)" && 7z a "$(BUNDLES_DIR)/$(BUNDLE_NAME).7z" .
|
||||
|
||||
bundle_gzip: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.gz'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.gzip/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.gzip/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.gzip" && tar -zc$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.gz" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.gzip"
|
||||
|
||||
bundle_bzip2: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.bz2'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.bzip2/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.bzip2/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.bzip2" && tar -jc$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.bz2" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.bzip2"
|
||||
|
||||
bundle_lzma: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.lzma'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.lzma/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.lzma/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.lzma" && tar --lzma -c$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.lzma" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.lzma"
|
||||
|
||||
bundle_xz: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.xz'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.xz/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.xz/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.xz" && tar --xz -c$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.xz" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.xz"
|
||||
|
||||
bundle_lha: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).lha'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.lha/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.lha/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.lha" && lha ao6 "$(BUNDLES_DIR)/$(BUNDLE_NAME).lha" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.lha"
|
||||
|
||||
bundle_dmg: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).dmg'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
|
||||
$(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(VERSION)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg"
|
||||
$(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
|
||||
|
||||
bundle_exe: all
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).exe'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)"
|
||||
$(Q)unix2dos "$(ROOT_DIR)/docs/"*.txt "$(ROOT_DIR)/README.md" "$(ROOT_DIR)/COPYING" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt"
|
||||
$(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"
|
||||
|
||||
ifdef OSXAPP
|
||||
install:
|
||||
@echo '[INSTALL] Cannot install the OSX Application Bundle'
|
||||
else
|
||||
install: bundle
|
||||
@echo '[INSTALL] Installing OpenTTD'
|
||||
$(Q)install -d "$(INSTALL_BINARY_DIR)"
|
||||
$(Q)install -d "$(INSTALL_ICON_DIR)"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/ai"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/game"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/baseset"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/lang"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/scripts"
|
||||
ifeq ($(TTD), openttd.exe)
|
||||
$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)/${BINARY_NAME}.exe"
|
||||
else
|
||||
$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)/${BINARY_NAME}"
|
||||
endif
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/ai/"* "$(INSTALL_DATA_DIR)/ai"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/game/"* "$(INSTALL_DATA_DIR)/game"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/baseset/"* "$(INSTALL_DATA_DIR)/baseset"
|
||||
$(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.md" "$(BUNDLE_DIR)/known-bugs.txt" "$(INSTALL_DOC_DIR)"
|
||||
endif
|
||||
ifndef DO_NOT_INSTALL_CHANGELOG
|
||||
$(Q)install -d "$(INSTALL_DOC_DIR)"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/changelog.txt" "$(INSTALL_DOC_DIR)"
|
||||
endif
|
||||
ifndef DO_NOT_INSTALL_LICENSE
|
||||
$(Q)install -d "$(INSTALL_DOC_DIR)"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/COPYING" "$(INSTALL_DOC_DIR)"
|
||||
endif
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.xpm" "$(INSTALL_ICON_DIR)/${BINARY_NAME}.32.xpm"
|
||||
ifdef ICON_THEME_DIR
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/16x16/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.16.png" "$(INSTALL_ICON_THEME_DIR)/16x16/apps/${BINARY_NAME}.png"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/32x32/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.png" "$(INSTALL_ICON_THEME_DIR)/32x32/apps/${BINARY_NAME}.png"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/48x48/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.48.png" "$(INSTALL_ICON_THEME_DIR)/48x48/apps/${BINARY_NAME}.png"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/64x64/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.64.png" "$(INSTALL_ICON_THEME_DIR)/64x64/apps/${BINARY_NAME}.png"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/128x128/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.128.png" "$(INSTALL_ICON_THEME_DIR)/128x128/apps/${BINARY_NAME}.png"
|
||||
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/256x256/apps"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.256.png" "$(INSTALL_ICON_THEME_DIR)/256x256/apps/${BINARY_NAME}.png"
|
||||
else
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/"*.png "$(INSTALL_ICON_DIR)"
|
||||
endif
|
||||
ifdef MAN_DIR
|
||||
ifndef DO_NOT_INSTALL_MAN
|
||||
$(Q)install -d "$(INSTALL_MAN_DIR)"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6.gz" "$(INSTALL_MAN_DIR)/${BINARY_NAME}.6.gz"
|
||||
endif
|
||||
endif
|
||||
ifdef MENU_DIR
|
||||
$(Q)install -d "$(INSTALL_MENU_DIR)"
|
||||
$(Q)install -m 644 "$(ROOT_DIR)/media/openttd.desktop.install" "$(INSTALL_MENU_DIR)/${BINARY_NAME}.desktop"
|
||||
endif
|
||||
endif # OSXAPP
|
118
Makefile.grf.in
118
Makefile.grf.in
@@ -1,118 +0,0 @@
|
||||
# $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/>.
|
||||
#
|
||||
# Building requires GRFCodec.
|
||||
#
|
||||
# Recent versions (including sources) can be found at:
|
||||
# http://www.openttd.org/download-grfcodec
|
||||
#
|
||||
# The mercurial repository can be found at:
|
||||
# http://hg.openttdcoop.org/grfcodec
|
||||
#
|
||||
|
||||
|
||||
ROOT_DIR = !!ROOT_DIR!!
|
||||
GRF_DIR = $(ROOT_DIR)/media/extra_grf
|
||||
BASESET_DIR = $(ROOT_DIR)/media/baseset
|
||||
LANG_DIR = $(ROOT_DIR)/src/lang
|
||||
BIN_DIR = !!BIN_DIR!!/baseset
|
||||
OBJS_DIR = !!GRF_OBJS_DIR!!
|
||||
OS = !!OS!!
|
||||
STAGE = !!STAGE!!
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
Q =
|
||||
E = @true
|
||||
else
|
||||
Q = @
|
||||
E = @echo
|
||||
endif
|
||||
|
||||
GRFCODEC := !!GRFCODEC!!
|
||||
NFORENUM := !!NFORENUM!!
|
||||
CC_BUILD := !!CC_BUILD!!
|
||||
MD5SUM := $(shell [ "$(OS)" = "OSX" ] && echo "md5 -r" || echo "md5sum")
|
||||
|
||||
# Some "should not be changed" settings.
|
||||
NFO_FILES := $(GRF_DIR)/*.nfo $(GRF_DIR)/rivers/*.nfo
|
||||
PNG_FILES := $(GRF_DIR)/*.png $(GRF_DIR)/rivers/*.png
|
||||
|
||||
# List of target files.
|
||||
OBT_FILES := $(BIN_DIR)/orig_dos.obg
|
||||
OBT_FILES += $(BIN_DIR)/orig_dos_de.obg
|
||||
OBT_FILES += $(BIN_DIR)/orig_win.obg
|
||||
OBT_FILES += $(BIN_DIR)/orig_dos.obs
|
||||
OBT_FILES += $(BIN_DIR)/orig_win.obs
|
||||
OBT_FILES += $(BIN_DIR)/no_sound.obs
|
||||
OBT_FILES += $(BIN_DIR)/orig_dos.obm
|
||||
OBT_FILES += $(BIN_DIR)/orig_win.obm
|
||||
OBT_FILES += $(BIN_DIR)/no_music.obm
|
||||
OBT_FILES += $(BIN_DIR)/orig_tto.obm
|
||||
|
||||
# Build the GRF.
|
||||
all: $(OBT_FILES)
|
||||
ifdef GRFCODEC
|
||||
all: $(BIN_DIR)/openttd.grf $(BIN_DIR)/orig_extra.grf
|
||||
endif
|
||||
|
||||
$(OBJS_DIR)/langfiles.tmp: $(LANG_DIR)/*.txt
|
||||
$(E) '$(STAGE) Collecting baseset translations'
|
||||
$(Q) cat $^ > $@
|
||||
|
||||
$(BIN_DIR)/%.obg: $(BASESET_DIR)/%.obg $(BIN_DIR)/orig_extra.grf $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
|
||||
$(E) '$(STAGE) Updating $(notdir $@)'
|
||||
$(Q) sed 's/^ORIG_EXTRA.GRF = *[0-9a-f]*$$/ORIG_EXTRA.GRF = '`$(MD5SUM) $(BIN_DIR)/orig_extra.grf | sed 's@ .*@@'`'/' $< > $@.tmp
|
||||
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $@.tmp >$@
|
||||
$(Q) rm $@.tmp
|
||||
|
||||
$(BIN_DIR)/%.obs: $(BASESET_DIR)/%.obs $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
|
||||
$(E) '$(STAGE) Updating $(notdir $@)'
|
||||
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@
|
||||
|
||||
$(BIN_DIR)/%.obm: $(BASESET_DIR)/%.obm $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
|
||||
$(E) '$(STAGE) Updating $(notdir $@)'
|
||||
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@
|
||||
|
||||
# Guard against trying to run GRFCODEC/NFORENUM without either being set.
|
||||
ifdef GRFCODEC
|
||||
ifdef NFORENUM
|
||||
|
||||
# Compile extra grf
|
||||
$(BIN_DIR)/openttd.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk
|
||||
$(E) '$(STAGE) Assembling openttd.nfo'
|
||||
$(Q)-mkdir -p $(OBJS_DIR)/sprites
|
||||
$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
|
||||
$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/openttd.nfo > $(OBJS_DIR)/sprites/openttd.nfo
|
||||
$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/openttd.nfo
|
||||
$(E) '$(STAGE) Compiling openttd.grf'
|
||||
$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/openttd.grf
|
||||
$(Q)cp $(OBJS_DIR)/openttd.grf $(BIN_DIR)/openttd.grf
|
||||
|
||||
# The copy operation of PNG_FILES is duplicated from the target 'openttd.grf', thus those targets may not run in parallel.
|
||||
$(BIN_DIR)/orig_extra.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk | $(BIN_DIR)/openttd.grf
|
||||
$(E) '$(STAGE) Assembling orig_extra.nfo'
|
||||
$(Q)-mkdir -p $(OBJS_DIR)/sprites
|
||||
$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
|
||||
$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/orig_extra.nfo > $(OBJS_DIR)/sprites/orig_extra.nfo
|
||||
$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/orig_extra.nfo
|
||||
$(E) '$(STAGE) Compiling orig_extra.grf'
|
||||
$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/orig_extra.grf
|
||||
$(Q)cp $(OBJS_DIR)/orig_extra.grf $(BIN_DIR)/orig_extra.grf
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
# Clean up temporary files.
|
||||
clean:
|
||||
$(Q)rm -f *.bak *.grf $(OBT_FILES)
|
||||
|
||||
# Clean up temporary files
|
||||
mrproper: clean
|
||||
$(Q)rm -fr sprites
|
||||
|
||||
.PHONY: all mrproper depend clean
|
237
Makefile.in
237
Makefile.in
@@ -1,9 +1,4 @@
|
||||
# $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/>.
|
||||
# Auto-generated file -- DO NOT EDIT
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
@@ -14,46 +9,35 @@ endif
|
||||
|
||||
include Makefile.am
|
||||
|
||||
CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
|
||||
SOURCE_LIST = !!SOURCE_LIST!!
|
||||
CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACHE_SOURCE_LIST!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
ICON_THEME_DIR = !!ICON_THEME_DIR!!
|
||||
MAN_DIR = !!MAN_DIR!!
|
||||
MENU_DIR = !!MENU_DIR!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
ROOT_DIR = !!ROOT_DIR!!
|
||||
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
|
||||
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
|
||||
INSTALL_DIR = !!INSTALL_DIR!!
|
||||
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
|
||||
INSTALL_MAN_DIR = "$(INSTALL_DIR)/$(MAN_DIR)"
|
||||
INSTALL_MENU_DIR = "$(INSTALL_DIR)/$(MENU_DIR)"
|
||||
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
|
||||
INSTALL_ICON_THEME_DIR = "$(INSTALL_DIR)/$(ICON_THEME_DIR)"
|
||||
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
|
||||
INSTALL_DOC_DIR = "$(INSTALL_DIR)/"!!DOC_DIR!!
|
||||
SOURCE_LIST = !!SOURCE_LIST!!
|
||||
CONFIGURE_FILES = !!CONFIGURE_FILES!!
|
||||
BINARY_NAME = !!BINARY_NAME!!
|
||||
STRIP = !!STRIP!!
|
||||
TTD = !!TTD!!
|
||||
TTDS = $(SRC_DIRS:%=%/$(TTD))
|
||||
OS = !!OS!!
|
||||
OSXAPP = !!OSXAPP!!
|
||||
LIPO = !!LIPO!!
|
||||
AWK = !!AWK!!
|
||||
SORT = !!SORT!!
|
||||
DISTCC = !!DISTCC!!
|
||||
LIPO = !!LIPO!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
ROOT_DIR = !!ROOT_DIR!!
|
||||
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
|
||||
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
|
||||
INSTALL_DIR = !!INSTALL_DIR!!
|
||||
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
|
||||
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
|
||||
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
|
||||
TTD = !!TTD!!
|
||||
TTDS = $(SRC_DIRS:%=%/$(TTD))
|
||||
OS = !!OS!!
|
||||
OSXAPP = !!OSXAPP!!
|
||||
REVISION = !!REVISION!!
|
||||
AWK = !!AWK!!
|
||||
DISTCC = !!DISTCC!!
|
||||
|
||||
RES := $(shell if [ ! -f $(CONFIG_CACHE_PWD) ] || [ "`pwd`" != "`cat $(CONFIG_CACHE_PWD)`" ]; then echo "`pwd`" > $(CONFIG_CACHE_PWD); fi )
|
||||
RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST) 2>/dev/null`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
|
||||
RES := $(shell if ! [ -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST)`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
|
||||
|
||||
all: config.pwd config.cache
|
||||
all: config.cache
|
||||
ifdef DISTCC
|
||||
@if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN paramter"; echo; fi
|
||||
endif
|
||||
@for dir in $(DIRS); do \
|
||||
$(MAKE) -C $$dir all || exit 1; \
|
||||
$(MAKE) -C $$dir all; \
|
||||
done
|
||||
ifdef LIPO
|
||||
# Lipo is an OSX thing. If it is defined, it means we are building for universal,
|
||||
@@ -87,22 +71,16 @@ help:
|
||||
@echo " bundle_lha create the lha installation bundle"
|
||||
@echo " bundle_dmg create the dmg installation bundle"
|
||||
|
||||
config.pwd: $(CONFIG_CACHE_PWD)
|
||||
$(MAKE) reconfigure
|
||||
|
||||
config.cache: $(CONFIG_CACHE_SOURCE_LIST) $(CONFIGURE_FILES)
|
||||
$(MAKE) reconfigure
|
||||
|
||||
reconfigure:
|
||||
ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
|
||||
@echo "----------------"
|
||||
@echo "The system detected that source.list or any configure file is altered."
|
||||
@echo " Going to reconfigure with last known settings..."
|
||||
@echo "----------------"
|
||||
# Make sure we don't lock config.cache
|
||||
@$(shell cat config.cache | sed 's@\\ @\\\\ @g') || exit 1
|
||||
@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
|
||||
@echo "----------------"
|
||||
@echo "Reconfig done. Please re-execute make."
|
||||
@echo "Reconfig done. Now compiling..."
|
||||
@echo "----------------"
|
||||
else
|
||||
@echo "----------------"
|
||||
@@ -125,34 +103,13 @@ lang:
|
||||
mrproper:
|
||||
@for dir in $(DIRS); do \
|
||||
$(MAKE) -C $$dir mrproper; \
|
||||
done
|
||||
# Don't be tempted to merge these two for loops. Doing that breaks make
|
||||
# --dry-run, since make has this "feature" that it always runs commands
|
||||
# containing $(MAKE), even when --dry-run is passed. The objective is of
|
||||
# course to also get a dry-run of submakes, but make is not smart enough
|
||||
# to see that a for loop runs both a submake and an actual command.
|
||||
@for dir in $(DIRS); do \
|
||||
rm -f $$dir/Makefile; \
|
||||
done
|
||||
$(Q)rm -rf objs
|
||||
$(Q)rm -f Makefile Makefile.am Makefile.bundle
|
||||
$(Q)rm -f media/openttd.desktop media/openttd.desktop.install
|
||||
$(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
|
||||
# directories for bundle generation
|
||||
$(Q)rm -f Makefile Makefile.am
|
||||
$(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.log
|
||||
$(Q)rm -rf $(BUNDLE_DIR)
|
||||
$(Q)rm -rf $(BUNDLES_DIR)
|
||||
# output of profiling
|
||||
$(Q)rm -f $(BIN_DIR)/gmon.out
|
||||
# output of generating 'API' documentation
|
||||
$(Q)rm -rf $(ROOT_DIR)/docs/source
|
||||
$(Q)rm -rf $(ROOT_DIR)/docs/aidocs
|
||||
$(Q)rm -rf $(ROOT_DIR)/docs/gamedocs
|
||||
# directories created by OpenTTD on regression testing
|
||||
$(Q)rm -rf $(BIN_DIR)/ai/regression/content_download $(BIN_DIR)/ai/regression/save $(BIN_DIR)/ai/regression/scenario
|
||||
distclean: mrproper
|
||||
|
||||
maintainer-clean: distclean
|
||||
$(Q)rm -f $(BIN_DIR)/baseset/openttd.grf $(BIN_DIR)/baseset/orig_extra.grf $(BIN_DIR)/baseset/*.obg $(BIN_DIR)/baseset/*.obs $(BIN_DIR)/baseset/*.obm
|
||||
|
||||
depend:
|
||||
@for dir in $(SRC_DIRS); do \
|
||||
@@ -168,10 +125,6 @@ run-gdb: all
|
||||
run-prof: all
|
||||
$(Q)cd !!BIN_DIR!! && ./!!TTD!! $(OPENTTD_ARGS) && gprof !!TTD!! | less
|
||||
|
||||
regression: all
|
||||
$(Q)cd !!BIN_DIR!! && sh ai/regression/run.sh
|
||||
test: regression
|
||||
|
||||
%.o:
|
||||
@for dir in $(SRC_DIRS); do \
|
||||
$(MAKE) -C $$dir $(@:src/%=%); \
|
||||
@@ -182,6 +135,140 @@ test: regression
|
||||
$(MAKE) -C $$dir $@; \
|
||||
done
|
||||
|
||||
.PHONY: test distclean mrproper clean
|
||||
#
|
||||
# Creation of bundles
|
||||
#
|
||||
|
||||
include Makefile.bundle
|
||||
# The revision is needed for the bundle name and creating an OSX application bundle.
|
||||
ifdef REVISION
|
||||
REV := $(REVISION)
|
||||
else
|
||||
# Are we a SVN dir?
|
||||
ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
|
||||
# Find if the local source if modified
|
||||
REV_MODIFIED := $(shell svnversion $(SRC_DIR) | sed -n 's/.*\(M\).*/\1/p' )
|
||||
# Find the revision like: rXXXX-branch
|
||||
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branches/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
|
||||
endif
|
||||
endif
|
||||
# Make sure we have something in REV
|
||||
ifeq ($(REV),)
|
||||
REV := norev000
|
||||
endif
|
||||
|
||||
ifndef BUNDLE_NAME
|
||||
BUNDLE_NAME = OTTD-$(OS)-custom-$(REV)
|
||||
endif
|
||||
|
||||
# An OSX application bundle needs the data files, lang files and openttd executable in a different location.
|
||||
ifdef OSXAPP
|
||||
DATA_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/data
|
||||
LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
|
||||
TTD_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
|
||||
else
|
||||
DATA_DIR = $(BUNDLE_DIR)/data
|
||||
LANG_DIR = $(BUNDLE_DIR)/lang
|
||||
TTD_DIR = $(BUNDLE_DIR)
|
||||
endif
|
||||
|
||||
bundle: all
|
||||
@echo '[BUNDLE] Constructing bundle'
|
||||
$(Q)rm -rf "${BUNDLE_DIR}"
|
||||
$(Q)mkdir -p "${BUNDLE_DIR}"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/docs"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/scenario"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/scenario/heightmap"
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/media"
|
||||
$(Q)mkdir -p "$(TTD_DIR)"
|
||||
$(Q)mkdir -p "$(DATA_DIR)"
|
||||
$(Q)mkdir -p "$(LANG_DIR)"
|
||||
ifdef OSXAPP
|
||||
$(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources"
|
||||
$(Q)echo "APPL????" > "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo"
|
||||
$(Q)cp "$(ROOT_DIR)/os/macosx/openttd.icns" "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns"
|
||||
$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "${BUNDLE_DIR}/$(OSXAPP)" "$(REV)"
|
||||
$(Q)cp "$(ROOT_DIR)/docs/OSX_install_instructions.txt" "$(BUNDLE_DIR)/docs/"
|
||||
$(Q)cp "$(ROOT_DIR)/os/macosx/splash.png" "$(DATA_DIR)"
|
||||
endif
|
||||
$(Q)cp "$(BIN_DIR)/$(TTD)" "$(TTD_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/data/"*.grf "$(DATA_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/data/opntitle.dat" "$(DATA_DIR)/"
|
||||
$(Q)cp "$(BIN_DIR)/lang/"*.lng "$(LANG_DIR)/"
|
||||
$(Q)cp "$(ROOT_DIR)/readme.txt" "$(BUNDLE_DIR)/"
|
||||
$(Q)cp "$(ROOT_DIR)/COPYING" "$(BUNDLE_DIR)/"
|
||||
$(Q)cp "$(ROOT_DIR)/known-bugs.txt" "$(BUNDLE_DIR)/docs/"
|
||||
$(Q)cp "$(ROOT_DIR)/docs/multiplayer.txt" "$(BUNDLE_DIR)/docs/"
|
||||
$(Q)cp "$(ROOT_DIR)/docs/32bpp.txt" "$(BUNDLE_DIR)/docs/"
|
||||
$(Q)cp "$(ROOT_DIR)/changelog.txt" "$(BUNDLE_DIR)/docs/"
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.64.png" "$(BUNDLE_DIR)/media/"
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.32.xpm" "$(BUNDLE_DIR)/media/"
|
||||
$(Q)cp "$(ROOT_DIR)/media/openttd.32.bmp" "$(BUNDLE_DIR)/media/"
|
||||
ifeq ($(shell if test -n "`ls -l \"$(BIN_DIR)/scenario/\"*.scn 2> /dev/null`"; then echo 1; fi), 1)
|
||||
$(Q)cp "$(BIN_DIR)/scenario/"*.scn "$(BUNDLE_DIR)/scenario/"
|
||||
endif
|
||||
ifeq ($(shell if test -n "`ls -l \"$(BIN_DIR)/scenario/heightmaps/\"* 2>/dev/null`"; then echo 1; fi), 1)
|
||||
$(Q)cp "$(BIN_DIR)/scenario/heightmaps/"* "$(BUNDLE_DIR)/scenario/heightmap/"
|
||||
endif
|
||||
ifeq ($(TTD), openttd.exe)
|
||||
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/readme.txt" "$(BUNDLE_DIR)/COPYING"
|
||||
endif
|
||||
|
||||
### Packing the current bundle into several compressed file formats ###
|
||||
#
|
||||
# Zips & dmgs do not contain a root folder, i.e. they have files in the root of the zip/dmg.
|
||||
# gzip, bzip2 and lha archives have a root folder, with the same name as the bundle.
|
||||
#
|
||||
# One can supply a custom name by adding BUNDLE_NAME:=<name> to the make command.
|
||||
#
|
||||
bundle_zip: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).zip'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)"
|
||||
$(Q)cd "$(BUNDLE_DIR)" && zip -r $(shell if test -z "$(VERBOSE)"; then echo '-q'; fi) "$(BUNDLES_DIR)/$(BUNDLE_NAME).zip" .
|
||||
|
||||
bundle_gzip: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.gz'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.gzip/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.gzip/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.gzip" && tar -zc$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.gz" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.gzip"
|
||||
|
||||
bundle_bzip2: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.bz2'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.bzip2/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.bzip2/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.bzip2" && tar -jc$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.bz2" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.bzip2"
|
||||
|
||||
bundle_lha: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).lha'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/.lha/$(BUNDLE_NAME)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.lha/$(BUNDLE_NAME)/"
|
||||
$(Q)cd "$(BUNDLES_DIR)/.lha" && lha ao6 "$(BUNDLES_DIR)/$(BUNDLE_NAME).lha" "$(BUNDLE_NAME)"
|
||||
$(Q)rm -rf "$(BUNDLES_DIR)/.lha"
|
||||
|
||||
bundle_dmg: bundle
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).dmg'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(REV)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(REV)"
|
||||
$(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(REV)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg"
|
||||
$(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(REV)"
|
||||
|
||||
ifdef OSXAPP
|
||||
install:
|
||||
@echo '[INSTALL] Cannot install the OSX Application Bundle'
|
||||
else
|
||||
install: bundle
|
||||
@echo '[INSTALL] Installing OpenTTD'
|
||||
$(Q)install -d "$(INSTALL_BINARY_DIR)"
|
||||
$(Q)install -d "$(INSTALL_ICON_DIR)"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/gm"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/data"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/lang"
|
||||
$(Q)install -d "$(INSTALL_DATA_DIR)/docs"
|
||||
$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/data/"* "$(INSTALL_DATA_DIR)/data"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(INSTALL_DATA_DIR)/docs"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/"* "$(INSTALL_ICON_DIR)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/scenario" "$(INSTALL_DATA_DIR)"
|
||||
endif # OSXAPP
|
||||
|
@@ -1,29 +1,28 @@
|
||||
# $Id$
|
||||
# Auto-generated file -- DO NOT EDIT
|
||||
|
||||
# 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/>.
|
||||
|
||||
STRGEN = !!STRGEN!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
LANG_DIR = !!LANG_DIR!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
LANGS_SRC = $(shell ls $(LANG_DIR)/*.txt)
|
||||
LANGS = $(LANGS_SRC:$(LANG_DIR)/%.txt=%.lng)
|
||||
CXX_BUILD = !!CXX_BUILD!!
|
||||
CFLAGS_BUILD = !!CFLAGS_BUILD!!
|
||||
CXXFLAGS_BUILD= !!CXXFLAGS_BUILD!!
|
||||
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
|
||||
STRGEN_FLAGS = !!STRGEN_FLAGS!!
|
||||
STAGE = !!STAGE!!
|
||||
LANG_SUPPRESS = !!LANG_SUPPRESS!!
|
||||
LANG_OBJS_DIR = !!LANG_OBJS_DIR!!
|
||||
STRGEN = !!STRGEN!!
|
||||
ENDIAN_CHECK = !!ENDIAN_CHECK!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
LANG_DIR = !!LANG_DIR!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
LANGS_SRC = $(shell ls $(LANG_DIR)/*.txt)
|
||||
LANGS = $(LANGS_SRC:$(LANG_DIR)/%.txt=%.lng)
|
||||
CXX_BUILD = !!CXX_BUILD!!
|
||||
CFLAGS_BUILD = !!CFLAGS_BUILD!!
|
||||
STRGEN_FLAGS = !!STRGEN_FLAGS!!
|
||||
STAGE = !!STAGE!!
|
||||
LANG_SUPPRESS= !!LANG_SUPPRESS!!
|
||||
LANG_OBJS_DIR= !!LANG_OBJS_DIR!!
|
||||
|
||||
ifeq ($(LANG_SUPPRESS), yes)
|
||||
LANG_ERRORS = >/dev/null 2>&1
|
||||
endif
|
||||
|
||||
# Make sure endian_host.h is reasable as if it was in the src/ dir
|
||||
CFLAGS_BUILD += -I $(LANG_OBJS_DIR)
|
||||
|
||||
ENDIAN_TARGETS := endian_host.h endian_target.h $(ENDIAN_CHECK)
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
Q =
|
||||
@@ -37,33 +36,25 @@ RES := $(shell mkdir -p $(BIN_DIR)/lang )
|
||||
|
||||
all: table/strings.h $(LANGS)
|
||||
|
||||
strgen_base.o: $(SRC_DIR)/strgen/strgen_base.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
|
||||
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h $(SRC_DIR)/table/control_codes.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
strgen.o: $(SRC_DIR)/strgen/strgen.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
|
||||
string.o: $(SRC_DIR)/string.cpp endian_host.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp endian_host.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
lang/english.txt: $(LANG_DIR)/english.txt
|
||||
$(Q)mkdir -p lang
|
||||
$(Q)cp $(LANG_DIR)/english.txt lang/english.txt
|
||||
|
||||
$(STRGEN): alloc_func.o string.o strgen_base.o strgen.o getoptdata.o
|
||||
$(STRGEN): alloc_func.o string.o strgen.o
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
|
||||
$(Q)$(CXX_BUILD) $^ -o $@
|
||||
|
||||
table/strings.h: lang/english.txt $(STRGEN)
|
||||
$(E) '$(STAGE) Generating $@'
|
||||
@@ -74,14 +65,23 @@ $(LANGS): %.lng: $(LANG_DIR)/%.txt $(STRGEN) lang/english.txt
|
||||
$(E) '$(STAGE) Compiling language $(*F)'
|
||||
$(Q)./$(STRGEN) $(STRGEN_FLAGS) -s $(LANG_DIR) -d $(LANG_OBJS_DIR) $< $(LANG_ERRORS) && cp $@ $(BIN_DIR)/lang || true # Do not fail all languages when one fails
|
||||
|
||||
# The targets to compile the endian-code
|
||||
|
||||
endian_host.h: $(ENDIAN_CHECK)
|
||||
$(E) '$(STAGE) Testing endianness for host'
|
||||
$(Q)./$(ENDIAN_CHECK) > $@
|
||||
|
||||
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
|
||||
|
||||
depend:
|
||||
|
||||
clean:
|
||||
$(E) '$(STAGE) Cleaning up language files'
|
||||
$(Q)rm -f strgen_base.o strgen.o string.o alloc_func.o getoptdata.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.*
|
||||
$(Q)rm -f strgen.o string.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.* $(ENDIAN_TARGETS)
|
||||
|
||||
mrproper: clean
|
||||
$(Q)rm -rf $(BIN_DIR)/lang
|
||||
|
||||
%.lng:
|
||||
@echo '$(STAGE) No such language: $(@:%.lng=%)'
|
||||
|
@@ -1,47 +0,0 @@
|
||||
# $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/>.
|
||||
|
||||
#
|
||||
# Makefile for creating bundles of MSVC's binaries in the same way as we make
|
||||
# the zip bundles for ALL other OSes.
|
||||
#
|
||||
# Usage: make -f Makefile.msvc PLATFORM=[Win32|x64] BUNDLE_NAME=openttd-<version>-win[32|64]
|
||||
# or make -f Makefile.msvc PLATFORM=[Win32|x64] BUNDLE_NAME=OTTD-win[32|64]-nightly-<revision>
|
||||
#
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
Q =
|
||||
else
|
||||
Q = @
|
||||
endif
|
||||
|
||||
AWK = "awk"
|
||||
ROOT_DIR := $(shell pwd)
|
||||
BIN_DIR = "$(ROOT_DIR)/bin"
|
||||
SRC_DIR = "$(ROOT_DIR)/src"
|
||||
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
|
||||
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
|
||||
TTD = openttd.exe
|
||||
PDB = openttd.pdb
|
||||
MODE = Release
|
||||
TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@")
|
||||
|
||||
all:
|
||||
$(Q)cp objs/$(TARGET)/$(MODE)/$(TTD) $(BIN_DIR)/$(TTD)
|
||||
|
||||
include Makefile.bundle.in
|
||||
|
||||
bundle_pdb:
|
||||
@echo '[BUNDLE] Creating $(BUNDLE_NAME).pdb.xz'
|
||||
$(Q)mkdir -p "$(BUNDLES_DIR)"
|
||||
$(Q)cp objs/$(TARGET)/Release/$(PDB) $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb
|
||||
$(Q)xz -9 $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb
|
||||
|
||||
regression: all
|
||||
$(Q)cp bin/$(TTD) bin/openttd
|
||||
$(Q)cd bin && sh ai/regression/run.sh
|
@@ -1,65 +0,0 @@
|
||||
# $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/>.
|
||||
|
||||
SETTINGSGEN = !!SETTINGSGEN!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
CXX_BUILD = !!CXX_BUILD!!
|
||||
CFLAGS_BUILD = !!CFLAGS_BUILD!!
|
||||
CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
|
||||
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
|
||||
STAGE = !!STAGE!!
|
||||
SETTING_OBJS_DIR = !!SETTING_OBJS_DIR!!
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
Q =
|
||||
E = @true
|
||||
else
|
||||
Q = @
|
||||
E = @echo
|
||||
endif
|
||||
|
||||
all: table/settings.h
|
||||
|
||||
settingsgen.o: $(SRC_DIR)/settingsgen/settingsgen.cpp $(SRC_DIR)/string_func.h $(SRC_DIR)/strings_type.h $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/ini_type.h $(SRC_DIR)/core/smallvec_type.hpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
ini_load.o: $(SRC_DIR)/ini_load.cpp $(SRC_DIR)/core/alloc_func.hpp $(SRC_DIR)/core/mem_func.hpp $(SRC_DIR)/ini_type.h $(SRC_DIR)/string_func.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
$(SETTINGSGEN): alloc_func.o string.o ini_load.o settingsgen.o getoptdata.o
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
|
||||
|
||||
table/settings.h: $(SETTINGSGEN) $(SRC_DIR)/table/settings.h.preamble $(SRC_DIR)/table/settings.h.postamble $(SRC_DIR)/table/*.ini
|
||||
$(E) '$(STAGE) Generating $@'
|
||||
@mkdir -p table
|
||||
$(Q)./$(SETTINGSGEN) -o table/settings.h -b $(SRC_DIR)/table/settings.h.preamble -a $(SRC_DIR)/table/settings.h.postamble $(SRC_DIR)/table/*.ini
|
||||
|
||||
depend:
|
||||
|
||||
clean:
|
||||
$(E) '$(STAGE) Cleaning up settings files'
|
||||
$(Q)rm -f settingsgen.o alloc_func.o getoptdata.o string.o ini_load.o $(SETTINGSGEN) table/settings.h
|
||||
|
||||
mrproper: clean
|
||||
|
||||
.PHONY: all mrproper depend clean
|
266
Makefile.src.in
266
Makefile.src.in
@@ -1,43 +1,37 @@
|
||||
# $Id$
|
||||
# Auto-generated file -- DO NOT EDIT
|
||||
|
||||
# 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/>.
|
||||
|
||||
CC_HOST = !!CC_HOST!!
|
||||
CXX_HOST = !!CXX_HOST!!
|
||||
CC_BUILD = !!CC_BUILD!!
|
||||
CXX_BUILD = !!CXX_BUILD!!
|
||||
WINDRES = !!WINDRES!!
|
||||
STRIP = !!STRIP!!
|
||||
CFLAGS = !!CFLAGS!!
|
||||
CFLAGS_BUILD = !!CFLAGS_BUILD!!
|
||||
CXXFLAGS = !!CXXFLAGS!!
|
||||
CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
|
||||
LIBS = !!LIBS!!
|
||||
LDFLAGS = !!LDFLAGS!!
|
||||
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
|
||||
ROOT_DIR = !!ROOT_DIR!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
LANG_DIR = !!LANG_DIR!!
|
||||
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
|
||||
LANG_OBJS_DIR = !!LANG_OBJS_DIR!!
|
||||
SETTING_OBJS_DIR= !!SETTING_OBJS_DIR!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
SCRIPT_SRC_DIR = !!SCRIPT_SRC_DIR!!
|
||||
MEDIA_DIR = !!MEDIA_DIR!!
|
||||
TTD = !!TTD!!
|
||||
STRGEN = !!STRGEN!!
|
||||
DEPEND = !!DEPEND!!
|
||||
OS = !!OS!!
|
||||
STAGE = !!STAGE!!
|
||||
MAKEDEPEND = !!MAKEDEPEND!!
|
||||
CFLAGS_MAKEDEP = !!CFLAGS_MAKEDEP!!
|
||||
SORT = !!SORT!!
|
||||
AWK = !!AWK!!
|
||||
CC_HOST = !!CC_HOST!!
|
||||
CXX_HOST = !!CXX_HOST!!
|
||||
CC_BUILD = !!CC_BUILD!!
|
||||
CXX_BUILD = !!CXX_BUILD!!
|
||||
WINDRES = !!WINDRES!!
|
||||
STRIP = !!STRIP!!
|
||||
CC_CFLAGS = !!CC_CFLAGS!!
|
||||
CFLAGS = !!CFLAGS!!
|
||||
CFLAGS_BUILD = !!CFLAGS_BUILD!!
|
||||
LIBS = !!LIBS!!
|
||||
LDFLAGS = !!LDFLAGS!!
|
||||
BIN_DIR = !!BIN_DIR!!
|
||||
LANG_DIR = !!LANG_DIR!!
|
||||
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
|
||||
LANG_OBJS_DIR= !!LANG_OBJS_DIR!!
|
||||
SRC_DIR = !!SRC_DIR!!
|
||||
MEDIA_DIR = !!MEDIA_DIR!!
|
||||
TTD = !!TTD!!
|
||||
STRGEN = !!STRGEN!!
|
||||
ENDIAN_CHECK = !!ENDIAN_CHECK!!
|
||||
ENDIAN_FORCE = !!ENDIAN_FORCE!!
|
||||
OS = !!OS!!
|
||||
STAGE = !!STAGE!!
|
||||
MAKEDEPEND = !!MAKEDEPEND!!
|
||||
CFLAGS_MAKEDEP= !!CFLAGS_MAKEDEP!!
|
||||
SORT = !!SORT!!
|
||||
REVISION = !!REVISION!!
|
||||
AWK = !!AWK!!
|
||||
GCC295 = !!GCC295!!
|
||||
CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!!
|
||||
CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!!
|
||||
CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!!
|
||||
CONFIG_CACHE_SOURCE = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_SOURCE!!
|
||||
CONFIG_CACHE_VERSION = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_VERSION!!
|
||||
|
||||
@@ -49,15 +43,28 @@ OBJS := $(OBJS_C) $(OBJS_CPP) $(OBJS_MM) $(OBJS_RC)
|
||||
SRCS := !!SRCS!!
|
||||
|
||||
# All C-files depend on those 3 files
|
||||
FILE_DEP := $(CONFIG_CACHE_COMPILER)
|
||||
FILE_DEP := $(CONFIG_CACHE_COMPILER) $(LANG_OBJS_DIR)/table/strings.h endian_target.h
|
||||
# Create all dirs and subdirs
|
||||
RES := $(shell mkdir -p $(BIN_DIR) $(sort $(dir $(OBJS))))
|
||||
|
||||
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SETTING_OBJS_DIR)
|
||||
CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SETTING_OBJS_DIR)
|
||||
ifdef SCRIPT_SRC_DIR
|
||||
CFLAGS_MAKEDEP += -I $(SCRIPT_SRC_DIR)
|
||||
endif
|
||||
# Make sure endian_target.h is reasable as if it was in the src/ dir
|
||||
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR)
|
||||
|
||||
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
|
||||
|
||||
# This 'sed' basicly just removes 'const' from the line if it is a 2+D array
|
||||
# For more information, please check:
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
|
||||
GCC295_FIX=sed -r 's/^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$/\1\2 \4\6\8\9/g'
|
||||
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
|
||||
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
|
||||
# compiler can't handle that information (just don't ask). So we remove it
|
||||
# and then it compiles happily and without bitching :)
|
||||
# Furthermore gcc 2.95 has some trouble with protected and private when
|
||||
# accessing the protected/private stuff of the enclosing class (or the
|
||||
# super class of the enclosing class).
|
||||
GCC295_FIX_2=sed -e 's|\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$|\1|g;s|private:|public:|g;s|protected:|public:|g'
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
@@ -82,33 +89,50 @@ $(LANG_OBJS_DIR)/$(STRGEN):
|
||||
$(LANG_OBJS_DIR)/table/strings.h: $(LANG_DIR)/english.txt $(LANG_OBJS_DIR)/$(STRGEN)
|
||||
$(MAKE) -C $(LANG_OBJS_DIR) table/strings.h
|
||||
|
||||
# Always run version detection, so we always have an accurate modified
|
||||
# flag
|
||||
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
|
||||
MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d' ')
|
||||
|
||||
# Use autodetected revisions
|
||||
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
|
||||
ISODATE := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
|
||||
GITHASH := $(shell echo "$(VERSIONS)" | cut -f 4 -d' ')
|
||||
ISTAG := $(shell echo "$(VERSIONS)" | cut -f 5 -d' ')
|
||||
|
||||
# Make sure we have something in VERSION and ISODATE
|
||||
ifeq ($(VERSION),)
|
||||
VERSION := norev000
|
||||
# Make the revision number
|
||||
ifdef REVISION
|
||||
REV := $(REVISION)
|
||||
REV_NR := $(shell echo $(REVISION) | sed "s/[^0-9]//g")
|
||||
else
|
||||
# Are we a SVN dir?
|
||||
ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
|
||||
# Find if the local source if modified
|
||||
REV_MODIFIED := $(shell svnversion $(SRC_DIR) | sed -n 's/.*\(M\).*/\1/p' )
|
||||
# Find the revision like: rXXXX-branch
|
||||
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branch/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
|
||||
REV_NR := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^Last Changed Rev:/ { print $$4 }')
|
||||
else
|
||||
# Are we a git dir?
|
||||
ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
|
||||
# Find the revision like: gXXXXM-branch
|
||||
REV := g$(shell if head=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if cd "$(SRC_DIR)/.." && git diff-index HEAD src | read dummy; then echo M; fi)$(shell git branch|grep '[*]' | sed 's/\* /-/;s/^-master$$//')
|
||||
REV_NR := $(shell LC_ALL=C cd "$(SRC_DIR)/.." && git log --pretty=format:%s src | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
|
||||
else
|
||||
# Are we a hg (Mercurial) dir?
|
||||
ifeq ($(shell if test -d $(SRC_DIR)/../.hg; then echo 1; fi), 1)
|
||||
# Find the revision like: hXXXXM-branch
|
||||
REV := h$(shell if head=`LC_ALL=C hg tip 2>/dev/null`; then echo "$$head" | head -n 1 | cut -c19-26; fi)$(shell if hg status $(SRC_DIR) | grep -v '^?' | read dummy; then echo M; fi)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
|
||||
REV_NR := $(shell LC_ALL=C hg log -k "svn" -l 1 --template "{desc}\n" $(SRC_DIR) | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
|
||||
endif
|
||||
ifeq ($(ISODATE),)
|
||||
ISODATE := 00000000
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Make sure we have something in REV
|
||||
ifeq ($(REV),)
|
||||
REV := norev000
|
||||
REV_NR := 0
|
||||
endif
|
||||
|
||||
# This helps to recompile if flags change
|
||||
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CFLAGS) $(CXXFLAGS)" ]; then echo "$(CFLAGS) $(CXXFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
|
||||
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CC_CFLAGS) $(CFLAGS)" ]; then echo "$(CC_CFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
|
||||
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
|
||||
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
|
||||
|
||||
# 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`" != "$(VERSION) $(MODIFIED)" ]; then echo "$(VERSION) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi )
|
||||
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV)" ]; then echo "$(REV)" > $(CONFIG_CACHE_VERSION); fi )
|
||||
|
||||
ifndef MAKEDEPEND
|
||||
# The slow, but always correct, dep-check
|
||||
@@ -116,7 +140,7 @@ DEP_MASK := %.d
|
||||
DEPS := $(OBJS:%.o=%.d)
|
||||
|
||||
# Only include the deps if we are compiling everything
|
||||
ifeq ($(filter %.o clean mrproper, $(MAKECMDGOALS)),)
|
||||
ifeq ($(filter $(ENDIAN_TARGETS) %.o clean mrproper, $(MAKECMDGOALS)),)
|
||||
-include $(DEPS)
|
||||
else
|
||||
# In case we want to compile a single target, include the .d file for it
|
||||
@@ -130,18 +154,18 @@ endif
|
||||
|
||||
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)'
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
|
||||
|
||||
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
|
||||
|
||||
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
|
||||
|
||||
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.rc=%.rc)'
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
$(Q)touch $@
|
||||
|
||||
else
|
||||
@@ -150,52 +174,39 @@ DEP_MASK :=
|
||||
DEPS := Makefile.dep
|
||||
|
||||
# Only include the deps if we are not cleaning
|
||||
ifeq ($(filter depend clean mrproper, $(MAKECMDGOALS)),)
|
||||
ifeq ($(filter $(ENDIAN_TARGETS) depend clean mrproper, $(MAKECMDGOALS)),)
|
||||
-include Makefile.dep
|
||||
endif
|
||||
|
||||
ifeq ("$(SRC_OBJS_DIR)/$(DEPEND)","$(MAKEDEPEND)")
|
||||
DEP := $(MAKEDEPEND)
|
||||
$(SRC_OBJS_DIR)/$(DEPEND): $(SRC_DIR)/depend/depend.cpp
|
||||
$(E) '$(STAGE) Compiling and linking $(DEPEND)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) -o $@ $<
|
||||
endif
|
||||
|
||||
# Macro for invoking a command on groups of 100 words at a time
|
||||
# (analogous to xargs(1)). The macro invokes itself recursively
|
||||
# until the list of words is depleted.
|
||||
#
|
||||
# Usage: $(call xargs,COMMAND,LIST)
|
||||
#
|
||||
# COMMAND should be a shell command to which the words will be
|
||||
# appended as arguments in groups of 100.
|
||||
define xargs
|
||||
$(1) $(wordlist 1,100,$(2))
|
||||
$(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2))))
|
||||
endef
|
||||
|
||||
# Make sure that only 'make depend' ALWAYS triggers a recheck
|
||||
ifeq ($(filter depend, $(MAKECMDGOALS)),)
|
||||
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE) $(DEP)
|
||||
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE)
|
||||
else
|
||||
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(DEP) FORCE
|
||||
Makefile.dep: FORCE
|
||||
endif
|
||||
$(E) '$(STAGE) DEP CHECK (all files)'
|
||||
$(Q)rm -f Makefile.dep.tmp
|
||||
$(Q)touch Makefile.dep.tmp
|
||||
|
||||
# Calculate the deps via makedepend
|
||||
$(call xargs,$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -a -- $(CFLAGS_MAKEDEP) -- 2>/dev/null,$(SRCS:%=$(SRC_DIR)/%))
|
||||
$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -- $(CFLAGS_MAKEDEP) -- $(SRCS:%=$(SRC_DIR)/%) 2>/dev/null
|
||||
|
||||
# Convert x:/... paths to /x/... for mingw
|
||||
ifeq ($(OS), MINGW)
|
||||
@cat Makefile.dep.tmp | sed 's@\([a-zA-Z]\):\/@\/\1\/@g' > Makefile.dep.tmp.mingw
|
||||
@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
|
||||
@rm -f Makefile.dep.tmp.mingw
|
||||
endif
|
||||
|
||||
# Remove all comments and includes that don't start with $(SRC_DIR)
|
||||
# Remove $(SRC_DIR) from object-file-name
|
||||
@$(AWK) ' \
|
||||
/^# DO NOT/ { print $$0 ; next} \
|
||||
/^#/ {next} \
|
||||
/: / { \
|
||||
/:/ { \
|
||||
left = NF - 1; \
|
||||
for (n = 2; n <= NF; n++) { \
|
||||
if (match($$n, "^$(ROOT_DIR)") == 0) { \
|
||||
if (match($$n, "^$(SRC_DIR)") == 0) { \
|
||||
$$n = ""; \
|
||||
left--; \
|
||||
} \
|
||||
@@ -211,16 +222,16 @@ endif
|
||||
{ \
|
||||
print $$0 \
|
||||
} \
|
||||
' < Makefile.dep.tmp | sed 's@ *@ @g;s@ $$@@' | LC_ALL=C $(SORT) > Makefile.dep
|
||||
' < Makefile.dep.tmp | sed 's/ */ /g;s/ $$//' | $(SORT) > Makefile.dep
|
||||
|
||||
$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
|
||||
|
||||
endif
|
||||
|
||||
# Avoid problems with deps if a .h/.hpp/.hpp.sq file is deleted without the deps
|
||||
# Avoid problems with deps if a .h/.hpp file is deleted without the deps
|
||||
# being updated. Now the Makefile continues, the deps are recreated
|
||||
# and all will be fine.
|
||||
%.h %.hpp %.hpp.sq:
|
||||
%.h %.hpp:
|
||||
@true
|
||||
|
||||
|
||||
@@ -228,23 +239,15 @@ endif
|
||||
|
||||
$(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.c=%.c)'
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -c -o $@ $<
|
||||
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
$(filter-out %sse2.o, $(filter-out %ssse3.o, $(filter-out %sse4.o, $(OBJS_CPP)))): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
$(filter %sse2.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -msse2 -o $@ $<
|
||||
|
||||
$(filter %ssse3.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -mssse3 -o $@ $<
|
||||
|
||||
$(filter %sse4.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -msse4.1 -o $@ $<
|
||||
ifeq ($(GCC295), 1)
|
||||
$(Q)$(CXX_HOST) -E $(CFLAGS) $< | $(GCC295_FIX) | $(GCC295_FIX_2) | $(CXX_HOST) $(CFLAGS) -c -o $@ -x c++ -
|
||||
else
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
|
||||
endif
|
||||
|
||||
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
@@ -252,35 +255,42 @@ $(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
|
||||
|
||||
$(OBJS_RC): %.o: $(SRC_DIR)/%.rc $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling resource $(<:$(SRC_DIR)/%.rc=%.rc)'
|
||||
$(Q)$(WINDRES) -o $@ $<
|
||||
$(Q)$(WINDRES) -o $@ -I $(MEDIA_DIR) $<
|
||||
|
||||
$(BIN_DIR)/$(TTD): $(TTD)
|
||||
$(Q)cp $(TTD) $(BIN_DIR)/$(TTD)
|
||||
ifeq ($(OS), UNIX)
|
||||
$(Q)cp $(MEDIA_DIR)/openttd.32.bmp $(BIN_DIR)/baseset/
|
||||
endif
|
||||
ifeq ($(OS), OSX)
|
||||
$(Q)cp $(ROOT_DIR)/os/macosx/splash.png $(BIN_DIR)/baseset/
|
||||
endif
|
||||
$(Q)cp $< $@
|
||||
|
||||
$(TTD): $(OBJS) $(CONFIG_CACHE_LINKER)
|
||||
$(E) '$(STAGE) Linking $@'
|
||||
$(Q)+$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
||||
ifeq ($(OS), PSP)
|
||||
# Because of a bug in the PSP GCC tools, linking via CXX results
|
||||
# in total chaos and more problems then you can handle. So we need
|
||||
# CC to link OpenTTD for PSP
|
||||
$(Q)$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
||||
else
|
||||
$(Q)$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
||||
endif
|
||||
ifdef STRIP
|
||||
$(Q)$(STRIP) $@
|
||||
endif
|
||||
ifeq ($(OS), DOS)
|
||||
$(E) '$(STAGE) Adding CWSDPMI stub to $@'
|
||||
$(Q)$(ROOT_DIR)/os/dos/make_dos_binary_selfcontained.sh $(SRC_OBJS_DIR)/$@
|
||||
endif
|
||||
|
||||
# The targets to compile the endian-code
|
||||
|
||||
endian_target.h: $(ENDIAN_CHECK) $(CONFIG_CACHE_ENDIAN)
|
||||
$(E) '$(STAGE) Testing endianness for target'
|
||||
$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
|
||||
|
||||
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
|
||||
|
||||
# Revision files
|
||||
|
||||
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in
|
||||
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g" > $(SRC_DIR)/rev.cpp
|
||||
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s#@@REVISION@@#$(REV_NR)#g;s#@@VERSION@@#$(REV)#g;s#@@DATE@@#`date +%d.%m.%y`#g" > $(SRC_DIR)/rev.cpp
|
||||
|
||||
$(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in
|
||||
$(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc
|
||||
$(SRC_DIR)/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/ottdres.rc.in
|
||||
$(Q)cat $(SRC_DIR)/ottdres.rc.in | sed "s#@@REVISION@@#$(REV_NR)#g;s#@@VERSION@@#$(REV)#g;s#@@DATE@@#`date +%d.%m.%y`#g" > $(SRC_DIR)/ottdres.rc
|
||||
|
||||
FORCE:
|
||||
|
||||
@@ -288,10 +298,10 @@ depend: $(DEPS)
|
||||
|
||||
clean:
|
||||
$(E) '$(STAGE) Cleaning up object files'
|
||||
$(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(DEPEND) $(TTD:%=$(BIN_DIR)/%) $(BIN_DIR)/baseset/openttd.32.bmp $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_SOURCE)
|
||||
$(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS)
|
||||
|
||||
mrproper: clean
|
||||
$(Q)rm -f $(SRC_DIR)/rev.cpp $(SRC_DIR)/os/windows/ottdres.rc
|
||||
$(Q)rm -f $(SRC_DIR)/rev.cpp $(SRC_DIR)/ottdres.rc
|
||||
|
||||
%.o:
|
||||
@echo '$(STAGE) No such source-file: $(@:%.o=%).[c|cpp|mm|rc]'
|
||||
|
839
README.md
839
README.md
@@ -1,839 +0,0 @@
|
||||
# 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)
|
||||
- 5.2) [Frame rate and performance metrics](#52-frame-rate-and-performance-metrics)
|
||||
- 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 https://www.openttd.org.
|
||||
|
||||
You can also find the OpenTTD forums at
|
||||
[https://www.tt-forums.net](https://www.tt-forums.net/viewforum.php?f=55).
|
||||
|
||||
### 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 GitHub's issue tracker. You can find
|
||||
the tracker at 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 Git revision/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-bit Windows, 64-bit Windows,
|
||||
Linux on an ARM, Mac OS X on a PowerPC, etc.)
|
||||
- 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 (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:
|
||||
|
||||
- https://www.openttd.org/download-opengfx for OpenGFX
|
||||
- https://www.openttd.org/download-opensfx for OpenSFX
|
||||
- https://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 appropriate files from
|
||||
the original game into the baseset folder.
|
||||
- TTD for Windows: All files in the gm/ folder (gm_tt00.gm up to gm_tt21.gm)
|
||||
- TTD for DOS: The GM.CAT file
|
||||
- Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT
|
||||
|
||||
#### 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 https://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, 8.1, 10)
|
||||
- macOS: `~/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, 8.1, 10)
|
||||
- macOS: `/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 (macOS 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](https://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 https://wiki.openttd.org/Hidden_features
|
||||
for a non-comprehensive list or look at the tooltips.
|
||||
- Ingame console. More information at https://wiki.openttd.org/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.
|
||||
|
||||
### 5.2) Frame rate and performance metrics
|
||||
|
||||
The Help menu in-game has a function to open the Frame rate window. This
|
||||
window shows various real-time performance statistics, measuring what parts
|
||||
of the game require the most processing power currently.
|
||||
|
||||
A summary of the statistics can also be retrieved from the console with the
|
||||
`fps` command. This is especially useful on dedicated servers, where the
|
||||
administrator might want to determine what's limiting performance in a slow
|
||||
game.
|
||||
|
||||
The frame rate is given as two figures, the simulation rate and the graphics
|
||||
frame rate. Usually these are identical, as the screen is rendered exactly
|
||||
once per simulated tick, but in the future there might be support for graphics
|
||||
and simulation running at different rates. When the game is paused, the
|
||||
simulation rate drops to zero.
|
||||
|
||||
In addition to the simulation rate, a game speed factor is also calculated.
|
||||
This is based on the target simulation speed, which is 30 milliseconds per
|
||||
game tick. At that speed, the expected frame rate is 33.33 frames/second, and
|
||||
the game speed factor is how close to that target the actual rate is. When
|
||||
the game is in fast forward mode, the game speed factor shows how much
|
||||
speed up is achieved.
|
||||
|
||||
The lower part of the window shows timing statistics for individual parts of
|
||||
the game. The times shown are short-term and long-term averages of how long
|
||||
it takes to process one tick of game time, all figures are in milliseconds.
|
||||
|
||||
Clicking a line in the lower part of the window opens a graph window, giving
|
||||
detailed readings on each tick simulated by the game.
|
||||
|
||||
The following is an explanation of the different statistics:
|
||||
|
||||
- *Game loop* - Total processing time used per simulated "tick" in the game.
|
||||
This includes all pathfinding, world updates, and economy handling.
|
||||
- *Cargo handling* - Time spent loading/unloading cargo at stations, and
|
||||
industries and towns sending/retrieving cargo from stations.
|
||||
- *Train ticks*, *Road vehicle ticks*, *Ship ticks*, *Aircraft ticks* -
|
||||
Time spent on pathfinding and other processing for each player vehicle type.
|
||||
- *World ticks* - Time spent on other world/landscape processing. This
|
||||
includes towns growing, building animations, updates of farmland and trees,
|
||||
and station rating updates.
|
||||
- *GS/AI total*, *Game script*, and *AI players* - Time spent running logic
|
||||
for game scripts and AI players. The total may show as less than the current
|
||||
sum of the individual scripts, this is because AI players at lower
|
||||
difficulty settings do not run every game tick, and hence contribute less
|
||||
to the average across all ticks. Keep in mind that the "Current" figure is
|
||||
also an average, just only over short term.
|
||||
- *Link graph delay* - Time overruns of the cargo distribution link graph
|
||||
update thread. Usually the link graph is updated in a background thread,
|
||||
but these updates need to synchronise with the main game loop occasionally,
|
||||
if the time spent on link graph updates is longer than the time taken to
|
||||
otherwise simulate the game while it was updating, these delays are counted
|
||||
in this figure.
|
||||
- *Graphics rendering* - Total time spent rendering all graphics, including
|
||||
both GUI and world viewports. This typically spikes when panning the view
|
||||
around, and when more things are happening on screen at once.
|
||||
- *World viewport rendering* - Isolated time spent rendering just world
|
||||
viewports. If this figure is significantly lower than the total graphics
|
||||
rendering time, most time is spent rendering GUI than rendering world.
|
||||
- *Video output* - Speed of copying the rendered graphics to the display
|
||||
adapter. Usually this should be very fast (in the range of 0-3 ms), large
|
||||
values for this can indicate a graphics driver problem.
|
||||
- *Sound mixing* - Speed of mixing active audio samples together. Usually
|
||||
this should be very fast (in the range of 0-3 ms), if it is slow, consider
|
||||
switching to the NoSound set.
|
||||
|
||||
If the frame rate window is shaded, the title bar will instead show just the
|
||||
current simulation rate and the game speed factor.
|
||||
|
||||
## 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 2015 Update 3 or more recent. 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), ZLIB (WITH_ZLIB), LZO (WITH_LZO), Freetype (WITH_FREETYPE) and
|
||||
LZMA (WITH_LZMA) support is enabled by default. For these to work you need their
|
||||
development files. To get them just use vcpkg from https://github.com/Microsoft/vcpkg
|
||||
using x86-windows-static and x64-windows-static triplets.
|
||||
For more help with VS see docs/Readme_Windows_MSVC.md.
|
||||
|
||||
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:
|
||||
|
||||
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 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) 2015, 2017 and 2019.
|
||||
- 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) 2013 and earlier.
|
||||
These old versions do not support modern C++ language features.
|
||||
- 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 https://github.com/OpenTTD/OpenTTD/issues/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 https://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 https://www.openttd.org/development for up-to-date information.
|
||||
|
||||
The use of the online Translator service, located at
|
||||
https://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 (https://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 Git 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 https://wiki.openttd.org/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](https://www.tt-forums.net/viewforum.php?f=66)
|
||||
or [GRFCrawler](https://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.
|
||||
|
||||
CONTRIBUTING.md 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.
|
||||
|
||||
## 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)
|
||||
- Niels Martin Hansen (nielsm) - Music system, general coding (since 1.9)
|
||||
- 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) - macOS 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) - macOS 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!
|
@@ -1,67 +0,0 @@
|
||||
trigger:
|
||||
- master
|
||||
pr:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: windows
|
||||
displayName: 'Windows'
|
||||
pool:
|
||||
vmImage: 'VS2017-Win2016'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
Win32:
|
||||
BuildPlatform: 'Win32'
|
||||
Win64:
|
||||
BuildPlatform: 'x64'
|
||||
|
||||
steps:
|
||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||
- template: azure-pipelines/templates/windows-dependencies.yml
|
||||
- template: azure-pipelines/templates/ci-opengfx.yml
|
||||
- template: azure-pipelines/templates/windows-build.yml
|
||||
parameters:
|
||||
BuildPlatform: $(BuildPlatform)
|
||||
- script: |
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
|
||||
cd projects
|
||||
call regression.bat
|
||||
displayName: 'Test'
|
||||
|
||||
- job: linux
|
||||
displayName: 'Linux'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
commit-checker: {}
|
||||
linux-amd64-clang-3.8: {}
|
||||
linux-amd64-gcc-6: {}
|
||||
linux-i386-gcc-6: {}
|
||||
|
||||
steps:
|
||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||
# The dockers already have the dependencies installed
|
||||
# The dockers already have OpenGFX installed
|
||||
- template: azure-pipelines/templates/linux-build.yml
|
||||
parameters:
|
||||
Image: compile-farm-ci
|
||||
Tag: $(Agent.JobName)
|
||||
|
||||
- job: macos
|
||||
displayName: 'MacOS'
|
||||
pool:
|
||||
vmImage: 'macOS-10.13'
|
||||
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.9
|
||||
|
||||
steps:
|
||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||
- template: azure-pipelines/templates/osx-dependencies.yml
|
||||
- template: azure-pipelines/templates/ci-opengfx.yml
|
||||
- template: azure-pipelines/templates/osx-build.yml
|
||||
- script: 'make regression'
|
||||
displayName: 'Test'
|
@@ -1,10 +0,0 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- refs/tags/*
|
||||
pr: none
|
||||
|
||||
jobs:
|
||||
- template: azure-pipelines/templates/release.yml
|
||||
parameters:
|
||||
IsStableRelease: true
|
@@ -1,7 +0,0 @@
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
jobs:
|
||||
- template: azure-pipelines/templates/release.yml
|
||||
parameters:
|
||||
IsStableRelease: false
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
tag=$(git describe --tags 2>/dev/null)
|
||||
|
||||
# If we are a tag, show the part of the changelog till (but excluding) the last stable
|
||||
if [ -n "$tag" ]; then
|
||||
grep='^[0-9]\.[0-9]\.[0-9][^-]'
|
||||
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
|
||||
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9].[0-9].[0-9]/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# In all other cases, show the git log of the last 7 days
|
||||
revdate=$(git log -1 --pretty=format:"%ci")
|
||||
last_week=$(date -u -d "$revdate -7days" +"%Y-%m-%d %H:%M")
|
||||
git log --after="${last_week}" --pretty=fuller
|
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <folder-with-bundles>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FOLDER=$1
|
||||
|
||||
if [ ! -e .version ] || [ ! -e .release_date ]; then
|
||||
echo "This script should be executed in the root of an extracted source tarball"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the name based on the version
|
||||
if [ -e .is_stable ]; then
|
||||
isTesting=$(cat .version | grep "RC\|beta" || true)
|
||||
if [ -z "${isTesting}" ]; then
|
||||
NAME="stable"
|
||||
else
|
||||
NAME="testing"
|
||||
fi
|
||||
else
|
||||
NAME=$(cat .version | cut -d- -f2 | cut -d- -f-2)
|
||||
fi
|
||||
|
||||
# Convert the date to a YAML date
|
||||
DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/')
|
||||
VERSION=$(cat .version)
|
||||
BASE="openttd-${VERSION}"
|
||||
|
||||
echo "name: ${NAME}" >> manifest.yaml
|
||||
echo "date: ${DATE}" >> manifest.yaml
|
||||
echo "base: ${BASE}-" >> manifest.yaml
|
||||
echo "files:" >> manifest.yaml
|
||||
|
||||
error=""
|
||||
for i in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
|
||||
if [ -n "$(echo $i | grep pdb.xz)" ]; then continue; fi
|
||||
if [ -n "$(echo $i | grep dbg.deb)" ]; then continue; fi
|
||||
|
||||
if [ ! -e ${FOLDER}/$i.md5sum ] || [ ! -e ${FOLDER}/$i.sha1sum ] || [ ! -e ${FOLDER}/$i.sha256sum ]; then
|
||||
echo "ERROR: missing checksum file for ${i}" 1>&2
|
||||
error="y"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "- id: $i" >> manifest.yaml
|
||||
echo " size: $(stat -c"%s" ${FOLDER}/$i)" >> manifest.yaml
|
||||
echo " md5sum: $(cat ${FOLDER}/$i.md5sum | cut -d\ -f1)" >> manifest.yaml
|
||||
echo " sha1sum: $(cat ${FOLDER}/$i.sha1sum | cut -d\ -f1)" >> manifest.yaml
|
||||
echo " sha256sum: $(cat ${FOLDER}/$i.sha256sum | cut -d\ -f1)" >> manifest.yaml
|
||||
done
|
||||
|
||||
if [ -n "${error}" ]; then
|
||||
echo "ERROR: exiting due to earlier errors" 1>&2
|
||||
exit 1
|
||||
fi
|
@@ -1,9 +0,0 @@
|
||||
steps:
|
||||
# Rebase to origin/master for every PR. This means users don't have to
|
||||
# rebase every time master changes. As long as the PR applies cleanly, we
|
||||
# will validate it.
|
||||
- script: |
|
||||
git config user.email 'info@openttd.org'
|
||||
git config user.name 'OpenTTD CI'
|
||||
git rebase origin/master
|
||||
displayName: 'Rebase to master'
|
@@ -1,8 +0,0 @@
|
||||
steps:
|
||||
- bash: |
|
||||
set -ex
|
||||
cd bin/baseset
|
||||
curl -L https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip > opengfx-0.5.2-all.zip
|
||||
unzip opengfx-0.5.2-all.zip
|
||||
rm -f opengfx-0.5.2-all.zip
|
||||
displayName: 'Install OpenGFX'
|
@@ -1,18 +0,0 @@
|
||||
parameters:
|
||||
Image: ''
|
||||
Tag: ''
|
||||
ContainerCommand: ''
|
||||
|
||||
steps:
|
||||
- task: Docker@1
|
||||
${{ if eq(parameters.Image, 'compile-farm') }}:
|
||||
displayName: 'Build'
|
||||
${{ if eq(parameters.Image, 'compile-farm-ci') }}:
|
||||
displayName: 'Build and test'
|
||||
inputs:
|
||||
command: 'Run an image'
|
||||
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
|
||||
volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)'
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
containerCommand: ${{ parameters.ContainerCommand }}
|
||||
runInBackground: false
|
@@ -1,5 +0,0 @@
|
||||
steps:
|
||||
# Because we run the compile in a docker (under root), we are not owner
|
||||
# of the 'bundles' folder. Fix that by executing a chown on it.
|
||||
- bash: sudo chown -R $(id -u):$(id -g) bundles
|
||||
displayName: 'Claim bundles folder back'
|
@@ -1,5 +0,0 @@
|
||||
steps:
|
||||
- script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static'
|
||||
displayName: 'Configure'
|
||||
- script: 'make -j2'
|
||||
displayName: 'Build'
|
@@ -1,11 +0,0 @@
|
||||
steps:
|
||||
- script: |
|
||||
set -ex
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng
|
||||
# Remove the dynamic libraries of these libraries, to ensure we use
|
||||
# the static versions. That is important, as it is unlikely any
|
||||
# end-user has these brew libraries installed.
|
||||
rm /usr/local/Cellar/lzo/*/lib/*.dylib
|
||||
rm /usr/local/Cellar/xz/*/lib/*.dylib
|
||||
rm /usr/local/Cellar/libpng/*/lib/*.dylib
|
||||
displayName: 'Install dependencies'
|
@@ -1,19 +0,0 @@
|
||||
parameters:
|
||||
CalculateChecksums: true
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.CalculateChecksums, true) }}:
|
||||
- bash: |
|
||||
set -ex
|
||||
cd bundles
|
||||
for i in $(ls); do
|
||||
openssl dgst -r -md5 -hex $i > $i.md5sum
|
||||
openssl dgst -r -sha1 -hex $i > $i.sha1sum
|
||||
openssl dgst -r -sha256 -hex $i > $i.sha256sum
|
||||
done
|
||||
displayName: 'Calculate checksums'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish bundles'
|
||||
inputs:
|
||||
PathtoPublish: bundles/
|
||||
ArtifactName: bundles
|
@@ -1,20 +0,0 @@
|
||||
# Fetch the source tarball as prepared by an earlier job. In there is the
|
||||
# version predefined. This ensures we are all going to compile the same
|
||||
# source with the same version.
|
||||
|
||||
steps:
|
||||
- checkout: none
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: 'Download source'
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: 'bundles/openttd-*-source.tar.xz'
|
||||
downloadPath: '$(Build.ArtifactStagingDirectory)'
|
||||
- bash: tar --xz -xf ../a/bundles/openttd-*-source.tar.xz --strip-components=1
|
||||
displayName: 'Extracting source'
|
||||
- bash: |
|
||||
set -e
|
||||
VERSION=$(cat .version)
|
||||
echo "${VERSION}"
|
||||
echo "##vso[build.updatebuildnumber]${VERSION}"
|
||||
displayName: 'Change BuildNumber to version'
|
@@ -1,20 +0,0 @@
|
||||
parameters:
|
||||
IsStableRelease: false
|
||||
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: 'Download all bundles'
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: 'bundles/*'
|
||||
downloadPath: '$(Build.ArtifactStagingDirectory)'
|
||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
- script: |
|
||||
touch .is_stable
|
||||
displayName: 'Mark as stable release'
|
||||
- script: |
|
||||
set -ex
|
||||
./azure-pipelines/manifest.sh ../a/bundles/
|
||||
mkdir -p bundles
|
||||
mv manifest.yaml bundles/
|
||||
displayName: 'Create manifest.yaml'
|
@@ -1,35 +0,0 @@
|
||||
# Set the revisions, and remove the VCS files.
|
||||
# This ensures everything else picks up on the predefined versions, and not
|
||||
# that because of some build process the version all of a sudden changes.
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set -ex
|
||||
|
||||
if [ -n "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]; then
|
||||
# We are triggered from a GitHub Pull Request
|
||||
git checkout -B pr${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}
|
||||
elif [ "${BUILD_SOURCEBRANCHNAME}" = "merge" ] || [ "${BUILD_SOURCEBRANCHNAME}" = "head" ]; then
|
||||
# We are manually triggered based on a GitHub Pull Request
|
||||
PULLREQUESTNUMBER=$(echo ${BUILD_SOURCEBRANCH} | cut -d/ -f3)
|
||||
git checkout -B pr${PULLREQUESTNUMBER}
|
||||
else
|
||||
git checkout -B ${BUILD_SOURCEBRANCHNAME}
|
||||
fi
|
||||
|
||||
./findversion.sh > .ottdrev
|
||||
./azure-pipelines/changelog.sh > .changelog
|
||||
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
|
||||
cat .ottdrev | cut -f 1 -d$'\t' > .version
|
||||
echo "Release Date: $(cat .release_date)"
|
||||
echo "Revision: $(cat .ottdrev)"
|
||||
echo "Version: $(cat .version)"
|
||||
displayName: 'Create version files'
|
||||
- script: |
|
||||
set -e
|
||||
VERSION=$(cat .version)
|
||||
echo "${VERSION}"
|
||||
echo "##vso[build.updatebuildnumber]${VERSION}"
|
||||
displayName: 'Change BuildNumber to version'
|
||||
- script: find . -iname .hg -or -iname .git -or -iname .svn | xargs rm -rf
|
||||
displayName: 'Remove VCS information'
|
@@ -1,175 +0,0 @@
|
||||
parameters:
|
||||
# If this is false, not all targets are triggered. For example:
|
||||
# The NSIS installer for Windows and the creation of debs only work for
|
||||
# releases. Not for any other type of binary. So they are skilled if this
|
||||
# is set to false.
|
||||
IsStableRelease: false
|
||||
|
||||
jobs:
|
||||
- job: source
|
||||
displayName: 'Source'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
|
||||
steps:
|
||||
- template: release-prepare-source.yml
|
||||
- script: |
|
||||
set -ex
|
||||
|
||||
# Rename the folder to openttd-NNN-source
|
||||
mkdir openttd-$(Build.BuildNumber)
|
||||
find . -maxdepth 1 -not -name . -not -name openttd-$(Build.BuildNumber) -exec mv {} openttd-$(Build.BuildNumber)/ \;
|
||||
# Copy back release_date, as it is needed for the template 'release-bundles'
|
||||
cp openttd-$(Build.BuildNumber)/.release_date .release_date
|
||||
|
||||
mkdir bundles
|
||||
tar --xz -cf bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
|
||||
zip -9 -r -q bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
|
||||
displayName: 'Create bundle'
|
||||
- template: release-bundles.yml
|
||||
|
||||
- job: meta
|
||||
displayName: 'Metadata'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
dependsOn: source
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- script: |
|
||||
set -ex
|
||||
|
||||
mkdir -p bundles
|
||||
cp .changelog bundles/changelog.txt
|
||||
cp .release_date bundles/released.txt
|
||||
cp README.md bundles/README.md
|
||||
displayName: 'Copy meta files'
|
||||
- template: release-bundles.yml
|
||||
parameters:
|
||||
CalculateChecksums: false
|
||||
|
||||
- job: docs
|
||||
displayName: 'Docs'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
dependsOn: source
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- template: linux-build.yml
|
||||
parameters:
|
||||
Image: compile-farm
|
||||
ContainerCommand: '$(Build.BuildNumber)'
|
||||
Tag: docs
|
||||
- template: linux-claim-bundles.yml
|
||||
- template: release-bundles.yml
|
||||
|
||||
- job: windows
|
||||
displayName: 'Windows'
|
||||
pool:
|
||||
vmImage: 'VS2017-Win2016'
|
||||
dependsOn: source
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
Win32:
|
||||
BuildPlatform: 'Win32'
|
||||
BundlePlatform: 'win32'
|
||||
Win64:
|
||||
BuildPlatform: 'x64'
|
||||
BundlePlatform: 'win64'
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- template: windows-dependencies.yml
|
||||
- template: windows-dependency-zip.yml
|
||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
- template: windows-dependency-nsis.yml
|
||||
- template: windows-build.yml
|
||||
parameters:
|
||||
BuildPlatform: $(BuildPlatform)
|
||||
- bash: |
|
||||
set -ex
|
||||
make -f Makefile.msvc bundle_pdb bundle_zip PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
|
||||
displayName: 'Create bundles'
|
||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
- bash: |
|
||||
set -ex
|
||||
# NSIS will be part of the Hosted image in the next update. Till then, we set the PATH ourself
|
||||
export PATH="${PATH}:/c/Program Files (x86)/NSIS"
|
||||
make -f Makefile.msvc bundle_exe PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
|
||||
displayName: 'Create installer bundle'
|
||||
- template: release-bundles.yml
|
||||
|
||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
- job: linux_stable
|
||||
displayName: 'Linux'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
dependsOn: source
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
linux-ubuntu-xenial-i386-gcc: {}
|
||||
linux-ubuntu-xenial-amd64-gcc: {}
|
||||
linux-ubuntu-bionic-i386-gcc: {}
|
||||
linux-ubuntu-bionic-amd64-gcc: {}
|
||||
linux-debian-jessie-i386-gcc: {}
|
||||
linux-debian-jessie-amd64-gcc: {}
|
||||
linux-debian-stretch-i386-gcc: {}
|
||||
linux-debian-stretch-amd64-gcc: {}
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- template: linux-build.yml
|
||||
parameters:
|
||||
Image: compile-farm
|
||||
ContainerCommand: '$(Build.BuildNumber)'
|
||||
Tag: $(Agent.JobName)
|
||||
- template: linux-claim-bundles.yml
|
||||
- template: release-bundles.yml
|
||||
|
||||
- job: macos
|
||||
displayName: 'MacOS'
|
||||
pool:
|
||||
vmImage: 'macOS-10.13'
|
||||
dependsOn: source
|
||||
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.9
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- template: osx-dependencies.yml
|
||||
- template: osx-build.yml
|
||||
- script: 'make bundle_zip bundle_dmg BUNDLE_NAME=openttd-$(Build.BuildNumber)-macosx'
|
||||
displayName: 'Create bundles'
|
||||
- template: release-bundles.yml
|
||||
|
||||
- job: manifest
|
||||
displayName: 'Manifest'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
dependsOn:
|
||||
- source
|
||||
- docs
|
||||
- windows
|
||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
- linux_stable
|
||||
- macos
|
||||
# "Skipped" is not a status, and is not succeeded. So it seems to be
|
||||
# considered failed. So we trigger if all the earlier jobs are done (which
|
||||
# might be succeeded, failed, or skipped), and run this job. This is not
|
||||
# optimal, but given the rules, it is the only way to get this to work (as
|
||||
# some jobs might be skipped).
|
||||
condition: succeededOrFailed()
|
||||
|
||||
steps:
|
||||
- template: release-fetch-source.yml
|
||||
- template: release-manifest.yml
|
||||
${{ if eq(parameters.IsStableRelease, true) }}:
|
||||
parameters:
|
||||
IsStableRelease: true
|
||||
- template: release-bundles.yml
|
||||
parameters:
|
||||
CalculateChecksums: false
|
@@ -1,11 +0,0 @@
|
||||
parameters:
|
||||
BuildPlatform: ''
|
||||
|
||||
steps:
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build'
|
||||
inputs:
|
||||
solution: 'projects/openttd_vs141.sln'
|
||||
platform: ${{ parameters.BuildPlatform }}
|
||||
configuration: Release
|
||||
maximumCpuCount: true
|
@@ -1,10 +0,0 @@
|
||||
steps:
|
||||
- bash: |
|
||||
set -ex
|
||||
curl -L https://github.com/OpenTTD/CompileFarm/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip
|
||||
unzip windows-dependencies.zip
|
||||
rm -f windows-dependencies.zip
|
||||
displayName: 'Download dependencies'
|
||||
workingDirectory: $(Build.ArtifactStagingDirectory)
|
||||
- script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install
|
||||
displayName: 'Install dependencies'
|
@@ -1,26 +0,0 @@
|
||||
parameters:
|
||||
condition: true
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
set -ex
|
||||
|
||||
mkdir nsis-plugin; cd nsis-plugin
|
||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/Nsis7z.zip > Nsis7z.zip
|
||||
unzip Nsis7z.zip
|
||||
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/"
|
||||
cd ..; rm -rf nsis-plugin
|
||||
|
||||
mkdir nsis-plugin; cd nsis-plugin
|
||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisGetVersion.zip > NsisGetVersion.zip
|
||||
unzip NsisGetVersion.zip
|
||||
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
|
||||
cd ..; rm -rf nsis-plugin
|
||||
|
||||
mkdir nsis-plugin; cd nsis-plugin
|
||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisFindProc.zip > NsisFindProc.zip
|
||||
unzip NsisFindProc.zip
|
||||
cp -R *.dll "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
|
||||
cd ..; rm -rf nsis-plugin
|
||||
displayName: 'Install NSIS with the 7z, GetVersion, and FindProc plugins'
|
||||
condition: and(succeeded(), ${{ parameters.condition }})
|
@@ -1,5 +0,0 @@
|
||||
steps:
|
||||
- bash: |
|
||||
set -ex
|
||||
choco install zip
|
||||
displayName: 'Install zip'
|
@@ -1,376 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("0.7 API compatibility in effect:");
|
||||
AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
|
||||
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
|
||||
AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
|
||||
|
||||
AISign.GetMaxSignID <- function()
|
||||
{
|
||||
local list = AISignList();
|
||||
local max_id = 0;
|
||||
foreach (id, d in list) {
|
||||
if (id > max_id) max_id = id;
|
||||
}
|
||||
return max_id;
|
||||
}
|
||||
|
||||
AITile.GetHeight <- function(tile)
|
||||
{
|
||||
if (!AIMap.IsValidTile(tile)) return -1;
|
||||
|
||||
return AITile.GetCornerHeight(tile, AITile.CORNER_N);
|
||||
}
|
||||
|
||||
AIOrder.ChangeOrder <- function(vehicle_id, order_position, order_flags)
|
||||
{
|
||||
return AIOrder.SetOrderFlags(vehicle_id, order_position, order_flags);
|
||||
}
|
||||
|
||||
AIWaypoint.WAYPOINT_INVALID <- 0xFFFF;
|
||||
|
||||
AISubsidy.SourceIsTown <- function(subsidy_id)
|
||||
{
|
||||
if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
|
||||
|
||||
return AISubsidy.GetSourceType(subsidy_id) == AISubsidy.SPT_TOWN;
|
||||
}
|
||||
|
||||
AISubsidy.GetSource <- function(subsidy_id)
|
||||
{
|
||||
if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
|
||||
|
||||
if (AISubsidy.IsAwarded(subsidy_id)) {
|
||||
return AIBaseStation.STATION_INVALID;
|
||||
}
|
||||
|
||||
return AISubsidy.GetSourceIndex(subsidy_id);
|
||||
}
|
||||
|
||||
AISubsidy.DestinationIsTown <- function(subsidy_id)
|
||||
{
|
||||
if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
|
||||
|
||||
return AISubsidy.GetDestinationType(subsidy_id) == AISubsidy.SPT_TOWN;
|
||||
}
|
||||
|
||||
AISubsidy.GetDestination <- function(subsidy_id)
|
||||
{
|
||||
if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
|
||||
|
||||
if (AISubsidy.IsAwarded(subsidy_id)) {
|
||||
return AIBaseStation.STATION_INVALID;
|
||||
}
|
||||
|
||||
return AISubsidy.GetDestinationIndex(subsidy_id);
|
||||
}
|
||||
|
||||
AITown.GetMaxProduction <- function(town_id, cargo_id)
|
||||
{
|
||||
return AITown.GetLastMonthProduction(town_id, cargo_id);
|
||||
}
|
||||
|
||||
AIRail.RemoveRailWaypoint <- function(tile)
|
||||
{
|
||||
return AIRail.RemoveRailWaypointTileRect(tile, tile, true);
|
||||
}
|
||||
|
||||
AIRail.RemoveRailStationTileRect <- function(tile, tile2)
|
||||
{
|
||||
return AIRail.RemoveRailStationTileRectangle(tile, tile2, false);
|
||||
}
|
||||
|
||||
AIVehicle.SkipToVehicleOrder <- function(vehicle_id, order_position)
|
||||
{
|
||||
return AIOrder.SkipToOrder(vehicle_id, order_position);
|
||||
}
|
||||
|
||||
AIEngine.IsValidEngine <- function(engine_id)
|
||||
{
|
||||
return AIEngine.IsBuildable(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetName <- AIEngine.GetName;
|
||||
AIEngine.GetName <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return null;
|
||||
return AIEngine._GetName(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetCargoType <- AIEngine.GetCargoType;
|
||||
AIEngine.GetCargoType <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return 255;
|
||||
return AIEngine._GetCargoType(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._CanRefitCargo <- AIEngine.CanRefitCargo;
|
||||
AIEngine.CanRefitCargo <- function(engine_id, cargo_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._CanRefitCargo(engine_id, cargo_id);
|
||||
}
|
||||
|
||||
AIEngine._CanPullCargo <- AIEngine.CanPullCargo;
|
||||
AIEngine.CanPullCargo <- function(engine_id, cargo_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._CanPullCargo(engine_id, cargo_id);
|
||||
}
|
||||
|
||||
AIEngine._GetCapacity <- AIEngine.GetCapacity;
|
||||
AIEngine.GetCapacity <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetCapacity(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetReliability <- AIEngine.GetReliability;
|
||||
AIEngine.GetReliability <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetReliability(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetMaxSpeed <- AIEngine.GetMaxSpeed;
|
||||
AIEngine.GetMaxSpeed <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetMaxSpeed(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetPrice <- AIEngine.GetPrice;
|
||||
AIEngine.GetPrice <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetPrice(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetMaxAge <- AIEngine.GetMaxAge;
|
||||
AIEngine.GetMaxAge <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetMaxAge(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetRunningCost <- AIEngine.GetRunningCost;
|
||||
AIEngine.GetRunningCost <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetRunningCost(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetPower <- AIEngine.GetPower;
|
||||
AIEngine.GetPower <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetPower(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetWeight <- AIEngine.GetWeight;
|
||||
AIEngine.GetWeight <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetWeight(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetMaxTractiveEffort <- AIEngine.GetMaxTractiveEffort;
|
||||
AIEngine.GetMaxTractiveEffort <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetMaxTractiveEffort(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetDesignDate <- AIEngine.GetDesignDate;
|
||||
AIEngine.GetDesignDate <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetDesignDate(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetVehicleType <- AIEngine.GetVehicleType;
|
||||
AIEngine.GetVehicleType <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return AIVehicle.VT_INVALID;
|
||||
return AIEngine._GetVehicleType(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._IsWagon <- AIEngine.IsWagon;
|
||||
AIEngine.IsWagon <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._IsWagon(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._CanRunOnRail <- AIEngine.CanRunOnRail;
|
||||
AIEngine.CanRunOnRail <- function(engine_id, track_rail_type)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._CanRunOnRail(engine_id, track_rail_type);
|
||||
}
|
||||
|
||||
AIEngine._HasPowerOnRail <- AIEngine.HasPowerOnRail;
|
||||
AIEngine.HasPowerOnRail <- function(engine_id, track_rail_type)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._HasPowerOnRail(engine_id, track_rail_type);
|
||||
}
|
||||
|
||||
AIEngine._GetRoadType <- AIEngine.GetRoadType;
|
||||
AIEngine.GetRoadType <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return AIRoad.ROADTYPE_INVALID;
|
||||
return AIEngine._GetRoadType(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetRailType <- AIEngine.GetRailType;
|
||||
AIEngine.GetRailType <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return AIRail.RAILTYPE_INVALID;
|
||||
return AIEngine._GetRailType(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._IsArticulated <- AIEngine.IsArticulated;
|
||||
AIEngine.IsArticulated <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return false;
|
||||
return AIEngine._IsArticulated(engine_id);
|
||||
}
|
||||
|
||||
AIEngine._GetPlaneType <- AIEngine.GetPlaneType;
|
||||
AIEngine.GetPlaneType <- function(engine_id)
|
||||
{
|
||||
if (!AIEngine.IsBuildable(engine_id)) return -1;
|
||||
return AIEngine._GetPlaneType(engine_id);
|
||||
}
|
||||
|
||||
_AIWaypointList <- AIWaypointList;
|
||||
class AIWaypointList extends _AIWaypointList {
|
||||
constructor()
|
||||
{
|
||||
::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL);
|
||||
}
|
||||
}
|
||||
|
||||
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
|
||||
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
|
||||
{
|
||||
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
|
||||
|
||||
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
|
||||
}
|
||||
|
||||
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
|
||||
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
|
||||
{
|
||||
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
|
||||
|
||||
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
|
||||
}
|
||||
|
||||
AIBridgeList.HasNext <-
|
||||
AIBridgeList_Length.HasNext <-
|
||||
AICargoList.HasNext <-
|
||||
AICargoList_IndustryAccepting.HasNext <-
|
||||
AICargoList_IndustryProducing.HasNext <-
|
||||
AIDepotList.HasNext <-
|
||||
AIEngineList.HasNext <-
|
||||
AIGroupList.HasNext <-
|
||||
AIIndustryList.HasNext <-
|
||||
AIIndustryList_CargoAccepting.HasNext <-
|
||||
AIIndustryList_CargoProducing.HasNext <-
|
||||
AIIndustryTypeList.HasNext <-
|
||||
AIList.HasNext <-
|
||||
AIRailTypeList.HasNext <-
|
||||
AISignList.HasNext <-
|
||||
AIStationList.HasNext <-
|
||||
AIStationList_Vehicle.HasNext <-
|
||||
AISubsidyList.HasNext <-
|
||||
AITileList.HasNext <-
|
||||
AITileList_IndustryAccepting.HasNext <-
|
||||
AITileList_IndustryProducing.HasNext <-
|
||||
AITileList_StationType.HasNext <-
|
||||
AITownList.HasNext <-
|
||||
AIVehicleList.HasNext <-
|
||||
AIVehicleList_DefaultGroup.HasNext <-
|
||||
AIVehicleList_Group.HasNext <-
|
||||
AIVehicleList_SharedOrders.HasNext <-
|
||||
AIVehicleList_Station.HasNext <-
|
||||
AIWaypointList.HasNext <-
|
||||
AIWaypointList_Vehicle.HasNext <-
|
||||
function()
|
||||
{
|
||||
return !this.IsEnd();
|
||||
}
|
||||
|
||||
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
|
||||
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
|
||||
{
|
||||
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
AIAbstractList <- AIList;
|
||||
|
||||
AIList.ChangeItem <- AIList.SetValue;
|
||||
|
||||
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
|
||||
|
||||
AICompany.GetCompanyValue <- function(company)
|
||||
{
|
||||
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
|
||||
}
|
||||
|
||||
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
|
||||
|
||||
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
|
||||
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
|
||||
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
|
||||
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
|
||||
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
|
||||
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
|
||||
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
|
||||
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
|
||||
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
|
||||
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
|
||||
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
|
||||
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
|
||||
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
|
||||
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
|
||||
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
|
||||
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
|
||||
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
|
||||
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
|
||||
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
|
||||
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
|
||||
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
|
||||
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
|
||||
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
|
||||
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
|
||||
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
|
||||
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
|
||||
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
|
||||
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
|
||||
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
|
||||
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
|
||||
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
|
||||
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
|
||||
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
|
||||
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,128 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.0 API compatibility in effect.");
|
||||
|
||||
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
|
||||
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
|
||||
{
|
||||
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
|
||||
|
||||
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
|
||||
}
|
||||
|
||||
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
|
||||
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
|
||||
{
|
||||
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
|
||||
|
||||
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
|
||||
}
|
||||
|
||||
AIBridgeList.HasNext <-
|
||||
AIBridgeList_Length.HasNext <-
|
||||
AICargoList.HasNext <-
|
||||
AICargoList_IndustryAccepting.HasNext <-
|
||||
AICargoList_IndustryProducing.HasNext <-
|
||||
AIDepotList.HasNext <-
|
||||
AIEngineList.HasNext <-
|
||||
AIGroupList.HasNext <-
|
||||
AIIndustryList.HasNext <-
|
||||
AIIndustryList_CargoAccepting.HasNext <-
|
||||
AIIndustryList_CargoProducing.HasNext <-
|
||||
AIIndustryTypeList.HasNext <-
|
||||
AIList.HasNext <-
|
||||
AIRailTypeList.HasNext <-
|
||||
AISignList.HasNext <-
|
||||
AIStationList.HasNext <-
|
||||
AIStationList_Vehicle.HasNext <-
|
||||
AISubsidyList.HasNext <-
|
||||
AITileList.HasNext <-
|
||||
AITileList_IndustryAccepting.HasNext <-
|
||||
AITileList_IndustryProducing.HasNext <-
|
||||
AITileList_StationType.HasNext <-
|
||||
AITownList.HasNext <-
|
||||
AIVehicleList.HasNext <-
|
||||
AIVehicleList_DefaultGroup.HasNext <-
|
||||
AIVehicleList_Depot.HasNext <-
|
||||
AIVehicleList_Group.HasNext <-
|
||||
AIVehicleList_SharedOrders.HasNext <-
|
||||
AIVehicleList_Station.HasNext <-
|
||||
AIWaypointList.HasNext <-
|
||||
AIWaypointList_Vehicle.HasNext <-
|
||||
function()
|
||||
{
|
||||
return !this.IsEnd();
|
||||
}
|
||||
|
||||
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
|
||||
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
|
||||
{
|
||||
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
AIAbstractList <- AIList;
|
||||
|
||||
AIList.ChangeItem <- AIList.SetValue;
|
||||
|
||||
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
|
||||
|
||||
AICompany.GetCompanyValue <- function(company)
|
||||
{
|
||||
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
|
||||
}
|
||||
|
||||
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
|
||||
|
||||
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
|
||||
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
|
||||
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
|
||||
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
|
||||
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
|
||||
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
|
||||
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
|
||||
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
|
||||
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
|
||||
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
|
||||
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
|
||||
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
|
||||
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
|
||||
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
|
||||
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
|
||||
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
|
||||
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
|
||||
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
|
||||
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
|
||||
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
|
||||
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
|
||||
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
|
||||
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
|
||||
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
|
||||
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
|
||||
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
|
||||
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
|
||||
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
|
||||
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
|
||||
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
|
||||
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
|
||||
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
|
||||
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
|
||||
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
|
||||
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,65 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.1 API compatibility in effect.");
|
||||
|
||||
AICompany.GetCompanyValue <- function(company)
|
||||
{
|
||||
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
|
||||
}
|
||||
|
||||
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
|
||||
|
||||
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
|
||||
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
|
||||
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
|
||||
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
|
||||
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
|
||||
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
|
||||
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
|
||||
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
|
||||
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
|
||||
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
|
||||
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
|
||||
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
|
||||
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
|
||||
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
|
||||
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
|
||||
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
|
||||
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
|
||||
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
|
||||
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
|
||||
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
|
||||
AIEvent.AI_ET_TOWN_FOUNDED <- AIEvent.ET_TOWN_FOUNDED;
|
||||
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
|
||||
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
|
||||
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
|
||||
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
|
||||
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
|
||||
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
|
||||
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
|
||||
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
|
||||
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
|
||||
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
|
||||
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
|
||||
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
|
||||
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
|
||||
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
|
||||
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
|
||||
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
|
||||
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.2 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.3 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.4 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.5 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.6 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.7 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
AILog.Info("1.8 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
AIBridge._GetName <- AIBridge.GetName;
|
||||
AIBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
@@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
if ! [ -f ai/regression/completeness.sh ]; then
|
||||
echo "Make sure you are in the root of OpenTTD before starting this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
|
||||
/^function/ {
|
||||
for (local in locals) {
|
||||
delete locals[local]
|
||||
}
|
||||
if (match($0, "function Regression::Start") || match($0, "function Regression::Stop")) next
|
||||
locals["this"] = "AIControllerSquirrel"
|
||||
}
|
||||
|
||||
/local/ {
|
||||
gsub(".*local", "local")
|
||||
if (match($4, "^AI")) {
|
||||
sub("\\(.*", "", $4)
|
||||
locals[$2] = $4
|
||||
}
|
||||
}
|
||||
|
||||
/Valuate/ {
|
||||
gsub(".*Valuate\\(", "")
|
||||
gsub("\\).*", "")
|
||||
gsub(",.*", "")
|
||||
gsub("\\.", "::")
|
||||
print $0
|
||||
}
|
||||
|
||||
/\./ {
|
||||
for (local in locals) {
|
||||
if (match($0, local ".")) {
|
||||
fname = substr($0, index($0, local "."))
|
||||
sub("\\(.*", "", fname)
|
||||
sub("\\.", "::", fname)
|
||||
sub(local, locals[local], fname)
|
||||
print fname
|
||||
if (match(locals[local], "List")) {
|
||||
sub(locals[local], "AIAbstractList", fname)
|
||||
print fname
|
||||
}
|
||||
}
|
||||
}
|
||||
# We want to remove everything before the FIRST occurence of AI.
|
||||
# If we do not remove any other occurences of AI from the string
|
||||
# we will remove everything before the LAST occurence of AI, so
|
||||
# do some little magic to make it work the way we want.
|
||||
sub("AI", "AXXXXY")
|
||||
gsub("AI", "AXXXXX")
|
||||
sub(".*AXXXXY", "AI")
|
||||
if (match($0, "^AI") && match($0, ".")) {
|
||||
sub("\\(.*", "", $0)
|
||||
sub("\\.", "::", $0)
|
||||
print $0
|
||||
}
|
||||
}
|
||||
' | sed 's/ //g' | sort | uniq > tmp.in_regression
|
||||
|
||||
grep 'DefSQ.*Method' ../src/script/api/ai/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api
|
||||
|
||||
diff -u tmp.in_regression tmp.in_api | grep -v '^+++' | grep '^+' | sed 's/^+//'
|
||||
|
||||
rm -f tmp.in_regression tmp.in_api
|
||||
|
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
[misc]
|
||||
display_opt = SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|WAYPOINTS
|
||||
language = english.lng
|
||||
|
||||
[gui]
|
||||
autosave = off
|
||||
|
||||
[game_creation]
|
||||
town_name = english
|
||||
|
||||
[ai_players]
|
||||
none =
|
||||
regression =
|
||||
|
||||
[vehicle]
|
||||
road_side = right
|
||||
plane_speed = 2
|
||||
|
||||
[construction]
|
||||
max_bridge_length = 100
|
@@ -1,15 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
class Regression extends AIInfo {
|
||||
function GetAuthor() { return "OpenTTD NoAI Developers Team"; }
|
||||
function GetName() { return "Regression"; }
|
||||
function GetShortName() { return "REGR"; }
|
||||
function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
|
||||
function GetVersion() { return 1; }
|
||||
function GetAPIVersion() { return "1.9"; }
|
||||
function GetDate() { return "2007-03-18"; }
|
||||
function CreateInstance() { return "Regression"; }
|
||||
}
|
||||
|
||||
RegisterAI(Regression());
|
||||
|
@@ -1,71 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
if ! [ -f ai/regression/run.sh ]; then
|
||||
echo "Make sure you are in the root of OpenTTD before starting this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f scripts/game_start.scr ]; then
|
||||
mv scripts/game_start.scr scripts/game_start.scr.regression
|
||||
fi
|
||||
|
||||
params=""
|
||||
gdb=""
|
||||
if [ "$1" != "-r" ]; then
|
||||
params="-snull -mnull -vnull:ticks=30000"
|
||||
fi
|
||||
if [ "$1" = "-g" ]; then
|
||||
gdb="gdb --ex run --args "
|
||||
fi
|
||||
|
||||
if [ -d "ai/regression/tst_$1" ]; then
|
||||
tests="ai/regression/tst_$1"
|
||||
elif [ -d "ai/regression/tst_$2" ]; then
|
||||
tests="ai/regression/tst_$2"
|
||||
else
|
||||
tests=ai/regression/tst_*
|
||||
fi
|
||||
|
||||
ret=0
|
||||
for tst in $tests; do
|
||||
echo -n "Running $tst... "
|
||||
|
||||
# Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
|
||||
cp ai/regression/regression_info.nut $tst/info.nut
|
||||
|
||||
sav=$tst/test.sav
|
||||
if ! [ -f $sav ]; then
|
||||
sav=ai/regression/empty.sav
|
||||
fi
|
||||
|
||||
if [ -n "$gdb" ]; then
|
||||
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g $sav
|
||||
else
|
||||
./openttd -x -c ai/regression/regression.cfg $params -g $sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > $tst/tmp.regression
|
||||
fi
|
||||
|
||||
if [ -z "$gdb" ]; then
|
||||
res="`diff -ub $tst/result.txt $tst/tmp.regression`"
|
||||
if [ -z "$res" ]; then
|
||||
echo "passed!"
|
||||
else
|
||||
echo "failed! Difference:"
|
||||
echo "$res"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm $tst/info.nut
|
||||
|
||||
if [ "$1" != "-k" ]; then
|
||||
rm -f $tst/tmp.regression
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -f scripts/game_start.scr.regression ]; then
|
||||
mv scripts/game_start.scr.regression scripts/game_start.scr
|
||||
fi
|
||||
|
||||
exit $ret
|
@@ -1,154 +0,0 @@
|
||||
Option Explicit
|
||||
|
||||
' $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/>.
|
||||
|
||||
Dim FSO
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
Function GetTestList()
|
||||
Dim retests, i, tests, dir
|
||||
Set retests = New RegExp
|
||||
Set GetTestList = CreateObject("Scripting.Dictionary")
|
||||
|
||||
retests.Pattern = "ai/regression/tst_*"
|
||||
retests.Global = True
|
||||
For i = 0 To WScript.Arguments.Count - 1
|
||||
Dim test
|
||||
test = "ai/regression/tst_" & WScript.Arguments.Item(i)
|
||||
If FSO.FolderExists(test) Then
|
||||
retests.Pattern = test
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each dir In FSO.GetFolder("ai/regression/").SubFolders
|
||||
Dim name
|
||||
name = "ai/regression/" & dir.Name
|
||||
If retests.Test(name) Then
|
||||
GetTestList.Add name, name
|
||||
End If
|
||||
Next
|
||||
End Function
|
||||
|
||||
Function GetParams()
|
||||
GetParams = "-snull -mnull -vnull:ticks=30000"
|
||||
If WScript.Arguments.Count = 0 Then Exit Function
|
||||
If WScript.Arguments.Item(0) <> "-r" Then Exit Function
|
||||
GetParams = ""
|
||||
End Function
|
||||
|
||||
Sub FilterFile(filename)
|
||||
Dim lines, filter, file
|
||||
|
||||
Set file = FSO.OpenTextFile(filename, 1)
|
||||
If Not file.AtEndOfStream Then
|
||||
lines = file.ReadAll
|
||||
End If
|
||||
file.Close
|
||||
|
||||
Set filter = New RegExp
|
||||
filter.Global = True
|
||||
filter.Multiline = True
|
||||
filter.Pattern = "0x(\(nil\)|0+)(x0)?"
|
||||
lines = filter.Replace(lines, "0x00000000")
|
||||
filter.Pattern = "^dbg: \[script\]"
|
||||
lines = filter.Replace(lines, "")
|
||||
filter.Pattern = "^ "
|
||||
lines = filter.Replace(lines, "ERROR: ")
|
||||
filter.Pattern = "ERROR: \[1\] \[P\] "
|
||||
lines = filter.Replace(lines, "")
|
||||
filter.Pattern = "^dbg: .*\r\n"
|
||||
lines = filter.Replace(lines, "")
|
||||
|
||||
Set file = FSO.OpenTextFile(filename, 2)
|
||||
file.Write lines
|
||||
file.Close
|
||||
End Sub
|
||||
|
||||
Function CompareFiles(filename1, filename2)
|
||||
Dim file, lines1, lines2
|
||||
Set file = FSO.OpenTextFile(filename1, 1)
|
||||
If Not file.AtEndOfStream Then
|
||||
lines1 = file.ReadAll
|
||||
End IF
|
||||
file.Close
|
||||
Set file = FSO.OpenTextFile(filename2, 1)
|
||||
If Not file.AtEndOfStream Then
|
||||
lines2 = file.ReadAll
|
||||
End IF
|
||||
file.Close
|
||||
CompareFiles = (lines1 = lines2)
|
||||
End Function
|
||||
|
||||
Function RunTest(test, params, ret)
|
||||
Dim WshShell, oExec, sav, command
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
|
||||
' Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
|
||||
FSO.CopyFile "ai/regression/regression_info.nut", test & "/info.nut"
|
||||
|
||||
sav = test & "/test.sav"
|
||||
If Not FSO.FileExists(sav) Then
|
||||
sav = "ai/regression/empty.sav"
|
||||
End If
|
||||
|
||||
command = ".\openttd -x -c ai/regression/regression.cfg " & params & " -g " & sav & " -d script=2 -d misc=9"
|
||||
' 2>&1 must be after >tmp.regression, else stderr is not redirected to the file
|
||||
WshShell.Run "cmd /c " & command & " >"& test & "/tmp.regression 2>&1", 0, True
|
||||
|
||||
FilterFile test & "/tmp.regression"
|
||||
|
||||
If CompareFiles(test & "/result.txt", test & "/tmp.regression") Then
|
||||
RunTest = "passed!"
|
||||
Else
|
||||
RunTest = "failed!"
|
||||
ret = 1
|
||||
End If
|
||||
|
||||
FSO.DeleteFile test & "/info.nut"
|
||||
|
||||
If WScript.Arguments.Count > 0 Then
|
||||
If WScript.Arguments.Item(0) = "-k" Then
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
|
||||
FSO.DeleteFile test & "/tmp.regression"
|
||||
End Function
|
||||
|
||||
On Error Resume Next
|
||||
WScript.StdOut.WriteLine ""
|
||||
If Err.Number <> 0 Then
|
||||
WScript.Echo "This script must be started with cscript."
|
||||
WScript.Quit 1
|
||||
End If
|
||||
On Error Goto 0
|
||||
|
||||
If Not FSO.FileExists("ai/regression/run.vbs") Then
|
||||
WScript.Echo "Make sure you are in the root of OpenTTD before starting this script."
|
||||
WScript.Quit 1
|
||||
End If
|
||||
|
||||
If FSO.FileExists("scripts/game_start.scr") Then
|
||||
FSO.MoveFile "scripts/game_start.scr", "scripts/game_start.scr.regression"
|
||||
End If
|
||||
|
||||
Dim params, test, ret
|
||||
params = GetParams()
|
||||
ret = 0
|
||||
|
||||
For Each test in GetTestList()
|
||||
WScript.StdOut.Write "Running " & test & "... "
|
||||
WScript.StdOut.WriteLine RunTest(test, params, ret)
|
||||
Next
|
||||
|
||||
If FSO.FileExists("scripts/game_start.scr.regression") Then
|
||||
FSO.MoveFile "scripts/game_start.scr.regression", "scripts/game_start.scr"
|
||||
End If
|
||||
|
||||
WScript.Quit ret
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
print(" Required this file");
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,216 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
class Regression extends AIController {
|
||||
function Start();
|
||||
};
|
||||
|
||||
|
||||
function Regression::StationList()
|
||||
{
|
||||
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
|
||||
|
||||
print("");
|
||||
print("--StationList--");
|
||||
print(" Count(): " + list.Count());
|
||||
list.Valuate(AIStation.GetLocation);
|
||||
print(" Location ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetCargoWaiting, 0);
|
||||
print(" CargoWaiting(0) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetCargoWaiting, 1);
|
||||
print(" CargoWaiting(1) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_Cargo()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_Cargo--");
|
||||
|
||||
for (local mode = AIStationList_Cargo.CM_WAITING; mode <= AIStationList_Cargo.CM_PLANNED; ++mode) {
|
||||
print(" " + mode);
|
||||
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA ; ++selector) {
|
||||
print(" " + selector);
|
||||
local list = AIStationList_Cargo(mode, selector, 6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoPlanned()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoPlanned--");
|
||||
|
||||
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
|
||||
print(" " + selector);
|
||||
local list = AIStationList_CargoPlanned(selector, 6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoPlannedByFrom()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoPlannedByFrom--");
|
||||
local list = AIStationList_CargoPlannedByFrom(2, 0);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoPlannedByVia()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoPlannedByVia--");
|
||||
local list = AIStationList_CargoPlannedByVia(2, 0);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoPlannedViaByFrom()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoPlannedViaByFrom--");
|
||||
local list = AIStationList_CargoPlannedViaByFrom(6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoPlannedFromByVia()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoPlannedFromByVia--");
|
||||
local list = AIStationList_CargoPlannedFromByVia(6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoWaiting()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoWaiting--");
|
||||
|
||||
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
|
||||
print(" " + selector);
|
||||
local list = AIStationList_CargoWaiting(selector, 6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoWaitingByFrom()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoWaitingByFrom--");
|
||||
local list = AIStationList_CargoWaitingByFrom(2, 0);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoWaitingByVia()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoWaitingByVia--");
|
||||
local list = AIStationList_CargoWaitingByVia(2, 0);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoWaitingViaByFrom()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoWaitingViaByFrom--");
|
||||
local list = AIStationList_CargoWaitingViaByFrom(6, 0, 7);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_CargoWaitingFromByVia()
|
||||
{
|
||||
print("");
|
||||
print("--StationList_CargoWaitingFromByVia--");
|
||||
local list = AIStationList_CargoWaitingFromByVia(2, 0, 2);
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
};
|
||||
|
||||
function Regression::StationList_Vehicle()
|
||||
{
|
||||
local list = AIStationList_Vehicle(12);
|
||||
|
||||
print("");
|
||||
print("--StationList_Vehicle--");
|
||||
print(" Count(): " + list.Count());
|
||||
list.Valuate(AIStation.GetLocation);
|
||||
print(" Location ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetCargoWaiting, 0);
|
||||
print(" CargoWaiting(0) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetCargoWaiting, 1);
|
||||
print(" CargoWaiting(1) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetCargoRating, 1);
|
||||
print(" CargoRating(1) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
|
||||
print(" DistanceManhattanToTile(30000) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
|
||||
print(" DistanceSquareToTile(30000) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
list.Valuate(AIStation.IsWithinTownInfluence, 0);
|
||||
print(" IsWithinTownInfluence(0) ListDump:");
|
||||
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
}
|
||||
|
||||
function Regression::Start()
|
||||
{
|
||||
StationList();
|
||||
StationList_Cargo();
|
||||
StationList_CargoPlanned();
|
||||
StationList_CargoPlannedByFrom();
|
||||
StationList_CargoPlannedByVia();
|
||||
StationList_CargoPlannedViaByFrom();
|
||||
StationList_CargoPlannedFromByVia();
|
||||
StationList_CargoWaiting();
|
||||
StationList_CargoWaitingByFrom();
|
||||
StationList_CargoWaitingByVia();
|
||||
StationList_CargoWaitingViaByFrom();
|
||||
StationList_CargoWaitingFromByVia();
|
||||
StationList_Vehicle();
|
||||
}
|
@@ -1,127 +0,0 @@
|
||||
|
||||
--StationList--
|
||||
Count(): 5
|
||||
Location ListDump:
|
||||
6 => 42341
|
||||
2 => 41831
|
||||
7 => 41825
|
||||
5 => 33421
|
||||
4 => 33411
|
||||
CargoWaiting(0) ListDump:
|
||||
7 => 6
|
||||
6 => 6
|
||||
2 => 3
|
||||
5 => 0
|
||||
4 => 0
|
||||
CargoWaiting(1) ListDump:
|
||||
7 => 0
|
||||
6 => 0
|
||||
5 => 0
|
||||
4 => 0
|
||||
2 => 0
|
||||
|
||||
--StationList_Cargo--
|
||||
0
|
||||
0
|
||||
6 => 6
|
||||
1
|
||||
6 => 2
|
||||
2
|
||||
2 => 4
|
||||
7 => 2
|
||||
3
|
||||
1
|
||||
0
|
||||
7 => 18
|
||||
6 => 16
|
||||
2 => 7
|
||||
1
|
||||
6 => 8
|
||||
2 => 3
|
||||
2
|
||||
2 => 16
|
||||
6 => 14
|
||||
7 => 11
|
||||
3
|
||||
6 => 10
|
||||
2 => 8
|
||||
|
||||
--StationList_CargoPlanned--
|
||||
0
|
||||
7 => 18
|
||||
6 => 16
|
||||
2 => 7
|
||||
1
|
||||
6 => 8
|
||||
2 => 3
|
||||
2
|
||||
2 => 16
|
||||
6 => 14
|
||||
7 => 11
|
||||
3
|
||||
6 => 10
|
||||
2 => 8
|
||||
|
||||
--StationList_CargoPlannedByFrom--
|
||||
7 => 8
|
||||
6 => 8
|
||||
2 => 7
|
||||
|
||||
--StationList_CargoPlannedByVia--
|
||||
2 => 16
|
||||
6 => 7
|
||||
|
||||
--StationList_CargoPlannedViaByFrom--
|
||||
6 => 8
|
||||
2 => 3
|
||||
|
||||
--StationList_CargoPlannedFromByVia--
|
||||
6 => 10
|
||||
2 => 8
|
||||
|
||||
--StationList_CargoWaiting--
|
||||
0
|
||||
6 => 6
|
||||
1
|
||||
6 => 2
|
||||
2
|
||||
2 => 4
|
||||
7 => 2
|
||||
3
|
||||
|
||||
--StationList_CargoWaitingByFrom--
|
||||
2 => 3
|
||||
|
||||
--StationList_CargoWaitingByVia--
|
||||
6 => 3
|
||||
|
||||
--StationList_CargoWaitingViaByFrom--
|
||||
6 => 2
|
||||
|
||||
--StationList_CargoWaitingFromByVia--
|
||||
6 => 3
|
||||
|
||||
--StationList_Vehicle--
|
||||
Count(): 2
|
||||
Location ListDump:
|
||||
5 => 33421
|
||||
4 => 33411
|
||||
CargoWaiting(0) ListDump:
|
||||
5 => 0
|
||||
4 => 0
|
||||
CargoWaiting(1) ListDump:
|
||||
5 => 0
|
||||
4 => 0
|
||||
CargoRating(1) ListDump:
|
||||
5 => -1
|
||||
4 => -1
|
||||
DistanceManhattanToTile(30000) ListDump:
|
||||
5 => 106
|
||||
4 => 96
|
||||
DistanceSquareToTile(30000) ListDump:
|
||||
5 => 8818
|
||||
4 => 7058
|
||||
IsWithinTownInfluence(0) ListDump:
|
||||
5 => 0
|
||||
4 => 0
|
||||
ERROR: The script died unexpectedly.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/data/openttdw.grf
Normal file
BIN
bin/data/openttdw.grf
Normal file
Binary file not shown.
BIN
bin/data/opntitle.dat
Normal file
BIN
bin/data/opntitle.dat
Normal file
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.2 API compatibility in effect.");
|
||||
|
||||
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
|
||||
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
|
||||
{
|
||||
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
|
||||
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
|
||||
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
|
||||
}
|
||||
|
||||
/* 1.5 adds a game element reference to the news. */
|
||||
GSNews._Create <- GSNews.Create;
|
||||
GSNews.Create <- function(type, text, company)
|
||||
{
|
||||
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
|
||||
}
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,32 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.3 API compatibility in effect.");
|
||||
|
||||
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
|
||||
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
|
||||
{
|
||||
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
|
||||
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
|
||||
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
|
||||
}
|
||||
|
||||
/* 1.5 adds a game element reference to the news. */
|
||||
GSNews._Create <- GSNews.Create;
|
||||
GSNews.Create <- function(type, text, company)
|
||||
{
|
||||
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
|
||||
}
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.4 API compatibility in effect.");
|
||||
|
||||
/* 1.5 adds a game element reference to the news. */
|
||||
GSNews._Create <- GSNews.Create;
|
||||
GSNews.Create <- function(type, text, company)
|
||||
{
|
||||
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
|
||||
}
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.5 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.6 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.7 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
GSLog.Info("1.8 API compatibility in effect.");
|
||||
|
||||
/* 1.9 adds a vehicle type parameter. */
|
||||
GSBridge._GetName <- GSBridge.GetName;
|
||||
GSBridge.GetName <- function(bridge_id)
|
||||
{
|
||||
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
/* $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/>.
|
||||
*/
|
4
bin/scenario/README
Normal file
4
bin/scenario/README
Normal file
@@ -0,0 +1,4 @@
|
||||
You can place you scenarios in this dir.
|
||||
|
||||
This file is really here to make the Makefile happy, it should be modified to
|
||||
properly handle scenarios (or maybe even not at all...).
|
@@ -1,2 +0,0 @@
|
||||
start_ai MyAI
|
||||
|
@@ -1,2 +0,0 @@
|
||||
# Show a MOTD
|
||||
say "Welcome..."
|
@@ -10,8 +10,6 @@ local scripts:
|
||||
should be used to set client optimization settings:
|
||||
- 'on_client.scr' is executed when you join a server [all clients]
|
||||
|
||||
- 'on_server_connect.scr' is executed on the server when a client has joined (MOTD)
|
||||
|
||||
should be used to set the servers port/ip and/or server optimization settings/patches:
|
||||
- 'pre_server.scr' is executed before the servers tcp stack is started [in-game only]
|
||||
- 'pre_dedicated.scr' is executed before the servers tcp stack is started [dedicated only]
|
||||
|
5673
changelog.txt
5673
changelog.txt
File diff suppressed because it is too large
Load Diff
2640
config.lib
2640
config.lib
File diff suppressed because it is too large
Load Diff
87
configure
vendored
87
configure
vendored
@@ -1,20 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $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/>.
|
||||
|
||||
check_path_characters() {
|
||||
if [ -n "`echo $ROOT_DIR | grep '[^-_A-Za-z0-9\/\\\.:]'`" ]; then
|
||||
echo "WARNING: The path contains a non-alphanumeric character that might cause"
|
||||
echo " failures in subsequent build stages. Any failures with the build"
|
||||
echo " will most likely be caused by this."
|
||||
fi
|
||||
}
|
||||
|
||||
CONFIGURE_EXECUTABLE="$_"
|
||||
# On *nix systems those two are equal when ./configure is done
|
||||
if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
|
||||
@@ -29,17 +14,10 @@ if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
|
||||
fi
|
||||
# Find out where configure is (in what dir)
|
||||
ROOT_DIR="`dirname $0`"
|
||||
# For MSYS/MinGW we want to know the FULL path. This as that path is generated
|
||||
# once you call an outside binary. Having the same path for the rest is needed
|
||||
# for dependency checking.
|
||||
# pwd -W returns said FULL path, but doesn't exist on others so fall back.
|
||||
ROOT_DIR="`cd $ROOT_DIR && (pwd -W 2>/dev/null || pwd 2>/dev/null)`"
|
||||
ROOT_DIR="`cd $ROOT_DIR && pwd`"
|
||||
|
||||
check_path_characters
|
||||
|
||||
# Same here as for the ROOT_DIR above
|
||||
PWD="`pwd -W 2>/dev/null || pwd 2>/dev/null`"
|
||||
PREFIX="$PWD/bin"
|
||||
PWD="`pwd`"
|
||||
PREFIX="`pwd`/bin"
|
||||
|
||||
. $ROOT_DIR/config.lib
|
||||
|
||||
@@ -47,8 +25,6 @@ PREFIX="$PWD/bin"
|
||||
OBJS_DIR="$PWD/objs"
|
||||
BASE_SRC_OBJS_DIR="$OBJS_DIR"
|
||||
LANG_OBJS_DIR="$OBJS_DIR/lang"
|
||||
GRF_OBJS_DIR="$OBJS_DIR/extra_grf"
|
||||
SETTING_OBJS_DIR="$OBJS_DIR/setting"
|
||||
BIN_DIR="$PREFIX"
|
||||
SRC_DIR="$ROOT_DIR/src"
|
||||
LANG_DIR="$SRC_DIR/lang"
|
||||
@@ -56,16 +32,15 @@ MEDIA_DIR="$ROOT_DIR/media"
|
||||
SOURCE_LIST="$ROOT_DIR/source.list"
|
||||
|
||||
if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
|
||||
if [ ! -f "config.cache" ]; then
|
||||
if ! [ -f "config.cache" ]; then
|
||||
echo "can't reconfigure, because never configured before"
|
||||
exit 1
|
||||
fi
|
||||
# Make sure we don't lock config.cache
|
||||
cat config.cache | sed 's@\\ @\\\\ @g' > cache.tmp
|
||||
cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
|
||||
sh cache.tmp
|
||||
RET=$?
|
||||
rm -f cache.tmp
|
||||
exit $RET
|
||||
exit $?
|
||||
fi
|
||||
|
||||
set_default
|
||||
@@ -75,28 +50,27 @@ save_params
|
||||
make_cflags_and_ldflags
|
||||
|
||||
EXE=""
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "DOS" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "WINCE" ]; then
|
||||
EXE=".exe"
|
||||
fi
|
||||
|
||||
TTD="openttd$EXE"
|
||||
STRGEN="strgen$EXE"
|
||||
DEPEND="depend$EXE"
|
||||
SETTINGSGEN="settings_gen$EXE"
|
||||
ENDIAN_CHECK="endian_check$EXE"
|
||||
|
||||
if [ -z "$sort" ]; then
|
||||
PIPE_SORT="sed s@a@a@"
|
||||
PIPE_SORT="sed s/a/a/"
|
||||
else
|
||||
PIPE_SORT="$sort"
|
||||
fi
|
||||
|
||||
if [ ! -f "$LANG_DIR/english.txt" ]; then
|
||||
if ! [ -f "$LANG_DIR/english.txt" ]; then
|
||||
echo "Languages not found in $LANG_DIR. Can't continue without it."
|
||||
echo "Please make sure the dir exists and contains at least english.txt"
|
||||
fi
|
||||
|
||||
# Read the source.list and process it
|
||||
AWKCOMMAND='
|
||||
SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
|
||||
{ }
|
||||
/^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; }
|
||||
/^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; }
|
||||
@@ -108,26 +82,21 @@ AWKCOMMAND='
|
||||
|
||||
deep += 1;
|
||||
|
||||
if ($0 == "ALLEGRO" && "'$allegro_config'" == "") { next; }
|
||||
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
||||
if ($0 == "PNG" && "'$png_config'" == "") { next; }
|
||||
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
||||
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
||||
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
||||
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
|
||||
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
|
||||
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
|
||||
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
|
||||
if ($0 == "BEOS" && "'$os'" != "BEOS" &&
|
||||
"'$os'" != "HAIKU") { next; }
|
||||
if ($0 == "BEOS" && "'$os'" != "BEOS") { next; }
|
||||
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
|
||||
"'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
|
||||
if ($0 == "MORPHOS" && "'$os'" != "MORPHOS") { next; }
|
||||
"'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
|
||||
if ($0 == "WINCE" && "'$os'" != "WINCE") { next; }
|
||||
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
|
||||
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }
|
||||
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
|
||||
if ($0 == "FLUIDSYNTH" && "'$fluidsynth'" == "" ) { next; }
|
||||
if ($0 == "HAVE_THREAD" && "'$with_threads'" == "0") { next; }
|
||||
if ($0 == "SSE" && "'$with_sse'" != "1") { next; }
|
||||
if ($0 == "NO_THREADS" && "'$with_threads'" == "0") { next; }
|
||||
|
||||
skip += 1;
|
||||
|
||||
@@ -143,31 +112,23 @@ AWKCOMMAND='
|
||||
print $0;
|
||||
}
|
||||
}
|
||||
'
|
||||
' | $PIPE_SORT`"
|
||||
|
||||
# Read the source.list and process it
|
||||
# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations
|
||||
SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk \"$AWKCOMMAND\" | LC_ALL=C $PIPE_SORT`"
|
||||
|
||||
OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.c$/ { gsub(\".c$\", \".o\", $0); print $0; }'`"
|
||||
OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.cpp$/ { gsub(\".cpp$\", \".o\", $0); print $0; }'`"
|
||||
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.mm$/ { gsub(\".mm$\", \".o\", $0); print $0; }'`"
|
||||
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.rc$/ { gsub(\".rc$\", \".o\", $0); print $0; }'`"
|
||||
SRCS="` echo \"$SRCS\" | $awk ' { ORS = \" \" } { print $0; }'`"
|
||||
OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.c$/ { gsub(".c$", ".o", $0); print $0; }'`"
|
||||
OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = " " } /\.cpp$/ { gsub(".cpp$", ".o", $0); print $0; }'`"
|
||||
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`"
|
||||
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`"
|
||||
SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
|
||||
|
||||
# In makefiles, we always use -u for sort
|
||||
if [ -z "$sort" ]; then
|
||||
sort="sed s@a@a@"
|
||||
sort="sed s/a/a/"
|
||||
else
|
||||
sort="$sort -u"
|
||||
fi
|
||||
|
||||
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.grf.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in $ROOT_DIR/Makefile.setting.in"
|
||||
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in"
|
||||
|
||||
generate_main
|
||||
generate_lang
|
||||
generate_settings
|
||||
generate_grf
|
||||
generate_src
|
||||
|
||||
check_path_characters
|
||||
|
36
docs/32bpp.txt
Normal file
36
docs/32bpp.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
32bpp and OpenTTD
|
||||
=================
|
||||
|
||||
OpenTTD has 32bpp support. This means: OpenTTD still is 8bpp, but it has the
|
||||
posibility to override the graphics with 32bpp. This means that it isn't a
|
||||
replacement of grf or newgrf, but simply an addition. If you want to use 32bpp
|
||||
graphics of a newgrf, you do need the newgrf itself too (with 8bpp graphics).
|
||||
|
||||
|
||||
The Format
|
||||
----------
|
||||
|
||||
32bpp images are stored in PNG. They should go in:
|
||||
data/sprites/<grfname>/<SpriteID>.png
|
||||
|
||||
For example, a grfname would be 'openttd' (without .grf, lowercase), and the
|
||||
SpriteID 3, to override the 3rd sprite in openttd.grf with a 32bpp version.
|
||||
|
||||
The format of this PNG can be almost anything, but we advise to use RGBA
|
||||
format. Alpha-channel is fully supported.
|
||||
|
||||
As the core of OpenTTD is 8bpp, and because you of course want company colours
|
||||
in your images, you will need to add a mask for every sprite that needs colour
|
||||
remapping. The name is simular as above, only you have to put a 'm' behind the
|
||||
SpriteID. This image should be a 8bpp palette image, where the palette is the
|
||||
OpenTTD palette. Upon load of the PNG, the mask is loaded too, and overrides
|
||||
the RGB (not the Alpha) of the original PNG image, and replacing it with a
|
||||
8bpp color remapped and converted to 32bpp.
|
||||
|
||||
An other thing that OpenTTD needs in your png, is 2 tEXt chunks: x_offs and
|
||||
y_offs. This to define the x- and y-offset, of course. Use the tool we supply
|
||||
to add this information. Sadly enough most graphical editors trashes those
|
||||
chunks upon save, so you have to readd it every time you save your image.
|
||||
|
||||
Your images should be the same as the grf, in size.
|
||||
|
@@ -1,35 +1,22 @@
|
||||
OpenTTD and strgen
|
||||
Last updated: 2009-06-30
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) strgen usage
|
||||
* 1.1) Examples
|
||||
* 1.2) strgen command switches
|
||||
|
||||
|
||||
1.0) strgen usage
|
||||
---- ------------
|
||||
STRGEN USAGE
|
||||
------------
|
||||
This guide is only interesting for people who want to alter something
|
||||
themselves without access to translator.openttd.org. Please note that
|
||||
themselves without access to WT2 (translator2.openttd.org). Please note that
|
||||
your compiled language file will only be compatible with the OpenTTD version
|
||||
you have downloaded english.txt, the master language file, for. While this is
|
||||
not always true, namely when changes in the code have not touched language
|
||||
files, your safest bet is to assume this 'limitation'.
|
||||
As a first step you need to compile strgen. This is as easy as typing
|
||||
'make strgen'. You can download the precompile strgen from:
|
||||
http://www.openttd.org/download-strgen
|
||||
|
||||
'make strgen'. You can also download a precompiled binary from a release,
|
||||
nightly, etc.
|
||||
strgen takes as argument a txt file and translates it to a lng file, allowing
|
||||
it to be used inside OpenTTD. strgen needs the master language file
|
||||
english.txt to work. Below are some examples of strgen usage.
|
||||
|
||||
1.1) Examples
|
||||
---- --------
|
||||
EXAMPLES
|
||||
--------
|
||||
Example 1:
|
||||
if you are in the root of your working copy (git repository), you should type
|
||||
if you are in the root of your working copy (svn code), you should type
|
||||
strgen/strgen -s lang lang/english.txt
|
||||
to compile englist.txt into english.lng. It will be placed in the lang dir
|
||||
|
||||
@@ -47,10 +34,10 @@ resulting language file to go to /tmp. Use
|
||||
You can interchange english.txt to whichever language you want to generate a
|
||||
.lng file for.
|
||||
|
||||
1.2) strgen command switches
|
||||
---- -----------------------
|
||||
STRGEN COMMAND SWITCHES
|
||||
-----------------------
|
||||
-v | --version
|
||||
strgen will tell what git revision it was last modified
|
||||
strgen will tell what svn revision it was last modified
|
||||
|
||||
-t | --todo
|
||||
strgen will add <TODO> to any untranslated/missing strings and use the english
|
||||
|
100
docs/Manual.txt
Normal file
100
docs/Manual.txt
Normal file
@@ -0,0 +1,100 @@
|
||||
Welcome to the manual for OpenTTD. The latest release version at the time of writing is 0.3.2.
|
||||
|
||||
1 Obtaining OpenTTD.
|
||||
|
||||
You can obtain built binaries of OpenTTD for the 4 supported platforms - Win32, Linux,-x86, BeOS 5 and MacOS-X from the projects Sourceforge page, at http://sourceforge.net/projects/openttd . For the non-Win32 builds you will need libSDL.so, libpng.so and zlib.so compiled for your platform. Some builds will include these.
|
||||
|
||||
If you use another platform, such as FreeBSD, which has POSIX file i/o and an SDL port, you should be able to build OpenTTD from its source. This is available in the proejcts Subversion repository at svn://svn.openttd.com . The module name is "trunk".
|
||||
|
||||
1.1 Building OpenTTD.
|
||||
|
||||
Once you have obtained a recent copy of the source, you must build it. Windows build instructions will be provided later.
|
||||
|
||||
On UNIX platforms (including OS-X and BeOS), ensure you have a recent GCC (2.9 or above, or 3 and above).You will also need SDL development headers and libraries (libSDL 1.2 or higher). For PNG screenshot support and zlib compressed games, you will need libpng 1.0.12 or higher and zlib 1.2 or higher.
|
||||
|
||||
Most UNIX platforms:
|
||||
First run ./configure, them use make or gmake to compile OpenTTD. You can configure the different compile options via ./configure.
|
||||
|
||||
BeOS:
|
||||
On BeOS, run ./configure and then use jam. There are a variaty of options you can pass to your build tool, these are reported by ./configure.
|
||||
|
||||
1.2 Installing OpenTTD.
|
||||
|
||||
On Windows, insert your "Transport Tycoon Deluxe for Windows 95" disk. You can use a DOS version, but your graphics will be purple. NB: Even if your version of Transport Tycoon Deluxe ran on Windows 95, it may still be the DOS version. Then run the OpenTTD installer.
|
||||
|
||||
On UNIX platforms; decompress your OpenTTD archive, or otherwise run the installer. You should be left with an OpenTTD directory on your system. In this directory, make a subdirectory called 'data', and into this place the sample.cat file and all the .grf files from the install CD of 'Transport Tycoon Deluxe for Windows 95".
|
||||
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF, TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF. A few minor graphical glitches with the DOS graphics remain. E.g. the autorail button in the rail toolbar doesn't look as nice as with the Windows graphics.)
|
||||
|
||||
If you want MIDI music, copy the 'gm' folder from the original game directory/CD to the OpenTTD folder.
|
||||
|
||||
1.3 Running OpenTTD.
|
||||
|
||||
On Windows, you can use a third-party launcher such as OTTD-Launcher to run OpenTTD directly from Explorer. Otherwise, navigate via the command prompt to the correct location and launch ttd.exe.
|
||||
|
||||
On Linux, navigate at the shell to the correct location and run ttd.
|
||||
|
||||
On BeOS and Mac OS-X, just double click the ttd binary in the Tracker/Finder. You can also start from the shell.
|
||||
|
||||
1.4 Configuring OpenTTD
|
||||
|
||||
OpenTTD's launch menu contains three configuration menus - Difficulty Settings, Configure Patches and Game Settings. Most of these menus can be configured from within a running game as well.
|
||||
|
||||
Difficulty Settings lets you configure settings that affect the difficulty of playing the game. These include when your (computer-controlled) competitors can start building, how many of them there are, and how intelligent they are. You can also control how much the subsidy mutliplier is for subsidised routes, and how stable/volitile the in-game economy is. You can also set how you want the terrain to be configured in a random game.
|
||||
|
||||
Game Settings lets you set regional settings - currency, language, town names, etc. It also lets you select the resolution to run the game at, as well as the screenshot format to use.
|
||||
|
||||
Configure Patches lets you select which patches to use in the game. This allows you to set the game play to either original Transport Tycoon Deluxe compatible mode or a mode more like playing under TTD-Patch. Patches include building on slopes, longer bridges, longer trains, pre-signals, and TTD-Patch compatible handling of non-stop orders.
|
||||
|
||||
2.1 Gameplay
|
||||
|
||||
This section of the manual is written with the assumption that you already know the gameplay basics of Transport Tycoon Deluxe, on either DOS or Windows. As you must have the Windows Transport Tycoon Deluxe CD to play OpenTTD, you should either have a paper manual or the complete manual in PDF format on the disk. This section will only cover the gameplay differences from Transport Tycoon Deluxe.
|
||||
|
||||
2.2 Station Construction
|
||||
|
||||
In OpenTTD, you can build rail stations up to seven squares long and with up to seven platforms. You can also have stations spreading across far larger distances, allowing a large rail station to be connected to a large airport, for instance.
|
||||
|
||||
However, there is an even more noticable difference in rail station construction. You may now add platforms and lenght to a station after it has been built, and you may also add platforms of a different type. Users of TTDPatch will be used to this behaviour. But beyond what TTDPatch has, you can make stations of uneven lenght/width, and even ones with perpendicular tracks. You can also delete single tiles or tracks from a station, by holding down Shift before pressing the station construction button.
|
||||
|
||||
2.3 Checkpoint Stations
|
||||
|
||||
Checkpoint stations (the small blue item in the rail construction window) are small 1x1 stations. They must be built on top of pre-existing track. They do not accept or produce carge of any kind. They exist solely for use as route points. They become useful when dealing with large networks where trains may attempt to route themselves along undesirable or impossible routes. As an alternative to checkpoint stations, you can also direct trains to visit depots along the way. This has the advantage of also servicing the train and hence the train will rarely to never need to depart from its route to be serviced.
|
||||
|
||||
2.4 Freeform Rail Laying.
|
||||
|
||||
Along side the other rail laying buttons, you will see a button that looks somewhat like a crossing. This is the freeform rail laying tool., and it allows you to drag rail in any direction to lay it. This has a number of advantages, one of the main ones being that it can seriously speed up the laying of diagonal tracks.
|
||||
|
||||
2.5 Vehicle Queuing (with Quantum Effects)
|
||||
|
||||
This useful addition to OpenTTD means that road vehicles will queue outside a road station to wait for a space rather than attempt to enter it immediately. As anyone who has operated a large road network with busy stations will know, road vehicles quickly pile up inside stations. This will prevent that. The Quantum Effects are down to a bug in the game that means that mutliple vehicles will often only take up one space in the queue. However, this is almost too useful to fix, and should still be there in later versions. This can be enabled/disabled.
|
||||
|
||||
2.6 Building On Slopes
|
||||
|
||||
This allows you to build roads, rails, stations and depots on slopes. It also allows the construction of trasmitters and lighthouses on slopes in the scenario editor. There are some minor differences between OpenTTD's and TTD-Patch's handling of building on slopes, the main one being that bridges must still have solid land at their endings.
|
||||
|
||||
2.7 Long Bridges
|
||||
|
||||
OpenTTD allows you to constuct bridges up to 127 squares - half the size of the current map. This means that the crossing of large estuaries, such at the Bristol Channel in the original "West Country 90210" scenario can be acheived with one bridge instead of many bridges with staging points.
|
||||
|
||||
2.8 Long trains
|
||||
|
||||
OpenTTD allows trains of around 60 cars length, hence allowing you to use 7 square stations to their capacity and beyond.
|
||||
|
||||
2.9 Speed Display
|
||||
|
||||
This addition to OpenTTD allows you to see the current speed of any vehicle in their status window. Just open the status window of a vehicle and you can see the speed at that given moment. This allows you to see wheter better bridges, flatter/straighter track or more powerful engines could be used to increase the speed of a vehicle
|
||||
|
||||
2.10 More Trains, More Ships, More Everything!
|
||||
|
||||
Virtually any settings - train numbers, start date, what vehicles your competitors can use, etc - can be set in OpenTTD. Just use the Configure Patches menu on the main screen.
|
||||
|
||||
2.11 Network Play
|
||||
|
||||
See multiplayer.txt for more info.
|
||||
|
||||
2.12 Rail Recycling.
|
||||
|
||||
This button, at the end of the train construction window, lets you 'recycle' track to a new type. It also works on bridges, tunnels, stations and depots.
|
||||
|
||||
2.13 Canal Building
|
||||
|
||||
This button, at the end of the water construction window, lets you build canals and shiplifts across the landscape. These act just like normal water.
|
23
docs/OSX_install_instructions.txt
Normal file
23
docs/OSX_install_instructions.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
To install OpenTTD, you should drag the game to any location you want and in that folder, you should create a folder called "data". It should contain:
|
||||
sample.cat
|
||||
trg1r.grf
|
||||
trgcr.grf
|
||||
trghr.grf
|
||||
trgir.grf
|
||||
trgtr.grf
|
||||
|
||||
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF, TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF. A few minor graphical glitches with the DOS graphics remain. E.g. the autorail button in the rail toolbar doesn't look as nice as with the Windows graphics.)
|
||||
|
||||
You should also use the data folder to add any custom grf files if you like
|
||||
|
||||
if you want music, you can add a GM folder and add all .gm files from TTD inside it
|
||||
|
||||
If you want to use the scenarios, you can copy the scenario folder as well. If you already have one, just copy the content so you don't overwrite old ones that have been removed.
|
||||
|
||||
In the end, you should have a folder containing:
|
||||
OpenTTD (the actual game)
|
||||
data (containing the grf files)
|
||||
GM (optional for music)
|
||||
scenario (optional pregenerated maps)
|
||||
|
||||
The game adds some items by itself when it runs, like a save folder and a setting file
|
@@ -1,71 +0,0 @@
|
||||
# Compiling OpenTTD using Microsoft Visual C++
|
||||
|
||||
Last updated: 2018-12-27
|
||||
|
||||
## Supported MSVC compilers
|
||||
|
||||
OpenTTD includes projects for Visual Studio 2015 Update 3 or more recent.
|
||||
You can download the free Visual Studio Community Edition from Microsoft at
|
||||
https://visualstudio.microsoft.com/vs/community/.
|
||||
|
||||
## Required files
|
||||
|
||||
### Microsoft platform files
|
||||
|
||||
OpenTTD needs the Platform SDK, if it isn't installed already. This can be
|
||||
done during installing Visual Studio, by selecting
|
||||
`Visual C++ MFC for x86 and x64` (and possibly
|
||||
`Visual C++ ATL for x86 and x64` depending on your version). If not, you
|
||||
can get it at this location:
|
||||
|
||||
- [MS Windows Platform SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk)
|
||||
|
||||
Install the SDK by following the instructions as given.
|
||||
|
||||
### OpenTTD dependencies
|
||||
|
||||
Dependencies for OpenTTD on Windows are handled via
|
||||
[vcpkg](https://github.com/Microsoft/vcpkg/). First you need to install vcpkg
|
||||
by following the `Quick Start` intructions of their
|
||||
[README](https://github.com/Microsoft/vcpkg/blob/master/README.md).
|
||||
|
||||
After this, you can install the dependencies OpenTTD needs. We advise to use
|
||||
the `static` versions, and OpenTTD currently needs the following dependencies:
|
||||
|
||||
- freetype
|
||||
- liblzma
|
||||
- libpng
|
||||
- lzo
|
||||
- zlib
|
||||
|
||||
To install both the x64 (64bit) and x86 (32bit) variants, you can use:
|
||||
|
||||
```ps
|
||||
.\vcpkg install freetype:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
|
||||
.\vcpkg install freetype:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
|
||||
```
|
||||
|
||||
## TTD Graphics files
|
||||
|
||||
See section 4.1 of README.md for the required 3rdparty files and how to install them.
|
||||
|
||||
## Compiling
|
||||
|
||||
Open the appropriate `sln` (Solution) file for your version of Visual Studio:
|
||||
|
||||
- VS 2015: projects/openttd_vs140.sln
|
||||
- VS 2017: projects/openttd_vs141.sln
|
||||
- VS 2019: projects/openttd_vs142.sln
|
||||
|
||||
Set the build mode to `Release` in
|
||||
`Build > Configuration manager > Active solution configuration`.
|
||||
You can now compile.
|
||||
|
||||
If everything works well the binary should be in `objs\Win[32|64]\Release\openttd.exe`
|
||||
and in `bin\openttd.exe`
|
||||
|
||||
## Problems
|
||||
|
||||
If compilation fails, double-check that you are using the latest github
|
||||
source. If it still doesn't work, check in on IRC (irc://irc.oftc.net/openttd),
|
||||
to ask for help.
|
115
docs/Readme_Windows_MSVC.txt
Normal file
115
docs/Readme_Windows_MSVC.txt
Normal file
@@ -0,0 +1,115 @@
|
||||
Compiling OpenTTD using Microsoft Visual C++
|
||||
January 2, 2007
|
||||
--------------------------------------------
|
||||
PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!!
|
||||
|
||||
|
||||
SUPPORTED MSVC COMPILERS
|
||||
------------------------
|
||||
OpenTTD includes projects for MSVC 2005.NET and MSVC 2008.NET. Both will
|
||||
compile out of the box, providing you have the required libraries/headers;
|
||||
which ones, see below. There is no support for VS6 or MSVC 2002, or
|
||||
MSVC 2003.NET. You are therefore strongly encouraged to either upgrade to
|
||||
MSVC 2005 Express (free) or use GCC.
|
||||
|
||||
|
||||
1) REQUIRED FILES
|
||||
-----------------
|
||||
You might already have some of the files already installed, so check before
|
||||
downloading; mostly because the DirectX SDK and Platform SDK are about
|
||||
500MB each.
|
||||
Download the following files:
|
||||
|
||||
* openttd-useful.zip (http://sf.net/project/showfiles.php?group_id=103924&package_id=114307)
|
||||
* DirectX 8.1 SDK (http://neuron.tuke.sk/~mizanin/eng/Dx81sdk-include-lib.rar) (or alternatively the latest DirectX SDK from Microsoft)
|
||||
* MS Windows Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en)
|
||||
* afxres.h (http://www-d0.fnal.gov/d0dist/dist/packages/d0ve/devel/windows/AFXRES.H)
|
||||
|
||||
...and of course the newest source from svn://svn.openttd.org/trunk
|
||||
|
||||
You need an SVN-client to download the source from subversion:
|
||||
|
||||
* CLI Subversion (http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91)
|
||||
* GUI TortoiseSVN (http://tortoisesvn.tigris.org/download.html)
|
||||
|
||||
|
||||
2) INCLUDES AND LIBRARIES
|
||||
-------------------------
|
||||
Put the newly downloaded files in the VC lib\ and include\ directories; where
|
||||
"C:\Program Files\Microsoft Visual Studio 8\VC" is your location of Visual C.
|
||||
If you are compiling for an x64 system, use the include\ and lib\ directories
|
||||
from the win64/ folder.
|
||||
|
||||
* openttd-useful.zip\include\*
|
||||
* afxresh.h
|
||||
to > C:\Program Files\Microsoft Visual Studio 8\VC\Include
|
||||
|
||||
* openttd-useful.zip\lib\*
|
||||
to > C:\Program Files\Microsoft Visual Studio 8\VC\Lib
|
||||
|
||||
Custom directories might be recommended, check 2.2)
|
||||
|
||||
|
||||
2.1) INCLUDES AND LIBRARIES - DIRECTX/PLATFORM SDK
|
||||
--------------------------------------------------
|
||||
Basically the same procedure as with the useful zip file, providing
|
||||
you are not using the Microsoft installer. Put the include files in the
|
||||
include\ directory and the library files to the Lib\ directory.
|
||||
|
||||
It is recommended to use custom directories so you don't overwrite any
|
||||
default header or library files.
|
||||
|
||||
|
||||
2.2) CUSTOM DIRECTORIES
|
||||
-----------------------
|
||||
If you have put the above include and/or library files into custom folders,
|
||||
MSVC will not find them by default. You need to add these paths to VC through:
|
||||
|
||||
Tools > Options > Projects and Solutions > VC++ Directories > show directories for
|
||||
|
||||
* Include files: Add the DirectX/Platform SDK include dir you've created
|
||||
* Library files: Add the path to the SDK custom lib dir
|
||||
|
||||
NOTE: make sure that the directory for the DirectX SDK is the first one in the
|
||||
list, above all others, otherwise compilation will most likely fail!!
|
||||
|
||||
|
||||
3) TTD GRAPHICS FILES
|
||||
---------------------
|
||||
Copy the following files from Transport Tycoon Deluxe to the bin/data folder
|
||||
|
||||
* sample.cat
|
||||
* trg1r.grf
|
||||
* trgcr.grf
|
||||
* trghr.grf
|
||||
* trgir.grf
|
||||
* trgtr.grf
|
||||
|
||||
|
||||
4) COMPILING
|
||||
------------
|
||||
Open trunk/openttd_vs[89]0.sln
|
||||
Set the build mode to 'Release' in
|
||||
Build > Configuration manager > Active solution configuration > select "Release"
|
||||
Compile...
|
||||
|
||||
If everything works well the binary should be in trunk/objs/Win[32|64]/Release/openttd.exe
|
||||
|
||||
|
||||
5) EDITING, CHANGING SOURCE CODE
|
||||
--------------------------------
|
||||
Set the build mode (back to) 'Debug'
|
||||
Change the startup project to openttd by right-clicking the 'openttd' project
|
||||
in the Solution Explorer and selecting 'Set as Startup Project'. The 'openttd'
|
||||
project should now show up bold instead of 'strgen'.
|
||||
|
||||
|
||||
6) PROBLEMS?
|
||||
------------
|
||||
If compilation fails, double-check that you are using the latest SVN (!)
|
||||
source. If it still doesn't work, check in on IRC (irc://irc.oftc.net/openttd),
|
||||
to ask about reasons; or just wait. The problem will most likely solve itself
|
||||
within a few days as the problem is noticed and fixed.
|
||||
|
||||
An up-to-date version of this README can be found on the wiki:
|
||||
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress
|
@@ -1,219 +0,0 @@
|
||||
OpenTTD's admin network
|
||||
Last updated: 2011-01-20
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) Preface
|
||||
2.0) Joining the network
|
||||
3.0) Asking for updates
|
||||
* 3.1) Polling manually
|
||||
4.0) Sending rcon commands
|
||||
5.0) Sending chat
|
||||
* 5.1) Receiving chat
|
||||
6.0) Disconnecting
|
||||
7.0) Certain packet information
|
||||
|
||||
|
||||
1.0) Preface
|
||||
---- -------
|
||||
The admin network provides a dedicated network protocol designed for other
|
||||
applications to communicate with OpenTTD. Connected applications can execute
|
||||
console commands remotely (rcon commands) with no further authentication.
|
||||
Furthermore information about clients and companies can be provided.
|
||||
|
||||
Admin applications remain connected when starting a new game or loading a saved
|
||||
game in contrast to normal OpenTTD clients that get disconnected.
|
||||
|
||||
This document describes the admin network and its protocol.
|
||||
|
||||
Please refer to the mentioned enums in src/network/core/tcp_admin.h
|
||||
|
||||
Please also note that further improvements to the admin protocol can mean that
|
||||
more packet types will be sent by the server. For forward compatibility it is
|
||||
therefore wise to ignore unknown packets. Future improvements might also add
|
||||
additional data to packets. This data should be ignored. Data will never be
|
||||
removed from packets in later versions, except the possibility that complete
|
||||
packets are dropped in favour of a new packet.
|
||||
This though will be reflected in the protocol version as announced in the
|
||||
ADMIN_PACKET_SERVER_PROTOCOL in section 2.0).
|
||||
|
||||
A reference implementation in Java for a client connecting to the admin interface
|
||||
can be found at: http://dev.openttdcoop.org/projects/joan
|
||||
|
||||
|
||||
2.0) Joining the network
|
||||
---- -------------------
|
||||
Create a TCP connection to the server on port 3977. The application is
|
||||
expected to authenticate within 10 seconds.
|
||||
|
||||
To authenticate send a ADMIN_PACKET_ADMIN_JOIN packet.
|
||||
|
||||
The server will reply with ADMIN_PACKET_SERVER_PROTOCOL followed directly by
|
||||
ADMIN_PACKET_SERVER_WELCOME.
|
||||
|
||||
ADMIN_PACKET_SERVER_PROTOCOL contains details about the protocol version.
|
||||
It is the job of your application to check this number and decide whether
|
||||
it will remain connected or not.
|
||||
Furthermore, this packet holds details on every AdminUpdateType and the
|
||||
supported AdminFrequencyTypes (bitwise representation).
|
||||
|
||||
ADMIN_PACKET_SERVER_WELCOME contains details on the server and the map,
|
||||
e.g. if the server is dedicated, its NetworkLanguage, size of the Map, etc.
|
||||
|
||||
Once you have received ADMIN_PACKET_SERVER_WELCOME you are connected and
|
||||
authorized to do your thing.
|
||||
The server will not provide any game related updates unless you ask for them.
|
||||
There are four packets the server will none the less send, if applicable:
|
||||
- ADMIN_PACKET_SERVER_ERROR
|
||||
- ADMIN_PACKET_SERVER_WELCOME
|
||||
- ADMIN_PACKET_SERVER_NEWGAME
|
||||
- ADMIN_PACKET_SERVER_SHUTDOWN
|
||||
|
||||
However, ADMIN_PACKET_SERVER_WELCOME only after a ADMIN_PACKET_SERVER_NEWGAME
|
||||
|
||||
|
||||
3.0) Asking for updates
|
||||
---- ------------------
|
||||
Asking for updates is done with ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY.
|
||||
With this packet you define which update you wish to receive at which
|
||||
frequency.
|
||||
|
||||
Note: not every update type supports every frequency. If in doubt, you can
|
||||
verify against the data received in ADMIN_PACKET_SERVER_PROTOCOL.
|
||||
|
||||
The server will not confirm your registered update. However, asking for an
|
||||
invalid AdminUpdateType or a not supported AdminUpdateFrequency you will be
|
||||
disconnected from the server with NETWORK_ERROR_ILLEGAL_PACKET.
|
||||
|
||||
Additional debug information can be found with a debug level of net=3.
|
||||
|
||||
ADMIN_UPDATE_DATE results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_DATE
|
||||
|
||||
ADMIN_UPDATE_CLIENT_INFO results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_CLIENT_JOIN
|
||||
- ADMIN_PACKET_SERVER_CLIENT_INFO
|
||||
- ADMIN_PACKET_SERVER_CLIENT_UPDATE
|
||||
- ADMIN_PACKET_SERVER_CLIENT_QUIT
|
||||
- ADMIN_PACKET_SERVER_CLIENT_ERROR
|
||||
|
||||
ADMIN_UPDATE_COMPANY_INFO results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_COMPANY_NEW
|
||||
- ADMIN_PACKET_SERVER_COMPANY_INFO
|
||||
- ADMIN_PACKET_SERVER_COMPANY_UPDATE
|
||||
- ADMIN_PACKET_SERVER_COMPANY_REMOVE
|
||||
|
||||
ADMIN_UPDATE_COMPANY_ECONOMY results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_COMPANY_ECONOMY
|
||||
|
||||
ADMIN_UPDATE_COMPANY_STATS results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_COMPANY_STATS
|
||||
|
||||
ADMIN_UPDATE_CHAT results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_CHAT
|
||||
|
||||
ADMIN_UPDATE_CONSOLE results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_CONSOLE
|
||||
|
||||
|
||||
ADMIN_UPDATE_CMD_LOGGING results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_CMD_LOGGING
|
||||
|
||||
3.1) Polling manually
|
||||
---- ----------------
|
||||
Certain AdminUpdateTypes can also be polled:
|
||||
- ADMIN_UPDATE_DATE
|
||||
- ADMIN_UPDATE_CLIENT_INFO
|
||||
- ADMIN_UPDATE_COMPANY_INFO
|
||||
- ADMIN_UPDATE_COMPANY_ECONOMY
|
||||
- ADMIN_UPDATE_COMPANY_STATS
|
||||
- ADMIN_UPDATE_CMD_NAMES
|
||||
|
||||
ADMIN_UPDATE_CLIENT_INFO and ADMIN_UPDATE_COMPANY_INFO accept an additional
|
||||
parameter. This parameter is used to specify a certain client or company.
|
||||
Setting this parameter to UINT32_MAX (0xFFFFFFFF) will tell the server you
|
||||
want to receive updates for all clients or companies.
|
||||
|
||||
Not supported AdminUpdateType in the poll will result in the server
|
||||
disconnecting the application with NETWORK_ERROR_ILLEGAL_PACKET.
|
||||
|
||||
Additional debug information can be found with a debug level of net=3.
|
||||
|
||||
|
||||
4.0) Sending rcon commands
|
||||
---- ---------------------
|
||||
Rcon runs separate from the ADMIN_UPDATE_CONSOLE AdminUpdateType. Requesting
|
||||
the execution of a remote console command is done with the packet
|
||||
ADMIN_PACKET_ADMIN_RCON.
|
||||
|
||||
Note: No additional authentication is required for rcon commands.
|
||||
|
||||
The server will reply with one or more ADMIN_PACKET_SERVER_RCON packets.
|
||||
Finally an ADMIN_PACKET_ADMIN_RCON_END packet will be sent. Applications
|
||||
will not receive the answer twice if they have asked for the AdminUpdateType
|
||||
ADMIN_UPDATE_CONSOLE, as the result is not printed on the servers console
|
||||
(just like clients rcon commands).
|
||||
|
||||
Furthermore, sending a 'say' command (or any similar command) will not
|
||||
be sent back into the admin network.
|
||||
Chat from the server itself will only be sent to the admin network when it
|
||||
was not sent from the admin network.
|
||||
|
||||
Note that when content is queried or updated via rcon, the processing
|
||||
happens asynchronously. But the ADMIN_PACKET_ADMIN_RCON_END packet is sent
|
||||
already right after the content is requested as there's no immediate output.
|
||||
Thus other packages and the output of content rcon command may be sent at
|
||||
an arbitrary later time, mixing into the output of other console activity,
|
||||
e.g. also of possible subsequent other rcon commands sent.
|
||||
|
||||
|
||||
5.0) Sending chat
|
||||
---- ------------
|
||||
Sending a ADMIN_PACKET_ADMIN_CHAT results in chat originating from the server.
|
||||
|
||||
Currently four types of chat are supported:
|
||||
- NETWORK_ACTION_CHAT
|
||||
- NETWORK_ACTION_CHAT_CLIENT
|
||||
- NETWORK_ACTION_CHAT_COMPANY
|
||||
- NETWORK_ACTION_SERVER_MESSAGE
|
||||
|
||||
NETWORK_ACTION_SERVER_MESSAGE can be sent to a single client or company
|
||||
using the respective DestType and ID.
|
||||
This is a message prefixed with the 3 stars, e.g. *** foo has joined the game
|
||||
|
||||
5.1) Receiving chat
|
||||
---- -------------
|
||||
Register ADMIN_UPDATE_CHAT at ADMIN_FREQUENCY_AUTOMATIC to receive chat.
|
||||
The application will be able to receive all chat the server can see.
|
||||
|
||||
The configuration option network.server_admin_chat specifies whether
|
||||
private chat for to the server is distributed into the admin network.
|
||||
|
||||
|
||||
6.0) Disconnecting
|
||||
---- -------------
|
||||
It is a kind thing to say good bye before leaving. Do this by sending the
|
||||
ADMIN_PACKET_ADMIN_QUIT packet.
|
||||
|
||||
|
||||
7.0) Certain packet information
|
||||
---- --------------------------
|
||||
All ADMIN_PACKET_SERVER_* packets have an enum value greater 100.
|
||||
|
||||
ADMIN_PACKET_SERVER_WELCOME
|
||||
Either directly follows ADMIN_PACKET_SERVER_PROTOCOL or is sent
|
||||
after a new game has been started or a map loaded, i.e. also
|
||||
after ADMIN_PACKET_SERVER_NEWGAME.
|
||||
|
||||
ADMIN_PACKET_SERVER_CLIENT_JOIN and ADMIN_PACKET_SERVER_COMPANY_NEW
|
||||
These packets directly follow their respective INFO packets. If you receive
|
||||
a CLIENT_JOIN / COMPANY_NEW packet without having received the INFO packet
|
||||
it may be a good idea to POLL for the specific ID.
|
||||
|
||||
ADMIN_PACKET_SERVER_CMD_NAMES and ADMIN_PACKET_SERVER_CMD_LOGGING
|
||||
Data provided with these packets is not stable and will not be
|
||||
treated as such. Do not rely on IDs or names to be constant
|
||||
across different versions / revisions of OpenTTD.
|
||||
Data provided in this packet is for logging purposes only.
|
268
docs/desync.txt
268
docs/desync.txt
@@ -1,268 +0,0 @@
|
||||
Some explanations about Desyncs
|
||||
Last updated: 2014-02-23
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) Desync theory
|
||||
* 1.1) OpenTTD multiplayer architecture
|
||||
* 1.2) What is a Desync and how is it detected
|
||||
* 1.3) Typical causes of Desyncs
|
||||
2.0) What to do in case of a Desync
|
||||
* 2.1) Cache debugging
|
||||
* 2.2) Desync recording
|
||||
3.0) Evaluating the Desync records
|
||||
* 3.1) Replaying
|
||||
* 3.2) Evaluation the replay
|
||||
* 3.3) Comparing savegames
|
||||
|
||||
|
||||
1.1) OpenTTD multiplayer architecture
|
||||
---- --------------------------------
|
||||
OpenTTD has a huge gamestate, which changes all of the time.
|
||||
The savegame contains the complete gamestate at a specific point
|
||||
in time. But this state changes completely each tick: Vehicles move
|
||||
and trees grow.
|
||||
|
||||
However, most of these changes in the gamestate are deterministic:
|
||||
Without a player interfering a vehicle follows its orders always
|
||||
in the same way, and trees always grow the same.
|
||||
|
||||
In OpenTTD multiplayer synchronisation works by creating a savegame
|
||||
when clients join, and then transfering that savegame to the client,
|
||||
so it has the complete gamestate at a fixed point in time.
|
||||
|
||||
Afterwards clients only receive 'commands', that is: Stuff which is
|
||||
not predictable, like
|
||||
- player actions
|
||||
- AI actions
|
||||
- GameScript actions
|
||||
- Admin Port command
|
||||
- rcon commands
|
||||
- ...
|
||||
|
||||
These commands contain the information on how to execute the command,
|
||||
and when to execute it. Time is measured in 'network frames'.
|
||||
Mind that network frames to not match ingame time. Network frames
|
||||
also run while the game is paused, to give a defined behaviour to
|
||||
stuff that is executing while the game is paused.
|
||||
|
||||
The deterministic part of the gamestate is run by the clients on
|
||||
their own. All they get from the server is the instruction to
|
||||
run the gamestate up to a certain network time, which basically
|
||||
says that there are no commands scheduled in that time.
|
||||
|
||||
When a client (which includes the server itself) wants to execute
|
||||
a command (i.e. a non-predictable action), it does this by
|
||||
- calling DoCommandP resp. DoCommandPInternal
|
||||
- These functions first do a local test-run of the command to
|
||||
check simple preconditions. (Just to give the client an
|
||||
immediate response without bothering the server and waiting for
|
||||
the response.) The test-run may not actually change the
|
||||
gamestate, all changes must be discarded.
|
||||
- If the local test-run succeeds the command is sent to the server.
|
||||
- The server inserts the command into the command queue, which
|
||||
assigns a network frame to the commands, i.e. when it shall be
|
||||
executed on all clients.
|
||||
- Enhanced with this specific timestamp, the command is send to all
|
||||
clients, which execute the command simultaneously in the same
|
||||
network frame in the same order.
|
||||
|
||||
1.2) What is a Desync and how is it detected
|
||||
---- ---------------------------------------
|
||||
In the ideal case all clients have the same gamestate as the server
|
||||
and run in sync. That is, vehicle movement is the same on all
|
||||
clients, and commands are executed the same everywhere and
|
||||
have the same results.
|
||||
|
||||
When a Desync happens, it means that the gamestates on the clients
|
||||
(including the server) are no longer the same. Just imagine
|
||||
that a vehicle picks the left line instead of the right line at
|
||||
a junction on one client.
|
||||
|
||||
The important thing here is, that noone notices when a Desync
|
||||
occurs. The desync client will continue to simulate the gamestate
|
||||
and execute commands from the server. Once the gamestate differs
|
||||
it will increasingly spiral out of control: If a vehicle picks a
|
||||
different route, it will arrive at a different time at a station,
|
||||
which will load different cargo, which causes other vehicles to
|
||||
load other stuff, which causes industries to notice different
|
||||
servicing, which causes industries to change production, ...
|
||||
the client could run all day in a different universe.
|
||||
|
||||
To limit how long a Desync can remain unnoticed, the server
|
||||
transfers some checksums every now and then for the gamestate.
|
||||
Currently this checksum is the state of the random number
|
||||
generator of the game logic. A lot of things in OpenTTD depend
|
||||
on the RNG, and if the gamestate differs, it is likely that the
|
||||
RNG is called at different times, and the state differs when
|
||||
checked.
|
||||
|
||||
The clients compare this 'checksum' with the checksum of their
|
||||
own gamestate at the specific network frame. If they differ,
|
||||
the client disconnects with a Desync error.
|
||||
|
||||
The important thing here is: The detection of the Desync is
|
||||
only an ultimate failure detection. It does not give any
|
||||
indication on when the Desync happened. The Desync may after
|
||||
all have occurred long ago, and just did not affect the checksum
|
||||
up to now. The checksum may have matched 10 times or more
|
||||
since the Desync happend, and only now the Desync has spiraled
|
||||
enough to finally affect the checksum. (There was once a desync
|
||||
which was only noticed by the checksum after 20 game years.)
|
||||
|
||||
1.3) Typical causes of Desyncs
|
||||
---- -------------------------
|
||||
Desyncs can be caused by the following scenarios:
|
||||
- The savegame does not describe the complete gamestate.
|
||||
- Some information which affects the progression of the
|
||||
gamestate is not saved in the savegame.
|
||||
- Some information which affects the progression of the
|
||||
gamestate is not loaded from the savegame.
|
||||
This includes the case that something is not completely
|
||||
reset before loading the savegame, so data from the
|
||||
previous game is carried over to the new one.
|
||||
- The gamestate does not behave deterministic.
|
||||
- Cache mismatch: The game logic depends on some cached
|
||||
values, which are not invalidated properly. This is
|
||||
the usual case for NewGRF-specific Desyncs.
|
||||
- Undefined behaviour: The game logic performs multiple
|
||||
things in an undefined order or with an undefined
|
||||
result. E.g. when sorting something with a key while
|
||||
some keys are equal. Or some computation that depends
|
||||
on the CPU architecture (32/64 bit, little/big endian).
|
||||
- The gamestate is modified when it shall not be modified.
|
||||
- The test-run of a command alters the gamestate.
|
||||
- The gamestate is altered by a player or script without
|
||||
using commands.
|
||||
|
||||
|
||||
2.1) Cache debugging
|
||||
---- ---------------
|
||||
Desyncs which are caused by inproper cache validation can
|
||||
often be found by enabling cache validation:
|
||||
- Start OpenTTD with '-d desync=2'.
|
||||
- This will enable validation of caches every tick.
|
||||
That is, cached values are recomputed every tick and compared
|
||||
to the cached value.
|
||||
- Differences are logged to 'commands-out.log' in the autosave
|
||||
folder.
|
||||
|
||||
Mind that this type of debugging can also be done in singleplayer.
|
||||
|
||||
2.2) Desync recording
|
||||
---- ----------------
|
||||
If you have a server, which happens to encounter Desyncs often,
|
||||
you can enable recording of the gamestate alterations. This
|
||||
will later allow the replay the gamestate and locate the Desync
|
||||
cause.
|
||||
|
||||
There are two levels of Desync recording, which are enabled
|
||||
via '-d desync=2' resp. '-d desync=3'. Both will record all
|
||||
commands to a file 'commands-out.log' in the autosave folder.
|
||||
|
||||
If you have the savegame from the start of the server, and
|
||||
this command log you can replay the whole game. (see Section 3.1)
|
||||
|
||||
If you do not start the server from a savegame, there will
|
||||
also be a savegame created just after a map has been generated.
|
||||
The savegame will be named 'dmp_cmds_*.sav' and be put into
|
||||
the autosave folder.
|
||||
|
||||
In addition to that '-d desync=3' also creates regular savegames
|
||||
at defined spots in network time. (more defined than regular
|
||||
autosaves). These will be created in the autosave folder
|
||||
and will also be named 'dmp_cmds_*.sav'.
|
||||
|
||||
These saves allow comparing the gamestate with the original
|
||||
gamestate during replaying, and thus greatly help debugging.
|
||||
However, they also take a lot of disk space.
|
||||
|
||||
|
||||
3.1) Replaying
|
||||
---- ---------
|
||||
To replay a Desync recording, you need these files:
|
||||
- The savegame from when the server was started, resp.
|
||||
the automatically created savegame from when the map
|
||||
was generated.
|
||||
- The 'commands-out.log' file.
|
||||
- Optionally the 'dmp_cmds_*.sav'.
|
||||
Put these files into a safe spot. (Not your autosave folder!)
|
||||
|
||||
Next, prepare your OpenTTD for replaying:
|
||||
- Get the same version of OpenTTD as the original server was running.
|
||||
- Uncomment/enable the define 'DEBUG_DUMP_COMMANDS' in
|
||||
'src/network/network_func.h'.
|
||||
(DEBUG_FAILED_DUMP_COMMANDS is explained later)
|
||||
- Put the 'commands-out.log' into the root save folder, and rename
|
||||
it to 'commands.log'.
|
||||
- Run 'openttd -D -d desync=3 -g startsavegame.sav'.
|
||||
This replays the server log and creates new 'commands-out.log'
|
||||
and 'dmp_cmds_*.sav' in your autosave folder.
|
||||
|
||||
3.2) Evaluation the replay
|
||||
---- ---------------------
|
||||
The replaying will also compare the checksums which are part of
|
||||
the 'commands-out.log' with the replayed gamestate.
|
||||
If they differ, it will trigger a 'NOT_REACHED'.
|
||||
|
||||
If the replay succeeds without mismatch, that is the replay reproduces
|
||||
the original server state:
|
||||
- Repeat the replay starting from incrementally later 'dmp_cmds_*.sav'
|
||||
while truncating the 'commands.log' at the beginning appropriately.
|
||||
The 'dmp_cmds_*.sav' can be your own ones from the first reply, or
|
||||
the ones from the original server (if you have them).
|
||||
(This simulates the view of joining clients during the game.)
|
||||
- If one of those replays fails, you have located the Desync between
|
||||
the last dmp_cmds that reproduces the replay and the first one
|
||||
that fails.
|
||||
|
||||
If the replay does not succeed without mismatch, you can check the logs
|
||||
whether there were failed commands. Then you may try to replay with
|
||||
DEBUG_FAILED_DUMP_COMMANDS enabled. If the replay then fails, the
|
||||
command test-run of the failed command modified the game state.
|
||||
|
||||
If you have the original 'dmp_cmds_*.sav', you can also compare those
|
||||
savegames with your own ones from the replay. You can also comment/disable
|
||||
the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from
|
||||
the replay after the mismatch has already been detected.
|
||||
See Section 3.2 on how to compare savegames.
|
||||
If the saves differ you have located the Desync between the last dmp_cmds
|
||||
that match and the first one that does not. The difference of the saves
|
||||
may point you in the direction of what causes it.
|
||||
|
||||
If the replay succeeds without mismatch, and you do not have any
|
||||
'dmp_cmd_*.sav' from the original server, it is a lost case.
|
||||
Enable creation of the 'dmp_cmd_*.sav' on the server, and wait for the
|
||||
next Desync.
|
||||
|
||||
Finally, you can also compare the 'commands-out.log' from the original
|
||||
server with the one from the replay. They will differ in stuff like
|
||||
dates, and the original log will contain the chat, but otherwise they
|
||||
should match.
|
||||
|
||||
3.2) Comparing savegames
|
||||
---- -------------------
|
||||
The binary form of the savegames from the original server and from
|
||||
your replay will always differ:
|
||||
- The savegame contains paths to used NewGRF files.
|
||||
- The gamelog will log your loading of the savegame.
|
||||
- The savegame data of AIs and the Gamescript will differ.
|
||||
Scripts are not run during the replay, only their recorded commands
|
||||
are replayed. Their internal state will thus not change in the
|
||||
replay and will differ.
|
||||
|
||||
To compare savegame more semantically, there exist some ugly hackish
|
||||
tools at:
|
||||
http://devs.openttd.org/~frosch/texts/zpipe.c
|
||||
http://devs.openttd.org/~frosch/texts/printhunk.c
|
||||
|
||||
The first one decompresses OpenTTD savegames. The second one creates
|
||||
a textual representation of an uncompressed savegame, by parsing hunks
|
||||
and arrays and such. With both tools you need to be a bit careful
|
||||
since they work on stdin and stdout, which may not deal well with
|
||||
binary data.
|
||||
|
||||
If you have the textual representation of the savegames, you can
|
||||
compare them with regular diff tools.
|
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 62 KiB |
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 61 KiB |
@@ -4,104 +4,64 @@
|
||||
<head>
|
||||
<meta name="Author" content="Marcin Grzegorczyk">
|
||||
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>OpenTTD Landscape Internals</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h3><a name="Landscape">Landscape</a></h3>
|
||||
<p>Seven attributes (counting "<span style="font-weight: bold;">type_height</span>") hold the informations about a tile.<BR>
|
||||
These attributes are referred to as
|
||||
"<span style="font-weight: bold;">type_height</span>",
|
||||
"<span style="font-weight: bold;">m1</span>", "<span style="font-weight: bold;">m2</span>",
|
||||
"<span style="font-weight: bold;">m3</span>", "<span style="font-weight: bold;">m4</span>",
|
||||
"<span style="font-weight: bold;">m5</span>" and "<span style="font-weight: bold;">m6</span>".<BR>
|
||||
The most important value is the class of a tile, stored in the upper 4 bits
|
||||
of the <span style="font-weight: bold;">type_height</span> attribute. The lower 4 bits are used to encode the height and
|
||||
slope data.
|
||||
</p>
|
||||
|
||||
Special Attribute : <span style="font-weight: bold;">m6</span>. There are 4 bits of it that are used accross multiple tile classes<br>
|
||||
<ul>
|
||||
<li>
|
||||
<a name = "bridge_direction">
|
||||
Bits 7..6 :
|
||||
<table border="1">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above,<br>for tiles that support this.</td></tr>
|
||||
<tr><td><tt>00</tt> </td><td>no bridge</td></tr>
|
||||
<tr><td><tt>01</tt> </td><td>Axis X (North-East)</td></tr>
|
||||
<tr><td><tt>02</tt> </td><td>Axis Y (South-West)</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
<a name = "tropic_zone">
|
||||
Bits 1..0 :
|
||||
<table border="1">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate.<br>It contains the definition of the available zones</td></tr>
|
||||
<tr><td><tt>00</tt> </td><td>normal</td></tr>
|
||||
<tr><td><tt>01</tt> </td><td>desert</td></tr>
|
||||
<tr><td><tt>02</tt> </td><td>rain forest</td></tr>
|
||||
</table>
|
||||
In any other climate, those 2 bits are free of use.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
For a graphical representation of the tile-layout have a look at
|
||||
<a href="landscape_grid.html">Landscape grid</a> page.
|
||||
</p>
|
||||
<p>Nine attributes (counting "<span style="font-weight: bold;">type</span>" and
|
||||
"<span style="font-weight: bold;">height</span>") hold the informations about a tile.<BR>
|
||||
These attributes are referred to as
|
||||
"<span style="font-weight: bold;">type</span>",
|
||||
"<span style="font-weight: bold;">height</span>",
|
||||
"<span style="font-weight: bold;">m1</span>", "<span style="font-weight: bold;">m2</span>",
|
||||
"<span style="font-weight: bold;">m3</span>", "<span style="font-weight: bold;">m4</span>",
|
||||
"<span style="font-weight: bold;">m5</span>", "<span style="font-weight: bold;">m6</span>"
|
||||
and "<span style="font-weight: bold;">m7</span>".<br>
|
||||
The most important value is the class of a tile, stored in the upper 4 bits
|
||||
of the <span style="font-weight: bold;">type</span> attribute.
|
||||
</p>
|
||||
|
||||
Frequently repeating patterns:
|
||||
<ul>
|
||||
<li><span style="font-weight: bold;">type</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a name="type"></a>
|
||||
Bits 7..4:
|
||||
<table border="1" style="width: 30em;">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">The tile type.</td></tr>
|
||||
<tr><td style="width: 5em;"><tt>00</tt></td><td>Ground</td></tr>
|
||||
<tr><td><tt>01</tt></td><td>Railway tracks</td></tr>
|
||||
<tr><td><tt>02</tt></td><td>Roads</td></tr>
|
||||
<tr><td><tt>03</tt></td><td>Town building</td></tr>
|
||||
<tr><td><tt>04</tt></td><td>Trees</td></tr>
|
||||
<tr><td><tt>05</tt></td><td>Station tiles</td></tr>
|
||||
<tr><td><tt>06</tt></td><td>Water</td></tr>
|
||||
<tr><td><tt>07</tt></td><td>Void</td></tr>
|
||||
<tr><td><tt>08</tt></td><td>Industries</td></tr>
|
||||
<tr><td><tt>09</tt></td><td>Tunnel / bridge</td></tr>
|
||||
<tr><td><tt>0A</tt></td><td>Objects</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
Bits 3..2:
|
||||
<table border="1" style="width: 30em;">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above.</td></tr>
|
||||
<tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
|
||||
<tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
|
||||
<tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
|
||||
</table>
|
||||
<li>
|
||||
<a name="tropic_zone"></a>
|
||||
Bits 1..0:
|
||||
<table border="1" style="width: 30em;">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate. It contains the definition of the available zones</td></tr>
|
||||
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
|
||||
<tr><td><tt>01</tt></td><td>desert</td></tr>
|
||||
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
|
||||
</table>
|
||||
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
|
||||
</li>
|
||||
</ul>
|
||||
<li><span style="font-weight: bold;">m1</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a name="WaterClass"></a>
|
||||
Bits 6..5:
|
||||
<table border="1" style="width: 30em;">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">The type of water that is on a tile.
|
||||
<tr><td style="width: 5em;"><tt>00</tt></td><td align=left>Sea</td></tr>
|
||||
<tr><td><tt>01</tt></td><td align=left>Canal</td></tr>
|
||||
<tr><td><tt>02</tt></td><td align=left>River</td></tr>
|
||||
<tr><td><tt>03</tt></td><td align=left>Invalid, i.e. no water on this tile</td></tr>
|
||||
</table>
|
||||
Some tiles, such as houses, reuse these bits of other purposes.
|
||||
</li>
|
||||
<li>
|
||||
<a name="OwnershipInfo"></a>
|
||||
Bits 4..0:
|
||||
<table border="1" style="width: 30em;">
|
||||
<tr bgcolor="#CCCCCC"><td colspan="2">The owner of a tile can be either companies (human or AI) or "Game entities".
|
||||
<tr><td style="width: 5em;"><tt>00..0E</tt></td><td align=left>Normal companies</td></tr>
|
||||
<tr><td><tt>0F</tt></td><td align=left>a town owns the tile</td></tr>
|
||||
<tr><td><tt>10</tt></td><td align=left>nobody owns the tile</td></tr>
|
||||
<tr><td><tt>11</tt></td><td align=left>"water" owns the tile</td></tr>
|
||||
<tr><td><tt>FF</tt></td><td align=left>spectator in MP or in scenario editor</td></tr>
|
||||
</table>
|
||||
Some tiles, such as houses and industries, reuse these bits of other purposes.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><span style="font-weight: bold;">m7:</span><br>
|
||||
Animation frame/state. Used for houses, industries, objects and stations.
|
||||
</li>
|
||||
</ul>
|
||||
The <a name="OwnershipInfo">owner of a tile</a>, as frequently associated with attribute m1,
|
||||
can be either players (human or AI) or "Game entities".
|
||||
They are identified using:
|
||||
<table border="1">
|
||||
<tr><td><tt>00</tt> </td><td align=left>current player</td></tr>
|
||||
<tr><td><tt>01..08</tt> </td><td align=left>AI or network players</td></tr>
|
||||
<tr><td><tt>0F</tt> </td><td align=left>a town owns the tile</td></tr>
|
||||
<tr><td><tt>10</tt> </td><td align=left>nobody owns the tile</td></tr>
|
||||
<tr><td><tt>11</tt> </td><td align=left>"water" owns the tile</td></tr>
|
||||
<tr><td><tt>FF</tt> </td><td align=left>spectator in MP or in scenario editor</td></tr>
|
||||
</table>
|
||||
|
||||
<p>OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.</p>
|
||||
|
||||
@@ -118,11 +78,9 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
|
||||
<li>m2: see fields</li>
|
||||
<li>m3 bits 7..5: type of hedge on NE border of the tile</li>
|
||||
<li>m3 bits 3..0: see fields</li>
|
||||
<li>m3 bit 4: set if the tile is covered with snow</li>
|
||||
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
|
||||
<li>m4 bits 4..2: same as 7..5, but for the SE border</li>
|
||||
<li>m5 bits 7..5: update counter, incremented on every periodic processing for tile types,
|
||||
@@ -210,7 +168,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m6 bits 4..2: type of hedge on NW border of the tile</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -223,10 +182,10 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile</li>
|
||||
<li>m2: see signals</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the tile</li>
|
||||
<li>m2: see waypoint and signals</li>
|
||||
<li>m3 bits 7..4: see signals</li>
|
||||
<li>m8 bits 5..0 = <a name="TrackType">track type</a>:
|
||||
<li>m3 bits 3..0 = <a name="TrackType">track type</a>:
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>0</tt> </td>
|
||||
@@ -417,40 +376,30 @@
|
||||
</tr>
|
||||
</table>
|
||||
<ul>
|
||||
<li>m2 bit 7: Signal 0 and 1: set = semaphore signals, clear = light signals</li>
|
||||
<li>m2 bit 3: Signal 2 and 3: set = semaphore signals, clear = light signals</li>
|
||||
<li>m2 bits 6..4: type of signal 0 and 1 (same values as m2 bits 2..0)</li>
|
||||
<li>m2 bits 2..0: type of signal 2 and 3
|
||||
<li>m2 bit 6: Signal 0 and 1: set = semaphore signals, clear = light signals</li>
|
||||
<li>m2 bit 2: Signal 2 and 3: set = semaphore signals, clear = light signals</li>
|
||||
<li>m2 bits 5..4: type of signal 0 and 1 (same values as m2 bits 1..0)</li>
|
||||
<li>m2 bits 1..0: type of signal 2 and 3
|
||||
<table>
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>000</tt>: </td>
|
||||
<td nowrap="nowrap" valign="top"><tt>00</tt>: </td>
|
||||
<td align="left">normal signals</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>001</tt>: </td>
|
||||
<td nowrap="nowrap" valign="top"><tt>01</tt>: </td>
|
||||
<td align="left">pre-signals</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>010</tt>: </td>
|
||||
<td nowrap="nowrap" valign="top"><tt>10</tt>: </td>
|
||||
<td align="left">exit-signals</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>011</tt>: </td>
|
||||
<td nowrap="nowrap" valign="top"><tt>11</tt>: </td>
|
||||
<td align="left">combo-signals</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>100</tt>: </td>
|
||||
<td align="left">pbs signals</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap="nowrap" valign="top"><tt>101</tt>: </td>
|
||||
<td align="left">no-entry signals</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
|
||||
@@ -458,44 +407,28 @@
|
||||
<li>m4 bits 7..4: bit clear = signal 3..0 shows red</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m2 bits 8..10: track reserved for pbs
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>0</tt> </td>
|
||||
<td>not reserved</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>1</tt> </td>
|
||||
<td>X direction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>2</tt> </td>
|
||||
<td>Y direction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>3</tt> </td>
|
||||
<td>north corner (W-E)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>4</tt> </td>
|
||||
<td>south corner (W-E)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>5</tt> </td>
|
||||
<td>west corner (N-S)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>6</tt> </td>
|
||||
<td>east corner (N-S)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m5 bit 7 set, bit 6 clear: checkpoint
|
||||
<ul>
|
||||
<li>m2: index into the array of waypoints.</li>
|
||||
<li>m5 bit 0:
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>0</tt> </td>
|
||||
<td>in X direction</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>1</tt> </td>
|
||||
<td>in Y direction</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m2 bit 11: opposite track is reserved, too</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m5 bit 7 set, bit 6 set: railway depot
|
||||
<ul>
|
||||
<li>m2: Depot index</li>
|
||||
<li>m5 bits 1..0: exit towards
|
||||
<table>
|
||||
<tr>
|
||||
@@ -519,9 +452,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m5 bit 4: pbs reservation state</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -534,9 +468,8 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m2: Index into the array of towns (owning town for town roads; closest town otherwise, INVALID_TOWN if there is no town or we are creating a town)</li>
|
||||
<li>m7 bit 5 set = on snow or desert</li>
|
||||
<li>m7 bits 7..6: present road types
|
||||
<li>m3 bit 7 set = on snow or desert</li>
|
||||
<li>m7 bits 7..5: present road types
|
||||
<table>
|
||||
<tr>
|
||||
<td>bit 0 </td>
|
||||
@@ -547,12 +480,17 @@
|
||||
<td>bit 1 </td>
|
||||
<td>tram</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>bit 2 </td>
|
||||
<td>reserved</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
|
||||
<li>m5 bits 7 clear: road or level-crossing
|
||||
<ul>
|
||||
<li>m6 bits 5..3:
|
||||
<li>m2: Index into the array of towns, 0 for non-town roads</li>
|
||||
<li>m3 bits 6..4:
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>0</tt> </td>
|
||||
@@ -584,11 +522,13 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m5 bits 3..0: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
|
||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road type 2 (reserved)
|
||||
<li>m5 bit 6 clear: road
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
|
||||
<li>m7 bits 3..0: counter for the roadworks</li>
|
||||
<li>m5 bits 3..0: road layout road type 0 (normal road): bit set = road piece present:
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
|
||||
<li>m3 bits 3..0: counter for the roadworks</li>
|
||||
<li>m4 bits 3..0: road layout road type 0 (normal road): bit set = road piece present:
|
||||
<table>
|
||||
<tr>
|
||||
<td align=left>bit 0: </td>
|
||||
@@ -608,7 +548,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m3 bits 0..3: road layout road type 1 (tram)</li>
|
||||
<li>m4 bits 7..4: road layout road type 1 (tram)</li>
|
||||
<li>m6 bits 5..2: road layout road type 2 (reserved)</li>
|
||||
<li>m5 bits 5..4: bits to disallow vehicles to go a specific direction
|
||||
<table>
|
||||
<tr>
|
||||
@@ -625,10 +566,9 @@
|
||||
</li>
|
||||
<li>m5 bit 6 set: level crossing
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the railway track</li>
|
||||
<li>m5 bit 5: set if crossing lights are on</li>
|
||||
<li>m5 bit 4: pbs reservation state</li>
|
||||
<li>m5 bit 0: direction
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the railway track</li>
|
||||
<li>m3 bits 3..0: <a href="#TrackType">railway track type</a></li>
|
||||
<li>m4 bit 6: direction
|
||||
<table>
|
||||
<tr>
|
||||
<td align=left><tt>0</tt> </td>
|
||||
@@ -640,17 +580,16 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
|
||||
<li>m8 bits 5..0: <a href="#TrackType">railway track type</a></li>
|
||||
<li>m4 bit 5: set if crossing lights are on</li>
|
||||
<li>m4 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m5 bit 7 set, bit 6 clear: road depot
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the depot</li>
|
||||
<li>m2: Depot index</li>
|
||||
<li>m5 bits 1..0: exit towards:
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the depot</li>
|
||||
<li>m5 bits 3..0: exit towards:
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>0</tt> </td>
|
||||
@@ -673,9 +612,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -694,7 +634,7 @@
|
||||
<ul>
|
||||
<li> set : House is complete
|
||||
<ul>
|
||||
<li>m5 : Age of house in years, clamped at 255</li>
|
||||
<li>m5 : year of house construction (relative to 1920); clamped to 0..255 (1920..2175)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> clear : House is in construction
|
||||
@@ -706,7 +646,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
|
||||
<li>m3 bit 5 : free</li>
|
||||
<li>m3 bit 5 : bit 6 of current animation frame (see m6)</li>
|
||||
<li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
|
||||
<li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
|
||||
<li>m5 : see m3 bit 7</li>
|
||||
@@ -714,7 +654,7 @@
|
||||
<ul>
|
||||
<li>If <a href="#newhouses">newhouses</a> is activated
|
||||
<ul>
|
||||
<li>bits 7..2 : Periodic processing time remaining</li>
|
||||
<li>bits 7..2 : Current animation frame (bits 5..0); bit 6 in m3</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Standard behaviour
|
||||
@@ -722,13 +662,14 @@
|
||||
<li>bits 7..2 : lift position (for houses type 04 and 05)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>bits 1..0 : tropic zone specifier</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m7 :
|
||||
<ul>
|
||||
<li>If <a href="#newhouses">newhouses</a> is activated
|
||||
<ul>
|
||||
<li>Current animation frame</li>
|
||||
<li>Periodic processing time remaining</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Standard behaviour (only for houses type 04 and 05)
|
||||
@@ -744,7 +685,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<small><a name="newhouses"></a>Newhouses is the name englobing a newGRF feature developped by TTDPatch devs (mainly Csaboka).<br>
|
||||
<small><a name="newhouses">Newhouses is the name englobing a newGRF feature developped by TTDPatch devs (mainly Csaboka).<br>
|
||||
It allows the replacement of the properties as well as the graphics of houses in the game.<br>
|
||||
To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.<br>
|
||||
110 is the count of standard houses. So above 110 means there is a new definition of at least one house</small>
|
||||
@@ -759,8 +700,9 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
|
||||
<li>m2 bits 8..6: ground
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
|
||||
<li>m2 bits 7..6: ground density
|
||||
<li>m2 bits 5..4: ground
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
@@ -782,14 +724,8 @@
|
||||
<td align=left><tt>3</tt> </td>
|
||||
<td>on shore (density must be 3)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=left><tt>4</tt> </td>
|
||||
<td>on snow with rough land underneed</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m2 bits 5..4: ground density</li>
|
||||
<li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
|
||||
on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
|
||||
<li>m3 bits 7..0: type of trees:
|
||||
@@ -826,6 +762,8 @@
|
||||
</table>
|
||||
<small>Note: the actually displayed set of trees depends on both type and number of trees</small>
|
||||
</li>
|
||||
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
|
||||
<li>m4 bits 4..2: type of hedge on the SE border of the tile (1 through 6, or 0=none)</li>
|
||||
<li>m5 bits 7..6: number of trees minus one</li>
|
||||
<li>m5 bits 2..0: growth status:
|
||||
<table border="0">
|
||||
@@ -843,6 +781,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -855,11 +794,12 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 6..5: water class for buoys, water part of docks and for airport tiles</li>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the station</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the station</li>
|
||||
<li>m2: index into the array of stations</li>
|
||||
<li>m3 bits 7..4: persistent random data for railway stations/waypoints and airports)</li>
|
||||
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram tracks (road stop)</li>
|
||||
<li>m3 bits 7..4: persistent random data for newstations</li>
|
||||
<li>m3 bits 3..0: <a href="#TrackType">track type</a> for railway stations</li>
|
||||
<li>m3 bits 2..0: present road types for road stops</li>
|
||||
<li>m3 bits 1..0: water class for buoys and water part of docks</li>
|
||||
<li>m4: custom station id; 0 means standard graphics</li>
|
||||
<li>m5: graphics index (range from 0..255 for each station type):
|
||||
<table>
|
||||
@@ -887,29 +827,13 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>00</tt>..<tt>01</tt></td>
|
||||
<td align=left>waypoints
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>00</tt> </td>
|
||||
<td align=left>in X direction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>01</tt> </td>
|
||||
<td align=left>in Y direction</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>00</tt>..<tt>FF</tt></td>
|
||||
<td nowrap valign=top><tt>00</tt>..<tt>8F</tt></td>
|
||||
<td align=left>all airports</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>00</tt>..<tt>05</tt> </td>
|
||||
<td align=left>road stops
|
||||
<td align=left>road stops:
|
||||
<table>
|
||||
<tr>
|
||||
<td><tt>00</tt> </td>
|
||||
@@ -972,13 +896,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
|
||||
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
|
||||
|
||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
|
||||
<li>m7 bits 7..6: present road types (road stops)</li>
|
||||
<li>m7: animation frame (railway stations/waypoints, airports)</li>
|
||||
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>
|
||||
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy)</li>
|
||||
<li>m6 bit 2: 1 when a drive through road stop is built over a town owned road, otherwise 0</li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -991,9 +911,8 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 6..5 : Water class (sea, canal or river)
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
|
||||
<li>m2: Depot index (for depots only)</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
|
||||
<li>m3 bits 1..0 : Water class (sea, canal or river)
|
||||
<li>m4: Random data for canal or river tiles</li>
|
||||
<li>m5: tile type:
|
||||
<table>
|
||||
@@ -1088,6 +1007,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1105,7 +1026,7 @@
|
||||
|
||||
<tr bgcolor="#CCCCCC">
|
||||
<td valign=top nowrap><strong><a name="Class8"><tt> 8</tt></a></strong></td>
|
||||
<td><strong>Industries </strong></td>
|
||||
<td><strong>Industry tile </strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top nowrap> </td>
|
||||
@@ -1113,14 +1034,13 @@
|
||||
<ul>
|
||||
<li>m1 bit 7: clear = under construction
|
||||
<ul>
|
||||
<li>m1 bits 6..5 : Water class (sea, canal, river or land)
|
||||
<li>m1 bits 3..2: construction counter, for buildings under construction incremented on every periodic tile processing</li>
|
||||
<li>m1 bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around<br>
|
||||
the meaning is different for some animated tiles which are never under construction (types <tt>01</tt>, <tt>1E</tt>..<tt>20</tt>, <tt>30</tt>, <tt>58</tt>; see above)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>m2: index into the array of industries</li>
|
||||
<li>m3: random bits (NewGRF)</li>
|
||||
<li>m3: animation state</li>
|
||||
<li>m4: animation loop</li>
|
||||
<li>m5: type (plus m6 bit 2):<br>
|
||||
<small>(note: this is not the same as the industry type, which is stored in the array of industries)</small>
|
||||
@@ -1137,7 +1057,7 @@
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>01</tt> </td>
|
||||
<td align=left>wheel tower when animated<br>
|
||||
animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
|
||||
animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -1153,7 +1073,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>0A</tt> </td>
|
||||
<td align=left>transformer; animation progress in m7(valid range <tt>0</tt>..<tt>7</tt>)</td>
|
||||
<td align=left>transformer; animation progress in m3(valid range <tt>0</tt>..<tt>7</tt>)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -1196,7 +1116,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>1E</tt>..<tt>20</tt> </td>
|
||||
<td align=left>various stages of animation; progress of animation in m7</td>
|
||||
<td align=left>various stages of animation; progress of animation in m3</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -1227,7 +1147,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>30</tt> </td>
|
||||
<td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
|
||||
<td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>31</tt> </td>
|
||||
@@ -1267,7 +1187,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>58</tt> </td>
|
||||
<td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
|
||||
<td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
@@ -1362,7 +1282,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>8F</tt> </td>
|
||||
<td align=left>Animated part; animation state in m7 (valid range <tt>00</tt>..<tt>31</tt>)<br>
|
||||
<td align=left>Animated part; animation state in m3 (valid range <tt>00</tt>..<tt>31</tt>)<br>
|
||||
Tile animation is started (m4 zeroed) on the periodic processing.<br>
|
||||
While the animation is in progress, m4 holds the number
|
||||
of animation cycles that have already taken place.<br>
|
||||
@@ -1392,7 +1312,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>A2</tt> </td>
|
||||
<td align=left>bubble capture facility; animation state in m7 (valid range <tt>00</tt>..<tt>27</tt>)</td>
|
||||
<td align=left>bubble capture facility; animation state in m3 (valid range <tt>00</tt>..<tt>27</tt>)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -1429,7 +1349,8 @@
|
||||
</li>
|
||||
<li>m6 bits 5..3: random triggers (NewGRF)</li>
|
||||
<li>m6 bit 2: bit 8 of type (see m5)</li>
|
||||
<li>m7: animation frame</li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
<li>m7: random bits (NewGRF)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1442,13 +1363,15 @@
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a></li>
|
||||
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram</li>
|
||||
<li>m5 bit 4: pbs reservation state for railway</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a></li>
|
||||
<li>m2 bits 7..4: see bridge ramp</li>
|
||||
<li>m3 bits 3..0: <a href="#TrackType">track type</a> for railway</li>
|
||||
<li>m3 bits 2..0: present road types for road</li>
|
||||
<li>m4 bit 7 set = on snow or desert</li>
|
||||
<li>m5 bits 7 clear: tunnel entrance/exit</li>
|
||||
<li>m5 bit 7 set: bridge ramp
|
||||
<ul>
|
||||
<li>m6 bits 5..2: <a name="BridgeType">bridge type</a>:
|
||||
<li>m2 bits 7..4: <a name="BridgeType">bridge type</a>:
|
||||
<table>
|
||||
<tr>
|
||||
<th align=left>Type </th>
|
||||
@@ -1548,12 +1471,6 @@
|
||||
<td><tt>1</tt> </td>
|
||||
<td>road</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>2</tt> </td>
|
||||
<td>water</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m5 bits 1..0: direction onto the bridge / out of the tunnel
|
||||
<table>
|
||||
@@ -1578,28 +1495,56 @@
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road</li>
|
||||
<li>m7 bit 5 set = on snow or desert</li>
|
||||
<li>m7 bits 7..6: present road types for road</li>
|
||||
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="#CCCCCC">
|
||||
<td valign=top nowrap><strong><a name="ClassA"><tt> A</tt></a></strong></td>
|
||||
<td><strong><tt>Objects</tt></strong></td>
|
||||
<td><strong><tt>Unmovables</tt></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top nowrap> </td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>m1 bits 6..5 : Water class (sea, canal, river or land)</li>
|
||||
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
|
||||
<li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li>
|
||||
<li>m3: random bits</li>
|
||||
<li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li>
|
||||
<li>m7: animation counter</li>
|
||||
<li>m1: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
|
||||
<li>m2: see company statue
|
||||
<li>m5: tile type:
|
||||
<table>
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>00</tt> </td>
|
||||
<td align=left>transmitter</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>01</tt> </td>
|
||||
<td align=left>lighthouse</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>02</tt> </td>
|
||||
<td align=left>company statue
|
||||
<ul>
|
||||
<li>m2: TownID on which the statue is built in</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>03</tt> </td>
|
||||
<td align=left>company-owned land</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap valign=top><tt>80</tt>..<tt>93</tt> </td>
|
||||
<td align=left>company headquarters (5 sets of 4 tiles each, updated quarterly depending on the company performance)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
|
||||
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="Author" content="Marcin Grzegorczyk">
|
||||
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>OpenTTD Landscape externals</title>
|
||||
</head>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays #2">
|
||||
<title>OpenTTD Landscape Internals - #2</title>
|
||||
<style type="text/css">
|
||||
@@ -17,7 +17,7 @@
|
||||
</head>
|
||||
<body style="direction: ltr;">
|
||||
<h3 style="font-weight: bold;">Landscape</h3>
|
||||
<span style="font-weight: bold;"></span>Nine attributes hold the information about a tile.
|
||||
<span style="font-weight: bold;"></span>Six attributes hold the information about a tile.
|
||||
This can be seen in the <a href="landscape.html">Landscape</a> document. This page tries to give an overview of used and free bits of
|
||||
the array so you can quickly see what is used and what is not.
|
||||
<ul>
|
||||
@@ -28,24 +28,21 @@ the array so you can quickly see what is used and what is not.
|
||||
</ul>
|
||||
<p>
|
||||
<ul>
|
||||
<li><span style="font-weight: bold;">type</span> - 8 bits in size, tile class (bits 4..7), bridge (bits 2..3) tropic zone (bits 0..1, only valid in tropic climate)</li>
|
||||
<li><span style="font-weight: bold;">height</span> - 8 bits in size, stores tile height</li>
|
||||
<li><span style="font-weight: bold;">type_height</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)</li>
|
||||
<li><span style="font-weight: bold;">m1</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li>
|
||||
<li><span style="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li>
|
||||
<li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m6</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m6</span> - 8 bits in size, special meaning : lower 2 bits only valid in tropic climate, upper 2 bits for bridges</li>
|
||||
<li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m8</span> - 16 bits in size, is used for general storage</li>
|
||||
</ul>
|
||||
|
||||
<table align=center border="1" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>class</th>
|
||||
<th>type (8)</th>
|
||||
<th>height (8)</th>
|
||||
<th>type_height (8)</th>
|
||||
<th>m1 (8)</th>
|
||||
<th>m2 (16)</th>
|
||||
<th>m3 (8)</th>
|
||||
@@ -53,342 +50,303 @@ the array so you can quickly see what is used and what is not.
|
||||
<th>m5 (8)</th>
|
||||
<th>m6 (8)</th>
|
||||
<th>m7 (8)</th>
|
||||
<th>m8 (16)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 class="caption">bits</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">FEDC BA98 7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">FEDC BA98 7654 3210</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">0</td>
|
||||
<td class="caption">ground</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">farmland</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>1</td>
|
||||
<td rowspan=4>1</td>
|
||||
<td class="caption">rail</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">rail with signals</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO O</span>XXX <span class="free">O</span>XXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">depot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">waypoint</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</td>
|
||||
<td class="bits">XX<span class="free">OO OOO</span>X</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>2</td>
|
||||
<td class="caption">road</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits">XXX<span class="free">O</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">level crossing</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOO</span>X</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">road depot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXX<span class="free">O</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XXX<span class="free">O OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td class="caption">house</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
|
||||
<td class="bits">XXX<span class="option">~ ~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXX<span class="abuse">X XXXX</span></td>
|
||||
<td class="bits"><span class="abuse">XXXX XX</span><span class="free">OO</span></td>
|
||||
<td class="bits"><span class="abuse">XXXX XX</span>XX</td>
|
||||
<td class="bits">XXXX <span class="abuse">XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td class="caption">trees</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XX<span class="free">OO O</span>XXX</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=7>5</td>
|
||||
<td rowspan=6>5</td>
|
||||
<td class="caption">rail station</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">rail waypoint</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">road stop</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO O</span>XXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits">XX<span class="free">O</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">dock</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">airport</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">buoy</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">oilrig</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>6</td>
|
||||
<td class="caption">sea, shore</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="option">~~</span>X XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">canal, river</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">shipdepot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td class="caption">industry</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="abuse">
|
||||
XXXX</span></td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=2>9</td>
|
||||
<td class="caption">tunnel entrance</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OO</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>bridge ramp</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=2>A</td>
|
||||
<td class="caption">objects</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="caption">unmovables</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="option">~~</span>X XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">company statue</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -1,30 +0,0 @@
|
||||
Some clarifications about the link graph
|
||||
----------------------------------------
|
||||
|
||||
InitializeLinkGraphs joins all threads, so if the game is abandoned
|
||||
with some threads still running, they're joined as soon as the next game
|
||||
(possibly the title game) is started. See also InitializeGame.
|
||||
|
||||
The MCF (multi-commodity flow) algorithm can be quite CPU-hungry as it's
|
||||
NP-hard and takes exponential time (though with a very small constant
|
||||
factor) in the number of nodes.
|
||||
This is why it is run in a separate thread where possible. However after
|
||||
some time the thread is joined and if it hasn't finished by then the game
|
||||
will hang. This problem gets worse if we are running on a platform without
|
||||
threads. However, as those are usually the ones with less CPU power I
|
||||
assume the contention for the CPU would make the game hard to play even
|
||||
with threads or even without cargodist (autosave ...). I might be wrong,
|
||||
but I won't put any work into this before someone shows me some problem.
|
||||
|
||||
You can configure the link graph recalculation time. A link graph
|
||||
recalculation time of X days means that each link graph job has X days
|
||||
to run before it is joined. The downside is that the flow stats won't be
|
||||
updated before the job is finished and thus a high value means less
|
||||
updates and longer times until changes in capacities are accounted for.
|
||||
If you play a very large map with a complicated link graph you may want to
|
||||
raise the time setting to avoid lags. The same holds for systems with slow
|
||||
CPUs.
|
||||
|
||||
Another option to avoid excessive lags is to reduce the accuracy of link
|
||||
graph calculations. Generally the accuracy is inversely correlated to the
|
||||
CPU requirements of the MCF algorithm.
|
@@ -1,219 +1,121 @@
|
||||
Multiplayer manual for OpenTTD
|
||||
Last updated: 2011-02-16
|
||||
------------------------------------------------------------------------
|
||||
Multiplayer Manual for OpenTTD (0.3.5)
|
||||
=======================================
|
||||
|
||||
1. Starting a Server
|
||||
---------------------
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) Starting a server
|
||||
2.0) Connecting to a server
|
||||
* 2.1) Connecting to a server over the console
|
||||
3.0) Playing internet games
|
||||
4.0) Tips for servers
|
||||
* 4.1) Imposing landscaping limits
|
||||
5.0) Some useful things
|
||||
6.0) Troubleshooting
|
||||
|
||||
|
||||
1.0) Starting a server
|
||||
---- -----------------
|
||||
- Make sure that you have your firewall of the computer as well as possible
|
||||
routers or modems of the server configured such that:
|
||||
* port 3979 is free for both UDP and TCP connections in- and outgoing
|
||||
* port 3978 is free outbound for UDP in order to advertise with the master
|
||||
server (if desired). Otherwise you'll have to tell players your IP.
|
||||
* port 3977 if use of the admin interface is desired (see admin_network.txt)
|
||||
- Click "multiplayer" on the startup screen
|
||||
- Click "start server"
|
||||
- Type in a game name
|
||||
- Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the
|
||||
last one other people are able to see you online. Else they need your IP and
|
||||
port to join)
|
||||
- Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the last one
|
||||
other people are able to see you online. Else they need your IP and port to join)
|
||||
- Click "start game", "load game" or "load scenario"
|
||||
- Start playing
|
||||
|
||||
|
||||
2.0) Connecting to a server
|
||||
---- ----------------------
|
||||
2. Connecting to a Server
|
||||
--------------------------
|
||||
|
||||
- Click "multiplayer" on the startup screen
|
||||
|
||||
- If you want to connect to any network game in your LAN click on 'LAN', then
|
||||
on 'Find Server'
|
||||
- If you want to see which servers all online on the Internet, click on
|
||||
'Internet' and 'Find Server'
|
||||
- If you want to connect to any network game in your LAN click on 'LAN', then on
|
||||
'Find Server'
|
||||
- If you want to see which servers all online on the Internet, click on 'Internet'
|
||||
and 'Find Server'
|
||||
|
||||
- If there were more than one server
|
||||
- If there were more then one server
|
||||
- select one in the list below the buttons
|
||||
- click on 'join game'
|
||||
|
||||
- If you want to play and you have the ip or hostname of the game server you
|
||||
want connect to.
|
||||
- If you want to play and you have the ip or hostname of the game server you want connect to.
|
||||
- click add server
|
||||
- type in the ip address or hostname
|
||||
- if you want to add a port use :<port>
|
||||
|
||||
- Now you can select a company and press: "Join company", to help that company
|
||||
- Or you can press "Spectate game", to spectate the game
|
||||
- Or you can press "New company", and start your own company (if there are
|
||||
slots free)
|
||||
- Or you can press "New company", and start your own company (if there are slots free)
|
||||
|
||||
- You see a progressbar how far you are with joining the server.
|
||||
|
||||
- Happy playing
|
||||
|
||||
2.1) Connecting to a server over the console
|
||||
---- ---------------------------------------
|
||||
|
||||
3. Connecting to a Server over the Console
|
||||
-------------------------------------------
|
||||
|
||||
- Open the console and type in the following command:
|
||||
connect <ip/host>:<port>#<company-no>
|
||||
|
||||
connect <ip/host>:<port>#<player-no>
|
||||
|
||||
|
||||
3.0) Playing internet games
|
||||
---- ----------------------
|
||||
- Servers with a red dot behind it have a different version then you have. You
|
||||
will not be able to join those servers.
|
||||
4. Playing Internet-Games
|
||||
--------------------------
|
||||
|
||||
- Servers with a yellow dot behind it have NewGRFs that you do not have. You
|
||||
will not be able to join those servers. However, via "NewGRF Settings" and
|
||||
"Find missing content online" you might be able to download the needed
|
||||
NewGRFs after which you can join the server.
|
||||
- Since OpenTTD 0.3.5 the network protocol has been rewritten and is very stable, even over slow connections.
|
||||
|
||||
- It can happen that a connection is that slow, or you have that many clients
|
||||
connected to your server, that your clients start to loose their connection.
|
||||
Some things you can do about it:
|
||||
- [network] frame_freq:
|
||||
change it in console with: 'set network.frame_freq <number>'
|
||||
the number should be between the 0 and 10, not much higher. It indicates
|
||||
the delay between clicking and showing up. The higher, the more you notice
|
||||
it, but the less bandwidth you use.
|
||||
- Servers with a red dot behind it have a different version then you have. You will not be able to join those servers.
|
||||
|
||||
- Servers with a yellow dot behind it have NewGRFs that you do not have. You will not be able to join those servers.
|
||||
|
||||
- It can happen that a connection is that slow, or you have that many clients connected to your server, that your clients start to loose their connection. Some things you can do about it:
|
||||
|
||||
- net_frame_freq:
|
||||
change it in console with: net_frame_freq = <number>
|
||||
the number should be between the 0 and 10, not much higher. It indicates the delay between clicking and showing up. The higher, the more you notice it, but the less bandwidth you use.
|
||||
A good value for Internet-games is 2 or 3.
|
||||
|
||||
- [network] sync_freq:
|
||||
change it in console with: 'set network.sync_freq <number>'
|
||||
the number should be between the 50 and 1000, not much lower, not much
|
||||
higher. It indicates the time between sync-frames. A sync-frame is a frame
|
||||
which checks if all clients are still in sync. When the value it too high,
|
||||
clients can desync in 1960, but the server detects it in 1970. Not really
|
||||
handy. The lower the value, the more bandwidth it uses.
|
||||
- net_sync_freq:
|
||||
change it in console with: net_sync_freq = <number>
|
||||
the number should be between the 50 and 1000, not much lower, not much higer. It indicates the time between sync-frames. A sync-frame is a frame which checks if all clients are still in sync. When the value it too high, clients can desync in 1960, but the server detects it in 1970. Not really handy. The lower the value, the more bandwidth it uses.
|
||||
|
||||
NB: changing frame_freq has more effect on the bandwidth then sync_freq.
|
||||
NB: changing net_frame_freq has more effect on the bandwidth then net_sync_freq. You should never change net_sync_freq!
|
||||
|
||||
|
||||
4.0) Tips for servers
|
||||
---- ----------------
|
||||
- You can launch a dedicated server by adding -D as parameter.
|
||||
- In UNIX like systems, you can fork your dedicated server by adding -f as
|
||||
parameter.
|
||||
5. Tips for servers
|
||||
--------------------
|
||||
|
||||
- You can automatically clean companies that do not have a client connected to
|
||||
them, for, let's say, 3 years. You can do this via: 'set autoclean_companies'
|
||||
and 'set autoclean_protected' and 'set autoclean_unprotected'. Unprotected
|
||||
removes a password from a company when it is not used for more then the
|
||||
defined amount of months. 'set autoclean_novehicles' can be used to remove
|
||||
companies without any vehicles quickly.
|
||||
- You can launch a dedicated server by adding -D as parameter
|
||||
- In UNIX like systems, you can fork your dedicated server by adding -f as parameter
|
||||
|
||||
- You can automaticly clean companies that do not have a client connected to them, for, let's say,
|
||||
3 years. You can do this via: 'set autoclean_companies' and 'set autoclean_protected' and
|
||||
'set autoclean_unprotected'. Unprotected removes a password from a company when it is
|
||||
not used for more then the defined amount of months.
|
||||
- You can also do this manually via the console: 'reset_company'.
|
||||
Both ways, the company will go bankrupt.
|
||||
|
||||
- You can let your server automatically restart a map when, let's say, year 2030
|
||||
is reached. See 'set restart_game_date' for detail.
|
||||
- You can let your server automaticly restart a map when, let's say, year 2030 is reached.
|
||||
See 'set restart_game_date' for detail.
|
||||
- If you want to be on the server-list, enable Advertising. To do this, select 'Internet (advertise)'
|
||||
in the Start Server menu, or type in console: 'set server_advertise 1'.
|
||||
|
||||
- If you want to be on the server-list, enable Advertising. To do this, select
|
||||
'Internet (advertise)' in the Start Server menu, or type in console:
|
||||
'set server_advertise 1'.
|
||||
- You can protect your server with a password via the console: 'set server_pw', or via the
|
||||
Start Server menu.
|
||||
|
||||
- You can protect your server with a password via the console: 'set server_pw',
|
||||
or via the Start Server menu.
|
||||
|
||||
- When you have many clients connected to your server via Internet, watch your
|
||||
bandwidth (if you have any limit on it, set by your ISP). One client uses
|
||||
about 1.5 kilobytes per second up and down. To decrease this amount, setting
|
||||
'frame_freq' to 1 will reduce it to roughly 1 kilobyte per second per client.
|
||||
|
||||
- OpenTTD's default settings for maximum number of clients, and amount of data
|
||||
from clients to process are chosen to not influence the normal playing of
|
||||
people, but to prevent or at least make it less likely that someone can
|
||||
perform a (distributed) denial-of-service attack on your server by causing
|
||||
an out-of-memory event by flooding the server with data to send to all
|
||||
clients. The major factor in this is the maximum number of clients; with
|
||||
32 clients "only" sending one chat message causes 1024 messages to be
|
||||
distributed in total, with 64 clients that already quadruples to 4096. Given
|
||||
that upstream bandwidth is usually the limiting factor, a queue of packets
|
||||
that need to be sent will be created.
|
||||
To prevent clients from exploiting this "explosion" of packets to send we
|
||||
limit the number of incoming data, resulting in effectively limiting the
|
||||
amount of data that OpenTTD will send to the clients. Even with the default
|
||||
limits it is possible to generate about 70.000 packets per second, or about
|
||||
7 megabit per second of traffic.
|
||||
Given that OpenTTD kicks clients after they have not reacted within about 9
|
||||
seconds from sending a frame update packet it would be possible that OpenTTD
|
||||
keeps about 600.000 packets in memory, using about 50 megabytes of memory.
|
||||
Given that OpenTTD allows short bursts of packets, you can have slightly
|
||||
more packets in memory in case of a distributed denial of service attack.
|
||||
When increasing the amount of incoming data, or the maximum number of
|
||||
clients the amount of memory OpenTTD needs in case of a distributed denial
|
||||
of service attack is linearly related to the amount of incoming data and
|
||||
quadratic to the amount of clients. In short, a rule of thumb for, the
|
||||
maximum memory usage for packets is:
|
||||
#max_clients * #max_clients * bytes_per_frame * 10 KiB.
|
||||
|
||||
4.1) Imposing landscaping limits
|
||||
---- ---------------------------
|
||||
- You can impose limits on companies by the following 4 settings:
|
||||
- terraform_per_64k_frames
|
||||
- terraform_frame_burst
|
||||
- clear_per_64k_frames
|
||||
- clear_frame_burst
|
||||
|
||||
- Explaining 'per_64K_frames' and 'burst'
|
||||
- 'burst' defines 3 things, the maximum limit, the limit of a single action,
|
||||
and the initial value for the limit assigned to a new company.
|
||||
This setting is fairly simple and requires no math.
|
||||
|
||||
A value of 1 means a single tile can be affected by a single action.
|
||||
This results in having to click 400 times when wanting to cover an area
|
||||
of 20 x 20 tiles.
|
||||
|
||||
The default value 4096 covers an area of 64 x 64 tiles.
|
||||
|
||||
- 'per_64k_frames' defines the number of tiles added to each companies limit
|
||||
per frame (however not past the possible maximum value,the 'burst').
|
||||
64k rather resembles the exact number of 65536 frames. So setting this
|
||||
variable to 65536 means: 65536 / 65536 = 1 tile per frame.
|
||||
As a day consists of 74 frames, a company's limit is increased by 74
|
||||
tiles during the course of a single day (2.22 seconds).
|
||||
|
||||
To achieve a 1 tile per day increase the following calculation is needed:
|
||||
1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...
|
||||
after rounding: a value of 886 means adding a bit over 1 tile per day.
|
||||
|
||||
There is still enough space to scale this value downwards:
|
||||
decreasing this value to 127 results in a bit over 1 tile added to the
|
||||
allowance per week (7 days).
|
||||
|
||||
To create a setup in which a company gets an initial allowance only,
|
||||
set the value to 0 - no increase of the allowance per frame.
|
||||
|
||||
- Even though construction actions include a clear tile action, they are not
|
||||
affected by the above settings.
|
||||
- When you have many clients connected to your server via Internet, watch your bandwidth (if
|
||||
you have any limit on it, set by your ISP). 1 client uses +/- 3 kb/s up and down. To decrease
|
||||
this amount, set 'net_frame_freq' to 1 for example. This will reduce it to 1.5 kb/s per client.
|
||||
|
||||
|
||||
5.0) Some useful things
|
||||
---- ------------------
|
||||
- You can protect your company so nobody else can join uninvited. To do this,
|
||||
set a password in your Company Screen
|
||||
6. Some useful things
|
||||
----------------------
|
||||
|
||||
- You can give other players some money via the ClientList (under the 'head'
|
||||
in the mainbar).
|
||||
- You can protect your company so nobody else can join uninvited. To do this, check your Company Screen
|
||||
|
||||
- You can give other players some money via the ClientList (under the 'head' in the mainbar).
|
||||
|
||||
- You can chat with other players via ENTER or via SHIFT+T or via the ClientList
|
||||
|
||||
- Servers can now kick players, so don't make them use it!
|
||||
|
||||
- From 0.3.5, desyncs should not happen anymore
|
||||
|
||||
6.0) Troubleshooting
|
||||
---- ---------------
|
||||
- My advertising server does not show up in list at servers.openttd.org
|
||||
Run openttd with the '-d net=2' parameter. That will show which incoming
|
||||
communication is received, whether the replies from the master server or
|
||||
communication from an admin tool reach the programme. See section 1
|
||||
'Starting a server' further up for the ports and protocols used by OpenTTD.
|
||||
The ports can be configured in the config file.
|
||||
- From 0.3.5, patch-settings are also synced. You can now play without deleting openttd.cfg, and with, for example, extra large trains enabled.
|
||||
|
||||
7. Troubleshooting
|
||||
------------------
|
||||
|
||||
- My advertised server does not show up in the 'advertised server list' (servers.openttd.org)
|
||||
Run openttd with the '-d net=2' parameter, as this will show whether it receives replies from the master server.
|
||||
If it does not receive replies it is most likely that you need to configure your router to forward the OpenTTD ports 3979 (both TCP and UDP) to the computer that is hosting the game.
|
||||
|
@@ -1,85 +0,0 @@
|
||||
;
|
||||
; Example file for the OpenTTD Base Graphics replacement sets.
|
||||
; This file consists of basically two different parts:
|
||||
; * metadata
|
||||
; * information about the files
|
||||
;
|
||||
; Metadata contains information about the name, version and palette
|
||||
; of the graphics set.
|
||||
;
|
||||
; == Getting started ==
|
||||
; - you can't add comments after values
|
||||
; - you have to fill the MD5 checksum for each file
|
||||
; - you may not miss any of the metadata or files items
|
||||
; - `openttd -h` lists all graphics replacements sets it found to be correct
|
||||
; - `openttd -d grf=1` shows warnings/errors when parsing an .obg file
|
||||
; - `openttd -I <name>` starts OpenTTD with the given set (case sensitive)
|
||||
; - adding `graphicsset = <name>` to the misc section of openttd.cfg makes
|
||||
; OpenTTD start with that graphics set by default
|
||||
; - there is a command line tool for all platforms called md5sum that can
|
||||
; create the MD5 checksum you need.
|
||||
; - all files specified in this file are search relatively to the path where
|
||||
; this file is found, i.e. if the graphics files are in a subdir you have
|
||||
; to add that subdir to the names in this file to! It will NOT search for
|
||||
; a file named like specified in here.
|
||||
|
||||
[metadata]
|
||||
; the name of the pack, preferably less than 16 characters
|
||||
name = example
|
||||
; the short name (4 characters), used to identify this set
|
||||
shortname = XMPL
|
||||
; the version of this graphics set (read as single integer)
|
||||
version = 0
|
||||
; a fairly short description of the set
|
||||
; By adding '.<iso code>' you can translate the description.
|
||||
; Note that OpenTTD first tries the full ISO code, then the first
|
||||
; two characters and then uses the fallback (no '.<iso code>').
|
||||
; The ISO code matching is case sensitive!
|
||||
; So en_US will be used for en_GB if no en_GB translation is added.
|
||||
; As a result the below example has 'howdie' for en_US and en_GB but
|
||||
; 'foo' for all other languages.
|
||||
description = foo
|
||||
description.en_US = howdie
|
||||
; palette used by the set; either DOS or Windows
|
||||
palette = DOS
|
||||
; preferred blitter, optional; either 8bpp (default) or 32bpp.
|
||||
blitter = 8bpp
|
||||
|
||||
; The files section lists the files that replace sprites.
|
||||
; The file names are case sensitive.
|
||||
[files]
|
||||
; GRF file with the base sprites
|
||||
base = TRG1.GRF
|
||||
; GRF file with logos, original terrain generator sprites
|
||||
logos = TRGI.GRF
|
||||
; GRF file with extra arctic sprites
|
||||
arctic = TRGC.GRF
|
||||
; GRF file with extra tropical sprites
|
||||
tropical = TRGH.GRF
|
||||
; GRF file with extra toyland sprites
|
||||
toyland = TRGT.GRF
|
||||
; NewGRF file using Actions 5, 7, 9 and A to replace sprites
|
||||
; Must use a GRF ID starting with FF so it cannot be selected from
|
||||
; the in-game NewGRF list and (thus) be loaded twice.
|
||||
extra = OPENTTDD.GRF
|
||||
|
||||
; The md5s section lists the MD5 checksum for the files that replace them.
|
||||
; Note that the list of files is case sensitive. Each GRF listed in the
|
||||
; files section must be listed here with it's MD5 checksum, otherwise you
|
||||
; will get a lot of warnings when starting OpenTTD.
|
||||
[md5s]
|
||||
TRG1.GRF = 9311676280e5b14077a8ee41c1b42192
|
||||
TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
|
||||
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
|
||||
TRGC.GRF = ed446637e034104c5559b32c18afe78d
|
||||
TRGT.GRF = fcde1d7e8a74197d72a62695884b909e
|
||||
OPENTTDD.GRF = f829f62c137d6d7c6e272c481b796dd5
|
||||
|
||||
; The origin section provides the possibility to put and extra line into
|
||||
; the warning that a file is missing/corrupt. This can be used to tell
|
||||
; them where to find it. It works on the filename specified in the
|
||||
; files section and if that is not found it will fall back to the default
|
||||
; as shown below here.
|
||||
[origin]
|
||||
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
|
||||
OPENTTDD.GRF = This file was part of your installation.
|
@@ -1,124 +0,0 @@
|
||||
;
|
||||
; Example file for the OpenTTD Base Music replacement sets.
|
||||
; This file consists of basically two different parts:
|
||||
; * metadata
|
||||
; * information about the files/songs
|
||||
;
|
||||
; Metadata contains information about the name and version
|
||||
; of the music set.
|
||||
;
|
||||
; == Getting started ==
|
||||
; - you can't add comments after values
|
||||
; - you have to fill the MD5 checksum for each file
|
||||
; - you may not miss any of the metadata or files items
|
||||
; - `openttd -h` lists all music replacement sets it found to be correct
|
||||
; - `openttd -d grf=1` shows warnings/errors when parsing an .obm file
|
||||
; - `openttd -M <name>` starts OpenTTD with the given set (case sensitive)
|
||||
; - adding `musicset = <name>` to the misc section of openttd.cfg makes
|
||||
; OpenTTD start with that sound set by default
|
||||
; - there is a command line tool for all platforms called md5sum that can
|
||||
; create the MD5 checksum you need.
|
||||
; - all files specified in this file are search relatively to the path where
|
||||
; this file is found, i.e. if the sound files are in a subdir you have
|
||||
; to add that subdir to the names in this file to! It will NOT search for
|
||||
; a file named like specified in here.
|
||||
|
||||
[metadata]
|
||||
; the name of the pack, preferably less than 16 characters
|
||||
name = example
|
||||
; the short name (4 characters), used to identify this set
|
||||
shortname = XMPL
|
||||
; the version of this sound set (read as single integer)
|
||||
version = 0
|
||||
; a fairly short description of the set
|
||||
; By adding '.<iso code>' you can translate the description.
|
||||
; Note that OpenTTD first tries the full ISO code, then the first
|
||||
; two characters and then uses the fallback (no '.<iso code>').
|
||||
; The ISO code matching is case sensitive!
|
||||
; So en_US will be used for en_GB if no en_GB translation is added.
|
||||
; As a result the below example has 'howdie' for en_US and en_GB but
|
||||
; 'foo' for all other languages.
|
||||
description = foo
|
||||
description.en_US = howdie
|
||||
|
||||
; The files section lists the files that replace songs.
|
||||
; The file names are case sensitive.
|
||||
; You can have empty file names; in that case no song will be loaded
|
||||
; for that 'entry'.
|
||||
; If you want to load music from the MPS DOS music driver "cat" format,
|
||||
; specify just the name of the .cat file the song is located in, then
|
||||
; fill out the "catindex" section.
|
||||
[files]
|
||||
; The theme song for OpenTTD
|
||||
theme = THEME_SONG.GM
|
||||
; The songs in the 'old style' category
|
||||
old_0 = GM.CAT
|
||||
old_1 = GM.CAT
|
||||
old_2 =
|
||||
old_3 =
|
||||
old_4 =
|
||||
old_5 =
|
||||
old_6 =
|
||||
old_7 =
|
||||
old_8 =
|
||||
old_9 =
|
||||
; The songs in the 'new style' category
|
||||
new_0 =
|
||||
new_1 =
|
||||
new_2 =
|
||||
new_3 =
|
||||
new_4 =
|
||||
new_5 =
|
||||
new_6 =
|
||||
new_7 =
|
||||
new_8 =
|
||||
new_9 =
|
||||
; The songs in the 'ezy street' category
|
||||
ezy_0 =
|
||||
ezy_1 =
|
||||
ezy_2 =
|
||||
ezy_3 =
|
||||
ezy_4 =
|
||||
ezy_5 =
|
||||
ezy_6 =
|
||||
ezy_7 =
|
||||
ezy_8 =
|
||||
ezy_9 =
|
||||
|
||||
; The names section lists the song names for the given file name.
|
||||
; Note that the list of files is case sensitive. Each file listed in the
|
||||
; files section must be listed here with it's song name, otherwise you
|
||||
; will get a lot of warnings when starting OpenTTD.
|
||||
; You don't need to fill this out for "cat" format music, the song names
|
||||
; are loaded directly from the file in that case.
|
||||
[names]
|
||||
THEME_SONG.GM = Tycoon DELUXE Theme
|
||||
|
||||
; If you are loading music from the DOS version "cat" format, specify
|
||||
; which index into the file the song has.
|
||||
[catindex]
|
||||
old_0 = 1
|
||||
old_1 = 3
|
||||
|
||||
; The md5s section lists the MD5 checksum for the files that replace them.
|
||||
; Note that the list of files is case sensitive. Each file listed in the
|
||||
; files section must be listed here with it's MD5 checksum, otherwise you
|
||||
; will get a lot of warnings when starting OpenTTD.
|
||||
[md5s]
|
||||
THEME_SONG.GM = 45cfec1b9d8c7a0ad45e755833cbf221
|
||||
|
||||
; If a song needs to have parts of the start or end cut off to avoid long
|
||||
; silences, you can specify MIDI tick codes for start:end of the actual
|
||||
; music part for each file here.
|
||||
; Not all music drivers might support this feature.
|
||||
[timingtrim]
|
||||
THEME_SONG.GM = 768:53760
|
||||
|
||||
; The origin section provides the possibility to put and extra line into
|
||||
; the warning that a file is missing/corrupt. This can be used to tell
|
||||
; them where to find it. It works on the filename specified in the
|
||||
; files section and if that is not found it will fall back to the default
|
||||
; as shown below here.
|
||||
[origin]
|
||||
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
|
||||
THEME_SONG.GM = You can find it also on your Transport Tycoon Deluxe CD-ROM.
|
@@ -1,64 +0,0 @@
|
||||
;
|
||||
; Example file for the OpenTTD Base Sound replacement sets.
|
||||
; This file consists of basically two different parts:
|
||||
; * metadata
|
||||
; * information about the files
|
||||
;
|
||||
; Metadata contains information about the name and version
|
||||
; of the sound set.
|
||||
;
|
||||
; == Getting started ==
|
||||
; - you can't add comments after values
|
||||
; - you have to fill the MD5 checksum for each file
|
||||
; - you may not miss any of the metadata or files items
|
||||
; - `openttd -h` lists all sound replacements sets it found to be correct
|
||||
; - `openttd -d grf=1` shows warnings/errors when parsing an .obs file
|
||||
; - `openttd -S <name>` starts OpenTTD with the given set (case sensitive)
|
||||
; - adding `soundsset = <name>` to the misc section of openttd.cfg makes
|
||||
; OpenTTD start with that sound set by default
|
||||
; - there is a command line tool for all platforms called md5sum that can
|
||||
; create the MD5 checksum you need.
|
||||
; - all files specified in this file are search relatively to the path where
|
||||
; this file is found, i.e. if the sound files are in a subdir you have
|
||||
; to add that subdir to the names in this file to! It will NOT search for
|
||||
; a file named like specified in here.
|
||||
|
||||
[metadata]
|
||||
; the name of the pack, preferably less than 16 characters
|
||||
name = example
|
||||
; the short name (4 characters), used to identify this set
|
||||
shortname = XMPL
|
||||
; the version of this sound set (read as single integer)
|
||||
version = 0
|
||||
; a fairly short description of the set
|
||||
; By adding '.<iso code>' you can translate the description.
|
||||
; Note that OpenTTD first tries the full ISO code, then the first
|
||||
; two characters and then uses the fallback (no '.<iso code>').
|
||||
; The ISO code matching is case sensitive!
|
||||
; So en_US will be used for en_GB if no en_GB translation is added.
|
||||
; As a result the below example has 'howdie' for en_US and en_GB but
|
||||
; 'foo' for all other languages.
|
||||
description = foo
|
||||
description.en_US = howdie
|
||||
|
||||
; The files section lists the files that replace sprites.
|
||||
; The file names are case sensitive.
|
||||
[files]
|
||||
; The file with the samples. Must contain exactly 73 samples.
|
||||
samples = SAMPLES.CAT
|
||||
|
||||
; The md5s section lists the MD5 checksum for the files that replace them.
|
||||
; Note that the list of files is case sensitive. Each file listed in the
|
||||
; files section must be listed here with it's MD5 checksum, otherwise you
|
||||
; will get a lot of warnings when starting OpenTTD.
|
||||
[md5s]
|
||||
SAMPLES.CAT = 422ea3dd074d2859bb51639a6e0e85da
|
||||
|
||||
; The origin section provides the possibility to put and extra line into
|
||||
; the warning that a file is missing/corrupt. This can be used to tell
|
||||
; them where to find it. It works on the filename specified in the
|
||||
; files section and if that is not found it will fall back to the default
|
||||
; as shown below here.
|
||||
[origin]
|
||||
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
|
||||
SAMPLES.CAT = You can find it also on your Transport Tycoon Deluxe CD-ROM.
|
163
docs/openttd.6
163
docs/openttd.6
@@ -1,152 +1,79 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.Dd October 13, 2014
|
||||
.Dd Jul 20, 2008
|
||||
.Dt OPENTTD 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm openttd
|
||||
.Nd open source clone of the Microprose game \(lqTransport Tycoon Deluxe\(rq
|
||||
.Nd An open source clone of the Microprose game "Transport Tycoon Deluxe"
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl efhx
|
||||
.Op Fl b Ar blitter
|
||||
.Op Fl c Ar config_file
|
||||
.Op Fl d Op Ar level | Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
|
||||
.Op Fl D Oo Ar host Oc Ns Op : Ns Ar port
|
||||
.Op Fl g Op Ar savegame
|
||||
.Op Fl Defhix
|
||||
.Op Fl G Ar seed
|
||||
.Op Fl I Ar graphicsset
|
||||
.Op Fl l Ar host Ns Op : Ns Ar port
|
||||
.Op Fl b Ar blitter
|
||||
.Op Fl d Ar [level | cat=lvl[, ...]]
|
||||
.Op Fl c Ar config_file
|
||||
.Op Fl g Ar [savegame]
|
||||
.Op Fl l Ar host[:port]
|
||||
.Op Fl n Ar host[:port][#player]
|
||||
.Op Fl r Ar widthxheight
|
||||
.Op Fl t Ar date
|
||||
.Op Fl m Ar driver
|
||||
.Op Fl M Ar musicset
|
||||
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
|
||||
.Op Fl p Ar password
|
||||
.Op Fl P Ar password
|
||||
.Op Fl q Ar savegame
|
||||
.Op Fl r Ar width Ns x Ns Ar height
|
||||
.Op Fl s Ar driver
|
||||
.Op Fl S Ar soundset
|
||||
.Op Fl t Ar year
|
||||
.Op Fl v Ar driver
|
||||
.Op Fl b Ar blitter
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width "-n host[:port][#player]"
|
||||
.Bl -tag -width ".Fl n Ar host[:port][#player]"
|
||||
.It Fl D Ar [host][:port]
|
||||
Start a dedicated server
|
||||
.It Fl G Ar seed
|
||||
Seed the pseudo random number generator
|
||||
.It Fl b Ar blitter
|
||||
Select the blitter
|
||||
.Ar blitter ;
|
||||
see
|
||||
Set the blitter, see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl c Ar config_file
|
||||
Use
|
||||
.Ar config_file
|
||||
instead of
|
||||
.Pa openttd.cfg .
|
||||
Use 'config_file' instead of 'openttd.cfg'
|
||||
.It Fl d Ar [level]
|
||||
Set debug verbosity for all categories to
|
||||
.Ar level ,
|
||||
or 1 if omitted.
|
||||
.It Fl d Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
|
||||
Set debug verbosity to
|
||||
.Ar lvl
|
||||
for a specific category
|
||||
.Ar cat .
|
||||
.It Fl D Oo Ar host Oc Ns Op : Ns Ar port
|
||||
Start a dedicated server.
|
||||
.Pp
|
||||
Network debug level will be set to 6.
|
||||
If you want to change this, set
|
||||
.Fl d
|
||||
after setting
|
||||
.Fl D .
|
||||
.Ar level
|
||||
or 1 if omitted
|
||||
.It Fl d Ar cat=level[, ...]
|
||||
Set debug verbosity for a specific category
|
||||
.It Fl e
|
||||
Start in world editor mode.
|
||||
Start in world editor mode
|
||||
.It Fl f
|
||||
Fork into background (dedicated server only, see
|
||||
.Fl D ) .
|
||||
.It Fl g Op Ar savegame
|
||||
Fork into background (dedicated only, see
|
||||
.Fl D )
|
||||
.It Fl g Ar [savegame]
|
||||
Load
|
||||
.Ar savegame
|
||||
at start or start a new game if omitted.
|
||||
.Ar savegame
|
||||
must be either an absolute path or one relative to the current path or one of
|
||||
the search paths.
|
||||
.It Fl G Ar seed
|
||||
Seed the pseudo random number generator with
|
||||
.Ar seed .
|
||||
at start or start a new game if omitted
|
||||
.It Fl h
|
||||
Display a summary of all options and list all the available AIs, blitters,
|
||||
sound, music and video drivers, graphics sets and sound sets.
|
||||
.It Fl I Ar graphicsset
|
||||
Select the graphics set
|
||||
.Ar graphicsset ;
|
||||
see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl l Ar host Ns Op : Ns Ar port
|
||||
Redirect
|
||||
.Fn DEBUG
|
||||
output; see
|
||||
.Fl D .
|
||||
Display a summary of all options and available drivers
|
||||
.It Fl i
|
||||
Force to use the DOS palette (use this if you see a lot of magenta)
|
||||
.It Fl l Ar host[:port]
|
||||
Redirect DEBUG(), See
|
||||
.Fl D
|
||||
.It Fl m Ar driver
|
||||
Select the music driver
|
||||
.Ar driver ;
|
||||
see
|
||||
Set the music driver, see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl M Ar musicset
|
||||
Select the music set
|
||||
.Ar musicset ;
|
||||
see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
|
||||
Join a network game, optionally specifying a port to connect to and player to
|
||||
play as.
|
||||
.It Fl p Ar password
|
||||
Password used to join server.
|
||||
Only useful with
|
||||
.Fl n .
|
||||
.It Fl P Ar password
|
||||
Password used to join company.
|
||||
Only useful with
|
||||
.Fl n .
|
||||
.It Fl q Ar savegame
|
||||
Write some information about the specified savegame and exit.
|
||||
.It Fl r Ar width Ns x Ns Ar height
|
||||
Set the resolution to
|
||||
.Ar width
|
||||
\(mu
|
||||
.Ar height
|
||||
pixels.
|
||||
.It Fl n Ar host[:port][#player]
|
||||
Join a network game, optionally specify player to play as and port to connect to
|
||||
.It Fl r Ar widthxheight
|
||||
Set the resolution
|
||||
.It Fl s Ar driver
|
||||
Select the sound driver
|
||||
.Ar driver ;
|
||||
see
|
||||
Set the sound driver, see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl S Ar soundset
|
||||
Select the sound set
|
||||
.Ar soundset ;
|
||||
see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl t Ar year
|
||||
Set the starting year to
|
||||
.Ar year .
|
||||
.It Fl t Ar date
|
||||
Set the starting date
|
||||
.It Fl v Ar driver
|
||||
Select the video driver
|
||||
.Ar driver ;
|
||||
see
|
||||
Set the video driver, see
|
||||
.Fl h
|
||||
for a full list.
|
||||
.It Fl x
|
||||
Do not automatically save to config file on exit.
|
||||
Do not automatically save to config file on exit
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Lk https://wiki.openttd.org "Wiki"
|
||||
(includes community maintained manual),
|
||||
.Lk https://forum.openttd.org "Forum",
|
||||
.Lk https://www.openttd.org "News"
|
||||
http://wiki.openttd.org/, http://www.openttd.org
|
||||
.Sh HISTORY
|
||||
Transport Tycoon Deluxe was written by Chris Sawyer and published by Microprose.
|
||||
.Nm
|
||||
|
BIN
docs/ottd-colour-palette.gif
Normal file
BIN
docs/ottd-colour-palette.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user