1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-15 18:49:10 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
rubidium
f71e754e5c (svn r15829) -Release: 0.7.0-RC2 2009-03-23 00:22:57 +00:00
336 changed files with 10409 additions and 16256 deletions

View File

@@ -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 " Going to reconfigure with last known settings..."
@echo "----------------" @echo "----------------"
# Make sure we don't lock config.cache # 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 "----------------"
@echo "Reconfig done. Please re-execute make." @echo "Reconfig done. Please re-execute make."
@echo "----------------" @echo "----------------"

View File

@@ -19,8 +19,8 @@ BIN_DIR = "$(ROOT_DIR)/bin"
SRC_DIR = "$(ROOT_DIR)/src" SRC_DIR = "$(ROOT_DIR)/src"
BUNDLE_DIR = "$(ROOT_DIR)/bundle" BUNDLE_DIR = "$(ROOT_DIR)/bundle"
BUNDLES_DIR = "$(ROOT_DIR)/bundles" BUNDLES_DIR = "$(ROOT_DIR)/bundles"
TTD = openttd.exe 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: all:
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD) $(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)

View File

@@ -4,6 +4,7 @@ CC_BUILD = !!CC_BUILD!!
CXX_BUILD = !!CXX_BUILD!! CXX_BUILD = !!CXX_BUILD!!
WINDRES = !!WINDRES!! WINDRES = !!WINDRES!!
STRIP = !!STRIP!! STRIP = !!STRIP!!
CC_CFLAGS = !!CC_CFLAGS!!
CFLAGS = !!CFLAGS!! CFLAGS = !!CFLAGS!!
CFLAGS_BUILD = !!CFLAGS_BUILD!! CFLAGS_BUILD = !!CFLAGS_BUILD!!
LIBS = !!LIBS!! LIBS = !!LIBS!!
@@ -27,6 +28,7 @@ CFLAGS_MAKEDEP= !!CFLAGS_MAKEDEP!!
SORT = !!SORT!! SORT = !!SORT!!
REVISION = !!REVISION!! REVISION = !!REVISION!!
AWK = !!AWK!! AWK = !!AWK!!
GCC295 = !!GCC295!!
CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!! CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!!
CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!! CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!!
CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!! CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!!
@@ -51,6 +53,20 @@ CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SCRIPT_SRC_DIR)
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK) ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
# This 'sed' basicly just removes 'const' from the line if it is a 2+D array
# For more information, please check:
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
GCC295_FIX=sed -r 's~^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$~\1\2 \4\6\8\9~g'
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
# compiler can't handle that information (just don't ask). So we remove it
# and then it compiles happily and without bitching :)
# Furthermore gcc 2.95 has some trouble with protected and private when
# accessing the protected/private stuff of the enclosing class (or the
# super class of the enclosing class).
GCC295_FIX_2=sed -e 's~\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$~\1~g;s~private:~public:~g;s~protected:~public:~g'
# Check if we want to show what we are doing # Check if we want to show what we are doing
ifdef VERBOSE ifdef VERBOSE
Q = Q =
@@ -82,7 +98,7 @@ MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d' ')
ifdef REVISION ifdef REVISION
# Use specified revision (which should be of the form "r000"). # Use specified revision (which should be of the form "r000").
REV := $(REVISION) REV := $(REVISION)
REV_NR := $(shell echo $(REVISION) | sed "s@[^0-9]@@g") REV_NR := $(shell echo $(REVISION) | sed "s~[^0-9]~~g")
else else
# Use autodetected revisions # Use autodetected revisions
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ') REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
@@ -98,7 +114,7 @@ REV_NR := 0
endif endif
# This helps to recompile if flags change # This helps to recompile if flags change
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CFLAGS)" ]; then echo "$(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi ) RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CC_CFLAGS) $(CFLAGS)" ]; then echo "$(CC_CFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi ) RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi ) RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
@@ -127,15 +143,15 @@ endif
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP) $(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)' $(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) $(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)' $(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) $(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)' $(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) $(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)' $(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
@@ -166,7 +182,7 @@ endif
# Convert x:/... paths to /x/... for mingw # Convert x:/... paths to /x/... for mingw
ifeq ($(OS), 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 @cp Makefile.dep.tmp.mingw Makefile.dep.tmp
@rm -f Makefile.dep.tmp.mingw @rm -f Makefile.dep.tmp.mingw
endif endif
@@ -176,7 +192,7 @@ endif
@$(AWK) ' \ @$(AWK) ' \
/^# DO NOT/ { print $$0 ; next} \ /^# DO NOT/ { print $$0 ; next} \
/^#/ {next} \ /^#/ {next} \
/: / { \ /:/ { \
left = NF - 1; \ left = NF - 1; \
for (n = 2; n <= NF; n++) { \ for (n = 2; n <= NF; n++) { \
if (match($$n, "^$(ROOT_DIR)") == 0) { \ if (match($$n, "^$(ROOT_DIR)") == 0) { \
@@ -195,7 +211,7 @@ endif
{ \ { \
print $$0 \ 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 $(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
@@ -210,9 +226,17 @@ endif
# Compile all the files according to the targets # Compile all the files according to the targets
$(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.c=%.c)'
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -c -o $@ $<
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP) $(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)' $(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
ifeq ($(GCC295), 1)
$(Q)$(CXX_HOST) -E $(CFLAGS) $< | $(GCC295_FIX) | $(GCC295_FIX_2) | $(CXX_HOST) $(CFLAGS) -c -o $@ -x c++ -
else
$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $< $(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
endif
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP) $(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)' $(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
@@ -256,10 +280,10 @@ $(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
# Revision files # Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in $(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 $(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: FORCE:

View File

@@ -58,7 +58,7 @@ function Regression::TestInit()
} }
list = AIList(); list = AIList();
list.Sort(AIAbstractList.SORT_BY_VALUE, AIAbstractList.SORT_ASCENDING); list.Sort(AIAbstractList.SORT_BY_VALUE, true);
print(""); print("");
print(" Value Ascending"); print(" Value Ascending");
list.AddItem( 5, 10); list.AddItem( 5, 10);
@@ -93,7 +93,7 @@ function Regression::TestInit()
} }
list = AIList(); list = AIList();
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_DESCENDING); list.Sort(AIAbstractList.SORT_BY_ITEM, false);
print(""); print("");
print(" Item Descending"); print(" Item Descending");
list.AddItem( 5, 10); list.AddItem( 5, 10);
@@ -128,7 +128,7 @@ function Regression::TestInit()
} }
list = AIList(); list = AIList();
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING); list.Sort(AIAbstractList.SORT_BY_ITEM, true);
print(""); print("");
print(" Item Ascending"); print(" Item Ascending");
list.AddItem( 5, 10); list.AddItem( 5, 10);
@@ -220,7 +220,6 @@ function Regression::Airport()
} }
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.COMPANY_SELF)); print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
print(" GetPrice(): " + AIAirport.GetPrice(0));
print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0, AIStation.STATION_JOIN_ADJACENT)); print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0, AIStation.STATION_JOIN_ADJACENT));
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116)); print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116));
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116)); print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116));
@@ -257,15 +256,12 @@ function Regression::Bridge()
print(" Valid Bridges: " + j); print(" Valid Bridges: " + j);
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160)); print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33160));
print(" RemoveBridge(): " + AIBridge.RemoveBridge(33155)); print(" RemoveBridge(): " + AIBridge.RemoveBridge(33155));
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); print(" GetLastErrorString(): " + AIError.GetLastErrorString());
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160)); print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160));
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155)); print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160)); print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33160));
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33155)); print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33155));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33155));
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160)); print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160));
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155)); print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); print(" GetLastErrorString(): " + AIError.GetLastErrorString());
@@ -333,7 +329,6 @@ function Regression::Cargo()
print(" GetCargoIncome(10, 10): " + AICargo.GetCargoIncome(i, 10, 10)); print(" GetCargoIncome(10, 10): " + AICargo.GetCargoIncome(i, 10, 10));
print(" GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(i, 100, 10)); print(" GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(i, 100, 10));
print(" GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(i, 10, 100)); print(" GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(i, 10, 100));
print(" GetRoadVehicleTypeForCargo(): " + AIRoad.GetRoadVehicleTypeForCargo(i));
} }
} }
@@ -545,7 +540,7 @@ function Regression::Industry()
print("--Industry--"); print("--Industry--");
print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount()); print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount());
local list = AIIndustryList(); local list = AIIndustryList();
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING); list.Sort(AIAbstractList.SORT_BY_ITEM, true);
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
if (AIIndustry.IsValidIndustry(i)) j++; if (AIIndustry.IsValidIndustry(i)) j++;
print(" Industry " + i); print(" Industry " + i);
@@ -636,9 +631,6 @@ function Regression::IndustryTypeList()
print(" GetName(): " + AIIndustryType.GetName(i)); print(" GetName(): " + AIIndustryType.GetName(i));
print(" CanBuildIndustry(): " + AIIndustryType.CanBuildIndustry(i)); print(" CanBuildIndustry(): " + AIIndustryType.CanBuildIndustry(i));
print(" CanProspectIndustry(): " + AIIndustryType.CanProspectIndustry(i)); print(" CanProspectIndustry(): " + AIIndustryType.CanProspectIndustry(i));
print(" IsBuiltOnWater(): " + AIIndustryType.IsBuiltOnWater(i));
print(" HasHeliport(): " + AIIndustryType.HasHeliport(i));
print(" HasDock(): " + AIIndustryType.HasDock(i));
} }
} }
@@ -667,7 +659,7 @@ function Regression::List()
print(" HasItem(1050): " + list.HasItem(1050)); print(" HasItem(1050): " + list.HasItem(1050));
print(" HasItem(1051): " + list.HasItem(1051)); print(" HasItem(1051): " + list.HasItem(1051));
print(" IsEmpty(): " + list.IsEmpty()); print(" IsEmpty(): " + list.IsEmpty());
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING); list.Sort(AIAbstractList.SORT_BY_ITEM, true);
print(" List Dump:"); print(" List Dump:");
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i)); print(" " + i + " => " + list.GetValue(i));
@@ -1077,10 +1069,9 @@ function Regression::Sign()
print(" BuildSign(33409, 'Some other Sign'): " + sign_id); print(" BuildSign(33409, 'Some other Sign'): " + sign_id);
print(" RemoveSign(" + sign_id + "): " + AISign.RemoveSign(sign_id)); print(" RemoveSign(" + sign_id + "): " + AISign.RemoveSign(sign_id));
print(""); print("");
local list = AISignList(); print(" GetMaxSignID(): " + AISign.GetMaxSignID());
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING); for (local i = -1; i < AISign.GetMaxSignID() + 1; i++) {
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { if (AISign.IsValidSign(i)) j++;
j++;
print(" Sign " + i); print(" Sign " + i);
print(" IsValidSign(): " + AISign.IsValidSign(i)); print(" IsValidSign(): " + AISign.IsValidSign(i));
print(" GetName(): " + AISign.GetName(i)); print(" GetName(): " + AISign.GetName(i));
@@ -1191,7 +1182,7 @@ function Regression::TileList()
print(""); print("");
print("--TileList--"); print("--TileList--");
print(" Count(): " + list.Count()); print(" Count(): " + list.Count());
list.AddRectangle(34436, 256 * 2 + 34436 + 8); list.AddRectangle(41895 - 256 * 2, 256 * 2 + 41895 + 8);
print(" Count(): " + list.Count()); print(" Count(): " + list.Count());
list.Valuate(AITile.GetHeight); list.Valuate(AITile.GetHeight);
@@ -1202,30 +1193,6 @@ function Regression::TileList()
print(" " + i + " => " + list.GetValue(i)); print(" " + i + " => " + list.GetValue(i));
} }
list.Valuate(AITile.GetCornerHeight, AITile.CORNER_N);
print(" CornerHeight(North): done");
print(" Count(): " + list.Count());
print(" ListDump:");
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AITile.GetMinHeight);
print(" MinHeight(): done");
print(" Count(): " + list.Count());
print(" ListDump:");
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AITile.GetMaxHeight);
print(" MaxHeight(): done");
print(" Count(): " + list.Count());
print(" ListDump:");
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AITile.GetSlope); list.Valuate(AITile.GetSlope);
list.KeepValue(0); list.KeepValue(0);
print(" Slope(): done"); print(" Slope(): done");
@@ -1236,8 +1203,6 @@ function Regression::TileList()
print(" " + i + " => " + list.GetValue(i)); print(" " + i + " => " + list.GetValue(i));
} }
list.Clear();
list.AddRectangle(41895 - 256 * 2, 256 * 2 + 41895 + 8);
list.Valuate(AITile.IsBuildable); list.Valuate(AITile.IsBuildable);
list.KeepValue(1); list.KeepValue(1);
print(" Buildable(): done"); print(" Buildable(): done");
@@ -1347,7 +1312,7 @@ function Regression::Town()
print("--Town--"); print("--Town--");
print(" GetTownCount(): " + AITown.GetTownCount()); print(" GetTownCount(): " + AITown.GetTownCount());
local list = AITownList(); local list = AITownList();
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING); list.Sort(AIAbstractList.SORT_BY_ITEM, true);
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
if (AITown.IsValidTown(i)) j++; if (AITown.IsValidTown(i)) j++;
print(" Town " + i); print(" Town " + i);

View File

@@ -620,7 +620,6 @@
GetAirportHeight(9): -1 GetAirportHeight(9): -1
GetAirportCoverageRadius(9): -1 GetAirportCoverageRadius(9): -1
GetBankBalance(): 100000 GetBankBalance(): 100000
GetPrice(): 84
BuildAirport(): true BuildAirport(): true
IsHangarTile(): false IsHangarTile(): false
IsAirportTile(): true IsAirportTile(): true
@@ -648,70 +647,70 @@
IsValidBridge(): true IsValidBridge(): true
GetName(): Wooden rail bridge GetName(): Wooden rail bridge
GetMaxSpeed(): 32 GetMaxSpeed(): 32
GetPrice(): 15 GetPrice(): 10
GetMaxLength(): 102 GetMaxLength(): 102
GetMinLength(): 2 GetMinLength(): 2
Bridge 1 Bridge 1
IsValidBridge(): true IsValidBridge(): true
GetName(): Concrete rail bridge GetName(): Concrete rail bridge
GetMaxSpeed(): 48 GetMaxSpeed(): 48
GetPrice(): 21 GetPrice(): 15
GetMaxLength(): 4 GetMaxLength(): 4
GetMinLength(): 2 GetMinLength(): 2
Bridge 2 Bridge 2
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel girder rail bridge GetName(): Steel girder rail bridge
GetMaxSpeed(): 64 GetMaxSpeed(): 64
GetPrice(): 27 GetPrice(): 19
GetMaxLength(): 7 GetMaxLength(): 7
GetMinLength(): 2 GetMinLength(): 2
Bridge 3 Bridge 3
IsValidBridge(): true IsValidBridge(): true
GetName(): Reinforced concrete suspension rail bridge GetName(): Reinforced concrete suspension rail bridge
GetMaxSpeed(): 80 GetMaxSpeed(): 80
GetPrice(): 32 GetPrice(): 22
GetMaxLength(): 12 GetMaxLength(): 12
GetMinLength(): 4 GetMinLength(): 4
Bridge 4 Bridge 4
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel suspension rail bridge GetName(): Steel suspension rail bridge
GetMaxSpeed(): 96 GetMaxSpeed(): 96
GetPrice(): 35 GetPrice(): 25
GetMaxLength(): 102 GetMaxLength(): 102
GetMinLength(): 5 GetMinLength(): 5
Bridge 5 Bridge 5
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel suspension rail bridge GetName(): Steel suspension rail bridge
GetMaxSpeed(): 112 GetMaxSpeed(): 112
GetPrice(): 36 GetPrice(): 26
GetMaxLength(): 102 GetMaxLength(): 102
GetMinLength(): 5 GetMinLength(): 5
Bridge 6 Bridge 6
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel cantilever rail bridge GetName(): Steel cantilever rail bridge
GetMaxSpeed(): 160 GetMaxSpeed(): 160
GetPrice(): 42 GetPrice(): 30
GetMaxLength(): 9 GetMaxLength(): 9
GetMinLength(): 5 GetMinLength(): 5
Bridge 7 Bridge 7
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel cantilever rail bridge GetName(): Steel cantilever rail bridge
GetMaxSpeed(): 208 GetMaxSpeed(): 208
GetPrice(): 44 GetPrice(): 31
GetMaxLength(): 10 GetMaxLength(): 10
GetMinLength(): 5 GetMinLength(): 5
Bridge 8 Bridge 8
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel cantilever rail bridge GetName(): Steel cantilever rail bridge
GetMaxSpeed(): 240 GetMaxSpeed(): 240
GetPrice(): 47 GetPrice(): 33
GetMaxLength(): 11 GetMaxLength(): 11
GetMinLength(): 5 GetMinLength(): 5
Bridge 9 Bridge 9
IsValidBridge(): true IsValidBridge(): true
GetName(): Steel girder rail bridge GetName(): Steel girder rail bridge
GetMaxSpeed(): 256 GetMaxSpeed(): 256
GetPrice(): 45 GetPrice(): 32
GetMaxLength(): 4 GetMaxLength(): 4
GetMinLength(): 2 GetMinLength(): 2
Bridge 10 Bridge 10
@@ -744,15 +743,12 @@
GetMinLength(): -1 GetMinLength(): -1
Valid Bridges: 10 Valid Bridges: 10
IsBridgeTile(): false IsBridgeTile(): false
GetBridgeID(): -1
RemoveBridge(): false RemoveBridge(): false
GetLastErrorString(): ERR_PRECONDITION_FAILED GetLastErrorString(): ERR_PRECONDITION_FAILED
GetOtherBridgeEnd(): -1 GetOtherBridgeEnd(): -1
BuildBridge(): true BuildBridge(): true
IsBridgeTile(): true IsBridgeTile(): true
GetBridgeID(): 5
IsBridgeTile(): true IsBridgeTile(): true
GetBridgeID(): 5
GetOtherBridgeEnd(): 33155 GetOtherBridgeEnd(): 33155
BuildBridge(): false BuildBridge(): false
GetLastErrorString(): ERR_ALREADY_BUILT GetLastErrorString(): ERR_ALREADY_BUILT
@@ -773,16 +769,16 @@
1 => 48 1 => 48
0 => 32 0 => 32
Price ListDump: Price ListDump:
8 => 47 8 => 33
9 => 45 9 => 32
7 => 44 7 => 31
6 => 42 6 => 30
5 => 36 5 => 26
4 => 35 4 => 25
3 => 32 3 => 22
2 => 27 2 => 19
1 => 21 1 => 15
0 => 15 0 => 10
MaxLength ListDump: MaxLength ListDump:
5 => 102 5 => 102
4 => 102 4 => 102
@@ -813,9 +809,9 @@
4 => 96 4 => 96
0 => 32 0 => 32
Price ListDump: Price ListDump:
5 => 220 5 => 73
4 => 212 4 => 70
0 => 91 0 => 30
--AICargo-- --AICargo--
Cargo -1 Cargo -1
@@ -828,7 +824,6 @@
GetCargoIncome(10, 10): -1 GetCargoIncome(10, 10): -1
GetCargoIncome(100, 10): -1 GetCargoIncome(100, 10): -1
GetCargoIncome(10, 100): -1 GetCargoIncome(10, 100): -1
GetRoadVehicleTypeForCargo(): 1
Cargo 0 Cargo 0
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'PASS' GetCargoLabel(): 'PASS'
@@ -839,7 +834,6 @@
GetCargoIncome(10, 10): 3 GetCargoIncome(10, 10): 3
GetCargoIncome(100, 10): 39 GetCargoIncome(100, 10): 39
GetCargoIncome(10, 100): 3 GetCargoIncome(10, 100): 3
GetRoadVehicleTypeForCargo(): 0
Cargo 1 Cargo 1
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'COAL' GetCargoLabel(): 'COAL'
@@ -850,7 +844,6 @@
GetCargoIncome(10, 10): 7 GetCargoIncome(10, 10): 7
GetCargoIncome(100, 10): 75 GetCargoIncome(100, 10): 75
GetCargoIncome(10, 100): 6 GetCargoIncome(10, 100): 6
GetRoadVehicleTypeForCargo(): 1
Cargo 2 Cargo 2
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'MAIL' GetCargoLabel(): 'MAIL'
@@ -861,7 +854,6 @@
GetCargoIncome(10, 10): 5 GetCargoIncome(10, 10): 5
GetCargoIncome(100, 10): 58 GetCargoIncome(100, 10): 58
GetCargoIncome(10, 100): 5 GetCargoIncome(10, 100): 5
GetRoadVehicleTypeForCargo(): 1
Cargo 3 Cargo 3
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'OIL_' GetCargoLabel(): 'OIL_'
@@ -872,7 +864,6 @@
GetCargoIncome(10, 10): 5 GetCargoIncome(10, 10): 5
GetCargoIncome(100, 10): 56 GetCargoIncome(100, 10): 56
GetCargoIncome(10, 100): 5 GetCargoIncome(10, 100): 5
GetRoadVehicleTypeForCargo(): 1
Cargo 4 Cargo 4
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'LVST' GetCargoLabel(): 'LVST'
@@ -883,7 +874,6 @@
GetCargoIncome(10, 10): 5 GetCargoIncome(10, 10): 5
GetCargoIncome(100, 10): 55 GetCargoIncome(100, 10): 55
GetCargoIncome(10, 100): 4 GetCargoIncome(10, 100): 4
GetRoadVehicleTypeForCargo(): 1
Cargo 5 Cargo 5
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'GOOD' GetCargoLabel(): 'GOOD'
@@ -894,7 +884,6 @@
GetCargoIncome(10, 10): 7 GetCargoIncome(10, 10): 7
GetCargoIncome(100, 10): 78 GetCargoIncome(100, 10): 78
GetCargoIncome(10, 100): 6 GetCargoIncome(10, 100): 6
GetRoadVehicleTypeForCargo(): 1
Cargo 6 Cargo 6
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'GRAI' GetCargoLabel(): 'GRAI'
@@ -905,7 +894,6 @@
GetCargoIncome(10, 10): 6 GetCargoIncome(10, 10): 6
GetCargoIncome(100, 10): 60 GetCargoIncome(100, 10): 60
GetCargoIncome(10, 100): 5 GetCargoIncome(10, 100): 5
GetRoadVehicleTypeForCargo(): 1
Cargo 7 Cargo 7
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'WOOD' GetCargoLabel(): 'WOOD'
@@ -916,7 +904,6 @@
GetCargoIncome(10, 10): 6 GetCargoIncome(10, 10): 6
GetCargoIncome(100, 10): 63 GetCargoIncome(100, 10): 63
GetCargoIncome(10, 100): 5 GetCargoIncome(10, 100): 5
GetRoadVehicleTypeForCargo(): 1
Cargo 8 Cargo 8
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'IORE' GetCargoLabel(): 'IORE'
@@ -927,7 +914,6 @@
GetCargoIncome(10, 10): 6 GetCargoIncome(10, 10): 6
GetCargoIncome(100, 10): 65 GetCargoIncome(100, 10): 65
GetCargoIncome(10, 100): 5 GetCargoIncome(10, 100): 5
GetRoadVehicleTypeForCargo(): 1
Cargo 9 Cargo 9
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'STEL' GetCargoLabel(): 'STEL'
@@ -938,7 +924,6 @@
GetCargoIncome(10, 10): 7 GetCargoIncome(10, 10): 7
GetCargoIncome(100, 10): 72 GetCargoIncome(100, 10): 72
GetCargoIncome(10, 100): 6 GetCargoIncome(10, 100): 6
GetRoadVehicleTypeForCargo(): 1
Cargo 10 Cargo 10
IsValidCargo(): true IsValidCargo(): true
GetCargoLabel(): 'VALU' GetCargoLabel(): 'VALU'
@@ -949,7 +934,6 @@
GetCargoIncome(10, 10): 9 GetCargoIncome(10, 10): 9
GetCargoIncome(100, 10): 94 GetCargoIncome(100, 10): 94
GetCargoIncome(10, 100): 7 GetCargoIncome(10, 100): 7
GetRoadVehicleTypeForCargo(): 1
Cargo 11 Cargo 11
IsValidCargo(): false IsValidCargo(): false
GetCargoLabel(): '(null : 0x00000000)' GetCargoLabel(): '(null : 0x00000000)'
@@ -960,7 +944,6 @@
GetCargoIncome(10, 10): -1 GetCargoIncome(10, 10): -1
GetCargoIncome(100, 10): -1 GetCargoIncome(100, 10): -1
GetCargoIncome(10, 100): -1 GetCargoIncome(10, 100): -1
GetRoadVehicleTypeForCargo(): 1
Cargo 12 Cargo 12
IsValidCargo(): false IsValidCargo(): false
GetCargoLabel(): '(null : 0x00000000)' GetCargoLabel(): '(null : 0x00000000)'
@@ -971,7 +954,6 @@
GetCargoIncome(10, 10): -1 GetCargoIncome(10, 10): -1
GetCargoIncome(100, 10): -1 GetCargoIncome(100, 10): -1
GetCargoIncome(10, 100): -1 GetCargoIncome(10, 100): -1
GetRoadVehicleTypeForCargo(): 1
Cargo 13 Cargo 13
IsValidCargo(): false IsValidCargo(): false
GetCargoLabel(): '(null : 0x00000000)' GetCargoLabel(): '(null : 0x00000000)'
@@ -982,7 +964,6 @@
GetCargoIncome(10, 10): -1 GetCargoIncome(10, 10): -1
GetCargoIncome(100, 10): -1 GetCargoIncome(100, 10): -1
GetCargoIncome(10, 100): -1 GetCargoIncome(10, 100): -1
GetRoadVehicleTypeForCargo(): 1
Cargo 14 Cargo 14
IsValidCargo(): false IsValidCargo(): false
GetCargoLabel(): '(null : 0x00000000)' GetCargoLabel(): '(null : 0x00000000)'
@@ -993,7 +974,6 @@
GetCargoIncome(10, 10): -1 GetCargoIncome(10, 10): -1
GetCargoIncome(100, 10): -1 GetCargoIncome(100, 10): -1
GetCargoIncome(10, 100): -1 GetCargoIncome(10, 100): -1
GetRoadVehicleTypeForCargo(): 1
--CargoList-- --CargoList--
Count(): 11 Count(): 11
@@ -1072,7 +1052,7 @@
GetAutoRenewStatus(); true GetAutoRenewStatus(); true
SetAutoRenewStatus(true); false SetAutoRenewStatus(true); false
SetAutoRenewStatus(false); true SetAutoRenewStatus(false); true
GetAutoRenewMonths(); 6 GetAutoRenewMonths(); -6
SetAutoRenewMonths(-12); true SetAutoRenewMonths(-12); true
GetAutoRenewMonths(); -12 GetAutoRenewMonths(); -12
SetAutoRenewMonths(-12); false SetAutoRenewMonths(-12); false
@@ -6927,9 +6907,6 @@
GetName(): Farm GetName(): Farm
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 5 Id: 5
IsRawIndustry(): true IsRawIndustry(): true
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6937,9 +6914,6 @@
GetName(): Oil Rig GetName(): Oil Rig
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): true
HasHeliport(): true
HasDock(): true
Id: 12 Id: 12
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6947,9 +6921,6 @@
GetName(): Bank GetName(): Bank
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 11 Id: 11
IsRawIndustry(): true IsRawIndustry(): true
ProductionCanIncrease(): false ProductionCanIncrease(): false
@@ -6957,9 +6928,6 @@
GetName(): Oil Wells GetName(): Oil Wells
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 1 Id: 1
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6967,9 +6935,6 @@
GetName(): Power Station GetName(): Power Station
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 3 Id: 3
IsRawIndustry(): true IsRawIndustry(): true
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6977,9 +6942,6 @@
GetName(): Forest GetName(): Forest
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 2 Id: 2
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6987,9 +6949,6 @@
GetName(): Sawmill GetName(): Sawmill
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 18 Id: 18
IsRawIndustry(): true IsRawIndustry(): true
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -6997,9 +6956,6 @@
GetName(): Iron Ore Mine GetName(): Iron Ore Mine
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 0 Id: 0
IsRawIndustry(): true IsRawIndustry(): true
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -7007,9 +6963,6 @@
GetName(): Coal Mine GetName(): Coal Mine
CanBuildIndustry(): false CanBuildIndustry(): false
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 8 Id: 8
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -7017,9 +6970,6 @@
GetName(): Steel Mill GetName(): Steel Mill
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 4 Id: 4
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -7027,9 +6977,6 @@
GetName(): Oil Refinery GetName(): Oil Refinery
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
Id: 6 Id: 6
IsRawIndustry(): false IsRawIndustry(): false
ProductionCanIncrease(): true ProductionCanIncrease(): true
@@ -7037,9 +6984,6 @@
GetName(): Factory GetName(): Factory
CanBuildIndustry(): true CanBuildIndustry(): true
CanProspectIndustry(): false CanProspectIndustry(): false
IsBuiltOnWater(): false
HasHeliport(): false
HasDock(): false
--Map-- --Map--
GetMapSize(): 65536 GetMapSize(): 65536
@@ -7242,6 +7186,11 @@
BuildSign(33409, 'Some other Sign'): 2 BuildSign(33409, 'Some other Sign'): 2
RemoveSign(2): true RemoveSign(2): true
GetMaxSignID(): 3
Sign -1
IsValidSign(): false
GetName(): (null : 0x00000000)
GetLocation(): -1
Sign 0 Sign 0
IsValidSign(): true IsValidSign(): true
GetName(): Some Sign GetName(): Some Sign
@@ -7250,6 +7199,14 @@
IsValidSign(): true IsValidSign(): true
GetName(): Test2 GetName(): Test2
GetLocation(): 33411 GetLocation(): 33411
Sign 2
IsValidSign(): false
GetName(): (null : 0x00000000)
GetLocation(): -1
Sign 3
IsValidSign(): false
GetName(): (null : 0x00000000)
GetLocation(): -1
Valid Signs: 2 Valid Signs: 2
--Station-- --Station--
@@ -7316,7 +7273,7 @@
Count(): 9 Count(): 9
ListDump: ListDump:
27631 => 29 27631 => 29
27631 => 65535 27631 => 255
27631 => true 27631 => true
27631 => false 27631 => false
27888 => 13 27888 => 13
@@ -7354,178 +7311,125 @@
--TileList-- --TileList--
Count(): 0 Count(): 0
Count(): 27 Count(): 45
Height(): done Height(): done
Count(): 27 Count(): 45
ListDump: ListDump:
34956 => 4 42411 => 2
34700 => 4 42410 => 2
34444 => 4 42409 => 2
34955 => 3 42408 => 2
34954 => 3 42407 => 2
34953 => 3 42154 => 2
34699 => 3 42153 => 2
34698 => 3 42152 => 2
34697 => 3 42151 => 2
34693 => 3 41898 => 2
34692 => 3 41897 => 2
34443 => 3 41896 => 2
34442 => 3 41895 => 2
34441 => 3 41642 => 2
34439 => 3 41641 => 2
34438 => 3 41640 => 2
34437 => 3 41639 => 2
34436 => 3 41386 => 2
34952 => 2 41385 => 2
34951 => 2 41384 => 2
34950 => 2 41383 => 2
34949 => 2
34948 => 2
34696 => 2
34695 => 2
34694 => 2
34440 => 2
CornerHeight(North): done
Count(): 27
ListDump:
34956 => 4
34700 => 4
34444 => 4
34955 => 3
34954 => 3
34953 => 3
34699 => 3
34698 => 3
34697 => 3
34693 => 3
34692 => 3
34443 => 3
34442 => 3
34441 => 3
34439 => 3
34438 => 3
34437 => 3
34436 => 3
34952 => 2
34951 => 2
34950 => 2
34949 => 2
34948 => 2
34696 => 2
34695 => 2
34694 => 2
34440 => 2
MinHeight(): done
Count(): 27
ListDump:
34956 => 4
34700 => 4
34444 => 4
34955 => 3
34954 => 3
34953 => 3
34699 => 3
34698 => 3
34697 => 3
34443 => 3
34442 => 3
34441 => 3
34436 => 3
34952 => 2
34951 => 2
34950 => 2
34949 => 2
34948 => 2
34696 => 2
34695 => 2
34694 => 2
34693 => 2
34692 => 2
34440 => 2
34439 => 2
34438 => 2
34437 => 2
MaxHeight(): done
Count(): 27
ListDump:
34956 => 4
34955 => 4
34700 => 4
34699 => 4
34444 => 4
34443 => 4
34954 => 3
34953 => 3
34952 => 3
34951 => 3
34950 => 3
34949 => 3
34948 => 3
34698 => 3
34697 => 3
34696 => 3
34693 => 3
34692 => 3
34442 => 3
34441 => 3
34440 => 3
34439 => 3
34438 => 3
34437 => 3
34436 => 3
34695 => 2
34694 => 2
Slope(): done
KeepValue(0): done
Count(): 12
ListDump:
34956 => 0
34954 => 0
34953 => 0
34700 => 0
34698 => 0
34697 => 0
34695 => 0
34694 => 0
34444 => 0
34442 => 0
34441 => 0
34436 => 0
Buildable(): done
KeepValue(1): done
Count(): 35
BuildableRectangle(3, 3) ListDump:
42415 => 1 42415 => 1
42414 => 1 42414 => 1
42413 => 1 42413 => 1
42412 => 1 42412 => 1
42411 => 1
42410 => 1
42159 => 1 42159 => 1
42158 => 1 42158 => 1
42157 => 1 42157 => 1
42156 => 1 42156 => 1
42155 => 1 42155 => 1
42154 => 1
41903 => 1 41903 => 1
41902 => 1 41902 => 1
41901 => 1 41901 => 1
41900 => 1 41900 => 1
41899 => 1 41899 => 1
41898 => 1
41647 => 1 41647 => 1
41646 => 1 41646 => 1
41645 => 1 41645 => 1
41644 => 1 41644 => 1
41643 => 1 41643 => 1
41642 => 1 41391 => 1
41390 => 1
41389 => 1
41388 => 1
41387 => 1
Slope(): done
KeepValue(0): done
Count(): 38
ListDump:
42415 => 0
42414 => 0
42413 => 0
42410 => 0
42409 => 0
42408 => 0
42407 => 0
42159 => 0
42158 => 0
42157 => 0
42156 => 0
42153 => 0
42152 => 0
42151 => 0
41903 => 0
41902 => 0
41901 => 0
41900 => 0
41899 => 0
41897 => 0
41896 => 0
41895 => 0
41647 => 0
41646 => 0
41645 => 0
41644 => 0
41643 => 0
41641 => 0
41640 => 0
41639 => 0
41391 => 0
41390 => 0
41389 => 0
41388 => 0
41387 => 0
41385 => 0
41384 => 0
41383 => 0
Buildable(): done
KeepValue(1): done
Count(): 28
BuildableRectangle(3, 3) ListDump:
42415 => 1
42414 => 1
42413 => 1
42410 => 1
42159 => 1
42158 => 1
42157 => 1
42156 => 1
41903 => 1
41902 => 1
41901 => 1
41900 => 1
41899 => 1
41647 => 1
41646 => 1
41645 => 1
41644 => 1
41643 => 1
41641 => 1 41641 => 1
41391 => 1 41391 => 1
41390 => 1 41390 => 1
41389 => 1 41389 => 1
41388 => 1 41388 => 1
41387 => 1 41387 => 1
41386 => 1
41385 => 1 41385 => 1
42153 => 0 42153 => 0
41897 => 0 41897 => 0
@@ -7537,33 +7441,26 @@
42413 => 173 42413 => 173
42158 => 173 42158 => 173
41903 => 173 41903 => 173
42412 => 172
42157 => 172 42157 => 172
41902 => 172 41902 => 172
41647 => 172 41647 => 172
42411 => 171
42156 => 171 42156 => 171
41901 => 171 41901 => 171
41646 => 171 41646 => 171
41391 => 171 41391 => 171
42410 => 170 42410 => 170
42155 => 170
41900 => 170 41900 => 170
41645 => 170 41645 => 170
41390 => 170 41390 => 170
42154 => 169
41899 => 169 41899 => 169
41644 => 169 41644 => 169
41389 => 169 41389 => 169
42153 => 168 42153 => 168
41898 => 168
41643 => 168 41643 => 168
41388 => 168 41388 => 168
41897 => 167 41897 => 167
41642 => 167
41387 => 167 41387 => 167
41641 => 166 41641 => 166
41386 => 166
41385 => 165 41385 => 165
41384 => 164 41384 => 164
DistanceSquareToTile(30000) ListDump: DistanceSquareToTile(30000) ListDump:
@@ -7580,24 +7477,17 @@
42157 => 17834 42157 => 17834
41390 => 17812 41390 => 17812
41901 => 17741 41901 => 17741
42412 => 17680
41645 => 17650 41645 => 17650
42156 => 17585 42156 => 17585
41389 => 17561 41389 => 17561
41900 => 17492 41900 => 17492
42411 => 17433
41644 => 17401 41644 => 17401
42155 => 17338
41388 => 17312 41388 => 17312
41899 => 17245 41899 => 17245
42410 => 17188 42410 => 17188
41643 => 17154 41643 => 17154
42154 => 17093
41387 => 17065 41387 => 17065
41898 => 17000
41642 => 16909
42153 => 16850 42153 => 16850
41386 => 16820
41897 => 16757 41897 => 16757
41641 => 16666 41641 => 16666
41385 => 16577 41385 => 16577
@@ -7606,77 +7496,63 @@
42415 => -1 42415 => -1
42414 => -1 42414 => -1
42413 => -1 42413 => -1
42412 => -1
42411 => -1
42410 => -1 42410 => -1
42159 => -1 42159 => -1
42158 => -1 42158 => -1
42157 => -1 42157 => -1
42156 => -1 42156 => -1
42155 => -1
42154 => -1
42153 => -1 42153 => -1
41903 => -1 41903 => -1
41902 => -1 41902 => -1
41901 => -1 41901 => -1
41900 => -1 41900 => -1
41899 => -1 41899 => -1
41898 => -1
41897 => -1 41897 => -1
41647 => -1 41647 => -1
41646 => -1 41646 => -1
41645 => -1 41645 => -1
41644 => -1 41644 => -1
41643 => -1 41643 => -1
41642 => -1
41641 => -1 41641 => -1
41391 => -1 41391 => -1
41390 => -1 41390 => -1
41389 => -1 41389 => -1
41388 => -1 41388 => -1
41387 => -1 41387 => -1
41386 => -1
41385 => -1 41385 => -1
41384 => -1 41384 => -1
GetClosestTown() ListDump: GetClosestTown() ListDump:
42415 => 3 42415 => 3
42414 => 3 42414 => 3
42413 => 3 42413 => 3
42412 => 3
42411 => 3
42410 => 3 42410 => 3
42159 => 3 42159 => 3
42158 => 3 42158 => 3
42157 => 3 42157 => 3
42156 => 3 42156 => 3
42155 => 3
42154 => 3
42153 => 3 42153 => 3
41903 => 3 41903 => 3
41902 => 3 41902 => 3
41901 => 3 41901 => 3
41900 => 3 41900 => 3
41899 => 3 41899 => 3
41898 => 3
41897 => 3 41897 => 3
41647 => 3 41647 => 3
41646 => 3 41646 => 3
41645 => 3 41645 => 3
41644 => 3 41644 => 3
41643 => 3 41643 => 3
41642 => 3
41641 => 3 41641 => 3
41391 => 3 41391 => 3
41390 => 3 41390 => 3
41389 => 3 41389 => 3
41388 => 3 41388 => 3
41387 => 3 41387 => 3
41386 => 3
41385 => 3 41385 => 3
41384 => 3 41384 => 3
CargoAcceptance(): done CargoAcceptance(): done
KeepAboveValue(10): done KeepAboveValue(10): done
Count(): 15 Count(): 9
ListDump: ListDump:
41897 => 29 41897 => 29
41385 => 26 41385 => 26
@@ -7684,15 +7560,9 @@
42153 => 25 42153 => 25
41641 => 23 41641 => 23
41899 => 17 41899 => 17
41898 => 17
41387 => 17 41387 => 17
41386 => 17
41643 => 14 41643 => 14
41642 => 14
42411 => 13
42410 => 13 42410 => 13
42155 => 13
42154 => 13
RoadTile(): done RoadTile(): done
KeepValue(1): done KeepValue(1): done
Count(): 0 Count(): 0

