mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-30 09:59:10 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8a1c079edf | ||
|
ba01583ce3 | ||
|
498e5989d1 | ||
|
ab7b117c50 | ||
|
085b498c28 | ||
|
30eff93341 |
@@ -93,7 +93,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
|
||||
@echo " Going to reconfigure with last known settings..."
|
||||
@echo "----------------"
|
||||
# Make sure we don't lock config.cache
|
||||
@$(shell cat config.cache | sed 's~\\ ~\\\\ ~g') || exit 1
|
||||
@$(shell cat config.cache | sed 's@\\ @\\\\ @g') || exit 1
|
||||
@echo "----------------"
|
||||
@echo "Reconfig done. Please re-execute make."
|
||||
@echo "----------------"
|
||||
|
@@ -20,7 +20,7 @@ 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~")
|
||||
TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@")
|
||||
|
||||
all:
|
||||
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)
|
||||
|
@@ -57,7 +57,7 @@ ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
|
||||
# For more information, please check:
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
|
||||
GCC295_FIX=sed -r 's~^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$~\1\2 \4\6\8\9~g'
|
||||
GCC295_FIX=sed -r 's@^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$@\1\2 \4\6\8\9@g'
|
||||
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
|
||||
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
|
||||
# compiler can't handle that information (just don't ask). So we remove it
|
||||
@@ -65,7 +65,7 @@ GCC295_FIX=sed -r 's~^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;)
|
||||
# Furthermore gcc 2.95 has some trouble with protected and private when
|
||||
# accessing the protected/private stuff of the enclosing class (or the
|
||||
# super class of the enclosing class).
|
||||
GCC295_FIX_2=sed -e 's~\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$~\1~g;s~private:~public:~g;s~protected:~public:~g'
|
||||
GCC295_FIX_2=sed -e 's@\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$@\1@g;s@private:@public:@g;s@protected:@public:@g'
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
@@ -98,7 +98,7 @@ MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d' ')
|
||||
ifdef REVISION
|
||||
# Use specified revision (which should be of the form "r000").
|
||||
REV := $(REVISION)
|
||||
REV_NR := $(shell echo $(REVISION) | sed "s~[^0-9]~~g")
|
||||
REV_NR := $(shell echo $(REVISION) | sed "s@[^0-9]@@g")
|
||||
else
|
||||
# Use autodetected revisions
|
||||
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
|
||||
@@ -143,15 +143,15 @@ endif
|
||||
|
||||
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)'
|
||||
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
|
||||
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
|
||||
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
|
||||
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
|
||||
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
|
||||
|
||||
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
|
||||
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
@@ -182,7 +182,7 @@ endif
|
||||
|
||||
# Convert x:/... paths to /x/... for mingw
|
||||
ifeq ($(OS), MINGW)
|
||||
@cat Makefile.dep.tmp | sed 's~\([a-zA-Z]\):\/~\/\1\/~g' > Makefile.dep.tmp.mingw
|
||||
@cat Makefile.dep.tmp | sed 's@\([a-zA-Z]\):\/@\/\1\/@g' > Makefile.dep.tmp.mingw
|
||||
@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
|
||||
@rm -f Makefile.dep.tmp.mingw
|
||||
endif
|
||||
@@ -211,7 +211,7 @@ endif
|
||||
{ \
|
||||
print $$0 \
|
||||
} \
|
||||
' < Makefile.dep.tmp | sed 's~ *~ ~g;s~ $$~~' | $(SORT) > Makefile.dep
|
||||
' < Makefile.dep.tmp | sed 's@ *@ @g;s@ $$@@' | $(SORT) > Makefile.dep
|
||||
|
||||
$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
|
||||
|
||||
@@ -280,10 +280,10 @@ $(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@!!MODIFIED!!@$(MODIFIED)@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
|
||||
$(Q)cat $(SRC_DIR)/ottdres.rc.in | sed "s@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!DATE!!@`date +%d.%m.%y`@g" > $(SRC_DIR)/ottdres.rc
|
||||
|
||||
FORCE:
|
||||
|
||||
|
@@ -1072,7 +1072,7 @@
|
||||
GetAutoRenewStatus(); true
|
||||
SetAutoRenewStatus(true); false
|
||||
SetAutoRenewStatus(false); true
|
||||
GetAutoRenewMonths(); -6
|
||||
GetAutoRenewMonths(); 6
|
||||
SetAutoRenewMonths(-12); true
|
||||
GetAutoRenewMonths(); -12
|
||||
SetAutoRenewMonths(-12); false
|
||||
|
1785
changelog.txt
1785
changelog.txt
File diff suppressed because it is too large
Load Diff
187
config.lib
187
config.lib
@@ -5,7 +5,7 @@ log() {
|
||||
}
|
||||
|
||||
set_default() {
|
||||
released_version=""
|
||||
released_version="0.7.1-RC2"
|
||||
|
||||
ignore_extra_parameters="0"
|
||||
# We set all kinds of defaults for params. Later on the user can override
|
||||
@@ -415,7 +415,7 @@ save_params() {
|
||||
configure="$CONFIGURE_EXECUTABLE --ignore-extra-parameters"
|
||||
for p in $save_params_array; do
|
||||
eval "v=\"\$$p\""
|
||||
p=`echo "$p" | sed 's~_~-~g;s~\n~~g;s~ ~\\ ~g'`
|
||||
p=`echo "$p" | sed 's@_@-@g;s@\n@@g;s@ @\\ @g'`
|
||||
# Only save those params that aren't empty
|
||||
configure="$configure --$p=\"$v\""
|
||||
done
|
||||
@@ -815,6 +815,7 @@ check_params() {
|
||||
fi
|
||||
|
||||
if [ "$os" = "OSX" ]; then
|
||||
check_osx_sdk
|
||||
# Test on G5
|
||||
|
||||
if [ "$enable_osx_g5" != "0" ]; then
|
||||
@@ -903,7 +904,7 @@ check_params() {
|
||||
doc_dir="$data_dir/docs"
|
||||
fi
|
||||
else
|
||||
doc_dir="`echo $doc_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
doc_dir="`echo $doc_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
if [ "$icon_theme_dir" = "1" ]; then
|
||||
@@ -913,7 +914,7 @@ check_params() {
|
||||
icon_theme_dir=""
|
||||
fi
|
||||
else
|
||||
icon_theme_dir="`echo $icon_theme_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
icon_theme_dir="`echo $icon_theme_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
if [ "$personal_dir" = "1" ]; then
|
||||
@@ -925,7 +926,7 @@ check_params() {
|
||||
personal_dir=".openttd"
|
||||
fi
|
||||
else
|
||||
personal_dir="`echo $personal_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
personal_dir="`echo $personal_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
if [ "$shared_dir" = "1" ]; then
|
||||
@@ -936,7 +937,7 @@ check_params() {
|
||||
shared_dir=""
|
||||
fi
|
||||
else
|
||||
shared_dir="`echo $shared_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
shared_dir="`echo $shared_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
if [ "$man_dir" = "1" ]; then
|
||||
@@ -947,7 +948,7 @@ check_params() {
|
||||
man_dir=""
|
||||
fi
|
||||
else
|
||||
man_dir="`echo $man_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
man_dir="`echo $man_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
if [ "$menu_dir" = "1" ]; then
|
||||
@@ -958,7 +959,7 @@ check_params() {
|
||||
menu_dir=""
|
||||
fi
|
||||
else
|
||||
menu_dir="`echo $menu_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
|
||||
menu_dir="`echo $menu_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
|
||||
fi
|
||||
|
||||
# "set_universal_binary_flags" needs to be before "detect_iconv"
|
||||
@@ -1206,7 +1207,7 @@ make_cflags_and_ldflags() {
|
||||
if [ -n "$sdl_config" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_SDL"
|
||||
# SDL must not add _GNU_SOURCE as it breaks many platforms
|
||||
CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's~-D_GNU_SOURCE[^ ]*~~'`"
|
||||
CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`"
|
||||
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "WINCE" ]; then
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
LIBS="$LIBS `$sdl_config --static-libs`"
|
||||
@@ -1268,7 +1269,7 @@ make_cflags_and_ldflags() {
|
||||
if [ "$os" = "OSX" ]; then
|
||||
# fontconfig_config goes via pkg-config on all systems, which doesn't know --prefix
|
||||
# Also, despite the reason we link to the .a file ourself (because we can't use -static), we do need to ask pkg-config about possible other deps
|
||||
LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s~-lfontconfig~~`"
|
||||
LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s@-lfontconfig@@`"
|
||||
else
|
||||
LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' ' '`"
|
||||
fi
|
||||
@@ -1400,8 +1401,10 @@ make_cflags_and_ldflags() {
|
||||
# Lovely hackish, not?
|
||||
# Btw, this almost always comes from outside the configure, so it is
|
||||
# not something we can control.
|
||||
# Also make makedepend aware of compiler's built-in defines.
|
||||
if [ "$with_makedepend" != "0" ]; then
|
||||
cflags_makedep="` echo "$CFLAGS" | sed 's~ /~ -~g;s~-I[ ]*[^ ]*~~g'`"
|
||||
cflags_makedep="`echo | $cxx_host -E -x c++ -dM - | sed 's@.define @-D@g;s@ .*@ @g;s@(.*)@@g' | tr -d '\r\n'`"
|
||||
cflags_makedep="$cflags_makedep `echo "$CFLAGS" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`"
|
||||
else
|
||||
makedepend=""
|
||||
fi
|
||||
@@ -1617,6 +1620,30 @@ set_universal_binary_flags() {
|
||||
fi
|
||||
}
|
||||
|
||||
check_osx_sdk() {
|
||||
cat > tmp.osx.cpp << EOF
|
||||
#include <AvailabilityMacros.h>
|
||||
#if !defined(MAC_OS_X_VERSION_10_5)
|
||||
# error "Need newer SDK"
|
||||
#endif
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
execute="$cxx_host $CFLAGS -E tmp.osx.cpp -o - 2>&1"
|
||||
eval $execute > /dev/null
|
||||
ret=$?
|
||||
log 2 "executing $execute"
|
||||
log 2 " exit code $ret"
|
||||
rm -f tmp.osx.cpp
|
||||
if [ "$ret" != "0" ]; then
|
||||
log 1 "I couldn't detect any XCode >= 2.5 on your system"
|
||||
log 1 "please install/upgrade your XCode"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_direct_music() {
|
||||
echo "
|
||||
#include <windows.h>
|
||||
@@ -2537,104 +2564,104 @@ make_sed() {
|
||||
# use multiple OBJS_DIR, because all in-between
|
||||
# binaries are stored in there, and nowhere else.
|
||||
SRC_REPLACE="
|
||||
s~!!CC_HOST!!~$cc_host~g;
|
||||
s~!!CXX_HOST!!~$cxx_host~g;
|
||||
s~!!CC_BUILD!!~$cc_build~g;
|
||||
s~!!CXX_BUILD!!~$cxx_build~g;
|
||||
s~!!WINDRES!!~$windres~g;
|
||||
s~!!STRIP!!~$strip $strip_arg~g;
|
||||
s~!!LIPO!!~$lipo~g;
|
||||
s~!!CC_CFLAGS!!~$CC_CFLAGS~g;
|
||||
s~!!CFLAGS!!~$T_CFLAGS~g;
|
||||
s~!!CFLAGS_BUILD!!~$CFLAGS_BUILD~g;
|
||||
s~!!STRGEN_FLAGS!!~$strgen_flags~g;
|
||||
s~!!LIBS!!~$LIBS~g;
|
||||
s~!!LDFLAGS!!~$T_LDFLAGS~g;
|
||||
s~!!BIN_DIR!!~$BIN_DIR~g;
|
||||
s~!!ROOT_DIR!!~$ROOT_DIR~g;
|
||||
s~!!MEDIA_DIR!!~$MEDIA_DIR~g;
|
||||
s~!!SOURCE_LIST!!~$SOURCE_LIST~g;
|
||||
s~!!SRC_OBJS_DIR!!~$SRC_OBJS_DIR~g;
|
||||
s~!!LANG_OBJS_DIR!!~$LANG_OBJS_DIR~g;
|
||||
s~!!SRC_DIR!!~$SRC_DIR~g;
|
||||
s~!!SCRIPT_SRC_DIR!!~$SCRIPT_SRC_DIR~g;
|
||||
s~!!OSXAPP!!~$OSXAPP~g;
|
||||
s~!!LANG_DIR!!~$LANG_DIR~g;
|
||||
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;
|
||||
s~!!BINARY_NAME!!~$binary_name~g;
|
||||
s~!!STRGEN!!~$STRGEN~g;
|
||||
s~!!ENDIAN_CHECK!!~$ENDIAN_CHECK~g;
|
||||
s~!!ENDIAN_FORCE!!~$endian~g;
|
||||
s~!!STAGE!!~$STAGE~g;
|
||||
s~!!MAKEDEPEND!!~$makedepend~g;
|
||||
s~!!CFLAGS_MAKEDEP!!~$cflags_makedep~g;
|
||||
s~!!SORT!!~$sort~g;
|
||||
s~!!CONFIG_CACHE_COMPILER!!~config.cache.compiler~g;
|
||||
s~!!CONFIG_CACHE_LINKER!!~config.cache.linker~g;
|
||||
s~!!CONFIG_CACHE_ENDIAN!!~config.cache.endian~g;
|
||||
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;
|
||||
s~!!OBJS_MM!!~$OBJS_MM~g;
|
||||
s~!!OBJS_RC!!~$OBJS_RC~g;
|
||||
s~!!SRCS!!~$SRCS~g;
|
||||
s~!!OS!!~$os~g;
|
||||
s~!!CONFIGURE_FILES!!~$CONFIGURE_FILES~g;
|
||||
s~!!REVISION!!~$revision~g;
|
||||
s~!!AWK!!~$awk~g;
|
||||
s~!!GCC295!!~$gcc295~g;
|
||||
s~!!DISTCC!!~$distcc~g;
|
||||
s@!!CC_HOST!!@$cc_host@g;
|
||||
s@!!CXX_HOST!!@$cxx_host@g;
|
||||
s@!!CC_BUILD!!@$cc_build@g;
|
||||
s@!!CXX_BUILD!!@$cxx_build@g;
|
||||
s@!!WINDRES!!@$windres@g;
|
||||
s@!!STRIP!!@$strip $strip_arg@g;
|
||||
s@!!LIPO!!@$lipo@g;
|
||||
s@!!CC_CFLAGS!!@$CC_CFLAGS@g;
|
||||
s@!!CFLAGS!!@$T_CFLAGS@g;
|
||||
s@!!CFLAGS_BUILD!!@$CFLAGS_BUILD@g;
|
||||
s@!!STRGEN_FLAGS!!@$strgen_flags@g;
|
||||
s@!!LIBS!!@$LIBS@g;
|
||||
s@!!LDFLAGS!!@$T_LDFLAGS@g;
|
||||
s@!!BIN_DIR!!@$BIN_DIR@g;
|
||||
s@!!ROOT_DIR!!@$ROOT_DIR@g;
|
||||
s@!!MEDIA_DIR!!@$MEDIA_DIR@g;
|
||||
s@!!SOURCE_LIST!!@$SOURCE_LIST@g;
|
||||
s@!!SRC_OBJS_DIR!!@$SRC_OBJS_DIR@g;
|
||||
s@!!LANG_OBJS_DIR!!@$LANG_OBJS_DIR@g;
|
||||
s@!!SRC_DIR!!@$SRC_DIR@g;
|
||||
s@!!SCRIPT_SRC_DIR!!@$SCRIPT_SRC_DIR@g;
|
||||
s@!!OSXAPP!!@$OSXAPP@g;
|
||||
s@!!LANG_DIR!!@$LANG_DIR@g;
|
||||
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;
|
||||
s@!!BINARY_NAME!!@$binary_name@g;
|
||||
s@!!STRGEN!!@$STRGEN@g;
|
||||
s@!!ENDIAN_CHECK!!@$ENDIAN_CHECK@g;
|
||||
s@!!ENDIAN_FORCE!!@$endian@g;
|
||||
s@!!STAGE!!@$STAGE@g;
|
||||
s@!!MAKEDEPEND!!@$makedepend@g;
|
||||
s@!!CFLAGS_MAKEDEP!!@$cflags_makedep@g;
|
||||
s@!!SORT!!@$sort@g;
|
||||
s@!!CONFIG_CACHE_COMPILER!!@config.cache.compiler@g;
|
||||
s@!!CONFIG_CACHE_LINKER!!@config.cache.linker@g;
|
||||
s@!!CONFIG_CACHE_ENDIAN!!@config.cache.endian@g;
|
||||
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;
|
||||
s@!!OBJS_MM!!@$OBJS_MM@g;
|
||||
s@!!OBJS_RC!!@$OBJS_RC@g;
|
||||
s@!!SRCS!!@$SRCS@g;
|
||||
s@!!OS!!@$os@g;
|
||||
s@!!CONFIGURE_FILES!!@$CONFIGURE_FILES@g;
|
||||
s@!!REVISION!!@$revision@g;
|
||||
s@!!AWK!!@$awk@g;
|
||||
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;
|
||||
s@!!ICON_THEME_DIR!!@$prefix_dir/$icon_theme_dir@g;
|
||||
"
|
||||
else
|
||||
SRC_REPLACE="$SRC_REPLACE
|
||||
s#!!ICON_THEME_DIR!!##g;
|
||||
s@!!ICON_THEME_DIR!!@@g;
|
||||
"
|
||||
fi
|
||||
|
||||
if [ "$man_dir" != "" ]; then
|
||||
SRC_REPLACE="$SRC_REPLACE
|
||||
s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
|
||||
s@!!MAN_DIR!!@$prefix_dir/$man_dir@g;
|
||||
"
|
||||
else
|
||||
SRC_REPLACE="$SRC_REPLACE
|
||||
s#!!MAN_DIR!!##g;
|
||||
s@!!MAN_DIR!!@@g;
|
||||
"
|
||||
fi
|
||||
|
||||
if [ "$menu_dir" != "" ]; then
|
||||
SRC_REPLACE="$SRC_REPLACE
|
||||
s#!!MENU_DIR!!#$prefix_dir/$menu_dir#g;
|
||||
s@!!MENU_DIR!!@$prefix_dir/$menu_dir@g;
|
||||
"
|
||||
else
|
||||
SRC_REPLACE="$SRC_REPLACE
|
||||
s#!!MENU_DIR!!##g;
|
||||
s@!!MENU_DIR!!@@g;
|
||||
"
|
||||
fi
|
||||
}
|
||||
|
||||
generate_menu_item() {
|
||||
MENU_REPLACE="
|
||||
s~!!TTD!!~$TTD~g;
|
||||
s~!!MENU_GROUP!!~$menu_group~g;
|
||||
s~!!MENU_NAME!!~$menu_name~g
|
||||
s@!!TTD!!@$TTD@g;
|
||||
s@!!MENU_GROUP!!@$menu_group@g;
|
||||
s@!!MENU_NAME!!@$menu_name@g
|
||||
"
|
||||
log 1 "Generating menu item..."
|
||||
mkdir -p media
|
||||
|
6
configure
vendored
6
configure
vendored
@@ -37,7 +37,7 @@ if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
|
||||
exit 1
|
||||
fi
|
||||
# Make sure we don't lock config.cache
|
||||
cat config.cache | sed 's~\\ ~\\\\ ~g' > cache.tmp
|
||||
cat config.cache | sed 's@\\ @\\\\ @g' > cache.tmp
|
||||
sh cache.tmp
|
||||
rm -f cache.tmp
|
||||
exit $?
|
||||
@@ -59,7 +59,7 @@ STRGEN="strgen$EXE"
|
||||
ENDIAN_CHECK="endian_check$EXE"
|
||||
|
||||
if [ -z "$sort" ]; then
|
||||
PIPE_SORT="sed s~a~a~"
|
||||
PIPE_SORT="sed s@a@a@"
|
||||
else
|
||||
PIPE_SORT="$sort"
|
||||
fi
|
||||
@@ -125,7 +125,7 @@ SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
|
||||
|
||||
# In makefiles, we always use -u for sort
|
||||
if [ -z "$sort" ]; then
|
||||
sort="sed s~a~a~"
|
||||
sort="sed s@a@a@"
|
||||
else
|
||||
sort="$sort -u"
|
||||
fi
|
||||
|
@@ -86,8 +86,8 @@ elif [ -d "$ROOT_DIR/.git" ]; then
|
||||
fi
|
||||
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
|
||||
REV="g`echo $HASH | cut -c1-8`"
|
||||
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~"`
|
||||
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
|
||||
@@ -95,8 +95,8 @@ elif [ -d "$ROOT_DIR/.hg" ]; then
|
||||
fi
|
||||
HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3`
|
||||
REV="h`echo $HASH | cut -c1-8`"
|
||||
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~"`
|
||||
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"
|
||||
|
@@ -1,3 +1,9 @@
|
||||
openttd (0.7.1~RC2) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 21 Mar 2008 14:34:56 +0200
|
||||
|
||||
openttd (0.7.1~RC1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@@ -1,11 +1,11 @@
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "0.7.1-RC1" ; Define application version
|
||||
!define APPVERSION "0.7.1-RC2" ; Define application version
|
||||
!define APPVERSIONINTERNAL "0.7.1.0" ; Define application version in X.X.X.X
|
||||
!define INSTALLERVERSION 59 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!define INSTALLERVERSION 60 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!include ${VERSION_INCLUDE}
|
||||
|
||||
!define APPURLLINK "http://www.openttd.org"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION_FULL}"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
|
||||
|
||||
!define MUI_ICON "..\..\..\media\openttd.ico"
|
||||
!define MUI_UNICON "..\..\..\media\openttd.ico"
|
||||
@@ -112,13 +112,6 @@ Section "!OpenTTD" Section1
|
||||
File ${PATH_ROOT}bin\data\*.grf
|
||||
File ${PATH_ROOT}bin\data\*.obg
|
||||
File ${PATH_ROOT}bin\data\opntitle.dat
|
||||
; Copy scenario files (don't choke if they don't exist)
|
||||
SetOutPath "$INSTDIR\scenario\"
|
||||
File /nonfatal ${PATH_ROOT}bin\scenario\*.scn
|
||||
|
||||
; Copy heightmap files (don't choke if they don't exist)
|
||||
SetOutPath "$INSTDIR\scenario\heightmap\"
|
||||
File /nonfatal ${PATH_ROOT}bin\scenario\heightmap\*.*
|
||||
|
||||
; Copy the scripts
|
||||
SetOutPath "$INSTDIR\scripts\"
|
||||
|
@@ -16,10 +16,10 @@ End Sub
|
||||
|
||||
Sub UpdateFile(modified, 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
|
||||
FindReplaceInFile filename, "!!MODIFIED!!", modified
|
||||
FindReplaceInFile filename, "!!REVISION!!", revision
|
||||
FindReplaceInFile filename, "!!VERSION!!", version
|
||||
FindReplaceInFile filename, "!!DATE!!", cur_date
|
||||
End Sub
|
||||
|
||||
Sub UpdateFiles(version)
|
||||
@@ -32,6 +32,7 @@ Sub UpdateFiles(version)
|
||||
modified = Mid(version, InStrRev(version, Chr(9)) + 1)
|
||||
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
|
||||
Else
|
||||
version = "0.7.1-RC2"
|
||||
revision = 0
|
||||
modified = 1
|
||||
End If
|
||||
|
@@ -203,6 +203,7 @@
|
||||
if (IsRailWaypointTile(tile)) return ::GetRailWaypointBits(tile);
|
||||
if (IsRailStationTile(tile)) return ::TrackToTrackBits(::GetRailStationTrack(tile));
|
||||
if (IsLevelCrossingTile(tile)) return ::GetCrossingRailBits(tile);
|
||||
if (IsRailDepotTile(tile)) return ::TRACK_BIT_NONE;
|
||||
return ::GetTrackBits(tile);
|
||||
}
|
||||
|
||||
|
@@ -293,6 +293,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get all RailTracks on the given tile.
|
||||
* @note A depot has no railtracks.
|
||||
* @param tile The tile to check.
|
||||
* @pre IsRailTile(tile).
|
||||
* @return A bitmask of RailTrack with all RailTracks on the tile.
|
||||
|
@@ -445,12 +445,11 @@ Company *DoStartupNewCompany(bool is_ai)
|
||||
c->inaugurated_year = _cur_year;
|
||||
RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false); // create a random company manager face
|
||||
|
||||
/* Engine renewal settings */
|
||||
c->engine_renew_list = NULL;
|
||||
c->renew_keep_length = false;
|
||||
c->engine_renew = _settings_client.gui.autorenew;
|
||||
c->engine_renew_months = _settings_client.gui.autorenew_months;
|
||||
c->engine_renew_money = _settings_client.gui.autorenew_money;
|
||||
/* Settings for non-ai companies are copied from the client settings later. */
|
||||
if (is_ai) {
|
||||
c->engine_renew_money = 100000;
|
||||
c->engine_renew_months = 6;
|
||||
}
|
||||
|
||||
GeneratePresidentName(c);
|
||||
|
||||
@@ -756,6 +755,9 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
/* This is the client (or non-dedicated server) who wants a new company */
|
||||
if (cid == _network_own_client_id) {
|
||||
/* Create p1 and p2 here because SetLocalCompany resets the gui.autorenew* settings. */
|
||||
uint32 p1 = (_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4;
|
||||
uint32 p2 = _settings_client.gui.autorenew_money;
|
||||
assert(_local_company == COMPANY_SPECTATOR);
|
||||
SetLocalCompany(c->index);
|
||||
if (!StrEmpty(_settings_client.network.default_company_pass)) {
|
||||
@@ -767,13 +769,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
/* Now that we have a new company, broadcast our autorenew settings to
|
||||
* all clients so everything is in sync */
|
||||
NetworkSend_Command(0,
|
||||
(_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
|
||||
_settings_client.gui.autorenew_money,
|
||||
CMD_SET_AUTOREPLACE,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
NetworkSend_Command(0, p1, p2, CMD_SET_AUTOREPLACE, NULL, NULL);
|
||||
|
||||
MarkWholeScreenDirty();
|
||||
}
|
||||
|
@@ -318,7 +318,7 @@ static FORCEINLINE T ROR(const T x, const uint8 n)
|
||||
*/
|
||||
static FORCEINLINE uint32 BSWAP32(uint32 x)
|
||||
{
|
||||
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ >= 3))
|
||||
#if !defined(__ICC) && defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ >= 3))
|
||||
/* GCC >= 4.3 provides a builtin, resulting in faster code */
|
||||
return (uint32)__builtin_bswap32((int32)x);
|
||||
#else
|
||||
|
@@ -187,7 +187,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(uint count, const Con
|
||||
|
||||
this->Send_Packet(p);
|
||||
count -= p_count;
|
||||
content_ids += count;
|
||||
content_ids += p_count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin
|
||||
|
||||
this->Send_Packet(p);
|
||||
count -= p_count;
|
||||
content_ids += count;
|
||||
content_ids += p_count;
|
||||
}
|
||||
|
||||
free(ids);
|
||||
|
@@ -2038,8 +2038,8 @@ static ChangeInfoResult SoundEffectChangeInfo(uint sid, int numinfo, int prop, b
|
||||
case 0x0A: { // Override old sound
|
||||
uint orig_sound = grf_load_byte(&buf);
|
||||
|
||||
if (orig_sound >= GetNumSounds()) {
|
||||
grfmsg(1, "SoundEffectChangeInfo: Original sound %d not defined (max %d)", orig_sound, GetNumSounds());
|
||||
if (orig_sound >= ORIGINAL_SAMPLE_COUNT) {
|
||||
grfmsg(1, "SoundEffectChangeInfo: Original sound %d not defined (max %d)", orig_sound, ORIGINAL_SAMPLE_COUNT);
|
||||
} else {
|
||||
FileEntry *newfe = GetSound(sound);
|
||||
FileEntry *oldfe = GetSound(orig_sound);
|
||||
@@ -5834,10 +5834,25 @@ static void FinaliseHouseArray()
|
||||
|
||||
for (int i = 0; i < HOUSE_MAX; i++) {
|
||||
HouseSpec *hs = file->housespec[i];
|
||||
if (hs != NULL) {
|
||||
_house_mngr.SetEntitySpec(hs);
|
||||
if (hs->min_year < min_year) min_year = hs->min_year;
|
||||
|
||||
if (hs == NULL) continue;
|
||||
|
||||
const HouseSpec *next1 = (i + 1 < HOUSE_MAX ? file->housespec[i + 1] : NULL);
|
||||
const HouseSpec *next2 = (i + 2 < HOUSE_MAX ? file->housespec[i + 2] : NULL);
|
||||
const HouseSpec *next3 = (i + 3 < HOUSE_MAX ? file->housespec[i + 3] : NULL);
|
||||
|
||||
if (((hs->building_flags & BUILDING_HAS_2_TILES) != 0 &&
|
||||
(next1 == NULL || !next1->enabled || (next1->building_flags & BUILDING_HAS_1_TILE) != 0)) ||
|
||||
((hs->building_flags & BUILDING_HAS_4_TILES) != 0 &&
|
||||
(next2 == NULL || !next2->enabled || (next2->building_flags & BUILDING_HAS_1_TILE) != 0 ||
|
||||
next3 == NULL || !next3->enabled || (next3->building_flags & BUILDING_HAS_1_TILE) != 0))) {
|
||||
hs->enabled = false;
|
||||
DEBUG(grf, 1, "FinaliseHouseArray: %s defines house %d as multitile, but no suitable tiles follow. Disabling house.", file->filename, hs->local_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
_house_mngr.SetEntitySpec(hs);
|
||||
if (hs->min_year < min_year) min_year = hs->min_year;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -255,7 +255,7 @@ static uint32 HouseGetVariable(const ResolverObject *object, byte variable, byte
|
||||
case 0x40: return (IsTileType(tile, MP_HOUSE) ? GetHouseBuildingStage(tile) : 0) | TileHash2Bit(TileX(tile), TileY(tile)) << 2;
|
||||
|
||||
/* Building age. */
|
||||
case 0x41: return GetHouseAge(tile);
|
||||
case 0x41: return IsTileType(tile, MP_HOUSE) ? GetHouseAge(tile) : 0;
|
||||
|
||||
/* Town zone */
|
||||
case 0x42: return GetTownRadiusGroup(town, tile);
|
||||
|
@@ -300,9 +300,6 @@ static void InitializeDynamicVariables()
|
||||
*/
|
||||
static void ShutdownGame()
|
||||
{
|
||||
/* stop the AI */
|
||||
AI::Uninitialize(false);
|
||||
|
||||
IConsoleFree();
|
||||
|
||||
if (_network_available) NetworkShutDown(); // Shut down the network and close any open connections
|
||||
@@ -311,6 +308,9 @@ static void ShutdownGame()
|
||||
|
||||
UnInitWindowSystem();
|
||||
|
||||
/* stop the AI */
|
||||
AI::Uninitialize(false);
|
||||
|
||||
/* Uninitialize airport state machines */
|
||||
UnInitializeAirports();
|
||||
|
||||
@@ -745,6 +745,11 @@ static void MakeNewGameDone()
|
||||
/* Create a single company */
|
||||
DoStartupNewCompany(false);
|
||||
|
||||
Company *c = GetCompany(COMPANY_FIRST);
|
||||
c->engine_renew = _settings_client.gui.autorenew;
|
||||
c->engine_renew_months = _settings_client.gui.autorenew_months;
|
||||
c->engine_renew_money = _settings_client.gui.autorenew_money;
|
||||
|
||||
IConsoleCmdExec("exec scripts/game_start.scr 0");
|
||||
|
||||
SetLocalCompany(COMPANY_FIRST);
|
||||
|
@@ -64,8 +64,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,7,0,@@REVISION@@
|
||||
PRODUCTVERSION 0,7,0,@@REVISION@@
|
||||
FILEVERSION 0,7,1,16365
|
||||
PRODUCTVERSION 0,7,1,16365
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -83,14 +83,14 @@ BEGIN
|
||||
VALUE "Comments", "This program is licensed under the GNU General Public License.\0"
|
||||
VALUE "CompanyName", "OpenTTD Development Team\0"
|
||||
VALUE "FileDescription", "OpenTTD\0"
|
||||
VALUE "FileVersion", "Development @@VERSION@@\0"
|
||||
VALUE "FileVersion", "0.7.1-RC2\0"
|
||||
VALUE "InternalName", "openttd\0"
|
||||
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-2009. All Rights Reserved.\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "openttd.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "OpenTTD\0"
|
||||
VALUE "ProductVersion", "Development @@VERSION@@\0"
|
||||
VALUE "ProductVersion", "0.7.1-RC2\0"
|
||||
VALUE "SpecialBuild", "-\0"
|
||||
END
|
||||
END
|
||||
|
@@ -321,6 +321,8 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
case MP_RAILWAY:
|
||||
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
||||
|
||||
if (!IsPlainRailTile(tile)) return CMD_ERROR;
|
||||
|
||||
if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_1001_IMPOSSIBLE_TRACK_COMBINATION);
|
||||
|
||||
if (!CheckTrackCombination(tile, trackbit, flags) ||
|
||||
@@ -554,6 +556,8 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
*/
|
||||
bool FloodHalftile(TileIndex t)
|
||||
{
|
||||
assert(IsPlainRailTile(t));
|
||||
|
||||
bool flooded = false;
|
||||
if (GetRailGroundType(t) == RAIL_GROUND_WATER) return flooded;
|
||||
|
||||
@@ -1043,7 +1047,7 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin
|
||||
end_tile = p1;
|
||||
if (signal_density == 0 || signal_density > 20) return CMD_ERROR;
|
||||
|
||||
if (!IsTileType(tile, MP_RAILWAY)) return CMD_ERROR;
|
||||
if (!IsTileType(tile, MP_RAILWAY) || !IsPlainRailTile(tile)) return CMD_ERROR;
|
||||
|
||||
/* for vertical/horizontal tracks, double the given signals density
|
||||
* since the original amount will be too dense (shorter tracks) */
|
||||
@@ -1169,6 +1173,7 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1
|
||||
|
||||
if (!ValParamTrackOrientation(track) ||
|
||||
!IsTileType(tile, MP_RAILWAY) ||
|
||||
!IsPlainRailTile(tile) ||
|
||||
!HasTrack(tile, track) ||
|
||||
!EnsureNoTrainOnTrack(tile, track) ||
|
||||
!HasSignalOnTrack(tile, track)) {
|
||||
@@ -2175,7 +2180,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_X)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(0, -1);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2190,7 +2195,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_X)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(0, 1);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2206,7 +2211,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_Y)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(-1, 0);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2221,7 +2226,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_Y)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(1, 0);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
|
@@ -989,6 +989,11 @@ public:
|
||||
this->vscroll.count = _railstation.station_count;
|
||||
this->vscroll.cap = 5;
|
||||
this->vscroll.pos = Clamp(_railstation.station_type - 2, 0, this->vscroll.count - this->vscroll.cap);
|
||||
} else {
|
||||
/* New stations are not available, so ensure the default station
|
||||
* type is 'selected'. */
|
||||
_railstation.station_class = STAT_CLASS_DFLT;
|
||||
_railstation.station_type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -141,6 +141,7 @@ static inline void SetRailType(TileIndex t, RailType r)
|
||||
*/
|
||||
static inline TrackBits GetTrackBits(TileIndex tile)
|
||||
{
|
||||
assert(IsPlainRailTile(tile));
|
||||
return (TrackBits)GB(_m[tile].m5, 0, 6);
|
||||
}
|
||||
|
||||
@@ -151,6 +152,7 @@ static inline TrackBits GetTrackBits(TileIndex tile)
|
||||
*/
|
||||
static inline void SetTrackBits(TileIndex t, TrackBits b)
|
||||
{
|
||||
assert(IsPlainRailTile(t));
|
||||
SB(_m[t].m5, 0, 6, b);
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* norev000 is for non-releases that are made on systems without
|
||||
* subversion or sources that are not a checkout of subversion.
|
||||
*/
|
||||
const char _openttd_revision[] = "@@VERSION@@";
|
||||
const char _openttd_revision[] = "0.7.1-RC2";
|
||||
|
||||
/**
|
||||
* Let us know if current build was modified. This detection
|
||||
@@ -30,7 +30,7 @@ const char _openttd_revision[] = "@@VERSION@@";
|
||||
* (compiling from sources without any version control software)
|
||||
* and 2 is for modified revision.
|
||||
*/
|
||||
const byte _openttd_revision_modified = @@MODIFIED@@;
|
||||
const byte _openttd_revision_modified = !!MODIFIED!!;
|
||||
|
||||
/**
|
||||
* The NewGRF revision of OTTD:
|
||||
@@ -45,11 +45,11 @@ const byte _openttd_revision_modified = @@MODIFIED@@;
|
||||
* final release will always have a lower version number than the released
|
||||
* version, thus making comparisions on specific revisions easy.
|
||||
*/
|
||||
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 0 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
|
||||
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 1 << 20 | 0 << 19 | (16365 & ((1 << 19) - 1));
|
||||
|
||||
#ifdef __MORPHOS__
|
||||
/**
|
||||
* Variable used by MorphOS to show the version.
|
||||
*/
|
||||
extern const char morphos_versions_tag[] = "$VER: OpenTTD @@VERSION@@ (@@DATE@@) OpenTTD Team [MorphOS, PowerPC]";
|
||||
extern const char morphos_versions_tag[] = "$VER: OpenTTD 0.7.1-RC2 (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
|
||||
#endif
|
||||
|
@@ -18,7 +18,7 @@
|
||||
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
|
||||
{
|
||||
return (IsTileType(tile, MP_RAILWAY) &&
|
||||
!HasSignals(tile) &&
|
||||
GetRailTileType(tile) == RAIL_TILE_NORMAL &&
|
||||
GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) &&
|
||||
GetFoundationSlope(tile, NULL) == SLOPE_FLAT);
|
||||
}
|
||||
|
@@ -321,6 +321,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
|
||||
if (rt == ROADTYPE_ROAD && HasTileRoadType(tile, ROADTYPE_TRAM) && (flags & DC_EXEC || crossing_check)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
Track railtrack = GetCrossingRailTrack(tile);
|
||||
RoadTypes rts = GetRoadTypes(tile) & ComplementRoadTypes(RoadTypeToRoadTypes(rt));
|
||||
if (rts == ROADTYPES_NONE) {
|
||||
TrackBits tracks = GetCrossingRailBits(tile);
|
||||
@@ -332,7 +333,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
|
||||
/* If we ever get HWAY and it is possible without road then we will need to promote ownership and invalidate town index here, too */
|
||||
}
|
||||
MarkTileDirtyByTile(tile);
|
||||
YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
|
||||
YapfNotifyTrackLayoutChange(tile, railtrack);
|
||||
}
|
||||
return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road * 2);
|
||||
}
|
||||
@@ -549,9 +550,10 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
|
||||
Track railtrack = AxisToTrack(OtherAxis(roaddir));
|
||||
YapfNotifyTrackLayoutChange(tile, railtrack);
|
||||
/* Always add road to the roadtypes (can't draw without it) */
|
||||
bool reserved = HasBit(GetTrackReservation(tile), AxisToTrack(OtherAxis(roaddir)));
|
||||
bool reserved = HasBit(GetTrackReservation(tile), railtrack);
|
||||
MakeRoadCrossing(tile, _current_company, _current_company, GetTileOwner(tile), roaddir, GetRailType(tile), RoadTypeToRoadTypes(rt) | ROADTYPES_ROAD, p2);
|
||||
SetCrossingReservation(tile, reserved);
|
||||
UpdateLevelCrossing(tile, false);
|
||||
|
@@ -235,14 +235,41 @@ static bool InitializeWindowsAndCaches()
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef void (CDECL *SignalHandlerPointer)(int);
|
||||
static SignalHandlerPointer _prev_segfault = NULL;
|
||||
static SignalHandlerPointer _prev_abort = NULL;
|
||||
|
||||
static void CDECL HandleSavegameLoadCrash(int signum);
|
||||
|
||||
/**
|
||||
* Replaces signal handlers of SIGSEGV and SIGABRT
|
||||
* and stores pointers to original handlers in memory.
|
||||
*/
|
||||
static void SetSignalHandlers()
|
||||
{
|
||||
_prev_segfault = signal(SIGSEGV, HandleSavegameLoadCrash);
|
||||
_prev_abort = signal(SIGABRT, HandleSavegameLoadCrash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets signal handlers back to original handlers.
|
||||
*/
|
||||
static void ResetSignalHandlers()
|
||||
{
|
||||
signal(SIGSEGV, _prev_segfault);
|
||||
signal(SIGABRT, _prev_abort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Signal handler used to give a user a more useful report for crashes during
|
||||
* the savegame loading process; especially when there's problems with the
|
||||
* NewGRFs that are required by the savegame.
|
||||
* @param unused well... unused
|
||||
* @param signum received signal
|
||||
*/
|
||||
void CDECL HandleSavegameLoadCrash(int unused)
|
||||
static void CDECL HandleSavegameLoadCrash(int signum)
|
||||
{
|
||||
ResetSignalHandlers();
|
||||
|
||||
char buffer[8192];
|
||||
char *p = buffer;
|
||||
p += seprintf(p, lastof(buffer),
|
||||
@@ -272,6 +299,9 @@ void CDECL HandleSavegameLoadCrash(int unused)
|
||||
}
|
||||
|
||||
ShowInfo(buffer);
|
||||
|
||||
SignalHandlerPointer call = signum == SIGSEGV ? _prev_segfault : _prev_abort;
|
||||
if (call != NULL) call(signum);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,9 +352,7 @@ static void FixOwnerOfRailTrack(TileIndex t)
|
||||
|
||||
bool AfterLoadGame()
|
||||
{
|
||||
typedef void (CDECL *SignalHandlerPointer)(int);
|
||||
SignalHandlerPointer prev_segfault = signal(SIGSEGV, HandleSavegameLoadCrash);
|
||||
SignalHandlerPointer prev_abort = signal(SIGABRT, HandleSavegameLoadCrash);
|
||||
SetSignalHandlers();
|
||||
|
||||
TileIndex map_size = MapSize();
|
||||
Company *c;
|
||||
@@ -433,8 +461,7 @@ bool AfterLoadGame()
|
||||
if (_networking && gcf_res != GLC_ALL_GOOD) {
|
||||
SetSaveLoadError(STR_NETWORK_ERR_CLIENT_NEWGRF_MISMATCH);
|
||||
/* Restore the signals */
|
||||
signal(SIGSEGV, prev_segfault);
|
||||
signal(SIGABRT, prev_abort);
|
||||
ResetSignalHandlers();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -486,8 +513,7 @@ bool AfterLoadGame()
|
||||
if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, UINT_MAX)) {
|
||||
SetSaveLoadError(STR_NO_TOWN_IN_SCENARIO);
|
||||
/* Restore the signals */
|
||||
signal(SIGSEGV, prev_segfault);
|
||||
signal(SIGABRT, prev_abort);
|
||||
ResetSignalHandlers();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -550,8 +576,7 @@ bool AfterLoadGame()
|
||||
SetStationGfx(t, gfx - 170 + GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
|
||||
} else {
|
||||
/* Restore the signals */
|
||||
signal(SIGSEGV, prev_segfault);
|
||||
signal(SIGABRT, prev_abort);
|
||||
ResetSignalHandlers();
|
||||
return false;
|
||||
}
|
||||
SB(_m[t].m6, 3, 3, st);
|
||||
@@ -1801,8 +1826,7 @@ bool AfterLoadGame()
|
||||
|
||||
bool ret = InitializeWindowsAndCaches();
|
||||
/* Restore the signals */
|
||||
signal(SIGSEGV, prev_segfault);
|
||||
signal(SIGABRT, prev_abort);
|
||||
ResetSignalHandlers();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -65,17 +65,17 @@ static const SaveLoadGlobVarList _date_desc[] = {
|
||||
SLEG_CONDVAR(_cur_tileloop_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
|
||||
SLEG_CONDVAR(_cur_tileloop_tile, SLE_UINT32, 6, SL_MAX_VERSION),
|
||||
SLEG_VAR(_disaster_delay, SLE_UINT16),
|
||||
SLEG_VAR(_station_tick_ctr, SLE_UINT16),
|
||||
SLE_CONDNULL(2, 0, 119),
|
||||
SLEG_VAR(_random.state[0], SLE_UINT32),
|
||||
SLEG_VAR(_random.state[1], SLE_UINT32),
|
||||
SLEG_CONDVAR(_cur_town_ctr, SLE_FILE_U8 | SLE_VAR_U32, 0, 9),
|
||||
SLEG_CONDVAR(_cur_town_ctr, SLE_UINT32, 10, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(1, 0, 9),
|
||||
SLE_CONDNULL(4, 10, 119),
|
||||
SLEG_VAR(_cur_company_tick_index, SLE_FILE_U8 | SLE_VAR_U32),
|
||||
SLEG_CONDVAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32, 0, 108),
|
||||
SLEG_CONDVAR(_next_competitor_start, SLE_UINT32, 109, SL_MAX_VERSION),
|
||||
SLEG_VAR(_trees_tick_ctr, SLE_UINT8),
|
||||
SLEG_CONDVAR(_pause_game, SLE_UINT8, 4, SL_MAX_VERSION),
|
||||
SLEG_CONDVAR(_cur_town_iter, SLE_UINT32, 11, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(4, 11, 119),
|
||||
SLEG_END()
|
||||
};
|
||||
|
||||
|
@@ -96,6 +96,17 @@ static void FixTTDMapArray()
|
||||
FixOldMapArray();
|
||||
}
|
||||
|
||||
static void FixTTDDepots()
|
||||
{
|
||||
const Depot *d;
|
||||
FOR_ALL_DEPOTS_FROM(d, 252) {
|
||||
if (!IsRoadDepotTile(d->xy) && !IsRailDepotTile(d->xy) && !IsShipDepotTile(d->xy) && !IsHangarTile(d->xy)) {
|
||||
/** Workaround for SVXConverter bug, depots 252-255 could be invalid */
|
||||
delete d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define FIXNUM(x, y, z) (((((x) << 16) / (y)) + 1) << z)
|
||||
|
||||
static uint32 RemapOldTownName(uint32 townnameparts, byte old_town_name_type)
|
||||
@@ -1260,7 +1271,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
|
||||
uint type = ReadByte(ls);
|
||||
switch (type) {
|
||||
default: return false;
|
||||
case 0x00 /* VEH_INVALID */: v = new (_current_vehicle_id) InvalidVehicle(); break;
|
||||
case 0x00 /* VEH_INVALID */: v = new (_current_vehicle_id) InvalidVehicle(); break;
|
||||
case 0x25 /* MONORAIL */:
|
||||
case 0x20 /* VEH_TRAIN */: v = new (_current_vehicle_id) Train(); break;
|
||||
case 0x21 /* VEH_ROAD */: v = new (_current_vehicle_id) RoadVehicle(); break;
|
||||
@@ -1583,7 +1594,6 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
|
||||
}
|
||||
|
||||
extern TileIndex _cur_tileloop_tile;
|
||||
static uint32 _old_cur_town_ctr;
|
||||
static const OldChunks main_chunk[] = {
|
||||
OCL_ASSERT( OC_TTD, 0 ),
|
||||
OCL_ASSERT( OC_TTO, 0 ),
|
||||
@@ -1618,7 +1628,7 @@ static const OldChunks main_chunk[] = {
|
||||
OCL_ASSERT( OC_TTD, 0x4B26 ),
|
||||
OCL_ASSERT( OC_TTO, 0x3A20 ),
|
||||
|
||||
OCL_VAR ( OC_UINT32, 1, &_old_cur_town_ctr ),
|
||||
OCL_NULL( 4 ), ///< town counter, no longer in use
|
||||
OCL_NULL( 2 ), ///< timer_counter, no longer in use
|
||||
OCL_NULL( 2 ), ///< land_code, no longer in use
|
||||
|
||||
@@ -1707,8 +1717,7 @@ static const OldChunks main_chunk[] = {
|
||||
|
||||
OCL_CNULL( OC_TTD, 144 ), ///< AI cargo-stuff, calculated in InitializeLandscapeVariables
|
||||
OCL_NULL( 2 ), ///< Company indexes of companies, no longer in use
|
||||
|
||||
OCL_VAR ( OC_FILE_U8 | OC_VAR_U16, 1, &_station_tick_ctr ),
|
||||
OCL_NULL( 1 ), ///< Station tick counter, no longer in use
|
||||
|
||||
OCL_VAR ( OC_UINT8, 1, &_settings_game.locale.currency ),
|
||||
OCL_VAR ( OC_UINT8, 1, &_settings_game.locale.units ),
|
||||
@@ -1771,13 +1780,11 @@ bool LoadTTDMain(LoadgameState *ls)
|
||||
DEBUG(oldloader, 3, "Done, converting game data...");
|
||||
|
||||
FixTTDMapArray();
|
||||
FixTTDDepots();
|
||||
|
||||
/* Fix some general stuff */
|
||||
_settings_game.game_creation.landscape = _settings_game.game_creation.landscape & 0xF;
|
||||
|
||||
/* Remap some pointers */
|
||||
_cur_town_ctr = RemapTownIndex(_old_cur_town_ctr);
|
||||
|
||||
/* Fix the game to be compatible with OpenTTD */
|
||||
FixOldTowns();
|
||||
FixOldVehicles();
|
||||
@@ -1814,8 +1821,6 @@ bool LoadTTOMain(LoadgameState *ls)
|
||||
_settings_game.game_creation.landscape = 0;
|
||||
_trees_tick_ctr = 0xFF;
|
||||
|
||||
_cur_town_ctr = RemapTownIndex(_old_cur_town_ctr);
|
||||
|
||||
if (!FixTTOMapArray() || !FixTTOEngines()) {
|
||||
DEBUG(oldloader, 0, "Conversion failed");
|
||||
return false;
|
||||
|
@@ -138,8 +138,8 @@ static void Load_ORDR()
|
||||
|
||||
free(orders);
|
||||
} else if (CheckSavegameVersionOldStyle(5, 2)) {
|
||||
len /= sizeof(uint16);
|
||||
uint16 *orders = MallocT<uint16>(len + 1);
|
||||
len /= sizeof(uint32);
|
||||
uint32 *orders = MallocT<uint32>(len + 1);
|
||||
|
||||
SlArray(orders, len, SLE_UINT32);
|
||||
|
||||
|
@@ -195,9 +195,6 @@ static void Load_STNS()
|
||||
|
||||
SaveLoad_STNS(st);
|
||||
}
|
||||
|
||||
/* This is to ensure all pointers are within the limits of _stations_size */
|
||||
if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
|
||||
}
|
||||
|
||||
static void Save_ROADSTOP()
|
||||
|
@@ -189,11 +189,6 @@ static void Load_TOWN()
|
||||
|
||||
_total_towns++;
|
||||
}
|
||||
|
||||
/* This is to ensure all pointers are within the limits of
|
||||
* the size of the TownPool */
|
||||
if (_cur_town_ctr > GetMaxTownIndex())
|
||||
_cur_town_ctr = 0;
|
||||
}
|
||||
|
||||
extern const ChunkHandler _town_chunk_handlers[] = {
|
||||
|
@@ -698,7 +698,7 @@ void Load_VEHS()
|
||||
case VEH_AIRCRAFT: v = new (index) Aircraft(); break;
|
||||
case VEH_EFFECT: v = new (index) EffectVehicle(); break;
|
||||
case VEH_DISASTER: v = new (index) DisasterVehicle(); break;
|
||||
case VEH_INVALID: v = new (index) InvalidVehicle(); break;
|
||||
case VEH_INVALID: /* Savegame shouldn't contain invalid vehicles */
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
|
||||
|
@@ -20,9 +20,6 @@ MusicFileSettings msf;
|
||||
/* Number of levels of panning per side */
|
||||
#define PANNING_LEVELS 16
|
||||
|
||||
/** The number of sounds in the original sample.cat */
|
||||
static const uint ORIGINAL_SAMPLE_COUNT = 73;
|
||||
|
||||
static void OpenBankFile(const char *filename)
|
||||
{
|
||||
FileEntry *fe = CallocT<FileEntry>(ORIGINAL_SAMPLE_COUNT);
|
||||
|
@@ -110,4 +110,7 @@ enum SoundFx {
|
||||
template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
|
||||
typedef TinyEnumT<SoundFx> SoundFxByte;
|
||||
|
||||
/** The number of sounds in the original sample.cat */
|
||||
static const uint ORIGINAL_SAMPLE_COUNT = 73;
|
||||
|
||||
#endif /* SOUND_TYPE_H */
|
||||
|
@@ -1820,7 +1820,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
if (distant_join && (!_settings_game.station.distant_join_stations || !IsValidStationID(station_to_join))) return CMD_ERROR;
|
||||
|
||||
/* Check if a valid, buildable airport was chosen for construction */
|
||||
if (p1 > lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
|
||||
if (p1 >= lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
|
||||
|
||||
if (!CheckIfAuthorityAllowsNewStation(tile, flags)) {
|
||||
return CMD_ERROR;
|
||||
@@ -2086,8 +2086,8 @@ bool HasStationInUse(StationID station, CompanyID company)
|
||||
|
||||
static CommandCost RemoveBuoy(Station *st, DoCommandFlag flags)
|
||||
{
|
||||
/* XXX: strange stuff */
|
||||
if (!IsValidCompanyID(_current_company)) return_cmd_error(INVALID_STRING_ID);
|
||||
/* XXX: strange stuff, allow clearing as invalid company when clearing landscape */
|
||||
if (!IsValidCompanyID(_current_company) && !(flags & DC_BANKRUPT)) return_cmd_error(INVALID_STRING_ID);
|
||||
|
||||
TileIndex tile = st->dock_tile;
|
||||
|
||||
@@ -2689,7 +2689,11 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
|
||||
return VETSB_CONTINUE;
|
||||
}
|
||||
|
||||
/* this function is called for one station each tick */
|
||||
/**
|
||||
* This function is called for each station once every 250 ticks.
|
||||
* Not all stations will get the tick at the same time.
|
||||
* @param st the station receiving the tick.
|
||||
*/
|
||||
static void StationHandleBigTick(Station *st)
|
||||
{
|
||||
UpdateStationAcceptance(st, true);
|
||||
@@ -2829,11 +2833,6 @@ void OnTick_Station()
|
||||
{
|
||||
if (_game_mode == GM_EDITOR) return;
|
||||
|
||||
uint i = _station_tick_ctr;
|
||||
if (++_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
|
||||
|
||||
if (IsValidStationID(i)) StationHandleBigTick(GetStation(i));
|
||||
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
StationHandleSmallTick(st);
|
||||
@@ -2842,6 +2841,7 @@ void OnTick_Station()
|
||||
* Station index is included so that triggers are not all done
|
||||
* at the same time. */
|
||||
if ((_tick_counter + st->index) % 250 == 0) {
|
||||
StationHandleBigTick(st);
|
||||
StationAnimationTrigger(st, st->xy, STAT_ANIM_250_TICKS);
|
||||
}
|
||||
}
|
||||
@@ -3201,8 +3201,6 @@ void InitializeStations()
|
||||
/* Clean the roadstop pool and create 1 block in it */
|
||||
_RoadStop_pool.CleanPool();
|
||||
_RoadStop_pool.AddBlockToPool();
|
||||
|
||||
_station_tick_ctr = 0;
|
||||
}
|
||||
|
||||
static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
|
||||
|
@@ -22,9 +22,11 @@
|
||||
#include "textbuf_gui.h"
|
||||
#include "genworld.h"
|
||||
#include "tree_map.h"
|
||||
#include "station_map.h"
|
||||
#include "landscape_type.h"
|
||||
#include "tilehighlight_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "waypoint.h"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
@@ -58,11 +60,9 @@ static void GenerateDesertArea(TileIndex end, TileIndex start)
|
||||
|
||||
_generating_world = true;
|
||||
BEGIN_TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
|
||||
if (GetTileType(tile) != MP_WATER) {
|
||||
SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT);
|
||||
DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
|
||||
MarkTileDirtyByTile(tile);
|
||||
}
|
||||
SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT);
|
||||
DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
|
||||
MarkTileDirtyByTile(tile);
|
||||
} END_TILE_LOOP(tile, size_x, size_y, 0);
|
||||
_generating_world = false;
|
||||
}
|
||||
@@ -572,24 +572,34 @@ static OnButtonClick * const _editor_terraform_button_proc[] = {
|
||||
static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
|
||||
{
|
||||
if (confirmed) {
|
||||
Company *c;
|
||||
|
||||
/* Set generating_world to true to get instant-green grass after removing
|
||||
* company property. */
|
||||
_generating_world = true;
|
||||
|
||||
/* Delete all stations owned by a company */
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
if (IsValidCompanyID(st->owner)) delete st;
|
||||
}
|
||||
|
||||
/* Delete all companies */
|
||||
Company *c;
|
||||
FOR_ALL_COMPANIES(c) {
|
||||
ChangeOwnershipOfCompanyItems(c->index, INVALID_OWNER);
|
||||
delete c;
|
||||
}
|
||||
|
||||
_generating_world = false;
|
||||
|
||||
/* Delete all station signs */
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
/* There can be buoys, remove them */
|
||||
if (st->IsBuoy() && IsBuoyTile(st->xy)) DoCommand(st->xy, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
|
||||
if (st->facilities == 0) delete st;
|
||||
}
|
||||
|
||||
/* The same for waypoints */
|
||||
Waypoint *wp;
|
||||
FOR_ALL_WAYPOINTS(wp) {
|
||||
delete wp;
|
||||
}
|
||||
|
||||
MarkWholeScreenDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -784,8 +784,8 @@ static void ToolbarScenDateBackward(Window *w)
|
||||
w->HandleButtonClick(TBSE_DATEBACKWARD);
|
||||
w->SetDirty();
|
||||
|
||||
_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year - 1, MIN_YEAR, MAX_YEAR);
|
||||
SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1));
|
||||
_settings_game.game_creation.starting_year = Clamp(_settings_game.game_creation.starting_year - 1, MIN_YEAR, MAX_YEAR);
|
||||
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
|
||||
}
|
||||
_left_button_clicked = false;
|
||||
}
|
||||
@@ -797,8 +797,8 @@ static void ToolbarScenDateForward(Window *w)
|
||||
w->HandleButtonClick(TBSE_DATEFORWARD);
|
||||
w->SetDirty();
|
||||
|
||||
_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + 1, MIN_YEAR, MAX_YEAR);
|
||||
SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1));
|
||||
_settings_game.game_creation.starting_year = Clamp(_settings_game.game_creation.starting_year + 1, MIN_YEAR, MAX_YEAR);
|
||||
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
|
||||
}
|
||||
_left_button_clicked = false;
|
||||
}
|
||||
@@ -1233,8 +1233,8 @@ public:
|
||||
|
||||
virtual void OnPaint()
|
||||
{
|
||||
this->SetWidgetDisabledState(TBSE_DATEBACKWARD, _settings_newgame.game_creation.starting_year <= MIN_YEAR);
|
||||
this->SetWidgetDisabledState(TBSE_DATEFORWARD, _settings_newgame.game_creation.starting_year >= MAX_YEAR);
|
||||
this->SetWidgetDisabledState(TBSE_DATEBACKWARD, _settings_game.game_creation.starting_year <= MIN_YEAR);
|
||||
this->SetWidgetDisabledState(TBSE_DATEFORWARD, _settings_game.game_creation.starting_year >= MAX_YEAR);
|
||||
|
||||
/* Draw brown-red toolbar bg. */
|
||||
GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB2);
|
||||
@@ -1242,7 +1242,7 @@ public:
|
||||
|
||||
this->DrawWidgets();
|
||||
|
||||
SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1));
|
||||
SetDParam(0, ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
|
||||
DrawStringCenteredTruncated(this->widget[TBSE_DATEBACKWARD].right, this->widget[TBSE_DATEFORWARD].left, 6, STR_00AF, TC_FROMSTRING);
|
||||
|
||||
/* We hide this panel when the toolbar space gets too small */
|
||||
|
@@ -43,6 +43,7 @@ enum BuildingFlags {
|
||||
BUILDING_IS_CHURCH = 1U << 6,
|
||||
BUILDING_IS_STADIUM = 1U << 7,
|
||||
BUILDING_HAS_1_TILE = TILE_SIZE_1x1 | TILE_SIZE_2x1 | TILE_SIZE_1x2 | TILE_SIZE_2x2,
|
||||
BUILDING_HAS_2_TILES = TILE_SIZE_2x1 | TILE_SIZE_1x2 | TILE_SIZE_2x2,
|
||||
BUILDING_2_TILES_X = TILE_SIZE_2x1 | TILE_SIZE_2x2,
|
||||
BUILDING_2_TILES_Y = TILE_SIZE_1x2 | TILE_SIZE_2x2,
|
||||
BUILDING_HAS_4_TILES = TILE_SIZE_2x2,
|
||||
@@ -351,8 +352,6 @@ Town *CalcClosestTownFromTile(TileIndex tile, uint threshold = UINT_MAX);
|
||||
|
||||
extern Town *_cleared_town;
|
||||
extern int _cleared_town_rating;
|
||||
extern uint32 _cur_town_ctr;
|
||||
extern uint32 _cur_town_iter;
|
||||
|
||||
void ResetHouses();
|
||||
|
||||
|
@@ -683,17 +683,12 @@ void OnTick_Town()
|
||||
{
|
||||
if (_game_mode == GM_EDITOR) return;
|
||||
|
||||
/* Make sure each town's tickhandler invocation frequency is about the
|
||||
* same - TOWN_GROWTH_FREQUENCY - independent on the number of towns. */
|
||||
for (_cur_town_iter += GetMaxTownIndex() + 1;
|
||||
_cur_town_iter >= TOWN_GROWTH_FREQUENCY;
|
||||
_cur_town_iter -= TOWN_GROWTH_FREQUENCY) {
|
||||
uint32 i = _cur_town_ctr;
|
||||
|
||||
if (++_cur_town_ctr > GetMaxTownIndex())
|
||||
_cur_town_ctr = 0;
|
||||
|
||||
if (IsValidTownID(i)) TownTickHandler(GetTown(i));
|
||||
Town *t;
|
||||
FOR_ALL_TOWNS(t) {
|
||||
/* Run town tick at regular intervals, but not all at once. */
|
||||
if ((_tick_counter + t->index) % TOWN_GROWTH_FREQUENCY == 0) {
|
||||
TownTickHandler(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2429,7 +2424,7 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t)
|
||||
*/
|
||||
CommandCost CmdDoTownAction(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
{
|
||||
if (!IsValidTownID(p1) || p2 > lengthof(_town_action_proc)) return CMD_ERROR;
|
||||
if (!IsValidTownID(p1) || p2 >= lengthof(_town_action_proc)) return CMD_ERROR;
|
||||
|
||||
Town *t = GetTown(p1);
|
||||
|
||||
@@ -2751,8 +2746,6 @@ void InitializeTowns()
|
||||
s->cargo_type = CT_INVALID;
|
||||
}
|
||||
|
||||
_cur_town_ctr = 0;
|
||||
_cur_town_iter = 0;
|
||||
_total_towns = 0;
|
||||
}
|
||||
|
||||
|
@@ -2383,6 +2383,15 @@ static bool CheckTrainStayInDepot(Vehicle *v)
|
||||
seg_state = _settings_game.pf.reserve_paths ? SIGSEG_PBS : UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
|
||||
}
|
||||
|
||||
/* We are leaving a depot, but have to go to the exact same one; re-enter */
|
||||
if (v->tile == v->dest_tile) {
|
||||
/* We need to have a reservation for this to work. */
|
||||
if (GetDepotWaypointReservation(v->tile)) return true;
|
||||
SetDepotWaypointReservation(v->tile, true);
|
||||
VehicleEnterDepot(v);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only leave when we can reserve a path to our destination. */
|
||||
if (seg_state == SIGSEG_PBS && !TryPathReserve(v) && v->u.rail.force_proceed == 0) {
|
||||
/* No path and no force proceed. */
|
||||
|
@@ -18,10 +18,6 @@ VARDEF byte _age_cargo_skip_counter;
|
||||
/* Also save scrollpos_x, scrollpos_y and zoom */
|
||||
VARDEF uint16 _disaster_delay;
|
||||
|
||||
/* Determines what station to operate on in the
|
||||
* tick handler. */
|
||||
VARDEF uint16 _station_tick_ctr;
|
||||
|
||||
/* Determines how often to run the tree loop */
|
||||
VARDEF byte _trees_tick_ctr;
|
||||
|
||||
|
@@ -1219,13 +1219,12 @@ Trackdir GetVehicleTrackdir(const Vehicle *v)
|
||||
if (IsStandardRoadStopTile(v->tile)) // We'll assume the road vehicle is facing outwards
|
||||
return DiagDirToDiagTrackdir(GetRoadStopDir(v->tile)); // Road vehicle in a station
|
||||
|
||||
if (IsDriveThroughStopTile(v->tile)) return DiagDirToDiagTrackdir(DirToDiagDir(v->direction));
|
||||
/* Drive through road stops / wormholes (tunnels) */
|
||||
if (v->u.road.state > RVSB_TRACKDIR_MASK) return DiagDirToDiagTrackdir(DirToDiagDir(v->direction));
|
||||
|
||||
/* If vehicle's state is a valid track direction (vehicle is not turning around) return it */
|
||||
if (!IsReversingRoadTrackdir((Trackdir)v->u.road.state)) return (Trackdir)v->u.road.state;
|
||||
|
||||
/* Vehicle is turning around, get the direction from vehicle's direction */
|
||||
return DiagDirToDiagTrackdir(DirToDiagDir(v->direction));
|
||||
/* If vehicle's state is a valid track direction (vehicle is not turning around) return it,
|
||||
* otherwise transform it into a valid track direction */
|
||||
return (Trackdir)((IsReversingRoadTrackdir((Trackdir)v->u.road.state)) ? (v->u.road.state - 6) : v->u.road.state);
|
||||
|
||||
/* case VEH_AIRCRAFT: case VEH_EFFECT: case VEH_DISASTER: */
|
||||
default: return INVALID_TRACKDIR;
|
||||
|
@@ -1219,7 +1219,7 @@ const char *FS2OTTD(const TCHAR *name)
|
||||
wchar_t w;
|
||||
int len = MultiByteToWideChar(_codepage, 0, name, 1, &w, 1);
|
||||
if (len != 1) {
|
||||
DEBUG(misc, 0, "[utf8] M2W error converting '%c'. Errno %d", *name, GetLastError());
|
||||
DEBUG(misc, 0, "[utf8] M2W error converting '%c'. Errno %lu", *name, GetLastError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ const TCHAR *OTTD2FS(const char *name)
|
||||
char mb;
|
||||
int len = WideCharToMultiByte(_codepage, 0, (wchar_t*)&c, 1, &mb, 1, NULL, NULL);
|
||||
if (len != 1) {
|
||||
DEBUG(misc, 0, "[utf8] W2M error converting '0x%X'. Errno %d", c, GetLastError());
|
||||
DEBUG(misc, 0, "[utf8] W2M error converting '0x%X'. Errno %lu", c, GetLastError());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,10 @@ protected:
|
||||
};
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @note maximum cost doesn't work with caching enabled
|
||||
* @todo fix maximum cost failing with caching (e.g. FS#2900)
|
||||
*/
|
||||
int m_max_cost;
|
||||
CBlobT<int> m_sig_look_ahead_costs;
|
||||
bool m_disable_cache;
|
||||
@@ -111,7 +115,7 @@ public:
|
||||
|
||||
FORCEINLINE int SwitchCost(TileIndex tile1, TileIndex tile2, DiagDirection exitdir)
|
||||
{
|
||||
if (IsTileType(tile1, MP_RAILWAY) && IsTileType(tile2, MP_RAILWAY)) {
|
||||
if (IsTileType(tile1, MP_RAILWAY) && IsTileType(tile2, MP_RAILWAY) && IsPlainRailTile(tile1) && IsPlainRailTile(tile2)) {
|
||||
bool t1 = KillFirstBit(GetTrackBits(tile1) & DiagdirReachesTracks(ReverseDiagDir(exitdir))) != TRACK_BIT_NONE;
|
||||
bool t2 = KillFirstBit(GetTrackBits(tile2) & DiagdirReachesTracks(exitdir)) != TRACK_BIT_NONE;
|
||||
if (t1 && t2) return Yapf().PfGetSettings().rail_doubleslip_penalty;
|
||||
|
@@ -198,6 +198,16 @@ public:
|
||||
static bool stFindNearestDepotTwoWay(const Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex *depot_tile, bool *reversed)
|
||||
{
|
||||
Tpf pf1;
|
||||
/*
|
||||
* With caching enabled it simply cannot get a reliable result when you
|
||||
* have limited the distance a train may travel. This means that the
|
||||
* cached result does not match uncached result in all cases and that
|
||||
* causes desyncs. So disable caching when finding for a depot that is
|
||||
* nearby. This only happens with automatic servicing of vehicles,
|
||||
* so it will only impact performance when you do not manually set
|
||||
* depot orders and you do not disable automatic servicing.
|
||||
*/
|
||||
if (max_distance != 0) pf1.DisableCache(true);
|
||||
bool result1 = pf1.FindNearestDepotTwoWay(v, t1, td1, t2, td2, max_distance, reverse_penalty, depot_tile, reversed);
|
||||
|
||||
#if DEBUG_YAPF_CACHE
|
||||
|
Reference in New Issue
Block a user