mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-09-14 12:29:39 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d585b433d5 |
@@ -89,7 +89,8 @@ FILE_PATTERNS = *.c \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.h \
|
||||
*.hpp
|
||||
*.hpp \
|
||||
table/*.h
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
@@ -195,8 +196,8 @@ EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = ENABLE_NETWORK ENABLE_AI WITH_ZLIB WITH_LZO WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE
|
||||
EXPAND_AS_DEFINED =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED = DEF_COMMAND
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
|
||||
+1
-16
@@ -129,22 +129,10 @@ mrproper:
|
||||
done
|
||||
$(Q)rm -rf objs
|
||||
$(Q)rm -f Makefile Makefile.am Makefile.bundle
|
||||
$(Q)rm -f media/openttd.desktop media/openttd.desktop.install
|
||||
$(Q)rm -f media/openttd.desktop
|
||||
$(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
|
||||
# directories for bundle generation
|
||||
$(Q)rm -rf $(BUNDLE_DIR)
|
||||
$(Q)rm -rf $(BUNDLES_DIR)
|
||||
# output of profiling
|
||||
$(Q)rm -f $(BIN_DIR)/gmon.out
|
||||
# output of generating 'API' documentation
|
||||
$(Q)rm -f $(ROOT_DIR)/openttd.tag
|
||||
$(Q)rm -rf $(ROOT_DIR)/docs/source
|
||||
# output of generating AI API documentation
|
||||
$(Q)rm -f $(SRC_DIR)/ai/api/openttd.tag
|
||||
$(Q)rm -rf $(ROOT_DIR)/docs/aidocs
|
||||
# directories created by OpenTTD on regression testing
|
||||
$(Q)rm -rf $(BIN_DIR)/ai/regression/content_download $(BIN_DIR)/ai/regression/save $(BIN_DIR)/ai/regression/scenario
|
||||
distclean: mrproper
|
||||
|
||||
depend:
|
||||
@for dir in $(SRC_DIRS); do \
|
||||
@@ -162,7 +150,6 @@ run-prof: all
|
||||
|
||||
regression: all
|
||||
$(Q)cd !!BIN_DIR!! && sh ai/regression/run.sh
|
||||
test: regression
|
||||
|
||||
%.o:
|
||||
@for dir in $(SRC_DIRS); do \
|
||||
@@ -174,6 +161,4 @@ test: regression
|
||||
$(MAKE) -C $$dir $@; \
|
||||
done
|
||||
|
||||
.PHONY: test distclean mrproper clean
|
||||
|
||||
include Makefile.bundle
|
||||
|
||||
@@ -88,7 +88,6 @@ clean:
|
||||
$(Q)rm -f strgen.o string.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.* $(ENDIAN_TARGETS)
|
||||
|
||||
mrproper: clean
|
||||
$(Q)rm -rf $(BIN_DIR)/lang
|
||||
|
||||
%.lng:
|
||||
@echo '$(STAGE) No such language: $(@:%.lng=%)'
|
||||
|
||||
+1
-4
@@ -58,10 +58,7 @@ RES := $(shell mkdir -p $(BIN_DIR) $(sort $(dir $(OBJS))))
|
||||
|
||||
# Make sure endian_target.h is reasable as if it was in the src/ dir
|
||||
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR)
|
||||
CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR)
|
||||
ifdef SCRIPT_SRC_DIR
|
||||
CFLAGS_MAKEDEP += -I $(SCRIPT_SRC_DIR)
|
||||
endif
|
||||
CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SCRIPT_SRC_DIR)
|
||||
|
||||
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
|
||||
|
||||
|
||||
@@ -504,45 +504,6 @@ function Regression::EngineList()
|
||||
}
|
||||
}
|
||||
|
||||
function Regression::Prices()
|
||||
{
|
||||
print("");
|
||||
print("--Prices--");
|
||||
print(" -Rail-");
|
||||
print(" 0,BT_TRACK: " + AIRail.GetBuildCost(0, AIRail.BT_TRACK));
|
||||
print(" 0,BT_SIGNAL: " + AIRail.GetBuildCost(0, AIRail.BT_SIGNAL));
|
||||
print(" 0,BT_DEPOT: " + AIRail.GetBuildCost(0, AIRail.BT_DEPOT));
|
||||
print(" 0,BT_STATION: " + AIRail.GetBuildCost(0, AIRail.BT_STATION));
|
||||
print(" 0,BT_WAYPOINT: " + AIRail.GetBuildCost(0, AIRail.BT_WAYPOINT));
|
||||
print(" 1,BT_TRACK: " + AIRail.GetBuildCost(1, AIRail.BT_TRACK));
|
||||
print(" 1,BT_SIGNAL: " + AIRail.GetBuildCost(1, AIRail.BT_SIGNAL));
|
||||
print(" 1,BT_DEPOT: " + AIRail.GetBuildCost(1, AIRail.BT_DEPOT));
|
||||
print(" 1,BT_STATION: " + AIRail.GetBuildCost(1, AIRail.BT_STATION));
|
||||
print(" 1,BT_WAYPOINT: " + AIRail.GetBuildCost(1, AIRail.BT_WAYPOINT));
|
||||
print(" -Road-");
|
||||
print(" ROADTYPE_ROAD,BT_ROAD: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_ROAD));
|
||||
print(" ROADTYPE_ROAD,BT_DEPOT: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_DEPOT));
|
||||
print(" ROADTYPE_ROAD,BT_BUS_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_BUS_STOP));
|
||||
print(" ROADTYPE_ROAD,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_TRUCK_STOP));
|
||||
print(" ROADTYPE_TRAM,BT_ROAD: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_ROAD));
|
||||
print(" ROADTYPE_TRAM,BT_DEPOT: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_DEPOT));
|
||||
print(" ROADTYPE_TRAM,BT_BUS_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_BUS_STOP));
|
||||
print(" ROADTYPE_TRAM,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_TRUCK_STOP));
|
||||
print(" -Water-");
|
||||
print(" BT_DOCK: " + AIMarine.GetBuildCost(AIMarine.BT_DOCK));
|
||||
print(" BT_DEPOT: " + AIMarine.GetBuildCost(AIMarine.BT_DEPOT));
|
||||
print(" BT_BUOY: " + AIMarine.GetBuildCost(AIMarine.BT_BUOY));
|
||||
print(" -Tile-");
|
||||
print(" BT_FOUNDATION: " + AITile.GetBuildCost(AITile.BT_FOUNDATION));
|
||||
print(" BT_TERRAFORM: " + AITile.GetBuildCost(AITile.BT_TERRAFORM));
|
||||
print(" BT_BUILD_TREES: " + AITile.GetBuildCost(AITile.BT_BUILD_TREES));
|
||||
print(" BT_CLEAR_GRASS: " + AITile.GetBuildCost(AITile.BT_CLEAR_GRASS));
|
||||
print(" BT_CLEAR_ROUGH: " + AITile.GetBuildCost(AITile.BT_CLEAR_ROUGH));
|
||||
print(" BT_CLEAR_ROCKY: " + AITile.GetBuildCost(AITile.BT_CLEAR_ROCKY));
|
||||
print(" BT_CLEAR_FIELDS: " + AITile.GetBuildCost(AITile.BT_CLEAR_FIELDS));
|
||||
print(" BT_CLEAR_HOUSE: " + AITile.GetBuildCost(AITile.BT_CLEAR_HOUSE));
|
||||
}
|
||||
|
||||
function cost_callback(old_path, new_tile, new_direction, self) { if (old_path == null) return 0; return old_path.GetCost() + 1; }
|
||||
function estimate_callback(tile, direction, goals, self) { return goals[0] - tile; }
|
||||
function neighbours_callback(path, cur_tile, self) { return [[cur_tile + 1, 1]]; }
|
||||
@@ -920,15 +881,6 @@ function Regression::Order()
|
||||
print(" UnshareOrders(): " + AIOrder.UnshareOrders(13));
|
||||
print(" AppendOrder(): " + AIOrder.AppendOrder(12, 33421, AIOrder.AIOF_NONE));
|
||||
|
||||
print(" GetStopLocation(): " + AIOrder.GetStopLocation(13, 0));
|
||||
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(23596, 8));
|
||||
print(" BuildRailStation(): " + AIRail.BuildRailStation(7958, AIRail.RAILTRACK_NE_SW, 1, 1, AIStation.STATION_NEW));
|
||||
print(" AppendOrder(): " + AIOrder.AppendOrder(20, 7958, AIOrder.AIOF_NONE));
|
||||
print(" GetOrderCount(): " + AIOrder.GetOrderCount(20));
|
||||
print(" GetStopLocation(): " + AIOrder.GetStopLocation(20, 0));
|
||||
print(" SetStopLocation(): " + AIOrder.SetStopLocation(20, 0, AIOrder.STOPLOCATION_MIDDLE));
|
||||
print(" GetStopLocation(): " + AIOrder.GetStopLocation(20, 0));
|
||||
|
||||
local list = AIStationList_Vehicle(12);
|
||||
|
||||
print("");
|
||||
@@ -1033,7 +985,6 @@ function Regression::Rail()
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
}
|
||||
print(" RemoveDepot(): " + AITile.DemolishTile(33411));
|
||||
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(23596, 23597));
|
||||
|
||||
print(" Station");
|
||||
print(" BuildRailStation(): " + AIRail.BuildRailStation(0, AIRail.RAILTRACK_NE_SW, 1, 1, AIStation.STATION_NEW));
|
||||
@@ -1748,7 +1699,6 @@ function Regression::Start()
|
||||
this.IndustryTypeList();
|
||||
this.Map();
|
||||
this.Marine();
|
||||
this.Prices();
|
||||
this.Rail();
|
||||
this.RailTypeList();
|
||||
this.Road();
|
||||
|
||||
@@ -584,7 +584,7 @@
|
||||
GetBankBalance(): 100000
|
||||
GetName(): (null : 0x00000000)
|
||||
GetLoanAmount(): 100000
|
||||
GetMaxLoanAmount(): 500000
|
||||
GetMaxLoanAmount(): 2000000000
|
||||
GetLoanInterval(): 10000
|
||||
SetLoanAmount(1): false
|
||||
SetLoanAmount(100): false
|
||||
@@ -596,8 +596,8 @@
|
||||
GetBankBalance(): 40000
|
||||
GetLoanAmount(): 40000
|
||||
SetLoanAmount(10000): true
|
||||
GetBankBalance(): 500000
|
||||
GetLoanAmount(): 500000
|
||||
GetBankBalance(): 2000000000
|
||||
GetLoanAmount(): 2000000000
|
||||
GetCompanyHQ(): -1
|
||||
BuildCompanyHQ(): true
|
||||
GetCompanyHQ(): 33151
|
||||
@@ -681,7 +681,7 @@
|
||||
GetAirportWidth(9): -1
|
||||
GetAirportHeight(9): -1
|
||||
GetAirportCoverageRadius(9): -1
|
||||
GetBankBalance(): 499790
|
||||
GetBankBalance(): 1999999790
|
||||
GetPrice(): 5400
|
||||
BuildAirport(): true
|
||||
IsHangarTile(): false
|
||||
@@ -691,11 +691,11 @@
|
||||
IsHangarTile(): true
|
||||
IsAirportTile(): true
|
||||
GetAirportType(): 0
|
||||
GetBankBalance(): 489890
|
||||
GetBankBalance(): 1999989890
|
||||
RemoveAirport(): true
|
||||
IsHangarTile(): false
|
||||
IsAirportTile(): false
|
||||
GetBankBalance(): 489626
|
||||
GetBankBalance(): 1999989626
|
||||
BuildAirport(): true
|
||||
|
||||
--Bridge--
|
||||
@@ -7085,7 +7085,7 @@
|
||||
IsBuoyTile(): false
|
||||
IsLockTile(): false
|
||||
IsCanalTile(): false
|
||||
GetBankBalance(): 480703
|
||||
GetBankBalance(): 1999980703
|
||||
BuildWaterDepot(): true
|
||||
BuildDock(): true
|
||||
BuildBuoy(): true
|
||||
@@ -7098,7 +7098,7 @@
|
||||
IsBuoyTile(): true
|
||||
IsLockTile(): true
|
||||
IsCanalTile(): true
|
||||
GetBankBalance(): 451154
|
||||
GetBankBalance(): 1999951154
|
||||
|
||||
--AIWaypointList(BUOY)--
|
||||
Count(): 1
|
||||
@@ -7117,45 +7117,10 @@
|
||||
IsBuoyTile(): false
|
||||
IsLockTile(): false
|
||||
IsCanalTile(): false
|
||||
GetBankBalance(): 428509
|
||||
GetBankBalance(): 1999928509
|
||||
BuildWaterDepot(): true
|
||||
BuildDock(): true
|
||||
|
||||
--Prices--
|
||||
-Rail-
|
||||
0,BT_TRACK: 75
|
||||
0,BT_SIGNAL: 48
|
||||
0,BT_DEPOT: 450
|
||||
0,BT_STATION: 285
|
||||
0,BT_WAYPOINT: 450
|
||||
1,BT_TRACK: -1
|
||||
1,BT_SIGNAL: -1
|
||||
1,BT_DEPOT: -1
|
||||
1,BT_STATION: -1
|
||||
1,BT_WAYPOINT: -1
|
||||
-Road-
|
||||
ROADTYPE_ROAD,BT_ROAD: 71
|
||||
ROADTYPE_ROAD,BT_DEPOT: 375
|
||||
ROADTYPE_ROAD,BT_BUS_STOP: 150
|
||||
ROADTYPE_ROAD,BT_TRUCK_STOP: 150
|
||||
ROADTYPE_TRAM,BT_ROAD: -1
|
||||
ROADTYPE_TRAM,BT_DEPOT: -1
|
||||
ROADTYPE_TRAM,BT_BUS_STOP: -1
|
||||
ROADTYPE_TRAM,BT_TRUCK_STOP: -1
|
||||
-Water-
|
||||
BT_DOCK: 262
|
||||
BT_DEPOT: 525
|
||||
BT_BUOY: 262
|
||||
-Tile-
|
||||
BT_FOUNDATION: 187
|
||||
BT_TERRAFORM: 187
|
||||
BT_BUILD_TREES: 15
|
||||
BT_CLEAR_GRASS: 15
|
||||
BT_CLEAR_ROUGH: 30
|
||||
BT_CLEAR_ROCKY: 150
|
||||
BT_CLEAR_FIELDS: 375
|
||||
BT_CLEAR_HOUSE: 1200
|
||||
|
||||
--Rail--
|
||||
IsRailTile(): false
|
||||
BuildRailTrack(): true
|
||||
@@ -7179,7 +7144,6 @@
|
||||
Depot distance from (0,0) ListDump:
|
||||
33411 => 261
|
||||
RemoveDepot(): true
|
||||
BuildRailDepot(): true
|
||||
Station
|
||||
BuildRailStation(): false
|
||||
BuildRailStation(): true
|
||||
@@ -8566,14 +8530,6 @@
|
||||
ShareOrders(): true
|
||||
UnshareOrders(): true
|
||||
AppendOrder(): true
|
||||
GetStopLocation(): -1
|
||||
BuildVehicle(): 20
|
||||
BuildRailStation(): true
|
||||
AppendOrder(): true
|
||||
GetOrderCount(): 1
|
||||
GetStopLocation(): 2
|
||||
SetStopLocation(): true
|
||||
GetStopLocation(): 1
|
||||
|
||||
--StationList_Vehicle--
|
||||
Count(): 2
|
||||
@@ -8600,11 +8556,9 @@
|
||||
4 => 0
|
||||
|
||||
--VehicleList_Station--
|
||||
Count(): 1
|
||||
Count(): 0
|
||||
Location ListDump:
|
||||
20 => 23596
|
||||
foreach():
|
||||
20 => 23596
|
||||
|
||||
First Subsidy Test
|
||||
--Subsidy (0) --
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ old_3 = GM_TT12.GM
|
||||
old_4 = GM_TT08.GM
|
||||
old_5 = GM_TT13.GM
|
||||
old_6 = GM_TT14.GM
|
||||
old_7 = GM_TT10.GM
|
||||
old_7 = GM_TT19.GM
|
||||
old_8 =
|
||||
old_9 =
|
||||
new_0 = GM_TT04.GM
|
||||
|
||||
@@ -1,74 +1,3 @@
|
||||
1.0.0-RC1 (2010-02-18)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Allow to select different land colours for the smallmap (r19064)
|
||||
- Feature: [NewGRF] Action 3/2/1 (i.e. new graphics) support for rail types (r19056)
|
||||
- Feature: Add zoom-out to smallmap (r19039)
|
||||
- Add: [NoAI] AIOrder::[G|S]etStopLocation to get/set the stop location of trains in a rail station (r19014)
|
||||
- Change: Move home directory to a better place in Haiku [FS#3625] (r19151)
|
||||
- Change: Do not load the 'new game' NewGRFs when you are certain the savegame would not have been saved with them, i.e. do not load the 'new game' NewGRFs for TTO savegames (r19044)
|
||||
- Fix: Invisible depots draw the track, so also draw the overlays (r19154)
|
||||
- Fix: [v]seprintf should return the number of added characters excluding '\0' on truncation [FS#3627] (r19149, r19148)
|
||||
- Fix: [YAPF] Look-ahead for multitile waypoints 'made up' data that should not go into the cache, causing desyncs in MP [FS#3619] (r19141)
|
||||
- Fix: Report a more useful error when failing to build a bubble generator (r19137)
|
||||
- Fix: Resize station cargo widget when needed to display all accepted cargo types [FS#3617] (r19123)
|
||||
- Fix: [NewGRF] Industry property 0x17 was interpreted incorrectly and in some cases circumvented the density difficulty setting (r19120)
|
||||
- Fix: removing towns (in the scenario editor) that had stations/depots refer to them or vehicles were on the town's road could cause a crash [FS#3616] (r19119)
|
||||
- Fix: In the order window the Non-stop dropdown was not enabled for depot and waypoint orders and some buttons were raised too soon [FS#3593] (r19118, r19117)
|
||||
- Fix: Do not crash on broken lng file and prevent it from happening again [FS#3611] (r19113, r19112)
|
||||
- Fix: Not all news data was properly freed when starting a new game [FS#3614] (r19105)
|
||||
- Fix: The BeMidi driver was broken [FS#3610] (r19097)
|
||||
- Fix: Crash when one of the items in the news_display group in the config file has no value (r19096)
|
||||
- Fix: Crash when a baseset has an empty metadata field (r19095)
|
||||
- Fix: Possible read/write after free when the client triggered the server to close the connection [FS#3599] (r19072)
|
||||
- Fix: Remove Bidi control characters from the reordered text so they are not drawn [FS#3604] (r19067)
|
||||
- Fix: [NewGRF] Settings that are part of the "TTPatch flags" can cause desyncs if they are changed in network games (r19066)
|
||||
- Fix: When banning yourself via rcon do not send the 'command response' to the client as the connection has already been terminated [FS#3598] (r19054)
|
||||
- Fix: Mass stopping/starting/autoreplacing gave empty errors when there were no vehicles [FS#3577] (r19024)
|
||||
- Fix: City airport introduction date had become 5 years later (r19023)
|
||||
- Fix: Loading old (0.1-ish) savegames failed (r19022)
|
||||
- Fix: Do not NULL the pointers when saving the savegame on an error during saving; the savegame is still valid, so do not make it invalid [FS#3570] (r19021)
|
||||
- Fix: When removing roads, the player was also charged for removing the foundations [FS#3591] (r19016)
|
||||
|
||||
|
||||
1.0.0-beta4 (2010-02-04)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Content mirroring support (r18994)
|
||||
- Feature: Show empty query after creating new group (instead of 'Group nnn') (r18981)
|
||||
- Feature: [NewGRF] NewGRF-settable rail type properties, increase number of possible rail types, per rail type speed limits (r18970, r18969)
|
||||
- Feature: [NewGRF] Allow layering of multiple groundsprites in spritelayouts of stations, houses and industrytiles; so hacks with zero-sized bounding boxes are no longer needed and no longer cause trouble (r18959)
|
||||
- Feature: [NoAI] Introduce GetBuildCost functions in several classes to get easier cost estimations before you start building (r18955)
|
||||
- Feature: [NoAI] Allow editing AI settings while an AI is running (r18953)
|
||||
- Feature: Make it possible to change newgame settings from within a game via the console (use setting_newgame instead of setting) [FS#2885] (r18943)
|
||||
- Feature: Add a setting to reduce/disable aircraft crashes [FS#2678] (r18942)
|
||||
- Feature: Make the crash position of aircraft a bit random by giving aircraft a chance to crash every tick they are breaking (r18940)
|
||||
- Change: [NoAI] Use the highest version of an AI that can load the AI data from a savegame instead of the exact same version [FS#3232] (r18944)
|
||||
- Fix: Off-by-one in the music playlist (song missing) [FS#3588] (r18997)
|
||||
- Fix: [NewGRF] industry var A5 (=high 8 bits of var A4) returned the high 8 bits of var A2. Same problem for 9B/9A/98 (r18988)
|
||||
- Fix: [NoAI] Make building long rails fail for AIs if there is an obstacle in the way (r18987)
|
||||
- Fix: Possible invalid memory access when merging companies [FS#3584] (r18978)
|
||||
- Fix: Estimating the cost of removing statues could clear the presence flag in the town (r18976)
|
||||
- Fix: CMD_BUILD_ROAD missed CMD_AUTO. Also do not access tiles anymore after clearing them; that fails either in test or exec run [FS#3578] (r18974)
|
||||
- Fix: Train acceleration for original acceleration model was not updated if the train's power changed (r18971)
|
||||
- Fix: Make sure the values of settings loaded from a savegame are valid (r18950)
|
||||
- Fix: After clicking move up/move down in the NewGRF/AI the selected item could be out of range [FS#1510] (r18948, r18947)
|
||||
- Fix: It was possible to change AI settings without changing to the custom difficulty level by using the query text window (r18946)
|
||||
- Fix: Remove the loading indicators as soon as a train crashes [FS#3575] (r18941)
|
||||
- Fix: [NewGRF] Industrylayout's special water tile check did not properly check for crossing north border of map (r18938)
|
||||
- Fix: [NewGRF] Value of variables 90 and 91 were not what NARS expects [FS#3551] (r18935)
|
||||
- Fix: [Windows] In some rare case a deadlock could happen when stopping sound driver (r18934, r18913, r18892)
|
||||
- Fix: [NoAI] Autoreplace is also valid for the default group (r18930)
|
||||
- Fix: Preserve some timetable related vehicle flags during autorenew/-replace [FS#3568] (r18929)
|
||||
- Fix: AIOrder::GetOrderDestination could return a non-waypoint tile when the waypoint was a multitile waypoint [NoAI] (r18924)
|
||||
- Fix: On bankruptcy the company value did include the loan and as such the value at which you bought the company was too low [FS#3561] (r18908)
|
||||
- Fix: Writing LZO-compressed savegames would produce invalid files and potentially overwrite memory (r18904)
|
||||
- Fix: [Windows] File locations for Windows were not documented correctly for all versions of Windows [FS#3562] (r18903)
|
||||
- Fix: Pressing cancel for the query windows of the world generation window caused the default to be set instead of no changes to the value [FS#3558] (r18896)
|
||||
- Fix: Avoid duplicate path separator when searching for PNG files which prevented tar-lookups (r18891)
|
||||
- Fix: [NewGRF] Perform bounds checking for all NewGRF data reads. Explicit length checks (which were not always correct) are no longer needed so these are removed to simplify code (r18884)
|
||||
- Fix: Aircraft can be send to an hangar when the target airport has one and when it can land, not only when it has a plane terminal (r18880)
|
||||
- Fix: [NewGRF] Crash when a NewGRF used var62 in an industry tile chain when the industry tile was part of an original industry (r18878)
|
||||
|
||||
|
||||
1.0.0-beta3 (2010-01-21)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Make building (long) roads work like building rail; build upon the first obstruction instead of failing totally [FS#3318] (r18803)
|
||||
|
||||
+19
-28
@@ -11,7 +11,7 @@ log() {
|
||||
}
|
||||
|
||||
set_default() {
|
||||
released_version="1.0.0-RC1"
|
||||
released_version="1.0.0-beta3"
|
||||
|
||||
ignore_extra_parameters="0"
|
||||
# We set all kinds of defaults for params. Later on the user can override
|
||||
@@ -51,7 +51,6 @@ set_default() {
|
||||
enable_lto="0"
|
||||
enable_dedicated="0"
|
||||
enable_network="1"
|
||||
enable_ai="1"
|
||||
enable_static="1"
|
||||
enable_translator="0"
|
||||
enable_unicode="1"
|
||||
@@ -123,7 +122,6 @@ set_default() {
|
||||
enable_lto
|
||||
enable_dedicated
|
||||
enable_network
|
||||
enable_ai
|
||||
enable_static
|
||||
enable_translator
|
||||
enable_unicode
|
||||
@@ -276,12 +274,8 @@ detect_params() {
|
||||
--enable-ipo=*) enable_lto="$optarg";;
|
||||
--enable-dedicated) enable_dedicated="1";;
|
||||
--enable-dedicated=*) enable_dedicated="$optarg";;
|
||||
--enable-network) enable_network="2";;
|
||||
--enable-network=*) enable_network="$optarg";;
|
||||
--disable-network) enable_network="0";;
|
||||
--enable-ai) enable_ai="2";;
|
||||
--enable-ai=*) enable_ai="$optarg";;
|
||||
--disable-ai) enable_ai="0";;
|
||||
--disable-static) enable_static="0";;
|
||||
--enable-static) enable_static="2";;
|
||||
--enable-static=*) enable_static="$optarg";;
|
||||
@@ -718,14 +712,6 @@ check_params() {
|
||||
log 1 "checking network... disabled"
|
||||
fi
|
||||
|
||||
if [ "$enable_ai" != "0" ]; then
|
||||
log 1 "checking ai... found"
|
||||
SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
|
||||
else
|
||||
log 1 "checking ai... disabled"
|
||||
SCRIPT_SRC_DIR=""
|
||||
fi
|
||||
|
||||
if [ "$enable_translator" != "0" ]; then
|
||||
log 1 "checking translator... debug"
|
||||
# -t shows TODO items, normally they are muted
|
||||
@@ -741,6 +727,15 @@ check_params() {
|
||||
log 1 "checking assert... disabled"
|
||||
fi
|
||||
|
||||
SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
|
||||
if [ ! -d "$SCRIPT_SRC_DIR" ]; then
|
||||
log 1 "checking 3rdparty... NOT FOUND"
|
||||
log 1 "ERROR: please make sure you have src/3rdparty/squirrel"
|
||||
log 1 "ERROR: you can find the source at svn://svn.openttd.org/3rdparty/squirrel"
|
||||
exit 1
|
||||
fi
|
||||
log 1 "checking 3rdparty... found"
|
||||
|
||||
pre_detect_with_zlib=$with_zlib
|
||||
detect_zlib
|
||||
|
||||
@@ -1018,7 +1013,7 @@ check_params() {
|
||||
fi
|
||||
|
||||
if [ "$personal_dir" = "1" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ] || [ "$os" = "DOS" ] || [ "$os" == "HAIKU" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ] || [ "$os" = "DOS" ]; then
|
||||
personal_dir="OpenTTD"
|
||||
elif [ "$os" = "OSX" ]; then
|
||||
personal_dir="Documents/OpenTTD"
|
||||
@@ -1150,8 +1145,8 @@ make_compiler_cflags() {
|
||||
# Enable some things only for certain GCC versions
|
||||
cc_version=`$1 -dumpversion | cut -c 1,3`
|
||||
|
||||
if [ $cc_version -lt 33 ]; then
|
||||
log 1 "configure: error: gcc older than 3.3 can't compile OpenTTD because of its poor template support"
|
||||
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
|
||||
|
||||
@@ -1433,9 +1428,7 @@ make_cflags_and_ldflags() {
|
||||
if [ "$cpu_type" = "64" ] && [ "$enable_universal" = "0" ]; then
|
||||
CFLAGS="$CFLAGS -D_SQ64"
|
||||
fi
|
||||
if [ "$enable_ai" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR -DENABLE_AI"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR"
|
||||
|
||||
if [ -n "$png_config" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_PNG"
|
||||
@@ -1649,7 +1642,7 @@ check_compiler() {
|
||||
fi
|
||||
machine=`eval $compiler $9 2>/dev/null`
|
||||
ret=$?
|
||||
eval "$2=\"$compiler\""
|
||||
eval "$2=$compiler"
|
||||
|
||||
log 2 "executing $compiler $9"
|
||||
log 2 " returned $machine"
|
||||
@@ -1670,7 +1663,7 @@ check_compiler() {
|
||||
# Check for manual compiler
|
||||
machine=`$4 $9 2>/dev/null`
|
||||
ret=$?
|
||||
eval "$2=\"$4\""
|
||||
eval "$2=$4"
|
||||
|
||||
log 2 "executing $4 $9"
|
||||
log 2 " returned $machine"
|
||||
@@ -1687,7 +1680,7 @@ check_compiler() {
|
||||
if [ -n "$5" ]; then
|
||||
machine=`$5 $9 2>/dev/null`
|
||||
ret=$?
|
||||
eval "$2=\"$5\""
|
||||
eval "$2=$5"
|
||||
|
||||
log 2 "executing $5 $9"
|
||||
log 2 " returned $machine"
|
||||
@@ -1706,7 +1699,7 @@ check_compiler() {
|
||||
# No $5, so try '$6'
|
||||
machine=`$6 $9 2>/dev/null`
|
||||
ret=$?
|
||||
eval "$2=\"$6\""
|
||||
eval "$2=$6"
|
||||
|
||||
log 2 "executing $6 $9"
|
||||
log 2 " returned $machine"
|
||||
@@ -1716,7 +1709,7 @@ check_compiler() {
|
||||
# Maybe '$7'?
|
||||
machine=`$7 $9 2>/dev/null`
|
||||
ret=$?
|
||||
eval "$2=\"$7\""
|
||||
eval "$2=$7"
|
||||
|
||||
log 2 "executing $7 $9"
|
||||
log 2 " returned $machine"
|
||||
@@ -3172,8 +3165,6 @@ showhelp() {
|
||||
echo " --with-psp-config[=psp-config] enables psp-config support (PSP ONLY)"
|
||||
echo " --disable-builtin-depend disable use of builtin deps finder"
|
||||
echo " --with-makedepend[=makedepend] enables makedepend support"
|
||||
echo " --with-ccache enables ccache support"
|
||||
echo " --with-distcc enables distcc support"
|
||||
echo ""
|
||||
echo "Some influential environment variables:"
|
||||
echo " CC C compiler command"
|
||||
|
||||
@@ -113,7 +113,6 @@ AWKCOMMAND='
|
||||
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
||||
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
||||
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
|
||||
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
|
||||
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
|
||||
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
|
||||
if ($0 == "BEOS" && "'$os'" != "BEOS" &&
|
||||
|
||||
+12
-12
@@ -91,7 +91,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
@@ -102,7 +102,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
@@ -113,7 +113,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span>X <span class="free">O</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
@@ -136,7 +136,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX<span class="free"> OOO</span>X</td>
|
||||
<td class="bits">XXXX X<span class="free">O</span>XX</td>
|
||||
@@ -146,7 +146,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="caption">road depot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
@@ -183,7 +183,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
@@ -206,7 +206,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span>X XXXX</td>
|
||||
@@ -217,7 +217,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
@@ -228,7 +228,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
@@ -239,7 +239,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
@@ -250,7 +250,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
@@ -308,7 +308,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OO</span>X XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl efhx
|
||||
.Op Fl a Ar ai
|
||||
.Op Fl b Ar blitter
|
||||
.Op Fl c Ar config_file
|
||||
.Op Fl d Ar [level | cat=lvl[,...]]
|
||||
@@ -29,6 +30,10 @@
|
||||
.Op Fl v Ar driver
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width ".Fl n Ar host[:port][#player]"
|
||||
.It Fl a Ar ai
|
||||
Set the AI, see
|
||||
.Fl h
|
||||
for a full list
|
||||
.It Fl b Ar blitter
|
||||
Set the blitter, see
|
||||
.Fl h
|
||||
|
||||
+5
-3
@@ -1,6 +1,6 @@
|
||||
OpenTTD's known bugs
|
||||
Last updated: 2010-02-18
|
||||
Release version: 1.0.0-RC1
|
||||
Last updated: 2010-01-21
|
||||
Release version: 1.0.0-beta3
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -35,9 +35,11 @@ If the bugs are closed but still listed here it means that the bug is fixed
|
||||
and that the nightlies and next major release will not have that bug.
|
||||
|
||||
- 3447 [OSX] SDL port is unuseable
|
||||
- 3194 [OSX] Full screen strobing/flickering
|
||||
- 2782 [OSX] Port hopelessly outdated
|
||||
- 2585 [OSX] OS' mouse pointer showing
|
||||
- 2484 [OSX] Cannot enter CJK characters
|
||||
- 1140 [OSX] Not smooth moving map with touchpad
|
||||
|
||||
|
||||
3) Known bugs that will not be solved:
|
||||
@@ -142,7 +144,7 @@ Extreme CPU usage/hangs when using SDL and PulseAudio [FS#3294]
|
||||
use of interrupt-based scheduling may resolve sound problems for
|
||||
some users. Under recent versions of Ubuntu Linux (9.04 and higher)
|
||||
this can be accomplished by changing the following line in the
|
||||
/etc/pulse/default.pa file:
|
||||
/etc/pulsa/default.pa file:
|
||||
load-module module-udev-detect
|
||||
to
|
||||
load-module module-udev-detect tsched=0
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
openttd (1.0.0~RC1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 18 Feb 2010 00:01:02 +0100
|
||||
|
||||
openttd (1.0.0~beta4) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 04 Feb 2010 18:36:02 +0100
|
||||
|
||||
openttd (1.0.0~beta3) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set OPENTTD_VERSION=1.0.0-RC1
|
||||
set OPENTTD_VERSION=1.0.0-beta3
|
||||
set OPENSFX_VERSION=0.8.0
|
||||
set NOSOUND_VERSION=0.8.0
|
||||
set OPENGFX_VERSION=0.7.0
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
!define APPV_MAJOR 1
|
||||
!define APPV_MINOR 0
|
||||
!define APPV_MAINT 0
|
||||
!define APPV_BUILD 4
|
||||
!define APPV_EXTRA "-RC1"
|
||||
!define APPV_BUILD 2
|
||||
!define APPV_EXTRA "-beta3"
|
||||
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
|
||||
|
||||
@@ -39,7 +39,7 @@ Sub UpdateFiles(version)
|
||||
modified = Mid(version, InStrRev(version, Chr(9)) + 1)
|
||||
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
|
||||
Else
|
||||
version = "1.0.0-RC1"
|
||||
version = "1.0.0-beta3"
|
||||
revision = 0
|
||||
modified = 1
|
||||
End If
|
||||
|
||||
+1
-3
@@ -40,7 +40,6 @@ sdl_config="1"
|
||||
png_config="1"
|
||||
os="MSVC"
|
||||
enable_dedicated="0"
|
||||
enable_ai="1"
|
||||
with_cocoa="0"
|
||||
enable_directmusic="1"
|
||||
with_threads="1"
|
||||
@@ -95,7 +94,6 @@ load_main_data() {
|
||||
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
||||
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
|
||||
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
|
||||
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
|
||||
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
|
||||
if ($0 == "BEOS" && "'$os'" != "BEOS") { next; }
|
||||
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
|
||||
@@ -161,7 +159,7 @@ load_lang_data() {
|
||||
<Tool
|
||||
Name=\"VCCustomBuildTool\"
|
||||
Description=\"Generating "$i" language file\"
|
||||
CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang "\$(InputPath)"
exit 0\"
|
||||
CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang "\$(InputPath)"
\"
|
||||
AdditionalDependencies=\"..\\src\\lang\\english.txt\"
|
||||
Outputs=\"..\\bin\\lang\\"$i".lng\"
|
||||
/>
|
||||
|
||||
@@ -158,7 +158,6 @@ Function load_main_data(filename)
|
||||
line = "WIN32" Or _
|
||||
line = "MSVC" Or _
|
||||
line = "DIRECTMUSIC" Or _
|
||||
line = "AI" Or _
|
||||
line = "HAVE_THREAD" _
|
||||
) Then skip = skip + 1
|
||||
deep = deep + 1
|
||||
@@ -210,7 +209,7 @@ Function load_lang_data(dir)
|
||||
& vbCrLf & " <Tool" _
|
||||
& vbCrLf & " Name=" & Chr(34) & "VCCustomBuildTool" & Chr(34) _
|
||||
& vbCrLf & " Description=" & Chr(34) & "Generating " & file & " language file" & Chr(34) _
|
||||
& vbCrLf & " CommandLine=" & Chr(34) & "..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0" & Chr(34) _
|
||||
& vbCrLf & " CommandLine=" & Chr(34) & "..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
" & Chr(34) _
|
||||
& vbCrLf & " AdditionalDependencies=" & Chr(34) & "..\src\lang\english.txt" & Chr(34) _
|
||||
& vbCrLf & " Outputs=" & Chr(34) & "..\bin\lang\" & file & ".lng" & Chr(34) _
|
||||
& vbCrLf & " />" _
|
||||
|
||||
+45
-60
@@ -55,7 +55,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating afrikaans language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\afrikaans.lng"
|
||||
/>
|
||||
@@ -70,7 +70,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating arabic_egypt language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\arabic_egypt.lng"
|
||||
/>
|
||||
@@ -85,7 +85,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating brazilian_portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\brazilian_portuguese.lng"
|
||||
/>
|
||||
@@ -100,7 +100,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating bulgarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\bulgarian.lng"
|
||||
/>
|
||||
@@ -115,7 +115,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating catalan language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\catalan.lng"
|
||||
/>
|
||||
@@ -130,7 +130,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating croatian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\croatian.lng"
|
||||
/>
|
||||
@@ -145,7 +145,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating czech language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\czech.lng"
|
||||
/>
|
||||
@@ -160,7 +160,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating danish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\danish.lng"
|
||||
/>
|
||||
@@ -175,7 +175,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating dutch language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\dutch.lng"
|
||||
/>
|
||||
@@ -190,7 +190,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\english.lng"
|
||||
/>
|
||||
@@ -205,7 +205,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english_US language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\english_US.lng"
|
||||
/>
|
||||
@@ -220,7 +220,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating esperanto language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\esperanto.lng"
|
||||
/>
|
||||
@@ -235,7 +235,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating estonian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\estonian.lng"
|
||||
/>
|
||||
@@ -250,7 +250,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating finnish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\finnish.lng"
|
||||
/>
|
||||
@@ -265,7 +265,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating french language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\french.lng"
|
||||
/>
|
||||
@@ -280,7 +280,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating galician language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\galician.lng"
|
||||
/>
|
||||
@@ -295,7 +295,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating german language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\german.lng"
|
||||
/>
|
||||
@@ -310,7 +310,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating greek language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\greek.lng"
|
||||
/>
|
||||
@@ -325,7 +325,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating hebrew language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\hebrew.lng"
|
||||
/>
|
||||
@@ -340,7 +340,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating hungarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\hungarian.lng"
|
||||
/>
|
||||
@@ -355,7 +355,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating icelandic language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\icelandic.lng"
|
||||
/>
|
||||
@@ -370,7 +370,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating indonesian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\indonesian.lng"
|
||||
/>
|
||||
@@ -385,7 +385,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating italian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\italian.lng"
|
||||
/>
|
||||
@@ -400,7 +400,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating japanese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\japanese.lng"
|
||||
/>
|
||||
@@ -415,7 +415,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating korean language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\korean.lng"
|
||||
/>
|
||||
@@ -430,7 +430,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating latvian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\latvian.lng"
|
||||
/>
|
||||
@@ -445,7 +445,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating lithuanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\lithuanian.lng"
|
||||
/>
|
||||
@@ -460,7 +460,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating luxembourgish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\luxembourgish.lng"
|
||||
/>
|
||||
@@ -475,7 +475,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating malay language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\malay.lng"
|
||||
/>
|
||||
@@ -490,7 +490,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_bokmal language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\norwegian_bokmal.lng"
|
||||
/>
|
||||
@@ -505,7 +505,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_nynorsk language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\norwegian_nynorsk.lng"
|
||||
/>
|
||||
@@ -520,7 +520,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating polish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\polish.lng"
|
||||
/>
|
||||
@@ -535,7 +535,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\portuguese.lng"
|
||||
/>
|
||||
@@ -550,7 +550,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating romanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\romanian.lng"
|
||||
/>
|
||||
@@ -565,7 +565,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating russian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\russian.lng"
|
||||
/>
|
||||
@@ -580,7 +580,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating serbian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\serbian.lng"
|
||||
/>
|
||||
@@ -595,7 +595,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating simplified_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\simplified_chinese.lng"
|
||||
/>
|
||||
@@ -610,7 +610,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovak language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\slovak.lng"
|
||||
/>
|
||||
@@ -625,7 +625,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovenian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\slovenian.lng"
|
||||
/>
|
||||
@@ -640,7 +640,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating spanish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\spanish.lng"
|
||||
/>
|
||||
@@ -655,7 +655,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating swedish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\swedish.lng"
|
||||
/>
|
||||
@@ -670,7 +670,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating traditional_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\traditional_chinese.lng"
|
||||
/>
|
||||
@@ -685,7 +685,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating turkish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\turkish.lng"
|
||||
/>
|
||||
@@ -700,27 +700,12 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating ukrainian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\ukrainian.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\vietnamese.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating vietnamese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\vietnamese.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\welsh.txt"
|
||||
>
|
||||
@@ -730,7 +715,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating welsh language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\welsh.lng"
|
||||
/>
|
||||
|
||||
+45
-60
@@ -56,7 +56,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating afrikaans language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\afrikaans.lng"
|
||||
/>
|
||||
@@ -71,7 +71,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating arabic_egypt language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\arabic_egypt.lng"
|
||||
/>
|
||||
@@ -86,7 +86,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating brazilian_portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\brazilian_portuguese.lng"
|
||||
/>
|
||||
@@ -101,7 +101,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating bulgarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\bulgarian.lng"
|
||||
/>
|
||||
@@ -116,7 +116,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating catalan language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\catalan.lng"
|
||||
/>
|
||||
@@ -131,7 +131,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating croatian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\croatian.lng"
|
||||
/>
|
||||
@@ -146,7 +146,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating czech language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\czech.lng"
|
||||
/>
|
||||
@@ -161,7 +161,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating danish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\danish.lng"
|
||||
/>
|
||||
@@ -176,7 +176,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating dutch language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\dutch.lng"
|
||||
/>
|
||||
@@ -191,7 +191,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\english.lng"
|
||||
/>
|
||||
@@ -206,7 +206,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english_US language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\english_US.lng"
|
||||
/>
|
||||
@@ -221,7 +221,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating esperanto language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\esperanto.lng"
|
||||
/>
|
||||
@@ -236,7 +236,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating estonian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\estonian.lng"
|
||||
/>
|
||||
@@ -251,7 +251,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating finnish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\finnish.lng"
|
||||
/>
|
||||
@@ -266,7 +266,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating french language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\french.lng"
|
||||
/>
|
||||
@@ -281,7 +281,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating galician language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\galician.lng"
|
||||
/>
|
||||
@@ -296,7 +296,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating german language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\german.lng"
|
||||
/>
|
||||
@@ -311,7 +311,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating greek language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\greek.lng"
|
||||
/>
|
||||
@@ -326,7 +326,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating hebrew language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\hebrew.lng"
|
||||
/>
|
||||
@@ -341,7 +341,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating hungarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\hungarian.lng"
|
||||
/>
|
||||
@@ -356,7 +356,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating icelandic language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\icelandic.lng"
|
||||
/>
|
||||
@@ -371,7 +371,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating indonesian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\indonesian.lng"
|
||||
/>
|
||||
@@ -386,7 +386,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating italian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\italian.lng"
|
||||
/>
|
||||
@@ -401,7 +401,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating japanese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\japanese.lng"
|
||||
/>
|
||||
@@ -416,7 +416,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating korean language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\korean.lng"
|
||||
/>
|
||||
@@ -431,7 +431,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating latvian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\latvian.lng"
|
||||
/>
|
||||
@@ -446,7 +446,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating lithuanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\lithuanian.lng"
|
||||
/>
|
||||
@@ -461,7 +461,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating luxembourgish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\luxembourgish.lng"
|
||||
/>
|
||||
@@ -476,7 +476,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating malay language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\malay.lng"
|
||||
/>
|
||||
@@ -491,7 +491,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_bokmal language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\norwegian_bokmal.lng"
|
||||
/>
|
||||
@@ -506,7 +506,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_nynorsk language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\norwegian_nynorsk.lng"
|
||||
/>
|
||||
@@ -521,7 +521,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating polish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\polish.lng"
|
||||
/>
|
||||
@@ -536,7 +536,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\portuguese.lng"
|
||||
/>
|
||||
@@ -551,7 +551,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating romanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\romanian.lng"
|
||||
/>
|
||||
@@ -566,7 +566,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating russian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\russian.lng"
|
||||
/>
|
||||
@@ -581,7 +581,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating serbian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\serbian.lng"
|
||||
/>
|
||||
@@ -596,7 +596,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating simplified_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\simplified_chinese.lng"
|
||||
/>
|
||||
@@ -611,7 +611,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovak language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\slovak.lng"
|
||||
/>
|
||||
@@ -626,7 +626,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovenian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\slovenian.lng"
|
||||
/>
|
||||
@@ -641,7 +641,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating spanish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\spanish.lng"
|
||||
/>
|
||||
@@ -656,7 +656,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating swedish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\swedish.lng"
|
||||
/>
|
||||
@@ -671,7 +671,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating traditional_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\traditional_chinese.lng"
|
||||
/>
|
||||
@@ -686,7 +686,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating turkish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\turkish.lng"
|
||||
/>
|
||||
@@ -701,27 +701,12 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating ukrainian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\ukrainian.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\vietnamese.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating vietnamese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\vietnamese.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\welsh.txt"
|
||||
>
|
||||
@@ -731,7 +716,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating welsh language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
exit 0"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies="..\src\lang\english.txt"
|
||||
Outputs="..\bin\lang\welsh.lng"
|
||||
/>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -169,7 +169,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -273,7 +273,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -383,7 +383,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -719,10 +719,6 @@
|
||||
RelativePath=".\..\src\tile_map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tilearea.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\townname.cpp"
|
||||
>
|
||||
@@ -1023,10 +1019,6 @@
|
||||
RelativePath=".\..\src\gfxinit.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\graph_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\group.h"
|
||||
>
|
||||
@@ -1191,10 +1183,6 @@
|
||||
RelativePath=".\..\src\newgrf_properties.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_railtype.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_sound.h"
|
||||
>
|
||||
@@ -1323,10 +1311,6 @@
|
||||
RelativePath=".\..\src\sdl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\smallmap_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound\sdl_s.h"
|
||||
>
|
||||
@@ -2191,10 +2175,6 @@
|
||||
RelativePath=".\..\src\table\airport_defaults.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\airporttile_ids.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\airporttiles.h"
|
||||
>
|
||||
@@ -3207,10 +3187,6 @@
|
||||
RelativePath=".\..\src\newgrf_industrytiles.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_railtype.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_sound.cpp"
|
||||
>
|
||||
@@ -3435,14 +3411,6 @@
|
||||
RelativePath=".\..\src\network\core\tcp_game.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\tcp_http.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\tcp_http.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\udp.cpp"
|
||||
>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -169,7 +169,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -273,7 +273,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -383,7 +383,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -168,7 +168,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -271,7 +271,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -380,7 +380,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -716,10 +716,6 @@
|
||||
RelativePath=".\..\src\tile_map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tilearea.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\townname.cpp"
|
||||
>
|
||||
@@ -1020,10 +1016,6 @@
|
||||
RelativePath=".\..\src\gfxinit.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\graph_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\group.h"
|
||||
>
|
||||
@@ -1188,10 +1180,6 @@
|
||||
RelativePath=".\..\src\newgrf_properties.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_railtype.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_sound.h"
|
||||
>
|
||||
@@ -1320,10 +1308,6 @@
|
||||
RelativePath=".\..\src\sdl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\smallmap_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound\sdl_s.h"
|
||||
>
|
||||
@@ -2188,10 +2172,6 @@
|
||||
RelativePath=".\..\src\table\airport_defaults.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\airporttile_ids.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\airporttiles.h"
|
||||
>
|
||||
@@ -3204,10 +3184,6 @@
|
||||
RelativePath=".\..\src\newgrf_industrytiles.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_railtype.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_sound.cpp"
|
||||
>
|
||||
@@ -3432,14 +3408,6 @@
|
||||
RelativePath=".\..\src\network\core\tcp_game.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\tcp_http.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\tcp_http.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\core\udp.cpp"
|
||||
>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -168,7 +168,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -271,7 +271,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -380,7 +380,7 @@
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
+7
-29
@@ -1,6 +1,6 @@
|
||||
OpenTTD README
|
||||
Last updated: 2010-02-18
|
||||
Release version: 1.0.0-RC1
|
||||
Last updated: 2010-01-21
|
||||
Release version: 1.0.0-beta3
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ Table of Contents:
|
||||
6.0) Configuration File
|
||||
7.0) Compiling
|
||||
* 7.1) Required/optional libraries
|
||||
* 7.2) Supported compilers
|
||||
8.0) Translating
|
||||
* 8.1 Translation
|
||||
* 8.2 Previewing
|
||||
@@ -251,14 +250,11 @@ The TTD artwork files listed in the section 4.1 "(Required) 3rd party files"
|
||||
can be placed in a few different locations:
|
||||
1. The current working directory (from where you started OpenTTD)
|
||||
2. Your personal directory
|
||||
Windows: C:\My Documents (95, 98, ME)
|
||||
C:\Documents and Settings\<username>\My Documents\OpenTTD (2000, XP)
|
||||
C:\Users\<username>\Documents\OpenTTD (Vista, 7)
|
||||
Windows: C:\Documents and Settings\<username>\My Documents\OpenTTD
|
||||
Mac OSX: ~/Documents/OpenTTD
|
||||
Linux: ~/.openttd
|
||||
3. The shared directory
|
||||
Windows: C:\Documents and Settings\All Users\Shared Documents\OpenTTD (2000, XP)
|
||||
C:\Users\Public\Documents\OpenTTD (Vista, 7)
|
||||
Windows: C:\Documents and Settings\All Users\Documents\OpenTTD
|
||||
Mac OSX: /Library/Application Support/OpenTTD
|
||||
Linux: not available
|
||||
4. The binary directory (where the OpenTTD executable is)
|
||||
@@ -425,23 +421,6 @@ 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.
|
||||
|
||||
7.2) Supported compilers:
|
||||
---- -------------------
|
||||
The following compilers are known to compile OpenTTD:
|
||||
- Microsoft Visual C++ (MSVC) 2005 and 2008.
|
||||
Version 2005 gives bogus warnings about scoping issues.
|
||||
- GNU Compiler Collection (GCC) 3.3 - 4.5.
|
||||
Versions 4.1 and earlier give bogus warnings about uninitialised variables.
|
||||
Versions 4.4 and later give bogus warnings about freeing heap objects.
|
||||
- Intel C++ Compiler (ICC) 11.0 and 11.1.
|
||||
|
||||
The following compilers are known not to compile OpenTTD:
|
||||
- Microsoft Visual C++ (MSVC) 2003 and earlier.
|
||||
- GNU Compiler Collection (GCC) 3.2 and earlier.
|
||||
- (Open) Watcom.
|
||||
|
||||
If any of these compilers can compile OpenTTD again, please let us know.
|
||||
|
||||
8.0) Translating:
|
||||
---- -------------------
|
||||
See http://www.openttd.org/development for up-to-date information.
|
||||
@@ -530,8 +509,10 @@ X.X) Credits:
|
||||
---- --------
|
||||
The OpenTTD team (in alphabetical order):
|
||||
Albert Hofkamp (Alberth) - GUI expert
|
||||
Jean-François Claeys (Belugas) - GUI, newindustries and more
|
||||
Jean-Francois Claeys (Belugas) - GUI, newindustries and more
|
||||
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles
|
||||
Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework
|
||||
Victor Fischer (Celestar) - Programming everywhere you need him to
|
||||
Christoph Elsenhans (frosch) - General coding
|
||||
Loïc Guilloux (glx) - Windows Expert
|
||||
Michael Lutz (michi_cc) - Path based signals
|
||||
@@ -539,12 +520,9 @@ The OpenTTD team (in alphabetical order):
|
||||
Peter Nelson (peter1138) - Spiritual descendant from newGRF gods
|
||||
Remko Bijker (Rubidium) - Lead coder and way more
|
||||
Zdeněk Sojka (SmatZ) - Bug finder and fixer
|
||||
José Soler (Terkhen) - General coding
|
||||
Thijs Marinussen (Yexo) - AI Framework
|
||||
|
||||
Inactive Developers:
|
||||
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles
|
||||
Victor Fischer (Celestar) - Programming everywhere you need him to
|
||||
Tamás Faragó (Darkvater) - Ex-Lead coder
|
||||
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
|
||||
Jonathan Coome (Maedhros) - High priest of the NewGRF Temple
|
||||
|
||||
-10
@@ -67,7 +67,6 @@ subsidy.cpp
|
||||
texteff.cpp
|
||||
tgp.cpp
|
||||
tile_map.cpp
|
||||
tilearea.cpp
|
||||
townname.cpp
|
||||
#if WIN32
|
||||
#else
|
||||
@@ -165,7 +164,6 @@ genworld.h
|
||||
gfx_func.h
|
||||
gfx_type.h
|
||||
gfxinit.h
|
||||
graph_gui.h
|
||||
group.h
|
||||
group_gui.h
|
||||
group_type.h
|
||||
@@ -207,7 +205,6 @@ newgrf_house.h
|
||||
newgrf_industries.h
|
||||
newgrf_industrytiles.h
|
||||
newgrf_properties.h
|
||||
newgrf_railtype.h
|
||||
newgrf_sound.h
|
||||
newgrf_spritegroup.h
|
||||
newgrf_station.h
|
||||
@@ -240,7 +237,6 @@ roadstop_base.h
|
||||
roadveh.h
|
||||
screenshot.h
|
||||
sdl.h
|
||||
smallmap_gui.h
|
||||
sound/sdl_s.h
|
||||
video/sdl_v.h
|
||||
settings_func.h
|
||||
@@ -478,7 +474,6 @@ saveload/waypoint_sl.cpp
|
||||
|
||||
# Tables
|
||||
table/airport_defaults.h
|
||||
table/airporttile_ids.h
|
||||
table/airporttiles.h
|
||||
table/airport_movement.h
|
||||
table/animcursors.h
|
||||
@@ -517,7 +512,6 @@ table/water_land.h
|
||||
3rdparty/md5/md5.cpp
|
||||
3rdparty/md5/md5.h
|
||||
|
||||
#if AI
|
||||
# Script
|
||||
script/script_info.cpp
|
||||
script/script_info.hpp
|
||||
@@ -698,7 +692,6 @@ ai/api/ai_vehicle.cpp
|
||||
ai/api/ai_vehiclelist.cpp
|
||||
ai/api/ai_waypoint.cpp
|
||||
ai/api/ai_waypointlist.cpp
|
||||
#end
|
||||
|
||||
# Blitters
|
||||
#if DEDICATED
|
||||
@@ -750,7 +743,6 @@ newgrf_generic.cpp
|
||||
newgrf_house.cpp
|
||||
newgrf_industries.cpp
|
||||
newgrf_industrytiles.cpp
|
||||
newgrf_railtype.cpp
|
||||
newgrf_sound.cpp
|
||||
newgrf_spritegroup.cpp
|
||||
newgrf_station.cpp
|
||||
@@ -810,8 +802,6 @@ network/core/tcp_content.cpp
|
||||
network/core/tcp_content.h
|
||||
network/core/tcp_game.cpp
|
||||
network/core/tcp_game.h
|
||||
network/core/tcp_http.cpp
|
||||
network/core/tcp_http.h
|
||||
network/core/udp.cpp
|
||||
network/core/udp.h
|
||||
|
||||
|
||||
+1
-24
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_HPP
|
||||
#define AI_HPP
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
#include "api/ai_event_types.hpp"
|
||||
#include "../date_type.h"
|
||||
#include "../core/string_compare_type.hpp"
|
||||
@@ -115,7 +114,7 @@ public:
|
||||
static char *GetConsoleList(char *p, const char *last);
|
||||
static const AIInfoList *GetInfoList();
|
||||
static const AIInfoList *GetUniqueInfoList();
|
||||
static AIInfo *FindInfo(const char *name, int version, bool force_exact_match);
|
||||
static AIInfo *FindInfo(const char *name, int version);
|
||||
static bool ImportLibrary(const char *library, const char *class_name, int version, HSQUIRRELVM vm);
|
||||
static void Rescan();
|
||||
#if defined(ENABLE_NETWORK)
|
||||
@@ -126,26 +125,4 @@ private:
|
||||
static class AIScanner *ai_scanner;
|
||||
};
|
||||
|
||||
#else /* ENABLE_AI */
|
||||
|
||||
#include "../company_type.h"
|
||||
|
||||
#define NewEvent(cid, event) nop()
|
||||
#define BroadcastNewEvent(...) nop()
|
||||
|
||||
class AI {
|
||||
public:
|
||||
static void StartNew(CompanyID company, bool rerandomise_ai = true) {}
|
||||
static void Stop(CompanyID company) {}
|
||||
static void Initialize() {}
|
||||
static void Uninitialize(bool keepConfig) {}
|
||||
static void KillAll() {}
|
||||
static void GameLoop() {}
|
||||
static bool HasAI(const struct ContentInfo *ci, bool md5sum) { return false; }
|
||||
static void Rescan() {}
|
||||
static char *GetConsoleList(char *p, const char *last) { return p; }
|
||||
static void nop() { }
|
||||
};
|
||||
|
||||
#endif /* ENABLE_AI */
|
||||
#endif /* AI_HPP */
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
#include "ai.hpp"
|
||||
#include "ai_config.hpp"
|
||||
|
||||
void AIConfig::ChangeAI(const char *name, int version, bool force_exact_match, bool is_random_ai)
|
||||
void AIConfig::ChangeAI(const char *name, int version, bool is_random_ai)
|
||||
{
|
||||
free((void *)this->name);
|
||||
this->name = (name == NULL) ? NULL : strdup(name);
|
||||
this->info = (name == NULL) ? NULL : AI::FindInfo(this->name, version, force_exact_match);
|
||||
this->info = (name == NULL) ? NULL : AI::FindInfo(this->name, version);
|
||||
this->version = (info == NULL) ? -1 : info->GetVersion();
|
||||
this->is_random_ai = is_random_ai;
|
||||
if (this->config_list != NULL) delete this->config_list;
|
||||
@@ -79,7 +79,7 @@ AIInfo *AIConfig::GetInfo() const
|
||||
|
||||
bool AIConfig::ResetInfo()
|
||||
{
|
||||
this->info = AI::FindInfo(this->name, -1, false);
|
||||
this->info = AI::FindInfo(this->name, -1);
|
||||
return this->info != NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#ifndef AI_CONFIG_HPP
|
||||
#define AI_CONFIG_HPP
|
||||
#ifdef ENABLE_AI
|
||||
|
||||
#include <map>
|
||||
#include "ai_info.hpp"
|
||||
@@ -37,11 +36,9 @@ public:
|
||||
* Set another AI to be loaded in this slot.
|
||||
* @param name The name of the AI.
|
||||
* @param version The version of the AI to load, or -1 of latest.
|
||||
* @param force_exact_match If true try to find the exact same version
|
||||
* as specified. If false any compatible version is ok.
|
||||
* @param is_random Is the AI chosen randomly?
|
||||
*/
|
||||
void ChangeAI(const char *name, int version = -1, bool force_exact_match = false, bool is_random = false);
|
||||
void ChangeAI(const char *name, int version = -1, bool is_random = false);
|
||||
|
||||
/**
|
||||
* When ever the AI Scanner is reloaded, all infos become invalid. This
|
||||
@@ -131,5 +128,4 @@ private:
|
||||
bool is_random_ai;
|
||||
};
|
||||
|
||||
#endif /* ENABLE_AI */
|
||||
#endif /* AI_CONFIG_HPP */
|
||||
|
||||
+3
-4
@@ -44,7 +44,7 @@
|
||||
info = AI::ai_scanner->SelectRandomAI();
|
||||
assert(info != NULL);
|
||||
/* Load default data and store the name in the settings */
|
||||
config->ChangeAI(info->GetName(), -1, false, true);
|
||||
config->ChangeAI(info->GetName(), -1, true);
|
||||
}
|
||||
|
||||
_current_company = company;
|
||||
@@ -105,7 +105,6 @@
|
||||
_current_company = old_company;
|
||||
|
||||
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
|
||||
DeleteWindowById(WC_AI_SETTINGS, company);
|
||||
}
|
||||
|
||||
/* static */ void AI::KillAll()
|
||||
@@ -289,9 +288,9 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
|
||||
return AI::ai_scanner->GetUniqueAIInfoList();
|
||||
}
|
||||
|
||||
/* static */ AIInfo *AI::FindInfo(const char *name, int version, bool force_exact_match)
|
||||
/* static */ AIInfo *AI::FindInfo(const char *name, int version)
|
||||
{
|
||||
return AI::ai_scanner->FindInfo(name, version, force_exact_match);
|
||||
return AI::ai_scanner->FindInfo(name, version);
|
||||
}
|
||||
|
||||
/* static */ bool AI::ImportLibrary(const char *library, const char *class_name, int version, HSQUIRRELVM vm)
|
||||
|
||||
+61
-75
@@ -10,7 +10,6 @@
|
||||
/** @file ai_gui.cpp Window for configuring the AIs */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../openttd.h"
|
||||
#include "../gui.h"
|
||||
#include "../window_gui.h"
|
||||
#include "../company_func.h"
|
||||
@@ -149,7 +148,7 @@ struct AIListWindow : public Window {
|
||||
SetWindowDirty(WC_GAME_OPTIONS, 0);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case AIL_WIDGET_LIST: { // Select one of the AIs
|
||||
@@ -157,10 +156,6 @@ struct AIListWindow : public Window {
|
||||
if (sel < (int)this->ai_info_list->size()) {
|
||||
this->selected = sel;
|
||||
this->SetDirty();
|
||||
if (click_count > 1) {
|
||||
this->ChangeAI();
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -177,6 +172,21 @@ struct AIListWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDoubleClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case AIL_WIDGET_LIST: {
|
||||
int sel = (pt.y - this->GetWidget<NWidgetBase>(AIL_WIDGET_LIST)->pos_y) / this->line_height + this->vscroll.GetPosition() - 1;
|
||||
if (sel < (int)this->ai_info_list->size()) {
|
||||
this->selected = sel;
|
||||
this->ChangeAI();
|
||||
delete this;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
{
|
||||
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(AIL_WIDGET_LIST);
|
||||
@@ -246,9 +256,7 @@ struct AISettingsWindow : public Window {
|
||||
{
|
||||
this->ai_config = AIConfig::GetConfig(slot);
|
||||
|
||||
this->InitNested(desc, slot); // Initializes 'this->line_height' as side effect.
|
||||
|
||||
this->SetWidgetDisabledState(AIS_WIDGET_RESET, _game_mode != GM_MENU);
|
||||
this->InitNested(desc); // Initializes 'this->line_height' as side effect.
|
||||
|
||||
this->vscroll.SetCount((int)this->ai_config->GetConfigList()->size());
|
||||
}
|
||||
@@ -289,13 +297,12 @@ struct AISettingsWindow : public Window {
|
||||
int y = r.top;
|
||||
for (; this->vscroll.IsVisible(i) && it != config->GetConfigList()->end(); i++, it++) {
|
||||
int current_value = config->GetSetting((*it).name);
|
||||
bool editable = (_game_mode == GM_MENU) || ((it->flags & AICONFIG_INGAME) != 0);
|
||||
|
||||
uint x = rtl ? r.right : r.left;
|
||||
if (((*it).flags & AICONFIG_BOOLEAN) != 0) {
|
||||
DrawFrameRect(buttons_left, y + 2, buttons_left + 19, y + 10, (current_value != 0) ? COLOUR_GREEN : COLOUR_RED, (current_value != 0) ? FR_LOWERED : FR_NONE);
|
||||
} else {
|
||||
DrawArrowButtons(buttons_left, y + 2, COLOUR_YELLOW, (this->clicked_button == i) ? 1 + (this->clicked_increase != rtl) : 0, editable && current_value > (*it).min_value, editable && current_value < (*it).max_value);
|
||||
DrawArrowButtons(buttons_left, y + 2, COLOUR_YELLOW, (this->clicked_button == i) ? 1 + (this->clicked_increase != rtl) : 0, current_value > (*it).min_value, current_value < (*it).max_value);
|
||||
if (it->labels != NULL && it->labels->Find(current_value) != it->labels->End()) {
|
||||
x = DrawString(value_left, value_right, y + WD_MATRIX_TOP, it->labels->Find(current_value)->second, TC_ORANGE);
|
||||
} else {
|
||||
@@ -309,19 +316,7 @@ struct AISettingsWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
void CheckDifficultyLevel()
|
||||
{
|
||||
if (_game_mode == GM_MENU) {
|
||||
if (_settings_newgame.difficulty.diff_level != 3) {
|
||||
_settings_newgame.difficulty.diff_level = 3;
|
||||
ShowErrorMessage(STR_WARNING_DIFFICULTY_TO_CUSTOM, INVALID_STRING_ID, 0, 0);
|
||||
}
|
||||
} else if (_settings_game.difficulty.diff_level != 3) {
|
||||
IConsoleSetSetting("difficulty.diff_level", 3);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case AIS_WIDGET_BACKGROUND: {
|
||||
@@ -332,8 +327,6 @@ struct AISettingsWindow : public Window {
|
||||
AIConfigItemList::const_iterator it = this->ai_config->GetConfigList()->begin();
|
||||
for (int i = 0; i < num; i++) it++;
|
||||
AIConfigItem config_item = *it;
|
||||
if (_game_mode != GM_MENU && (config_item.flags & AICONFIG_INGAME) == 0) return;
|
||||
|
||||
bool bool_item = (config_item.flags & AICONFIG_BOOLEAN) != 0;
|
||||
|
||||
int x = pt.x - wid->pos_x;
|
||||
@@ -360,7 +353,10 @@ struct AISettingsWindow : public Window {
|
||||
this->clicked_button = num;
|
||||
this->timeout = 5;
|
||||
|
||||
this->CheckDifficultyLevel();
|
||||
if (_settings_newgame.difficulty.diff_level != 3) {
|
||||
_settings_newgame.difficulty.diff_level = 3;
|
||||
ShowErrorMessage(STR_WARNING_DIFFICULTY_TO_CUSTOM, INVALID_STRING_ID, 0, 0);
|
||||
}
|
||||
} else if (!bool_item) {
|
||||
/* Display a query box so users can enter a custom value. */
|
||||
this->clicked_row = num;
|
||||
@@ -390,7 +386,6 @@ struct AISettingsWindow : public Window {
|
||||
for (int i = 0; i < this->clicked_row; i++) it++;
|
||||
int32 value = atoi(str);
|
||||
this->ai_config->SetSetting((*it).name, value);
|
||||
this->CheckDifficultyLevel();
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
@@ -577,7 +572,7 @@ struct AIConfigWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case AIC_WIDGET_DECREASE:
|
||||
@@ -596,7 +591,6 @@ struct AIConfigWindow : public Window {
|
||||
case AIC_WIDGET_LIST: { // Select a slot
|
||||
this->selected_slot = (CompanyID)((pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / this->line_height + this->vscroll.GetPosition());
|
||||
this->InvalidateData();
|
||||
if (click_count > 1 && this->selected_slot != INVALID_COMPANY) ShowAIListWindow((CompanyID)this->selected_slot);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -604,7 +598,6 @@ struct AIConfigWindow : public Window {
|
||||
if (this->selected_slot > 1) {
|
||||
Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot - 1]);
|
||||
this->selected_slot--;
|
||||
this->vscroll.ScrollTowards(this->selected_slot);
|
||||
this->InvalidateData();
|
||||
}
|
||||
break;
|
||||
@@ -613,7 +606,6 @@ struct AIConfigWindow : public Window {
|
||||
if (this->selected_slot < _settings_newgame.difficulty.max_no_competitors) {
|
||||
Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot + 1]);
|
||||
this->selected_slot++;
|
||||
this->vscroll.ScrollTowards(this->selected_slot);
|
||||
this->InvalidateData();
|
||||
}
|
||||
break;
|
||||
@@ -642,6 +634,16 @@ struct AIConfigWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDoubleClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case AIC_WIDGET_LIST:
|
||||
this->OnClick(pt, widget);
|
||||
if (this->selected_slot != INVALID_COMPANY) ShowAIListWindow((CompanyID)this->selected_slot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnInvalidateData(int data)
|
||||
{
|
||||
if (this->selected_slot == 0 || this->selected_slot > _settings_newgame.difficulty.max_no_competitors) {
|
||||
@@ -675,7 +677,6 @@ void ShowAIConfigWindow()
|
||||
enum AIDebugWindowWidgets {
|
||||
AID_WIDGET_VIEW,
|
||||
AID_WIDGET_NAME_TEXT,
|
||||
AID_WIDGET_SETTINGS,
|
||||
AID_WIDGET_RELOAD_TOGGLE,
|
||||
AID_WIDGET_LOG_PANEL,
|
||||
AID_WIDGET_SCROLLBAR,
|
||||
@@ -703,7 +704,6 @@ struct AIDebugWindow : public Window {
|
||||
this->SetWidgetDisabledState(i + AID_WIDGET_COMPANY_BUTTON_START, !Company::IsValidAiID(i));
|
||||
}
|
||||
this->DisableWidget(AID_WIDGET_RELOAD_TOGGLE);
|
||||
this->DisableWidget(AID_WIDGET_SETTINGS);
|
||||
|
||||
this->last_vscroll_pos = 0;
|
||||
this->autoscroll = true;
|
||||
@@ -743,11 +743,8 @@ struct AIDebugWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
/* Update "Reload AI" and "AI settings" buttons */
|
||||
this->SetWidgetsDisabledState(ai_debug_company == INVALID_COMPANY,
|
||||
AID_WIDGET_RELOAD_TOGGLE,
|
||||
AID_WIDGET_SETTINGS,
|
||||
WIDGET_LIST_END);
|
||||
/* Update "Reload AI" button */
|
||||
this->SetWidgetDisabledState(AID_WIDGET_RELOAD_TOGGLE, ai_debug_company == INVALID_COMPANY);
|
||||
|
||||
/* Draw standard stuff */
|
||||
this->DrawWidgets();
|
||||
@@ -784,7 +781,7 @@ struct AIDebugWindow : public Window {
|
||||
if (!valid) continue;
|
||||
|
||||
byte offset = (i == ai_debug_company) ? 1 : 0;
|
||||
DrawCompanyIcon(i, button->pos_x + button->current_x / 2 - 7 + offset, this->GetWidget<NWidgetBase>(AID_WIDGET_COMPANY_BUTTON_START + i)->pos_y + 2 + offset);
|
||||
DrawCompanyIcon(i, this->GetWidget<NWidgetBase>(AID_WIDGET_COMPANY_BUTTON_START + i)->pos_x + 11 + offset, this->GetWidget<NWidgetBase>(AID_WIDGET_COMPANY_BUTTON_START + i)->pos_y + 2 + offset);
|
||||
}
|
||||
|
||||
CompanyID old_company = _current_company;
|
||||
@@ -887,11 +884,9 @@ struct AIDebugWindow : public Window {
|
||||
this->autoscroll = true;
|
||||
this->last_vscroll_pos = this->vscroll.GetPosition();
|
||||
this->SetDirty();
|
||||
/* Close AI settings window to prevent confusion */
|
||||
DeleteWindowByClass(WC_AI_SETTINGS);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
/* Check which button is clicked */
|
||||
if (IsInsideMM(widget, AID_WIDGET_COMPANY_BUTTON_START, AID_WIDGET_COMPANY_BUTTON_END + 1)) {
|
||||
@@ -900,24 +895,16 @@ struct AIDebugWindow : public Window {
|
||||
ChangeToAI((CompanyID)(widget - AID_WIDGET_COMPANY_BUTTON_START));
|
||||
}
|
||||
}
|
||||
|
||||
switch (widget) {
|
||||
case AID_WIDGET_RELOAD_TOGGLE:
|
||||
/* 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, 1, ai_debug_company, CMD_COMPANY_CTRL);
|
||||
break;
|
||||
|
||||
case AID_WIDGET_SETTINGS:
|
||||
ShowAISettingsWindow(ai_debug_company);
|
||||
break;
|
||||
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 */
|
||||
DoCommandP(0, 2, ai_debug_company, CMD_COMPANY_CTRL);
|
||||
DoCommandP(0, 1, ai_debug_company, CMD_COMPANY_CTRL);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnTimeout()
|
||||
{
|
||||
this->RaiseWidget(AID_WIDGET_RELOAD_TOGGLE);
|
||||
this->RaiseWidget(AID_WIDGET_SETTINGS);
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
@@ -946,48 +933,47 @@ static const NWidgetPart _nested_ai_debug_widgets[] = {
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_VIEW),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(2, 0),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 1), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 1), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 2), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 2), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 3), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 3), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 4), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 4), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 5), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 5), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 6), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 6), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 7), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 7), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(2, 0),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(2, 0), SetResize(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(2, 0),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 8), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 8), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 9), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 9), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 10), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 10), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 11), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 11), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 12), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 12), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 13), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 13), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 14), SetMinimalSize(37, 13), SetResize(1, 0), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START + 14), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(39, 0), SetResize(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 1), SetResize(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, AID_WIDGET_NAME_TEXT), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_JUST_STRING, STR_AI_DEBUG_NAME_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, AID_WIDGET_SETTINGS), SetMinimalSize(100, 20), SetDataTip(STR_AI_DEBUG_SETTINGS, STR_AI_DEBUG_SETTINGS_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, AID_WIDGET_RELOAD_TOGGLE), SetMinimalSize(100, 20), SetDataTip(STR_AI_DEBUG_RELOAD, STR_AI_DEBUG_RELOAD_TOOLTIP),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, AID_WIDGET_NAME_TEXT), SetMinimalSize(150, 20), SetResize(1, 0), SetDataTip(STR_JUST_STRING, STR_AI_DEBUG_NAME_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, AID_WIDGET_RELOAD_TOGGLE), SetMinimalSize(149, 20), SetDataTip(STR_AI_DEBUG_RELOAD, STR_AI_DEBUG_RELOAD_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_LOG_PANEL), SetMinimalSize(287, 180), SetResize(1, 1),
|
||||
@@ -1000,7 +986,7 @@ static const NWidgetPart _nested_ai_debug_widgets[] = {
|
||||
};
|
||||
|
||||
static const WindowDesc _ai_debug_desc(
|
||||
WDP_AUTO, 600, 450,
|
||||
WDP_AUTO, 299, 241,
|
||||
WC_AI_DEBUG, WC_NONE,
|
||||
0,
|
||||
_nested_ai_debug_widgets, lengthof(_nested_ai_debug_widgets)
|
||||
|
||||
@@ -14,17 +14,7 @@
|
||||
|
||||
#include "../company_type.h"
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY);
|
||||
void ShowAIConfigWindow();
|
||||
#else
|
||||
#include "table/strings.h"
|
||||
|
||||
static inline void ShowAIConfigWindow()
|
||||
{
|
||||
ShowErrorMessage(STR_ERROR_NO_AI, STR_ERROR_NO_AI_SUB, 0, 0);
|
||||
}
|
||||
static inline void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY) {ShowAIConfigWindow();}
|
||||
#endif /* ENABLE_AI */
|
||||
|
||||
#endif /* AI_GUI_HPP */
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_INFO
|
||||
#define AI_INFO
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
|
||||
#include <list>
|
||||
#include "../core/smallmap_type.hpp"
|
||||
#include "../script/script_info.hpp"
|
||||
@@ -22,7 +20,6 @@ enum AIConfigFlags {
|
||||
AICONFIG_NONE = 0x0,
|
||||
AICONFIG_RANDOM = 0x1, //!< When randomizing the AI, pick any value between min_value and max_value when on custom difficulty setting.
|
||||
AICONFIG_BOOLEAN = 0x2, //!< This value is a boolean (either 0 (false) or 1 (true) ).
|
||||
AICONFIG_INGAME = 0x4, //!< This setting can be changed while the AI is running.
|
||||
};
|
||||
|
||||
typedef SmallMap<int, char *> LabelMapping;
|
||||
@@ -143,5 +140,4 @@ private:
|
||||
const char *category;
|
||||
};
|
||||
|
||||
#endif /* ENABLE_AI */
|
||||
#endif /* AI_INFO */
|
||||
|
||||
+11
-11
@@ -39,10 +39,8 @@ AIScanner::AIScanner() :
|
||||
SQAIInfo.AddConstructor<void (AIInfo::*)(), 1>(engine, "x");
|
||||
SQAIInfo.DefSQAdvancedMethod(this->engine, &AIInfo::AddSetting, "AddSetting");
|
||||
SQAIInfo.DefSQAdvancedMethod(this->engine, &AIInfo::AddLabels, "AddLabels");
|
||||
SQAIInfo.DefSQConst(engine, AICONFIG_NONE, "AICONFIG_NONE");
|
||||
SQAIInfo.DefSQConst(engine, AICONFIG_RANDOM, "AICONFIG_RANDOM");
|
||||
SQAIInfo.DefSQConst(engine, AICONFIG_BOOLEAN, "AICONFIG_BOOLEAN");
|
||||
SQAIInfo.DefSQConst(engine, AICONFIG_INGAME, "AICONFIG_INGAME");
|
||||
SQAIInfo.PostRegister(engine);
|
||||
this->engine->AddMethod("RegisterAI", &AIInfo::Constructor, 2, "tx");
|
||||
this->engine->AddMethod("RegisterDummyAI", &AIInfo::DummyConstructor, 2, "tx");
|
||||
@@ -276,7 +274,7 @@ AIInfo *AIScanner::SelectRandomAI() const
|
||||
return (*it).second;
|
||||
}
|
||||
|
||||
AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam, bool force_exact_match)
|
||||
AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam)
|
||||
{
|
||||
if (this->info_list.size() == 0) return NULL;
|
||||
if (nameParam == NULL) return NULL;
|
||||
@@ -301,19 +299,21 @@ AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam, bool force_
|
||||
/* Fall-through, like we were calling this function with a version */
|
||||
}
|
||||
|
||||
if (force_exact_match) {
|
||||
/* Try to find a direct 'name.version' match */
|
||||
char ai_name_tmp[1024];
|
||||
snprintf(ai_name_tmp, sizeof(ai_name_tmp), "%s.%d", ai_name, versionParam);
|
||||
strtolower(ai_name_tmp);
|
||||
if (this->info_list.find(ai_name_tmp) != this->info_list.end()) return this->info_list[ai_name_tmp];
|
||||
}
|
||||
/* Try to find a direct 'name.version' match */
|
||||
char ai_name_tmp[1024];
|
||||
snprintf(ai_name_tmp, sizeof(ai_name_tmp), "%s.%d", ai_name, versionParam);
|
||||
strtolower(ai_name_tmp);
|
||||
if (this->info_list.find(ai_name_tmp) != this->info_list.end()) return this->info_list[ai_name_tmp];
|
||||
|
||||
/* See if there is a compatible AI which goes by that name, with the highest
|
||||
* version which allows loading the requested version */
|
||||
AIInfoList::iterator it = this->info_list.begin();
|
||||
for (; it != this->info_list.end(); it++) {
|
||||
if (strcasecmp(ai_name, (*it).second->GetName()) == 0 && (*it).second->CanLoadFromVersion(versionParam) && (version == -1 || (*it).second->GetVersion() > version)) {
|
||||
char ai_name_compare[1024];
|
||||
snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName());
|
||||
strtolower(ai_name_compare);
|
||||
|
||||
if (strcasecmp(ai_name, ai_name_compare) == 0 && (*it).second->CanLoadFromVersion(versionParam) && (version == -1 || (*it).second->GetVersion() > version)) {
|
||||
version = (*it).second->GetVersion();
|
||||
info = (*it).second;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* Find an AI by name.
|
||||
*/
|
||||
class AIInfo *FindInfo(const char *name, int version, bool force_exact_match);
|
||||
class AIInfo *FindInfo(const char *name, int version);
|
||||
|
||||
/**
|
||||
* Get the list of available AIs for the console.
|
||||
|
||||
@@ -23,21 +23,14 @@
|
||||
* \li AIEngine::IsBuildable
|
||||
* \li AIEventCompanyAskMerger
|
||||
* \li AIIndustry::GetLastMonthTransportedPercentage
|
||||
* \li AIInfo::AICONFIG_INGAME
|
||||
* \li AIMarine::GetBuildCost
|
||||
* \li AIOrder::AIOF_GOTO_NEAREST_DEPOT
|
||||
* \li AIOrder::GetStopLocation
|
||||
* \li AIOrder::SetStopLocation
|
||||
* \li AIRail::RemoveRailStationTileRectangle
|
||||
* \li AIRail::RemoveRailWaypointTileRectangle
|
||||
* \li AIRail::GetBuildCost
|
||||
* \li AIRoad::GetBuildCost
|
||||
* \li AISubsidy::SubsidyParticipantType
|
||||
* \li AISubsidy::GetSourceType
|
||||
* \li AISubsidy::GetSourceIndex
|
||||
* \li AISubsidy::GetDestinationType
|
||||
* \li AISubsidy::GetDestinationIndex
|
||||
* \li AITile::GetBuildCost
|
||||
* \li AITown::GetLastMonthTransportedPercentage
|
||||
* \li AIVehicleList_Depot
|
||||
* \li AIWaypoint::WaypointType
|
||||
@@ -104,12 +97,6 @@
|
||||
* the search bounding box and the industry's bounding box intersect, are
|
||||
* counted. Previously these industries (and their cargos), although they
|
||||
* produced cargo for a station at the given location, were not returned.
|
||||
* \li AIRail::BuildRail will now fail completely if there is an obstacle
|
||||
* between the begin and end, instead of building up to the obstacle and
|
||||
* returning that everything went okay.
|
||||
* \li Orders for buoys are now waypoint orders, i.e. instead of using the
|
||||
* station orders for buoys one has to use waypoint orders.
|
||||
* \li Autoreplaces can now also be set for the default group via AIGroup.
|
||||
*
|
||||
* \b 0.7.5
|
||||
*
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "ai_gamesettings.hpp"
|
||||
#include "../../settings_internal.h"
|
||||
#include "../../economy_func.h"
|
||||
|
||||
/* static */ bool AIGameSettings::IsValid(const char *setting)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
/* static */ bool AIGroup::SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL);
|
||||
EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
|
||||
EnforcePrecondition(false, AIEngine::IsBuildable(engine_id_new));
|
||||
|
||||
return AIObject::DoCommand(0, group_id << 16, (engine_id_new << 16) | engine_id_old, CMD_SET_AUTOREPLACE);
|
||||
@@ -120,14 +120,14 @@
|
||||
|
||||
/* static */ EngineID AIGroup::GetEngineReplacement(GroupID group_id, EngineID engine_id)
|
||||
{
|
||||
if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return ::INVALID_ENGINE;
|
||||
if (!IsValidGroup(group_id) && group_id != GROUP_ALL) return ::INVALID_ENGINE;
|
||||
|
||||
return ::EngineReplacementForCompany(Company::Get(_current_company), engine_id, group_id);
|
||||
}
|
||||
|
||||
/* static */ bool AIGroup::StopAutoReplace(GroupID group_id, EngineID engine_id)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL);
|
||||
EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
|
||||
|
||||
return AIObject::DoCommand(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, CMD_SET_AUTOREPLACE);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
* vehicles from all groups that haven't set autoreplace protection.
|
||||
* @param engine_id_old The engine id to start replacing.
|
||||
* @param engine_id_new The engine id to replace with.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_ALL.
|
||||
* @pre AIEngine.IsBuildable(engine_id_new).
|
||||
* @note To stop autoreplacing engine_id_old, call StopAutoReplace(group_id, engine_id_old).
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
* Get the EngineID the given EngineID is replaced with.
|
||||
* @param group_id The group to get the replacement from.
|
||||
* @param engine_id The engine that is being replaced.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_ALL.
|
||||
* @return The EngineID that is replacing engine_id or an invalid EngineID
|
||||
* in case engine_id is not begin replaced.
|
||||
*/
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
* Stop replacing a certain engine in the specified group.
|
||||
* @param group_id The group to stop replacing the engine in.
|
||||
* @param engine_id The engine id to stop replacing with another engine.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL.
|
||||
* @pre IsValidGroup(group_id) || group_id == GROUP_ALL.
|
||||
* @return True if and if the replacing was succesfully stopped.
|
||||
*/
|
||||
static bool StopAutoReplace(GroupID group_id, EngineID engine_id);
|
||||
|
||||
@@ -184,7 +184,6 @@ public:
|
||||
AICONFIG_NONE, //!< Normal setting.
|
||||
AICONFIG_RANDOM, //!< When randomizing the AI, pick any value between min_value and max_value.
|
||||
AICONFIG_BOOLEAN, //!< This value is a boolean (either 0 (false) or 1 (true) ).
|
||||
AICONFIG_INGAME, //!< This setting can be changed while the AI is running.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "ai_station.hpp"
|
||||
#include "../../station_base.h"
|
||||
#include "../../tile_cmd.h"
|
||||
#include "../../economy_func.h"
|
||||
|
||||
|
||||
/* static */ bool AIMarine::IsWaterDepotTile(TileIndex tile)
|
||||
@@ -150,13 +149,3 @@
|
||||
|
||||
return AIObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
|
||||
}
|
||||
|
||||
/* static */ Money AIMarine::GetBuildCost(BuildType build_type)
|
||||
{
|
||||
switch (build_type) {
|
||||
case BT_DOCK: return ::GetPrice(PR_BUILD_STATION_DOCK, 1, NULL);
|
||||
case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_SHIP, 1, NULL);
|
||||
case BT_BUOY: return ::GetPrice(PR_BUILD_WAYPOINT_BUOY, 1, NULL);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,6 @@ public:
|
||||
ERR_MARINE_MUST_BE_BUILT_ON_WATER, // [STR_ERROR_MUST_BE_BUILT_ON_WATER]
|
||||
};
|
||||
|
||||
/**
|
||||
* Types of water-related objects in the game.
|
||||
*/
|
||||
enum BuildType {
|
||||
BT_DOCK, //!< Build a dock
|
||||
BT_DEPOT, //!< Build a ship depot
|
||||
BT_BUOY, //!< Build a buoy
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a water depot.
|
||||
* @param tile The tile to check.
|
||||
@@ -200,13 +191,6 @@ public:
|
||||
* @return Whether the canal has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveCanal(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Get the baseprice of building a water-related object.
|
||||
* @param build_type the type of object to build
|
||||
* @return The baseprice of building the given object.
|
||||
*/
|
||||
static Money GetBuildCost(BuildType build_type);
|
||||
};
|
||||
|
||||
#endif /* AI_MARINE_HPP */
|
||||
|
||||
@@ -15,8 +15,6 @@ namespace SQConvert {
|
||||
/* Allow enums to be used as Squirrel parameters */
|
||||
template <> AIMarine::ErrorMessages GetParam(ForceType<AIMarine::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIMarine::ErrorMessages)tmp; }
|
||||
template <> int Return<AIMarine::ErrorMessages>(HSQUIRRELVM vm, AIMarine::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIMarine::BuildType GetParam(ForceType<AIMarine::BuildType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIMarine::BuildType)tmp; }
|
||||
template <> int Return<AIMarine::BuildType>(HSQUIRRELVM vm, AIMarine::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow AIMarine to be used as Squirrel parameter */
|
||||
template <> AIMarine *GetParam(ForceType<AIMarine *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMarine *)instance; }
|
||||
@@ -34,9 +32,6 @@ void SQAIMarine_Register(Squirrel *engine)
|
||||
|
||||
SQAIMarine.DefSQConst(engine, AIMarine::ERR_MARINE_BASE, "ERR_MARINE_BASE");
|
||||
SQAIMarine.DefSQConst(engine, AIMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER, "ERR_MARINE_MUST_BE_BUILT_ON_WATER");
|
||||
SQAIMarine.DefSQConst(engine, AIMarine::BT_DOCK, "BT_DOCK");
|
||||
SQAIMarine.DefSQConst(engine, AIMarine::BT_DEPOT, "BT_DEPOT");
|
||||
SQAIMarine.DefSQConst(engine, AIMarine::BT_BUOY, "BT_BUOY");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_MUST_BE_BUILT_ON_WATER, AIMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER);
|
||||
|
||||
@@ -58,7 +53,6 @@ void SQAIMarine_Register(Squirrel *engine)
|
||||
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveBuoy, "RemoveBuoy", 2, ".i");
|
||||
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveLock, "RemoveLock", 2, ".i");
|
||||
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveCanal, "RemoveCanal", 2, ".i");
|
||||
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::GetBuildCost, "GetBuildCost", 2, ".i");
|
||||
|
||||
SQAIMarine.PostRegister(engine);
|
||||
}
|
||||
|
||||
+3
-34
@@ -188,7 +188,8 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
case OT_GOTO_STATION: {
|
||||
const Station *st = ::Station::Get(order->GetDestination());
|
||||
if (st->train_station.tile != INVALID_TILE) {
|
||||
TILE_AREA_LOOP(t, st->train_station) {
|
||||
for (uint i = 0; i < st->train_station.w; i++) {
|
||||
TileIndex t = st->train_station.tile + TileDiffXY(i, 0);
|
||||
if (st->TileBelongsToRailStation(t)) return t;
|
||||
}
|
||||
} else if (st->dock_tile != INVALID_TILE) {
|
||||
@@ -205,17 +206,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
}
|
||||
return INVALID_TILE;
|
||||
}
|
||||
|
||||
case OT_GOTO_WAYPOINT: {
|
||||
const Waypoint *wp = ::Waypoint::Get(order->GetDestination());
|
||||
if (wp->train_station.tile != INVALID_TILE) {
|
||||
TILE_AREA_LOOP(t, wp->train_station) {
|
||||
if (wp->TileBelongsToRailStation(t)) return t;
|
||||
}
|
||||
}
|
||||
/* If the waypoint has no rail waypoint tiles, it must have a buoy */
|
||||
return wp->xy;
|
||||
}
|
||||
case OT_GOTO_WAYPOINT: return ::Waypoint::Get(order->GetDestination())->xy;
|
||||
default: return INVALID_TILE;
|
||||
}
|
||||
}
|
||||
@@ -285,16 +276,6 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
return value;
|
||||
}
|
||||
|
||||
/* static */ AIOrder::StopLocation AIOrder::GetStopLocation(VehicleID vehicle_id, OrderPosition order_position)
|
||||
{
|
||||
if (!IsValidVehicleOrder(vehicle_id, order_position)) return STOPLOCATION_INVALID;
|
||||
if (AIVehicle::GetVehicleType(vehicle_id) != AIVehicle::VT_RAIL) return STOPLOCATION_INVALID;
|
||||
if (!IsGotoStationOrder(vehicle_id, order_position)) return STOPLOCATION_INVALID;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
return (AIOrder::StopLocation)order->GetStopLocation();
|
||||
}
|
||||
|
||||
/* static */ bool AIOrder::SetOrderJumpTo(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position));
|
||||
@@ -332,18 +313,6 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
return AIObject::DoCommand(0, vehicle_id | (order_position << 16), MOF_COND_VALUE | (value << 4), CMD_MODIFY_ORDER);
|
||||
}
|
||||
|
||||
/* static */ bool AIOrder::SetStopLocation(VehicleID vehicle_id, OrderPosition order_position, StopLocation stop_location)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position));
|
||||
EnforcePrecondition(false, AIVehicle::GetVehicleType(vehicle_id) == AIVehicle::VT_RAIL);
|
||||
EnforcePrecondition(false, IsGotoStationOrder(vehicle_id, order_position));
|
||||
EnforcePrecondition(false, stop_location >= STOPLOCATION_NEAR && stop_location <= STOPLOCATION_FAR);
|
||||
|
||||
uint32 p1 = vehicle_id | (order_position << 16);
|
||||
uint32 p2 = MOF_STOP_LOCATION | (stop_location << 4);
|
||||
return AIObject::DoCommand(0, p1, p2, CMD_MODIFY_ORDER);
|
||||
}
|
||||
|
||||
/* static */ bool AIOrder::AppendOrder(VehicleID vehicle_id, TileIndex destination, AIOrderFlags order_flags)
|
||||
{
|
||||
EnforcePrecondition(false, AIVehicle::IsValidVehicle(vehicle_id));
|
||||
|
||||
@@ -118,14 +118,6 @@ public:
|
||||
ORDER_INVALID = -1, //!< An invalid order.
|
||||
};
|
||||
|
||||
/** Where to stop trains in a station that's longer then the train */
|
||||
enum StopLocation {
|
||||
STOPLOCATION_NEAR, //!< Stop the train as soon as it's completely in the station
|
||||
STOPLOCATION_MIDDLE, //!< Stop the train in the middle of the station
|
||||
STOPLOCATION_FAR, //!< Stop the train at the far end of the station
|
||||
STOPLOCATION_INVALID = -1, //!< An invalid stop location
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the given order id is valid for the given vehicle.
|
||||
* @param vehicle_id The vehicle to check the order index for.
|
||||
@@ -289,17 +281,6 @@ public:
|
||||
*/
|
||||
static int32 GetOrderCompareValue(VehicleID vehicle_id, OrderPosition order_position);
|
||||
|
||||
/**
|
||||
* Gets the stoplocation of the given order for the given train.
|
||||
* @param vehicle_id The vehicle to get the value for.
|
||||
* @param order_position The order to get the value for.
|
||||
* @pre IsValidVehicleOrder(vehicle_id, order_position).
|
||||
* @pre AIVehicle::GetVehicleType(vehicle_id) == AIVehicle::VT_RAIL.
|
||||
* @pre IsGotoStationOrder(vehicle_id, order_position).
|
||||
* @return The relative position where the train will stop inside a station.
|
||||
*/
|
||||
static StopLocation GetStopLocation(VehicleID vehicle_id, OrderPosition order_position);
|
||||
|
||||
/**
|
||||
* Sets the OrderPosition to jump to if the check succeeds of the given order for the given vehicle.
|
||||
* @param vehicle_id The vehicle to set the OrderPosition for.
|
||||
@@ -348,19 +329,6 @@ public:
|
||||
*/
|
||||
static bool SetOrderCompareValue(VehicleID vehicle_id, OrderPosition order_position, int32 value);
|
||||
|
||||
/**
|
||||
* Sets the stoplocation of the given order for the given train.
|
||||
* @param vehicle_id The vehicle to get the value for.
|
||||
* @param order_position The order to get the value for.
|
||||
* @param stop_location The relative position where a train will stop inside a station.
|
||||
* @pre IsValidVehicleOrder(vehicle_id, order_position).
|
||||
* @pre AIVehicle::GetVehicleType(vehicle_id) == AIVehicle::VT_RAIL.
|
||||
* @pre IsGotoStationOrder(vehicle_id, order_position).
|
||||
* @pre stop_location >= STOPLOCATION_NEAR && stop_location <= STOPLOCATION_FAR
|
||||
* @return Whether the order has been/can be changed.
|
||||
*/
|
||||
static bool SetStopLocation(VehicleID vehicle_id, OrderPosition order_position, StopLocation stop_location);
|
||||
|
||||
/**
|
||||
* Appends an order to the end of the vehicle's order list.
|
||||
* @param vehicle_id The vehicle to append the order to.
|
||||
|
||||
@@ -23,8 +23,6 @@ namespace SQConvert {
|
||||
template <> int Return<AIOrder::CompareFunction>(HSQUIRRELVM vm, AIOrder::CompareFunction res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIOrder::OrderPosition GetParam(ForceType<AIOrder::OrderPosition>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIOrder::OrderPosition)tmp; }
|
||||
template <> int Return<AIOrder::OrderPosition>(HSQUIRRELVM vm, AIOrder::OrderPosition res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIOrder::StopLocation GetParam(ForceType<AIOrder::StopLocation>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIOrder::StopLocation)tmp; }
|
||||
template <> int Return<AIOrder::StopLocation>(HSQUIRRELVM vm, AIOrder::StopLocation res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow AIOrder to be used as Squirrel parameter */
|
||||
template <> AIOrder *GetParam(ForceType<AIOrder *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIOrder *)instance; }
|
||||
@@ -78,10 +76,6 @@ void SQAIOrder_Register(Squirrel *engine)
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::CF_INVALID, "CF_INVALID");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::ORDER_CURRENT, "ORDER_CURRENT");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::ORDER_INVALID, "ORDER_INVALID");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_NEAR, "STOPLOCATION_NEAR");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_MIDDLE, "STOPLOCATION_MIDDLE");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_FAR, "STOPLOCATION_FAR");
|
||||
SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_INVALID, "STOPLOCATION_INVALID");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_NO_MORE_SPACE_FOR_ORDERS, AIOrder::ERR_ORDER_TOO_MANY);
|
||||
AIError::RegisterErrorMap(STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION, AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION);
|
||||
@@ -105,12 +99,10 @@ void SQAIOrder_Register(Squirrel *engine)
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCondition, "GetOrderCondition", 3, ".ii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareFunction, "GetOrderCompareFunction", 3, ".ii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareValue, "GetOrderCompareValue", 3, ".ii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetStopLocation, "GetStopLocation", 3, ".ii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderJumpTo, "SetOrderJumpTo", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCondition, "SetOrderCondition", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareFunction, "SetOrderCompareFunction", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareValue, "SetOrderCompareValue", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetStopLocation, "SetStopLocation", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendOrder, "AppendOrder", 4, ".iii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendConditionalOrder, "AppendConditionalOrder", 3, ".ii");
|
||||
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertOrder, "InsertOrder", 5, ".iiii");
|
||||
|
||||
+1
-16
@@ -19,7 +19,6 @@
|
||||
#include "../../newgrf.h"
|
||||
#include "../../newgrf_generic.h"
|
||||
#include "../../newgrf_station.h"
|
||||
#include "../../economy_func.h"
|
||||
|
||||
/* static */ bool AIRail::IsRailTile(TileIndex tile)
|
||||
{
|
||||
@@ -332,7 +331,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
|
||||
(::TileX(from) == ::TileX(tile) && ::TileX(tile) == ::TileX(to)) ||
|
||||
(::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to)));
|
||||
|
||||
uint32 p2 = SimulateDrag(from, tile, &to) | 1 << 8;
|
||||
uint32 p2 = SimulateDrag(from, tile, &to);
|
||||
return AIObject::DoCommand(tile, to, p2, CMD_BUILD_RAILROAD_TRACK);
|
||||
}
|
||||
|
||||
@@ -455,17 +454,3 @@ static bool IsValidSignalType(int signal_type)
|
||||
|
||||
return AIObject::DoCommand(tile, track, 0, CMD_REMOVE_SIGNALS);
|
||||
}
|
||||
|
||||
/* static */ Money AIRail::GetBuildCost(RailType railtype, BuildType build_type)
|
||||
{
|
||||
if (!AIRail::IsRailTypeAvailable(railtype)) return -1;
|
||||
|
||||
switch (build_type) {
|
||||
case BT_TRACK: return ::RailBuildCost((::RailType)railtype);
|
||||
case BT_SIGNAL: return ::GetPrice(PR_BUILD_SIGNALS, 1, NULL);
|
||||
case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_TRAIN, 1, NULL);
|
||||
case BT_STATION: return ::GetPrice(PR_BUILD_STATION_RAIL, 1, NULL) + ::GetPrice(PR_BUILD_STATION_RAIL_LENGTH, 1, NULL);
|
||||
case BT_WAYPOINT: return ::GetPrice(PR_BUILD_WAYPOINT_RAIL, 1, NULL);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,17 +81,6 @@ public:
|
||||
SIGNALTYPE_NONE = 0xFF, //!< No signal.
|
||||
};
|
||||
|
||||
/**
|
||||
* Types of rail-related objects in the game.
|
||||
*/
|
||||
enum BuildType {
|
||||
BT_TRACK, //!< Build a track
|
||||
BT_SIGNAL, //!< Build a signal
|
||||
BT_DEPOT, //!< Build a depot
|
||||
BT_STATION, //!< Build a station
|
||||
BT_WAYPOINT, //!< Build a rail waypoint
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with rail that can be
|
||||
* used to traverse a tile. This excludes rail depots but includes
|
||||
@@ -380,7 +369,6 @@ public:
|
||||
* @exception AIRail::ERR_CROSSING_ON_ONEWAY_ROAD
|
||||
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
|
||||
* @exception AIError::ERR_ALREADY_BUILT
|
||||
* @note Construction will fail if an obstacle is found between the start and end tiles.
|
||||
* @return Whether the rail has been/can be build or not.
|
||||
*/
|
||||
static bool BuildRail(TileIndex from, TileIndex tile, TileIndex to);
|
||||
@@ -431,15 +419,6 @@ public:
|
||||
* @return Whether the signal has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveSignal(TileIndex tile, TileIndex front);
|
||||
|
||||
/**
|
||||
* Get the baseprice of building a rail-related object.
|
||||
* @param railtype the railtype that is build (on)
|
||||
* @param build_type the type of object to build
|
||||
* @pre IsRailTypeAvailable(railtype)
|
||||
* @return The baseprice of building the given object.
|
||||
*/
|
||||
static Money GetBuildCost(RailType railtype, BuildType build_type);
|
||||
};
|
||||
|
||||
#endif /* AI_RAIL_HPP */
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace SQConvert {
|
||||
template <> int Return<AIRail::RailTrack>(HSQUIRRELVM vm, AIRail::RailTrack res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIRail::SignalType GetParam(ForceType<AIRail::SignalType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRail::SignalType)tmp; }
|
||||
template <> int Return<AIRail::SignalType>(HSQUIRRELVM vm, AIRail::SignalType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIRail::BuildType GetParam(ForceType<AIRail::BuildType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRail::BuildType)tmp; }
|
||||
template <> int Return<AIRail::BuildType>(HSQUIRRELVM vm, AIRail::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow AIRail to be used as Squirrel parameter */
|
||||
template <> AIRail *GetParam(ForceType<AIRail *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIRail *)instance; }
|
||||
@@ -62,11 +60,6 @@ void SQAIRail_Register(Squirrel *engine)
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_EXIT_TWOWAY, "SIGNALTYPE_EXIT_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_COMBO_TWOWAY, "SIGNALTYPE_COMBO_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NONE, "SIGNALTYPE_NONE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_TRACK, "BT_TRACK");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_SIGNAL, "BT_SIGNAL");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_DEPOT, "BT_DEPOT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_STATION, "BT_STATION");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_WAYPOINT, "BT_WAYPOINT");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD);
|
||||
AIError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, AIRail::ERR_UNSUITABLE_TRACK);
|
||||
@@ -105,7 +98,6 @@ void SQAIRail_Register(Squirrel *engine)
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::GetSignalType, "GetSignalType", 3, ".ii");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::BuildSignal, "BuildSignal", 4, ".iii");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::RemoveSignal, "RemoveSignal", 3, ".ii");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::GetBuildCost, "GetBuildCost", 3, ".ii");
|
||||
|
||||
SQAIRail.PostRegister(engine);
|
||||
}
|
||||
|
||||
+1
-14
@@ -471,7 +471,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
|
||||
EnforcePrecondition(false, !one_way || AIObject::GetRoadType() == ::ROADTYPE_ROAD);
|
||||
EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType()));
|
||||
|
||||
return AIObject::DoCommand(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (AIObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 5) | 1 << 6, CMD_BUILD_LONG_ROAD);
|
||||
return AIObject::DoCommand(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (AIObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 5), CMD_BUILD_LONG_ROAD);
|
||||
}
|
||||
|
||||
/* static */ bool AIRoad::BuildRoad(TileIndex start, TileIndex end)
|
||||
@@ -579,16 +579,3 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
|
||||
|
||||
return AIObject::DoCommand(tile, 0, GetRoadStopType(tile), CMD_REMOVE_ROAD_STOP);
|
||||
}
|
||||
|
||||
/* static */ Money AIRoad::GetBuildCost(RoadType roadtype, BuildType build_type)
|
||||
{
|
||||
if (!AIRoad::IsRoadTypeAvailable(roadtype)) return -1;
|
||||
|
||||
switch (build_type) {
|
||||
case BT_ROAD: return ::GetPrice(PR_BUILD_ROAD, 1, NULL);
|
||||
case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_ROAD, 1, NULL);
|
||||
case BT_BUS_STOP: return ::GetPrice(PR_BUILD_STATION_BUS, 1, NULL);
|
||||
case BT_TRUCK_STOP: return ::GetPrice(PR_BUILD_STATION_TRUCK, 1, NULL);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,16 +63,6 @@ public:
|
||||
ROADVEHTYPE_TRUCK, //!< Build objects useable for trucks and cargo trams
|
||||
};
|
||||
|
||||
/**
|
||||
* Types of road-related objects in the game.
|
||||
*/
|
||||
enum BuildType {
|
||||
BT_ROAD, //!< Build a piece of road
|
||||
BT_DEPOT, //!< Build a road depot
|
||||
BT_BUS_STOP, //!< Build a bus stop
|
||||
BT_TRUCK_STOP, //!< Build a truck stop
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines whether a busstop or a truckstop is needed to transport a certain cargo.
|
||||
* @param cargo_type The cargo to test.
|
||||
@@ -263,7 +253,6 @@ public:
|
||||
* @exception AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
|
||||
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
|
||||
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
|
||||
* @note Construction will fail if an obstacle is found between the start and end tiles.
|
||||
* @return Whether the road has been/can be build or not.
|
||||
*/
|
||||
static bool BuildRoad(TileIndex start, TileIndex end);
|
||||
@@ -290,7 +279,6 @@ public:
|
||||
* @exception AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
|
||||
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
|
||||
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
|
||||
* @note Construction will fail if an obstacle is found between the start and end tiles.
|
||||
* @return Whether the road has been/can be build or not.
|
||||
*/
|
||||
static bool BuildOneWayRoad(TileIndex start, TileIndex end);
|
||||
@@ -313,7 +301,6 @@ public:
|
||||
* @exception AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
|
||||
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
|
||||
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
|
||||
* @note Construction will fail if an obstacle is found between the start and end tiles.
|
||||
* @return Whether the road has been/can be build or not.
|
||||
*/
|
||||
static bool BuildRoadFull(TileIndex start, TileIndex end);
|
||||
@@ -341,7 +328,6 @@ public:
|
||||
* @exception AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
|
||||
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
|
||||
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
|
||||
* @note Construction will fail if an obstacle is found between the start and end tiles.
|
||||
* @return Whether the road has been/can be build or not.
|
||||
*/
|
||||
static bool BuildOneWayRoadFull(TileIndex start, TileIndex end);
|
||||
@@ -465,15 +451,6 @@ public:
|
||||
*/
|
||||
static bool RemoveRoadStation(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Get the baseprice of building a road-related object.
|
||||
* @param roadtype the roadtype that is build (on)
|
||||
* @param build_type the type of object to build
|
||||
* @pre IsRoadTypeAvailable(railtype)
|
||||
* @return The baseprice of building the given object.
|
||||
*/
|
||||
static Money GetBuildCost(RoadType roadtype, BuildType build_type);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace SQConvert {
|
||||
template <> int Return<AIRoad::RoadType>(HSQUIRRELVM vm, AIRoad::RoadType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIRoad::RoadVehicleType GetParam(ForceType<AIRoad::RoadVehicleType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRoad::RoadVehicleType)tmp; }
|
||||
template <> int Return<AIRoad::RoadVehicleType>(HSQUIRRELVM vm, AIRoad::RoadVehicleType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AIRoad::BuildType GetParam(ForceType<AIRoad::BuildType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRoad::BuildType)tmp; }
|
||||
template <> int Return<AIRoad::BuildType>(HSQUIRRELVM vm, AIRoad::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow AIRoad to be used as Squirrel parameter */
|
||||
template <> AIRoad *GetParam(ForceType<AIRoad *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIRoad *)instance; }
|
||||
@@ -46,10 +44,6 @@ void SQAIRoad_Register(Squirrel *engine)
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::ROADTYPE_INVALID, "ROADTYPE_INVALID");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::ROADVEHTYPE_BUS, "ROADVEHTYPE_BUS");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::ROADVEHTYPE_TRUCK, "ROADVEHTYPE_TRUCK");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::BT_ROAD, "BT_ROAD");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::BT_DEPOT, "BT_DEPOT");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::BT_BUS_STOP, "BT_BUS_STOP");
|
||||
SQAIRoad.DefSQConst(engine, AIRoad::BT_TRUCK_STOP, "BT_TRUCK_STOP");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_ROAD_WORKS_IN_PROGRESS, AIRoad::ERR_ROAD_WORKS_IN_PROGRESS);
|
||||
AIError::RegisterErrorMap(STR_ERROR_DRIVE_THROUGH_DIRECTION, AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION);
|
||||
@@ -88,7 +82,6 @@ void SQAIRoad_Register(Squirrel *engine)
|
||||
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadFull, "RemoveRoadFull", 3, ".ii");
|
||||
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadDepot, "RemoveRoadDepot", 2, ".i");
|
||||
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadStation, "RemoveRoadStation", 2, ".i");
|
||||
SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetBuildCost, "GetBuildCost", 3, ".ii");
|
||||
|
||||
SQAIRoad.PostRegister(engine);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
DEBUG(ai, 0, "GetCoverageRadius(): coverage radius of airports needs to be requested via AIAirport::GetAirportCoverageRadius(), as it requires AirportType");
|
||||
return -1;
|
||||
}
|
||||
if (!HasExactlyOneBit(station_type)) return -1;
|
||||
if (CountBits(station_type) != 1) return -1;
|
||||
if (!_settings_game.station.modified_catchment) return CA_UNMODIFIED;
|
||||
|
||||
switch (station_type) {
|
||||
@@ -89,7 +89,7 @@
|
||||
/* static */ bool AIStation::HasStationType(StationID station_id, StationType station_type)
|
||||
{
|
||||
if (!IsValidStation(station_id)) return false;
|
||||
if (!HasExactlyOneBit(station_type)) return false;
|
||||
if (CountBits(station_type) != 1) return false;
|
||||
|
||||
return (::Station::Get(station_id)->facilities & station_type) != 0;
|
||||
}
|
||||
|
||||
+1
-17
@@ -19,7 +19,6 @@
|
||||
#include "../../tree_map.h"
|
||||
#include "../../town.h"
|
||||
#include "../../landscape.h"
|
||||
#include "../../economy_func.h"
|
||||
|
||||
/* static */ bool AITile::IsBuildable(TileIndex tile)
|
||||
{
|
||||
@@ -35,7 +34,7 @@
|
||||
if (::GetRoadTypes(tile) != ROADTYPES_ROAD) return false;
|
||||
/* Depots and crossings aren't considered buildable */
|
||||
if (::GetRoadTileType(tile) != ROAD_TILE_NORMAL) return false;
|
||||
if (!HasExactlyOneBit(::GetRoadBits(tile, ROADTYPE_ROAD))) return false;
|
||||
if (CountBits(::GetRoadBits(tile, ROADTYPE_ROAD)) != 1) return false;
|
||||
if (::IsRoadOwner(tile, ROADTYPE_ROAD, OWNER_TOWN)) return true;
|
||||
if (::IsRoadOwner(tile, ROADTYPE_ROAD, _current_company)) return true;
|
||||
return false;
|
||||
@@ -272,18 +271,3 @@
|
||||
|
||||
return ::ClosestTownFromTile(tile, UINT_MAX)->index;
|
||||
}
|
||||
|
||||
/* static */ Money AITile::GetBuildCost(BuildType build_type)
|
||||
{
|
||||
switch (build_type) {
|
||||
case BT_FOUNDATION: return ::GetPrice(PR_BUILD_FOUNDATION, 1, NULL);
|
||||
case BT_TERRAFORM: return ::GetPrice(PR_TERRAFORM, 1, NULL);
|
||||
case BT_BUILD_TREES: return ::GetPrice(PR_BUILD_TREES, 1, NULL);
|
||||
case BT_CLEAR_GRASS: return ::GetPrice(PR_CLEAR_GRASS, 1, NULL);
|
||||
case BT_CLEAR_ROUGH: return ::GetPrice(PR_CLEAR_ROUGH, 1, NULL);
|
||||
case BT_CLEAR_ROCKY: return ::GetPrice(PR_CLEAR_ROCKS, 1, NULL);
|
||||
case BT_CLEAR_FIELDS: return ::GetPrice(PR_CLEAR_FIELDS, 1, NULL);
|
||||
case BT_CLEAR_HOUSE: return ::GetPrice(PR_CLEAR_HOUSE, 1, NULL);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,20 +103,6 @@ public:
|
||||
TRANSPORT_INVALID = -1, //!< Tile without any transport type.
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the base cost for building/clearing several things.
|
||||
*/
|
||||
enum BuildType {
|
||||
BT_FOUNDATION, //!< Build a foundation under something
|
||||
BT_TERRAFORM, //!< Terraform
|
||||
BT_BUILD_TREES, //!< Build trees
|
||||
BT_CLEAR_GRASS, //!< Clear a tile with just grass
|
||||
BT_CLEAR_ROUGH, //!< Clear a rough tile
|
||||
BT_CLEAR_ROCKY, //!< Clear a tile with rocks
|
||||
BT_CLEAR_FIELDS, //!< Clear a tile with farm fields
|
||||
BT_CLEAR_HOUSE, //!< Clear a tile with a house
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this tile is buildable, i.e. no things on it that needs
|
||||
* demolishing.
|
||||
@@ -449,13 +435,6 @@ public:
|
||||
* @return The TownID of the town closest to the tile.
|
||||
*/
|
||||
static TownID GetClosestTown(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Get the baseprice of building/clearing various tile-related things.
|
||||
* @param build_type the type to build
|
||||
* @return The baseprice of building or removing the given object.
|
||||
*/
|
||||
static Money GetBuildCost(BuildType build_type);
|
||||
};
|
||||
|
||||
#endif /* AI_TILE_HPP */
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace SQConvert {
|
||||
template <> int Return<AITile::Slope>(HSQUIRRELVM vm, AITile::Slope res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AITile::TransportType GetParam(ForceType<AITile::TransportType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AITile::TransportType)tmp; }
|
||||
template <> int Return<AITile::TransportType>(HSQUIRRELVM vm, AITile::TransportType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
template <> AITile::BuildType GetParam(ForceType<AITile::BuildType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AITile::BuildType)tmp; }
|
||||
template <> int Return<AITile::BuildType>(HSQUIRRELVM vm, AITile::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow AITile to be used as Squirrel parameter */
|
||||
template <> AITile *GetParam(ForceType<AITile *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITile *)instance; }
|
||||
@@ -75,14 +73,6 @@ void SQAITile_Register(Squirrel *engine)
|
||||
SQAITile.DefSQConst(engine, AITile::TRANSPORT_WATER, "TRANSPORT_WATER");
|
||||
SQAITile.DefSQConst(engine, AITile::TRANSPORT_AIR, "TRANSPORT_AIR");
|
||||
SQAITile.DefSQConst(engine, AITile::TRANSPORT_INVALID, "TRANSPORT_INVALID");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_FOUNDATION, "BT_FOUNDATION");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_TERRAFORM, "BT_TERRAFORM");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_BUILD_TREES, "BT_BUILD_TREES");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_CLEAR_GRASS, "BT_CLEAR_GRASS");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_CLEAR_ROUGH, "BT_CLEAR_ROUGH");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_CLEAR_ROCKY, "BT_CLEAR_ROCKY");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_CLEAR_FIELDS, "BT_CLEAR_FIELDS");
|
||||
SQAITile.DefSQConst(engine, AITile::BT_CLEAR_HOUSE, "BT_CLEAR_HOUSE");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_HIGH);
|
||||
AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_LOW);
|
||||
@@ -126,7 +116,6 @@ void SQAITile_Register(Squirrel *engine)
|
||||
SQAITile.DefSQStaticMethod(engine, &AITile::PlantTreeRectangle, "PlantTreeRectangle", 4, ".iii");
|
||||
SQAITile.DefSQStaticMethod(engine, &AITile::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
|
||||
SQAITile.DefSQStaticMethod(engine, &AITile::GetClosestTown, "GetClosestTown", 2, ".i");
|
||||
SQAITile.DefSQStaticMethod(engine, &AITile::GetBuildCost, "GetBuildCost", 2, ".i");
|
||||
|
||||
SQAITile.PostRegister(engine);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/* static */ bool AIWaypoint::HasWaypointType(StationID waypoint_id, WaypointType waypoint_type)
|
||||
{
|
||||
if (!IsValidWaypoint(waypoint_id)) return false;
|
||||
if (!HasExactlyOneBit(waypoint_type)) return false;
|
||||
if (CountBits(waypoint_type) != 1) return false;
|
||||
|
||||
return (::Waypoint::Get(waypoint_id)->facilities & waypoint_type) != 0;
|
||||
}
|
||||
|
||||
+27
-20
@@ -200,7 +200,7 @@ static SpriteID GetAircraftIcon(EngineID engine)
|
||||
return DIR_W + _aircraft_sprite[spritenum];
|
||||
}
|
||||
|
||||
void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
|
||||
void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
|
||||
{
|
||||
SpriteID sprite = GetAircraftIcon(engine);
|
||||
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
|
||||
@@ -273,6 +273,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
v->owner = u->owner = _current_company;
|
||||
|
||||
v->tile = tile;
|
||||
// u->tile = 0;
|
||||
|
||||
uint x = TileX(tile) * TILE_SIZE + 5;
|
||||
uint y = TileY(tile) * TILE_SIZE + 3;
|
||||
@@ -283,10 +284,15 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
u->z_pos = GetSlopeZ(x, y);
|
||||
v->z_pos = u->z_pos + 1;
|
||||
|
||||
v->running_ticks = 0;
|
||||
|
||||
// u->delta_x = u->delta_y = 0;
|
||||
|
||||
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
|
||||
u->vehstatus = VS_HIDDEN | VS_UNCLICKABLE | VS_SHADOW;
|
||||
|
||||
v->spritenum = avi->image_index;
|
||||
// v->cargo_count = u->number_of_pieces = 0;
|
||||
|
||||
v->cargo_cap = avi->passenger_capacity;
|
||||
u->cargo_cap = avi->mail_capacity;
|
||||
@@ -294,8 +300,15 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
v->cargo_type = e->GetDefaultCargoType();
|
||||
u->cargo_type = CT_MAIL;
|
||||
|
||||
v->cargo_subtype = 0;
|
||||
|
||||
v->name = NULL;
|
||||
// v->next_order_param = v->next_order = 0;
|
||||
|
||||
// v->time_counter = 0;
|
||||
// v->progress = 0;
|
||||
v->last_station_visited = INVALID_STATION;
|
||||
// v->destination_coords = 0;
|
||||
|
||||
v->max_speed = avi->max_speed;
|
||||
v->acceleration = avi->acceleration;
|
||||
@@ -518,8 +531,10 @@ static void CheckIfAircraftNeedsService(Aircraft *v)
|
||||
|
||||
assert(st != NULL);
|
||||
|
||||
/* only goto depot if the target airport has a depot */
|
||||
if (st->GetAirportSpec()->nof_depots > 0 && CanVehicleUseStation(v, st)) {
|
||||
/* only goto depot if the target airport has terminals (eg. it is airport) */
|
||||
if (st->airport_tile != INVALID_TILE && st->Airport()->terminals != NULL) {
|
||||
// printf("targetairport = %d, st->index = %d\n", v->targetairport, st->index);
|
||||
// v->targetairport = st->index;
|
||||
v->current_order.MakeGoToDepot(st->index, ODTFB_SERVICE);
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
} else if (v->current_order.IsType(OT_GOTO_DEPOT)) {
|
||||
@@ -619,7 +634,7 @@ void SetAircraftPosition(Aircraft *v, int x, int y, int z)
|
||||
int safe_x = Clamp(x, 0, MapMaxX() * TILE_SIZE);
|
||||
int safe_y = Clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
|
||||
u->x_pos = x;
|
||||
u->y_pos = y - ((v->z_pos - GetSlopeZ(safe_x, safe_y)) >> 3);
|
||||
u->y_pos = y - ((v->z_pos - GetSlopeZ(safe_x, safe_y)) >> 3);;
|
||||
|
||||
safe_y = Clamp(u->y_pos, 0, MapMaxY() * TILE_SIZE);
|
||||
u->z_pos = GetSlopeZ(safe_x, safe_y);
|
||||
@@ -823,9 +838,6 @@ static byte AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *apc)
|
||||
return apc->entry_points[dir];
|
||||
}
|
||||
|
||||
|
||||
static void MaybeCrashAirplane(Aircraft *v);
|
||||
|
||||
/**
|
||||
* Controls the movement of an aircraft. This function actually moves the vehicle
|
||||
* on the map and takes care of minor things like sound playback.
|
||||
@@ -957,11 +969,6 @@ static bool AircraftController(Aircraft *v)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (amd->flag & AMED_BRAKE && v->cur_speed > SPEED_LIMIT_TAXI * _settings_game.vehicle.plane_speed) {
|
||||
MaybeCrashAirplane(v);
|
||||
if ((v->vehstatus & VS_CRASHED) != 0) return false;
|
||||
}
|
||||
|
||||
uint speed_limit = SPEED_LIMIT_TAXI;
|
||||
bool hard_limit = true;
|
||||
|
||||
@@ -1256,14 +1263,17 @@ static void CrashAirplane(Aircraft *v)
|
||||
v->Next()->cargo.Truncate(0);
|
||||
const Station *st = GetTargetAirportIfValid(v);
|
||||
StringID newsitem;
|
||||
AIEventVehicleCrashed::CrashReason crash_reason;
|
||||
if (st == NULL) {
|
||||
newsitem = STR_NEWS_PLANE_CRASH_OUT_OF_FUEL;
|
||||
crash_reason = AIEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT;
|
||||
} else {
|
||||
SetDParam(1, st->index);
|
||||
newsitem = STR_NEWS_AIRCRAFT_CRASH;
|
||||
crash_reason = AIEventVehicleCrashed::CRASH_PLANE_LANDING;
|
||||
}
|
||||
|
||||
AI::NewEvent(v->owner, new AIEventVehicleCrashed(v->index, v->tile, st == NULL ? AIEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : AIEventVehicleCrashed::CRASH_PLANE_LANDING));
|
||||
AI::NewEvent(v->owner, new AIEventVehicleCrashed(v->index, v->tile, crash_reason));
|
||||
|
||||
AddVehicleNewsItem(newsitem,
|
||||
NS_ACCIDENT,
|
||||
@@ -1275,21 +1285,17 @@ static void CrashAirplane(Aircraft *v)
|
||||
|
||||
static void MaybeCrashAirplane(Aircraft *v)
|
||||
{
|
||||
if (_settings_game.vehicle.plane_crashes == 0) return;
|
||||
|
||||
Station *st = Station::Get(v->targetairport);
|
||||
|
||||
/* FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports */
|
||||
uint32 prob = (0x4000 << _settings_game.vehicle.plane_crashes);
|
||||
uint16 prob = 0x10000 / 1500;
|
||||
if ((st->Airport()->flags & AirportFTAClass::SHORT_STRIP) &&
|
||||
(AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) &&
|
||||
!_cheats.no_jetcrash.value) {
|
||||
prob /= 20;
|
||||
} else {
|
||||
prob /= 1500;
|
||||
prob = 0x10000 / 20;
|
||||
}
|
||||
|
||||
if (GB(Random(), 0, 22) > prob) return;
|
||||
if (GB(Random(), 0, 16) > prob) return;
|
||||
|
||||
/* Crash the airplane. Remove all goods stored at the station. */
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
@@ -1332,6 +1338,7 @@ static void AircraftLandAirplane(Aircraft *v)
|
||||
if (!PlayVehicleSound(v, VSE_TOUCHDOWN)) {
|
||||
SndPlayVehicleFx(SND_17_SKID_PLANE, v);
|
||||
}
|
||||
MaybeCrashAirplane(v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s
|
||||
int x = rtl ? right - real_sprite->width - real_sprite->x_offs : left - real_sprite->x_offs;
|
||||
bool helicopter = v->subtype == AIR_HELICOPTER;
|
||||
|
||||
PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
|
||||
SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
|
||||
DrawSprite(sprite, pal, x, y + 10);
|
||||
if (helicopter) {
|
||||
const Aircraft *a = Aircraft::From(v);
|
||||
|
||||
+106
-1
@@ -16,7 +16,112 @@
|
||||
#include "core/alloc_func.hpp"
|
||||
#include "date_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "table/airporttile_ids.h"
|
||||
|
||||
|
||||
/* 8-66 are mapped to 0-58, 83+ are mapped to 59+ */
|
||||
enum AirportTiles {
|
||||
APT_APRON = 0,
|
||||
APT_APRON_FENCE_NW = 1,
|
||||
APT_APRON_FENCE_SW = 2,
|
||||
APT_STAND = 3,
|
||||
APT_APRON_W = 4,
|
||||
APT_APRON_S = 5,
|
||||
APT_APRON_VER_CROSSING_S = 6,
|
||||
APT_APRON_HOR_CROSSING_W = 7,
|
||||
APT_APRON_VER_CROSSING_N = 8,
|
||||
APT_APRON_HOR_CROSSING_E = 9,
|
||||
APT_APRON_E = 10,
|
||||
APT_ARPON_N = 11,
|
||||
APT_APRON_HOR = 12,
|
||||
APT_APRON_N_FENCE_SW = 13,
|
||||
APT_RUNWAY_1 = 14,
|
||||
APT_RUNWAY_2 = 15,
|
||||
APT_RUNWAY_3 = 16,
|
||||
APT_RUNWAY_4 = 17,
|
||||
APT_RUNWAY_END_FENCE_SE = 18,
|
||||
APT_BUILDING_2 = 19,
|
||||
APT_TOWER_FENCE_SW = 20,
|
||||
APT_ROUND_TERMINAL = 21,
|
||||
APT_BUILDING_3 = 22,
|
||||
APT_BUILDING_1 = 23,
|
||||
APT_DEPOT_SE = 24,
|
||||
APT_STAND_1 = 25,
|
||||
APT_STAND_PIER_NE = 26,
|
||||
APT_PIER_NW_NE = 27,
|
||||
APT_PIER = 28,
|
||||
APT_EMPTY = 29,
|
||||
APT_EMPTY_FENCE_NE = 30,
|
||||
APT_RADAR_GRASS_FENCE_SW = 31,
|
||||
/* 32-42 are for turning the radar */
|
||||
APT_RADIO_TOWER_FENCE_NE = 43,
|
||||
APT_SMALL_BUILDING_3 = 44,
|
||||
APT_SMALL_BUILDING_2 = 45,
|
||||
APT_SMALL_BUILDING_1 = 46,
|
||||
APT_GRASS_FENCE_SW = 47,
|
||||
APT_GRASS_2 = 48,
|
||||
APT_GRASS_1 = 49,
|
||||
APT_GRASS_FENCE_NE_FLAG = 50,
|
||||
/* 51-53 are for flag animation */
|
||||
APT_RUNWAY_SMALL_NEAR_END = 54,
|
||||
APT_RUNWAY_SMALL_MIDDLE = 55,
|
||||
APT_RUNWAY_SMALL_FAR_END = 56,
|
||||
APT_SMALL_DEPOT_SE = 57,
|
||||
APT_HELIPORT = 58,
|
||||
APT_RUNWAY_END = 59,
|
||||
APT_RUNWAY_5 = 60,
|
||||
APT_TOWER = 61,
|
||||
APT_SMALL_DEPOT_SE_2 = 62, // unused (copy of APT_SMALL_DEPOT_SE)
|
||||
APT_APRON_FENCE_NE = 63,
|
||||
APT_RUNWAY_END_FENCE_NW = 64,
|
||||
APT_RUNWAY_FENCE_NW = 65,
|
||||
APT_RADAR_FENCE_SW = 66,
|
||||
/* 67-77 are for turning the radar */
|
||||
APT_RADAR_FENCE_NE = 78,
|
||||
/* 79-89 are for turning the radar */
|
||||
APT_HELIPAD_1 = 90,
|
||||
APT_HELIPAD_2_FENCE_NW = 91,
|
||||
APT_HELIPAD_2 = 92,
|
||||
APT_APRON_FENCE_NE_SW = 93,
|
||||
APT_RUNWAY_END_FENCE_NW_SW = 94,
|
||||
APT_RUNWAY_END_FENCE_SE_SW = 95,
|
||||
APT_RUNWAY_END_FENCE_NE_NW = 96,
|
||||
APT_RUNWAY_END_FENCE_NE_SE = 97,
|
||||
APT_HELIPAD_2_FENCE_NE_SE = 98,
|
||||
APT_APRON_FENCE_SE_SW = 99,
|
||||
APT_LOW_BUILDING_FENCE_N = 100,
|
||||
APT_ROT_RUNWAY_FENCE_NE = 101, // unused
|
||||
APT_ROT_RUNWAY_END_FENCE_NE= 102, // unused
|
||||
APT_ROT_RUNWAY_FENCE_SW = 103, // unused
|
||||
APT_ROT_RUNWAY_END_FENCE_SW= 104, // unused
|
||||
APT_DEPOT_SW = 105, // unused
|
||||
APT_DEPOT_NW = 106, // unused
|
||||
APT_DEPOT_NE = 107, // unused
|
||||
APT_HELIPAD_2_FENCE_SE_SW = 108, // unused
|
||||
APT_HELIPAD_2_FENCE_SE = 109, // unused
|
||||
APT_LOW_BUILDING_FENCE_NW = 110,
|
||||
APT_LOW_BUILDING_FENCE_NE = 111, // unused
|
||||
APT_LOW_BUILDING_FENCE_SW = 112, // unused
|
||||
APT_LOW_BUILDING_FENCE_SE = 113, // unused
|
||||
APT_STAND_FENCE_NE = 114, // unused
|
||||
APT_STAND_FENCE_SE = 115, // unused
|
||||
APT_STAND_FENCE_SW = 116, // unused
|
||||
APT_APRON_FENCE_NE_2 = 117, // unused (copy of APT_APRON_FENCE_NE)
|
||||
APT_APRON_FENCE_SE = 118,
|
||||
APT_HELIPAD_2_FENCE_NW_SW = 119, // unused
|
||||
APT_HELIPAD_2_FENCE_SW = 120, // unused
|
||||
APT_RADAR_FENCE_SE = 121, // unused
|
||||
/* 122-132 used for radar rotation */
|
||||
APT_HELIPAD_3_FENCE_SE_SW = 133,
|
||||
APT_HELIPAD_3_FENCE_NW_SW = 134,
|
||||
APT_HELIPAD_3_FENCE_NW = 135,
|
||||
APT_LOW_BUILDING = 136,
|
||||
APT_APRON_FENCE_NE_SE = 137,
|
||||
APT_APRON_HALF_EAST = 138,
|
||||
APT_APRON_HALF_WEST = 139,
|
||||
APT_GRASS_FENCE_NE_FLAG_2 = 140,
|
||||
/* 141-143 used for flag animation */
|
||||
};
|
||||
|
||||
#include "table/airport_defaults.h"
|
||||
#include "table/airporttiles.h"
|
||||
|
||||
|
||||
+6
-2
@@ -21,7 +21,11 @@ enum {
|
||||
MAX_TERMINALS = 10, ///< maximum number of terminals per airport
|
||||
MAX_HELIPADS = 4, ///< maximum number of helipads per airport
|
||||
MAX_ELEMENTS = 255, ///< maximum number of aircraft positions at airport
|
||||
NUM_AIRPORTTILES = 74, ///< total number of airport tiles
|
||||
NUM_AIRPORTTILES = 144, ///< total number of airport tiles
|
||||
};
|
||||
|
||||
enum {
|
||||
AIRPORTTILE_NOANIM = 0xFF, ///< flag to mark airport tiles as having no animation
|
||||
};
|
||||
|
||||
/** Airport types */
|
||||
@@ -75,7 +79,7 @@ struct AirportSpec {
|
||||
* Defines the data structure of each indivudual tile of an airport.
|
||||
*/
|
||||
struct AirportTileSpec {
|
||||
uint16 animation_info; ///< Information about the animation (is it looping, how many loops etc)
|
||||
StationGfx anim_next; ///< Next StationGfx in an animation
|
||||
uint8 animation_speed; ///< The speed of the animation
|
||||
|
||||
static const AirportTileSpec *Get(StationGfx gfx);
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ struct BuildAirToolbarWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
if (!IsInsideBS(widget, ATW_AIRPORT, lengthof(_build_air_button_proc))) return;
|
||||
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case BAW_SMALL_AIRPORT: case BAW_CITY_AIRPORT: case BAW_HELIPORT: case BAW_METRO_AIRPORT:
|
||||
|
||||
@@ -170,7 +170,7 @@ void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type,
|
||||
EngineID artic_engine = GetNextArticPart(i, engine);
|
||||
if (artic_engine == INVALID_ENGINE) break;
|
||||
|
||||
veh_cargos = GetAvailableVehicleCargoTypes(artic_engine, include_initial_cargo_type);
|
||||
veh_cargos = GetAvailableVehicleCargoTypes(artic_engine, include_initial_cargo_type);;
|
||||
*union_mask |= veh_cargos;
|
||||
if (veh_cargos != 0) *intersection_mask &= veh_cargos;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,9 @@ static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b)
|
||||
*/
|
||||
bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
|
||||
{
|
||||
assert(Engine::IsValidID(from) && Engine::IsValidID(to));
|
||||
/* First we make sure that it's a valid type the user requested
|
||||
* check that it's an engine that is in the engine array */
|
||||
if (!Engine::IsValidID(from) || !Engine::IsValidID(to)) return false;
|
||||
|
||||
/* we can't replace an engine into itself (that would be autorenew) */
|
||||
if (from == to) return false;
|
||||
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE:
|
||||
|
||||
@@ -24,7 +24,7 @@ template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::availab
|
||||
*/
|
||||
#define fetch_metadata(name) \
|
||||
item = metadata->GetItem(name, false); \
|
||||
if (item == NULL || StrEmpty(item->value)) { \
|
||||
if (item == NULL || strlen(item->value) == 0) { \
|
||||
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing", name); \
|
||||
return false; \
|
||||
}
|
||||
@@ -140,7 +140,7 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length)
|
||||
bool ret = false;
|
||||
DEBUG(grf, 1, "Checking %s for base " SET_TYPE " set", filename);
|
||||
|
||||
Tbase_set *set = new Tbase_set();
|
||||
Tbase_set *set = new Tbase_set();;
|
||||
IniFile *ini = new IniFile();
|
||||
ini->LoadFromDisk(filename);
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)
|
||||
void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColourMappingRect() */
|
||||
@@ -261,6 +261,17 @@ void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = colour;
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) {
|
||||
*dst = LookupColourInPalette(colour);
|
||||
/* Set the colour in the anim-buffer too, if we are rendering to the screen */
|
||||
if (_screen_disable_anim) return;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = colour;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
|
||||
@@ -28,8 +28,9 @@ public:
|
||||
{}
|
||||
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
|
||||
|
||||
@@ -22,6 +22,12 @@ void Blitter_32bppBase::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) *dst = LookupColourInPalette(colour);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
uint32 colour32 = LookupColourInPalette(colour);
|
||||
|
||||
@@ -20,10 +20,11 @@ class Blitter_32bppBase : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 32; }
|
||||
// /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
// /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
|
||||
// /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
|
||||
@@ -63,7 +63,7 @@ void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoo
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)
|
||||
void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class Blitter_32bppSimple : public Blitter_32bppBase {
|
||||
public:
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
|
||||
/* virtual */ const char *GetName() { return "32bpp-simple"; }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../gfx_func.h"
|
||||
#include "8bpp_base.hpp"
|
||||
|
||||
void Blitter_8bppBase::DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)
|
||||
void Blitter_8bppBase::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
const uint8 *ctab = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
|
||||
@@ -33,6 +33,12 @@ void Blitter_8bppBase::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
*((uint8 *)video + x + y * _screen.pitch) = colour;
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint8 *dst = (uint8 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) *dst = colour;
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
do {
|
||||
|
||||
@@ -18,10 +18,11 @@ class Blitter_8bppBase : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 8; }
|
||||
// /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
|
||||
@@ -57,7 +57,7 @@ void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoom
|
||||
Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator)
|
||||
{
|
||||
Sprite *dest_sprite;
|
||||
dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width);
|
||||
dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width);;
|
||||
|
||||
dest_sprite->height = sprite->height;
|
||||
dest_sprite->width = sprite->width;
|
||||
|
||||
+10
-1
@@ -68,7 +68,7 @@ public:
|
||||
* @param height the height of the buffer.
|
||||
* @param pal the palette to use.
|
||||
*/
|
||||
virtual void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) = 0;
|
||||
virtual void DrawColourMappingRect(void *dst, int width, int height, int pal) = 0;
|
||||
|
||||
/**
|
||||
* Convert a sprite from the loader to our own format.
|
||||
@@ -94,6 +94,15 @@ public:
|
||||
*/
|
||||
virtual void SetPixel(void *video, int x, int y, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Draw a pixel with a given colour on the video-buffer if there is currently a black pixel.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
* @param x The x position within video-buffer.
|
||||
* @param y The y position within video-buffer.
|
||||
* @param colour A 8bpp mapping colour.
|
||||
*/
|
||||
virtual void SetPixelIfEmpty(void *video, int x, int y, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Make a single horizontal line in a single colour on the video-buffer.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
delete *GetActiveBlitter();
|
||||
*GetActiveBlitter() = newb;
|
||||
|
||||
DEBUG(driver, 1, "Successfully %s blitter '%s'", StrEmpty(name) ? "probed" : "loaded", bname);
|
||||
DEBUG(driver, 1, "Successfully %s blitter '%s'",StrEmpty(name) ? "probed" : "loaded", bname);
|
||||
return newb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,11 @@ class Blitter_Null : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 0; }
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {};
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal) {};
|
||||
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y) { return NULL; };
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour) {};
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour) {};
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {};
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ struct BridgeSpec {
|
||||
uint16 price; ///< the price multiplier
|
||||
uint16 speed; ///< maximum travel speed
|
||||
SpriteID sprite; ///< the sprite which is used in the GUI
|
||||
PaletteID pal; ///< the palette which is used in the GUI
|
||||
SpriteID pal; ///< the palette which is used in the GUI
|
||||
StringID material; ///< the string that contains the bridge description
|
||||
StringID transport_name[2]; ///< description of the bridge, when built for road or rail
|
||||
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
|
||||
|
||||
+2
-2
@@ -243,7 +243,7 @@ public:
|
||||
return ES_NOT_HANDLED;
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
default: break;
|
||||
@@ -319,7 +319,7 @@ static const NWidgetPart _nested_build_bridge_widgets[] = {
|
||||
/* Sort order + criteria buttons */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_DARK_GREEN, BBSW_DROPDOWN_ORDER), SetFill(1, 0), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_DARK_GREEN, BBSW_DROPDOWN_CRITERIA), SetFill(1, 0), SetDataTip(0x0, STR_TOOLTIP_SORT_CRITERIA),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_DARK_GREEN, BBSW_DROPDOWN_CRITERIA), SetFill(1, 0), SetDataTip(0x0, STR_TOOLTIP_SORT_CRITERIAP),
|
||||
EndContainer(),
|
||||
/* Matrix. */
|
||||
NWidget(WWT_MATRIX, COLOUR_DARK_GREEN, BBSW_BRIDGE_LIST), SetFill(1, 0), SetResize(0, 22), SetDataTip(0x401, STR_SELECT_BRIDGE_SELECTION_TOOLTIP),
|
||||
|
||||
@@ -70,7 +70,7 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = {
|
||||
NWidget(NWID_SPACER), SetFill(1, 1),
|
||||
EndContainer(),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_GREY, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIA),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_GREY, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIAP),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_GREY, BUILD_VEHICLE_WIDGET_CARGO_FILTER_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_FILTER_CRITERIA),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
@@ -479,7 +479,7 @@ static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engin
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
|
||||
/* Max tractive effort - not applicable if old acceleration or maglev */
|
||||
if (_settings_game.vehicle.train_acceleration_model != AM_ORIGINAL && GetRailTypeInfo(rvi->railtype)->acceleration_type != 2) {
|
||||
if (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && GetRailTypeInfo(rvi->railtype)->acceleration_type != 2) {
|
||||
SetDParam(0, e->GetDisplayMaxTractiveEffort());
|
||||
DrawString(left, right, y, STR_PURCHASE_INFO_MAX_TE);
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
@@ -1002,7 +1002,7 @@ struct BuildVehicleWindow : Window {
|
||||
this->eng_list.RebuildDone();
|
||||
}
|
||||
|
||||
void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING:
|
||||
@@ -1017,7 +1017,6 @@ struct BuildVehicleWindow : Window {
|
||||
size_t num_items = this->eng_list.Length();
|
||||
this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE;
|
||||
this->SetDirty();
|
||||
if (click_count > 1) this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1129,6 +1128,14 @@ struct BuildVehicleWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDoubleClick(Point pt, int widget)
|
||||
{
|
||||
if (widget == BUILD_VEHICLE_WIDGET_LIST) {
|
||||
/* When double clicking, we want to buy a vehicle */
|
||||
this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnQueryTextFinished(char *str)
|
||||
{
|
||||
if (str == NULL) return;
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ struct CheatWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(CW_PANEL);
|
||||
uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP - this->header_height) / (FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL);
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlag flags)
|
||||
PR_CLEAR_GRASS,
|
||||
PR_CLEAR_ROUGH,
|
||||
PR_CLEAR_ROCKS,
|
||||
PR_CLEAR_FIELDS,
|
||||
PR_CLEAR_FILEDS,
|
||||
PR_CLEAR_ROUGH,
|
||||
PR_CLEAR_ROUGH,
|
||||
};
|
||||
|
||||
+5
-7
@@ -65,6 +65,7 @@ CommandProc CmdRemoveRoadStop;
|
||||
CommandProc CmdBuildLongRoad;
|
||||
CommandProc CmdRemoveLongRoad;
|
||||
CommandProc CmdBuildRoad;
|
||||
CommandProc CmdRemoveRoad;
|
||||
|
||||
CommandProc CmdBuildRoadDepot;
|
||||
|
||||
@@ -220,7 +221,8 @@ static const Command _command_proc_table[] = {
|
||||
{CmdRemoveRoadStop, 0}, // CMD_REMOVE_ROAD_STOP
|
||||
{CmdBuildLongRoad, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_LONG_ROAD
|
||||
{CmdRemoveLongRoad, CMD_NO_TEST | CMD_AUTO}, // CMD_REMOVE_LONG_ROAD; towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed.
|
||||
{CmdBuildRoad, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_ROAD
|
||||
{CmdBuildRoad, 0}, // CMD_BUILD_ROAD
|
||||
{CmdRemoveRoad, 0}, // CMD_REMOVE_ROAD
|
||||
{CmdBuildRoadDepot, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_ROAD_DEPOT
|
||||
|
||||
{CmdBuildAirport, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_AIRPORT
|
||||
@@ -682,16 +684,12 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd,
|
||||
#undef return_dcpi
|
||||
|
||||
|
||||
/**
|
||||
* Adds the cost of the given command return value to this cost.
|
||||
* Also takes a possible error message when it is set.
|
||||
* @param ret The command to add the cost of.
|
||||
*/
|
||||
void CommandCost::AddCost(const CommandCost &ret)
|
||||
CommandCost CommandCost::AddCost(CommandCost ret)
|
||||
{
|
||||
this->AddCost(ret.cost);
|
||||
if (this->success && !ret.success) {
|
||||
this->message = ret.message;
|
||||
this->success = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
+20
-10
@@ -48,34 +48,43 @@ public:
|
||||
* @param ex_t the expense type
|
||||
* @param cst the initial cost of this command
|
||||
*/
|
||||
CommandCost(ExpensesType ex_t, const Money &cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
|
||||
CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
|
||||
|
||||
/**
|
||||
* Adds the cost of the given command return value to this cost.
|
||||
* Also takes a possible error message when it is set.
|
||||
* @param ret the command to add the cost of.
|
||||
* @return this class.
|
||||
*/
|
||||
CommandCost AddCost(CommandCost ret);
|
||||
|
||||
/**
|
||||
* Adds the given cost to the cost of the command.
|
||||
* @param cost the cost to add
|
||||
* @return this class.
|
||||
*/
|
||||
FORCEINLINE void AddCost(const Money &cost)
|
||||
CommandCost AddCost(Money cost)
|
||||
{
|
||||
this->cost += cost;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void AddCost(const CommandCost &cmd_cost);
|
||||
|
||||
/**
|
||||
* Multiplies the cost of the command by the given factor.
|
||||
* @param factor factor to multiply the costs with
|
||||
* @return this class
|
||||
*/
|
||||
FORCEINLINE void MultiplyCost(int factor)
|
||||
CommandCost MultiplyCost(int factor)
|
||||
{
|
||||
this->cost *= factor;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The costs as made up to this moment
|
||||
* @return the costs
|
||||
*/
|
||||
FORCEINLINE Money GetCost() const
|
||||
Money GetCost() const
|
||||
{
|
||||
return this->cost;
|
||||
}
|
||||
@@ -84,7 +93,7 @@ public:
|
||||
* The expense type of the cost
|
||||
* @return the expense type
|
||||
*/
|
||||
FORCEINLINE ExpensesType GetExpensesType() const
|
||||
ExpensesType GetExpensesType() const
|
||||
{
|
||||
return this->expense_type;
|
||||
}
|
||||
@@ -92,7 +101,7 @@ public:
|
||||
/**
|
||||
* Sets the global error message *if* this class has one.
|
||||
*/
|
||||
FORCEINLINE void SetGlobalErrorMessage() const
|
||||
void SetGlobalErrorMessage() const
|
||||
{
|
||||
extern StringID _error_message;
|
||||
if (this->message != INVALID_STRING_ID) _error_message = this->message;
|
||||
@@ -126,7 +135,7 @@ public:
|
||||
* Did this command succeed?
|
||||
* @return true if and only if it succeeded
|
||||
*/
|
||||
FORCEINLINE bool Succeeded() const
|
||||
bool Succeeded() const
|
||||
{
|
||||
return this->success;
|
||||
}
|
||||
@@ -135,7 +144,7 @@ public:
|
||||
* Did this command fail?
|
||||
* @return true if and only if it failed
|
||||
*/
|
||||
FORCEINLINE bool Failed() const
|
||||
bool Failed() const
|
||||
{
|
||||
return !this->success;
|
||||
}
|
||||
@@ -179,6 +188,7 @@ enum {
|
||||
CMD_BUILD_LONG_ROAD, ///< build a complete road (not a "half" one)
|
||||
CMD_REMOVE_LONG_ROAD, ///< remove a complete road (not a "half" one)
|
||||
CMD_BUILD_ROAD, ///< build a "half" road
|
||||
CMD_REMOVE_ROAD, ///< remove a "half" road
|
||||
CMD_BUILD_ROAD_DEPOT, ///< build a road depot
|
||||
|
||||
CMD_BUILD_AIRPORT, ///< build an airport
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ struct Company : CompanyPool::PoolItem<&_company_pool> {
|
||||
#define FOR_ALL_COMPANIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Company, company_index, var, start)
|
||||
#define FOR_ALL_COMPANIES(var) FOR_ALL_COMPANIES_FROM(var, 0)
|
||||
|
||||
Money CalculateCompanyValue(const Company *c, bool including_loan = true);
|
||||
Money CalculateCompanyValue(const Company *c);
|
||||
|
||||
extern uint _next_competitor_start;
|
||||
extern uint _cur_company_tick_index;
|
||||
|
||||
+3
-9
@@ -507,7 +507,6 @@ void StartupCompanies()
|
||||
_next_competitor_start = 0;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
static void MaybeStartNewCompany()
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
@@ -528,7 +527,6 @@ static void MaybeStartNewCompany()
|
||||
DoCommandP(0, 1, INVALID_COMPANY, CMD_COMPANY_CTRL);
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_AI */
|
||||
|
||||
void InitializeCompanies()
|
||||
{
|
||||
@@ -610,7 +608,6 @@ void OnTick_Companies()
|
||||
if (c->bankrupt_asked != 0) HandleBankruptcyTakeover(c);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
if (_next_competitor_start == 0) {
|
||||
_next_competitor_start = AI::GetStartNextTime() * DAY_TICKS;
|
||||
}
|
||||
@@ -618,7 +615,6 @@ void OnTick_Companies()
|
||||
if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) {
|
||||
MaybeStartNewCompany();
|
||||
}
|
||||
#endif /* ENABLE_AI */
|
||||
|
||||
_cur_company_tick_index = (_cur_company_tick_index + 1) % MAX_COMPANIES;
|
||||
}
|
||||
@@ -667,10 +663,7 @@ CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
|
||||
CommandCost cost;
|
||||
|
||||
if (!Group::IsValidID(id_g) && !IsAllGroupID(id_g) && !IsDefaultGroupID(id_g)) return CMD_ERROR;
|
||||
if (!Engine::IsValidID(old_engine_type)) return CMD_ERROR;
|
||||
|
||||
if (new_engine_type != INVALID_ENGINE) {
|
||||
if (!Engine::IsValidID(new_engine_type)) return CMD_ERROR;
|
||||
if (!CheckAutoreplaceValidity(old_engine_type, new_engine_type, _current_company)) return CMD_ERROR;
|
||||
|
||||
cost = AddEngineReplacementForCompany(c, old_engine_type, new_engine_type, id_g, flags);
|
||||
@@ -678,7 +671,7 @@ CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
|
||||
cost = RemoveEngineReplacementForCompany(c, old_engine_type, id_g, flags);
|
||||
}
|
||||
|
||||
if ((flags & DC_EXEC) && IsLocalCompany()) InvalidateAutoreplaceWindow(old_engine_type, id_g);
|
||||
if (IsLocalCompany()) InvalidateAutoreplaceWindow(old_engine_type, id_g);
|
||||
|
||||
return cost;
|
||||
}
|
||||
@@ -776,7 +769,8 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
assert(_local_company == COMPANY_SPECTATOR);
|
||||
SetLocalCompany(c->index);
|
||||
if (!StrEmpty(_settings_client.network.default_company_pass)) {
|
||||
NetworkChangeCompanyPassword(_settings_client.network.default_company_pass);
|
||||
char *password = _settings_client.network.default_company_pass;
|
||||
NetworkChangeCompanyPassword(1, &password);
|
||||
}
|
||||
|
||||
_current_company = _local_company;
|
||||
|
||||
+12
-12
@@ -433,7 +433,7 @@ struct CompanyFinancesWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case CFW_TOGGLE_SIZE: // toggle size
|
||||
@@ -729,7 +729,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
/* Livery Class buttons */
|
||||
@@ -846,7 +846,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
|
||||
bool has_moustache = !HasBit(ge, GENDER_FEMALE) && GetCompanyManagerFaceBits(cmf, CMFV_HAS_MOUSTACHE, ge) != 0;
|
||||
bool has_tie_earring = !HasBit(ge, GENDER_FEMALE) || GetCompanyManagerFaceBits(cmf, CMFV_HAS_TIE_EARRING, ge) != 0;
|
||||
bool has_glasses = GetCompanyManagerFaceBits(cmf, CMFV_HAS_GLASSES, ge) != 0;
|
||||
PaletteID pal;
|
||||
SpriteID pal;
|
||||
|
||||
/* Modify eye colour palette only if 2 or more valid values exist */
|
||||
if (_cmf_info[CMFV_EYE_COLOUR].valid_values[ge] < 2) {
|
||||
@@ -1328,25 +1328,25 @@ public:
|
||||
|
||||
|
||||
case SCMFW_WIDGET_HAS_MOUSTACHE_EARRING:
|
||||
if (this->is_female) { // Only for female faces
|
||||
if (this->is_female) { /* Only for female faces */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_HAS_MOUSTACHE_EARRING, GetCompanyManagerFaceBits(this->face, CMFV_HAS_TIE_EARRING, this->ge), true);
|
||||
} else { // Only for male faces
|
||||
} else { /* Only for male faces */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_HAS_MOUSTACHE_EARRING, GetCompanyManagerFaceBits(this->face, CMFV_HAS_MOUSTACHE, this->ge), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCMFW_WIDGET_TIE_EARRING:
|
||||
if (this->is_female) { // Only for female faces
|
||||
if (this->is_female) { /* Only for female faces */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_TIE_EARRING, GetCompanyManagerFaceBits(this->face, CMFV_TIE_EARRING, this->ge), false);
|
||||
} else { // Only for male faces
|
||||
} else { /* Only for male faces */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_TIE_EARRING, GetCompanyManagerFaceBits(this->face, CMFV_TIE_EARRING, this->ge), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCMFW_WIDGET_LIPS_MOUSTACHE:
|
||||
if (this->is_moust_male) { // Only for male faces with moustache
|
||||
if (this->is_moust_male) { /* Only for male faces with moustache */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_LIPS_MOUSTACHE, GetCompanyManagerFaceBits(this->face, CMFV_MOUSTACHE, this->ge), false);
|
||||
} else { // Only for female faces or male faces without moustache
|
||||
} else { /* Only for female faces or male faces without moustache */
|
||||
this->DrawFaceStringLabel(SCMFW_WIDGET_LIPS_MOUSTACHE, GetCompanyManagerFaceBits(this->face, CMFV_LIPS, this->ge), false);
|
||||
}
|
||||
break;
|
||||
@@ -1393,7 +1393,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
/* Toggle size, advanced/simple face selection */
|
||||
@@ -1916,7 +1916,7 @@ struct CompanyWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case CW_WIDGET_NEW_FACE: DoSelectCompanyManagerFace(this); break;
|
||||
@@ -2115,7 +2115,7 @@ struct BuyCompanyWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case BCW_NO:
|
||||
|
||||
+405
-21
@@ -15,7 +15,6 @@
|
||||
#include "network/network_func.h"
|
||||
#include "debug.h"
|
||||
#include "console_func.h"
|
||||
#include "settings_type.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -28,9 +27,13 @@
|
||||
#define ICON_TOKEN_COUNT 20
|
||||
|
||||
/* console parser */
|
||||
IConsoleCmd *_iconsole_cmds; ///< list of registered commands
|
||||
IConsoleAlias *_iconsole_aliases; ///< list of registered aliases
|
||||
IConsoleCmd *_iconsole_cmds; ///< list of registred commands
|
||||
IConsoleVar *_iconsole_vars; ///< list of registred vars
|
||||
IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
|
||||
|
||||
/* ** stdlib ** */
|
||||
byte _stdlib_developer = 1;
|
||||
bool _stdlib_con_developer = false;
|
||||
FILE *_iconsole_output_file;
|
||||
|
||||
void IConsoleInit()
|
||||
@@ -143,8 +146,8 @@ void CDECL IConsolePrintF(ConsoleColour colour_code, const char *format, ...)
|
||||
*/
|
||||
void IConsoleDebug(const char *dbg, const char *string)
|
||||
{
|
||||
if (_settings_client.gui.developer <= 1) return;
|
||||
IConsolePrintF(CC_DEBUG, "dbg: [%s] %s", dbg, string);
|
||||
if (_stdlib_developer > 1)
|
||||
IConsolePrintF(CC_DEBUG, "dbg: [%s] %s", dbg, string);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,8 +157,8 @@ void IConsoleDebug(const char *dbg, const char *string)
|
||||
*/
|
||||
void IConsoleWarning(const char *string)
|
||||
{
|
||||
if (_settings_client.gui.developer == 0) return;
|
||||
IConsolePrintF(CC_WARNING, "WARNING: %s", string);
|
||||
if (_stdlib_developer > 0)
|
||||
IConsolePrintF(CC_WARNING, "WARNING: %s", string);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,9 +194,92 @@ bool GetArgumentInteger(uint32 *value, const char *arg)
|
||||
return arg != endptr;
|
||||
}
|
||||
|
||||
/* * *************************
|
||||
* hooking code *
|
||||
* *************************/
|
||||
|
||||
/**
|
||||
* General internal hooking code that is the same for both commands and variables
|
||||
* @param hooks IConsoleHooks structure that will be set according to
|
||||
* @param type type access trigger
|
||||
* @param proc function called when the hook criteria is met
|
||||
*/
|
||||
static void IConsoleHookAdd(IConsoleHooks *hooks, IConsoleHookTypes type, IConsoleHook *proc)
|
||||
{
|
||||
if (hooks == NULL || proc == NULL) return;
|
||||
|
||||
switch (type) {
|
||||
case ICONSOLE_HOOK_ACCESS:
|
||||
hooks->access = proc;
|
||||
break;
|
||||
case ICONSOLE_HOOK_PRE_ACTION:
|
||||
hooks->pre = proc;
|
||||
break;
|
||||
case ICONSOLE_HOOK_POST_ACTION:
|
||||
hooks->post = proc;
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any special hook triggers. If the hook type is met check if
|
||||
* there is a function associated with that and if so, execute it
|
||||
* @param hooks IConsoleHooks structure that will be checked
|
||||
* @param type type of hook, trigger that needs to be activated
|
||||
* @return true on a successful execution of the hook command or if there
|
||||
* is no hook/trigger present at all. False otherwise
|
||||
*/
|
||||
static bool IConsoleHookHandle(const IConsoleHooks *hooks, IConsoleHookTypes type)
|
||||
{
|
||||
IConsoleHook *proc = NULL;
|
||||
if (hooks == NULL) return false;
|
||||
|
||||
switch (type) {
|
||||
case ICONSOLE_HOOK_ACCESS:
|
||||
proc = hooks->access;
|
||||
break;
|
||||
case ICONSOLE_HOOK_PRE_ACTION:
|
||||
proc = hooks->pre;
|
||||
break;
|
||||
case ICONSOLE_HOOK_POST_ACTION:
|
||||
proc = hooks->post;
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
|
||||
return (proc == NULL) ? true : proc();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a hook to a command that will be triggered at certain points
|
||||
* @param name name of the command that the hook is added to
|
||||
* @param type type of hook that is added (ACCESS, BEFORE and AFTER change)
|
||||
* @param proc function called when the hook criteria is met
|
||||
*/
|
||||
void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc)
|
||||
{
|
||||
IConsoleCmd *cmd = IConsoleCmdGet(name);
|
||||
if (cmd == NULL) return;
|
||||
IConsoleHookAdd(&cmd->hook, type, proc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a hook to a variable that will be triggered at certain points
|
||||
* @param name name of the variable that the hook is added to
|
||||
* @param type type of hook that is added (ACCESS, BEFORE and AFTER change)
|
||||
* @param proc function called when the hook criteria is met
|
||||
*/
|
||||
void IConsoleVarHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc)
|
||||
{
|
||||
IConsoleVar *var = IConsoleVarGet(name);
|
||||
if (var == NULL) return;
|
||||
IConsoleHookAdd(&var->hook, type, proc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perhaps ugly macro, but this saves us the trouble of writing the same function
|
||||
* twice, just with different variables. Yes, templates would be handy. It was
|
||||
* three types, just with different variables. Yes, templates would be handy. It was
|
||||
* either this define or an even more ugly void* magic function
|
||||
*/
|
||||
#define IConsoleAddSorted(_base, item_new, IConsoleType, type) \
|
||||
@@ -238,13 +324,18 @@ bool GetArgumentInteger(uint32 *value, const char *arg)
|
||||
* @param name name of the command that will be used
|
||||
* @param proc function that will be called upon execution of command
|
||||
*/
|
||||
void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc, IConsoleHook *hook)
|
||||
void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc)
|
||||
{
|
||||
char *new_cmd = strdup(name);
|
||||
IConsoleCmd *item_new = MallocT<IConsoleCmd>(1);
|
||||
item_new->name = strdup(name);
|
||||
|
||||
item_new->next = NULL;
|
||||
item_new->proc = proc;
|
||||
item_new->hook = hook;
|
||||
item_new->name = new_cmd;
|
||||
|
||||
item_new->hook.access = NULL;
|
||||
item_new->hook.pre = NULL;
|
||||
item_new->hook.post = NULL;
|
||||
|
||||
IConsoleAddSorted(_iconsole_cmds, item_new, IConsoleCmd, "a command");
|
||||
}
|
||||
@@ -325,7 +416,8 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
||||
memset(&aliases, 0, sizeof(aliases));
|
||||
memset(&aliasstream, 0, sizeof(aliasstream));
|
||||
|
||||
DEBUG(console, 6, "Requested command is an alias; parsing...");
|
||||
if (_stdlib_con_developer)
|
||||
IConsolePrintF(CC_DEBUG, "condbg: requested command is an alias; parsing...");
|
||||
|
||||
aliases[0] = aliasstream;
|
||||
for (cmdptr = alias->cmdline, a_index = 0, astream_i = 0; *cmdptr != '\0'; cmdptr++) {
|
||||
@@ -384,6 +476,281 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
||||
for (i = 0; i <= a_index; i++) IConsoleCmdExec(aliases[i]); // execute each alias in turn
|
||||
}
|
||||
|
||||
/**
|
||||
* Special function for adding string-type variables. They in addition
|
||||
* also need a 'size' value saying how long their string buffer is.
|
||||
* @param name name of the variable that will be used
|
||||
* @param addr memory location the variable will point to
|
||||
* @param size the length of the string buffer
|
||||
* @param help the help string shown for the variable
|
||||
* For more information see IConsoleVarRegister()
|
||||
*/
|
||||
void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help)
|
||||
{
|
||||
IConsoleVar *var;
|
||||
IConsoleVarRegister(name, addr, ICONSOLE_VAR_STRING, help);
|
||||
var = IConsoleVarGet(name);
|
||||
var->size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new variable to be used in the console
|
||||
* @param name name of the variable that will be used
|
||||
* @param addr memory location the variable will point to
|
||||
* @param help the help string shown for the variable
|
||||
* @param type the type of the variable (simple atomic) so we know which values it can get
|
||||
*/
|
||||
void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, const char *help)
|
||||
{
|
||||
char *new_cmd = strdup(name);
|
||||
IConsoleVar *item_new = MallocT<IConsoleVar>(1);
|
||||
|
||||
item_new->help = (help != NULL) ? strdup(help) : NULL;
|
||||
|
||||
item_new->next = NULL;
|
||||
item_new->name = new_cmd;
|
||||
item_new->addr = addr;
|
||||
item_new->proc = NULL;
|
||||
item_new->type = type;
|
||||
|
||||
item_new->hook.access = NULL;
|
||||
item_new->hook.pre = NULL;
|
||||
item_new->hook.post = NULL;
|
||||
|
||||
IConsoleAddSorted(_iconsole_vars, item_new, IConsoleVar, "a variable");
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the variable pointed to by its string
|
||||
* @param name variable to be found
|
||||
* @return return Varstruct of the found variable, or NULL on failure
|
||||
*/
|
||||
IConsoleVar *IConsoleVarGet(const char *name)
|
||||
{
|
||||
IConsoleVar *item;
|
||||
for (item = _iconsole_vars; item != NULL; item = item->next) {
|
||||
if (strcmp(item->name, name) == 0) return item;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of the variable and put it into a printable
|
||||
* string form so we can use it for printing
|
||||
*/
|
||||
static char *IConsoleVarGetStringValue(const IConsoleVar *var)
|
||||
{
|
||||
static char tempres[50];
|
||||
char *value = tempres;
|
||||
|
||||
switch (var->type) {
|
||||
case ICONSOLE_VAR_BOOLEAN:
|
||||
snprintf(tempres, sizeof(tempres), "%s", (*(bool*)var->addr) ? "on" : "off");
|
||||
break;
|
||||
case ICONSOLE_VAR_BYTE:
|
||||
snprintf(tempres, sizeof(tempres), "%u", *(byte*)var->addr);
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT16:
|
||||
snprintf(tempres, sizeof(tempres), "%u", *(uint16*)var->addr);
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT32:
|
||||
snprintf(tempres, sizeof(tempres), "%u", *(uint32*)var->addr);
|
||||
break;
|
||||
case ICONSOLE_VAR_INT16:
|
||||
snprintf(tempres, sizeof(tempres), "%i", *(int16*)var->addr);
|
||||
break;
|
||||
case ICONSOLE_VAR_INT32:
|
||||
snprintf(tempres, sizeof(tempres), "%i", *(int32*)var->addr);
|
||||
break;
|
||||
case ICONSOLE_VAR_STRING:
|
||||
value = (char*)var->addr;
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print out the value of the variable after it has been assigned
|
||||
* a new value, thus giving us feedback on the action
|
||||
*/
|
||||
static void IConsoleVarPrintSetValue(const IConsoleVar *var)
|
||||
{
|
||||
char *value = IConsoleVarGetStringValue(var);
|
||||
IConsolePrintF(CC_WARNING, "'%s' changed to: %s", var->name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new value to a console variable
|
||||
* @param *var the variable being set/changed
|
||||
* @param value the new value given to the variable, cast properly
|
||||
*/
|
||||
static void IConsoleVarSetValue(const IConsoleVar *var, uint32 value)
|
||||
{
|
||||
IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_PRE_ACTION);
|
||||
switch (var->type) {
|
||||
case ICONSOLE_VAR_BOOLEAN:
|
||||
*(bool*)var->addr = (value != 0);
|
||||
break;
|
||||
case ICONSOLE_VAR_BYTE:
|
||||
*(byte*)var->addr = (byte)value;
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT16:
|
||||
*(uint16*)var->addr = (uint16)value;
|
||||
break;
|
||||
case ICONSOLE_VAR_INT16:
|
||||
*(int16*)var->addr = (int16)value;
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT32:
|
||||
*(uint32*)var->addr = (uint32)value;
|
||||
break;
|
||||
case ICONSOLE_VAR_INT32:
|
||||
*(int32*)var->addr = (int32)value;
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
|
||||
IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_POST_ACTION);
|
||||
IConsoleVarPrintSetValue(var);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new value to a string-type variable. Basically this
|
||||
* means to copy the new value over to the container.
|
||||
* @param *var the variable in question
|
||||
* @param *value the new value
|
||||
*/
|
||||
static void IConsoleVarSetStringvalue(const IConsoleVar *var, const char *value)
|
||||
{
|
||||
if (var->type != ICONSOLE_VAR_STRING || var->addr == NULL) return;
|
||||
|
||||
IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_PRE_ACTION);
|
||||
ttd_strlcpy((char*)var->addr, value, var->size);
|
||||
IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_POST_ACTION);
|
||||
IConsoleVarPrintSetValue(var); // print out the new value, giving feedback
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the current value of a variable and return it
|
||||
* @param *var the variable queried
|
||||
* @return current value of the variable
|
||||
*/
|
||||
static uint32 IConsoleVarGetValue(const IConsoleVar *var)
|
||||
{
|
||||
uint32 result = 0;
|
||||
|
||||
switch (var->type) {
|
||||
case ICONSOLE_VAR_BOOLEAN:
|
||||
result = *(bool*)var->addr;
|
||||
break;
|
||||
case ICONSOLE_VAR_BYTE:
|
||||
result = *(byte*)var->addr;
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT16:
|
||||
result = *(uint16*)var->addr;
|
||||
break;
|
||||
case ICONSOLE_VAR_INT16:
|
||||
result = *(int16*)var->addr;
|
||||
break;
|
||||
case ICONSOLE_VAR_UINT32:
|
||||
result = *(uint32*)var->addr;
|
||||
break;
|
||||
case ICONSOLE_VAR_INT32:
|
||||
result = *(int32*)var->addr;
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print out the value of the variable when asked
|
||||
*/
|
||||
void IConsoleVarPrintGetValue(const IConsoleVar *var)
|
||||
{
|
||||
char *value;
|
||||
/* Some variables need really specific handling, handle this in its
|
||||
* callback function */
|
||||
if (var->proc != NULL) {
|
||||
var->proc(0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
value = IConsoleVarGetStringValue(var);
|
||||
IConsolePrintF(CC_WARNING, "Current value for '%s' is: %s", var->name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a variable command. Without any parameters, print out its value
|
||||
* with parameters it assigns a new value to the variable
|
||||
* @param *var the variable that we will be querying/changing
|
||||
* @param tokencount how many additional parameters have been given to the commandline
|
||||
* @param *token the actual parameters the variable was called with
|
||||
*/
|
||||
static void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[ICON_TOKEN_COUNT])
|
||||
{
|
||||
const char *tokenptr = token[0];
|
||||
byte t_index = tokencount;
|
||||
uint32 value;
|
||||
|
||||
if (_stdlib_con_developer)
|
||||
IConsolePrintF(CC_DEBUG, "condbg: requested command is a variable");
|
||||
|
||||
if (tokencount == 0) { // Just print out value
|
||||
IConsoleVarPrintGetValue(var);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Use of assignment sign is not mandatory but supported, so just 'ignore it appropiately' */
|
||||
if (strcmp(tokenptr, "=") == 0) tokencount--;
|
||||
|
||||
if (tokencount == 1) {
|
||||
/* Some variables need really special handling, handle it in their callback procedure */
|
||||
if (var->proc != NULL) {
|
||||
var->proc(tokencount, &token[t_index - tokencount]); // set the new value
|
||||
return;
|
||||
}
|
||||
/* Strings need special processing. No need to convert the argument to
|
||||
* an integer value, just copy over the argument on a one-by-one basis */
|
||||
if (var->type == ICONSOLE_VAR_STRING) {
|
||||
IConsoleVarSetStringvalue(var, token[t_index - tokencount]);
|
||||
return;
|
||||
} else if (GetArgumentInteger(&value, token[t_index - tokencount])) {
|
||||
IConsoleVarSetValue(var, value);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Increase or decrease the value by one. This of course can only happen to 'number' types */
|
||||
if (strcmp(tokenptr, "++") == 0 && var->type != ICONSOLE_VAR_STRING) {
|
||||
IConsoleVarSetValue(var, IConsoleVarGetValue(var) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(tokenptr, "--") == 0 && var->type != ICONSOLE_VAR_STRING) {
|
||||
IConsoleVarSetValue(var, IConsoleVarGetValue(var) - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
IConsoleError("invalid variable assignment");
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a callback function to the variable. Some variables need
|
||||
* very special processing, which can only be done with custom code
|
||||
* @param name name of the variable the callback function is added to
|
||||
* @param proc the function called
|
||||
*/
|
||||
void IConsoleVarProcAdd(const char *name, IConsoleCmdProc *proc)
|
||||
{
|
||||
IConsoleVar *var = IConsoleVarGet(name);
|
||||
if (var == NULL) return;
|
||||
var->proc = proc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a given command passed to us. First chop it up into
|
||||
* individual tokens (seperated by spaces), then execute it if possible
|
||||
@@ -393,6 +760,7 @@ void IConsoleCmdExec(const char *cmdstr)
|
||||
{
|
||||
IConsoleCmd *cmd = NULL;
|
||||
IConsoleAlias *alias = NULL;
|
||||
IConsoleVar *var = NULL;
|
||||
|
||||
const char *cmdptr;
|
||||
char *tokens[ICON_TOKEN_COUNT], tokenstream[ICON_MAX_STREAMSIZE];
|
||||
@@ -411,7 +779,8 @@ void IConsoleCmdExec(const char *cmdstr)
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG(console, 4, "Executing cmdline: '%s'", cmdstr);
|
||||
if (_stdlib_con_developer)
|
||||
IConsolePrintF(CC_DEBUG, "condbg: executing cmdline: '%s'", cmdstr);
|
||||
|
||||
memset(&tokens, 0, sizeof(tokens));
|
||||
memset(&tokenstream, 0, sizeof(tokenstream));
|
||||
@@ -455,31 +824,46 @@ void IConsoleCmdExec(const char *cmdstr)
|
||||
}
|
||||
}
|
||||
|
||||
for (uint i = 0; tokens[i] != NULL; i++) {
|
||||
DEBUG(console, 8, "Token %d is: '%s'", i, tokens[i]);
|
||||
if (_stdlib_con_developer) {
|
||||
uint i;
|
||||
|
||||
for (i = 0; tokens[i] != NULL; i++) {
|
||||
IConsolePrintF(CC_DEBUG, "condbg: token %d is: '%s'", i, tokens[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (tokens[0] == '\0') return; // don't execute empty commands
|
||||
/* 2. Determine type of command (cmd or alias) and execute
|
||||
* First try commands, then aliases. Execute
|
||||
/* 2. Determine type of command (cmd, alias or variable) and execute
|
||||
* First try commands, then aliases, and finally variables. Execute
|
||||
* the found action taking into account its hooking code
|
||||
*/
|
||||
cmd = IConsoleCmdGet(tokens[0]);
|
||||
if (cmd != NULL) {
|
||||
if (cmd->hook == NULL || cmd->hook()) {
|
||||
if (!cmd->proc(t_index, tokens)) { // index started with 0
|
||||
if (IConsoleHookHandle(&cmd->hook, ICONSOLE_HOOK_ACCESS)) {
|
||||
IConsoleHookHandle(&cmd->hook, ICONSOLE_HOOK_PRE_ACTION);
|
||||
if (cmd->proc(t_index, tokens)) { // index started with 0
|
||||
IConsoleHookHandle(&cmd->hook, ICONSOLE_HOOK_POST_ACTION);
|
||||
} else {
|
||||
cmd->proc(0, NULL); // if command failed, give help
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
t_index--;
|
||||
t_index--; // ignore the variable-name for comfort for both aliases and variaables
|
||||
alias = IConsoleAliasGet(tokens[0]);
|
||||
if (alias != NULL) {
|
||||
IConsoleAliasExec(alias, t_index, &tokens[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
IConsoleError("command not found");
|
||||
var = IConsoleVarGet(tokens[0]);
|
||||
if (var != NULL) {
|
||||
if (IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_ACCESS)) {
|
||||
IConsoleVarExec(var, t_index, &tokens[1]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
IConsoleError("command or variable not found");
|
||||
}
|
||||
|
||||
+188
-87
@@ -44,14 +44,14 @@
|
||||
static FILE *_script_file;
|
||||
static bool _script_running;
|
||||
|
||||
/* console command defines */
|
||||
/* console command / variable defines */
|
||||
#define DEF_CONSOLE_CMD(function) static bool function(byte argc, char *argv[])
|
||||
#define DEF_CONSOLE_HOOK(function) static bool function()
|
||||
|
||||
|
||||
/****************
|
||||
* command hooks
|
||||
****************/
|
||||
/*****************************
|
||||
* variable and command hooks
|
||||
*****************************/
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
|
||||
@@ -69,7 +69,7 @@ DEF_CONSOLE_HOOK(ConHookServerOnly)
|
||||
if (!NetworkAvailable()) return false;
|
||||
|
||||
if (!_network_server) {
|
||||
IConsoleError("This command is only available to a network server.");
|
||||
IConsoleError("This command/variable is only available to a network server.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -80,7 +80,7 @@ DEF_CONSOLE_HOOK(ConHookClientOnly)
|
||||
if (!NetworkAvailable()) return false;
|
||||
|
||||
if (_network_server) {
|
||||
IConsoleError("This command is not available to a network server.");
|
||||
IConsoleError("This command/variable is not available to a network server.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -91,7 +91,7 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
|
||||
if (!NetworkAvailable()) return false;
|
||||
|
||||
if (!_networking) {
|
||||
IConsoleError("Not connected. This command is only available in multiplayer.");
|
||||
IConsoleError("Not connected. This command/variable is only available in multiplayer.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -100,14 +100,12 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
|
||||
DEF_CONSOLE_HOOK(ConHookNoNetwork)
|
||||
{
|
||||
if (_networking) {
|
||||
IConsoleError("This command is forbidden in multiplayer.");
|
||||
IConsoleError("This command/variable is forbidden in multiplayer.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
# define ConHookNoNetwork NULL
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
static void IConsoleHelp(const char *str)
|
||||
@@ -215,7 +213,7 @@ DEF_CONSOLE_CMD(ConSave)
|
||||
if (SaveOrLoad(filename, SL_SAVE, SAVE_DIR) != SL_OK) {
|
||||
IConsolePrint(CC_ERROR, "Saving map failed");
|
||||
} else {
|
||||
IConsolePrintF(CC_DEFAULT, "Map successfully saved to %s", filename);
|
||||
IConsolePrintF(CC_DEFAULT, "Map sucessfully saved to %s", filename);
|
||||
}
|
||||
free(filename);
|
||||
return true;
|
||||
@@ -557,7 +555,7 @@ DEF_CONSOLE_CMD(ConServerInfo)
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("List current and maximum client/company limits. Usage 'server_info'");
|
||||
IConsoleHelp("You can change these values by modifying settings 'network.max_clients', 'network.max_companies' and 'network.max_spectators'");
|
||||
IConsoleHelp("You can change these values by setting the variables 'max_clients', 'max_companies' and 'max_spectators'");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -993,7 +991,6 @@ DEF_CONSOLE_CMD(ConRestart)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
DEF_CONSOLE_CMD(ConListAI)
|
||||
{
|
||||
char buf[4096];
|
||||
@@ -1055,7 +1052,7 @@ DEF_CONSOLE_CMD(ConStartAI)
|
||||
|
||||
AIConfig *config = AIConfig::GetConfig((CompanyID)n);
|
||||
if (argc >= 2) {
|
||||
config->ChangeAI(argv[1], -1, true);
|
||||
config->ChangeAI(argv[1]);
|
||||
if (!config->HasAI()) {
|
||||
IConsoleWarning("Failed to load the specified AI");
|
||||
return true;
|
||||
@@ -1160,7 +1157,6 @@ DEF_CONSOLE_CMD(ConRescanAI)
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif /* ENABLE_AI */
|
||||
|
||||
DEF_CONSOLE_CMD(ConGetSeed)
|
||||
{
|
||||
@@ -1245,6 +1241,35 @@ DEF_CONSOLE_CMD(ConScreenShot)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConInfoVar)
|
||||
{
|
||||
static const char * const _icon_vartypes[] = {"boolean", "byte", "uint16", "uint32", "int16", "int32", "string"};
|
||||
const IConsoleVar *var;
|
||||
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Print out debugging information about a variable. Usage: 'info_var <var>'");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc < 2) return false;
|
||||
|
||||
var = IConsoleVarGet(argv[1]);
|
||||
if (var == NULL) {
|
||||
IConsoleError("the given variable was not found");
|
||||
return true;
|
||||
}
|
||||
|
||||
IConsolePrintF(CC_DEFAULT, "variable name: %s", var->name);
|
||||
IConsolePrintF(CC_DEFAULT, "variable type: %s", _icon_vartypes[var->type]);
|
||||
IConsolePrintF(CC_DEFAULT, "variable addr: %p", var->addr);
|
||||
|
||||
if (var->hook.access) IConsoleWarning("variable is access hooked");
|
||||
if (var->hook.pre) IConsoleWarning("variable is pre hooked");
|
||||
if (var->hook.post) IConsoleWarning("variable is post hooked");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
DEF_CONSOLE_CMD(ConInfoCmd)
|
||||
{
|
||||
const IConsoleCmd *cmd;
|
||||
@@ -1265,7 +1290,9 @@ DEF_CONSOLE_CMD(ConInfoCmd)
|
||||
IConsolePrintF(CC_DEFAULT, "command name: %s", cmd->name);
|
||||
IConsolePrintF(CC_DEFAULT, "command proc: %p", cmd->proc);
|
||||
|
||||
if (cmd->hook != NULL) IConsoleWarning("command is hooked");
|
||||
if (cmd->hook.access) IConsoleWarning("command is access hooked");
|
||||
if (cmd->hook.pre) IConsoleWarning("command is pre hooked");
|
||||
if (cmd->hook.post) IConsoleWarning("command is post hooked");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1319,6 +1346,7 @@ DEF_CONSOLE_CMD(ConHelp)
|
||||
{
|
||||
if (argc == 2) {
|
||||
const IConsoleCmd *cmd;
|
||||
const IConsoleVar *var;
|
||||
const IConsoleAlias *alias;
|
||||
|
||||
cmd = IConsoleCmdGet(argv[1]);
|
||||
@@ -1338,16 +1366,25 @@ DEF_CONSOLE_CMD(ConHelp)
|
||||
return true;
|
||||
}
|
||||
|
||||
IConsoleError("command not found");
|
||||
var = IConsoleVarGet(argv[1]);
|
||||
if (var != NULL && var->help != NULL) {
|
||||
IConsoleHelp(var->help);
|
||||
return true;
|
||||
}
|
||||
|
||||
IConsoleError("command or variable not found");
|
||||
return true;
|
||||
}
|
||||
|
||||
IConsolePrint(CC_WARNING, " ---- OpenTTD Console Help ---- ");
|
||||
IConsolePrint(CC_DEFAULT, " - variables: [command to list all variables: list_vars]");
|
||||
IConsolePrint(CC_DEFAULT, " set value with '<var> = <value>', use '++/--' to in-or decrement");
|
||||
IConsolePrint(CC_DEFAULT, " or omit '=' and just '<var> <value>'. get value with typing '<var>'");
|
||||
IConsolePrint(CC_DEFAULT, " - commands: [command to list all commands: list_cmds]");
|
||||
IConsolePrint(CC_DEFAULT, " call commands with '<command> <arg2> <arg3>...'");
|
||||
IConsolePrint(CC_DEFAULT, " - to assign strings, or use them as arguments, enclose it within quotes");
|
||||
IConsolePrint(CC_DEFAULT, " like this: '<command> \"string argument with spaces\"'");
|
||||
IConsolePrint(CC_DEFAULT, " - use 'help <command>' to get specific information");
|
||||
IConsolePrint(CC_DEFAULT, " - use 'help <command> | <variable>' to get specific information");
|
||||
IConsolePrint(CC_DEFAULT, " - scroll console output with shift + (up | down) | (pageup | pagedown))");
|
||||
IConsolePrint(CC_DEFAULT, " - scroll console input history with the up | down arrows");
|
||||
IConsolePrint(CC_DEFAULT, "");
|
||||
@@ -1357,14 +1394,17 @@ DEF_CONSOLE_CMD(ConHelp)
|
||||
DEF_CONSOLE_CMD(ConListCommands)
|
||||
{
|
||||
const IConsoleCmd *cmd;
|
||||
size_t l = 0;
|
||||
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("List all registered commands. Usage: 'list_cmds [<pre-filter>]'");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argv[1] != NULL) l = strlen(argv[1]);
|
||||
|
||||
for (cmd = _iconsole_cmds; cmd != NULL; cmd = cmd->next) {
|
||||
if (argv[1] == NULL || strstr(cmd->name, argv[1]) != NULL) {
|
||||
if (argv[1] == NULL || strncmp(cmd->name, argv[1], l) == 0) {
|
||||
IConsolePrintF(CC_DEFAULT, "%s", cmd->name);
|
||||
}
|
||||
}
|
||||
@@ -1372,19 +1412,41 @@ DEF_CONSOLE_CMD(ConListCommands)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConListVariables)
|
||||
{
|
||||
const IConsoleVar *var;
|
||||
size_t l = 0;
|
||||
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("List all registered variables. Usage: 'list_vars [<pre-filter>]'");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argv[1] != NULL) l = strlen(argv[1]);
|
||||
|
||||
for (var = _iconsole_vars; var != NULL; var = var->next) {
|
||||
if (argv[1] == NULL || strncmp(var->name, argv[1], l) == 0)
|
||||
IConsolePrintF(CC_DEFAULT, "%s", var->name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConListAliases)
|
||||
{
|
||||
const IConsoleAlias *alias;
|
||||
size_t l = 0;
|
||||
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("List all registered aliases. Usage: 'list_aliases [<pre-filter>]'");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argv[1] != NULL) l = strlen(argv[1]);
|
||||
|
||||
for (alias = _iconsole_aliases; alias != NULL; alias = alias->next) {
|
||||
if (argv[1] == NULL || strstr(alias->name, argv[1]) != NULL) {
|
||||
if (argv[1] == NULL || strncmp(alias->name, argv[1], l) == 0)
|
||||
IConsolePrintF(CC_DEFAULT, "%s => %s", alias->name, alias->cmdline);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1489,7 +1551,8 @@ DEF_CONSOLE_CMD(ConSayClient)
|
||||
|
||||
extern void HashCurrentCompanyPassword(const char *password);
|
||||
|
||||
DEF_CONSOLE_CMD(ConCompanyPassword)
|
||||
/* Also use from within company_gui to change the password graphically */
|
||||
bool NetworkChangeCompanyPassword(byte argc, char *argv[])
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Change the password of your company. Usage: 'company_pw \"<password>\"'");
|
||||
@@ -1497,21 +1560,23 @@ DEF_CONSOLE_CMD(ConCompanyPassword)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc != 2) return false;
|
||||
|
||||
if (!Company::IsValidID(_local_company)) {
|
||||
IConsoleError("You have to own a company to make use of this command.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *password = NetworkChangeCompanyPassword(argv[1]);
|
||||
if (argc != 1) return false;
|
||||
|
||||
if (StrEmpty(password)) {
|
||||
IConsolePrintF(CC_WARNING, "Company password cleared");
|
||||
if (strcmp(argv[0], "*") == 0) argv[0][0] = '\0';
|
||||
|
||||
if (!_network_server) {
|
||||
NetworkClientSetPassword(argv[0]);
|
||||
} else {
|
||||
IConsolePrintF(CC_WARNING, "Company password changed to: %s", password);
|
||||
HashCurrentCompanyPassword(argv[0]);
|
||||
}
|
||||
|
||||
IConsolePrintF(CC_WARNING, "'company_pw' changed to: %s", argv[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1648,25 +1713,6 @@ DEF_CONSOLE_CMD(ConSetting)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConSettingNewgame)
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Change setting for the next game. Usage: 'setting_newgame <name> [<value>]'");
|
||||
IConsoleHelp("Omitting <value> will print out the current value of the setting.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc == 1 || argc > 3) return false;
|
||||
|
||||
if (argc == 2) {
|
||||
IConsoleGetSetting(argv[1], true);
|
||||
} else {
|
||||
IConsoleSetSetting(argv[1], argv[2], true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConListSettings)
|
||||
{
|
||||
if (argc == 0) {
|
||||
@@ -1680,6 +1726,26 @@ DEF_CONSOLE_CMD(ConListSettings)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConListDumpVariables)
|
||||
{
|
||||
const IConsoleVar *var;
|
||||
size_t l = 0;
|
||||
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("List all variables with their value. Usage: 'dump_vars [<pre-filter>]'");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argv[1] != NULL) l = strlen(argv[1]);
|
||||
|
||||
for (var = _iconsole_vars; var != NULL; var = var->next) {
|
||||
if (argv[1] == NULL || strncmp(var->name, argv[1], l) == 0)
|
||||
IConsoleVarPrintGetValue(var);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConGamelogPrint)
|
||||
{
|
||||
GamelogPrintConsole();
|
||||
@@ -1687,12 +1753,16 @@ DEF_CONSOLE_CMD(ConGamelogPrint)
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
/******************
|
||||
* debug commands
|
||||
******************/
|
||||
/*******************************************
|
||||
* debug commands and variables
|
||||
********************************************/
|
||||
|
||||
static void IConsoleDebugLibRegister()
|
||||
{
|
||||
/* debugging variables and functions */
|
||||
extern bool _stdlib_con_developer; // XXX extern in .cpp
|
||||
|
||||
IConsoleVarRegister("con_developer", &_stdlib_con_developer, ICONSOLE_VAR_BOOLEAN, "Enable/disable console debugging information (internal)");
|
||||
IConsoleCmdRegister("resettile", ConResetTile);
|
||||
IConsoleCmdRegister("stopall", ConStopAllVehicles);
|
||||
IConsoleAliasRegister("dbg_echo", "echo %A; echo %B");
|
||||
@@ -1700,13 +1770,18 @@ static void IConsoleDebugLibRegister()
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************
|
||||
* console command registration
|
||||
*******************************/
|
||||
/*******************************************
|
||||
* console command and variable registration
|
||||
********************************************/
|
||||
|
||||
void IConsoleStdLibRegister()
|
||||
{
|
||||
/* stdlib */
|
||||
extern byte _stdlib_developer; // XXX extern in .cpp
|
||||
|
||||
/* default variables and functions */
|
||||
IConsoleCmdRegister("debug_level", ConDebugLevel);
|
||||
IConsoleCmdRegister("dump_vars", ConListDumpVariables);
|
||||
IConsoleCmdRegister("echo", ConEcho);
|
||||
IConsoleCmdRegister("echoc", ConEchoC);
|
||||
IConsoleCmdRegister("exec", ConExec);
|
||||
@@ -1714,14 +1789,19 @@ void IConsoleStdLibRegister()
|
||||
IConsoleCmdRegister("part", ConPart);
|
||||
IConsoleCmdRegister("help", ConHelp);
|
||||
IConsoleCmdRegister("info_cmd", ConInfoCmd);
|
||||
IConsoleCmdRegister("info_var", ConInfoVar);
|
||||
IConsoleCmdRegister("list_ai", ConListAI);
|
||||
IConsoleCmdRegister("list_cmds", ConListCommands);
|
||||
IConsoleCmdRegister("list_vars", ConListVariables);
|
||||
IConsoleCmdRegister("list_aliases", ConListAliases);
|
||||
IConsoleCmdRegister("newgame", ConNewGame);
|
||||
IConsoleCmdRegister("restart", ConRestart);
|
||||
IConsoleCmdRegister("getseed", ConGetSeed);
|
||||
IConsoleCmdRegister("getdate", ConGetDate);
|
||||
IConsoleCmdRegister("quit", ConExit);
|
||||
IConsoleCmdRegister("resetengines", ConResetEngines, ConHookNoNetwork);
|
||||
IConsoleCmdRegister("reload_ai", ConReloadAI);
|
||||
IConsoleCmdRegister("rescan_ai", ConRescanAI);
|
||||
IConsoleCmdRegister("resetengines", ConResetEngines);
|
||||
IConsoleCmdRegister("return", ConReturn);
|
||||
IConsoleCmdRegister("screenshot", ConScreenShot);
|
||||
IConsoleCmdRegister("script", ConScript);
|
||||
@@ -1731,12 +1811,13 @@ void IConsoleStdLibRegister()
|
||||
IConsoleCmdRegister("rm", ConRemove);
|
||||
IConsoleCmdRegister("save", ConSave);
|
||||
IConsoleCmdRegister("saveconfig", ConSaveConfig);
|
||||
IConsoleCmdRegister("start_ai", ConStartAI);
|
||||
IConsoleCmdRegister("stop_ai", ConStopAI);
|
||||
IConsoleCmdRegister("ls", ConListFiles);
|
||||
IConsoleCmdRegister("cd", ConChangeDirectory);
|
||||
IConsoleCmdRegister("pwd", ConPrintWorkingDirectory);
|
||||
IConsoleCmdRegister("clear", ConClearBuffer);
|
||||
IConsoleCmdRegister("setting", ConSetting);
|
||||
IConsoleCmdRegister("setting_newgame", ConSettingNewgame);
|
||||
IConsoleCmdRegister("list_settings",ConListSettings);
|
||||
IConsoleCmdRegister("gamelog", ConGamelogPrint);
|
||||
|
||||
@@ -1747,57 +1828,77 @@ void IConsoleStdLibRegister()
|
||||
IConsoleAliasRegister("new_game", "newgame");
|
||||
IConsoleAliasRegister("patch", "setting %+");
|
||||
IConsoleAliasRegister("set", "setting %+");
|
||||
IConsoleAliasRegister("set_newgame", "setting_newgame %+");
|
||||
IConsoleAliasRegister("list_patches", "list_settings %+");
|
||||
IConsoleAliasRegister("developer", "setting developer %+");
|
||||
|
||||
#ifdef ENABLE_AI
|
||||
IConsoleCmdRegister("list_ai", ConListAI);
|
||||
IConsoleCmdRegister("reload_ai", ConReloadAI);
|
||||
IConsoleCmdRegister("rescan_ai", ConRescanAI);
|
||||
IConsoleCmdRegister("start_ai", ConStartAI);
|
||||
IConsoleCmdRegister("stop_ai", ConStopAI);
|
||||
#endif /* ENABLE_AI */
|
||||
|
||||
/* networking functions */
|
||||
|
||||
IConsoleVarRegister("developer", &_stdlib_developer, ICONSOLE_VAR_BYTE, "Redirect debugging output from the console/command line to the ingame console (value 2). Default value: 1");
|
||||
|
||||
/* networking variables and functions */
|
||||
#ifdef ENABLE_NETWORK
|
||||
/* Network hooks; only active in network */
|
||||
IConsoleCmdHookAdd ("resetengines", ICONSOLE_HOOK_ACCESS, ConHookNoNetwork);
|
||||
|
||||
/* Content downloading is only available with ZLIB */
|
||||
#if defined(WITH_ZLIB)
|
||||
IConsoleCmdRegister("content", ConContent);
|
||||
#endif /* defined(WITH_ZLIB) */
|
||||
|
||||
/*** Networking commands ***/
|
||||
IConsoleCmdRegister("say", ConSay, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("companies", ConCompanies, ConHookServerOnly);
|
||||
IConsoleCmdRegister("say", ConSay);
|
||||
IConsoleCmdHookAdd("say", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("companies", ConCompanies);
|
||||
IConsoleCmdHookAdd("companies", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleAliasRegister("players", "companies");
|
||||
IConsoleCmdRegister("say_company", ConSayCompany, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("say_company", ConSayCompany);
|
||||
IConsoleCmdHookAdd("say_company", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
IConsoleAliasRegister("say_player", "say_company %+");
|
||||
IConsoleCmdRegister("say_client", ConSayClient, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("say_client", ConSayClient);
|
||||
IConsoleCmdHookAdd("say_client", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
|
||||
IConsoleCmdRegister("connect", ConNetworkConnect, ConHookClientOnly);
|
||||
IConsoleCmdRegister("clients", ConNetworkClients, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("status", ConStatus, ConHookServerOnly);
|
||||
IConsoleCmdRegister("server_info", ConServerInfo, ConHookServerOnly);
|
||||
IConsoleCmdRegister("connect", ConNetworkConnect);
|
||||
IConsoleCmdHookAdd("connect", ICONSOLE_HOOK_ACCESS, ConHookClientOnly);
|
||||
IConsoleCmdRegister("clients", ConNetworkClients);
|
||||
IConsoleCmdHookAdd("clients", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("status", ConStatus);
|
||||
IConsoleCmdHookAdd("status", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("server_info", ConServerInfo);
|
||||
IConsoleCmdHookAdd("server_info", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleAliasRegister("info", "server_info");
|
||||
IConsoleCmdRegister("reconnect", ConNetworkReconnect, ConHookClientOnly);
|
||||
IConsoleCmdRegister("rcon", ConRcon, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("reconnect", ConNetworkReconnect);
|
||||
IConsoleCmdHookAdd("reconnect", ICONSOLE_HOOK_ACCESS, ConHookClientOnly);
|
||||
IConsoleCmdRegister("rcon", ConRcon);
|
||||
IConsoleCmdHookAdd("rcon", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
|
||||
IConsoleCmdRegister("join", ConJoinCompany, ConHookNeedNetwork);
|
||||
IConsoleCmdRegister("join", ConJoinCompany);
|
||||
IConsoleCmdHookAdd("join", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
IConsoleAliasRegister("spectate", "join 255");
|
||||
IConsoleCmdRegister("move", ConMoveClient, ConHookServerOnly);
|
||||
IConsoleCmdRegister("reset_company", ConResetCompany, ConHookServerOnly);
|
||||
IConsoleCmdRegister("move", ConMoveClient);
|
||||
IConsoleCmdHookAdd("move", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("reset_company", ConResetCompany);
|
||||
IConsoleCmdHookAdd("reset_company", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleAliasRegister("clean_company", "reset_company %A");
|
||||
IConsoleCmdRegister("client_name", ConClientNickChange, ConHookServerOnly);
|
||||
IConsoleCmdRegister("kick", ConKick, ConHookServerOnly);
|
||||
IConsoleCmdRegister("ban", ConBan, ConHookServerOnly);
|
||||
IConsoleCmdRegister("unban", ConUnBan, ConHookServerOnly);
|
||||
IConsoleCmdRegister("banlist", ConBanList, ConHookServerOnly);
|
||||
IConsoleCmdRegister("client_name", ConClientNickChange);
|
||||
IConsoleCmdHookAdd("client_name", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("kick", ConKick);
|
||||
IConsoleCmdHookAdd("kick", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("ban", ConBan);
|
||||
IConsoleCmdHookAdd("ban", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("unban", ConUnBan);
|
||||
IConsoleCmdHookAdd("unban", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("banlist", ConBanList);
|
||||
IConsoleCmdHookAdd("banlist", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
|
||||
IConsoleCmdRegister("pause", ConPauseGame, ConHookServerOnly);
|
||||
IConsoleCmdRegister("unpause", ConUnPauseGame, ConHookServerOnly);
|
||||
IConsoleCmdRegister("pause", ConPauseGame);
|
||||
IConsoleCmdHookAdd("pause", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
IConsoleCmdRegister("unpause", ConUnPauseGame);
|
||||
IConsoleCmdHookAdd("unpause", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||
|
||||
IConsoleCmdRegister("company_pw", ConCompanyPassword, ConHookNeedNetwork);
|
||||
IConsoleAliasRegister("company_password", "company_pw %+");
|
||||
/*** Networking variables ***/
|
||||
IConsoleVarStringRegister("company_pw", NULL, 0, "Set a password for your company, so no one without the correct password can join. Use '*' to clear the password");
|
||||
IConsoleVarHookAdd("company_pw", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||
IConsoleVarProcAdd("company_pw", NetworkChangeCompanyPassword);
|
||||
IConsoleAliasRegister("company_password", "company_pw %+");
|
||||
|
||||
IConsoleAliasRegister("net_frame_freq", "setting frame_freq %+");
|
||||
IConsoleAliasRegister("net_sync_freq", "setting sync_freq %+");
|
||||
|
||||
+68
-7
@@ -19,6 +19,34 @@ enum {
|
||||
ICON_MAX_STREAMSIZE = 2048, ///< maximum length of a totally expanded command
|
||||
};
|
||||
|
||||
enum IConsoleVarTypes {
|
||||
ICONSOLE_VAR_BOOLEAN,
|
||||
ICONSOLE_VAR_BYTE,
|
||||
ICONSOLE_VAR_UINT16,
|
||||
ICONSOLE_VAR_UINT32,
|
||||
ICONSOLE_VAR_INT16,
|
||||
ICONSOLE_VAR_INT32,
|
||||
ICONSOLE_VAR_STRING
|
||||
};
|
||||
|
||||
enum IConsoleHookTypes {
|
||||
ICONSOLE_HOOK_ACCESS,
|
||||
ICONSOLE_HOOK_PRE_ACTION,
|
||||
ICONSOLE_HOOK_POST_ACTION
|
||||
};
|
||||
|
||||
/** --Hooks--
|
||||
* Hooks are certain triggers get get accessed/executed on either
|
||||
* access, before execution/change or after execution/change. This allows
|
||||
* for general flow of permissions or special action needed in some cases
|
||||
*/
|
||||
typedef bool IConsoleHook();
|
||||
struct IConsoleHooks{
|
||||
IConsoleHook *access; ///< trigger when accessing the variable/command
|
||||
IConsoleHook *pre; ///< trigger before the variable/command is changed/executed
|
||||
IConsoleHook *post; ///< trigger after the variable/command is changed/executed
|
||||
};
|
||||
|
||||
/** --Commands--
|
||||
* Commands are commands, or functions. They get executed once and any
|
||||
* effect they produce are carried out. The arguments to the commands
|
||||
@@ -26,20 +54,41 @@ enum {
|
||||
* If you want to handle multiple words as one, enclose them in double-quotes
|
||||
* eg. 'say "hello sexy boy"'
|
||||
*/
|
||||
typedef bool IConsoleCmdProc(byte argc, char *argv[]);
|
||||
typedef bool IConsoleHook();
|
||||
typedef bool (IConsoleCmdProc)(byte argc, char *argv[]);
|
||||
|
||||
struct IConsoleCmd {
|
||||
char *name; ///< name of command
|
||||
IConsoleCmd *next; ///< next command in list
|
||||
|
||||
IConsoleCmdProc *proc; ///< process executed when command is typed
|
||||
IConsoleHook *hook; ///< any special trigger action that needs executing
|
||||
IConsoleHooks hook; ///< any special trigger action that needs executing
|
||||
};
|
||||
|
||||
/** --Variables--
|
||||
* Variables are pointers to real ingame variables which allow for
|
||||
* changing while ingame. After changing they keep their new value
|
||||
* and can be used for debugging, gameplay, etc. It accepts:
|
||||
* - no arguments; just print out current value
|
||||
* - '= <new value>' to assign a new value to the variable
|
||||
* - '++' to increase value by one
|
||||
* - '--' to decrease value by one
|
||||
*/
|
||||
struct IConsoleVar {
|
||||
char *name; ///< name of the variable
|
||||
IConsoleVar *next; ///< next variable in list
|
||||
|
||||
void *addr; ///< the address where the variable is pointing at
|
||||
uint32 size; ///< size of the variable, used for strings
|
||||
char *help; ///< the optional help string shown when requesting information
|
||||
IConsoleVarTypes type; ///< type of variable (for correct assignment/output)
|
||||
IConsoleCmdProc *proc; ///< some variables need really special handling, use a callback function for that
|
||||
IConsoleHooks hook; ///< any special trigger action that needs executing
|
||||
};
|
||||
|
||||
/** --Aliases--
|
||||
* Aliases are like shortcuts for complex functions, variable assignments,
|
||||
* etc. You can use a simple alias to rename a longer command (eg 'set' for
|
||||
* 'setting' for example), or concatenate more commands into one
|
||||
* etc. You can use a simple alias to rename a longer command (eg 'lv' for
|
||||
* 'list_vars' for example), or concatenate more commands into one
|
||||
* (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
|
||||
* given to them in the command line.
|
||||
* - "%A - %Z" substitute arguments 1 t/m 26
|
||||
@@ -56,20 +105,32 @@ struct IConsoleAlias {
|
||||
|
||||
/* console parser */
|
||||
extern IConsoleCmd *_iconsole_cmds; ///< list of registred commands
|
||||
extern IConsoleVar *_iconsole_vars; ///< list of registred vars
|
||||
extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
|
||||
|
||||
/* console functions */
|
||||
void IConsoleClearBuffer();
|
||||
|
||||
/* Commands */
|
||||
void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc, IConsoleHook *hook = NULL);
|
||||
void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc);
|
||||
void IConsoleAliasRegister(const char *name, const char *cmd);
|
||||
IConsoleCmd *IConsoleCmdGet(const char *name);
|
||||
IConsoleAlias *IConsoleAliasGet(const char *name);
|
||||
|
||||
/* console std lib (register ingame commands/aliases) */
|
||||
/* Variables */
|
||||
void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, const char *help);
|
||||
void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help);
|
||||
IConsoleVar *IConsoleVarGet(const char *name);
|
||||
void IConsoleVarPrintGetValue(const IConsoleVar *var);
|
||||
|
||||
/* console std lib (register ingame commands/aliases/variables) */
|
||||
void IConsoleStdLibRegister();
|
||||
|
||||
/* Hooking code */
|
||||
void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
|
||||
void IConsoleVarHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
|
||||
void IConsoleVarProcAdd(const char *name, IConsoleCmdProc *proc);
|
||||
|
||||
/* Supporting functions */
|
||||
bool GetArgumentInteger(uint32 *value, const char *arg);
|
||||
|
||||
|
||||
@@ -254,30 +254,6 @@ static inline uint CountBits(T value)
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether \a value has exactly 1 bit set
|
||||
*
|
||||
* @param value the value to test.
|
||||
* @return does \a value have exactly 1 bit set?
|
||||
*/
|
||||
template <typename T>
|
||||
static FORCEINLINE bool HasExactlyOneBit(T value)
|
||||
{
|
||||
return value != 0 && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether \a value has at most 1 bit set
|
||||
*
|
||||
* @param value the value to test.
|
||||
* @return does \a value have at most 1 bit set?
|
||||
*/
|
||||
template <typename T>
|
||||
static FORCEINLINE bool HasAtMostOneBit(T value)
|
||||
{
|
||||
return (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ROtate x Left by n
|
||||
*
|
||||
|
||||
@@ -42,7 +42,6 @@ void SetRandomSeed(uint32 seed)
|
||||
}
|
||||
|
||||
#ifdef RANDOM_DEBUG
|
||||
#include "../network/network.h"
|
||||
#include "../network/network_internal.h"
|
||||
#include "../company_func.h"
|
||||
|
||||
|
||||
@@ -85,11 +85,7 @@ static inline void RestoreRandomSeeds(const SavedRandomSeeds &storage)
|
||||
|
||||
void SetRandomSeed(uint32 seed);
|
||||
#ifdef RANDOM_DEBUG
|
||||
#ifdef __APPLE__
|
||||
#define OTTD_Random() DoRandom(__LINE__, __FILE__)
|
||||
#else
|
||||
#define Random() DoRandom(__LINE__, __FILE__)
|
||||
#endif
|
||||
#define Random() DoRandom(__LINE__, __FILE__)
|
||||
uint32 DoRandom(int line, const char *file);
|
||||
#define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__)
|
||||
uint DoRandomRange(uint max, int line, const char *file);
|
||||
|
||||
@@ -76,20 +76,16 @@ public:
|
||||
|
||||
/**
|
||||
* Append an item and return it.
|
||||
* @param to_add the number of items to append
|
||||
* @return pointer to newly allocated item
|
||||
*/
|
||||
FORCEINLINE T *Append(uint to_add = 1)
|
||||
FORCEINLINE T *Append()
|
||||
{
|
||||
uint begin = this->items;
|
||||
this->items += to_add;
|
||||
|
||||
if (this->items > this->capacity) {
|
||||
this->capacity = Align(this->items, S);
|
||||
if (this->items == this->capacity) {
|
||||
this->capacity += S;
|
||||
this->data = ReallocT(this->data, this->capacity);
|
||||
}
|
||||
|
||||
return &this->data[begin];
|
||||
return &this->data[this->items++];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "company_base.h"
|
||||
#include "company_func.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/* static */ const char *CrashLog::message = NULL;
|
||||
/* static */ char *CrashLog::gamelog_buffer = NULL;
|
||||
@@ -134,9 +133,7 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
|
||||
if (c->ai_info == NULL) {
|
||||
buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index);
|
||||
} else {
|
||||
#ifdef ENABLE_AI
|
||||
buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion());
|
||||
#endif /* ENABLE_AI */
|
||||
}
|
||||
}
|
||||
buffer += seprintf(buffer, last, "\n");
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ struct SetDateWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch (widget) {
|
||||
case SDW_DAY:
|
||||
|
||||
+4
-2
@@ -29,16 +29,17 @@ int _debug_driver_level;
|
||||
int _debug_grf_level;
|
||||
int _debug_map_level;
|
||||
int _debug_misc_level;
|
||||
int _debug_ms_level;
|
||||
int _debug_net_level;
|
||||
int _debug_sprite_level;
|
||||
int _debug_oldloader_level;
|
||||
int _debug_ntp_level;
|
||||
int _debug_npf_level;
|
||||
int _debug_yapf_level;
|
||||
int _debug_freetype_level;
|
||||
int _debug_sl_level;
|
||||
int _debug_gamelog_level;
|
||||
int _debug_desync_level;
|
||||
int _debug_console_level;
|
||||
|
||||
|
||||
struct DebugLevel {
|
||||
@@ -53,16 +54,17 @@ struct DebugLevel {
|
||||
DEBUG_LEVEL(grf),
|
||||
DEBUG_LEVEL(map),
|
||||
DEBUG_LEVEL(misc),
|
||||
DEBUG_LEVEL(ms),
|
||||
DEBUG_LEVEL(net),
|
||||
DEBUG_LEVEL(sprite),
|
||||
DEBUG_LEVEL(oldloader),
|
||||
DEBUG_LEVEL(ntp),
|
||||
DEBUG_LEVEL(npf),
|
||||
DEBUG_LEVEL(yapf),
|
||||
DEBUG_LEVEL(freetype),
|
||||
DEBUG_LEVEL(sl),
|
||||
DEBUG_LEVEL(gamelog),
|
||||
DEBUG_LEVEL(desync),
|
||||
DEBUG_LEVEL(console),
|
||||
};
|
||||
#undef DEBUG_LEVEL
|
||||
|
||||
|
||||
+1
-1
@@ -39,13 +39,13 @@
|
||||
extern int _debug_net_level;
|
||||
extern int _debug_sprite_level;
|
||||
extern int _debug_oldloader_level;
|
||||
extern int _debug_ntp_level;
|
||||
extern int _debug_npf_level;
|
||||
extern int _debug_yapf_level;
|
||||
extern int _debug_freetype_level;
|
||||
extern int _debug_sl_level;
|
||||
extern int _debug_gamelog_level;
|
||||
extern int _debug_desync_level;
|
||||
extern int _debug_console_level;
|
||||
|
||||
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
|
||||
#endif /* NO_DEBUG_MESSAGES */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user