Binary file not shown.

View File

@@ -1,7 +1,7 @@
; $Id$ ; $Id$
; ;
; This represents the original graphics as on the Transport ; This represents the original graphics as on the Transport
; Tycoon Deluxe for Windows CD. ; Tycoon Deluxe for Windows.
; ;
[metadata] [metadata]
name = original_windows name = original_windows

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ log() {
} }
set_default() { set_default() {
released_version="0.7.3-RC1" released_version="0.7.0-RC2"
ignore_extra_parameters="0" ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override # 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" configure="$CONFIGURE_EXECUTABLE --ignore-extra-parameters"
for p in $save_params_array; do for p in $save_params_array; do
eval "v=\"\$$p\"" 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 # Only save those params that aren't empty
configure="$configure --$p=\"$v\"" configure="$configure --$p=\"$v\""
done done
@@ -815,7 +815,6 @@ check_params() {
fi fi
if [ "$os" = "OSX" ]; then if [ "$os" = "OSX" ]; then
check_osx_sdk
# Test on G5 # Test on G5
if [ "$enable_osx_g5" != "0" ]; then if [ "$enable_osx_g5" != "0" ]; then
@@ -904,7 +903,7 @@ check_params() {
doc_dir="$data_dir/docs" doc_dir="$data_dir/docs"
fi fi
else 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 fi
if [ "$icon_theme_dir" = "1" ]; then if [ "$icon_theme_dir" = "1" ]; then
@@ -914,7 +913,7 @@ check_params() {
icon_theme_dir="" icon_theme_dir=""
fi fi
else 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 fi
if [ "$personal_dir" = "1" ]; then if [ "$personal_dir" = "1" ]; then
@@ -926,7 +925,7 @@ check_params() {
personal_dir=".openttd" personal_dir=".openttd"
fi fi
else 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 fi
if [ "$shared_dir" = "1" ]; then if [ "$shared_dir" = "1" ]; then
@@ -937,7 +936,7 @@ check_params() {
shared_dir="" shared_dir=""
fi fi
else 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 fi
if [ "$man_dir" = "1" ]; then if [ "$man_dir" = "1" ]; then
@@ -948,7 +947,7 @@ check_params() {
man_dir="" man_dir=""
fi fi
else 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 fi
if [ "$menu_dir" = "1" ]; then if [ "$menu_dir" = "1" ]; then
@@ -959,7 +958,7 @@ check_params() {
menu_dir="" menu_dir=""
fi fi
else 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 fi
# "set_universal_binary_flags" needs to be before "detect_iconv" # "set_universal_binary_flags" needs to be before "detect_iconv"
@@ -1009,74 +1008,13 @@ check_params() {
fi fi
} }
make_compiler_cflags() {
# Params:
# $1 - compiler
# $2 - the current cflags
# $3 - variable to finally write to
flags="$2"
if [ `echo $1 | cut -c 1-3` = "icc" ]; then
# Enable some things only for certain ICC versions
cc_version=`$1 -dumpversion | cut -c 1-4`
if [ "$cc_version" = "10.1" ]; then
flags="$flags -Wno-multichar"
fi
if [ "$cc_version" = "11.0" ]; then
# warning 1899: multicharacter character literal (potential portability problem) (e.g. 'FOOD')
# vec report defaults to telling where it did loop vectorisation, which is not very important
flags="$flags -vec-report=0 -wd1899"
fi
else
# Enable some things only for certain GCC versions
cc_version=`$1 -dumpversion | cut -c 1,3`
if [ $cc_version -lt 30 ]; then
log 1 "configure: error: gcc older than 3.0 can't compile OpenTTD because of its poor template support"
exit 1
fi
flags="$flags -Wall -Wno-multichar -Wsign-compare -Wundef"
flags="$flags -Wwrite-strings -Wpointer-arith"
flags="$flags -Wno-uninitialized"
flags="$flags -W -Wno-unused-parameter -Wformat=2"
flags="$flags -Wredundant-decls"
if [ $enable_assert -eq 0 ]; then
# Do not warn about unused variables when building without asserts
flags="$flags -Wno-unused-variable"
fi
if [ $cc_version -ge 40 ]; then
# GCC 4.0+ complains about that we break strict-aliasing.
# On most places we don't see how to fix it, and it doesn't
# break anything. So disable strict-aliasing to make the
# compiler all happy.
flags="$flags -fno-strict-aliasing"
fi
if [ $cc_version -ge 42 ]; then
# GCC 4.2+ automatically assumes that signed overflows do
# not occur in signed arithmetics, whereas we are not
# sure that they will not happen. It furthermore complains
# about it's own optimized code in some places.
flags="$flags -fno-strict-overflow"
fi
fi
eval "$3=\"$flags\""
}
make_cflags_and_ldflags() { make_cflags_and_ldflags() {
# General CFlags for BUILD # General CFlags for BUILD
CFLAGS_BUILD="" CFLAGS_BUILD=""
# General CFlags for HOST # General CFlags for HOST
CFLAGS="$CFLAGS -D$os" CFLAGS="$CFLAGS -D$os"
# CFlags for HOST and C-Compiler
CC_FLAGS=""
# Libs to compile. In fact this is just LDFLAGS # Libs to compile. In fact this is just LDFLAGS
LIBS="-lstdc++" LIBS="-lstdc++"
# LDFLAGS used for HOST # LDFLAGS used for HOST
@@ -1125,16 +1063,58 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DNO_THREADS" CFLAGS="$CFLAGS -DNO_THREADS"
fi fi
make_compiler_cflags "$cc_build" "$CFLAGS_BUILD" "CFLAGS_BUILD" if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
make_compiler_cflags "$cc_host" "$CFLAGS" "CFLAGS" # Enable some things only for certain ICC versions
cc_version=`$cc_host -dumpversion | cut -c 1-4`
if [ "$cc_version" = "10.1" ]; then
CFLAGS="$CFLAGS -Wno-multichar"
fi
else
# Enable some things only for certain GCC versions
cc_version=`$cc_host -dumpversion | cut -c 1,3`
if [ $cc_version -ge 29 ]; then
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
CFLAGS="$CFLAGS -Wno-uninitialized"
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
fi
gcc295=""
if [ "$cc_version" = 29 ]; then
# 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 -Wformat=2"
CFLAGS="$CFLAGS -Wredundant-decls"
# 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
CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
fi
if [ "`echo $1 | cut -c 1-3`" != "icc" ]; then
if [ "$os" = "CYGWIN" ]; then if [ "$os" = "CYGWIN" ]; then
flags="$flags -mwin32" CFLAGS="$CFLAGS -mwin32"
LDFLAGS="$LDFLAGS -mwin32" LDFLAGS="$LDFLAGS -mwin32"
fi fi
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
flags="$flags -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin" LDFLAGS="$LDFLAGS -mno-cygwin"
fi fi
@@ -1142,6 +1122,22 @@ make_cflags_and_ldflags() {
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows" LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32" LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
fi fi
# GCC 4.0+ complains about that we break strict-aliasing.
# On most places we don't see how to fix it, and it doesn't
# break anything. So disable strict-aliasing to make the
# compiler all happy.
if [ $cc_version -ge 40 ]; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
# GCC 4.2+ automatically assumes that signed overflows do
# not occur in signed arithmetics, whereas we are not
# sure that they will not happen. It furthermore complains
# about it's own optimized code in some places.
if [ $cc_version -ge 42 ]; then
CFLAGS="$CFLAGS -fno-strict-overflow"
fi
fi fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
@@ -1210,7 +1206,7 @@ make_cflags_and_ldflags() {
if [ -n "$sdl_config" ]; then if [ -n "$sdl_config" ]; then
CFLAGS="$CFLAGS -DWITH_SDL" CFLAGS="$CFLAGS -DWITH_SDL"
# SDL must not add _GNU_SOURCE as it breaks many platforms # 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 [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "WINCE" ]; then
if [ "$enable_static" != "0" ]; then if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$sdl_config --static-libs`" LIBS="$LIBS `$sdl_config --static-libs`"
@@ -1272,7 +1268,7 @@ make_cflags_and_ldflags() {
if [ "$os" = "OSX" ]; then if [ "$os" = "OSX" ]; then
# fontconfig_config goes via pkg-config on all systems, which doesn't know --prefix # 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 # 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 else
LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' ' '`" LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' ' '`"
fi fi
@@ -1301,8 +1297,7 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_ICU" CFLAGS="$CFLAGS -DWITH_ICU"
CFLAGS="$CFLAGS `$icu_config --cppflags | tr '\n\r' ' '`" CFLAGS="$CFLAGS `$icu_config --cppflags | tr '\n\r' ' '`"
# Some icu-configs have the 'feature' of not adding a space where others do add the space LIBS="$LIBS `$icu_config --ldflags-libsonly | tr '\n\r' ' '`"
LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly | tr '\n\r' ' '`"
fi fi
@@ -1383,7 +1378,7 @@ make_cflags_and_ldflags() {
fi fi
if [ "$enable_osx_g5" != "0" ]; then if [ "$enable_osx_g5" != "0" ]; then
CFLAGS="$CFLAGS -mcpu=G5 -mpowerpc64 -mtune=970 -mcpu=970 -mpowerpc-gpopt" CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
fi fi
if [ -n "$personal_dir" ]; then if [ -n "$personal_dir" ]; then
@@ -1396,7 +1391,7 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\"" CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
log 1 "using CFLAGS... $CFLAGS" log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
log 1 "using LDFLAGS... $LIBS $LDFLAGS" log 1 "using LDFLAGS... $LIBS $LDFLAGS"
# Makedepend doesn't like something like: -isysroot /OSX/blabla # Makedepend doesn't like something like: -isysroot /OSX/blabla
@@ -1405,12 +1400,8 @@ make_cflags_and_ldflags() {
# Lovely hackish, not? # Lovely hackish, not?
# Btw, this almost always comes from outside the configure, so it is # Btw, this almost always comes from outside the configure, so it is
# not something we can control. # not something we can control.
# Also make makedepend aware of compiler's built-in defines.
if [ "$with_makedepend" != "0" ]; then if [ "$with_makedepend" != "0" ]; then
cflags_makedep="`echo | $cxx_host -E -x c++ -dM - | sed 's@.define @-D@g;s@ .*@ @g;s@(.*)@@g' | tr -d '\r\n'`" cflags_makedep="` echo "$CFLAGS" | sed 's~ /~ -~g;s~-I[ ]*[^ ]*~~g'`"
# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations
cflags_makedep="$cflags_makedep `echo \"$CFLAGS\" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`"
else else
makedepend="" makedepend=""
fi fi
@@ -1589,7 +1580,7 @@ check_strip() {
elif [ "$os" = "OSX" ]; then elif [ "$os" = "OSX" ]; then
# Most targets have -V in strip, to see if they exists... OSX doesn't.. so execute something # Most targets have -V in strip, to see if they exists... OSX doesn't.. so execute something
echo "int main(int argc, char *argv[]) { }" > strip.test.c echo "int main(int argc, char *argv[]) { }" > strip.test.c
$cxx_host strip.test.c -o strip.test $cc_host strip.test.c -o strip.test
check_compiler "host strip" "strip" "$host" "$strip" "$STRIP" "strip" "strip" "3" "strip.test" check_compiler "host strip" "strip" "$host" "$strip" "$STRIP" "strip" "strip" "3" "strip.test"
rm -f strip.test.c strip.test rm -f strip.test.c strip.test
else else
@@ -1600,7 +1591,7 @@ check_strip() {
check_lipo() { check_lipo() {
if [ "$os" = "OSX" ] && [ "$enable_universal" != "0" ]; then if [ "$os" = "OSX" ] && [ "$enable_universal" != "0" ]; then
echo "int main(int argc, char *argv[]) { }" > lipo.test.c echo "int main(int argc, char *argv[]) { }" > lipo.test.c
$cxx_host lipo.test.c -o lipo.test $cc_host lipo.test.c -o lipo.test
check_compiler "host lipo" "lipo" "$host" "$lipo" "$LIPO" "lipo" "lipo" "4" "-info lipo.test" check_compiler "host lipo" "lipo" "$host" "$lipo" "$LIPO" "lipo" "lipo" "4" "-info lipo.test"
rm -f lipo.test.c lipo.test rm -f lipo.test.c lipo.test
fi fi
@@ -1626,28 +1617,6 @@ set_universal_binary_flags() {
fi fi
} }
check_osx_sdk() {
cat > tmp.osx.mm << EOF
#include <Cocoa/Cocoa.h>
int main() {
kCGBitmapByteOrder32Host;
return 0;
}
EOF
execute="$cxx_host $CFLAGS tmp.osx.mm -framework Cocoa -o tmp.osx 2>&1"
eval $execute > /dev/null
ret=$?
log 2 "executing $execute"
log 2 " exit code $ret"
rm -f tmp.osx.mm tmp.osx
if [ "$ret" != "0" ]; then
log 1 "Your system SDK is probably too old"
log 1 "Please install/upgrade your Xcode to >= 2.5"
exit 1
fi
}
check_direct_music() { check_direct_music() {
echo " echo "
#include <windows.h> #include <windows.h>
@@ -2297,9 +2266,9 @@ detect_icu() {
log 2 " returned $version" log 2 " returned $version"
log 2 " exit code $ret" log 2 " exit code $ret"
if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$shortversion" -lt "22" ]; then if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$shortversion" -lt "20" ]; then
if [ -n "$shortversion" ] && [ "$shortversion" -lt "22" ]; then if [ -n "$shortversion" ] && [ "$shortversion" -lt "20" ]; then
log 1 "checking libicu... needs at least version 2.2.0, icu NOT enabled" log 1 "checking libicu... needs at least version 2.0.0, icu NOT enabled"
else else
log 1 "checking libicu... not found" log 1 "checking libicu... not found"
fi fi
@@ -2436,7 +2405,7 @@ int main() {
} }
EOF EOF
execute="$cxx_host $CFLAGS -c tmp.iconv.cpp -o tmp.iconv -DTESTING 2>&1" execute="$cxx_host $CFLAGS -c tmp.iconv.cpp -o tmp.iconv -DTESTING 2>&1"
eval $execute > /dev/null eval $execute >&/dev/null
ret=$? ret=$?
log 2 "executing $execute" log 2 "executing $execute"
log 2 " exit code $ret" log 2 " exit code $ret"
@@ -2457,7 +2426,7 @@ int main() {
} }
EOF EOF
execute="$cxx_host $CFLAGS tmp.iconv.cpp -o tmp.iconv -DTESTING 2>&1" execute="$cxx_host $CFLAGS tmp.iconv.cpp -o tmp.iconv -DTESTING 2>&1"
eval $execute > /dev/null eval $execute >&/dev/null
ret=$? ret=$?
log 2 "executing $execute" log 2 "executing $execute"
log 2 " exit code $ret" log 2 " exit code $ret"
@@ -2532,8 +2501,7 @@ detect_cputype() {
log 1 "forcing cpu-type... $cpu_type bits" log 1 "forcing cpu-type... $cpu_type bits"
return; return;
fi fi
echo "#define _SQ64 1" > tmp.64bit.cpp echo "#include \"src/stdafx.h\"" > tmp.64bit.cpp
echo "#include \"src/stdafx.h\"" >> tmp.64bit.cpp
echo "assert_compile(sizeof(size_t) == 8);" >> tmp.64bit.cpp echo "assert_compile(sizeof(size_t) == 8);" >> tmp.64bit.cpp
echo "int main() { return 0; }" >> tmp.64bit.cpp echo "int main() { return 0; }" >> tmp.64bit.cpp
execute="$cxx_host $CFLAGS tmp.64bit.cpp -o tmp.64bit -DTESTING 2>&1" execute="$cxx_host $CFLAGS tmp.64bit.cpp -o tmp.64bit -DTESTING 2>&1"
@@ -2551,6 +2519,17 @@ make_sed() {
T_CFLAGS="$CFLAGS" T_CFLAGS="$CFLAGS"
T_LDFLAGS="$LDFLAGS" 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
# FOUR_BYTE_BOOL is needed, because C++ uses 4byte for a bool on PPC, where
# we use 1 byte per bool normally in C part. So convert that last one to 4
# bytes too, but only for PPC.
ppc=`$cc_host -dumpmachine | egrep "powerpc|ppc"`
if [ -n "$ppc" ]; then
T_CFLAGS="$T_CFLAGS -DFOUR_BYTE_BOOL"
fi
SRC_OBJS_DIR="$BASE_SRC_OBJS_DIR/$OBJS_SUBDIR" SRC_OBJS_DIR="$BASE_SRC_OBJS_DIR/$OBJS_SUBDIR"
# All the data needed to compile a single target # All the data needed to compile a single target
@@ -2558,102 +2537,104 @@ make_sed() {
# use multiple OBJS_DIR, because all in-between # use multiple OBJS_DIR, because all in-between
# binaries are stored in there, and nowhere else. # binaries are stored in there, and nowhere else.
SRC_REPLACE=" SRC_REPLACE="
s@!!CC_HOST!!@$cc_host@g; s~!!CC_HOST!!~$cc_host~g;
s@!!CXX_HOST!!@$cxx_host@g; s~!!CXX_HOST!!~$cxx_host~g;
s@!!CC_BUILD!!@$cc_build@g; s~!!CC_BUILD!!~$cc_build~g;
s@!!CXX_BUILD!!@$cxx_build@g; s~!!CXX_BUILD!!~$cxx_build~g;
s@!!WINDRES!!@$windres@g; s~!!WINDRES!!~$windres~g;
s@!!STRIP!!@$strip $strip_arg@g; s~!!STRIP!!~$strip $strip_arg~g;
s@!!LIPO!!@$lipo@g; s~!!LIPO!!~$lipo~g;
s@!!CFLAGS!!@$T_CFLAGS@g; s~!!CC_CFLAGS!!~$CC_CFLAGS~g;
s@!!CFLAGS_BUILD!!@$CFLAGS_BUILD@g; s~!!CFLAGS!!~$T_CFLAGS~g;
s@!!STRGEN_FLAGS!!@$strgen_flags@g; s~!!CFLAGS_BUILD!!~$CFLAGS_BUILD~g;
s@!!LIBS!!@$LIBS@g; s~!!STRGEN_FLAGS!!~$strgen_flags~g;
s@!!LDFLAGS!!@$T_LDFLAGS@g; s~!!LIBS!!~$LIBS~g;
s@!!BIN_DIR!!@$BIN_DIR@g; s~!!LDFLAGS!!~$T_LDFLAGS~g;
s@!!ROOT_DIR!!@$ROOT_DIR@g; s~!!BIN_DIR!!~$BIN_DIR~g;
s@!!MEDIA_DIR!!@$MEDIA_DIR@g; s~!!ROOT_DIR!!~$ROOT_DIR~g;
s@!!SOURCE_LIST!!@$SOURCE_LIST@g; s~!!MEDIA_DIR!!~$MEDIA_DIR~g;
s@!!SRC_OBJS_DIR!!@$SRC_OBJS_DIR@g; s~!!SOURCE_LIST!!~$SOURCE_LIST~g;
s@!!LANG_OBJS_DIR!!@$LANG_OBJS_DIR@g; s~!!SRC_OBJS_DIR!!~$SRC_OBJS_DIR~g;
s@!!SRC_DIR!!@$SRC_DIR@g; s~!!LANG_OBJS_DIR!!~$LANG_OBJS_DIR~g;
s@!!SCRIPT_SRC_DIR!!@$SCRIPT_SRC_DIR@g; s~!!SRC_DIR!!~$SRC_DIR~g;
s@!!OSXAPP!!@$OSXAPP@g; s~!!SCRIPT_SRC_DIR!!~$SCRIPT_SRC_DIR~g;
s@!!LANG_DIR!!@$LANG_DIR@g; s~!!OSXAPP!!~$OSXAPP~g;
s@!!TTD!!@$TTD@g; s~!!LANG_DIR!!~$LANG_DIR~g;
s@!!BINARY_DIR!!@$prefix_dir/$binary_dir@g; s~!!TTD!!~$TTD~g;
s@!!DATA_DIR!!@$prefix_dir/$data_dir@g; s~!!BINARY_DIR!!~$prefix_dir/$binary_dir~g;
s@!!DOC_DIR!!@$prefix_dir/$doc_dir@g; s~!!DATA_DIR!!~$prefix_dir/$data_dir~g;
s@!!MAN_DIR!!@$prefix_dir/$man_dir@g; s~!!DOC_DIR!!~$prefix_dir/$doc_dir~g;
s@!!ICON_DIR!!@$prefix_dir/$icon_dir@g; s~!!MAN_DIR!!~$prefix_dir/$man_dir~g;
s@!!ICON_THEME_DIR!!@$prefix_dir/$icon_theme_dir@g; s~!!ICON_DIR!!~$prefix_dir/$icon_dir~g;
s@!!PERSONAL_DIR!!@$personal_dir@g; s~!!ICON_THEME_DIR!!~$prefix_dir/$icon_theme_dir~g;
s@!!SHARED_DIR!!@$shared_dir@g; s~!!PERSONAL_DIR!!~$personal_dir~g;
s@!!INSTALL_DIR!!@$install_dir@g; s~!!SHARED_DIR!!~$shared_dir~g;
s@!!BINARY_NAME!!@$binary_name@g; s~!!INSTALL_DIR!!~$install_dir~g;
s@!!STRGEN!!@$STRGEN@g; s~!!BINARY_NAME!!~$binary_name~g;
s@!!ENDIAN_CHECK!!@$ENDIAN_CHECK@g; s~!!STRGEN!!~$STRGEN~g;
s@!!ENDIAN_FORCE!!@$endian@g; s~!!ENDIAN_CHECK!!~$ENDIAN_CHECK~g;
s@!!STAGE!!@$STAGE@g; s~!!ENDIAN_FORCE!!~$endian~g;
s@!!MAKEDEPEND!!@$makedepend@g; s~!!STAGE!!~$STAGE~g;
s@!!CFLAGS_MAKEDEP!!@$cflags_makedep@g; s~!!MAKEDEPEND!!~$makedepend~g;
s@!!SORT!!@$sort@g; s~!!CFLAGS_MAKEDEP!!~$cflags_makedep~g;
s@!!CONFIG_CACHE_COMPILER!!@config.cache.compiler@g; s~!!SORT!!~$sort~g;
s@!!CONFIG_CACHE_LINKER!!@config.cache.linker@g; s~!!CONFIG_CACHE_COMPILER!!~config.cache.compiler~g;
s@!!CONFIG_CACHE_ENDIAN!!@config.cache.endian@g; s~!!CONFIG_CACHE_LINKER!!~config.cache.linker~g;
s@!!CONFIG_CACHE_SOURCE!!@config.cache.source@g; s~!!CONFIG_CACHE_ENDIAN!!~config.cache.endian~g;
s@!!CONFIG_CACHE_VERSION!!@config.cache.version@g; s~!!CONFIG_CACHE_SOURCE!!~config.cache.source~g;
s@!!CONFIG_CACHE_SOURCE_LIST!!@config.cache.source.list@g; s~!!CONFIG_CACHE_VERSION!!~config.cache.version~g;
s@!!CONFIG_CACHE_PWD!!@config.cache.pwd@g; s~!!CONFIG_CACHE_SOURCE_LIST!!~config.cache.source.list~g;
s@!!LANG_SUPPRESS!!@$lang_suppress@g; s~!!CONFIG_CACHE_PWD!!~config.cache.pwd~g;
s@!!OBJS_C!!@$OBJS_C@g; s~!!LANG_SUPPRESS!!~$lang_suppress~g;
s@!!OBJS_CPP!!@$OBJS_CPP@g; s~!!OBJS_C!!~$OBJS_C~g;
s@!!OBJS_MM!!@$OBJS_MM@g; s~!!OBJS_CPP!!~$OBJS_CPP~g;
s@!!OBJS_RC!!@$OBJS_RC@g; s~!!OBJS_MM!!~$OBJS_MM~g;
s@!!SRCS!!@$SRCS@g; s~!!OBJS_RC!!~$OBJS_RC~g;
s@!!OS!!@$os@g; s~!!SRCS!!~$SRCS~g;
s@!!CONFIGURE_FILES!!@$CONFIGURE_FILES@g; s~!!OS!!~$os~g;
s@!!REVISION!!@$revision@g; s~!!CONFIGURE_FILES!!~$CONFIGURE_FILES~g;
s@!!AWK!!@$awk@g; s~!!REVISION!!~$revision~g;
s@!!DISTCC!!@$distcc@g; s~!!AWK!!~$awk~g;
s~!!GCC295!!~$gcc295~g;
s~!!DISTCC!!~$distcc~g;
" "
if [ "$icon_theme_dir" != "" ]; then if [ "$icon_theme_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE 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 else
SRC_REPLACE="$SRC_REPLACE SRC_REPLACE="$SRC_REPLACE
s@!!ICON_THEME_DIR!!@@g; s#!!ICON_THEME_DIR!!##g;
" "
fi fi
if [ "$man_dir" != "" ]; then if [ "$man_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE SRC_REPLACE="$SRC_REPLACE
s@!!MAN_DIR!!@$prefix_dir/$man_dir@g; s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
" "
else else
SRC_REPLACE="$SRC_REPLACE SRC_REPLACE="$SRC_REPLACE
s@!!MAN_DIR!!@@g; s#!!MAN_DIR!!##g;
" "
fi fi
if [ "$menu_dir" != "" ]; then if [ "$menu_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE SRC_REPLACE="$SRC_REPLACE
s@!!MENU_DIR!!@$prefix_dir/$menu_dir@g; s#!!MENU_DIR!!#$prefix_dir/$menu_dir#g;
" "
else else
SRC_REPLACE="$SRC_REPLACE SRC_REPLACE="$SRC_REPLACE
s@!!MENU_DIR!!@@g; s#!!MENU_DIR!!##g;
" "
fi fi
} }
generate_menu_item() { generate_menu_item() {
MENU_REPLACE=" MENU_REPLACE="
s@!!TTD!!@$TTD@g; s~!!TTD!!~$TTD~g;
s@!!MENU_GROUP!!@$menu_group@g; s~!!MENU_GROUP!!~$menu_group~g;
s@!!MENU_NAME!!@$menu_name@g s~!!MENU_NAME!!~$menu_name~g
" "
log 1 "Generating menu item..." log 1 "Generating menu item..."
mkdir -p media mkdir -p media

48
configure vendored
View File

@@ -1,13 +1,5 @@
#!/bin/sh #!/bin/sh
check_path_characters() {
if [ -n "`echo $ROOT_DIR | grep '[^-_A-Za-z0-9\/\\\.:]'`" ]; then
echo "WARNING: The path contains a non-alphanumeric character that might cause"
echo " failures in subsequent build stages. Any failures with the build"
echo " will most likely be caused by this."
fi
}
CONFIGURE_EXECUTABLE="$_" CONFIGURE_EXECUTABLE="$_"
# On *nix systems those two are equal when ./configure is done # On *nix systems those two are equal when ./configure is done
if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
@@ -22,16 +14,9 @@ if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
fi fi
# Find out where configure is (in what dir) # Find out where configure is (in what dir)
ROOT_DIR="`dirname $0`" ROOT_DIR="`dirname $0`"
# For MSYS/MinGW we want to know the FULL path. This as that path is generated ROOT_DIR="`cd $ROOT_DIR && pwd`"
# once you call an outside binary. Having the same path for the rest is needed
# for dependency checking.
# pwd -W returns said FULL path, but doesn't exist on others so fall back.
ROOT_DIR="`cd $ROOT_DIR && (pwd -W 2>/dev/null || pwd 2>/dev/null)`"
check_path_characters PWD="`pwd`"
# Same here as for the ROOT_DIR above
PWD="`pwd -W 2>/dev/null || pwd 2>/dev/null`"
PREFIX="$PWD/bin" PREFIX="$PWD/bin"
. $ROOT_DIR/config.lib . $ROOT_DIR/config.lib
@@ -52,11 +37,10 @@ if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
exit 1 exit 1
fi fi
# Make sure we don't lock config.cache # 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 sh cache.tmp
RET=$?
rm -f cache.tmp rm -f cache.tmp
exit $RET exit $?
fi fi
set_default set_default
@@ -75,7 +59,7 @@ STRGEN="strgen$EXE"
ENDIAN_CHECK="endian_check$EXE" ENDIAN_CHECK="endian_check$EXE"
if [ -z "$sort" ]; then if [ -z "$sort" ]; then
PIPE_SORT="sed s@a@a@" PIPE_SORT="sed s~a~a~"
else else
PIPE_SORT="$sort" PIPE_SORT="$sort"
fi fi
@@ -86,7 +70,7 @@ if [ ! -f "$LANG_DIR/english.txt" ]; then
fi fi
# Read the source.list and process it # Read the source.list and process it
AWKCOMMAND=' SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
{ } { }
/^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; } /^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; }
/^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; } /^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; }
@@ -131,21 +115,17 @@ AWKCOMMAND='
print $0; print $0;
} }
} }
' ' | $PIPE_SORT`"
# Read the source.list and process it OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.c$/ { gsub(".c$", ".o", $0); print $0; }'`"
# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = " " } /\.cpp$/ { gsub(".cpp$", ".o", $0); print $0; }'`"
SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk \"$AWKCOMMAND\" | $PIPE_SORT`" OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`"
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`"
OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.c$/ { gsub(\".c$\", \".o\", $0); print $0; }'`" SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.cpp$/ { gsub(\".cpp$\", \".o\", $0); print $0; }'`"
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.mm$/ { gsub(\".mm$\", \".o\", $0); print $0; }'`"
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.rc$/ { gsub(\".rc$\", \".o\", $0); print $0; }'`"
SRCS="` echo \"$SRCS\" | $awk ' { ORS = \" \" } { print $0; }'`"
# In makefiles, we always use -u for sort # In makefiles, we always use -u for sort
if [ -z "$sort" ]; then if [ -z "$sort" ]; then
sort="sed s@a@a@" sort="sed s~a~a~"
else else
sort="$sort -u" sort="$sort -u"
fi fi
@@ -155,5 +135,3 @@ CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in
generate_main generate_main
generate_lang generate_lang
generate_src generate_src
check_path_characters

View File

@@ -1,7 +1,7 @@
STRGEN USAGE STRGEN USAGE
------------ ------------
This guide is only interesting for people who want to alter something This guide is only interesting for people who want to alter something
themselves without access to translator.openttd.org. Please note that themselves without access to WT2 (translator2.openttd.org). Please note that
your compiled language file will only be compatible with the OpenTTD version your compiled language file will only be compatible with the OpenTTD version
you have downloaded english.txt, the master language file, for. While this is you have downloaded english.txt, the master language file, for. While this is
not always true, namely when changes in the code have not touched language not always true, namely when changes in the code have not touched language

View File

@@ -26,7 +26,7 @@
[metadata] [metadata]
; the name of the pack, preferably less than 16 characters ; the name of the pack, preferably less than 16 characters
name = example name = example
; the short name (4 characters), used to identify this set ; the short name (4 characters), used to identify this set within NewGRFs
shortname = XMPL shortname = XMPL
; the version of this graphics set (read as single integer) ; the version of this graphics set (read as single integer)
version = 0 version = 0
@@ -49,8 +49,6 @@ tropical = TRGH.GRF
; GRF file with extra toyland sprites ; GRF file with extra toyland sprites
toyland = TRGT.GRF toyland = TRGT.GRF
; NewGRF file using Actions 5, 7, 9 and A to replace sprites ; NewGRF file using Actions 5, 7, 9 and A to replace sprites
; Must use a GRF ID starting with FF so it cannot be selected from
; the in-game NewGRF list and (thus) be loaded twice.
extra = OPENTTDD.GRF extra = OPENTTDD.GRF
; The md5s section lists the MD5 checksum for the files that replace them. ; The md5s section lists the MD5 checksum for the files that replace them.

View File

@@ -86,17 +86,17 @@ elif [ -d "$ROOT_DIR/.git" ]; then
fi fi
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null` HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
REV="g`echo $HASH | cut -c1-8`" REV="g`echo $HASH | cut -c1-8`"
BRANCH=`git branch|grep '[*]' | sed 's@\* @@;s@^master$@@'` 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@"` 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 elif [ -d "$ROOT_DIR/.hg" ]; then
# We are a hg checkout # We are a hg checkout
if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
MODIFIED="2" MODIFIED="2"
fi fi
HASH=`LC_ALL=C hg parents --template="{node}"` HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3`
REV="h`echo $HASH | cut -c1-8`" REV="h`echo $HASH | cut -c1-8`"
BRANCH=`hg branch | sed 's@^default$@@'` 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@"` 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 else
# We don't know # We don't know
MODIFIED="1" MODIFIED="1"

View File

@@ -11,19 +11,13 @@ by the number below on http://bugs.openttd.org.
If the bug report is closed, it has been fixed, which then can be verified If the bug report is closed, it has been fixed, which then can be verified
in the latest SVN version of /trunk. in the latest SVN version of /trunk.
Bugs for 0.7.2 Bugs for 0.7.0-RC2
------------------------------------------------------------------------ ------------------------------------------------------------------------
URL: http://bugs.openttd.org URL: http://bugs.openttd.org
- 3057 Road vehicle sometimes 'forget' the need for servicing
- 3040 Not all alternatives are always shown in the "Join station" list
- 2955 With path signals depots are less likely to be visited
- 2891 Ignore signal does not keep the train running when in path signalled block till the next signal
- 2769 No offer for buying bankrupt AIs
- 2737 Self-crossing trains ignore "forbid 90 degree turn" setting - 2737 Self-crossing trains ignore "forbid 90 degree turn" setting
- 2616 Cloning creates vehicles with invalid subcargos - 2616 Cloning creates vehicles with invalid subcargos
- 2585 [OSX] OS' mouse pointer showing - 2585 [OSX] OS' mouse pointer showing
- 2484 [OSX] Cannot enter CJK characters
- 2427 Vehicle owner gets paid for whole cargo feeder share - 2427 Vehicle owner gets paid for whole cargo feeder share
- 1944 Road vehicles not picking empty drivethrough platform - 1944 Road vehicles not picking empty drivethrough platform
- 1762 Strange Autoreplace behaviour - 1762 Strange Autoreplace behaviour

View File

@@ -1,6 +1,7 @@
# $Id$ # $Id$
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html # http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8
Type=Application Type=Application
Version=1.1 Version=1.1
Name=!!MENU_NAME!! Name=!!MENU_NAME!!

View File

@@ -1,76 +1,22 @@
openttd (0.7.3~RC1) unstable; urgency=low openttd (0.7.0-RC2) unstable; urgency=low
* New upstream release. * New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Sun, 13 Sep 2009 10:25:56 +0200 -- Matthijs Kooijman <matthijs@stdin.nl> Mon, 23 Mar 2008 00:42:00 +0200
openttd (0.7.2) unstable; urgency=low openttd (0.7.0-RC1) unstable; urgency=low
* New upstream release. * New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Sat, 01 Aug 2009 00:19:43 +0200 -- Matthijs Kooijman <matthijs@stdin.nl> Mon, 16 Mar 2008 00:07:00 +0200
openttd (0.7.2~RC2) unstable; urgency=low openttd (0.7.0-beta2) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Tue, 21 Jul 2009 20:25:56 +0200
openttd (0.7.2~RC1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Wed, 15 Jul 2009 22:25:56 +0200
openttd (0.7.1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Tue, 09 Jun 2009 01:34:56 +0200
openttd (0.7.1~RC3) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Wed, 03 Jun 2009 15:34:56 +0200
openttd (0.7.1~RC2) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 21 Mar 2009 14:34:56 +0200
openttd (0.7.1~RC1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 11 Mar 2009 17:34:56 +0200
openttd (0.7.0) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Wed, 01 Apr 2009 13:37:42 +0000
openttd (0.7.0~RC2) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 23 Mar 2009 00:42:00 +0200
openttd (0.7.0~RC1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 16 Mar 2009 00:07:00 +0200
openttd (0.7.0~beta2) unstable; urgency=low
* New upstream release. * New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Tue, 10 Mar 2009 00:33:05 +0100 -- Matthijs Kooijman <matthijs@stdin.nl> Tue, 10 Mar 2009 00:33:05 +0100
openttd (0.7.0~beta1) unstable; urgency=low openttd (0.7.0-beta1) unstable; urgency=low
* New upstream release. * New upstream release.

View File

@@ -7,13 +7,10 @@
# This file and all modifications and additions to the pristine # This file and all modifications and additions to the pristine
# package are under the same license as the package itself # package are under the same license as the package itself
# #
# Note: for (at least) CentOS '#' comments end '\' continue command on new line.
# So place all '#' commented parameters of e.g. configure to the end.
#
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
Name: openttd Name: openttd
Version: 0.7.3 Version: 0.7.0
Release: 1%{?dist} Release: 1%{?dist}
Group: Amusements/Games Group: Amusements/Games
@@ -21,7 +18,7 @@ License: GPLv2
URL: http://www.openttd.org URL: http://www.openttd.org
Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoon Deluxe Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoon Deluxe
Source: %{name}-%{version}-source.tar.bz2 Source: %{name}-%{version}.tar.bz2
Requires: fontconfig Requires: fontconfig
Requires: libicu Requires: libicu
@@ -79,23 +76,22 @@ download of the game.
--prefix-dir="%{_prefix}" \ --prefix-dir="%{_prefix}" \
--binary-dir="bin" \ --binary-dir="bin" \
--binary-name="%{name}" \ --binary-name="%{name}" \
--enable-debug=0 \
--with-sdl \
--with-zlib \
--with-png \
--with-freetype \
--with-fontconfig \
--with-icu \
--enable-strip \
# --menu_group="Game;" \
# --menu-name="OpenTTD" \ # --menu-name="OpenTTD" \
# --data-dir="share\games\%{name}" \ # --data-dir="share\games\%{name}" \
# --doc-dir="share\doc\%{name}" \ # --doc-dir="share\doc\%{name}" \
# --icon-dir="share/pixmaps" \ # --icon-dir="share/pixmaps" \
# --icon-theme-dir="share/icons/hicolor" \ # --icon-theme-dir="share/icons/hicolor" \
# --man-dir="share/man/man6" \ # --man-dir="share/man/man6" \
# --menu-dir="share/applications" # --menu-dir="share/applications" \
--enable-debug=0 \
# --menu_group="Game;" \
--with-sdl \
--with-zlib \
--with-png \
--with-freetype \
--with-fontconfig \
--with-icu \
--enable-strip
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
@@ -105,11 +101,11 @@ make install INSTALL_DIR="%{buildroot}"
# Validate menu entrys (vendor specific) # Validate menu entrys (vendor specific)
%if %{_vendor} == "redhat" || %{_vendor}=="fedora" %if %{_vendor} == "redhat" || %{_vendor}=="fedora"
desktop-file-install \ desktop-file-install \
# --delete-original \
--vendor="%{_vendor}" \ --vendor="%{_vendor}" \
--remove-key Version \ --remove-key Version \
--dir="%{buildroot}/%{_datadir}/applications/" \ --dir="%{buildroot}/%{_datadir}/applications/" \
"%{buildroot}/%{_datadir}/applications/%{name}.desktop" \ "%{buildroot}/%{_datadir}/applications/%{name}.desktop"
# --delete-original
%endif %endif
%clean %clean
@@ -152,8 +148,7 @@ fi
%{_datadir}/doc/%{name}/* %{_datadir}/doc/%{name}/*
%{_datadir}/games/%{name}/lang/* %{_datadir}/games/%{name}/lang/*
%{_datadir}/games/%{name}/data/* %{_datadir}/games/%{name}/data/*
%{_datadir}/games/%{name}/scripts/* %{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/pixmaps/* %{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/icons/hicolor/*/apps/%{name}.png
%doc %{_mandir}/man6/%{name}.6.gz %doc %{_mandir}/man6/%{name}.6.gz

View File

@@ -1,11 +1,11 @@
!define APPNAME "OpenTTD" ; Define application name !define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "0.7.3-RC1" ; Define application version !define APPVERSION "0.7.0" ; Define application version
!define APPVERSIONINTERNAL "0.7.3.0" ; Define application version in X.X.X.X !define INSTALLERVERSION 57 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define INSTALLERVERSION 66 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!include ${VERSION_INCLUDE} !include ${VERSION_INCLUDE}
!define APPURLLINK "http://www.openttd.org" !define APPURLLINK "http://www.openttd.org"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}" !define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
!define MUI_ICON "..\..\..\media\openttd.ico" !define MUI_ICON "..\..\..\media\openttd.ico"
!define MUI_UNICON "..\..\..\media\openttd.ico" !define MUI_UNICON "..\..\..\media\openttd.ico"
@@ -71,6 +71,10 @@ Page custom SelectCDEnter SelectCDExit ": TTD folder"
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
;-----------------------------------------------------
; New custom page to show UNICODE and MSLU information
Page custom ShowWarningsPage
!define MUI_FINISHPAGE_TITLE_3LINES !define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!" !define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!"
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe" !define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe"
@@ -108,6 +112,13 @@ Section "!OpenTTD" Section1
File ${PATH_ROOT}bin\data\*.grf File ${PATH_ROOT}bin\data\*.grf
File ${PATH_ROOT}bin\data\*.obg File ${PATH_ROOT}bin\data\*.obg
File ${PATH_ROOT}bin\data\opntitle.dat 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 ; Copy the scripts
SetOutPath "$INSTDIR\scripts\" SetOutPath "$INSTDIR\scripts\"
@@ -129,6 +140,7 @@ Section "!OpenTTD" Section1
; Delete old files from the main dir. they are now placed in data/ and lang/ ; Delete old files from the main dir. they are now placed in data/ and lang/
Delete "$INSTDIR\*.lng" Delete "$INSTDIR\*.lng"
Delete "$INSTDIR\*.grf" Delete "$INSTDIR\*.grf"
Delete "$INSTDIR\*.obg"
Delete "$INSTDIR\sample.cat" Delete "$INSTDIR\sample.cat"
Delete "$INSTDIR\ttd.exe" Delete "$INSTDIR\ttd.exe"
@@ -367,6 +379,23 @@ WinNT:
ClearErrors ClearErrors
FunctionEnd FunctionEnd
;----------------------------------------------------------------------------------
; Custom page function to show notices for running OpenTTD (only for win32 systems)
; We have extracted this custom page as Notice in the .onInit function
Function ShowWarningsPage
Call GetWindowsVersion
Pop $R0
; Don't show the UNICODE notice if the installer is run on Win9x systems
StrCmp $R0 "win9x" 0 WinNT
Abort
WinNT:
!insertmacro MUI_HEADER_TEXT "Installation Complete" "Important notices for OpenTTD usage."
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "notice.ini" "Notice"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Notice"
ClearErrors
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
; Determine windows version, returns "win9x" if Win9x/Me or "winnt" on the stack ; Determine windows version, returns "win9x" if Win9x/Me or "winnt" on the stack
Function GetWindowsVersion Function GetWindowsVersion

View File

@@ -0,0 +1,30 @@
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=3
CancelEnabled=0
[Field 1]
Type=Groupbox
Text=UNICODE support
Left=8
Right=292
Top=0
Bottom=75
[Field 2]
Type=Label
Text=This version of OpenTTD has support for UNICODE, allowing users to use non-ASCII character sets such as Russian or Japanese.\r\nSelecting such a language will result in an unusable and garbled interface. You will need to specify a font that has support for these characters in openttd.cfg, or alternatively use an appropiate grf file.\r\n\r\nFor more information please refer to the readme or the wiki.
Left=13
Right=284
Top=9
Bottom=65
[Field 3]
Type=Link
Text=OpenTTD wiki
Left=238
Right=284
Top=64
Bottom=72
State=http://wiki.openttd.org/index.php/Unicode

View File

@@ -16,10 +16,10 @@ End Sub
Sub UpdateFile(modified, revision, version, cur_date, filename) Sub UpdateFile(modified, revision, version, cur_date, filename)
FSO.CopyFile filename & ".in", filename FSO.CopyFile filename & ".in", filename
FindReplaceInFile filename, "!!MODIFIED!!", modified FindReplaceInFile filename, "@@MODIFIED@@", modified
FindReplaceInFile filename, "!!REVISION!!", revision FindReplaceInFile filename, "@@REVISION@@", revision
FindReplaceInFile filename, "!!VERSION!!", version FindReplaceInFile filename, "@@VERSION@@", version
FindReplaceInFile filename, "!!DATE!!", cur_date FindReplaceInFile filename, "@@DATE@@", cur_date
End Sub End Sub
Sub UpdateFiles(version) Sub UpdateFiles(version)
@@ -32,7 +32,7 @@ Sub UpdateFiles(version)
modified = Mid(version, InStrRev(version, Chr(9)) + 1) modified = Mid(version, InStrRev(version, Chr(9)) + 1)
version = Mid(version, 1, InStr(version, Chr(9)) - 1) version = Mid(version, 1, InStr(version, Chr(9)) - 1)
Else Else
version = "0.7.3-RC1" version = "0.7.0-RC2"
revision = 0 revision = 0
modified = 1 modified = 1
End If End If

View File

@@ -153,7 +153,7 @@ load_lang_data() {
Name=\"VCCustomBuildTool\" Name=\"VCCustomBuildTool\"
Description=\"Generating "$i" language file\" Description=\"Generating "$i" language file\"
CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\" CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\"
AdditionalDependencies=\"..\\src\\lang\\english.txt\" AdditionalDependencies=\"\"
Outputs=\"..\\bin\\lang\\"$i".lng\" Outputs=\"..\\bin\\lang\\"$i".lng\"
/> />
</FileConfiguration> </FileConfiguration>

View File

@@ -203,7 +203,7 @@ Function load_lang_data(dir)
& vbCrLf & " Name=" & Chr(34) & "VCCustomBuildTool" & Chr(34) _ & vbCrLf & " Name=" & Chr(34) & "VCCustomBuildTool" & Chr(34) _
& vbCrLf & " Description=" & Chr(34) & "Generating " & file & " language file" & 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 & " CommandLine=" & Chr(34) & "..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" & Chr(34) _
& vbCrLf & " AdditionalDependencies=" & Chr(34) & "..\src\lang\english.txt" & Chr(34) _ & vbCrLf & " AdditionalDependencies=" & Chr(34) & Chr(34) _
& vbCrLf & " Outputs=" & Chr(34) & "..\bin\lang\" & file & ".lng" & Chr(34) _ & vbCrLf & " Outputs=" & Chr(34) & "..\bin\lang\" & file & ".lng" & Chr(34) _
& vbCrLf & " />" _ & vbCrLf & " />" _
& vbCrLf & " </FileConfiguration>" _ & vbCrLf & " </FileConfiguration>" _

View File

@@ -56,7 +56,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating afrikaans language file" Description="Generating afrikaans language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\afrikaans.lng" Outputs="..\bin\lang\afrikaans.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -71,7 +71,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating arabic_egypt language file" Description="Generating arabic_egypt language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\arabic_egypt.lng" Outputs="..\bin\lang\arabic_egypt.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -86,7 +86,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating brazilian_portuguese language file" Description="Generating brazilian_portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\brazilian_portuguese.lng" Outputs="..\bin\lang\brazilian_portuguese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -101,7 +101,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating bulgarian language file" Description="Generating bulgarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\bulgarian.lng" Outputs="..\bin\lang\bulgarian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -116,7 +116,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating catalan language file" Description="Generating catalan language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\catalan.lng" Outputs="..\bin\lang\catalan.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -131,7 +131,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating croatian language file" Description="Generating croatian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\croatian.lng" Outputs="..\bin\lang\croatian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -146,7 +146,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating czech language file" Description="Generating czech language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\czech.lng" Outputs="..\bin\lang\czech.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -161,7 +161,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating danish language file" Description="Generating danish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\danish.lng" Outputs="..\bin\lang\danish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -176,7 +176,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating dutch language file" Description="Generating dutch language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\dutch.lng" Outputs="..\bin\lang\dutch.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -191,7 +191,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating english language file" Description="Generating english language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\english.lng" Outputs="..\bin\lang\english.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -206,7 +206,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating english_US language file" Description="Generating english_US language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\english_US.lng" Outputs="..\bin\lang\english_US.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -221,7 +221,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating esperanto language file" Description="Generating esperanto language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\esperanto.lng" Outputs="..\bin\lang\esperanto.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -236,7 +236,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating estonian language file" Description="Generating estonian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\estonian.lng" Outputs="..\bin\lang\estonian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -251,7 +251,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating finnish language file" Description="Generating finnish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\finnish.lng" Outputs="..\bin\lang\finnish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -266,7 +266,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating french language file" Description="Generating french language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\french.lng" Outputs="..\bin\lang\french.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -281,7 +281,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating galician language file" Description="Generating galician language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\galician.lng" Outputs="..\bin\lang\galician.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -296,7 +296,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating german language file" Description="Generating german language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\german.lng" Outputs="..\bin\lang\german.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -311,7 +311,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating hebrew language file" Description="Generating hebrew language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\hebrew.lng" Outputs="..\bin\lang\hebrew.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -326,7 +326,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating hungarian language file" Description="Generating hungarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\hungarian.lng" Outputs="..\bin\lang\hungarian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -341,7 +341,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating icelandic language file" Description="Generating icelandic language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\icelandic.lng" Outputs="..\bin\lang\icelandic.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -356,7 +356,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating indonesian language file" Description="Generating indonesian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\indonesian.lng" Outputs="..\bin\lang\indonesian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -371,7 +371,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating italian language file" Description="Generating italian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\italian.lng" Outputs="..\bin\lang\italian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -386,7 +386,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating japanese language file" Description="Generating japanese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\japanese.lng" Outputs="..\bin\lang\japanese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -401,7 +401,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating korean language file" Description="Generating korean language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\korean.lng" Outputs="..\bin\lang\korean.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -416,7 +416,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating latvian language file" Description="Generating latvian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\latvian.lng" Outputs="..\bin\lang\latvian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -431,7 +431,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating lithuanian language file" Description="Generating lithuanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\lithuanian.lng" Outputs="..\bin\lang\lithuanian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -446,7 +446,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating luxembourgish language file" Description="Generating luxembourgish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\luxembourgish.lng" Outputs="..\bin\lang\luxembourgish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -461,7 +461,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating norwegian_bokmal language file" Description="Generating norwegian_bokmal language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_bokmal.lng" Outputs="..\bin\lang\norwegian_bokmal.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -476,7 +476,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating norwegian_nynorsk language file" Description="Generating norwegian_nynorsk language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_nynorsk.lng" Outputs="..\bin\lang\norwegian_nynorsk.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -491,7 +491,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating piglatin language file" Description="Generating piglatin language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\piglatin.lng" Outputs="..\bin\lang\piglatin.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -506,7 +506,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating polish language file" Description="Generating polish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\polish.lng" Outputs="..\bin\lang\polish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -521,7 +521,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating portuguese language file" Description="Generating portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\portuguese.lng" Outputs="..\bin\lang\portuguese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -536,7 +536,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating romanian language file" Description="Generating romanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\romanian.lng" Outputs="..\bin\lang\romanian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -551,26 +551,11 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating russian language file" Description="Generating russian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\russian.lng" Outputs="..\bin\lang\russian.lng"
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\src\lang\serbian.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating serbian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt"
Outputs="..\bin\lang\serbian.lng"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\src\lang\simplified_chinese.txt" RelativePath="..\src\lang\simplified_chinese.txt"
> >
@@ -581,7 +566,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating simplified_chinese language file" Description="Generating simplified_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\simplified_chinese.lng" Outputs="..\bin\lang\simplified_chinese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -596,7 +581,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating slovak language file" Description="Generating slovak language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\slovak.lng" Outputs="..\bin\lang\slovak.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -611,7 +596,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating slovenian language file" Description="Generating slovenian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\slovenian.lng" Outputs="..\bin\lang\slovenian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -626,7 +611,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating spanish language file" Description="Generating spanish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\spanish.lng" Outputs="..\bin\lang\spanish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -641,7 +626,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating swedish language file" Description="Generating swedish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\swedish.lng" Outputs="..\bin\lang\swedish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -656,7 +641,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating traditional_chinese language file" Description="Generating traditional_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\traditional_chinese.lng" Outputs="..\bin\lang\traditional_chinese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -671,7 +656,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating turkish language file" Description="Generating turkish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\turkish.lng" Outputs="..\bin\lang\turkish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -686,7 +671,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating ukrainian language file" Description="Generating ukrainian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\ukrainian.lng" Outputs="..\bin\lang\ukrainian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -701,7 +686,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating welsh language file" Description="Generating welsh language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\welsh.lng" Outputs="..\bin\lang\welsh.lng"
/> />
</FileConfiguration> </FileConfiguration>

View File

@@ -57,7 +57,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating afrikaans language file" Description="Generating afrikaans language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\afrikaans.lng" Outputs="..\bin\lang\afrikaans.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -72,7 +72,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating arabic_egypt language file" Description="Generating arabic_egypt language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\arabic_egypt.lng" Outputs="..\bin\lang\arabic_egypt.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -87,7 +87,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating brazilian_portuguese language file" Description="Generating brazilian_portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\brazilian_portuguese.lng" Outputs="..\bin\lang\brazilian_portuguese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -102,7 +102,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating bulgarian language file" Description="Generating bulgarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\bulgarian.lng" Outputs="..\bin\lang\bulgarian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -117,7 +117,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating catalan language file" Description="Generating catalan language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\catalan.lng" Outputs="..\bin\lang\catalan.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -132,7 +132,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating croatian language file" Description="Generating croatian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\croatian.lng" Outputs="..\bin\lang\croatian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -147,7 +147,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating czech language file" Description="Generating czech language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\czech.lng" Outputs="..\bin\lang\czech.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -162,7 +162,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating danish language file" Description="Generating danish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\danish.lng" Outputs="..\bin\lang\danish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -177,7 +177,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating dutch language file" Description="Generating dutch language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\dutch.lng" Outputs="..\bin\lang\dutch.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -192,7 +192,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating english language file" Description="Generating english language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\english.lng" Outputs="..\bin\lang\english.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -207,7 +207,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating english_US language file" Description="Generating english_US language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\english_US.lng" Outputs="..\bin\lang\english_US.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -222,7 +222,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating esperanto language file" Description="Generating esperanto language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\esperanto.lng" Outputs="..\bin\lang\esperanto.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -237,7 +237,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating estonian language file" Description="Generating estonian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\estonian.lng" Outputs="..\bin\lang\estonian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -252,7 +252,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating finnish language file" Description="Generating finnish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\finnish.lng" Outputs="..\bin\lang\finnish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -267,7 +267,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating french language file" Description="Generating french language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\french.lng" Outputs="..\bin\lang\french.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -282,7 +282,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating galician language file" Description="Generating galician language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\galician.lng" Outputs="..\bin\lang\galician.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -297,7 +297,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating german language file" Description="Generating german language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\german.lng" Outputs="..\bin\lang\german.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -312,7 +312,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating hebrew language file" Description="Generating hebrew language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\hebrew.lng" Outputs="..\bin\lang\hebrew.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -327,7 +327,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating hungarian language file" Description="Generating hungarian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\hungarian.lng" Outputs="..\bin\lang\hungarian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -342,7 +342,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating icelandic language file" Description="Generating icelandic language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\icelandic.lng" Outputs="..\bin\lang\icelandic.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -357,7 +357,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating indonesian language file" Description="Generating indonesian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\indonesian.lng" Outputs="..\bin\lang\indonesian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -372,7 +372,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating italian language file" Description="Generating italian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\italian.lng" Outputs="..\bin\lang\italian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -387,7 +387,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating japanese language file" Description="Generating japanese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\japanese.lng" Outputs="..\bin\lang\japanese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -402,7 +402,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating korean language file" Description="Generating korean language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\korean.lng" Outputs="..\bin\lang\korean.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -417,7 +417,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating latvian language file" Description="Generating latvian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\latvian.lng" Outputs="..\bin\lang\latvian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -432,7 +432,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating lithuanian language file" Description="Generating lithuanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\lithuanian.lng" Outputs="..\bin\lang\lithuanian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -447,7 +447,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating luxembourgish language file" Description="Generating luxembourgish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\luxembourgish.lng" Outputs="..\bin\lang\luxembourgish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -462,7 +462,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating norwegian_bokmal language file" Description="Generating norwegian_bokmal language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_bokmal.lng" Outputs="..\bin\lang\norwegian_bokmal.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -477,7 +477,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating norwegian_nynorsk language file" Description="Generating norwegian_nynorsk language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\norwegian_nynorsk.lng" Outputs="..\bin\lang\norwegian_nynorsk.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -492,7 +492,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating piglatin language file" Description="Generating piglatin language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\piglatin.lng" Outputs="..\bin\lang\piglatin.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -507,7 +507,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating polish language file" Description="Generating polish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\polish.lng" Outputs="..\bin\lang\polish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -522,7 +522,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating portuguese language file" Description="Generating portuguese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\portuguese.lng" Outputs="..\bin\lang\portuguese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -537,7 +537,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating romanian language file" Description="Generating romanian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\romanian.lng" Outputs="..\bin\lang\romanian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -552,26 +552,11 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating russian language file" Description="Generating russian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\russian.lng" Outputs="..\bin\lang\russian.lng"
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\src\lang\serbian.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating serbian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt"
Outputs="..\bin\lang\serbian.lng"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\src\lang\simplified_chinese.txt" RelativePath="..\src\lang\simplified_chinese.txt"
> >
@@ -582,7 +567,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating simplified_chinese language file" Description="Generating simplified_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\simplified_chinese.lng" Outputs="..\bin\lang\simplified_chinese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -597,7 +582,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating slovak language file" Description="Generating slovak language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\slovak.lng" Outputs="..\bin\lang\slovak.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -612,7 +597,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating slovenian language file" Description="Generating slovenian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\slovenian.lng" Outputs="..\bin\lang\slovenian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -627,7 +612,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating spanish language file" Description="Generating spanish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\spanish.lng" Outputs="..\bin\lang\spanish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -642,7 +627,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating swedish language file" Description="Generating swedish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\swedish.lng" Outputs="..\bin\lang\swedish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -657,7 +642,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating traditional_chinese language file" Description="Generating traditional_chinese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\traditional_chinese.lng" Outputs="..\bin\lang\traditional_chinese.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -672,7 +657,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating turkish language file" Description="Generating turkish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\turkish.lng" Outputs="..\bin\lang\turkish.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -687,7 +672,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating ukrainian language file" Description="Generating ukrainian language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\ukrainian.lng" Outputs="..\bin\lang\ukrainian.lng"
/> />
</FileConfiguration> </FileConfiguration>
@@ -702,7 +687,7 @@
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Generating welsh language file" Description="Generating welsh language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt" AdditionalDependencies=""
Outputs="..\bin\lang\welsh.lng" Outputs="..\bin\lang\welsh.lng"
/> />
</FileConfiguration> </FileConfiguration>

View File

@@ -103,8 +103,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
OptimizeForWindows98="1" OptimizeForWindows98="1"
TargetMachine="1" TargetMachine="1"
@@ -203,8 +201,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
@@ -316,8 +312,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
OptimizeForWindows98="1" OptimizeForWindows98="1"
TargetMachine="17" TargetMachine="17"
@@ -419,8 +413,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="17" TargetMachine="17"
/> />
<Tool <Tool
@@ -955,10 +947,6 @@
RelativePath=".\..\src\driver.h" RelativePath=".\..\src\driver.h"
> >
</File> </File>
<File
RelativePath=".\..\src\economy_base.h"
>
</File>
<File <File
RelativePath=".\..\src\economy_func.h" RelativePath=".\..\src\economy_func.h"
> >
@@ -2563,10 +2551,6 @@
RelativePath=".\..\src\ai\api\ai_cargolist.hpp" RelativePath=".\..\src\ai\api\ai_cargolist.hpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_changelog.hpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_company.hpp" RelativePath=".\..\src\ai\api\ai_company.hpp"
> >
@@ -2675,10 +2659,6 @@
RelativePath=".\..\src\ai\api\ai_sign.hpp" RelativePath=".\..\src\ai\api\ai_sign.hpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_signlist.hpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_station.hpp" RelativePath=".\..\src\ai\api\ai_station.hpp"
> >
@@ -2883,10 +2863,6 @@
RelativePath=".\..\src\ai\api\ai_sign.cpp" RelativePath=".\..\src\ai\api\ai_sign.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_signlist.cpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_station.cpp" RelativePath=".\..\src\ai\api\ai_station.cpp"
> >

View File

@@ -103,8 +103,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
OptimizeForWindows98="1" OptimizeForWindows98="1"
TargetMachine="1" TargetMachine="1"
@@ -203,8 +201,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
@@ -316,8 +312,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
OptimizeForWindows98="1" OptimizeForWindows98="1"
TargetMachine="17" TargetMachine="17"
@@ -419,8 +413,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="17" TargetMachine="17"
/> />
<Tool <Tool

View File

@@ -104,8 +104,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
@@ -202,8 +200,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1" TargetMachine="1"
@@ -314,8 +310,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
TargetMachine="17" TargetMachine="17"
/> />
@@ -416,8 +410,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="17" TargetMachine="17"
/> />
<Tool <Tool
@@ -952,10 +944,6 @@
RelativePath=".\..\src\driver.h" RelativePath=".\..\src\driver.h"
> >
</File> </File>
<File
RelativePath=".\..\src\economy_base.h"
>
</File>
<File <File
RelativePath=".\..\src\economy_func.h" RelativePath=".\..\src\economy_func.h"
> >
@@ -2560,10 +2548,6 @@
RelativePath=".\..\src\ai\api\ai_cargolist.hpp" RelativePath=".\..\src\ai\api\ai_cargolist.hpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_changelog.hpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_company.hpp" RelativePath=".\..\src\ai\api\ai_company.hpp"
> >
@@ -2672,10 +2656,6 @@
RelativePath=".\..\src\ai\api\ai_sign.hpp" RelativePath=".\..\src\ai\api\ai_sign.hpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_signlist.hpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_station.hpp" RelativePath=".\..\src\ai\api\ai_station.hpp"
> >
@@ -2880,10 +2860,6 @@
RelativePath=".\..\src\ai\api\ai_sign.cpp" RelativePath=".\..\src\ai\api\ai_sign.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\ai\api\ai_signlist.cpp"
>
</File>
<File <File
RelativePath=".\..\src\ai\api\ai_station.cpp" RelativePath=".\..\src\ai\api\ai_station.cpp"
> >

View File

@@ -104,8 +104,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
@@ -202,8 +200,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1" TargetMachine="1"
@@ -314,8 +310,6 @@
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
OptimizeReferences="2" OptimizeReferences="2"
TargetMachine="17" TargetMachine="17"
/> />
@@ -416,8 +410,6 @@
IgnoreDefaultLibraryNames="LIBCMT.lib" IgnoreDefaultLibraryNames="LIBCMT.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
StackReserveSize="1048576"
StackCommitSize="1048576"
TargetMachine="17" TargetMachine="17"
/> />
<Tool <Tool

View File

@@ -1,6 +1,6 @@
OpenTTD README OpenTTD README
Last updated: 2009-08-18 Last updated: 2009-03-23
Release version: 0.7.2 Release version: 0.7.0-RC2
------------------------------------------------------------------------ ------------------------------------------------------------------------
@@ -17,7 +17,6 @@ Table of Contents:
5.0) OpenTTD features 5.0) OpenTTD features
6.0) Configuration File 6.0) Configuration File
7.0) Compiling 7.0) Compiling
* 7.1) Required/optional libraries
8.0) Translating 8.0) Translating
* 8.1 Guidelines * 8.1 Guidelines
* 8.2 Translation * 8.2 Translation
@@ -192,19 +191,6 @@ 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 the following sections) as sooner or later you will run into graphical glitches
when using other versions of the game. when using other versions of the game.
If you want AIs use the in-game content downloader. If for some reason that is
not possible or you want to use an AI that has not been uploaded to the content
download system download the tar file and place it in the ai/ directory. If the
AI needs libraries you'll have to download those too and put them in the
ai/library/ directory. All AIs and AI Libraries that have been uploaded to
the content download system can be found at http://noai.openttd.org/downloads/
The AIs and libraries can be found their in the form of .tar.gz packages.
OpenTTD can read inside tar files but it does not extract .tar.gz files by
itself.
To figure out which libraries you need for an AI you have to start the AI and
wait for an error message to pop up. The error message will tell you
"couldn't find library 'lib-name'". Download that library and try again.
4.2) OpenTTD directories 4.2) OpenTTD directories
---- ------------------------------- ---- -------------------------------
@@ -330,12 +316,18 @@ Windows:
You can also build it using the Makefile with MSYS/MinGW or Cygwin/MinGW. You can also build it using the Makefile with MSYS/MinGW or Cygwin/MinGW.
Please read the Makefile for more information. Please read the Makefile for more information.
Solaris, FreeBSD, OpenBSD: Solaris 10:
Use "gmake", but do a "./configure" before the first build. You need g++ (version 3 or higher), together with SDL. Installation of
libpng and zlib is recommended. For the first build it is required
to execute "bash configure" first. Note that ./configure does not work
yet. It is likely that you don't have a strip binary, so use the
--disable-strip option in that case. Fontconfig (>2.3.0) and freetype
are optional. "make run" will then run the program.
Linux/Unix: Unix:
OpenTTD can be built with GNU "make". On non-GNU systems it's called "gmake". OpenTTD can be built with GNU "make". On non-GNU systems it's called "gmake".
However, for the first build one has to do a "./configure" first. However, for the first build one has to do a "./configure" first.
Note that you need SDL-devel 1.2.5 (or higher) to compile OpenTTD.
MacOS X: MacOS X:
Use "make" or Xcode (which will then call make for you) Use "make" or Xcode (which will then call make for you)
@@ -347,6 +339,15 @@ MacOS X:
BeOS: BeOS:
Use "make", but do a "./configure" before the first build. Use "make", but do a "./configure" before the first build.
FreeBSD:
You need the port devel/sdl12 for a non-dedicated build.
graphics/png is optional for screenshots in the PNG format.
Use "gmake", but do a "./configure" before the first build.
OpenBSD:
Use "gmake", but do a "./configure" before the first build.
Note that you need the port devel/sdl to compile OpenTTD.
MorphOS: MorphOS:
Use "make". However, for the first build one has to do a "./configure" first. Use "make". However, for the first build one has to do a "./configure" first.
Note that you need the MorphOS SDK, latest libnix updates (else C++ parts of Note that you need the MorphOS SDK, latest libnix updates (else C++ parts of
@@ -367,8 +368,6 @@ DOS:
will be generated that does not need cwsdpmi.exe by adding the cswdstub.exe will be generated that does not need cwsdpmi.exe by adding the cswdstub.exe
to the created OpenTTD binary. to the created OpenTTD binary.
7.1) Required/optional libraries:
---- -------------------
The following libraries are used by OpenTTD for: The following libraries are used by OpenTTD for:
- libSDL/liballegro: hardware access (video, sound, mouse) - libSDL/liballegro: hardware access (video, sound, mouse)
- zlib: (de)compressing of savegames - zlib: (de)compressing of savegames
@@ -377,18 +376,15 @@ The following libraries are used by OpenTTD for:
- libfontconfig: searching for fonts, resolving font names to actual fonts - libfontconfig: searching for fonts, resolving font names to actual fonts
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) - libicu: handling of right-to-left scripts (e.g. Arabic and Persian)
OpenTTD does not require any of the libraries to be present, but without
zlib you cannot open most savegames or use the content downloading system.
Without libSDL/liballegro on non-Windows and non-MacOS X machines you have
no graphical user interface; you would be building a dedicated server.
8.0) Translating: 8.0) Translating:
---- ------------------- ---- -------------------
See http://www.openttd.org/development for up-to-date information. See http://www.openttd.org/development for up-to-date information.
The use of the online Translator service, located at The use of the online Translator service, located at
http://translator.openttd.org/, is highly encouraged. For getting an account http://translator2.openttd.org/, is highly encouraged. For a username/password
simply follow the guidelines in the FAQ of the translator website. combo you should contact the development team, either by mail, IRC or the
forums. The system is straightforward to use, and if you have any problems,
read the online help located there.
If for some reason the website is down for a longer period of time, the If for some reason the website is down for a longer period of time, the
information below might be of help. information below might be of help.
@@ -490,7 +486,7 @@ Inactive Developers:
Tamás Faragó (Darkvater) - Ex-Lead coder Tamás Faragó (Darkvater) - Ex-Lead coder
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;) Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
Jonathan Coome (Maedhros) - High priest of the NewGRF Temple Jonathan Coome (Maedhros) - High priest of the NewGRF Temple
Attila Bán (MiHaMiX) - WebTranslator 1 and 2 Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host
Christoph Mallon (Tron) - Programmer, code correctness police Christoph Mallon (Tron) - Programmer, code correctness police
Retired Developers: Retired Developers:
@@ -498,7 +494,7 @@ Retired Developers:
Serge Paquet (vurlix) - Assistant project manager, coder (0.1 - 0.3.3) Serge Paquet (vurlix) - Assistant project manager, coder (0.1 - 0.3.3)
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6) Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6)
Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker
Patric Stout (TrueLight) - Programmer (0.3 - pre0.7), sys op (active) Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.7)
Thanks to: Thanks to:
Josef Drexler - For his great work on TTDPatch. Josef Drexler - For his great work on TTDPatch.
@@ -511,8 +507,6 @@ Thanks to:
Christian Rosentreter (tokai) - MorphOS / AmigaOS port Christian Rosentreter (tokai) - MorphOS / AmigaOS port
Richard Kempton (RichK67) - Additional airports, initial TGP implementation Richard Kempton (RichK67) - Additional airports, initial TGP implementation
Alberto Demichelis - Squirrel scripting language Alberto Demichelis - Squirrel scripting language
Markus F.X.J. Oberhumer - MiniLZO for loading old savegames
L. Peter Deutsch - MD5 implementation
Michael Blunck - For revolutionizing TTD with awesome graphics Michael Blunck - For revolutionizing TTD with awesome graphics
George - Canal graphics George - Canal graphics
David Dallaston (Pikka) - Tram tracks David Dallaston (Pikka) - Tram tracks

View File

@@ -167,7 +167,6 @@ direction_func.h
direction_type.h direction_type.h
music/dmusic.h music/dmusic.h
driver.h driver.h
economy_base.h
economy_func.h economy_func.h
economy_type.h economy_type.h
effectvehicle_base.h effectvehicle_base.h
@@ -594,7 +593,6 @@ ai/api/ai_bridge.hpp
ai/api/ai_bridgelist.hpp ai/api/ai_bridgelist.hpp
ai/api/ai_cargo.hpp ai/api/ai_cargo.hpp
ai/api/ai_cargolist.hpp ai/api/ai_cargolist.hpp
ai/api/ai_changelog.hpp
ai/api/ai_company.hpp ai/api/ai_company.hpp
ai/api/ai_controller.hpp ai/api/ai_controller.hpp
ai/api/ai_date.hpp ai/api/ai_date.hpp
@@ -622,7 +620,6 @@ ai/api/ai_rail.hpp
ai/api/ai_railtypelist.hpp ai/api/ai_railtypelist.hpp
ai/api/ai_road.hpp ai/api/ai_road.hpp
ai/api/ai_sign.hpp ai/api/ai_sign.hpp
ai/api/ai_signlist.hpp
ai/api/ai_station.hpp ai/api/ai_station.hpp
ai/api/ai_stationlist.hpp ai/api/ai_stationlist.hpp
ai/api/ai_subsidy.hpp ai/api/ai_subsidy.hpp
@@ -675,7 +672,6 @@ ai/api/ai_rail.cpp
ai/api/ai_railtypelist.cpp ai/api/ai_railtypelist.cpp
ai/api/ai_road.cpp ai/api/ai_road.cpp
ai/api/ai_sign.cpp ai/api/ai_sign.cpp
ai/api/ai_signlist.cpp
ai/api/ai_station.cpp ai/api/ai_station.cpp
ai/api/ai_stationlist.cpp ai/api/ai_stationlist.cpp
ai/api/ai_subsidy.cpp ai/api/ai_subsidy.cpp

View File

@@ -275,7 +275,6 @@ typedef struct tagSQRegFunction{
}SQRegFunction; }SQRegFunction;
/*vm*/ /*vm*/
SQUIRREL_API bool sq_can_suspend(HSQUIRRELVM v);
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize); SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize);
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize); SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v); SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v);
@@ -286,7 +285,6 @@ SQUIRREL_API void sq_setprintfunc(HSQUIRRELVM v, SQPRINTFUNCTION printfunc);
SQUIRREL_API SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v); SQUIRREL_API SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_suspendvm(HSQUIRRELVM v); SQUIRREL_API SQRESULT sq_suspendvm(HSQUIRRELVM v);
SQUIRREL_API bool sq_resumecatch(HSQUIRRELVM v, int suspend = -1); SQUIRREL_API bool sq_resumecatch(HSQUIRRELVM v, int suspend = -1);
SQUIRREL_API bool sq_resumeerror(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror); SQUIRREL_API SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror);
SQUIRREL_API SQInteger sq_getvmstate(HSQUIRRELVM v); SQUIRREL_API SQInteger sq_getvmstate(HSQUIRRELVM v);

