Compare commits

..
Author SHA1 Message Date
rubidium 57cbb89fa9 (svn r15661) -Release: 0.7.0-beta2 2009-03-09 23:31:28 +00:00
296 changed files with 6120 additions and 6694 deletions
+65 -65
View File
@@ -5811,7 +5811,7 @@
GetStockpiledCargo(): 0
Industry 1
IsValidIndustry(): true
GetName(): Satown Forest
GetName(): Sadtown Forest
GetLocation(): 45122
IsCargoAccepted(): false
GetLastMonthProduction(): 72
@@ -5819,7 +5819,7 @@
GetStockpiledCargo(): -1
Industry 2
IsValidIndustry(): true
GetName(): Fudhattan Forest
GetName(): Fudinghattan Forest
GetLocation(): 41929
IsCargoAccepted(): false
GetLastMonthProduction(): 108
@@ -5827,7 +5827,7 @@
GetStockpiledCargo(): -1
Industry 3
IsValidIndustry(): true
GetName(): Beningville Forest
GetName(): Benville Forest
GetLocation(): 44640
IsCargoAccepted(): false
GetLastMonthProduction(): 80
@@ -5835,7 +5835,7 @@
GetStockpiledCargo(): -1
Industry 4
IsValidIndustry(): true
GetName(): Nefingbridge Forest
GetName(): Netfingbridge Forest
GetLocation(): 8793
IsCargoAccepted(): false
GetLastMonthProduction(): 135
@@ -5843,7 +5843,7 @@
GetStockpiledCargo(): -1
Industry 5
IsValidIndustry(): true
GetName(): Hutford Forest
GetName(): Hutfingford Forest
GetLocation(): 55429
IsCargoAccepted(): false
GetLastMonthProduction(): 99
@@ -5859,7 +5859,7 @@
GetStockpiledCargo(): -1
Industry 7
IsValidIndustry(): true
GetName(): Tonston Forest
GetName(): Tondston Forest
GetLocation(): 27609
IsCargoAccepted(): false
GetLastMonthProduction(): 115
@@ -5878,7 +5878,7 @@
GetStockpiledCargo(): -1
Industry 9
IsValidIndustry(): true
GetName(): Hutford Sawmill
GetName(): Hutfingford Sawmill
GetLocation(): 60050
IsCargoAccepted(): false
GetLastMonthProduction(): -1
@@ -5889,7 +5889,7 @@
GetStockpiledCargo(): -1
Industry 10
IsValidIndustry(): true
GetName(): Natborough Sawmill
GetName(): Naborough Sawmill
GetLocation(): 54184
IsCargoAccepted(): false
GetLastMonthProduction(): -1
@@ -5911,7 +5911,7 @@
GetStockpiledCargo(): -1
Industry 12
IsValidIndustry(): true
GetName(): Fratston Sawmill
GetName(): Fraston Sawmill
GetLocation(): 51419
IsCargoAccepted(): false
GetLastMonthProduction(): -1
@@ -5968,7 +5968,7 @@
GetStockpiledCargo(): -1
Industry 18
IsValidIndustry(): true
GetName(): Little Frutford Coal Mine
GetName(): Little Fruford Coal Mine
GetLocation(): 23682
IsCargoAccepted(): false
GetLastMonthProduction(): 126
@@ -5976,7 +5976,7 @@
GetStockpiledCargo(): -1
Industry 19
IsValidIndustry(): true
GetName(): Hutford Coal Mine
GetName(): Hutfingford Coal Mine
GetLocation(): 57429
IsCargoAccepted(): false
GetLastMonthProduction(): 99
@@ -5984,7 +5984,7 @@
GetStockpiledCargo(): -1
Industry 20
IsValidIndustry(): true
GetName(): Mendston Coal Mine
GetName(): Mendingston Coal Mine
GetLocation(): 8562
IsCargoAccepted(): false
GetLastMonthProduction(): 171
@@ -5992,7 +5992,7 @@
GetStockpiledCargo(): -1
Industry 21
IsValidIndustry(): true
GetName(): Tonston Coal Mine
GetName(): Tondston Coal Mine
GetLocation(): 29147
IsCargoAccepted(): false
GetLastMonthProduction(): 117
@@ -6000,7 +6000,7 @@
GetStockpiledCargo(): -1
Industry 22
IsValidIndustry(): true
GetName(): Quarfingfield Coal Mine
GetName(): Quartfingfield Coal Mine
GetLocation(): 27822
IsCargoAccepted(): false
GetLastMonthProduction(): 153
@@ -6024,7 +6024,7 @@
GetStockpiledCargo(): -1
Industry 25
IsValidIndustry(): true
GetName(): Satown Power Station
GetName(): Sadtown Power Station
GetLocation(): 48182
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -6040,7 +6040,7 @@
GetStockpiledCargo(): 0
Industry 27
IsValidIndustry(): true
GetName(): Quarfingfield Power Station
GetName(): Quartfingfield Power Station
GetLocation(): 23714
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -6056,7 +6056,7 @@
GetStockpiledCargo(): 0
Industry 29
IsValidIndustry(): true
GetName(): Nuntburg Power Station
GetName(): Nuntfingburg Power Station
GetLocation(): 6685
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -6064,7 +6064,7 @@
GetStockpiledCargo(): 0
Industry 30
IsValidIndustry(): true
GetName(): Beburg Power Station
GetName(): Bedburg Power Station
GetLocation(): 29022
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -6072,7 +6072,7 @@
GetStockpiledCargo(): 0
Industry 31
IsValidIndustry(): true
GetName(): Beningville Power Station
GetName(): Benville Power Station
GetLocation(): 44160
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -6088,7 +6088,7 @@
GetStockpiledCargo(): -1
Industry 33
IsValidIndustry(): true
GetName(): Nuntburg Oil Wells
GetName(): Nuntfingburg Oil Wells
GetLocation(): 5659
IsCargoAccepted(): false
GetLastMonthProduction(): 40
@@ -6096,7 +6096,7 @@
GetStockpiledCargo(): -1
Industry 34
IsValidIndustry(): true
GetName(): Beningville Oil Wells
GetName(): Benville Oil Wells
GetLocation(): 36728
IsCargoAccepted(): false
GetLastMonthProduction(): 64
@@ -6120,7 +6120,7 @@
GetStockpiledCargo(): -1
Industry 37
IsValidIndustry(): true
GetName(): Tonston Oil Wells
GetName(): Tondston Oil Wells
GetLocation(): 34237
IsCargoAccepted(): false
GetLastMonthProduction(): 108
@@ -6136,7 +6136,7 @@
GetStockpiledCargo(): -1
Industry 39
IsValidIndustry(): true
GetName(): Tonston Iron Ore Mine
GetName(): Tondston Iron Ore Mine
GetLocation(): 25545
IsCargoAccepted(): false
GetLastMonthProduction(): 30
@@ -6144,7 +6144,7 @@
GetStockpiledCargo(): -1
Industry 40
IsValidIndustry(): true
GetName(): Fudhattan Iron Ore Mine
GetName(): Fudinghattan Iron Ore Mine
GetLocation(): 47838
IsCargoAccepted(): false
GetLastMonthProduction(): 72
@@ -6152,7 +6152,7 @@
GetStockpiledCargo(): -1
Industry 41
IsValidIndustry(): true
GetName(): Nuntburg Iron Ore Mine
GetName(): Nuntfingburg Iron Ore Mine
GetLocation(): 8763
IsCargoAccepted(): false
GetLastMonthProduction(): 72
@@ -6160,7 +6160,7 @@
GetStockpiledCargo(): -1
Industry 42
IsValidIndustry(): true
GetName(): Larborough Iron Ore Mine
GetName(): Lardborough Iron Ore Mine
GetLocation(): 60866
IsCargoAccepted(): false
GetLastMonthProduction(): 81
@@ -6176,7 +6176,7 @@
GetStockpiledCargo(): -1
Industry 44
IsValidIndustry(): true
GetName(): Chenfingbourne Iron Ore Mine
GetName(): Chentfingbourne Iron Ore Mine
GetLocation(): 19529
IsCargoAccepted(): false
GetLastMonthProduction(): 135
@@ -6184,7 +6184,7 @@
GetStockpiledCargo(): -1
Industry 45
IsValidIndustry(): true
GetName(): Natborough Farm
GetName(): Naborough Farm
GetLocation(): 52931
IsCargoAccepted(): false
GetLastMonthProduction(): 81
@@ -6195,7 +6195,7 @@
GetStockpiledCargo(): -1
Industry 46
IsValidIndustry(): true
GetName(): Larborough Farm
GetName(): Lardborough Farm
GetLocation(): 59604
IsCargoAccepted(): false
GetLastMonthProduction(): 81
@@ -6206,7 +6206,7 @@
GetStockpiledCargo(): -1
Industry 47
IsValidIndustry(): true
GetName(): Chenfingbourne Farm
GetName(): Chentfingbourne Farm
GetLocation(): 24366
IsCargoAccepted(): false
GetLastMonthProduction(): 63
@@ -6217,7 +6217,7 @@
GetStockpiledCargo(): -1
Industry 48
IsValidIndustry(): true
GetName(): Wruntown Farm
GetName(): Wrundtown Farm
GetLocation(): 36847
IsCargoAccepted(): false
GetLastMonthProduction(): 72
@@ -6228,7 +6228,7 @@
GetStockpiledCargo(): -1
Industry 49
IsValidIndustry(): true
GetName(): Little Frutford Farm
GetName(): Little Fruford Farm
GetLocation(): 28287
IsCargoAccepted(): false
GetLastMonthProduction(): 90
@@ -6239,7 +6239,7 @@
GetStockpiledCargo(): -1
Industry 50
IsValidIndustry(): true
GetName(): Hutford Farm
GetName(): Hutfingford Farm
GetLocation(): 57432
IsCargoAccepted(): false
GetLastMonthProduction(): 117
@@ -6250,7 +6250,7 @@
GetStockpiledCargo(): -1
Industry 51
IsValidIndustry(): true
GetName(): Tonston Farm
GetName(): Tondston Farm
GetLocation(): 23519
IsCargoAccepted(): false
GetLastMonthProduction(): 81
@@ -6261,7 +6261,7 @@
GetStockpiledCargo(): -1
Industry 52
IsValidIndustry(): true
GetName(): Nuntburg Farm
GetName(): Nuntfingburg Farm
GetLocation(): 10773
IsCargoAccepted(): false
GetLastMonthProduction(): 126
@@ -6272,7 +6272,7 @@
GetStockpiledCargo(): -1
Industry 53
IsValidIndustry(): true
GetName(): Satown Farm
GetName(): Sadtown Farm
GetLocation(): 48206
IsCargoAccepted(): false
GetLastMonthProduction(): 40
@@ -6283,7 +6283,7 @@
GetStockpiledCargo(): -1
Industry 54
IsValidIndustry(): true
GetName(): Quarfingfield Farm
GetName(): Quartfingfield Farm
GetLocation(): 24005
IsCargoAccepted(): false
GetLastMonthProduction(): 72
@@ -6294,7 +6294,7 @@
GetStockpiledCargo(): -1
Industry 55
IsValidIndustry(): true
GetName(): Little Frutford Steel Mill
GetName(): Little Fruford Steel Mill
GetLocation(): 21107
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6305,7 +6305,7 @@
GetStockpiledCargo(): 0
Industry 56
IsValidIndustry(): true
GetName(): Quarfingfield Steel Mill
GetName(): Quartfingfield Steel Mill
GetLocation(): 23727
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6316,7 +6316,7 @@
GetStockpiledCargo(): 0
Industry 57
IsValidIndustry(): true
GetName(): Beburg Steel Mill
GetName(): Bedburg Steel Mill
GetLocation(): 41813
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6338,7 +6338,7 @@
GetStockpiledCargo(): 0
Industry 59
IsValidIndustry(): true
GetName(): Larborough Steel Mill
GetName(): Lardborough Steel Mill
GetLocation(): 59867
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6349,7 +6349,7 @@
GetStockpiledCargo(): 0
Industry 60
IsValidIndustry(): true
GetName(): Satown Steel Mill
GetName(): Sadtown Steel Mill
GetLocation(): 55360
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6360,7 +6360,7 @@
GetStockpiledCargo(): 0
Industry 61
IsValidIndustry(): true
GetName(): Fratston Steel Mill
GetName(): Fraston Steel Mill
GetLocation(): 52953
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6371,7 +6371,7 @@
GetStockpiledCargo(): 0
Industry 62
IsValidIndustry(): true
GetName(): Chenfingbourne Factory
GetName(): Chentfingbourne Factory
GetLocation(): 24893
IsCargoAccepted(): false
GetLastMonthProduction(): -1
@@ -6405,7 +6405,7 @@
GetStockpiledCargo(): 0
Industry 64
IsValidIndustry(): true
GetName(): Fudhattan Factory
GetName(): Fudinghattan Factory
GetLocation(): 46278
IsCargoAccepted(): false
GetLastMonthProduction(): -1
@@ -6490,7 +6490,7 @@
GetStockpiledCargo(): 0
Industry 69
IsValidIndustry(): true
GetName(): Wruntown Oil Refinery
GetName(): Wrundtown Oil Refinery
GetLocation(): 39663
IsCargoAccepted(): false
GetLastMonthProduction(): 0
@@ -6501,7 +6501,7 @@
GetStockpiledCargo(): 0
Industry 70
IsValidIndustry(): true
GetName(): Mendston Power Station
GetName(): Mendingston Power Station
GetLocation(): 6498
IsCargoAccepted(): true
GetLastMonthProduction(): -1
@@ -7212,7 +7212,7 @@
--Station--
IsValidStation(0): true
IsValidStation(1000): false
GetName(0): Beningville Airport
GetName(0): Benville Airport
SetName(0): true
GetName(0): Look, a station
GetLocation(1): 29253
@@ -7791,7 +7791,7 @@
GetRating(): 0
Town 2
IsValidTown(): true
GetName(): Tonston
GetName(): Tondston
GetPopulation(): 380
GetLocation(): 28365
GetHouseCount(): 19
@@ -7805,14 +7805,14 @@
GetRating(): 0
Town 4
IsValidTown(): true
GetName(): Wruntown
GetName(): Wrundtown
GetPopulation(): 426
GetLocation(): 41450
GetHouseCount(): 18
GetRating(): 0
Town 5
IsValidTown(): true
GetName(): Fratston
GetName(): Fraston
GetPopulation(): 205
GetLocation(): 55007
GetHouseCount(): 11
@@ -7826,14 +7826,14 @@
GetRating(): 0
Town 7
IsValidTown(): true
GetName(): Hutford
GetName(): Hutfingford
GetPopulation(): 950
GetLocation(): 59234
GetHouseCount(): 33
GetRating(): 0
Town 8
IsValidTown(): true
GetName(): Satown
GetName(): Sadtown
GetPopulation(): 358
GetLocation(): 51267
GetHouseCount(): 20
@@ -7847,7 +7847,7 @@
GetRating(): 0
Town 10
IsValidTown(): true
GetName(): Nuntburg
GetName(): Nuntfingburg
GetPopulation(): 737
GetLocation(): 6446
GetHouseCount(): 26
@@ -7861,7 +7861,7 @@
GetRating(): 0
Town 12
IsValidTown(): true
GetName(): Gintborough
GetName(): Ginborough
GetPopulation(): 982
GetLocation(): 32740
GetHouseCount(): 28
@@ -7882,7 +7882,7 @@
GetRating(): 0
Town 15
IsValidTown(): true
GetName(): Beningville
GetName(): Benville
GetPopulation(): 807
GetLocation(): 42338
GetHouseCount(): 33
@@ -7896,28 +7896,28 @@
GetRating(): 0
Town 17
IsValidTown(): true
GetName(): Quarfingfield
GetName(): Quartfingfield
GetPopulation(): 218
GetLocation(): 24252
GetHouseCount(): 13
GetRating(): 0
Town 18
IsValidTown(): true
GetName(): Nefingbridge
GetName(): Netfingbridge
GetPopulation(): 262
GetLocation(): 10574
GetHouseCount(): 13
GetRating(): 0
Town 19
IsValidTown(): true
GetName(): Mendston
GetName(): Mendingston
GetPopulation(): 243
GetLocation(): 6511
GetHouseCount(): 14
GetRating(): 0
Town 20
IsValidTown(): true
GetName(): Chenfingbourne
GetName(): Chentfingbourne
GetPopulation(): 437
GetLocation(): 22585
GetHouseCount(): 15
@@ -7931,21 +7931,21 @@
GetRating(): 0
Town 22
IsValidTown(): true
GetName(): Natborough
GetName(): Naborough
GetPopulation(): 221
GetLocation(): 51891
GetHouseCount(): 12
GetRating(): 0
Town 23
IsValidTown(): true
GetName(): Larborough
GetName(): Lardborough
GetPopulation(): 652
GetLocation(): 59622
GetHouseCount(): 27
GetRating(): 0
Town 24
IsValidTown(): true
GetName(): Little Frutford
GetName(): Little Fruford
GetPopulation(): 668
GetLocation(): 19596
GetHouseCount(): 34
@@ -7959,14 +7959,14 @@
GetRating(): 0
Town 26
IsValidTown(): true
GetName(): Beburg
GetName(): Bedburg
GetPopulation(): 362
GetLocation(): 39505
GetHouseCount(): 18
GetRating(): 0
Town 27
IsValidTown(): true
GetName(): Fudhattan
GetName(): Fudinghattan
GetPopulation(): 390
GetLocation(): 45525
GetHouseCount(): 19
-19
View File
@@ -1,22 +1,3 @@
0.7.0-RC1 (2009-03-16)
------------------------------------------------------------------------
-Feature: Pop up the AI Debug Window if one of the AIs crashed and show a message that the user should report the crash [FS#2728] (r15708)
-Feature: Allow the number of towns that will be generated in the generate world window to be customized [FS#2672] (r15695)
-Fix: Enabling freeform edges could cause submarines to get stuck on land tiles (r15733)
-Fix: Centering on a vehicle did not respect its z coordinate (r15725)
-Fix: Do not show passenger-/mail-capacity if the aircraft carries only cargo (r15705)
-Fix: Blame NewGRFs returning inconsistent information in purchase-list/after building before users have a chance to blame OpenTTD for incorrectly autorenewing/-replacing [FS#2595] (r15701)
-Fix: Just sell the old engines after autorenew/replace. Do not bother about trains exceeding the trainlimit, which will be sold anyway [FS#2721] (r15692)
-Fix: Do not crash when the generate map does not contain a suitable location for a town [FS#2720] (r15689)
-Fix: Do not crash when someone substitutes the "map generation" sprites with garbage [FS#2720] (r15685)
-Fix: Vehicle images would be determined during the process of moving the vehicle which means that only the (orientation) data for the vehicles in front of it is valid. Now the data for the vehicles behind the vehicle are valid too [FS#2546] (r15677)
-Fix: It was possible to remove rail tunnels/bridges and aqueducts build by rival companies [FS#2718] (r15667)
-Fix: Sorting of engines in the purchase list did not use the same numbers as the GUI showed, e.g. articulated parts were not taken into accound when ordering by capacity [FS#2689] (r15666)
-Fix: Handling of aircraft crash counter did not take account of the reduced number of calls (from 6 down to 2) to the aircraft event handler, resulting in crashed aircraft taking three times longer than they should to clear. Compensate by increasing the counter by 3 on every call instead of 1 (r15665)
-Fix: Growing of vsize as (some) threads were not properly released (r15663)
-Fix: Do not mark a company as having ratings in a town when querying the cost of a command (r15662)
0.7.0-beta2 (2009-03-10)
------------------------------------------------------------------------
- Feature: Allow downloading scenarios and heightmaps via the in game content download (r15632)
+1 -1
View File
@@ -5,7 +5,7 @@ log() {
}
set_default() {
released_version="0.7.0-RC1"
released_version="0.7.0-beta2"
ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override
+2 -1
View File
@@ -11,10 +11,11 @@ by the number below on http://bugs.openttd.org.
If the bug report is closed, it has been fixed, which then can be verified
in the latest SVN version of /trunk.
Bugs for 0.7.0-RC1
Bugs for 0.7.0-beta2
------------------------------------------------------------------------
URL: http://bugs.openttd.org
- 2689 Capacity ordering of articulated vehicle in build vehicle window is wrong
- 2616 Cloning creates vehicles with invalid subcargos
- 2585 [OSX] OS' mouse pointer showing
- 2427 Vehicle owner gets paid for whole cargo feeder share
+4 -3
View File
@@ -1,8 +1,9 @@
openttd (0.7.0-RC1) unstable; urgency=low
openttd (0.7~svn-1) UNRELEASED; urgency=low
* New upstream release.
* Unreleased SVN version. Versioned to allow normal upgrades to released
versions.
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 16 Mar 2008 00:07:00 +0200
-- Matthijs Kooijman <matthijs@stdin.nl> Wed, 03 Sep 2008 18:56:04 +0200
openttd (0.7.0-beta2) unstable; urgency=low
+1 -1
View File
@@ -1,6 +1,6 @@
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "0.7.0" ; Define application version
!define INSTALLERVERSION 56 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define INSTALLERVERSION 55 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!include ${VERSION_INCLUDE}
!define APPURLLINK "http://www.openttd.org"
+1 -1
View File
@@ -278,7 +278,7 @@ Function CheckFile(filename)
End Function
Dim version
version = "0.7.0-RC1"
version = "0.7.0-beta2"
If Not (IsCachedVersion(version) And CheckFile("../src/rev.cpp") And CheckFile("../src/ottdres.rc")) Then
UpdateFiles version
End If
+15 -15
View File
@@ -436,21 +436,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\luxembourgish.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating luxembourgish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\luxembourgish.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\norwegian_bokmal.txt"
>
@@ -481,6 +466,21 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\origveh.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating origveh language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\origveh.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\piglatin.txt"
>
+15 -15
View File
@@ -437,21 +437,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\luxembourgish.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating luxembourgish language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\luxembourgish.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\norwegian_bokmal.txt"
>
@@ -482,6 +467,21 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\origveh.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating origveh language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\origveh.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\piglatin.txt"
>
-12
View File
@@ -1971,10 +1971,6 @@
RelativePath=".\..\src\ship_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\signs_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\station_cmd.cpp"
>
@@ -2007,18 +2003,10 @@
RelativePath=".\..\src\unmovable_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\vehicle_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\water_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\waypoint_cmd.cpp"
>
</File>
</Filter>
<Filter
Name="Save/Load handlers"
-12
View File
@@ -1968,10 +1968,6 @@
RelativePath=".\..\src\ship_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\signs_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\station_cmd.cpp"
>
@@ -2004,18 +2000,10 @@
RelativePath=".\..\src\unmovable_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\vehicle_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\water_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\waypoint_cmd.cpp"
>
</File>
</Filter>
<Filter
Name="Save/Load handlers"
+9 -17
View File
@@ -1,6 +1,6 @@
OpenTTD README
Last updated: 2009-03-16
Release version: 0.7.0-RC1
Last updated: 2009-03-10
Release version: 0.7.0-beta2
------------------------------------------------------------------------
@@ -65,8 +65,6 @@ Please include the following information in your bug report:
version without the bug and the first version including
the bug. That way we can fix it quicker by looking at the
changes made.
- Attach crash.dmp, crash.log and crash.sav from the data
directory if they exist.
2.2) Reporting Desyncs:
---- ------------------
@@ -253,11 +251,9 @@ features known from TTDPatch (http://www.ttdpatch.net/).
Several important non-standard controls:
* Ctrl makes many commands more powerful. For example Ctrl clicking on signals
with the build signal tool changes their behaviour.
* Use Ctrl to place semaphore signals
* Ingame console. More information at
http://wiki.openttd.org/index.php/Console
* Right clicking shows tooltips
5.1) Logging of potentially dangerous actions:
@@ -295,9 +291,6 @@ OpenTTD in debug mode.
The configuration file for OpenTTD (openttd.cfg) is in a simple Windows-like
.INI format. It's mostly undocumented. Almost all settings can be changed
ingame by using the 'Advanced Settings' window.
When you can not find openttd.cfg you should look in the directories as
described in section 4.2. If you do not have an openttd.cfg OpenTTD will
create one after closing.
7.0) Compiling:
@@ -474,27 +467,26 @@ The OpenTTD team (in alphabetical order):
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
Loïc Guilloux (glx) - General coding
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
Jonathan Coome (Maedhros) - High priest of the NewGRF Temple
Michael Lutz (michi_cc) - Path based signals
Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host
Owen Rudge (orudge) - Forum host, OS/2 port
Peter Nelson (peter1138) - Spiritual descendant from newGRF gods
Remko Bijker (Rubidium) - Lead coder and way more
Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker
Zdenek Sojka (SmatZ) - Bug finder and fixer
Thijs Marinussen (Yexo) - AI Framework
Inactive Developers:
Tamás Faragó (Darkvater) - Ex-Lead coder
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
Jonathan Coome (Maedhros) - High priest of the NewGRF Temple
Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host
Christoph Mallon (Tron) - Programmer, code correctness police
Retired Developers:
Ludvig Strigeus (ludde) - OpenTTD author, main coder (0.1 - 0.3.3)
Serge Paquet (vurlix) - Assistant project manager, coder (0.1 - 0.3.3)
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6)
Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.7)
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.6)
Thanks to:
Josef Drexler - For his great work on TTDPatch.
-3
View File
@@ -441,7 +441,6 @@ rail_cmd.cpp
road_cmd.cpp
roadveh_cmd.cpp
ship_cmd.cpp
signs_cmd.cpp
station_cmd.cpp
terraform_cmd.cpp
timetable_cmd.cpp
@@ -450,9 +449,7 @@ train_cmd.cpp
tree_cmd.cpp
tunnelbridge_cmd.cpp
unmovable_cmd.cpp
vehicle_cmd.cpp
water_cmd.cpp
waypoint_cmd.cpp
# Save/Load handlers
saveload/afterload.cpp
+14 -21
View File
@@ -195,12 +195,12 @@ static const Widget _ai_list_widgets[] = {
};
/* Window definition for the ai list window. */
static const WindowDesc _ai_list_desc(
static const WindowDesc _ai_list_desc = {
WDP_CENTER, WDP_CENTER, 200, 234, 200, 234,
WC_AI_LIST, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_ai_list_widgets
);
};
void ShowAIListWindow(CompanyID slot)
{
@@ -377,12 +377,12 @@ static const Widget _ai_settings_widgets[] = {
};
/* Window definition for the AI settings window. */
static const WindowDesc _ai_settings_desc(
static const WindowDesc _ai_settings_desc = {
WDP_CENTER, WDP_CENTER, 200, 208, 500, 208,
WC_AI_SETTINGS, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_ai_settings_widgets
);
};
void ShowAISettingsWindow(CompanyID slot)
{
@@ -405,12 +405,12 @@ static const Widget _ai_config_widgets[] = {
};
/* Window definition for the configure AI window. */
static const WindowDesc _ai_config_desc(
static const WindowDesc _ai_config_desc = {
WDP_CENTER, WDP_CENTER, 300, 172, 300, 172,
WC_GAME_OPTIONS, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_ai_config_widgets
);
};
/**
* Window to configure which AIs will start.
@@ -688,21 +688,16 @@ struct AIDebugWindow : public Window {
}
}
void ChangeToAI(CompanyID show_ai)
{
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
ai_debug_company = show_ai;
this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
this->SetDirty();
}
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)) {
/* Is it no on disable? */
if (!this->IsWidgetDisabled(widget)) {
ChangeToAI((CompanyID)(widget - AID_WIDGET_COMPANY_BUTTON_START));
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
ai_debug_company = (CompanyID)(widget - AID_WIDGET_COMPANY_BUTTON_START);
this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
this->SetDirty();
}
}
if (widget == AID_WIDGET_RELOAD_TOGGLE && !this->IsWidgetDisabled(widget)) {
@@ -768,19 +763,17 @@ static const Widget _ai_debug_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _ai_debug_desc(
static const WindowDesc _ai_debug_desc = {
WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
WC_AI_DEBUG, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_ai_debug_widgets
);
};
void ShowAIDebugWindow(CompanyID show_company)
void ShowAIDebugWindow()
{
if (!_networking || _network_server) {
AIDebugWindow *w = (AIDebugWindow *)BringWindowToFrontById(WC_AI_DEBUG, 0);
if (w == NULL) w = new AIDebugWindow(&_ai_debug_desc, 0);
if (show_company != INVALID_COMPANY) w->ChangeToAI(show_company);
AllocateWindowDescFront<AIDebugWindow>(&_ai_debug_desc, 0);
} else {
ShowErrorMessage(INVALID_STRING_ID, STR_AI_DEBUG_SERVER_ONLY, 0, 0);
}
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef AI_GUI_HPP
#define AI_GUI_HPP
void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY);
void ShowAIDebugWindow();
void ShowAIConfigWindow();
#endif /* AI_GUI_HPP */
+1 -1
View File
@@ -31,7 +31,7 @@ class DummyAI extends AIController {
function Start() { \n\
AILog.Error(\"No suitable AI found to load.\"); \n\
AILog.Error(\"This AI is a dummy AI and won't do anything.\"); \n\
AILog.Error(\"You can download several via the 'Online Content' system.\"); \n\
AILog.Error(\"Please add one or several AIs in your ai/ directory.\"); \n\
} \n\
} \n\
");
+2 -7
View File
@@ -7,7 +7,6 @@
#include "../settings_type.h"
#include "../vehicle_base.h"
#include "../saveload/saveload.h"
#include "../gui.h"
#include "table/strings.h"
#include <squirrel.h>
@@ -21,7 +20,6 @@
#include "ai_info.hpp"
#include "ai_storage.hpp"
#include "ai_instance.hpp"
#include "ai_gui.hpp"
/* Convert all AI related classes to Squirrel data.
* Note: this line a marker in squirrel_export.sh. Do not change! */
@@ -253,9 +251,6 @@ void AIInstance::Died()
delete this->engine;
this->instance = NULL;
this->engine = NULL;
ShowAIDebugWindow(_current_company);
ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0);
}
void AIInstance::GameLoop()
@@ -393,7 +388,7 @@ enum {
/* static */ bool AIInstance::SaveObject(HSQUIRRELVM vm, SQInteger index, int max_depth, bool test)
{
if (max_depth == 0) {
AILog::Error("Savedata can only be nested to 25 deep. No data saved.");
AILog::Error("Savedata can only be nested to 5 deep. No data saved.");
return false;
}
@@ -504,7 +499,7 @@ enum {
}
default:
AILog::Error("You tried to save an unsupported type. No data saved.");
AILog::Error("You tried to save unsupported type. No data saved.");
return false;
}
}
+14 -5
View File
@@ -20,7 +20,7 @@
#include "ai_scanner.hpp"
#include "api/ai_controller.hpp"
void AIScanner::ScanDir(const char *dirname, bool library_scan)
void AIScanner::ScanDir(const char *dirname, bool library_scan, bool library_recursive)
{
extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
extern bool FiosIsHiddenFile(const struct dirent *ent);
@@ -48,10 +48,19 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan)
ttd_strlcpy(temp_script, dirname, sizeof(temp_script));
ttd_strlcat(temp_script, d_name, sizeof(temp_script));
if (S_ISREG(sb.st_mode)) {
if (S_ISDIR(sb.st_mode)) {
/* Libraries are always in a subdirectory of their category, so scan those */
if (library_scan && !library_recursive) {
ttd_strlcat(temp_script, PATHSEP, sizeof(temp_script));
ScanDir(temp_script, library_scan, true);
continue;
}
} else if (S_ISREG(sb.st_mode)) {
/* Only .tar files are allowed */
char *ext = strrchr(d_name, '.');
if (ext == NULL || strcasecmp(ext, ".tar") != 0) continue;
/* .tar files are only allowed in the root of the library dir */
if (library_recursive) continue;
/* We always expect a directory in the TAR */
const char *first_dir = FioTarFirstDir(temp_script);
@@ -60,7 +69,7 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan)
ttd_strlcat(temp_script, PATHSEP, sizeof(temp_script));
ttd_strlcat(temp_script, first_dir, sizeof(temp_script));
FioTarAddLink(temp_script, first_dir);
} else if (!S_ISDIR(sb.st_mode)) {
} else {
/* Skip any other type of file */
continue;
}
@@ -79,7 +88,7 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan)
if (!FioCheckFileExists(info_script, AI_DIR) || !FioCheckFileExists(main_script, AI_DIR)) continue;
DEBUG(ai, 6, "Loading AI at location '%s'", main_script);
/* We don't care if one of the other scripts failed to load. */
/* We don't care if one of the other scripst failed to load. */
this->engine->ResetCrashed();
this->engine->LoadScript(info_script);
} else {
@@ -554,7 +563,7 @@ bool AIScanner::HasAI(const ContentInfo *ci, bool md5sum)
* @param md5sum whether to check the MD5 checksum
* @return true iff we have an AI (library) matching.
*/
/* static */ bool AI::HasAI(const ContentInfo *ci, bool md5sum)
/*static */ bool AI::HasAI(const ContentInfo *ci, bool md5sum)
{
return AI::ai_scanner->HasAI(ci, md5sum);
}
+2 -2
View File
@@ -56,7 +56,7 @@ public:
const AIInfoList *GetUniqueAIInfoList() { return &this->info_single_list; }
/**
* Get the engine of the main squirrel handler (it indexes all available scripts).
* Get the engine of the main squirrel handler (it indexes all avialable squirrels).
*/
class Squirrel *GetEngine() { return this->engine; }
@@ -88,7 +88,7 @@ private:
* For library-scan, if a library is found, AILibrary is created, and the
* library is registered to the central system.
*/
void ScanDir(const char *dirname, bool library_dir);
void ScanDir(const char *dirname, bool library_dir, bool library_recursive = false);
AIInfo *info_dummy;
AIInfoList info_list;
+2 -2
View File
@@ -32,7 +32,7 @@ static void _DoCommandReturnBuildBridge2(class AIInstance *instance)
}
/* This can never happen, as in test-mode this callback is never executed,
* and in execute-mode, the other callback is called. */
* and in execute-mode, the other callback is called. */
NOT_REACHED();
}
@@ -45,7 +45,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
}
/* This can never happen, as in test-mode this callback is never executed,
* and in execute-mode, the other callback is called. */
* and in execute-mode, the other callback is called. */
NOT_REACHED();
}
+10 -9
View File
@@ -64,11 +64,10 @@
{
if (!IsValidEngine(engine_id)) return -1;
const Engine *e = ::GetEngine(engine_id);
switch (e->type) {
switch (::GetEngine(engine_id)->type) {
case VEH_ROAD:
case VEH_TRAIN: {
uint16 *capacities = GetCapacityOfArticulatedParts(engine_id, e->type);
uint16 *capacities = GetCapacityOfArticulatedParts(engine_id, ::GetEngine(engine_id)->type);
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (capacities[c] == 0) continue;
return capacities[c];
@@ -76,13 +75,15 @@
return -1;
} break;
case VEH_SHIP:
return e->u.ship.capacity;
break;
case VEH_SHIP: {
const ShipVehicleInfo *vi = ::ShipVehInfo(engine_id);
return vi->capacity;
} break;
case VEH_AIRCRAFT:
return AircraftDefaultCargoCapacity(e->GetDefaultCargoType(), &e->u.air);
break;
case VEH_AIRCRAFT: {
const AircraftVehicleInfo *vi = ::AircraftVehInfo(engine_id);
return vi->passenger_capacity;
} break;
default: NOT_REACHED();
}
-1
View File
@@ -91,7 +91,6 @@ public:
/**
* Insert an event to the queue for the company.
* @param event The event to insert.
* @note DO NOT CALL YOURSELF; leave it to the internal AI programming.
*/
static void InsertEvent(AIEvent *event);
+10 -9
View File
@@ -28,11 +28,10 @@ CargoID AIEventEnginePreview::GetCargoType()
int32 AIEventEnginePreview::GetCapacity()
{
const Engine *e = ::GetEngine(engine);
switch (e->type) {
switch (::GetEngine(engine)->type) {
case VEH_ROAD:
case VEH_TRAIN: {
uint16 *capacities = GetCapacityOfArticulatedParts(engine, e->type);
uint16 *capacities = GetCapacityOfArticulatedParts(engine, ::GetEngine(engine)->type);
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (capacities[c] == 0) continue;
return capacities[c];
@@ -40,13 +39,15 @@ int32 AIEventEnginePreview::GetCapacity()
return -1;
} break;
case VEH_SHIP:
return e->u.ship.capacity;
break;
case VEH_SHIP: {
const ShipVehicleInfo *vi = ::ShipVehInfo(engine);
return vi->capacity;
} break;
case VEH_AIRCRAFT:
return AircraftDefaultCargoCapacity(e->GetDefaultCargoType(), &e->u.air);
break;
case VEH_AIRCRAFT: {
const AircraftVehicleInfo *vi = ::AircraftVehInfo(engine);
return vi->passenger_capacity;
} break;
default: NOT_REACHED();
}
-7
View File
@@ -306,13 +306,6 @@ static OrderType GetOrderTypeByTile(TileIndex t)
return AIObject::DoCommand(0, vehicle_id, order_position, CMD_DELETE_ORDER);
}
/* static */ bool AIOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order)
{
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order));
return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
}
/**
* Callback handler as SetOrderFlags possibly needs multiple DoCommand calls
* to be able to set all order flags correctly. As we need to wait till the
+1 -11
View File
@@ -331,7 +331,7 @@ public:
* Removes an order from the vehicle's order list.
* @param vehicle_id The vehicle to remove the order from.
* @param order_position The order to remove from the order list.
* @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre AIVehicle::IsValidVehicleOrder(vehicle_id, order_position).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return True if and only if the order was removed.
*/
@@ -377,16 +377,6 @@ public:
*/
static bool MoveOrder(VehicleID vehicle_id, OrderPosition order_position_move, OrderPosition order_position_target);
/**
* Make a vehicle execute next_order instead of its current order.
* @param vehicle_id The vehicle that should skip some orders.
* @param next_order The order the vehicle should skip to.
* @pre IsValidVehicleOrder(vehicle_id, next_order).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return True if and only the current order was changed.
*/
static bool SkipToOrder(VehicleID vehicle_id, OrderPosition next_order);
/**
* Copies the orders from another vehicle. The orders of the main vehicle
* are going to be the orders of the changed vehicle.
-1
View File
@@ -95,7 +95,6 @@ void SQAIOrder_Register(Squirrel *engine) {
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderFlags, "SetOrderFlags", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ChangeOrder, "ChangeOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::MoveOrder, "MoveOrder", 4, ".iii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SkipToOrder, "SkipToOrder", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::CopyOrders, "CopyOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::ShareOrders, "ShareOrders", 3, ".ii");
SQAIOrder.DefSQStaticMethod(engine, &AIOrder::UnshareOrders, "UnshareOrders", 2, ".i");
+2 -2
View File
@@ -316,7 +316,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(to));
EnforcePrecondition(false, ::DistanceManhattan(from, tile) == 1);
EnforcePrecondition(false, ::DistanceManhattan(tile, to) >= 1);
EnforcePrecondition(false, ::DistanceManhattan(tile,to) >= 1);
EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType()));
int diag_offset = abs(abs((int)::TileX(to) - (int)::TileX(tile)) - abs((int)::TileY(to) - (int)::TileY(tile)));
EnforcePrecondition(false, diag_offset <= 1 ||
@@ -333,7 +333,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(to));
EnforcePrecondition(false, ::DistanceManhattan(from, tile) == 1);
EnforcePrecondition(false, ::DistanceManhattan(tile, to) >= 1);
EnforcePrecondition(false, ::DistanceManhattan(tile,to) >= 1);
int diag_offset = abs(abs((int)::TileX(to) - (int)::TileX(tile)) - abs((int)::TileY(to) - (int)::TileY(tile)));
EnforcePrecondition(false, diag_offset <= 1 ||
(::TileX(from) == ::TileX(tile) && ::TileX(tile) == ::TileX(to)) ||
+1 -1
View File
@@ -395,7 +395,7 @@ static bool NormaliseTileOffset(int32 *tile)
static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, DiagDirection neighbour)
{
TileIndex neighbour_tile = ::TileAddByDiagDir(start_tile, neighbour);
if ((rts & ::GetRoadTypes(neighbour_tile)) == 0) return false;
if ((rts & ::GetRoadTypes(neighbour_tile)) == 0) return false;
switch (::GetTileType(neighbour_tile)) {
case MP_ROAD:
+1 -1
View File
@@ -8,7 +8,7 @@
bool AITestMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs)
{
/* In test mode we only return 'false', telling the DoCommand it
* should stop after testing the command and return with that result. */
* should stop after testing the command and return with that result. */
return false;
}
+20 -12
View File
@@ -397,8 +397,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
UpdateAircraftCache(v);
VehicleMove(v, false);
VehicleMove(u, false);
VehiclePositionChanged(v);
VehiclePositionChanged(u);
/* Aircraft with 3 vehicles (chopper)? */
if (v->subtype == AIR_HELICOPTER) {
@@ -421,14 +421,14 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
w->UpdateDeltaXY(INVALID_DIR);
u->SetNext(w);
VehicleMove(w, false);
VehiclePositionChanged(w);
}
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClassesData(WC_AIRCRAFT_LIST, 0);
InvalidateWindow(WC_COMPANY, v->owner);
if (IsLocalCompany())
InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Aircraft window
InvalidateAutoreplaceWindow(v->engine_type, v->group_id); //updates the replace Aircraft window
GetCompany(_current_company)->num_engines[p1]++;
}
@@ -692,7 +692,9 @@ static void HelicopterTickHandler(Vehicle *v)
u->cur_image = img;
VehicleMove(u, true);
BeginVehicleMove(u);
VehiclePositionChanged(u);
EndVehicleMove(u);
}
void SetAircraftPosition(Vehicle *v, int x, int y, int z)
@@ -704,7 +706,9 @@ void SetAircraftPosition(Vehicle *v, int x, int y, int z)
v->cur_image = v->GetImage(v->direction);
if (v->subtype == AIR_HELICOPTER) v->Next()->Next()->cur_image = GetRotorImage(v);
VehicleMove(v, true);
BeginVehicleMove(v);
VehiclePositionChanged(v);
EndVehicleMove(v);
Vehicle *u = v->Next();
@@ -717,7 +721,9 @@ void SetAircraftPosition(Vehicle *v, int x, int y, int z)
u->z_pos = GetSlopeZ(safe_x, safe_y);
u->cur_image = v->cur_image;
VehicleMove(u, true);
BeginVehicleMove(u);
VehiclePositionChanged(u);
EndVehicleMove(u);
u = u->Next();
if (u != NULL) {
@@ -725,7 +731,9 @@ void SetAircraftPosition(Vehicle *v, int x, int y, int z)
u->y_pos = y;
u->z_pos = z + 5;
VehicleMove(u, true);
BeginVehicleMove(u);
VehiclePositionChanged(u);
EndVehicleMove(u);
}
}
@@ -1148,7 +1156,7 @@ static bool AircraftController(Vehicle *v)
static void HandleCrashedAircraft(Vehicle *v)
{
v->u.air.crashed_counter += 3;
v->u.air.crashed_counter++;
Station *st = GetTargetAirportIfValid(v);
@@ -1622,9 +1630,9 @@ static void AircraftEventHandler_Flying(Vehicle *v, const AirportFTAClass *apc)
if (apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES) &&
st->airport_tile != INVALID_TILE &&
(st->owner == OWNER_NONE || st->owner == v->owner)) {
/* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
* if it is an airplane, look for LANDING, for helicopter HELILANDING
* it is possible to choose from multiple landing runways, so loop until a free one is found */
// {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
// if it is an airplane, look for LANDING, for helicopter HELILANDING
// it is possible to choose from multiple landing runways, so loop until a free one is found
byte landingtype = (v->subtype == AIR_HELICOPTER) ? HELILANDING : LANDING;
const AirportFTA *current = apc->layout[v->u.air.pos].next;
while (current != NULL) {
+6 -6
View File
@@ -15,12 +15,12 @@
#include "table/strings.h"
/**
* Draw the details for the given vehicle at the position (x, y)
*
* @param v current vehicle
* @param x The x coordinate
* @param y The y coordinate
*/
* Draw the details for the given vehicle at the position (x,y)
*
* @param v current vehicle
* @param x The x coordinate
* @param y The y coordinate
*/
void DrawAircraftDetails(const Vehicle *v, int x, int y)
{
int y_offset = (v->Next()->cargo_cap != 0) ? -11 : 0;
+2 -2
View File
@@ -69,8 +69,8 @@ enum {
HELIPAD4 = 22
};
/* Movement Blocks on Airports
* blocks (eg_airport_flags) */
/* Movement Blocks on Airports */
/* blocks (eg_airport_flags) */
static const uint64
TERM1_block = 1ULL << 0,
TERM2_block = 1ULL << 1,
+6 -6
View File
@@ -138,12 +138,12 @@ static const Widget _air_toolbar_widgets[] = {
};
static const WindowDesc _air_toolbar_desc(
static const WindowDesc _air_toolbar_desc = {
WDP_ALIGN_TBR, 22, 64, 36, 64, 36,
WC_BUILD_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
_air_toolbar_widgets
);
_air_toolbar_widgets,
};
void ShowBuildAirToolbar()
{
@@ -299,12 +299,12 @@ static const Widget _build_airport_picker_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _build_airport_desc(
static const WindowDesc _build_airport_desc = {
WDP_AUTO, WDP_AUTO, 148, 240, 148, 240,
WC_BUILD_STATION, WC_BUILD_TOOLBAR,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
_build_airport_picker_widgets
);
_build_airport_picker_widgets,
};
static void ShowBuildAirportPicker(Window *parent)
{
+62 -62
View File
@@ -6,8 +6,8 @@
#define AIRPORT_MOVEMENT_H
/* state machine input struct (from external file, etc.)
* Finite sTate mAchine --> FTA */
// state machine input struct (from external file, etc.)
// Finite sTate mAchine --> FTA
struct AirportFTAbuildup {
byte position; // the position that an airplane is at
byte heading; // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.)
@@ -25,7 +25,7 @@ static const AirportMovingData _airport_moving_data_dummy[] = {
{ 96, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} },
};
/* Country Airfield (small) 4x3 */
// Country Airfield (small) 4x3
static const AirportMovingData _airport_moving_data_country[22] = {
{ 53, 3, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar
{ 53, 27, 0, {DIR_N} }, // 01 Taxi to right outside depot
@@ -51,7 +51,7 @@ static const AirportMovingData _airport_moving_data_country[22] = {
{ 44, 40, AMED_HELI_LOWER, {DIR_N} }, // 21 Helicopter landing
};
/* Commuter Airfield (small) 5x4 */
// Commuter Airfield (small) 5x4
static const AirportMovingData _airport_moving_data_commuter[37] = {
{ 69, 3, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar
{ 72, 22, 0, {DIR_N} }, // 01 Taxi to right outside depot
@@ -78,7 +78,7 @@ static const AirportMovingData _airport_moving_data_commuter[37] = {
{ 1, 6, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 22 Fly around waiting for a landing spot (north-west)
{ 193, 6, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 23 Fly around waiting for a landing spot (south-west)
{ 225, 81, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 24 Fly around waiting for a landing spot (south)
/* Helicopter */
// Helicopter
{ 80, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 25 Bufferspace before helipad
{ 80, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 26 Bufferspace before helipad
{ 32, 8, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 27 Get in position for Helipad1
@@ -93,7 +93,7 @@ static const AirportMovingData _airport_moving_data_commuter[37] = {
{ 56, 8, AMED_EXACTPOS, {DIR_N} }, // pre-helitakeoff helipad 2
};
/* City Airport (large) 6x6 */
// City Airport (large) 6x6
static const AirportMovingData _airport_moving_data_town[] = {
{ 85, 3, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar
{ 85, 27, 0, {DIR_N} }, // 01 Taxi to right outside depot
@@ -111,7 +111,7 @@ static const AirportMovingData _airport_moving_data_town[] = {
{ 177, 87, AMED_HOLD | AMED_SLOWTURN, {DIR_N} }, // 13 Fly to landing position in air
{ 89, 87, AMED_HOLD | AMED_LAND, {DIR_N} }, // 14 Going down for land
{ 20, 87, AMED_NOSPDCLAMP | AMED_BRAKE, {DIR_N} }, // 15 Just landed, brake until end of runway
{ 20, 87, 0, {DIR_N} }, // 16 Just landed, turn around and taxi 1 square // NOT USED
{ 20, 87, 0, {DIR_N} }, // 16 Just landed, turn around and taxi 1 square /* NOT USED */
{ 36, 71, 0, {DIR_N} }, // 17 Taxi from runway to crossing
{ 160, 87, AMED_HOLD | AMED_SLOWTURN, {DIR_N} }, // 18 Fly around waiting for a landing spot (north-east)
{ 140, 1, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 19 Final approach fix
@@ -127,7 +127,7 @@ static const AirportMovingData _airport_moving_data_town[] = {
{ -32, 120, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 29 Initial approach fix (east)
};
/* Metropolitan Airport (metropolitan) - 2 runways */
// Metropolitan Airport (metropolitan) - 2 runways
static const AirportMovingData _airport_moving_data_metropolitan[27] = {
{ 85, 3, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar
{ 85, 27, 0, {DIR_N} }, // 01 Taxi to right outside depot
@@ -158,7 +158,7 @@ static const AirportMovingData _airport_moving_data_metropolitan[27] = {
{ 15, 54, AMED_HELI_LOWER, {DIR_N} }, // 26 Helicopter landing
};
/* International Airport (international) - 2 runways, 6 terminals, dedicated helipod */
// International Airport (international) - 2 runways, 6 terminals, dedicated helipod
static const AirportMovingData _airport_moving_data_international[51] = {
{ 7, 55, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar 1
{ 100, 21, AMED_EXACTPOS, {DIR_SE} }, // 01 In Hangar 2
@@ -201,7 +201,7 @@ static const AirportMovingData _airport_moving_data_international[51] = {
{ 1, 6, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 38 Fly around waiting for a landing spot (north-west)
{ 273, 6, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 39 Fly around waiting for a landing spot (south-west)
{ 305, 81, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 40 Fly around waiting for a landing spot (south)
/* Helicopter */
// Helicopter
{ 128, 80, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 41 Bufferspace before helipad
{ 128, 80, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 42 Bufferspace before helipad
{ 96, 71, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 43 Get in position for Helipad1
@@ -214,7 +214,7 @@ static const AirportMovingData _airport_moving_data_international[51] = {
{ 104, 32, AMED_HELI_LOWER, {DIR_N} }, // 50 Land in HANGAR2_AREA to go to hangar
};
/* Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads */
// Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads
static const AirportMovingData _airport_moving_data_intercontinental[77] = {
{ 7, 87, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar 1
{ 135, 72, AMED_EXACTPOS, {DIR_SE} }, // 01 In Hangar 2
@@ -263,7 +263,7 @@ static const AirportMovingData _airport_moving_data_intercontinental[77] = {
{ -200, 88, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 44 Fly around waiting for a landing spot (north-west)
{ 56, -168, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 45 Fly around waiting for a landing spot (south-west)
{ 312, 88, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 46 Fly around waiting for a landing spot (south)
/* Helicopter */
// Helicopter
{ 96, 40, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 47 Bufferspace before helipad
{ 96, 40, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 48 Bufferspace before helipad
{ 82, 54, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 49 Get in position for Helipad1
@@ -297,7 +297,7 @@ static const AirportMovingData _airport_moving_data_intercontinental[77] = {
};
/* Heliport (heliport) */
// Heliport (heliport)
static const AirportMovingData _airport_moving_data_heliport[9] = {
{ 5, 9, AMED_EXACTPOS, {DIR_NE} }, // 0 - At heliport terminal
{ 2, 9, AMED_HELI_RAISE, {DIR_N} }, // 1 - Take off (play sound)
@@ -310,7 +310,7 @@ static const AirportMovingData _airport_moving_data_heliport[9] = {
{ 70, 9, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 8 - Circle #4 (south)
};
/* HeliDepot 2x2 (heliport) */
// HeliDepot 2x2 (heliport)
static const AirportMovingData _airport_moving_data_helidepot[18] = {
{ 24, 4, AMED_EXACTPOS, {DIR_NE} }, // 0 - At depot
{ 24, 28, 0, {DIR_N} }, // 1 Taxi to right outside depot
@@ -332,7 +332,7 @@ static const AirportMovingData _airport_moving_data_helidepot[18] = {
{ 8, 24, AMED_SLOWTURN | AMED_EXACTPOS, {DIR_E} }, // 17 - turn on helipad1 for takeoff
};
/* HeliDepot 2x2 (heliport) */
// HeliDepot 2x2 (heliport)
static const AirportMovingData _airport_moving_data_helistation[33] = {
{ 8, 3, AMED_EXACTPOS, {DIR_SE} }, // 00 In Hangar2
{ 8, 22, 0, {DIR_N} }, // 01 outside hangar 2
@@ -369,7 +369,7 @@ static const AirportMovingData _airport_moving_data_helistation[33] = {
{ 132, -24, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 32 Fly around waiting for a landing spot (north-east)
};
/* Oilrig */
// Oilrig
static const AirportMovingData _airport_moving_data_oilrig[9] = {
{ 31, 9, AMED_EXACTPOS, {DIR_NE} }, // 0 - At oilrig terminal
{ 28, 9, AMED_HELI_RAISE, {DIR_N} }, // 1 - Take off (play sound)
@@ -406,17 +406,17 @@ static const AirportFTAbuildup _airport_fta_country[] = {
{ 4, 255, AIRPORT_BUSY_block, 0 }, { 4, TERM2, 0, 5 }, { 4, HANGAR, 0, 1 }, { 4, TAKEOFF, 0, 6 }, { 4, HELITAKEOFF, 0, 1 },
{ 5, 255, AIRPORT_BUSY_block, 0 }, { 5, TERM2, TERM2_block, 3 }, { 5, 0, 0, 4 },
{ 6, 0, AIRPORT_BUSY_block, 7 },
/* takeoff */
// takeoff
{ 7, TAKEOFF, AIRPORT_BUSY_block, 8 },
{ 8, STARTTAKEOFF, NOTHING_block, 9 },
{ 9, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 10, FLYING, NOTHING_block, 15 }, { 10, LANDING, 0, 11 }, { 10, HELILANDING, 0, 20 },
{ 11, LANDING, AIRPORT_BUSY_block, 12 },
{ 12, 0, AIRPORT_BUSY_block, 13 },
{ 13, ENDLANDING, AIRPORT_BUSY_block, 14 }, { 13, TERM2, 0, 5 }, { 13, 0, 0, 14 },
{ 14, 0, AIRPORT_BUSY_block, 1 },
/* In air */
// In air
{ 15, 0, NOTHING_block, 16 },
{ 16, 0, NOTHING_block, 17 },
{ 17, 0, NOTHING_block, 18 },
@@ -444,31 +444,31 @@ static const AirportFTAbuildup _airport_fta_commuter[] = {
{ 9, 255, TAXIWAY_BUSY_block, 9 }, { 9, TAKEOFF, TAXIWAY_BUSY_block, 10 }, { 9, HANGAR, TAXIWAY_BUSY_block, 10 }, { 9, TERM2, TERM2_block, 4 }, { 9, HELIPAD1, HELIPAD1_block, 6 }, { 9, HELITAKEOFF, HELIPAD1_block, 6 }, { 9, TERM1, TAXIWAY_BUSY_block, 8 }, { 9, 0, TAXIWAY_BUSY_block, 10 },
{ 10, 255, TAXIWAY_BUSY_block, 10 }, { 10, TERM3, TERM3_block, 5 }, { 10, HELIPAD1, 0, 9 }, { 10, HELIPAD2, HELIPAD2_block, 7 }, { 10, HELITAKEOFF, HELIPAD2_block, 7 }, { 10, TAKEOFF, TAXIWAY_BUSY_block, 1 }, { 10, HANGAR, TAXIWAY_BUSY_block, 1 }, { 10, 0, TAXIWAY_BUSY_block, 9 },
{ 11, 0, OUT_WAY_block, 12 },
/* takeoff */
// takeoff
{ 12, TAKEOFF, RUNWAY_IN_OUT_block, 13 },
{ 13, 0, RUNWAY_IN_OUT_block, 14 },
{ 14, STARTTAKEOFF, RUNWAY_IN_OUT_block, 15 },
{ 15, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 16, FLYING, NOTHING_block, 21 }, { 16, LANDING, IN_WAY_block, 17 }, { 16, HELILANDING, 0, 25 },
{ 17, LANDING, RUNWAY_IN_OUT_block, 18 },
{ 18, 0, RUNWAY_IN_OUT_block, 19 },
{ 19, 0, RUNWAY_IN_OUT_block, 20 },
{ 20, ENDLANDING, IN_WAY_block, 2 },
/* In Air */
// In Air
{ 21, 0, NOTHING_block, 22 },
{ 22, 0, NOTHING_block, 23 },
{ 23, 0, NOTHING_block, 24 },
{ 24, 0, NOTHING_block, 16 },
/* Helicopter -- stay in air in special place as a buffer to choose from helipads */
// Helicopter -- stay in air in special place as a buffer to choose from helipads
{ 25, HELILANDING, PRE_HELIPAD_block, 26 },
{ 26, HELIENDLANDING, PRE_HELIPAD_block, 26 }, { 26, HELIPAD1, 0, 27 }, { 26, HELIPAD2, 0, 28 }, { 26, HANGAR, 0, 33 },
{ 27, 0, NOTHING_block, 29 }, // helipad1 approach
{ 27, 0, NOTHING_block, 29 }, //helipad1 approach
{ 28, 0, NOTHING_block, 30 },
/* landing */
// landing
{ 29, 255, NOTHING_block, 0 }, { 29, HELIPAD1, HELIPAD1_block, 6 },
{ 30, 255, NOTHING_block, 0 }, { 30, HELIPAD2, HELIPAD2_block, 7 },
/* Helicopter -- takeoff */
// Helicopter -- takeoff
{ 31, HELITAKEOFF, NOTHING_block, 0 },
{ 32, HELITAKEOFF, NOTHING_block, 0 },
{ 33, 0, TAXIWAY_BUSY_block, 34 }, // need to go to hangar when waiting in air
@@ -492,22 +492,22 @@ static const AirportFTAbuildup _airport_fta_city[] = {
{ 7, 255, TAXIWAY_BUSY_block, 0 }, { 7, TERM1, TERM1_block, 2 }, { 7, TAKEOFF, OUT_WAY_block, 8 }, { 7, HELITAKEOFF, 0, 22 }, { 7, HANGAR, 0, 1 }, { 7, 0, 0, 6 },
{ 8, 0, OUT_WAY_block, 9 },
{ 9, 0, RUNWAY_IN_OUT_block, 10 },
/* takeoff */
// takeoff
{ 10, TAKEOFF, RUNWAY_IN_OUT_block, 11 },
{ 11, STARTTAKEOFF, NOTHING_block, 12 },
{ 12, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 13, FLYING, NOTHING_block, 18 }, { 13, LANDING, 0, 14 }, { 13, HELILANDING, 0, 23 },
{ 14, LANDING, RUNWAY_IN_OUT_block, 15 },
{ 15, 0, RUNWAY_IN_OUT_block, 17 },
{ 16, 0, RUNWAY_IN_OUT_block, 17 }, // not used, left for compatibility
{ 16, 0, RUNWAY_IN_OUT_block, 17 }, /* not used, left for compatibility */
{ 17, ENDLANDING, IN_WAY_block, 7 },
/* In Air */
// In Air
{ 18, 0, NOTHING_block, 25 },
{ 19, 0, NOTHING_block, 20 },
{ 20, 0, NOTHING_block, 21 },
{ 21, 0, NOTHING_block, 13 },
/* helicopter */
// helicopter
{ 22, HELITAKEOFF, NOTHING_block, 0 },
{ 23, HELILANDING, IN_WAY_block, 24 },
{ 24, HELIENDLANDING, IN_WAY_block, 17 },
@@ -533,23 +533,23 @@ static const AirportFTAbuildup _airport_fta_metropolitan[] = {
{ 7, 255, TAXIWAY_BUSY_block, 0 }, { 7, TERM1, TERM1_block, 2 }, { 7, TAKEOFF, 0, 8 }, { 7, HELITAKEOFF, 0, 23 }, { 7, HANGAR, 0, 1 }, { 7, 0, 0, 6 },
{ 8, 0, OUT_WAY_block, 9 },
{ 9, 0, RUNWAY_OUT_block, 10 },
/* takeoff */
// takeoff
{ 10, TAKEOFF, RUNWAY_OUT_block, 11 },
{ 11, STARTTAKEOFF, NOTHING_block, 12 },
{ 12, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 13, FLYING, NOTHING_block, 19 }, { 13, LANDING, 0, 14 }, { 13, HELILANDING, 0, 25 },
{ 14, LANDING, RUNWAY_IN_block, 15 },
{ 15, 0, RUNWAY_IN_block, 16 },
{ 16, 255, RUNWAY_IN_block, 0 }, { 16, ENDLANDING, IN_WAY_block, 17 },
{ 17, 255, RUNWAY_OUT_block, 0 }, { 17, ENDLANDING, IN_WAY_block, 18 },
{ 18, ENDLANDING, IN_WAY_block, 7 },
/* In Air */
// In Air
{ 19, 0, NOTHING_block, 20 },
{ 20, 0, NOTHING_block, 21 },
{ 21, 0, NOTHING_block, 22 },
{ 22, 0, NOTHING_block, 13 },
/* helicopter */
// helicopter
{ 23, 0, NOTHING_block, 24 },
{ 24, HELITAKEOFF, NOTHING_block, 0 },
{ 25, HELILANDING, IN_WAY_block, 26 },
@@ -590,31 +590,31 @@ static const AirportFTAbuildup _airport_fta_international[] = {
{ 25, 255, TERM_GROUP1_block, 0 }, { 25, TERM3, TERM3_block, 6 }, { 25, TAKEOFF, 0, 26 }, { 25, 0, 0, 24 },
{ 26, 255, TAXIWAY_BUSY_block, 0 }, { 26, TAKEOFF, 0, 27 }, { 26, 0, 0, 25 },
{ 27, 0, OUT_WAY_block, 28 },
/* takeoff */
// takeoff
{ 28, TAKEOFF, OUT_WAY_block, 29 },
{ 29, 0, RUNWAY_OUT_block, 30 },
{ 30, STARTTAKEOFF, NOTHING_block, 31 },
{ 31, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 32, FLYING, NOTHING_block, 37 }, { 32, LANDING, 0, 33 }, { 32, HELILANDING, 0, 41 },
{ 33, LANDING, RUNWAY_IN_block, 34 },
{ 34, 0, RUNWAY_IN_block, 35 },
{ 35, 0, RUNWAY_IN_block, 36 },
{ 36, ENDLANDING, IN_WAY_block, 36 }, { 36, 255, TERM_GROUP1_block, 0 }, { 36, 255, TERM_GROUP2_ENTER1_block, 1 }, { 36, TERM4, 0, 12 }, { 36, TERM5, 0, 12 }, { 36, TERM6, 0, 12 }, { 36, 0, 0, 2 },
/* In Air */
// In Air
{ 37, 0, NOTHING_block, 38 },
{ 38, 0, NOTHING_block, 39 },
{ 39, 0, NOTHING_block, 40 },
{ 40, 0, NOTHING_block, 32 },
/* Helicopter -- stay in air in special place as a buffer to choose from helipads */
// Helicopter -- stay in air in special place as a buffer to choose from helipads
{ 41, HELILANDING, PRE_HELIPAD_block, 42 },
{ 42, HELIENDLANDING, PRE_HELIPAD_block, 42 }, { 42, HELIPAD1, 0, 43 }, { 42, HELIPAD2, 0, 44 }, { 42, HANGAR, 0, 49 },
{ 43, 0, NOTHING_block, 45 },
{ 44, 0, NOTHING_block, 46 },
/* landing */
// landing
{ 45, 255, NOTHING_block, 0 }, { 45, HELIPAD1, HELIPAD1_block, 10 },
{ 46, 255, NOTHING_block, 0 }, { 46, HELIPAD2, HELIPAD2_block, 11 },
/* Helicopter -- takeoff */
// Helicopter -- takeoff
{ 47, HELITAKEOFF, NOTHING_block, 0 },
{ 48, HELITAKEOFF, NOTHING_block, 0 },
{ 49, 0, HANGAR2_AREA_block, 50 }, // need to go to hangar when waiting in air
@@ -622,7 +622,7 @@ static const AirportFTAbuildup _airport_fta_international[] = {
{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
};
/* intercontinental */
// intercontinental
static const TileIndexDiffC _airport_depots_intercontinental[] = { { 0, 5 }, { 8, 4 } };
static const byte _airport_terminal_intercontinental[] = { 2, 4, 4 };
static const byte _airport_helipad_intercontinental[] = { 1, 2 };
@@ -660,12 +660,12 @@ static const AirportFTAbuildup _airport_fta_intercontinental[] = {
{ 29, 255, TERM_GROUP1_block, 0 }, { 29, TERM4, TERM4_block, 7 }, { 29, HANGAR, HANGAR1_AREA_block, 27 }, { 29, TAKEOFF, 0, 30 }, { 29, 0, 0, 28 },
{ 30, 0, OUT_WAY_block2, 31 },
{ 31, 0, OUT_WAY_block, 32 },
/* takeoff */
// takeoff
{ 32, TAKEOFF, RUNWAY_OUT_block, 33 },
{ 33, 0, RUNWAY_OUT_block, 34 },
{ 34, STARTTAKEOFF, NOTHING_block, 35 },
{ 35, ENDTAKEOFF, NOTHING_block, 0 },
/* landing */
// landing
{ 36, 0, 0, 0 },
{ 37, LANDING, RUNWAY_IN_block, 38 },
{ 38, 0, RUNWAY_IN_block, 39 },
@@ -673,32 +673,32 @@ static const AirportFTAbuildup _airport_fta_intercontinental[] = {
{ 40, ENDLANDING, RUNWAY_IN_block, 41 },
{ 41, 0, IN_WAY_block, 42 },
{ 42, 255, IN_WAY_block, 0 }, { 42, 255, TERM_GROUP1_block, 0 }, { 42, 255, TERM_GROUP1_block, 1 }, { 42, HANGAR, 0, 2 }, { 42, 0, 0, 26 },
/* In Air */
// In Air
{ 43, 0, 0, 44 },
{ 44, FLYING, 0, 45 }, { 44, HELILANDING, 0, 47 }, { 44, LANDING, 0, 69 }, { 44, 0, 0, 45 },
{ 45, 0, 0, 46 },
{ 46, FLYING, 0, 43 }, { 46, LANDING, 0, 76 }, { 46, 0, 0, 43 },
/* Helicopter -- stay in air in special place as a buffer to choose from helipads */
// Helicopter -- stay in air in special place as a buffer to choose from helipads
{ 47, HELILANDING, PRE_HELIPAD_block, 48 },
{ 48, HELIENDLANDING, PRE_HELIPAD_block, 48 }, { 48, HELIPAD1, 0, 49 }, { 48, HELIPAD2, 0, 50 }, { 48, HANGAR, 0, 55 },
{ 49, 0, NOTHING_block, 51 },
{ 50, 0, NOTHING_block, 52 },
/* landing */
// landing
{ 51, 255, NOTHING_block, 0 }, { 51, HELIPAD1, HELIPAD1_block, 12 }, { 51, HANGAR, 0, 55 }, { 51, 0, 0, 12 },
{ 52, 255, NOTHING_block, 0 }, { 52, HELIPAD2, HELIPAD2_block, 13 }, { 52, HANGAR, 0, 55 }, { 52, 0, 0, 13 },
/* Helicopter -- takeoff */
// Helicopter -- takeoff
{ 53, HELITAKEOFF, NOTHING_block, 0 },
{ 54, HELITAKEOFF, NOTHING_block, 0 },
{ 55, 0, HANGAR2_AREA_block, 56 }, // need to go to hangar when waiting in air
{ 56, 0, HANGAR2_AREA_block, 3 },
/* runway 2 out support */
// runway 2 out support
{ 57, 255, OUT_WAY2_block, 0 }, { 57, TAKEOFF, 0, 58 }, { 57, 0, 0, 58 },
{ 58, 0, OUT_WAY2_block, 59 },
{ 59, TAKEOFF, RUNWAY_OUT2_block, 60 }, // takeoff
{ 60, 0, RUNWAY_OUT2_block, 61 },
{ 61, STARTTAKEOFF, NOTHING_block, 62 },
{ 62, ENDTAKEOFF, NOTHING_block, 0 },
/* runway 2 in support */
// runway 2 in support
{ 63, LANDING, RUNWAY_IN2_block, 64 },
{ 64, 0, RUNWAY_IN2_block, 65 },
{ 65, 0, RUNWAY_IN2_block, 66 },
@@ -717,7 +717,7 @@ static const AirportFTAbuildup _airport_fta_intercontinental[] = {
};
/* heliports, oilrigs don't have depots */
// heliports, oilrigs don't have depots
static const byte _airport_helipad_heliport_oilrig[] = { 1, 1 };
static const byte _airport_entries_heliport_oilrig[] = { 7, 7, 7, 7 };
static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
@@ -726,7 +726,7 @@ static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
{ 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 },
{ 3, HELILANDING, AIRPORT_BUSY_block, 4 },
{ 4, HELIENDLANDING, AIRPORT_BUSY_block, 4 }, { 4, HELIPAD1, HELIPAD1_block, 0 }, { 4, HELITAKEOFF, 0, 2 },
/* In Air */
// In Air
{ 5, 0, NOTHING_block, 6 },
{ 6, 0, NOTHING_block, 7 },
{ 7, 0, NOTHING_block, 8 },
@@ -734,7 +734,7 @@ static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
};
/* helidepots */
// helidepots
static const TileIndexDiffC _airport_depots_helidepot[] = { { 1, 0 } };
static const byte _airport_helipad_helidepot[] = { 1, 1 };
static const byte _airport_entries_helidepot[] = { 4, 4, 4, 4 };
@@ -742,18 +742,18 @@ static const AirportFTAbuildup _airport_fta_helidepot[] = {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, 255, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELIPAD1, HELIPAD1_block, 14 }, { 1, HELITAKEOFF, 0, 15 }, { 1, 0, 0, 0 },
{ 2, FLYING, NOTHING_block, 3 }, { 2, HELILANDING, PRE_HELIPAD_block, 7 }, { 2, HANGAR, 0, 12 }, { 2, HELITAKEOFF, NOTHING_block, 16 },
/* In Air */
// In Air
{ 3, 0, NOTHING_block, 4 },
{ 4, 0, NOTHING_block, 5 },
{ 5, 0, NOTHING_block, 6 },
{ 6, 0, NOTHING_block, 2 },
/* Helicopter -- stay in air in special place as a buffer to choose from helipads */
// Helicopter -- stay in air in special place as a buffer to choose from helipads
{ 7, HELILANDING, PRE_HELIPAD_block, 8 },
{ 8, HELIENDLANDING, PRE_HELIPAD_block, 8 }, { 8, HELIPAD1, 0, 9 }, { 8, HANGAR, 0, 12 }, { 8, 0, 0, 2 },
{ 9, 0, NOTHING_block, 10 },
/* landing */
// landing
{ 10, 255, NOTHING_block, 10 }, { 10, HELIPAD1, HELIPAD1_block, 14 }, { 10, HANGAR, 0, 1 }, { 10, 0, 0, 14 },
/* Helicopter -- takeoff */
// Helicopter -- takeoff
{ 11, HELITAKEOFF, NOTHING_block, 0 },
{ 12, 0, HANGAR2_AREA_block, 13 }, // need to go to hangar when waiting in air
{ 13, 0, HANGAR2_AREA_block, 1 },
@@ -764,16 +764,16 @@ static const AirportFTAbuildup _airport_fta_helidepot[] = {
{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
};
/* helistation */
// helistation
static const TileIndexDiffC _airport_depots_helistation[] = { { 0, 0 } };
static const byte _airport_helipad_helistation[] = { 1, 3 };
static const byte _airport_entries_helistation[] = { 25, 25, 25, 25 };
static const AirportFTAbuildup _airport_fta_helistation[] = {
{ 0, HANGAR, NOTHING_block, 8 }, { 0, HELIPAD1, 0, 1 }, { 0, HELIPAD2, 0, 1 }, { 0, HELIPAD3, 0, 1 }, { 0, HELITAKEOFF, 0, 1 }, { 0, 0, 0, 0 },
{ 1, 255, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELITAKEOFF, 0, 3 }, { 1, 0, 0, 4 },
/* landing */
// landing
{ 2, FLYING, NOTHING_block, 28 }, { 2, HELILANDING, 0, 15 }, { 2, 0, 0, 28 },
/* helicopter side */
// helicopter side
{ 3, HELITAKEOFF, NOTHING_block, 0 }, // helitakeoff outside hangar2
{ 4, 255, TAXIWAY_BUSY_block, 0 }, { 4, HANGAR, HANGAR2_AREA_block, 1 }, { 4, HELITAKEOFF, 0, 1 }, { 4, 0, 0, 5 },
{ 5, 255, TAXIWAY_BUSY_block, 0 }, { 5, HELIPAD1, HELIPAD1_block, 6 }, { 5, HELIPAD2, HELIPAD2_block, 7 }, { 5, HELIPAD3, HELIPAD3_block, 8 }, { 5, 0, 0, 4 },
@@ -786,13 +786,13 @@ static const AirportFTAbuildup _airport_fta_helistation[] = {
{ 12, HELITAKEOFF, NOTHING_block, 0 },
{ 13, HELITAKEOFF, NOTHING_block, 0 },
{ 14, HELITAKEOFF, NOTHING_block, 0 },
/* heli - in flight moves */
// heli - in flight moves
{ 15, HELILANDING, PRE_HELIPAD_block, 16 },
{ 16, HELIENDLANDING, PRE_HELIPAD_block, 16 }, { 16, HELIPAD1, 0, 17 }, { 16, HELIPAD2, 0, 18 }, { 16, HELIPAD3, 0, 19 }, { 16, HANGAR, 0, 23 },
{ 17, 0, NOTHING_block, 20 },
{ 18, 0, NOTHING_block, 21 },
{ 19, 0, NOTHING_block, 22 },
/* heli landing */
// heli landing
{ 20, 255, NOTHING_block, 0 }, { 20, HELIPAD1, HELIPAD1_block, 6 }, { 20, HANGAR, 0, 23 }, { 20, 0, 0, 6 },
{ 21, 255, NOTHING_block, 0 }, { 21, HELIPAD2, HELIPAD2_block, 7 }, { 21, HANGAR, 0, 23 }, { 21, 0, 0, 7 },
{ 22, 255, NOTHING_block, 0 }, { 22, HELIPAD3, HELIPAD3_block, 8 }, { 22, HANGAR, 0, 23 }, { 22, 0, 0, 8 },
+1 -61
View File
@@ -9,8 +9,6 @@
#include "newgrf_engine.h"
#include "vehicle_func.h"
#include "table/strings.h"
static const uint MAX_ARTICULATED_PARTS = 100; ///< Maximum of articulated parts per vehicle, i.e. when to abort calling the articulated vehicle callback.
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
@@ -240,64 +238,6 @@ bool IsArticulatedVehicleCarryingDifferentCargos(const Vehicle *v, CargoID *carg
return false;
}
/**
* Checks whether the specs of freshly build articulated vehicles are consistent with the information specified in the purchase list.
* Only essential information is checked to leave room for magic tricks/workarounds to grfcoders.
* It checks:
* For autoreplace/-renew:
* - Default cargo type (without capacity)
* - intersection and union of refit masks.
*/
void CheckConsistencyOfArticulatedVehicle(const Vehicle *v)
{
const Engine *engine = GetEngine(v->engine_type);
uint32 purchase_refit_union = GetUnionOfArticulatedRefitMasks(v->engine_type, v->type, true);
uint32 purchase_refit_intersection = GetIntersectionOfArticulatedRefitMasks(v->engine_type, v->type, true);
uint16 *purchase_default_capacity = GetCapacityOfArticulatedParts(v->engine_type, v->type);
uint32 real_refit_union = 0;
uint32 real_refit_intersection = UINT_MAX;
uint16 real_default_capacity[NUM_CARGO];
memset(real_default_capacity, 0, sizeof(real_default_capacity));
do {
uint32 refit_mask = GetAvailableVehicleCargoTypes(v->engine_type, v->type, true);
real_refit_union |= refit_mask;
if (refit_mask != 0) real_refit_intersection &= refit_mask;
assert(v->cargo_type < NUM_CARGO);
real_default_capacity[v->cargo_type] += v->cargo_cap;
switch (v->type) {
case VEH_TRAIN:
v = (EngineHasArticPart(v) ? GetNextArticPart(v) : NULL);
break;
case VEH_ROAD:
v = (RoadVehHasArticPart(v) ? v->Next() : NULL);
break;
default:
v = NULL;
break;
}
} while (v != NULL);
/* Check whether the vehicle carries more cargos than expected */
bool carries_more = false;
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
if (real_default_capacity[cid] != 0 && purchase_default_capacity[cid] == 0) {
carries_more = true;
break;
}
}
/* show a warning once for each GRF after each game load */
if (real_refit_union != purchase_refit_union || real_refit_intersection != purchase_refit_intersection || carries_more) {
ShowNewGrfVehicleError(engine->index, STR_NEWGRF_BUGGY, STR_NEWGRF_BUGGY_ARTICULATED_CARGO, GBUG_VEH_REFIT, false);
}
}
void AddArticulatedParts(Vehicle **vl, VehicleType type)
{
@@ -389,6 +329,6 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
if (flip_image) u->spritenum++;
VehicleMove(u, false);
VehiclePositionChanged(u);
}
}
-2
View File
@@ -15,7 +15,5 @@ uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, VehicleType type, bool i
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, VehicleType type, bool include_initial_cargo_type);
bool IsArticulatedVehicleCarryingDifferentCargos(const Vehicle *v, CargoID *cargo_type);
bool IsArticulatedVehicleRefittable(EngineID engine);
void CheckConsistencyOfArticulatedVehicle(const Vehicle *v);
#endif /* ARTICULATED_VEHICLES_H */
+3 -5
View File
@@ -342,6 +342,7 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head,
/** Replace a single unit in a free wagon chain
* @param single_unit vehicle to let autoreplace/renew operator on
* @param flags command flags
* @param wagon_removal remove wagons when the resulting chain occupies more tiles than the old did
* @param nothing_to_do is set to 'false' when something was done (only valid when not failed)
* @return cost or error
*/
@@ -513,7 +514,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
*chain = new_head;
}
/* Transfer cargo of old vehicles and sell them */
/* Transfer cargo of old vehicles and sell them*/
for (int i = 0; i < num_units; i++) {
Vehicle *w = old_vehs[i];
/* Is the vehicle again part of the new chain?
@@ -522,10 +523,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
if ((flags & DC_EXEC) != 0) TransferCargo(w, new_head, true);
/* Sell the vehicle.
* Note: This might temporarly construct new trains, so use DC_AUTOREPLACE to prevent
* it from failing due to engine limits. */
cost.AddCost(DoCommand(0, w->index, 0, flags | DC_AUTOREPLACE, GetCmdSellVeh(w)));
cost.AddCost(DoCommand(0, w->index, 0, flags, GetCmdSellVeh(w)));
if ((flags & DC_EXEC) != 0) {
old_vehs[i] = NULL;
if (i == 0) old_head = NULL;
+17 -17
View File
@@ -207,7 +207,7 @@ public:
if (vehicletype == VEH_TRAIN) {
this->wagon_btnstate = true;
/* The train window is bigger so we will move some of the widgets to fit the new size.
* We will start by moving the resize button to the lower right corner. */
* We will start by moving the resize button to the lower right corner. */
widget[RVW_WIDGET_RESIZE].top = widget[RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE].top;
widget[RVW_WIDGET_RESIZE].bottom = widget[RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE].bottom;
widget[RVW_WIDGET_STOP_REPLACE].right = widget[RVW_WIDGET_RESIZE].right;
@@ -342,7 +342,7 @@ public:
this->SetDirty();
break;
case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: { // Railtype selection dropdown menu
case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: { /* Railtype selection dropdown menu */
const Company *c = GetCompany(_local_company);
DropDownList *list = new DropDownList();
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
@@ -355,18 +355,18 @@ public:
break;
}
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: // toggle renew_keep_length
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: /* toggle renew_keep_length */
DoCommandP(0, 5, GetCompany(_local_company)->renew_keep_length ? 0 : 1, CMD_SET_AUTOREPLACE);
break;
case RVW_WIDGET_START_REPLACE: { // Start replacing
case RVW_WIDGET_START_REPLACE: { /* Start replacing */
EngineID veh_from = this->sel_engine[0];
EngineID veh_to = this->sel_engine[1];
DoCommandP(0, 3 + (this->sel_group << 16) , veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
} break;
case RVW_WIDGET_STOP_REPLACE: { // Stop replacing
case RVW_WIDGET_STOP_REPLACE: { /* Stop replacing */
EngineID veh_from = this->sel_engine[0];
DoCommandP(0, 3 + (this->sel_group << 16), veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
@@ -421,12 +421,12 @@ public:
if (delta.x != 0) {
/* We changed the width of the window so we have to resize the lists.
* Because ResizeButtons() makes each widget the same size it can't be used on the lists
* because then the lists would have the same size as the scrollbars.
* Instead we use it on the detail panels.
* Afterwards we use the new location of the detail panels (the middle of the window)
* to place the lists.
* This way the lists will have equal size while keeping the width of the scrollbars unchanged. */
* Because ResizeButtons() makes each widget the same size it can't be used on the lists
* because then the lists would have the same size as the scrollbars.
* Instead we use it on the detail panels.
* Afterwards we use the new location of the detail panels (the middle of the window)
* to place the lists.
* This way the lists will have equal size while keeping the width of the scrollbars unchanged. */
ResizeButtons(this, RVW_WIDGET_LEFT_DETAILS, RVW_WIDGET_RIGHT_DETAILS);
widget[RVW_WIDGET_RIGHT_MATRIX].left = widget[RVW_WIDGET_RIGHT_DETAILS].left;
widget[RVW_WIDGET_LEFT_SCROLLBAR].right = widget[RVW_WIDGET_LEFT_DETAILS].right;
@@ -470,19 +470,19 @@ static const Widget _replace_vehicle_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _replace_rail_vehicle_desc(
static const WindowDesc _replace_rail_vehicle_desc = {
WDP_AUTO, WDP_AUTO, 456, 140, 456, 140,
WC_REPLACE_VEHICLE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
_replace_vehicle_widgets
);
_replace_vehicle_widgets,
};
static const WindowDesc _replace_vehicle_desc(
static const WindowDesc _replace_vehicle_desc = {
WDP_AUTO, WDP_AUTO, 456, 118, 456, 118,
WC_REPLACE_VEHICLE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
_replace_vehicle_widgets
);
_replace_vehicle_widgets,
};
RailType ReplaceVehicleWindow::sel_railtype = RAILTYPE_RAIL;
+48 -48
View File
@@ -25,36 +25,36 @@
int _aystar_stats_open_size;
int _aystar_stats_closed_size;
/* This looks in the Hash if a node exists in ClosedList
* If so, it returns the PathNode, else NULL */
// This looks in the Hash if a node exists in ClosedList
// If so, it returns the PathNode, else NULL
static PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, const AyStarNode *node)
{
return (PathNode*)Hash_Get(&aystar->ClosedListHash, node->tile, node->direction);
}
/* This adds a node to the ClosedList
* It makes a copy of the data */
// This adds a node to the ClosedList
// It makes a copy of the data
static void AyStarMain_ClosedList_Add(AyStar *aystar, const PathNode *node)
{
/* Add a node to the ClosedList */
// Add a node to the ClosedList
PathNode *new_node = MallocT<PathNode>(1);
*new_node = *node;
Hash_Set(&aystar->ClosedListHash, node->node.tile, node->node.direction, new_node);
}
/* Checks if a node is in the OpenList
* If so, it returns the OpenListNode, else NULL */
// Checks if a node is in the OpenList
// If so, it returns the OpenListNode, else NULL
static OpenListNode *AyStarMain_OpenList_IsInList(AyStar *aystar, const AyStarNode *node)
{
return (OpenListNode*)Hash_Get(&aystar->OpenListHash, node->tile, node->direction);
}
/* Gets the best node from OpenList
* returns the best node, or NULL of none is found
* Also it deletes the node from the OpenList */
// Gets the best node from OpenList
// returns the best node, or NULL of none is found
// Also it deletes the node from the OpenList
static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
{
/* Return the item the Queue returns.. the best next OpenList item. */
// Return the item the Queue returns.. the best next OpenList item.
OpenListNode *res = (OpenListNode*)aystar->OpenListQueue.pop(&aystar->OpenListQueue);
if (res != NULL) {
Hash_Delete(&aystar->OpenListHash, res->path.node.tile, res->path.node.direction);
@@ -63,18 +63,18 @@ static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
return res;
}
/* Adds a node to the OpenList
* It makes a copy of node, and puts the pointer of parent in the struct */
// Adds a node to the OpenList
// It makes a copy of node, and puts the pointer of parent in the struct
static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, const AyStarNode *node, int f, int g)
{
/* Add a new Node to the OpenList */
// Add a new Node to the OpenList
OpenListNode *new_node = MallocT<OpenListNode>(1);
new_node->g = g;
new_node->path.parent = parent;
new_node->path.node = *node;
Hash_Set(&aystar->OpenListHash, node->tile, node->direction, new_node);
/* Add it to the queue */
// Add it to the queue
aystar->OpenListQueue.push(&aystar->OpenListQueue, new_node, f);
}
@@ -89,49 +89,49 @@ int AyStarMain_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *pare
PathNode *closedlist_parent;
OpenListNode *check;
/* Check the new node against the ClosedList */
// Check the new node against the ClosedList
if (AyStarMain_ClosedList_IsInList(aystar, current) != NULL) return AYSTAR_DONE;
/* Calculate the G-value for this node */
// Calculate the G-value for this node
new_g = aystar->CalculateG(aystar, current, parent);
/* If the value was INVALID_NODE, we don't do anything with this node */
// If the value was INVALID_NODE, we don't do anything with this node
if (new_g == AYSTAR_INVALID_NODE) return AYSTAR_DONE;
/* There should not be given any other error-code.. */
// There should not be given any other error-code..
assert(new_g >= 0);
/* Add the parent g-value to the new g-value */
// Add the parent g-value to the new g-value
new_g += parent->g;
if (aystar->max_path_cost != 0 && (uint)new_g > aystar->max_path_cost) return AYSTAR_DONE;
/* Calculate the h-value */
// Calculate the h-value
new_h = aystar->CalculateH(aystar, current, parent);
/* There should not be given any error-code.. */
// There should not be given any error-code..
assert(new_h >= 0);
/* The f-value if g + h */
// The f-value if g + h
new_f = new_g + new_h;
/* Get the pointer to the parent in the ClosedList (the currentone is to a copy of the one in the OpenList) */
// Get the pointer to the parent in the ClosedList (the currentone is to a copy of the one in the OpenList)
closedlist_parent = AyStarMain_ClosedList_IsInList(aystar, &parent->path.node);
/* Check if this item is already in the OpenList */
// Check if this item is already in the OpenList
check = AyStarMain_OpenList_IsInList(aystar, current);
if (check != NULL) {
uint i;
/* Yes, check if this g value is lower.. */
// Yes, check if this g value is lower..
if (new_g > check->g) return AYSTAR_DONE;
aystar->OpenListQueue.del(&aystar->OpenListQueue, check, 0);
/* It is lower, so change it to this item */
// It is lower, so change it to this item
check->g = new_g;
check->path.parent = closedlist_parent;
/* Copy user data, will probably have changed */
for (i = 0; i < lengthof(current->user_data); i++) {
check->path.node.user_data[i] = current->user_data[i];
}
/* Readd him in the OpenListQueue */
// Readd him in the OpenListQueue
aystar->OpenListQueue.push(&aystar->OpenListQueue, check, new_f);
} else {
/* A new node, add him to the OpenList */
// A new node, add him to the OpenList
AyStarMain_OpenList_Add(aystar, closedlist_parent, current, new_f, new_g);
}
@@ -153,12 +153,12 @@ int AyStarMain_Loop(AyStar *aystar)
{
int i, r;
/* Get the best node from OpenList */
// Get the best node from OpenList
OpenListNode *current = AyStarMain_OpenList_Pop(aystar);
/* If empty, drop an error */
// If empty, drop an error
if (current == NULL) return AYSTAR_EMPTY_OPENLIST;
/* Check for end node and if found, return that code */
// Check for end node and if found, return that code
if (aystar->EndNodeCheck(aystar, current) == AYSTAR_FOUND_END_NODE) {
if (aystar->FoundEndNode != NULL)
aystar->FoundEndNode(aystar, current);
@@ -166,26 +166,26 @@ int AyStarMain_Loop(AyStar *aystar)
return AYSTAR_FOUND_END_NODE;
}
/* Add the node to the ClosedList */
// Add the node to the ClosedList
AyStarMain_ClosedList_Add(aystar, &current->path);
/* Load the neighbours */
// Load the neighbours
aystar->GetNeighbours(aystar, current);
/* Go through all neighbours */
// Go through all neighbours
for (i = 0; i < aystar->num_neighbours; i++) {
/* Check and add them to the OpenList if needed */
// Check and add them to the OpenList if needed
r = aystar->checktile(aystar, &aystar->neighbours[i], current);
}
/* Free the node */
// Free the node
free(current);
if (aystar->max_search_nodes != 0 && Hash_Size(&aystar->ClosedListHash) >= aystar->max_search_nodes) {
/* We've expanded enough nodes */
return AYSTAR_LIMIT_REACHED;
} else {
/* Return that we are still busy */
// Return that we are still busy
return AYSTAR_STILL_BUSY;
}
}
@@ -211,10 +211,10 @@ void AyStarMain_Free(AyStar *aystar)
*/
void AyStarMain_Clear(AyStar *aystar)
{
/* Clean the Queue, but not the elements within. That will be done by
* the hash. */
// Clean the Queue, but not the elements within. That will be done by
// the hash.
aystar->OpenListQueue.clear(&aystar->OpenListQueue, false);
/* Clean the hashes */
// Clean the hashes
clear_Hash(&aystar->OpenListHash, true);
clear_Hash(&aystar->ClosedListHash, true);
@@ -235,8 +235,8 @@ void AyStarMain_Clear(AyStar *aystar)
*/
int AyStarMain_Main(AyStar *aystar) {
int r, i = 0;
/* Loop through the OpenList
* Quit if result is no AYSTAR_STILL_BUSY or is more than loops_per_tick */
// Loop through the OpenList
// Quit if result is no AYSTAR_STILL_BUSY or is more than loops_per_tick
while ((r = aystar->loop(aystar)) == AYSTAR_STILL_BUSY && (aystar->loops_per_tick == 0 || ++i < aystar->loops_per_tick)) { }
#ifdef AYSTAR_DEBUG
switch (r) {
@@ -279,14 +279,14 @@ void AyStarMain_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g)
void init_AyStar(AyStar *aystar, Hash_HashProc hash, uint num_buckets)
{
/* Allocated the Hash for the OpenList and ClosedList */
// Allocated the Hash for the OpenList and ClosedList
init_Hash(&aystar->OpenListHash, hash, num_buckets);
init_Hash(&aystar->ClosedListHash, hash, num_buckets);
/* Set up our sorting queue
* BinaryHeap allocates a block of 1024 nodes
* When thatone gets full it reserves an otherone, till this number
* That is why it can stay this high */
// Set up our sorting queue
// BinaryHeap allocates a block of 1024 nodes
// When thatone gets full it reserves an otherone, till this number
// That is why it can stay this high
init_BinaryHeap(&aystar->OpenListQueue, 102400);
aystar->addstart = AyStarMain_AddStartNode;
+6 -6
View File
@@ -35,16 +35,16 @@ struct AyStarNode {
uint user_data[2];
};
/* The resulting path has nodes looking like this. */
// The resulting path has nodes looking like this.
struct PathNode {
AyStarNode node;
/* The parent of this item */
// The parent of this item
PathNode *parent;
};
/* For internal use only
* We do not save the h-value, because it is only needed to calculate the f-value.
* h-value should _always_ be the distance left to the end-tile. */
// For internal use only
// We do not save the h-value, because it is only needed to calculate the f-value.
// h-value should _always_ be the distance left to the end-tile.
struct OpenListNode {
int g;
PathNode path;
@@ -97,7 +97,7 @@ typedef void AyStar_GetNeighbours(AyStar *aystar, OpenListNode *current);
*/
typedef void AyStar_FoundEndNode(AyStar *aystar, OpenListNode *current);
/* For internal use, see aystar.cpp */
// For internal use, see aystar.c
typedef void AyStar_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g);
typedef int AyStar_Main(AyStar *aystar);
typedef int AyStar_Loop(AyStar *aystar);
+1 -1
View File
@@ -128,7 +128,7 @@ void Blitter_32bppBase::ScrollBuffer(void *video, int &left, int &top, int &widt
uint32 *dst;
if (scroll_y > 0) {
/* Calculate pointers */
/*Calculate pointers */
dst = (uint32 *)video + left + (top + height - 1) * _screen.pitch;
src = dst - scroll_y * _screen.pitch;
+12 -12
View File
@@ -97,12 +97,12 @@ public:
}
/**
* Make a pixel looks like it is transparent.
* @param colour the colour already on the screen.
* @param nom the amount of transparency, nominator, makes colour lighter.
* @param denom denominator, makes colour darker.
* @return the new colour for the screen.
*/
* Make a pixel looks like it is transparent.
* @param colour the colour already on the screen.
* @param nom the amount of transparency, nominator, makes colour lighter.
* @param denom denominator, makes colour darker.
* @return the new colour for the screen.
*/
static inline uint32 MakeTransparent(uint32 colour, uint nom, uint denom = 256)
{
uint r = GB(colour, 16, 8);
@@ -113,10 +113,10 @@ public:
}
/**
* Make a colour grey - based.
* @param colour the colour to make grey.
* @return the new colour, now grey.
*/
* Make a colour grey - based.
* @param colour the colour to make grey.
* @return the new colour, now grey.
*/
static inline uint32 MakeGrey(uint32 colour)
{
uint r = GB(colour, 16, 8);
@@ -124,8 +124,8 @@ public:
uint b = GB(colour, 0, 8);
/* To avoid doubles and stuff, multiple it with a total of 65536 (16bits), then
* divide by it to normalize the value to a byte again. See heightmap.cpp for
* information about the formula. */
* divide by it to normalize the value to a byte again. See heightmap.cpp for
* information about the formula. */
colour = ((r * 19595) + (g * 38470) + (b * 7471)) / 65536;
return ComposeColour(0xFF, colour, colour, colour);
+1 -1
View File
@@ -132,7 +132,7 @@ void Blitter_8bppBase::ScrollBuffer(void *video, int &left, int &top, int &width
uint8 *dst;
if (scroll_y > 0) {
/* Calculate pointers */
/*Calculate pointers */
dst = (uint8 *)video + left + (top + height - 1) * _screen.pitch;
src = dst - scroll_y * _screen.pitch;
+4 -4
View File
@@ -67,7 +67,7 @@ private:
/* Constants for sorting the bridges */
static const StringID sorter_names[];
static GUIBridgeList::SortFunction * const sorter_funcs[];
static GUIBridgeList::SortFunction *const sorter_funcs[];
/* Internal variables */
TileIndex start_tile;
@@ -268,12 +268,12 @@ static const Widget _build_bridge_widgets[] = {
};
/* Window definition for the rail bridge selection window */
static const WindowDesc _build_bridge_desc(
static const WindowDesc _build_bridge_desc = {
WDP_AUTO, WDP_AUTO, 200, 114, 200, 114,
WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
_build_bridge_widgets
);
_build_bridge_widgets,
};
/**
* Prepare the data for the build a bridge window.
+185 -84
View File
@@ -55,7 +55,6 @@ static const Widget _build_vehicle_widgets[] = {
{ WIDGETS_END},
};
static bool _internal_sort_order; // descending/ascending
static byte _last_sort_criteria[] = {0, 0, 0, 0};
static bool _last_sort_order[] = {false, false, false, false};
@@ -75,8 +74,10 @@ static int CDECL EngineIntroDateSorter(const void *a, const void *b)
const int vb = GetEngine(*(const EngineID*)b)->intro_date;
const int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
@@ -87,6 +88,7 @@ static int CDECL EngineNameSorter(const void *a, const void *b)
const EngineID va = *(const EngineID*)a;
const EngineID vb = *(const EngineID*)b;
int r;
if (va != last_engine[0]) {
last_engine[0] = va;
@@ -100,10 +102,12 @@ static int CDECL EngineNameSorter(const void *a, const void *b)
GetString(last_name[1], STR_ENGINE_NAME, lastof(last_name[1]));
}
int r = strcmp(last_name[0], last_name[1]); // sort by name
r = strcmp(last_name[0], last_name[1]); // sort by name
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
@@ -113,73 +117,68 @@ static int CDECL EngineReliabilitySorter(const void *a, const void *b)
const int vb = GetEngine(*(const EngineID*)b)->reliability;
const int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
static int CDECL EngineCostSorter(const void *a, const void *b)
/* Train sorting functions */
static int CDECL TrainEngineCostSorter(const void *a, const void *b)
{
int va = GetEngine(*(const EngineID*)a)->GetRunningCost();
int vb = GetEngine(*(const EngineID*)b)->GetRunningCost();
int r = ClampToI32(va - vb);
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
static int CDECL EngineSpeedSorter(const void *a, const void *b)
{
int va = GetEngine(*(const EngineID*)a)->GetDisplayMaxSpeed();
int vb = GetEngine(*(const EngineID*)b)->GetDisplayMaxSpeed();
int va = RailVehInfo(*(const EngineID*)a)->cost_factor;
int vb = RailVehInfo(*(const EngineID*)b)->cost_factor;
int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
static int CDECL EnginePowerSorter(const void *a, const void *b)
static int CDECL TrainEngineSpeedSorter(const void *a, const void *b)
{
int va = GetEngine(*(const EngineID*)a)->GetPower();
int vb = GetEngine(*(const EngineID*)b)->GetPower();
int va = RailVehInfo(*(const EngineID*)a)->max_speed;
int vb = RailVehInfo(*(const EngineID*)b)->max_speed;
int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
static int CDECL EngineRunningCostSorter(const void *a, const void *b)
static int CDECL TrainEnginePowerSorter(const void *a, const void *b)
{
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
int va = rvi_a->power;
int vb = rvi_b->power;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
{
Money va = GetEngine(*(const EngineID*)a)->GetRunningCost();
Money vb = GetEngine(*(const EngineID*)b)->GetRunningCost();
int r = ClampToI32(va - vb);
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
/* Train sorting functions */
static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void *b)
{
const Engine *e_a = GetEngine(*(const EngineID*)a);
const Engine *e_b = GetEngine(*(const EngineID*)b);
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
/* Here we are using a few tricks to get the right sort.
* We want power/running cost, but since we usually got higher running cost than power and we store the result in an int,
* we will actually calculate cunning cost/power (to make it more than 1).
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
* Another thing is that both power and running costs should be doubled for multiheaded engines.
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
Money va = (e_a->GetRunningCost()) / max(1U, (uint)e_a->GetPower());
Money vb = (e_b->GetRunningCost()) / max(1U, (uint)e_b->GetPower());
* We want power/running cost, but since we usually got higher running cost than power and we store the result in an int,
* we will actually calculate cunning cost/power (to make it more than 1).
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
* Another thing is that both power and running costs should be doubled for multiheaded engines.
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
Money va = (GetEngine(*(const EngineID*)a)->GetRunningCost()) / max(1U, (uint)rvi_a->power);
Money vb = (GetEngine(*(const EngineID*)b)->GetRunningCost()) / max(1U, (uint)rvi_b->power);
int r = ClampToI32(vb - va);
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
@@ -188,12 +187,14 @@ static int CDECL TrainEngineCapacitySorter(const void *a, const void *b)
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
int va = GetTotalCapacityOfArticulatedParts(*(const EngineID*)a, VEH_TRAIN) * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int vb = GetTotalCapacityOfArticulatedParts(*(const EngineID*)b, VEH_TRAIN) * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int va = rvi_a->capacity * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int vb = rvi_b->capacity * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
@@ -207,41 +208,141 @@ static int CDECL TrainEnginesThenWagonsSorter(const void *a, const void *b)
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
/* Road vehicle sorting functions */
static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *b)
static int CDECL RoadVehEngineCostSorter(const void *a, const void *b)
{
int va = GetTotalCapacityOfArticulatedParts(*(const EngineID*)a, VEH_ROAD);
int vb = GetTotalCapacityOfArticulatedParts(*(const EngineID*)b, VEH_ROAD);
int va = RoadVehInfo(*(const EngineID*)a)->cost_factor;
int vb = RoadVehInfo(*(const EngineID*)b)->cost_factor;
int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
return _internal_sort_order ? -r : r;
}
/* Ship vehicle sorting functions */
static int CDECL RoadVehEngineSpeedSorter(const void *a, const void *b)
{
int va = RoadVehInfo(*(const EngineID*)a)->max_speed;
int vb = RoadVehInfo(*(const EngineID*)b)->max_speed;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
static int CDECL RoadVehEngineRunningCostSorter(const void *a, const void *b)
{
Money va = GetEngine(*(const EngineID*)a)->GetRunningCost();
Money vb = GetEngine(*(const EngineID*)b)->GetRunningCost();
int r = ClampToI32(va - vb);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *b)
{
int va = RoadVehInfo(*(const EngineID*)a)->capacity;
int vb = RoadVehInfo(*(const EngineID*)b)->capacity;
int r = va - vb;
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
/* Road vehicle sorting functions */
static int CDECL ShipEngineCostSorter(const void *a, const void *b)
{
int va = ShipVehInfo(*(const EngineID*)a)->cost_factor;
int vb = ShipVehInfo(*(const EngineID*)b)->cost_factor;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
static int CDECL ShipEngineSpeedSorter(const void *a, const void *b)
{
int va = ShipVehInfo(*(const EngineID*)a)->max_speed;
int vb = ShipVehInfo(*(const EngineID*)b)->max_speed;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
static int CDECL ShipEngineRunningCostSorter(const void *a, const void *b)
{
const int va = GetEngine(*(const EngineID*)a)->GetRunningCost();
const int vb = GetEngine(*(const EngineID*)b)->GetRunningCost();
const int r = va - vb;
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
static int CDECL ShipEngineCapacitySorter(const void *a, const void *b)
{
int va = ShipVehInfo(*(const EngineID*)a)->capacity;
int vb = ShipVehInfo(*(const EngineID*)b)->capacity;
int r = va - vb;
/* Use EngineID to sort instead since we want consistent sorting */
if (r == 0) return EngineNumberSorter(a, b);
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
/* Aircraft sorting functions */
static int CDECL AircraftEngineCostSorter(const void *a, const void *b)
{
const int va = AircraftVehInfo(*(const EngineID*)a)->cost_factor;
const int vb = AircraftVehInfo(*(const EngineID*)b)->cost_factor;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
static int CDECL AircraftEngineSpeedSorter(const void *a, const void *b)
{
const int va = AircraftVehInfo(*(const EngineID*)a)->max_speed;
const int vb = AircraftVehInfo(*(const EngineID*)b)->max_speed;
const int r = va - vb;
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
static int CDECL AircraftEngineRunningCostSorter(const void *a, const void *b)
{
const int va = GetEngine(*(const EngineID*)a)->GetRunningCost();
const int vb = GetEngine(*(const EngineID*)b)->GetRunningCost();
const int r = va - vb;
if (r == 0) {
/* Use EngineID to sort instead since we want consistent sorting */
return EngineNumberSorter(a, b);
}
return _internal_sort_order ? -r : r;
}
static int CDECL AircraftEngineCargoSorter(const void *a, const void *b)
{
const Engine *e_a = GetEngine(*(const EngineID*)a);
const Engine *e_b = GetEngine(*(const EngineID*)b);
int va = AircraftDefaultCargoCapacity(e_a->GetDefaultCargoType(), &e_a->u.air);
int vb = AircraftDefaultCargoCapacity(e_b->GetDefaultCargoType(), &e_b->u.air);
int va = AircraftVehInfo(*(const EngineID*)a)->passenger_capacity;
int vb = AircraftVehInfo(*(const EngineID*)b)->passenger_capacity;
int r = va - vb;
if (r == 0) {
@@ -261,43 +362,43 @@ static int CDECL AircraftEngineCargoSorter(const void *a, const void *b)
static EngList_SortTypeFunction * const _sorter[][10] = {{
/* Trains */
&EngineNumberSorter,
&EngineCostSorter,
&EngineSpeedSorter,
&EnginePowerSorter,
&TrainEngineCostSorter,
&TrainEngineSpeedSorter,
&TrainEnginePowerSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&EngineRunningCostSorter,
&TrainEngineRunningCostSorter,
&TrainEnginePowerVsRunningCostSorter,
&EngineReliabilitySorter,
&TrainEngineCapacitySorter,
}, {
/* Road vehicles */
&EngineNumberSorter,
&EngineCostSorter,
&EngineSpeedSorter,
&RoadVehEngineCostSorter,
&RoadVehEngineSpeedSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&EngineRunningCostSorter,
&RoadVehEngineRunningCostSorter,
&EngineReliabilitySorter,
&RoadVehEngineCapacitySorter,
}, {
/* Ships */
&EngineNumberSorter,
&EngineCostSorter,
&EngineSpeedSorter,
&ShipEngineCostSorter,
&ShipEngineSpeedSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&EngineRunningCostSorter,
&ShipEngineRunningCostSorter,
&EngineReliabilitySorter,
&ShipEngineCapacitySorter,
}, {
/* Aircraft */
&EngineNumberSorter,
&EngineCostSorter,
&EngineSpeedSorter,
&AircraftEngineCostSorter,
&AircraftEngineSpeedSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&EngineRunningCostSorter,
&AircraftEngineRunningCostSorter,
&EngineReliabilitySorter,
&AircraftEngineCargoSorter,
}};
@@ -514,7 +615,7 @@ static int DrawAircraftPurchaseInfo(int x, int y, EngineID engine_number, const
DrawString(x, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY, TC_FROMSTRING);
} else {
/* Note, if the default capacity is selected by the refit capacity
* callback, then the capacity shown is likely to be incorrect. */
* callback, then the capacity shown is likely to be incorrect. */
SetDParam(0, cargo);
SetDParam(1, AircraftDefaultCargoCapacity(cargo, avi));
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
@@ -809,9 +910,9 @@ struct BuildVehicleWindow : Window {
this->eng_list.Clear();
/* Make list of all available train engines and wagons.
* Also check to see if the previously selected engine is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when engines become obsolete and are removed */
* Also check to see if the previously selected engine is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when engines become obsolete and are removed */
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
EngineID eid = e->index;
@@ -891,9 +992,9 @@ struct BuildVehicleWindow : Window {
const Station *st = this->listview_mode ? NULL : GetStationByTile(this->window_number);
/* Make list of all available planes.
* Also check to see if the previously selected plane is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when planes become obsolete and are removed */
* Also check to see if the previously selected plane is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when planes become obsolete and are removed */
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_AIRCRAFT) {
EngineID eid = e->index;
@@ -1087,12 +1188,12 @@ struct BuildVehicleWindow : Window {
}
};
static const WindowDesc _build_vehicle_desc(
static const WindowDesc _build_vehicle_desc = {
WDP_AUTO, WDP_AUTO, 240, 174, 240, 256,
WC_BUILD_VEHICLE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE | WDF_CONSTRUCTION,
_build_vehicle_widgets
);
_build_vehicle_widgets,
};
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
{
+3 -3
View File
@@ -235,12 +235,12 @@ struct CheatWindow : Window {
}
};
static const WindowDesc _cheats_desc(
static const WindowDesc _cheats_desc = {
240, 22, 400, 170, 400, 170,
WC_CHEATS, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_cheat_widgets
);
_cheat_widgets,
};
void ShowCheatWindow()
+1 -1
View File
@@ -21,7 +21,7 @@ template<> struct ExtractBits<RoadBits> { static const uint Count = 4; };
template<typename T, uint N, typename U> static inline T Extract(U v)
{
/* Check if there are enough bits in v */
// Check if there are enough bits in v
ExtractValid<N + ExtractBits<T>::Count <= sizeof(U) * 8>();
return (T)GB(v, N, ExtractBits<T>::Count);
}
+108 -108
View File
@@ -201,140 +201,140 @@ DEF_COMMAND(CmdAutofillTimetable);
* as the value from the CMD_* enums.
*/
static const Command _command_proc_table[] = {
{CmdBuildRailroadTrack, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_RAILROAD_TRACK
{CmdRemoveRailroadTrack, CMD_AUTO}, // CMD_REMOVE_RAILROAD_TRACK
{CmdBuildSingleRail, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_SINGLE_RAIL
{CmdRemoveSingleRail, CMD_AUTO}, // CMD_REMOVE_SINGLE_RAIL
{CmdLandscapeClear, 0}, // CMD_LANDSCAPE_CLEAR
{CmdBuildBridge, CMD_AUTO}, // CMD_BUILD_BRIDGE
{CmdBuildRailroadStation, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_RAILROAD_STATION
{CmdBuildTrainDepot, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_TRAIN_DEPOT
{CmdBuildSingleSignal, CMD_AUTO}, // CMD_BUILD_SIGNALS
{CmdRemoveSingleSignal, CMD_AUTO}, // CMD_REMOVE_SIGNALS
{CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO}, // CMD_TERRAFORM_LAND
{CmdPurchaseLandArea, CMD_NO_WATER | CMD_AUTO}, // CMD_PURCHASE_LAND_AREA
{CmdSellLandArea, 0}, // CMD_SELL_LAND_AREA
{CmdBuildTunnel, CMD_AUTO}, // CMD_BUILD_TUNNEL
{CmdRemoveFromRailroadStation, 0}, // CMD_REMOVE_FROM_RAILROAD_STATION
{CmdConvertRail, 0}, // CMD_CONVERT_RAILD
{CmdBuildTrainWaypoint, 0}, // CMD_BUILD_TRAIN_WAYPOINT
{CmdRenameWaypoint, 0}, // CMD_RENAME_WAYPOINT
{CmdRemoveTrainWaypoint, 0}, // CMD_REMOVE_TRAIN_WAYPOINT
{CmdBuildRailroadTrack, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
{CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
{CmdBuildSingleRail, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
{CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
{CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
{CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
{CmdBuildRailroadStation, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
{CmdBuildTrainDepot, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
{CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
{CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
{CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO}, /* CMD_TERRAFORM_LAND */
{CmdPurchaseLandArea, CMD_NO_WATER | CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
{CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
{CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
{CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
{CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
{CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
{CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
{CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
{CmdBuildRoadStop, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_ROAD_STOP
{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, 0}, // CMD_BUILD_ROAD
{CmdRemoveRoad, 0}, // CMD_REMOVE_ROAD
{CmdBuildRoadDepot, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_ROAD_DEPOT
{CmdBuildRoadStop, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
{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, 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
{CmdBuildDock, CMD_AUTO}, // CMD_BUILD_DOCK
{CmdBuildShipDepot, CMD_AUTO}, // CMD_BUILD_SHIP_DEPOT
{CmdBuildBuoy, CMD_AUTO}, // CMD_BUILD_BUOY
{CmdPlantTree, CMD_AUTO}, // CMD_PLANT_TREE
{CmdBuildRailVehicle, 0}, // CMD_BUILD_RAIL_VEHICLE
{CmdMoveRailVehicle, 0}, // CMD_MOVE_RAIL_VEHICLE
{CmdBuildAirport, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_AIRPORT */
{CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
{CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
{CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
{CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
{CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
{CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
{CmdSellRailWagon, 0}, // CMD_SELL_RAIL_WAGON
{CmdSendTrainToDepot, 0}, // CMD_SEND_TRAIN_TO_DEPOT
{CmdForceTrainProceed, 0}, // CMD_FORCE_TRAIN_PROCEED
{CmdReverseTrainDirection, 0}, // CMD_REVERSE_TRAIN_DIRECTION
{CmdSellRailWagon, 0}, /* CMD_SELL_RAIL_WAGON */
{CmdSendTrainToDepot, 0}, /* CMD_SEND_TRAIN_TO_DEPOT */
{CmdForceTrainProceed, 0}, /* CMD_FORCE_TRAIN_PROCEED */
{CmdReverseTrainDirection, 0}, /* CMD_REVERSE_TRAIN_DIRECTION */
{CmdModifyOrder, 0}, // CMD_MODIFY_ORDER
{CmdSkipToOrder, 0}, // CMD_SKIP_TO_ORDER
{CmdDeleteOrder, 0}, // CMD_DELETE_ORDER
{CmdInsertOrder, 0}, // CMD_INSERT_ORDER
{CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
{CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
{CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
{CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
{CmdChangeServiceInt, 0}, // CMD_CHANGE_SERVICE_INT
{CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
{CmdBuildIndustry, 0}, // CMD_BUILD_INDUSTRY
{CmdBuildCompanyHQ, CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_COMPANY_HQ
{CmdSetCompanyManagerFace, 0}, // CMD_SET_COMPANY_MANAGER_FACE
{CmdSetCompanyColour, 0}, // CMD_SET_COMPANY_COLOUR
{CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
{CmdBuildCompanyHQ, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
{CmdSetCompanyManagerFace, 0}, /* CMD_SET_COMPANY_MANAGER_FACE */
{CmdSetCompanyColour, 0}, /* CMD_SET_COMPANY_COLOUR */
{CmdIncreaseLoan, 0}, // CMD_INCREASE_LOAN
{CmdDecreaseLoan, 0}, // CMD_DECREASE_LOAN
{CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
{CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
{CmdWantEnginePreview, 0}, // CMD_WANT_ENGINE_PREVIEW
{CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
{CmdRenameVehicle, 0}, // CMD_RENAME_VEHICLE
{CmdRenameEngine, 0}, // CMD_RENAME_ENGINE
{CmdRenameVehicle, 0}, /* CMD_RENAME_VEHICLE */
{CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
{CmdRenameCompany, 0}, // CMD_RENAME_COMPANY
{CmdRenamePresident, 0}, // CMD_RENAME_PRESIDENT
{CmdRenameCompany, 0}, /* CMD_RENAME_COMPANY */
{CmdRenamePresident, 0}, /* CMD_RENAME_PRESIDENT */
{CmdRenameStation, 0}, // CMD_RENAME_STATION
{CmdRenameStation, 0}, /* CMD_RENAME_STATION */
{CmdSellAircraft, 0}, // CMD_SELL_AIRCRAFT
{CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
{CmdBuildAircraft, 0}, // CMD_BUILD_AIRCRAFT
{CmdSendAircraftToHangar, 0}, // CMD_SEND_AIRCRAFT_TO_HANGAR
{CmdRefitAircraft, 0}, // CMD_REFIT_AIRCRAFT
{CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
{CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
{CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
{CmdPlaceSign, 0}, // CMD_PLACE_SIGN
{CmdRenameSign, 0}, // CMD_RENAME_SIGN
{CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
{CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
{CmdBuildRoadVeh, 0}, // CMD_BUILD_ROAD_VEH
{CmdSellRoadVeh, 0}, // CMD_SELL_ROAD_VEH
{CmdSendRoadVehToDepot, 0}, // CMD_SEND_ROADVEH_TO_DEPOT
{CmdTurnRoadVeh, 0}, // CMD_TURN_ROADVEH
{CmdRefitRoadVeh, 0}, // CMD_REFIT_ROAD_VEH
{CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
{CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
{CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
{CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
{CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
{CmdPause, CMD_SERVER}, // CMD_PAUSE
{CmdPause, CMD_SERVER}, /* CMD_PAUSE */
{CmdBuyShareInCompany, 0}, // CMD_BUY_SHARE_IN_COMPANY
{CmdSellShareInCompany, 0}, // CMD_SELL_SHARE_IN_COMPANY
{CmdBuyCompany, 0}, // CMD_BUY_COMANY
{CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
{CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
{CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
{CmdBuildTown, CMD_OFFLINE}, // CMD_BUILD_TOWN
{CmdRenameTown, CMD_SERVER}, // CMD_RENAME_TOWN
{CmdDoTownAction, 0}, // CMD_DO_TOWN_ACTION
{CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
{CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
{CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
{CmdSellShip, 0}, // CMD_SELL_SHIP
{CmdBuildShip, 0}, // CMD_BUILD_SHIP
{CmdSendShipToDepot, 0}, // CMD_SEND_SHIP_TO_DEPOT
{CmdRefitShip, 0}, // CMD_REFIT_SHIP
{CmdSellShip, 0}, /* CMD_SELL_SHIP */
{CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
{CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
{CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
{CmdOrderRefit, 0}, // CMD_ORDER_REFIT
{CmdCloneOrder, 0}, // CMD_CLONE_ORDER
{CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
{CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
{CmdClearArea, CMD_NO_TEST}, // CMD_CLEAR_AREA; destroying multi-tile houses makes town rating differ between test and execution
{CmdClearArea, CMD_NO_TEST}, /* CMD_CLEAR_AREA; destroying multi-tile houses makes town rating differ between test and execution */
{CmdMoneyCheat, CMD_OFFLINE}, // CMD_MONEY_CHEAT
{CmdBuildCanal, CMD_AUTO}, // CMD_BUILD_CANAL
{CmdCompanyCtrl, CMD_SPECTATOR}, // CMD_COMPANY_CTRL
{CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
{CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
{CmdCompanyCtrl, CMD_SPECTATOR}, /* CMD_COMPANY_CTRL */
{CmdLevelLand, CMD_ALL_TILES | CMD_NO_TEST | CMD_AUTO}, // CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once
{CmdLevelLand, CMD_ALL_TILES | CMD_NO_TEST | CMD_AUTO}, /* CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once */
{CmdRefitRailVehicle, 0}, // CMD_REFIT_RAIL_VEHICLE
{CmdRestoreOrderIndex, 0}, // CMD_RESTORE_ORDER_INDEX
{CmdBuildLock, CMD_AUTO}, // CMD_BUILD_LOCK
{CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
{CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
{CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
{CmdBuildSignalTrack, CMD_AUTO}, // CMD_BUILD_SIGNAL_TRACK
{CmdRemoveSignalTrack, CMD_AUTO}, // CMD_REMOVE_SIGNAL_TRACK
{CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
{CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
{CmdGiveMoney, 0}, // CMD_GIVE_MONEY
{CmdChangeSetting, CMD_SERVER}, // CMD_CHANGE_SETTING
{CmdSetAutoReplace, 0}, // CMD_SET_AUTOREPLACE
{CmdCloneVehicle, CMD_NO_TEST}, // CMD_CLONE_VEHICLE; NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost
{CmdStartStopVehicle, 0}, // CMD_START_STOP_VEHICLE
{CmdMassStartStopVehicle, 0}, // CMD_MASS_START_STOP
{CmdAutoreplaceVehicle, 0}, // CMD_AUTOREPLACE_VEHICLE
{CmdDepotSellAllVehicles, 0}, // CMD_DEPOT_SELL_ALL_VEHICLES
{CmdDepotMassAutoReplace, 0}, // CMD_DEPOT_MASS_AUTOREPLACE
{CmdCreateGroup, 0}, // CMD_CREATE_GROUP
{CmdDeleteGroup, 0}, // CMD_DELETE_GROUP
{CmdRenameGroup, 0}, // CMD_RENAME_GROUP
{CmdAddVehicleGroup, 0}, // CMD_ADD_VEHICLE_GROUP
{CmdAddSharedVehicleGroup, 0}, // CMD_ADD_SHARE_VEHICLE_GROUP
{CmdRemoveAllVehiclesGroup, 0}, // CMD_REMOVE_ALL_VEHICLES_GROUP
{CmdSetGroupReplaceProtection, 0}, // CMD_SET_GROUP_REPLACE_PROTECTION
{CmdMoveOrder, 0}, // CMD_MOVE_ORDER
{CmdChangeTimetable, 0}, // CMD_CHANGE_TIMETABLE
{CmdSetVehicleOnTime, 0}, // CMD_SET_VEHICLE_ON_TIME
{CmdAutofillTimetable, 0}, // CMD_AUTOFILL_TIMETABLE
{CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
{CmdChangeSetting, CMD_SERVER}, /* CMD_CHANGE_SETTING */
{CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
{CmdCloneVehicle, CMD_NO_TEST}, /* CMD_CLONE_VEHICLE; NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost */
{CmdStartStopVehicle, 0}, /* CMD_START_STOP_VEHICLE */
{CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
{CmdAutoreplaceVehicle, 0}, /* CMD_AUTOREPLACE_VEHICLE */
{CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
{CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
{CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
{CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
{CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
{CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
{CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
{CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
{CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
{CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
{CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
{CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
{CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
};
/*!
+26 -24
View File
@@ -13,6 +13,7 @@
#include "network/network.h"
#include "network/network_func.h"
#include "network/network_base.h"
#include "variables.h"
#include "ai/ai.hpp"
#include "company_manager_face.h"
#include "group.h"
@@ -22,6 +23,7 @@
#include "gfx_func.h"
#include "date_func.h"
#include "sound_func.h"
#include "core/alloc_func.hpp"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
#include "string_func.h"
@@ -129,7 +131,7 @@ bool IsValidCompanyManagerFace(CompanyManagerFace cmf)
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
switch (cmfv) {
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
case CMFV_LIPS: // FALL THROUGH
case CMFV_LIPS: /* FALL THROUGH */
case CMFV_NOSE: if (has_moustache) continue; break;
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
case CMFV_GLASSES: if (!has_glasses) continue; break;
@@ -718,19 +720,19 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0);
switch (p1) {
case 0: { // Create a new company
case 0: { /* Create a new company */
/* This command is only executed in a multiplayer game */
if (!_networking) return CMD_ERROR;
#ifdef ENABLE_NETWORK
/* Joining Client:
* _local_company: COMPANY_SPECTATOR
* _network_playas/cid = requested company/clientid
*
* Other client(s)/server:
* _local_company/_network_playas: what they play as
* cid = requested company/company of joining client */
* _local_company: COMPANY_SPECTATOR
* _network_playas/cid = requested company/clientid
*
* Other client(s)/server:
* _local_company/_network_playas: what they play as
* cid = requested company/company of joining client */
ClientID cid = (ClientID)p2;
/* Has the network client a correct ClientIndex? */
@@ -766,7 +768,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
_current_company = _local_company;
/* Now that we have a new company, broadcast our autorenew settings to
* all clients so everything is in sync */
* all clients so everything is in sync */
NetworkSend_Command(0,
(_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
_settings_client.gui.autorenew_money,
@@ -780,8 +782,8 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (_network_server) {
/* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at
* server side in network_server.c:838, function
* DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND) */
* server-side in network_server.c:838, function
* DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND) */
CompanyID old_playas = ci->client_playas;
ci->client_playas = c->index;
NetworkUpdateClientInfo(ci->client_id);
@@ -793,16 +795,16 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
NetworkServerUpdateCompanyPassworded(ci->client_playas, false);
/* XXX - When a client joins, we automatically set its name to the
* client's name (for some reason). As it stands now only the server
* knows the client's name, so it needs to send out a "broadcast" to
* do this. To achieve this we send a network command. However, it
* uses _local_company to execute the command as. To prevent abuse
* (eg. only yourself can change your name/company), we 'cheat' by
* impersonation _local_company as the server. Not the best solution;
* but it works.
* TODO: Perhaps this could be improved by when the client is ready
* with joining to let it send itself the command, and not the server?
* For example in network_client.c:534? */
* client's name (for some reason). As it stands now only the server
* knows the client's name, so it needs to send out a "broadcast" to
* do this. To achieve this we send a network command. However, it
* uses _local_company to execute the command as. To prevent abuse
* (eg. only yourself can change your name/company), we 'cheat' by
* impersonation _local_company as the server. Not the best solution;
* but it works.
* TODO: Perhaps this could be improved by when the client is ready
* with joining to let it send itself the command, and not the server?
* For example in network_client.c:534? */
_local_company = ci->client_playas;
NetworkSend_Command(0, 0, 0, CMD_RENAME_PRESIDENT, NULL, ci->client_name);
_local_company = company_backup;
@@ -816,13 +818,13 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
#endif /* ENABLE_NETWORK */
} break;
case 1: // Make a new AI company
case 1: /* Make a new AI company */
if (!(flags & DC_EXEC)) return CommandCost();
DoStartupNewCompany(true);
break;
case 2: { // Delete a company
case 2: { /* Delete a company */
Company *c;
if (!IsValidCompanyID((CompanyID)p2)) return CMD_ERROR;
@@ -851,7 +853,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
AI::BroadcastNewEvent(new AIEventCompanyBankrupt(c_index));
} break;
case 3: { // Merge a company (#1) into another company (#2), elimination company #1
case 3: { /* Merge a company (#1) into another company (#2), elimination company #1 */
CompanyID cid_old = (CompanyID)GB(p2, 0, 16);
CompanyID cid_new = (CompanyID)GB(p2, 16, 16);
+34 -34
View File
@@ -286,7 +286,7 @@ struct CompanyFinancesWindow : Window {
virtual void OnClick(Point pt, int widget)
{
switch (widget) {
case CFW_WIDGET_TOGGLE_SIZE: {// toggle size
case CFW_WIDGET_TOGGLE_SIZE: {/* toggle size */
bool new_mode = !this->small;
bool stickied = !!(this->flags4 & WF_STICKY);
int oldtop = this->top; ///< current top position of the window before closing it
@@ -299,30 +299,30 @@ struct CompanyFinancesWindow : Window {
}
break;
case CFW_WIDGET_INCREASE_LOAN: // increase loan
case CFW_WIDGET_INCREASE_LOAN: /* increase loan */
DoCommandP(0, 0, _ctrl_pressed, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY));
break;
case CFW_WIDGET_REPAY_LOAN: // repay loan
case CFW_WIDGET_REPAY_LOAN: /* repay loan */
DoCommandP(0, 0, _ctrl_pressed, CMD_DECREASE_LOAN | CMD_MSG(STR_702F_CAN_T_REPAY_LOAN));
break;
}
}
};
static const WindowDesc _company_finances_desc(
static const WindowDesc _company_finances_desc = {
WDP_AUTO, WDP_AUTO, 407, 60 + 10, 407, 60 + 10,
WC_FINANCES, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
_company_finances_widgets
);
_company_finances_widgets,
};
static const WindowDesc _company_finances_small_desc(
static const WindowDesc _company_finances_small_desc = {
WDP_AUTO, WDP_AUTO, 280, 60, 280, 60,
WC_FINANCES, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
_company_finances_small_widgets
);
_company_finances_small_widgets,
};
/**
* Open the small/large finance window of the company
@@ -550,11 +550,11 @@ public:
break;
}
case SCLW_WIDGET_PRI_COL_DROPDOWN: // First colour dropdown
case SCLW_WIDGET_PRI_COL_DROPDOWN: /* First colour dropdown */
ShowColourDropDownMenu(SCLW_WIDGET_PRI_COL_DROPDOWN);
break;
case SCLW_WIDGET_SEC_COL_DROPDOWN: // Second colour dropdown
case SCLW_WIDGET_SEC_COL_DROPDOWN: /* Second colour dropdown */
ShowColourDropDownMenu(SCLW_WIDGET_SEC_COL_DROPDOWN);
break;
@@ -626,12 +626,12 @@ static const Widget _select_company_livery_widgets[] = {
{ WIDGETS_END },
};
static const WindowDesc _select_company_livery_desc(
static const WindowDesc _select_company_livery_desc = {
WDP_AUTO, WDP_AUTO, 400, 49 + 1 * 14, 400, 49 + 1 * 14,
WC_COMPANY_COLOUR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_select_company_livery_widgets
);
_select_company_livery_widgets,
};
/**
* Draws the face of a company manager's face.
@@ -667,7 +667,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
switch (cmfv) {
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
case CMFV_LIPS: // FALL THROUGH
case CMFV_LIPS: /* FALL THROUGH */
case CMFV_NOSE: if (has_moustache) continue; break;
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
case CMFV_GLASSES: if (!has_glasses) continue; break;
@@ -877,8 +877,8 @@ public:
/* Disable dynamically the widgets which CompanyManagerFaceVariable has less than 2 options
* (or in other words you haven't any choice).
* If the widgets depend on a HAS-variable and this is false the widgets will be disabled, too. */
* (or in other words you haven't any choice).
* If the widgets depend on a HAS-variable and this is false the widgets will be disabled, too. */
/* Eye colour buttons */
this->SetWidgetsDisabledState(_cmf_info[CMFV_EYE_COLOUR].valid_values[this->ge] < 2,
@@ -1037,10 +1037,10 @@ public:
default:
/* For all buttons from SCMFW_WIDGET_HAS_MOUSTACHE_EARRING to SCMFW_WIDGET_GLASSES_R is the same function.
* Therefor is this combined function.
* First it checks which CompanyManagerFaceVariable will be change and then
* a: invert the value for boolean variables
* or b: it checks inside of IncreaseCompanyManagerFaceBits() if a left (_L) butten is pressed and then decrease else increase the variable */
* Therefor is this combined function.
* First it checks which CompanyManagerFaceVariable will be change and then
* a: invert the value for boolean variables
* or b: it checks inside of IncreaseCompanyManagerFaceBits() if a left (_L) butten is pressed and then decrease else increase the variable */
if (this->advanced && widget >= SCMFW_WIDGET_HAS_MOUSTACHE_EARRING && widget <= SCMFW_WIDGET_GLASSES_R) {
CompanyManagerFaceVariable cmfv; // which CompanyManagerFaceVariable shall be edited
@@ -1093,20 +1093,20 @@ public:
};
/** normal/simple company manager face selection window description */
static const WindowDesc _select_company_manager_face_desc(
static const WindowDesc _select_company_manager_face_desc = {
WDP_AUTO, WDP_AUTO, 190, 163, 190, 163,
WC_COMPANY_MANAGER_FACE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
_select_company_manager_face_widgets
);
_select_company_manager_face_widgets,
};
/** advanced company manager face selection window description */
static const WindowDesc _select_company_manager_face_adv_desc(
static const WindowDesc _select_company_manager_face_adv_desc = {
WDP_AUTO, WDP_AUTO, 220, 220, 220, 220,
WC_COMPANY_MANAGER_FACE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
_select_company_manager_face_adv_widgets
);
_select_company_manager_face_adv_widgets,
};
/**
* Open the simple/advanced company manager face selection window
@@ -1268,7 +1268,7 @@ struct CompanyWindow : Window
this->SetWidgetHiddenState(CW_WIDGET_PRESIDENT_NAME, !local);
this->SetWidgetHiddenState(CW_WIDGET_COMPANY_NAME, !local);
this->widget[CW_WIDGET_BUILD_VIEW_HQ].data = (local && c->location_of_HQ == INVALID_TILE) ? STR_706F_BUILD_HQ : STR_7072_VIEW_HQ;
if (local && c->location_of_HQ != INVALID_TILE) this->widget[CW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // HQ is already built.
if (local && c->location_of_HQ != INVALID_TILE) this->widget[CW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; //HQ is already built.
this->SetWidgetDisabledState(CW_WIDGET_BUILD_VIEW_HQ, !local && c->location_of_HQ == INVALID_TILE);
this->SetWidgetHiddenState(CW_WIDGET_RELOCATE_HQ, !local || c->location_of_HQ == INVALID_TILE);
this->SetWidgetHiddenState(CW_WIDGET_BUY_SHARE, local);
@@ -1456,12 +1456,12 @@ struct CompanyWindow : Window
}
};
static const WindowDesc _company_desc(
static const WindowDesc _company_desc = {
WDP_AUTO, WDP_AUTO, 360, 170, 360, 170,
WC_COMPANY, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_company_widgets
);
_company_widgets,
};
void ShowCompany(CompanyID company)
{
@@ -1515,12 +1515,12 @@ static const Widget _buy_company_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _buy_company_desc(
static const WindowDesc _buy_company_desc = {
153, 171, 334, 137, 334, 137,
WC_BUY_COMPANY, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
_buy_company_widgets
);
_buy_company_widgets,
};
void ShowBuyCompanyDialog(CompanyID company)
+2 -2
View File
@@ -57,8 +57,8 @@ struct CompanyManagerFaceBitsInfo {
/** Lookup table for indices into the CompanyManagerFace, valid ranges and sprites */
static const CompanyManagerFaceBitsInfo _cmf_info[] = {
/* Index off len WM WF BM BF WM WF BM BF
* CMFV_GENDER */ { 0, 1, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< 0 = male, 1 = female
/* Index off len WM WF BM BF WM WF BM BF */
/* CMFV_GENDER */ { 0, 1, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< 0 = male, 1 = female
/* CMFV_ETHNICITY */ { 1, 2, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< 0 = (Western-)Caucasian, 1 = African(-American)/Black
/* CMFV_GEN_ETHN */ { 0, 3, { 4, 4, 4, 4 }, { 0, 0, 0, 0 } }, ///< Shortcut to get/set gender _and_ ethnicity
/* CMFV_HAS_MOUSTACHE */ { 3, 1, { 2, 0, 2, 0 }, { 0, 0, 0, 0 } }, ///< Females do not have a moustache
+2 -2
View File
@@ -691,7 +691,7 @@ void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[ICON_T
if (_stdlib_con_developer)
IConsolePrintF(CC_DEBUG, "condbg: requested command is a variable");
if (tokencount == 0) { // Just print out value
if (tokencount == 0) { /* Just print out value */
IConsoleVarPrintGetValue(var);
return;
}
@@ -784,7 +784,7 @@ void IConsoleCmdExec(const char *cmdstr)
if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
switch (*cmdptr) {
case ' ': // Token seperator
case ' ': /* Token seperator */
if (!foundtoken) break;
if (longtoken) {
+22 -22
View File
@@ -37,18 +37,18 @@
#include "table/strings.h"
#endif /* ENABLE_NETWORK */
/* scriptfile handling */
// ** scriptfile handling ** //
static FILE *_script_file;
static bool _script_running;
/* console command / variable 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()
/*****************************
* variable and command hooks
*****************************/
/* **************************** */
/* variable and command hooks */
/* **************************** */
#ifdef ENABLE_NETWORK
@@ -343,7 +343,7 @@ DEF_CONSOLE_CMD(ConPrintWorkingDirectory)
return true;
}
/* XXX - Workaround for broken file handling */
// XXX - Workaround for broken file handling
FiosGetSavegameList(SLD_LOAD_GAME);
FiosFreeSavegameList();
@@ -365,9 +365,9 @@ DEF_CONSOLE_CMD(ConClearBuffer)
}
/**********************************
* Network Core Console Commands
**********************************/
// ********************************* //
// * Network Core Console Commands * //
// ********************************* //
#ifdef ENABLE_NETWORK
DEF_CONSOLE_CMD(ConBan)
@@ -798,9 +798,9 @@ DEF_CONSOLE_CMD(ConNetworkConnect)
#endif /* ENABLE_NETWORK */
/*********************************
* script file console commands
*********************************/
/* ******************************** */
/* script file console commands */
/* ******************************** */
DEF_CONSOLE_CMD(ConExec)
{
@@ -853,9 +853,9 @@ DEF_CONSOLE_CMD(ConReturn)
return true;
}
/*****************************
* default console commands
******************************/
/* **************************** */
/* default console commands */
/* **************************** */
extern bool CloseConsoleLogIfActive();
DEF_CONSOLE_CMD(ConScript)
@@ -1678,9 +1678,9 @@ DEF_CONSOLE_CMD(ConGamelogPrint)
}
#ifdef _DEBUG
/*******************************************
* debug commands and variables
********************************************/
/* ****************************************** */
/* debug commands and variables */
/* ****************************************** */
static void IConsoleDebugLibRegister()
{
@@ -1695,9 +1695,9 @@ static void IConsoleDebugLibRegister()
}
#endif
/*******************************************
* console command and variable registration
********************************************/
/* ****************************************** */
/* console command and variable registration */
/* ****************************************** */
void IConsoleStdLibRegister()
{
@@ -1846,7 +1846,7 @@ void IConsoleStdLibRegister()
IConsoleAliasRegister("reload_cfg", "setting reload_cfg %+");
#endif /* ENABLE_NETWORK */
/* debugging stuff */
// debugging stuff
#ifdef _DEBUG
IConsoleDebugLibRegister();
#endif
+4 -4
View File
@@ -204,7 +204,7 @@ struct IConsoleWindow : Window
const int scroll_height = (this->height / ICON_LINE_HEIGHT) - 1;
switch (keycode) {
case WKC_UP:
IConsoleHistoryNavigate(1);
IConsoleHistoryNavigate(+1);
this->SetDirty();
break;
@@ -317,12 +317,12 @@ static const Widget _iconsole_window_widgets[] = {
{WIDGETS_END}
};
static const WindowDesc _iconsole_window_desc(
static const WindowDesc _iconsole_window_desc = {
0, 0, 2, 2, 2, 2,
WC_CONSOLE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_iconsole_window_widgets
);
_iconsole_window_widgets,
};
void IConsoleGUIInit()
{
+6 -6
View File
@@ -64,12 +64,12 @@ struct MakeEnumPropsT {
/** In some cases we use byte or uint16 to store values that are defined as enum. It is
* necessary in order to control the sizeof() such values. Some compilers make enum
* the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
* compiler type - checking causes errors like:
* 'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
* u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
* to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
* necessary in order to control the sizeof() such values. Some compilers make enum
* the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
* compiler type - checking causes errors like:
* 'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
* u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
* to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
template <typename Tenum_t> struct TinyEnumT;
/** The general declaration of TinyEnumT<> (above) */
+4 -4
View File
@@ -10,10 +10,10 @@
#include "table/strings.h"
/* exchange rate prefix symbol_pos
* | separator | postfix |
* | | Euro year | | | name
* | | | | | | | */
// exchange rate prefix symbol_pos
// | separator | postfix |
// | | Euro year | | | name
// | | | | | | |
static const CurrencySpec origin_currency_specs[NUM_CURRENCY] = {
{ 1, ',', CF_NOEURO, "£", "", 0, STR_CURR_GBP }, ///< british pounds
{ 2, ',', CF_NOEURO, "$", "", 0, STR_CURR_USD }, ///< us dollars
+1 -1
View File
@@ -37,7 +37,7 @@ struct CurrencySpec {
extern CurrencySpec _currency_specs[NUM_CURRENCY];
/* XXX small hack, but makes the rest of the code a bit nicer to read */
// XXX small hack, but makes the rest of the code a bit nicer to read
#define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
#define _currency ((const CurrencySpec*)&_currency_specs[_game_mode == GM_MENU ? _settings_newgame.locale.currency : _settings_game.locale.currency])
+24 -24
View File
@@ -97,33 +97,33 @@ static const Widget _depot_widgets[] = {
};
static const WindowDesc _train_depot_desc(
static const WindowDesc _train_depot_desc = {
WDP_AUTO, WDP_AUTO, 36, 27, 362, 123,
WC_VEHICLE_DEPOT, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_depot_widgets
);
_depot_widgets,
};
static const WindowDesc _road_depot_desc(
static const WindowDesc _road_depot_desc = {
WDP_AUTO, WDP_AUTO, 36, 27, 316, 97,
WC_VEHICLE_DEPOT, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_depot_widgets
);
_depot_widgets,
};
static const WindowDesc _ship_depot_desc(
static const WindowDesc _ship_depot_desc = {
WDP_AUTO, WDP_AUTO, 36, 27, 306, 99,
WC_VEHICLE_DEPOT, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_depot_widgets
);
_depot_widgets,
};
static const WindowDesc _aircraft_depot_desc(
static const WindowDesc _aircraft_depot_desc = {
WDP_AUTO, WDP_AUTO, 36, 27, 332, 99,
WC_VEHICLE_DEPOT, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_depot_widgets
);
_depot_widgets,
};
extern int WagonLengthToPixels(int len);
extern void DepotSortList(VehicleList *list);
@@ -167,7 +167,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh
uint _block_sizes[4][2];
/* Array to hold the default resize capacities
* First part is the vehicle type, while the last is 0 = x, 1 = y */
* First part is the vehicle type, while the last is 0 = x, 1 = y */
const uint _resize_cap[][2] = {
/* VEH_TRAIN */ {6, 10 * 29},
/* VEH_ROAD */ {5, 5},
@@ -255,11 +255,11 @@ struct DepotWindow : Window {
}
/** Draw a vehicle in the depot window in the box with the top left corner at x,y
* @param *w Window to draw in
* @param *v Vehicle to draw
* @param x Left side of the box to draw in
* @param y Top of the box to draw in
*/
* @param *w Window to draw in
* @param *v Vehicle to draw
* @param x Left side of the box to draw in
* @param y Top of the box to draw in
*/
void DrawVehicleInDepot(Window *w, const Vehicle *v, int x, int y)
{
byte diff_x = 0, diff_y = 0;
@@ -371,7 +371,7 @@ struct DepotWindow : Window {
DrawTrainImage(v, x + 50, y, this->sel, this->hscroll.cap - 29, 0);
DrawString(x, y + 2, STR_8816, TC_FROMSTRING);
/* Draw the train counter */
/*Draw the train counter */
i = 0;
u = v;
do i++; while ((u = u->Next()) != NULL); // Determine length of train
@@ -550,10 +550,10 @@ struct DepotWindow : Window {
}
/**
* Clones a vehicle
* @param *v is the original vehicle to clone
* @param *w is the window of the depot where the clone is build
*/
* Clones a vehicle
* @param *v is the original vehicle to clone
* @param *w is the window of the depot where the clone is build
*/
void HandleCloneVehClick(const Vehicle *v, const Window *w)
{
uint error_str;
@@ -585,7 +585,7 @@ struct DepotWindow : Window {
if (this->type == VEH_TRAIN) {
/* Divide the size of DEPOT_WIDGET_SELL into two equally big buttons so DEPOT_WIDGET_SELL and DEPOT_WIDGET_SELL_CHAIN will get the same size.
* This way it will stay the same even if DEPOT_WIDGET_SELL_CHAIN is resized for some reason */
* This way it will stay the same even if DEPOT_WIDGET_SELL_CHAIN is resized for some reason */
this->widget[DEPOT_WIDGET_SELL_CHAIN].top = ((this->widget[DEPOT_WIDGET_SELL_CHAIN].bottom - this->widget[DEPOT_WIDGET_SELL].top) / 2) + this->widget[DEPOT_WIDGET_SELL].top;
this->widget[DEPOT_WIDGET_SELL].bottom = this->widget[DEPOT_WIDGET_SELL_CHAIN].top - 1;
}
+2 -2
View File
@@ -35,7 +35,7 @@ DECLARE_POSTFIX_INCREMENT(Direction);
/** Define basic enum properties */
template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
typedef TinyEnumT<Direction> DirectionByte; // typedefing-enumification of Direction
typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
/**
@@ -85,7 +85,7 @@ DECLARE_POSTFIX_INCREMENT(DiagDirection);
/** Define basic enum properties */
template <> struct EnumPropsT<DiagDirection> : MakeEnumPropsT<DiagDirection, byte, DIAGDIR_BEGIN, DIAGDIR_END, INVALID_DIAGDIR> {};
typedef TinyEnumT<DiagDirection> DiagDirectionByte; // typedefing-enumification of DiagDirection
typedef TinyEnumT<DiagDirection> DiagDirectionByte; //typedefing-enumification of DiagDirection
/**
+64 -47
View File
@@ -39,21 +39,21 @@
#include "table/sprites.h"
enum DisasterSubType {
ST_ZEPPELINER,
ST_ZEPPELINER_SHADOW,
ST_SMALL_UFO,
ST_SMALL_UFO_SHADOW,
ST_AIRPLANE,
ST_AIRPLANE_SHADOW,
ST_HELICOPTER,
ST_HELICOPTER_SHADOW,
ST_HELICOPTER_ROTORS,
ST_BIG_UFO,
ST_BIG_UFO_SHADOW,
ST_BIG_UFO_DESTROYER,
ST_BIG_UFO_DESTROYER_SHADOW,
ST_SMALL_SUBMARINE,
ST_BIG_SUBMARINE,
ST_Zeppeliner,
ST_Zeppeliner_Shadow,
ST_Small_Ufo,
ST_Small_Ufo_Shadow,
ST_Airplane,
ST_Airplane_Shadow,
ST_Helicopter,
ST_Helicopter_Shadow,
ST_Helicopter_Rotors,
ST_Big_Ufo,
ST_Big_Ufo_Shadow,
ST_Big_Ufo_Destroyer,
ST_Big_Ufo_Destroyer_Shadow,
ST_Small_Submarine,
ST_Big_Submarine,
};
static void DisasterClearSquare(TileIndex tile)
@@ -135,7 +135,7 @@ static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Directio
v->current_order.Free();
DisasterVehicleUpdateImage(v);
VehicleMove(v, false);
VehiclePositionChanged(v);
MarkSingleVehicleDirty(v);
}
@@ -143,17 +143,20 @@ static void SetDisasterVehiclePos(Vehicle *v, int x, int y, byte z)
{
Vehicle *u;
BeginVehicleMove(v);
v->x_pos = x;
v->y_pos = y;
v->z_pos = z;
v->tile = TileVirtXY(x, y);
DisasterVehicleUpdateImage(v);
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
if ((u = v->Next()) != NULL) {
int safe_x = Clamp(x, 0, MapMaxX() * TILE_SIZE);
int safe_y = Clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
BeginVehicleMove(u);
u->x_pos = x;
u->y_pos = y - 1 - (max(z - GetSlopeZ(safe_x, safe_y), 0U) >> 3);
@@ -162,13 +165,16 @@ static void SetDisasterVehiclePos(Vehicle *v, int x, int y, byte z)
u->direction = v->direction;
DisasterVehicleUpdateImage(u);
VehicleMove(u, true);
VehiclePositionChanged(u);
EndVehicleMove(u);
if ((u = u->Next()) != NULL) {
BeginVehicleMove(u);
u->x_pos = x;
u->y_pos = y;
u->z_pos = z + 5;
VehicleMove(u, true);
VehiclePositionChanged(u);
EndVehicleMove(u);
}
}
}
@@ -537,7 +543,8 @@ static void DisasterTick_Helicopter_Rotors(Vehicle *v)
if (++v->cur_image > SPR_ROTOR_MOVING_3) v->cur_image = SPR_ROTOR_MOVING_1;
VehicleMove(v, true);
VehiclePositionChanged(v);
MarkSingleVehicleDirty(v);
}
/**
@@ -597,13 +604,13 @@ static void DisasterTick_Big_Ufo(Vehicle *v)
}
u = new DisasterVehicle();
InitializeDisasterVehicle(u, -6 * TILE_SIZE, v->y_pos, 135, DIR_SW, ST_BIG_UFO_DESTROYER);
InitializeDisasterVehicle(u, -6 * TILE_SIZE, v->y_pos, 135, DIR_SW, ST_Big_Ufo_Destroyer);
u->u.disaster.big_ufo_destroyer_target = v->index;
Vehicle *w = new DisasterVehicle();
u->SetNext(w);
InitializeDisasterVehicle(w, -6 * TILE_SIZE, v->y_pos, 0, DIR_SW, ST_BIG_UFO_DESTROYER_SHADOW);
InitializeDisasterVehicle(w, -6 * TILE_SIZE, v->y_pos, 0, DIR_SW, ST_Big_Ufo_Destroyer_Shadow);
w->vehstatus |= VS_SHADOW;
} else if (v->current_order.GetDestination() == 0) {
int x = TileX(v->dest_tile) * TILE_SIZE;
@@ -695,6 +702,8 @@ static void DisasterTick_Submarine(Vehicle *v)
v->tick_counter++;
if (++v->age > 8880) {
VehiclePositionChanged(v);
MarkSingleVehicleDirty(v);
delete v;
return;
}
@@ -757,12 +766,12 @@ static void Disaster_Zeppeliner_Init()
}
}
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, ST_ZEPPELINER);
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, ST_Zeppeliner);
/* Allocate shadow */
Vehicle *u = new DisasterVehicle();
v->SetNext(u);
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, ST_ZEPPELINER_SHADOW);
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, ST_Zeppeliner_Shadow);
u->vehstatus |= VS_SHADOW;
}
@@ -776,14 +785,14 @@ static void Disaster_Small_Ufo_Init()
Vehicle *v = new DisasterVehicle();
int x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2;
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, ST_SMALL_UFO);
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, ST_Small_Ufo);
v->dest_tile = TileXY(MapSizeX() / 2, MapSizeY() / 2);
v->age = 0;
/* Allocate shadow */
Vehicle *u = new DisasterVehicle();
v->SetNext(u);
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, ST_SMALL_UFO_SHADOW);
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, ST_Small_Ufo_Shadow);
u->vehstatus |= VS_SHADOW;
}
@@ -810,11 +819,11 @@ static void Disaster_Airplane_Init()
int x = (MapSizeX() + 9) * TILE_SIZE - 1;
int y = TileY(found->xy) * TILE_SIZE + 37;
InitializeDisasterVehicle(v, x, y, 135, DIR_NE, ST_AIRPLANE);
InitializeDisasterVehicle(v, x, y, 135, DIR_NE, ST_Airplane);
Vehicle *u = new DisasterVehicle();
v->SetNext(u);
InitializeDisasterVehicle(u, x, y, 0, DIR_SE, ST_AIRPLANE_SHADOW);
InitializeDisasterVehicle(u, x, y, 0, DIR_SE, ST_Airplane_Shadow);
u->vehstatus |= VS_SHADOW;
}
@@ -840,16 +849,16 @@ static void Disaster_Helicopter_Init()
int x = -16 * TILE_SIZE;
int y = TileY(found->xy) * TILE_SIZE + 37;
InitializeDisasterVehicle(v, x, y, 135, DIR_SW, ST_HELICOPTER);
InitializeDisasterVehicle(v, x, y, 135, DIR_SW, ST_Helicopter);
Vehicle *u = new DisasterVehicle();
v->SetNext(u);
InitializeDisasterVehicle(u, x, y, 0, DIR_SW, ST_HELICOPTER_SHADOW);
InitializeDisasterVehicle(u, x, y, 0, DIR_SW, ST_Helicopter_Shadow);
u->vehstatus |= VS_SHADOW;
Vehicle *w = new DisasterVehicle();
u->SetNext(w);
InitializeDisasterVehicle(w, x, y, 140, DIR_SW, ST_HELICOPTER_ROTORS);
InitializeDisasterVehicle(w, x, y, 140, DIR_SW, ST_Helicopter_Rotors);
}
@@ -863,22 +872,24 @@ static void Disaster_Big_Ufo_Init()
int x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2;
int y = MapMaxX() * TILE_SIZE - 1;
InitializeDisasterVehicle(v, x, y, 135, DIR_NW, ST_BIG_UFO);
InitializeDisasterVehicle(v, x, y, 135, DIR_NW, ST_Big_Ufo);
v->dest_tile = TileXY(MapSizeX() / 2, MapSizeY() / 2);
v->age = 0;
/* Allocate shadow */
Vehicle *u = new DisasterVehicle();
v->SetNext(u);
InitializeDisasterVehicle(u, x, y, 0, DIR_NW, ST_BIG_UFO_SHADOW);
InitializeDisasterVehicle(u, x, y, 0, DIR_NW, ST_Big_Ufo_Shadow);
u->vehstatus |= VS_SHADOW;
}
static void Disaster_Submarine_Init(DisasterSubType subtype)
/* Curious submarine #1, just floats around */
static void Disaster_Small_Submarine_Init()
{
if (!Vehicle::CanAllocateItem()) return;
Vehicle *v = new DisasterVehicle();
int y;
Direction dir;
uint32 r = Random();
@@ -889,27 +900,33 @@ static void Disaster_Submarine_Init(DisasterSubType subtype)
dir = DIR_NW;
} else {
y = TILE_SIZE / 2;
if (_settings_game.construction.freeform_edges) y += TILE_SIZE;
dir = DIR_SE;
}
if (!IsWaterTile(TileVirtXY(x, y))) return;
Vehicle *v = new DisasterVehicle();
InitializeDisasterVehicle(v, x, y, 0, dir, subtype);
InitializeDisasterVehicle(v, x, y, 0, dir, ST_Small_Submarine);
v->age = 0;
}
/* Curious submarine #1, just floats around */
static void Disaster_Small_Submarine_Init()
{
Disaster_Submarine_Init(ST_SMALL_SUBMARINE);
}
/* Curious submarine #2, just floats around */
static void Disaster_Big_Submarine_Init()
{
Disaster_Submarine_Init(ST_BIG_SUBMARINE);
if (!Vehicle::CanAllocateItem()) return;
Vehicle *v = new DisasterVehicle();
int y;
Direction dir;
uint32 r = Random();
int x = TileX(r) * TILE_SIZE + TILE_SIZE / 2;
if (HasBit(r, 31)) {
y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1;
dir = DIR_NW;
} else {
y = TILE_SIZE / 2;
dir = DIR_SE;
}
InitializeDisasterVehicle(v, x, y, 0, dir, ST_Big_Submarine);
v->age = 0;
}
@@ -1016,7 +1033,7 @@ void ReleaseDisastersTargetingIndustry(IndustryID i)
Vehicle *v;
FOR_ALL_VEHICLES(v) {
/* primary disaster vehicles that have chosen target */
if (v->type == VEH_DISASTER && (v->subtype == ST_AIRPLANE || v->subtype == ST_HELICOPTER)) {
if (v->type == VEH_DISASTER && (v->subtype == ST_Airplane || v->subtype == ST_Helicopter)) {
/* if it has chosen target, and it is this industry (yes, dest_tile is IndustryID here), set order to "leaving map peacefully" */
if (v->current_order.GetDestination() > 0 && v->dest_tile == i) v->current_order.SetDestination(3);
}
+12 -12
View File
@@ -274,12 +274,12 @@ static const Widget _build_docks_toolb_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _build_docks_toolbar_desc(
static const WindowDesc _build_docks_toolbar_desc = {
WDP_ALIGN_TBR, 22, 160, 36, 160, 36,
WC_BUILD_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
_build_docks_toolb_widgets
);
_build_docks_toolb_widgets,
};
void ShowBuildDocksToolbar()
{
@@ -309,12 +309,12 @@ static const Widget _build_docks_scen_toolb_widgets[] = {
};
/* Window definition for the build docks in scenario editor window */
static const WindowDesc _build_docks_scen_toolbar_desc(
static const WindowDesc _build_docks_scen_toolbar_desc = {
WDP_AUTO, WDP_AUTO, 115, 36, 115, 36,
WC_SCEN_BUILD_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
_build_docks_scen_toolb_widgets
);
_build_docks_scen_toolb_widgets,
};
void ShowBuildDocksScenToolbar()
{
@@ -395,12 +395,12 @@ static const Widget _build_dock_station_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _build_dock_station_desc(
static const WindowDesc _build_dock_station_desc = {
WDP_AUTO, WDP_AUTO, 148, 75, 148, 75,
WC_BUILD_STATION, WC_BUILD_TOOLBAR,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
_build_dock_station_widgets
);
_build_dock_station_widgets,
};
static void ShowBuildDockStationPicker(Window *parent)
{
@@ -469,12 +469,12 @@ static const Widget _build_docks_depot_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _build_docks_depot_desc(
static const WindowDesc _build_docks_depot_desc = {
WDP_AUTO, WDP_AUTO, 204, 86, 204, 86,
WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
_build_docks_depot_widgets
);
_build_docks_depot_widgets,
};
static void ShowBuildDocksDepotPicker(Window *parent)
+14 -14
View File
@@ -75,18 +75,18 @@ static CommandCost TerraformTile_Dummy(TileIndex tile, DoCommandFlag flags, uint
}
extern const TileTypeProcs _tile_type_dummy_procs = {
DrawTile_Dummy, // draw_tile_proc
GetSlopeZ_Dummy, // get_slope_z_proc
ClearTile_Dummy, // clear_tile_proc
GetAcceptedCargo_Dummy, // get_accepted_cargo_proc
GetTileDesc_Dummy, // get_tile_desc_proc
GetTileTrackStatus_Dummy, // get_tile_track_status_proc
ClickTile_Dummy, // click_tile_proc
AnimateTile_Dummy, // animate_tile_proc
TileLoop_Dummy, // tile_loop_clear
ChangeTileOwner_Dummy, // change_tile_owner_clear
NULL, // get_produced_cargo_proc
NULL, // vehicle_enter_tile_proc
GetFoundation_Dummy, // get_foundation_proc
TerraformTile_Dummy, // terraform_tile_proc
DrawTile_Dummy, /* draw_tile_proc */
GetSlopeZ_Dummy, /* get_slope_z_proc */
ClearTile_Dummy, /* clear_tile_proc */
GetAcceptedCargo_Dummy, /* get_accepted_cargo_proc */
GetTileDesc_Dummy, /* get_tile_desc_proc */
GetTileTrackStatus_Dummy, /* get_tile_track_status_proc */
ClickTile_Dummy, /* click_tile_proc */
AnimateTile_Dummy, /* animate_tile_proc */
TileLoop_Dummy, /* tile_loop_clear */
ChangeTileOwner_Dummy, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
GetFoundation_Dummy, /* get_foundation_proc */
TerraformTile_Dummy, /* terraform_tile_proc */
};
+14 -14
View File
@@ -190,7 +190,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update)
do {
min_income = min(min_income, cee->income + cee->expenses);
max_income = max(max_income, cee->income + cee->expenses);
} while (++cee, --numec);
} while (++cee,--numec);
if (min_income > 0) {
_score_part[owner][SCORE_MIN_INCOME] = ClampToI32(min_income);
@@ -212,7 +212,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update)
total_delivered = 0;
do {
total_delivered += cee->delivered_cargo;
} while (++cee, --numec);
} while (++cee,--numec);
_score_part[owner][SCORE_DELIVERED] = total_delivered;
}
@@ -332,7 +332,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
if (new_owner != INVALID_OWNER) {
if (HasBit(t->have_ratings, old_owner)) {
if (HasBit(t->have_ratings, new_owner)) {
/* use max of the two ratings. */
// use max of the two ratings.
t->ratings[new_owner] = max(t->ratings[new_owner], t->ratings[old_owner]);
} else {
SetBit(t->have_ratings, new_owner);
@@ -962,7 +962,7 @@ struct FoundRoute {
static void FindSubsidyPassengerRoute(FoundRoute *fr)
{
Town *from, *to;
Town *from,*to;
fr->distance = UINT_MAX;
@@ -1062,13 +1062,13 @@ static void SubsidyMonthlyHandler()
for (s = _subsidies; s != endof(_subsidies); s++) {
if (s->cargo_type == CT_INVALID) continue;
if (s->age == 12 - 1) {
if (s->age == 12-1) {
pair = SetupSubsidyDecodeParam(s, 1);
AddNewsItem(STR_202E_OFFER_OF_SUBSIDY_EXPIRED, NS_SUBSIDIES, pair.a, pair.b);
s->cargo_type = CT_INVALID;
modified = true;
AI::BroadcastNewEvent(new AIEventSubsidyOfferExpired(s - _subsidies));
} else if (s->age == 2 * 12 - 1) {
} else if (s->age == 2*12-1) {
st = GetStation(s->to);
if (st->owner == _local_company) {
pair = SetupSubsidyDecodeParam(s, 1);
@@ -1083,7 +1083,7 @@ static void SubsidyMonthlyHandler()
}
/* 25% chance to go on */
if (Chance16(1, 4)) {
if (Chance16(1,4)) {
/* Find a free slot*/
s = _subsidies;
while (s->cargo_type != CT_INVALID) {
@@ -1514,7 +1514,7 @@ void VehiclePayment(Vehicle *front_v)
}
/* Call the production machinery of industries only once for every vehicle chain */
const Industry * const *isend = industry_set.End();
const Industry *const *isend = industry_set.End();
for (Industry **iid = industry_set.Begin(); iid != isend; iid++) {
TriggerIndustryProduction(*iid);
}
@@ -1734,7 +1734,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
if (anything_loaded || anything_unloaded) {
if (_settings_game.order.gradual_loading) {
/* The time it takes to load one 'slice' of cargo or passengers depends
* on the vehicle type - the values here are those found in TTDPatch */
* on the vehicle type - the values here are those found in TTDPatch */
const uint gradual_loading_wait_time[] = { 40, 20, 10, 20 };
unloading_time = gradual_loading_wait_time[v->type];
@@ -1889,8 +1889,8 @@ CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1,
{
CommandCost cost(EXPENSES_OTHER);
/* Check if buying shares is allowed (protection against modified clients)
* Cannot buy own shares */
/* Check if buying shares is allowed (protection against modified clients) */
/* Cannot buy own shares */
if (!IsValidCompanyID((CompanyID)p1) || !_settings_game.economy.allow_shares || _current_company == (CompanyID)p1) return CMD_ERROR;
Company *c = GetCompany((CompanyID)p1);
@@ -1909,7 +1909,7 @@ CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1,
OwnerByte *b = c->share_owners;
int i;
while (*b != COMPANY_SPECTATOR) b++; // share owners is guaranteed to contain at least one COMPANY_SPECTATOR
while (*b != COMPANY_SPECTATOR) b++; /* share owners is guaranteed to contain at least one COMPANY_SPECTATOR */
*b = _current_company;
for (i = 0; c->share_owners[i] == _current_company;) {
@@ -1932,8 +1932,8 @@ CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1,
*/
CommandCost CmdSellShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
/* Check if selling shares is allowed (protection against modified clients)
* Cannot sell own shares */
/* Check if selling shares is allowed (protection against modified clients) */
/* Cannot sell own shares */
if (!IsValidCompanyID((CompanyID)p1) || !_settings_game.economy.allow_shares || _current_company == (CompanyID)p1) return CMD_ERROR;
Company *c = GetCompany((CompanyID)p1);
+58 -14
View File
@@ -25,8 +25,11 @@ static void ChimneySmokeTick(Vehicle *v)
if (v->progress > 0) {
v->progress--;
} else {
BeginVehicleMove(v);
TileIndex tile = TileVirtXY(v->x_pos, v->y_pos);
if (!IsTileType(tile, MP_INDUSTRY)) {
EndVehicleMove(v);
delete v;
return;
}
@@ -37,7 +40,8 @@ static void ChimneySmokeTick(Vehicle *v)
v->cur_image = SPR_CHIMNEY_SMOKE_0;
}
v->progress = 7;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
}
}
@@ -51,6 +55,8 @@ static void SteamSmokeTick(Vehicle *v)
{
bool moved = false;
BeginVehicleMove(v);
v->progress++;
if ((v->progress & 7) == 0) {
@@ -62,13 +68,17 @@ static void SteamSmokeTick(Vehicle *v)
if (v->cur_image != SPR_STEAM_SMOKE_4) {
v->cur_image++;
} else {
EndVehicleMove(v);
delete v;
return;
}
moved = true;
}
if (moved) VehicleMove(v, true);
if (moved) {
VehiclePositionChanged(v);
EndVehicleMove(v);
}
}
static void DieselSmokeInit(Vehicle *v)
@@ -82,13 +92,18 @@ static void DieselSmokeTick(Vehicle *v)
v->progress++;
if ((v->progress & 3) == 0) {
BeginVehicleMove(v);
v->z_pos++;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
} else if ((v->progress & 7) == 1) {
BeginVehicleMove(v);
if (v->cur_image != SPR_DIESEL_SMOKE_5) {
v->cur_image++;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
} else {
EndVehicleMove(v);
delete v;
}
}
@@ -106,10 +121,13 @@ static void ElectricSparkTick(Vehicle *v)
v->progress++;
} else {
v->progress = 0;
BeginVehicleMove(v);
if (v->cur_image != SPR_ELECTRIC_SPARK_5) {
v->cur_image++;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
} else {
EndVehicleMove(v);
delete v;
}
}
@@ -125,6 +143,8 @@ static void SmokeTick(Vehicle *v)
{
bool moved = false;
BeginVehicleMove(v);
v->progress++;
if ((v->progress & 3) == 0) {
@@ -136,13 +156,17 @@ static void SmokeTick(Vehicle *v)
if (v->cur_image != SPR_SMOKE_4) {
v->cur_image++;
} else {
EndVehicleMove(v);
delete v;
return;
}
moved = true;
}
if (moved) VehicleMove(v, true);
if (moved) {
VehiclePositionChanged(v);
EndVehicleMove(v);
}
}
static void ExplosionLargeInit(Vehicle *v)
@@ -155,10 +179,13 @@ static void ExplosionLargeTick(Vehicle *v)
{
v->progress++;
if ((v->progress & 3) == 0) {
BeginVehicleMove(v);
if (v->cur_image != SPR_EXPLOSION_LARGE_F) {
v->cur_image++;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
} else {
EndVehicleMove(v);
delete v;
}
}
@@ -174,16 +201,20 @@ static void BreakdownSmokeTick(Vehicle *v)
{
v->progress++;
if ((v->progress & 7) == 0) {
BeginVehicleMove(v);
if (v->cur_image != SPR_BREAKDOWN_SMOKE_3) {
v->cur_image++;
} else {
v->cur_image = SPR_BREAKDOWN_SMOKE_0;
}
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
}
v->u.effect.animation_state--;
if (v->u.effect.animation_state == 0) {
BeginVehicleMove(v);
EndVehicleMove(v);
delete v;
}
}
@@ -198,10 +229,13 @@ static void ExplosionSmallTick(Vehicle *v)
{
v->progress++;
if ((v->progress & 3) == 0) {
BeginVehicleMove(v);
if (v->cur_image != SPR_EXPLOSION_SMALL_B) {
v->cur_image++;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
} else {
EndVehicleMove(v);
delete v;
}
}
@@ -260,6 +294,8 @@ static void BulldozerTick(Vehicle *v)
if ((v->progress & 7) == 0) {
const BulldozerMovement *b = &_bulldozer_movement[v->u.effect.animation_state];
BeginVehicleMove(v);
v->cur_image = SPR_BULLDOZER_NE + b->image;
v->x_pos += _inc_by_dir[b->direction].x;
@@ -270,11 +306,13 @@ static void BulldozerTick(Vehicle *v)
v->u.effect.animation_substate = 0;
v->u.effect.animation_state++;
if (v->u.effect.animation_state == lengthof(_bulldozer_movement)) {
EndVehicleMove(v);
delete v;
return;
}
}
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
}
}
@@ -442,10 +480,13 @@ static void BubbleTick(Vehicle *v)
v->progress++;
if ((v->progress & 3) != 0) return;
BeginVehicleMove(v);
if (v->spritenum == 0) {
v->cur_image++;
if (v->cur_image < SPR_BUBBLE_GENERATE_3) {
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
return;
}
if (v->u.effect.animation_substate != 0) {
@@ -461,6 +502,7 @@ static void BubbleTick(Vehicle *v)
const BubbleMovement *b = &_bubble_movement[v->spritenum - 1][anim_state];
if (b->y == 4 && b->x == 0) {
EndVehicleMove(v);
delete v;
return;
}
@@ -491,7 +533,8 @@ static void BubbleTick(Vehicle *v)
v->z_pos += b->z;
v->cur_image = SPR_BUBBLE_0 + b->image;
VehicleMove(v, true);
VehiclePositionChanged(v);
EndVehicleMove(v);
}
@@ -540,8 +583,9 @@ Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicleType type)
_effect_init_procs[type](v);
VehicleMove(v, false);
MarkSingleVehicleDirty(v);
VehiclePositionChanged(v);
BeginVehicleMove(v);
EndVehicleMove(v);
return v;
}
+12 -12
View File
@@ -358,8 +358,8 @@ static void DrawCatenaryRailway(const TileInfo *ti)
AdjustTileh(neighbour, &tileh[TS_NEIGHBOUR]);
/* If we have a straight (and level) track, we want a pylon only every 2 tiles
* Delete the PCP if this is the case.
* Level means that the slope is the same, or the track is flat */
* Delete the PCP if this is the case. */
/* Level means that the slope is the same, or the track is flat */
if (tileh[TS_HOME] == tileh[TS_NEIGHBOUR] || (isflat[TS_HOME] && isflat[TS_NEIGHBOUR])) {
for (uint k = 0; k < NUM_IGNORE_GROUPS; k++) {
if (PPPpreferred[i] == IgnoredPCP[k][tlg][i]) ClrBit(PCPstatus, i);
@@ -394,13 +394,13 @@ static void DrawCatenaryRailway(const TileInfo *ti)
if (!HasBit(OwnedPPPonPCP[i], temp)) {
/* We have a neighour that will draw it, bail out */
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE) break;
continue; // No neighbour, go looking for a better position
continue; /* No neighbour, go looking for a better position */
}
AddSortableSpriteToDraw(pylon_base + pylon_sprites[temp], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE,
elevation, IsTransparencySet(TO_CATENARY), -1, -1);
break; // We already have drawn a pylon, bail out
break; /* We already have drawn a pylon, bail out */
}
}
}
@@ -425,9 +425,9 @@ static void DrawCatenaryRailway(const TileInfo *ti)
(HasBit(PCPstatus, PCPpositions[t][1]) << 1);
const SortableSpriteStruct *sss;
int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; // tileh for the slopes, 0 otherwise
int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */
assert(PCPconfig != 0); // We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that)
assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
assert(!IsSteepSlope(tileh[TS_HOME]));
sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
@@ -478,8 +478,8 @@ void DrawCatenaryOnBridge(const TileInfo *ti)
SpriteID pylon_base = GetPylonBase(start);
/* Finished with wires, draw pylons
* every other tile needs a pylon on the northern end */
/* Finished with wires, draw pylons */
/* every other tile needs a pylon on the northern end */
if (num % 2) {
DiagDirection PCPpos = (axis == AXIS_X ? DIAGDIR_NE : DIAGDIR_NW);
Direction PPPpos = (axis == AXIS_X ? DIR_NW : DIR_NE);
@@ -552,12 +552,12 @@ bool SettingsDisableElrail(int32 p1)
}
/* when disabling elrails, make sure that all existing trains can run on
* normal rail too */
* normal rail too */
if (disable) {
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
/* this railroad vehicle is now compatible only with elrail,
* so add there also normal rail compatibility */
* so add there also normal rail compatibility */
v->u.rail.compatible_railtypes |= RAILTYPES_RAIL;
v->u.rail.railtype = RAILTYPE_RAIL;
SetBit(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
@@ -577,8 +577,8 @@ bool SettingsDisableElrail(int32 p1)
FOR_ALL_COMPANIES(c) c->avail_railtypes = GetCompanyRailtypes(c->index);
/* This resets the _last_built_railtype, which will be invalid for electric
* rails. It may have unintended consequences if that function is ever
* extended, though. */
* rails. It may have unintended consequences if that function is ever
* extended, though. */
ReinitGuiAfterToggleElrail(disable);
return true;
}
+1 -1
View File
@@ -673,7 +673,7 @@ void EnginesMonthlyLoop()
if (!(e->flags & ENGINE_AVAILABLE) && _date >= (e->intro_date + DAYS_IN_YEAR)) {
/* Introduce it to all companies */
NewVehicleAvailable(e);
} else if (!(e->flags & (ENGINE_AVAILABLE | ENGINE_EXCLUSIVE_PREVIEW)) && _date >= e->intro_date) {
} else if (!(e->flags & (ENGINE_AVAILABLE|ENGINE_EXCLUSIVE_PREVIEW)) && _date >= e->intro_date) {
/* Introduction date has passed.. show introducing dialog to one companies. */
e->flags |= ENGINE_EXCLUSIVE_PREVIEW;
-2
View File
@@ -25,6 +25,4 @@ void SetCachedEngineCounts();
void SetYearEngineAgingStops();
void StartupOneEngine(Engine *e, Date aging_date);
uint GetTotalCapacityOfArticulatedParts(EngineID engine, VehicleType type);
#endif /* ENGINE_H */
+11 -22
View File
@@ -14,7 +14,6 @@
#include "engine_gui.h"
#include "articulated_vehicles.h"
#include "rail.h"
#include "aircraft.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -97,12 +96,12 @@ struct EnginePreviewWindow : Window {
}
};
static const WindowDesc _engine_preview_desc(
static const WindowDesc _engine_preview_desc = {
WDP_CENTER, WDP_CENTER, 300, 192, 300, 192,
WC_ENGINE_PREVIEW, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
_engine_preview_widgets
);
_engine_preview_widgets,
};
void ShowEnginePreviewWindow(EngineID engine)
@@ -110,7 +109,7 @@ void ShowEnginePreviewWindow(EngineID engine)
AllocateWindowDescFront<EnginePreviewWindow>(&_engine_preview_desc, engine);
}
uint GetTotalCapacityOfArticulatedParts(EngineID engine, VehicleType type)
static uint GetTotalCapacityOfArticulatedParts(EngineID engine, VehicleType type)
{
uint total = 0;
@@ -145,26 +144,16 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw)
{
const AircraftVehicleInfo *avi = AircraftVehInfo(engine);
const Engine *e = GetEngine(engine);
CargoID cargo = e->GetDefaultCargoType();
if (cargo == CT_INVALID || cargo == CT_PASSENGERS) {
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
SetDParam(2, e->u.air.passenger_capacity);
SetDParam(3, e->u.air.mail_capacity);
SetDParam(4, e->GetRunningCost());
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
SetDParam(2, avi->passenger_capacity);
SetDParam(3, avi->mail_capacity);
SetDParam(4, e->GetRunningCost());
DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw);
} else {
SetDParam(0, e->GetCost());
SetDParam(1, e->GetDisplayMaxSpeed());
SetDParam(2, cargo);
SetDParam(3, AircraftDefaultCargoCapacity(cargo, &e->u.air));
SetDParam(4, e->GetRunningCost());
DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw);
}
DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw);
}
static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw)
+2 -2
View File
@@ -485,8 +485,8 @@ static void TarAddLink(const std::string &srcParam, const std::string &destParam
/* Link to file. Process the link like the destination file. */
_tar_filelist.insert(TarFileList::value_type(src, dest_file->second));
} else {
/* Destination file not found. Assume 'link to directory'
* Append PATHSEPCHAR to 'src' and 'dest' if needed */
/* Destination file not found. Assume 'link to directory' */
/* Append PATHSEPCHAR to 'src' and 'dest' if needed */
const std::string src_path = ((*src.rbegin() == PATHSEPCHAR) ? src : src + PATHSEPCHAR);
const std::string dst_path = (dest.length() == 0 ? "" : ((*dest.rbegin() == PATHSEPCHAR) ? dest : dest + PATHSEPCHAR));
_tar_linklist.insert(TarLinkList::value_type(src_path, dst_path));
+10 -6
View File
@@ -12,7 +12,12 @@
#include <sys/stat.h>
#ifdef WIN32
# include <tchar.h>
# ifndef UNICODE
# include <io.h>
# endif
# define access _taccess
# define unlink _tunlink
#else
# include <unistd.h>
#endif /* WIN32 */
@@ -156,12 +161,16 @@ void FiosMakeSavegameName(char *buf, const char *name, size_t size)
#endif
}
#if defined(WIN32)
# define unlink _tunlink
#endif
bool FiosDelete(const char *name)
{
char filename[512];
FiosMakeSavegameName(filename, name, lengthof(filename));
return unlink(filename) == 0;
return unlink(OTTD2FS(filename)) == 0;
}
bool FileExists(const char *filename)
@@ -221,13 +230,8 @@ bool FiosFileScanner::AddFile(const char *filename, size_t basepath_length)
}
FiosItem *fios = _fios_items.Append();
#ifdef WIN32
struct _stat sb;
if (_tstat(OTTD2FS(filename), &sb) == 0) {
#else
struct stat sb;
if (stat(filename, &sb) == 0) {
#endif
fios->mtime = sb.st_mtime;
} else {
fios->mtime = 0;
+5 -4
View File
@@ -38,7 +38,8 @@ enum {
* If no appropiate font is found, the function returns an error */
#ifdef WIN32
#include <windows.h>
#include <shlobj.h> /* SHGetFolderPath */
#include <tchar.h>
#include <shlobj.h> // SHGetFolderPath
#include "win32.h"
/**
@@ -376,8 +377,8 @@ static FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
if (font_style != NULL && strcasecmp(font_style, (char*)style) != 0) continue;
/* Font config takes the best shot, which, if the family name is spelled
* wrongly a 'random' font, so check whether the family name is the
* same as the supplied name */
* wrongly a 'random' font, so check whether the family name is the
* same as the supplied name */
if (strcasecmp(font_family, (char*)family) == 0) {
err = FT_New_Face(_library, (char *)file, 0, face);
}
@@ -713,7 +714,7 @@ const Sprite *GetGlyph(FontSize size, WChar key)
sprite.width = width;
sprite.height = height;
sprite.x_offs = slot->bitmap_left;
/* XXX 2 should be determined somehow... it's right for the normal face */
// XXX 2 should be determined somehow... it's right for the normal face
y_adj = (size == FS_NORMAL) ? 2 : 0;
sprite.y_offs = GetCharacterHeight(size) - slot->bitmap_top - y_adj;
+21 -29
View File
@@ -82,26 +82,6 @@ bool IsGenerateWorldThreaded()
return _gw.threaded && !_gw.quit_thread;
}
/**
* Clean up the 'mess' of generation. That is show windows again, reset
* thread variables and delete the progress window.
*/
static void CleanupGeneration()
{
_generating_world = false;
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
/* Show all vital windows again, because we have hidden them */
if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
_gw.active = false;
_gw.proc = NULL;
_gw.abortp = NULL;
_gw.threaded = false;
DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
MarkWholeScreenDirty();
}
/**
* The internal, real, generate function.
*/
@@ -141,10 +121,7 @@ static void _GenerateWorld(void *arg)
/* only generate towns, tree and industries in newgame mode. */
if (_game_mode != GM_EDITOR) {
if (!GenerateTowns(_settings_game.economy.town_layout)) {
HandleGeneratingWorldAbortion();
return;
}
GenerateTowns(_settings_game.economy.town_layout);
GenerateIndustries();
GenerateUnmovables();
GenerateTrees();
@@ -181,7 +158,15 @@ static void _GenerateWorld(void *arg)
if (_gw.proc != NULL) _gw.proc();
IncreaseGeneratingWorldProgress(GWP_GAME_START);
CleanupGeneration();
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
/* Show all vital windows again, because we have hidden them */
if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
_gw.active = false;
_gw.proc = NULL;
_gw.threaded = false;
DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
MarkWholeScreenDirty();
if (_network_dedicated) DEBUG(net, 0, "Map generated, starting game");
DEBUG(desync, 1, "new_map: %i\n", _settings_game.game_creation.generation_seed);
@@ -256,12 +241,19 @@ void HandleGeneratingWorldAbortion()
if (_gw.abortp != NULL) _gw.abortp();
CleanupGeneration();
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
/* Show all vital windows again, because we have hidden them */
if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
if (_gw.thread != NULL) _gw.thread->Exit();
_gw.active = false;
_gw.proc = NULL;
_gw.abortp = NULL;
_gw.threaded = false;
extern void SwitchToMode(SwitchMode new_mode);
SwitchToMode(_switch_mode);
DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
MarkWholeScreenDirty();
_gw.thread->Exit();
}
/**
+4 -4
View File
@@ -20,10 +20,10 @@ enum {
/* Modes for GenerateWorld */
enum GenerateWorldMode {
GW_NEWGAME = 0, ///< Generate a map for a new game
GW_EMPTY = 1, ///< Generate an empty map (sea-level)
GW_RANDOM = 2, ///< Generate a random map for SE
GW_HEIGHTMAP = 3, ///< Generate a newgame from a heightmap
GW_NEWGAME = 0, /* Generate a map for a new game */
GW_EMPTY = 1, /* Generate an empty map (sea-level) */
GW_RANDOM = 2, /* Generate a random map for SE */
GW_HEIGHTMAP = 3, /* Generate a newgame from a heightmap */
};
typedef void gw_done_proc();
+17 -26
View File
@@ -25,7 +25,6 @@
#include "core/random_func.hpp"
#include "landscape_type.h"
#include "querystring_gui.h"
#include "town.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -286,7 +285,7 @@ static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_
static const StringID _tree_placer[] = {STR_CONFIG_SETTING_TREE_PLACER_NONE, STR_CONFIG_SETTING_TREE_PLACER_ORIGINAL, STR_CONFIG_SETTING_TREE_PLACER_IMPROVED, INVALID_STRING_ID};
static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CLOCKWISE, INVALID_STRING_ID};
static const StringID _landscape[] = {STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL, STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS, INVALID_STRING_ID};
static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, STR_02BF_CUSTOM, INVALID_STRING_ID};
static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
static const StringID _num_inds[] = {STR_NONE, STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
struct GenerateLandscapeWindow : public QueryStringBaseWindow {
@@ -555,9 +554,10 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
EventState state;
this->HandleEditBoxKey(GLAND_RANDOM_EDITBOX, key, keycode, state);
/* the seed is unsigned, therefore atoi cannot be used.
* As UINT32_MAX is a 'magic' value (use random seed) it
* should not be possible to be entered into the input
* field; the generate seed button can be used instead. */
* As 2^32 - 1 (UINT32_MAX) is a 'magic' value
* (use random seed) it should not be possible to be
* entered into the input field; the generate seed
* button can be used instead. */
_settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1);
return state;
}
@@ -571,11 +571,6 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
case GLAND_SMOOTHNESS_PULLDOWN: _settings_newgame.game_creation.tgen_smoothness = index; break;
case GLAND_TOWN_PULLDOWN:
if ((uint)index == CUSTOM_TOWN_NUMBER_DIFFICULTY) {
this->widget_id = widget;
SetDParam(0, _settings_newgame.game_creation.custom_town_number);
ShowQueryString(STR_CONFIG_SETTING_INT32, STR_NUMBER_OF_TOWNS, 5, 50, this, CS_NUMERAL, QSF_NONE);
};
IConsoleSetSetting("difficulty.number_towns", index);
break;
@@ -626,10 +621,6 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
this->InvalidateWidget(GLAND_SNOW_LEVEL_TEXT);
_settings_newgame.game_creation.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT);
break;
case GLAND_TOWN_PULLDOWN:
_settings_newgame.game_creation.custom_town_number = Clamp(value, 1, CUSTOM_TOWN_MAX_NUMBER);
break;
}
this->SetDirty();
@@ -637,19 +628,19 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
}
};
static const WindowDesc _generate_landscape_desc(
static const WindowDesc _generate_landscape_desc = {
WDP_CENTER, WDP_CENTER, 338, 313, 338, 313,
WC_GENERATE_LANDSCAPE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_generate_landscape_widgets
);
_generate_landscape_widgets,
};
static const WindowDesc _heightmap_load_desc(
static const WindowDesc _heightmap_load_desc = {
WDP_CENTER, WDP_CENTER, 338, 236, 338, 236,
WC_GENERATE_LANDSCAPE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
_heightmap_load_widgets
);
_heightmap_load_widgets,
};
static void _ShowGenerateLandscape(glwp_modes mode)
{
@@ -885,12 +876,12 @@ static const Widget _create_scenario_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _create_scenario_desc(
static const WindowDesc _create_scenario_desc = {
WDP_CENTER, WDP_CENTER, 338, 170, 338, 170,
WC_GENERATE_LANDSCAPE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
_create_scenario_widgets
);
_create_scenario_widgets,
};
void ShowCreateScenario()
{
@@ -906,12 +897,12 @@ static const Widget _generate_progress_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _generate_progress_desc(
static const WindowDesc _generate_progress_desc = {
WDP_CENTER, WDP_CENTER, 181, 97, 181, 97,
WC_GENERATE_PROGRESS_WINDOW, WC_NONE,
WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_generate_progress_widgets
);
_generate_progress_widgets,
};
struct tp_info {
uint percent;
+2 -4
View File
@@ -467,10 +467,8 @@ bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length)
if (duplicate) {
delete graphics;
} else {
GraphicsSet **last = &_available_graphics_sets;
while (*last != NULL) last = &(*last)->next;
*last = graphics;
graphics->next = _available_graphics_sets;
_available_graphics_sets = graphics;
ret = true;
}
} else {
+48 -48
View File
@@ -98,12 +98,12 @@ static const Widget _graph_legend_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _graph_legend_desc(
static const WindowDesc _graph_legend_desc = {
WDP_AUTO, WDP_AUTO, 250, 198, 250, 198,
WC_GRAPH_LEGEND, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_graph_legend_widgets
);
_graph_legend_widgets,
};
static void ShowGraphLegend()
{
@@ -125,8 +125,8 @@ protected:
GRAPH_NUM_LINES_Y = 9, ///< How many horizontal lines to draw.
/* 9 is convenient as that means the distance between them is the gd_height of the graph / 8,
* which is the same
* as height >> 3. */
* which is the same
* as height >> 3. */
};
uint excluded_data; ///< bitmask of the datasets that shouldn't be displayed.
@@ -159,7 +159,7 @@ protected:
int x_axis_offset; ///< Distance from the top of the graph to the x axis.
/* the colours and cost array of GraphDrawer must accomodate
* both values for cargo and companies. So if any are higher, quit */
* both values for cargo and companies. So if any are higher, quit */
assert(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES);
assert(this->num_vert_lines > 0);
@@ -209,9 +209,9 @@ protected:
assert(this->num_dataset > 0);
/* Start of with a value of twice the gd_height of the graph in pixels. It's a
* bit arbitrary, but it makes the cargo payment graph look a little nicer,
* and prevents division by zero when calculating where the datapoint
* should be drawn. */
* bit arbitrary, but it makes the cargo payment graph look a little nicer,
* and prevents division by zero when calculating where the datapoint
* should be drawn. */
highest_value = x_axis_offset * 2;
for (int i = 0; i < this->num_dataset; i++) {
@@ -221,8 +221,8 @@ protected:
if (datapoint != INVALID_DATAPOINT) {
/* For now, if the graph has negative values the scaling is
* symmetrical about the x axis, so take the absolute value
* of each data point. */
* symmetrical about the x axis, so take the absolute value
* of each data point. */
highest_value = max(highest_value, abs(datapoint));
}
}
@@ -230,7 +230,7 @@ protected:
}
/* Round up highest_value so that it will divide cleanly into the number of
* axis labels used. */
* axis labels used. */
int round_val = highest_value % (GRAPH_NUM_LINES_Y - 1);
if (round_val != 0) highest_value += (GRAPH_NUM_LINES_Y - 1 - round_val);
@@ -239,7 +239,7 @@ protected:
int64 y_label_separation = highest_value / (GRAPH_NUM_LINES_Y - 1);
/* If there are negative values, the graph goes from highest_value to
* -highest_value, not highest_value to 0. */
* -highest_value, not highest_value to 0. */
if (this->has_negative_values) y_label_separation *= 2;
x = this->gd_left + GRAPH_X_POSITION_BEGINNING + 1;
@@ -303,16 +303,16 @@ protected:
if (datapoint != INVALID_DATAPOINT) {
/*
* Check whether we need to reduce the 'accuracy' of the
* datapoint value and the highest value to splut overflows.
* And when 'drawing' 'one million' or 'one million and one'
* there is no significant difference, so the least
* significant bits can just be removed.
*
* If there are more bits needed than would fit in a 32 bits
* integer, so at about 31 bits because of the sign bit, the
* least significant bits are removed.
*/
* Check whether we need to reduce the 'accuracy' of the
* datapoint value and the highest value to splut overflows.
* And when 'drawing' 'one million' or 'one million and one'
* there is no significant difference, so the least
* significant bits can just be removed.
*
* If there are more bits needed than would fit in a 32 bits
* integer, so at about 31 bits because of the sign bit, the
* least significant bits are removed.
*/
int mult_range = FindLastBit(x_axis_offset) + FindLastBit(abs(datapoint));
int reduce_range = max(mult_range - 31, 0);
@@ -439,12 +439,12 @@ static const Widget _operating_profit_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _operating_profit_desc(
static const WindowDesc _operating_profit_desc = {
WDP_AUTO, WDP_AUTO, 576, 174, 576, 174,
WC_OPERATING_PROFIT, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_operating_profit_widgets
);
_operating_profit_widgets,
};
void ShowOperatingProfitGraph()
@@ -478,12 +478,12 @@ static const Widget _income_graph_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _income_graph_desc(
static const WindowDesc _income_graph_desc = {
WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
WC_INCOME_GRAPH, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_income_graph_widgets
);
_income_graph_widgets,
};
void ShowIncomeGraph()
{
@@ -515,12 +515,12 @@ static const Widget _delivered_cargo_graph_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _delivered_cargo_graph_desc(
static const WindowDesc _delivered_cargo_graph_desc = {
WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
WC_DELIVERED_CARGO, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_delivered_cargo_graph_widgets
);
_delivered_cargo_graph_widgets,
};
void ShowDeliveredCargoGraph()
{
@@ -559,12 +559,12 @@ static const Widget _performance_history_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _performance_history_desc(
static const WindowDesc _performance_history_desc = {
WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
WC_PERFORMANCE_HISTORY, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_performance_history_widgets
);
_performance_history_widgets,
};
void ShowPerformanceHistoryGraph()
{
@@ -596,12 +596,12 @@ static const Widget _company_value_graph_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _company_value_graph_desc(
static const WindowDesc _company_value_graph_desc = {
WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
WC_COMPANY_VALUE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_company_value_graph_widgets
);
_company_value_graph_widgets,
};
void ShowCompanyValueGraph()
{
@@ -720,12 +720,12 @@ static const Widget _cargo_payment_rates_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _cargo_payment_rates_desc(
static const WindowDesc _cargo_payment_rates_desc = {
WDP_AUTO, WDP_AUTO, 568, 46, 568, 46,
WC_PAYMENT_RATES, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_cargo_payment_rates_widgets
);
_cargo_payment_rates_widgets,
};
void ShowCargoPaymentRates()
@@ -843,12 +843,12 @@ static const Widget _company_league_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _company_league_desc(
static const WindowDesc _company_league_desc = {
WDP_AUTO, WDP_AUTO, 400, 167, 400, 167,
WC_COMPANY_LEAGUE, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_company_league_widgets
);
_company_league_widgets,
};
void ShowCompanyLeagueTable()
{
@@ -1008,7 +1008,7 @@ public:
if (i == SCORE_LOAN) val = needed - val;
/* Draw the amount we have against what is needed
* For some of them it is in currency format */
* For some of them it is in currency format */
SetDParam(0, val);
SetDParam(1, needed);
switch (i) {
@@ -1088,12 +1088,12 @@ static const Widget _performance_rating_detail_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _performance_rating_detail_desc(
static const WindowDesc _performance_rating_detail_desc = {
WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
WC_PERFORMANCE_DETAIL, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_performance_rating_detail_widgets
);
_performance_rating_detail_widgets,
};
void ShowPerformanceRatingDetail()
{
+29 -29
View File
@@ -86,32 +86,32 @@ static void ShowGroupActionDropdown(Window *w, GroupID gid)
static const Widget _group_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // GRP_WIDGET_CLOSEBOX
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 447, 0, 13, 0x0, STR_018C_WINDOW_TITLE_DRAG_THIS}, // GRP_WIDGET_CAPTION
{ WWT_STICKYBOX, RESIZE_LR, COLOUR_GREY, 448, 459, 0, 13, 0x0, STR_STICKY_BUTTON}, // GRP_WIDGET_STICKY
{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 200, 280, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP}, // GRP_WIDGET_SORT_BY_ORDER
{ WWT_DROPDOWN, RESIZE_NONE, COLOUR_GREY, 281, 447, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, // GRP_WIDGET_SORT_BY_DROPDOWN
{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 448, 459, 14, 25, 0x0, STR_NULL}, // GRP_WIDGET_EMPTY_TOP_RIGHT
{ WWT_MATRIX, RESIZE_RB, COLOUR_GREY, 200, 447, 26, 181, 0x701, STR_NULL}, // GRP_WIDGET_LIST_VEHICLE
{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 448, 459, 26, 181, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // GRP_WIDGET_LIST_VEHICLE_SCROLLBAR
{ WWT_PANEL, RESIZE_TB, COLOUR_GREY, 188, 199, 169, 193, 0x0, STR_NULL}, // GRP_WIDGET_EMPTY2
{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 200, 305, 182, 193, 0x0, STR_AVAILABLE_ENGINES_TIP}, // GRP_WIDGET_AVAILABLE_VEHICLES
{ WWT_DROPDOWN, RESIZE_TB, COLOUR_GREY, 306, 423, 182, 193, STR_MANAGE_LIST, STR_MANAGE_LIST_TIP}, // GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 424, 435, 182, 193, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP}, // GRP_WIDGET_STOP_ALL
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 436, 447, 182, 193, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP}, // GRP_WIDGET_START_ALL
{ WWT_PANEL, RESIZE_RTB, COLOUR_GREY, 448, 447, 182, 193, 0x0, STR_NULL}, // GRP_WIDGET_EMPTY_BOTTOM_RIGHT
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 448, 459, 182, 193, 0x0, STR_RESIZE_BUTTON}, // GRP_WIDGET_RESIZE
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 447, 0, 13, 0x0, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, RESIZE_LR, COLOUR_GREY, 448, 459, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 200, 280, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_DROPDOWN, RESIZE_NONE, COLOUR_GREY, 281, 447, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 448, 459, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, RESIZE_RB, COLOUR_GREY, 200, 447, 26, 181, 0x701, STR_NULL},
{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 448, 459, 26, 181, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_TB, COLOUR_GREY, 188, 199, 169, 193, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 200, 305, 182, 193, 0x0, STR_AVAILABLE_ENGINES_TIP},
{ WWT_DROPDOWN, RESIZE_TB, COLOUR_GREY, 306, 423, 182, 193, STR_MANAGE_LIST, STR_MANAGE_LIST_TIP},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 424, 435, 182, 193, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 436, 447, 182, 193, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP},
{ WWT_PANEL, RESIZE_RTB, COLOUR_GREY, 448, 447, 182, 193, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 448, 459, 182, 193, 0x0, STR_RESIZE_BUTTON},
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 14, 25, 0x0, STR_NULL}, // GRP_WIDGET_EMPTY_TOP_LEFT
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 26, 38, 0x0, STR_NULL}, // GRP_WIDGET_ALL_VEHICLES
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 39, 51, 0x0, STR_NULL}, // GRP_WIDGET_DEFAULT_VEHICLES
{ WWT_MATRIX, RESIZE_BOTTOM, COLOUR_GREY, 0, 187, 52, 168, 0x701, STR_GROUPS_CLICK_ON_GROUP_FOR_TIP}, // GRP_WIDGET_LIST_GROUP
{ WWT_SCROLL2BAR, RESIZE_BOTTOM, COLOUR_GREY, 188, 199, 52, 168, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // GRP_WIDGET_LIST_GROUP_SCROLLBAR
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 0, 23, 169, 193, 0x0, STR_GROUP_CREATE_TIP}, // GRP_WIDGET_CREATE_GROUP
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 24, 47, 169, 193, 0x0, STR_GROUP_DELETE_TIP}, // GRP_WIDGET_DELETE_GROUP
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 48, 71, 169, 193, 0x0, STR_GROUP_RENAME_TIP}, // GRP_WIDGET_RENAME_GROUP
{ WWT_PANEL, RESIZE_TB, COLOUR_GREY, 72, 163, 169, 193, 0x0, STR_NULL}, // GRP_WIDGET_EMPTY1
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 164, 187, 169, 193, 0x0, STR_GROUP_REPLACE_PROTECTION_TIP}, // GRP_WIDGET_REPLACE_PROTECTION
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 14, 25, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 26, 38, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 199, 39, 51, 0x0, STR_NULL},
{ WWT_MATRIX, RESIZE_BOTTOM, COLOUR_GREY, 0, 187, 52, 168, 0x701, STR_GROUPS_CLICK_ON_GROUP_FOR_TIP},
{ WWT_SCROLL2BAR, RESIZE_BOTTOM, COLOUR_GREY, 188, 199, 52, 168, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 0, 23, 169, 193, 0x0, STR_GROUP_CREATE_TIP},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 24, 47, 169, 193, 0x0, STR_GROUP_DELETE_TIP},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 48, 71, 169, 193, 0x0, STR_GROUP_RENAME_TIP},
{ WWT_PANEL, RESIZE_TB, COLOUR_GREY, 72, 163, 169, 193, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, RESIZE_TB, COLOUR_GREY, 164, 187, 169, 193, 0x0, STR_GROUP_REPLACE_PROTECTION_TIP},
{ WIDGETS_END},
};
@@ -388,7 +388,7 @@ public:
this->DrawWidgets();
/* Draw Matrix Group
* The selected group is drawn in white */
* The selected group is drawn in white */
StringID str_all_veh, str_no_group_veh;
switch (this->vehicle_type) {
@@ -700,12 +700,12 @@ public:
};
static WindowDesc _group_desc(
static WindowDesc _group_desc = {
WDP_AUTO, WDP_AUTO, 460, 194, 460, 246,
WC_INVALID, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_group_widgets
);
_group_widgets,
};
void ShowCompanyGroup(CompanyID company, VehicleType vehicle_type)
{
+1 -1
View File
@@ -352,7 +352,7 @@ static void GrayscaleToMapHeights(uint img_width, uint img_height, byte *map)
* This function takes care of the fact that land in OpenTTD can never differ
* more than 1 in height
*/
void FixSlopes()
static void FixSlopes()
{
uint width, height;
int row, col;
-6
View File
@@ -37,10 +37,4 @@ void LoadHeightmap(char *filename);
*/
void FlatEmptyWorld(byte tile_height);
/**
* This function takes care of the fact that land in OpenTTD can never differ
* more than 1 in height
*/
void FixSlopes();
#endif /* HEIGHTMAP_H */
+6 -6
View File
@@ -166,19 +166,19 @@ static const Widget _highscore_widgets[] = {
{ WIDGETS_END},
};
static const WindowDesc _highscore_desc(
static const WindowDesc _highscore_desc = {
0, 0, 641, 481, 641, 481,
WC_HIGHSCORE, WC_NONE,
0,
_highscore_widgets
);
_highscore_widgets,
};
static const WindowDesc _endgame_desc(
static const WindowDesc _endgame_desc = {
0, 0, 641, 481, 641, 481,
WC_ENDSCREEN, WC_NONE,
0,
_highscore_widgets
);
_highscore_widgets,
};
/** Show the highscore table for a given difficulty. When called from
* endgame ranking is set to the top5 element that was newly added
+1 -1
View File
@@ -156,7 +156,7 @@ struct GRFFileProps {
* Defines the data structure for constructing industry.
*/
struct IndustrySpec {
const IndustryTileTable * const *table;///< List of the tiles composing the industry
const IndustryTileTable *const *table;///< List of the tiles composing the industry
byte num_table; ///< Number of elements in the table
uint8 cost_multiplier; ///< Base construction cost multiplier.
uint32 removal_cost_multiplier; ///< Base removal cost multiplier.
+46 -46
View File
@@ -1720,11 +1720,11 @@ enum {
static const byte _numof_industry_table[NB_DIFFICULTY_LEVEL][NB_NUMOFINDUSTRY] = {
/* difficulty settings for number of industries */
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // none
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // very low
{0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5}, // low
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, // normal
{0, 2, 3, 4, 6, 7, 8, 9, 10, 10, 10}, // high
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //none
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //very low
{0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5}, //low
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, //normal
{0, 2, 3, 4, 6, 7, 8, 9, 10, 10, 10}, //high
};
/** This function is the one who really do the creation work
@@ -1848,7 +1848,7 @@ struct ProbabilityHelper {
*/
static void MaybeNewIndustry(void)
{
Industry *ind; // will receive the industry's creation pointer
Industry *ind; //will receive the industry's creation pointer
IndustryType rndtype, j; // Loop controlers
const IndustrySpec *ind_spc;
uint num = 0;
@@ -1921,14 +1921,14 @@ static bool CheckIndustryCloseDownProtection(IndustryType type)
}
/**
* Can given cargo type be accepted or produced by the industry?
* @param cargo: Cargo type
* @param ind: Industry
* @param *c_accepts: Pointer to boolean for acceptance of cargo
* @param *c_produces: Pointer to boolean for production of cargo
* @return: \c *c_accepts is set when industry accepts the cargo type,
* \c *c_produces is set when the industry produces the cargo type
*/
* Can given cargo type be accepted or produced by the industry?
* @param cargo: Cargo type
* @param ind: Industry
* @param *c_accepts: Pointer to boolean for acceptance of cargo
* @param *c_produces: Pointer to boolean for production of cargo
* @return: \c *c_accepts is set when industry accepts the cargo type,
* \c *c_produces is set when the industry produces the cargo type
*/
static void CanCargoServiceIndustry(CargoID cargo, Industry *ind, bool *c_accepts, bool *c_produces)
{
const IndustrySpec *indspec = GetIndustrySpec(ind->type);
@@ -1959,18 +1959,18 @@ static void CanCargoServiceIndustry(CargoID cargo, Industry *ind, bool *c_accept
}
/**
* Compute who can service the industry.
*
* Here, 'can service' means that he/she has trains and stations close enough
* to the industry with the right cargo type and the right orders (ie has the
* technical means).
*
* @param ind: Industry being investigated.
*
* @return: 0 if nobody can service the industry, 2 if the local company can
* service the industry, and 1 otherwise (only competitors can service the
* industry)
*/
* Compute who can service the industry.
*
* Here, 'can service' means that he/she has trains and stations close enough
* to the industry with the right cargo type and the right orders (ie has the
* technical means).
*
* @param ind: Industry being investigated.
*
* @return: 0 if nobody can service the industry, 2 if the local company can
* service the industry, and 1 otherwise (only competitors can service the
* industry)
*/
int WhoCanServiceIndustry(Industry *ind)
{
/* Find all stations within reach of the industry */
@@ -2024,12 +2024,12 @@ int WhoCanServiceIndustry(Industry *ind)
}
/**
* Report news that industry production has changed significantly
*
* @param ind: Industry with changed production
* @param type: Cargo type that has changed
* @param percent: Percentage of change (>0 means increase, <0 means decrease)
*/
* Report news that industry production has changed significantly
*
* @param ind: Industry with changed production
* @param type: Cargo type that has changed
* @param percent: Percentage of change (>0 means increase, <0 means decrease)
*/
static void ReportNewsProductionChangeIndustry(Industry *ind, CargoID type, int percent)
{
NewsSubtype ns;
@@ -2377,18 +2377,18 @@ static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, u
}
extern const TileTypeProcs _tile_type_industry_procs = {
DrawTile_Industry, // draw_tile_proc
GetSlopeZ_Industry, // get_slope_z_proc
ClearTile_Industry, // clear_tile_proc
GetAcceptedCargo_Industry, // get_accepted_cargo_proc
GetTileDesc_Industry, // get_tile_desc_proc
GetTileTrackStatus_Industry, // get_tile_track_status_proc
ClickTile_Industry, // click_tile_proc
AnimateTile_Industry, // animate_tile_proc
TileLoop_Industry, // tile_loop_proc
ChangeTileOwner_Industry, // change_tile_owner_proc
GetProducedCargo_Industry, // get_produced_cargo_proc
NULL, // vehicle_enter_tile_proc
GetFoundation_Industry, // get_foundation_proc
TerraformTile_Industry, // terraform_tile_proc
DrawTile_Industry, /* draw_tile_proc */
GetSlopeZ_Industry, /* get_slope_z_proc */
ClearTile_Industry, /* clear_tile_proc */
GetAcceptedCargo_Industry, /* get_accepted_cargo_proc */
GetTileDesc_Industry, /* get_tile_desc_proc */
GetTileTrackStatus_Industry, /* get_tile_track_status_proc */
ClickTile_Industry, /* click_tile_proc */
AnimateTile_Industry, /* animate_tile_proc */
TileLoop_Industry, /* tile_loop_proc */
ChangeTileOwner_Industry, /* change_tile_owner_proc */
GetProducedCargo_Industry, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
GetFoundation_Industry, /* get_foundation_proc */
TerraformTile_Industry, /* terraform_tile_proc */
};
+11 -11
View File
@@ -85,12 +85,12 @@ static const Widget _build_industry_widgets[] = {
};
/** Window definition of the dynamic place industries gui */
static const WindowDesc _build_industry_desc(
static const WindowDesc _build_industry_desc = {
WDP_AUTO, WDP_AUTO, 170, 212, 170, 212,
WC_BUILD_INDUSTRY, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
_build_industry_widgets
);
_build_industry_widgets,
};
class BuildIndustryWindow : public Window {
int selected_index; ///< index of the element in the matrix
@@ -382,7 +382,7 @@ public:
if (--this->callback_timer == 0) {
/* We have just passed another day.
* See if we need to update availability of currently selected industry */
this->callback_timer = DAY_TICKS; // restart counter
this->callback_timer = DAY_TICKS; //restart counter
const IndustrySpec *indsp = GetIndustrySpec(this->selected_type);
@@ -673,12 +673,12 @@ static const Widget _industry_view_widgets[] = {
};
/** Window definition of the view industy gui */
static const WindowDesc _industry_view_desc(
static const WindowDesc _industry_view_desc = {
WDP_AUTO, WDP_AUTO, 260, 120, 260, 120,
WC_INDUSTRY_VIEW, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_industry_view_widgets
);
_industry_view_widgets,
};
void ShowIndustryViewWindow(int industry)
{
@@ -728,7 +728,7 @@ protected:
/* Constants for sorting stations */
static const StringID sorter_names[];
static GUIIndustryList::SortFunction * const sorter_funcs[];
static GUIIndustryList::SortFunction *const sorter_funcs[];
GUIIndustryList industries;
@@ -985,12 +985,12 @@ const StringID IndustryDirectoryWindow::sorter_names[] = {
/** Window definition of the industy directory gui */
static const WindowDesc _industry_directory_desc(
static const WindowDesc _industry_directory_desc = {
WDP_AUTO, WDP_AUTO, 428, 190, 428, 190,
WC_INDUSTRY_DIRECTORY, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_industry_directory_widgets
);
_industry_directory_widgets,
};
void ShowIndustryDirectory()
{
+21 -67
View File
@@ -5,21 +5,11 @@
#include "stdafx.h"
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
#include "core/mem_func.hpp"
#include "debug.h"
#include "ini_type.h"
#include "string_func.h"
#include "fileio_func.h"
#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 500)
# define WITH_FDATASYNC
# include <unistd.h>
#endif
#ifdef WIN32
# include <shellapi.h>
#endif
IniItem::IniItem(IniGroup *parent, const char *name, size_t len) : next(NULL), value(NULL), comment(NULL)
{
if (len == 0) len = strlen(name);
@@ -74,14 +64,17 @@ IniGroup::~IniGroup()
IniItem *IniGroup::GetItem(const char *name, bool create)
{
for (IniItem *item = this->item; item != NULL; item = item->next) {
IniItem *item;
size_t len = strlen(name);
for (item = this->item; item != NULL; item = item->next) {
if (strcmp(item->name, name) == 0) return item;
}
if (!create) return NULL;
/* otherwise make a new one */
return new IniItem(this, name, strlen(name));
return new IniItem(this, name, len);
}
void IniGroup::Clear()
@@ -104,17 +97,19 @@ IniFile::~IniFile()
IniGroup *IniFile::GetGroup(const char *name, size_t len)
{
IniGroup *group;
if (len == 0) len = strlen(name);
/* does it exist already? */
for (IniGroup *group = this->group; group != NULL; group = group->next) {
for (group = this->group; group != NULL; group = group->next) {
if (!memcmp(group->name, name, len) && group->name[len] == 0) {
return group;
}
}
/* otherwise make a new one */
IniGroup *group = new IniGroup(this, name, len);
group = new IniGroup(this, name, len);
group->comment = strdup("\n");
return group;
}
@@ -150,8 +145,9 @@ void IniFile::LoadFromDisk(const char *filename)
{
assert(this->last_group == &this->group);
char buffer[1024];
char buffer[1024], c, *s, *t, *e;
IniGroup *group = NULL;
IniItem *item = NULL;
char *comment = NULL;
uint comment_size = 0;
@@ -177,12 +173,11 @@ void IniFile::LoadFromDisk(const char *filename)
/* for each line in the file */
while ((size_t)ftell(in) < end && fgets(buffer, sizeof(buffer), in)) {
char c, *s;
/* trim whitespace from the left side */
for (s = buffer; *s == ' ' || *s == '\t'; s++) {}
/* trim whitespace from right side. */
char *e = s + strlen(s);
e = s + strlen(s);
while (e > s && ((c = e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
*e = '\0';
@@ -190,13 +185,14 @@ void IniFile::LoadFromDisk(const char *filename)
if (*s == '#' || *s == ';' || *s == '\0') {
uint ns = comment_size + (e - s + 1);
uint a = comment_alloc;
uint pos;
/* add to comment */
if (ns > a) {
a = max(a, 128U);
do a *= 2; while (a < ns);
comment = ReallocT(comment, comment_alloc = a);
}
uint pos = comment_size;
pos = comment_size;
comment_size += (e - s + 1);
comment[pos + e - s] = '\n'; // comment newline
memcpy(comment + pos, s, e - s); // copy comment contents
@@ -217,7 +213,6 @@ void IniFile::LoadFromDisk(const char *filename)
comment_size = 0;
}
} else if (group) {
char *t;
/* find end of keyname */
if (*s == '\"') {
s++;
@@ -228,7 +223,7 @@ void IniFile::LoadFromDisk(const char *filename)
}
/* it's an item in an existing group */
IniItem *item = new IniItem(group, s, t - s);
item = new IniItem(group, s, t-s);
if (comment_size) {
item->comment = strndup(comment, comment_size);
comment_size = 0;
@@ -263,22 +258,17 @@ void IniFile::LoadFromDisk(const char *filename)
bool IniFile::SaveToDisk(const char *filename)
{
/*
* First write the configuration to a (temporary) file and then rename
* that file. This to prevent that when OpenTTD crashes during the save
* you end up with a truncated configuration file.
*/
char file_new[MAX_PATH];
FILE *f;
IniGroup *group;
IniItem *item;
strecpy(file_new, filename, lastof(file_new));
strecat(file_new, ".new", lastof(file_new));
FILE *f = fopen(file_new, "w");
f = fopen(filename, "w");
if (f == NULL) return false;
for (const IniGroup *group = this->group; group != NULL; group = group->next) {
for (group = this->group; group != NULL; group = group->next) {
if (group->comment) fputs(group->comment, f);
fprintf(f, "[%s]\n", group->name);
for (const IniItem *item = group->item; item != NULL; item = item->next) {
for (item = group->item; item != NULL; item = item->next) {
assert(item->value != NULL);
if (item->comment != NULL) fputs(item->comment, f);
@@ -294,42 +284,6 @@ bool IniFile::SaveToDisk(const char *filename)
}
if (this->comment) fputs(this->comment, f);
/*
* POSIX (and friends) do not guarantee that when a file is closed it is
* flushed to the disk. So we manually flush it do disk if we have the
* APIs to do so. We only need to flush the data as the metadata itself
* (modification date etc.) is not important to us; only the real data is.
*/
#ifdef WITH_FDATASYNC
int ret = fdatasync(fileno(f));
fclose(f);
if (ret != 0) return false;
#else
fclose(f);
#endif
#if defined(WIN32) || defined(WIN64)
/* Allocate space for one more \0 character. */
TCHAR tfilename[MAX_PATH + 1], tfile_new[MAX_PATH + 1];
_tcsncpy(tfilename, OTTD2FS(filename), MAX_PATH);
_tcsncpy(tfile_new, OTTD2FS(file_new), MAX_PATH);
/* SHFileOperation wants a double '\0' terminated string. */
tfilename[MAX_PATH - 1] = '\0';
tfile_new[MAX_PATH - 1] = '\0';
tfilename[_tcslen(tfilename) + 1] = '\0';
tfile_new[_tcslen(tfile_new) + 1] = '\0';
/* Rename file without any user confirmation. */
SHFILEOPSTRUCT shfopt;
MemSetT(&shfopt, 0);
shfopt.wFunc = FO_MOVE;
shfopt.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_SILENT;
shfopt.pFrom = tfile_new;
shfopt.pTo = tfilename;
SHFileOperation(&shfopt);
#else
rename(file_new, filename);
#endif
return true;
}
+4 -12
View File
@@ -20,7 +20,6 @@
#include "functions.h"
#include "newgrf_config.h"
#include "ai/ai_gui.hpp"
#include "gfx_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -107,14 +106,7 @@ public:
#endif /* ENABLE_NETWORK */
switch (widget) {
case SGI_GENERATE_GAME:
if (_ctrl_pressed) {
StartNewGameWithoutGUI(GENERATE_NEW_SEED);
} else {
ShowGenerateLandscape();
}
break;
case SGI_GENERATE_GAME: ShowGenerateLandscape(); break;
case SGI_LOAD_GAME: ShowSaveLoadDialog(SLD_LOAD_GAME); break;
case SGI_PLAY_SCENARIO: ShowSaveLoadDialog(SLD_LOAD_SCENARIO); break;
case SGI_PLAY_HEIGHTMAP: ShowSaveLoadDialog(SLD_LOAD_HEIGHTMAP); break;
@@ -151,12 +143,12 @@ public:
}
};
static const WindowDesc _select_game_desc(
static const WindowDesc _select_game_desc = {
WDP_CENTER, WDP_CENTER, 336, 213, 336, 213,
WC_SELECT_GAME, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_select_game_widgets
);
_select_game_widgets,
};
void ShowSelectGameWindow()
{
+5 -7
View File
@@ -675,7 +675,7 @@ void RunTileLoop()
if (TileX(tile) < MapSizeX() - TILELOOP_SIZE) {
tile += TILELOOP_SIZE; // no overflow
} else {
tile = TILE_MASK(tile - TILELOOP_SIZE * (MapSizeX() / TILELOOP_SIZE - 1) + TileDiffXY(0, TILELOOP_SIZE)); // x would overflow, also increase y
tile = TILE_MASK(tile - TILELOOP_SIZE * (MapSizeX() / TILELOOP_SIZE - 1) + TileDiffXY(0, TILELOOP_SIZE)); /* x would overflow, also increase y */
}
} while (--count != 0);
assert((tile & ~TILELOOP_ASSERTMASK) == 0);
@@ -766,7 +766,7 @@ static void GenerateTerrain(int type, uint flag)
Tile *tile_cur = tile;
for (uint w_cur = w; w_cur != 0; --w_cur) {
if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
if (*p >= tile_cur->type_height) tile_cur->type_height = *p;
p++;
tile_cur++;
}
@@ -779,7 +779,7 @@ static void GenerateTerrain(int type, uint flag)
Tile *tile_cur = tile;
for (uint h_cur = h; h_cur != 0; --h_cur) {
if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
if (*p >= tile_cur->type_height) tile_cur->type_height = *p;
p++;
tile_cur += TileDiffXY(0, 1);
}
@@ -793,7 +793,7 @@ static void GenerateTerrain(int type, uint flag)
Tile *tile_cur = tile;
for (uint w_cur = w; w_cur != 0; --w_cur) {
if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
if (*p >= tile_cur->type_height) tile_cur->type_height = *p;
p++;
tile_cur--;
}
@@ -807,7 +807,7 @@ static void GenerateTerrain(int type, uint flag)
Tile *tile_cur = tile;
for (uint h_cur = h; h_cur != 0; --h_cur) {
if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
if (*p >= tile_cur->type_height) tile_cur->type_height = *p;
p++;
tile_cur -= TileDiffXY(0, 1);
}
@@ -815,8 +815,6 @@ static void GenerateTerrain(int type, uint flag)
} while (--w != 0);
break;
}
FixSlopes();
}
-1
View File
@@ -2,7 +2,6 @@
##ownname Jaybee
##isocode af_ZA
##winlangid 0x0436
##grflangid 0x1b
##plural 0
##gender male
-1
View File
@@ -2,7 +2,6 @@
##ownname Arabic (Egypt)
##isocode ar_EG
##winlangid 0x0c01
##grflangid 0x14
##plural 1
##textdir rtl
-1
View File
@@ -2,7 +2,6 @@
##ownname Português (BR)
##isocode pt_BR
##winlangid 0x0416
##grflangid 0x37
##plural 2
##gender m f
-1
View File
@@ -2,7 +2,6 @@
##ownname Български
##isocode bg_BG
##winlangid 0x0402
##grflangid 0x18
##plural 0
##case m f n p
##gender m f n p
+1 -7
View File
@@ -2,7 +2,6 @@
##ownname Català
##isocode ca_ES
##winlangid 0x0403
##grflangid 0x22
##plural 0
#
@@ -667,6 +666,7 @@ STR_FULL :Complet
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Directori de Poblacions
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Personalitzat
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1197,7 +1197,6 @@ STR_CANT_REMOVE_TRAIN_WAYPOINT :{WHITE}Aquí no
STR_BUILD_AUTORAIL_TIP :{BLACK}Construeix vies de tren utilitzant el mode Autorail
STR_NO_TOWN_IN_SCENARIO :{WHITE}...no hi ha poblacions en aquest escenari
STR_COULD_NOT_CREATE_TOWN :{WHITE}Generació del mapa avortada...{}...no hi ha llocs adequats per als pobles
STR_MANY_RANDOM_TOWNS :{BLACK}Moltes poblacions aleatòries
STR_RANDOM_TOWNS_TIP :{BLACK}Omple el mapa amb poblacions situades aleatòriament
@@ -2129,7 +2128,6 @@ STR_NUM_VERY_LOW :Molt baix
STR_6816_LOW :Baix
STR_6817_NORMAL :Normal
STR_6818_HIGH :Alt
STR_02BF_CUSTOM :Personalitzat
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Molt lent
@@ -3170,9 +3168,6 @@ STR_NEWGRF_BROKEN :{WHITE}El compo
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Canvia la llargada del vehicle pel '{1:ENGINE}' quan no sigui dins del dipòsit.
STR_BROKEN_VEHICLE_LENGTH :{WHITE}El tren '{VEHICLE}' pertanyent a la '{COMPANY}' té una llargada invàlida. Això està causat probablement per problemes amb els NewGRFs. El joc podria desincronitzar-se i/o penjar-se.
STR_NEWGRF_BUGGY :{WHITE}El NewGRF '{0:STRING}' està donant informació incorrecta.
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}La informació de càrrega/remodelació per '{1:ENGINE}' no encaixa amb la llista de compres després de la construcció. Això podria causar un mal funcionament de autorenov/-substitueix.
STR_LOADGAME_REMOVED_TRAMS :{WHITE}El joc s'ha desat en una versió sense suport de tramvies. Tots els tramvies s'han eliminat.
STR_CURRENCY_WINDOW :{WHITE}Moneda personalitzada
@@ -3583,7 +3578,6 @@ STR_AI_RANDOM_AI :IA Aleatòria
STR_AI_SETTINGS_CAPTION :{WHITE}Paràmetres IA
STR_AI_AUTHOR :Autor:
STR_AI_VERSION :Versió:
STR_AI_PLEASE_REPORT_CRASH :{WHITE}Una de les IAs s'ha penjat. Si us plau reporta això a l'autor de la IA amb una captura de pantalla de la finestra de depuració IA.
########
############ town controlled noise level
-1
View File
@@ -2,7 +2,6 @@
##ownname Hrvatski
##isocode hr_HR
##winlangid 0x041a
##grflangid 0x38
##plural 6
##case nom gen dat aku vok lok ins
##gender male female middle
+7 -16
View File
@@ -2,7 +2,6 @@
##ownname Čeština
##isocode cs_CZ
##winlangid 0x0405
##grflangid 0x15
##plural 6
##case nom gen dat acc voc loc ins big small
##gender m f n
@@ -675,7 +674,6 @@ STR_CANNOT_GENERATE_TOWN :{WHITE}Nelze vy
STR_NO_SPACE_FOR_TOWN :{WHITE}... na mapě už není místo.
STR_023B_INCREASE_SIZE_OF_TOWN :{BLACK}Zvetšit velikost města
STR_023C_EXPAND :{BLACK}Rozšířit
STR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}Město nebude stavět silnice. Můžete to změnit přes Pokročilé nastavení->Ekonomika->Města.
STR_023D_RANDOM_TOWN :{BLACK}Náhodné město
STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION :{BLACK}Vybuduj město na nahodné pozici
STR_0285_CAN_T_BUILD_HERE :{WHITE}Nemůžeš zde stavět {STRING} ...
@@ -714,18 +712,18 @@ STR_02A1_SMALL :{BLACK}Malé
STR_02A2_MEDIUM :{BLACK}Středni
STR_02A3_LARGE :{BLACK}Velké
STR_SELECT_TOWN_SIZE_RANDOM :{BLACK}Náhodná
STR_FOUND_TOWN_CITY :{BLACK}Velkoměsto
STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Velkoměsta rostou rychleji než běžná města. V závislosti na nastavení jsou při založení větší
STR_02A4_SELECT_TOWN_SIZE :{BLACK}Zvolte velikost města
STR_FOUND_TOWN_CITY :{BLACK}Město
STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Velkoměsta rostou rychleji než běžná města{}V závislosti na nastavení jsou při založení větší
STR_02A4_SELECT_TOWN_SIZE :{BLACK}Zvol velikost města:
STR_02A5_TOWN_SIZE :{YELLOW}Velikost města:
STR_TOWN_ROAD_LAYOUT :{YELLOW}Silniční síť města:
STR_SELECT_TOWN_ROAD_LAYOUT :{BLACK}Zvolte rozvržení silniční sítě v tomto městě
STR_SELECT_LAYOUT_ORIGINAL :{BLACK}Původní
STR_SELECT_LAYOUT_BETTER_ROADS :{BLACK}Lepší silnice
STR_SELECT_LAYOUT_2X2_GRID :{BLACK}Mřížka 2x2
STR_SELECT_LAYOUT_3X3_GRID :{BLACK}Mřížka 3x3
STR_SELECT_LAYOUT_RANDOM :{BLACK}Náhodná
STR_SELECT_LAYOUT_2X2_GRID :{BLACK}mřížka 2x2
STR_SELECT_LAYOUT_3X3_GRID :{BLACK}mřížka 3x3
STR_SELECT_LAYOUT_RANDOM :{BLACK}Náhodné
STR_02B6 :{STRING} - {STRING}
STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS :{BLACK}Ukázat poslední zprávu nebo článek
@@ -735,6 +733,7 @@ STR_FULL :Plná
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Seznam měst
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Vlastní
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1014,10 +1013,8 @@ STR_CONFIG_SETTING_NONUNIFORM_STATIONS :{LTBLUE}Nejedno
STR_CONFIG_SETTING_FREIGHT_TRAINS :{LTBLUE}Pro simulaci těžkých vlaků vynásobit hmotnost nákladu: {ORANGE}{STRING}x
STR_CONFIG_SETTING_PLANE_SPEED :{LTBLUE}Činitel rychlosti letadel: {ORANGE}1/{STRING}
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :{LTBLUE}Stavba průjezdných zastávek na obecních silnicích: {ORANGE}{STRING}
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :{LTBLUE}Stavba průjezdných zastávek na silnicích vlastněných konkurencí: {ORANGE}{STRING}
STR_CONFIG_SETTING_ADJACENT_STATIONS :{LTBLUE}Povolit stavění přilehlých stanic: {ORANGE}{STRING}
STR_CONFIG_SETTING_DYNAMIC_ENGINES :{LTBLUE}Více grafických setů s vozidly vedle sebe: {ORANGE}{STRING}
STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Toto nastavení nemůže být změněno, když jsou ve hře již nějaká vozidla.
STR_CONFIG_SETTING_SMALL_AIRPORTS :{LTBLUE}Malá letiště se budou moci stále stavět: {ORANGE}{STRING}
@@ -1265,7 +1262,6 @@ STR_CANT_REMOVE_TRAIN_WAYPOINT :{WHITE}Zde nelz
STR_BUILD_AUTORAIL_TIP :{BLACK}Budovat koleje použitím režimu Autokoleje
STR_NO_TOWN_IN_SCENARIO :{WHITE}... v tomto scénáři není ani jedno město
STR_COULD_NOT_CREATE_TOWN :{WHITE}Generování mapy zrušeno...{}...nebylo možné založit žádné město
STR_MANY_RANDOM_TOWNS :{BLACK}Hodně náhodných měst
STR_RANDOM_TOWNS_TIP :{BLACK}Pokryje krajinu mnoha náhodnými městy
@@ -2197,7 +2193,6 @@ STR_NUM_VERY_LOW :velmi nízké
STR_6816_LOW :nízké
STR_6817_NORMAL :střední
STR_6818_HIGH :vysoké
STR_02BF_CUSTOM :Vlastní
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :velmi nízká
@@ -3244,9 +3239,6 @@ STR_NEWGRF_BROKEN :{WHITE}Chován
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Mění délku vozidla '{1:ENGINE}', které není v depu.
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Vlak '{VEHICLE}' patřící '{COMPANY}' nemá platnou délku. Pravděpodobně to způsobila nějaká grafika. Hra se může desynchronizovat nebo spadnout.
STR_NEWGRF_BUGGY :{WHITE}Grafika '{0:STRING}' poskytuje neplatné informace.
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Informace o nákladu/možnosti přestavby pro '{1:ENGINE}' se po nákupu změnily. To může způsobit problémy při automatické výměně vozidel.
STR_LOADGAME_REMOVED_TRAMS :{WHITE}Hra byla uložena ve verzi bez podpory tramvají. Všechny tramvaje se odstraní.
STR_CURRENCY_WINDOW :{WHITE}Vlastní měna
@@ -3657,7 +3649,6 @@ STR_AI_RANDOM_AI :Náhodná AI
STR_AI_SETTINGS_CAPTION :{WHITE}Parametery AI
STR_AI_AUTHOR :Autor:
STR_AI_VERSION :Verze:
STR_AI_PLEASE_REPORT_CRASH :{WHITE}Některá z bežících AI skončila s chybou. Prosím oznamte toto autorovi AI spolu se screenshotem okna Ladění AI.
########
############ town controlled noise level
+1 -7
View File
@@ -2,7 +2,6 @@
##ownname Dansk
##isocode da_DA
##winlangid 0x0406
##grflangid 0x2d
##plural 0
#
@@ -666,6 +665,7 @@ STR_FULL :Fuld
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Byoversigt
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Brugerdefineret
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -2123,7 +2123,6 @@ STR_NUM_VERY_LOW :Meget lav
STR_6816_LOW :Lav
STR_6817_NORMAL :Normal
STR_6818_HIGH :Høj
STR_02BF_CUSTOM :Brugerdefineret
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Meget langsom
@@ -3164,7 +3163,6 @@ STR_NEWGRF_BROKEN :{WHITE}Denne Ne
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Den ændrer toglængden for '{1:ENGINE}' mens den ikke er i depot.
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Toget '{VEHICLE}' fra firmaet '{COMPANY}' har ugyldig længde. Det skyldes sandsynligvis at problem med en NewGRF. Spillet går muligvis ned.
STR_LOADGAME_REMOVED_TRAMS :{WHITE}Spillet er gemt i en version uden sporveje. Alle sporveje er blevet fjernet.
STR_CURRENCY_WINDOW :{WHITE}Brugerdefineret møntfod
@@ -3549,10 +3547,6 @@ STR_OSK_KEYBOARD_LAYOUT_CAPS :~!@#$%^&*()_+|Q
########
############ AI GUI
STR_AI_CLOSE :{BLACK}Luk
STR_AI_RESET :{BLACK}Nulstil
STR_AI_AUTHOR :Skaber:
STR_AI_VERSION :Version:
########
############ town controlled noise level
+2 -3
View File
@@ -2,7 +2,6 @@
##ownname Nederlands
##isocode nl_NL
##winlangid 0x0413
##grflangid 0x1f
##plural 0
#
@@ -667,6 +666,7 @@ STR_FULL :Volledig
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Stedenlijst
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Aangepast
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1685,7 +1685,7 @@ STR_200B_CENTER_THE_MAIN_VIEW_ON :{BLACK}Centreer
STR_200C_CHANGE_TOWN_NAME :{BLACK}Hernoem plaats
STR_200D_PASSENGERS_LAST_MONTH_MAX :{BLACK}Passagiers afgelopen maand: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA}
STR_200E_MAIL_LAST_MONTH_MAX :{BLACK}Post afgelopen maand: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA}
STR_CARGO_FOR_TOWNGROWTH :{BLACK}Vracht nodig voor groei dorp:
STR_CARGO_FOR_TOWNGROWTH :{BLACK}Goederen nodig om het dorp te laten groeien:
STR_CARGO_FOR_TOWNGROWTH_REQUIRED :{SETX 20}{ORANGE}{STRING}{BLACK} nodig
STR_CARGO_FOR_TOWNGROWTH_LAST_MONTH :{SETX 20}{ORANGE}{CARGO}{BLACK} afgelopen maand afgeleverd
STR_200F_TALL_OFFICE_BLOCK :Hoog kantoorgebouw
@@ -2128,7 +2128,6 @@ STR_NUM_VERY_LOW :Erg laag
STR_6816_LOW :Laag
STR_6817_NORMAL :Normaal
STR_6818_HIGH :Hoog
STR_02BF_CUSTOM :Aangepast
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Erg langzaam
+1 -7
View File
@@ -2,7 +2,6 @@
##ownname English (UK)
##isocode en_GB
##winlangid 0x0809
##grflangid 0x01
##plural 0
#
@@ -667,6 +666,7 @@ STR_FULL :Full
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Town directory
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Custom
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1197,7 +1197,6 @@ STR_CANT_REMOVE_TRAIN_WAYPOINT :{WHITE}Can't re
STR_BUILD_AUTORAIL_TIP :{BLACK}Build railway track using the Autorail mode
STR_NO_TOWN_IN_SCENARIO :{WHITE}...there is no town in this scenario
STR_COULD_NOT_CREATE_TOWN :{WHITE}Map generation aborted...{}...no suitable town locations
STR_MANY_RANDOM_TOWNS :{BLACK}Many random towns
STR_RANDOM_TOWNS_TIP :{BLACK}Cover the map with randomly placed towns
@@ -2129,7 +2128,6 @@ STR_NUM_VERY_LOW :Very low
STR_6816_LOW :Low
STR_6817_NORMAL :Normal
STR_6818_HIGH :High
STR_02BF_CUSTOM :Custom
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Very Slow
@@ -3170,9 +3168,6 @@ STR_NEWGRF_BROKEN :{WHITE}Behaviou
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}It changes vehicle length for '{1:ENGINE}' when not inside a depot.
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Train '{VEHICLE}' belonging to '{COMPANY}' has invalid length. It is probably caused by problems with NewGRFs. Game may desync or crash.
STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:RAW_STRING}' provides incorrect information.
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Cargo/refit information for '{1:ENGINE}' differs from purchase list after construction. This might cause autorenew/-replace to fail refitting correctly.
STR_LOADGAME_REMOVED_TRAMS :{WHITE}Game was saved in version without tram support. All trams have been removed.
STR_CURRENCY_WINDOW :{WHITE}Custom currency
@@ -3583,7 +3578,6 @@ STR_AI_RANDOM_AI :Random AI
STR_AI_SETTINGS_CAPTION :{WHITE}AI Parameters
STR_AI_AUTHOR :Author:
STR_AI_VERSION :Version:
STR_AI_PLEASE_REPORT_CRASH :{WHITE}One of the running AIs crashed. Please report this to the AI author with a screenshot of the AI Debug Window.
########
############ town controlled noise level
+1 -3
View File
@@ -2,7 +2,6 @@
##ownname English (US)
##isocode en_US
##winlangid 0x0409
##grflangid 0x00
##plural 0
#
@@ -667,6 +666,7 @@ STR_FULL :Full
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Town directory
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Custom
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1197,7 +1197,6 @@ STR_CANT_REMOVE_TRAIN_WAYPOINT :{WHITE}Can't re
STR_BUILD_AUTORAIL_TIP :{BLACK}Build railroad track using the Autorail mode
STR_NO_TOWN_IN_SCENARIO :{WHITE}...there is no town in this scenario
STR_COULD_NOT_CREATE_TOWN :{WHITE}Map generation aborted...{}...no suitable town locations
STR_MANY_RANDOM_TOWNS :{BLACK}Many random towns
STR_RANDOM_TOWNS_TIP :{BLACK}Cover the map with randomly placed towns
@@ -2129,7 +2128,6 @@ STR_NUM_VERY_LOW :Very low
STR_6816_LOW :Low
STR_6817_NORMAL :Normal
STR_6818_HIGH :High
STR_02BF_CUSTOM :Custom
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Very Slow
-1
View File
@@ -2,7 +2,6 @@
##ownname Esperanto
##isocode eo_EO
##winlangid 0x0000
##grflangid 0x05
##plural 0
##case n
-1
View File
@@ -2,7 +2,6 @@
##ownname Eesti keel
##isocode et_ET
##winlangid 0x0425
##grflangid 0x34
##plural 0
##case g in
+1 -7
View File
@@ -2,7 +2,6 @@
##ownname Suomi
##isocode fi_FI
##winlangid 0x040b
##grflangid 0x35
##plural 0
#
@@ -667,6 +666,7 @@ STR_FULL :Täysi
STR_02BA :{SILVER}- - {COMPANY} - -
STR_02BB_TOWN_DIRECTORY :Kaupunkihakemisto
STR_02BD :{BLACK}{STRING}
STR_02BF_CUSTOM :Oma
STR_CHECKMARK :{CHECKMARK}
############ range for menu starts
@@ -1197,7 +1197,6 @@ STR_CANT_REMOVE_TRAIN_WAYPOINT :{WHITE}Junien r
STR_BUILD_AUTORAIL_TIP :{BLACK}Rakenna rautatiet käyttäen Autorail-tilaa.
STR_NO_TOWN_IN_SCENARIO :{WHITE}...tässä skenaariossa ei ole kaupunkeja.
STR_COULD_NOT_CREATE_TOWN :{WHITE}Kartan generointi peruutettu...{}...ei kelvollisia kaupunkien sijainteja
STR_MANY_RANDOM_TOWNS :{BLACK}Monta satunnaista kaupunkia
STR_RANDOM_TOWNS_TIP :{BLACK}Peitä kartta satunnaisesti sijoitetuilla kaupungeilla.
@@ -2129,7 +2128,6 @@ STR_NUM_VERY_LOW :Erittäin alhai
STR_6816_LOW :Matala
STR_6817_NORMAL :Normaali
STR_6818_HIGH :Korkea
STR_02BF_CUSTOM :Oma
STR_6819 :{BLACK}{SMALLLEFTARROW}
STR_681A :{BLACK}{SMALLRIGHTARROW}
STR_681B_VERY_SLOW :Hyvin hidas
@@ -3170,9 +3168,6 @@ STR_NEWGRF_BROKEN :{WHITE}NewGRF:n
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Se muuttaa kulkuneuvon '{1:ENGINE}' pituutta, kun se ei ole varikolla.
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Yhtiölle '{1:COMPANY}' kuuluvan junan '{0:VEHICLE}' pituus on virheellinen. Tämä johtuu luultavasti NewGRF:ien ongelmista. Peli saattaa nykiä tai kaatua.
STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' antaa väärää tietoa.
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Rahti/uudelleensovitus tiedot kulkuneuvolle '{1:ENGINE}' ovat eri kuin ostolistassa rakentamisen jälkeen. Tämä voi aiheuttaa, että kulkuneuvon korvaus ei uudelleensovita oikein.
STR_LOADGAME_REMOVED_TRAMS :{WHITE}Peli tallennettiin versiossa, joka ei tue raitiovaunuja. Kaikki raitiovaunut on poistettu.
STR_CURRENCY_WINDOW :{WHITE}Oma valuutta
@@ -3583,7 +3578,6 @@ STR_AI_RANDOM_AI :Sattumanvaraine
STR_AI_SETTINGS_CAPTION :{WHITE}Tekoälyn parametrit
STR_AI_AUTHOR :Tekijä:
STR_AI_VERSION :Versio:
STR_AI_PLEASE_REPORT_CRASH :{WHITE}Yksi käynnissä olevista tekoälyistä kaatui. Ole hyvä ja kerro tästä tekoälyn tekijälle, sekä ota kuvankaappaus Tekoalyn Virheenkorjaus ikkunasta.
########
############ town controlled noise level

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