1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-14 10:09:11 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
rubidium
7def546fca (svn r11869) -Release: 0.6.0-beta3
Took way too long, but that happens when real life interferes and the bugcount is rising instead of declining.
2008-01-15 20:55:36 +00:00
375 changed files with 20249 additions and 22337 deletions

11
.gitignore vendored
View File

@@ -1,11 +0,0 @@
Makefile*
bin/*
!bin/data/chars.grf
!bin/data/openttdd.grf
!bin/data/openttdw.grf
!bin/data/opntitle.grf
!bin/scenario/README
!bin/scripts*
config.*
objs/*
src/rev.cpp

View File

@@ -158,7 +158,7 @@ RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO

View File

@@ -1,173 +0,0 @@
#
# Creation of bundles
#
# The revision is needed for the bundle name and creating an OSX application bundle.
ifdef REVISION
REV := $(REVISION)
else
# Detect the revision
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
REV := $(shell echo "$(VERSIONS)" | cut -f 1)
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)/"
$(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)/"
ifdef MAN_DIR
$(Q)mkdir -p "$(BUNDLE_DIR)/man/"
$(Q)cp "$(ROOT_DIR)/docs/openttd.6" "$(BUNDLE_DIR)/man/"
$(Q)gzip "$(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/"
ifdef MENU_DIR
$(Q)cp "$(ROOT_DIR)/media/openttd.desktop" "$(BUNDLE_DIR)/media/"
endif
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" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
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)"
bundle_exe: all
@echo '[BUNDLE] Creating $(BUNDLE_NAME).exe'
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)unix2dos "$(ROOT_DIR)/docs/"* "$(ROOT_DIR)/readme.txt" "$(ROOT_DIR)/COPYING" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt"
$(Q)cd $(ROOT_DIR)/os/win32/installer && makensis.exe //DVERSION_INCLUDE=version_$(PLATFORM).txt install.nsi
$(Q)mv $(ROOT_DIR)/os/win32/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)/gm"
$(Q)install -d "$(INSTALL_DATA_DIR)/data"
$(Q)install -d "$(INSTALL_DATA_DIR)/lang"
$(Q)install -d "$(INSTALL_DOC_DIR)"
$(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_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.xpm" "$(INSTALL_ICON_DIR)"
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"
$(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"
$(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"
$(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"
$(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"
$(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"
else
$(Q)install -m 644 "$(BUNDLE_DIR)/media/"*.png "$(INSTALL_ICON_DIR)"
endif
ifdef MAN_DIR
$(Q)install -d "$(INSTALL_MAN_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6.gz" "$(INSTALL_MAN_DIR)"
endif
ifdef MENU_DIR
$(Q)install -d "$(INSTALL_MENU_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.desktop" "$(INSTALL_MENU_DIR)"
endif
$(Q)cp -R "$(BUNDLE_DIR)/scenario" "$(INSTALL_DATA_DIR)"
endif # OSXAPP

View File

@@ -1,3 +1,5 @@
# Auto-generated file -- DO NOT EDIT
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
@@ -9,25 +11,18 @@ include Makefile.am
SOURCE_LIST = !!SOURCE_LIST!!
CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACHE_SOURCE_LIST!!
CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
CONFIGURE_FILES = !!CONFIGURE_FILES!!
LIPO = !!LIPO!!
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!!
INSTALL_PERSONAL_DIR = !!PERSONAL_DIR!!
TTD = !!TTD!!
TTDS = $(SRC_DIRS:%=%/$(TTD))
OS = !!OS!!
@@ -36,10 +31,9 @@ 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
@@ -78,13 +72,7 @@ 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."
@@ -93,7 +81,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
# Make sure we don't lock config.cache
@$(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 "----------------"
@@ -119,9 +107,8 @@ mrproper:
rm -f $$dir/Makefile; \
done
$(Q)rm -rf objs
$(Q)rm -f Makefile Makefile.am Makefile.bundle
$(Q)rm -f media/openttd.desktop
$(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
$(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)
@@ -149,4 +136,145 @@ run-prof: all
$(MAKE) -C $$dir $@; \
done
include Makefile.bundle
#
# Creation of bundles
#
# 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)"
ifdef INSTALL_PERSONAL_DIR
$(Q)mkdir -p ~/"$(INSTALL_PERSONAL_DIR)"
$(Q)cp -R "$(BUNDLE_DIR)/scenario" ~/"$(INSTALL_PERSONAL_DIR)"
else
$(Q)cp -R "$(BUNDLE_DIR)/scenario" "$(INSTALL_DATA_DIR)"
endif # INSTALL_PERSONAL_DIR
endif # OSXAPP

View File

@@ -1,3 +1,5 @@
# Auto-generated file -- DO NOT EDIT
STRGEN = !!STRGEN!!
ENDIAN_CHECK = !!ENDIAN_CHECK!!
SRC_DIR = !!SRC_DIR!!
@@ -34,7 +36,7 @@ RES := $(shell mkdir -p $(BIN_DIR)/lang )
all: table/strings.h $(LANGS)
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h $(SRC_DIR)/table/control_codes.h
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
@@ -42,17 +44,13 @@ string.o: $(SRC_DIR)/string.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(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.o
$(STRGEN): string.o strgen.o
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $^ -o $@
$(Q)$(CXX_BUILD) string.o strgen.o -o $@
table/strings.h: lang/english.txt $(STRGEN)
$(E) '$(STAGE) Generating $@'

View File

@@ -1,28 +0,0 @@
#
# 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"
TARGET := $(shell echo $(PLATFORM) | sed "s/win64/x64/;s/win32/Win32/")
all:
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)
include Makefile.bundle.in

View File

@@ -1,3 +1,5 @@
# Auto-generated file -- DO NOT EDIT
CC_HOST = !!CC_HOST!!
CXX_HOST = !!CXX_HOST!!
CC_BUILD = !!CC_BUILD!!
@@ -9,7 +11,6 @@ CFLAGS = !!CFLAGS!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
LIBS = !!LIBS!!
LDFLAGS = !!LDFLAGS!!
ROOT_DIR = !!ROOT_DIR!!
BIN_DIR = !!BIN_DIR!!
LANG_DIR = !!LANG_DIR!!
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
@@ -88,26 +89,38 @@ $(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)
# Make the revision number
ifdef REVISION
# Use specified revision (which should be of the form "r000").
REV := $(REVISION)
REV_NR := $(shell echo $(REVISION) | sed "s/[^0-9]//g")
else
# Use autodetected revisions
REV := $(shell echo "$(VERSIONS)" | cut -f 1)
REV_NR := $(shell echo "$(VERSIONS)" | cut -f 2)
# 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
endif
endif
endif
# Make sure we have something in REV and REV_NR
# Make sure we have something in REV
ifeq ($(REV),)
REV := norev000
endif
ifeq ($(REV_NR),)
REV_NR := 0
endif
@@ -119,7 +132,7 @@ RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORC
# If there is a change in the source-file-list, make sure we recheck the deps
RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi )
# If there is a change in the revision, make sure we recompile rev.cpp
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV) $(MODIFIED)" ]; then echo "$(REV) $(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
@@ -274,7 +287,7 @@ $(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
# Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s#@@REVISION@@#$(REV_NR)#g;s#@@VERSION@@#$(REV)#g;s#@@MODIFIED@@#$(MODIFIED)#g;s#@@DATE@@#`date +%d.%m.%y`#g" > $(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)/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

BIN
bin/data/chars.grf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,447 +1,48 @@
0.6.3 (2008-10-01)
------------------------------------------------------------------------
- Fix: NewGRF VarAction 2 variable 43 for industries saw MP_VOID tiles as land tiles and was inefficient (r14417, r14416, r14415)
- Fix: Possible buffer overrun/wrong parameter type passed to printf (r14414, r14397)
- Fix: Generation seed set using -G was always overwritten by -g (r14408)
- Fix: Do not allow extending signals by dragging in any direction other than the track direction [FS#2202] (r14013)
0.6.3-RC1 (2008-09-22)
------------------------------------------------------------------------
- Fix: Invalid v->u.air.targetairport could cause crashes at several places [FS#2300] (r14383, r14344, r14343)
- Fix: Moving the first vehicle of a train elsewhere might require a new unitnumber for the remaining chain which might not be available (r14384)
- Fix: Trams jumping when reversing on a single trambit (like caused during road construction reworks) or when (manually) reversing in a corner [FS#1852] (r14371)
- Fix: Multiheaded parts in free wagon chains weren't connected (could cause desyncs) (r14366, r14362)
- Fix: [Win32] Some keypress combinations could be handled twice [FS#2206] (r14363)
- Fix: The ownership of roadtiles was not properly set for very old savegames (including TTD's) making it impossible to remove some pieces of road [FS#2311] (r14359)
- Fix: Desync due to randomly ordered vehicle hash by flooding and road vehicle overtake/following (r14356, r14258)
- Fix: Signs were not updated on company bankrupcy/sell, and thus could have the colour of invalid player (r14348)
- Fix: Delete the RenameSignWindow when 'its' sign is deleted (r14345)
- Fix: Signs from old savegames were lost (causing little memory leaks) (r14340)
- Fix: When a company was renamed and then manager was renamed before building anything, company name changed (r14328)
- Fix: When you rename a town before building something and build something near that town your company would be called "<old townname> Transport" [FS#2251] (r14327)
- Fix: Free any blocks that a helicopter may have on an oilrig when the helicopter gets forcefully removed (bankruptcy). For other airports this isn't needed as they can't be used by multiple companies [FS#2241] (r14324)
- Fix: Possible assert when renaming removed waypoint (r14322)
- Fix: Properly delete orders so the pool doesn't fill up (r14319)
- Fix: Do not allow building road over level crossings and drive-through road stops in the wrong direction; do not allow adding roadtypes to non-drive through road stops; pay for all added road bits [FS#2268] (r14316, r14315, r14314, r14308)
- Fix: Aircraft frozen above oil rig when the next order is invalid [FS#2244] (r14309)
- Fix: [YAPF] Only reserve road slots for multistop when they are really reachable [FS#2294] (r14305)
- Fix: One could be trying to get the station name of a station that is outside of the pool (r14297)
- Fix: Default for sound effects and music volume should be in the valid range for that setting [FS#2286] (r14289)
- Fix: Make small UFO aware of articulated RVs so they crash the complete vehicle instead of a small part of it (r14270)
- Fix: Desyncs after deleting a waypoint because of explicit destructor call instead of using operator delete (r14265)
- Fix: Merge keycode for "normal" 0-9 keys and keypad 0-9 keys so people do not get confused that the keypad does not work as expected [FS#2277] (r14260)
- Fix: Clicking on the smallmap didn't break the "follow vehicle in main viewport" [FS#2269] (r14243)
- Fix: The engine-purchase-list-sorter doubled running-cost and halfed capacity of double-headed engines [FS#2267] (r14239)
- Fix: Feeder share was computed wrong when splitting cargo packet (r14234)
- Fix: Signs (town name, station name, ...) could be too long for 8bit width in pixels (r14221)
- Fix: 10 days != 6*2.5 days, effectively causing the payment graph to show the wrong data (r14219)
- Fix: When determining length of a string with limited size, first check if we are not out of bounds already (r14204)
- Fix: Properly update the current timetable's travel/wait times instead of only doing it for one vehicle in the shared order chain and only when some bit has not been set [FS#2236] (r14192)
- Fix: Sprite payload skipping would not skip enough bytes in a very small subset of compressed sprites (r14191)
- Fix: After applying NewGRF settings, all rail and road types were available as the engine availability check was performed too early (r14182)
- Fix: Close all related vehicle lists when closing a station window (and not only the train list) (r14180)
- Fix: RemoveOrderFromAllVehicles() did not mark enough windows dirty (r14179)
- Fix: Incorrect cargo weights (r14144)
- Fix: GetSlopeZ() gets a virtual coordinate, not a tile (r14139)
- Fix: Close the 'manage vehicles' dropdown once the number of vehicles in the list reaches 0 [FS#2249] (r14133)
- Fix: [strgen] Changing order of parameters {X:...} did not work for strings including some {StringY} (r14111)
- Fix: Desync due to bubbles in toyland (r14110)
- Fix: Make NewGRF action 0x06's changes persistent over the several loading stages [FS#1986] (r14102)
- Fix: Make the 'Transfer Credit' display aware of the entire consist, not only the first vehicle (r14098)
- Fix: Do not flood a NewGRF industry when it implicitly tells that it wants to be build on water (land shape flags bit 5) [FS#2230] (r14093)
- Fix: The vehicle window of articulated road vehicles would show the clone/refit button when the vehicle was not completely stopped in the depot (r14090)
- Fix: Flawed parsing of words (as in 2 bytes) in GRF strings due to sign extension [FS#2228] (r14087)
- Fix: Division by 0 in NewAI [FS#2226] (r14062)
- Fix: NewGRF callback 23 did not use the NewGRF compatible text stack [FS#2224] (r14058)
- Fix: NewGRF text stack's "push word" didn't move the data around properly (r14057)
- Fix: Long strings in the edit box would cause OpenTTD to stop drawing the string. This is especially noticable with low resolutions and the chat input box (r14054)
- Fix: [OSX] changed the condition for selecting 8 or 32 bpp blitter by default. Now we will pick 32 bpp if no 8 bpp fullscreen resolutions are available on the main display (the one with the dock) (r14032)
- Fix: Crash when the AI tries to find the depot of an airport that doesn't have a depot [FS#2190] (r13999)
- Fix: MSVC cannot handle changed files in the prebuild event, so make the version determination a separate subproject [FS#2004] (r13998)
- Fix: The dedicated console removed any character that was not a printable ASCII character instead. Now it allows UTF8 formated strings too [FS#2189] (r13992)
- Fix: Resetting construction stage counter reset more than it should (r13981)
- Fix: Wrong tooltip for the industry directory's list [FS#2178] (r13917)
0.6.2 (2008-08-01)
------------------------------------------------------------------------
- Fix: Custom vehicle names from TTD(Patch) games were lost (r13884)
- Fix: NewGRF Callback 10 (visual effect and powered wagons setting) and powered wagons operation were not performed for articulated wagons [FS#2167] (r13870)
- Fix: In some cases the sprite cache could be filled with unremovable items [FS#2153] (r13869)
- Fix: Return of wrong parent scope of (NewGRF) industry variables (r13868)
- Fix: Loading of TTD(Patch) savegames from the command line did not work (r13859)
- Fix: Buffer overflow for too long filename supplied as '-g' parameter (r13858)
- Fix: Cargo type lookup was incorrect for NewGRF version 7 files without a translation table [FS#2157] (r13855)
- Fix: GetTownByTile() is only valid for houses and roads (r13851)
- Fix: Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window (r13844)
- Fix: FreeType may return a bitmap glyph even if a grey-scale glyph was requested [FS#2152] (r13832)
0.6.2-RC2 (2008-07-25)
------------------------------------------------------------------------
- Fix: Building through the wrong side of a drive through station was allowed [FS#2166] (r13822)
- Fix: Check for vehicle length changes outside a depot (callback 0x11) and give a warning about that [FS#2150] (r13816)
- Fix: Several minor memory leaks. They only happened once per game (r13809, 13810)
- Fix: Checking for train waiting at other side of two-way signal was broken [FS#2162] (r13806)
- Fix: Some revision checking code was unintentionally disabled (r13776)
- Fix: Enforce the validity of a NetworkAction (chat packet) issued by a client (r13775)
- Fix: Selecting non-full length vehicles in the depot gui would place the "mouse pointer" out of the center of the vehicle making it hard to "aim" [FS#2147] (r13759)
- Fix: NewGRF rail continuation would always mark a tunnel on the same axis as connected, even when the tunnel faces the wrong direction (r13734)
- Fix: Assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded (r13729)
- Fix: Possible desync on the autorenew settings 20+ game years (i.e. 4.5+ hours) after a company was started (r13718)
- Fix: Any player could construct new companies [FS#2144] (r13716)
- Fix: Remove the unique_id from the message that a client has joined as it is only exposes the unique_id more than needed (r13714)
- Fix: Possible crash on creating a network packet (r13713)
- Fix: Enforce the length restrictions of company and president name in the commands too (r13712)
0.6.2-RC1 (2008-07-16)
------------------------------------------------------------------------
- Fix: Possible buffer overflow in string truncation code (r13700)
- Fix: Handle SETX(Y) properly when truncating a string instead of ignoring it and returning a too long string (r13699)
- Fix: In some cases the (sound) mixer could overflow causing artefacts in the sound [FS#2120] (r13695)
- Fix: Do not rely on .tar files always ending with a block of zeros (r13693)
- Fix: Make sure a command is ran in the context of autoreplace or not (r13691)
- Fix: In the case that elrails and 'realistic' acceleration are disabled all electrified engines would have no power on load, until the vehicle got turned around, loaded or got into a depot [FS#2102]- Fix: Saving TTD imported games in recession failed due to wrong (and unneeded) type conversions in the saveload code [FS#2131] (r13679)
- Fix: Inactive companies from old (TTD) saves could be marked active in some cases, which then loads garbage in their statistics and such [FS#2126] (r13676)
- Fix: Memory leak when NewGRFs got forcefully disabled and they defined GOTO labels (r13675)
- Fix: Crash when drawing a non-real sprite caused by NewGRF interference [FS#2127] (r13674)
- Fix: Desync when building electrified trains on a dedicated server that was started with electrification disabled [FS#2122] (r13673)
- Fix: Bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop [FS#2117] (r13664)
- Fix: Server crashing when banning the rconning client (r13661)
- Fix: Signals were not updated correctly when a player removed a non-existing track piece (r13626)
- Fix: Crash when one tries to raise the nothern corner of MP_VOID tiles (i.e. the southern corner of the tiles on the southern map edge) in the scenario editor [FS#2106] (r13624)
- Fix: Only the front of a RV would be considered when determining to what cargos a vehicle can be refitted instead of all cargos [FS#2109] (r13622)
- Fix: If the first bridge can not be build for a given length, then none of the other bridges can. Effectively meaning that if someone replaces the first bridge with a bridge that can be only 3 tiles longs then only other bridges that can be 3 tiles long will be buildable, but only if they are 3 tiles long [FS#2100] (r13611)
- Fix: Signal states could be propagated through waypoints built in orthogonal axis (r13589)
- Fix: [OSX] 10.5 failed to switch to fullscreen (r13584)
- Fix: RVs continueing onto next DT station when they are build adjacent to them [FS#2040] (r13581)
- Fix: Disable static NewGRFs when non-static NewGRFs query them in the context of network games. This makes it impossible for static NewGRFs to disable non-static NewGRFs and 'bad' things happening because the non-static NewGRF doesn't know about the static NewGRF (r13576)
- Fix: Properly count number of non-north housetiles [FS#2083] (r13518)
- Fix: Incorrect usage of strtoul (r13508)
- Fix: Clear the memory for the new AI during the loading of a savegame so it does not try to execute commands generated in a different savegame, which could be resulting in the AI trying to give orders to stations that do not exist (r13505)
- Fix: Drawing of zoomed out partial sprites could cause deadlocks or crashes (r13502)
- Fix: First determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good (r13489)
- Fix: Track was not removed on company bankrupcy when there was a ship on lower halftile (r13488)
- Fix: Let ships also navigate on half-tile sloped watery rail tiles (r13485)
- Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
- Fix: Do not crash when resolving vehicle sprite groups with zero sprites (r13397)
- Fix: In the purchase list, CB36 for capacity was not called for the first part of rail and road vehicles (r13385)
- Fix: Loading of very old OpenTTD savegames was broken (r13373)
0.6.1 (2008-06-01)
------------------------------------------------------------------------
- Fix: Industry tiles would sometimes tell they need a 'level' slope when they do not want the slope (r13348)
- Fix: Attempts to make the old AI perform better (r13217, r13221, r13222)
0.6.1-RC2 (2008-05-21)
------------------------------------------------------------------------
- Fix: Do not send rcon commands of the server to the first client but do directly execute those on the server (r13137)
- Fix: For multiheaded engines, halve power and running cost when used instead of when loading, to allow callback values to work properly (r13074)
- Fix: Loading of TTDP savegames with rivers in them [FS#2005] (r13066)
- Fix: Update build industry window when raw_industry_construction setting is modified (r13060)
- Fix: Revert changes to multihead engine weight -- the original values were correct (r13023)
- Fix: Debugging was not possible with MSVC 2008 (r12996)
- Fix: List used for sorting GRFs was not freed (r12993)
- Fix: Default difficulty settings were different to TTD's original settings [FS#1977] (r12951)
- Fix: All vehicles would be available when an original scenario would be played [FS#1982] (r12948)
- Fix: Keep only first 15 bits for non failed callback results (r12947)
- Fix: Reading/modifying invalid data under some circumstances (r12943)
- Fix: Minor errors related to industries accepted/produced cargo (r12933)
- Fix: Town rating was affected even after the test run (r12920)
- Fix: Flood road tiles even when there are road works in progress [FS#1965] (r12919)
- Fix: Do not initialize Station struct with tile=0, buoys will never change that value [FS#1960] (r12915)
- Fix: Game crash when a spectator/server tried to show an engine with no owner when a NewGRF requested a specific variable (r12914)
- Fix: Report reverse sprite status (FD/FE) to NewGRF for manually toggled vehicles (r12910)
- Fix: Vehicles going twice to a depot when the automatic service interfered with the current order [FS#1985] (r12629)
0.6.1-RC1 (2008-04-26)
------------------------------------------------------------------------
- Fix: Vehicle groups, engine replacement rules and player/company names were not properly reset/freed after bankrupt (r12906)
- Fix: Remove trams from savegames saved in OTTD without tram support, it is better than to simply crash [FS#1953] (r12904)
- Fix: GCC on FreeBSD does not support -dumpmachine causing configure to fail. Use g++ instead [FS#1928] (r12876)
- Fix: Make the town rating tests use less memory and much quicker (r12859)
- Fix: Usage of AutoPtr made (trying to) build stuff very (time) expensive (r12857, r12855)
- Fix: Ensure that prop 25 is set for all vehicles in the consist before other properties as it could cause desyncs (r12856)
- Fix: Too much catenary was drawn about tunnel entrances, middle bridge pieces and non-rail station tiles (r12853, r12852)
- Fix: Use YAPF for fairly old savegames from before YAPF was introduced (r12845)
- Fix: The industry tick trigger should only be triggered once every 256 ticks, not every tick... Also bail out of the triggers a little earlier if you know they are not going to happen anyway (r12844)
- Fix: Inconsistent use of 8/15-bitness of NewGRF callback results with respect to TTDP's implementation of the specification (r12819, r12818, r12759)
- Fix: Possible out of bounds array access (r12809)
- Fix: Enforce autorenew values range in command (r12808)
- Fix: Vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefor break downs now do not happen when loading [FS#1938] (r12795)
- Fix: [OSX] In some rare cases when using an uncalibrated monitor the system colour space could not be retrieved. Show an error when this happens instead of just trying an assertion (r12776)
- Fix: Slope checking for NewGRFs failed (r12759)
- Fix: Check the TILE_NOT_SLOPED flag of the _north_ tile of multi-tile houses to decide if autoslope is allowed (r12717)
- Fix: Do not move windows below the toolbar on resizes unless they would go behind the toolbar [FS#1904] (r12714)
- Fix: Increase default sound buffer size only for Vista [FS#1914] (r12708)
- Fix: Do not crash very hard on unrecognised savegames, just go back to the intro menu instead (r12707)
- Fix: In some cases a news messages would not be shown [FS#1906] (r12683)
- Fix: Removing road pieces from a town gave you twice the intended penalty [FS#1920] (r12682)
- Fix: When a road vehicle has a tram only stop multiple times in a row in it's orders, only the first one would be skipped [FS#1918] (r12678)
- Fix: Colour remaps on station sprites only worked for company colours [FS#1902] (r12674)
- Fix: Remove buggy buoys at tile 0 from old TTDP savegames (r12642)
- Fix: Possible NULL pointer dereference when reading some NewGRF data [FS#1913] (r12637)
- Fix: Infinite loop in case your compiler decides that enums are unsigned by default (r12622)
- Fix: The convert signal button disallowed signal dragging when the signal GUI was closed (r12577)
- Fix: Binding to a specific IP could cause OpenTTD to not register properly with the masterserver if one has multiple external interfaces (r12574)
- Fix: min() has 32bit arguments, clamping of 64bit values did not work (r12572)
- Fix: Towns could not terraform when inflation rised terraform prices enough (r12564)
- Fix: Do not affect town rating change by the order in which we examine stations (r12561)
- Fix: Redraw the signal GUI when the signal drag density changes in the patch settings and vice versa (r12553)
- Fix: Do not install scenarios into the current user's homedir when running 'make install', that is silly. Simply always install scenarios system wide instead (r12542)
0.6.0 (2008-04-01)
------------------------------------------------------------------------
- Fix: Final formatting of some string codes from NewGRFs was not done correctly [FS#1889] (r12488)
- Fix: Timetable times for aircraft were always doubled [FS#1883] (r12477)
- Fix: Remove broken endian-dependent code and unnecessary rgb to bgr swapping [FS#1880] (r12453)
- Fix: Do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection) [FS#1871] (r12439)
- Fix: Plural rule for Icelandic was wrong (r12417)
0.6.0-RC1 (2008-03-26)
------------------------------------------------------------------------
- Feature: Show whether a town is a "city" in the town description title bar (r12391)
- Feature: Increase house animation frame number from 32 to 128 (r12347)
- Fix: Loading of TTD savegames (r12399, r12401)
- Fix: Vehicle lists related to stations not closed when the station is deleted [FS#1872] (r12393)
- Fix: Trams failing to turn on bridge heads/tunnel entrances [FS#1851] (r123890)
- Fix: Train could break apart when reversed while partially in a depot [FS#1841] (r12386, r12384)
- Fix: Non-breaking spaces should not be broken (r12385)
- Fix: Check return of AfterLoadGame for success or failure when loading TTD games [FS#1860] (r12383)
- Fix: Use 'items' unit for batteries, fizzy drinks, toys and bubbles in total cargo tab [FS#1864] (r12382)
- Fix: The number of houses wasn't computed right [FS#1835, FS#1535] (r12381)
- Fix: Update train acceleration and max speed after setting cached value to ensure the correct max speed is used with disabled real acceleration (r12380)
- Fix: Refresh vehicle details window when cached values are updated (r12378)
- Fix: Set cached value for vehicle property 25 before other cached values [FS#1854] (r12377)
- Fix: Don't close a dropmenu when clicking on a dropdown widget (r12374)
- Fix: win32 music driver fails if path is too long or if containing non-latin chars [FS#1849] (r12373, r12372)
- Fix: Do not let window hide behind the main toolbar after resizing the screen [FS#1823] (r12371)
- Fix: Close language drop down when parent window is clicked/closed [FS#1853] (r12370)
- Fix: Reset train speed limits when _patches.realistic_acceleration changes (r12369)
- Fix: Commands were sent to clients waiting for map download causing 'executing command from the past' error [FS#1650] (r12367)
- Fix: Do not allow building 'zero' road bits (r12363)
- Fix: Randomize variable 8F only once per callback 28 (r12362)
- Fix: openttdd.grf was using the wrong colours for glyphs due to a grfcodec bug (fixed in grfcodec 0.9.10 r1837) (r12360)
- Fix: Some callback-results were treated as 8 bit, when they were 15 bit, and vice versa (r12352, r12358)
- Fix: Do not try to flood water tile [FS#1836] (r12350)
- Fix: NTP skipped junction just after bridge end (r12348)
- Fix: Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP [FS#1748, FS#1825] (r12346)
- Fix: Don't try to restore backupped timetable when timetabling is disabled [FS#1828] (r12345)
- Fix: Slow helicopters never got the 'chance' to finish the landing routine (r12343)
- Fix: GRM buffer for cargos was incorrect size [FS#1827] (r12341)
- Fix: Recalculate cached train data after clearing reversing flag when entering depot (r12339)
0.6.0-beta5 (2008-03-04)
------------------------------------------------------------------------
- Feature: Vehicle variable FE bit 5, 6 and 8 [FS#1812] (r12331, r12330)
- Feature: Support loading full range of 0xD0xx NewGRF strings which includes 0xD000 to 0xD3FF (r12316)
- Feature: Ability to change aircraft speed factor, from so called 'realistic' (matching other vehicles) (1/1) to original TTD speed (1/4) (r12293, r12294)
- Change: Update readme about where openttd looks for files (r12321)
- Fix: Don't pause/unpause the game when showing load/save windows when the game is paused due to missing GRFs [FS#1733] (r12336)
- Fix: Disallow building level crossings over one-way roads as this allowed competitors to remove the one-way state [FS#1819] (r12329)
- Fix: Wrong Y pillar specified for girder with arch bridge (r12328)
- Fix: Vehicles could be sorted in a wrong order when a vehicle name changed - cached name was not invalidated (r12324)
- Fix: Vehicle sorting by name was broken, it was comparing the same string (when caching was not used) [FS#1821] (r12323)
- Fix: Endian issue when saving/loading group owner (r12322)
- Fix: Wrong transparency options could be saved after toggling all [FS#1817] (r12320)
- Fix: Map string IDs that are embedded from other strings [FS#1815] (r12317)
- Fix: Include prop 25 data for all train parts, not just those that carry cargo (r12314)
- Fix: YAPF and NTP did not apply penalty for uphill tracks on steep slopes (r12313)
- Fix: Restore timetable from backupped orders and add group ID to the backup [FS#1549] (r12296)
- Fix: Do not draw trees nor lamps between tram tracks (r12290) [FS#1807]
- Fix: [Win32] Do not create save dir on install (r12269)
- Fix: Autoreplace did not update vehicle index for timetable window [FS#1805] (r12261)
- Fix: GetProductionAroundTiles() may fail if only the second production slot exists (r12258)
- Fix: Town variables 0x9E to 0xAD (company ratings) returned wrong values (r12247)
- Fix: Typo resulting in no players are given the engine preview offer (r12244)
- Fix: Mac OSX bundle display name should be 'OpenTTD' [FS#1798] (r12234)
- Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, show running cost of wagons if available (r12209)
- Fix: When loading a savegame fails, do not start creating a new game, just go straight back to the intro screen (r12202)
- Fix: Force AI to build rail or road instead of bridges if possible, so it doesn't build bridges everywhere (r12200)
- Fix: "Transparent buildings" now only toggles buildings, so show tick when buildings are transparent [FS#1789] (r12198)
- Fix: Show correct last year profit when the train had negative income [FS#1788] (r12197)
- Fix: There can be oil rigs at map borders, do not set water class for them [FS#1787] (r12195)
- Fix: Do not start overtaking if the RV reaches wrong-way one-way-road in the next tiles (r12191)
- Fix: Assert when trying to play tile sound at NW border of map (placing buyos, leveling land) [FS#1784] (r12186)
- Fix: Take into account possible loan when AI is deciding which bridge to build, so it won't build wooden bridges everytime (r12184)
0.6.0-beta4 (2008-02-18)
------------------------------------------------------------------------
- Feature: Allow buttons to resize in NewGRF settings window (r12172)
- Feature: Change colour of autorail and autoroad selection when Ctrl is pressed (r12167)
- Feature: Separate catenary transparency settings from building transparency settings (r12103)
- Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x' (r12102)
- Feature: Add some missing VarAction2 variables (r12124)
- Feature: Make snow appear on rail tiles dependant on track height, not on height of the lowest part of the tile (r12098)
- Feature: [NewGRF] Specify the purchase, rail and road description of a bridge (r12069)
- Feature: [NewGRF] Add support for var 12, Variational Action 2 (r12045)
- Feature: Allow trees on shore (r12029)
- Feature: Invisible trees are now separate from the building concept (r12022)
- Feature: Add support for passenger engine designation for AI-use, NewGRF property 0x08 for trains (r12019)
- Feature: Show all cargo sources (en-route from) in the station view cargo waiting list instead of just one (r11990)
- Feature: [NewGRF] Resizable industry view window on callback 3A (r11987)
- Feature: [NewGRF] Implement var 8F (random bits) during callback 28 [FS#1697] (r11985)
- Feature: [NewGRF] Add support for Action 0D, var 13: informations about current map size (r11961)
- Feature: Support Action5 type 0D (newwater) (r11947)
- Feature: Allow building bridge heads on more slopes (r11937)
- Feature: [NewGRF] Add support for Rivers. Rivers can currently only be placed with-in the scenario editor (r11926,r11938,r11949,r12071)
- Feature: Generate.vbs script to allow project files generation for users unable to run generate bash script (r12123)
- Feature: Sort the strings in languages dropdown (r11886)
- Codechange: Drop MSVC 2003 support (r11979)
- Fix: Test purchase list loading/loaded sprites instead of unconditionally returning a possibly non-existant sprite (r12180)
- Fix: Return correct bridge price for AI when DC_QUERY_COST is set [FS#609] (r12171)
- Fix: When drag&drop mode was cancelled by keyboard input, depot/group window wasn't updated [FS#337] (r12166)
- Fix: Buffer overflow when drawing scrolling news [FS#1652, FS#1773] (r12165)
- Fix: If a train is 'stopping' when entering a depot, do not let it leave again [FS#1705] (r12163)
- Fix: Towns shouldn't build over houses owned by another town [FS#1757] (r12162)
- Fix: Towns will no longer build houses > 1x1 there where should be road (with 2x2, 3x3 grid town layouts) (r12161)
- Fix: Remove the arbitrary limit of 64 waypoints per town [FS#1744] (r12160)
- Fix: Chance16I was now biased towards zero - round to nearest now (r12156)
- Fix: Adjust aircraft slowing algorithm (r12144)
- Fix: Callback 0x3D always gets a cargobit in var 0x18, independent of grf version [FS#1766] (r12142)
- Fix: Do not allow adding tram to rail-road crossing when there is a vehicle on it (r12138)
- Fix: Show cargo capacity for articulated vehicles correctly in the purchase list. Multiple cargo types can also now been shown [FS#1769] (r12137)
- Fix: With mammoth trains disabled, maximum train length was limited to 9 (r12131)
- Fix: Use tile index 0 for planes in the air, so it cannot have an invalid tile index [FS#1745] (r12109)
- Fix: X/Y axis swap for station tiles in GetNearbyTile() was wrong way around [FS#1753]( r12108)
- Fix: Loading older savegames fixes (r12096,r12097)
- Fix: When a company bankrupts, remove drive-through road stops, ship depots and buoys too. Update owners of water and road [FS#1703] (r12095)
- Fix: Do not set station owner for buoys when merging company (r12093)
- Fix: Keep production level within delimited boundaries, while using var result 0D/0E and than multiplying/dividing it [FS#1755] (r12092)
- Fix: Assert when loading savegame with wrong tiletype at south map borders (r12088)
- Fix: Check overrides only for industries when mapping newgrf entities to 'real' entities [FS#1747] (r12086)
- Fix: Update waypoint signs when changing language (r12080)
- Fix: Use search paths when opening console scripts (r12079)
- Fix: When reusing a renamed deleted waypoint, keep the new name (r12076)
- Fix: Make docks at sea flood neighboured tiles (r12072)
- Fix: Possible deadlock when there are no houses available to build at given tile (r12062)
- Fix: Houses with zero probability could be built (r12062)
- Fix: Do not clear tiles when the town won't be able to build any buildings anyway (r12060)
- Fix: Allow building 2x2 building on slopes if not explicitly forbidden (r12060)
- Fix: It was possible to build 2x1 and 1x2 buildings on slopes even if it was not allowed (r12060)
- Fix: Teach NPF where road vehicles and trams can reverse (r12058)
- Fix: Ships can drive through opponents' ship depots (r12058)
- Fix: Slowdown train when approaching 90deg turn when 90deg turns are forbidden (r12057)
- Fix: Enable YAPF to start searching inside a wormhole [FS#1704] (r12056)
- Fix: Another way to fix AI trying to build road through depots (r12055)
- Fix: The cargo translation table was loaded at the right time, but all the other global variables were now loaded too early [FS#1737] (r12052)
- Fix: Random_func broke for desync debug (r12050)
- Fix: Memset on multibyte array with wrong byte count (r12049)
- Fix: Crash when centering on a vehicle (aircraft) that is outside of the map [FS#1741] (r12044)
- Fix: Allow building transmitters and lighthouses on tree tiles [FS#1736] (r12043)
- Fix: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be stored for buoys, docks, locks and depots. All these are now allowed on rivers and removal of them will revert to the original water type [FS#1676] (r12042)
- Fix: Change ownership of or remove statues when merging/bankrupting companies (r12038)
- Fix: For station tiles, only get road types for road stops (r12036)
- Fix: Teach YAPF where trams can reverse, and where not [FS#1702] (r12035)
- Fix: Do not show train speed as zero after loading paused game (r12033)
- Fix: When removing a statue, remove town statue flag for the statue owner, not current player (r12032)
- Fix: Prevent towns from removing or claiming ownership of player owned tiles when growing [FS#1689,FS#1719] (r12031)
- Fix: In one case trees could spread under bridges (r12024)
- Fix: Put a better suited text in the quit-dialog [FS#1690] (r12023)
- Fix: Restore initial intent on the invisible tree while transparent building patch setting [FS#1721] (r12018)
- Fix: When you have more than 9 network interfaces you'll enter the wonderfull world of overflows (r12017)
- Fix: Better work on strings in regard to gender [FS#1716] (r12015)
- Fix: Lighthouses and transmitters were never supposed to be build on a slope (r12014)
- Fix: When modifying watered tiles, mark neighboured canals and rivers dirty in more cases (r12013)
- Fix: Enable TownRatingTestMode during cost estimation with 'shift'-key (r12012)
- Fix: Do not consider one-corner-raised-shores to be watered tiles from all sides [FS#1701] (r12011)
- Fix: Avoid loading sample.cat if it 'looks' incorrect, and avoid later null pointer dereferences by moving volume lookup deeper [FS#1707] (r12009)
- Fix: Possible reading from an invalid pointer [FS#1717] (r12005)
- Fix: When skipping Action 11 or 12, also skip belonging sprites (r12001)
- Fix: Do entrance-slope-check for every tile of railstations (r11999)
- Fix: Possible remote assert by setting bit 6 of p1 for CMD_REMOVE_ROAD [FS#1692] (r11998)
- Fix: Update train statusbar when stopping from zero speed [FS#1706] (r11996)
- Fix: Resize station/roadstop/dock/airport construction windows if cargo acceptance list is too long (r11993)
- Fix: When building two rail stations close to each other (with control) so they looked like one long track trains would see them as one (r11992)
- Fix: Resize autoreplace window to fit purchase information text if it is too large (r11989)
- Fix: Build system ignored changes to table/control_codes.h which require strgen to be rebuilt (r11986)
- Fix: Also draw corner shores under rail tracks (r11984)
- Fix: Use unicode glyph mapping to fix up missing/shuffled sprites in original data files instead of shuffling or skipping sprites directly [FS#1698] (r11981)
- Fix: Industries using results 0D/0E on callback cb29/35 were a bit too eager to close down (r11976)
- Fix: Shore and sea tiles under bridges were converted to canals in old savegames [FS#1684] (r11974)
- Fix: Use grass tiles for corner shores, if shores got replaced by ActionA [FS#1683] (r11973)
- Fix: Old AI shouldn't build fast planes with a small airport in orders(r11972)
- Fix: MP_ROAD can have railbits too - OPF searching over rail of diffen t owner behind crossing (r11967)
- Fix: OPF was searching through depots and normal road stops [FS#1403, FS#1506] (r11966)
- Fix: Tropic zone data was returned incorrectly [FS#1685] (r11964)
- Fix: NewAI couldn't build any road vehicles when there were any tram grfs loaded (r11958)
- Fix: Disallow building locks and docks on rapids [FS#1675] (r11956)
- Fix: Do not allow modifying roadbits when other roadtypes would need different foundation (r11953)
- Fix: Loading of very old savegames was broken (r11951)
- Fix: Slope detection of bridge ramps. Helps YAPF and Trolly (r11946)
- Fix: FileExists() failed for non latin paths (win32) (r11945)
- Fix: Allow building drive-through road/tram stops at road/tram track that has no owner (r11944)
- Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes (r11936)
- Fix: [Autoreplace] Single to dualhead locomotive replacefailed when player had enough money to replace and refit one but not enough to refit the last one as well [FS#1624] (r11929)
- Fix: [Autoreplace] Autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had (r11928)
- Fix: Loading old, pre savegame version 2, savegames (r11925)
- Fix: AI was reading wrong tile slope while building road bridge (r11917)
- Fix: set correctly crossing state after train reversal, train leaving crossing, train crash (r11900)
- Fix: Segmentation faults/wrong frees due uninitialized memory in the AI [FS#1658] (r11887)
- Fix: Assert when trying to remove rail from a house or industry tile [FS#1663,FS#1665-6-7-8,FS#1680,FS#1686-7-8 FS#1715 FS#1742 FS#1771 FS#1776](r11883)
- Fix: Crash in MP in vehicle group window if the currently selected group is deleted by another player (r11878)
- Fix: Another way to crash competitors' train in a station (r11877)
- Fix: Automatically sending aircraft to depot for autoreplace/renew is now triggered by the correct conditions (r11875)
- Fix: EngineHasReplacementForPlayer() didn't look in ALL_GROUP (r11872)
- Fix: Do not update signals after each tile when building/removing a large block of track/signals/station [FS#1074] (r11871)
- Fix: Slow down train when approaching tile we can't enter in more cases (r11870)
- Fix: Do not make crossing red when we can't enter it in any case (r11870)
0.6.0-beta3 (2008-01-16)
------------------------------------------------------------------------
- Feature: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names (r11822)
- Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match (r11759)
- Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves (r11741)
- Feature: Added sorting for cost, running costs and speed to road vehicles and ships build windows (r11710)
- Feature: List neutral stations where the player has service in the station list too (r11670)
- Feature: Check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen (r11646)
- Feature: Support shore replacement via Action 5 (r11726)
- Fix: When two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF [FS#1559] (r11862)
- Fix: Recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs [FS#1335] (r11855)
- Fix: Road vehicle count was incorrect in network lobby window (r11844)
- Fix: Mark dirty canal tile even in diagonal direction from flooded tile, draw correctly canal next to half flooded rail tile (r11843, r11838)
- Fix: At least one instance of dmusic driver is needed for it to be registered and usable (r11826)
- Fix: An articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile [FS#1627] (r11825)
- Fix: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots [FS#1602] (r11813)
- Fix: Do not crash trains when leaving depot to a very long track [FS#716] (r11802)
- Fix: Take town rating into account when testing if a command can be executed [FS#1616] (r11795)
- Fix: Reversing a train when loading at a station with an adjacent station in the same axis crashed [FS#1632] (r11794)
- Fix: Group names got not deallocated in the command test run [FS#1614] (r11743)
- Fix: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused [FS#1319] (r11742)
- Fix: Modify and possibly discard key events for code points in the unicode private use area [FS#1610] (r11740)
- Fix: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out [FS#1609] (r11739)
- Fix: Do not reset loading indicator IDs when only reloading NewGRFs [FS#1574] (r11735)
- Fix: Elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype (r11732)
- Fix: Clear sprite override data before performing NewGRF wagon attach callback. This stopped the callback working for autoreplace and when moving wagons from train to train in a depot [FS#1582] ( r11731)
- Fix: If there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available [FS#1577] (r11727)
- Fix: Make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time (r11724)
- Fix: Do not put more than one Random() in function calls because parameter evaluation order is not guaranteed in the C++ standard [FS#1561] (r11716)
- Fix: Do not allow player inauguration date on scenarios to be bigger than current year [FS#1569] (r11714)
- Fix: Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids (r11712)
- Fix: Do not allow refitting flooded (destroyed) vehicles (r11707)
- Fix: Trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process [FS#1557] (r11705)
- Fix: When removing buoys, return to water or canal depending on their owner (r11666)
- Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08 (r11665)
- Fix: Do not allow modifying non-uniform stations when non-uniform stations are disabled [FS#1563] (r11659)
- Fix: 'Initialised' NewGRFs could still be deactivated in the later 'activation' pass (r11650)
- Fix: Vehicles were still followed when sold [FS#1541] (r11632)
- Fix: Many viewports could crash the scenario editor [FS#1527] (r11629)
- Fix: Popping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order [FS#1532] (r11627)
- Fix: There were still some cases where one could not build a tram track, but the tram could become blocked [FS#1525] (r11621)
- Fix: Do not make crossing red behind depot the train is entering [FS#1531] (r11619)
- Fix: Buoys are just waypoints, so don't allow load/unload/transfert for them (r11618)
- Fix: Sometimes large values could go off the chart [FS#1526] (r11616)
- Fix: Temperate banks can only be built in towns (over a house) (r11615)
-Feature: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names (r11822)
-Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match (r11759)
-Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves (r11741)
-Feature: Added sorting for cost, running costs and speed to road vehicles and ships build windows (r11710)
-Feature: List neutral stations where the player has service in the station list too (r11670)
-Feature: Check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen (r11646)
-Feature: Support shore replacement via Action 5 (r11726)
-Fix: When two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF [FS#1559] (r11862)
-Fix: Recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs [FS#1335] (r11855)
-Fix: Road vehicle count was incorrect in network lobby window (r11844)
-Fix: Mark dirty canal tile even in diagonal direction from flooded tile, draw correctly canal next to half flooded rail tile (r11843, r11838)
-Fix: At least one instance of dmusic driver is needed for it to be registered and usable (r11826)
-Fix: An articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile [FS#1627] (r11825)
-Fix: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots [FS#1602] (r11813)
-Fix: Do not crash trains when leaving depot to a very long track [FS#716] (r11802)
-Fix: Take town rating into account when testing if a command can be executed [FS#1616] (r11795)
-Fix: Reversing a train when loading at a station with an adjacent station in the same axis crashed [FS#1632] (r11794)
-Fix: Group names got not deallocated in the command test run [FS#1614] (r11743)
-Fix: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused [FS#1319] (r11742)
-Fix: Modify and possibly discard key events for code points in the unicode private use area [FS#1610] (r11740)
-Fix: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out [FS#1609] (r11739)
-Fix: Do not reset loading indicator IDs when only reloading NewGRFs [FS#1574] (r11735)
-Fix: Elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype (r11732)
-Fix: Clear sprite override data before performing NewGRF wagon attach callback. This stopped the callback working for autoreplace and when moving wagons from train to train in a depot [FS#1582] (r11731)
-Fix: If there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available [FS#1577] (r11727)
-Fix: Make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time (r11724)
-Fix: Do not put more than one Random() in function calls because parameter evaluation order is not guaranteed in the c++ standard [FS#1561] (r11716)
-Fix: Do not allow player inauguration date on scenarios to be bigger than current year [FS#1569] (r11714)
-Fix: Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids (r11712)
-Fix: Do not allow refitting flooded (destroyed) vehicles (r11707)
-Fix: Trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process [FS#1557] (r11705)
-Fix: When removing buoys, return to water or canal depending on their owner (r11666)
-Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08 (r11665)
-Fix: Do not allow modifying non-uniform stations when non-uniform stations are disabled [FS#1563] (r11659)
-Fix: 'Initialised' NewGRFs could still be deactivated in the later 'activation' pass (r11650)
-Fix: Vehicles were still followed when sold [FS#1541] (r11632)
-Fix: Many viewports could crash the scenario editor [FS#1527] (r11629)
-Fix: Popping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order [FS#1532] (r11627)
-Fix: There were still some cases where one could not build a tram track, but the tram could become blocked [FS#1525] (r11621)
-Fix: Do not make crossing red behind depot the train is entering [FS#1531] (r11619)
-Fix: Buoys are just waypoints, so don't allow load/unload/transfert for them (r11618)
-Fix: Sometimes large values could go off the chart [FS#1526] (r11616)
-Fix: Temperate banks can only be built in towns (over a house) (r11615)
0.6.0-beta2 (2007-12-09)

295
config.lib Executable file → Normal file
View File

@@ -5,7 +5,7 @@ log() {
}
set_default() {
released_version=""
released_version="0.6.0-beta3"
ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override
@@ -28,15 +28,10 @@ set_default() {
prefix_dir="/usr/local"
binary_dir="games"
data_dir="share/games/openttd"
doc_dir="1"
icon_dir="share/pixmaps"
icon_theme_dir="1"
personal_dir="1"
shared_dir="1"
install_dir="/"
man_dir="1"
menu_dir="1"
menu_group="Game;"
enable_debug="0"
enable_desync_debug="0"
enable_profiling="0"
@@ -46,14 +41,13 @@ set_default() {
enable_translator="0"
enable_unicode="1"
enable_assert="1"
enable_strip="0"
enable_strip="1"
enable_universal="1"
enable_osx_g5="0"
enable_cocoa_quartz="1"
enable_cocoa_quickdraw="1"
with_osx_sysroot="1"
with_application_bundle="1"
with_menu_entry="1"
with_sdl="1"
with_cocoa="1"
with_zlib="1"
@@ -91,15 +85,10 @@ set_default() {
prefix_dir
binary_dir
data_dir
doc_dir
icon_dir
icon_theme_dir
man_dir
menu_dir
personal_dir
shared_dir
install_dir
menu_group
enable_debug
enable_desync_debug
enable_profiling
@@ -199,23 +188,9 @@ detect_params() {
--data-dir) prevp_p="data-dir";;
--data-dir=*) data_dir="$optarg";;
--doc-dir) prevp_p="doc-dir";;
--doc-dir=*) doc_dir="$optarg";;
--icon-dir) prevp_p="icon-dir";;
--icon-dir=*) icon_dir="$optarg";;
--icon-theme-dir) prevp_p="icon-theme-dir";;
--icon-theme-dir=*) icon_theme_dir="$optarg";;
--without-icon-theme) icon_theme_dir="";;
--menu-dir) prevp_p="menu_dir";;
--menu-dir=*) menu_dir="$optarg";;
--without-menu-entry) menu_dir="";;
--man-dir) prevp_p="man_dir";;
--man-dir=*) man_dir="$optarg";;
--personal-dir) prevp_p="personal-dir";;
--personal-dir=*) personal_dir="$optarg";;
--without-personal-dir) personal_dir="";;
@@ -229,11 +204,6 @@ detect_params() {
--menu-group) prevp_p="menu_group";;
--menu-group=*) menu_group="$optarg";;
--enable-debug) enable_debug="1";;
--enable-debug=*) enable_debug="$optarg";;
--enable-desync-debug) enable_desync_debug="1";;
@@ -422,9 +392,9 @@ check_params() {
exit 1
fi
# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
echo "configure: error: invalid option --os=$os"
echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
exit 1
fi
# cpu_type can be either 32 or 64
@@ -449,11 +419,11 @@ check_params() {
detect_awk
detect_os
check_build
check_host
detect_os
# We might enable universal builds always on OSX targets.. but currently we don't
# if [ "$enable_universal" = "1" ] && [ "$os" != "OSX" ]; then
if [ "$enable_universal" = "1" ]; then
@@ -594,6 +564,7 @@ check_params() {
detect_png
detect_freetype
detect_fontconfig
detect_iconv
detect_pspconfig
detect_libtimidity
@@ -664,7 +635,7 @@ check_params() {
distcc="$with_distcc"
fi
if [ "$with_distcc" != "0" ]; then
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 1-6`"
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 0-6`"
if [ "$res" != "distcc" ]; then
distcc=""
log 1 "checking distcc... no"
@@ -693,7 +664,7 @@ check_params() {
ccache="$with_ccache"
fi
if [ "$with_ccache" != "0" ]; then
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 1-6`"
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 0-6`"
if [ "$res" != "ccache" ]; then
ccache=""
log 1 "checking ccache... no"
@@ -766,7 +737,7 @@ check_params() {
# First, are we a real OSX system, else we can't detect it
native=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | grep darwin`
# If $host doesn't match $build , we are cross-compiling
if [ -n "$native" ] && [ "$build" = "$host" ]; then
if [ -n "$native" ] && [ "$build" == "$host" ]; then
$cxx_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
res=`./G5_detector`
rm -f G5_detector
@@ -839,22 +810,6 @@ check_params() {
fi
fi
if [ "$doc_dir" = "1" ]; then
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
doc_dir="share/doc/openttd"
else
doc_dir="$data_dir/docs"
fi
fi
if [ "$icon_theme_dir" = "1" ]; then
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
icon_theme_dir="share/icons/hicolor"
else
icon_theme_dir=""
fi
fi
if [ "$personal_dir" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
personal_dir="OpenTTD"
@@ -874,28 +829,6 @@ check_params() {
fi
fi
if [ "$man_dir" = "1" ]; then
# add manpage on UNIX systems
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then
man_dir="share/man/man6"
else
man_dir=""
fi
fi
if [ "$menu_dir" = "1" ]; then
# add a freedesktop menu item only for some UNIX systems
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
menu_dir="share/applications"
else
menu_dir=""
fi
fi
# "set_universal_binary_flags" needs to be before "detect_iconv"
set_universal_binary_flags
detect_iconv
if [ -n "$personal_dir" ]
then
log 1 "personal home directory... $personal_dir"
@@ -916,27 +849,6 @@ check_params() {
else
log 1 "installation directory... none"
fi
if [ -n "$icon_theme_dir" ]
then
log 1 "icon theme directory... $icon_theme_dir"
else
log 1 "icon theme directory... none"
fi
if [ -n "$man_dir" ]
then
log 1 "manual page directory... $man_dir"
else
log 1 "manual page directory... none"
fi
if [ -n "$menu_dir" ]
then
log 1 "menu item directory... $menu_dir"
else
log 1 "menu item directory... none"
fi
}
make_cflags_and_ldflags() {
@@ -968,7 +880,7 @@ make_cflags_and_ldflags() {
else
OBJS_SUBDIR="debug"
# Each debug level reduces the optimization by a bit
# Each debug level reduces the optimalization by a bit
if [ $enable_debug -ge 1 ]; then
CFLAGS="$CFLAGS -g -D_DEBUG"
if [ "$os" = "PSP" ]; then
@@ -1019,20 +931,10 @@ make_cflags_and_ldflags() {
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
# need a lovely hack there to make it compile correctly.
gcc295="1"
# Disable warnings about unused variables when
# compiling with asserts disabled
if [ $enable_assert -eq 0 ]; then
CFLAGS="$CFLAGS -Wno-unused"
fi
fi
if [ $cc_version -ge 30 ]; then
CFLAGS="$CFLAGS -W -Wno-unused-parameter"
# Do not warn about unused variables when building without asserts
if [ $enable_assert -eq 0 ]; then
CFLAGS="$CFLAGS -Wno-unused-variable"
fi
fi
if [ $cc_version -ge 34 ]; then
@@ -1068,10 +970,17 @@ make_cflags_and_ldflags() {
if [ $cc_version -ge 42 ]; then
CFLAGS="$CFLAGS -fno-strict-overflow"
fi
# GCC 4.3+ gives a warning about empty body of
# loops and conditions
if [ $cc_version -ge 43 ]; then
CFLAGS="$CFLAGS -Wno-empty-body"
fi
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread"
LIBS="$LIBS -lrt"
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
@@ -1113,7 +1022,7 @@ make_cflags_and_ldflags() {
fi
# Most targets act like UNIX, just with some additions
if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
CFLAGS="$CFLAGS -DUNIX"
fi
# And others like Windows
@@ -1285,6 +1194,11 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
fi
if [ "$with_osx_sysroot" != "0" ] && [ "$with_osx_sysroot" != "3" ]; then
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX$with_osx_sysroot.sdk"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$with_osx_sysroot.sdk"
fi
if [ -n "$personal_dir" ]; then
CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
fi
@@ -1439,26 +1353,13 @@ check_compiler() {
}
check_build() {
if [ "$os" = "FREEBSD" ]; then
# FreeBSD's C compiler does not support dump machine.
# However, removing C support is not possible because PSP must be linked with the C compiler.
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CXX" "g++" "c++" "0" "-dumpmachine"
else
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
fi
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
}
check_host() {
# By default the host is the build
if [ -z "$host" ]; then host="$build"; fi
if [ "$os" = "FREEBSD" ]; then
# FreeBSD's C compiler does not support dump machine.
# However, removing C support is not possible because PSP must be linked with the C compiler.
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CXX" "g++" "c++" "0" "-dumpmachine"
else
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
fi
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
}
check_cxx_build() {
@@ -1501,26 +1402,6 @@ check_lipo() {
fi
}
set_universal_binary_flags() {
if [ -z "$osx_target_version" ]; then
# if we don't speficy a target version then we presume 10.4
osx_target_version=10.4
fi
if [ "$osx_target_version" = "10.4" ]; then
# Apple added u to 10.4 to show that it's universal
# There is a version without the u, but it's only in Xcode 2.0 and people should use the free update to 2.5
osx_sysroot_version=10.4u
else
osx_sysroot_version="$osx_target_version"
fi
if [ "$with_osx_sysroot" = "3" ]; then
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX$osx_sysroot_version.sdk -mmacosx-version-min=$osx_target_version"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$osx_sysroot_version.sdk -mmacosx-version-min=$osx_target_version"
fi
}
check_direct_music() {
echo "
#include <windows.h>
@@ -1636,7 +1517,7 @@ detect_awk() {
detect_os() {
if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
# Detect UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
# Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
@@ -1644,8 +1525,6 @@ detect_os() {
/darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit}
@@ -1663,8 +1542,6 @@ detect_os() {
/darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit}
@@ -1677,7 +1554,7 @@ detect_os() {
if [ -z "$os" ]; then
log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --os=OS to force one"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
exit 1
fi
@@ -2245,9 +2122,6 @@ detect_cputype() {
}
make_sed() {
T_CFLAGS="$CFLAGS"
T_LDFLAGS="$LDFLAGS"
# We check here if we are PPC, because then we need to enable FOUR_BYTE_BOOL
# We do this here, and not sooner, so universal builds also have this
# automatically correct
@@ -2256,7 +2130,17 @@ make_sed() {
# bytes too, but only for PPC.
ppc=`$cc_host -dumpmachine | egrep "powerpc|ppc"`
if [ -n "$ppc" ]; then
T_CFLAGS="$T_CFLAGS -DFOUR_BYTE_BOOL"
T_CFLAGS="$CFLAGS -DFOUR_BYTE_BOOL"
osx_sysroot_version=10.4u
else
T_CFLAGS="$CFLAGS"
osx_sysroot_version=10.4u
fi
T_LDFLAGS="$LDFLAGS"
if [ "$with_osx_sysroot" = "3" ]; then
T_CFLAGS="$T_CFLAGS -isysroot /Developer/SDKs/MacOSX$osx_sysroot_version.sdk"
T_LDFLAGS="$T_LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$osx_sysroot_version.sdk"
fi
SRC_OBJS_DIR="$BASE_SRC_OBJS_DIR/$OBJS_SUBDIR"
@@ -2291,10 +2175,7 @@ make_sed() {
s#!!TTD!!#$TTD#g;
s#!!BINARY_DIR!!#$prefix_dir/$binary_dir#g;
s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
s#!!DOC_DIR!!#$prefix_dir/$doc_dir#g;
s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
s#!!ICON_THEME_DIR!!#$prefix_dir/$icon_theme_dir#g;
s#!!PERSONAL_DIR!!#$personal_dir#g;
s#!!SHARED_DIR!!#$shared_dir#g;
s#!!INSTALL_DIR!!#$install_dir#g;
@@ -2311,7 +2192,6 @@ make_sed() {
s#!!CONFIG_CACHE_SOURCE!!#config.cache.source#g;
s#!!CONFIG_CACHE_VERSION!!#config.cache.version#g;
s#!!CONFIG_CACHE_SOURCE_LIST!!#config.cache.source.list#g;
s#!!CONFIG_CACHE_PWD!!#config.cache.pwd#g;
s#!!LANG_SUPPRESS!!#$lang_suppress#g;
s#!!OBJS_C!!#$OBJS_C#g;
s#!!OBJS_CPP!!#$OBJS_CPP#g;
@@ -2325,45 +2205,6 @@ make_sed() {
s#!!GCC295!!#$gcc295#g;
s#!!DISTCC!!#$distcc#g;
"
if [ "$icon_theme_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE
s#!!ICON_THEME_DIR!!#$prefix_dir/$icon_theme_dir#g;
"
else
SRC_REPLACE="$SRC_REPLACE
s#!!ICON_THEME_DIR!!##g;
"
fi
if [ "$man_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE
s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
"
else
SRC_REPLACE="$SRC_REPLACE
s#!!MAN_DIR!!##g;
"
fi
if [ "$menu_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE
s#!!MENU_DIR!!#$prefix_dir/$menu_dir#g;
"
else
SRC_REPLACE="$SRC_REPLACE
s#!!MENU_DIR!!##g;
"
fi
}
generate_menu_item() {
MENU_REPLACE="
s#!!TTD!!#$TTD#g;
s#!!MENU_GROUP!!#$menu_group#g
"
echo "Generating menu item..."
< $ROOT_DIR/media/openttd.desktop.in sed "$MENU_REPLACE" > media/openttd.desktop
}
generate_main() {
@@ -2373,22 +2214,13 @@ generate_main() {
# Create the main Makefile
echo "Generating Makefile..."
echo "# Auto-generated file from 'Makefile.in' -- DO NOT EDIT" > Makefile
< $ROOT_DIR/Makefile.in sed "$SRC_REPLACE" >> Makefile
cp $ROOT_DIR/Makefile.bundle.in Makefile.bundle
< $ROOT_DIR/Makefile.in sed "$SRC_REPLACE" > Makefile
echo "# Auto-generated file -- DO NOT EDIT" > Makefile.am
echo >> Makefile.am
# Make the copy of the source-list, so we don't trigger an unwanted recompile
cp $SOURCE_LIST config.cache.source.list
# Add the current directory, so we don't trigger an unwanted recompile
echo "`pwd`" > config.cache.pwd
# Make sure config.cache is OLDER then config.cache.source.list
touch config.cache
touch config.pwd
if [ "$menu_dir" != "" ]; then
generate_menu_item
fi
}
generate_lang() {
@@ -2400,8 +2232,7 @@ generate_lang() {
mkdir -p $LANG_OBJS_DIR
echo "Generating lang/Makefile..."
echo "# Auto-generated file from 'Makefile.lang.in' -- DO NOT EDIT" > $LANG_OBJS_DIR/Makefile
< $ROOT_DIR/Makefile.lang.in sed "$SRC_REPLACE" >> $LANG_OBJS_DIR/Makefile
< $ROOT_DIR/Makefile.lang.in sed "$SRC_REPLACE" > $LANG_OBJS_DIR/Makefile
echo "DIRS += $LANG_OBJS_DIR" >> Makefile.am
echo "LANG_DIRS += $LANG_OBJS_DIR" >> Makefile.am
}
@@ -2415,8 +2246,7 @@ generate_src_normal() {
mkdir -p $SRC_OBJS_DIR
echo "Generating $2/Makefile..."
echo "# Auto-generated file from 'Makefile.src.in' -- DO NOT EDIT" > $SRC_OBJS_DIR/Makefile
< $ROOT_DIR/Makefile.src.in sed "$SRC_REPLACE" >> $SRC_OBJS_DIR/Makefile
< $ROOT_DIR/Makefile.src.in sed "$SRC_REPLACE" > $SRC_OBJS_DIR/Makefile
echo "DIRS += $SRC_OBJS_DIR" >> Makefile.am
echo "SRC_DIRS += $SRC_OBJS_DIR" >> Makefile.am
}
@@ -2471,66 +2301,51 @@ showhelp() {
echo " --strip=STRIP the strip to use [HOST-strip]"
echo " --awk=AWK the awk to use in configure [awk]"
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
echo " --os=OS the OS we are compiling for [$os]"
echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/NETBSD/"
echo " MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/MINGW/OS2/"
echo " WINCE/PSP"
echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/MORPHOS/"
echo " BEOS/SUNOS/CYGWIN/MINGW/OS2/WINCE/PSP"
echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)"
echo " --revision=rXXXX overwrite the revision detection."
echo " Use with care!"
echo ""
echo "Paths:"
echo " --prefix-dir=dir specifies the prefix for all installed"
echo " files [$prefix_dir]"
echo " files [/usr/local]"
echo " --binary-dir=dir location of the binary. Will be prefixed"
echo " with the prefix-dir [$binary_dir]"
echo " with the prefix-dir [games]"
echo " --data-dir=dir location of data files (lang, data, gm)."
echo " Will be prefixed with the prefix-dir"
echo " [$data_dir]"
echo " --doc-dir=dir location of the doc files"
echo " Will be prefixed with the prefix-dir"
echo " [$doc_dir]"
echo " [share/games/openttd]"
echo " --icon-dir=dir location of icons. Will be prefixed"
echo " with the prefix-dir [$icon_dir]"
echo " --icon-theme-dir=dir location of icon theme."
echo " Will be prefixed with the prefix-dir"
echo " and postfixed with size-dirs [$icon_theme_dir]"
echo " --man-dir=dir location of the manual page (UNIX only)"
echo " Will be prefixed with the prefix-dir"
echo " [$man_dir]"
echo " --menu-dir=dir location of the menu item. (UNIX only, except OSX)"
echo " Will be prefixed with the prefix-dir"
echo " [$menu_dir]"
echo " with the prefix-dir [share/pixmaps]"
echo " --personal-dir=dir location of the personal directory"
echo " [$personal_dir]"
echo " [os-dependent default]"
echo " --shared-dir=dir location of shared data files"
echo " [$shared_dir]"
echo " [os-dependent default]"
echo " --install-dir=dir specifies the root to install to."
echo " Useful to install into jails [$install_dir]"
echo " Useful to install into jails [/]"
echo ""
echo "Features and packages:"
echo " --enable-debug[=LVL] enable debug-mode (LVL=[0123], 0 is release)"
echo " --enable-desync-debug=[LVL] enable desync debug options (LVL=[012], 0 is none"
echo " --enable_desync_debug=[LVL] enable desync debug options (LVL=[012], 0 is none"
echo " --enable-profiling enables profiling"
echo " --enable-dedicated compile a dedicated server (without video)"
echo " --enable-static enable static compile (doesn't work for"
echo " all HOSTs)"
echo " --enable-translator enable extra output for translators"
echo " --enable-universal enable universal builds (OSX ONLY)"
echo " --enable-osx-g5 enables optimizations for G5 (OSX ONLY)"
echo " --enable-osx-g5 enables optimalizations for G5 (OSX ONLY)"
echo " --disable-cocoa-quartz disable the quartz window mode driver for Cocoa (OSX ONLY)"
echo " --disable-cocoa-quickdraw disable the quickdraw window mode driver for Cocoa (OSX ONLY)"
echo " --disable-unicode disable unicode support to build win9x"
echo " version (Win32 ONLY)"
echo " --disable-network disable network support"
echo " --disable-assert disable asserts (continue on errors)"
echo " --enable-strip enable any possible stripping"
echo " --disable-strip disable any possible stripping"
echo " --without-osx-sysroot disable the automatic adding of sysroot "
echo " (OSX ONLY)"
echo " --without-application-bundle disable generation of application bundle"
echo " (OSX ONLY)"
echo " --without-menu-entry Don't generate a menu item (Freedesktop based only)"
echo " --menu-group=group Category in which the menu item will be placed (Freedesktop based only)"
echo " --with-direct-music enable direct music support (Win32 ONLY)"
echo " --with-sort=sort define a non-default location for sort"
echo " --with-midi=midi define which midi-player to use"

6
configure vendored
View File

@@ -17,7 +17,7 @@ ROOT_DIR="`dirname $0`"
ROOT_DIR="`cd $ROOT_DIR && pwd`"
PWD="`pwd`"
PREFIX="$PWD/bin"
PREFIX="`pwd`/bin"
. $ROOT_DIR/config.lib
@@ -32,7 +32,7 @@ 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
@@ -64,7 +64,7 @@ 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

View File

@@ -6,11 +6,11 @@ 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
OpenTTD includes projects for MSVC 2003.NET and MSVC 2005.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.
which ones, see below. There is no support for VS6, you are therefore
strongly encouraged to either upgrade to MSVC 2005 Express (free) or use GCC.
MSVC 2002 probably works as well, but it has not been tested.
1) REQUIRED FILES
@@ -74,6 +74,20 @@ 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!!
2.3) DEBUGGING - WORKING DIRECTORY (MSVC 2003 ONLY!)
----------------------------------------------------
The very first time you check out and compile OpenTTD with Visual Studio 2003, running
the binary will complain about missing files. You need to go into and change a setting
OpenTTD > Project > Properties > Configuration (All Configurations) > ...
Configuration Properties > Debugging >
* Working Directory: ..\bin
VS 2005 works out of the box because Microsoft allowed a user to supply a humanly-
readable defaults file (openttd_vs80.vcproj.user), whereas 2003 is braindead.
3) TTD GRAPHICS FILES
---------------------
Copy the following files from Transport Tycoon Deluxe to the bin/data folder
@@ -88,12 +102,12 @@ Copy the following files from Transport Tycoon Deluxe to the bin/data folder
4) COMPILING
------------
Open trunk/openttd_vs[89]0.sln
Open trunk/openttd[_vs80].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
If everything works well the binary should be in trunk/objs/[Win32]/Release/openttd.exe
5) EDITING, CHANGING SOURCE CODE
@@ -112,4 +126,4 @@ 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
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,6 @@
<title>OpenTTD Landscape Internals - #2</title>
<style type="text/css">
span.abuse { font-family: "Courier New", Courier, mono; background-color: rgb(255, 58, 31); }
span.option{ font-family: "Courier New", Courier, mono; background-color: rgb(255,255, 30); }
span.free { font-family: "Courier New", Courier, mono; background-color: rgb(30, 178, 54); }
span.used { font-family: "Courier New", Courier, mono; }
td.bits { white-space: nowrap; text-align: center; font-family: "Courier New", Courier, mono; }
@@ -23,8 +22,7 @@ the array so you can quickly see what is used and what is not.
<ul>
<li><span style="font-weight: bold;"><span class="free">O</span></span> - bit is free</li>
<li><span style="font-weight: bold;"><span class="used">X</span></span> - bit is used</li>
<li><span style="font-weight: bold;"><span class="abuse">&nbsp;</span></span> - bit of attribute is abused for different purposes, i.e. other bits define the actual meaning.</li>
<li><span style="font-weight: bold;"><span class="option">~</span></span> - bit is accessed, but does not really have a meaning (e.g. owner of clear land is always OWNER_NONE)</li>
<li><span style="font-weight: bold;"><span class="abuse">&nbsp;</span></span> - bit of attribute is abused for different purposes</li>
</ul>
<p>
<ul>
@@ -66,7 +64,7 @@ the array so you can quickly see what is used and what is not.
<td rowspan="2">0</td>
<td class="caption">ground</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~~ ~~~~</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">OOOO OOOO</span></td>
<td class="bits">XXXX XX<span class="free">OO</span></td>
@@ -77,34 +75,23 @@ the array so you can quickly see what is used and what is not.
<tr>
<td class="caption">farmland</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX 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 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 rowspan=4>1</td>
<td rowspan=3>1</td>
<td class="caption">rail</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</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>
</tr>
<tr>
<td class="caption">rail with signals</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</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">XXXX 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>
</tr>
@@ -113,9 +100,9 @@ the array so you can quickly see what is used and what is not.
<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"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XX<span class="free">OO O</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>
</tr>
@@ -124,9 +111,9 @@ the array so you can quickly see what is used and what is not.
<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</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 OOO</span>X</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XX<span class="free">OO O</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>
</tr>
@@ -134,7 +121,7 @@ the array so you can quickly see what is used and what is not.
<td rowspan=3>2</td>
<td class="caption">road</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
@@ -147,11 +134,11 @@ the array so you can quickly see what is used and what is not.
<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">XXXX XXXX</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 XXXX</td>
</tr>
<tr>
<td class="caption">road depot</td>
@@ -160,7 +147,7 @@ the array so you can quickly see what is used and what is not.
<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">XX<span class="free">OO</span> XXXX</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>
@@ -170,122 +157,45 @@ the array so you can quickly see what is used and what is not.
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXX<span class="option">~ ~~</span>XX</td>
<td class="bits">XX<span class="free">O</span>X XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXX<span class="abuse">X XXXX</span></td>
<td class="bits">XX<span class="abuse">XX XXXX</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="abuse">X</span>XX<span class="abuse">X XXX</span>X</td>
</tr>
<tr>
<td>4</td>
<td class="caption">trees</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits">XXXX XXXX</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">XXXX XXXX</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>
</tr>
<tr>
<td rowspan=6>5</td>
<td class="caption">rail station</td>
<td>5</td>
<td class="caption">station</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX 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="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 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"><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">XXXX XXXX</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"><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">O</span>XX</td>
<td class="bits"><span class="free">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"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td>6</td>
<td class="caption">water</td>
<td class="bits">XXXX XXXX</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"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="option">~~~~ ~~~~</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>
</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"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</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>
</tr>
<tr>
<td rowspan=3>6</td>
<td class="caption">sea, shore</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 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>
</tr>
<tr>
<td class="caption">canal, river</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 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>
</tr>
<tr>
<td class="caption">shipdepot</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 OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</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>
</tr>
@@ -293,7 +203,7 @@ the array so you can quickly see what is used and what is not.
<td>8</td>
<td class="caption">industry</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">X<span class="free">OOO</span> <span class="abuse">
<td class="bits"><span class="abuse">X</span><span class="free">OO</span><span class="abuse">X
XXXX</span></td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
@@ -306,45 +216,35 @@ the array so you can quickly see what is used and what is not.
<td rowspan=2>9</td>
<td class="caption">tunnel entrance</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</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">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
<td class="bits"><span class="free">OOOO</span> XXXX</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">X<span class="free">OOO</span> 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>bridge ramp</td>
<td class="bits">-inherit-</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">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span> <span class="abuse">XXXX</span>
<span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO</span> XXXX</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">X<span class="free">OOO</span> 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 rowspan=2>A</td>
<td>A</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">XXXX 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">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>
</tr>

View File

@@ -1,37 +1,28 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage.
.Dd Jul 20, 2008
.Dd Sep 15, 2007
.Dt OPENTTD 6
.Sh NAME
.Nm openttd
.Nd An open source clone of the Microprose game "Transport Tycoon Deluxe"
.Sh SYNOPSIS
.Nm
.Op Fl Defhix
.Op Fl Defhi
.Op Fl G Ar seed
.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 s Ar driver
.Op Fl v Ar driver
.Op Fl b Ar blitter
.Sh OPTIONS
.Bl -tag -width ".Fl n Ar host[:port][#player]"
.It Fl D Ar [host][:port]
.It Fl D
Start a dedicated server
.It Fl G Ar seed
Seed the pseudo random number generator
.It Fl b Ar blitter
Set the blitter, see
.Fl h
.It Fl c Ar config_file
Use 'config_file' instead of 'openttd.cfg'
.It Fl d Ar [level]
Set debug verbosity for all categories to
.Ar level
@@ -51,9 +42,6 @@ at start or start a new game if omitted
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
Set the music driver, see
.Fl h
@@ -69,8 +57,6 @@ Set the starting date
.It Fl v Ar driver
Set the video driver, see
.Fl h
.It Fl x
Do not automatically save to config file on exit
.El
.Sh SEE ALSO
http://wiki.openttd.org/, http://www.openttd.org

View File

@@ -1,116 +0,0 @@
#!/bin/sh
# Arguments given? Show help text.
if [ "$#" != "0" ]; then
cat <<EOF
Usage: ./findversion.sh
Finds the current revision and if the code is modified.
Output: <REV>\t<REV_NR>\t<MODIFIED>\t<CLEAN_REV>
REV
a string describing what version of the code the current checkout is
based on. The exact format of this string depends on the version
control system in use, but it tries to identify the revision used as
close as possible (using the svn revision number or hg/git hash).
This also includes an indication of whether the checkout was
modified and which branch was checked out. This value is not
guaranteed to be sortable, but is mainly meant for identifying the
revision and user display.
If no revision identifier could be found, this is left empty.
REV_NR
the revision number of the svn revision this checkout is based on.
This can be used to determine which functionality is present in this
checkout. For trunk svn checkouts and hg/git branches based upon it,
this number should be accurate. For svn branch checkouts, this
number is mostly meaningless, at least when comparing with the
REV_NR from other branches or trunk.
This number should be sortable. Within a given branch or trunk, a
higher number means a newer version. However, when using git or hg,
this number will not increase on new commits.
If no revision number could be found, this is left empty.
MODIFIED
Whether (the src directory of) this checkout is modified or not. A
value of 0 means not modified, a value of 2 means it was modified.
Modification is determined in relation to the commit identified by
REV, so not in relation to the svn revision identified by REV_NR.
A value of 1 means that the modified status is unknown, because this
is not an svn/git/hg checkout for example.
CLEAN_REV
the same as REV but without branch name
By setting the AWK environment variable, a caller can determine which
version of "awk" is used. If nothing is set, this script defaults to
"awk".
EOF
exit 1;
fi
# Allow awk to be provided by the caller.
if [ -z "$AWK" ]; then
AWK=awk
fi
# Find out some dirs
cd `dirname "$0"`
ROOT_DIR=`pwd`
SRC_DIR=src
# Determine if we are using a modified version
# Assume the dir is not modified
MODIFIED="0"
if [ -d "$ROOT_DIR/.svn" ]; then
# We are an svn checkout
if [ -n "`svnversion \"$SRC_DIR\" | grep 'M'`" ]; then
MODIFIED="2"
fi
# Find the revision like: rXXXXM-branch
BRANCH=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^URL:.*branches/ { split($2, a, "/"); for(i in a) if (a[i]=="branches") { print a[i+1]; break } }'`
TAG=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^URL:.*tags/ { split($2, a, "/"); for(i in a) if (a[i]=="tags") { print a[i+1]; break } }'`
REV_NR=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^Last Changed Rev:/ { print $4 }'`
if [ -n "$TAG" ]; then
REV=$TAG
else
REV="r$REV_NR"
fi
elif [ -d "$ROOT_DIR/.git" ]; then
# We are a git checkout
if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
MODIFIED="2"
fi
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null | cut -c1-8`
REV="g$HASH"
BRANCH=`git branch|grep '[*]' | sed 's/\* //;s/^master$//'`
REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
elif [ -d "$ROOT_DIR/.hg" ]; then
# We are a hg checkout
if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
MODIFIED="2"
fi
HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3 | cut -c1-8`
REV="h$HASH"
BRANCH=`hg branch | sed 's/^default$//'`
REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
else
# We don't know
MODIFIED="1"
BRANCH=""
REV=""
REV_NR=""
fi
if [ "$MODIFIED" -eq "2" ]; then
REV="${REV}M"
fi
CLEAN_REV=${REV}
if [ -n "$BRANCH" ]; then
REV="${REV}-$BRANCH"
fi
echo "$REV $REV_NR $MODIFIED $CLEAN_REV"

View File

@@ -11,28 +11,18 @@ by the number below on http://bugs.openttd.org.
If the bug report is closed, it has been fixed, which then can be verified
in the latest SVN version of /trunk.
Bugs for 0.6.3
Bugs for 0.6.0-beta3
------------------------------------------------------------------------
URL: http://bugs.openttd.org
- 2176 Towns unconditionally flatten all land
- 2138 Unexpected cargo appears
- 2132 Station vehicle/service window closes even when pinned
- 2129 Strings from message boxes could sometimes change (e.g. the screenshot filename)
- 2085 Vehicle list of shared vehicles without orders not possible
- 1944 Road vehicles not picking empty drivethrough platform
- 1923 Unique names not always enforced
- 1890 Airplanes copy helipcopters goto heliport order
- 1885 Almost all unserved industries die in big maps
- 1858 Industry legend in small map overwrites buttons
- 1802 Path with space in configure fails
- 1793 Inconsistent travel time for fast trains
- 1762 Strange Autoreplace behaviour
- 1752 User input is not checked
- 1693 Removing road does not reset owner
- 1624 Autoreplace refit fails -> crash
- 1549 Timetable + group ID are not backed up with orders
- 1495 Long vehicles block multistop station
- 1487 Ending_year is never written to
- 1473 Train not going to available platform
- 1404 Spinner widget interprets one click as many
- 1264 Autoreplace for multiple NewGRF DMU sets fails
- 1140 [OSX] Not smooth moving map with touchpad
- 1074 Large slowdown when building tracks
- 1072 Text overflows in several windows
- 119 Clipping problems with vehicles on slopes

View File

@@ -1,13 +0,0 @@
# $Id$
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html
[Desktop Entry]
Encoding=UTF-8
Type=Application
Version=1.1
Name=OpenTTD
GenericName=A clone of Transport Tycoon Deluxe
Comment=A business simulation game
Icon=openttd
Exec=!!TTD!!
Terminal=false
Categories=!!MENU_GROUP!!

View File

@@ -15,7 +15,7 @@ You should copy the data files from the original TTD into the data directory
For in game music (optional), you should copy all files in the gm/
subdir of your ttd installation to /usr/share/games/openttd/gm. You
should also install timidity and a soundfont (freepats is packaged in
Debian and works out of the box).
debian and works out of the box).
Don't forget to use -m extmidi if you want music, and if you have
problems, remember that not all audio devices support multiple
@@ -23,9 +23,12 @@ You should copy the data files from the original TTD into the data directory
mixing. My VIA AC97 device cannot do hardware mixing, for example.
-Scenarios
There are no scenarios included in this release. Scenarios can be
downloaded separately from the OpenTTD website and all over the
internet. Place scenarios in your ~/.openttd/scenario directory to
use them.
There are a few scenarios included in this release. When you start
openttd it will look for scenarios in ~/.openttd/scenario, while the
premade scenarios are in /usr/share/games/openttd/data/scenario. You
have two options to use the scenarios.
* Navigate to /usr/share/games/openttd/data/scenario within openttd.
* Copy scenarios from /usr/share/games/openttd/data/scenario to
~/.openttd/scenario. We are looking into a better solution for this.
-- Matthijs Kooijman <matthijs@stdin.nl>, Tue, 25 Jan 2004 14:11:01 +0200
-- Matthijs Kooijman <m.kooijman@student.utwente.nl>, Tue, 25 Jan 2004 14:11:01 +0200

View File

@@ -1,138 +1,92 @@
openttd (0.6.3-1) unstable; urgency=low
openttd (0.6~svn) unstable; urgency=low
* Unreleased SVN version. Versioned to allow normal upgrades to released versions.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 26 Feb 2007 21:07:05 +0100
openttd (0.6.0~beta3-1) unstable; urgency=low
* New upstream release.
-- Remko Bijker <rubidium@openttd.org> Wed, 01 Oct 2008 18:48:05 +0200
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 16 Jan 2008 21:40:07 +0100
openttd (0.6.3~rc1-1) unstable; urgency=low
openttd (0.6.0~beta2-1) unstable; urgency=low
* New upstream release.
-- Remko Bijker <rubidium@openttd.org> Mon, 22 Sep 2008 22:17:05 +0200
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sun, 09 Dec 2007 22:05:05 +0100
openttd (0.6.2-1) unstable; urgency=low
openttd (0.6.0~beta1-1) unstable; urgency=low
* New upstream release.
- Fixes remote crash vulnerability CVE-2008-3547. Closes: #493714
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 08 Aug 2008 11:07:05 +0200
openttd (0.6.2~rc2-1) experimental; urgency=low
[ Matthijs Kooijman ]
* New upstream release.
[ Jordi Mallach ]
* Fix typo in README.Debian (lintian).
* Remove dpatch build-dep and the empty debian/patches dir.
* Don't ignore possible "make distclean" errors.
-- Jordi Mallach <jordi@debian.org> Sat, 26 Jul 2008 01:35:30 +0200
openttd (0.6.2~rc1-1) experimental; urgency=low
[ Matthijs Kooijman ]
* New upstream release.
-- Jordi Mallach <jordi@debian.org> Thu, 24 Jul 2008 16:09:57 +0200
openttd (0.6.1-1) unstable; urgency=low
[ Matthijs Kooijman ]
* New upstream release.
* Remove no_install_personal.dpatch, it is included upstream now.
-- Jordi Mallach <jordi@debian.org> Thu, 05 Jun 2008 00:47:36 +0200
openttd (0.6.0-2) unstable; urgency=low
[ Jordi Mallach ]
* Rename XS-Vcs-* to the official Vcs-* fields.
[ Matthijs Kooijman ]
* Don't install anything into ~ during make install, this prevented
successful builds on some architectures. Fix imported from upstream.
* Put the homepage in it's own Homepage field instead of in the description.
* Bump Standards-Version to 3.7.3
-- Jordi Mallach <jordi@debian.org> Thu, 03 Apr 2008 00:07:10 +0200
openttd (0.6.0-1) unstable; urgency=low
[ Matthijs Kooijman ]
* New upstream release:
- Adds note about font-configuration for non-latin languages.
Closes: #462604
* Add .desktop file, provided by Andrea Colangelo.
Closes: #460073
* Add Finnish Debconf translation, provided by Esko Arajärvi.
Closes: #456956
[ Jordi Mallach ]
* Fixes and improvements for the .desktop file according to the spec.
-- Jordi Mallach <jordi@debian.org> Wed, 02 Apr 2008 14:04:40 +0200
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sun, 18 Nov 2007 16:05:05 +0100
openttd (0.5.3-1) unstable; urgency=low
[ Matthijs Kooijman ]
* New upstream release
* New upstream release.
-- Jordi Mallach <jordi@debian.org> Tue, 18 Sep 2007 12:05:28 +0200
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sat, 15 Sep 2007 13:30:00 +0100
openttd (0.5.3~rc3-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Thu, 30 Aug 2007 23:30:00 +0100
openttd (0.5.3~rc2-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sat, 7 Jul 2007 20:05:00 +0100
openttd (0.5.3~rc1-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Thu, 28 Jun 2007 18:00:00 +0100
openttd (0.5.2-1) unstable; urgency=low
[ Jordi Mallach ]
* New upstream release.
* Debconf translation updates:
- Catalan.
[ Christian Perrier ]
* Debconf templates and debian/control reviewed by the debian-l10n-
english team as part of the Smith review project.
Closes: #422183, #419096.
* Debconf translation updates:
- Swedish. Closes: #422780
- Basque. Closes: #422786
- Czech. Closes: #422809
- Galician. Closes: #422831
- German. Closes: #422908
- Tamil. Closes: #423079
- Russian. Closes: #423224
- Portuguese. Closes: #423413
- French. Closes: #424436
- Brazilian Portuguese. Closes: #425585
- Dutch. Closes: #425707
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 29 May 2007 20:00:00 +0100
-- Jordi Mallach <jordi@debian.org> Sat, 02 Jun 2007 06:24:34 +0200
openttd (0.5.2~rc1-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 16 May 2007 23:35:39 +0100
openttd (0.5.1-1) unstable; urgency=low
[ Matthijs Kooijman ]
* New upstream release
* Add German and Swedish translations (Closes: #420258, #419097)
* Remove bogus fuzzy mark from the Catalan translation
* New upstream release.
[ Jordi Mallach ]
* debian/control: add XS-Vcs-Svn and XS-Vcs-Browser fields.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Fri, 20 Apr 2007 21:45:32 +0100
-- Jordi Mallach <jordi@debian.org> Mon, 23 Apr 2007 21:03:06 +0200
openttd (0.5.1~rc3-1) unstable; urgency=low
openttd (0.5.0-2) unstable; urgency=low
* New upstream release.
* Upload to Debian.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 17 Apr 2007 22:00:46 +0100
-- Jordi Mallach <jordi@debian.org> Sun, 11 Mar 2007 14:12:37 +0100
openttd (0.5.1~rc2-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Fri, 23 Mar 2007 23:45:46 +0100
openttd (0.5.1~rc1-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 20 Mar 2007 22:03:46 +0100
openttd (0.5.0-1) unstable; urgency=low
[ Matthijs Kooijman ]
* New upstream release
[ Jordi Mallach ]
* Depend on ${misc:Depends}, not debconf directly.
-- Jordi Mallach <jordi@debian.org> Thu, 8 Mar 2007 15:34:54 +0100
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 26 Feb 2007 21:07:05 +0100
openttd (0.5.0~rc5-1) unstable; urgency=low
@@ -235,13 +189,13 @@ openttd (0.4.0.1-1) unstable; urgency=low
* New upstream release
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 23 May 2005 13:04:24 +0200
-- Matthijs Kooijman <matthijs@katherina.student.utwente.nl> Mon, 23 May 2005 13:04:24 +0200
openttd (0.4.0-1) unstable; urgency=low
* New upstream release
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 16 May 2005 00:16:17 +0200
-- Matthijs Kooijman <matthijs@katherina.student.utwente.nl> Mon, 16 May 2005 00:16:17 +0200
openttd (0.3.6-1) unstable; urgency=low
@@ -249,18 +203,18 @@ openttd (0.3.6-1) unstable; urgency=low
* Modifed Makefile to install xpm icon and scenarios in /usr/share/games/openttd/
* Added openttd.32.xpm, openttd.64.xpm was too big
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 25 Jan 2005 19:21:08 +0100
-- root <root@katherina.student.utwente.nl> Tue, 25 Jan 2005 19:21:08 +0100
openttd (0.3.5-2) unstable; urgency=low
* Fixed some lintian warnings.
* Added openttd.64.xpm (icon for menu).
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 27 Dec 2004 01:51:36 +0100
-- Matthijs Kooijman <matthijs@katherina.student.utwente.nl> Mon, 27 Dec 2004 01:51:36 +0100
openttd (0.3.5-1) unstable; urgency=low
* Initial Release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Fri, 24 Dec 2004 02:58:47 +0100
-- Matthijs Kooijman <matthijs@katherina.student.utwente.nl> Fri, 24 Dec 2004 02:58:47 +0100

View File

@@ -6,16 +6,16 @@
FILES="trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf sample.cat"
DATADIR=/usr/share/games/openttd/data
MISSING="No"
MISSING="No";
for FILE in $FILES; do
# Check if all the files needed are here.
if [ ! -e $DATADIR/$FILE ]; then
MISSING="Yes"
break
fi;
done
MISSING="Yes";
break;
fi;
done;
if [ $MISSING = "Yes" ]; then
db_input high openttd/datafiles || true
db_go
fi
fi;

View File

@@ -1,21 +1,20 @@
Source: openttd
Section: contrib/games
Priority: optional
Maintainer: Matthijs Kooijman <matthijs@stdin.nl>
Maintainer: Matthijs Kooijman <m.kooijman@student.utwente.nl>
Uploaders: Jordi Mallach <jordi@debian.org>
Build-Depends: debhelper (>= 4.0.0), libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev
Standards-Version: 3.7.3
Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/openttd/trunk/
Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/openttd/trunk
Homepage: http://www.openttd.org/
Build-Depends: debhelper (>= 4.0.0), dpatch, libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev
Standards-Version: 3.7.2
Package: openttd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: ${shlibs:Depends}, debconf
Suggests: timidity, freepats
Description: reimplementation of Transport Tycoon Deluxe with enhancements
OpenTTD is a reimplementation of the Microprose game "Transport
Tycoon Deluxe" with lots of new features and enhancements. The data
files of the original Transport Tycoon Deluxe for Windows are
mandatory to play the game. They must be manually copied to the game
data directory (see README.Debian for details).
A reimplementation of the Microprose game "Transport Tycoon Deluxe" with lots
of new features and enhancements.
You require the data files of the original Transport Tycoon Deluxe
for Windows to play the game. You have to MANUALLY copy them to the
game data directory! (see README.Debian for details)
.
Homepage: http://www.openttd.org/

0
os/debian/patches/00list Normal file
View File

View File

@@ -1,40 +1,35 @@
# Catalan translation of openttd's Debconf templates.
# Copyright © 2007 Software in the Public Interest, Inc.
# Copyright <EFBFBD> 2007 Software in the Public Interest
# This file is distributed under the same license as the openttd package.
# Jordi Mallach <jordi@debian.org>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd 0.5.2-1\n"
"Project-Id-Version: openttd 0.5.0-1\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-06-01 00:45+0200\n"
"POT-Creation-Date: 2007-02-01 12:25+0100\n"
"PO-Revision-Date: 2007-02-01 12:16+0100\n"
"Last-Translator: Jordi Mallach <jordi@debian.org>\n"
"Language-Team: Catalan <debian-l10n-catalan@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Type: note
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Es necessiten els fitxers de dades"
#: ../templates:1001
msgid "You need to install data files"
msgstr "Heu d'instal<61>lar els fitxers de dades"
#. Type: error
#. Type: note
#. Description
#: ../templates:2001
#: ../templates:1001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
"OpenTTD needs the data files from the original TTD game to run. You should "
"install these data files before you can play the game. See README.Debian for "
"more details on which files need to be copied where."
msgstr ""
"Per a funcionar, OpenTTD necessita els fitxers de dades del joc "
"Transport Tycoon Deluxe original."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr "Vegeu el fitxer /usr/share/doc/openttd/README.Debian per a obtenir-ne més detalls sobre els fitxers necessaris i la seua ubicació."
"OpenTTD necessita els fitxers de dades del joc TTD original per a funcionar. "
"Haureu d'instal<61>lar aquests fitxers de dades abans de poder jugar al joc. "
"Llegiu el document README.Debian per a obtindre m<>s detalls sobre quins "
"fitxers s'han de copiar i a quina ubicaci<63>."

View File

@@ -1,42 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 10:52+0200\n"
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Vyžadovány datové soubory"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Pro svůj běh vyžaduje OpenTTD datové soubory z původní hry Transport Tycoon "
"Deluxe."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Podrobnosti o vyžadovaných souborech a jejich umístění naleznete v souboru /"
"usr/share/doc/openttd/README.Debian."

View File

@@ -1,55 +0,0 @@
# Translation of openttd debconf templates to German
# Copyright (C) Helge Kreutzmann <debian@helgefjell.de>, 2007.
# This file is distributed under the same license as the openttd package.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd 0.5.0-2\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 21:21+0200\n"
"Last-Translator: Helge Kreutzmann <debian@helgefjell.de>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Ben<65>tigte Datendateien"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Zum Betrieb ben<65>tigt OpenTTD Datendateien aus dem Originalspiel Transport "
"Tycoon Deluxe."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Lesen Sie die Datei /usr/share/doc/openttd/README.Debian f<>r weitere Details "
"<22>ber die ben<65>tigten Dateien und ihren Ort."
#~ msgid "You need to install data files"
#~ msgstr "Sie m<>ssen Daten-Dateien installieren"
#~ msgid ""
#~ "OpenTTD needs the data files from the original Transport Tycoon Deluxe "
#~ "game to run. You should install these data files before you can play the "
#~ "game. See README.Debian for more details on which files need to be copied "
#~ "where."
#~ msgstr ""
#~ "OpenTTD ben<65>tigt zur Ausf<73>hrung Daten-Dateien aus dem Originalspiel "
#~ "<22>Transport Tycoon Deluxe<78>. Sie sollten diese Daten-Dateien installieren, "
#~ "bevor Sie das Spiel spielen k<>nnen. Lesen Sie README.Debian f<>r weitere "
#~ "Details dar<61>ber, welche Dateien wohin kopiert werden m<>ssen."

View File

@@ -1,42 +0,0 @@
# OpenTTD debconf template basque translation
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Piarres eobide <pi@beobide.net>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: OpenTTD Debconf\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 09:55+0200\n"
"Last-Translator: Piarres eobide <pi@beobide.net>\n"
"Language-Team: Euskara <Librezale@librezale.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Datu fitxategiak behar dira"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Funtziona dezan, OpenTTD-ek jatorrizko 'Transport Tycoon Deluxe' jokoaren "
"datu fitxategiak behar ditu."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"/usr/share/doc/openttd/README.Debian fitxategia begiratu beharrezko "
"fitategien eta bere kokapenari buruz xehetasun gehiago ikusteko."

View File

@@ -1,32 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: openttd_0.5.3-1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 04:33+0200\n"
"PO-Revision-Date: 2007-12-18 20:01+0200\n"
"Last-Translator: Esko Arajärvi <edu@iki.fi>\n"
"Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Finnish\n"
"X-Poedit-Country: Finland\n"
#. Type: error
#. Description
#: ../templates:1001
msgid "Data files needed"
msgstr "Datatiedostoja puuttuu"
#. Type: error
#. Description
#: ../templates:1001
msgid "For its operation, OpenTTD needs the data files from the original Transport Tycoon Deluxe game."
msgstr "OpenTTD tarvitsee toimiakseen datatiedostoja alkuperäisestä Transport Tycoon Deluxe -pelistä."
#. Type: error
#. Description
#: ../templates:1001
msgid "See the /usr/share/doc/openttd/README.Debian file for more details about the needed files and their location."
msgstr "Tiedostossa /usr/share/doc/openttd/README.Debian on (englanniksi) lisätietoja tarvittavista tiedostoista ja niiden sijainnista."

View File

@@ -1,42 +0,0 @@
# debian-l10n-french translation of 0.5.1-1.
# Copyright (C) 2007 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Ivan Buresi <err747@free.fr>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: 0.5.1-1\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 11:41+0200\n"
"Last-Translator: Ivan Buresi <err747@free.fr>\n"
"Language-Team: debian-l10n-french <debian-l10n-french@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Fichiers de données indispensables"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Pour fonctionner correctement, OpenTTD a besoin des fichiers de données du "
"jeu « Transport Tycoon Deluxe » original."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Veuillez lire le fichier /usr/share/doc/openttd/README.Debian pour plus "
"d'informations sur les fichiers requis et leur emplacement."

View File

@@ -1,41 +0,0 @@
# Galician translation of openttd's debconf templates
# This file is distributed under the same license as the openttd package.
# Jacobo Tarrio <jtarrio@debian.org>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 13:12+0200\n"
"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
"Language-Team: Galician <proxecto@trasno.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Precísase de ficheiros de datos"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Para o seu funcionamento, OpenTTD precisa dos ficheiros de datos do xogo "
"Transport Tycoon Deluxe orixinal."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Consulte o ficheiro /usr/share/doc/openttd/README.Debian para máis "
"información sobre os ficheiros necesarios e as súas ubicacións."

View File

@@ -1,43 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-16 19:25+0100\n"
"Last-Translator: Bart Cornelis <cobaco@skolelinux.no>\n"
"Language-Team: debian-l10n-dutch <debian-l10n-dutch@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Dutch\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Databestanden zijn vereist"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Om te werken heeft OpenTTD de databestanden van het oorspronkelijkee "
"'Transport Tycoon Deluxe'-spel nodig."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Meer informatie over de vereiste bestanden en hun locatie vindt u in /usr/"
"share/doc/openttd/README.Debian . "

View File

@@ -1,42 +0,0 @@
# Portuguese translation of openttd's debconf messages.
# Copyright (C) 2007
# This file is distributed under the same license as the openttd package.
# Ricardo Silva <ardoric@gmail.com>, 2007
#
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-09 09:37+0100\n"
"Last-Translator: Ricardo Silva <ardoric@gmail.com>\n"
"Language-Team: Portuguese <traduz@debianpt.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "São necessários ficheiros de dados"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Para esta operação o OpenTTD precisa dos ficheiros de dados do jogo original "
"Transport Tycool Deluxe."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Veja o ficheiro /usr/share/doc/openttd/README.Debian para mais detalhes "
"sobre os ficheiros que são necessários e a sua localização."

View File

@@ -1,43 +0,0 @@
# openttd Brazilian Portuguese translation
# Copyright (C) 2007, Eder L. Marques
# This file is distributed under the same license as the openttd package.
# Eder L. Marques <frolic@debian-ce.org>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd 0.5.0-2\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 11:00-0300\n"
"Last-Translator: Eder L. Marques <frolic@debian-ce.org>\n"
"Language-Team: l10n Portuguese <debian-l10n-portuguese@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"pt_BR utf-8\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Arquivos de dados necessários"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Para sua operação, o OpenTTD necessita dos arquivos de dados do jogo "
"Transport Tycoon Deluxe original."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Veja o arquivo /usr/share/doc/openttd/README.Debian para maiores detalhes "
"sobre os arquivos necessários e suas localizações."

View File

@@ -1,45 +0,0 @@
# translation of openttd_debconf_ru.po to Russian
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Yuri Kozlov <kozlov.y@gmail.com>, 2007.
msgid ""
msgstr ""
"Project-Id-Version: 0.5.1-1\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-10 21:45+0400\n"
"Last-Translator: Yuri Kozlov <kozlov.y@gmail.com>\n"
"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Необходимы файлы данных"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"Для работы OpenTTD требуются файлы данных от оригинальной игры Transport "
"Tycoon Deluxe."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"В файле /usr/share/doc/openttd/README.Debian приведена информация о том, "
"какие файлы нужны и где они лежат."

View File

@@ -1,56 +0,0 @@
# Swedish translation for openttd debconf template.
# Copyright (C) 2007 Free Software Foundation, Inc.
# This file is distributed under the same license as the openttd package.
# Daniel Nylander <po@danielnylander.se>, 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 09:47+0100\n"
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
"Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "Datafiler behövs"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"För att fungera behöva OpenTTD datafilerna från det ursprungliga spelet "
"Transport Tycoon Deluxe."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"Se filen /usr/share/doc/openttd/README.Debian för mer information om de "
"nödvändiga filera och var de finns någonstans."
#~ msgid "You need to install data files"
#~ msgstr "Du behöver installera datafilerna"
#~ msgid ""
#~ "OpenTTD needs the data files from the original Transport Tycoon Deluxe "
#~ "game to run. You should install these data files before you can play the "
#~ "game. See README.Debian for more details on which files need to be copied "
#~ "where."
#~ msgstr ""
#~ "OpenTTD behöver datafilerna från det ursprungliga spelet Transport Tycoon "
#~ "Deluxe för att kunna köras. Du måste installera dessa datafiler innan du "
#~ "kan spela spelet. Se README.Debian för fler detaljer om vilka filer som "
#~ "behöver kopieras."

View File

@@ -1,43 +0,0 @@
# translation of openttd.po to TAMIL
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Dr.T.Vasudevan <agnihot3@gmail.com>, 2007.
msgid ""
msgstr ""
"Project-Id-Version: openttd\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"PO-Revision-Date: 2007-05-08 15:04+0530\n"
"Last-Translator: Dr.T.Vasudevan <agnihot3@gmail.com>\n"
"Language-Team: TAMIL <ubuntu-l10n-tam@lists.ubuntu.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
#. Type: error
#. Description
#: ../templates:2001
msgid "Data files needed"
msgstr "தேவையான தரவு கோப்புகள்"
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
"இயங்குவதற்கு ஓபன் டிடிடி(OpenTTD) க்கு ட்ரான்ஸ்போர்ட் டைகூன் டீலக்ஸ் விளையாட்டிலிருந்து "
"தரவு கோப்புகள் தேவை."
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
msgstr ""
"தேவையான கோப்புகள் அவற்றின் இடம் ஆகியவற்றை அறிய /usr/share/doc/openttd/README "
"டெபியன் கோப்பை பார்க்கவும்."

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: m.kooijman@student.utwente.nl\n"
"POT-Creation-Date: 2007-05-08 09:39+0200\n"
"POT-Creation-Date: 2007-02-01 12:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,24 +16,17 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: error
#. Type: note
#. Description
#: ../templates:2001
msgid "Data files needed"
#: ../templates:1001
msgid "You need to install data files"
msgstr ""
#. Type: error
#. Type: note
#. Description
#: ../templates:2001
#: ../templates:1001
msgid ""
"For its operation, OpenTTD needs the data files from the original Transport "
"Tycoon Deluxe game."
msgstr ""
#. Type: error
#. Description
#: ../templates:2001
msgid ""
"See the /usr/share/doc/openttd/README.Debian file for more details about the "
"needed files and their location."
"OpenTTD needs the data files from the original TTD game to run. You should "
"install these data files before you can play the game. See README.Debian for "
"more details on which files need to be copied where."
msgstr ""

View File

@@ -6,7 +6,9 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
include /usr/share/dpatch/dpatch.make
configure: patch configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
@@ -27,16 +29,13 @@ build-stamp:
touch build-stamp
clean:
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
# We check for Makefile presence, because clean is called at the
# start of the build process (before configure) where we don't
# have a Makefile yet.
[ ! -f Makefile ] || $(MAKE) distclean
-$(MAKE) clean
dh_clean
@@ -85,4 +84,4 @@ binary-arch: build install
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
.PHONY: build clean binary-indep binary-arch binary install configure patch

View File

@@ -1,16 +1,6 @@
# These templates have been reviewed by the debian-l10n-english
# team
#
# If modifications/additions/rewording are needed, please ask
# for an advice to debian-l10n-english@lists.debian.org
#
# Even minor modifications require translation updates and such
# changes should be coordinated with translators and reviewers.
Template: openttd/datafiles
Type: error
_Description: Data files needed
For its operation, OpenTTD needs the data files from the original
Transport Tycoon Deluxe game.
.
See the /usr/share/doc/openttd/README.Debian file for more details
about the needed files and their location.
Type: note
_Description: You need to install data files
OpenTTD needs the data files from the original TTD game to run. You should
install these data files before you can play the game. See README.Debian
for more details on which files need to be copied where.

View File

@@ -19,7 +19,7 @@ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>OpenTTD</string>
<string>Open Transport Tycoon</string>
<key>CFBundleExecutable</key>
<string>openttd</string>
<key>CFBundleGetInfoString</key>

9
os/mandrake/README.urpmi Normal file
View File

@@ -0,0 +1,9 @@
You require the data files of the original Transport Tycoon Deluxe
for Windows to play the game. You have to manually copy the following
files to %{_gamesdatadir}/openttd/data/
sample.cat
trg1r.grf
trgcr.grf
trghr.grf
trgir.grf
trgtr.grf

146
os/mandrake/openttd.spec Normal file
View File

@@ -0,0 +1,146 @@
#------------------------------------------------------------------------------
# openttd.spec
# This SPEC file controls the building of custom OpenTTD RPM
# packages.
#------------------------------------------------------------------------------
%define name openttd
%define version 0.5.0
%define release 1mdk
#------------------------------------------------------------------------------
# Prologue information
#------------------------------------------------------------------------------
Name: %{name}
Version: %{version}
Release: %{release}
Summary: An open source clone of the Microprose game "Transport Tycoon Deluxe"
Group: Games/Strategy
License: GPL
URL: http://www.openttd.org
Source: %{name}-%{version}.tar.gz
Packager: Dominik Scherer <dominik@openttd.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: libSDL1.2-devel >= 1.2.7
BuildRequires: libpng3-devel >= 1.2.5
BuildRequires: zlib1-devel >= 1.2.1
#------------------------------------------------------------------------------
# Description
#------------------------------------------------------------------------------
%description
An enhanced open source clone of the Microprose game "Transport Tycoon Deluxe".
You require the data files of the original Transport Tycoon Deluxe
for Windows to play the game. You have to MANUALLY copy them to the
game data directory!
#------------------------------------------------------------------------------
# install scripts
#------------------------------------------------------------------------------
%prep
rm -rf $RPM_BUILD_ROOT
%setup
%build
make BINARY_DIR=%{_gamesbindir} PREFIX=%{_gamesdatadir} DATA_DIR=openttd INSTALL_DIR=%{_gamesdatadir}/openttd/ USE_HOMEDIR=1 PERSONAL_DIR=.openttd INSTALL=1 RELEASE=%{version}
%install
mkdir -p $RPM_BUILD_ROOT%{_gamesbindir}
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario
cp ./openttd $RPM_BUILD_ROOT%{_gamesbindir}/
cp -r ./lang/*.lng $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang/
cp -r ./data/*.grf $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/
cp -r ./scenario/*.scn $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario/
cp -r ./data/opntitle.dat $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/
# icon
install -m644 media/openttd.32.png -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png
install -m644 media/openttd.64.png -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png
install -m644 media/openttd.128.png -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png
# menu entry
mkdir -p $RPM_BUILD_ROOT/%{_menudir}
cat << EOF > $RPM_BUILD_ROOT/%{_menudir}/%{name}
?package(%{name}):command="%{_gamesbindir}/openttd" icon="%{name}.png" \
needs="X11" section="Amusement/Strategy" title="OpenTTD" \
longtitle="%{Summary}"
EOF
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{update_menus}
%postun
%{clean_menus}
#------------------------------------------------------------------------------
# Files listing.
#------------------------------------------------------------------------------
%files
%defattr(-,root,root,0755)
%{_gamesbindir}/openttd
%{_gamesdatadir}/openttd/lang/american.lng
%{_gamesdatadir}/openttd/lang/catalan.lng
%{_gamesdatadir}/openttd/lang/czech.lng
%{_gamesdatadir}/openttd/lang/danish.lng
%{_gamesdatadir}/openttd/lang/dutch.lng
%{_gamesdatadir}/openttd/lang/english.lng
%{_gamesdatadir}/openttd/lang/finnish.lng
%{_gamesdatadir}/openttd/lang/french.lng
%{_gamesdatadir}/openttd/lang/galician.lng
%{_gamesdatadir}/openttd/lang/german.lng
%{_gamesdatadir}/openttd/lang/hungarian.lng
%{_gamesdatadir}/openttd/lang/icelandic.lng
%{_gamesdatadir}/openttd/lang/italian.lng
%{_gamesdatadir}/openttd/lang/norwegian.lng
%{_gamesdatadir}/openttd/lang/origveh.lng
%{_gamesdatadir}/openttd/lang/polish.lng
%{_gamesdatadir}/openttd/lang/portuguese.lng
%{_gamesdatadir}/openttd/lang/romanian.lng
%{_gamesdatadir}/openttd/lang/slovak.lng
%{_gamesdatadir}/openttd/lang/spanish.lng
%{_gamesdatadir}/openttd/lang/swedish.lng
%{_gamesdatadir}/openttd/data/autorail.grf
%{_gamesdatadir}/openttd/data/canalsw.grf
%{_gamesdatadir}/openttd/data/openttd.grf
%{_gamesdatadir}/openttd/data/opntitle.dat
%{_gamesdatadir}/openttd/data/signalsw.grf
%{_gamesdatadir}/openttd/data/trkfoundw.grf
"%{_gamesdatadir}/openttd/scenario/Linkgame Islands 2004.scn"
"%{_gamesdatadir}/openttd/scenario/Mountain Pass.scn"
"%{_gamesdatadir}/openttd/scenario/Volcano City.scn"
%{_menudir}/%{name}
%{_iconsdir}/*.png
%{_miconsdir}/*.png
%{_liconsdir}/*.png
%doc changelog.txt readme.txt COPYING os/linux/README.urpmi
#------------------------------------------------------------------------------
# Change Log
#------------------------------------------------------------------------------
%changelog
* Sun Jan 23 2005 Dominik Scherer <dominik@openttd.com> 0.3.6-1mdk
- Upgraded to 0.3.6
- Structured and commented the spec file a bit (inspired by ScummVM)
* Fri Dec 24 2004 Dominik Scherer <dominik@openttd.com> 0.3.5-1mdk
- Upgraded to 0.3.5
- Added a warning message about the additional required files (only displayed when installing via urpmi)
* Wed Sep 15 2004 Dominik Scherer <> 0.3.4-1mdk
- Upgraded to 0.3.4
* Wed Jul 31 2004 Dominik Scherer <> 0.3.3-1mdk
- Initial release

View File

@@ -1,75 +0,0 @@
#
# spec file for package openttd (trunk)
#
# Copyright (c) 2007 The OpenTTD team.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself
#
Name: openttd
Version: svn
Release: head
Group: Applications/Games
Source: %{name}-%{version}-%{release}.tar.gz
License: GPL
URL: http://www.openttd.org
Packager: Denis Burlaka <burlaka@yandex.ru>
Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoon Deluxe
Requires: SDL zlib libpng freetype2 fontconfig
BuildRequires: gcc SDL-devel zlib-devel libpng-devel fontconfig-devel
%if %{_vendor}=="suse"
BuildRequires: freetype2-devel
%endif
%if %{_vendor}=="fedora"
BuildRequires: freetype-devel
%endif
%if %{_vendor}=="mandriva"
BuildRequires: libfreetype6-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: /usr
%description
OpenTTD is a clone of the Microprose game "Transport Tycoon Deluxe", a popular game originally 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. For more information, see the file 'COPYING' included with every release and source download of the game.
%prep
%setup
%build
./configure --prefix-dir=%{prefix} --binary-dir=bin --install-dir="$RPM_BUILD_ROOT"
make
%install
make ROOT="$RPM_BUILD_ROOT" install
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
cat << EOF > $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop
[Desktop Entry]
Categories=Games;
Encoding=UTF-8
Exec=/usr/bin/openttd
Name=OpenTTD
Icon=openttd.32
Terminal=false
Type=Application
EOF
%clean
rm -Rf "$RPM_BUILD_ROOT"
%files
%dir %{_datadir}/games/%{name}
%dir %{_datadir}/games/%{name}/lang
%dir %{_datadir}/games/%{name}/data
%dir %{_datadir}/games/%{name}/gm
%dir %{_datadir}/games/%{name}/docs
%dir %{_datadir}/pixmaps
%defattr(644, root, games, 755)
%attr(755, root, games) %{_bindir}/%{name}
%{_datadir}/games/%{name}/lang/*
%{_datadir}/games/%{name}/data/*
%{_datadir}/games/%{name}/docs/*
%{_datadir}/pixmaps/*
%{_datadir}/applications/%{name}.desktop

BIN
os/suse/openttd.spec Normal file

Binary file not shown.

View File

@@ -1,10 +1,9 @@
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "0.6.3" ; Define application version
!define INSTALLERVERSION 53 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!include ${VERSION_INCLUDE}
!define APPVERSION "0.6.0" ; Define application version
!define INSTALLERVERSION 41 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define APPURLLINK "http://www.openttd.org"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}-beta3"
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
!define MUI_ICON "..\..\..\media\openttd.ico"
@@ -19,20 +18,21 @@ SetCompressor LZMA
; Version Info
Var AddWinPrePopulate
VIProductVersion "${APPVERSIONINTERNAL}"
VIAddVersionKey "ProductName" "OpenTTD Installer ${APPBITS} bits version ${EXTRA_VERSION}"
VIAddVersionKey "ProductName" "OpenTTD Installer"
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}"
VIAddVersionKey "CompanyName" "OpenTTD Developers"
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}"
VIAddVersionKey "ProductVersion" "${APPVERSION}"
VIAddVersionKey "InternalName" "InstOpenTTD-${APPARCH}"
VIAddVersionKey "FileVersion" "${APPVERSION}-${APPARCH}"
VIAddVersionKey "InternalName" "InstOpenTTD"
VIAddVersionKey "FileVersion" "${APPVERSION}"
VIAddVersionKey "LegalCopyright" " "
; Main Install settings
Name "${APPNAMEANDVERSION} ${APPBITS} bits version ${EXTRA_VERSION}"
Name "${APPNAMEANDVERSION}"
; NOTE: Keep trailing backslash!
InstallDir "$PROGRAMFILES\OpenTTD\"
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder"
OutFile "openttd-${APPVERSION}-${APPARCH}.exe"
OutFile "openttd-${APPVERSION}-win32.exe"
CRCCheck force
ShowInstDetails show
@@ -45,7 +45,7 @@ Var CDDRIVE
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_RADIOBUTTONS
@@ -75,8 +75,6 @@ Page custom SelectCDEnter SelectCDExit ": TTD folder"
; New custom page to show UNICODE and MSLU information
Page custom ShowWarningsPage
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!"
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe"
!define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for latest news, FAQs and downloads"
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}"
@@ -86,7 +84,6 @@ Page custom ShowWarningsPage
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack
!insertmacro MUI_PAGE_FINISH
!define MUI_PAGE_HEADER_TEXT "Uninstall ${APPNAMEANDVERSION}"
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
@@ -100,12 +97,15 @@ Section "!OpenTTD" Section1
; Overwrite files by default, but don't complain on failure
SetOverwrite try
; Make savegame folder
SetOutPath "$INSTDIR\save"
; Define root variable relative to installer
!define PATH_ROOT "..\..\..\"
; Copy language files
SetOutPath "$INSTDIR\lang\"
File ${PATH_ROOT}bin\lang\*.lng
File ${PATH_ROOT}src\lang\english.txt
; Copy data files
SetOutPath "$INSTDIR\data\"
@@ -129,7 +129,8 @@ Section "!OpenTTD" Section1
File ${PATH_ROOT}known-bugs.txt
; Copy executable
File /oname=openttd.exe ${BINARY_DIR}\openttd.exe
File /oname=openttd.exe ${PATH_ROOT}objs\Win32\Release\openttd.exe
File ${PATH_ROOT}objs\strgen\strgen.exe
; Delete old files from the main dir. they are now placed in data/ and lang/
@@ -246,10 +247,10 @@ Section "Uninstall"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\known-bugs.txt"
Delete "$INSTDIR\openttd.exe"
Delete "$INSTDIR\strgen.exe"
Delete "$INSTDIR\COPYING"
Delete "$INSTDIR\INSTALL.LOG"
Delete "$INSTDIR\crash.log"
Delete "$INSTDIR\crash.dmp"
Delete "$INSTDIR\openttd.cfg"
Delete "$INSTDIR\hs.dat"
Delete "$INSTDIR\cached_sprites.*"
@@ -268,8 +269,6 @@ Section "Uninstall"
Delete "$INSTDIR\data\openttd.grf"
Delete "$INSTDIR\data\roadstops.grf"
Delete "$INSTDIR\data\trkfoundw.grf"
Delete "$INSTDIR\data\openttdd.grf"
Delete "$INSTDIR\data\openttdw.grf"
Delete "$INSTDIR\data\sample.cat"
; Windows Data files
@@ -290,6 +289,7 @@ Section "Uninstall"
; Language files
Delete "$INSTDIR\lang\*.lng"
Delete "$INSTDIR\lang\english.txt"
; Remove remaining directories
RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\"
@@ -390,55 +390,14 @@ Function GetWindowsVersion
ClearErrors
StrCpy $R0 "winnt"
GetVersion::WindowsPlatformId
Pop $R0
IntCmp $R0 2 WinNT 0
ReadRegStr $R1 HKLM "SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion" CurrentVersion
IfErrors 0 WinNT
StrCpy $R0 "win9x"
WinNT:
ClearErrors
Push $R0
FunctionEnd
;-------------------------------------------------------------------------------
; Check whether we're not running an installer for 64 bits on 32 bits and vice versa
Function CheckProcessorArchitecture
GetVersion::WindowsPlatformArchitecture
Pop $R0
IntCmp $R0 64 Win64 0
ClearErrors
IntCmp ${APPBITS} 64 0 Done
MessageBox MB_OKCANCEL|MB_ICONSTOP "You want to install the 64 bits OpenTTD on a 32 bits Operating System. This is not going to work. Please download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort
GoTo Done
Win64:
ClearErrors
IntCmp ${APPBITS} 64 Done 0
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "You want to install the 32 bits OpenTTD on a 64 bits Operating System. This is not adviced, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort
GoTo Done
Abort:
Quit
Done:
FunctionEnd
;-------------------------------------------------------------------------------
; Check whether we're not running an installer for NT on 9x and vice versa
Function CheckWindowsVersion
Call GetWindowsVersion
Pop $R0
StrCmp $R0 "win9x" 0 WinNT
ClearErrors
StrCmp ${APPARCH} "win9x" Done 0
MessageBox MB_OKCANCEL|MB_ICONSTOP "You want to install the Windows 2000, XP and Vista version on Windows 95, 98 or ME. This is will not work. Please download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort
GoTo Done
WinNT:
ClearErrors
StrCmp ${APPARCH} "win9x" 0 Done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "You want to install the Windows 95, 98 and ME version on Windows 2000, XP or Vista. This is not adviced, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort
Abort:
Quit
Done:
FunctionEnd
Var OLDVERSION
Var UninstallString
@@ -489,8 +448,6 @@ InstallerIsOlder:
FinishCallback:
ClearErrors
Call CheckProcessorArchitecture
Call CheckWindowsVersion
FunctionEnd
; eof

View File

@@ -1,5 +0,0 @@
!define APPBITS 32 ; Define number of bits for the architecture
!define EXTRA_VERSION "for Windows 2000, XP and Vista"
!define APPARCH "win32" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}objs\win32\Release"
InstallDir "$PROGRAMFILES32\OpenTTD\"

View File

@@ -1,5 +0,0 @@
!define APPBITS 64 ; Define number of bits for the architecture
!define EXTRA_VERSION "for Windows XP and Vista"
!define APPARCH "win64" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}objs\x64\Release"
InstallDir "$PROGRAMFILES64\OpenTTD\"

View File

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

124
projects/determineversion.vbs Executable file → Normal file
View File

@@ -9,39 +9,34 @@ Sub FindReplaceInFile(filename, to_find, replacement)
data = file.ReadAll
file.Close
data = Replace(data, to_find, replacement)
Set file = FSO.CreateTextFile(filename, -1, 0)
Set file = FSO.CreateTextFile(FileName, -1, 0)
file.Write data
file.Close
End Sub
Sub UpdateFile(modified, revision, version, cur_date, filename)
Sub UpdateFile(revision, version, cur_date, filename)
FSO.CopyFile filename & ".in", filename
FindReplaceInFile filename, "@@MODIFIED@@", modified
FindReplaceInFile filename, "@@REVISION@@", revision
FindReplaceInFile filename, "@@VERSION@@", version
FindReplaceInFile filename, "@@DATE@@", cur_date
End Sub
Sub UpdateFiles(version)
Dim WshShell, cur_date, modified, revision, oExec
Dim WshShell, cur_date, revision, oExec
Set WshShell = CreateObject("WScript.Shell")
cur_date = DatePart("D", Date) & "." & DatePart("M", Date) & "." & DatePart("YYYY", Date)
revision = 0
modified = 1
Select Case Mid(version, 1, 1)
Case "r" ' svn
revision = Mid(version, 2)
If InStr(revision, "M") Then
revision = Mid(revision, 1, InStr(revision, "M") - 1)
modified = 2
Else
modified = 0
End If
If InStr(revision, "-") Then
revision = Mid(revision, 1, InStr(revision, "-") - 1)
End If
Case "h" ' mercurial (hg)
Set oExec = WshShell.Exec("hg log -r " & Mid(version, 2, 8) & ":0 -k " & Chr(34) & "svn" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc}\n" & Chr(34) & " ../src")
Set oExec = WshShell.Exec("hg log -k " & Chr(34) & "svn" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc}\n" & Chr(34) & " ../src")
If Err.Number = 0 Then
revision = Mid(OExec.StdOut.ReadLine(), 7)
revision = Mid(revision, 1, InStr(revision, ")") - 1)
@@ -54,47 +49,10 @@ Sub UpdateFiles(version)
End If
End Select
UpdateFile modified, revision, version, cur_date, "../src/rev.cpp"
UpdateFile modified, revision, version, cur_date, "../src/ottdres.rc"
UpdateFile revision, version, cur_date, "../src/rev.cpp"
UpdateFile revision, version, cur_date, "../src/ottdres.rc"
End Sub
Function ReadRegistryKey(shive, subkey, valuename, architecture)
Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
' First, get the Registry Provider for the requested architecture
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objReg = objServices.Get("StdRegProv")
' Check the hive and give it the right value
Select Case shive
Case "HKCR", "HKEY_CLASSES_ROOT"
hiveKey = &h80000000
Case "HKCU", "HKEY_CURRENT_USER"
hiveKey = &H80000001
Case "HKLM", "HKEY_LOCAL_MACHINE"
hiveKey = &h80000002
Case "HKU", "HKEY_USERS"
hiveKey = &h80000003
Case "HKCC", "HKEY_CURRENT_CONFIG"
hiveKey = &h80000005
Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
hiveKey = &h80000006
Case Else
MsgBox "Hive not valid (ReadRegistryKey)"
End Select
Set Inparams = objReg.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = hiveKey
Inparams.Ssubkeyname = subkey
Inparams.Svaluename = valuename
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
ReadRegistryKey = Outparams.SValue
End Function
Function DetermineSVNVersion()
Dim WshShell, version, url, oExec, line
Set WshShell = CreateObject("WScript.Shell")
@@ -103,35 +61,27 @@ Function DetermineSVNVersion()
' Try TortoiseSVN
' Get the directory where TortoiseSVN (should) reside(s)
Dim sTortoise
' First, try with 32-bit architecture
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 32)
If sTortoise = Nothing Then
' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 64)
End If
sTortoise = WshShell.RegRead("HKLM\SOFTWARE\TortoiseSVN\Directory")
' If TortoiseSVN is installed, try to get the revision number
If sTortoise <> Nothing Then
Dim file
' Write some "magic" to a temporary file so we can acquire the svn revision/state
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
file.WriteLine "r$WCREV$$WCMODS?M:$"
file.WriteLine "$WCURL$"
file.Close
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
' Wait till the application is finished ...
Do
OExec.StdOut.ReadLine()
Loop While Not OExec.StdOut.atEndOfStream
Dim file
' Write some "magic" to a temporary file so we can acquire the svn revision/state
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
file.WriteLine "r$WCREV$$WCMODS?M:$"
file.WriteLine "$WCURL$"
file.Close
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
' Wait till the application is finished ...
Do
OExec.StdOut.ReadLine()
Loop While Not OExec.StdOut.atEndOfStream
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
version = file.ReadLine
url = file.ReadLine
file.Close
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
version = file.ReadLine
url = file.ReadLine
file.Close
Set file = FSO.GetFile("tsvn_tmp")
file.Delete
End If
Set file = FSO.GetFile("tsvn_tmp")
file.Delete
' Looks like there is no TortoiseSVN installed either. Then we don't know it.
If InStr(version, "$") Then
@@ -141,11 +91,6 @@ Function DetermineSVNVersion()
' Do we have subversion installed? Check immediatelly whether we've got a modified WC.
Set oExec = WshShell.Exec("svnversion ../src")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
End If
If Err.Number = 0 And oExec.ExitCode = 0 Then
Dim modified
If InStr(OExec.StdOut.ReadLine(), "M") Then
modified = "M"
@@ -183,11 +128,6 @@ Function DetermineSVNVersion()
Err.Clear
Set oExec = WshShell.Exec("git rev-parse --verify --short=8 HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
End If
If Err.Number = 0 And oExec.ExitCode = 0 Then
version = "g" & oExec.StdOut.ReadLine()
Set oExec = WshShell.Exec("git diff-index --exit-code --quiet HEAD ../src")
Do While oExec.Status = 0 And Err.Number = 0
@@ -199,7 +139,7 @@ Function DetermineSVNVersion()
Set oExec = WshShell.Exec("git symbolic-ref HEAD")
If Err.Number = 0 Then
line = oExec.StdOut.ReadLine()
line = Mid(line, InStrRev(line, "/") + 1)
line = Mid(line, InStrRev(line, "/")+1)
If line <> "master" Then
version = version & "-" & line
End If
@@ -207,20 +147,14 @@ Function DetermineSVNVersion()
Else
' try mercurial (hg)
Err.Clear
Set oExec = WshShell.Exec("hg parents")
Set oExec = WshShell.Exec("hg tip")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
End If
If Err.Number = 0 And oExec.ExitCode = 0 Then
line = OExec.StdOut.ReadLine()
version = "h" & Mid(line, InStrRev(line, ":") + 1, 8)
version = "h" & Mid(OExec.StdOut.ReadLine(), 19, 8)
Set oExec = WshShell.Exec("hg status ../src")
If Err.Number = 0 Then
Do
line = OExec.StdOut.ReadLine()
If Len(line) > 0 And Mid(line, 1, 1) <> "?" Then
If Mid(line, 1, 1) <> "?" Then
version = version & "M"
Exit Do
End If
@@ -260,7 +194,7 @@ Function IsCachedVersion(version)
End Function
Dim version
version = DetermineSVNVersion
version = "0.6.0-beta3"
If Not (IsCachedVersion(version) And FSO.FileExists("../src/rev.cpp") And FSO.FileExists("../src/ottdres.rc")) Then
UpdateFiles version
End If

View File

@@ -25,6 +25,13 @@ fi
# langs_vs80.vcproj is for MSVC 2005
# strgen_vs80.vcproj is for MSVC 2005
# openttd.sln is for MSVC 2003
# openttd.vcproj is for MSVC 2003
# langs.vcproj is for MSVC 2003
# strgen.vcproj is for MSVC 2003
# openttd.tgt is for WatCom
# First, collect the list of Windows files
@@ -103,7 +110,7 @@ load_main_data() {
print " <Filter";
print " Name=\\""$0"\\"";
print " >";
print " Filter=\\"\\">";
}
next;
@@ -114,8 +121,7 @@ load_main_data() {
gsub(" ", "", $0);
gsub("/", "\\\\", $0);
print " <File";
print " RelativePath=\\".\\\\'$file_prefix'"$0"\\"";
print " >";
print " RelativePath=\\".\\\\'$file_prefix'"$0"\\">";
print " </File>";
}
}
@@ -132,18 +138,15 @@ load_lang_data() {
i=`basename $i | sed s/.txt$//g`
RES="$RES
<File
RelativePath=\"..\\src\\lang\\"$i".txt\"
>
RelativePath=\"..\\src\\lang\\"$i".txt\">
<FileConfiguration
Name=\"Debug|Win32\"
>
Name=\"Debug|Win32\">
<Tool
Name=\"VCCustomBuildTool\"
Description=\"Generating "$i" language file\"
CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\"
AdditionalDependencies=\"\"
Outputs=\"..\\bin\\lang\\"$i".lng\"
/>
Outputs=\"..\\bin\\lang\\"$i".lng\"/>
</FileConfiguration>
</File>"
done
@@ -162,7 +165,22 @@ generate() {
}
' > "$ROOT_DIR/projects/$2"
echo "$1" >> "$ROOT_DIR/projects/$2"
# The files-list
echo "$1" | awk -v type="$3" '
/&#x0D;&#x0A;/ {
if (type == "msvc2003") gsub("&#x0D;&#x0A;", "\n", $0);
}
/Filter="">/ {
if (type == "msvc2005") gsub("Filter=\"\">", ">", $0);
}
/"\/>/ {
if (type == "msvc2005") gsub("/>", "\n" substr($0, 1, index($0, $1) - 2) "/>", $0);
}
/">/ {
if (type == "msvc2005") gsub(">", "\n" substr($0, 1, index($0, $1) - 1) ">", $0);
}
{ print $0 }
' >> "$ROOT_DIR/projects/$2"
# Everything below the !!FILES!! marker
cat "$ROOT_DIR/projects/$2".in | tr '\r' '\n' | awk '
@@ -181,7 +199,9 @@ safety_check "$ROOT_DIR/source.list"
load_main_data "$ROOT_DIR/source.list" openttd
load_lang_data "$ROOT_DIR/src/lang/*.txt" lang
generate "$openttd" "openttd_vs80.vcproj"
generate "$openttd" "openttd_vs90.vcproj"
generate "$lang" "langs_vs80.vcproj"
generate "$lang" "langs_vs90.vcproj"
generate "$openttd" "openttd.vcproj" "msvc2003"
generate "$openttd" "openttd_vs80.vcproj" "msvc2005"
generate "$openttd" "openttd_vs90.vcproj" "msvc2005"
generate "$lang" "langs.vcproj" "msvc2003"
generate "$lang" "langs_vs80.vcproj" "msvc2005"
generate "$lang" "langs_vs90.vcproj" "msvc2005"

View File

@@ -1,183 +0,0 @@
Option Explicit
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
' openttd_vs90.sln is for MSVC 2008
' openttd_vs90.vcproj is for MSVC 2008
' langs_vs90.vcproj is for MSVC 2008
' strgen_vs90.vcproj is for MSVC 2008
' openttd_vs80.sln is for MSVC 2005
' openttd_vs80.vcproj is for MSVC 2005
' langs_vs80.vcproj is for MSVC 2005
' strgen_vs80.vcproj is for MSVC 2005
Sub safety_check(filename)
Dim file, line, regexp, list
' Define regexp
Set regexp = New RegExp
regexp.Pattern = "#|ottdres.rc|win32.cpp|win32_v.cpp"
regexp.Global = True
' We use a dictionary to check duplicates
Set list = CreateObject("Scripting.Dictionary")
Set file = FSO.OpenTextFile(filename, 1, 0, 0)
While Not file.AtEndOfStream
line = Replace(file.ReadLine, Chr(9), "") ' Remove tabs
If Len(line) > 0 And Not regexp.Test(line) Then
line = FSO.GetFileName(line)
if list.Exists(line) Then
WScript.Echo " !! ERROR !!" _
& vbCrLf & "" _
& vbCrLf & "The filename '" & line & "' is already used in this project." _
& vbCrLf & "Because MSVC uses one single directory for all object files, it" _
& vbCrLf & "cannot handle filenames with the same name inside the same project." _
& vbCrLf & "Please rename either one of the file and try generating again." _
& vbCrLf & "" _
& vbCrLf & " !! ERROR !!"
WScript.Quit(1)
End If
list.Add line, line
End If
Wend
file.Close
End Sub
Function load_main_data(filename)
Dim res, file, line, deep, skip, first_time
res = ""
' Read the source.list and process it
Set file = FSO.OpenTextFile(filename, 1, 0, 0)
While Not file.AtEndOfStream
line = Replace(file.ReadLine, Chr(9), "") ' Remove tabs
If Len(line) > 0 Then
Select Case Split(line, " ")(0)
Case "#end"
If deep = skip Then skip = skip - 1
deep = deep - 1
Case "#else"
If deep = skip Then
skip = skip - 1
ElseIf deep - 1 = skip Then
skip = skip + 1
End If
Case "#if"
line = Replace(line, "#if ", "")
If deep = skip And ( _
line = "SDL" Or _
line = "PNG" Or _
line = "WIN32" Or _
line = "MSVC" Or _
line = "DIRECTMUSIC" Or _
line = "NO_THREADS" _
) Then skip = skip + 1
deep = deep + 1
Case "#"
if deep = skip Then
line = Replace(line, "# ", "")
if first_time <> 0 Then
res = res & " </Filter>" & vbCrLf
Else
first_time = 1
End If
res = res & _
" <Filter" & vbCrLf & _
" Name=" & Chr(34) & line & Chr(34) & vbCrLf & _
" >" & vbCrLf
End If
Case Else
If deep = skip Then
line = Replace(line, "/" ,"\")
res = res & _
" <File" & vbCrLf & _
" RelativePath=" & Chr(34) & ".\..\src\" & line & Chr(34) & vbCrLf & _
" >" & vbCrLf & _
" </File>" & vbCrLf
End If
End Select
End If
Wend
res = res & " </Filter>"
file.Close()
load_main_data = res
End Function
Function load_lang_data(dir)
Dim res, folder, file
res = ""
Set folder = FSO.GetFolder(dir)
For Each file In folder.Files
file = FSO.GetFileName(file)
If FSO.GetExtensionName(file) = "txt" Then
file = Left(file, Len(file) - 4)
res = res _
& vbCrLf & " <File" _
& vbCrLf & " RelativePath=" & Chr(34) & "..\src\lang\" & file & ".txt" & Chr(34) _
& vbCrLf & " >" _
& vbCrLf & " <FileConfiguration" _
& vbCrLf & " Name=" & Chr(34) & "Debug|Win32" & Chr(34) _
& vbCrLf & " >" _
& vbCrLf & " <Tool" _
& vbCrLf & " Name=" & Chr(34) & "VCCustomBuildTool" & Chr(34) _
& vbCrLf & " Description=" & Chr(34) & "Generating " & file & " language file" & Chr(34) _
& vbCrLf & " CommandLine=" & Chr(34) & "..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" & Chr(34) _
& vbCrLf & " AdditionalDependencies=" & Chr(34) & Chr(34) _
& vbCrLf & " Outputs=" & Chr(34) & "..\bin\lang\" & file & ".lng" & Chr(34) _
& vbCrLf & " />" _
& vbCrLf & " </FileConfiguration>" _
& vbCrLf & " </File>"
End If
Next
load_lang_data = res
End Function
Sub generate(data, dest)
Dim srcfile, destfile, line
WScript.Echo "Generating " & FSO.GetFileName(dest) & "..."
Set srcfile = FSO.OpenTextFile(dest & ".in", 1, 0, 0)
Set destfile = FSO.CreateTextFile(dest, -1, 0)
' Everything above the !!FILES!! marker
line = srcfile.ReadLine()
While line <> "!!FILES!!"
If len(line) > 0 Then destfile.WriteLine(line)
line = srcfile.ReadLine()
Wend
' Our generated content
destfile.WriteLine(data)
' Everything below the !!FILES!! marker
While Not srcfile.AtEndOfStream
line = srcfile.ReadLine()
If len(line) > 0 Then destfile.WriteLine(line)
Wend
srcfile.Close()
destfile.Close()
End Sub
Dim ROOT_DIR
ROOT_DIR = FSO.GetFolder("..").Path
If Not FSO.FileExists(ROOT_DIR & "/source.list") Then
ROOT_DIR = FSO.GetFolder(".").Path
End If
If Not FSO.FileExists(ROOT_DIR & "/source.list") Then
WScript.Echo "Can't find source.list, needed in order to make this run." _
& vbCrLf & "Please go to either the project dir, or the root dir of a clean SVN checkout."
WScript.Quit(1)
End If
safety_check ROOT_DIR & "/source.list"
Dim openttd
openttd = load_main_data(ROOT_DIR &"/source.list")
generate openttd, ROOT_DIR & "/projects/openttd_vs80.vcproj"
generate openttd, ROOT_DIR & "/projects/openttd_vs90.vcproj"
Dim lang
lang = load_lang_data(ROOT_DIR & "/src/lang")
generate lang, ROOT_DIR & "/projects/langs_vs80.vcproj"
generate lang, ROOT_DIR & "/projects/langs_vs90.vcproj"

538
projects/langs.vcproj Normal file
View File

@@ -0,0 +1,538 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="langs"
ProjectGUID="{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
RootNamespace="langs"
SccProjectName=""
SccLocalPath=""
Keyword="MakeFileProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\bin\lang\"
IntermediateDirectory="..\objs\langs\"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName="./langs.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
Description="Generating strings.h"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\objs\langs\table"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\src\lang\afrikaans.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating afrikaans language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\afrikaans.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\brazilian_portuguese.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating brazilian_portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\brazilian_portuguese.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\bulgarian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating bulgarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\bulgarian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\catalan.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating catalan language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\catalan.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\croatian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating croatian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\croatian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\czech.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating czech language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\czech.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\danish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating danish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\danish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\dutch.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating dutch language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\dutch.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\english.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating english language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\english.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\english_US.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating english_US language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\english_US.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\esperanto.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating esperanto language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\esperanto.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\estonian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating estonian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\estonian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\finnish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating finnish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\finnish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\french.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating french language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\french.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\galician.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating galician language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\galician.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\german.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating german language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\german.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\hungarian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating hungarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\hungarian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\icelandic.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating icelandic language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\icelandic.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\italian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating italian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\italian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\japanese.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating japanese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\japanese.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\korean.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating korean language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\korean.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\lithuanian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating lithuanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\lithuanian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\norwegian_bokmal.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating norwegian_bokmal language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_bokmal.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\norwegian_nynorsk.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating norwegian_nynorsk language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_nynorsk.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\origveh.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating origveh language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\origveh.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\piglatin.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating piglatin language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\piglatin.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\polish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating polish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\polish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\portuguese.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\portuguese.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\romanian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating romanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\romanian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\russian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating russian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\russian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\simplified_chinese.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating simplified_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\simplified_chinese.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\slovak.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating slovak language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\slovak.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\slovenian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating slovenian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\slovenian.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\spanish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating spanish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\spanish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\swedish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating swedish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\swedish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\traditional_chinese.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating traditional_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\traditional_chinese.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\turkish.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating turkish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\turkish.lng"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\ukrainian.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating ukrainian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
"
AdditionalDependencies=""
Outputs="..\bin\lang\ukrainian.lng"/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

44
projects/langs.vcproj.in Normal file
View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="langs"
ProjectGUID="{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
RootNamespace="langs"
SccProjectName=""
SccLocalPath=""
Keyword="MakeFileProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\bin\lang\"
IntermediateDirectory="..\objs\langs\"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName="./langs.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
Description="Generating strings.h"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\objs\langs\table"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
!!FILES!!
</Files>
<Globals>
</Globals>
</VisualStudioProject>

43
projects/openttd.sln Normal file
View File

@@ -0,0 +1,43 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openttd", "openttd.vcproj", "{668328A0-B40E-4CDB-BD72-D0064424414A}"
ProjectSection(ProjectDependencies) = postProject
{0F066B23-18DF-4284-8265-F4A5E7E3B966} = {0F066B23-18DF-4284-8265-F4A5E7E3B966}
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strgen", "strgen.vcproj", "{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "langs", "langs.vcproj", "{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
ProjectSection(ProjectDependencies) = postProject
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug.ActiveCfg = Debug|Win32
{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug.Build.0 = Debug|Win32
{668328A0-B40E-4CDB-BD72-D0064424414A}.Release.ActiveCfg = Release|Win32
{668328A0-B40E-4CDB-BD72-D0064424414A}.Release.Build.0 = Release|Win32
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug.ActiveCfg = Release|Win32
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug.Build.0 = Release|Win32
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Release.ActiveCfg = Release|Win32
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Release.Build.0 = Release|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Debug.ActiveCfg = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Debug.Build.0 = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release.ActiveCfg = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
EndGlobal

2667
projects/openttd.tgt Normal file

File diff suppressed because it is too large Load Diff

1426
projects/openttd.vcproj Normal file

File diff suppressed because it is too large Load Diff

177
projects/openttd.vcproj.in Normal file
View File

@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="openttd"
RootNamespace="openttd"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="1"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="2"
OmitFramePointers="TRUE"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="..\objs\langs"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="TRUE"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
StructMemberAlignment="3"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
DefaultCharIsUnsigned="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
PrecompiledHeaderFile=""
AssemblerOutput="2"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/$(TargetName).pdb"
BrowseInformation="1"
BrowseInformationFile="$(IntDir)/"
WarningLevel="3"
WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CallingConvention="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
OptimizeForWindows98="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/openttd.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\objs\langs"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/$(TargetName).pdb"
WarningLevel="3"
WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"
CallingConvention="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="unicows.lib winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
LinkIncremental="0"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="TRUE"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/openttd.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
!!FILES!!
<File
RelativePath=".\..\media\mainicon.ico">
</File>
<File
RelativePath=".\..\media\openttd.ico">
</File>
<File
RelativePath=".\..\readme.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -4,7 +4,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openttd", "openttd_vs80.vcp
ProjectSection(ProjectDependencies) = postProject
{0F066B23-18DF-4284-8265-F4A5E7E3B966} = {0F066B23-18DF-4284-8265-F4A5E7E3B966}
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC} = {1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strgen", "strgen_vs80.vcproj", "{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}"
@@ -14,8 +13,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "langs", "langs_vs80.vcproj"
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version_vs80.vcproj", "{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -48,14 +45,6 @@ Global
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|Win32.Build.0 = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|x64.ActiveCfg = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|x64.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|Win32.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|Win32.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|x64.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|x64.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|Win32.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|Win32.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|x64.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|x64.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -33,6 +33,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -143,6 +145,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -239,6 +243,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -350,6 +356,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -447,10 +455,6 @@
RelativePath=".\..\src\airport.cpp"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.cpp"
>
@@ -463,10 +467,6 @@
RelativePath=".\..\src\aystar.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\bmp.cpp"
>
@@ -495,6 +495,14 @@
RelativePath=".\..\src\console_cmds.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\currency.cpp"
>
@@ -519,10 +527,6 @@
RelativePath=".\..\src\driver.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\economy.cpp"
>
@@ -663,10 +667,6 @@
RelativePath=".\..\src\rail.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\rev.cpp"
>
@@ -751,6 +751,10 @@
RelativePath=".\..\src\widget.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\win32.cpp"
>
@@ -775,30 +779,10 @@
RelativePath=".\..\src\airport_movement.h"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_base.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_func.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_gui.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_type.h"
>
</File>
<File
RelativePath=".\..\src\autoslope.h"
>
@@ -807,26 +791,10 @@
RelativePath=".\..\src\aystar.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\bmp.h"
>
</File>
<File
RelativePath=".\..\src\bridge.h"
>
</File>
<File
RelativePath=".\..\src\callback_table.h"
>
</File>
<File
RelativePath=".\..\src\cargo_type.h"
>
</File>
<File
RelativePath=".\..\src\cargopacket.h"
>
@@ -836,31 +804,31 @@
>
</File>
<File
RelativePath=".\..\src\cmd_helper.h"
>
</File>
<File
RelativePath=".\..\src\command_func.h"
>
</File>
<File
RelativePath=".\..\src\command_type.h"
RelativePath=".\..\src\command.h"
>
</File>
<File
RelativePath=".\..\src\console.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\currency.h"
>
</File>
<File
RelativePath=".\..\src\date_func.h"
>
</File>
<File
RelativePath=".\..\src\date_type.h"
RelativePath=".\..\src\date.h"
>
</File>
<File
@@ -876,11 +844,7 @@
>
</File>
<File
RelativePath=".\..\src\direction_func.h"
>
</File>
<File
RelativePath=".\..\src\direction_type.h"
RelativePath=".\..\src\direction.h"
>
</File>
<File
@@ -892,33 +856,13 @@
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\economy_func.h"
>
</File>
<File
RelativePath=".\..\src\economy_type.h"
>
</File>
<File
RelativePath=".\..\src\core\endian_func.hpp"
RelativePath=".\..\src\economy.h"
>
</File>
<File
RelativePath=".\..\src\engine.h"
>
</File>
<File
RelativePath=".\..\src\core\enum_type.hpp"
>
</File>
<File
RelativePath=".\..\src\fileio.h"
>
@@ -940,15 +884,7 @@
>
</File>
<File
RelativePath=".\..\src\core\geometry_type.hpp"
>
</File>
<File
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
RelativePath=".\..\src\gfx.h"
>
</File>
<File
@@ -959,10 +895,6 @@
RelativePath=".\..\src\group.h"
>
</File>
<File
RelativePath=".\..\src\group_gui.h"
>
</File>
<File
RelativePath=".\..\src\gui.h"
>
@@ -975,10 +907,6 @@
RelativePath=".\..\src\industry.h"
>
</File>
<File
RelativePath=".\..\src\industry_type.h"
>
</File>
<File
RelativePath=".\..\src\landscape.h"
>
@@ -988,7 +916,7 @@
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
RelativePath=".\..\src\map.h"
>
</File>
<File
@@ -1023,10 +951,6 @@
RelativePath=".\..\src\network\network_gui.h"
>
</File>
<File
RelativePath=".\..\src\network\network_internal.h"
>
</File>
<File
RelativePath=".\..\src\network\network_server.h"
>
@@ -1063,10 +987,6 @@
RelativePath=".\..\src\newgrf_engine.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.h"
>
@@ -1135,38 +1055,18 @@
RelativePath=".\..\src\openttd.h"
>
</File>
<File
RelativePath=".\..\src\order.h"
>
</File>
<File
RelativePath=".\..\src\core\overflowsafe_type.hpp"
>
</File>
<File
RelativePath=".\..\src\pathfind.h"
>
</File>
<File
RelativePath=".\..\src\player_base.h"
RelativePath=".\..\src\player.h"
>
</File>
<File
RelativePath=".\..\src\player_face.h"
>
</File>
<File
RelativePath=".\..\src\player_func.h"
>
</File>
<File
RelativePath=".\..\src\player_gui.h"
>
</File>
<File
RelativePath=".\..\src\player_type.h"
>
</File>
<File
RelativePath=".\..\src\queue.h"
>
@@ -1175,42 +1075,10 @@
RelativePath=".\..\src\rail.h"
>
</File>
<File
RelativePath=".\..\src\rail_gui.h"
>
</File>
<File
RelativePath=".\..\src\rail_type.h"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\road_cmd.h"
>
</File>
<File
RelativePath=".\..\src\road_func.h"
>
</File>
<File
RelativePath=".\..\src\road_gui.h"
>
</File>
<File
RelativePath=".\..\src\road_internal.h"
>
</File>
<File
RelativePath=".\..\src\road_type.h"
>
</File>
<File
RelativePath=".\..\src\roadveh.h"
>
</File>
<File
RelativePath=".\..\src\saveload.h"
>
@@ -1228,23 +1096,7 @@
>
</File>
<File
RelativePath=".\..\src\settings_func.h"
>
</File>
<File
RelativePath=".\..\src\settings_internal.h"
>
</File>
<File
RelativePath=".\..\src\settings_type.h"
>
</File>
<File
RelativePath=".\..\src\ship.h"
>
</File>
<File
RelativePath=".\..\src\signal_func.h"
RelativePath=".\..\src\settings.h"
>
</File>
<File
@@ -1252,19 +1104,15 @@
>
</File>
<File
RelativePath=".\..\src\slope_func.h"
RelativePath=".\..\src\signal_func.h"
>
</File>
<File
RelativePath=".\..\src\slope_type.h"
RelativePath=".\..\src\slope.h"
>
</File>
<File
RelativePath=".\..\src\sound_func.h"
>
</File>
<File
RelativePath=".\..\src\sound_type.h"
RelativePath=".\..\src\sound.h"
>
</File>
<File
@@ -1288,27 +1136,7 @@
>
</File>
<File
RelativePath=".\..\src\string_func.h"
>
</File>
<File
RelativePath=".\..\src\string_type.h"
>
</File>
<File
RelativePath=".\..\src\strings_func.h"
>
</File>
<File
RelativePath=".\..\src\strings_type.h"
>
</File>
<File
RelativePath=".\..\src\terraform_gui.h"
>
</File>
<File
RelativePath=".\..\src\textbuf_gui.h"
RelativePath=".\..\src\string.h"
>
</File>
<File
@@ -1324,11 +1152,7 @@
>
</File>
<File
RelativePath=".\..\src\tile_cmd.h"
>
</File>
<File
RelativePath=".\..\src\tile_type.h"
RelativePath=".\..\src\tile.h"
>
</File>
<File
@@ -1339,18 +1163,6 @@
RelativePath=".\..\src\town.h"
>
</File>
<File
RelativePath=".\..\src\town_type.h"
>
</File>
<File
RelativePath=".\..\src\track_func.h"
>
</File>
<File
RelativePath=".\..\src\track_type.h"
>
</File>
<File
RelativePath=".\..\src\train.h"
>
@@ -1363,24 +1175,12 @@
RelativePath=".\..\src\transparency_gui.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge.h"
>
</File>
<File
RelativePath=".\..\src\unmovable.h"
>
</File>
<File
RelativePath=".\..\src\variables.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_base.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_func.h"
RelativePath=".\..\src\vehicle.h"
>
</File>
<File
@@ -1388,7 +1188,7 @@
>
</File>
<File
RelativePath=".\..\src\vehicle_type.h"
RelativePath=".\..\src\viewport.h"
>
</File>
<File
@@ -1408,23 +1208,23 @@
>
</File>
<File
RelativePath=".\..\src\window_func.h"
RelativePath=".\..\src\window.h"
>
</File>
<File
RelativePath=".\..\src\window_gui.h"
RelativePath=".\..\src\widgets\dropdown.h"
>
</File>
<File
RelativePath=".\..\src\window_type.h"
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\zoom_func.h"
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom_type.h"
RelativePath=".\..\src\zoom.hpp"
>
</File>
</Filter>
@@ -1724,7 +1524,7 @@
>
</File>
<File
RelativePath=".\..\src\table\roadveh_movement.h"
RelativePath=".\..\src\table\roadveh.h"
>
</File>
<File
@@ -1943,10 +1743,6 @@
RelativePath=".\..\src\newgrf_engine.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.cpp"
>
@@ -2023,10 +1819,6 @@
RelativePath=".\..\src\station_map.h"
>
</File>
<File
RelativePath=".\..\src\tile_map.h"
>
</File>
<File
RelativePath=".\..\src\town_map.h"
>
@@ -2067,6 +1859,14 @@
RelativePath=".\..\src\misc\array.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\autocopyptr.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\autoptr.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\binaryheap.hpp"
>
@@ -2159,6 +1959,10 @@
<Filter
Name="YAPF"
>
<File
RelativePath=".\..\src\yapf\follow_track.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\follow_track.hpp"
>
@@ -2183,6 +1987,10 @@
RelativePath=".\..\src\yapf\yapf_base.hpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.hpp"
>

View File

@@ -33,6 +33,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -143,6 +145,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -239,6 +243,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -350,6 +356,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"

View File

@@ -4,7 +4,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openttd", "openttd_vs90.vcp
ProjectSection(ProjectDependencies) = postProject
{0F066B23-18DF-4284-8265-F4A5E7E3B966} = {0F066B23-18DF-4284-8265-F4A5E7E3B966}
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC} = {1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strgen", "strgen_vs90.vcproj", "{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}"
@@ -14,8 +13,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "langs", "langs_vs90.vcproj"
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version_vs90.vcproj", "{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -48,14 +45,6 @@ Global
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|Win32.Build.0 = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|x64.ActiveCfg = Debug|Win32
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release|x64.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|Win32.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|Win32.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|x64.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Debug|x64.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|Win32.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|Win32.Build.0 = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|x64.ActiveCfg = Debug|Win32
{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}.Release|x64.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -34,6 +34,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -142,6 +144,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -237,6 +241,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -347,6 +353,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -444,10 +452,6 @@
RelativePath=".\..\src\airport.cpp"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.cpp"
>
@@ -460,10 +464,6 @@
RelativePath=".\..\src\aystar.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\bmp.cpp"
>
@@ -492,6 +492,14 @@
RelativePath=".\..\src\console_cmds.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\currency.cpp"
>
@@ -516,10 +524,6 @@
RelativePath=".\..\src\driver.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\economy.cpp"
>
@@ -660,10 +664,6 @@
RelativePath=".\..\src\rail.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\rev.cpp"
>
@@ -748,6 +748,10 @@
RelativePath=".\..\src\widget.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\win32.cpp"
>
@@ -772,30 +776,10 @@
RelativePath=".\..\src\airport_movement.h"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_base.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_func.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_gui.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_type.h"
>
</File>
<File
RelativePath=".\..\src\autoslope.h"
>
@@ -804,26 +788,10 @@
RelativePath=".\..\src\aystar.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\bmp.h"
>
</File>
<File
RelativePath=".\..\src\bridge.h"
>
</File>
<File
RelativePath=".\..\src\callback_table.h"
>
</File>
<File
RelativePath=".\..\src\cargo_type.h"
>
</File>
<File
RelativePath=".\..\src\cargopacket.h"
>
@@ -833,31 +801,31 @@
>
</File>
<File
RelativePath=".\..\src\cmd_helper.h"
>
</File>
<File
RelativePath=".\..\src\command_func.h"
>
</File>
<File
RelativePath=".\..\src\command_type.h"
RelativePath=".\..\src\command.h"
>
</File>
<File
RelativePath=".\..\src\console.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\currency.h"
>
</File>
<File
RelativePath=".\..\src\date_func.h"
>
</File>
<File
RelativePath=".\..\src\date_type.h"
RelativePath=".\..\src\date.h"
>
</File>
<File
@@ -873,11 +841,7 @@
>
</File>
<File
RelativePath=".\..\src\direction_func.h"
>
</File>
<File
RelativePath=".\..\src\direction_type.h"
RelativePath=".\..\src\direction.h"
>
</File>
<File
@@ -889,33 +853,13 @@
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\economy_func.h"
>
</File>
<File
RelativePath=".\..\src\economy_type.h"
>
</File>
<File
RelativePath=".\..\src\core\endian_func.hpp"
RelativePath=".\..\src\economy.h"
>
</File>
<File
RelativePath=".\..\src\engine.h"
>
</File>
<File
RelativePath=".\..\src\core\enum_type.hpp"
>
</File>
<File
RelativePath=".\..\src\fileio.h"
>
@@ -937,15 +881,7 @@
>
</File>
<File
RelativePath=".\..\src\core\geometry_type.hpp"
>
</File>
<File
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
RelativePath=".\..\src\gfx.h"
>
</File>
<File
@@ -956,10 +892,6 @@
RelativePath=".\..\src\group.h"
>
</File>
<File
RelativePath=".\..\src\group_gui.h"
>
</File>
<File
RelativePath=".\..\src\gui.h"
>
@@ -972,10 +904,6 @@
RelativePath=".\..\src\industry.h"
>
</File>
<File
RelativePath=".\..\src\industry_type.h"
>
</File>
<File
RelativePath=".\..\src\landscape.h"
>
@@ -985,7 +913,7 @@
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
RelativePath=".\..\src\map.h"
>
</File>
<File
@@ -1020,10 +948,6 @@
RelativePath=".\..\src\network\network_gui.h"
>
</File>
<File
RelativePath=".\..\src\network\network_internal.h"
>
</File>
<File
RelativePath=".\..\src\network\network_server.h"
>
@@ -1060,10 +984,6 @@
RelativePath=".\..\src\newgrf_engine.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.h"
>
@@ -1132,38 +1052,18 @@
RelativePath=".\..\src\openttd.h"
>
</File>
<File
RelativePath=".\..\src\order.h"
>
</File>
<File
RelativePath=".\..\src\core\overflowsafe_type.hpp"
>
</File>
<File
RelativePath=".\..\src\pathfind.h"
>
</File>
<File
RelativePath=".\..\src\player_base.h"
RelativePath=".\..\src\player.h"
>
</File>
<File
RelativePath=".\..\src\player_face.h"
>
</File>
<File
RelativePath=".\..\src\player_func.h"
>
</File>
<File
RelativePath=".\..\src\player_gui.h"
>
</File>
<File
RelativePath=".\..\src\player_type.h"
>
</File>
<File
RelativePath=".\..\src\queue.h"
>
@@ -1172,42 +1072,10 @@
RelativePath=".\..\src\rail.h"
>
</File>
<File
RelativePath=".\..\src\rail_gui.h"
>
</File>
<File
RelativePath=".\..\src\rail_type.h"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\road_cmd.h"
>
</File>
<File
RelativePath=".\..\src\road_func.h"
>
</File>
<File
RelativePath=".\..\src\road_gui.h"
>
</File>
<File
RelativePath=".\..\src\road_internal.h"
>
</File>
<File
RelativePath=".\..\src\road_type.h"
>
</File>
<File
RelativePath=".\..\src\roadveh.h"
>
</File>
<File
RelativePath=".\..\src\saveload.h"
>
@@ -1225,23 +1093,7 @@
>
</File>
<File
RelativePath=".\..\src\settings_func.h"
>
</File>
<File
RelativePath=".\..\src\settings_internal.h"
>
</File>
<File
RelativePath=".\..\src\settings_type.h"
>
</File>
<File
RelativePath=".\..\src\ship.h"
>
</File>
<File
RelativePath=".\..\src\signal_func.h"
RelativePath=".\..\src\settings.h"
>
</File>
<File
@@ -1249,19 +1101,15 @@
>
</File>
<File
RelativePath=".\..\src\slope_func.h"
RelativePath=".\..\src\signal_func.h"
>
</File>
<File
RelativePath=".\..\src\slope_type.h"
RelativePath=".\..\src\slope.h"
>
</File>
<File
RelativePath=".\..\src\sound_func.h"
>
</File>
<File
RelativePath=".\..\src\sound_type.h"
RelativePath=".\..\src\sound.h"
>
</File>
<File
@@ -1285,27 +1133,7 @@
>
</File>
<File
RelativePath=".\..\src\string_func.h"
>
</File>
<File
RelativePath=".\..\src\string_type.h"
>
</File>
<File
RelativePath=".\..\src\strings_func.h"
>
</File>
<File
RelativePath=".\..\src\strings_type.h"
>
</File>
<File
RelativePath=".\..\src\terraform_gui.h"
>
</File>
<File
RelativePath=".\..\src\textbuf_gui.h"
RelativePath=".\..\src\string.h"
>
</File>
<File
@@ -1321,11 +1149,7 @@
>
</File>
<File
RelativePath=".\..\src\tile_cmd.h"
>
</File>
<File
RelativePath=".\..\src\tile_type.h"
RelativePath=".\..\src\tile.h"
>
</File>
<File
@@ -1336,18 +1160,6 @@
RelativePath=".\..\src\town.h"
>
</File>
<File
RelativePath=".\..\src\town_type.h"
>
</File>
<File
RelativePath=".\..\src\track_func.h"
>
</File>
<File
RelativePath=".\..\src\track_type.h"
>
</File>
<File
RelativePath=".\..\src\train.h"
>
@@ -1360,24 +1172,12 @@
RelativePath=".\..\src\transparency_gui.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge.h"
>
</File>
<File
RelativePath=".\..\src\unmovable.h"
>
</File>
<File
RelativePath=".\..\src\variables.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_base.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_func.h"
RelativePath=".\..\src\vehicle.h"
>
</File>
<File
@@ -1385,7 +1185,7 @@
>
</File>
<File
RelativePath=".\..\src\vehicle_type.h"
RelativePath=".\..\src\viewport.h"
>
</File>
<File
@@ -1405,23 +1205,23 @@
>
</File>
<File
RelativePath=".\..\src\window_func.h"
RelativePath=".\..\src\window.h"
>
</File>
<File
RelativePath=".\..\src\window_gui.h"
RelativePath=".\..\src\widgets\dropdown.h"
>
</File>
<File
RelativePath=".\..\src\window_type.h"
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\zoom_func.h"
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom_type.h"
RelativePath=".\..\src\zoom.hpp"
>
</File>
</Filter>
@@ -1721,7 +1521,7 @@
>
</File>
<File
RelativePath=".\..\src\table\roadveh_movement.h"
RelativePath=".\..\src\table\roadveh.h"
>
</File>
<File
@@ -1940,10 +1740,6 @@
RelativePath=".\..\src\newgrf_engine.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.cpp"
>
@@ -2020,10 +1816,6 @@
RelativePath=".\..\src\station_map.h"
>
</File>
<File
RelativePath=".\..\src\tile_map.h"
>
</File>
<File
RelativePath=".\..\src\town_map.h"
>
@@ -2064,6 +1856,14 @@
RelativePath=".\..\src\misc\array.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\autocopyptr.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\autoptr.hpp"
>
</File>
<File
RelativePath=".\..\src\misc\binaryheap.hpp"
>
@@ -2156,6 +1956,10 @@
<Filter
Name="YAPF"
>
<File
RelativePath=".\..\src\yapf\follow_track.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\follow_track.hpp"
>
@@ -2180,6 +1984,10 @@
RelativePath=".\..\src\yapf\yapf_base.hpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.hpp"
>

View File

@@ -34,6 +34,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -142,6 +144,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -237,6 +241,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -347,6 +353,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCCustomBuildTool"

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Release|Win32"
>
<DebugSettings
WorkingDirectory="..\bin"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
WorkingDirectory="..\bin"
/>
</Configuration>
<Configuration
Name="Release|x64"
>
<DebugSettings
WorkingDirectory="..\bin"
/>
</Configuration>
<Configuration
Name="Debug|x64"
>
<DebugSettings
WorkingDirectory="..\bin"
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

101
projects/strgen.vcproj Normal file
View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="strgen"
RootNamespace="strgen"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="..\objs\strgen\"
IntermediateDirectory="..\objs\strgen\"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
GlobalOptimizations="TRUE"
FavorSizeOrSpeed="2"
PreprocessorDefinitions="STRGEN;WIN32;NDEBUG;_CONSOLE"
BasicRuntimeChecks="0"
RuntimeLibrary="5"
PrecompiledHeaderFile=""
AssemblerOutput="2"
AssemblerListingLocation="$(IntDir)"
ObjectFile="$(IntDir)"
ProgramDataBaseFileName="$(IntDir)\$(TargetName).pdb"
WarningLevel="3"
WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(IntDir)\strgen.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(IntDir)\strgen.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/strgen.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\src\strgen\strgen.cpp">
</File>
<File
RelativePath="..\src\string.cpp">
</File>
</Filter>
<File
RelativePath="..\src\macros.h">
</File>
<File
RelativePath="..\src\stdafx.h">
</File>
<File
RelativePath="..\src\string.h">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -112,10 +112,6 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath="..\src\strgen\strgen.cpp"
>
@@ -126,19 +122,7 @@
</File>
</Filter>
<File
RelativePath="..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath="..\src\table\control_codes.h"
>
</File>
<File
RelativePath="..\src\debug.h"
>
</File>
<File
RelativePath="..\src\core\endian_func.hpp"
RelativePath="..\src\macros.h"
>
</File>
<File

View File

@@ -112,10 +112,6 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath="..\src\strgen\strgen.cpp"
>
@@ -126,19 +122,7 @@
</File>
</Filter>
<File
RelativePath="..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath="..\src\table\control_codes.h"
>
</File>
<File
RelativePath="..\src\debug.h"
>
</File>
<File
RelativePath="..\src\core\endian_func.hpp"
RelativePath="..\src\macros.h"
>
</File>
<File

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="version"
ProjectGUID="{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}"
RootNamespace="version"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\src\rev.cpp.in"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="version"
ProjectGUID="{1A2B3C5E-1C23-41A5-9C9B-ACBA2AA75FEC}"
RootNamespace="version"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="Determining version number"
CommandLine="&quot;$(InputDir)/determineversion.vbs&quot;"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\src\rev.cpp.in"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,6 +1,6 @@
OpenTTD README
Last updated: 2008-10-01
Release version: 0.6.3
Last updated: 2008-01-16
Release version: 0.6.0-beta3
------------------------------------------------------------------------
@@ -11,9 +11,6 @@ Table of Contents:
* 2.1 Reporting Bugs
3.0) Supported Platforms
4.0) Installing and running OpenTTD
* 4.1 (Required) 3rd party files
* 4.2 OpenTTD directories
* 4.3 Portable Installations (External Media)
5.0) OpenTTD features
6.0) Configuration File
7.0) Compiling
@@ -91,100 +88,25 @@ 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)
4.1) (Required) 3rd party files:
---- ---------------------------
Before you run OpenTTD, you need to put the game's datafiles into a data/
directory which can be located in various places addressed in the following
section.
As OpenTTD makes use of the original TTD artwork you will need the files listed
below, which you can find on a Transport Tycoon Deluxe CD-ROM.
The Windows installer optionally can copy these files from that CD-ROM.
Before you run OpenTTD, you need to put the game's datafiles into the data/
subdirectory. You need the following files from the original version
of TTD as OpenTTD makes use of the original TTD artwork. The Windows
installer optionally can copy these files from your Transport Tycoon Deluxe
CD-ROM.
List of the required files:
- sample.cat
- trg1r.grf
- trgcr.grf
- trghr.grf
- trgir.grf
- trgtr.grf
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
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF,
TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF.
If you want the TTD music, copy the gm/ folder from the Windows version
of TTD to your OpenTTD folder (not your data folder - also explained in
the following sections).
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.2) OpenTTD directories
---- -------------------------------
The TTD artwork files listed in the section 4.1 "(Required) 3rd party files"
can be placed in a few different locations:
1. The current working directory (from where you started OpenTTD)
2. Your personal directory
Windows: C:\Documents and Settings\<username>\My Documents\OpenTTD
Mac OSX: ~/Documents/OpenTTD
Linux: ~/.openttd
3. The shared directory
Windows: C:\Documents and Settings\All Users\Documents\OpenTTD
Mac OSX: /Library/Application Support/OpenTTD
Linux: not available
4. The binary directory (where the OpenTTD executable is)
Windows: C:\Program Files\OpenTTD
Linux: /usr/games
5. The installation directory (Linux only)
Linux: /usr/share/games/openttd
6. The application bundle (Mac OSX only)
It includes the OTTD files (grf+lng) and it will work as long as they aren't touched
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.
- 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.
The prefered setup:
Place 3rd party files in shared directory (or in personal directory if you don't
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 (External 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), data/ 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 data/ dir (for details,
again, see section 4.1).
If you want music you need to copy the gm/ folder from Windows TTD into your
OpenTTD folder, not your data folder.
5.0) OpenTTD features:
@@ -363,7 +285,6 @@ The OpenTTD team (in alphabetical order):
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles
Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework
Loïc Guilloux (glx) - General coding
Christoph Elsenhans (frosch) - General coding
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
Jonathan Coome (Maedhros) - High priest of the newGRF Temple
Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host

View File

@@ -1,10 +1,8 @@
# Source Files
airport.cpp
core/alloc_func.cpp
articulated_vehicles.cpp
autoreplace_cmd.cpp
aystar.cpp
core/bitmath_func.cpp
bmp.cpp
callback_table.cpp
cargopacket.cpp
@@ -12,13 +10,14 @@ cargotype.cpp
command.cpp
console.cpp
console_cmds.cpp
core/bitmath_func.cpp
core/random_func.cpp
currency.cpp
date.cpp
debug.cpp
dedicated.cpp
depot.cpp
driver.cpp
widgets/dropdown.cpp
economy.cpp
elrail.cpp
engine.cpp
@@ -59,7 +58,6 @@ pathfind.cpp
players.cpp
queue.cpp
rail.cpp
core/random_func.cpp
rev.cpp
road.cpp
saveload.cpp
@@ -95,6 +93,7 @@ vehicle.cpp
viewport.cpp
waypoint.cpp
widget.cpp
widgets/dropdown.cpp
#if WIN32
win32.cpp
#end
@@ -104,60 +103,41 @@ window.cpp
aircraft.h
airport.h
airport_movement.h
core/alloc_func.hpp
articulated_vehicles.h
autoreplace_base.h
autoreplace_func.h
autoreplace_gui.h
autoreplace_type.h
autoslope.h
aystar.h
core/bitmath_func.hpp
bmp.h
bridge.h
callback_table.h
cargo_type.h
cargopacket.h
cargotype.h
cmd_helper.h
command_func.h
command_type.h
command.h
console.h
core/bitmath_func.hpp
core/math_func.hpp
core/random_func.hpp
currency.h
date_func.h
date_type.h
date.h
debug.h
video/dedicated_v.h
depot.h
direction_func.h
direction_type.h
direction.h
music/dmusic.h
driver.h
widgets/dropdown_func.h
widgets/dropdown_type.h
economy_func.h
economy_type.h
core/endian_func.hpp
economy.h
engine.h
core/enum_type.hpp
fileio.h
fios.h
fontcache.h
functions.h
genworld.h
core/geometry_type.hpp
gfx_func.h
gfx_type.h
gfx.h
gfxinit.h
group.h
group_gui.h
gui.h
heightmap.h
industry.h
industry_type.h
landscape.h
livery.h
core/math_func.hpp
map.h
md5.h
mixer.h
music.h
@@ -166,7 +146,6 @@ network/network_client.h
network/network_data.h
network/network_gamelist.h
network/network_gui.h
network/network_internal.h
network/network_server.h
network/network_udp.h
newgrf.h
@@ -176,7 +155,6 @@ newgrf_cargo.h
newgrf_commons.h
newgrf_config.h
newgrf_engine.h
newgrf_generic.h
newgrf_house.h
newgrf_industries.h
newgrf_industrytiles.h
@@ -194,79 +172,49 @@ sound/null_s.h
video/null_v.h
oldpool.h
openttd.h
order.h
core/overflowsafe_type.hpp
pathfind.h
player_base.h
player.h
player_face.h
player_func.h
player_gui.h
player_type.h
queue.h
rail.h
rail_gui.h
rail_type.h
core/random_func.hpp
road_cmd.h
road_func.h
road_gui.h
road_internal.h
road_type.h
roadveh.h
saveload.h
screenshot.h
sound/sdl_s.h
video/sdl_v.h
settings_func.h
settings_internal.h
settings_type.h
ship.h
signal_func.h
settings.h
signs.h
slope_func.h
slope_type.h
sound_func.h
sound_type.h
signal_func.h
slope.h
sound.h
sprite.h
spritecache.h
station.h
station_gui.h
stdafx.h
string_func.h
string_type.h
strings_func.h
strings_type.h
terraform_gui.h
textbuf_gui.h
string.h
texteff.hpp
tgp.h
thread.h
tile_cmd.h
tile_type.h
tile.h
timetable.h
town.h
town_type.h
track_func.h
track_type.h
train.h
transparency.h
transparency_gui.h
tunnelbridge.h
unmovable.h
variables.h
vehicle_base.h
vehicle_func.h
vehicle.h
vehicle_gui.h
vehicle_type.h
viewport.h
waypoint.h
music/win32_m.h
sound/win32_s.h
video/win32_v.h
window_func.h
window_gui.h
window_type.h
zoom_func.h
zoom_type.h
window.h
widgets/dropdown.h
widgets/dropdown_type.h
widgets/dropdown_func.h
zoom.hpp
# GUI Source Code
aircraft_gui.cpp
@@ -344,7 +292,7 @@ table/landscape_sprite.h
table/namegen.h
table/palettes.h
table/road_land.h
table/roadveh_movement.h
table/roadveh.h
table/sprites.h
table/station_land.h
../objs/langs/table/strings.h
@@ -406,7 +354,6 @@ newgrf_cargo.cpp
newgrf_commons.cpp
newgrf_config.cpp
newgrf_engine.cpp
newgrf_generic.cpp
newgrf_house.cpp
newgrf_industries.cpp
newgrf_industrytiles.cpp
@@ -427,7 +374,6 @@ rail_map.h
road_map.cpp
road_map.h
station_map.h
tile_map.h
town_map.h
tree_map.h
tunnel_map.cpp
@@ -439,6 +385,8 @@ water_map.h
# Misc
misc/array.hpp
misc/autocopyptr.hpp
misc/autoptr.hpp
misc/binaryheap.hpp
misc/blob.hpp
misc/countedptr.hpp
@@ -464,12 +412,14 @@ network/core/udp.cpp
network/core/udp.h
# YAPF
yapf/follow_track.cpp
yapf/follow_track.hpp
yapf/nodelist.hpp
yapf/track_dir.hpp
yapf/yapf.h
yapf/yapf.hpp
yapf/yapf_base.hpp
yapf/yapf_common.cpp
yapf/yapf_common.hpp
yapf/yapf_costbase.hpp
yapf/yapf_costcache.hpp

View File

@@ -10,8 +10,6 @@
#include "../player_base.h"
#include "ai.h"
#include "default/default.h"
#include "trolly/trolly.h"
#include "../signal_func.h"
AIStruct _ai;
AIPlayer _ai_player[MAX_PLAYERS];
@@ -161,9 +159,6 @@ static void AI_RunTick(PlayerID player)
AiDoGameLoop(p);
_is_old_ai_player = false;
}
/* AI could change some track, so update signals */
UpdateSignalsInBuffer();
}
@@ -224,13 +219,6 @@ void AI_PlayerDied(PlayerID player)
{
/* Called if this AI died */
_ai_player[player].active = false;
if (_players_ainew[player].pathfinder == NULL) return;
AyStarMain_Free(_players_ainew[player].pathfinder);
delete _players_ainew[player].pathfinder;
_players_ainew[player].pathfinder = NULL;
}
/**
@@ -252,5 +240,9 @@ void AI_Initialize()
*/
void AI_Uninitialize()
{
for (PlayerID p = PLAYER_FIRST; p < MAX_PLAYERS; p++) AI_PlayerDied(p);
const Player* p;
FOR_ALL_PLAYERS(p) {
if (p->is_active && p->is_ai) AI_PlayerDied(p->index);
}
}