View File

@@ -90,11 +90,6 @@ SQInteger sq_getvmstate(HSQUIRRELVM v)
} }
} }
bool sq_can_suspend(HSQUIRRELVM v)
{
return v->_nnativecalls <= 2;
}
void sq_seterrorhandler(HSQUIRRELVM v) void sq_seterrorhandler(HSQUIRRELVM v)
{ {
SQObject o = stack_get(v, -1); SQObject o = stack_get(v, -1);
@@ -1010,14 +1005,6 @@ bool sq_resumecatch(HSQUIRRELVM v, int suspend)
return v->Execute(_null_, v->_top, -1, -1, ret, SQTrue, SQVM::ET_RESUME_OPENTTD); return v->Execute(_null_, v->_top, -1, -1, ret, SQTrue, SQVM::ET_RESUME_OPENTTD);
} }
bool sq_resumeerror(HSQUIRRELVM v)
{
SQObjectPtr ret;
v->_can_suspend = true;
v->_ops_till_suspend = 1;
return v->Execute(_null_, v->_top, -1, -1, ret, SQTrue, SQVM::ET_RESUME_THROW_VM);
}
void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook) void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook)
{ {
if(sq_gettop(v) >= 1){ if(sq_gettop(v) >= 1){

View File

@@ -128,17 +128,7 @@ public:
} }
void Release() { void Release() {
_uiRef++; _uiRef++;
try { if (_hook) { _hook(_userpointer,0);}
if (_hook) { _hook(_userpointer,0);}
} catch (...) {
_uiRef--;
if (_uiRef == 0) {
SQInteger size = _memsize;
this->~SQInstance();
SQ_FREE(this, size);
}
throw;
}
_uiRef--; _uiRef--;
if(_uiRef > 0) return; if(_uiRef > 0) return;
SQInteger size = _memsize; SQInteger size = _memsize;

View File

@@ -1110,23 +1110,6 @@ public:
case TK_STRING_LITERAL: case TK_STRING_LITERAL:
val = _fs->CreateString(_lex._svalue,_lex._longstr.size()-1); val = _fs->CreateString(_lex._svalue,_lex._longstr.size()-1);
break; break;
case '-':
Lex();
switch(_token)
{
case TK_INTEGER:
val._type = OT_INTEGER;
val._unVal.nInteger = -_lex._nvalue;
break;
case TK_FLOAT:
val._type = OT_FLOAT;
val._unVal.fFloat = -_lex._fvalue;
break;
default:
Error(_SC("scalar expected : integer,float"));
val._type = OT_NULL; // Silent compile-warning
}
break;
default: default:
Error(_SC("scalar expected : integer,float or string")); Error(_SC("scalar expected : integer,float or string"));
val._type = OT_NULL; // Silent compile-warning val._type = OT_NULL; // Silent compile-warning

View File

@@ -188,13 +188,9 @@ SQSharedState::~SQSharedState()
#ifndef NO_GARBAGE_COLLECTOR #ifndef NO_GARBAGE_COLLECTOR
SQCollectable *t = _gc_chain; SQCollectable *t = _gc_chain;
SQCollectable *nx = NULL; SQCollectable *nx = NULL;
while(t) {
t->_uiRef++;
t = t->_next;
}
t = _gc_chain;
while(t) { while(t) {
t->UnMark(); t->UnMark();
t->_uiRef++;
t->Finalize(); t->Finalize();
nx = t->_next; nx = t->_next;
if(--t->_uiRef == 0) if(--t->_uiRef == 0)

View File

@@ -88,7 +88,7 @@ public:
} }
SQUnsignedInteger capacity() { return _allocated; } SQUnsignedInteger capacity() { return _allocated; }
inline T &back() const { return _vals[_size - 1]; } inline T &back() const { return _vals[_size - 1]; }
inline T& operator[](SQUnsignedInteger pos) const{ assert(pos < _allocated); return _vals[pos]; } inline T& operator[](SQUnsignedInteger pos) const{ return _vals[pos]; }
T* _vals; T* _vals;
private: private:
void _realloc(SQUnsignedInteger newsize) void _realloc(SQUnsignedInteger newsize)

View File

@@ -50,9 +50,7 @@ bool SQVM::ARITH_OP(SQUnsignedInteger op,SQObjectPtr &trg,const SQObjectPtr &o1,
res = i1 / i2; res = i1 / i2;
break; break;
case '*': res = i1 * i2; break; case '*': res = i1 * i2; break;
case '%': if(i2 == 0) { Raise_Error(_SC("modulo by zero")); return false; } case '%': res = i1 % i2; break;
res = i1 % i2;
break;
default: res = 0xDEADBEEF; default: res = 0xDEADBEEF;
} }
trg = res; trg = res;
@@ -85,7 +83,7 @@ SQVM::SQVM(SQSharedState *ss)
_suspended = SQFalse; _suspended = SQFalse;
_suspended_target=-1; _suspended_target=-1;
_suspended_root = SQFalse; _suspended_root = SQFalse;
_suspended_traps=0; _suspended_traps=-1;
_foreignptr=NULL; _foreignptr=NULL;
_nnativecalls=0; _nnativecalls=0;
_lasterror = _null_; _lasterror = _null_;
@@ -323,10 +321,6 @@ bool SQVM::StartCall(SQClosure *closure,SQInteger target,SQInteger args,SQIntege
SQInteger ndef = func->_ndefaultparams; SQInteger ndef = func->_ndefaultparams;
if(ndef && nargs < paramssize) { if(ndef && nargs < paramssize) {
SQInteger diff = paramssize - nargs; SQInteger diff = paramssize - nargs;
if (diff > ndef) {
Raise_Error(_SC("wrong number of parameters"));
return false;
}
for(SQInteger n = ndef - diff; n < ndef; n++) { for(SQInteger n = ndef - diff; n < ndef; n++) {
_stack._vals[stackbase + (nargs++)] = closure->_defaultparams[n]; _stack._vals[stackbase + (nargs++)] = closure->_defaultparams[n];
} }
@@ -688,15 +682,12 @@ bool SQVM::Execute(SQObjectPtr &closure, SQInteger target, SQInteger nargs, SQIn
break; break;
case ET_RESUME_GENERATOR: _generator(closure)->Resume(this, target); ci->_root = SQTrue; traps += ci->_etraps; break; case ET_RESUME_GENERATOR: _generator(closure)->Resume(this, target); ci->_root = SQTrue; traps += ci->_etraps; break;
case ET_RESUME_VM: case ET_RESUME_VM:
case ET_RESUME_THROW_VM:
traps = _suspended_traps; traps = _suspended_traps;
ci->_root = _suspended_root; ci->_root = _suspended_root;
ci->_vargs = _suspend_varargs; ci->_vargs = _suspend_varargs;
_suspended = SQFalse; _suspended = SQFalse;
if(et == ET_RESUME_THROW_VM) { SQ_THROW(); }
break; break;
case ET_RESUME_OPENTTD: case ET_RESUME_OPENTTD:
traps = _suspended_traps;
_suspended = SQFalse; _suspended = SQFalse;
break; break;
} }
@@ -707,7 +698,7 @@ exception_restore:
for(;;) for(;;)
{ {
DecreaseOps(1); DecreaseOps(1);
if (ShouldSuspend()) { _suspended = SQTrue; _suspended_traps = traps; return true; } if (ShouldSuspend()) { _suspended = SQTrue; return true; }
const SQInstruction &_i_ = *ci->_ip++; const SQInstruction &_i_ = *ci->_ip++;
//dumpstack(_stackbase); //dumpstack(_stackbase);
@@ -749,23 +740,15 @@ common_call:
_GUARD(gen->Yield(this)); _GUARD(gen->Yield(this));
Return(1, ct_target, clo); Return(1, ct_target, clo);
STK(ct_target) = gen; STK(ct_target) = gen;
while (last_top >= _top) _stack._vals[last_top--].Null();
continue;
} }
while (last_top >= _top) _stack._vals[last_top--].Null();
} }
continue; continue;
case OT_NATIVECLOSURE: { case OT_NATIVECLOSURE: {
bool suspend; bool suspend;
_suspended_target = ct_target; _suspended_target = ct_target;
try { _GUARD(CallNative(_nativeclosure(clo), arg3, ct_stackbase, clo,suspend));
_GUARD(CallNative(_nativeclosure(clo), arg3, ct_stackbase, clo,suspend));
} catch (...) {
_suspended = SQTrue;
_suspended_target = ct_target;
_suspended_root = ci->_root;
_suspended_traps = traps;
_suspend_varargs = ci->_vargs;
throw;
}
if(suspend){ if(suspend){
_suspended = SQTrue; _suspended = SQTrue;
_suspended_target = ct_target; _suspended_target = ct_target;
@@ -945,7 +928,7 @@ common_call:
traps -= ci->_etraps; traps -= ci->_etraps;
if(sarg1 != MAX_FUNC_STACKSIZE) STK(arg1) = temp_reg; if(sarg1 != MAX_FUNC_STACKSIZE) STK(arg1) = temp_reg;
} }
else { Raise_Error(_SC("trying to yield a '%s',only genenerator can be yielded"), GetTypeName(ci->_closure)); SQ_THROW();} else { Raise_Error(_SC("trying to yield a '%s',only genenerator can be yielded"), GetTypeName(ci->_generator)); SQ_THROW();}
if(Return(arg0, arg1, temp_reg)){ if(Return(arg0, arg1, temp_reg)){
assert(traps == 0); assert(traps == 0);
outres = temp_reg; outres = temp_reg;
@@ -1142,8 +1125,6 @@ bool SQVM::CallNative(SQNativeClosure *nclosure,SQInteger nargs,SQInteger stackb
} }
/* Store the call stack size, so we can restore that */
SQInteger cstksize = _callsstacksize;
SQInteger ret; SQInteger ret;
try { try {
SQBool can_suspend = this->_can_suspend; SQBool can_suspend = this->_can_suspend;
@@ -1154,7 +1135,6 @@ bool SQVM::CallNative(SQNativeClosure *nclosure,SQInteger nargs,SQInteger stackb
_nnativecalls--; _nnativecalls--;
suspend = false; suspend = false;
_callsstacksize = cstksize;
_stackbase = oldstackbase; _stackbase = oldstackbase;
_top = oldtop; _top = oldtop;
@@ -1164,8 +1144,6 @@ bool SQVM::CallNative(SQNativeClosure *nclosure,SQInteger nargs,SQInteger stackb
throw; throw;
} }
assert(cstksize == _callsstacksize);
_nnativecalls--; _nnativecalls--;
suspend = false; suspend = false;
if( ret == SQ_SUSPEND_FLAG) suspend = true; if( ret == SQ_SUSPEND_FLAG) suspend = true;
@@ -1508,19 +1486,7 @@ void SQVM::Pop(SQInteger n) {
} }
} }
void SQVM::Push(const SQObjectPtr &o) { void SQVM::Push(const SQObjectPtr &o) { _stack[_top++] = o; }
/* Normally the stack shouldn't get this full, sometimes it might. As of now
* all cases have been bugs in "our" (OpenTTD) code. Trigger an assert for
* all debug builds and for the release builds just increase the stack size.
* This way getting a false positive isn't that bad (releases work fine) and
* if there is something fishy it can be caught in RCs/nightlies. */
#ifdef NDEBUG
if (_top >= (int)_stack.capacity()) _stack.resize(2 * _stack.capacity());
#else
assert(_top < (int)_stack.capacity());
#endif
_stack[_top++] = o;
}
SQObjectPtr &SQVM::Top() { return _stack[_top-1]; } SQObjectPtr &SQVM::Top() { return _stack[_top-1]; }
SQObjectPtr &SQVM::PopGet() { return _stack[--_top]; } SQObjectPtr &SQVM::PopGet() { return _stack[--_top]; }
SQObjectPtr &SQVM::GetUp(SQInteger n) { return _stack[_top+n]; } SQObjectPtr &SQVM::GetUp(SQInteger n) { return _stack[_top+n]; }

View File

@@ -53,7 +53,7 @@ struct SQVM : public CHAINABLE_OBJ
typedef sqvector<CallInfo> CallInfoVec; typedef sqvector<CallInfo> CallInfoVec;
public: public:
enum ExecutionType { ET_CALL, ET_RESUME_GENERATOR, ET_RESUME_VM, ET_RESUME_THROW_VM, ET_RESUME_OPENTTD }; enum ExecutionType { ET_CALL, ET_RESUME_GENERATOR, ET_RESUME_VM, ET_RESUME_OPENTTD };
SQVM(SQSharedState *ss); SQVM(SQSharedState *ss);
~SQVM(); ~SQVM();
bool Init(SQVM *friendvm, SQInteger stacksize); bool Init(SQVM *friendvm, SQInteger stacksize);

View File

@@ -103,11 +103,6 @@ struct AIListWindow : public Window {
sprintf(buf, "%d", selected_info->GetVersion()); sprintf(buf, "%d", selected_info->GetVersion());
DoDrawStringTruncated(buf, x + 5, y, TC_BLACK, this->width - x - 8); DoDrawStringTruncated(buf, x + 5, y, TC_BLACK, this->width - x - 8);
y += 13; y += 13;
if (selected_info->GetURL() != NULL) {
SetDParamStr(0, selected_info->GetURL());
DrawString(4, y, STR_AI_URL, TC_BLACK);
y += 13;
}
SetDParamStr(0, selected_info->GetDescription()); SetDParamStr(0, selected_info->GetDescription());
DrawStringMultiLine(4, y, STR_JUST_RAW_STRING, this->width - 8, this->widget[AIL_WIDGET_INFO_BG].bottom - y); DrawStringMultiLine(4, y, STR_JUST_RAW_STRING, this->width - 8, this->widget[AIL_WIDGET_INFO_BG].bottom - y);
} }
@@ -561,7 +556,6 @@ struct AIDebugWindow : public Window {
enum AIDebugWindowWidgets { enum AIDebugWindowWidgets {
AID_WIDGET_CLOSEBOX = 0, AID_WIDGET_CLOSEBOX = 0,
AID_WIDGET_CAPTION, AID_WIDGET_CAPTION,
AID_WIDGET_STICKY,
AID_WIDGET_VIEW, AID_WIDGET_VIEW,
AID_WIDGET_NAME_TEXT, AID_WIDGET_NAME_TEXT,
AID_WIDGET_RELOAD_TOGGLE, AID_WIDGET_RELOAD_TOGGLE,
@@ -581,8 +575,6 @@ struct AIDebugWindow : public Window {
static CompanyID ai_debug_company; static CompanyID ai_debug_company;
int redraw_timer; int redraw_timer;
int last_vscroll_pos;
bool autoscroll;
AIDebugWindow(const WindowDesc *desc, WindowNumber number) : Window(desc, number) AIDebugWindow(const WindowDesc *desc, WindowNumber number) : Window(desc, number)
{ {
@@ -595,8 +587,6 @@ struct AIDebugWindow : public Window {
this->vscroll.cap = 14; this->vscroll.cap = 14;
this->vscroll.pos = 0; this->vscroll.pos = 0;
this->resize.step_height = 12; this->resize.step_height = 12;
this->last_vscroll_pos = 0;
this->autoscroll = true;
if (ai_debug_company != INVALID_COMPANY) this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); if (ai_debug_company != INVALID_COMPANY) this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
@@ -606,7 +596,7 @@ struct AIDebugWindow : public Window {
virtual void OnPaint() virtual void OnPaint()
{ {
/* Check if the currently selected company is still active. */ /* Check if the currently selected company is still active. */
if (ai_debug_company == INVALID_COMPANY || !IsValidCompanyID(ai_debug_company) || !GetCompany(ai_debug_company)->is_ai) { if (ai_debug_company == INVALID_COMPANY || !IsValidCompanyID(ai_debug_company)) {
if (ai_debug_company != INVALID_COMPANY) { if (ai_debug_company != INVALID_COMPANY) {
/* Raise and disable the widget for the previous selection. */ /* Raise and disable the widget for the previous selection. */
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
@@ -674,35 +664,13 @@ struct AIDebugWindow : public Window {
AILog::LogData *log = (AILog::LogData *)AIObject::GetLogPointer(); AILog::LogData *log = (AILog::LogData *)AIObject::GetLogPointer();
_current_company = old_company; _current_company = old_company;
int scroll_count = (log == NULL) ? 0 : log->used; SetVScrollCount(this, (log == NULL) ? 0 : log->used);
if (this->vscroll.count != scroll_count) { this->InvalidateWidget(AID_WIDGET_SCROLLBAR);
SetVScrollCount(this, scroll_count);
/* We need a repaint */
this->InvalidateWidget(AID_WIDGET_SCROLLBAR);
}
if (log == NULL) return; if (log == NULL) return;
/* Detect when the user scrolls the window. Enable autoscroll when the
* bottom-most line becomes visible. */
if (this->last_vscroll_pos != this->vscroll.pos) {
this->autoscroll = this->vscroll.pos >= log->used - this->vscroll.cap;
}
if (this->autoscroll) {
int scroll_pos = max(0, log->used - this->vscroll.cap);
if (scroll_pos != this->vscroll.pos) {
this->vscroll.pos = scroll_pos;
/* We need a repaint */
this->InvalidateWidget(AID_WIDGET_SCROLLBAR);
}
}
last_vscroll_pos = this->vscroll.pos;
int y = 6; int y = 6;
for (int i = this->vscroll.pos; i < (this->vscroll.cap + this->vscroll.pos) && i < log->used; i++) { for (int i = this->vscroll.pos; i < (this->vscroll.cap + this->vscroll.pos); i++) {
uint pos = (i + log->pos + 1 - log->used + log->count) % log->count; uint pos = (log->count + log->pos - i) % log->count;
if (log->lines[pos] == NULL) break; if (log->lines[pos] == NULL) break;
TextColour colour; TextColour colour;
@@ -725,8 +693,6 @@ struct AIDebugWindow : public Window {
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
ai_debug_company = show_ai; ai_debug_company = show_ai;
this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
this->autoscroll = true;
this->last_vscroll_pos = this->vscroll.pos;
this->SetDirty(); this->SetDirty();
} }
@@ -742,7 +708,7 @@ struct AIDebugWindow : public Window {
if (widget == AID_WIDGET_RELOAD_TOGGLE && !this->IsWidgetDisabled(widget)) { if (widget == AID_WIDGET_RELOAD_TOGGLE && !this->IsWidgetDisabled(widget)) {
/* First kill the company of the AI, then start a new one. This should start the current AI again */ /* First kill the company of the AI, then start a new one. This should start the current AI again */
DoCommandP(0, 2, ai_debug_company, CMD_COMPANY_CTRL); DoCommandP(0, 2, ai_debug_company, CMD_COMPANY_CTRL);
DoCommandP(0, 1, ai_debug_company, CMD_COMPANY_CTRL); DoCommandP(0, 1, 0, CMD_COMPANY_CTRL);
} }
} }
@@ -760,7 +726,6 @@ struct AIDebugWindow : public Window {
virtual void OnResize(Point new_size, Point delta) virtual void OnResize(Point new_size, Point delta)
{ {
this->vscroll.cap += delta.y / (int)this->resize.step_height; this->vscroll.cap += delta.y / (int)this->resize.step_height;
SetVScrollCount(this, this->vscroll.count); // vscroll.pos should be in a valid range
} }
}; };
@@ -769,7 +734,6 @@ CompanyID AIDebugWindow::ai_debug_company = INVALID_COMPANY;
static const Widget _ai_debug_widgets[] = { static const Widget _ai_debug_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // AID_WIDGET_CLOSEBOX { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // AID_WIDGET_CLOSEBOX
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 298, 0, 13, STR_AI_DEBUG, STR_018C_WINDOW_TITLE_DRAG_THIS}, // AID_WIDGET_CAPTION { WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 298, 0, 13, STR_AI_DEBUG, STR_018C_WINDOW_TITLE_DRAG_THIS}, // AID_WIDGET_CAPTION
{ WWT_STICKYBOX, RESIZE_LR, COLOUR_GREY, 287, 298, 0, 13, 0x0, STR_STICKY_BUTTON }, // AID_WIDGET_STICKY
{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 298, 14, 40, 0x0, STR_NULL}, // AID_WIDGET_VIEW { WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 298, 14, 40, 0x0, STR_NULL}, // AID_WIDGET_VIEW
{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 149, 41, 60, 0x0, STR_AI_DEBUG_NAME_TIP}, // AID_WIDGET_NAME_TEXT { WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 149, 41, 60, 0x0, STR_AI_DEBUG_NAME_TIP}, // AID_WIDGET_NAME_TEXT
@@ -807,7 +771,7 @@ static const Widget _ai_debug_widgets[] = {
static const WindowDesc _ai_debug_desc( static const WindowDesc _ai_debug_desc(
WDP_AUTO, WDP_AUTO, 299, 241, 299, 241, WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
WC_AI_DEBUG, WC_NONE, WC_AI_DEBUG, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_ai_debug_widgets _ai_debug_widgets
); );

View File

@@ -36,7 +36,6 @@ AIFileInfo::~AIFileInfo()
free((void *)this->description); free((void *)this->description);
free((void *)this->date); free((void *)this->date);
free((void *)this->instance_name); free((void *)this->instance_name);
free((void *)this->url);
free(this->main_script); free(this->main_script);
free(this->SQ_instance); free(this->SQ_instance);
} }
@@ -99,11 +98,6 @@ bool AIFileInfo::CheckMethod(const char *name) const
if (!info->engine->CallIntegerMethod(*info->SQ_instance, "GetVersion", &info->version)) return SQ_ERROR; if (!info->engine->CallIntegerMethod(*info->SQ_instance, "GetVersion", &info->version)) return SQ_ERROR;
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "CreateInstance", &info->instance_name)) return SQ_ERROR; if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "CreateInstance", &info->instance_name)) return SQ_ERROR;
/* The GetURL function is optional. */
if (info->engine->MethodExists(*info->SQ_instance, "GetURL")) {
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetURL", &info->url)) return SQ_ERROR;
}
return 0; return 0;
} }
@@ -131,12 +125,6 @@ bool AIFileInfo::CheckMethod(const char *name) const
} else { } else {
info->min_loadable_version = info->GetVersion(); info->min_loadable_version = info->GetVersion();
} }
/* When there is an UseAsRandomAI function, call it. */
if (info->engine->MethodExists(*info->SQ_instance, "UseAsRandomAI")) {
if (!info->engine->CallBoolMethod(*info->SQ_instance, "UseAsRandomAI", &info->use_as_random)) return SQ_ERROR;
} else {
info->use_as_random = true;
}
/* Remove the link to the real instance, else it might get deleted by RegisterAI() */ /* Remove the link to the real instance, else it might get deleted by RegisterAI() */
sq_setinstanceup(vm, 2, NULL); sq_setinstanceup(vm, 2, NULL);

View File

@@ -41,7 +41,7 @@ public:
friend class AIInfo; friend class AIInfo;
friend class AILibrary; friend class AILibrary;
AIFileInfo() : SQ_instance(NULL), main_script(NULL), author(NULL), name(NULL), short_name(NULL), description(NULL), date(NULL), instance_name(NULL), url(NULL) {}; AIFileInfo() : SQ_instance(NULL), main_script(NULL), author(NULL), name(NULL), short_name(NULL), description(NULL), date(NULL), instance_name(NULL) {};
~AIFileInfo(); ~AIFileInfo();
/** /**
@@ -84,11 +84,6 @@ public:
*/ */
const char *GetInstanceName() const { return this->instance_name; } const char *GetInstanceName() const { return this->instance_name; }
/**
* Get the website for this script.
*/
const char *GetURL() const { return this->url; }
/** /**
* Get the filename of the main.nut script. * Get the filename of the main.nut script.
*/ */
@@ -116,7 +111,6 @@ private:
const char *date; const char *date;
const char *instance_name; const char *instance_name;
int version; int version;
const char *url;
}; };
class AIInfo : public AIFileInfo { class AIInfo : public AIFileInfo {
@@ -161,15 +155,9 @@ public:
*/ */
int GetSettingDefaultValue(const char *name) const; int GetSettingDefaultValue(const char *name) const;
/**
* Use this AI as a random AI.
*/
bool UseAsRandomAI() const { return this->use_as_random; }
private: private:
AIConfigItemList config_list; AIConfigItemList config_list;
int min_loadable_version; int min_loadable_version;
bool use_as_random;
}; };
class AILibrary : public AIFileInfo { class AILibrary : public AIFileInfo {

View File

@@ -19,7 +19,6 @@
#define DEFINE_SCRIPT_FILES #define DEFINE_SCRIPT_FILES
#include "ai_info.hpp" #include "ai_info.hpp"
#include "ai_config.hpp"
#include "ai_storage.hpp" #include "ai_storage.hpp"
#include "ai_instance.hpp" #include "ai_instance.hpp"
#include "ai_gui.hpp" #include "ai_gui.hpp"
@@ -60,7 +59,6 @@
#include "api/ai_railtypelist.hpp.sq" #include "api/ai_railtypelist.hpp.sq"
#include "api/ai_road.hpp.sq" #include "api/ai_road.hpp.sq"
#include "api/ai_sign.hpp.sq" #include "api/ai_sign.hpp.sq"
#include "api/ai_signlist.hpp.sq"
#include "api/ai_station.hpp.sq" #include "api/ai_station.hpp.sq"
#include "api/ai_stationlist.hpp.sq" #include "api/ai_stationlist.hpp.sq"
#include "api/ai_subsidy.hpp.sq" #include "api/ai_subsidy.hpp.sq"
@@ -100,7 +98,6 @@ AIInstance::AIInstance(AIInfo *info) :
instance(NULL), instance(NULL),
is_started(false), is_started(false),
is_dead(false), is_dead(false),
is_save_data_on_stack(false),
suspend(0), suspend(0),
callback(NULL) callback(NULL)
{ {
@@ -119,9 +116,6 @@ AIInstance::AIInstance(AIInfo *info) :
/* Register the AIController */ /* Register the AIController */
SQAIController_Register(this->engine); SQAIController_Register(this->engine);
/* Register the API functions and classes */
this->RegisterAPI();
/* Load and execute the script for this AI */ /* Load and execute the script for this AI */
const char *main_script = info->GetMainScript(); const char *main_script = info->GetMainScript();
if (strcmp(main_script, "%_dummy") == 0) { if (strcmp(main_script, "%_dummy") == 0) {
@@ -138,6 +132,13 @@ AIInstance::AIInstance(AIInfo *info) :
this->Died(); this->Died();
return; return;
} }
/* Register the API functions and classes */
this->RegisterAPI();
/* The topmost stack item is true if there is data from a savegame
* and false otherwise. */
sq_pushbool(this->engine->vm, false);
} }
AIInstance::~AIInstance() AIInstance::~AIInstance()
@@ -210,7 +211,6 @@ void AIInstance::RegisterAPI()
SQAIRailTypeList_Register(this->engine); SQAIRailTypeList_Register(this->engine);
SQAIRoad_Register(this->engine); SQAIRoad_Register(this->engine);
SQAISign_Register(this->engine); SQAISign_Register(this->engine);
SQAISignList_Register(this->engine);
SQAIStation_Register(this->engine); SQAIStation_Register(this->engine);
SQAIStationList_Register(this->engine); SQAIStationList_Register(this->engine);
SQAIStationList_Vehicle_Register(this->engine); SQAIStationList_Vehicle_Register(this->engine);
@@ -255,21 +255,14 @@ void AIInstance::Died()
this->engine = NULL; this->engine = NULL;
ShowAIDebugWindow(_current_company); ShowAIDebugWindow(_current_company);
if (strcmp(GetCompany(_current_company)->ai_info->GetMainScript(), "%_dummy") != 0) {
const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo();
if (info != NULL) {
ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0); ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0);
if (info->GetURL() != NULL) {
AILog::Info("Please report the error to the following URL:");
AILog::Info(info->GetURL());
}
} }
} }
void AIInstance::GameLoop() void AIInstance::GameLoop()
{ {
if (this->IsDead()) return; if (this->is_dead) return;
if (this->engine->HasScriptCrashed()) { if (this->engine->HasScriptCrashed()) {
/* The script crashed during saving, kill it here. */ /* The script crashed during saving, kill it here. */
this->Died(); this->Died();
@@ -283,10 +276,6 @@ void AIInstance::GameLoop()
/* If there is a callback to call, call that first */ /* If there is a callback to call, call that first */
if (this->callback != NULL) { if (this->callback != NULL) {
if (this->is_save_data_on_stack) {
sq_poptop(this->engine->GetVM());
this->is_save_data_on_stack = false;
}
try { try {
this->callback(this); this->callback(this);
} catch (AI_VMSuspend e) { } catch (AI_VMSuspend e) {
@@ -305,37 +294,20 @@ void AIInstance::GameLoop()
AIObject::SetAllowDoCommand(false); AIObject::SetAllowDoCommand(false);
/* Run the constructor if it exists. Don't allow any DoCommands in it. */ /* Run the constructor if it exists. Don't allow any DoCommands in it. */
if (this->engine->MethodExists(*this->instance, "constructor")) { if (this->engine->MethodExists(*this->instance, "constructor")) {
if (!this->engine->CallMethod(*this->instance, "constructor", 100000) || this->engine->IsSuspended()) { if (!this->engine->CallMethod(*this->instance, "constructor")) { this->Died(); return; }
if (this->engine->IsSuspended()) AILog::Error("This AI took too long to initialize. AI is not started.");
this->Died();
return;
}
}
if (!this->CallLoad() || this->engine->IsSuspended()) {
if (this->engine->IsSuspended()) AILog::Error("This AI took too long in the Load function. AI is not started.");
this->Died();
return;
} }
if (!this->CallLoad()) { this->Died(); return; }
AIObject::SetAllowDoCommand(true); AIObject::SetAllowDoCommand(true);
/* Start the AI by calling Start() */ /* Start the AI by calling Start() */
if (!this->engine->CallMethod(*this->instance, "Start", _settings_game.ai.ai_max_opcode_till_suspend) || !this->engine->IsSuspended()) this->Died(); if (!this->engine->CallMethod(*this->instance, "Start", _settings_game.ai.ai_max_opcode_till_suspend) || !this->engine->IsSuspended()) this->Died();
} catch (AI_VMSuspend e) { } catch (AI_VMSuspend e) {
this->suspend = e.GetSuspendTime(); this->suspend = e.GetSuspendTime();
this->callback = e.GetSuspendCallback(); this->callback = e.GetSuspendCallback();
} catch (AI_FatalError e) {
this->is_dead = true;
this->engine->ThrowError(e.GetErrorMessage());
this->engine->ResumeError();
this->Died();
} }
this->is_started = true; this->is_started = true;
return; return;
} }
if (this->is_save_data_on_stack) {
sq_poptop(this->engine->GetVM());
this->is_save_data_on_stack = false;
}
/* Continue the VM */ /* Continue the VM */
try { try {
@@ -343,17 +315,12 @@ void AIInstance::GameLoop()
} catch (AI_VMSuspend e) { } catch (AI_VMSuspend e) {
this->suspend = e.GetSuspendTime(); this->suspend = e.GetSuspendTime();
this->callback = e.GetSuspendCallback(); this->callback = e.GetSuspendCallback();
} catch (AI_FatalError e) {
this->is_dead = true;
this->engine->ThrowError(e.GetErrorMessage());
this->engine->ResumeError();
this->Died();
} }
} }
void AIInstance::CollectGarbage() void AIInstance::CollectGarbage()
{ {
if (this->is_started && !this->IsDead()) this->engine->CollectGarbage(); if (this->is_started && !this->is_dead) this->engine->CollectGarbage();
} }
/* static */ void AIInstance::DoCommandReturn(AIInstance *instance) /* static */ void AIInstance::DoCommandReturn(AIInstance *instance)
@@ -559,38 +526,29 @@ void AIInstance::Save()
} }
HSQUIRRELVM vm = this->engine->GetVM(); HSQUIRRELVM vm = this->engine->GetVM();
if (this->is_save_data_on_stack) { if (!this->is_started) {
SQBool res;
sq_getbool(vm, -1, &res);
if (!res) {
SaveEmpty();
return;
}
/* Push the loaded savegame data to the top of the stack. */
sq_push(vm, -2);
_ai_sl_byte = 1; _ai_sl_byte = 1;
SlObject(NULL, _ai_byte); SlObject(NULL, _ai_byte);
/* Save the data that was just loaded. */ /* Save the data that was just loaded. */
SaveObject(vm, -1, AISAVE_MAX_DEPTH, false); SaveObject(vm, -1, AISAVE_MAX_DEPTH, false);
} else if (!this->is_started) { sq_poptop(vm);
SaveEmpty();
return;
} else if (this->engine->MethodExists(*this->instance, "Save")) { } else if (this->engine->MethodExists(*this->instance, "Save")) {
HSQOBJECT savedata; HSQOBJECT savedata;
/* We don't want to be interrupted during the save function. */ /* We don't want to be interrupted during the save function. */
bool backup_allow = AIObject::GetAllowDoCommand(); bool backup_allow = AIObject::GetAllowDoCommand();
AIObject::SetAllowDoCommand(false); AIObject::SetAllowDoCommand(false);
try { if (!this->engine->CallMethod(*this->instance, "Save", &savedata)) {
if (!this->engine->CallMethod(*this->instance, "Save", &savedata)) { /* The script crashed in the Save function. We can't kill
/* The script crashed in the Save function. We can't kill * it here, but do so in the next AI tick. */
* it here, but do so in the next AI tick. */
SaveEmpty();
this->engine->CrashOccurred();
return;
}
} catch (AI_FatalError e) {
/* If we don't mark the AI as dead here cleaning up the squirrel
* stack could throw AI_FatalError again. */
this->is_dead = true;
this->engine->ThrowError(e.GetErrorMessage());
this->engine->ResumeError();
SaveEmpty(); SaveEmpty();
/* We can't kill the AI here, so mark it as crashed (not dead) and
* kill it in the next AI tick. */
this->is_dead = false;
this->engine->CrashOccurred();
return; return;
} }
AIObject::SetAllowDoCommand(backup_allow); AIObject::SetAllowDoCommand(backup_allow);
@@ -598,7 +556,6 @@ void AIInstance::Save()
if (!sq_istable(savedata)) { if (!sq_istable(savedata)) {
AILog::Error("Save function should return a table."); AILog::Error("Save function should return a table.");
SaveEmpty(); SaveEmpty();
this->engine->CrashOccurred();
return; return;
} }
sq_pushobject(vm, savedata); sq_pushobject(vm, savedata);
@@ -606,11 +563,11 @@ void AIInstance::Save()
_ai_sl_byte = 1; _ai_sl_byte = 1;
SlObject(NULL, _ai_byte); SlObject(NULL, _ai_byte);
SaveObject(vm, -1, AISAVE_MAX_DEPTH, false); SaveObject(vm, -1, AISAVE_MAX_DEPTH, false);
this->is_save_data_on_stack = true;
} else { } else {
SaveEmpty(); _ai_sl_byte = 0;
this->engine->CrashOccurred(); SlObject(NULL, _ai_byte);
} }
sq_pop(vm, 1);
} else { } else {
AILog::Warning("Save function is not implemented"); AILog::Warning("Save function is not implemented");
_ai_sl_byte = 0; _ai_sl_byte = 0;
@@ -697,18 +654,21 @@ void AIInstance::Load(int version)
/* Check if there was anything saved at all. */ /* Check if there was anything saved at all. */
if (_ai_sl_byte == 0) return; if (_ai_sl_byte == 0) return;
/* First remove the value "false" since we have data to load. */
sq_poptop(vm);
sq_pushinteger(vm, version); sq_pushinteger(vm, version);
LoadObjects(vm); LoadObjects(vm);
this->is_save_data_on_stack = true; sq_pushbool(vm, true);
} }
bool AIInstance::CallLoad() bool AIInstance::CallLoad()
{ {
HSQUIRRELVM vm = this->engine->GetVM(); HSQUIRRELVM vm = this->engine->GetVM();
/* Is there save data that we should load? */ /* Is there save data that we should load? */
if (!this->is_save_data_on_stack) return true; SQBool res;
/* Whatever happens, after CallLoad the savegame data is removed from the stack. */ sq_getbool(vm, -1, &res);
this->is_save_data_on_stack = false; sq_poptop(vm);
if (!res) return true;
if (!this->engine->MethodExists(*this->instance, "Load")) { if (!this->engine->MethodExists(*this->instance, "Load")) {
AILog::Warning("Loading failed: there was data for the AI to load, but the AI does not have a Load() function."); AILog::Warning("Loading failed: there was data for the AI to load, but the AI does not have a Load() function.");
@@ -732,7 +692,7 @@ bool AIInstance::CallLoad()
/* Call the AI load function. sq_call removes the arguments (but not the /* Call the AI load function. sq_call removes the arguments (but not the
* function pointer) from the stack. */ * function pointer) from the stack. */
if (SQ_FAILED(sq_call(vm, 3, SQFalse, SQFalse, 100000))) return false; if (SQ_FAILED(sq_call(vm, 3, SQFalse, SQFalse))) return false;
/* Pop 1) The version, 2) the savegame data, 3) the object instance, 4) the function pointer. */ /* Pop 1) The version, 2) the savegame data, 3) the object instance, 4) the function pointer. */
sq_pop(vm, 4); sq_pop(vm, 4);

View File

@@ -18,7 +18,7 @@ public:
AI_VMSuspend(int time, AISuspendCallbackProc *callback) : AI_VMSuspend(int time, AISuspendCallbackProc *callback) :
time(time), time(time),
callback(callback) callback(callback)
{} {}
int GetSuspendTime() { return time; } int GetSuspendTime() { return time; }
AISuspendCallbackProc *GetSuspendCallback() { return callback; } AISuspendCallbackProc *GetSuspendCallback() { return callback; }
@@ -28,24 +28,8 @@ private:
AISuspendCallbackProc *callback; AISuspendCallbackProc *callback;
}; };
/**
* A throw-class that is given when the AI made a fatal error.
*/
class AI_FatalError {
public:
AI_FatalError(const char *msg) :
msg(msg)
{}
const char *GetErrorMessage() { return msg; }
private:
const char *msg;
};
class AIInstance { class AIInstance {
public: public:
friend class AIObject;
AIInstance(class AIInfo *info); AIInstance(class AIInfo *info);
~AIInstance(); ~AIInstance();
@@ -95,11 +79,6 @@ public:
*/ */
class AIController *GetController() { return controller; } class AIController *GetController() { return controller; }
/**
* Return the "this AI died" value
*/
inline bool IsDead() { return this->is_dead; }
/** /**
* Call the AI Save function and save all data in the savegame. * Call the AI Save function and save all data in the savegame.
*/ */
@@ -138,7 +117,6 @@ private:
bool is_started; bool is_started;
bool is_dead; bool is_dead;
bool is_save_data_on_stack;
int suspend; int suspend;
AISuspendCallbackProc *callback; AISuspendCallbackProc *callback;

View File

@@ -153,7 +153,7 @@ AIScanner::AIScanner() :
/* Create the dummy AI */ /* Create the dummy AI */
this->engine->ResetCrashed(); this->engine->ResetCrashed();
strecpy(this->main_script, "%_dummy", lastof(this->main_script)); strcpy(this->main_script, "%_dummy");
extern void AI_CreateAIInfoDummy(HSQUIRRELVM vm); extern void AI_CreateAIInfoDummy(HSQUIRRELVM vm);
AI_CreateAIInfoDummy(this->engine->GetVM()); AI_CreateAIInfoDummy(this->engine->GetVM());
} }
@@ -345,31 +345,20 @@ void AIScanner::RegisterAI(AIInfo *info)
AIInfo *AIScanner::SelectRandomAI() AIInfo *AIScanner::SelectRandomAI()
{ {
uint num_random_ais = 0; if (this->info_single_list.size() == 0) {
for (AIInfoList::iterator it = this->info_single_list.begin(); it != this->info_single_list.end(); it++) {
if (it->second->UseAsRandomAI()) num_random_ais++;
}
if (num_random_ais == 0) {
DEBUG(ai, 0, "No suitable AI found, loading 'dummy' AI."); DEBUG(ai, 0, "No suitable AI found, loading 'dummy' AI.");
return this->info_dummy; return this->info_dummy;
} }
/* Find a random AI */ /* Find a random AI */
uint pos; uint pos;
if (_networking) { if (_networking) pos = InteractiveRandomRange((uint16)this->info_single_list.size());
pos = InteractiveRandomRange(num_random_ais); else pos = RandomRange((uint16)this->info_single_list.size());
} else {
pos = RandomRange(num_random_ais);
}
/* Find the Nth item from the array */ /* Find the Nth item from the array */
AIInfoList::iterator it = this->info_single_list.begin(); AIInfoList::iterator it = this->info_single_list.begin();
while (!it->second->UseAsRandomAI()) it++; for (; pos > 0; pos--) it++;
for (; pos > 0; pos--) { AIInfoList::iterator first_it = it;
it++;
while (!it->second->UseAsRandomAI()) it++;
}
return (*it).second; return (*it).second;
} }
@@ -412,7 +401,7 @@ AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam)
snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName()); snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName());
strtolower(ai_name_compare); strtolower(ai_name_compare);
if (strcasecmp(ai_name, ai_name_compare) == 0 && (*it).second->CanLoadFromVersion(versionParam) && (version == -1 || (*it).second->GetVersion() > version)) { if (strcasecmp(ai_name, ai_name_compare) == 0 && (*it).second->CanLoadFromVersion(versionParam)) {
version = (*it).second->GetVersion(); version = (*it).second->GetVersion();
info = (*it).second; info = (*it).second;
} }

View File

@@ -31,6 +31,7 @@ SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 2 TAB_SIZE = 2

View File

@@ -375,7 +375,6 @@ AIAbstractList::AIAbstractList()
this->sorter_type = SORT_BY_VALUE; this->sorter_type = SORT_BY_VALUE;
this->sort_ascending = false; this->sort_ascending = false;
this->initialized = false; this->initialized = false;
this->modifications = 0;
} }
AIAbstractList::~AIAbstractList() AIAbstractList::~AIAbstractList()
@@ -390,8 +389,6 @@ bool AIAbstractList::HasItem(int32 item)
void AIAbstractList::Clear() void AIAbstractList::Clear()
{ {
this->modifications++;
this->items.clear(); this->items.clear();
this->buckets.clear(); this->buckets.clear();
this->sorter->End(); this->sorter->End();
@@ -399,8 +396,6 @@ void AIAbstractList::Clear()
void AIAbstractList::AddItem(int32 item) void AIAbstractList::AddItem(int32 item)
{ {
this->modifications++;
if (this->HasItem(item)) return; if (this->HasItem(item)) return;
this->items[item] = 0; this->items[item] = 0;
@@ -409,8 +404,6 @@ void AIAbstractList::AddItem(int32 item)
void AIAbstractList::RemoveItem(int32 item) void AIAbstractList::RemoveItem(int32 item)
{ {
this->modifications++;
if (!this->HasItem(item)) return; if (!this->HasItem(item)) return;
int32 value = this->GetValue(item); int32 value = this->GetValue(item);
@@ -464,8 +457,6 @@ int32 AIAbstractList::GetValue(int32 item)
bool AIAbstractList::SetValue(int32 item, int32 value) bool AIAbstractList::SetValue(int32 item, int32 value)
{ {
this->modifications++;
if (!this->HasItem(item)) return false; if (!this->HasItem(item)) return false;
int32 value_old = this->GetValue(item); int32 value_old = this->GetValue(item);
@@ -481,8 +472,6 @@ bool AIAbstractList::SetValue(int32 item, int32 value)
void AIAbstractList::Sort(SorterType sorter, bool ascending) void AIAbstractList::Sort(SorterType sorter, bool ascending)
{ {
this->modifications++;
if (sorter != SORT_BY_VALUE && sorter != SORT_BY_ITEM) return; if (sorter != SORT_BY_VALUE && sorter != SORT_BY_ITEM) return;
if (sorter == this->sorter_type && ascending == this->sort_ascending) return; if (sorter == this->sorter_type && ascending == this->sort_ascending) return;
@@ -517,8 +506,6 @@ void AIAbstractList::AddList(AIAbstractList *list)
void AIAbstractList::RemoveAboveValue(int32 value) void AIAbstractList::RemoveAboveValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second > value) this->items.erase(iter); if ((*iter).second > value) this->items.erase(iter);
@@ -532,8 +519,6 @@ void AIAbstractList::RemoveAboveValue(int32 value)
void AIAbstractList::RemoveBelowValue(int32 value) void AIAbstractList::RemoveBelowValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second < value) this->items.erase(iter); if ((*iter).second < value) this->items.erase(iter);
@@ -547,8 +532,6 @@ void AIAbstractList::RemoveBelowValue(int32 value)
void AIAbstractList::RemoveBetweenValue(int32 start, int32 end) void AIAbstractList::RemoveBetweenValue(int32 start, int32 end)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second > start && (*iter).second < end) this->items.erase(iter); if ((*iter).second > start && (*iter).second < end) this->items.erase(iter);
@@ -562,8 +545,6 @@ void AIAbstractList::RemoveBetweenValue(int32 start, int32 end)
void AIAbstractList::RemoveValue(int32 value) void AIAbstractList::RemoveValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second == value) this->items.erase(iter); if ((*iter).second == value) this->items.erase(iter);
@@ -577,8 +558,6 @@ void AIAbstractList::RemoveValue(int32 value)
void AIAbstractList::RemoveTop(int32 count) void AIAbstractList::RemoveTop(int32 count)
{ {
this->modifications++;
if (!this->sort_ascending) { if (!this->sort_ascending) {
this->Sort(this->sorter_type, !this->sort_ascending); this->Sort(this->sorter_type, !this->sort_ascending);
this->RemoveBottom(count); this->RemoveBottom(count);
@@ -614,8 +593,6 @@ void AIAbstractList::RemoveTop(int32 count)
void AIAbstractList::RemoveBottom(int32 count) void AIAbstractList::RemoveBottom(int32 count)
{ {
this->modifications++;
if (!this->sort_ascending) { if (!this->sort_ascending) {
this->Sort(this->sorter_type, !this->sort_ascending); this->Sort(this->sorter_type, !this->sort_ascending);
this->RemoveTop(count); this->RemoveTop(count);
@@ -650,8 +627,6 @@ void AIAbstractList::RemoveBottom(int32 count)
void AIAbstractList::RemoveList(AIAbstractList *list) void AIAbstractList::RemoveList(AIAbstractList *list)
{ {
this->modifications++;
AIAbstractListMap *list_items = &list->items; AIAbstractListMap *list_items = &list->items;
for (AIAbstractListMap::iterator iter = list_items->begin(); iter != list_items->end(); iter++) { for (AIAbstractListMap::iterator iter = list_items->begin(); iter != list_items->end(); iter++) {
this->RemoveItem((*iter).first); this->RemoveItem((*iter).first);
@@ -660,8 +635,6 @@ void AIAbstractList::RemoveList(AIAbstractList *list)
void AIAbstractList::KeepAboveValue(int32 value) void AIAbstractList::KeepAboveValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second <= value) this->items.erase(iter); if ((*iter).second <= value) this->items.erase(iter);
@@ -675,8 +648,6 @@ void AIAbstractList::KeepAboveValue(int32 value)
void AIAbstractList::KeepBelowValue(int32 value) void AIAbstractList::KeepBelowValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second >= value) this->items.erase(iter); if ((*iter).second >= value) this->items.erase(iter);
@@ -690,8 +661,6 @@ void AIAbstractList::KeepBelowValue(int32 value)
void AIAbstractList::KeepBetweenValue(int32 start, int32 end) void AIAbstractList::KeepBetweenValue(int32 start, int32 end)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second <= start || (*iter).second >= end) this->items.erase(iter); if ((*iter).second <= start || (*iter).second >= end) this->items.erase(iter);
@@ -705,8 +674,6 @@ void AIAbstractList::KeepBetweenValue(int32 start, int32 end)
void AIAbstractList::KeepValue(int32 value) void AIAbstractList::KeepValue(int32 value)
{ {
this->modifications++;
for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) { for (AIAbstractListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
next_iter = iter; next_iter++; next_iter = iter; next_iter++;
if ((*iter).second != value) this->items.erase(iter); if ((*iter).second != value) this->items.erase(iter);
@@ -720,22 +687,16 @@ void AIAbstractList::KeepValue(int32 value)
void AIAbstractList::KeepTop(int32 count) void AIAbstractList::KeepTop(int32 count)
{ {
this->modifications++;
this->RemoveBottom(this->Count() - count); this->RemoveBottom(this->Count() - count);
} }
void AIAbstractList::KeepBottom(int32 count) void AIAbstractList::KeepBottom(int32 count)
{ {
this->modifications++;
this->RemoveTop(this->Count() - count); this->RemoveTop(this->Count() - count);
} }
void AIAbstractList::KeepList(AIAbstractList *list) void AIAbstractList::KeepList(AIAbstractList *list)
{ {
this->modifications++;
AIAbstractList tmp; AIAbstractList tmp;
for (AIAbstractListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) { for (AIAbstractListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) {
tmp.AddItem((*iter).first); tmp.AddItem((*iter).first);
@@ -785,8 +746,6 @@ SQInteger AIAbstractList::_nexti(HSQUIRRELVM vm)
SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm) SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm)
{ {
this->modifications++;
/* The first parameter is the instance of AIAbstractList. */ /* The first parameter is the instance of AIAbstractList. */
int nparam = sq_gettop(vm) - 1; int nparam = sq_gettop(vm) - 1;
@@ -812,10 +771,6 @@ SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm)
/* Walk all items, and query the result */ /* Walk all items, and query the result */
this->buckets.clear(); this->buckets.clear();
/* Check for changing of items. */
int begin_modification_count = this->modifications;
for (AIAbstractListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) { for (AIAbstractListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) {
/* Push the root table as instance object, this is what squirrel does for meta-functions. */ /* Push the root table as instance object, this is what squirrel does for meta-functions. */
sq_pushroottable(vm); sq_pushroottable(vm);
@@ -853,15 +808,6 @@ SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm)
} }
} }
/* Was something changed? */
if (begin_modification_count != this->modifications) {
/* See below for explanation. The extra pop is the return value. */
sq_pop(vm, nparam + 4);
AIObject::SetAllowDoCommand(backup_allow);
return sq_throwerror(vm, _SC("modifying valuated list outside of valuator function"));
}
(*iter).second = (int32)value; (*iter).second = (int32)value;
this->buckets[(int32)value].insert((*iter).first); this->buckets[(int32)value].insert((*iter).first);

View File

@@ -25,17 +25,11 @@ public:
SORT_BY_ITEM, //!< Sort the list based on the item itself. SORT_BY_ITEM, //!< Sort the list based on the item itself.
}; };
/** Sort ascending */
static const bool SORT_ASCENDING = true;
/** Sort descnding */
static const bool SORT_DESCENDING = false;
private: private:
AIAbstractListSorter *sorter; //!< Sorting algorithm AIAbstractListSorter *sorter;
SorterType sorter_type; //!< Sorting type SorterType sorter_type;
bool sort_ascending; //!< Whether to sort ascending or descending bool sort_ascending;
bool initialized; //!< Whether an iteration has been started bool initialized;
int modifications; //!< Number of modification that has been done. To prevent changing data while valuating.
public: public:
typedef std::set<int32> AIItemList; //!< The list of items inside the bucket typedef std::set<int32> AIItemList; //!< The list of items inside the bucket
@@ -129,7 +123,6 @@ public:
* @param sorter the type of sorter to use * @param sorter the type of sorter to use
* @param ascending if true, lowest value is on top, else at bottom. * @param ascending if true, lowest value is on top, else at bottom.
* @note the current item stays at the same place. * @note the current item stays at the same place.
* @see SORT_ASCENDING SORT_DESCENDING
*/ */
void Sort(SorterType sorter, bool ascending); void Sort(SorterType sorter, bool ascending);
@@ -252,8 +245,6 @@ public:
* @param valuator_function The function which will be doing the valuation. * @param valuator_function The function which will be doing the valuation.
* @param params The params to give to the valuators (minus the first param, * @param params The params to give to the valuators (minus the first param,
* which is always the index-value we are valuating). * which is always the index-value we are valuating).
* @note You may not add, remove or change (setting the value of) items while
* valuating. You may also not (re)sort while valuating.
* @note You can write your own valuators and use them. Just remember that * @note You can write your own valuators and use them. Just remember that
* the first parameter should be the index-value, and it should return * the first parameter should be the index-value, and it should return
* an integer. * an integer.

View File

@@ -24,9 +24,6 @@ void SQAIAbstractList_Register(Squirrel *engine) {
SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_BY_VALUE, "SORT_BY_VALUE"); SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_BY_VALUE, "SORT_BY_VALUE");
SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_BY_ITEM, "SORT_BY_ITEM"); SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_BY_ITEM, "SORT_BY_ITEM");
SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_ASCENDING, "SORT_ASCENDING");
SQAIAbstractList.DefSQConst(engine, AIAbstractList::SORT_DESCENDING, "SORT_DESCENDING");
SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::Clear, "Clear", 1, "x"); SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::Clear, "Clear", 1, "x");
SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::HasItem, "HasItem", 2, "xi"); SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::HasItem, "HasItem", 2, "xi");
SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::Begin, "Begin", 1, "x"); SQAIAbstractList.DefSQMethod(engine, &AIAbstractList::Begin, "Begin", 1, "x");

View File

@@ -8,21 +8,12 @@
#include "../../company_func.h" #include "../../company_func.h"
#include "../../command_type.h" #include "../../command_type.h"
#include "../../town.h" #include "../../town.h"
#include "../../economy_func.h"
/* static */ bool AIAirport::IsValidAirportType(AirportType type) /* static */ bool AIAirport::IsValidAirportType(AirportType type)
{ {
return type >= AT_SMALL && type <= AT_HELISTATION && HasBit(::GetValidAirports(), type); return type >= AT_SMALL && type <= AT_HELISTATION && HasBit(::GetValidAirports(), type);
} }
/* static */ Money AIAirport::GetPrice(AirportType type)
{
if (!IsValidAirportType(type)) return -1;
const AirportFTAClass *afc = ::GetAirport(type);
return _price.build_airport * afc->size_x * afc->size_y;
}
/* static */ bool AIAirport::IsHangarTile(TileIndex tile) /* static */ bool AIAirport::IsHangarTile(TileIndex tile)
{ {
if (!::IsValidTile(tile)) return false; if (!::IsValidTile(tile)) return false;

View File

@@ -53,13 +53,6 @@ public:
*/ */
static bool IsValidAirportType(AirportType type); static bool IsValidAirportType(AirportType type);
/**
* Get the cost to build this AirportType.
* @param type The AirportType to check.
* @return The cost of building this AirportType.
*/
static Money GetPrice(AirportType type);
/** /**
* Checks whether the given tile is actually a tile with a hangar. * Checks whether the given tile is actually a tile with a hangar.
* @param tile The tile to check. * @param tile The tile to check.
@@ -129,7 +122,7 @@ public:
* @exception AIError::ERR_FLAT_LAND_REQUIRED * @exception AIError::ERR_FLAT_LAND_REQUIRED
* @exception AIError::ERR_LOCAL_AUTHORITY_REFUSES * @exception AIError::ERR_LOCAL_AUTHORITY_REFUSES
* @exception AIStation::ERR_STATION_TOO_LARGE * @exception AIStation::ERR_STATION_TOO_LARGE
* @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION * @exception AIStation::ERR_STATION_TOO_CLOSE_TO_OTHER_STATION
* @return Whether the airport has been/can be build or not. * @return Whether the airport has been/can be build or not.
*/ */
static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id); static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id);

View File

@@ -39,7 +39,6 @@ void SQAIAirport_Register(Squirrel *engine) {
SQAIAirport.DefSQConst(engine, AIAirport::PT_INVALID, "PT_INVALID"); SQAIAirport.DefSQConst(engine, AIAirport::PT_INVALID, "PT_INVALID");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType, "IsValidAirportType", 2, ".i"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType, "IsValidAirportType", 2, ".i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetPrice, "GetPrice", 2, ".i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile, "IsHangarTile", 2, ".i"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile, "IsHangarTile", 2, ".i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile, "IsAirportTile", 2, ".i"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile, "IsAirportTile", 2, ".i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, ".i"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, ".i");

View File

@@ -23,15 +23,10 @@
return ::IsBridgeTile(tile); return ::IsBridgeTile(tile);
} }
/* static */ BridgeID AIBridge::GetBridgeID(TileIndex tile)
{
if (!IsBridgeTile(tile)) return (BridgeID)-1;
return (BridgeID)::GetBridgeType(tile);
}
static void _DoCommandReturnBuildBridge2(class AIInstance *instance) static void _DoCommandReturnBuildBridge2(class AIInstance *instance)
{ {
if (!AIBridge::_BuildBridgeRoad2()) { if (!AIBridge::_BuildBridgeRoad2()) {
AIObject::SetLastCommandRes(false);
AIInstance::DoCommandReturn(instance); AIInstance::DoCommandReturn(instance);
return; return;
} }
@@ -44,6 +39,7 @@ static void _DoCommandReturnBuildBridge2(class AIInstance *instance)
static void _DoCommandReturnBuildBridge1(class AIInstance *instance) static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{ {
if (!AIBridge::_BuildBridgeRoad1()) { if (!AIBridge::_BuildBridgeRoad1()) {
AIObject::SetLastCommandRes(false);
AIInstance::DoCommandReturn(instance); AIInstance::DoCommandReturn(instance);
return; return;
} }
@@ -65,7 +61,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
switch (vehicle_type) { switch (vehicle_type) {
case AIVehicle::VT_ROAD: case AIVehicle::VT_ROAD:
type |= (TRANSPORT_ROAD << 15); type |= (TRANSPORT_ROAD << 15);
type |= (::RoadTypeToRoadTypes((::RoadType)AIObject::GetRoadType()) << 8); type |= (RoadTypeToRoadTypes((::RoadType)AIObject::GetRoadType()) << 8);
break; break;
case AIVehicle::VT_RAIL: case AIVehicle::VT_RAIL:
type |= (TRANSPORT_RAIL << 15); type |= (TRANSPORT_RAIL << 15);
@@ -84,7 +80,10 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
AIObject::SetCallbackVariable(0, start); AIObject::SetCallbackVariable(0, start);
AIObject::SetCallbackVariable(1, end); AIObject::SetCallbackVariable(1, end);
return AIObject::DoCommand(end, start, type | bridge_id, CMD_BUILD_BRIDGE, NULL, &_DoCommandReturnBuildBridge1); if (!AIObject::DoCommand(end, start, type | bridge_id, CMD_BUILD_BRIDGE, NULL, &_DoCommandReturnBuildBridge1)) return false;
/* In case of test-mode, test if we can build both road pieces */
return _BuildBridgeRoad1();
} }
/* static */ bool AIBridge::_BuildBridgeRoad1() /* static */ bool AIBridge::_BuildBridgeRoad1()
@@ -96,7 +95,10 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
DiagDirection dir_1 = (DiagDirection)((::TileX(start) == ::TileX(end)) ? (::TileY(start) < ::TileY(end) ? DIAGDIR_NW : DIAGDIR_SE) : (::TileX(start) < ::TileX(end) ? DIAGDIR_NE : DIAGDIR_SW)); DiagDirection dir_1 = (DiagDirection)((::TileX(start) == ::TileX(end)) ? (::TileY(start) < ::TileY(end) ? DIAGDIR_NW : DIAGDIR_SE) : (::TileX(start) < ::TileX(end) ? DIAGDIR_NE : DIAGDIR_SW));
DiagDirection dir_2 = ::ReverseDiagDir(dir_1); DiagDirection dir_2 = ::ReverseDiagDir(dir_1);
return AIObject::DoCommand(start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (AIObject::GetRoadType() << 4), 0, CMD_BUILD_ROAD, NULL, &_DoCommandReturnBuildBridge2); if (!AIObject::DoCommand(start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (AIObject::GetRoadType() << 4), 0, CMD_BUILD_ROAD, NULL, &_DoCommandReturnBuildBridge2)) return false;
/* In case of test-mode, test the other road piece too */
return _BuildBridgeRoad2();
} }
/* static */ bool AIBridge::_BuildBridgeRoad2() /* static */ bool AIBridge::_BuildBridgeRoad2()
@@ -139,7 +141,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{ {
if (!IsValidBridge(bridge_id)) return -1; if (!IsValidBridge(bridge_id)) return -1;
return ::CalcBridgeLenCostFactor(length) * _price.build_bridge * ::GetBridgeSpec(bridge_id)->price >> 8; return length * _price.build_bridge * ::GetBridgeSpec(bridge_id)->price >> 8;
} }
/* static */ int32 AIBridge::GetMaxLength(BridgeID bridge_id) /* static */ int32 AIBridge::GetMaxLength(BridgeID bridge_id)

View File

@@ -51,14 +51,6 @@ public:
*/ */
static bool IsBridgeTile(TileIndex tile); static bool IsBridgeTile(TileIndex tile);
/**
* Get the BridgeID of a bridge at a given tile.
* @param tile The tile to get the BridgeID from.
* @pre IsBridgeTile(tile).
* @return The BridgeID from the bridge at tile 'tile'.
*/
static BridgeID GetBridgeID(TileIndex tile);
/** /**
* Get the name of a bridge. * Get the name of a bridge.
* @param bridge_id The bridge to get the name of. * @param bridge_id The bridge to get the name of.

View File

@@ -36,7 +36,6 @@ void SQAIBridge_Register(Squirrel *engine) {
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsValidBridge, "IsValidBridge", 2, ".i"); SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsValidBridge, "IsValidBridge", 2, ".i");
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsBridgeTile, "IsBridgeTile", 2, ".i"); SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsBridgeTile, "IsBridgeTile", 2, ".i");
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetBridgeID, "GetBridgeID", 2, ".i");
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetName, "GetName", 2, ".i"); SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetName, "GetName", 2, ".i");
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetMaxSpeed, "GetMaxSpeed", 2, ".i"); SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetMaxSpeed, "GetMaxSpeed", 2, ".i");
SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetPrice, "GetPrice", 3, ".ii"); SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetPrice, "GetPrice", 3, ".ii");

View File

@@ -18,7 +18,7 @@ public:
* The classes of cargo (from newgrf_cargo.h). * The classes of cargo (from newgrf_cargo.h).
*/ */
enum CargoClass { enum CargoClass {
CC_PASSENGERS = 1 << 0, //!< Passengers. Cargos of this class appear at bus stops. Cargos not of this class appear at truck stops. CC_PASSENGERS = 1 << 0, //!< Passengers
CC_MAIL = 1 << 1, //!< Mail CC_MAIL = 1 << 1, //!< Mail
CC_EXPRESS = 1 << 2, //!< Express cargo (Goods, Food, Candy, but also possible for passengers) CC_EXPRESS = 1 << 2, //!< Express cargo (Goods, Food, Candy, but also possible for passengers)
CC_ARMOURED = 1 << 3, //!< Armoured cargo (Valuables, Gold, Diamonds) CC_ARMOURED = 1 << 3, //!< Armoured cargo (Valuables, Gold, Diamonds)
@@ -52,7 +52,6 @@ public:
/** /**
* Gets the string representation of the cargo label. * Gets the string representation of the cargo label.
* @param cargo_type The cargo to get the string representation of. * @param cargo_type The cargo to get the string representation of.
* @pre AICargo::IsValidCargo(cargo_type).
* @return The cargo label. * @return The cargo label.
* @note Never use this to check if it is a certain cargo. NewGRF can * @note Never use this to check if it is a certain cargo. NewGRF can
* redefine all of the names. * redefine all of the names.
@@ -61,10 +60,7 @@ public:
/** /**
* Checks whether the give cargo is a freight or not. * Checks whether the give cargo is a freight or not.
* This defines whether the "freight train weight multiplier" will apply to
* trains transporting this cargo.
* @param cargo_type The cargo to check on. * @param cargo_type The cargo to check on.
* @pre AICargo::IsValidCargo(cargo_type).
* @return True if and only if the cargo is freight. * @return True if and only if the cargo is freight.
*/ */
static bool IsFreight(CargoID cargo_type); static bool IsFreight(CargoID cargo_type);
@@ -72,7 +68,6 @@ public:
/** /**
* Check if this cargo is in the requested cargo class. * Check if this cargo is in the requested cargo class.
* @param cargo_type The cargo to check on. * @param cargo_type The cargo to check on.
* @pre AICargo::IsValidCargo(cargo_type).
* @param cargo_class The class to check for. * @param cargo_class The class to check for.
* @return True if and only if the cargo is in the cargo class. * @return True if and only if the cargo is in the cargo class.
*/ */
@@ -81,7 +76,6 @@ public:
/** /**
* Get the effect this cargo has on a town. * Get the effect this cargo has on a town.
* @param cargo_type The cargo to check on. * @param cargo_type The cargo to check on.
* @pre AICargo::IsValidCargo(cargo_type).
* @return The effect this cargo has on a town, or TE_NONE if it has no effect. * @return The effect this cargo has on a town, or TE_NONE if it has no effect.
*/ */
static TownEffect GetTownEffect(CargoID cargo_type); static TownEffect GetTownEffect(CargoID cargo_type);
@@ -90,7 +84,6 @@ public:
* Get the income for transporting a piece of cargo over the * Get the income for transporting a piece of cargo over the
* given distance within the specified time. * given distance within the specified time.
* @param cargo_type The cargo to transport. * @param cargo_type The cargo to transport.
* @pre AICargo::IsValidCargo(cargo_type).
* @param distance The distance the cargo travels from begin to end. * @param distance The distance the cargo travels from begin to end.
* @param days_in_transit Amount of (game) days the cargo is in transit. The max value of this variable is 637. Any value higher returns the same as 637 would. * @param days_in_transit Amount of (game) days the cargo is in transit. The max value of this variable is 637. Any value higher returns the same as 637 would.
* @return The amount of money that would be earned by this trip. * @return The amount of money that would be earned by this trip.

View File

@@ -1,70 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file ai_changelog.hpp Lists all changes / additions to the API.
*
* Only new / renamed / deleted api functions will be listed here. A list of
* bug fixes can be found in the normal changelog. Note that removed API
* functions may still be available if you return an older API version
* in GetAPIVersion() in info.nut.
*
* \b 0.7.3
*
* API additions:
* \li AIAbstractList::SORT_ASCENDING
* \li AIAbstractList::SORT_DESCENDING
* \li AICompany::GetPresidentGender
* \li AICompany::SetPresidentGender
* \li AIEngine::GetDesignDate
* \li AIStation::GetConstructionDate
*
* Other changes:
* \li AIs are now killed when they execute a DoCommand or Sleep at a time
* they are not allowed to do so.
* \li When the API requests a string as parameter you can give ever squirrel
* type and it'll be converted to a string
* \li AIs can create subclasses of API classes and use API constants as part
* of their own constants
*
* \b 0.7.2
*
* API additions:
* \li AIVehicle::GetReliability
*
* Other changes:
* \li DoCommands and sleeps in call, acall, pcall and valuators are disallowed
*
* \b 0.7.1
*
* API additions:
* \li AIAirport::GetPrice
* \li AIController::GetVersion
* \li AIOrder::AIOF_DEPOT_FLAGS
* \li AIOrder::AIOF_STOP_IN_DEPOT
* \li AIOrder::IsCurrentOrderPartOfOrderList
* \li AIOrder::IsGotoDepotOrder
* \li AIOrder::IsGotoStationOrder
* \li AIOrder::IsGotoWaypointOrder
* \li AISignList
* \li AITile::CORNER_[WSEN]
* \li AITile::ERR_AREA_ALREADY_FLAT
* \li AITile::ERR_EXCAVATION_WOULD_DAMAGE
* \li AITile::GetCornerHeight
* \li AITile::GetMaxHeight
* \li AITile::GetMinHeight
* \li AIVehicle::SendVehicleToDepotForServicing
*
* Other changes:
* \li GetURL() was added as optional function to info.nut
* \li UseAsRandomAI() was added as optional function to info.nut
* \li A limit was introduced on the time the AI spends in the constructor and Load function
*
* \b 0.7.0
* \li First stable release with the NoAI framework.
*/

View File

@@ -8,7 +8,6 @@
#include "../../command_func.h" #include "../../command_func.h"
#include "../../company_func.h" #include "../../company_func.h"
#include "../../company_base.h" #include "../../company_base.h"
#include "../../company_manager_face.h"
#include "../../economy_func.h" #include "../../economy_func.h"
#include "../../strings_func.h" #include "../../strings_func.h"
#include "../../tile_map.h" #include "../../tile_map.h"
@@ -72,27 +71,6 @@
return president_name; return president_name;
} }
/* static */ bool AICompany::SetPresidentGender(Gender gender)
{
EnforcePrecondition(false, gender == GENDER_MALE || gender == GENDER_FEMALE);
EnforcePrecondition(false, GetPresidentGender(AICompany::COMPANY_SELF) != gender);
CompanyManagerFace cmf;
GenderEthnicity ge = (GenderEthnicity)((gender == GENDER_FEMALE ? (1 << ::GENDER_FEMALE) : 0) | (::InteractiveRandom() & (1 << ETHNICITY_BLACK)));
RandomCompanyManagerFaceBits(cmf, ge, false);
return AIObject::DoCommand(0, 0, cmf, CMD_SET_COMPANY_MANAGER_FACE);
}
/* static */ AICompany::Gender AICompany::GetPresidentGender(CompanyID company)
{
company = ResolveCompanyID(company);
if (company == COMPANY_INVALID) return GENDER_INVALID;
GenderEthnicity ge = (GenderEthnicity)GetCompanyManagerFaceBits(GetCompany(company)->face, CMFV_GEN_ETHN, GE_WM);
return HasBit(ge, ::GENDER_FEMALE) ? GENDER_FEMALE : GENDER_MALE;
}
/* static */ Money AICompany::GetCompanyValue(AICompany::CompanyID company) /* static */ Money AICompany::GetCompanyValue(AICompany::CompanyID company)
{ {
company = ResolveCompanyID(company); company = ResolveCompanyID(company);

View File

@@ -26,13 +26,6 @@ public:
COMPANY_SELF = 254, //!< Constant that gets resolved to the correct company index for your company. COMPANY_SELF = 254, //!< Constant that gets resolved to the correct company index for your company.
}; };
/** Possible genders for company presidents. */
enum Gender {
GENDER_MALE, //!< A male person.
GENDER_FEMALE, //!< A female person.
GENDER_INVALID = -1, //!< An invalid gender.
};
/** /**
* Resolved the given company index to the correct index for the company. If * Resolved the given company index to the correct index for the company. If
* the company index was COMPANY_SELF it will be resolved to the index of * the company index was COMPANY_SELF it will be resolved to the index of
@@ -85,22 +78,6 @@ public:
*/ */
static char *GetPresidentName(CompanyID company); static char *GetPresidentName(CompanyID company);
/**
* Set the gender of the president of your company.
* @param gender The new gender for your president.
* @pre GetPresidentGender(AICompany.COMPANY_SELF) != gender.
* @return True if the gender was changed.
* @note When succesfull a random face will be created.
*/
static bool SetPresidentGender(Gender gender);
/**
* Get the gender of the president of the given company.
* @param company The company to get the presidents gender off.
* @return The gender of the president.
*/
static Gender GetPresidentGender(CompanyID company);
/** /**
* Sets the amount to loan. * Sets the amount to loan.
* @param loan The amount to loan (multiplier of GetLoanInterval()). * @param loan The amount to loan (multiplier of GetLoanInterval()).
@@ -176,8 +153,7 @@ public:
* Return the location of a company's HQ. * Return the location of a company's HQ.
* @param company The company the get the HQ of. * @param company The company the get the HQ of.
* @pre ResolveCompanyID(company) != COMPANY_INVALID. * @pre ResolveCompanyID(company) != COMPANY_INVALID.
* @return The tile of the company's HQ, this tile is the most nothern tile * @return The tile of the company's HQ, this tile is the most nothern tile of that HQ, or TILE_INVALID if there is no HQ yet.
* of that HQ, or AIMap::TILE_INVALID if there is no HQ yet.
*/ */
static TileIndex GetCompanyHQ(CompanyID company); static TileIndex GetCompanyHQ(CompanyID company);

View File

@@ -7,8 +7,6 @@ namespace SQConvert {
/* Allow enums to be used as Squirrel parameters */ /* Allow enums to be used as Squirrel parameters */
template <> AICompany::CompanyID GetParam(ForceType<AICompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyID)tmp; } template <> AICompany::CompanyID GetParam(ForceType<AICompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyID)tmp; }
template <> int Return<AICompany::CompanyID>(HSQUIRRELVM vm, AICompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; } template <> int Return<AICompany::CompanyID>(HSQUIRRELVM vm, AICompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> AICompany::Gender GetParam(ForceType<AICompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::Gender)tmp; }
template <> int Return<AICompany::Gender>(HSQUIRRELVM vm, AICompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow AICompany to be used as Squirrel parameter */ /* Allow AICompany to be used as Squirrel parameter */
template <> AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; } template <> AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; }
@@ -27,18 +25,13 @@ void SQAICompany_Register(Squirrel *engine) {
SQAICompany.DefSQConst(engine, AICompany::COMPANY_FIRST, "COMPANY_FIRST"); SQAICompany.DefSQConst(engine, AICompany::COMPANY_FIRST, "COMPANY_FIRST");
SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST"); SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST");
SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF, "COMPANY_SELF"); SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF, "COMPANY_SELF");
SQAICompany.DefSQConst(engine, AICompany::GENDER_MALE, "GENDER_MALE");
SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE, "GENDER_FEMALE");
SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID, "GENDER_INVALID");
SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::IsMine, "IsMine", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::IsMine, "IsMine", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::SetName, "SetName", 2, ".."); SQAICompany.DefSQStaticMethod(engine, &AICompany::SetName, "SetName", 2, ".s");
SQAICompany.DefSQStaticMethod(engine, &AICompany::GetName, "GetName", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::GetName, "GetName", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentName, "SetPresidentName", 2, ".."); SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentName, "SetPresidentName", 2, ".s");
SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentName, "GetPresidentName", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentName, "GetPresidentName", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentGender, "SetPresidentGender", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentGender, "GetPresidentGender", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::SetLoanAmount, "SetLoanAmount", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::SetLoanAmount, "SetLoanAmount", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, ".i"); SQAICompany.DefSQStaticMethod(engine, &AICompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, ".i");
SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanAmount, "GetLoanAmount", 1, "."); SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanAmount, "GetLoanAmount", 1, ".");