View File

@@ -31,7 +31,6 @@
#include "../../player_base.h"
#include "../../settings_type.h"
#include "default.h"
#include "../../tunnelbridge.h"
#include "../../table/ai_rail.h"
@@ -69,9 +68,10 @@ enum {
};
static inline TrackBits GetRailTrackStatus(TileIndex tile)
static TrackBits GetRailTrackStatus(TileIndex tile)
{
return TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0));
uint32 r = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0);
return (TrackBits)(byte) (r | r >> 8);
}
@@ -111,8 +111,8 @@ static void AiStateVehLoop(Player *p)
/* not profitable? */
if (v->age >= 730 &&
v->profit_last_year < _price.station_value * 5 * 256 &&
v->profit_this_year < _price.station_value * 5 * 256) {
v->profit_last_year < _price.station_value * 5 &&
v->profit_this_year < _price.station_value * 5) {
_players_ai[p->index].state_counter = 0;
_players_ai[p->index].state = AIS_SELL_VEHICLE;
_players_ai[p->index].cur_veh = v;
@@ -139,9 +139,10 @@ static EngineID AiChooseTrainToBuild(RailType railtype, Money money, byte flag,
{
EngineID best_veh_index = INVALID_ENGINE;
byte best_veh_score = 0;
CommandCost ret;
EngineID i;
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_TRAIN) {
for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
const RailVehicleInfo *rvi = RailVehInfo(i);
const Engine* e = GetEngine(i);
@@ -153,10 +154,7 @@ static EngineID AiChooseTrainToBuild(RailType railtype, Money money, byte flag,
continue;
}
/* Don't choose an engine designated for passenger use for freight. */
if (rvi->ai_passenger_only != 0 && flag == 1) continue;
CommandCost ret = DoCommand(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE);
ret = DoCommand(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE);
if (CmdSucceeded(ret) && ret.GetCost() <= money && rvi->ai_rank >= best_veh_score) {
best_veh_score = rvi->ai_rank;
best_veh_index = i;
@@ -170,11 +168,14 @@ static EngineID AiChooseRoadVehToBuild(CargoID cargo, Money money, TileIndex til
{
EngineID best_veh_index = INVALID_ENGINE;
int32 best_veh_rating = 0;
EngineID i;
EngineID i = ROAD_ENGINES_INDEX;
EngineID end = i + NUM_ROAD_ENGINES;
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_ROAD) {
for (; i != end; i++) {
const RoadVehicleInfo *rvi = RoadVehInfo(i);
const Engine* e = GetEngine(i);
int32 rating;
CommandCost ret;
if (!HasBit(e->player_avail, _current_player) || e->reliability < 0x8A3D) {
continue;
@@ -184,10 +185,10 @@ static EngineID AiChooseRoadVehToBuild(CargoID cargo, Money money, TileIndex til
if (rvi->cargo_type != cargo && !CanRefitTo(i, cargo)) continue;
/* Rate and compare the engine by speed & capacity */
int rating = rvi->max_speed * rvi->capacity;
rating = rvi->max_speed * rvi->capacity;
if (rating <= best_veh_rating) continue;
CommandCost ret = DoCommand(tile, i, 0, 0, CMD_BUILD_ROAD_VEH);
ret = DoCommand(tile, i, 0, 0, CMD_BUILD_ROAD_VEH);
if (CmdFailed(ret)) continue;
/* Add the cost of refitting */
@@ -201,28 +202,23 @@ static EngineID AiChooseRoadVehToBuild(CargoID cargo, Money money, TileIndex til
return best_veh_index;
}
/**
* Choose aircraft to build.
* @param money current AI money
* @param forbidden forbidden flags - AIR_HELI = 0 (always allowed), AIR_CTOL = 1 (bit 0), AIR_FAST = 2 (bit 1)
* @return EngineID of aircraft to build
*/
static EngineID AiChooseAircraftToBuild(Money money, byte forbidden)
static EngineID AiChooseAircraftToBuild(Money money, byte flag)
{
EngineID best_veh_index = INVALID_ENGINE;
Money best_veh_cost = 0;
EngineID i;
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_AIRCRAFT) {
for (i = AIRCRAFT_ENGINES_INDEX; i != AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; i++) {
const Engine* e = GetEngine(i);
CommandCost ret;
if (!HasBit(e->player_avail, _current_player) || e->reliability < 0x8A3D) {
continue;
}
if ((AircraftVehInfo(i)->subtype & forbidden) != 0) continue;
if ((AircraftVehInfo(i)->subtype & AIR_CTOL) != flag) continue;
CommandCost ret = DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT);
ret = DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT);
if (CmdSucceeded(ret) && ret.GetCost() <= money && ret.GetCost() >= best_veh_cost) {
best_veh_cost = ret.GetCost();
best_veh_index = i;
@@ -257,24 +253,8 @@ static EngineID AiChooseRoadVehToReplaceWith(const Player* p, const Vehicle* v)
static EngineID AiChooseAircraftToReplaceWith(const Player* p, const Vehicle* v)
{
Money avail_money = p->player_money + v->value;
/* determine forbidden aircraft bits */
byte forbidden = 0;
const Order *o;
FOR_VEHICLE_ORDERS(v, o) {
if (!o->IsValid()) continue;
if (!IsValidStationID(o->dest)) continue;
const Station *st = GetStation(o->dest);
if (!(st->facilities & FACIL_AIRPORT)) continue;
AirportFTAClass::Flags flags = st->Airport()->flags;
if (!(flags & AirportFTAClass::AIRPLANES)) forbidden |= AIR_CTOL | AIR_FAST; // no planes for heliports / oil rigs
if (flags & AirportFTAClass::SHORT_STRIP) forbidden |= AIR_FAST; // no fast planes for small airports
}
return AiChooseAircraftToBuild(
avail_money, forbidden
avail_money, AircraftVehInfo(v->engine_type)->subtype & AIR_CTOL
);
}
@@ -317,9 +297,9 @@ static void AiHandleGotoDepot(Player *p, int cmd)
static void AiRestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak)
{
if (bak->order == NULL) return;
uint i;
for (uint i = 0; bak->order[i].type != OT_NOTHING; i++) {
for (i = 0; bak->order[i].type != OT_NOTHING; i++) {
if (!DoCommandP(0, v->index + (i << 16), PackOrder(&bak->order[i]), NULL, CMD_INSERT_ORDER | CMD_NO_TEST_IF_IN_NETWORK))
break;
}
@@ -358,7 +338,7 @@ static void AiHandleReplaceTrain(Player *p)
static void AiHandleReplaceRoadVeh(Player *p)
{
const Vehicle* v = _players_ai[p->index].cur_veh;
BackuppedOrders orderbak;
BackuppedOrders orderbak[1];
EngineID veh;
if (!v->IsStoppedInDepot()) {
@@ -370,14 +350,14 @@ static void AiHandleReplaceRoadVeh(Player *p)
if (veh != INVALID_ENGINE) {
TileIndex tile;
BackupVehicleOrders(v, &orderbak);
BackupVehicleOrders(v, orderbak);
tile = v->tile;
if (CmdSucceeded(DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH)) &&
CmdSucceeded(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_ROAD_VEH))) {
VehicleID veh = _new_vehicle_id;
AiRestoreVehicleOrders(GetVehicle(veh), &orderbak);
AiRestoreVehicleOrders(GetVehicle(veh), orderbak);
DoCommand(0, veh, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
DoCommand(0, veh, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
}
@@ -387,7 +367,7 @@ static void AiHandleReplaceRoadVeh(Player *p)
static void AiHandleReplaceAircraft(Player *p)
{
const Vehicle* v = _players_ai[p->index].cur_veh;
BackuppedOrders orderbak;
BackuppedOrders orderbak[1];
EngineID veh;
if (!v->IsStoppedInDepot()) {
@@ -399,13 +379,13 @@ static void AiHandleReplaceAircraft(Player *p)
if (veh != INVALID_ENGINE) {
TileIndex tile;
BackupVehicleOrders(v, &orderbak);
BackupVehicleOrders(v, orderbak);
tile = v->tile;
if (CmdSucceeded(DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT)) &&
CmdSucceeded(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_AIRCRAFT))) {
VehicleID veh = _new_vehicle_id;
AiRestoreVehicleOrders(GetVehicle(veh), &orderbak);
AiRestoreVehicleOrders(GetVehicle(veh), orderbak);
DoCommand(0, veh, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
DoCommand(0, veh, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
@@ -1389,7 +1369,7 @@ static void AiWantPassengerAircraftRoute(Player *p)
/* Get aircraft that would be bought for this route
* (probably, as conditions may change before the route is fully built,
* like running out of money and having to select different aircraft, etc ...) */
EngineID veh = AiChooseAircraftToBuild(p->player_money, _players_ai[p->index].build_kind != 0 ? AIR_CTOL : 0);
EngineID veh = AiChooseAircraftToBuild(p->player_money, _players_ai[p->index].build_kind != 0 ? 0 : AIR_CTOL);
/* No aircraft buildable mean no aircraft route */
if (veh == INVALID_ENGINE) return;
@@ -1603,7 +1583,7 @@ static void AiStateWantNewRoute(Player *p)
static bool AiCheckTrackResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
{
uint rad = (_patches.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
uint rad = (_patches.modified_catchment) ? CA_TRAIN : 4;
for (; p->mode != 4; p++) {
AcceptedCargo values;
@@ -1901,7 +1881,7 @@ struct AiRailPathFindData {
bool flag;
};
static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length)
static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
{
if (a->flag) return true;
@@ -1923,7 +1903,7 @@ static bool AiDoFollowTrack(const Player* p)
arpfd.tile2 = _players_ai[p->index].cur_tile_a;
arpfd.flag = false;
arpfd.count = 0;
FollowTrack(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a), TRANSPORT_RAIL, 0, ReverseDiagDir(_players_ai[p->index].cur_dir_a),
FollowTrack(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a), 0x2000 | TRANSPORT_RAIL, 0, ReverseDiagDir(_players_ai[p->index].cur_dir_a),
(TPFEnumProc*)AiEnumFollowTrack, NULL, &arpfd);
return arpfd.count > 8;
}
@@ -2197,55 +2177,26 @@ static void AiBuildRailConstruct(Player *p)
_players_ai[p->index].cur_tile_a += TileOffsByDiagDir(_players_ai[p->index].cur_dir_a);
if (arf.best_ptr[0] & 0x80) {
TileIndex t1 = _players_ai[p->index].cur_tile_a;
TileIndex t2 = arf.bridge_end_tile;
int i;
int32 bridge_len = GetBridgeLength(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a);
int32 bridge_len = GetTunnelBridgeLength(t1, t2);
DiagDirection dir = (TileX(t1) == TileX(t2) ? DIAGDIR_SE : DIAGDIR_SW);
Track track = AxisToTrack(DiagDirToAxis(dir));
if (t2 < t1) dir = ReverseDiagDir(dir);
/* try to build a long rail instead of bridge... */
bool fail = false;
CommandCost cost;
TileIndex t = t1;
/* try to build one rail on each tile - can't use CMD_BUILD_RAILROAD_TRACK now, it can build one part of track without failing */
do {
cost = DoCommand(t, _players_ai[p->index].railtype_to_use, track, DC_AUTO | DC_NO_WATER, CMD_BUILD_SINGLE_RAIL);
/* do not allow building over existing track */
if (CmdFailed(cost) || IsTileType(t, MP_RAILWAY)) {
fail = true;
break;
/* Figure out which (rail)bridge type to build
* start with best bridge, then go down to worse and worse bridges
* unnecessary to check for worst bridge (i=0), since AI will always build
* that. AI is so fucked up that fixing this small thing will probably not
* solve a thing
*/
for (i = MAX_BRIDGES - 1; i != 0; i--) {
if (CheckBridge_Stuff(i, bridge_len)) {
CommandCost cost = DoCommand(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO, CMD_BUILD_BRIDGE);
if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 5)) break;
}
t += TileOffsByDiagDir(dir);
} while (t != t2);
/* can we build long track? */
if (!fail) cost = DoCommand(t1, t2, _players_ai[p->index].railtype_to_use | (track << 4), DC_AUTO | DC_NO_WATER, CMD_BUILD_RAILROAD_TRACK);
if (!fail && CmdSucceeded(cost) && cost.GetCost() <= p->player_money) {
DoCommand(t1, t2, _players_ai[p->index].railtype_to_use | (track << 4), DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_BUILD_RAILROAD_TRACK);
} else {
/* Figure out which (rail)bridge type to build
* start with best bridge, then go down to worse and worse bridges
* unnecessary to check for worst bridge (i=0), since AI will always build that. */
int i;
for (i = MAX_BRIDGES - 1; i != 0; i--) {
if (CheckBridge_Stuff(i, bridge_len)) {
CommandCost cost = DoCommand(t1, t2, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO, CMD_BUILD_BRIDGE);
if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 1) && cost.GetCost() < ((p->player_money + _economy.max_loan - p->current_loan) >> 5)) break;
}
}
/* Build it */
DoCommand(t1, t2, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
}
_players_ai[p->index].cur_tile_a = t2;
// Build it
DoCommand(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
_players_ai[p->index].cur_tile_a = arf.bridge_end_tile;
_players_ai[p->index].state_counter = 0;
} else if (arf.best_ptr[0] & 0x40) {
// tunnel
@@ -2282,7 +2233,7 @@ static bool AiRemoveTileAndGoForward(Player *p)
return false;
_players_ai[p->index].cur_tile_a = TILE_MASK(_build_tunnel_endtile - TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
return true;
} else { // IsBridge(tile)
} else {
// Check if the bridge points in the right direction.
// This is not really needed the first place AiRemoveTileAndGoForward is called.
if (DiagDirToAxis(GetTunnelBridgeDirection(tile)) != (_players_ai[p->index].cur_dir_a & 1)) return false;
@@ -2667,7 +2618,8 @@ static CommandCost AiDoBuildDefaultRoadBlock(TileIndex tile, const AiDefaultBloc
_cleared_town = NULL;
if (p->mode == 2) {
if (IsNormalRoadTile(c) &&
if (IsTileType(c, MP_ROAD) &&
GetRoadTileType(c) == ROAD_TILE_NORMAL &&
(GetRoadBits(c, ROADTYPE_ROAD) & p->attr) != 0) {
roadflag |= 2;
@@ -2709,7 +2661,7 @@ clear_town_stuff:;
if (GetTileSlope(c, NULL) != SLOPE_FLAT) return CMD_ERROR;
if (!IsNormalRoadTile(c)) {
if (!IsTileType(c, MP_ROAD) || GetRoadTileType(c) != ROAD_TILE_NORMAL) {
ret = DoCommand(c, 0, 0, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) return CMD_ERROR;
}
@@ -2877,14 +2829,14 @@ static bool AiCheckRoadPathBetter(AiRoadFinder *arf, const byte *p)
}
static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint length)
static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint length, byte *state)
{
uint dist = DistanceManhattan(tile, a->dest);
if (dist <= a->best_dist) {
TileIndex tile2 = TILE_MASK(tile + TileOffsByDiagDir(_dir_by_track[track]));
if (IsNormalRoadTile(tile2)) {
if (IsTileType(tile2, MP_ROAD) && GetRoadTileType(tile2) == ROAD_TILE_NORMAL) {
a->best_dist = dist;
a->best_tile = tile;
a->best_track = track;
@@ -2912,14 +2864,14 @@ static bool AiCheckRoadFinished(Player *p)
tile = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(dir));
if (IsRoadStopTile(tile) || IsTileDepotType(tile, TRANSPORT_ROAD)) return false;
bits = TrackStatusToTrackdirBits(GetTileTrackStatus(tile, TRANSPORT_ROAD, ROADTYPES_ROAD)) & _ai_road_table_and[dir];
bits = GetTileTrackStatus(tile, TRANSPORT_ROAD, ROADTYPES_ROAD) & _ai_road_table_and[dir];
if (bits == 0) return false;
are.best_dist = (uint)-1;
uint i;
FOR_EACH_SET_BIT(i, bits) {
FollowTrack(tile, 0x1000 | TRANSPORT_ROAD, ROADTYPES_ROAD, (DiagDirection)_dir_by_track[i], (TPFEnumProc*)AiEnumFollowRoad, NULL, &are);
FollowTrack(tile, 0x3000 | TRANSPORT_ROAD, ROADTYPES_ROAD, (DiagDirection)_dir_by_track[i], (TPFEnumProc*)AiEnumFollowRoad, NULL, &are);
}
if (DistanceManhattan(tile, are.dest) <= are.best_dist) return false;
@@ -2966,7 +2918,7 @@ static inline void AiCheckBuildRoadBridgeHere(AiRoadFinder *arf, TileIndex tile,
tile_new = TILE_MASK(tile_new + TileOffsByDiagDir(dir2));
type = GetTileType(tile_new);
if (type == MP_CLEAR || type == MP_TREES || GetTileSlope(tile_new, NULL) != SLOPE_FLAT) {
if (type == MP_CLEAR || type == MP_TREES || GetTileSlope(tile, NULL) != SLOPE_FLAT) {
// Allow a bridge if either we have a tile that's water, rail or street,
// or if we found an up tile.
if (!flag) return;
@@ -3115,36 +3067,26 @@ do_some_terraform:
tile = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
if (arf.best_ptr[0] & 0x80) {
TileIndex t1 = tile;
TileIndex t2 = arf.bridge_end_tile;
int i;
int32 bridge_len;
_players_ai[p->index].cur_tile_a = arf.bridge_end_tile;
bridge_len = GetBridgeLength(tile, _players_ai[p->index].cur_tile_a); // tile
int32 bridge_len = GetTunnelBridgeLength(t1, t2);
Axis axis = (TileX(t1) == TileX(t2) ? AXIS_Y : AXIS_X);
/* try to build a long road instead of bridge - CMD_BUILD_LONG_ROAD has to fail if it couldn't build at least one piece! */
CommandCost cost = DoCommand(t2, t1, (t2 < t1 ? 1 : 2) | (axis << 2) | (ROADTYPE_ROAD << 3), DC_AUTO | DC_NO_WATER, CMD_BUILD_LONG_ROAD);
if (CmdSucceeded(cost) && cost.GetCost() <= p->player_money) {
DoCommand(t2, t1, (t2 < t1 ? 1 : 2) | (axis << 2) | (ROADTYPE_ROAD << 3), DC_AUTO | DC_EXEC | DC_NO_WATER, CMD_BUILD_LONG_ROAD);
} else {
int i;
/* Figure out what (road)bridge type to build
* start with best bridge, then go down to worse and worse bridges
* unnecessary to check for worse bridge (i=0), since AI will always build that */
for (i = MAX_BRIDGES - 1; i != 0; i--) {
if (CheckBridge_Stuff(i, bridge_len)) {
CommandCost cost = DoCommand(t1, t2, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE);
if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 1) && cost.GetCost() < ((p->player_money + _economy.max_loan - p->current_loan) >> 5)) break;
}
/* Figure out what (road)bridge type to build
* start with best bridge, then go down to worse and worse bridges
* unnecessary to check for worse bridge (i=0), since AI will always build that.
*AI is so fucked up that fixing this small thing will probably not solve a thing
*/
for (i = 10; i != 0; i--) {
if (CheckBridge_Stuff(i, bridge_len)) {
CommandCost cost = DoCommand(tile, _players_ai[p->index].cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE);
if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 5)) break;
}
/* Build it */
DoCommand(t1, t2, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
}
_players_ai[p->index].cur_tile_a = t2;
// Build it
DoCommand(tile, _players_ai[p->index].cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
_players_ai[p->index].state_counter = 0;
} else if (arf.best_ptr[0] & 0x40) {
// tunnel
@@ -3377,8 +3319,7 @@ static void AiStateAirportStuff(Player *p)
AirportFTAClass::Flags flags = st->Airport()->flags;
/* if airport doesn't accept our kind of plane, dismiss it */
if (!(flags & (_players_ai[p->index].build_kind == 1 ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES))) {
if (!(flags & (_players_ai[p->index].build_kind == 1 && i == 0 ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES))) {
continue;
}
@@ -3448,7 +3389,7 @@ static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p,
const AirportFTAClass* airport = GetAirport(p->attr);
uint w = airport->size_x;
uint h = airport->size_y;
uint rad = _patches.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
uint rad = _patches.modified_catchment ? airport->catchment : 4;
if (cargo & 0x80) {
GetProductionAroundTiles(values, tile2, w, h, rad);
@@ -3464,29 +3405,12 @@ static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p,
static int AiFindBestDefaultAirportBlock(TileIndex tile, byte cargo, byte heli, CommandCost *cost)
{
const AiDefaultBlockData *p;
uint i;
bool no_small = false;
if (!heli) {
/* do not build small airport if we have large available and we are not building heli route */
uint valid = GetValidAirports();
for (uint i = 0; (p = _airport_default_block_data[i]) != NULL; i++) {
uint flags = GetAirport(p->attr)->flags;
if (HasBit(valid, p->attr) && (flags & AirportFTAClass::AIRPLANES) && !(flags & AirportFTAClass::SHORT_STRIP)) {
no_small = true;
break;
}
}
}
for (uint i = 0; (p = _airport_default_block_data[i]) != NULL; i++) {
uint flags = GetAirport(p->attr)->flags;
/* If we are doing a helicopter service, avoid building airports where they can't land */
if (heli && !(flags & AirportFTAClass::HELICOPTERS)) continue;
/* Similiar with aircraft ... */
if (!heli && !(flags & AirportFTAClass::AIRPLANES)) continue;
/* Do not build small airport if we prefer large */
if (no_small && (flags & AirportFTAClass::SHORT_STRIP)) continue;
for (i = 0; (p = _airport_default_block_data[i]) != NULL; i++) {
// If we are doing a helicopter service, avoid building
// airports where they can't land.
if (heli && !(GetAirport(p->attr)->flags & AirportFTAClass::HELICOPTERS)) continue;
*cost = AiDoBuildDefaultAirportBlock(tile, p, 0);
if (CmdSucceeded(*cost) && AiCheckAirportResources(tile, p, cargo))
@@ -3584,22 +3508,8 @@ static void AiStateBuildAircraftVehicles(Player *p)
tile = TILE_ADD(_players_ai[p->index].src.use_tile, ToTileIndexDiff(ptr->tileoffs));
/* determine forbidden aircraft bits */
byte forbidden = 0;
for (i = 0; _players_ai[p->index].order_list_blocks[i] != 0xFF; i++) {
const AiBuildRec *aib = (&_players_ai[p->index].src) + _players_ai[p->index].order_list_blocks[i];
const Station *st = GetStationByTile(aib->use_tile);
if (st == NULL || !(st->facilities & FACIL_AIRPORT)) continue;
AirportFTAClass::Flags flags = st->Airport()->flags;
if (!(flags & AirportFTAClass::AIRPLANES)) forbidden |= AIR_CTOL | AIR_FAST; // no planes for heliports / oil rigs
if (flags & AirportFTAClass::SHORT_STRIP) forbidden |= AIR_FAST; // no fast planes for small airports
}
veh = AiChooseAircraftToBuild(p->player_money, forbidden);
veh = AiChooseAircraftToBuild(p->player_money, _players_ai[p->index].build_kind != 0 ? 0 : AIR_CTOL);
if (veh == INVALID_ENGINE) return;
if (GetStationByTile(tile)->Airport()->nof_depots == 0) return;
/* XXX - Have the AI pick the hangar terminal in an airport. Eg get airport-type
* and offset to the FIRST depot because the AI picks the st->xy tile */
@@ -3796,7 +3706,7 @@ pos_3:
if (IsLevelCrossing(tile)) goto is_rail_crossing;
if (IsRoadDepot(tile)) {
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
DiagDirection dir;
TileIndex t;

View File

@@ -15,8 +15,6 @@
#include "../../player_base.h"
#include "../../player_func.h"
#include "../ai.h"
#include "../../tunnelbridge.h"
// Build HQ
// Params:
@@ -60,7 +58,7 @@ CommandCost AiNew_Build_Bridge(Player *p, TileIndex tile_a, TileIndex tile_b, by
int bridge_type, bridge_len, type, type2;
// Find a good bridgetype (the best money can buy)
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
bridge_len = GetBridgeLength(tile_a, tile_b);
type = type2 = 0;
for (bridge_type = MAX_BRIDGES-1; bridge_type >= 0; bridge_type--) {
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
@@ -236,29 +234,30 @@ EngineID AiNew_PickVehicle(Player *p)
} else {
EngineID best_veh_index = INVALID_ENGINE;
int32 best_veh_rating = 0;
EngineID start = ROAD_ENGINES_INDEX;
EngineID end = ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES;
EngineID i;
/* Loop through all road vehicles */
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_ROAD) {
for (i = start; i != end; i++) {
const RoadVehicleInfo *rvi = RoadVehInfo(i);
const Engine* e = GetEngine(i);
int32 rating;
CommandCost ret;
/* Skip vehicles which can't take our cargo type */
if (rvi->cargo_type != _players_ainew[p->index].cargo && !CanRefitTo(i, _players_ainew[p->index].cargo)) continue;
/* Skip trams */
if (HasBit(EngInfo(i)->misc_flags, EF_ROAD_TRAM)) continue;
// Is it availiable?
// Also, check if the reliability of the vehicle is above the AI_VEHICLE_MIN_RELIABILTY
if (!HasBit(e->player_avail, _current_player) || e->reliability * 100 < AI_VEHICLE_MIN_RELIABILTY << 16) continue;
/* Rate and compare the engine by speed & capacity */
int rating = rvi->max_speed * rvi->capacity;
rating = rvi->max_speed * rvi->capacity;
if (rating <= best_veh_rating) continue;
// Can we build it?
CommandCost ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
if (CmdFailed(ret)) continue;
best_veh_rating = rating;

View File

@@ -14,7 +14,6 @@
#include "../../variables.h"
#include "../../player_base.h"
#include "../../player_func.h"
#include "../../tunnelbridge.h"
#define TEST_STATION_NO_DIR 0xFF
@@ -321,7 +320,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
new_tile += TileOffsByDiagDir(dir);
// Precheck, is the length allowed?
if (!CheckBridge_Stuff(0, GetTunnelBridgeLength(tile, new_tile))) break;
if (!CheckBridge_Stuff(0, GetBridgeLength(tile, new_tile))) break;
// Check if we hit the station-tile.. we don't like that!
if (TILES_BETWEEN(new_tile, PathFinderInfo->end_tile_tl, PathFinderInfo->end_tile_br)) break;
@@ -341,11 +340,14 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// Next, check for tunnels!
// Tunnels can only be built on slopes corresponding to the direction
// For now, we check both sides for this tile.. terraforming gives fuzzy result
if (tileh == InclinedSlope(dir)) {
if ((dir == DIAGDIR_NE && tileh == SLOPE_NE) ||
(dir == DIAGDIR_SE && tileh == SLOPE_SE) ||
(dir == DIAGDIR_SW && tileh == SLOPE_SW) ||
(dir == DIAGDIR_NW && tileh == SLOPE_NW)) {
// Now simply check if a tunnel can be build
ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
tileh = GetTileSlope(_build_tunnel_endtile, NULL);
if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
if (CmdSucceeded(ret) && (tileh == SLOPE_SW || tileh == SLOPE_SE || tileh == SLOPE_NW || tileh == SLOPE_NE)) {
aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
aystar->neighbours[aystar->num_neighbours].user_data[0] = AI_PATHFINDER_FLAG_TUNNEL + (dir << 8);
aystar->neighbours[aystar->num_neighbours++].direction = 0;
@@ -357,6 +359,10 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
extern Foundation GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
extern Foundation GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
extern Foundation GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
enum BridgeFoundation {
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
};
// The most important function: it calculates the g-value
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
@@ -399,7 +405,8 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
if (parent->path.node.user_data[0] == 0 && current->user_data[0] == 0) {
if (PathFinderInfo->rail_or_road) {
Foundation f = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)));
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
// Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information..
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
} else {
res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -407,7 +414,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
} else {
if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) {
Foundation f = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile));
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
} else {
res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -422,19 +429,29 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
int r;
// Tunnels are very expensive when build on long routes..
// Ironicly, we are using BridgeCode here ;)
r = AI_PATHFINDER_TUNNEL_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
r = AI_PATHFINDER_TUNNEL_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
res += r + (r >> 8);
}
// Are we part of a bridge?
if ((AI_PATHFINDER_FLAG_BRIDGE & current->user_data[0]) != 0) {
// That means for every length a penalty
res += AI_PATHFINDER_BRIDGE_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
res += AI_PATHFINDER_BRIDGE_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
// Check if we are going up or down, first for the starting point
// In user_data[0] is at the 8th bit the direction
if (!HasBridgeFlatRamp(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
if (!HasBit(BRIDGE_NO_FOUNDATION, parent_tileh)) {
if (IsLeveledFoundation(GetBridgeFoundation(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
}
// Second for the end point
if (!HasBridgeFlatRamp(tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
if (!HasBit(BRIDGE_NO_FOUNDATION, tileh)) {
if (IsLeveledFoundation(GetBridgeFoundation(tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
}
if (parent_tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
if (tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
// To prevent the AI from taking the fastest way in tiles, but not the fastest way

View File

@@ -801,7 +801,8 @@ static void AiNew_State_FindDepot(Player *p)
for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
TileIndex t = tile + TileOffsByDiagDir(j);
if (IsRoadDepotTile(t) &&
if (IsTileType(t, MP_ROAD) &&
GetRoadTileType(t) == ROAD_TILE_DEPOT &&
IsTileOwner(t, _current_player) &&
GetRoadDepotDirection(t) == ReverseDiagDir(j)) {
_players_ainew[p->index].depot_tile = t;
@@ -881,7 +882,6 @@ static int AiNew_HowManyVehicles(Player *p)
length = _players_ainew[p->index].path_info.route_length;
// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
tiles_a_day = RoadVehInfo(i)->max_speed * DAY_TICKS / 256 / 16;
if (tiles_a_day == 0) tiles_a_day = 1;
// We want a vehicle in a station once a month at least, so, calculate it!
// (the * 2 is because we have 2 stations ;))
amount = length * 2 * 2 / tiles_a_day / 30;
@@ -898,7 +898,6 @@ static int AiNew_HowManyVehicles(Player *p)
length = _players_ainew[p->index].path_info.route_length;
// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
tiles_a_day = RoadVehInfo(i)->max_speed * DAY_TICKS / 256 / 16;
if (tiles_a_day == 0) tiles_a_day = 1;
if (_players_ainew[p->index].from_deliver) {
max_cargo = GetIndustry(_players_ainew[p->index].from_ic)->last_month_production[0];
} else {
@@ -1103,7 +1102,7 @@ static void AiNew_State_BuildDepot(Player *p)
CommandCost res;
assert(_players_ainew[p->index].state == AI_STATE_BUILD_DEPOT);
if (IsRoadDepotTile(_players_ainew[p->index].depot_tile)) {
if (IsTileType(_players_ainew[p->index].depot_tile, MP_ROAD) && GetRoadTileType(_players_ainew[p->index].depot_tile) == ROAD_TILE_DEPOT) {
if (IsTileOwner(_players_ainew[p->index].depot_tile, _current_player)) {
// The depot is already built
_players_ainew[p->index].state = AI_STATE_BUILD_VEHICLE;
@@ -1253,7 +1252,7 @@ static void AiNew_CheckVehicle(Player *p, Vehicle *v)
if (v->age > 360) {
// If both years together are not more than AI_MINIMUM_ROUTE_PROFIT,
// it is not worth the line I guess...
if (v->profit_last_year + v->profit_this_year < (Money)256 * AI_MINIMUM_ROUTE_PROFIT ||
if (v->profit_last_year + v->profit_this_year < AI_MINIMUM_ROUTE_PROFIT ||
(v->reliability * 100 >> 16) < 40) {
// There is a possibility that the route is fucked up...
if (v->cargo.DaysInTransit() > AI_VEHICLE_LOST_DAYS) {

View File

@@ -124,9 +124,6 @@ struct Aircraft : public Vehicle {
Money GetRunningCost() const { return AircraftVehInfo(this->engine_type)->running_cost * _price.aircraft_running; }
bool IsInDepot() const { return (this->vehstatus & VS_HIDDEN) != 0 && IsHangarTile(this->tile); }
void Tick();
void OnNewDay();
};
Station *GetTargetAirportIfValid(const Vehicle *v);
#endif /* AIRCRAFT_H */

View File

@@ -190,17 +190,15 @@ void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal)
{
const AircraftVehicleInfo* avi = AircraftVehInfo(engine);
int spritenum = avi->image_index;
SpriteID sprite = 0;
SpriteID sprite = (6 + _aircraft_sprite[spritenum]);
if (is_custom_sprite(spritenum)) {
sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite == 0) {
spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
sprite = (6 + _aircraft_sprite[spritenum]);
}
}
if (sprite == 0) {
sprite = 6 + _aircraft_sprite[spritenum];
}
DrawSprite(sprite, pal, x, y);
@@ -271,7 +269,7 @@ uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi)
* @param tile tile of depot where aircraft is built
* @param flags for command
* @param p1 aircraft type being built (engine)
* @param p2 unused
* @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number
* return result of operation. Could be cost, error
*/
CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
@@ -296,7 +294,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
}
UnitID unit_num = (flags & DC_AUTOREPLACE) ? 0 : GetFreeUnitNumber(VEH_AIRCRAFT);
UnitID unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_AIRCRAFT);
if (unit_num > _patches.max_aircraft)
return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
@@ -323,8 +321,6 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
u->z_pos = GetSlopeZ(x, y);
v->z_pos = u->z_pos + 1;
v->running_ticks = 0;
// u->delta_x = u->delta_y = 0;
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
@@ -529,7 +525,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
/* Check if this aircraft can be started/stopped. The callback will fail or
* return 0xFF if it can. */
uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v);
if (callback != CALLBACK_FAILED && GB(callback, 0, 8) != 0xFF) {
if (callback != CALLBACK_FAILED && callback != 0xFF) {
StringID error = GetGRFStringID(GetEngineGRFID(v->engine_type), 0xD000 + callback);
return_cmd_error(error);
}
@@ -541,7 +537,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
v->vehstatus ^= VS_STOPPED;
v->cur_speed = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
@@ -580,7 +576,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
return CommandCost();
}
@@ -590,14 +586,14 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (v->current_order.flags & OFB_UNLOAD) v->cur_order_index++;
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
} else {
bool next_airport_has_hangar = true;
StationID next_airport_index = v->u.air.targetairport;
const Station *st = GetTargetAirportIfValid(v);
const Station *st = GetStation(next_airport_index);
/* If the station is not a valid airport or if it has no hangars */
if (st == NULL || st->Airport()->nof_depots == 0) {
if (!st->IsValid() || st->airport_tile == 0 || st->Airport()->nof_depots == 0) {
/* the aircraft has to search for a hangar on its own */
StationID station = FindNearestHangar(v);
@@ -614,7 +610,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
v->current_order.refit_cargo = CT_INVALID;
v->current_order.dest = next_airport_index;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
if (v->u.air.state == FLYING && !next_airport_has_hangar) {
/* The aircraft is now heading for a different hangar than the next in the orders */
AircraftNextAirportPos_and_Order(v);
@@ -706,7 +702,7 @@ CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
static void CheckIfAircraftNeedsService(Vehicle *v)
{
if (_patches.servint_aircraft == 0 || !v->NeedsAutomaticServicing()) return;
if (_patches.servint_aircraft == 0 || !VehicleNeedsService(v)) return;
if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;
@@ -719,36 +715,35 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
// v->u.air.targetairport = st->index;
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OFB_NON_STOP;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
} else if (v->current_order.type == OT_GOTO_DEPOT) {
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
}
void Aircraft::OnNewDay()
void OnNewDay_Aircraft(Vehicle *v)
{
if (!IsNormalAircraft(this)) return;
if (!IsNormalAircraft(v)) return;
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);
if ((++v->day_counter & 7) == 0) DecreaseVehicleValue(v);
CheckOrders(this);
CheckOrders(v);
CheckVehicleBreakdown(this);
AgeVehicle(this);
CheckIfAircraftNeedsService(this);
CheckVehicleBreakdown(v);
AgeVehicle(v);
CheckIfAircraftNeedsService(v);
if (this->running_ticks == 0) return;
if (v->vehstatus & VS_STOPPED) return;
CommandCost cost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running * this->running_ticks / (364 * DAY_TICKS));
CommandCost cost = CommandCost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
this->profit_this_year -= cost.GetCost();
this->running_ticks = 0;
v->profit_this_year -= cost.GetCost() >> 8;
SubtractMoneyFromPlayerFract(this->owner, cost);
SubtractMoneyFromPlayerFract(v->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
@@ -926,10 +921,6 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
uint spd = v->acceleration * 16;
byte t;
/* Adjust speed limits by plane speed factor to prevent taxiing
* and take-off speeds being too low. */
speed_limit *= _patches.plane_speed;
if (v->u.air.cached_max_speed < speed_limit) {
if (v->cur_speed < speed_limit) hard_limit = false;
speed_limit = v->u.air.cached_max_speed;
@@ -939,15 +930,7 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
v->subspeed = (t=v->subspeed) + (byte)spd;
/* Aircraft's current speed is used twice so that very fast planes are
* forced to slow down rapidly in the short distance needed. The magic
* value 16384 was determined to give similar results to the old speed/48
* method at slower speeds. This also results in less reduction at slow
* speeds to that aircraft do not get to taxi speed straight after
* touchdown. */
if (!hard_limit && v->cur_speed > speed_limit) {
speed_limit = v->cur_speed - max(1, ((v->cur_speed * v->cur_speed) / 16384) / _patches.plane_speed);
}
if (!hard_limit && v->cur_speed > speed_limit) speed_limit = v->cur_speed - (v->cur_speed / 48);
spd = min(v->cur_speed + (spd >> 8) + (v->subspeed < t), speed_limit);
@@ -958,12 +941,9 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_patches.vehicle_speed)
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
/* Adjust distance moved by plane speed setting */
if (_patches.plane_speed > 1) spd /= _patches.plane_speed;
if (!(v->direction & 1)) spd = spd * 3 / 4;
spd += v->progress;
@@ -1023,16 +1003,9 @@ static byte AircraftGetEntryPoint(const Vehicle *v, const AirportFTAClass *apc)
assert(v != NULL);
assert(apc != NULL);
/* In the case the station doesn't exit anymore, set target tile 0.
* It doesn't hurt much, aircraft will go to next order, nearest hangar
* or it will simply crash in next tick */
TileIndex tile = 0;
if (IsValidStationID(v->u.air.targetairport)) {
const Station *st = GetStation(v->u.air.targetairport);
/* Make sure we don't go to 0,0 if the airport has been removed. */
tile = (st->airport_tile != 0) ? st->airport_tile : st->xy;
}
const Station *st = GetStation(v->u.air.targetairport);
/* Make sure we don't go to 0,0 if the airport has been removed. */
TileIndex tile = (st->airport_tile != 0) ? st->airport_tile : st->xy;
int delta_x = v->x_pos - TileX(tile) * TILE_SIZE;
int delta_y = v->y_pos - TileY(tile) * TILE_SIZE;
@@ -1058,20 +1031,15 @@ static byte AircraftGetEntryPoint(const Vehicle *v, const AirportFTAClass *apc)
static bool AircraftController(Vehicle *v)
{
int count;
/* NULL if station is invalid */
const Station *st = IsValidStationID(v->u.air.targetairport) ? GetStation(v->u.air.targetairport) : NULL;
/* 0 if there is no station */
TileIndex tile = 0;
if (st != NULL) {
tile = st->airport_tile;
if (tile == 0) tile = st->xy;
}
/* DUMMY if there is no station or no airport */
const AirportFTAClass *afc = tile == 0 ? GetAirport(AT_DUMMY) : st->Airport();
const Station *st = GetStation(v->u.air.targetairport);
const AirportFTAClass *afc = st->Airport();
const AirportMovingData *amd;
/* prevent going to 0,0 if airport is deleted. */
if (st == NULL || st->airport_tile == 0) {
TileIndex tile = st->airport_tile;
if (tile == 0) {
tile = st->xy;
/* Jump into our "holding pattern" state machine if possible */
if (v->u.air.pos >= afc->nofelements) {
v->u.air.pos = v->u.air.previous_pos = AircraftGetEntryPoint(v, afc);
@@ -1087,7 +1055,7 @@ static bool AircraftController(Vehicle *v)
}
/* get airport moving data */
const AirportMovingData *amd = afc->MovingData(v->u.air.pos);
amd = afc->MovingData(v->u.air.pos);
int x = TileX(tile) * TILE_SIZE;
int y = TileY(tile) * TILE_SIZE;
@@ -1119,36 +1087,34 @@ static bool AircraftController(Vehicle *v)
/* Helicopter landing. */
if (amd->flag & AMED_HELI_LOWER) {
if (st == NULL) {
/* FIXME - AircraftController -> if station no longer exists, do not land
* helicopter will circle until sign disappears, then go to next order
* what to do when it is the only order left, right now it just stays in 1 place */
v->u.air.state = FLYING;
UpdateAircraftCache(v);
AircraftNextAirportPos_and_Order(v);
return false;
}
count = UpdateAircraftSpeed(v);
if (count > 0) {
if (st->airport_tile == 0) {
/* FIXME - AircraftController -> if station no longer exists, do not land
* helicopter will circle until sign disappears, then go to next order
* what to do when it is the only order left, right now it just stays in 1 place */
v->u.air.state = FLYING;
UpdateAircraftCache(v);
AircraftNextAirportPos_and_Order(v);
return false;
}
/* Vehicle is now at the airport. */
v->tile = tile;
/* Vehicle is now at the airport. */
v->tile = st->airport_tile;
/* Find altitude of landing position. */
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
/* Find altitude of landing position. */
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
if (z == v->z_pos) {
Vehicle *u = v->Next()->Next();
if (z == v->z_pos) {
Vehicle *u = v->Next()->Next();
/* Increase speed of rotors. When speed is 80, we've landed. */
if (u->cur_speed >= 80) return true;
u->cur_speed += 4;
} else {
count = UpdateAircraftSpeed(v);
if (count > 0) {
if (v->z_pos > z) {
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
} else {
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
}
/* Increase speed of rotors. When speed is 80, we've landed. */
if (u->cur_speed >= 80) return true;
u->cur_speed += 4;
} else if (v->z_pos > z) {
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
} else {
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
}
}
return false;
@@ -1228,7 +1194,7 @@ static bool AircraftController(Vehicle *v)
v->tile = gp.new_tile;
/* If vehicle is in the air, use tile coordinate 0. */
if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
// if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
/* Adjust Z for land or takeoff? */
uint z = v->z_pos;
@@ -1284,10 +1250,10 @@ static void HandleCrashedAircraft(Vehicle *v)
{
v->u.air.crashed_counter++;
Station *st = GetTargetAirportIfValid(v);
Station *st = GetStation(v->u.air.targetairport);
/* make aircraft crash down to the ground */
if (v->u.air.crashed_counter < 500 && st == NULL && ((v->u.air.crashed_counter % 3) == 0) ) {
if (v->u.air.crashed_counter < 500 && st->airport_tile==0 && ((v->u.air.crashed_counter % 3) == 0) ) {
uint z = GetSlopeZ(v->x_pos, v->y_pos);
v->z_pos -= 1;
if (v->z_pos == z) {
@@ -1318,13 +1284,12 @@ static void HandleCrashedAircraft(Vehicle *v)
/* clear runway-in on all airports, set by crashing plane
* small airports use AIRPORT_BUSY, city airports use RUNWAY_IN_OUT_block, etc.
* but they all share the same number */
if (st != NULL) {
CLRBITS(st->airport_flags, RUNWAY_IN_block);
CLRBITS(st->airport_flags, RUNWAY_IN_OUT_block); // commuter airport
CLRBITS(st->airport_flags, RUNWAY_IN2_block); // intercontinental
}
CLRBITS(st->airport_flags, RUNWAY_IN_block);
CLRBITS(st->airport_flags, RUNWAY_IN_OUT_block); // commuter airport
CLRBITS(st->airport_flags, RUNWAY_IN2_block); // intercontinental
MarkSingleVehicleDirty(v);
BeginVehicleMove(v);
EndVehicleMove(v);
DoDeleteAircraft(v);
}
@@ -1384,7 +1349,7 @@ static void ProcessAircraftOrder(Vehicle *v)
case OT_GOTO_DEPOT:
if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
!v->NeedsServicing()) {
!VehicleNeedsService(v)) {
UpdateVehicleTimetable(v, true);
v->cur_order_index++;
}
@@ -1415,8 +1380,8 @@ static void ProcessAircraftOrder(Vehicle *v)
* go to a depot, we have to keep that order so the aircraft
* actually stops.
*/
const Station *st = GetTargetAirportIfValid(v);
if (st == NULL) {
const Station *st = GetStation(v->u.air.targetairport);
if (!st->IsValid() || st->airport_tile == 0) {
CommandCost ret;
PlayerID old_player = _current_player;
@@ -1452,7 +1417,7 @@ void Aircraft::MarkDirty()
{
this->cur_image = this->GetImage(this->direction);
if (this->subtype == AIR_HELICOPTER) this->Next()->Next()->cur_image = GetRotorImage(this);
MarkSingleVehicleDirty(this);
MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
}
static void CrashAirplane(Vehicle *v)
@@ -1470,15 +1435,16 @@ static void CrashAirplane(Vehicle *v)
v->cargo.Truncate(0);
v->Next()->cargo.Truncate(0);
const Station *st = GetTargetAirportIfValid(v);
const Station *st = GetStation(v->u.air.targetairport);
StringID newsitem;
if (st == NULL) {
if (st->airport_tile == 0) {
newsitem = STR_PLANE_CRASH_OUT_OF_FUEL;
} else {
SetDParam(1, st->index);
newsitem = STR_A034_PLANE_CRASH_DIE_IN_FIREBALL;
}
SetDParam(1, st->index);
AddNewsItem(newsitem,
NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0),
v->index,
@@ -1554,8 +1520,7 @@ static void AircraftNextAirportPos_and_Order(Vehicle *v)
v->current_order.type == OT_GOTO_DEPOT)
v->u.air.targetairport = v->current_order.dest;
const Station *st = GetTargetAirportIfValid(v);
const AirportFTAClass *apc = st == NULL ? GetAirport(AT_DUMMY) : st->Airport();
const AirportFTAClass *apc = GetStation(v->u.air.targetairport)->Airport();
v->u.air.pos = v->u.air.previous_pos = AircraftGetEntryPoint(v, apc);
}
@@ -1584,45 +1549,6 @@ static void AircraftLeaveHangar(Vehicle *v)
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
/** Checks if an aircraft should head towards a hangar because it needs replacement
* @param *v the vehicle to test
* @return true if the aircraft should head towards a hangar
*/
static inline bool CheckSendAircraftToHangarForReplacement(const Vehicle *v)
{
EngineID new_engine;
Player *p = GetPlayer(v->owner);
if (VehicleHasDepotOrders(v)) return false; // The aircraft will end up in the hangar eventually on it's own
new_engine = EngineReplacementForPlayer(p, v->engine_type, v->group_id);
if (new_engine == INVALID_ENGINE) {
/* There is no autoreplace assigned to this EngineID so we will set it to renew to the same type if needed */
new_engine = v->engine_type;
if (!v->NeedsAutorenewing(p)) {
/* No need to replace the aircraft */
return false;
}
}
if (!HasBit(GetEngine(new_engine)->player_avail, v->owner)) {
/* Engine is not buildable anymore */
return false;
}
if (p->player_money < (p->engine_renew_money + (2 * DoCommand(0, new_engine, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT).GetCost()))) {
/* We lack enough money to request the replacement right away.
* We want 2*(the price of the new vehicle) and not looking at the value of the vehicle we are going to sell.
* The reason is that we don't want to send a whole lot of vehicles to the hangars when we only have enough money to replace a single one.
* Remember this happens in the background so the user can't stop this. */
return false;
}
/* We found no reason NOT to send the aircraft to a hangar so we will send it there at once */
return true;
}
////////////////////////////////////////////////////////////////////////////////
/////////////////// AIRCRAFT MOVEMENT SCHEME ////////////////////////////////
@@ -1706,23 +1632,21 @@ static void AircraftEventHandler_AtTerminal(Vehicle *v, const AirportFTAClass *a
/* airport-road is free. We either have to go to another airport, or to the hangar
* ---> start moving */
bool go_to_hangar = false;
switch (v->current_order.type) {
case OT_GOTO_STATION: // ready to fly to another airport
/* airplane goto state takeoff, helicopter to helitakeoff */
v->u.air.state = (v->subtype == AIR_HELICOPTER) ? HELITAKEOFF : TAKEOFF;
break;
case OT_GOTO_DEPOT: // visit hangar for serivicing, sale, etc.
go_to_hangar = v->current_order.dest == v->u.air.targetairport;
if (v->current_order.dest == v->u.air.targetairport) {
v->u.air.state = HANGAR;
} else {
v->u.air.state = (v->subtype == AIR_HELICOPTER) ? HELITAKEOFF : TAKEOFF;
}
break;
default: // orders have been deleted (no orders), goto depot and don't bother us
v->current_order.Free();
go_to_hangar = GetStation(v->u.air.targetairport)->Airport()->nof_depots != 0;
}
if (go_to_hangar) {
v->u.air.state = HANGAR;
} else {
/* airplane goto state takeoff, helicopter to helitakeoff */
v->u.air.state = (v->subtype == AIR_HELICOPTER) ? HELITAKEOFF : TAKEOFF;
v->u.air.state = HANGAR;
}
AirportMove(v, apc);
}
@@ -1753,16 +1677,22 @@ static void AircraftEventHandler_EndTakeOff(Vehicle *v, const AirportFTAClass *a
static void AircraftEventHandler_HeliTakeOff(Vehicle *v, const AirportFTAClass *apc)
{
const Player* p = GetPlayer(v->owner);
v->u.air.state = FLYING;
v->UpdateDeltaXY(INVALID_DIR);
/* get the next position to go to, differs per airport */
AircraftNextAirportPos_and_Order(v);
/* Send the helicopter to a hangar if needed for replacement */
if (CheckSendAircraftToHangarForReplacement(v)) {
_current_player = v->owner;
DoCommand(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
* unless it is due for renewal but the engine is no longer available */
if (v->owner == _local_player && (
EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
((p->engine_renew && v->age - v->max_age > p->engine_renew_months * 30) &&
HasBit(GetEngine(v->engine_type)->player_avail, _local_player))
)) {
_current_player = _local_player;
DoCommandP(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
_current_player = OWNER_NONE;
}
}
@@ -1812,10 +1742,16 @@ static void AircraftEventHandler_Landing(Vehicle *v, const AirportFTAClass *apc)
AircraftLandAirplane(v); // maybe crash airplane
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */
if (CheckSendAircraftToHangarForReplacement(v)) {
_current_player = v->owner;
DoCommand(v->tile, v->index, DEPOT_SERVICE, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
_current_player = OWNER_NONE;
if (v->current_order.type != OT_GOTO_DEPOT && v->owner == _local_player) {
/* only the vehicle owner needs to calculate the rest (locally) */
const Player* p = GetPlayer(v->owner);
if (EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
(p->engine_renew && v->age - v->max_age > (p->engine_renew_months * 30))) {
/* send the aircraft to the hangar at next airport */
_current_player = _local_player;
DoCommandP(v->tile, v->index, DEPOT_SERVICE, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
_current_player = OWNER_NONE;
}
}
}
@@ -2153,6 +2089,7 @@ static bool AirportFindFreeHelipad(Vehicle *v, const AirportFTAClass *apc)
static void AircraftEventHandler(Vehicle *v, int loop)
{
v->tick_counter++;
v->current_order_time++;
if (v->vehstatus & VS_CRASHED) {
HandleCrashedAircraft(v);
@@ -2166,7 +2103,7 @@ static void AircraftEventHandler(Vehicle *v, int loop)
if (v->breakdown_ctr <= 2) {
HandleBrokenAircraft(v);
} else {
if (v->current_order.type != OT_LOADING) v->breakdown_ctr--;
v->breakdown_ctr--;
}
}
@@ -2183,14 +2120,10 @@ void Aircraft::Tick()
{
if (!IsNormalAircraft(this)) return;
if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++;
if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this);
AgeAircraftCargo(this);
this->current_order_time++;
for (uint i = 0; i != 2; i++) {
AircraftEventHandler(this, i);
if (this->type != VEH_AIRCRAFT) // In case it was deleted
@@ -2199,24 +2132,6 @@ void Aircraft::Tick()
}
/** Returns aircraft's target station if v->u.air.target_airport
* is a valid station with airport.
* @param v vehicle to get target airport for
* @return pointer to target station, NULL if invalid
*/
Station *GetTargetAirportIfValid(const Vehicle *v)
{
assert(v->type == VEH_AIRCRAFT);
StationID sid = v->u.air.targetairport;
if (!IsValidStationID(sid)) return NULL;
Station *st = GetStation(sid);
return st->airport_tile == 0 ? NULL : st;
}
/** need to be called to load aircraft from old version */
void UpdateOldAircraft()
{

View File

@@ -28,7 +28,6 @@
void DrawAircraftDetails(const Vehicle *v, int x, int y)
{
int y_offset = (v->Next()->cargo_cap != 0) ? -11 : 0;
Money feeder_share = 0;
for (const Vehicle *u = v ; u != NULL ; u = u->Next()) {
if (IsNormalAircraft(u)) {
@@ -54,12 +53,11 @@ void DrawAircraftDetails(const Vehicle *v, int x, int y)
SetDParam(1, cargo_count);
SetDParam(2, u->cargo.Source());
DrawString(x, y + 21 + y_offset, STR_8813_FROM, TC_FROMSTRING);
feeder_share += u->cargo.FeederShare();
}
}
}
SetDParam(0, feeder_share);
SetDParam(0, v->cargo.FeederShare());
DrawString(x, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
}

View File

@@ -179,19 +179,14 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
airport = GetAirport(_selected_airport_type);
SetTileSelectSize(airport->size_x, airport->size_y);
int rad = _patches.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
int rad = _patches.modified_catchment ? airport->catchment : 4;
if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
DrawWindowWidgets(w);
// strings such as 'Size' and 'Coverage Area'
// 'Coverage Area'
int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad) + 4;
if (text_end > w->widget[6].bottom) {
SetWindowDirty(w);
ResizeWindowForWidget(w, 6, 0, text_end - w->widget[6].bottom);
SetWindowDirty(w);
}
DrawStationCoverageAreaText(2, 206, SCT_ALL, rad);
break;
}

View File

@@ -26,7 +26,7 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
uint i;
for (i = 1; i < MAX_UVALUE(EngineID); i++) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, engine_type, v);
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) break;
if (callback == CALLBACK_FAILED || callback == 0xFF) break;
}
delete v;
@@ -34,42 +34,6 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
return i - 1;
}
uint16 *GetCapacityOfArticulatedParts(EngineID engine, VehicleType type)
{
static uint16 capacity[NUM_CARGO];
memset(capacity, 0, sizeof(capacity));
if (type == VEH_TRAIN) {
const RailVehicleInfo *rvi = RailVehInfo(engine);
capacity[rvi->cargo_type] = GetEngineProperty(engine, 0x14, rvi->capacity);
if (rvi->railveh_type == RAILVEH_MULTIHEAD) capacity[rvi->cargo_type] += rvi->capacity;
} else if (type == VEH_ROAD) {
const RoadVehicleInfo *rvi = RoadVehInfo(engine);
capacity[rvi->cargo_type] = GetEngineProperty(engine, 0x0F, rvi->capacity);
}
if (!HasBit(EngInfo(engine)->callbackmask, CBM_VEHICLE_ARTIC_ENGINE)) return capacity;
for (uint i = 1; i < MAX_UVALUE(EngineID); i++) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, engine, NULL);
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) break;
EngineID artic_engine = GetFirstEngineOfType(type) + GB(callback, 0, 7);
if (type == VEH_TRAIN) {
const RailVehicleInfo *rvi = RailVehInfo(artic_engine);
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x14, rvi->capacity);
} else if (type == VEH_ROAD) {
const RoadVehicleInfo *rvi = RoadVehInfo(artic_engine);
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x0F, rvi->capacity);
}
}
return capacity;
}
void AddArticulatedParts(Vehicle **vl, VehicleType type)
{
const Vehicle *v = vl[0];
@@ -79,7 +43,7 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
for (uint i = 1; i < MAX_UVALUE(EngineID); i++) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, v->engine_type, v);
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) return;
if (callback == CALLBACK_FAILED || callback == 0xFF) return;
/* Attempt to use pre-allocated vehicles until they run out. This can happen
* if the callback returns different values depending on the cargo type. */

View File

@@ -8,7 +8,6 @@
#include "vehicle_type.h"
uint CountArticulatedParts(EngineID engine_type, bool purchase_window);
uint16 *GetCapacityOfArticulatedParts(EngineID engine, VehicleType type);
void AddArticulatedParts(Vehicle **vl, VehicleType type);
#endif /* ARTICULATED_VEHICLES_H */

View File

@@ -21,11 +21,9 @@
#include "functions.h"
#include "variables.h"
#include "autoreplace_func.h"
#include "articulated_vehicles.h"
#include "table/strings.h"
/*
* move the cargo from one engine to another if possible
*/
@@ -58,7 +56,7 @@ static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
* the complete train, which is without the weight of cargo we just
* moved back into some (of the) new wagon(s).
*/
if (dest->type == VEH_TRAIN) TrainConsistChanged(dest->First(), true);
if (dest->type == VEH_TRAIN) TrainConsistChanged(dest->First());
}
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
@@ -95,7 +93,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
if (v->cargo_cap != 0 && (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type))) {
if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
} else {
@@ -127,7 +125,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
* @param flags is the flags to use when calling DoCommand(). Mainly DC_EXEC counts
* @return value is cost of the replacement or CMD_ERROR
*/
static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
{
CommandCost cost;
CommandCost sell_value;
@@ -140,9 +138,18 @@ static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
char *vehicle_name = NULL;
CargoID replacement_cargo_type;
/* Check if there is a autoreplacement set for the vehicle */
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
/* if not, just renew to the same type */
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
* If not, chek if an global auto replacement is defined */
new_engine_type = (IsValidGroupID(old_v->group_id) && GetGroup(old_v->group_id)->replace_protection) ?
INVALID_ENGINE :
EngineReplacementForPlayer(p, old_v->engine_type, ALL_GROUP);
/* If we don't set new_egnine_type previously, we try to check if an autoreplacement was defined
* for the group and the engine_type of the vehicle */
if (new_engine_type == INVALID_ENGINE && !IsAllGroupID(old_v->group_id)) {
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
}
if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
@@ -157,7 +164,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
* We take it back if building fails or when we really sell the old engine */
SubtractMoneyFromPlayer(sell_value);
cost = DoCommand(old_v->tile, new_engine_type, 0, flags | DC_AUTOREPLACE, GetCmdBuildVeh(old_v));
cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
if (CmdFailed(cost)) {
/* Take back the money we just gave the player */
sell_value.MultiplyCost(-1);
@@ -168,10 +175,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
if (replacement_cargo_type != CT_NO_REFIT) {
/* add refit cost */
CommandCost refit_cost = GetRefitCost(new_engine_type);
if (old_v->type == VEH_TRAIN && RailVehInfo(new_engine_type)->railveh_type == RAILVEH_MULTIHEAD) {
/* Since it's a dualheaded engine we have to pay once more because the rear end is being refitted too. */
refit_cost.AddCost(refit_cost);
}
if (old_v->type == VEH_TRAIN && IsMultiheaded(old_v)) refit_cost.AddCost(refit_cost); // pay for both ends
cost.AddCost(refit_cost);
}
@@ -207,7 +211,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
DoCommand(0, (front->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
} else {
// copy/clone the orders
DoCommand(0, (old_v->index << 16) | new_v->index, old_v->IsOrderListShared() ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
new_v->cur_order_index = old_v->cur_order_index;
ChangeVehicleViewWindow(old_v, new_v);
new_v->profit_this_year = old_v->profit_this_year;
@@ -246,7 +250,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
if (next_veh != NULL) {
/* Verify that the wagons can be placed on the engine in question.
* This is done by building an engine, test if the wagons can be added and then sell the test engine. */
DoCommand(old_v->tile, new_engine_type, 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_v));
DoCommand(old_v->tile, new_engine_type, 3, DC_EXEC, GetCmdBuildVeh(old_v));
Vehicle *temp = GetVehicle(_new_vehicle_id);
tmp_move = DoCommand(0, (temp->index << 16) | next_veh->index, 1, 0, CMD_MOVE_RAIL_VEHICLE);
DoCommand(0, temp->index, 0, DC_EXEC, GetCmdSellVeh(old_v));
@@ -334,9 +338,25 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
}
// check if the vehicle should be replaced
if (!w->NeedsAutorenewing(p) || // replace if engine is too old
if (!p->engine_renew ||
w->age - w->max_age < (p->engine_renew_months * 30) || // replace if engine is too old
w->max_age == 0) { // rail cars got a max age of 0
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id)) continue;
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
If not, chek if an global auto remplacement is defined */
if (IsValidGroupID(w->group_id)) {
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id) && (
GetGroup(w->group_id)->replace_protection ||
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP))) {
continue;
}
} else if (IsDefaultGroupID(w->group_id)) {
if (!EngineHasReplacementForPlayer(p, w->engine_type, DEFAULT_GROUP) &&
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
continue;
}
} else if (!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
continue;
}
}
/* Now replace the vehicle */

View File

@@ -36,24 +36,6 @@ static const StringID _rail_types_list[] = {
INVALID_STRING_ID
};
enum ReplaceVehicleWindowWidgets {
RVW_WIDGET_LEFT_DETAILS = 3,
RVW_WIDGET_START_REPLACE,
RVW_WIDGET_INFO_TAB,
RVW_WIDGET_STOP_REPLACE,
RVW_WIDGET_LEFT_MATRIX,
RVW_WIDGET_LEFT_SCROLLBAR,
RVW_WIDGET_RIGHT_MATRIX,
RVW_WIDGET_RIGHT_SCROLLBAR,
RVW_WIDGET_RIGHT_DETAILS,
RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE,
RVW_WIDGET_TRAIN_FLUFF_LEFT,
RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN,
RVW_WIDGET_TRAIN_FLUFF_RIGHT,
RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE,
};
static int CDECL TrainEngineNumberSorter(const void *a, const void *b)
{
const EngineID va = *(const EngineID*)a;
@@ -80,7 +62,7 @@ void InitializeVehiclesGuiList()
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
{
Player *p = GetPlayer(_local_player);
VehicleType type = GetEngine(e)->type;
byte type = GetEngine(e)->type;
uint num_engines = GetGroupNumEngines(_local_player, id_g, e);
if (num_engines == 0 || p->num_engines[e] == 0) {
@@ -175,7 +157,7 @@ static void GenerateReplaceVehList(Window *w, bool draw_left)
{
EngineID e;
EngineID selected_engine = INVALID_ENGINE;
VehicleType type = (VehicleType)w->window_number;
byte type = w->window_number;
byte i = draw_left ? 0 : 1;
EngineList *list = &WP(w, replaceveh_d).list[i];
@@ -282,7 +264,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
* Either list is empty
* or The selected replacement engine has a replacement (to prevent loops)
* or The right list (new replacement) has the existing replacement vehicle selected */
w->SetWidgetDisabledState(RVW_WIDGET_START_REPLACE,
w->SetWidgetDisabledState(4,
selected_id[0] == INVALID_ENGINE ||
selected_id[1] == INVALID_ENGINE ||
EngineReplacementForPlayer(p, selected_id[1], selected_group) != INVALID_ENGINE ||
@@ -291,7 +273,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
/* Disable the "Stop Replacing" button if:
* The left list (existing vehicle) is empty
* or The selected vehicle has no replacement set up */
w->SetWidgetDisabledState(RVW_WIDGET_STOP_REPLACE,
w->SetWidgetDisabledState(6,
selected_id[0] == INVALID_ENGINE ||
!EngineHasReplacementForPlayer(p, selected_id[0], selected_group));
@@ -306,18 +288,18 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
SetDParam(2, WP(w, replaceveh_d).wagon_btnstate ? STR_ENGINES : STR_WAGONS);
/* sets the colour of that art thing */
w->widget[RVW_WIDGET_TRAIN_FLUFF_LEFT].color = _player_colors[_local_player];
w->widget[RVW_WIDGET_TRAIN_FLUFF_RIGHT].color = _player_colors[_local_player];
}
if (w->window_number == VEH_TRAIN) {
/* Show the selected railtype in the pulldown menu */
RailType railtype = _railtype_selected_in_replace_gui;
w->widget[RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN].data = _rail_types_list[railtype];
w->widget[13].color = _player_colors[_local_player];
w->widget[16].color = _player_colors[_local_player];
}
DrawWindowWidgets(w);
if (w->window_number == VEH_TRAIN) {
/* Draw the selected railtype in the pulldown menu */
RailType railtype = _railtype_selected_in_replace_gui;
DrawString(157, w->widget[14].top + 1, _rail_types_list[railtype], TC_BLACK);
}
/* sets up the string for the vehicle that is being replaced to */
if (selected_id[0] != INVALID_ENGINE) {
if (!EngineHasReplacementForPlayer(p, selected_id[0], selected_group)) {
@@ -330,28 +312,22 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
SetDParam(0, STR_NOT_REPLACING_VEHICLE_SELECTED);
}
DrawString(145, w->widget[RVW_WIDGET_INFO_TAB].top + 1, STR_02BD, TC_BLACK);
DrawString(145, w->widget[5].top + 1, STR_02BD, TC_BLACK);
/* Draw the lists */
for(byte i = 0; i < 2; i++) {
uint widget = (i == 0) ? RVW_WIDGET_LEFT_MATRIX : RVW_WIDGET_RIGHT_MATRIX;
uint16 x = i == 0 ? 2 : 230; // at what X offset
EngineList list = WP(w, replaceveh_d).list[i]; // which list to draw
EngineID start = i == 0 ? w->vscroll.pos : w->vscroll2.pos; // what is the offset for the start (scrolling)
EngineID end = min((i == 0 ? w->vscroll.cap : w->vscroll2.cap) + start, EngList_Count(&list));
/* Do the actual drawing */
DrawEngineList((VehicleType)w->window_number, w->widget[widget].left + 2, w->widget[widget].top + 1, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
DrawEngineList((VehicleType)w->window_number, x, 15, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
/* Also draw the details if an engine is selected */
if (WP(w, replaceveh_d).sel_engine[i] != INVALID_ENGINE) {
const Widget *wi = &w->widget[i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS];
int text_end = DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
if (text_end > wi->bottom) {
SetWindowDirty(w);
ResizeWindowForWidget(w, i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS, 0, text_end - wi->bottom);
SetWindowDirty(w);
}
const Widget *wi = &w->widget[i == 0 ? 3 : 11];
DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
}
}
@@ -359,38 +335,39 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
case WE_CLICK: {
switch (e->we.click.widget) {
case RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE:
case 12:
WP(w, replaceveh_d).wagon_btnstate = !(WP(w, replaceveh_d).wagon_btnstate);
WP(w, replaceveh_d).update_left = true;
WP(w, replaceveh_d).init_lists = true;
SetWindowDirty(w);
break;
case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: /* Railtype selection dropdown menu */
ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN, 0, ~GetPlayer(_local_player)->avail_railtypes);
case 14:
case 15: /* Railtype selection dropdown menu */
ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, 0, ~GetPlayer(_local_player)->avail_railtypes);
break;
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: /* toggle renew_keep_length */
case 17: /* toggle renew_keep_length */
DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_SET_AUTOREPLACE);
break;
case RVW_WIDGET_START_REPLACE: { /* Start replacing */
case 4: { /* Start replacing */
EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
EngineID veh_to = WP(w, replaceveh_d).sel_engine[1];
DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16) , veh_from + (veh_to << 16), NULL, CMD_SET_AUTOREPLACE);
} break;
case RVW_WIDGET_STOP_REPLACE: { /* Stop replacing */
case 6: { /* Stop replacing */
EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16), veh_from + (INVALID_ENGINE << 16), NULL, CMD_SET_AUTOREPLACE);
} break;
case RVW_WIDGET_LEFT_MATRIX:
case RVW_WIDGET_RIGHT_MATRIX: {
case 7:
case 9: {
uint i = (e->we.click.pt.y - 14) / w->resize.step_height;
uint16 click_scroll_pos = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.pos : w->vscroll2.pos;
uint16 click_scroll_cap = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.cap : w->vscroll2.cap;
byte click_side = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? 0 : 1;
uint16 click_scroll_pos = e->we.click.widget == 7 ? w->vscroll.pos : w->vscroll2.pos;
uint16 click_scroll_cap = e->we.click.widget == 7 ? w->vscroll.cap : w->vscroll2.cap;
byte click_side = e->we.click.widget == 7 ? 0 : 1;
uint16 engine_count = EngList_Count(&WP(w, replaceveh_d).list[click_side]);
if (i < click_scroll_cap) {
@@ -428,8 +405,8 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
w->vscroll.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
w->vscroll2.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
w->widget[RVW_WIDGET_LEFT_MATRIX].data = (w->vscroll.cap << 8) + 1;
w->widget[RVW_WIDGET_RIGHT_MATRIX].data = (w->vscroll2.cap << 8) + 1;
w->widget[7].data = (w->vscroll.cap << 8) + 1;
w->widget[9].data = (w->vscroll2.cap << 8) + 1;
break;
case WE_INVALIDATE_DATA:
@@ -461,7 +438,8 @@ static const Widget _replace_rail_vehicle_widgets[] = {
// train specific stuff
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 138, 228, 239, STR_REPLACE_ENGINE_WAGON_SELECT, STR_REPLACE_ENGINE_WAGON_SELECT_HELP}, // widget 12
{ WWT_PANEL, RESIZE_TB, 14, 139, 153, 240, 251, 0x0, STR_NULL},
{ WWT_DROPDOWN, RESIZE_TB, 14, 154, 289, 240, 251, 0x0, STR_REPLACE_HELP_RAILTYPE},
{ WWT_PANEL, RESIZE_TB, 14, 154, 277, 240, 251, 0x0, STR_REPLACE_HELP_RAILTYPE},
{ WWT_TEXTBTN, RESIZE_TB, 14, 278, 289, 240, 251, STR_0225, STR_REPLACE_HELP_RAILTYPE},
{ WWT_PANEL, RESIZE_TB, 14, 290, 305, 240, 251, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 317, 455, 228, 239, STR_REPLACE_REMOVE_WAGON, STR_REPLACE_REMOVE_WAGON_HELP},
// end of train specific stuff
@@ -528,6 +506,38 @@ static const WindowDesc _replace_ship_aircraft_vehicle_desc = {
};
void ShowReplaceVehicleWindow(VehicleType vehicletype)
{
Window *w;
DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
switch (vehicletype) {
case VEH_TRAIN:
w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
w->vscroll.cap = 8;
w->resize.step_height = 14;
WP(w, replaceveh_d).wagon_btnstate = true;
break;
case VEH_ROAD:
w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
w->vscroll.cap = 8;
w->resize.step_height = 14;
break;
case VEH_SHIP:
case VEH_AIRCRAFT:
w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
w->vscroll.cap = 4;
w->resize.step_height = 24;
break;
default: return;
}
w->caption_color = _local_player;
w->vscroll2.cap = w->vscroll.cap; // these two are always the same
WP(w, replaceveh_d).sel_group = DEFAULT_GROUP;
}
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
{
Window *w;

View File

@@ -13,6 +13,7 @@
*/
void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
void ShowReplaceVehicleWindow(VehicleType vehicletype);
void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
#endif /* AUTOREPLACE_GUI_H */

View File

@@ -9,10 +9,6 @@
#include <string>
#include <map>
#if defined(WITH_COCOA)
bool QZ_CanDisplay8bpp();
#endif /* defined(WITH_COCOA) */
/**
* The base factory, keeping track of all blitters.
*/
@@ -69,15 +65,6 @@ public:
{
const char *default_blitter = "8bpp-optimized";
#if defined(WITH_COCOA)
/* Some people reported lack of fullscreen support in 8 bpp mode.
* While we prefer 8 bpp since it's faster, we will still have to test for support. */
if (!QZ_CanDisplay8bpp()) {
/* The main display can't go to 8 bpp fullscreen mode.
* We will have to switch to 32 bpp by default. */
default_blitter = "32bpp-anim";
}
#endif /* defined(WITH_COCOA) */
if (GetBlitters().size() == 0) return NULL;
const char *bname = (StrEmpty(name)) ? default_blitter : name;

View File

@@ -13,30 +13,27 @@ enum {
MAX_BRIDGES = 13
};
typedef uint BridgeType;
/** Struct containing information about a single bridge type
*/
struct BridgeSpec {
Year avail_year; ///< the year where it becomes available
byte min_length; ///< the minimum length (not counting start and end tile)
byte max_length; ///< the maximum length (not counting start and end tile)
uint16 price; ///< the price multiplier
uint16 speed; ///< maximum travel speed
SpriteID sprite; ///< the sprite which is used in the GUI
SpriteID pal; ///< the palette which is used in the GUI
StringID material; ///< the string that contains the bridge description
StringID transport_name[2]; ///< description of the bridge, when built for road or rail
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
byte flags; ///< bit 0 set: disable drawing of far pillars.
struct Bridge {
Year avail_year; ///< the year in which the bridge becomes available
byte min_length; ///< the minimum length of the bridge (not counting start and end tile)
byte max_length; ///< the maximum length of the bridge (not counting start and end tile)
uint16 price; ///< the relative price of the bridge
uint16 speed; ///< maximum travel speed
SpriteID sprite; ///< the sprite which is used in the GUI
SpriteID pal; ///< the palette which is used in the GUI
StringID material; ///< the string that contains the bridge description
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
byte flags; ///< bit 0 set: disable drawing of far pillars.
};
extern BridgeSpec _bridge[MAX_BRIDGES];
extern const Bridge orig_bridge[MAX_BRIDGES];
extern Bridge _bridge[MAX_BRIDGES];
Foundation GetBridgeFoundation(Slope tileh, Axis axis);
bool HasBridgeFlatRamp(Slope tileh, Axis axis);
static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
static inline const Bridge *GetBridge(uint i)
{
assert(i < lengthof(_bridge));
return &_bridge[i];
@@ -44,9 +41,8 @@ static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
void DrawBridgeMiddle(const TileInfo *ti);
bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len, uint32 flags = 0);
bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
uint32 GetBridgeLength(TileIndex begin, TileIndex end);
int CalcBridgeLenCostFactor(int x);
void ResetBridges();
#endif /* BRIDGE_H */

View File

@@ -16,7 +16,6 @@
#include "map_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "tunnelbridge.h"
#include "table/strings.h"
@@ -25,8 +24,8 @@ static struct BridgeData {
uint count;
TileIndex start_tile;
TileIndex end_tile;
uint32 type; ///< Data type for the bridge. Bit 16,15 = transport type, 14..8 = road/rail pieces, 7..0 = type of bridge
BridgeType indexes[MAX_BRIDGES];
uint8 type;
uint8 indexes[MAX_BRIDGES];
Money costs[MAX_BRIDGES];
BridgeData()
@@ -44,7 +43,7 @@ static void BuildBridge(Window *w, int i)
{
DeleteWindow(w);
DoCommandP(_bridgedata.end_tile, _bridgedata.start_tile,
_bridgedata.type | _bridgedata.indexes[i], CcBuildBridge,
_bridgedata.indexes[i] | (_bridgedata.type << 8), CcBuildBridge,
CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
}
@@ -79,7 +78,7 @@ static void BuildBridgeWndProc(Window *w, WindowEvent *e)
uint y = 15;
for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
const BridgeSpec *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
const Bridge *b = &_bridge[_bridgedata.indexes[i + w->vscroll.pos]];
SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
SetDParam(1, b->speed * 10 / 16);
@@ -143,18 +142,38 @@ static const WindowDesc _build_bridge_desc = {
BuildBridgeWndProc
};
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type)
/* Widget definition for the road bridge selection window */
static const Widget _build_road_bridge_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // BBSW_CLOSEBOX
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 199, 0, 13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // BBSW_CAPTION
{ WWT_MATRIX, RESIZE_BOTTOM, 7, 0, 187, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK}, // BBSW_BRIDGE_LIST
{ WWT_SCROLLBAR, RESIZE_BOTTOM, 7, 188, 199, 14, 89, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // BBSW_SCROLLBAR
{ WWT_RESIZEBOX, RESIZE_TB, 7, 188, 199, 90, 101, 0x0, STR_RESIZE_BUTTON}, // BBSW_RESIZEBOX
{ WIDGETS_END},
};
/* Window definition for the road bridge selection window */
static const WindowDesc _build_road_bridge_desc = {
WDP_AUTO, WDP_AUTO, 200, 102, 200, 102,
WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_build_road_bridge_widgets,
BuildBridgeWndProc
};
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
{
DeleteWindowById(WC_BUILD_BRIDGE, 0);
_bridgedata.type = (transport_type << 15) | (bridge_type << 8); //prepare the parameter for use only once
_bridgedata.type = bridge_type;
_bridgedata.start_tile = start;
_bridgedata.end_tile = end;
/* only query bridge building possibility once, result is the same for all bridges!
* returns CMD_ERROR on failure, and price on success */
StringID errmsg = INVALID_STRING_ID;
CommandCost ret = DoCommand(end, start, _bridgedata.type, DC_AUTO | DC_QUERY_COST, CMD_BUILD_BRIDGE);
CommandCost ret = DoCommand(end, start, (bridge_type << 8), DC_AUTO | DC_QUERY_COST, CMD_BUILD_BRIDGE);
uint8 j = 0;
if (CmdFailed(ret)) {
@@ -163,19 +182,19 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
/* check which bridges can be built
* get absolute bridge length
* length of the middle parts of the bridge */
const uint bridge_len = GetTunnelBridgeLength(start, end);
const uint bridge_len = GetBridgeLength(start, end);
/* total length of bridge */
const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
/* loop for all bridgetypes */
for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
if (CheckBridge_Stuff(brd_type, bridge_len)) {
for (bridge_type = 0; bridge_type != MAX_BRIDGES; bridge_type++) {
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
/* bridge is accepted, add to list */
const BridgeSpec *b = GetBridgeSpec(brd_type);
const Bridge *b = &_bridge[bridge_type];
/* Add to terraforming & bulldozing costs the cost of the
* bridge itself (not computed with DC_QUERY_COST) */
_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);
_bridgedata.indexes[j] = brd_type;
_bridgedata.indexes[j] = bridge_type;
j++;
}
}
@@ -184,9 +203,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
}
if (j != 0) {
Window *w = AllocateWindowDesc(&_build_bridge_desc);
/* Change the data, or the caption of the gui. Set it to road or rail, accordingly */
w->widget[BBSW_CAPTION].data = (transport_type == TRANSPORT_ROAD) ? STR_1803_SELECT_ROAD_BRIDGE : STR_100D_SELECT_RAIL_BRIDGE;
AllocateWindowDesc((_bridgedata.type & 0x80) ? &_build_road_bridge_desc : &_build_bridge_desc);
} else {
ShowErrorMessage(errmsg, STR_5015_CAN_T_BUILD_BRIDGE_HERE, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE);
}

View File

@@ -8,7 +8,6 @@
#include "direction_func.h"
#include "rail_type.h"
#include "road_map.h"
#include "bridge.h"
/**
@@ -68,7 +67,7 @@ static inline bool IsBridgeAbove(TileIndex t)
* @pre IsBridgeTile(t)
* @return The bridge type
*/
static inline BridgeType GetBridgeType(TileIndex t)
static inline uint GetBridgeType(TileIndex t)
{
assert(IsBridgeTile(t));
return GB(_m[t].m2, 4, 4);
@@ -164,7 +163,7 @@ static inline void SetBridgeMiddle(TileIndex t, Axis a)
* @param rt the road or rail type
* @note this function should not be called directly.
*/
static inline void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt, uint rt)
static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt, uint rt)
{
SetTileType(t, MP_TUNNELBRIDGE);
SetTileOwner(t, o);
@@ -182,7 +181,7 @@ static inline void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, D
* @param d the direction this ramp must be facing
* @param r the road type of the bridge
*/
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RoadTypes r)
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RoadTypes r)
{
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD, r);
}
@@ -195,7 +194,7 @@ static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, BridgeType bridgetyp
* @param d the direction this ramp must be facing
* @param r the rail type of the bridge
*/
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RailType r)
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RailType r)
{
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL, r);
}

View File

@@ -55,6 +55,7 @@ enum BuildVehicleWidgets {
BUILD_VEHICLE_WIDGET_CLOSEBOX = 0,
BUILD_VEHICLE_WIDGET_CAPTION,
BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING,
BUILD_VEHICLE_WIDGET_SORT_TEXT,
BUILD_VEHICLE_WIDGET_SORT_DROPDOWN,
BUILD_VEHICLE_WIDGET_LIST,
BUILD_VEHICLE_WIDGET_SCROLLBAR,
@@ -69,7 +70,8 @@ static const Widget _build_vehicle_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 239, 0, 13, 0x0, STR_018C_WINDOW_TITLE_DRAG_THIS },
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_DROPDOWN, RESIZE_RIGHT, 14, 81, 239, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, RESIZE_RIGHT, 14, 81, 227, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_TEXTBTN, RESIZE_LR, 14, 228, 239, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_MATRIX, RESIZE_RB, 14, 0, 227, 26, 39, 0x101, STR_NULL },
{ WWT_SCROLLBAR, RESIZE_LRB, 14, 228, 239, 26, 39, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST },
{ WWT_PANEL, RESIZE_RTB, 14, 0, 239, 40, 161, 0x0, STR_NULL },
@@ -81,11 +83,9 @@ static const Widget _build_vehicle_widgets[] = {
};
/* Setup widget strings to fit the different types of vehicles */
static void SetupWindowStrings(Window *w, VehicleType type)
static void SetupWindowStrings(Window *w, byte type)
{
switch (type) {
default: NOT_REACHED();
case VEH_TRAIN:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_JUST_STRING;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_8843_TRAIN_VEHICLE_SELECTION;
@@ -94,7 +94,6 @@ static void SetupWindowStrings(Window *w, VehicleType type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_8820_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_8845_RENAME_TRAIN_VEHICLE_TYPE;
break;
case VEH_ROAD:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9006_NEW_ROAD_VEHICLES;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9026_ROAD_VEHICLE_SELECTION;
@@ -103,7 +102,6 @@ static void SetupWindowStrings(Window *w, VehicleType type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9034_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9035_RENAME_ROAD_VEHICLE_TYPE;
break;
case VEH_SHIP:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9808_NEW_SHIPS;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9825_SHIP_SELECTION_LIST_CLICK;
@@ -112,7 +110,6 @@ static void SetupWindowStrings(Window *w, VehicleType type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9836_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9837_RENAME_SHIP_TYPE;
break;
case VEH_AIRCRAFT:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_A005_NEW_AIRCRAFT;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_A025_AIRCRAFT_SELECTION_LIST;
@@ -218,8 +215,8 @@ static int CDECL TrainEnginePowerSorter(const void *a, const void *b)
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
int va = rvi_a->power;
int vb = rvi_b->power;
int va = rvi_a->power << (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
int vb = rvi_b->power << (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
int r = va - vb;
return _internal_sort_order ? -r : r;
@@ -230,8 +227,8 @@ static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class);
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class);
Money va = rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class] * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
Money vb = rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class] * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int r = ClampToI32(va - vb);
return _internal_sort_order ? -r : r;
@@ -248,8 +245,8 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void *
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
* Another thing is that both power and running costs should be doubled for multiheaded engines.
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
Money va = (rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class)) / max(1U, (uint)rvi_a->power);
Money vb = (rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class)) / max(1U, (uint)rvi_b->power);
Money va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max(1U, (uint)rvi_a->power);
Money vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max(1U, (uint)rvi_b->power);
int r = ClampToI32(vb - va);
return _internal_sort_order ? -r : r;
@@ -266,11 +263,8 @@ static int CDECL TrainEngineNumberSorter(const void *a, const void *b)
static int CDECL TrainEngineCapacitySorter(const void *a, const void *b)
{
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
int va = rvi_a->capacity * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int vb = rvi_b->capacity * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int va = RailVehInfo(*(const EngineID*)a)->capacity;
int vb = RailVehInfo(*(const EngineID*)b)->capacity;
int r = va - vb;
if (r == 0) {
@@ -315,12 +309,9 @@ static int CDECL RoadVehEngineSpeedSorter(const void *a, const void *b)
static int CDECL RoadVehEngineRunningCostSorter(const void *a, const void *b)
{
const RoadVehicleInfo *rvi_a = RoadVehInfo(*(const EngineID*)a);
const RoadVehicleInfo *rvi_b = RoadVehInfo(*(const EngineID*)b);
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class);
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class);
int r = ClampToI32(va - vb);
const int va = RoadVehInfo(*(const EngineID*)a)->running_cost;
const int vb = RoadVehInfo(*(const EngineID*)b)->running_cost;
const int r = va - vb;
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
@@ -536,26 +527,6 @@ static const StringID _sort_listing[][11] = {{
INVALID_STRING_ID
}};
static int DrawCargoCapacityInfo(int x, int y, EngineID engine, VehicleType type, bool refittable)
{
uint16 *cap = GetCapacityOfArticulatedParts(engine, type);
for (uint c = 0; c < NUM_CARGO; c++) {
if (cap[c] == 0) continue;
SetDParam(0, c);
SetDParam(1, cap[c]);
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
/* Only show as refittable once */
refittable = false;
}
return y;
}
/* Draw rail wagon specific details */
static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const RailVehicleInfo *rvi)
{
@@ -580,14 +551,6 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const
y += 10;
}
}
/* Running cost */
if (rvi->running_cost_class != 0xFF) {
SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
}
return y;
}
@@ -605,7 +568,7 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
/* Max speed - Engine power */
SetDParam(0, GetEngineProperty(engine_number, 0x09, rvi->max_speed) * 10 / 16);
SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power));
SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power) << multihead);
DrawString(x, y, STR_PURCHASE_INFO_SPEED_POWER, TC_FROMSTRING);
y += 10;
@@ -617,11 +580,9 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
}
/* Running cost */
if (rvi->running_cost_class != 0xFF) {
SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
}
SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost_base) * _price.running_rail[rvi->running_cost_class] >> 8) << multihead);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
/* Powered wagons power - Powered wagons extra weight */
if (rvi->pow_wag_power != 0) {
@@ -646,12 +607,18 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R
y += 10;
/* Running cost */
SetDParam(0, rvi->running_cost * GetPriceByIndex(rvi->running_cost_class) >> 8);
SetDParam(0, rvi->running_cost * _price.roadveh_running >> 8);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
/* Cargo type + capacity */
return DrawCargoCapacityInfo(x, y, engine_number, VEH_ROAD, refittable);
SetDParam(0, rvi->cargo_type);
SetDParam(1, GetEngineProperty(engine_number, 0x0F, rvi->capacity));
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
return y;
}
/* Draw ship specific details */
@@ -742,18 +709,20 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
}
/* Cargo type + capacity, or N/A */
int new_y = DrawCargoCapacityInfo(x, y, engine_number, VEH_TRAIN, refitable);
if (new_y == y) {
if (rvi->capacity == 0) {
SetDParam(0, CT_INVALID);
SetDParam(2, STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
} else {
y = new_y;
int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
SetDParam(0, rvi->cargo_type);
SetDParam(1, (capacity * (CountArticulatedParts(engine_number, true) + 1)) << multihead);
SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
}
break;
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
}
break;
case VEH_ROAD:
y = DrawRoadVehPurchaseInfo(x, y, engine_number, RoadVehInfo(engine_number));
refitable = true;
@@ -806,8 +775,7 @@ static void GenerateBuildTrainList(Window *w)
* Also check to see if the previously selected engine is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when engines become obsolete and are removed */
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_TRAIN) {
for (EngineID eid = 0; eid < NUM_TRAIN_ENGINES; eid++) {
const RailVehicleInfo *rvi = RailVehInfo(eid);
if (bv->filter.railtype != RAILTYPE_END && !HasPowerOnRail(rvi->railtype, bv->filter.railtype)) continue;
@@ -845,8 +813,7 @@ static void GenerateBuildRoadVehList(Window *w)
EngList_RemoveAll(&bv->eng_list);
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_ROAD) {
for (EngineID eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
if (!IsEngineBuildable(eid, VEH_ROAD, _local_player)) continue;
if (!HasBit(bv->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue;
EngList_Add(&bv->eng_list, eid);
@@ -864,8 +831,7 @@ static void GenerateBuildShipList(Window *w)
EngList_RemoveAll(&bv->eng_list);
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_SHIP) {
for (EngineID eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
if (!IsEngineBuildable(eid, VEH_SHIP, _local_player)) continue;
EngList_Add(&bv->eng_list, eid);
@@ -886,8 +852,7 @@ static void GenerateBuildAircraftList(Window *w)
* Also check to see if the previously selected plane is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when planes become obsolete and are removed */
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_AIRCRAFT) {
for (EngineID eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_player)) continue;
/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
if (w->window_number > VEH_END && !CanAircraftUseStation(eid, w->window_number)) continue;
@@ -923,7 +888,7 @@ static void GenerateBuildList(Window *w)
EngList_Sort(&bv->eng_list, _sorter[bv->vehicle_type][bv->sort_criteria]);
}
static void DrawVehicleEngine(VehicleType type, int x, int y, EngineID engine, SpriteID pal)
static void DrawVehicleEngine(byte type, int x, int y, EngineID engine, SpriteID pal)
{
switch (type) {
case VEH_TRAIN: DrawTrainEngine( x, y, engine, pal); break;
@@ -991,6 +956,23 @@ void DrawEngineList(VehicleType type, int x, int y, const EngineList eng_list, u
}
}
static void ExpandPurchaseInfoWidget(Window *w, int expand_by)
{
Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
SetWindowDirty(w);
wi->bottom += expand_by;
for (uint i = BUILD_VEHICLE_WIDGET_BUILD; i < BUILD_VEHICLE_WIDGET_END; i++) {
wi = &w->widget[i];
wi->top += expand_by;
wi->bottom += expand_by;
}
w->height += expand_by;
SetWindowDirty(w);
}
static void DrawBuildVehicleWindow(Window *w)
{
const buildvehicle_d *bv = &WP(w, buildvehicle_d);
@@ -1000,26 +982,19 @@ static void DrawBuildVehicleWindow(Window *w)
SetVScrollCount(w, EngList_Count(&bv->eng_list));
SetDParam(0, bv->filter.railtype + STR_881C_NEW_RAIL_VEHICLES); // This should only affect rail vehicles
/* Set text of sort by dropdown */
w->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[bv->vehicle_type][bv->sort_criteria];
DrawWindowWidgets(w);
DrawEngineList(bv->vehicle_type, w->widget[BUILD_VEHICLE_WIDGET_LIST].left + 2, w->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
DrawEngineList(bv->vehicle_type, 2, 27, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
if (bv->sel_engine != INVALID_ENGINE) {
const Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
int text_end = DrawVehiclePurchaseInfo(2, wi->top + 1, wi->right - wi->left - 2, bv->sel_engine);
if (text_end > wi->bottom) {
SetWindowDirty(w);
ResizeWindowForWidget(w, BUILD_VEHICLE_WIDGET_PANEL, 0, text_end - wi->bottom);
SetWindowDirty(w);
}
if (text_end > wi->bottom) ExpandPurchaseInfoWidget(w, text_end - wi->bottom);
}
DrawSortButtonState(w, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, bv->descending_sort_order ? SBS_DOWN : SBS_UP);
DrawString(85, 15, _sort_listing[bv->vehicle_type][bv->sort_criteria], TC_BLACK);
DoDrawString(bv->descending_sort_order ? DOWNARROW : UPARROW, 69, 15, TC_BLACK);
}
static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
@@ -1035,14 +1010,14 @@ static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
break;
case BUILD_VEHICLE_WIDGET_LIST: {
uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint i = (e->we.click.pt.y - 26) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint num_items = EngList_Count(&bv->eng_list);
bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
SetWindowDirty(w);
break;
}
case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
case BUILD_VEHICLE_WIDGET_SORT_TEXT: case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
ShowDropDownMenu(w, _sort_listing[bv->vehicle_type], bv->sort_criteria, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN, 0, 0);
break;

View File

@@ -37,7 +37,7 @@ CargoPacket::~CargoPacket()
this->count = 0;
}
bool CargoPacket::SameSource(const CargoPacket *cp) const
bool CargoPacket::SameSource(CargoPacket *cp)
{
return this->source_xy == cp->source_xy && this->days_in_transit == cp->days_in_transit && this->paid_for == cp->paid_for;
}
@@ -217,21 +217,19 @@ bool CargoList::MoveTo(CargoList *dest, uint count, CargoList::MoveToAction mta,
/* Can move only part of the packet, so split it into two pieces */
if (mta != MTA_FINAL_DELIVERY) {
CargoPacket *cp_new = new CargoPacket();
Money fs = cp->feeder_share * count / static_cast<uint>(cp->count);
cp->feeder_share -= fs;
cp_new->source = cp->source;
cp_new->source_xy = cp->source_xy;
cp_new->loaded_at_xy = (mta == MTA_CARGO_LOAD) ? data : cp->loaded_at_xy;
cp_new->days_in_transit = cp->days_in_transit;
cp_new->feeder_share = fs;
cp_new->feeder_share = cp->feeder_share / count;
/* When cargo is moved into another vehicle you have *always* paid for it */
cp_new->paid_for = (mta == MTA_CARGO_LOAD) ? false : cp->paid_for;
cp_new->count = count;
dest->packets.push_back(cp_new);
cp->feeder_share /= cp->count - count;
}
cp->count -= count;

View File

@@ -1,6 +1,6 @@
/* $Id$ */
/** @file cargopacket.h */
/** @file cargotype.h */
#ifndef CARGOPACKET_H
#define CARGOPACKET_H
@@ -53,7 +53,7 @@ struct CargoPacket : PoolItem<CargoPacket, CargoPacketID, &_CargoPacket_pool> {
* @param cp the cargo packet to compare to
* @return true if and only if days_in_transit and source_xy are equal
*/
bool SameSource(const CargoPacket *cp) const;
bool SameSource(CargoPacket *cp);
};
/**

View File

@@ -315,7 +315,7 @@ static void ClickTile_Clear(TileIndex tile)
/* not used */
}
static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
static uint32 GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode)
{
return 0;
}

View File

@@ -20,7 +20,6 @@
#include "debug.h"
#include "player_func.h"
#include "player_base.h"
#include "signal_func.h"
#include "table/strings.h"
@@ -209,145 +208,160 @@ DEF_COMMAND(CmdAutofillTimetable);
* as the value from the CMD_* enums.
*/
static const Command _command_proc_table[] = {
{CmdBuildRailroadTrack, CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
{CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
{CmdBuildSingleRail, CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
{CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
{CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
{CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
{CmdBuildRailroadStation, CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
{CmdBuildTrainDepot, CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
{CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
{CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
{CmdTerraformLand, CMD_AUTO}, /* CMD_TERRAFORM_LAND */
{CmdPurchaseLandArea, CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
{CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
{CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
{CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
{CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
{CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
{CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
{CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
{CmdBuildRailroadTrack, CMD_AUTO}, /* 0, CMD_BUILD_RAILROAD_TRACK */
{CmdRemoveRailroadTrack, CMD_AUTO}, /* 1, CMD_REMOVE_RAILROAD_TRACK */
{CmdBuildSingleRail, CMD_AUTO}, /* 2, CMD_BUILD_SINGLE_RAIL */
{CmdRemoveSingleRail, CMD_AUTO}, /* 3, CMD_REMOVE_SINGLE_RAIL */
{CmdLandscapeClear, 0}, /* 4, CMD_LANDSCAPE_CLEAR */
{CmdBuildBridge, CMD_AUTO}, /* 5, CMD_BUILD_BRIDGE */
{CmdBuildRailroadStation, CMD_AUTO}, /* 6, CMD_BUILD_RAILROAD_STATION */
{CmdBuildTrainDepot, CMD_AUTO}, /* 7, CMD_BUILD_TRAIN_DEPOT */
{CmdBuildSingleSignal, CMD_AUTO}, /* 8, CMD_BUILD_SIGNALS */
{CmdRemoveSingleSignal, CMD_AUTO}, /* 9, CMD_REMOVE_SIGNALS */
{CmdTerraformLand, CMD_AUTO}, /* 10, CMD_TERRAFORM_LAND */
{CmdPurchaseLandArea, CMD_AUTO}, /* 11, CMD_PURCHASE_LAND_AREA */
{CmdSellLandArea, 0}, /* 12, CMD_SELL_LAND_AREA */
{CmdBuildTunnel, CMD_AUTO}, /* 13, CMD_BUILD_TUNNEL */
{CmdRemoveFromRailroadStation, 0}, /* 14, CMD_REMOVE_FROM_RAILROAD_STATION */
{CmdConvertRail, 0}, /* 15, CMD_CONVERT_RAILD */
{CmdBuildTrainWaypoint, 0}, /* 16, CMD_BUILD_TRAIN_WAYPOINT */
{CmdRenameWaypoint, 0}, /* 17, CMD_RENAME_WAYPOINT */
{CmdRemoveTrainWaypoint, 0}, /* 18, CMD_REMOVE_TRAIN_WAYPOINT */
{NULL, 0}, /* 19, unused */
{NULL, 0}, /* 20, unused */
{CmdBuildRoadStop, CMD_AUTO}, /* 21, CMD_BUILD_ROAD_STOP */
{CmdRemoveRoadStop, 0}, /* 22, CMD_REMOVE_ROAD_STOP */
{CmdBuildLongRoad, CMD_AUTO}, /* 23, CMD_BUILD_LONG_ROAD */
{CmdRemoveLongRoad, CMD_AUTO}, /* 24, CMD_REMOVE_LONG_ROAD */
{CmdBuildRoad, 0}, /* 25, CMD_BUILD_ROAD */
{CmdRemoveRoad, 0}, /* 26, CMD_REMOVE_ROAD */
{CmdBuildRoadDepot, CMD_AUTO}, /* 27, CMD_BUILD_ROAD_DEPOT */
{NULL, 0}, /* 28, unused */
{CmdBuildAirport, CMD_AUTO}, /* 29, CMD_BUILD_AIRPORT */
{CmdBuildDock, CMD_AUTO}, /* 30, CMD_BUILD_DOCK */
{CmdBuildShipDepot, CMD_AUTO}, /* 31, CMD_BUILD_SHIP_DEPOT */
{CmdBuildBuoy, CMD_AUTO}, /* 32, CMD_BUILD_BUOY */
{CmdPlantTree, CMD_AUTO}, /* 33, CMD_PLANT_TREE */
{CmdBuildRailVehicle, 0}, /* 34, CMD_BUILD_RAIL_VEHICLE */
{CmdMoveRailVehicle, 0}, /* 35, CMD_MOVE_RAIL_VEHICLE */
{CmdStartStopTrain, 0}, /* 36, CMD_START_STOP_TRAIN */
{NULL, 0}, /* 37, unused */
{CmdSellRailWagon, 0}, /* 38, CMD_SELL_RAIL_WAGON */
{CmdSendTrainToDepot, 0}, /* 39, CMD_SEND_TRAIN_TO_DEPOT */
{CmdForceTrainProceed, 0}, /* 40, CMD_FORCE_TRAIN_PROCEED */
{CmdReverseTrainDirection, 0}, /* 41, CMD_REVERSE_TRAIN_DIRECTION */
{CmdBuildRoadStop, CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
{CmdRemoveRoadStop, 0}, /* CMD_REMOVE_ROAD_STOP */
{CmdBuildLongRoad, CMD_AUTO}, /* CMD_BUILD_LONG_ROAD */
{CmdRemoveLongRoad, CMD_AUTO}, /* CMD_REMOVE_LONG_ROAD */
{CmdBuildRoad, 0}, /* CMD_BUILD_ROAD */
{CmdRemoveRoad, 0}, /* CMD_REMOVE_ROAD */
{CmdBuildRoadDepot, CMD_AUTO}, /* CMD_BUILD_ROAD_DEPOT */
{CmdModifyOrder, 0}, /* 42, CMD_MODIFY_ORDER */
{CmdSkipToOrder, 0}, /* 43, CMD_SKIP_TO_ORDER */
{CmdDeleteOrder, 0}, /* 44, CMD_DELETE_ORDER */
{CmdInsertOrder, 0}, /* 45, CMD_INSERT_ORDER */
{CmdBuildAirport, CMD_AUTO}, /* CMD_BUILD_AIRPORT */
{CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
{CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
{CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
{CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
{CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
{CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
{CmdStartStopTrain, 0}, /* CMD_START_STOP_TRAIN */
{CmdChangeServiceInt, 0}, /* 46, CMD_CHANGE_SERVICE_INT */
{CmdSellRailWagon, 0}, /* CMD_SELL_RAIL_WAGON */
{CmdSendTrainToDepot, 0}, /* CMD_SEND_TRAIN_TO_DEPOT */
{CmdForceTrainProceed, 0}, /* CMD_FORCE_TRAIN_PROCEED */
{CmdReverseTrainDirection, 0}, /* CMD_REVERSE_TRAIN_DIRECTION */
{CmdBuildIndustry, 0}, /* 47, CMD_BUILD_INDUSTRY */
{CmdBuildCompanyHQ, CMD_AUTO}, /* 48, CMD_BUILD_COMPANY_HQ */
{CmdSetPlayerFace, 0}, /* 49, CMD_SET_PLAYER_FACE */
{CmdSetPlayerColor, 0}, /* 50, CMD_SET_PLAYER_COLOR */
{CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
{CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
{CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
{CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
{CmdIncreaseLoan, 0}, /* 51, CMD_INCREASE_LOAN */
{CmdDecreaseLoan, 0}, /* 52, CMD_DECREASE_LOAN */
{CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
{CmdWantEnginePreview, 0}, /* 53, CMD_WANT_ENGINE_PREVIEW */
{CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
{CmdBuildCompanyHQ, CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
{CmdSetPlayerFace, 0}, /* CMD_SET_PLAYER_FACE */
{CmdSetPlayerColor, 0}, /* CMD_SET_PLAYER_COLOR */
{CmdNameVehicle, 0}, /* 54, CMD_NAME_VEHICLE */
{CmdRenameEngine, 0}, /* 55, CMD_RENAME_ENGINE */
{CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
{CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
{CmdChangeCompanyName, 0}, /* 56, CMD_CHANGE_COMPANY_NAME */
{CmdChangePresidentName, 0}, /* 57, CMD_CHANGE_PRESIDENT_NAME */
{CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
{CmdRenameStation, 0}, /* 58, CMD_RENAME_STATION */
{CmdNameVehicle, 0}, /* CMD_NAME_VEHICLE */
{CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
{CmdSellAircraft, 0}, /* 59, CMD_SELL_AIRCRAFT */
{CmdStartStopAircraft, 0}, /* 60, CMD_START_STOP_AIRCRAFT */
{CmdChangeCompanyName, 0}, /* CMD_CHANGE_COMPANY_NAME */
{CmdChangePresidentName, 0}, /* CMD_CHANGE_PRESIDENT_NAME */
{CmdBuildAircraft, 0}, /* 61, CMD_BUILD_AIRCRAFT */
{CmdSendAircraftToHangar, 0}, /* 62, CMD_SEND_AIRCRAFT_TO_HANGAR */
{NULL, 0}, /* 63, unused */
{CmdRefitAircraft, 0}, /* 64, CMD_REFIT_AIRCRAFT */
{CmdRenameStation, 0}, /* CMD_RENAME_STATION */
{CmdPlaceSign, 0}, /* 65, CMD_PLACE_SIGN */
{CmdRenameSign, 0}, /* 66, CMD_RENAME_SIGN */
{CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
{CmdStartStopAircraft, 0}, /* CMD_START_STOP_AIRCRAFT */
{CmdBuildRoadVeh, 0}, /* 67, CMD_BUILD_ROAD_VEH */
{CmdStartStopRoadVeh, 0}, /* 68, CMD_START_STOP_ROADVEH */
{CmdSellRoadVeh, 0}, /* 69, CMD_SELL_ROAD_VEH */
{CmdSendRoadVehToDepot, 0}, /* 70, CMD_SEND_ROADVEH_TO_DEPOT */
{CmdTurnRoadVeh, 0}, /* 71, CMD_TURN_ROADVEH */
{CmdRefitRoadVeh, 0}, /* 72, CMD_REFIT_ROAD_VEH */
{CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
{CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
{CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
{CmdPause, CMD_SERVER}, /* 73, CMD_PAUSE */
{CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
{CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
{CmdBuyShareInCompany, 0}, /* 74, CMD_BUY_SHARE_IN_COMPANY */
{CmdSellShareInCompany, 0}, /* 75, CMD_SELL_SHARE_IN_COMPANY */
{CmdBuyCompany, 0}, /* 76, CMD_BUY_COMANY */
{CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
{CmdStartStopRoadVeh, 0}, /* CMD_START_STOP_ROADVEH */
{CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
{CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
{CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
{CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
{CmdBuildTown, CMD_OFFLINE}, /* 77, CMD_BUILD_TOWN */
{NULL, 0}, /* 78, unused */
{NULL, 0}, /* 79, unused */
{CmdRenameTown, CMD_SERVER}, /* 80, CMD_RENAME_TOWN */
{CmdDoTownAction, 0}, /* 81, CMD_DO_TOWN_ACTION */
{CmdPause, CMD_SERVER}, /* CMD_PAUSE */
{CmdSetRoadDriveSide, CMD_SERVER}, /* 82, CMD_SET_ROAD_DRIVE_SIDE */
{NULL, 0}, /* 83, unused */
{NULL, 0}, /* 84, unused */
{CmdChangeDifficultyLevel, CMD_SERVER}, /* 85, CMD_CHANGE_DIFFICULTY_LEVEL */
{CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
{CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
{CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
{CmdStartStopShip, 0}, /* 86, CMD_START_STOP_SHIP */
{CmdSellShip, 0}, /* 87, CMD_SELL_SHIP */
{CmdBuildShip, 0}, /* 88, CMD_BUILD_SHIP */
{CmdSendShipToDepot, 0}, /* 89, CMD_SEND_SHIP_TO_DEPOT */
{NULL, 0}, /* 90, unused */
{CmdRefitShip, 0}, /* 91, CMD_REFIT_SHIP */
{CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
{CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
{CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
{NULL, 0}, /* 92, unused */
{NULL, 0}, /* 93, unused */
{NULL, 0}, /* 94, unused */
{NULL, 0}, /* 95, unused */
{NULL, 0}, /* 96, unused */
{NULL, 0}, /* 97, unused */
{CmdSetRoadDriveSide, CMD_SERVER}, /* CMD_SET_ROAD_DRIVE_SIDE */
{CmdChangeDifficultyLevel, CMD_SERVER}, /* CMD_CHANGE_DIFFICULTY_LEVEL */
{CmdOrderRefit, 0}, /* 98, CMD_ORDER_REFIT */
{CmdCloneOrder, 0}, /* 99, CMD_CLONE_ORDER */
{CmdStartStopShip, 0}, /* CMD_START_STOP_SHIP */
{CmdSellShip, 0}, /* CMD_SELL_SHIP */
{CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
{CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
{CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
{CmdClearArea, 0}, /* 100, CMD_CLEAR_AREA */
{NULL, 0}, /* 101, unused */
{CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
{CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
{CmdMoneyCheat, CMD_OFFLINE}, /* 102, CMD_MONEY_CHEAT */
{CmdBuildCanal, CMD_AUTO}, /* 103, CMD_BUILD_CANAL */
{CmdPlayerCtrl, 0}, /* 104, CMD_PLAYER_CTRL */
{CmdClearArea, 0}, /* CMD_CLEAR_AREA */
{CmdLevelLand, CMD_AUTO}, /* 105, CMD_LEVEL_LAND */
{CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
{CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
{CmdPlayerCtrl, 0}, /* CMD_PLAYER_CTRL */
{CmdLevelLand, CMD_AUTO}, /* CMD_LEVEL_LAND */
{CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
{CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
{CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
{CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
{CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
{CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
{CmdChangePatchSetting, CMD_SERVER}, /* CMD_CHANGE_PATCH_SETTING */
{CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
{CmdCloneVehicle, 0}, /* CMD_CLONE_VEHICLE */
{CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
{CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
{CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
{CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
{CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
{CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
{CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
{CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
{CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
{CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
{CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
{CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
{CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
{CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
{CmdRefitRailVehicle, 0}, /* 106, CMD_REFIT_RAIL_VEHICLE */
{CmdRestoreOrderIndex, 0}, /* 107, CMD_RESTORE_ORDER_INDEX */
{CmdBuildLock, CMD_AUTO}, /* 108, CMD_BUILD_LOCK */
{NULL, 0}, /* 109, unused */
{CmdBuildSignalTrack, CMD_AUTO}, /* 110, CMD_BUILD_SIGNAL_TRACK */
{CmdRemoveSignalTrack, CMD_AUTO}, /* 111, CMD_REMOVE_SIGNAL_TRACK */
{NULL, 0}, /* 112, unused */
{CmdGiveMoney, 0}, /* 113, CMD_GIVE_MONEY */
{CmdChangePatchSetting, CMD_SERVER}, /* 114, CMD_CHANGE_PATCH_SETTING */
{CmdSetAutoReplace, 0}, /* 115, CMD_SET_AUTOREPLACE */
{CmdCloneVehicle, 0}, /* 116, CMD_CLONE_VEHICLE */
{CmdMassStartStopVehicle, 0}, /* 117, CMD_MASS_START_STOP */
{CmdDepotSellAllVehicles, 0}, /* 118, CMD_DEPOT_SELL_ALL_VEHICLES */
{CmdDepotMassAutoReplace, 0}, /* 119, CMD_DEPOT_MASS_AUTOREPLACE */
{CmdCreateGroup, 0}, /* 120, CMD_CREATE_GROUP */
{CmdDeleteGroup, 0}, /* 121, CMD_DELETE_GROUP */
{CmdRenameGroup, 0}, /* 122, CMD_RENAME_GROUP */
{CmdAddVehicleGroup, 0}, /* 123, CMD_ADD_VEHICLE_GROUP */
{CmdAddSharedVehicleGroup, 0}, /* 124, CMD_ADD_SHARE_VEHICLE_GROUP */
{CmdRemoveAllVehiclesGroup, 0}, /* 125, CMD_REMOVE_ALL_VEHICLES_GROUP */
{CmdSetGroupReplaceProtection, 0}, /* 126, CMD_SET_GROUP_REPLACE_PROTECTION */
{CmdMoveOrder, 0}, /* 127, CMD_MOVE_ORDER */
{CmdChangeTimetable, 0}, /* 128, CMD_CHANGE_TIMETABLE */
{CmdSetVehicleOnTime, 0}, /* 129, CMD_SET_VEHICLE_ON_TIME */
{CmdAutofillTimetable, 0}, /* 130, CMD_AUTOFILL_TIMETABLE */
};
/*!
@@ -399,7 +413,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32
CommandProc *proc;
/* Do not even think about executing out-of-bounds tile-commands */
if (!IsValidTile(tile)) {
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
_cmd_text = NULL;
return CMD_ERROR;
}
@@ -411,7 +425,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32
_docommand_recursive++;
/* only execute the test call if it's toplevel, or we're not execing. */
if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) {
if (_docommand_recursive == 1 || !(flags & DC_EXEC) || (flags & DC_FORCETEST) ) {
SetTownRatingTestMode(true);
res = proc(tile, flags & ~DC_EXEC, p1, p2);
SetTownRatingTestMode(false);
@@ -422,7 +436,6 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32
if (_docommand_recursive == 1 &&
!(flags & DC_QUERY_COST) &&
!(flags & DC_BANKRUPT) &&
res.GetCost() != 0 &&
!CheckPlayerHasMoney(res)) {
goto error;
@@ -447,7 +460,7 @@ error:
}
/* if toplevel, subtract the money. */
if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
if (--_docommand_recursive == 0) {
SubtractMoneyFromPlayer(res);
/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
if (tile != 0 && IsValidPlayer(_current_player)) {
@@ -499,7 +512,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
int y = TileY(tile) * TILE_SIZE;
/* Do not even think about executing out-of-bounds tile-commands */
if (!IsValidTile(tile)) {
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
_cmd_text = NULL;
return false;
}
@@ -558,9 +571,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
!(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR)) &&
(cmd & 0xFF) != CMD_PAUSE) {
/* estimate the cost. */
SetTownRatingTestMode(true);
res = proc(tile, flags, p1, p2);
SetTownRatingTestMode(false);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
ShowErrorMessage(_error_message, error_part1, x, y);
@@ -631,9 +642,6 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
SubtractMoneyFromPlayer(res2);
/* update signals if needed */
UpdateSignalsInBuffer();
if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
if (res2.GetCost() != 0 && tile != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
if (_additional_cash_required != 0) {

View File

@@ -106,156 +106,156 @@ public:
* @see _command_proc_table
*/
enum {
CMD_BUILD_RAILROAD_TRACK, ///< build a rail track
CMD_REMOVE_RAILROAD_TRACK, ///< remove a rail track
CMD_BUILD_SINGLE_RAIL, ///< build a single rail track
CMD_REMOVE_SINGLE_RAIL, ///< remove a single rail track
CMD_LANDSCAPE_CLEAR, ///< demolish a tile
CMD_BUILD_BRIDGE, ///< build a bridge
CMD_BUILD_RAILROAD_STATION, ///< build a railroad station
CMD_BUILD_TRAIN_DEPOT, ///< build a train depot
CMD_BUILD_SIGNALS, ///< build a signal
CMD_REMOVE_SIGNALS, ///< remove a signal
CMD_TERRAFORM_LAND, ///< terraform a tile
CMD_PURCHASE_LAND_AREA, ///< purchase a tile
CMD_SELL_LAND_AREA, ///< sell a bought tile before
CMD_BUILD_TUNNEL, ///< build a tunnel
CMD_BUILD_RAILROAD_TRACK = 0, ///< build a rail track
CMD_REMOVE_RAILROAD_TRACK = 1, ///< remove a rail track
CMD_BUILD_SINGLE_RAIL = 2, ///< build a single rail track
CMD_REMOVE_SINGLE_RAIL = 3, ///< remove a single rail track
CMD_LANDSCAPE_CLEAR = 4, ///< demolish a tile
CMD_BUILD_BRIDGE = 5, ///< build a bridge
CMD_BUILD_RAILROAD_STATION = 6, ///< build a railroad station
CMD_BUILD_TRAIN_DEPOT = 7, ///< build a train depot
CMD_BUILD_SIGNALS = 8, ///< build a signal
CMD_REMOVE_SIGNALS = 9, ///< remove a signal
CMD_TERRAFORM_LAND = 10, ///< terraform a tile
CMD_PURCHASE_LAND_AREA = 11, ///< purchase a tile
CMD_SELL_LAND_AREA = 12, ///< sell a bought tile before
CMD_BUILD_TUNNEL = 13, ///< build a tunnel
CMD_REMOVE_FROM_RAILROAD_STATION, ///< remove a tile station
CMD_CONVERT_RAIL, ///< convert a rail type
CMD_REMOVE_FROM_RAILROAD_STATION = 14, ///< remove a tile station
CMD_CONVERT_RAIL = 15, ///< convert a rail type
CMD_BUILD_TRAIN_WAYPOINT, ///< build a waypoint
CMD_RENAME_WAYPOINT, ///< rename a waypoint
CMD_REMOVE_TRAIN_WAYPOINT, ///< remove a waypoint
CMD_BUILD_TRAIN_WAYPOINT = 16, ///< build a waypoint
CMD_RENAME_WAYPOINT = 17, ///< rename a waypoint
CMD_REMOVE_TRAIN_WAYPOINT = 18, ///< remove a waypoint
CMD_BUILD_ROAD_STOP, ///< build a road stop
CMD_REMOVE_ROAD_STOP, ///< remove a road stop
CMD_BUILD_LONG_ROAD, ///< build a complete road (not a "half" one)
CMD_REMOVE_LONG_ROAD, ///< remove a complete road (not a "half" one)
CMD_BUILD_ROAD, ///< build a "half" road
CMD_REMOVE_ROAD, ///< remove a "half" road
CMD_BUILD_ROAD_DEPOT, ///< build a road depot
CMD_BUILD_ROAD_STOP = 21, ///< build a road stop
CMD_REMOVE_ROAD_STOP = 22, ///< remove a road stop
CMD_BUILD_LONG_ROAD = 23, ///< build a complete road (not a "half" one)
CMD_REMOVE_LONG_ROAD = 24, ///< remove a complete road (not a "half" one)
CMD_BUILD_ROAD = 25, ///< build a "half" road
CMD_REMOVE_ROAD = 26, ///< remove a "half" road
CMD_BUILD_ROAD_DEPOT = 27, ///< build a road depot
CMD_BUILD_AIRPORT, ///< build an airport
CMD_BUILD_AIRPORT = 29, ///< build an airport
CMD_BUILD_DOCK, ///< build a dock
CMD_BUILD_DOCK = 30, ///< build a dock
CMD_BUILD_SHIP_DEPOT, ///< build a ship depot
CMD_BUILD_BUOY, ///< build a buoy
CMD_BUILD_SHIP_DEPOT = 31, ///< build a ship depot
CMD_BUILD_BUOY = 32, ///< build a buoy
CMD_PLANT_TREE, ///< plant a tree
CMD_PLANT_TREE = 33, ///< plant a tree
CMD_BUILD_RAIL_VEHICLE, ///< build a rail vehicle
CMD_MOVE_RAIL_VEHICLE, ///< move a rail vehicle (in the depot)
CMD_BUILD_RAIL_VEHICLE = 34, ///< build a rail vehicle
CMD_MOVE_RAIL_VEHICLE = 35, ///< move a rail vehicle (in the depot)
CMD_START_STOP_TRAIN, ///< start or stop a train
CMD_START_STOP_TRAIN = 36, ///< start or stop a train
CMD_SELL_RAIL_WAGON, ///< sell a rail wagon
CMD_SELL_RAIL_WAGON = 38, ///< sell a rail wagon
CMD_SEND_TRAIN_TO_DEPOT, ///< send a train to a depot
CMD_FORCE_TRAIN_PROCEED, ///< proceed a train to pass a red signal
CMD_REVERSE_TRAIN_DIRECTION, ///< turn a train around
CMD_SEND_TRAIN_TO_DEPOT = 39, ///< send a train to a depot
CMD_FORCE_TRAIN_PROCEED = 40, ///< proceed a train to pass a red signal
CMD_REVERSE_TRAIN_DIRECTION = 41, ///< turn a train around
CMD_MODIFY_ORDER, ///< modify an order (like set full-load)
CMD_SKIP_TO_ORDER, ///< skip an order to the next of specific one
CMD_DELETE_ORDER, ///< delete an order
CMD_INSERT_ORDER, ///< insert a new order
CMD_MODIFY_ORDER = 42, ///< modify an order (like set full-load)
CMD_SKIP_TO_ORDER = 43, ///< skip an order to the next of specific one
CMD_DELETE_ORDER = 44, ///< delete an order
CMD_INSERT_ORDER = 45, ///< insert a new order
CMD_CHANGE_SERVICE_INT, ///< change the server interval of a vehicle
CMD_CHANGE_SERVICE_INT = 46, ///< change the server interval of a vehicle
CMD_BUILD_INDUSTRY, ///< build a new industry
CMD_BUILD_INDUSTRY = 47, ///< build a new industry
CMD_BUILD_COMPANY_HQ, ///< build the company headquarter
CMD_SET_PLAYER_FACE, ///< set the face of the player/company
CMD_SET_PLAYER_COLOR, ///< set the color of the player/company
CMD_BUILD_COMPANY_HQ = 48, ///< build the company headquarter
CMD_SET_PLAYER_FACE = 49, ///< set the face of the player/company
CMD_SET_PLAYER_COLOR = 50, ///< set the color of the player/company
CMD_INCREASE_LOAN, ///< increase the loan from the bank
CMD_DECREASE_LOAN, ///< decrease the loan from the bank
CMD_INCREASE_LOAN = 51, ///< increase the loan from the bank
CMD_DECREASE_LOAN = 52, ///< decrease the loan from the bank
CMD_WANT_ENGINE_PREVIEW, ///< confirm the preview of an engine
CMD_WANT_ENGINE_PREVIEW = 53, ///< confirm the preview of an engine
CMD_NAME_VEHICLE, ///< rename a whole vehicle
CMD_RENAME_ENGINE, ///< rename a engine (in the engine list)
CMD_CHANGE_COMPANY_NAME, ///< change the company name
CMD_CHANGE_PRESIDENT_NAME, ///< change the president name
CMD_RENAME_STATION, ///< rename a station
CMD_NAME_VEHICLE = 54, ///< rename a whole vehicle
CMD_RENAME_ENGINE = 55, ///< rename a engine (in the engine list)
CMD_CHANGE_COMPANY_NAME = 56, ///< change the company name
CMD_CHANGE_PRESIDENT_NAME = 57, ///< change the president name
CMD_RENAME_STATION = 58, ///< rename a station
CMD_SELL_AIRCRAFT, ///< sell an aircraft
CMD_START_STOP_AIRCRAFT, ///< start/stop an aircraft
CMD_BUILD_AIRCRAFT, ///< build an aircraft
CMD_SEND_AIRCRAFT_TO_HANGAR, ///< send an aircraft to a hanger
CMD_REFIT_AIRCRAFT, ///< refit the cargo space of an aircraft
CMD_SELL_AIRCRAFT = 59, ///< sell an aircraft
CMD_START_STOP_AIRCRAFT = 60, ///< start/stop an aircraft
CMD_BUILD_AIRCRAFT = 61, ///< build an aircraft
CMD_SEND_AIRCRAFT_TO_HANGAR = 62, ///< send an aircraft to a hanger
CMD_REFIT_AIRCRAFT = 64, ///< refit the cargo space of an aircraft
CMD_PLACE_SIGN, ///< place a sign
CMD_RENAME_SIGN, ///< rename a sign
CMD_PLACE_SIGN = 65, ///< place a sign
CMD_RENAME_SIGN = 66, ///< rename a sign
CMD_BUILD_ROAD_VEH, ///< build a road vehicle
CMD_START_STOP_ROADVEH, ///< start/stop a road vehicle
CMD_SELL_ROAD_VEH, ///< sell a road vehicle
CMD_SEND_ROADVEH_TO_DEPOT, ///< send a road vehicle to the depot
CMD_TURN_ROADVEH, ///< turn a road vehicle around
CMD_REFIT_ROAD_VEH, ///< refit the cargo space of a road vehicle
CMD_BUILD_ROAD_VEH = 67, ///< build a road vehicle
CMD_START_STOP_ROADVEH = 68, ///< start/stop a road vehicle
CMD_SELL_ROAD_VEH = 69, ///< sell a road vehicle
CMD_SEND_ROADVEH_TO_DEPOT = 70, ///< send a road vehicle to the depot
CMD_TURN_ROADVEH = 71, ///< turn a road vehicle around
CMD_REFIT_ROAD_VEH = 72, ///< refit the cargo space of a road vehicle
CMD_PAUSE, ///< pause the game
CMD_PAUSE = 73, ///< pause the game
CMD_BUY_SHARE_IN_COMPANY, ///< buy a share from a company
CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company
CMD_BUY_COMPANY, ///< buy a company which is bankrupt
CMD_BUY_SHARE_IN_COMPANY = 74, ///< buy a share from a company
CMD_SELL_SHARE_IN_COMPANY = 75, ///< sell a share from a company
CMD_BUY_COMPANY = 76, ///< buy a company which is bankrupt
CMD_BUILD_TOWN, ///< build a town
CMD_BUILD_TOWN = 77, ///< build a town
CMD_RENAME_TOWN, ///< rename a town
CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe)
CMD_RENAME_TOWN = 80, ///< rename a town
CMD_DO_TOWN_ACTION = 81, ///< do a action from the town detail window (like advertises or bribe)
CMD_SET_ROAD_DRIVE_SIDE, ///< set the side where the road vehicles drive
CMD_SET_ROAD_DRIVE_SIDE = 82, ///< set the side where the road vehicles drive
CMD_CHANGE_DIFFICULTY_LEVEL, ///< change the difficult of a game (each setting for it own)
CMD_CHANGE_DIFFICULTY_LEVEL = 85, ///< change the difficult of a game (each setting for it own)
CMD_START_STOP_SHIP, ///< start/stop a ship
CMD_SELL_SHIP, ///< sell a ship
CMD_BUILD_SHIP, ///< build a new ship
CMD_SEND_SHIP_TO_DEPOT, ///< send a ship to a depot
CMD_REFIT_SHIP, ///< refit the cargo space of a ship
CMD_START_STOP_SHIP = 86, ///< start/stop a ship
CMD_SELL_SHIP = 87, ///< sell a ship
CMD_BUILD_SHIP = 88, ///< build a new ship
CMD_SEND_SHIP_TO_DEPOT = 89, ///< send a ship to a depot
CMD_REFIT_SHIP = 91, ///< refit the cargo space of a ship
CMD_ORDER_REFIT, ///< change the refit informaction of an order (for "goto depot" )
CMD_CLONE_ORDER, ///< clone (and share) an order
CMD_CLEAR_AREA, ///< clear an area
CMD_ORDER_REFIT = 98, ///< change the refit informaction of an order (for "goto depot" )
CMD_CLONE_ORDER = 99, ///< clone (and share) an order
CMD_CLEAR_AREA = 100, ///< clear an area
CMD_MONEY_CHEAT, ///< do the money cheat
CMD_BUILD_CANAL, ///< build a canal
CMD_MONEY_CHEAT = 102, ///< do the money cheat
CMD_BUILD_CANAL = 103, ///< build a canal
CMD_PLAYER_CTRL, ///< used in multiplayer to create a new player etc.
CMD_LEVEL_LAND, ///< level land
CMD_PLAYER_CTRL = 104, ///< used in multiplayer to create a new player etc.
CMD_LEVEL_LAND = 105, ///< level land
CMD_REFIT_RAIL_VEHICLE, ///< refit the cargo space of a train
CMD_RESTORE_ORDER_INDEX, ///< restore vehicle order-index and service interval
CMD_BUILD_LOCK, ///< build a lock
CMD_REFIT_RAIL_VEHICLE = 106, ///< refit the cargo space of a train
CMD_RESTORE_ORDER_INDEX = 107, ///< restore vehicle order-index and service interval
CMD_BUILD_LOCK = 108, ///< build a lock
CMD_BUILD_SIGNAL_TRACK, ///< add signals along a track (by dragging)
CMD_REMOVE_SIGNAL_TRACK, ///< remove signals along a track (by dragging)
CMD_BUILD_SIGNAL_TRACK = 110, ///< add signals along a track (by dragging)
CMD_REMOVE_SIGNAL_TRACK = 111, ///< remove signals along a track (by dragging)
CMD_GIVE_MONEY, ///< give money to an other player
CMD_CHANGE_PATCH_SETTING, ///< change a patch setting
CMD_GIVE_MONEY = 113, ///< give money to an other player
CMD_CHANGE_PATCH_SETTING = 114, ///< change a patch setting
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry
CMD_SET_AUTOREPLACE = 115, ///< set an autoreplace entry
CMD_CLONE_VEHICLE, ///< clone a vehicle
CMD_MASS_START_STOP, ///< start/stop all vehicles (in a depot)
CMD_DEPOT_SELL_ALL_VEHICLES, ///< sell all vehicles which are in a given depot
CMD_DEPOT_MASS_AUTOREPLACE, ///< force the autoreplace to take action in a given depot
CMD_CLONE_VEHICLE = 116, ///< clone a vehicle
CMD_MASS_START_STOP = 117, ///< start/stop all vehicles (in a depot)
CMD_DEPOT_SELL_ALL_VEHICLES = 118, ///< sell all vehicles which are in a given depot
CMD_DEPOT_MASS_AUTOREPLACE = 119, ///< force the autoreplace to take action in a given depot
CMD_CREATE_GROUP, ///< create a new group
CMD_DELETE_GROUP, ///< delete a group
CMD_RENAME_GROUP, ///< rename a group
CMD_ADD_VEHICLE_GROUP, ///< add a vehicle to a group
CMD_ADD_SHARED_VEHICLE_GROUP, ///< add all other shared vehicles to a group which are missing
CMD_REMOVE_ALL_VEHICLES_GROUP, ///< remove all vehicles from a group
CMD_SET_GROUP_REPLACE_PROTECTION, ///< set the autoreplace-protection for a group
CMD_CREATE_GROUP = 120, ///< create a new group
CMD_DELETE_GROUP = 121, ///< delete a group
CMD_RENAME_GROUP = 122, ///< rename a group
CMD_ADD_VEHICLE_GROUP = 123, ///< add a vehicle to a group
CMD_ADD_SHARED_VEHICLE_GROUP = 124, ///< add all other shared vehicles to a group which are missing
CMD_REMOVE_ALL_VEHICLES_GROUP = 125, ///< remove all vehicles from a group
CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
CMD_MOVE_ORDER, ///< move an order
CMD_CHANGE_TIMETABLE, ///< change the timetable for a vehicle
CMD_SET_VEHICLE_ON_TIME, ///< set the vehicle on time feature (timetable)
CMD_AUTOFILL_TIMETABLE, ///< autofill the timetable
CMD_MOVE_ORDER = 127, ///< move an order
CMD_CHANGE_TIMETABLE = 128, ///< change the timetable for a vehicle
CMD_SET_VEHICLE_ON_TIME = 129, ///< set the vehicle on time feature (timetable)
CMD_AUTOFILL_TIMETABLE = 130, ///< autofill the timetable
};
/**
@@ -264,15 +264,14 @@ enum {
* This enums defines some flags which can be used for the commands.
*/
enum {
DC_EXEC = 0x001, ///< execute the given command
DC_AUTO = 0x002, ///< don't allow building on structures
DC_QUERY_COST = 0x004, ///< query cost only, don't build.
DC_NO_WATER = 0x008, ///< don't allow building on water
DC_NO_RAIL_OVERLAP = 0x010, ///< don't allow overlap of rails (used in buildrail)
DC_AI_BUILDING = 0x020, ///< special building rules for AI
DC_NO_TOWN_RATING = 0x040, ///< town rating does not disallow you from building
DC_BANKRUPT = 0x080, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
DC_AUTOREPLACE = 0x100, ///< autoreplace/autorenew is in progress
DC_EXEC = 0x01, ///< execute the given command
DC_AUTO = 0x02, ///< don't allow building on structures
DC_QUERY_COST = 0x04, ///< query cost only, don't build.
DC_NO_WATER = 0x08, ///< don't allow building on water
DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
DC_AI_BUILDING = 0x20, ///< special building rules for AI
DC_NO_TOWN_RATING = 0x40, ///< town rating does not disallow you from building
DC_FORCETEST = 0x80, ///< force test too.
};
/**

View File

@@ -696,9 +696,8 @@ IConsoleAlias *IConsoleAliasGet(const char *name)
/** copy in an argument into the aliasstream */
static inline int IConsoleCopyInParams(char *dst, const char *src, uint bufpos)
{
/* len is the amount of bytes to add excluding the '\0'-termination */
int len = min(ICON_MAX_STREAMSIZE - bufpos - 1, (uint)strlen(src));
strecpy(dst, src, dst + len);
int len = min(ICON_MAX_STREAMSIZE - bufpos, (uint)strlen(src));
strncpy(dst, src, len);
return len;
}

View File

@@ -426,9 +426,9 @@ DEF_CONSOLE_CMD(ConBan)
}
if (ci != NULL) {
IConsolePrint(_icolour_def, "Client banned");
banip = inet_ntoa(*(struct in_addr *)&ci->client_ip);
SEND_COMMAND(PACKET_SERVER_ERROR)(NetworkFindClientStateFromIndex(index), NETWORK_ERROR_KICKED);
IConsolePrint(_icolour_def, "Client banned");
} else {
IConsolePrint(_icolour_def, "Client not online, banned IP");
}
@@ -537,11 +537,7 @@ DEF_CONSOLE_CMD(ConRcon)
if (argc < 3) return false;
if (_network_server) {
IConsoleCmdExec(argv[2]);
} else {
SEND_COMMAND(PACKET_CLIENT_RCON)(argv[1], argv[2]);
}
SEND_COMMAND(PACKET_CLIENT_RCON)(argv[1], argv[2]);
return true;
}
@@ -814,7 +810,7 @@ DEF_CONSOLE_CMD(ConExec)
if (argc < 2) return false;
_script_file = FioFOpenFile(argv[1], "r", BASE_DIR);
_script_file = fopen(argv[1], "r");
if (_script_file == NULL) {
if (argc == 2 || atoi(argv[2]) != 0) IConsoleError("script file not found");
@@ -838,7 +834,7 @@ DEF_CONSOLE_CMD(ConExec)
IConsoleError("Encountered errror while trying to read from script file");
_script_running = false;
FioFCloseFile(_script_file);
fclose(_script_file);
return true;
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/** @file alloc_func.cpp functions to 'handle' memory allocation errors */
#include "../stdafx.h"
#include "alloc_func.hpp"
/**
* Function to exit with an error message after malloc() or calloc() have failed
* @param size number of bytes we tried to allocate
*/
void MallocError(size_t size)
{
error("Out of memory. Cannot allocate %i bytes", size);
}
/**
* Function to exit with an error message after realloc() have failed
* @param size number of bytes we tried to allocate
*/
void ReallocError(size_t size)
{
error("Out of memory. Cannot reallocate %i bytes", size);
}

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