View File

@@ -5,7 +5,6 @@
#include "../../stdafx.h" #include "../../stdafx.h"
#include "../../string_func.h" #include "../../string_func.h"
#include "../../company_base.h" #include "../../company_base.h"
#include "../../rev.h"
#include "table/strings.h" #include "table/strings.h"
#include "../ai.hpp" #include "../ai.hpp"
@@ -23,8 +22,9 @@
/* static */ void AIController::Sleep(int ticks) /* static */ void AIController::Sleep(int ticks)
{ {
if (!AIObject::CanSuspend()) { if (!AIObject::GetAllowDoCommand()) {
throw AI_FatalError("You are not allowed to call Sleep in your constructor, Save(), Load(), and any valuator."); AILog::Error("You are not allowed to call Sleep in your constructor, Save(), Load(), and any valuator.\n");
return;
} }
if (ticks <= 0) { if (ticks <= 0) {
@@ -66,11 +66,6 @@ AIController::~AIController()
return AIConfig::GetConfig(_current_company)->GetSetting(name); return AIConfig::GetConfig(_current_company)->GetSetting(name);
} }
/* static */ uint AIController::GetVersion()
{
return _openttd_newgrf_version;
}
bool AIController::LoadedLibrary(const char *library_name, int *next_number, char *fake_class_name, int fake_class_name_len) bool AIController::LoadedLibrary(const char *library_name, int *next_number, char *fake_class_name, int fake_class_name_len)
{ {
LoadedLibraryList::iterator iter = this->loaded_library.find(library_name); LoadedLibraryList::iterator iter = this->loaded_library.find(library_name);

View File

@@ -50,18 +50,6 @@ public:
*/ */
static int GetSetting(const char *name); static int GetSetting(const char *name);
/**
* Get the OpenTTD version of this executable. The version is formatted
* with the bits having the following meaning:
* 28-31 major version
* 24-27 minor version
* 20-23 build
* 19 1 if it is a release, 0 if it is not.
* 0-18 revision number; 0 when the revision is unknown.
* @return The version in newgrf format.
*/
static uint GetVersion();
/** /**
* Change the minimum amount of time the AI should be put in suspend mode * Change the minimum amount of time the AI should be put in suspend mode
* when you execute a command. Normally in SP this is 1, and in MP it is * when you execute a command. Normally in SP this is 1, and in MP it is

View File

@@ -5,11 +5,10 @@
void SQAIController_Register(Squirrel *engine) { void SQAIController_Register(Squirrel *engine) {
DefSQClass <AIController> SQAIController("AIController"); DefSQClass <AIController> SQAIController("AIController");
SQAIController.PreRegister(engine); SQAIController.PreRegister(engine);
SQAIController.DefSQStaticMethod(engine, &AIController::GetTick, "GetTick", 1, "."); SQAIController.DefSQStaticMethod(engine, &AIController::GetTick, "GetTick", 1, "?");
SQAIController.DefSQStaticMethod(engine, &AIController::SetCommandDelay, "SetCommandDelay", 2, ".i"); SQAIController.DefSQStaticMethod(engine, &AIController::SetCommandDelay, "SetCommandDelay", 2, "?i");
SQAIController.DefSQStaticMethod(engine, &AIController::Sleep, "Sleep", 2, ".i"); SQAIController.DefSQStaticMethod(engine, &AIController::Sleep, "Sleep", 2, "?i");
SQAIController.DefSQStaticMethod(engine, &AIController::GetSetting, "GetSetting", 2, ".s"); SQAIController.DefSQStaticMethod(engine, &AIController::GetSetting, "GetSetting", 2, "?s");
SQAIController.DefSQStaticMethod(engine, &AIController::GetVersion, "GetVersion", 1, "."); SQAIController.DefSQStaticMethod(engine, &AIController::Print, "Print", 3, "?bs");
SQAIController.DefSQStaticMethod(engine, &AIController::Print, "Print", 3, ".bs");
SQAIController.PostRegister(engine); SQAIController.PostRegister(engine);
} }

View File

@@ -25,7 +25,7 @@ AIDepotList::AIDepotList(AITile::TransportType transport_type)
if (st->owner == ::_current_company) { if (st->owner == ::_current_company) {
const AirportFTAClass *afc = st->Airport(); const AirportFTAClass *afc = st->Airport();
for (uint i = 0; i < afc->nof_depots; i++) { for (uint i = 0; i < afc->nof_depots; i++) {
this->AddItem(st->airport_tile + ToTileIndexDiff(afc->airport_depots[i])); this->AddItem(st->xy + ToTileIndexDiff(afc->airport_depots[i]));
} }
} }
} }

View File

@@ -152,13 +152,6 @@
return ::GetEngine(engine_id)->GetDisplayMaxTractiveEffort(); return ::GetEngine(engine_id)->GetDisplayMaxTractiveEffort();
} }
/* static */ int32 AIEngine::GetDesignDate(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
return ::GetEngine(engine_id)->intro_date;
}
/* static */ AIVehicle::VehicleType AIEngine::GetVehicleType(EngineID engine_id) /* static */ AIVehicle::VehicleType AIEngine::GetVehicleType(EngineID engine_id)
{ {
if (!IsValidEngine(engine_id)) return AIVehicle::VT_INVALID; if (!IsValidEngine(engine_id)) return AIVehicle::VT_INVALID;

View File

@@ -152,14 +152,6 @@ public:
*/ */
static int32 GetMaxTractiveEffort(EngineID engine_id); static int32 GetMaxTractiveEffort(EngineID engine_id);
/**
* Get the date this engine was designed.
* @param engine_id The engine to get the design date of.
* @pre IsValidEngine(engine_id).
* @return The date this engine was designed.
*/
static int32 GetDesignDate(EngineID engine_id);
/** /**
* Get the type of an engine. * Get the type of an engine.
* @param engine_id The engine to get the type of. * @param engine_id The engine to get the type of.

View File

@@ -31,7 +31,6 @@ void SQAIEngine_Register(Squirrel *engine) {
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPower, "GetPower", 2, ".i"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPower, "GetPower", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetWeight, "GetWeight", 2, ".i"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetWeight, "GetWeight", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxTractiveEffort, "GetMaxTractiveEffort", 2, ".i"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxTractiveEffort, "GetMaxTractiveEffort", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetDesignDate, "GetDesignDate", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetVehicleType, "GetVehicleType", 2, ".i"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetVehicleType, "GetVehicleType", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsWagon, "IsWagon", 2, ".i"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsWagon, "IsWagon", 2, ".i");
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanRunOnRail, "CanRunOnRail", 3, ".ii"); SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanRunOnRail, "CanRunOnRail", 3, ".ii");

View File

@@ -35,7 +35,6 @@ public:
/** /**
* @param vehicle The vehicle that crashed. * @param vehicle The vehicle that crashed.
* @param crash_site Where the vehicle crashed. * @param crash_site Where the vehicle crashed.
* @param crash_reason The reason why the vehicle crashed.
*/ */
AIEventVehicleCrashed(VehicleID vehicle, TileIndex crash_site, CrashReason crash_reason) : AIEventVehicleCrashed(VehicleID vehicle, TileIndex crash_site, CrashReason crash_reason) :
AIEvent(AI_ET_VEHICLE_CRASHED), AIEvent(AI_ET_VEHICLE_CRASHED),

View File

@@ -4,9 +4,6 @@
#include "ai_execmode.hpp" #include "ai_execmode.hpp"
#include "../../command_type.h" #include "../../command_type.h"
#include "../../company_base.h"
#include "../../company_func.h"
#include "../ai_instance.hpp"
bool AIExecMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs) bool AIExecMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs)
{ {
@@ -24,12 +21,6 @@ AIExecMode::AIExecMode()
AIExecMode::~AIExecMode() AIExecMode::~AIExecMode()
{ {
if (this->GetDoCommandModeInstance() != this) { assert(this->GetDoCommandModeInstance() == this);
AIInstance *instance = GetCompany(_current_company)->ai_instance;
/* Ignore this error if the AI already died. */
if (!instance->IsDead()) {
throw AI_FatalError("AIExecMode object was removed while it was not the latest AI*Mode object created.");
}
}
this->SetDoCommandMode(this->last_mode, this->last_instance); this->SetDoCommandMode(this->last_mode, this->last_instance);
} }

View File

@@ -17,8 +17,8 @@ void SQAIGameSettings_Register(Squirrel *engine) {
SQAIGameSettings.PreRegister(engine); SQAIGameSettings.PreRegister(engine);
SQAIGameSettings.AddConstructor<void (AIGameSettings::*)(), 1>(engine, "x"); SQAIGameSettings.AddConstructor<void (AIGameSettings::*)(), 1>(engine, "x");
SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::IsValid, "IsValid", 2, ".."); SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::IsValid, "IsValid", 2, ".s");
SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::GetValue, "GetValue", 2, ".."); SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::GetValue, "GetValue", 2, ".s");
SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::IsDisabledVehicleType, "IsDisabledVehicleType", 2, ".i"); SQAIGameSettings.DefSQStaticMethod(engine, &AIGameSettings::IsDisabledVehicleType, "IsDisabledVehicleType", 2, ".i");
SQAIGameSettings.PostRegister(engine); SQAIGameSettings.PostRegister(engine);

View File

@@ -29,7 +29,7 @@ void SQAIGroup_Register(Squirrel *engine) {
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::CreateGroup, "CreateGroup", 2, ".i"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::CreateGroup, "CreateGroup", 2, ".i");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::DeleteGroup, "DeleteGroup", 2, ".i"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::DeleteGroup, "DeleteGroup", 2, ".i");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetVehicleType, "GetVehicleType", 2, ".i"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetVehicleType, "GetVehicleType", 2, ".i");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::SetName, "SetName", 3, ".i."); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::SetName, "SetName", 3, ".is");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetName, "GetName", 2, ".i"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetName, "GetName", 2, ".i");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::EnableAutoReplaceProtection, "EnableAutoReplaceProtection", 3, ".ib"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::EnableAutoReplaceProtection, "EnableAutoReplaceProtection", 3, ".ib");
SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetAutoReplaceProtection, "GetAutoReplaceProtection", 2, ".i"); SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetAutoReplaceProtection, "GetAutoReplaceProtection", 2, ".i");

View File

@@ -91,20 +91,6 @@
return -1; return -1;
} }
/* static */ int32 AIIndustry::GetLastMonthTransportedPercentage(IndustryID industry_id, CargoID cargo_id)
{
if (!IsValidIndustry(industry_id)) return -1;
if (!AICargo::IsValidCargo(cargo_id)) return -1;
const Industry *i = ::GetIndustry(industry_id);
for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
if (i->produced_cargo[j] == cargo_id) return i->last_month_pct_transported[j] * 100 >> 8;
}
return -1;
}
/* static */ TileIndex AIIndustry::GetLocation(IndustryID industry_id) /* static */ TileIndex AIIndustry::GetLocation(IndustryID industry_id)
{ {
if (!IsValidIndustry(industry_id)) return INVALID_TILE; if (!IsValidIndustry(industry_id)) return INVALID_TILE;

View File

@@ -77,16 +77,6 @@ public:
*/ */
static int32 GetLastMonthTransported(IndustryID industry_id, CargoID cargo_id); static int32 GetLastMonthTransported(IndustryID industry_id, CargoID cargo_id);
/**
* Get the percentage of cargo transported from an industry last month.
* @param industry_id The index of the industry.
* @param cargo_id The index of the cargo.
* @pre IsValidIndustry(industry_id).
* @pre AICargo::IsValidCargo(cargo_id).
* @return The percentage of given cargo transported from this industry last month.
*/
static int32 GetLastMonthTransportedPercentage(IndustryID industry_id, CargoID cargo_id);
/** /**
* Gets the location of the industry. * Gets the location of the industry.
* @param industry_id The index of the industry. * @param industry_id The index of the industry.
@@ -96,9 +86,7 @@ public:
static TileIndex GetLocation(IndustryID industry_id); static TileIndex GetLocation(IndustryID industry_id);
/** /**
* Get the number of stations around an industry. All stations that can * Get the number of stations around an industry.
* service the industry are counted, your own stations but also your
* opponents stations.
* @param industry_id The index of the industry. * @param industry_id The index of the industry.
* @pre IsValidIndustry(industry_id). * @pre IsValidIndustry(industry_id).
* @return The number of stations around an industry. * @return The number of stations around an industry.

View File

@@ -17,24 +17,23 @@ void SQAIIndustry_Register(Squirrel *engine) {
SQAIIndustry.PreRegister(engine); SQAIIndustry.PreRegister(engine);
SQAIIndustry.AddConstructor<void (AIIndustry::*)(), 1>(engine, "x"); SQAIIndustry.AddConstructor<void (AIIndustry::*)(), 1>(engine, "x");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, "."); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, ".");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetName, "GetName", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetName, "GetName", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsCargoAccepted, "IsCargoAccepted", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsCargoAccepted, "IsCargoAccepted", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetStockpiledCargo, "GetStockpiledCargo", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetStockpiledCargo, "GetStockpiledCargo", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthProduction, "GetLastMonthProduction", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthProduction, "GetLastMonthProduction", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthTransported, "GetLastMonthTransported", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthTransported, "GetLastMonthTransported", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLastMonthTransportedPercentage, "GetLastMonthTransportedPercentage", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLocation, "GetLocation", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLocation, "GetLocation", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetAmountOfStationsAround, "GetAmountOfStationsAround", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetAmountOfStationsAround, "GetAmountOfStationsAround", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsBuiltOnWater, "IsBuiltOnWater", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsBuiltOnWater, "IsBuiltOnWater", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::HasHeliport, "HasHeliport", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::HasHeliport, "HasHeliport", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetHeliportLocation, "GetHeliportLocation", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetHeliportLocation, "GetHeliportLocation", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::HasDock, "HasDock", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::HasDock, "HasDock", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDockLocation, "GetDockLocation", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetDockLocation, "GetDockLocation", 2, ".i"); SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryType, "GetIndustryType", 2, ".i");
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetIndustryType, "GetIndustryType", 2, ".i");
SQAIIndustry.PostRegister(engine); SQAIIndustry.PostRegister(engine);
} }

View File

@@ -111,24 +111,3 @@
uint32 seed = ::InteractiveRandom(); uint32 seed = ::InteractiveRandom();
return AIObject::DoCommand(0, industry_type, seed, CMD_BUILD_INDUSTRY); return AIObject::DoCommand(0, industry_type, seed, CMD_BUILD_INDUSTRY);
} }
/* static */ bool AIIndustryType::IsBuiltOnWater(IndustryType industry_type)
{
if (!IsValidIndustryType(industry_type)) return false;
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
}
/* static */ bool AIIndustryType::HasHeliport(IndustryType industry_type)
{
if (!IsValidIndustryType(industry_type)) return false;
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
}
/* static */ bool AIIndustryType::HasDock(IndustryType industry_type)
{
if (!IsValidIndustryType(industry_type)) return false;
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
}

View File

@@ -113,30 +113,6 @@ public:
* @note If true is returned the money is paid, whether a new industry was build or not. * @note If true is returned the money is paid, whether a new industry was build or not.
*/ */
static bool ProspectIndustry(IndustryType industry_type); static bool ProspectIndustry(IndustryType industry_type);
/**
* Is this type of industry built on water.
* @param industry_type The type of the industry.
* @pre IsValidIndustryType(industry_type).
* @return True when this type is built on water.
*/
static bool IsBuiltOnWater(IndustryType industry_type);
/**
* Does this type of industry have a heliport?
* @param industry_type The type of the industry.
* @pre IsValidIndustryType(industry_type).
* @return True when this type has a heliport.
*/
static bool HasHeliport(IndustryType industry_type);
/**
* Does this type of industry have a dock?
* @param industry_type The type of the industry.
* @pre IsValidIndustryType(industry_type).
* @return True when this type has a dock.
*/
static bool HasDock(IndustryType industry_type);
}; };
#endif /* AI_INDUSTRYTYPE_HPP */ #endif /* AI_INDUSTRYTYPE_HPP */

View File

@@ -28,9 +28,6 @@ void SQAIIndustryType_Register(Squirrel *engine) {
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::CanProspectIndustry, "CanProspectIndustry", 2, ".i"); SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::CanProspectIndustry, "CanProspectIndustry", 2, ".i");
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::BuildIndustry, "BuildIndustry", 3, ".ii"); SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::BuildIndustry, "BuildIndustry", 3, ".ii");
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::ProspectIndustry, "ProspectIndustry", 2, ".i"); SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::ProspectIndustry, "ProspectIndustry", 2, ".i");
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::IsBuiltOnWater, "IsBuiltOnWater", 2, ".i");
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::HasHeliport, "HasHeliport", 2, ".i");
SQAIIndustryType.DefSQStaticMethod(engine, &AIIndustryType::HasDock, "HasDock", 2, ".i");
SQAIIndustryType.PostRegister(engine); SQAIIndustryType.PostRegister(engine);
} }

View File

@@ -32,7 +32,7 @@
log->lines = CallocT<char *>(80); log->lines = CallocT<char *>(80);
log->type = CallocT<AILog::AILogType>(80); log->type = CallocT<AILog::AILogType>(80);
log->count = 80; log->count = 80;
log->pos = log->count - 1; log->pos = log->count;
log->used = 0; log->used = 0;
} }
LogData *log = (LogData *)AIObject::GetLogPointer(); LogData *log = (LogData *)AIObject::GetLogPointer();

View File

@@ -17,9 +17,9 @@ void SQAILog_Register(Squirrel *engine) {
SQAILog.PreRegister(engine); SQAILog.PreRegister(engine);
SQAILog.AddConstructor<void (AILog::*)(), 1>(engine, "x"); SQAILog.AddConstructor<void (AILog::*)(), 1>(engine, "x");
SQAILog.DefSQStaticMethod(engine, &AILog::Info, "Info", 2, ".."); SQAILog.DefSQStaticMethod(engine, &AILog::Info, "Info", 2, ".s");
SQAILog.DefSQStaticMethod(engine, &AILog::Warning, "Warning", 2, ".."); SQAILog.DefSQStaticMethod(engine, &AILog::Warning, "Warning", 2, ".s");
SQAILog.DefSQStaticMethod(engine, &AILog::Error, "Error", 2, ".."); SQAILog.DefSQStaticMethod(engine, &AILog::Error, "Error", 2, ".s");
SQAILog.PostRegister(engine); SQAILog.PostRegister(engine);
} }

View File

@@ -13,11 +13,10 @@
class AIMap : public AIObject { class AIMap : public AIObject {
public: public:
#ifdef DEFINE_SCRIPT_FILES #ifdef DEFINE_SCRIPT_FILES
static const int TILE_INVALID = INVALID_TILE; //!< Invalid TileIndex. enum MapType {
TILE_INVALID = INVALID_TILE, //!< Invalid TileIndex.
};
#endif /* DEFINE_SCRIPT_FILES */ #endif /* DEFINE_SCRIPT_FILES */
#ifdef DOXYGEN_SKIP
const static TileIndex TILE_INVALID; //!< Invalid TileIndex.
#endif /* DOXYGEN_SKIP */
static const char *GetClassName() { return "AIMap"; } static const char *GetClassName() { return "AIMap"; }

View File

@@ -4,6 +4,10 @@
#include "ai_map.hpp" #include "ai_map.hpp"
namespace SQConvert { namespace SQConvert {
/* Allow enums to be used as Squirrel parameters */
template <> AIMap::MapType GetParam(ForceType<AIMap::MapType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIMap::MapType)tmp; }
template <> int Return<AIMap::MapType>(HSQUIRRELVM vm, AIMap::MapType res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow AIMap to be used as Squirrel parameter */ /* Allow AIMap to be used as Squirrel parameter */
template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; } template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; }
template <> AIMap &GetParam(ForceType<AIMap &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; } template <> AIMap &GetParam(ForceType<AIMap &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; }

View File

@@ -55,13 +55,13 @@
DiagDirection to_other_tile = (TileX(t1) == TileX(t2)) ? DIAGDIR_SE : DIAGDIR_SW; DiagDirection to_other_tile = (TileX(t1) == TileX(t2)) ? DIAGDIR_SE : DIAGDIR_SW;
/* Determine the reachable tracks from the shared edge */ /* Determine the reachable tracks from the shared edge */
TrackBits gtts1 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t1, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile); TrackBits gtts2 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t2, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
if (gtts1 == TRACK_BIT_NONE) return false; if (gtts2 == TRACK_BIT_NONE) return false;
to_other_tile = ReverseDiagDir(to_other_tile); to_other_tile = ReverseDiagDir(to_other_tile);
TrackBits gtts2 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t2, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile); TrackBits gtts1 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t1, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
return gtts2 != TRACK_BIT_NONE; return gtts1 != TRACK_BIT_NONE;
} }
/* static */ bool AIMarine::BuildWaterDepot(TileIndex tile, TileIndex front) /* static */ bool AIMarine::BuildWaterDepot(TileIndex tile, TileIndex front)

View File

@@ -2,11 +2,6 @@
/** @file ai_object.cpp Implementation of AIObject. */ /** @file ai_object.cpp Implementation of AIObject. */
#include "../../stdafx.h"
#include <squirrel.h>
#include "../../script/squirrel.hpp"
#include "../../company_base.h"
#include "ai_log.hpp" #include "ai_log.hpp"
#include "table/strings.h" #include "table/strings.h"
#include "../ai.hpp" #include "../ai.hpp"
@@ -165,12 +160,6 @@ bool AIObject::GetAllowDoCommand()
return GetStorage()->allow_do_command; return GetStorage()->allow_do_command;
} }
bool AIObject::CanSuspend()
{
Squirrel *squirrel = GetCompany(_current_company)->ai_instance->engine;
return GetStorage()->allow_do_command && squirrel->CanSuspend();
}
void *&AIObject::GetEventPointer() void *&AIObject::GetEventPointer()
{ {
return GetStorage()->event_data; return GetStorage()->event_data;
@@ -194,8 +183,9 @@ int AIObject::GetCallbackVariable(int index)
bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text, AISuspendCallbackProc *callback) bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text, AISuspendCallbackProc *callback)
{ {
if (!AIObject::CanSuspend()) { if (AIObject::GetAllowDoCommand() == false) {
throw AI_FatalError("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator."); AILog::Error("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator.\n");
return false;
} }
CommandCost res; CommandCost res;

View File

@@ -133,15 +133,8 @@ protected:
static GroupID GetNewGroupID(); static GroupID GetNewGroupID();
/** /**
* Can we suspend the AI at this moment? * Get the latest stored allow_do_command.
*/ * If this is false, you are not allowed to do any DoCommands.
static bool CanSuspend();
/**
* Get the internal value of allow_do_command. This can differ
* from CanSuspend() if the reason we are not allowed
* to execute a DoCommand is in squirrel and not the API.
* In that case use this function to restore the previous value.
*/ */
static bool GetAllowDoCommand(); static bool GetAllowDoCommand();
@@ -150,24 +143,9 @@ protected:
*/ */
static void *&GetEventPointer(); static void *&GetEventPointer();
/**
* Set the cost of the last command.
*/
static void SetLastCost(Money last_cost); static void SetLastCost(Money last_cost);
/**
* Get the cost of the last command.
*/
static Money GetLastCost(); static Money GetLastCost();
/**
* Set a variable that can be used by callback functions to pass information.
*/
static void SetCallbackVariable(int index, int value); static void SetCallbackVariable(int index, int value);
/**
* Get the variable that is used by callback functions to pass information.
*/
static int GetCallbackVariable(int index); static int GetCallbackVariable(int index);
public: public:

View File

@@ -23,10 +23,7 @@ static OrderType GetOrderTypeByTile(TileIndex t)
switch (::GetTileType(t)) { switch (::GetTileType(t)) {
default: break; default: break;
case MP_STATION: case MP_STATION: return OT_GOTO_STATION; break;
if (IsHangar(t)) return OT_GOTO_DEPOT;
return OT_GOTO_STATION;
break;
case MP_WATER: if (::IsShipDepot(t)) return OT_GOTO_DEPOT; break; case MP_WATER: if (::IsShipDepot(t)) return OT_GOTO_DEPOT; break;
case MP_ROAD: if (::GetRoadTileType(t) == ROAD_TILE_DEPOT) return OT_GOTO_DEPOT; break; case MP_ROAD: if (::GetRoadTileType(t) == ROAD_TILE_DEPOT) return OT_GOTO_DEPOT; break;
case MP_RAILWAY: case MP_RAILWAY:
@@ -46,47 +43,6 @@ static OrderType GetOrderTypeByTile(TileIndex t)
return AIVehicle::IsValidVehicle(vehicle_id) && order_position >= 0 && (order_position < ::GetVehicle(vehicle_id)->GetNumOrders() || order_position == ORDER_CURRENT); return AIVehicle::IsValidVehicle(vehicle_id) && order_position >= 0 && (order_position < ::GetVehicle(vehicle_id)->GetNumOrders() || order_position == ORDER_CURRENT);
} }
/**
* Get the current order the vehicle is executing. If the current order is in
* the order list, return the order from the orderlist. If the current order
* was a manual order, return the current order.
*/
static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
{
const Vehicle *v = ::GetVehicle(vehicle_id);
if (order_position == AIOrder::ORDER_CURRENT) {
const Order *order = &v->current_order;
if (order->GetType() == OT_GOTO_DEPOT && !(order->GetDepotOrderType() & ODTFB_PART_OF_ORDERS)) return order;
order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
if (order_position == AIOrder::ORDER_INVALID) return NULL;
}
return ::GetVehicleOrder(v, order_position);
}
/* static */ bool AIOrder::IsGotoStationOrder(VehicleID vehicle_id, OrderPosition order_position)
{
if (!IsValidVehicleOrder(vehicle_id, order_position)) return false;
const Order *order = ::ResolveOrder(vehicle_id, order_position);
return order != NULL && order->GetType() == OT_GOTO_STATION;
}
/* static */ bool AIOrder::IsGotoDepotOrder(VehicleID vehicle_id, OrderPosition order_position)
{
if (!IsValidVehicleOrder(vehicle_id, order_position)) return false;
const Order *order = ::ResolveOrder(vehicle_id, order_position);
return order != NULL && order->GetType() == OT_GOTO_DEPOT;
}
/* static */ bool AIOrder::IsGotoWaypointOrder(VehicleID vehicle_id, OrderPosition order_position)
{
if (!IsValidVehicleOrder(vehicle_id, order_position)) return false;
const Order *order = ::ResolveOrder(vehicle_id, order_position);
return order != NULL && order->GetType() == OT_GOTO_WAYPOINT;
}
/* static */ bool AIOrder::IsConditionalOrder(VehicleID vehicle_id, OrderPosition order_position) /* static */ bool AIOrder::IsConditionalOrder(VehicleID vehicle_id, OrderPosition order_position)
{ {
if (order_position == ORDER_CURRENT) return false; if (order_position == ORDER_CURRENT) return false;
@@ -96,16 +52,6 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
return order->GetType() == OT_CONDITIONAL; return order->GetType() == OT_CONDITIONAL;
} }
/* static */ bool AIOrder::IsCurrentOrderPartOfOrderList(VehicleID vehicle_id)
{
if (AIVehicle::IsValidVehicle(vehicle_id)) return false;
if (GetOrderCount(vehicle_id) == 0) return false;
const Order *order = &::GetVehicle(vehicle_id)->current_order;
if (order->GetType() != OT_GOTO_DEPOT) return true;
return (order->GetDepotOrderType() & ODTFB_PART_OF_ORDERS) != 0;
}
/* static */ AIOrder::OrderPosition AIOrder::ResolveOrderPosition(VehicleID vehicle_id, OrderPosition order_position) /* static */ AIOrder::OrderPosition AIOrder::ResolveOrderPosition(VehicleID vehicle_id, OrderPosition order_position)
{ {
if (!AIVehicle::IsValidVehicle(vehicle_id)) return ORDER_INVALID; if (!AIVehicle::IsValidVehicle(vehicle_id)) return ORDER_INVALID;
@@ -128,10 +74,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
(((order_flags & AIOF_NO_UNLOAD) == 0) || ((order_flags & AIOF_NO_LOAD) == 0)) && (((order_flags & AIOF_NO_UNLOAD) == 0) || ((order_flags & AIOF_NO_LOAD) == 0)) &&
(((order_flags & AIOF_FULL_LOAD_ANY) == 0) || ((order_flags & AIOF_NO_LOAD) == 0)); (((order_flags & AIOF_FULL_LOAD_ANY) == 0) || ((order_flags & AIOF_NO_LOAD) == 0));
case OT_GOTO_DEPOT: case OT_GOTO_DEPOT: return (order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_SERVICE_IF_NEEDED)) == 0;
return ((order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_DEPOT_FLAGS)) == 0) &&
(((order_flags & AIOF_SERVICE_IF_NEEDED) == 0) || ((order_flags & AIOF_STOP_IN_DEPOT) == 0));
case OT_GOTO_WAYPOINT: return (order_flags & ~(AIOF_NON_STOP_FLAGS)) == 0; case OT_GOTO_WAYPOINT: return (order_flags & ~(AIOF_NON_STOP_FLAGS)) == 0;
default: return false; default: return false;
} }
@@ -165,41 +108,21 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
{ {
if (!IsValidVehicleOrder(vehicle_id, order_position)) return INVALID_TILE; if (!IsValidVehicleOrder(vehicle_id, order_position)) return INVALID_TILE;
const Order *order = ::ResolveOrder(vehicle_id, order_position); const Order *order;
if (order == NULL || order->GetType() == OT_CONDITIONAL) return INVALID_TILE;
const Vehicle *v = ::GetVehicle(vehicle_id); const Vehicle *v = ::GetVehicle(vehicle_id);
if (order_position == ORDER_CURRENT) {
order = &v->current_order;
} else {
order = ::GetVehicleOrder(GetVehicle(vehicle_id), order_position);
if (order->GetType() == OT_CONDITIONAL) return INVALID_TILE;
}
switch (order->GetType()) { switch (order->GetType()) {
case OT_GOTO_DEPOT: { case OT_GOTO_DEPOT:
if (v->type != VEH_AIRCRAFT) return ::GetDepot(order->GetDestination())->xy; if (v->type != VEH_AIRCRAFT) return ::GetDepot(order->GetDestination())->xy;
/* Aircraft's hangars are referenced by StationID, not DepotID */ /* FALL THROUGH: aircraft's hangars are referenced by StationID, not DepotID */
const Station *st = ::GetStation(order->GetDestination());
const AirportFTAClass *airport = st->Airport();
if (airport == NULL || airport->nof_depots == 0) return INVALID_TILE;
return st->airport_tile + ::ToTileIndexDiff(st->Airport()->airport_depots[0]);
}
case OT_GOTO_STATION: { case OT_GOTO_STATION: return ::GetStation(order->GetDestination())->xy;
const Station *st = ::GetStation(order->GetDestination());
if (st->train_tile != INVALID_TILE) {
for (uint i = 0; i < st->trainst_w; i++) {
TileIndex t = st->train_tile + TileDiffXY(i, 0);
if (st->TileBelongsToRailStation(t)) return t;
}
} else if (st->dock_tile != INVALID_TILE) {
return st->dock_tile;
} else if (st->bus_stops != NULL) {
return st->bus_stops->xy;
} else if (st->truck_stops != NULL) {
return st->truck_stops->xy;
} else if (st->airport_tile != INVALID_TILE) {
const AirportFTAClass *fta = st->Airport();
BEGIN_TILE_LOOP(tile, fta->size_x, fta->size_y, st->airport_tile) {
if (!::IsHangar(tile)) return tile;
} END_TILE_LOOP(tile, fta->size_x, fta->size_y, st->airport_tile)
}
return INVALID_TILE;
}
case OT_GOTO_WAYPOINT: return ::GetWaypoint(order->GetDestination())->xy; case OT_GOTO_WAYPOINT: return ::GetWaypoint(order->GetDestination())->xy;
default: return INVALID_TILE; default: return INVALID_TILE;
} }
@@ -209,15 +132,19 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
{ {
if (!IsValidVehicleOrder(vehicle_id, order_position)) return AIOF_INVALID; if (!IsValidVehicleOrder(vehicle_id, order_position)) return AIOF_INVALID;
const Order *order = ::ResolveOrder(vehicle_id, order_position); const Order *order;
if (order == NULL || order->GetType() == OT_CONDITIONAL) return AIOF_INVALID; if (order_position == ORDER_CURRENT) {
order = &::GetVehicle(vehicle_id)->current_order;
} else {
order = ::GetVehicleOrder(GetVehicle(vehicle_id), order_position);
if (order->GetType() == OT_CONDITIONAL) return AIOF_INVALID;
}
AIOrderFlags order_flags = AIOF_NONE; AIOrderFlags order_flags = AIOF_NONE;
order_flags |= (AIOrderFlags)order->GetNonStopType(); order_flags |= (AIOrderFlags)order->GetNonStopType();
switch (order->GetType()) { switch (order->GetType()) {
case OT_GOTO_DEPOT: case OT_GOTO_DEPOT:
if (order->GetDepotOrderType() & ODTFB_SERVICE) order_flags |= AIOF_SERVICE_IF_NEEDED; if (order->GetDepotOrderType() & ODTFB_SERVICE) order_flags |= AIOF_SERVICE_IF_NEEDED;
if (order->GetDepotActionType() & ODATFB_HALT) order_flags |= AIOF_STOP_IN_DEPOT;
break; break;
case OT_GOTO_STATION: case OT_GOTO_STATION:
@@ -333,21 +260,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
Order order; Order order;
switch (::GetOrderTypeByTile(destination)) { switch (::GetOrderTypeByTile(destination)) {
case OT_GOTO_DEPOT: { case OT_GOTO_DEPOT:
OrderDepotTypeFlags odtf = (OrderDepotTypeFlags)(ODTFB_PART_OF_ORDERS | ((order_flags & AIOF_SERVICE_IF_NEEDED) ? ODTFB_SERVICE : 0)); order.MakeGoToDepot(::GetDepotByTile(destination)->index, (OrderDepotTypeFlags)(ODTFB_PART_OF_ORDERS | ((order_flags & AIOF_SERVICE_IF_NEEDED) ? ODTFB_SERVICE : 0)));
OrderDepotActionFlags odaf = (OrderDepotActionFlags)(ODATF_SERVICE_ONLY | ((order_flags & AIOF_STOP_IN_DEPOT) ? ODATFB_HALT : 0));
OrderNonStopFlags onsf = (OrderNonStopFlags)((order_flags & AIOF_NON_STOP_INTERMEDIATE) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
/* Check explicitly if the order is to a station (for aircraft) or
* to a depot (other vehicle types). */
if (::GetVehicle(vehicle_id)->type == VEH_AIRCRAFT) {
if (!::IsTileType(destination, MP_STATION)) return false;
order.MakeGoToDepot(::GetStationIndex(destination), odtf, onsf, odaf);
} else {
if (::IsTileType(destination, MP_STATION)) return false;
order.MakeGoToDepot(::GetDepotByTile(destination)->index, odtf, onsf, odaf);
}
break; break;
}
case OT_GOTO_STATION: case OT_GOTO_STATION:
order.MakeGoToStation(::GetStationIndex(destination)); order.MakeGoToStation(::GetStationIndex(destination));
@@ -441,11 +356,8 @@ static void _DoCommandReturnSetOrderFlags(class AIInstance *instance)
switch (order->GetType()) { switch (order->GetType()) {
case OT_GOTO_DEPOT: case OT_GOTO_DEPOT:
if ((current & AIOF_DEPOT_FLAGS) != (order_flags & AIOF_DEPOT_FLAGS)) { if ((current & AIOF_SERVICE_IF_NEEDED) != (order_flags & AIOF_SERVICE_IF_NEEDED)) {
uint data = DA_ALWAYS_GO; return AIObject::DoCommand(0, vehicle_id | (order_position << 16), MOF_DEPOT_ACTION, CMD_MODIFY_ORDER, NULL, &_DoCommandReturnSetOrderFlags);
if (order_flags & AIOF_SERVICE_IF_NEEDED) data = DA_SERVICE;
if (order_flags & AIOF_STOP_IN_DEPOT) data = DA_STOP;
return AIObject::DoCommand(0, vehicle_id | (order_position << 16), (data << 4) | MOF_DEPOT_ACTION, CMD_MODIFY_ORDER, NULL, &_DoCommandReturnSetOrderFlags);
} }
break; break;

View File

@@ -57,8 +57,6 @@ public:
/** Service the vehicle when needed, otherwise skip this order; only for depots. */ /** Service the vehicle when needed, otherwise skip this order; only for depots. */
AIOF_SERVICE_IF_NEEDED = 1 << 2, AIOF_SERVICE_IF_NEEDED = 1 << 2,
/** Stop in the depot instead of only go there for servicing; only for depots. */
AIOF_STOP_IN_DEPOT = 1 << 3,
/** All flags related to non-stop settings. */ /** All flags related to non-stop settings. */
AIOF_NON_STOP_FLAGS = AIOF_NON_STOP_INTERMEDIATE | AIOF_NON_STOP_DESTINATION, AIOF_NON_STOP_FLAGS = AIOF_NON_STOP_INTERMEDIATE | AIOF_NON_STOP_DESTINATION,
@@ -66,8 +64,6 @@ public:
AIOF_UNLOAD_FLAGS = AIOF_TRANSFER | AIOF_UNLOAD | AIOF_NO_UNLOAD, AIOF_UNLOAD_FLAGS = AIOF_TRANSFER | AIOF_UNLOAD | AIOF_NO_UNLOAD,
/** All flags related to loading. */ /** All flags related to loading. */
AIOF_LOAD_FLAGS = AIOF_FULL_LOAD | AIOF_FULL_LOAD_ANY | AIOF_NO_LOAD, AIOF_LOAD_FLAGS = AIOF_FULL_LOAD | AIOF_FULL_LOAD_ANY | AIOF_NO_LOAD,
/** All flags related to depots. */
AIOF_DEPOT_FLAGS = AIOF_SERVICE_IF_NEEDED | AIOF_STOP_IN_DEPOT,
/** For marking invalid order flags */ /** For marking invalid order flags */
AIOF_INVALID = 0xFFFF, AIOF_INVALID = 0xFFFF,
@@ -118,33 +114,6 @@ public:
*/ */
static bool IsValidVehicleOrder(VehicleID vehicle_id, OrderPosition order_position); static bool IsValidVehicleOrder(VehicleID vehicle_id, OrderPosition order_position);
/**
* Checks whether the given order is a goto-station order.
* @param vehicle_id The vehicle to check.
* @param order_position The order index to check.
* @pre IsValidVehicleOrder(vehicle_id, order_position).
* @return True if and only if the order is a goto-station order.
*/
static bool IsGotoStationOrder(VehicleID vehicle_id, OrderPosition order_position);
/**
* Checks whether the given order is a goto-depot order.
* @param vehicle_id The vehicle to check.
* @param order_position The order index to check.
* @pre IsValidVehicleOrder(vehicle_id, order_position).
* @return True if and only if the order is a goto-depot order.
*/
static bool IsGotoDepotOrder(VehicleID vehicle_id, OrderPosition order_position);
/**
* Checks whether the given order is a goto-waypoint order.
* @param vehicle_id The vehicle to check.
* @param order_position The order index to check.
* @pre IsValidVehicleOrder(vehicle_id, order_position).
* @return True if and only if the order is a goto-waypoint order.
*/
static bool IsGotoWaypointOrder(VehicleID vehicle_id, OrderPosition order_position);
/** /**
* Checks whether the given order is a conditional order. * Checks whether the given order is a conditional order.
* @param vehicle_id The vehicle to check. * @param vehicle_id The vehicle to check.
@@ -154,17 +123,6 @@ public:
*/ */
static bool IsConditionalOrder(VehicleID vehicle_id, OrderPosition order_position); static bool IsConditionalOrder(VehicleID vehicle_id, OrderPosition order_position);
/**
* Checks whether the current order is part of the orderlist.
* @param vehicle_id The vehicle to check.
* @pre AIVehicle::IsValidVehicle(vehicle_id).
* @return True if and only if the current order is part of the order list.
* @note If the order is a non-'non-stop' order, and the vehicle is currently
* (un)loading at a station that is not the final destination, this function
* will still return true.
*/
static bool IsCurrentOrderPartOfOrderList(VehicleID vehicle_id);
/** /**
* Resolves the given order index to the correct index for the given vehicle. * Resolves the given order index to the correct index for the given vehicle.
* If the order index was ORDER_CURRENT it will be resolved to the index of * If the order index was ORDER_CURRENT it will be resolved to the index of
@@ -288,10 +246,8 @@ public:
* Sets the OrderCondition of the given order for the given vehicle. * Sets the OrderCondition of the given order for the given vehicle.
* @param vehicle_id The vehicle to set the condition type for. * @param vehicle_id The vehicle to set the condition type for.
* @param order_position The order to set the condition type for. * @param order_position The order to set the condition type for.
* @param condition The condition to compare on.
* @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position).
* @pre condition >= OC_LOAD_PERCENTAGE && condition <= OC_UNCONDITIONALLY.
* @return Whether the order has been/can be changed. * @return Whether the order has been/can be changed.
*/ */
static bool SetOrderCondition(VehicleID vehicle_id, OrderPosition order_position, OrderCondition condition); static bool SetOrderCondition(VehicleID vehicle_id, OrderPosition order_position, OrderCondition condition);
@@ -300,10 +256,8 @@ public:
* Sets the CompareFunction of the given order for the given vehicle. * Sets the CompareFunction of the given order for the given vehicle.
* @param vehicle_id The vehicle to set the compare function for. * @param vehicle_id The vehicle to set the compare function for.
* @param order_position The order to set the compare function for. * @param order_position The order to set the compare function for.
* @param compare The new compare function of the order.
* @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position).
* @pre compare >= CF_EQUALS && compare <= CF_IS_FALSE.
* @return Whether the order has been/can be changed. * @return Whether the order has been/can be changed.
*/ */
static bool SetOrderCompareFunction(VehicleID vehicle_id, OrderPosition order_position, CompareFunction compare); static bool SetOrderCompareFunction(VehicleID vehicle_id, OrderPosition order_position, CompareFunction compare);
@@ -312,7 +266,6 @@ public:
* Sets the value to compare against of the given order for the given vehicle. * Sets the value to compare against of the given order for the given vehicle.
* @param vehicle_id The vehicle to set the value for. * @param vehicle_id The vehicle to set the value for.
* @param order_position The order to set the value for. * @param order_position The order to set the value for.
* @param value The value to compare against.
* @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position). * @pre order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position).
* @pre value >= 0 && value < 2048. * @pre value >= 0 && value < 2048.
@@ -328,7 +281,7 @@ public:
* @pre AIVehicle::IsValidVehicle(vehicle_id). * @pre AIVehicle::IsValidVehicle(vehicle_id).
* @pre AreOrderFlagsValid(destination, order_flags). * @pre AreOrderFlagsValid(destination, order_flags).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIOrder::ERR_ORDER_TOO_MANY * @exception AIOrder::ERR_ORDER_NO_MORE_SPACE
* @exception AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION * @exception AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION
* @return True if and only if the order was appended. * @return True if and only if the order was appended.
*/ */
@@ -341,7 +294,7 @@ public:
* @pre AIVehicle::IsValidVehicle(vehicle_id). * @pre AIVehicle::IsValidVehicle(vehicle_id).
* @pre IsValidVehicleOrder(vehicle_id, jump_to). * @pre IsValidVehicleOrder(vehicle_id, jump_to).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIOrder::ERR_ORDER_TOO_MANY * @exception AIOrder::ERR_ORDER_NO_MORE_SPACE
* @return True if and only if the order was appended. * @return True if and only if the order was appended.
*/ */
static bool AppendConditionalOrder(VehicleID vehicle_id, OrderPosition jump_to); static bool AppendConditionalOrder(VehicleID vehicle_id, OrderPosition jump_to);
@@ -355,7 +308,7 @@ public:
* @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre AreOrderFlagsValid(destination, order_flags). * @pre AreOrderFlagsValid(destination, order_flags).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIOrder::ERR_ORDER_TOO_MANY * @exception AIOrder::ERR_ORDER_NO_MORE_SPACE
* @exception AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION * @exception AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION
* @return True if and only if the order was inserted. * @return True if and only if the order was inserted.
*/ */
@@ -369,7 +322,7 @@ public:
* @pre IsValidVehicleOrder(vehicle_id, order_position). * @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre IsValidVehicleOrder(vehicle_id, jump_to). * @pre IsValidVehicleOrder(vehicle_id, jump_to).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIOrder::ERR_ORDER_TOO_MANY * @exception AIOrder::ERR_ORDER_NO_MORE_SPACE
* @return True if and only if the order was inserted. * @return True if and only if the order was inserted.
*/ */
static bool InsertConditionalOrder(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to); static bool InsertConditionalOrder(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to);
@@ -442,7 +395,7 @@ public:
* @pre AIVehicle::IsValidVehicle(vehicle_id). * @pre AIVehicle::IsValidVehicle(vehicle_id).
* @pre AIVehicle::IsValidVehicle(main_vehicle_id). * @pre AIVehicle::IsValidVehicle(main_vehicle_id).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIOrder::ERR_ORDER_TOO_MANY * @exception AIOrder::ERR_ORDER_NO_MORE_SPACE
* @return True if and only if the copying succeeded. * @return True if and only if the copying succeeded.
*/ */
static bool CopyOrders(VehicleID vehicle_id, VehicleID main_vehicle_id); static bool CopyOrders(VehicleID vehicle_id, VehicleID main_vehicle_id);

View File

@@ -42,11 +42,9 @@ void SQAIOrder_Register(Squirrel *engine) {
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_FULL_LOAD_ANY, "AIOF_FULL_LOAD_ANY"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_FULL_LOAD_ANY, "AIOF_FULL_LOAD_ANY");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_NO_LOAD, "AIOF_NO_LOAD"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_NO_LOAD, "AIOF_NO_LOAD");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_SERVICE_IF_NEEDED, "AIOF_SERVICE_IF_NEEDED"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_SERVICE_IF_NEEDED, "AIOF_SERVICE_IF_NEEDED");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_STOP_IN_DEPOT, "AIOF_STOP_IN_DEPOT");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_NON_STOP_FLAGS, "AIOF_NON_STOP_FLAGS"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_NON_STOP_FLAGS, "AIOF_NON_STOP_FLAGS");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_UNLOAD_FLAGS, "AIOF_UNLOAD_FLAGS"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_UNLOAD_FLAGS, "AIOF_UNLOAD_FLAGS");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_LOAD_FLAGS, "AIOF_LOAD_FLAGS"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_LOAD_FLAGS, "AIOF_LOAD_FLAGS");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_DEPOT_FLAGS, "AIOF_DEPOT_FLAGS");
SQAIOrder.DefSQConst(engine, AIOrder::AIOF_INVALID, "AIOF_INVALID"); SQAIOrder.DefSQConst(engine, AIOrder::AIOF_INVALID, "AIOF_INVALID");
SQAIOrder.DefSQConst(engine, AIOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE"); SQAIOrder.DefSQConst(engine, AIOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE");
SQAIOrder.DefSQConst(engine, AIOrder::OC_RELIABILITY, "OC_RELIABILITY"); SQAIOrder.DefSQConst(engine, AIOrder::OC_RELIABILITY, "OC_RELIABILITY");
@@ -73,38 +71,34 @@ void SQAIOrder_Register(Squirrel *engine) {
AIError::RegisterErrorMapString(AIOrder::ERR_ORDER_TOO_MANY, "ERR_ORDER_TOO_MANY"); AIError::RegisterErrorMapString(AIOrder::ERR_ORDER_TOO_MANY, "ERR_ORDER_TOO_MANY");
AIError::RegisterErrorMapString(AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION, "ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION"); AIError::RegisterErrorMapString(AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION, "ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsValidVehicleOrder, "IsValidVehicleOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsValidVehicleOrder, "IsValidVehicleOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsGotoStationOrder, "IsGotoStationOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsConditionalOrder, "IsConditionalOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsGotoDepotOrder, "IsGotoDepotOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ResolveOrderPosition, "ResolveOrderPosition", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsGotoWaypointOrder, "IsGotoWaypointOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AreOrderFlagsValid, "AreOrderFlagsValid", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsConditionalOrder, "IsConditionalOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsValidConditionalOrder, "IsValidConditionalOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsCurrentOrderPartOfOrderList, "IsCurrentOrderPartOfOrderList", 2, ".i"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCount, "GetOrderCount", 2, ".i");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ResolveOrderPosition, "ResolveOrderPosition", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderDestination, "GetOrderDestination", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AreOrderFlagsValid, "AreOrderFlagsValid", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderFlags, "GetOrderFlags", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::IsValidConditionalOrder, "IsValidConditionalOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderJumpTo, "GetOrderJumpTo", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCount, "GetOrderCount", 2, ".i"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCondition, "GetOrderCondition", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderDestination, "GetOrderDestination", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareFunction, "GetOrderCompareFunction", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderFlags, "GetOrderFlags", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareValue, "GetOrderCompareValue", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderJumpTo, "GetOrderJumpTo", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderJumpTo, "SetOrderJumpTo", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCondition, "GetOrderCondition", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCondition, "SetOrderCondition", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareFunction, "GetOrderCompareFunction", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareFunction, "SetOrderCompareFunction", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareValue, "GetOrderCompareValue", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareValue, "SetOrderCompareValue", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderJumpTo, "SetOrderJumpTo", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendOrder, "AppendOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCondition, "SetOrderCondition", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendConditionalOrder, "AppendConditionalOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareFunction, "SetOrderCompareFunction", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertOrder, "InsertOrder", 5, ".iiii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareValue, "SetOrderCompareValue", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertConditionalOrder, "InsertConditionalOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendOrder, "AppendOrder", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::RemoveOrder, "RemoveOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendConditionalOrder, "AppendConditionalOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderFlags, "SetOrderFlags", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertOrder, "InsertOrder", 5, ".iiii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ChangeOrder, "ChangeOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertConditionalOrder, "InsertConditionalOrder", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::MoveOrder, "MoveOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::RemoveOrder, "RemoveOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SkipToOrder, "SkipToOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderFlags, "SetOrderFlags", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::CopyOrders, "CopyOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ChangeOrder, "ChangeOrder", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ShareOrders, "ShareOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::MoveOrder, "MoveOrder", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::UnshareOrders, "UnshareOrders", 2, ".i");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SkipToOrder, "SkipToOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::CopyOrders, "CopyOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ShareOrders, "ShareOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::UnshareOrders, "UnshareOrders", 2, ".i");
SQAIOrder.PostRegister(engine); SQAIOrder.PostRegister(engine);
} }

View File

@@ -110,7 +110,7 @@
{ {
if (!IsRailStationTile(tile)) return RAILTRACK_INVALID; if (!IsRailStationTile(tile)) return RAILTRACK_INVALID;
return (RailTrack)::GetRailStationTrackBits(tile); return (RailTrack)::GetRailStationTrack(tile);
} }
/* static */ bool AIRail::BuildRailDepot(TileIndex tile, TileIndex front) /* static */ bool AIRail::BuildRailDepot(TileIndex tile, TileIndex front)
@@ -203,7 +203,6 @@
if (IsRailWaypointTile(tile)) return ::GetRailWaypointBits(tile); if (IsRailWaypointTile(tile)) return ::GetRailWaypointBits(tile);
if (IsRailStationTile(tile)) return ::TrackToTrackBits(::GetRailStationTrack(tile)); if (IsRailStationTile(tile)) return ::TrackToTrackBits(::GetRailStationTrack(tile));
if (IsLevelCrossingTile(tile)) return ::GetCrossingRailBits(tile); if (IsLevelCrossingTile(tile)) return ::GetCrossingRailBits(tile);
if (IsRailDepotTile(tile)) return ::TRACK_BIT_NONE;
return ::GetTrackBits(tile); return ::GetTrackBits(tile);
} }
@@ -221,7 +220,7 @@
/* static */ bool AIRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track) /* static */ bool AIRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track)
{ {
EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsPlainRailTile(tile) || ::IsLevelCrossingTile(tile)); EnforcePrecondition(false, ::IsTileType(tile, MP_RAILWAY) && ::IsPlainRailTile(tile));
EnforcePrecondition(false, GetRailTracks(tile) & rail_track); EnforcePrecondition(false, GetRailTracks(tile) & rail_track);
EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0); EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0);
@@ -404,7 +403,7 @@ static bool IsValidSignalType(int signal_type)
/* static */ bool AIRail::BuildSignal(TileIndex tile, TileIndex front, SignalType signal) /* static */ bool AIRail::BuildSignal(TileIndex tile, TileIndex front, SignalType signal)
{ {
EnforcePrecondition(false, AIMap::DistanceManhattan(tile, front) == 1) EnforcePrecondition(false, AIMap::DistanceManhattan(tile, front) == 1)
EnforcePrecondition(false, ::IsPlainRailTile(tile)); EnforcePrecondition(false, ::IsTileType(tile, MP_RAILWAY) && ::IsPlainRailTile(tile));
EnforcePrecondition(false, ::IsValidSignalType(signal)); EnforcePrecondition(false, ::IsValidSignalType(signal));
Track track = INVALID_TRACK; Track track = INVALID_TRACK;

View File

@@ -293,7 +293,6 @@ public:
/** /**
* Get all RailTracks on the given tile. * Get all RailTracks on the given tile.
* @note A depot has no railtracks.
* @param tile The tile to check. * @param tile The tile to check.
* @pre IsRailTile(tile). * @pre IsRailTile(tile).
* @return A bitmask of RailTrack with all RailTracks on the tile. * @return A bitmask of RailTrack with all RailTracks on the tile.

View File

@@ -5,18 +5,12 @@
#include "ai_road.hpp" #include "ai_road.hpp"
#include "ai_map.hpp" #include "ai_map.hpp"
#include "ai_station.hpp" #include "ai_station.hpp"
#include "ai_cargo.hpp"
#include "../../station_map.h" #include "../../station_map.h"
#include "../../command_type.h" #include "../../command_type.h"
#include "../../settings_type.h" #include "../../settings_type.h"
#include "../../company_func.h" #include "../../company_func.h"
#include "../../script/squirrel_helper_type.hpp" #include "../../script/squirrel_helper_type.hpp"
/* static */ AIRoad::RoadVehicleType AIRoad::GetRoadVehicleTypeForCargo(CargoID cargo_type)
{
return AICargo::HasCargoClass(cargo_type, AICargo::CC_PASSENGERS) ? ROADVEHTYPE_BUS : ROADVEHTYPE_TRUCK;
}
/* static */ bool AIRoad::IsRoadTile(TileIndex tile) /* static */ bool AIRoad::IsRoadTile(TileIndex tile)
{ {
if (!::IsValidTile(tile)) return false; if (!::IsValidTile(tile)) return false;
@@ -75,7 +69,6 @@
{ {
if (!::IsValidTile(t1)) return false; if (!::IsValidTile(t1)) return false;
if (!::IsValidTile(t2)) return false; if (!::IsValidTile(t2)) return false;
if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false;
/* Tiles not neighbouring */ /* Tiles not neighbouring */
if ((abs((int)::TileX(t1) - (int)::TileX(t2)) + abs((int)::TileY(t1) - (int)::TileY(t2))) != 1) return false; if ((abs((int)::TileX(t1) - (int)::TileX(t2)) + abs((int)::TileY(t1) - (int)::TileY(t2))) != 1) return false;
@@ -422,7 +415,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ int32 AIRoad::GetNeighbourRoadCount(TileIndex tile) /* static */ int32 AIRoad::GetNeighbourRoadCount(TileIndex tile)
{ {
if (!::IsValidTile(tile)) return false; if (!::IsValidTile(tile)) return false;
if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false;
::RoadTypes rts = ::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType()); ::RoadTypes rts = ::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType());
int32 neighbour = 0; int32 neighbour = 0;
@@ -463,7 +455,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
EnforcePrecondition(false, ::IsValidTile(end)); EnforcePrecondition(false, ::IsValidTile(end));
EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end));
EnforcePrecondition(false, !one_way || AIObject::GetRoadType() == ::ROADTYPE_ROAD); EnforcePrecondition(false, !one_way || AIObject::GetRoadType() == ::ROADTYPE_ROAD);
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (AIObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 5), CMD_BUILD_LONG_ROAD); return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (AIObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 5), CMD_BUILD_LONG_ROAD);
} }
@@ -494,7 +485,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front)); EnforcePrecondition(false, ::IsValidTile(front));
EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front)); EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front));
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0);
@@ -509,7 +499,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front)); EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front));
EnforcePrecondition(false, station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id)); EnforcePrecondition(false, station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id));
EnforcePrecondition(false, road_veh_type == ROADVEHTYPE_BUS || road_veh_type == ROADVEHTYPE_TRUCK); EnforcePrecondition(false, road_veh_type == ROADVEHTYPE_BUS || road_veh_type == ROADVEHTYPE_TRUCK);
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
uint entrance_dir; uint entrance_dir;
if (drive_through) { if (drive_through) {
@@ -541,7 +530,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
EnforcePrecondition(false, ::IsValidTile(start)); EnforcePrecondition(false, ::IsValidTile(start));
EnforcePrecondition(false, ::IsValidTile(end)); EnforcePrecondition(false, ::IsValidTile(end));
EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end));
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 1 : 2) | (AIObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD); return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 1 : 2) | (AIObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD);
} }
@@ -551,7 +539,6 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
EnforcePrecondition(false, ::IsValidTile(start)); EnforcePrecondition(false, ::IsValidTile(start));
EnforcePrecondition(false, ::IsValidTile(end)); EnforcePrecondition(false, ::IsValidTile(end));
EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end));
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 2 : 1) | (AIObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD); return AIObject::DoCommand(end, start, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 2 : 1) | (AIObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD);
} }

View File

@@ -56,14 +56,6 @@ public:
ROADVEHTYPE_TRUCK, //!< Build objects useable for trucks and cargo trams ROADVEHTYPE_TRUCK, //!< Build objects useable for trucks and cargo trams
}; };
/**
* Determines whether a busstop or a truckstop is needed to transport a certain cargo.
* @param cargo_type The cargo to test.
* @pre AICargo::IsValidCargo(cargo_type).
* @return The road vehicle type needed to transport the cargo.
*/
static RoadVehicleType GetRoadVehicleTypeForCargo(CargoID cargo_type);
/** /**
* Checks whether the given tile is actually a tile with road that can be * Checks whether the given tile is actually a tile with road that can be
* used to traverse a tile. This excludes road depots and 'normal' road * used to traverse a tile. This excludes road depots and 'normal' road
@@ -134,7 +126,6 @@ public:
* center of the second tile. * center of the second tile.
* @param tile_from The source tile. * @param tile_from The source tile.
* @param tile_to The destination tile. * @param tile_to The destination tile.
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @pre AIMap::IsValidTile(tile_from). * @pre AIMap::IsValidTile(tile_from).
* @pre AIMap::IsValidTile(tile_to). * @pre AIMap::IsValidTile(tile_to).
* @pre 'tile_from' and 'tile_to' are directly neighbouring tiles. * @pre 'tile_from' and 'tile_to' are directly neighbouring tiles.
@@ -198,7 +189,6 @@ public:
* Count how many neighbours are road. * Count how many neighbours are road.
* @param tile The tile to check on. * @param tile The tile to check on.
* @pre AIMap::IsValidTile(tile). * @pre AIMap::IsValidTile(tile).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @return 0 means no neighbour road; max value is 4. * @return 0 means no neighbour road; max value is 4.
*/ */
static int32 GetNeighbourRoadCount(TileIndex tile); static int32 GetNeighbourRoadCount(TileIndex tile);
@@ -239,7 +229,6 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e. * @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or * AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end). * AIMap::GetTileY(start) == AIMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_ALREADY_BUILT * @exception AIError::ERR_ALREADY_BUILT
* @exception AIError::ERR_LAND_SLOPED_WRONG * @exception AIError::ERR_LAND_SLOPED_WRONG
* @exception AIError::ERR_AREA_NOT_CLEAR * @exception AIError::ERR_AREA_NOT_CLEAR
@@ -287,7 +276,6 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e. * @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or * AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end). * AIMap::GetTileY(start) == AIMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_ALREADY_BUILT * @exception AIError::ERR_ALREADY_BUILT
* @exception AIError::ERR_LAND_SLOPED_WRONG * @exception AIError::ERR_LAND_SLOPED_WRONG
* @exception AIError::ERR_AREA_NOT_CLEAR * @exception AIError::ERR_AREA_NOT_CLEAR
@@ -332,7 +320,6 @@ public:
* @pre AIMap::IsValidTile(tile). * @pre AIMap::IsValidTile(tile).
* @pre AIMap::IsValidTile(front). * @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it. * @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_FLAT_LAND_REQUIRED * @exception AIError::ERR_FLAT_LAND_REQUIRED
* @exception AIError::ERR_AREA_NOT_CLEAR * @exception AIError::ERR_AREA_NOT_CLEAR
* @return Whether the road depot has been/can be build or not. * @return Whether the road depot has been/can be build or not.
@@ -349,13 +336,12 @@ public:
* @pre AIMap::IsValidTile(front). * @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it. * @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id). * @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
* @pre GetCurrentRoadType() == ROADTYPE_ROAD.
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_AREA_NOT_CLEAR * @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_FLAT_LAND_REQUIRED * @exception AIError::ERR_FLAT_LAND_REQUIRED
* @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION * @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
* @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD * @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
* @exception AIError::ERR_VEHICLE_IN_THE_WAY * @exception AIError:ERR_VEHICLE_IN_THE_WAY
* @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION * @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
@@ -365,7 +351,7 @@ public:
/** /**
* Builds a drive-through road bus or truck station. * Builds a drive-through road bus or truck station.
* @param tile Place to build the station. * @param tile Place to build the depot.
* @param front A tile on the same axis with 'tile' as the station shall be oriented. * @param front A tile on the same axis with 'tile' as the station shall be oriented.
* @param road_veh_type Whether to build a truck or bus station. * @param road_veh_type Whether to build a truck or bus station.
* @param station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT. * @param station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT.
@@ -373,13 +359,12 @@ public:
* @pre AIMap::IsValidTile(front). * @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it. * @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id). * @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_AREA_NOT_CLEAR * @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_FLAT_LAND_REQUIRED * @exception AIError::ERR_FLAT_LAND_REQUIRED
* @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION * @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
* @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD * @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
* @exception AIError::ERR_VEHICLE_IN_THE_WAY * @exception AIError:ERR_VEHICLE_IN_THE_WAY
* @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION * @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
@@ -396,7 +381,6 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e. * @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or * AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end). * AIMap::GetTileY(start) == AIMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_VEHICLE_IN_THE_WAY * @exception AIError::ERR_VEHICLE_IN_THE_WAY
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS * @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
@@ -414,7 +398,6 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e. * @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or * AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end). * AIMap::GetTileY(start) == AIMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_VEHICLE_IN_THE_WAY * @exception AIError::ERR_VEHICLE_IN_THE_WAY
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS * @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS

View File

@@ -46,7 +46,6 @@ void SQAIRoad_Register(Squirrel *engine) {
AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD, "ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD"); AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD, "ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD");
AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, "ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS"); AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, "ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS");
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetRoadVehicleTypeForCargo, "GetRoadVehicleTypeForCargo", 2, ".i");
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadTile, "IsRoadTile", 2, ".i"); SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadTile, "IsRoadTile", 2, ".i");
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadDepotTile, "IsRoadDepotTile", 2, ".i"); SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadDepotTile, "IsRoadDepotTile", 2, ".i");
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadStationTile, "IsRoadStationTile", 2, ".i"); SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadStationTile, "IsRoadStationTile", 2, ".i");

View File

@@ -30,7 +30,6 @@ public:
/** /**
* Gets the maximum sign index; there are no valid signs with a higher index. * Gets the maximum sign index; there are no valid signs with a higher index.
* @deprecated This function is deprecated and might be removed in future versions of the API. Use AISignList() instead.
* @return The maximum sign index. * @return The maximum sign index.
* @post Return value is always non-negative. * @post Return value is always non-negative.
*/ */

View File

@@ -30,10 +30,10 @@ void SQAISign_Register(Squirrel *engine) {
SQAISign.DefSQStaticMethod(engine, &AISign::GetMaxSignID, "GetMaxSignID", 1, "."); SQAISign.DefSQStaticMethod(engine, &AISign::GetMaxSignID, "GetMaxSignID", 1, ".");
SQAISign.DefSQStaticMethod(engine, &AISign::IsValidSign, "IsValidSign", 2, ".i"); SQAISign.DefSQStaticMethod(engine, &AISign::IsValidSign, "IsValidSign", 2, ".i");
SQAISign.DefSQStaticMethod(engine, &AISign::SetName, "SetName", 3, ".i."); SQAISign.DefSQStaticMethod(engine, &AISign::SetName, "SetName", 3, ".is");
SQAISign.DefSQStaticMethod(engine, &AISign::GetName, "GetName", 2, ".i"); SQAISign.DefSQStaticMethod(engine, &AISign::GetName, "GetName", 2, ".i");
SQAISign.DefSQStaticMethod(engine, &AISign::GetLocation, "GetLocation", 2, ".i"); SQAISign.DefSQStaticMethod(engine, &AISign::GetLocation, "GetLocation", 2, ".i");
SQAISign.DefSQStaticMethod(engine, &AISign::BuildSign, "BuildSign", 3, ".i."); SQAISign.DefSQStaticMethod(engine, &AISign::BuildSign, "BuildSign", 3, ".is");
SQAISign.DefSQStaticMethod(engine, &AISign::RemoveSign, "RemoveSign", 2, ".i"); SQAISign.DefSQStaticMethod(engine, &AISign::RemoveSign, "RemoveSign", 2, ".i");
SQAISign.PostRegister(engine); SQAISign.PostRegister(engine);

View File

@@ -1,15 +0,0 @@
/* $Id$ */
/** @file ai_signlist.cpp Implementation of AISignList and friends. */
#include "ai_signlist.hpp"
#include "ai_sign.hpp"
#include "../../signs_base.h"
AISignList::AISignList()
{
Sign *s;
FOR_ALL_SIGNS(s) {
if (AISign::IsValidSign(s->index)) this->AddItem(s->index);
}
}

View File

@@ -1,20 +0,0 @@
/* $Id$ */
/** @file ai_signlist.hpp List all the signs of your company. */
#ifndef AI_SIGNLIST_HPP
#define AI_SIGNLIST_HPP
#include "ai_abstractlist.hpp"
/**
* Create a list of signs your company has created.
* @ingroup AIList
*/
class AISignList : public AIAbstractList {
public:
static const char *GetClassName() { return "AISignList"; }
AISignList();
};
#endif /* AI_SIGNLIST_HPP */

View File

@@ -1,21 +0,0 @@
/* $Id$ */
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
#include "ai_signlist.hpp"
namespace SQConvert {
/* Allow AISignList to be used as Squirrel parameter */
template <> AISignList *GetParam(ForceType<AISignList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AISignList *)instance; }
template <> AISignList &GetParam(ForceType<AISignList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AISignList *)instance; }
template <> const AISignList *GetParam(ForceType<const AISignList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AISignList *)instance; }
template <> const AISignList &GetParam(ForceType<const AISignList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AISignList *)instance; }
template <> int Return<AISignList *>(HSQUIRRELVM vm, AISignList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AISignList", res, NULL, DefSQDestructorCallback<AISignList>); return 1; }
}; // namespace SQConvert
void SQAISignList_Register(Squirrel *engine) {
DefSQClass <AISignList> SQAISignList("AISignList");
SQAISignList.PreRegister(engine, "AIAbstractList");
SQAISignList.AddConstructor<void (AISignList::*)(), 1>(engine, "x");
SQAISignList.PostRegister(engine);
}

View File

@@ -17,8 +17,7 @@
/* static */ bool AIStation::IsValidStation(StationID station_id) /* static */ bool AIStation::IsValidStation(StationID station_id)
{ {
const Station *st = ::IsValidStationID(station_id) ? GetStation(station_id) : NULL; return ::IsValidStationID(station_id) && ::GetStation(station_id)->owner == _current_company;
return st != NULL && (st->owner == _current_company || st->owner == OWNER_NONE);
} }
/* static */ StationID AIStation::GetStationID(TileIndex tile) /* static */ StationID AIStation::GetStationID(TileIndex tile)
@@ -55,13 +54,6 @@
return ::GetStation(station_id)->xy; return ::GetStation(station_id)->xy;
} }
/* static */ int32 AIStation::GetConstructionDate(StationID station_id)
{
if (!IsValidStation(station_id)) return -1;
return ::GetStation(station_id)->build_date;
}
/* static */ int32 AIStation::GetCargoWaiting(StationID station_id, CargoID cargo_id) /* static */ int32 AIStation::GetCargoWaiting(StationID station_id, CargoID cargo_id)
{ {
if (!IsValidStation(station_id)) return -1; if (!IsValidStation(station_id)) return -1;

View File

@@ -49,10 +49,6 @@ public:
STATION_ANY = 0x1F, //!< All station types STATION_ANY = 0x1F, //!< All station types
}; };
/**
* Special station IDs for building adjacent/new stations when
* the adjacent/distant join features are enabled.
*/
enum SpecialStationIDs { enum SpecialStationIDs {
STATION_NEW = 0xFFFD, //!< Build a new station STATION_NEW = 0xFFFD, //!< Build a new station
STATION_JOIN_ADJACENT = 0xFFFE, //!< Join an neighbouring station if one exists STATION_JOIN_ADJACENT = 0xFFFE, //!< Join an neighbouring station if one exists
@@ -102,13 +98,6 @@ public:
*/ */
static TileIndex GetLocation(StationID station_id); static TileIndex GetLocation(StationID station_id);
/**
* Get the last date a station part was added to this station.
* @param station_id The station to look at.
* @return The last date some part of this station was build.
*/
static int32 GetConstructionDate(StationID station_id);
/** /**
* See how much cargo there is waiting on a station. * See how much cargo there is waiting on a station.
* @param station_id The station to get the cargo-waiting of. * @param station_id The station to get the cargo-waiting of.

View File

@@ -57,9 +57,8 @@ void SQAIStation_Register(Squirrel *engine) {
SQAIStation.DefSQStaticMethod(engine, &AIStation::IsValidStation, "IsValidStation", 2, ".i"); SQAIStation.DefSQStaticMethod(engine, &AIStation::IsValidStation, "IsValidStation", 2, ".i");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetStationID, "GetStationID", 2, ".i"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetStationID, "GetStationID", 2, ".i");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetName, "GetName", 2, ".i"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetName, "GetName", 2, ".i");
SQAIStation.DefSQStaticMethod(engine, &AIStation::SetName, "SetName", 3, ".i."); SQAIStation.DefSQStaticMethod(engine, &AIStation::SetName, "SetName", 3, ".is");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetLocation, "GetLocation", 2, ".i"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetLocation, "GetLocation", 2, ".i");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCargoWaiting, "GetCargoWaiting", 3, ".ii"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCargoWaiting, "GetCargoWaiting", 3, ".ii");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCargoRating, "GetCargoRating", 3, ".ii"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCargoRating, "GetCargoRating", 3, ".ii");
SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCoverageRadius, "GetCoverageRadius", 2, ".i"); SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCoverageRadius, "GetCoverageRadius", 2, ".i");

View File

@@ -4,9 +4,6 @@
#include "ai_testmode.hpp" #include "ai_testmode.hpp"
#include "../../command_type.h" #include "../../command_type.h"
#include "../../company_base.h"
#include "../../company_func.h"
#include "../ai_instance.hpp"
bool AITestMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs) bool AITestMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs)
{ {
@@ -24,12 +21,6 @@ AITestMode::AITestMode()
AITestMode::~AITestMode() AITestMode::~AITestMode()
{ {
if (this->GetDoCommandModeInstance() != this) { assert(this->GetDoCommandModeInstance() == this);
AIInstance *instance = GetCompany(_current_company)->ai_instance;
/* Ignore this error if the AI already died. */
if (!instance->IsDead()) {
throw AI_FatalError("AITestmode object was removed while it was not the latest AI*Mode object created.");
}
}
this->SetDoCommandMode(this->last_mode, this->last_instance); this->SetDoCommandMode(this->last_mode, this->last_instance);
} }

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