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

Compare commits

...

680 Commits

Author SHA1 Message Date
rubidium
7a2dd974eb (svn r12526) -Fix: determining the version failed on Windows. 2008-03-31 22:51:39 +00:00
rubidium
9827f05300 (svn r12525) -Release: the April Fools' edition of OpenTTD. 2008-03-31 22:31:33 +00:00
rubidium
1a495b0b1c (svn r12524) [0.6] -Update: some documentation. 2008-03-31 22:09:27 +00:00
rubidium
5294075ad4 (svn r12523) [0.6] -Backport from trunk (r12486): wrong copy right data in Windows binaries. 2008-03-31 21:46:15 +00:00
rubidium
ed4ae53e8a (svn r12485) [0.6] -Backport: from trunk (r12483, disabling of stripping for betas and RCs). 2008-03-30 15:20:30 +00:00
rubidium
c53f9fc2a2 (svn r12481) [0.6] -Backport r12480 from trunk (default enabling of assertions). 2008-03-28 21:42:47 +00:00
rubidium
cbd426059e (svn r12478) [0.6] -Backport from trunk (12477, 12453, 12448, 12443, 12439, 12417):
- Fix: Timetable times for aircraft were always doubled [FS#1883] (r12477)
- Fix: Remove broken endian-dependent code and unnecessary rgb to bgr swapping [FS#1880] (r12453)
- Change: Unify RPM spec files (r12448)
- Add: OpenTTD's version to the config file to 'ease' getting the correct version on bugreports (r12443)
- Fix: Do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection) [FS#1871] (r12439)
- Fix: Plural rule for Icelandic was wrong (r12417)
2008-03-28 19:01:57 +00:00
rubidium
624549464f (svn r12465) [0.6] -Fix: for the 0.6.x releases we shouldn't say we're 0.7.0~svn. 2008-03-28 11:51:58 +00:00
belugas
1f9dce4697 (svn r12432) [0.6] -Change: Update documentation for release of RC1 2008-03-26 15:24:34 +00:00
glx
185c30b6bf (svn r12418) [0.6] -Backport from trunk (r12408):
- Language updates (r12408)
2008-03-25 18:34:49 +00:00
glx
8df7a53652 (svn r12416) [0.6] -Backport from trunk (r12399, r12401):
- Fix: loading of TTD savegames (r12399, r12401)
2008-03-25 14:53:59 +00:00
rubidium
9d47454105 (svn r12395) [0.6] -Branch: the long awaited branch so we can introduce new features in trunk before 0.6.0, but not let them destabalize the pending release :) 2008-03-22 19:48:14 +00:00
rubidium
f65b925744 (svn r12394) -Fix: make the style of the changelog more uniform. 2008-03-22 16:24:36 +00:00
rubidium
4094e9b495 (svn r12393) -Fix [FS#1872]: Vehicle lists related to stations not closed when the station is deleted. 2008-03-22 16:23:47 +00:00
maedhros
389d89ea49 (svn r12392) -Fix (r12391): Remove yapf/follow_track.cpp again. 2008-03-22 11:29:03 +00:00
maedhros
292cfc56f6 (svn r12391) -Feature: Show whether a town is a "city" in the town description title bar. 2008-03-22 11:27:46 +00:00
rubidium
f0538b4b62 (svn r12390) -Fix [FS#1851]: trams failing to turn on bridge heads/tunnel entrances. 2008-03-22 10:56:08 +00:00
rubidium
5d747802f2 (svn r12389) -Codechange: remove unneeded code from the Cheat window handling and bring it in line with the coding guidelines. 2008-03-22 10:50:50 +00:00
maedhros
9dffdaca0d (svn r12388) -Fix (r12352): Callback 14 (station sprite layout) is a 15-bit callback. 2008-03-21 11:10:36 +00:00
miham
55dcd4f94d (svn r12387) -Update: WebTranslator2 update to 2008-03-21 00:20:05
german     - 1 fixed by moewe2 (1)
icelandic  - 346 fixed by scrooge (346)
korean     - 2 fixed by darkttd (2)
portuguese - 6 fixed by nars (6)
russian    - 15 fixed by Smoky555 (15)
slovenian  - 6 fixed by Necrolyte (6)
2008-03-20 23:20:46 +00:00
smatz
ac4ec8c2d2 (svn r12386) -Fix [FS#1841](r2428): train could break apart when reversed while partially in a depot 2008-03-19 20:50:19 +00:00
ab7542e912 (svn r12385) -Fix [FS#ln]: Non-breaking spaces should not be broken. 2008-03-19 20:46:56 +00:00
smatz
031c9da01c (svn r12384) -Fix (r2428): do not disconnect train when reversing, it may 'think' it is whole in a depot 2008-03-19 20:42:05 +00:00
d27ab363a7 (svn r12383) -Fix [FS#1860]: Check return of AfterLoadGame for success or failure when loading TTD games. 2008-03-18 23:01:33 +00:00
glx
faa1483ee6 (svn r12382) -Fix [FS#1864]: use 'items' unit for batteries, fizzy drinks, toys and bubbles in total cargo tab 2008-03-18 16:57:05 +00:00
skidd13
a887b79f90 (svn r12381) -Fix [FS1835] [FS1535] (r11855): The number of houses wasn't computed right. A few other things regaring the updating had to be changed. Big thanks for support to frosch123 and SmatZ, to name just a few. (Inspired by a patch of bilbo) 2008-03-18 12:28:21 +00:00
glx
985dbaa093 (svn r12380) -Fix: update train acceleration and max speed after setting cached value to ensure the correct max speed is used with disabled real acceleration 2008-03-17 22:13:00 +00:00
glx
fbf70d53ec (svn r12379) -Codechange: removed now redondant InvalidateWindow() calls 2008-03-17 22:04:15 +00:00
glx
2b86efea74 (svn r12378) -Fix: refresh vehicle details window when cached values are updated 2008-03-17 21:50:53 +00:00
glx
e2ec1e7032 (svn r12377) -Fix [FS#1854]: set cached value for vehicle property 25 before other cached values 2008-03-17 21:49:14 +00:00
glx
a6cba39750 (svn r12375) -Fix [FS#1847]: revision detection failed to detect 64bit TortoiseSVN when ran from a 32bit MSVC on win64 system (Jafinto) 2008-03-15 22:43:28 +00:00
e27de79990 (svn r12374) -Fix (r11892): Don't close a dropmenu when clicking on a dropdown widget 2008-03-15 21:35:48 +00:00
glx
013d7db19f (svn r12373) -Fix [FS#1849]: win32 music driver fails if path is too long (128 chars is too much for mci it seems), so retry using the short path name (8.3 style) if available 2008-03-15 21:20:40 +00:00
glx
1abd2bd700 (svn r12372) -Fix: win32 music driver fails if path contains non-latin chars 2008-03-15 21:12:08 +00:00
smatz
756e0d9b6e (svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen 2008-03-15 20:32:42 +00:00
058724b768 (svn r12370) -Fix [FS#1853]: Close language drop down when parent window is clicked/closed. 2008-03-15 19:50:06 +00:00
smatz
89e9bbfa98 (svn r12369) -Fix (r1681): reset train speed limits when _patches.realistic_acceleration changes 2008-03-15 19:24:13 +00:00
smatz
bfae49aeb2 (svn r12368) -Codechange: use explicit body for loops and conditions and remove -Wno-empty-body from the configure script 2008-03-15 13:21:31 +00:00
smatz
5db7288ea9 (svn r12367) -Fix [FS#1650](r707): commands were sent to clients waiting for map download causing 'executing command from the past' error 2008-03-15 00:31:10 +00:00
glx
f8bae50bf5 (svn r12366) -Codechange: use MAX_PATH instead hardcoded value 2008-03-14 18:31:37 +00:00
skidd13
9a96f89646 (svn r12365) -Fix: missing redraw call in the road gui 2008-03-13 18:53:49 +00:00
d205e53392 (svn r12364) -Fix (r12361): Case attribute for brazilian_portuguese got lost. 2008-03-12 20:03:21 +00:00
smatz
902320d7cb (svn r12363) -Fix: do not allow building 'zero' road bits 2008-03-12 18:10:45 +00:00
frosch
84385f187b (svn r12362) -Fix (r11985, r12006): Randomize variable 8F only once per callback 28. 2008-03-12 15:56:56 +00:00
miham
761224a4f6 (svn r12361) -Update: WebTranslator2 update to 2008-03-12 09:46:45
brazilian_portuguese - 2 fixed by fukumori (2)
bulgarian  - 3 fixed, 1 changed by kokobongo (3), thetitan (1)
catalan    - 2 fixed by arnaullv (2)
czech      - 2 fixed by Hadez (2)
danish     - 15 fixed by ThomasA (15)
dutch      - 2 fixed, 1 changed by habell (3)
estonian   - 2 fixed by kristjans (2)
french     - 2 fixed by glx (2)
german     - 15 fixed, 1 changed by moewe2 (16)
italian    - 2 fixed by lorenzodv (2)
portuguese - 9 fixed, 6 changed by nars (15)
slovak     - 2 fixed by lengyel (2)
slovenian  - 9 fixed by Necrolyte (9)
spanish    - 2 fixed, 2 changed by eusebio (4)
turkish    - 22 fixed by jnmbk (22)
ukrainian  - 2 fixed, 18 changed by mad (20)
2008-03-12 08:47:44 +00:00
glx
7056428d15 (svn r12360) -Fix: openttdd.grf was using the wrong colours for glyphs due to a grfcodec bug (fixed in grfcodec 0.9.10 r1837) 2008-03-12 01:49:21 +00:00
frosch
ec59843136 (svn r12358) -Fix: Callback 2F returns 15 bit results starting from grf version 7. 2008-03-11 12:55:41 +00:00
frosch
51bbf0c84f (svn r12352) -Fix: Some callback-results were treated as 8 bit, when they were 15 bit, and vice versa.
Var 0x7E procedure-results are always 15 bit.
  Callbacks 0x2A, 0x2C, 0x36 (sometimes), 0x39 and 0x145 are 15 bit.
  Non-varaction2-calculated callback-results are also affected by the 8bit masking.
2008-03-10 15:31:07 +00:00
glx
220b2a1ae1 (svn r12350) -Fix [FS#1836](r11947): do not try ti flood water tile (performance increase) 2008-03-08 18:32:01 +00:00
belugas
82e340c325 (svn r12349) -Change[FS#1826]: Remove the need to include the afxres.h header when all that was needed was just the definition if IDC_STATIC.
Only valid for MSVC compilers.
2008-03-07 02:40:10 +00:00
smatz
2c74f39273 (svn r12348) -Fix (r7573): NTP skipped junction just after bridge end 2008-03-07 00:47:42 +00:00
frosch
08f0179916 (svn r12347) -Feature(ette): Increase house animation frame number from 32 to 128. 2008-03-06 14:21:10 +00:00
frosch
8f556828f0 (svn r12346) -Fix [FS#1748, FS#1825](r9874, r11872): Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP. 2008-03-06 10:39:26 +00:00
glx
1976d2d37c (svn r12345) -Fix [FS#1828](r12296): don't try to restore backupped timetable when timetabling is disabled 2008-03-05 22:05:22 +00:00
skidd13
442efcffb0 (svn r12344) -Codechange: Check uint64 bitsize on compiletime too. 2008-03-05 18:51:26 +00:00
b4a51cd28d (svn r12343) -Fix (r12293): Slow helicopters never got the 'chance' to finish the landing routine. 2008-03-05 18:33:31 +00:00
belugas
cd411ab75a (svn r12342) -Fix(r12340): In order to avoid confusion, SIGN should be used for signs and SIGNAL for signals :)
Always check your terms with your nearest british ;)
2008-03-05 11:41:26 +00:00
f08cf32216 (svn r12341) -Fix (r11224) [FS#1827]: GRM buffer for cargos was incorrect size. 2008-03-05 09:37:43 +00:00
belugas
a6ee46a5a0 (svn r12340) -Codechange: Remove some magic numbers (sprite IDs here) with some more meaningful values.
This allows to remove an unnecessary subtraction in the MAYBE_DAW_SIGNAL macro, who was waiting for an offset, at the first place.
2008-03-05 02:49:06 +00:00
bc8ad5c743 (svn r12339) -Fix (r12331): Recalculate cached train data after clearing reversing flag when entering depot. 2008-03-04 21:49:40 +00:00
belugas
266dd80f6c (svn r12337) -Change: update some documentation. 2008-03-04 17:07:33 +00:00
9674ff71de (svn r12336) -Fix [FS#1733]: Don't pause/unpause the game when showing load/save windows when the game is paused due to missing GRFs. 2008-03-04 12:15:33 +00:00
3907ac518b (svn r12335) -Codechange: Don't stuff signed values into a unsigned variable when the variable can just be unsigned... 2008-03-04 12:14:34 +00:00
e1cc80b01c (svn r12334) -Codechange: Don't change road owner without DC_EXEC. Didn't affect anything in this case but is bad form. 2008-03-04 12:13:15 +00:00
frosch
6e3ae628fc (svn r12333) -Fix: Switch grfstatus from 'activated' back to 'will-be-active' between reservation- and activation-stage.
This fixes action7/9 conditions 0x06 to 0x0A to return the same in those two stages.
2008-03-04 10:41:16 +00:00
6bb37edfb6 (svn r12332) -Fix (r12331): Invalidate cached data and update image after setting flag. 2008-03-03 21:42:37 +00:00
glx
b64f637c72 (svn r12331) -Feature: [NewGRF] vehicle variable FE bit 8 2008-03-03 20:56:30 +00:00
glx
cf0e6d4cb4 (svn r12330) -Feature: [NewGRF] vehicle variable FE bit 5 and 6 2008-03-03 20:41:47 +00:00
5049fbb081 (svn r12329) -Fix [FS#1819]: Disallow building level crossings over one-way roads as this allowed competitors to remove the one-way state. 2008-03-03 19:15:53 +00:00
belugas
56ed79e448 (svn r12328) -Fix(r3447): Wrong Y pillar specified for girder with arch bridge. Spotted and fixed by a lot of people ;) 2008-03-03 18:20:42 +00:00
smatz
620695587d (svn r12324) -Fix (r6789): vehicles could be sorted in a wrong order when a vehicle name changed - cached name was not invalidated 2008-03-02 00:25:54 +00:00
smatz
8dacca9a71 (svn r12323) -Fix [FS#1821](r6789): vehicle sorting by name was broken, it was comparing two the same strings (when caching was not used) 2008-03-01 23:53:58 +00:00
glx
c4e023bd6e (svn r12322) -Fix (r9874): endian issue when saving/loading group owner 2008-02-29 22:55:57 +00:00
glx
9973b7fb64 (svn r12321) -Change: update readme about where openttd looks for files (based on dih work) 2008-02-29 22:01:47 +00:00
f87b1df566 (svn r12320) -Fix [FS#1817]: Wrong transparency options could be saved after toggling all. 2008-02-29 15:20:02 +00:00
3bba6e4abd (svn r12319) -Cleanup: Comment fixes (Roujin) 2008-02-29 13:57:50 +00:00
9ccce57438 (svn r12317) -Fix [FS#1815]: Map string IDs that are embedded from other strings. 2008-02-29 08:48:01 +00:00
6bdc8e5fae (svn r12316) -Codechange: Support loading full range of 0xD0xx NewGRF strings which
includes 0xD000 to 0xD3FF (yes, 0xD0xx makes a lot of sense, really...) 
and handle 0xD400 to 0xD7FF strings which map to 0xD000 to 0xD3FF 
(obviously).
2008-02-29 08:40:49 +00:00
034649e7f5 (svn r12314) -Fix (r4896): Include prop 25 data for all train parts, not just those that carry cargo. 2008-02-28 21:44:13 +00:00
frosch
35fd0dfd4e (svn r12313) -Fix: YAPF and NTP did not apply penalty for uphill tracks on steep slopes. 2008-02-28 17:34:34 +00:00
glx
86a4d377b1 (svn r12304) -Codechange: use IsValidTile() where it should be used 2008-02-28 00:17:49 +00:00
glx
35195bb2bc (svn r12303) -Codechange: move IsValidTile() in a more suitable place and make it static inline 2008-02-28 00:10:08 +00:00
glx
459fd42e1d (svn r12296) -Fix [FS#1549]: restore timetable from backupped orders and add group ID to the backup 2008-02-27 21:46:57 +00:00
6aea2454c8 (svn r12295) -Codechange: Make plane speed option available to NewGRFs 2008-02-27 21:33:52 +00:00
926f5d548d (svn r12293) -Feature: Ability to change aircraft speed factor, from so
called 'realistic' (matching other vehicles) (1/1) to original TTD 
speed (1/4). Note this option defaults to original TTD speed.
2008-02-27 21:07:12 +00:00
belugas
8f47b642b6 (svn r12290) -Fix[FS#1807]: Do not draw trees nor lamps between tram tracks.(Roujin) 2008-02-27 15:35:24 +00:00
belugas
46a3508f50 (svn r12289) -Fix(r12288)[FS#1808]: Wrong bridge head table associated 2008-02-27 14:55:16 +00:00
belugas
202f1046f6 (svn r12288) -Fix(r12287): forgot to include two sprite renames out of consistency.
And obviously forgot to compile before committing, as the array rename would have been evident.
2008-02-27 04:26:25 +00:00
belugas
7c14dedeb6 (svn r12287) -Codechange: Give meaning to two other bridges sprites arrays.
A bit of re-indenting too
2008-02-27 04:00:25 +00:00
glx
92254bda01 (svn r12282) -Fix (r12123): generate.vbs should not skip files in NO_THREADS section of source.list 2008-02-26 22:32:27 +00:00
belugas
7e74fca7d8 (svn r12272) -Codechange: A bit of code style fixes (tabs instead of spaces), one space too many before macro definition and rename marco MB (MakeBridge) for MBR(MakeBRidge) 2008-02-26 18:24:46 +00:00
glx
68aaeec3a8 (svn r12269) -Fix: [Win32] don't create save dir on install 2008-02-26 15:31:48 +00:00
belugas
0a92b3366c (svn r12263) -Codechange: Give meaning to the concrete bridge sprites arrays.
Add macro MR (PALETTE_TO_STRUCT_RED) for easier viewing.
Still more to come.
2008-02-26 03:35:44 +00:00
belugas
3764aa5134 (svn r12262) -Codechange: Give meaning to the wooden bridge sprites arrays.
Add macro MN for easier viewing.
More to come.
2008-02-26 00:06:21 +00:00
glx
62d9bf8d0f (svn r12261) -Fix [FS#1805]: autoreplace did not update vehicle index for timetable window 2008-02-25 23:12:55 +00:00
glx
4a4be744b6 (svn r12258) -Fix: GetProductionAroundTiles() may fail if only the second production slot exists 2008-02-25 16:30:12 +00:00
KUDr
e41df385d7 (svn r12252) -Fix [FS#1801]: Broken FollowTrack_t related functions (thanks michi_cc).
-Fixed by removing FollowTrack_t structure and all related functions. Their purpose was to allow to call track followers from C code. They were:
  1. never used
  2. obsoleted by switching to C++
2008-02-25 15:09:22 +00:00
frosch
93b3a66678 (svn r12247) -Fix (r9315): Town variables 0x9E to 0xAD (company ratings) returned wrong values. 2008-02-25 13:48:23 +00:00
frosch
c2f3e0e326 (svn r12246) -Fix (r10460): Proper usage of Clamp(). 2008-02-25 13:38:11 +00:00
smatz
27284db36f (svn r12244) -Fix (r12150): typo resulting in no players are given the engine preview offer 2008-02-25 02:09:04 +00:00
glx
f352512c8d (svn r12239) -Fix [FS#1800] (r9729): inverted comments for SetRailType() and GetTrackBits() (michi_cc) 2008-02-24 22:20:31 +00:00
glx
ed1e402960 (svn r12238) -Change [FS#1800]: set svn:executable property for *.vbs (michi_cc) 2008-02-24 22:16:36 +00:00
glx
747f57bcec (svn r12234) -Fix [FS#1798]: Mac OSX bundle display name should be 'OpenTTD' (oVRoM) 2008-02-24 21:47:02 +00:00
bjarni
8290a798fc (svn r12231) -Cleanup (r12230): [autoreplace] moved Vehicle::NeedsAutorenewing() and added comments 2008-02-23 22:23:06 +00:00
bjarni
089969e1ca (svn r12230) -Codechange: [autoreplace] made a function to detect if a vehicle needs autorenewing
This will remove duplicated code and ensure that the check is consistent
2008-02-23 22:01:55 +00:00
miham
e821b3a9b8 (svn r12218) -Update: WebTranslator2 update to 2008-02-23 12:39:10
brazilian_portuguese - 13 fixed, 51 changed by fukumori (64)
bulgarian  - 12 fixed by thetitan (12)
catalan    - 13 fixed by arnaullv (13)
czech      - 13 fixed, 8 changed by Hadez (21)
dutch      - 13 fixed by habell (13)
estonian   - 13 fixed, 3 changed by kristjans (16)
french     - 13 fixed, 20 changed by glx (33)
hungarian  - 13 fixed by miham (13)
italian    - 13 fixed, 8 changed by lorenzodv (21)
japanese   - 13 fixed by ickoonite (13)
korean     - 14 fixed by leejaeuk5 (14)
portuguese - 2 fixed by nars (2)
slovak     - 13 fixed by lengyel (13)
slovenian  - 1 fixed by Necrolyte (1)
spanish    - 13 fixed by eusebio (13)
swedish    - 1 fixed by ChrillDeVille (1)
ukrainian  - 13 fixed, 1 deleted, 124 changed by mad (138)
2008-02-23 11:42:41 +00:00
dda6cab17a (svn r12209) -Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, and show running cost of wagons if they have it. 2008-02-21 19:09:10 +00:00
belugas
c0544563a6 (svn r12208) -Codechange: Alignment of params makes the code easier to read. 2008-02-21 16:05:33 +00:00
577b0cc260 (svn r12207) -Change: rail running costs are engine class, not rail type 2008-02-21 14:30:36 +00:00
belugas
1b73417e5f (svn r12206) -Fix: A comma is not a rare resource. Do not hesitate to use it when needed. 2008-02-20 21:08:27 +00:00
79b6b9cb66 (svn r12205) -Codechange: rename RailVehicleInfo::running_cost_base to running_cost, inline with other vehicle types (It is the factor, not the base) 2008-02-20 20:56:54 +00:00
smatz
db9d5a909f (svn r12204) -Fix (r12192): using UINT16_MAX broke compilation on many targets 2008-02-20 19:42:06 +00:00
frosch
1e74834441 (svn r12203) -Fix (r12199): Make trains pay attention to signals again. 2008-02-20 19:37:46 +00:00
e90cf8509a (svn r12202) -Fix: When loading a savegame fails, don't start creating a new game, just go straight back to the intro screen. 2008-02-20 19:37:02 +00:00
smatz
a47b4631ea (svn r12201) -Fix (r12060): compilation warnings - uninitialized variable when compiling with assert disabled 2008-02-20 19:34:53 +00:00
smatz
767e1cc37e (svn r12200) -Fix: force AI to build rail or road instead of bridges if possible, so it doesn't build bridges everywhere 2008-02-20 17:56:36 +00:00
frosch
b7993793c8 (svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus(). 2008-02-20 17:49:50 +00:00
9e65157548 (svn r12198) -Fix [FS#1789]: "Transparent buildings" now only toggles buildings, so show tick when buildings are transparent. 2008-02-20 17:12:08 +00:00
smatz
a190606f2e (svn r12197) -Fix [FS#1788](r12134): show correct last year profit when the train had negative income
-Codechange: use GetDisplayProfitThisYear() to convert vehicle profit to readable form
2008-02-20 17:06:58 +00:00
smatz
e95a85315c (svn r12195) -Fix [FS#1787](r12100): there can be oil rigs at map borders, do not set water class for them 2008-02-20 16:24:56 +00:00
smatz
73a6525129 (svn r12194) -Codechange: apply coding style on enum TrainSubtype 2008-02-20 15:18:35 +00:00
frosch
f5929d413b (svn r12193) -Codechange: Rename a magic variable, give it a decent type, and remove a 'goto'. 2008-02-20 15:13:42 +00:00
smatz
ca46154068 (svn r12192) -Fix: clamp various town variables to 16bit prior to returning the value 2008-02-20 14:30:53 +00:00
frosch
0e9e94a94b (svn r12191) -Fix: Do not start overtaking if the RV reaches wrong-way one-way-road in the next tiles. 2008-02-20 14:07:45 +00:00
smatz
2b8d1bcb51 (svn r12190) -Fix [FS#1786](r8080): YAPF always shows 0ms PF time in debug for debug level 2 (patch by IguannaB) 2008-02-20 12:31:28 +00:00
smatz
169ac7c91d (svn r12189) -Codechange: mark some functions in train_cmd.cpp inline (called once or very short) 2008-02-20 12:07:22 +00:00
smatz
595d9357c3 (svn r12188) -Codechange [FS#1782]: do not check twice for correct rail owner (patch by Vikthor) 2008-02-20 11:00:17 +00:00
belugas
b4b5c09ff9 (svn r12187) -Add: frosch as dev. Last, but not least 2008-02-19 17:52:30 +00:00
smatz
6e9b952623 (svn r12186) -Fix [FS#1784](r12169): assert when trying to play tile sound at NW border of map (placing buyos, leveling land) 2008-02-19 17:45:30 +00:00
smatz
adf1227290 (svn r12185) -Fix (r12177): wrong operator priority, hopefully harmless (spotted by michi_cc) 2008-02-18 23:37:16 +00:00
smatz
578e833284 (svn r12184) -Fix: take into account possible loan when AI is deciding which bridge to build, so it won't build wooden bridges everytime 2008-02-18 22:50:58 +00:00
smatz
0821df8537 (svn r12183) -Codechange: give a better error message when building road over existing road with vehicle on it, or do not fail at all 2008-02-18 22:12:27 +00:00
belugas
0cdf2b525f (svn r12181) -Change: update some documentation. 2008-02-18 20:59:04 +00:00
a4c14fb442 (svn r12180) -Fix: Test purchase list loading/loaded sprites instead of unconditionally returning a possibly non-existant sprite. 2008-02-18 19:20:37 +00:00
smatz
509b3a3247 (svn r12179) -Codechange: use GetCrossingRailTrack() and GetCrossingRailAxis() to improve code readability 2008-02-18 18:35:36 +00:00
smatz
c7a8080c3a (svn r12178) -Codechange: use the 'side' parameter in TrainController and TrainCheckIfLineEnds to simplify the code 2008-02-18 16:35:38 +00:00
smatz
29125c0e68 (svn r12177) -Codechange: use 'side' parameter in GetTileTrackStatus so there can be less checks in pathfinders for depots/stations/tunnels/bridges 2008-02-18 16:11:31 +00:00
smatz
a0a225ab02 (svn r12176) -Codechange: one division less when playing sounds (patch by Dominik) 2008-02-18 14:59:30 +00:00
a0fda5b969 (svn r12175) -Fix (r12174): Ensure the patches window is centred properly. 2008-02-18 13:19:57 +00:00
b3f304cde3 (svn r12174) -Codechange: Make the patches window dynamically resize to the largest patch tab, so adding patch options is simply a case of adding to the lists. 2008-02-18 12:36:10 +00:00
06de1215c1 (svn r12173) -Cleanup: Minor codestyle fixes. 2008-02-18 11:47:53 +00:00
db0eb9570c (svn r12172) -Codechange: Allow buttons to resize in NewGRF settings window 2008-02-18 09:16:02 +00:00
smatz
38969fe46d (svn r12171) -Fix [FS#609]: return correct bridge price for AI when DC_QUERY_COST is set (patch by Raimar Falke)
It never happens in current code, but it is better to be ready for it
2008-02-18 01:42:21 +00:00
smatz
d75cccf5d5 (svn r12170) -Fix: do not draw trees along road and street lights under low bridges (spotted by _minime_) 2008-02-17 21:27:44 +00:00
smatz
6bf44158c5 (svn r12169) -Change [FS#1696]: play sounds when there is only small part of tile/vehicle visible too (original idea by Dominik)
It improves the game appearance when playing with very small screen resolution
2008-02-17 20:15:20 +00:00
smatz
505951e9fa (svn r12168) -Fix: behave a bit better when 'R' is pressed during rail station dragging 2008-02-17 18:19:33 +00:00
smatz
8b56e7544e (svn r12167) -Feature(tte): change colour of autorail and autoroad selection when Ctrl is pressed 2008-02-17 17:00:43 +00:00
smatz
291931bf50 (svn r12166) -Fix [FS#337]: when drag&drop mode was cancelled by keyboard input, depot/group window wasn't updated (original patch by GrimRC) 2008-02-17 12:21:05 +00:00
glx
16e23a75fe (svn r12165) -Fix [FS#1652, FS#1773]: buffer overflow when drawing scrolling news 2008-02-17 00:47:39 +00:00
7394b9d030 (svn r12164) -Fix (r12137, FS#1775]: Variable scope bug crept in 2008-02-16 23:09:33 +00:00
smatz
13781ec11b (svn r12163) -Fix [FS#1705]: if a train is 'stopping' when entering a depot, do not let it leave again 2008-02-16 22:29:30 +00:00
smatz
ebe03109ad (svn r12162) -Fix [FS#1757]: towns shouldn't build over houses owned by another town 2008-02-16 17:54:29 +00:00
smatz
4b7a812e55 (svn r12161) -Fix: towns will no longer build houses > 1x1 there where should be road (with 2x2, 3x3 grid town layouts) 2008-02-16 17:10:14 +00:00
smatz
058f39fe18 (svn r12160) -Fix [FS#1744]: remove the arbitrary limit of 64 waypoints per town, so weird things won't happen anymore 2008-02-16 16:40:47 +00:00
belugas
e7173d3ba4 (svn r12159) -Codechange: Enumify some widget magical numbers
-Cleanup: apply a bit of code style.  Mostly re-indenting switch cases
2008-02-16 03:12:57 +00:00
belugas
245fccf22d (svn r12158) -Codechange: merge all the sprite recolouring mapping under a single function
-Fix: Handle the bridge recolouring mapping as the other features.  Although not specified by the specs, it seems to be implicit.
2008-02-16 03:01:05 +00:00
belugas
b8f8d0ca51 (svn r12157) -Codechange: Remove a structure definition and replace it with another one closely matching
-Codechange: Replace two magic numbers with according sprite names
2008-02-16 02:37:31 +00:00
smatz
b4f58ebae4 (svn r12156) -Fix (r11454): Chance16I was now biased towards zero - round to nearest now 2008-02-16 00:46:38 +00:00
glx
044ca2bbf6 (svn r12155) -Fix (r12154): some warnings (always compile before commit) 2008-02-16 00:10:03 +00:00
glx
3e70ee6ed7 (svn r12154) -Codechange: removed a magic number 2008-02-15 23:57:03 +00:00
smatz
a5f99154b7 (svn r12150) -Fix (r12143): compiler warnings - possible use of uninitialised variable 2008-02-15 21:05:46 +00:00
frosch
a40d761d7f (svn r12149) -Codechange: Merge 'ground_sprite' and 'ground_pal' of DrawTileSprites into one PalSpriteID 2008-02-15 18:40:42 +00:00
frosch
fd0f57a794 (svn r12148) -Codechange: Merge 'image' and 'pal' of DrawTileSeqStruct into one PalSpriteID 2008-02-15 18:34:26 +00:00
frosch
cedca22c60 (svn r12147) -Codechange: Use macros to build DrawTileSprites-tables in station_land and unmovable_land. 2008-02-15 18:21:04 +00:00
frosch
ef354e074f (svn r12146) -Codechange: Use macros to build DrawTileSeqStruct-tables in station_land and unmovable_land. 2008-02-15 18:00:30 +00:00
belugas
65a13a3022 (svn r12145) -Codechange: includes should be at the top of the source file
-Codechange: undefine a defined macro once work is finished, just in case
2008-02-15 17:38:18 +00:00
ac5433a924 (svn r12144) -Codechange: Adjust aircraft slowing algorithm so that very fast
aircraft slow down more rapidly than slower aircraft. This prevents them 
from reaching the end of the runway at high speed, and also stops slow 
aircraft from slowing down too much at the start of the runway.
2008-02-15 13:28:13 +00:00
d1c741db4c (svn r12143) -Fix (r8038): Engine::preview_player does not contain a Player ID. Rename this to preview_player_rank and change back to a uint8 to avoid confusion. 2008-02-15 11:02:50 +00:00
frosch
4164d2488f (svn r12142) -Fix [FS#1766]: Callback 0x3D always gets a cargobit in var 0x18, independent of grf version. 2008-02-15 10:52:10 +00:00
frosch
43c0f7ea8e (svn r12141) -Codechange: Introduce IsNormalRoad[Tile](), IsRoadDepot[Tile]() and HasTileRoadType(); and use them. 2008-02-14 15:59:16 +00:00
belugas
739b118c6b (svn r12140) -Codechange: A bit of code style fixes(Geektoo). 2008-02-14 15:13:36 +00:00
859d768bb7 (svn r12139) -Fix (r12124): The global variable value should be returned, not the variable. 2008-02-14 11:58:36 +00:00
smatz
bb81de3c4c (svn r12138) -Fix: do not allow adding tram to rail-road crossing when there is a vehicle on it 2008-02-14 10:19:16 +00:00
3371d02449 (svn r12137) -Fix [FS#1769]: Show cargo capacity for articulated vehicles correctly in the purchase list. Multiple cargo types can also now been shown. 2008-02-14 07:25:24 +00:00
belugas
539c635efd (svn r12136) -Fix(r12135): Code style compliance and... code style as such 2008-02-14 03:10:22 +00:00
belugas
81b3652f37 (svn r12135) -Codechange: Road and rail bridge selection windows were identical apart the caption. So remove one window definition and set manually the caption accordingly.
-Codechange: prepare the "type" of bridge parameter only once, at the beginning of the selection process.  Makes less magic around.
2008-02-14 02:57:38 +00:00
smatz
a0ddc43e92 (svn r12134) -Change: count the number of ticks a vehicle was running this day to calculate running cost
-Fix [FS#1739]: vehicle profit is now counted with 8bit fract, so it is now shown properly in the vehicle details window
2008-02-13 19:24:40 +00:00
b7cd791988 (svn r12133) -Fix: Vehicle sorting by max speed did not work properly for trains. Instead of trying to work it out again, just use the cached values... 2008-02-13 18:11:19 +00:00
smatz
fd51465c8b (svn r12132) -Cleanup: convert pathfinder selection from if/else to switch/case at many places 2008-02-13 17:54:11 +00:00
smatz
480036254b (svn r12131) -Fix (r3374): with mammoth trains disabled, maximum train length was limited to 9 2008-02-13 16:49:25 +00:00
smatz
0d1e4237cf (svn r12130) -Cleanup (r12129): remove now unused strings from all language files 2008-02-13 14:31:13 +00:00
smatz
507728f46b (svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick) 2008-02-13 14:21:36 +00:00
df7327b453 (svn r12128) -Codechange: Replace last use of TrainPlayLeaveStationSound(v) with v->PlayLeaveStationSound(), and remove wrapper function. 2008-02-13 09:34:56 +00:00
belugas
6bb9c474dd (svn r12127) -Codechange: Use a variable instead of calling the same function a few times. Again. Just a different value. 2008-02-13 03:21:19 +00:00
belugas
c95ff294fb (svn r12126) -Codechange: Use a variable instead of calling the same function a few times 2008-02-13 03:02:02 +00:00
63e306006b (svn r12125) -Codechange: Remove redundant signal lookup table, and document why normal electric signals are handled specially. 2008-02-12 20:14:14 +00:00
frosch
c2bad6d22c (svn r12124) -Codechange: Move newgrf-variables that are common to VarAction2 and Action7/9/D to their own function.
-Fix: Add some variables that were missing in one or both cases.
2008-02-12 15:43:10 +00:00
glx
23bae896c9 (svn r12123) -Add: generate.vbs script to allow project files generation for users unable to run generate bash script 2008-02-12 14:20:55 +00:00
4d0c443953 (svn r12122) -Codechange: Add framework for generic feature callbacks, along with some parts for AI use. 2008-02-12 13:23:57 +00:00
9f6fd72c09 (svn r12121) -Fix [FS#1764]: Drop down item indexes are now an int instead of a byte (Yexo) 2008-02-12 12:54:51 +00:00
592e22cc3a (svn r12120) -Cleanup: const-ify parameters when checking for same cargopacket source. 2008-02-12 11:46:29 +00:00
e76f7c9359 (svn r12119) -Codechange: Rename grfspec_feature to match code style, and expose in header for use elsewhere. 2008-02-12 11:08:47 +00:00
belugas
f4334301e8 (svn r12118) -Codechange: Put the two descriptions of bridges in an array instead of two single variables, following the transport type it represents 2008-02-12 03:05:27 +00:00
glx
b0b929ce42 (svn r12117) -Fix (r12115): strgen compilation was broken 2008-02-12 02:39:22 +00:00
glx
42b305661b (svn r12116) -Fix (r12083): little typos in source.list 2008-02-11 21:01:43 +00:00
smatz
f19eca0905 (svn r12115) -Codechange: move malloc/realloc error messages to separate file to spare 4-8kB of binary size 2008-02-11 20:23:38 +00:00
f175e46208 (svn r12114) -Fix (r12111): missed one Bridge -> BridgeSpec 2008-02-11 19:10:33 +00:00
belugas
cc2b8b574a (svn r12111) -Codechange: Rename Bridge to BridgeSpec, out of consistensy with other Specs in used. 2008-02-11 17:35:15 +00:00
smatz
1011ac353b (svn r12109) -Fix [FS#1745](r8973): use tile index 0 for planes in the air, so it cannot have an invalid tile index 2008-02-11 12:42:49 +00:00
fb6accfcb7 (svn r12108) -Fix [FS#1753]: X/Y axis swap for station tiles in GetNearbyTile() was wrong way around. 2008-02-11 11:21:29 +00:00
belugas
4f0e6ab0ea (svn r12107) -Codechange: Add and use the typedef BridgeType 2008-02-11 04:12:30 +00:00
belugas
d8b3526840 (svn r12106) -Fix(r12105): Kill warnings and raise an error when the transport type is not supported 2008-02-11 03:22:44 +00:00
belugas
9a50fcd281 (svn r12105) -Codechange: Use TransportType instead of guessing what kind of bridge we are preparing to build 2008-02-11 01:06:44 +00:00
smatz
9e0a93d286 (svn r12104) -Fix (r12103): remember loading indicators transparency settings and make in switchable by Ctrl+9 2008-02-10 18:31:33 +00:00
smatz
8a768652c8 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings 2008-02-10 15:53:26 +00:00
maedhros
4e839aacf6 (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin) 2008-02-10 14:49:44 +00:00
smatz
e075cf5500 (svn r12101) -Fix (r12100): there are void tiles at MapMaxX,Y - have to substract one to be on water border tiles 2008-02-10 14:16:25 +00:00
smatz
ad933e1ddb (svn r12100) -Fix (r12042): check for water class of surrounding tiles fails for buoys at map borders 2008-02-10 14:00:52 +00:00
smatz
a86921da41 (svn r12099) -Documentation: add new RailGroundType to landscape.html 2008-02-10 12:01:14 +00:00
smatz
9deab65bae (svn r12098) -Fix: make snow appear on rail tiles dependant on track height, not on height of the lowest part of the tile 2008-02-10 11:35:05 +00:00
glx
efe831934a (svn r12097) -Fix (r654, r1525): loading old, pre savegame version 2, savegames. 2008-02-10 05:21:08 +00:00
smatz
d9af979d6a (svn r12096) -Fix: remove leftover property when loading older savegames 2008-02-09 17:36:21 +00:00
smatz
e3301db213 (svn r12095) -Fix [FS#1703]: when a company bankrupts, remove drive-through road stops, ship depots and buoys too. Update owners of water and road. 2008-02-09 17:30:13 +00:00
smatz
802c949755 (svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes 2008-02-09 15:07:31 +00:00
smatz
221494bd3f (svn r12093) -Fix: do not set station owner for buoys when merging company 2008-02-09 12:20:50 +00:00
belugas
cebb86777a (svn r12092) -Fix(r11532)[FS#1755]: Make sure the production level will not get out of delimited boundaries, while using var result 0D/0E and than multiplying/dividing it.
And use multiply/divide operations instead of shifting.  It does the same, just adds a bit more readability
2008-02-09 03:12:05 +00:00
belugas
a782ab3903 (svn r12091) -Codechange : remove all production level magic numbers and replace them by enums 2008-02-09 03:03:09 +00:00
belugas
cf9447c15b (svn r12090) -Codechange : removed a magic number and code style application on enum ExpensesType 2008-02-09 02:49:33 +00:00
belugas
9343ad44fd (svn r12089) -Cleanup: re-order, yet another time, the files in msvc projects 2008-02-09 02:46:49 +00:00
smatz
8195e57fd4 (svn r12088) -Fix: assert when loading savegame with wrong tiletype at south map borders 2008-02-08 19:57:56 +00:00
glx
e2de86f951 (svn r12087) -Fix: MSVC warnings 2008-02-08 17:53:01 +00:00
glx
731137678c (svn r12086) -Fix [FS#1747] (r11425): check overrides only for industries when mapping newgrf entities to 'real' entities 2008-02-08 16:56:52 +00:00
frosch
7b9efcea21 (svn r12085) -Fix(r12058): Road vehicles could get stuck, when NPF told them to reverse on junction tiles. (spotted by SmatZ) 2008-02-08 16:25:55 +00:00
frosch
2173b03144 (svn r12084) -Fix: 'Early retirement'-properties are signed. 2008-02-08 15:34:54 +00:00
belugas
bf15bc9c57 (svn r12083) -Cleanup: Adding some more files in MSVC projects 2008-02-07 18:02:22 +00:00
belugas
30a8c150d0 (svn r12082) -Cleanup: MSVC projects do not care about the directory of the file while sorting. Only the "Absolute" name matters 2008-02-07 17:24:38 +00:00
belugas
034150c199 (svn r12081) -Codechange: Rename table/roadveh.h to table/roadveh_movment.h
It is more descriptive name and it will not upset the generate script anymore
2008-02-07 17:01:06 +00:00
glx
b68f398cac (svn r12080) -Fix: update waypoint signs when changing language 2008-02-07 16:17:00 +00:00
1bcc1927b1 (svn r12079) -Fix: Use search paths when opening console scripts. 2008-02-07 10:01:18 +00:00
belugas
431c3ce3c1 (svn r12078) -Cleanup: Add missing headers on project files 2008-02-07 04:47:38 +00:00
belugas
8a3f6830a3 (svn r12077) -Cleanup: Remove files not used anymore from project files 2008-02-07 03:45:02 +00:00
glx
eb0d50aaff (svn r12076) -Fix: when reusing a renamed deleted waypoint, keep the new name 2008-02-07 01:56:39 +00:00
a187d92d87 (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed. 2008-02-06 23:08:49 +00:00
smatz
8606e70819 (svn r12074) -Cleanup: use C++ variable scope and declaration in DrawTile_Trees() 2008-02-06 23:08:04 +00:00
smatz
c0c9b80db3 (svn r12073) -Codechange: stop drawing trees a bit earlier when they are invisible 2008-02-06 22:59:31 +00:00
frosch
918591c05b (svn r12072) -Fix: Make docks at sea flood neighboured tiles. 2008-02-06 16:19:28 +00:00
frosch
7860d8d18a (svn r12071) -Feature(ette): Draw river- and canal-edges under docks and shipdepots. 2008-02-06 16:12:23 +00:00
frosch
e95e887772 (svn r12070) -Cleanup(r12042): Water-owner of shipdepots is no longer needed. Removed. 2008-02-06 15:32:06 +00:00
belugas
94f4217984 (svn r12069) -Feature[newGRF]: Specify the purchase, rail and road description of a bridge. 2008-02-06 03:01:29 +00:00
belugas
5049ff8e8e (svn r12068) -Fix(r12067): forgot a return 2008-02-06 02:43:42 +00:00
f29c748d4c (svn r12067) -Cleanup: Codestyle on loading object references 2008-02-05 23:22:34 +00:00
belugas
62b3520e51 (svn r12066) -Codechange: Rename GetBridge for the more common GetBridgeSpec
-Codechange: Remove direct access to the _bridge table in favor of the above mentioned GetBridgeSpec
-Codechange: Rationalize the use of Bridge type pointer
2008-02-05 05:21:02 +00:00
belugas
80daad8d4d (svn r12065) -Codechange : removed a now useless declaration ( orig_bridge ) 2008-02-05 05:03:50 +00:00
belugas
3003986e67 (svn r12064) -Codechange : Give grf bridges their own ResetBridges function, and put bridge spec in table/bridge_land.h, where it should be. 2008-02-05 04:48:56 +00:00
smatz
c261218cf5 (svn r12063) -Cleanup: use C++ indenting and variable scope/declaration in BuildTownHouse() 2008-02-05 00:30:58 +00:00
smatz
146779b158 (svn r12062) -Fix: possible deadlock when there are no houses available to build at given tile
-Fix: houses with zero probability could be built
2008-02-04 23:24:22 +00:00
smatz
23c669fe50 (svn r12061) -Cleanup: since r12060, DC_FORCETEST is not used anymore 2008-02-04 22:44:05 +00:00
smatz
dbfdc5df94 (svn r12060) -Fix: do not clear tiles when the town won't be able to build any buildings anyway
-Fix: allow building 2x2 building on slopes if not explicitly forbidden
-Fix: it was possible to build 2x1 and 1x2 buildings on slopes even if it was not allowed
2008-02-04 22:15:48 +00:00
glx
b35611dae3 (svn r12059) -Fix (r12041): industries prop 24 is a word 2008-02-04 16:48:00 +00:00
frosch
5e7c8012ec (svn r12058) -Fix: Teach NPF where road vehicles and trams can reverse.
-Fix: Ships can drive through opponents' ship depots. (Thanks SmatZ)
-Codechange: Split NPFFollowTrack() in smaller parts.
2008-02-04 16:24:25 +00:00
smatz
04ef38ec60 (svn r12057) -Fix: slowdown train when approaching 90deg turn when 90deg turns are forbidden 2008-02-04 15:56:39 +00:00
frosch
2a2aa1d22a (svn r12056) -Fix [FS#1704]: Enable YAPF to start searching inside a wormhole. 2008-02-04 15:26:35 +00:00
smatz
b206e50f80 (svn r12055) -Fix: another way to fix AI trying to build road through depots 2008-02-04 14:08:02 +00:00
a528dc89c7 (svn r12054) -Cleanup: Use VehicleType instead of byte for vehicle types... 2008-02-04 11:28:12 +00:00
maedhros
2588879c6d (svn r12052) -Fix [FS#1737] (r11494): The cargo translation table was loaded at the right time, but all the other global variables were now loaded too early. ;) 2008-02-03 20:23:59 +00:00
rubidium
20e9abed47 (svn r12050) -Fix: random_func broke for desync debug. 2008-02-03 16:21:19 +00:00
smatz
0ca3977af8 (svn r12049) -Fix (r10496)(r10619): memset on multibyte array with wrong byte count 2008-02-03 12:41:06 +00:00
belugas
1e51090e74 (svn r12048) -Cleanup: Move some strings in the original bridge array, adjust documentation a bit. 2008-02-03 03:37:33 +00:00
belugas
90973cdcef (svn r12045) -Feature-ette(newGRF): Add support for var 12, Variational Action 2 2008-02-03 00:24:53 +00:00
rubidium
612ba5c787 (svn r12044) -Fix [FS#1741]: crash when centering on a vehicle (aircraft) that is outside of the map. 2008-02-02 21:09:05 +00:00
smatz
f3663fd25c (svn r12043) -Fix [FS#1736]: allow building transmitters and lighthouses on tree tiles 2008-02-02 20:15:20 +00:00
1d891a8b15 (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be
stored for buoys, docks, locks and depots. All these are now allowed on rivers and removal of them will revert to the 
original water type.
2008-02-02 09:28:43 +00:00
belugas
7cf2c83462 (svn r12041) -Codechange: Add the loader and the property for action 00 industries, prop 24, nearby station name.
No assignation yet, no real work either.
2008-02-02 03:23:26 +00:00
belugas
fc4f6dcfb1 (svn r12040) -Codechange: Change IsOrderListShared from a simple function to a class member(MagicBuzz). 2008-02-02 02:45:09 +00:00
7a78a1b51a (svn r12038) -Fix: Change ownership of or remove statues when merging/bankrupting companies. 2008-02-01 22:13:59 +00:00
glx
525409b0fc (svn r12037) -Codechange: replace OnNewDay_(Aircraft|RoadVeh|Ship|Train) with an OnNewDay method in the Vehicle class 2008-02-01 22:02:14 +00:00
67782add11 (svn r12036) -Fix: For station tiles, only get road types for road stops. 2008-02-01 20:10:57 +00:00
frosch
45b79bc9f1 (svn r12035) -Fix [FS#1702]: Teach YAPF where trams can reverse, and where not. 2008-02-01 17:27:45 +00:00
belugas
803a1e2353 (svn r12034) -Codechange: A bit of code style cleaning, regarding comments.
Thanks to MagicBuzz who spotted yet another non-converted file
2008-02-01 17:22:24 +00:00
smatz
6537d13c8a (svn r12033) -Fix: do not show train speed as zero after loading paused game 2008-02-01 15:09:55 +00:00
e0849acc5a (svn r12032) -Fix: When removing a statue, remove town statue flag for the statue owner, not current player. 2008-01-31 23:04:45 +00:00
be548ee224 (svn r12031) -Fix [FS#1689,FS#1719]: Prevent towns from removing or claiming ownership of player owned tiles when growing. 2008-01-31 21:16:40 +00:00
miham
f3ecaf796e (svn r12030) -Update: WebTranslator2 update to 2008-01-31 19:43:58
brazilian_portuguese - 1 changed by tucalipe (1)
italian    - 2 changed by lorenzodv (2)
japanese   - 7 fixed by ickoonite (7)
2008-01-31 18:44:28 +00:00
frosch
a1c543e064 (svn r12029) -Feature: Allow trees on shore. 2008-01-31 17:54:13 +00:00
frosch
fe9891c8ec (svn r12028) -Codechange: Split common part of station var 0x67, house var 0x62, indtile var 0x60 and industry var 0x62 to 'newgrf_commons.cpp'. 2008-01-31 17:46:08 +00:00
frosch
ef35cefddc (svn r12027) -Documentation: Update 'landscape.html' and 'landscape_grid.html' to reflect reality and add some details. 2008-01-31 15:18:07 +00:00
orudge
2ef11e0b8b (svn r12026) -Update: 'exit' is consistent with UK English in OpenTTD, 'quit' with US English 2008-01-30 19:07:41 +00:00
miham
bc1542d483 (svn r12025) -Update: WebTranslator2 update to 2008-01-30 19:43:26
czech      - 1 fixed by Hadez (1)
estonian   - 11 changed by kristjans (11)
french     - 2 changed by belugas (2)
korean     - 1 changed by darkttd (1)
spanish    - 5 fixed by eusebio (5)
2008-01-30 18:43:59 +00:00
frosch
1608d67030 (svn r12024) -Codechange: Reduce code duplication inside tree_cmd.
-CodeChange: When rocks get removed while planting trees, barren the ground.
-Fix: In one case trees could spread under bridges.
2008-01-30 18:40:42 +00:00
frosch
a2b35067dd (svn r12023) -Fix [FS#1690]: Put a better suited text in the quit-dialog. 2008-01-30 17:56:19 +00:00
belugas
caf7e8655c (svn r12022) -Revert(r12018): Invisible trees are now separate from the building concept.
So when you want invisible trees, just select the option of the same name in the Patch Options and toggle transparency of trees.
More to come on the saga of Invisibility. So stay tuned.
2008-01-30 17:36:28 +00:00
skidd13
953c3cb6df (svn r12021) -Cleanup: Make some parts of the town growth a bit more descriptive
-Codechange: Remove some needless checks
2008-01-30 17:31:39 +00:00
frosch
46589fa827 (svn r12020) -Documentation: Correct description of TropicZone. 2008-01-30 17:22:06 +00:00
1cdee354b4 (svn r12019) -Codechange: Add support for passenger engine designation for AI-use, NewGRF property 0x08 for trains. 2008-01-30 10:27:45 +00:00
belugas
94aa04948c (svn r12018) -Fix(FS#1721,r9563): Restore initial intent on the invisible tree while transparent building patch setting 2008-01-30 03:34:24 +00:00
rubidium
44f4ebffed (svn r12017) -Fix: when you have more than 9 network interfaces you'll enter the wonderfull world of overflows. 2008-01-29 21:43:22 +00:00
egladil
be6737a2db (svn r12016) -Fix (r12003): os x compilation was broken again ;) 2008-01-29 19:23:31 +00:00
fb8973c64a (svn r12015) -Fix [FS#1716] (Revert r11422): Patch in FS#1430 avoided instead of fixed the problem. GetStringWithArgs() discards information that SCC_GENDER_LIST needs to work. Now use pointers to retrieve GRF strings, so that GetStringPtr() will work correctly. This is advantageous as now no buffer copy is made when using all GRF strings. 2008-01-29 17:09:00 +00:00
rubidium
a736e8500a (svn r12014) -Fix: lighthouses and transmitters were never supposed to be build on a slope. 2008-01-29 14:19:07 +00:00
frosch
9c4cb84c03 (svn r12013) -Fix: When modifying watered tiles, mark neighboured canals and rivers dirty in more cases. 2008-01-29 14:17:13 +00:00
frosch
7cf4f09c26 (svn r12012) -Fix (r11795): Enable TownRatingTestMode during cost estimation with 'shift'-key. 2008-01-29 14:02:18 +00:00
frosch
cda0e9f91c (svn r12011) -Fix [FS#1701]: Do not consider one-corner-raised-shores to be watered tiles from all sides. 2008-01-29 13:54:52 +00:00
smatz
379f89fc7e (svn r12010) -Fix (r11994): build tramway window should use STR_WHITE_TRAMWAY_CONSTRUCTION 2008-01-29 13:52:55 +00:00
b20d220333 (svn r12009) -Fix [FS#1707]: Avoid loading sample.cat if it 'looks' incorrect, and avoid later null pointer dereferences by moving volume lookup deeper. 2008-01-29 13:27:31 +00:00
miham
02f774793b (svn r12008) -Update: WebTranslator2 update to 2008-01-29 14:07:31
brazilian_portuguese - 5 fixed, 5 changed by fukumori (4), tucalipe (6)
bulgarian  - 7 fixed by thetitan (7)
catalan    - 1 fixed by arnaullv (1)
danish     - 9 fixed by ThomasA (9)
dutch      - 5 fixed by habell (5)
estonian   - 7 fixed, 12 changed by kristjans (19)
french     - 1 fixed by glx (1)
german     - 6 fixed by moewe2 (6)
italian    - 1 fixed by lorenzodv (1)
korean     - 6 fixed, 11 changed by leejaeuk5 (17)
russian    - 9 fixed by Smoky555 (9)
slovak     - 7 fixed by lengyel (7)
slovenian  - 7 fixed by Necrolyte (7)
swedish    - 6 fixed by ChrillDeVille (6)
ukrainian  - 7 fixed by mad (7)
2008-01-29 13:13:19 +00:00
glx
fdd71514b2 (svn r12007) -Fix (r12003): win32 compilation was broken again ;) 2008-01-29 00:45:24 +00:00
rubidium
1629699094 (svn r12006) -Fix: implement FS#1697 without the nasty side effects as specified in FS#1712. 2008-01-29 00:36:55 +00:00
rubidium
c9a9103566 (svn r12005) -Fix [FS#1717]: possible reading from an invalid pointer. Patch by PhilSophus. 2008-01-29 00:29:28 +00:00
rubidium
3b2145aafe (svn r12004) -Codechange: refactor the random functions to reduce code duplication. 2008-01-29 00:27:25 +00:00
rubidium
fde33b5547 (svn r12003) -Codechange: don't declare InteractiveRandom[Range] in multiple places. 2008-01-29 00:26:31 +00:00
1a9b741e43 (svn r12002) -Cleanup (r11981): Remove obsolete code to skip sprites from indexed GRFs. 2008-01-28 17:51:45 +00:00
frosch
d3c7a35d22 (svn r12001) -Fix: When skipping Action 11 or 12, also skip belonging sprites. 2008-01-28 15:55:59 +00:00
frosch
abc6e70447 (svn r12000) -Fix (r11926): If no river NewGRF is loaded, use sloped water from locks. 2008-01-28 15:19:35 +00:00
frosch
a1b98cda59 (svn r11999) -Fix: Do entrance-slope-check for every tile of railstations. 2008-01-28 14:36:54 +00:00
smatz
a9031cc5f5 (svn r11998) -Fix [FS#1692](r10053): possible remote assert by setting bit 6 of p1 for CMD_REMOVE_ROAD 2008-01-28 12:40:31 +00:00
belugas
0253b1d02a (svn r11997) -Fix(FS#1712, r11985): Remove the code temporary, until a better scheme is implemented. 2008-01-28 03:33:41 +00:00
smatz
c8ba8d930b (svn r11996) -Fix [FS#1706]: update train statusbar when stopping from zero speed 2008-01-27 20:20:53 +00:00
maedhros
c5b81c9382 (svn r11995) -Cleanup (r11994): Change the string names in all the other languages. 2008-01-27 17:34:08 +00:00
maedhros
21eef65e77 (svn r11994) -Codechange: Remove numbers from string names where the strings aren't present in TTD, since they don't correspond to either TTD's TextIDs or OpenTTD's StringIDs. 2008-01-27 17:32:12 +00:00
0847def759 (svn r11993) -Fix: Resize station/roadstop/dock/airport construction windows if cargo acceptance list is too long. 2008-01-27 11:01:10 +00:00
bjarni
7b29dcde3c (svn r11992) -Fix (r9905): When building two rail stations close to each other (with control) so they looked like one long track trains would see them as one (spotted and fixed by eddi) 2008-01-27 02:09:46 +00:00
97a1cbdfa1 (svn r11991) -Cleanup: Remove strings removed in r11990 2008-01-26 22:41:24 +00:00
c6656d6b2f (svn r11990) -Codechange: Show all cargo sources (en-route from) in the station view
cargo waiting list instead of just one. The station view window is now 
resizable to cope with the extra information.
2008-01-26 22:15:39 +00:00
2fc2188127 (svn r11989) -Fix: Resize autoreplace window to fit purchase information text if it is too large. 2008-01-26 21:02:35 +00:00
c99eb9e456 (svn r11988) -Codechange: Add a generic way of changing a widget's size and adjust the widgets around it to suit. 2008-01-26 20:55:04 +00:00
belugas
d3990083d3 (svn r11987) -Feature[newGRF]: Allow the industry view window to be resized only when callback 3A (Show additional text in industry window) is available for the current industry.
This now allows grf authors to specify longer than 3 lines of text.
2008-01-26 03:11:27 +00:00
18431dd9f8 (svn r11986) -Fix: build system ignored changes to table/control_codes.h which require strgen to be rebuilt 2008-01-25 21:09:12 +00:00
belugas
e214e03c28 (svn r11985) -Feature[FS#1697, newGRF]: Implement var 8F(random bits) during callback 28 (Industry location permissibility) 2008-01-25 18:13:04 +00:00
frosch
b329781ab2 (svn r11984) -Fix: Also draw corner shores under rail tracks. 2008-01-25 16:51:35 +00:00
frosch
6f6708e844 (svn r11983) -Codechange: Add some helper functions for slopes and use them. 2008-01-25 15:47:58 +00:00
frosch
d11aeb118c (svn r11982) -Revert (r8738): Now we have shores in corners. No need to remove them from TTDP games. 2008-01-25 13:54:27 +00:00
eeeeeb9336 (svn r11981) -Fix [FS#1698]: Use unicode glyph mapping to fix up missing/shuffled sprites in original data files instead of shuffling or skipping
sprites directly. Some required glyphs were not loaded.
-Fix: Large capital U with grave (Ù) along with some other glyphs are broken in the original data files, so do no display them.
2008-01-25 13:48:39 +00:00
smatz
e99c34bef4 (svn r11980) -Fix: newer versions of cut do not accept field index 0 2008-01-24 23:56:43 +00:00
rubidium
bbdc5a9314 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble. 2008-01-24 18:47:05 +00:00
skidd13
4991dcecc7 (svn r11978) -Codechange: Replace some global variables with window owned ones 2008-01-24 18:35:35 +00:00
belugas
44d085af6c (svn r11977) -Fix(r11976): not a typo, not a bug. Just a removal that should have been done.
Would help to compile first...
2008-01-24 18:28:52 +00:00
belugas
1fc0c0d2dc (svn r11976) -Fix: It seems that industries using results 0D/0E on callback cb29/35 were a bit too eager to close down. 2008-01-24 18:16:04 +00:00
frosch
bd0c853e27 (svn r11975) -Documentation: Distinguish between station types in 'landscape_grid.html'. 2008-01-24 17:32:03 +00:00
frosch
da754951f1 (svn r11974) -Fix [FS#1684]: Shore and sea tiles under bridges were converted to canals in old savegames. 2008-01-24 14:57:43 +00:00
frosch
79aa7247c0 (svn r11973) -Fix (r11726, r11947)[FS#1683]: Use grass tiles for corner shores, if shores got replaced by ActionA. 2008-01-24 14:49:40 +00:00
smatz
5f9a877376 (svn r11972) -Fix: old AI shouldn't build fast planes with a small airport in orders 2008-01-24 14:22:10 +00:00
697b07c99c (svn r11971) -Codechange: use of FOR_ALL_ENGINES/ENGINEIDS_OF_TYPE instead of for-loops 2008-01-24 10:47:44 +00:00
9c65bcea7d (svn r11970) -Cleanup: Remove old comment 2008-01-24 10:41:12 +00:00
smatz
541247c830 (svn r11969) -Codechange: documentation update, there are no 'track bits under bridge' anymore 2008-01-23 23:22:47 +00:00
smatz
5a7c903770 (svn r11968) -Codechange: remove redundant FindLengthOfTunnel(), use GetTunnelBridgeLength() and/or GetOtherTunnelEnd() instead 2008-01-23 22:34:04 +00:00
smatz
b5641ae0f2 (svn r11967) -Fix (r1400): MP_ROAD can have railbits too - OPF searching over rail of diffent owner behind crossing 2008-01-23 20:02:30 +00:00
smatz
e40944f8e0 (svn r11966) -Fix: OPF was searching through depots and normal road stops
In effect, it also fixes old AI bugs like FS#1403 and FS#1506
2008-01-23 19:31:11 +00:00
smatz
4cb91fa591 (svn r11965) -Codechange: simplified tunnel/bridge code in TPFMode1 2008-01-23 18:24:04 +00:00
b718cae67d (svn r11964) -Fix [FS#1685]: Tropic zone data was returned incorrectly. 2008-01-23 17:45:48 +00:00
belugas
9c16461c29 (svn r11963) -Fix(r11961): Forgot to specify the meaning of the magical 6 substraction 2008-01-23 17:40:37 +00:00
smatz
d6eaf1a11a (svn r11962) -Cleanup: OPF is no longer used to update signals 2008-01-23 17:30:28 +00:00
belugas
4a3e135086 (svn r11961) -Feature[newGRF]: Add support for Action 0D, var 13: informations about current map size. 2008-01-23 17:08:35 +00:00
smatz
0b888ccc00 (svn r11960) -Cleanup: simplify some IsTunnel(Tile) / IsBridge(Tile) conditions 2008-01-23 14:51:36 +00:00
9515328962 (svn r11959) -Codechange: Use macro to loop for specific engine types instead of using specific indexes each time.
-Codechange: Minor scope changes in said loops.
2008-01-23 13:20:51 +00:00
smatz
a31ebdb2be (svn r11958) -Fix (r11204): NewAI couldn't build any road vehicles when there were any tram grfs loaded 2008-01-23 13:06:00 +00:00
e35cf20a23 (svn r11957) -Codechange [FS#1678]: Minor simplification and optimisation when checking for available road/rail types (bilbo) 2008-01-23 09:43:53 +00:00
0f966a316a (svn r11956) -Fix [FS#1675]: Disallow building locks and docks on rapids. 2008-01-23 08:47:49 +00:00
ff0891426f (svn r11955) -Fix (r11926): Prevent bridge and tunnel ends being placed on rivers. 2008-01-23 08:28:19 +00:00
smatz
983fdb8a4f (svn r11953) -Fix (r11172): do not allow modifying roadbits when other roadtypes would need different foundation 2008-01-23 00:36:48 +00:00
da53070a38 (svn r11952) -Fix (r11926): Prevent industries from being built on rivers, unless they require water. 2008-01-22 22:17:28 +00:00
smatz
3a423a8747 (svn r11951) -Fix (r11279): loading of very old savegames was broken 2008-01-22 21:01:35 +00:00
39f6173401 (svn r11949) -Codechange: add river icon and cursor, drawn by skidd13. 2008-01-22 20:04:30 +00:00
frosch
49d2087d7f (svn r11947) -Feature: Make use of new sprites added by Action5 type 0D.
Tiles which only consist of shore do not flood anymore, instead they get removed if they are no longer connected to flooding water.
2008-01-22 17:48:08 +00:00
frosch
b99c83246b (svn r11946) -Fix: slope detection of bridge ramps.
YAPF failed for steep slopes.
  Trolly failed for a lot.
2008-01-22 16:08:17 +00:00
glx
7d1e3086b8 (svn r11945) -Fix: FileExists() failed for non latin paths (win32) 2008-01-22 15:47:40 +00:00
smatz
96a18d859f (svn r11944) -Fix: allow building drive-through road/tram stops at road/tram track that has no owner 2008-01-22 15:40:29 +00:00
rubidium
59ec5e62ce (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack. 2008-01-22 12:09:12 +00:00
30bac58bde (svn r11942) -Codechange: Merge chars.grf into openttd[d|w].grf using action 12. Remove obsolete tables used for index mapping. 2008-01-22 08:47:30 +00:00
ffec79bbcf (svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either. 2008-01-22 07:27:06 +00:00
rubidium
9444eb4484 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik. 2008-01-21 23:55:57 +00:00
ca1b3e7b4e (svn r11938) -Codechange: support loading of canal/river properties (though still ignored) 2008-01-21 20:41:04 +00:00
frosch
0a6425926b (svn r11937) -Feature: Allow building bridge heads on more slopes.
These are SLOPE_NW, SLOPE_SW, SLOPE_SE, SLOPE_NE (with bridge perpendicular to the slope) and SLOPE_NS, SLOPE_EW.
2008-01-21 15:48:00 +00:00
frosch
f23e71f22f (svn r11936) -Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes. 2008-01-21 15:20:58 +00:00
bjarni
000117aa19 (svn r11935) -Fix (r11875)[FS#1672]: autosend aircraft to hangar for replacement check inverted the check for autorenew
Now it triggers when renew setting is on and only if it's on
  Note: aircraft already enroute to hangars due to this bug will still go there. They will only head there once though
2008-01-21 10:31:27 +00:00
9ca929c812 (svn r11934) -Codechange: add persistent random data for river and canal tiles. 2008-01-20 18:30:53 +00:00
miham
ffb9ca164e (svn r11933) -Update: WebTranslator2 update to 2008-01-20 18:42:56
brazilian_portuguese - 2 fixed by fukumori (2)
catalan    - 6 fixed by arnaullv (6)
croatian   - 4 changed by blozo (4)
czech      - 6 fixed by Hadez (6)
dutch      - 2 fixed by habell (2)
french     - 6 fixed by glx (6)
hungarian  - 15 fixed by miham (15)
italian    - 6 fixed by lorenzodv (6)
portuguese - 5 fixed, 2 changed by nars (7)
russian    - 1 changed by HMage (1)
spanish    - 3 fixed by eusebio (3)
2008-01-20 17:43:38 +00:00
belugas
2c5c97346b (svn r11932) -Codechange: Forgot two occurences of widget enumification 2008-01-20 04:01:28 +00:00
belugas
3423032dbb (svn r11931) -Codechange: enumify the widgets numbers. Give breathing room on the case switches too... 2008-01-20 03:56:15 +00:00
belugas
90a770250f (svn r11930) -Codechange: a bit of code style application 2008-01-20 03:11:14 +00:00
bjarni
e91230415d (svn r11929) -Fix (r9981)[FS#1624]: [autoreplace] fixed a case where a single headed locomotive caused an assert when being replaced to a dualheaded one
This triggered if the player had enough money to replace and refit one of them but not enough to refit the last one as well
2008-01-19 23:34:52 +00:00
bjarni
2f6ee3a4a1 (svn r11928) -Fix (r6393): [autoreplace] autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had
Now autoreplace will always look at the wagons to figure out what to replace to (as originally intended)
2008-01-19 22:47:07 +00:00
a580c8d059 (svn r11927) -Fix (r11926): unable to place canals in game 2008-01-19 18:24:20 +00:00
4a2f7db99b (svn r11926) -Feature: Rivers. Graphics must be provided by NewGRF else rivers are drawn as canals. Rivers can currently only be placed with-in the scenario editor. 2008-01-19 17:00:54 +00:00
rubidium
aa0412e0bc (svn r11925) -Fix (r122, r9867): loading old, pre savegame version 2, savegames. 2008-01-19 14:00:04 +00:00
02c9484ebb (svn r11924) -Codechange: All dropdowns now use the dropdown widget, so compatibility code can be removed 2008-01-19 11:08:06 +00:00
glx
1712a8a0e1 (svn r11923) -Cleanup: Remove strings removed from english.txt in r11919 2008-01-18 22:55:02 +00:00
smatz
730dda867b (svn r11922) -Codechange: use MaybeBarCrossingWithSound() to bar crossing with sound 2008-01-18 21:44:20 +00:00
14416791af (svn r11921) -Cleanup: correct indenting and switch case line spacing. 2008-01-18 21:33:19 +00:00
glx
600046f3d7 (svn r11920) -Fix (r11844): train count was incorrect in network lobby window (and 'players' command) 2008-01-18 21:25:18 +00:00
b6d0684826 (svn r11919) -Codechange: Assign numbered parameters to world generator widgets to avoid separate DrawString()s, and do the same for the scenario flat-land window. 2008-01-18 21:08:40 +00:00
70025a149d (svn r11918) -Codechange: Draw engine lists at widget positions instead of fixed pixel positions 2008-01-18 18:18:39 +00:00
smatz
22a7b95c10 (svn r11917) -Fix (r3677): AI was reading wrong tile slope while building road bridge 2008-01-18 14:48:57 +00:00
smatz
1d59439166 (svn r11916) -Codechange: use enums from VehicleViewWindowWidgets instead of constants
-Fix: refit button widget was not correctly updated
2008-01-18 13:02:47 +00:00
68707808c0 (svn r11915) -Codechange: Add a function to draw a sort button's up/down arrow. Arrows are now drawn in a consistent position based on the widget, instead of randomly positioned by pixel. 2008-01-18 10:36:55 +00:00
glx
b7f50533c2 (svn r11914) -Documentation: fix some @file statement 2008-01-18 03:48:29 +00:00
smatz
0b3db1a92d (svn r11913) -Fix (r11871): update signals after company bankrupt and disaster too 2008-01-18 02:16:39 +00:00
307b0e8e7a (svn r11912) -Codechange: use dropdown widget for autoreplace, station builder and (second?) vehicle list windows 2008-01-17 21:57:20 +00:00
ada41b7b3f (svn r11911) -Codechange: use enum for autoreplace window widgets 2008-01-17 21:44:52 +00:00
smatz
8d077b16d8 (svn r11910) -Fix: play 'ding-ding' crossing sound in more cases (except gameload and crossing construction)
-Fix: crossing sound is bound to tile, not to vehicle
2008-01-17 20:41:33 +00:00
ac0fa7f69f (svn r11909) -Codechange: use dropdown widget for player livery, network lobby/setup and news settings windows 2008-01-17 20:00:13 +00:00
smatz
822242f411 (svn r11908) -Fix: update crossing when merging a company, when building a crossing and after loading older savegame 2008-01-17 19:49:06 +00:00
35135222b5 (svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing. 2008-01-17 19:41:05 +00:00
miham
17c9ea9ca3 (svn r11906) -Fix: fixed a typo in german language (reported by Botcher0) 2008-01-17 19:35:37 +00:00
6d3aa07a24 (svn r11905) -Codechange: add widget enums for player finances and player livery windows 2008-01-17 19:12:53 +00:00
d80e04d6f6 (svn r11904) -Codechange: use dropdown widget in 3 more windows, build vehicle, group vehicle list and station list. 2008-01-17 18:49:39 +00:00
smatz
44a4ff835d (svn r11903) -Fix: try to fix MorphOS compilation 2008-01-17 18:21:31 +00:00
ad54075acc (svn r11902) -Codechange: use new dropdown widget for game options window 2008-01-17 18:10:27 +00:00
c313676c66 (svn r11901) -Add: add two widgets for dropdowns, one raised and one inset, to eventually replace use of two widgets for each dropdown control. 2008-01-17 18:09:15 +00:00
smatz
c74cf439fa (svn r11900) -Fix: set correctly crossing state after train reversal, train leaving crossing, train crash
Fixes several ways to leave crossing red forever or to leave it unbarred when there is a train on crossing
2008-01-17 17:57:39 +00:00
frosch
35f3421842 (svn r11899) -Cleanup: Remove ShowReplaceVehicleWindow() as it is basically a duplicate of ShowReplaceGroupVehicleWindow(). 2008-01-17 17:35:59 +00:00
frosch
c579bffed2 (svn r11898) -Fix: Update neighboured canals + signals when flooding non-flat tiles, too. 2008-01-17 17:13:47 +00:00
frosch
978a7ca56a (svn r11897) -Fix: Replace an uint with TileIndex and a small coding style fix. 2008-01-17 16:55:13 +00:00
glx
4f31704e2e (svn r11896) -Fix (r11886): a missing const broke compilation with MSVC 2008-01-17 16:46:41 +00:00
glx
f37174f0e2 (svn r11895) -Fix (r11875): for once MSVC warns for a good reason 2008-01-17 16:41:02 +00:00
a9c71ce375 (svn r11894) -Cleanup: Remove strings removed from english.txt in r11893 2008-01-17 14:06:49 +00:00
68fc3b35da (svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings 2008-01-17 14:00:17 +00:00
f788298209 (svn r11892) -Fix (r11879): View switched from ungrouped to all vehicles as ungrouped is not technically a valid group, and ensure dropdown is removed
on any click in the window.
2008-01-17 13:37:28 +00:00
rubidium
f5d72cc84c (svn r11890) -Change: ignore some files for git too. Patch by bruce89. 2008-01-17 02:13:01 +00:00
rubidium
08c01e64b8 (svn r11889) -Change: small inconsistency between documentation and code. Patch by Yexo. 2008-01-17 02:10:55 +00:00
glx
3d61a1adc5 (svn r11888) -Codechange: simplify sorting of the strings in town names dropdown 2008-01-17 02:10:26 +00:00
rubidium
f658b79e15 (svn r11887) -Fix [FS#1658]: segmentation faults/wrong frees due uninitialized memory in the AI. 2008-01-17 02:09:34 +00:00
glx
69c18efdca (svn r11886) -Add: sort the strings in languages dropdown 2008-01-17 00:21:43 +00:00
4d9a9bf6ff (svn r11885) -Cleanup: Remove gotos from widget drawing code. A side affect is that it is now possible for any widget type to be shown disabled. 2008-01-17 00:06:36 +00:00
bc438a3033 (svn r11884) -Cleanup: leftover use of widget numbers instead of enum 2008-01-16 23:46:46 +00:00
smatz
c8178d43c1 (svn r11883) -Fix (r11864): assert when trying to remove rail from a house or industry tile 2008-01-16 22:26:45 +00:00
smatz
ac7bc24b0e (svn r11882) -Codechange: introduce MarkSingleVehicleDirty() and simplify the code at some places 2008-01-16 21:17:31 +00:00
69cb009075 (svn r11881) -Cleanup: Code style for global variables. 2008-01-16 18:34:53 +00:00
330ec8bdd6 (svn r11880) -Codechange: Generate vehicle group action dropdown dynamically, and assign an enum for the function return codes. 2008-01-16 18:25:23 +00:00
abac83795d (svn r11879) -Fix: Only update group action drop down list when clicking on the dropdown text/button. Other times is not needed and caused a double free. 2008-01-16 17:43:46 +00:00
019ffe29b8 (svn r11878) -Fix: Crash in MP in vehicle group window if the currently selected group is deleted by another player. 2008-01-16 16:52:50 +00:00
smatz
692fbb3c05 (svn r11877) -Fix: another way to crash competitors' train in a station
-Codechange: increase the speed train is approaching line end/semaphore in non-diagonal direction a bit
2008-01-16 15:48:36 +00:00
frosch
5659cbe6fe (svn r11876) -Fix: Start industry tile animation also for overridden industry tiles. (Will only apply to new games or newly build industries.) 2008-01-16 15:06:48 +00:00
bjarni
beb1b07f5f (svn r11875) -Fix: automatically sending aircraft to depot for autoreplace/renew is now triggered by the correct conditions
Now it triggers by the following conditions:
  - aircraft is old enough for renew or needs to be autoreplaced
  - player has 2*cost of new aircraft+autorenew money (we don't want to send many aircraft to hangars when there is only money for replacing one)
  - aircraft has no hangars in it's order list
  - new aircraft is buildable (imagine autorenewing a retired design)
  This triggers right after a helicopter takes off or when a plane touches the ground while landing

  Another effect of this change is that this functionality no longer generates network traffic
2008-01-16 13:59:08 +00:00
rubidium
2817e5425b (svn r11874) -Fix [FS#1655]: all wagons of maglev/monorail trains would get the livery colour of the engine instead of their wagon type. 2008-01-16 11:25:15 +00:00
belugas
7a66d5e21d (svn r11873) -Codechange: less a few magical numbers and a tiny bit more comments on town zones 2008-01-16 02:53:55 +00:00
bjarni
77a20eae43 (svn r11872) -Fix (r9874): EngineHasReplacementForPlayer() didn't look in ALL_GROUP 2008-01-16 01:27:24 +00:00
smatz
9556623281 (svn r11871) -Fix [FS#1074]: do not update signals after each tile when building/removing a large block of track/signals/station 2008-01-16 01:18:15 +00:00
smatz
40a7ace4fa (svn r11870) -Fix: slow down train when approaching tile we can't enter in more cases
(tunnel/bridge/depot from wrong direction, competitor's track, wrong railtype)
-Fix: do not make crossing red when we can't enter it in any case
2008-01-16 00:33:28 +00:00
rubidium
ef112812c6 (svn r11868) -Fix: some files were still mentioning that beta1 is the latest release when that's not the case. 2008-01-15 20:44:31 +00:00
rubidium
6891bc2011 (svn r11867) -Fix: do not reset changes to persistent storages during world generation.
-Fix: store changes to persistent storages after performing all the game logic instead of resetting them.
2008-01-15 18:51:46 +00:00
rubidium
576f8ad93e (svn r11866) -Codechange: swap OFB_* and OF_* so it conceptually in sync with other cases of *B_* vs *_* like VETSB_* and VETS_*. 2008-01-15 18:44:22 +00:00
ab7cb0804d (svn r11865) -Feature(tte): Support scrolling of drop down lists when in drag mode by moving the pointer above or below the list. 2008-01-15 16:30:08 +00:00
smatz
245f05a7cc (svn r11864) -Codechange: pass owner whose signals we will update instead of complex detection later 2008-01-15 15:00:01 +00:00
932c586dfe (svn r11863) -Fix (r11848): One day I'll learn C++... Delete all items in a drop down list before deleting the list. 2008-01-15 13:20:58 +00:00
rubidium
26c621945d (svn r11862) -Fix [FS#1559]: when two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF... So store the GRF ID with the strings. To be extra sure add the same protection mechanism to industries and towns too. 2008-01-15 13:19:49 +00:00
smatz
0078fd1699 (svn r11861) -Fix: do not call rail specific functions when removing road tunnel/bridge 2008-01-15 11:45:29 +00:00
ea6535c864 (svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit. 2008-01-15 11:43:06 +00:00
68a3df82b9 (svn r11859) -Codechange: Update newgrf station class dropdown to use new method of generating list. 2008-01-15 10:36:51 +00:00
2723128ba9 (svn r11858) -Fix (r1679): Mask and rule colour in drop down lists using wrong source value. (r1679 partially reverted r1368) 2008-01-15 08:14:22 +00:00
rubidium
c1108bd293 (svn r11857) -Fix: some compile time warnings. 2008-01-15 00:48:14 +00:00
glx
af59eb2543 (svn r11856) -Revert (r11772): since FS#1335 is solved, we do not need the extra checking and such anymore. 2008-01-15 00:11:28 +00:00
glx
8c13852373 (svn r11855) -Fix [FS#1335]: recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs 2008-01-15 00:03:48 +00:00
1bcca5aae2 (svn r11854) -Fix (r11848): Nightly build farm showed up more compiler warnings... c++ is fun 2008-01-14 20:52:43 +00:00
bjarni
57ecf117c9 (svn r11853) -Fix [r11837]: [OSX] reconfigure killed the space in shared-dir
Thanks to TrueLight for finding the solution to this one
  Note: if the shared-dir setting is already broken due to this then you have to manually run configure again
2008-01-14 20:30:05 +00:00
miham
277ec663cb (svn r11852) -Update: WebTranslator2 update to 2008-01-14 21:05:38
brazilian_portuguese - 36 changed by fukumori (36)
korean     - 1 fixed by leejaeuk5 (1)
piglatin   - 20 fixed by adammw (20)
portuguese - 1 fixed by nars (1)
2008-01-14 20:06:18 +00:00
belugas
e789ee83ab (svn r11851) -Codechange: A few magic numbers removal, plus a little code style 2008-01-14 18:19:29 +00:00
ea808b2bfa (svn r11850) -Fix (r11848): forgot to update vc project files 2008-01-14 16:40:31 +00:00
bf0a7ae4fb (svn r11849) -Fix (r11848): Incomplete(?) class broke MSVC/mingw compilation 2008-01-14 16:35:49 +00:00
e4c05f8d78 (svn r11848) -Codechange: New class-based drop down list functionality. Lists are now dynamically generated, and can include parameters, or be extended however needed. 2008-01-14 16:10:58 +00:00
smatz
7beb63a93b (svn r11847) -Fix: do not affect the speed a train is entering a depot by trackbits behind it 2008-01-14 14:46:09 +00:00
027112e1fe (svn r11846) -Fix [FS#1651]: implicit conversion from unsigned to signed int caused compilation failure with MSVC. 2008-01-14 11:18:43 +00:00
smatz
bfc4d80c8e (svn r11845) -Codechange: simplify train collision detection a bit 2008-01-13 23:53:33 +00:00
glx
7d2d4314ec (svn r11844) -Fix: road vehicle count was incorrect in network lobby window 2008-01-13 22:27:06 +00:00
smatz
311c14c9f5 (svn r11843) -Fix: mark dirty canal tile even in diagonal direction from flooded tile 2008-01-13 22:12:39 +00:00
rubidium
933aea42cb (svn r11842) -Fix: libtimidity.cpp did not compile anymore. 2008-01-13 22:10:54 +00:00
glx
48861a9fae (svn r11841) -Fix: win32 compilation 2008-01-13 22:07:33 +00:00
rubidium
392d59f6a9 (svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server. 2008-01-13 21:51:53 +00:00
rubidium
3ca95f2a85 (svn r11839) -Codechange: move some variables from variables.h to a more logical location. 2008-01-13 21:41:24 +00:00
smatz
27e5deb719 (svn r11838) -Fix (r11320): draw correctly canal next to half flooded rail tile 2008-01-13 17:55:00 +00:00
bjarni
e281180d06 (svn r11837) -Feature: [OSX] added "/Library/Application Support/OpenTTD" to the search paths (based on patch by pv2b)
It is possible to set this to something else setting shared-dir with config
  This works on other OSes as well but it's off by default (and not really tested)
2008-01-13 17:45:29 +00:00
bjarni
ef219245af (svn r11836) -Fix [r11834]: [OSX] fixed compilation 2008-01-13 17:37:17 +00:00
smatz
8da51e5eb2 (svn r11835) -Fix: mark depot, viewports, vehicle lists and vehicle details dirty when a train crashes 2008-01-13 14:42:28 +00:00
rubidium
dc87b05e8c (svn r11834) -Codechange: only include settings_type.h if needed. 2008-01-13 14:37:30 +00:00
bjarni
2f9aab3217 (svn r11833) -Cleanup: changed save_params_array into one item for each line in config.lib
This should increase readability and conflict solving
2008-01-13 13:53:53 +00:00
rubidium
5c4150d304 (svn r11832) -Codechange: get rid of (quite) some VARDEFs. 2008-01-13 13:36:01 +00:00
smatz
b0c34f4d62 (svn r11831) -Fix: call TrainConsistChanged() when removing crashed train part to be consistent with saveload process 2008-01-13 13:11:59 +00:00
rubidium
cc52a56052 (svn r11830) -Fix [FS#1625]: road vehicles would not wait in line, but at a single point on bridges. Based on a patch by SmatZ. 2008-01-13 12:08:35 +00:00
rubidium
079abbd04b (svn r11829) -Feature: allow reloading openttd.cfg when starting a new game on a dedicated server. Patch by dihedral. 2008-01-13 01:39:22 +00:00
rubidium
d4e6a6bf57 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 2008-01-13 01:21:35 +00:00
rubidium
a78d73805f (svn r11827) -Codechange: do not include enum_type.hpp unnecessary. 2008-01-13 00:28:01 +00:00
glx
aa1d429d7f (svn r11826) -Fix (r10444): at least one instance of dmusic driver is needed for it to be registered and usable 2008-01-13 00:14:29 +00:00
rubidium
853ca6386e (svn r11825) -Fix (FS#1627): an articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile. 2008-01-12 22:10:00 +00:00
c7debf7908 (svn r11824) -Fix (r11822): Converting signs from TTD games incomplete 2008-01-12 21:25:04 +00:00
e677814a4b (svn r11823) -Fix (r11822): Custom names from old TTD games were not updated. 2008-01-12 21:01:27 +00:00
ab8382c0db (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
no limit to the amount of names.
-Fix: NewGRF engines could not be renamed.
2008-01-12 19:58:06 +00:00
smatz
a222fe2e86 (svn r11821) -Fix (r11802): 'optimization assert' when removing crashed wagon in some cases 2008-01-12 19:33:25 +00:00
smatz
704a75871a (svn r11820) -Fix: invalidate depot window when removing crashed train 2008-01-12 19:24:58 +00:00
smatz
712d4b6259 (svn r11819) -Fix: do not access the Vehicle struct that has been already deleted when removing crashed train 2008-01-12 19:20:44 +00:00
rubidium
ac528411df (svn r11818) -Codechange: split player.h into smaller pieces. 2008-01-12 14:10:35 +00:00
cbbc53e8f8 (svn r11817) -Codechange: Base vehicle group validity on owner, not name. 2008-01-12 13:36:22 +00:00
rubidium
ed727f9a64 (svn r11816) -Fix: forgot clearing one byte, causing the passwords to differ slightly on different platforms. 2008-01-12 08:34:16 +00:00
smatz
a4c1280945 (svn r11815) -Codechange (r11802): some compilers were giving a false warning about uninitialized variable 2008-01-11 22:29:47 +00:00
orudge
79e0a48c42 (svn r11814) -Fix: Get OpenTTD compiling again on OS/2 2008-01-11 18:53:52 +00:00
frosch
cbe7e5d668 (svn r11813) -Fix [FS#1602]: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots. 2008-01-11 17:12:41 +00:00
smatz
4d04077156 (svn r11812) -Codechange: introduce TrainExitDir() to simplify some functions 2008-01-11 15:10:59 +00:00
rubidium
04f936c2c6 (svn r11811) -Fix: make compilation without networking work again (and thus move the debugdumpcommand stuff out of the network 'area'). 2008-01-11 00:30:32 +00:00
smatz
e5d33482b4 (svn r11810) -Fix (r11802): reset sets when leaving prematurely 2008-01-10 22:46:04 +00:00
smatz
a1266da782 (svn r11809) -Fix [FS#1643]: set expenses type when selling all vehicles in depot 2008-01-10 21:54:45 +00:00
smatz
40ef636f43 (svn r11808) -Fix: remember --with-ccache in config.cache
-Codechange: shuffle params a bit, sort params in save_params_array in the same order as the table above
2008-01-10 18:59:16 +00:00
frosch
1b936179ca (svn r11807) -Codechange: Make Action5 handler more upwards- and TTDP-compatible by allowing specifiing more sprites than needed. 2008-01-10 18:02:15 +00:00
glx
3976bb987d (svn r11806) -Fix (r11793) [FS#1638]: sign inversion when updating income and expenses 2008-01-10 15:51:34 +00:00
frosch
930f875c51 (svn r11805) -Fix [FS#1620]: VEHICLE_TRIGGER_EMPTY was triggered continuously while train waiting in station. 2008-01-10 13:13:18 +00:00
belugas
0181678cde (svn r11804) -Fix(r11797,FS#1636): Industry tiles should receive the same medecine as indstries themselves regarding the resolver's object 2008-01-10 00:53:17 +00:00
d30321d2af (svn r11803) -Fix: unlikely but possible infinite loop leading to undefined behaviour 2008-01-09 23:17:40 +00:00
smatz
f44a9a5d5b (svn r11802) -Fix [FS#716]: do not crash trains when leaving depot to a very long track
-Codechange: use dedicated pathfinder for signal updating, resulting in better performance and possible future improvements
2008-01-09 23:00:59 +00:00
rubidium
6c954cad5f (svn r11801) -Codechange: remove some unneeded includes from some header files. 2008-01-09 21:27:39 +00:00
rubidium
998d7644f6 (svn r11800) -Codechange: move some functions to a more logical location + some type safety. 2008-01-09 21:05:03 +00:00
82fe2885ab (svn r11799) -Codechange: no need to special-case helicopter rotor 'overrides' 2008-01-09 20:23:12 +00:00
belugas
6375ea065b (svn r11798) -Codechange: add comments and give a more representative function's name 2008-01-09 18:35:18 +00:00
belugas
f67b5798a0 (svn r11797) -Fix: Add protection against not already created industry while doing industry callback.
Some variables used were linked to invalid industry.
2008-01-09 18:14:29 +00:00
glx
785572ea32 (svn r11795) -Fix [FS#1616]: take town rating into account when testing if a command can be executed. 2008-01-09 17:47:05 +00:00
glx
d133edd026 (svn r11794) -Fix [FS#1632]: reversing a train when loading at a station with an adjacent station in the same axis crashed. 2008-01-09 17:09:53 +00:00
rubidium
46650c54b6 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114). 2008-01-09 16:55:48 +00:00
rubidium
b4337eba83 (svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times. 2008-01-09 16:40:02 +00:00
a27a240b87 (svn r11791) -Cleanup: move railtype data into table/, like other data files. 2008-01-09 16:02:13 +00:00
rubidium
ebb6259057 (svn r11790) -Update: apparantly it's 2008 already ;). Patch by Anne Stellingwerf (FS#1613). 2008-01-09 11:46:40 +00:00
a01fc4c142 (svn r11789) -Codechange: coding style for global variable names 2008-01-09 10:15:20 +00:00
rubidium
b4b3190b62 (svn r11788) -Fix (11787): makedepend doesn't mark delete files as changed... 2008-01-09 09:57:48 +00:00
rubidium
0e517fe023 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h. 2008-01-09 09:45:45 +00:00
931e6ea49d (svn r11786) -Codechange: shuffle more includes 2008-01-09 08:12:10 +00:00
rubidium
cd92981e9f (svn r11785) -Codechange: remove some unneeded includes. 2008-01-09 00:59:02 +00:00
ce2104ed47 (svn r11784) -Codechange: set up initial engine data in one place 2008-01-08 18:25:51 +00:00
814f47a3cc (svn r11783) -Codechange: compare engine type with its type property, not by its index 2008-01-08 18:16:26 +00:00
352f13dad1 (svn r11782) -Codechange: e->type was used before being properly initialized (it relied on previous runs) but there is no need to invalidate window data during game load as the windows in question cannot be open. 2008-01-08 16:07:32 +00:00
4479c06e2d (svn r11781) -Codechange: variable scope and initialization 2008-01-07 22:38:30 +00:00
77717563e1 (svn r11780) -Codechange: When compiling a dedicated server build, select the dedicated video driver by default. 2008-01-07 16:41:03 +00:00
glx
2832a6cafb (svn r11779) -Fix: win32 compile failed. Also removed a duplicate include 2008-01-07 15:35:36 +00:00
rubidium
eced1fb4ae (svn r11778) -Fix: compiles with ICONV failed. 2008-01-07 15:17:23 +00:00
rubidium
a3ccdcea36 (svn r11777) -Codechange: split the string header and make do not include it when it's not necessary. 2008-01-07 14:23:25 +00:00
rubidium
38115acf5a (svn r11776) -Codechange: more header splittings to reduce the dependencies. 2008-01-07 14:02:26 +00:00
rubidium
a8a3a7e3f2 (svn r11775) -Codechange: move all autoreplace/autorenew functions to a single location. 2008-01-07 09:19:53 +00:00
rubidium
b0ac283aec (svn r11774) -Change: do not include variables.h in a header when it is not needed. 2008-01-07 00:57:19 +00:00
rubidium
64fc2ade9e (svn r11773) -Codechange: move some non-clear-land functions from clear_cmd.cpp to a more correct location. 2008-01-07 00:45:05 +00:00
glx
119b03ea70 (svn r11772) -Change: add some extra checking in the hope to find the cause of FS#1335 2008-01-07 00:43:03 +00:00
rubidium
acc7c9eb01 (svn r11771) -Codechange: split settings.h into better separated headers. 2008-01-07 00:19:09 +00:00
7be2160cfb (svn r11770) -Codechange: An engine type's type is EngineID, not byte. 2008-01-06 20:54:55 +00:00
miham
fd330ce743 (svn r11769) -Update: WebTranslator2 update to 2008-01-06 19:58:01
brazilian_portuguese - 2 fixed, 15 changed by fukumori (17)
bulgarian  - 29 fixed, 10 changed by groupsky (39)
croatian   - 13 fixed by knovak (13)
czech      - 2 fixed by Hadez (2)
dutch      - 1 fixed by habell (1)
estonian   - 1 fixed by kristjans (1)
french     - 1 fixed, 1 changed by glx (2)
galician   - 38 fixed by Condex (38)
italian    - 1 fixed by lorenzodv (1)
japanese   - 1 fixed by ickoonite (1)
norwegian_bokmal - 1 fixed by brygge_2 (1)
romanian   - 1 fixed by kneekoo (1)
slovak     - 1 fixed by lengyel (1)
swedish    - 2 fixed by daishan (2)
ukrainian  - 2 fixed by mad (2)
2008-01-06 18:58:55 +00:00
rubidium
aeff6e5761 (svn r11768) -Codechange: move some terraform related gui stuff from main_gui.cpp to terraform_gui.cpp (and introduce terraform_gui.h). Based on a patch by Roujin. 2008-01-06 18:56:43 +00:00
smatz
f7a293f074 (svn r11767) -Fix: do not call rail specific functions when building road bridge
-Fix: missing space in terraform_gui.cpp
2008-01-06 11:39:40 +00:00
belugas
f9a592cfdd (svn r11766) -Codechange: Last fine tunings on smooth economy, by Sirkoz. 2008-01-06 01:06:12 +00:00
rubidium
279bfad275 (svn r11765) -Fix: compile warning (Roujin). 2008-01-05 22:34:04 +00:00
rubidium
f8f86420f8 (svn r11764) -Change: make the 'do characters exist in the current font file(s)' more robust. 2008-01-05 22:19:27 +00:00
smatz
e165aad4db (svn r11763) -Fix: update signal states after merging a company 2008-01-05 22:04:11 +00:00
glx
91be5d7531 (svn r11762) -Fix: compilation with DEBUG_DUMP_COMMANDS was broken 2008-01-05 21:42:34 +00:00
5d837282ee (svn r11761) -Codechange: Use appropriate variable types for NewGRF engine overrides, and adjust scope while there. 2008-01-05 15:39:22 +00:00
smatz
7302d8c88b (svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
-Fix: adding road/tram to tram/road bridge was cheaper by one tile
2008-01-04 19:45:29 +00:00
9299f76af4 (svn r11759) -Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match. Patch by Roujin. 2008-01-04 18:18:46 +00:00
6a13067931 (svn r11758) -Fix(ette): Populate 'void' cargo slots (unused slots in temperate and arctic) with default data as per pre-newcargo support. These slots are still disabled by default, but some NewGRFs (erroneously?) expect the default data. 2008-01-04 17:25:53 +00:00
belugas
6b37ab36ea (svn r11757) -Fix(r11727): Don't use a function's default parameter when the value can be (more adequately, even better) computed from another source.
Thanks peter1138.
2008-01-04 15:39:08 +00:00
1cd2c3d517 (svn r11756) -Fix: Out of bounds access caused if a vehicle's cargo amount was higher than its capacity when resolving sprite groups. 2008-01-04 13:40:23 +00:00
3182cbb332 (svn r11755) -Fix: Debug level string buffer was not long enough to contain all debug levels. 2008-01-04 10:09:57 +00:00
belugas
23fab42b2f (svn r11754) -Fix(r11753): One too much command separator (;). Thanks glx for spotting 2008-01-04 03:31:08 +00:00
belugas
c59ea520a7 (svn r11753) -Codechange: re-indent the switch case structures, as to be more code style oriented.
Hoping it makes the whole file easier to follow/read
2008-01-04 03:11:36 +00:00
belugas
b0ef12e0e9 (svn r11752) -Fix(r11745): Silence a MSVC warning (glx) 2008-01-04 03:04:19 +00:00
belugas
8f94ac8f03 (svn r11751) -Codechange: Enumify some widgets (and others) and while at it, apply some code style 2008-01-04 02:32:58 +00:00
glx
72afdb8d34 (svn r11750) -Revert (r11749): commited too much 2008-01-03 23:54:23 +00:00
glx
42bddcf723 (svn r11749) -Fix (r11352): when a bankrupted company is bought, reset vehicle color mapping so the vehicles use the new owner color 2008-01-03 23:50:58 +00:00
belugas
aebcd80088 (svn r11748) -Codechange: Remove magic numbers introduced on r11746 and r11727
-Codechange: A few bad coding style inadvertendly applied too
2008-01-03 14:33:10 +00:00
belugas
7e4b7e3ad4 (svn r11747) -Change: Return of the prodigal son (or something). Little update (but highly noticed) on the OpenTTD Team 2008-01-03 14:04:08 +00:00
belugas
6ce70b17ca (svn r11746) -Fix(r11727): Make sure that action 0A does follow the same new ordering of shore sprites. It was not considered in the missing shore patch 2008-01-03 02:39:06 +00:00
skidd13
ade37de6c6 (svn r11745) -Codechange: Unify the spinner widget drawing of the difficulty settings window and make its disabled state min max aware. 2008-01-02 23:59:11 +00:00
glx
6f7f4adffc (svn r11744) -Codechange: don't redefine snprintf when using MinGW Runtime 3.14 or superior, as it now have snprintf() and vsnprintf conform to C99 2008-01-02 18:42:51 +00:00
rubidium
19f8990f64 (svn r11743) -Fix [FS#1614]: group names got not deallocated in the command test run. 2008-01-01 22:39:11 +00:00
fa83291a76 (svn r11742) -Codechange [FS#1319]: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused. 2008-01-01 22:34:00 +00:00
47082fec5c (svn r11741) -Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves. 2008-01-01 22:24:18 +00:00
egladil
9a2547b5a7 (svn r11740) -Fix [FS#1610]: Modify and possibly discard key events for code points in the unicode private use area. 2008-01-01 18:55:15 +00:00
c94a6b8c78 (svn r11739) -Fix [FS#1609]: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out. 2008-01-01 18:35:31 +00:00
47d23eb003 (svn r11738) -Codechange: Refactor realistic acceleration's curve counting to use DirDiffs instead of local tables, and remove an unnecessary loop. 2008-01-01 18:12:17 +00:00
24784b7e0d (svn r11737) -Fix: Reinstate NewGRF-specified engine list order in autoreplace window. 2008-01-01 17:01:06 +00:00
miham
f0e9c0cfc9 (svn r11736) -Update: WebTranslator2 update to 2008-01-01 17:42:54
catalan    - 1 fixed by arnaullv (1)
german     - 4 fixed by chu (4)
hungarian  - 23 fixed by miham (23)
romanian   - 17 fixed, 2 changed by kneekoo (19)
slovenian  - 1 fixed by Necrolyte (1)
2008-01-01 16:43:31 +00:00
aab495604a (svn r11735) -Fix [FS#1574]: Don't reset loading indicator IDs when only reloading NewGRFs. 2008-01-01 15:06:37 +00:00
belugas
3dd61f423a (svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
-Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed.
As for the reason it did not work, each computer/OS has its reason.
2008-01-01 14:20:48 +00:00
a8611311ac (svn r11733) -Fix: Max speed for entering stations overrode the max speed of curves 2008-01-01 14:15:28 +00:00
a967a7287f (svn r11732) -Fix (r4150): elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype. 2008-01-01 14:00:31 +00:00
7031358cff (svn r11731) -Fix [FS#1582]: Clear sprite override data before performing NewGRF wagon attach callback. This stopped
the callback working for autoreplace and when moving wagons from train to train in a depot.
-Fix (r11724): Don't check wagon attach callback for the chain when moving a single wagon.
2007-12-31 21:51:16 +00:00
miham
d8f4a80b0a (svn r11730) -Update: WebTranslator2 update to 2007-12-31 19:55:44
catalan    - 1 fixed by arnaullv (1)
dutch      - 1 fixed by webfreakz (1)
estonian   - 1 fixed by kristjans (1)
french     - 1 fixed by glx (1)
german     - 27 fixed by moewe2 (27)
hungarian  - 21 fixed by miham (21)
italian    - 1 fixed by lorenzodv (1)
japanese   - 1 fixed by ickoonite (1)
korean     - 1 fixed by leejaeuk5 (1)
norwegian_bokmal - 23 fixed by jhsoby (23)
polish     - 2 fixed by meush (2)
portuguese - 96 fixed, 7 changed by nars (103)
slovak     - 1 fixed by lengyel (1)
spanish    - 12 fixed by eusebio (12)
swedish    - 13 fixed by ChrillDeVille (13)
turkish    - 14 fixed by jnmbk (14)
2007-12-31 18:56:39 +00:00
75472cbc16 (svn r11729) -Codechange: Don't rely on the first railtype's sprite offset being zero when drawing road stations. 2007-12-31 11:13:51 +00:00
rubidium
b1be9f0137 (svn r11728) -Fix [FS#1577]: if there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available. 2007-12-31 07:14:25 +00:00
belugas
8ee1faca6c (svn r11726) -Feature[newGRF]: Extend the Action 5, feature 0D usage. Patch by BigBB 2007-12-31 04:38:11 +00:00
belugas
31e2ed8b4c (svn r11725) -Codechange: less a magical number 2007-12-31 02:39:50 +00:00
rubidium
1a70eed58c (svn r11724) -Fix: make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time. 2007-12-30 21:35:48 +00:00
skidd13
566a24d6ee (svn r11723) -Feature: add initial support for Intel C Compiler on linux
-Codechange: silence a few warnings of ICC
2007-12-30 19:32:09 +00:00
glx
892e231aad (svn r11722) -Fix (r11703): invalid plural form 2007-12-30 16:34:32 +00:00
rubidium
a3b19fd50c (svn r11721) -Fix: do not disable NewGRFs for 'eternity' during games. 2007-12-29 23:49:48 +00:00
06d578d07e (svn r11720) -Codechange: [NewGRF] Add support for bit 30 of station tile layouts; forcing a sprite to always be opaque. 2007-12-29 21:06:54 +00:00
rubidium
e5e75bd8f8 (svn r11719) -Codechange: split sound.h in a header with types and one with functions. 2007-12-29 09:24:26 +00:00
egladil
6ae9302708 (svn r11718) -Fix [FS#1483]: Show the fullscreen modes available to the cocoa driver in windowed mode too. 2007-12-29 05:15:13 +00:00
smatz
108ab3b910 (svn r11717) -Fix [FS#1590]: make sure invalid players have all shares owned by PLAYER_SPECTATOR 2007-12-28 18:25:30 +00:00
glx
c87f20ff37 (svn r11716) -Fix [FS#1561]: don't put more than one Random() in function calls because parameter evaluation order is not guaranteed in the c++ standard (can lead to desyncs) 2007-12-28 16:21:29 +00:00
smatz
8e1f21e29b (svn r11715) -Fix: do not use GetTrackBits() for depots and waypoints while converting railtype 2007-12-28 15:27:12 +00:00
belugas
e9a039b845 (svn r11714) -Fix[FS#1569]: Do not allow player inauguration date on scenarios to be bigger than current year.
This will not (yet) be true if you are loading a scenario with the "-g" command line option.
2007-12-28 04:20:56 +00:00
belugas
5087a6cdd7 (svn r11713) -Codechange: Move some declarations and definitions in a more logical disposition 2007-12-28 03:14:55 +00:00
maedhros
e2efaaff87 (svn r11712) -Fix (r9315): Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids. 2007-12-27 20:49:44 +00:00
belugas
e67ed0a808 (svn r11711) -Codechange: Name the Save Load Dialog Mode enum 2007-12-27 17:29:27 +00:00
bjarni
6196fa01ab (svn r11710) -Feature: [build vehicles windows] added sorting for cost, running costs and speed to road vehicles and ships build windows 2007-12-27 15:47:08 +00:00
bjarni
2ecb31ae3f (svn r11709) -Fix [FS#1385 FS#1386]: [OSX] Compiles on Leopard with the default settings
-Change:                [OSX] configure will no longer enable static by default
   Turns out that Leopard can't handle static builds without the user installing extra libs
   The tradeoff is that now people might have to enable static manually if moving the binary around
2007-12-27 15:05:46 +00:00
egladil
6e1cae5256 (svn r11708) -Fix [FS#1598]: Removed include of variables.h as it was no longer needed and caused compilation to fail. 2007-12-27 14:45:10 +00:00
smatz
38f0e422ac (svn r11707) -Fix: do not allow refitting flooded (destroyed) vehicles 2007-12-27 14:10:47 +00:00
rubidium
384503e7d3 (svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes. 2007-12-27 13:35:39 +00:00
smatz
4e66f5a04b (svn r11705) -Fix [FS#1557]: trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process (possible desyncs) 2007-12-27 13:25:23 +00:00
rubidium
0b1d3e43e5 (svn r11704) -Codechange: remove another bunch of useless includes. 2007-12-26 23:04:26 +00:00
miham
c124792fd2 (svn r11703) -Update: WebTranslator2 update to 2007-12-26 17:33:24
estonian   - 16 changed by kristjans (16)
polish     - 94 fixed, 6 changed by meush (100)
russian    - 22 fixed by Smoky555 (22)
spanish    - 11 fixed by eusebio (11)
traditional_chinese - 25 fixed, 4 changed by xbddc (29)
2007-12-26 16:38:34 +00:00
rubidium
b9046c97fb (svn r11702) -Codechange: move all date related stuff to date*. 2007-12-26 13:50:40 +00:00
rubidium
2786d789a1 (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h). 2007-12-26 11:45:43 +00:00
rubidium
aac835171e (svn r11700) -Codechange: reduce the amount of unnecessary includes. 2007-12-25 23:42:52 +00:00
skidd13
6cb68b9144 (svn r11699) -Cleanup: Remove some headers from the project files which aren't there anymore 2007-12-25 18:25:25 +00:00
skidd13
59d6c5e157 (svn r11698) -Change: Make the abort/accept process of the difficulty window a bit less confusing
-Change: Make the highscore button in the difficulty window a bit more obvious
-Codechange: Enumify the window-widgets of the difficulty window
2007-12-25 15:56:41 +00:00
rubidium
0bd93f5c37 (svn r11697) -Fix [FS#1585]: strgen did not (always) compile properly. 2007-12-25 14:08:56 +00:00
rubidium
87bd412885 (svn r11696) -Fix: remove BUGS as that is not about any real bugs, but rather things noted in the development of the new bridges/elrail. 2007-12-25 14:03:06 +00:00
skidd13
7963963d98 (svn r11695) -Codechange: Converted the md5 algorithm to OOP
-Codechange: Adapt the md5 algorithm to the OpenTTD source
2007-12-25 13:59:21 +00:00
rubidium
b3f6c0734b (svn r11694) -Codechange: move more endianness related stuff to endian_func.hpp. 2007-12-25 13:28:09 +00:00
rubidium
429521a7d1 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 2007-12-25 11:26:07 +00:00
rubidium
bf98e25e43 (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed. 2007-12-25 09:48:53 +00:00
egladil
e2f79f0eb5 (svn r11690) -Fix: Since indices into the patch array is sent over the network having conditionally compiled entries in the table can cause desyncs. Moving them to the end will hide this issue, but it should really be solved in a better way. 2007-12-25 01:29:54 +00:00
smatz
17d1b522bc (svn r11689) -Fix: compilation error and most of warnings for gcc 4.3 2007-12-23 21:02:40 +00:00
egladil
22f79df328 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again. 2007-12-23 18:08:39 +00:00
skidd13
da5d3a7b3b (svn r11687) -Codechange: move some defines to a better place 2007-12-23 14:06:03 +00:00
glx
451abbecb1 (svn r11686) -Fix (r11684): win32 compilation was broken again :) 2007-12-23 13:31:24 +00:00
rubidium
970fd6220a (svn r11685) -Codechange: remove a few 'useless' includes. 2007-12-23 11:20:41 +00:00
rubidium
a773d45885 (svn r11684) -Codechange: split gfx.h in a type and functional header. 2007-12-23 10:56:02 +00:00
belugas
82d240e300 (svn r11683) -Fix(r11682): win32.cpp still requires gfx.h inclusion, at least for now. 2007-12-23 04:31:45 +00:00
rubidium
8f0e68285b (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type. 2007-12-22 23:30:28 +00:00
rubidium
a7d54cf946 (svn r11681) -Fix (r11674): hopefully fix the compile error on big endian machines. 2007-12-22 21:01:49 +00:00
rubidium
6a9e77e079 (svn r11680) -Codechange: refactor more out of openttd.h and functions.h. 2007-12-21 22:50:51 +00:00
glx
1b53dbf9cc (svn r11679) -Add: [newgrf] support for station vars 67 and 68 2007-12-21 22:11:55 +00:00
bjarni
18e96ab49f (svn r11678) -Fix (r11674): [OSX] fixed compilation 2007-12-21 22:08:59 +00:00
rubidium
9e9cfe6e59 (svn r11677) -Codechange: move price and command related types/functions to their respective places. 2007-12-21 21:50:46 +00:00
glx
65754b8d12 (svn r11676) -Fix (r11674): some references to macros.h were left 2007-12-21 21:16:14 +00:00
rubidium
433a9f3c09 (svn r11675) -Codechange: split the string types from the string functions. 2007-12-21 19:49:27 +00:00
rubidium
01e20c9140 (svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations. 2007-12-21 19:21:21 +00:00
rubidium
d5c4ba8246 (svn r11673) -Codechange: move the overflow safe type to a separate file. 2007-12-21 08:34:53 +00:00
rubidium
a6b1526c13 (svn r11672) -Codechange: refactor some stuff out of gui.h. 2007-12-21 07:38:36 +00:00
smatz
30c0d6da99 (svn r11671) -Fix: sometimes a vehicle was selected in the vehicle list when it was opened 2007-12-20 22:45:56 +00:00
smatz
4a80cf8482 (svn r11670) -Feature [FS#1565]: list neutral stations where the player has service in the station list too 2007-12-19 23:35:14 +00:00
rubidium
5b49e75453 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h 2007-12-19 23:26:02 +00:00
rubidium
d582aea639 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found. 2007-12-19 20:45:46 +00:00
rubidium
8896bea306 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps. 2007-12-19 19:44:29 +00:00
glx
a9dafdff48 (svn r11666) -Fix (r11504): when removing buoys, return to water or canal depending on their owner 2007-12-19 02:41:25 +00:00
belugas
b8196d36e7 (svn r11665) -Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08.
Fix directly inspired by Csaboka
2007-12-18 21:25:44 +00:00
rubidium
7db6c7db38 (svn r11664) -Codechange: use more specific ("rail_type.h" instead of "rail.h" that includes way more than only "rail_type.h") includes at some places. 2007-12-18 20:58:12 +00:00
rubidium
e4ef359f47 (svn r11663) -Codechange: moving of the road related types and functions. 2007-12-18 20:38:16 +00:00
rubidium
df0c6eb2b9 (svn r11662) -Codechange: move some rail types/related functions around. 2007-12-18 20:10:21 +00:00
rubidium
f56a354d31 (svn r11661) -Codechange: some header reworks in order to try to reduce the compile time of OpenTTD by reduce the amount of circular-ish dependencies. 2007-12-18 19:52:14 +00:00
miham
5dc1fcea04 (svn r11660) -Change: english -> english (uk), english_us ->english (us) 2007-12-18 18:08:51 +00:00
smatz
c26a265f21 (svn r11659) -Fix [FS#1563]: do not allow modifying non-uniform stations when non-uniform stations are disabled 2007-12-18 18:02:00 +00:00
glx
805ac40280 (svn r11658) -Fix (r11654): forgot project files 2007-12-17 23:30:25 +00:00
smatz
0b08f7370d (svn r11657) -Fix: show better error message when trying to convert rail
-Codechange: merge DoConvert functions into one, make test and exec runs the same for tunnels/bridges
2007-12-17 22:29:27 +00:00
smatz
bda9d4a236 (svn r11656) -Codechange: add ZOOM_LVL_BEGIN and postfix operators so ZoomLevel can be used in some iterations 2007-12-17 22:04:07 +00:00
miham
61dcdbf0e0 (svn r11655) -Update: WebTranslator2 update to 2007-12-17 20:16:03
danish     - 22 fixed by ThomasA (22)
estonian   - 18 fixed, 47 changed by kristjans (65)
italian    - 4 changed by lorenzodv (4)
norwegian_nynorsk - 20 fixed by pollux (20)
2007-12-17 19:16:53 +00:00
miham
6f526fd2e1 (svn r11654) -Change: renaming american languagefile to english_US 2007-12-17 18:49:51 +00:00
egladil
2885c66060 (svn r11653) -Feature: [OSX] Allow windowed mode subdrivers to be disabled at compile time. 2007-12-17 07:47:21 +00:00
smatz
93c3e0d6ad (svn r11652) -Codechange: add the svn $ header for several files 2007-12-17 01:35:45 +00:00
rubidium
9ecda0a97a (svn r11651) -Codechange [FS#1555]: implement GRF parameter querying for industries and fix a 'bug' as side effect. 2007-12-16 23:10:30 +00:00
rubidium
85b52f6a64 (svn r11650) -Fix: 'initialised' NewGRFs could still be deactivated in the later 'activation' pass. 2007-12-16 22:21:34 +00:00
smatz
145517fb8e (svn r11649) -Codechange: some code can be simplified thanks to changes in r11642 2007-12-16 19:30:42 +00:00
rubidium
0730b9afc1 (svn r11648) -Fix [FS#1560]: the company password was not set when one pressed the enter key. 2007-12-16 19:28:07 +00:00
rubidium
3bba097bb3 (svn r11647) -Fix (r11646): it did not compile without freetype... 2007-12-16 19:21:28 +00:00
rubidium
ff7ff890f9 (svn r11646) -Codechange: check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen. 2007-12-16 18:38:19 +00:00
glx
5e062d3f15 (svn r11645) -Fix (r8128): station ground tiles may have transparency or company colour 2007-12-16 17:50:09 +00:00
smatz
3cee0abdba (svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h 2007-12-16 15:38:51 +00:00
rubidium
ec90ce7e98 (svn r11643) -Codechange: conform with the coding style for the WP macro uses. 2007-12-16 10:54:08 +00:00
smatz
acf6e08f78 (svn r11642) -Codechange: VehicleFromPos does check for v->tile == tile, so remove useless checks 2007-12-15 23:11:18 +00:00
rubidium
cbcfcb3bf4 (svn r11641) -Add: configure time parameter to enable some desync debugging functionality. 2007-12-15 22:42:12 +00:00
rubidium
214d25905a (svn r11640) -Fix: missed change of include when moving stuff to random_func.cpp 2007-12-15 22:05:02 +00:00
smatz
701e9d27fc (svn r11639) -Codechange: simplify EnsureNoVehicleOnGround 2007-12-15 20:30:43 +00:00
smatz
d0ad7688f2 (svn r11638) -Codechange: use faster check in SignalVehicleCheck for tunnel/bridge 2007-12-15 19:46:34 +00:00
smatz
4b22e57b33 (svn r11637) -Fix: mark viewports dirty when removing visible vehicle chain 2007-12-15 16:11:29 +00:00
smatz
46724104fe (svn r11636) -Fix: it was possible to build/remove road/tram in tunnel/bridge when there was vehicle in it 2007-12-15 13:59:38 +00:00
belugas
828c242291 (svn r11635) -Codechange: Give a more informative debug message when encountering unknown newgrf feature in action 00 handling.(FS#1551, Bilbo) 2007-12-15 03:42:41 +00:00
smatz
5992187a85 (svn r11634) -Fix: update signals when deleting crashed train on a bridge, update even when train is rotated 2007-12-15 00:04:01 +00:00
smatz
4b7f8f04a3 (svn r11633) -Codechange: merge CheckTunnelEmpty and IsVehicleOnBridge into GetVehicleTunnelBridge 2007-12-14 23:21:20 +00:00
rubidium
dedb15786c (svn r11632) -Fix [FS#1541]: vehicles were still followed when sold. 2007-12-14 21:11:30 +00:00
glx
ea1ae563c7 (svn r11631) -Fix (r11585, r11626): remove MSVC warnings 2007-12-14 00:25:00 +00:00
rubidium
2921e7482b (svn r11630) -Fix [FS#1544] (r11556): the chat GUI got broken. 2007-12-13 23:26:00 +00:00
rubidium
a0f2366e40 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor. 2007-12-13 18:46:04 +00:00
miham
98d18c5337 (svn r11628) -Update: WebTranslator2 update to 2007-12-13 09:47:23
american   - 30 fixed by WhiteRabbit (30)
brazilian_portuguese - 22 fixed by fukumori (9), tucalipe (13)
bulgarian  - 8 fixed by thetitan (8)
catalan    - 22 fixed by arnaullv (22)
croatian   - 17 fixed by knovak (17)
czech      - 22 fixed by Hadez (22)
danish     - 1 fixed, 4 changed by Bjarni (5)
dutch      - 22 fixed by habell (22)
estonian   - 10 fixed by kristjans (10)
french     - 7 fixed, 2 changed by glx (9)
italian    - 7 fixed, 2 changed by lorenzodv (9)
japanese   - 23 fixed by ickoonite (23)
korean     - 33 fixed, 7 changed by leejaeuk5 (40)
norwegian_nynorsk - 9 fixed by pollux (9)
romanian   - 13 fixed, 3 changed by CrystyB (16)
slovak     - 22 fixed by lengyel (22)
slovenian  - 22 fixed by Necrolyte (22)
swedish    - 10 fixed by daishan (10)
turkish    - 20 fixed by jnmbk (20)
ukrainian  - 22 fixed by mad (22)
2007-12-13 08:53:09 +00:00
glx
1a8afc5fb4 (svn r11627) -Fix [FS#1532] (r11145): poping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order. 2007-12-13 02:04:09 +00:00
skidd13
1d9c27e235 (svn r11626) -Fix [FS#1529]: Pause state wasn't set correctly in multiplayer saves 2007-12-12 21:56:10 +00:00
smatz
5acc147c1c (svn r11625) -Codechange: add CO_* enum at some places, add includes of order.h too 2007-12-12 14:37:35 +00:00
belugas
e0646af976 (svn r11624) -Fix[FS#1530]: An error in the translation of bitset to scroll directions made it so that up-down-right arrow keys did scrolled up, while it should have scrolled right instead. It was initially interpreted as left-right-up. 2007-12-12 02:28:08 +00:00
smatz
ed54703db8 (svn r11623) -Fix [FS#1533] (r11619): assert when train is going over two crossings next to each other 2007-12-11 22:50:13 +00:00
rubidium
78ae599790 (svn r11622) -Codechange: support the unicode version of the 'control' characters. 2007-12-11 21:25:48 +00:00
rubidium
a5bcce4fc8 (svn r11621) -Fix [FS#1525]: there were still some cases where one could not build a tram track, but the tram could become blocked. 2007-12-11 20:28:53 +00:00
belugas
a85c832919 (svn r11620) -Change: Some are going, some are coming, some we do not know exactly. Little update on the OpenTTD Team 2007-12-11 19:59:53 +00:00
smatz
359c9aea3f (svn r11619) -Fix [FS#1531]: do not make crossing red behind depot the train is entering 2007-12-11 19:09:36 +00:00
glx
fb1d768924 (svn r11618) -Fix: buoys are just waypoints, so don't allow load/unload/transfert for them 2007-12-11 17:44:55 +00:00
belugas
6f73382317 (svn r11617) -Feature(ette): Add the same game-mode keyboard shortcuts in scenario more.(Bilbo) 2007-12-11 03:41:33 +00:00
rubidium
a1dbb10c26 (svn r11616) -Fix [FS#1526]: sometimes large values could go off the chart. 2007-12-10 22:26:24 +00:00
glx
ac7c79f039 (svn r11615) -Fix (r11609): temperate banks can only be built in towns (over a house) 2007-12-10 17:26:49 +00:00
skidd13
9124331b0d (svn r11614) -Fix: The about dialog scrolling was connected to the mouse instead of the internal ticks 2007-12-09 22:14:41 +00:00
487 changed files with 32902 additions and 30305 deletions

11
.gitignore vendored Normal file
View File

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

12
BUGS
View File

@@ -1,12 +0,0 @@
/* $Id$ */
KNOWN BUGS / PROBLEMS:
bridges:
- Clearing tiles which may not have a bridge above can cause random bridge pieces to appear, which leads to crash in the long run
electrified rails:
Normal and elrail depots look the same. Use 'X' (transparent buildings)
to distinguish between them
Missing curors / icons for construction (currently using the conventional ones)

View File

@@ -79,7 +79,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
@echo " Going to reconfigure with last known settings..."
@echo "----------------"
# Make sure we don't lock config.cache
@$(shell cat config.cache) || exit 1
@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
@echo "----------------"
@echo "Reconfig done. Now compiling..."
@echo "----------------"

View File

@@ -36,7 +36,7 @@ RES := $(shell mkdir -p $(BIN_DIR)/lang )
all: table/strings.h $(LANGS)
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h $(SRC_DIR)/table/control_codes.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
@@ -44,13 +44,17 @@ string.o: $(SRC_DIR)/string.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
lang/english.txt: $(LANG_DIR)/english.txt
$(Q)mkdir -p lang
$(Q)cp $(LANG_DIR)/english.txt lang/english.txt
$(STRGEN): string.o strgen.o
$(STRGEN): alloc_func.o string.o strgen.o
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) string.o strgen.o -o $@
$(Q)$(CXX_BUILD) $^ -o $@
table/strings.h: lang/english.txt $(STRGEN)
$(E) '$(STAGE) Generating $@'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,250 @@
0.6.0 (2008-04-01)
------------------------------------------------------------------------
- Fix: Final formatting of some string codes from NewGRFs was not done correctly [FS#1889] (r12488)
- Fix: Timetable times for aircraft were always doubled [FS#1883] (r12477)
- Fix: Remove broken endian-dependent code and unnecessary rgb to bgr swapping [FS#1880] (r12453)
- Fix: Do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection) [FS#1871] (r12439)
- Fix: Plural rule for Icelandic was wrong (r12417)
0.6.0-RC1 (2008-03-26)
------------------------------------------------------------------------
- Feature: Show whether a town is a "city" in the town description title bar (r12391)
- Feature: Increase house animation frame number from 32 to 128 (r12347)
- Fix: Loading of TTD savegames (r12399, r12401)
- Fix: Vehicle lists related to stations not closed when the station is deleted [FS#1872] (r12393)
- Fix: Trams failing to turn on bridge heads/tunnel entrances [FS#1851] (r123890)
- Fix: Train could break apart when reversed while partially in a depot [FS#1841] (r12386, r12384)
- Fix: Non-breaking spaces should not be broken (r12385)
- Fix: Check return of AfterLoadGame for success or failure when loading TTD games [FS#1860] (r12383)
- Fix: Use 'items' unit for batteries, fizzy drinks, toys and bubbles in total cargo tab [FS#1864] (r12382)
- Fix: The number of houses wasn't computed right [FS#1835, FS#1535] (r12381)
- Fix: Update train acceleration and max speed after setting cached value to ensure the correct max speed is used with disabled real acceleration (r12380)
- Fix: Refresh vehicle details window when cached values are updated (r12378)
- Fix: Set cached value for vehicle property 25 before other cached values [FS#1854] (r12377)
- Fix: Don't close a dropmenu when clicking on a dropdown widget (r12374)
- Fix: win32 music driver fails if path is too long or if containing non-latin chars [FS#1849] (r12373, r12372)
- Fix: Do not let window hide behind the main toolbar after resizing the screen [FS#1823] (r12371)
- Fix: Close language drop down when parent window is clicked/closed [FS#1853] (r12370)
- Fix: Reset train speed limits when _patches.realistic_acceleration changes (r12369)
- Fix: Commands were sent to clients waiting for map download causing 'executing command from the past' error [FS#1650] (r12367)
- Fix: Do not allow building 'zero' road bits (r12363)
- Fix: Randomize variable 8F only once per callback 28 (r12362)
- Fix: openttdd.grf was using the wrong colours for glyphs due to a grfcodec bug (fixed in grfcodec 0.9.10 r1837) (r12360)
- Fix: Some callback-results were treated as 8 bit, when they were 15 bit, and vice versa (r12352, r12358)
- Fix: Do not try to flood water tile [FS#1836] (r12350)
- Fix: NTP skipped junction just after bridge end (r12348)
- Fix: Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP [FS#1748, FS#1825] (r12346)
- Fix: Don't try to restore backupped timetable when timetabling is disabled [FS#1828] (r12345)
- Fix: Slow helicopters never got the 'chance' to finish the landing routine (r12343)
- Fix: GRM buffer for cargos was incorrect size [FS#1827] (r12341)
- Fix: Recalculate cached train data after clearing reversing flag when entering depot (r12339)
0.6.0-beta5 (2008-03-04)
------------------------------------------------------------------------
- Feature: Vehicle variable FE bit 5, 6 and 8 [FS#1812] (r12331, r12330)
- Feature: Support loading full range of 0xD0xx NewGRF strings which includes 0xD000 to 0xD3FF (r12316)
- Feature: Ability to change aircraft speed factor, from so called 'realistic' (matching other vehicles) (1/1) to original TTD speed (1/4) (r12293, r12294)
- Change: Update readme about where openttd looks for files (r12321)
- Fix: Don't pause/unpause the game when showing load/save windows when the game is paused due to missing GRFs [FS#1733] (r12336)
- Fix: Disallow building level crossings over one-way roads as this allowed competitors to remove the one-way state [FS#1819] (r12329)
- Fix: Wrong Y pillar specified for girder with arch bridge (r12328)
- Fix: Vehicles could be sorted in a wrong order when a vehicle name changed - cached name was not invalidated (r12324)
- Fix: Vehicle sorting by name was broken, it was comparing the same string (when caching was not used) [FS#1821] (r12323)
- Fix: Endian issue when saving/loading group owner (r12322)
- Fix: Wrong transparency options could be saved after toggling all [FS#1817] (r12320)
- Fix: Map string IDs that are embedded from other strings [FS#1815] (r12317)
- Fix: Include prop 25 data for all train parts, not just those that carry cargo (r12314)
- Fix: YAPF and NTP did not apply penalty for uphill tracks on steep slopes (r12313)
- Fix: Restore timetable from backupped orders and add group ID to the backup [FS#1549] (r12296)
- Fix: Do not draw trees nor lamps between tram tracks (r12290) [FS#1807]
- Fix: [Win32] Do not create save dir on install (r12269)
- Fix: Autoreplace did not update vehicle index for timetable window [FS#1805] (r12261)
- Fix: GetProductionAroundTiles() may fail if only the second production slot exists (r12258)
- Fix: Town variables 0x9E to 0xAD (company ratings) returned wrong values (r12247)
- Fix: Typo resulting in no players are given the engine preview offer (r12244)
- Fix: Mac OSX bundle display name should be 'OpenTTD' [FS#1798] (r12234)
- Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, show running cost of wagons if available (r12209)
- Fix: When loading a savegame fails, do not start creating a new game, just go straight back to the intro screen (r12202)
- Fix: Force AI to build rail or road instead of bridges if possible, so it doesn't build bridges everywhere (r12200)
- Fix: "Transparent buildings" now only toggles buildings, so show tick when buildings are transparent [FS#1789] (r12198)
- Fix: Show correct last year profit when the train had negative income [FS#1788] (r12197)
- Fix: There can be oil rigs at map borders, do not set water class for them [FS#1787] (r12195)
- Fix: Do not start overtaking if the RV reaches wrong-way one-way-road in the next tiles (r12191)
- Fix: Assert when trying to play tile sound at NW border of map (placing buyos, leveling land) [FS#1784] (r12186)
- Fix: Take into account possible loan when AI is deciding which bridge to build, so it won't build wooden bridges everytime (r12184)
0.6.0-beta4 (2008-02-18)
------------------------------------------------------------------------
- Feature: Allow buttons to resize in NewGRF settings window (r12172)
- Feature: Change colour of autorail and autoroad selection when Ctrl is pressed (r12167)
- Feature: Separate catenary transparency settings from building transparency settings (r12103)
- Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x' (r12102)
- Feature: Add some missing VarAction2 variables (r12124)
- Feature: Make snow appear on rail tiles dependant on track height, not on height of the lowest part of the tile (r12098)
- Feature: [NewGRF] Specify the purchase, rail and road description of a bridge (r12069)
- Feature: [NewGRF] Add support for var 12, Variational Action 2 (r12045)
- Feature: Allow trees on shore (r12029)
- Feature: Invisible trees are now separate from the building concept (r12022)
- Feature: Add support for passenger engine designation for AI-use, NewGRF property 0x08 for trains (r12019)
- Feature: Show all cargo sources (en-route from) in the station view cargo waiting list instead of just one (r11990)
- Feature: [NewGRF] Resizable industry view window on callback 3A (r11987)
- Feature: [NewGRF] Implement var 8F (random bits) during callback 28 [FS#1697] (r11985)
- Feature: [NewGRF] Add support for Action 0D, var 13: informations about current map size (r11961)
- Feature: Support Action5 type 0D (newwater) (r11947)
- Feature: Allow building bridge heads on more slopes (r11937)
- Feature: [NewGRF] Add support for Rivers. Rivers can currently only be placed with-in the scenario editor (r11926,r11938,r11949,r12071)
- Feature: Generate.vbs script to allow project files generation for users unable to run generate bash script (r12123)
- Feature: Sort the strings in languages dropdown (r11886)
- Codechange: Drop MSVC 2003 support (r11979)
- Fix: Test purchase list loading/loaded sprites instead of unconditionally returning a possibly non-existant sprite (r12180)
- Fix: Return correct bridge price for AI when DC_QUERY_COST is set [FS#609] (r12171)
- Fix: When drag&drop mode was cancelled by keyboard input, depot/group window wasn't updated [FS#337] (r12166)
- Fix: Buffer overflow when drawing scrolling news [FS#1652, FS#1773] (r12165)
- Fix: If a train is 'stopping' when entering a depot, do not let it leave again [FS#1705] (r12163)
- Fix: Towns shouldn't build over houses owned by another town [FS#1757] (r12162)
- Fix: Towns will no longer build houses > 1x1 there where should be road (with 2x2, 3x3 grid town layouts) (r12161)
- Fix: Remove the arbitrary limit of 64 waypoints per town [FS#1744] (r12160)
- Fix: Chance16I was now biased towards zero - round to nearest now (r12156)
- Fix: Adjust aircraft slowing algorithm (r12144)
- Fix: Callback 0x3D always gets a cargobit in var 0x18, independent of grf version [FS#1766] (r12142)
- Fix: Do not allow adding tram to rail-road crossing when there is a vehicle on it (r12138)
- Fix: Show cargo capacity for articulated vehicles correctly in the purchase list. Multiple cargo types can also now been shown [FS#1769] (r12137)
- Fix: With mammoth trains disabled, maximum train length was limited to 9 (r12131)
- Fix: Use tile index 0 for planes in the air, so it cannot have an invalid tile index [FS#1745] (r12109)
- Fix: X/Y axis swap for station tiles in GetNearbyTile() was wrong way around [FS#1753]( r12108)
- Fix: Loading older savegames fixes (r12096,r12097)
- Fix: When a company bankrupts, remove drive-through road stops, ship depots and buoys too. Update owners of water and road [FS#1703] (r12095)
- Fix: Do not set station owner for buoys when merging company (r12093)
- Fix: Keep production level within delimited boundaries, while using var result 0D/0E and than multiplying/dividing it [FS#1755] (r12092)
- Fix: Assert when loading savegame with wrong tiletype at south map borders (r12088)
- Fix: Check overrides only for industries when mapping newgrf entities to 'real' entities [FS#1747] (r12086)
- Fix: Update waypoint signs when changing language (r12080)
- Fix: Use search paths when opening console scripts (r12079)
- Fix: When reusing a renamed deleted waypoint, keep the new name (r12076)
- Fix: Make docks at sea flood neighboured tiles (r12072)
- Fix: Possible deadlock when there are no houses available to build at given tile (r12062)
- Fix: Houses with zero probability could be built (r12062)
- Fix: Do not clear tiles when the town won't be able to build any buildings anyway (r12060)
- Fix: Allow building 2x2 building on slopes if not explicitly forbidden (r12060)
- Fix: It was possible to build 2x1 and 1x2 buildings on slopes even if it was not allowed (r12060)
- Fix: Teach NPF where road vehicles and trams can reverse (r12058)
- Fix: Ships can drive through opponents' ship depots (r12058)
- Fix: Slowdown train when approaching 90deg turn when 90deg turns are forbidden (r12057)
- Fix: Enable YAPF to start searching inside a wormhole [FS#1704] (r12056)
- Fix: Another way to fix AI trying to build road through depots (r12055)
- Fix: The cargo translation table was loaded at the right time, but all the other global variables were now loaded too early [FS#1737] (r12052)
- Fix: Random_func broke for desync debug (r12050)
- Fix: Memset on multibyte array with wrong byte count (r12049)
- Fix: Crash when centering on a vehicle (aircraft) that is outside of the map [FS#1741] (r12044)
- Fix: Allow building transmitters and lighthouses on tree tiles [FS#1736] (r12043)
- Fix: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be stored for buoys, docks, locks and depots. All these are now allowed on rivers and removal of them will revert to the original water type [FS#1676] (r12042)
- Fix: Change ownership of or remove statues when merging/bankrupting companies (r12038)
- Fix: For station tiles, only get road types for road stops (r12036)
- Fix: Teach YAPF where trams can reverse, and where not [FS#1702] (r12035)
- Fix: Do not show train speed as zero after loading paused game (r12033)
- Fix: When removing a statue, remove town statue flag for the statue owner, not current player (r12032)
- Fix: Prevent towns from removing or claiming ownership of player owned tiles when growing [FS#1689,FS#1719] (r12031)
- Fix: In one case trees could spread under bridges (r12024)
- Fix: Put a better suited text in the quit-dialog [FS#1690] (r12023)
- Fix: Restore initial intent on the invisible tree while transparent building patch setting [FS#1721] (r12018)
- Fix: When you have more than 9 network interfaces you'll enter the wonderfull world of overflows (r12017)
- Fix: Better work on strings in regard to gender [FS#1716] (r12015)
- Fix: Lighthouses and transmitters were never supposed to be build on a slope (r12014)
- Fix: When modifying watered tiles, mark neighboured canals and rivers dirty in more cases (r12013)
- Fix: Enable TownRatingTestMode during cost estimation with 'shift'-key (r12012)
- Fix: Do not consider one-corner-raised-shores to be watered tiles from all sides [FS#1701] (r12011)
- Fix: Avoid loading sample.cat if it 'looks' incorrect, and avoid later null pointer dereferences by moving volume lookup deeper [FS#1707] (r12009)
- Fix: Possible reading from an invalid pointer [FS#1717] (r12005)
- Fix: When skipping Action 11 or 12, also skip belonging sprites (r12001)
- Fix: Do entrance-slope-check for every tile of railstations (r11999)
- Fix: Possible remote assert by setting bit 6 of p1 for CMD_REMOVE_ROAD [FS#1692] (r11998)
- Fix: Update train statusbar when stopping from zero speed [FS#1706] (r11996)
- Fix: Resize station/roadstop/dock/airport construction windows if cargo acceptance list is too long (r11993)
- Fix: When building two rail stations close to each other (with control) so they looked like one long track trains would see them as one (r11992)
- Fix: Resize autoreplace window to fit purchase information text if it is too large (r11989)
- Fix: Build system ignored changes to table/control_codes.h which require strgen to be rebuilt (r11986)
- Fix: Also draw corner shores under rail tracks (r11984)
- Fix: Use unicode glyph mapping to fix up missing/shuffled sprites in original data files instead of shuffling or skipping sprites directly [FS#1698] (r11981)
- Fix: Industries using results 0D/0E on callback cb29/35 were a bit too eager to close down (r11976)
- Fix: Shore and sea tiles under bridges were converted to canals in old savegames [FS#1684] (r11974)
- Fix: Use grass tiles for corner shores, if shores got replaced by ActionA [FS#1683] (r11973)
- Fix: Old AI shouldn't build fast planes with a small airport in orders(r11972)
- Fix: MP_ROAD can have railbits too - OPF searching over rail of diffen t owner behind crossing (r11967)
- Fix: OPF was searching through depots and normal road stops [FS#1403, FS#1506] (r11966)
- Fix: Tropic zone data was returned incorrectly [FS#1685] (r11964)
- Fix: NewAI couldn't build any road vehicles when there were any tram grfs loaded (r11958)
- Fix: Disallow building locks and docks on rapids [FS#1675] (r11956)
- Fix: Do not allow modifying roadbits when other roadtypes would need different foundation (r11953)
- Fix: Loading of very old savegames was broken (r11951)
- Fix: Slope detection of bridge ramps. Helps YAPF and Trolly (r11946)
- Fix: FileExists() failed for non latin paths (win32) (r11945)
- Fix: Allow building drive-through road/tram stops at road/tram track that has no owner (r11944)
- Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes (r11936)
- Fix: [Autoreplace] Single to dualhead locomotive replacefailed when player had enough money to replace and refit one but not enough to refit the last one as well [FS#1624] (r11929)
- Fix: [Autoreplace] Autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had (r11928)
- Fix: Loading old, pre savegame version 2, savegames (r11925)
- Fix: AI was reading wrong tile slope while building road bridge (r11917)
- Fix: set correctly crossing state after train reversal, train leaving crossing, train crash (r11900)
- Fix: Segmentation faults/wrong frees due uninitialized memory in the AI [FS#1658] (r11887)
- Fix: Assert when trying to remove rail from a house or industry tile [FS#1663,FS#1665-6-7-8,FS#1680,FS#1686-7-8 FS#1715 FS#1742 FS#1771 FS#1776](r11883)
- Fix: Crash in MP in vehicle group window if the currently selected group is deleted by another player (r11878)
- Fix: Another way to crash competitors' train in a station (r11877)
- Fix: Automatically sending aircraft to depot for autoreplace/renew is now triggered by the correct conditions (r11875)
- Fix: EngineHasReplacementForPlayer() didn't look in ALL_GROUP (r11872)
- Fix: Do not update signals after each tile when building/removing a large block of track/signals/station [FS#1074] (r11871)
- Fix: Slow down train when approaching tile we can't enter in more cases (r11870)
- Fix: Do not make crossing red when we can't enter it in any case (r11870)
0.6.0-beta3 (2008-01-16)
------------------------------------------------------------------------
- Feature: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names (r11822)
- Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match (r11759)
- Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves (r11741)
- Feature: Added sorting for cost, running costs and speed to road vehicles and ships build windows (r11710)
- Feature: List neutral stations where the player has service in the station list too (r11670)
- Feature: Check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen (r11646)
- Feature: Support shore replacement via Action 5 (r11726)
- Fix: When two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF [FS#1559] (r11862)
- Fix: Recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs [FS#1335] (r11855)
- Fix: Road vehicle count was incorrect in network lobby window (r11844)
- Fix: Mark dirty canal tile even in diagonal direction from flooded tile, draw correctly canal next to half flooded rail tile (r11843, r11838)
- Fix: At least one instance of dmusic driver is needed for it to be registered and usable (r11826)
- Fix: An articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile [FS#1627] (r11825)
- Fix: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots [FS#1602] (r11813)
- Fix: Do not crash trains when leaving depot to a very long track [FS#716] (r11802)
- Fix: Take town rating into account when testing if a command can be executed [FS#1616] (r11795)
- Fix: Reversing a train when loading at a station with an adjacent station in the same axis crashed [FS#1632] (r11794)
- Fix: Group names got not deallocated in the command test run [FS#1614] (r11743)
- Fix: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused [FS#1319] (r11742)
- Fix: Modify and possibly discard key events for code points in the unicode private use area [FS#1610] (r11740)
- Fix: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out [FS#1609] (r11739)
- Fix: Do not reset loading indicator IDs when only reloading NewGRFs [FS#1574] (r11735)
- Fix: Elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype (r11732)
- Fix: Clear sprite override data before performing NewGRF wagon attach callback. This stopped the callback working for autoreplace and when moving wagons from train to train in a depot [FS#1582] ( r11731)
- Fix: If there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available [FS#1577] (r11727)
- Fix: Make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time (r11724)
- Fix: Do not put more than one Random() in function calls because parameter evaluation order is not guaranteed in the C++ standard [FS#1561] (r11716)
- Fix: Do not allow player inauguration date on scenarios to be bigger than current year [FS#1569] (r11714)
- Fix: Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids (r11712)
- Fix: Do not allow refitting flooded (destroyed) vehicles (r11707)
- Fix: Trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process [FS#1557] (r11705)
- Fix: When removing buoys, return to water or canal depending on their owner (r11666)
- Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08 (r11665)
- Fix: Do not allow modifying non-uniform stations when non-uniform stations are disabled [FS#1563] (r11659)
- Fix: 'Initialised' NewGRFs could still be deactivated in the later 'activation' pass (r11650)
- Fix: Vehicles were still followed when sold [FS#1541] (r11632)
- Fix: Many viewports could crash the scenario editor [FS#1527] (r11629)
- Fix: Popping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order [FS#1532] (r11627)
- Fix: There were still some cases where one could not build a tram track, but the tram could become blocked [FS#1525] (r11621)
- Fix: Do not make crossing red behind depot the train is entering [FS#1531] (r11619)
- Fix: Buoys are just waypoints, so don't allow load/unload/transfert for them (r11618)
- Fix: Sometimes large values could go off the chart [FS#1526] (r11616)
- Fix: Temperate banks can only be built in towns (over a house) (r11615)
0.6.0-beta2 (2007-12-09)
------------------------------------------------------------------------

View File

@@ -5,7 +5,7 @@ log() {
}
set_default() {
released_version=""
released_version="0.6.0"
ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override
@@ -30,20 +30,22 @@ set_default() {
data_dir="share/games/openttd"
icon_dir="share/pixmaps"
personal_dir="1"
shared_dir="1"
install_dir="/"
enable_debug="0"
enable_desync_debug="0"
enable_profiling="0"
enable_dedicated="0"
enable_network="1"
enable_static="1"
enable_translator="0"
enable_assert="1"
enable_unicode="1"
enable_assert="0"
enable_strip="1"
enable_universal="1"
enable_osx_g5="0"
enable_unicode="1"
with_distcc="1"
with_ccache="1"
enable_cocoa_quartz="1"
enable_cocoa_quickdraw="1"
with_osx_sysroot="1"
with_application_bundle="1"
with_sdl="1"
@@ -61,8 +63,66 @@ set_default() {
with_fontconfig="1"
with_psp_config="1"
with_threads="1"
with_distcc="1"
with_ccache="1"
save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
save_params_array="
build
host
cc_build
cc_host
cxx_build
cxx_host
windres
strip
lipo
awk
os
endian
cpu_type
revision
config_log
prefix_dir
binary_dir
data_dir
icon_dir
personal_dir
shared_dir
install_dir
enable_debug
enable_desync_debug
enable_profiling
enable_dedicated
enable_network
enable_static
enable_translator
enable_unicode
enable_assert
enable_strip
enable_universal
enable_osx_g5
enable_cocoa_quartz
enable_cocoa_quickdraw
with_osx_sysroot
with_application_bundle
with_sdl
with_cocoa
with_zlib
with_png
with_makedepend
with_direct_music
with_sort
with_iconv
with_midi
with_midi_arg
with_libtimidity
with_freetype
with_fontconfig
with_psp_config
with_threads
with_distcc
with_ccache
CC CXX CFLAGS LDFLAGS"
}
detect_params() {
@@ -135,6 +195,10 @@ detect_params() {
--personal-dir=*) personal_dir="$optarg";;
--without-personal-dir) personal_dir="";;
--shared-dir) prevp_p="shared-dir";;
--shared-dir=*) shared_dir="$optarg";;
--without-shared-dir) shared_dir="";;
--install-dir) prevp_p="install-dir";;
--install-dir=*) install_dir="$optarg";;
@@ -142,6 +206,8 @@ detect_params() {
--enable-debug) enable_debug="1";;
--enable-debug=*) enable_debug="$optarg";;
--enable-desync-debug) enable_desync_debug="1";;
--enable-desync-debug=*) enable_desync_debug="$optarg";;
--enable-profiling) enable_profiling="1";;
--enable-profiling=*) enable_profiling="$optarg";;
--enable-dedicated) enable_dedicated="1";;
@@ -170,6 +236,13 @@ detect_params() {
--enable-unicode) enable_unicode="2";;
--enable-unicode=*) enable_unicode="$optarg";;
--disable-cocoa-quartz) enable_cocoa_quartz="0";;
--enable-cocoa-quartz) enable_cocoa_quartz="2";;
--enable-cocoa-quartz=*) enable_cocoa_quartz="$optarg";;
--disable-cocoa-quickdraw) enable_cocoa_quickdraw="0";;
--enable-cocoa-quickdraw) enable_cocoa_quickdraw="2";;
--enable-cocoa-quickdraw=*) enable_cocoa_quickdraw="$optarg";;
--with-sdl) with_sdl="2";;
--without-sdl) with_sdl="0";;
--with-sdl=*) with_sdl="$optarg";;
@@ -337,6 +410,13 @@ check_params() {
exit 1
fi
# enable_desync_debug should be between 0 and 3
if [ -z "`echo $enable_desync_debug | egrep '^[012]$'`" ]; then
echo "configure: error: invalid option --enable-desync-debug=$enable_desync_debug"
echo " Available options are: --enable-desync-debug[=012]"
exit 1
fi
detect_awk
check_build
@@ -376,7 +456,7 @@ check_params() {
detect_cputype
if [ "$enable_static" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "OSX" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ]; then
enable_static="2"
else
enable_static="0"
@@ -419,6 +499,17 @@ check_params() {
log 1 "using debug level... level $enable_debug"
fi
if [ "$enable_desync_debug" = "0" ]; then
log 1 "using desync debug level... no"
else
log 1 "using desync debug level... level $enable_desync_debug"
log 1 "WARNING: desync debug functions slow down the game considerably."
log 1 "WARNING: use only when you are instructed to do so"
log 1 " or when you know what you are doing."
sleep 5
fi
detect_sdl
detect_cocoa
@@ -544,7 +635,7 @@ check_params() {
distcc="$with_distcc"
fi
if [ "$with_distcc" != "0" ]; then
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 0-6`"
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 1-6`"
if [ "$res" != "distcc" ]; then
distcc=""
log 1 "checking distcc... no"
@@ -573,7 +664,7 @@ check_params() {
ccache="$with_ccache"
fi
if [ "$with_ccache" != "0" ]; then
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 0-6`"
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 1-6`"
if [ "$res" != "ccache" ]; then
ccache=""
log 1 "checking ccache... no"
@@ -729,6 +820,15 @@ check_params() {
fi
fi
if [ "$shared_dir" = "1" ]; then
# we are using default values
if [ "$os" = "OSX" ]; then
shared_dir="/Library/Application\\\\ Support/OpenTTD"
else
shared_dir=""
fi
fi
if [ -n "$personal_dir" ]
then
log 1 "personal home directory... $personal_dir"
@@ -736,6 +836,13 @@ check_params() {
log 1 "personal home directory... none"
fi
if [ -n "$shared_dir" ]
then
log 1 "shared data directory... $shared_dir"
else
log 1 "shared data directory... none"
fi
if [ -n "$install_dir" ]
then
log 1 "installation directory... $install_dir"
@@ -799,60 +906,70 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DNO_THREADS"
fi
# Enable some things only for certain GCC versions
cc_version=`$cc_host -dumpversion | cut -c 1,3`
if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
# Enable some things only for certain ICC versions
cc_version=`$cc_host -dumpversion | cut -c 1-4`
if [ $cc_version -ge 29 ]; then
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
CFLAGS="$CFLAGS -Wno-uninitialized"
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
fi
if [ "$cc_version" = "10.1" ]; then
CFLAGS="$CFLAGS -Wno-multichar"
fi
else
# Enable some things only for certain GCC versions
cc_version=`$cc_host -dumpversion | cut -c 1,3`
gcc295=""
if [ "$cc_version" = 29 ]; then
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
# need a lovely hack there to make it compile correctly.
gcc295="1"
fi
if [ $cc_version -ge 29 ]; then
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
CFLAGS="$CFLAGS -Wno-uninitialized"
if [ $cc_version -ge 30 ]; then
CFLAGS="$CFLAGS -W -Wno-unused-parameter"
fi
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
fi
if [ $cc_version -ge 34 ]; then
CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
fi
gcc295=""
if [ "$cc_version" = 29 ]; then
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
# need a lovely hack there to make it compile correctly.
gcc295="1"
fi
if [ "$os" = "CYGWIN" ]; then
CFLAGS="$CFLAGS -mwin32"
LDFLAGS="$LDFLAGS -mwin32"
fi
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
fi
if [ $cc_version -ge 30 ]; then
CFLAGS="$CFLAGS -W -Wno-unused-parameter"
fi
if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
fi
if [ $cc_version -ge 34 ]; then
CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
fi
# GCC 4.0+ complains about that we break strict-aliasing.
# On most places we don't see how to fix it, and it doesn't
# break anything. So disable strict-aliasing to make the
# compiler all happy.
if [ $cc_version -ge 40 ]; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
if [ "$os" = "CYGWIN" ]; then
CFLAGS="$CFLAGS -mwin32"
LDFLAGS="$LDFLAGS -mwin32"
fi
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
fi
# GCC 4.2+ automatically assumes that signed overflows do
# not occur in signed arithmetics, whereas we are not
# sure that they will not happen. It furthermore complains
# about it's own optimized code in some places.
if [ $cc_version -ge 42 ]; then
CFLAGS="$CFLAGS -fno-strict-overflow"
if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
fi
# GCC 4.0+ complains about that we break strict-aliasing.
# On most places we don't see how to fix it, and it doesn't
# break anything. So disable strict-aliasing to make the
# compiler all happy.
if [ $cc_version -ge 40 ]; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
# GCC 4.2+ automatically assumes that signed overflows do
# not occur in signed arithmetics, whereas we are not
# sure that they will not happen. It furthermore complains
# about it's own optimized code in some places.
if [ $cc_version -ge 42 ]; then
CFLAGS="$CFLAGS -fno-strict-overflow"
fi
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
@@ -922,6 +1039,14 @@ make_cflags_and_ldflags() {
if [ "$with_cocoa" != "0" ]; then
CFLAGS="$CFLAGS -DWITH_COCOA"
LIBS="$LIBS -F/System/Library/Frameworks -framework Cocoa -framework Carbon -framework AudioUnit"
if [ "$enable_cocoa_quartz" != "0" ]; then
CFLAGS="$CFLAGS -DENABLE_COCOA_QUARTZ"
fi
if [ "$enable_cocoa_quickdraw" != "0" ]; then
CFLAGS="$CFLAGS -DENABLE_COCOA_QUICKDRAW"
fi
fi
if [ "$with_zlib" != "0" ]; then
@@ -1052,6 +1177,13 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DNDEBUG"
fi
if [ "$enable_desync_debug" = "1" ]; then
CFLAGS="$CFLAGS -DDEBUG_DUMP_COMMANDS"
fi
if [ "$enable_desync_debug" = "2" ]; then
CFLAGS="$CFLAGS -DRANDOM_DEBUG"
fi
if [ "$enable_osx_g5" != "0" ]; then
CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
fi
@@ -1065,6 +1197,10 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
fi
if [ -n "$shared_dir" ]; then
CFLAGS="$CFLAGS -DWITH_SHARED_DIR -DSHARED_DIR=\\\\\"$shared_dir\\\\\""
fi
CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
@@ -1524,6 +1660,19 @@ detect_cocoa() {
fi
log 1 "checking COCOA... found"
if [ "$enable_cocoa_quartz" != "0" ]; then
log 1 "checking whether to enable the Quartz window subdriver... yes"
else
log 1 "checking whether to enable the Quartz window subdriver... no"
fi
if [ "$enable_cocoa_quickdraw" != "0" ]; then
log 1 "checking whether to enable the Quickdraw window subdriver... yes"
else
log 1 "checking whether to enable the Quickdraw window subdriver... no"
fi
}
detect_library() {
@@ -2022,6 +2171,7 @@ make_sed() {
s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
s#!!PERSONAL_DIR!!#$personal_dir#g;
s#!!SHARED_DIR!!#$shared_dir#g;
s#!!INSTALL_DIR!!#$install_dir#g;
s#!!STRGEN!!#$STRGEN#g;
s#!!ENDIAN_CHECK!!#$ENDIAN_CHECK#g;
@@ -2162,12 +2312,16 @@ showhelp() {
echo " [share/games/openttd]"
echo " --icon-dir=dir location of icons. Will be prefixed"
echo " with the prefix-dir [share/pixmaps]"
echo " --personal-dir=dir location of the personal directory [.openttd]"
echo " --personal-dir=dir location of the personal directory"
echo " [os-dependent default]"
echo " --shared-dir=dir location of shared data files"
echo " [os-dependent default]"
echo " --install-dir=dir specifies the root to install to."
echo " Useful to install into jails [/]"
echo ""
echo "Features and packages:"
echo " --enable-debug[=LVL] enable debug-mode (LVL=[0123], 0 is release)"
echo " --enable_desync_debug=[LVL] enable desync debug options (LVL=[012], 0 is none"
echo " --enable-profiling enables profiling"
echo " --enable-dedicated compile a dedicated server (without video)"
echo " --enable-static enable static compile (doesn't work for"
@@ -2175,11 +2329,13 @@ showhelp() {
echo " --enable-translator enable extra output for translators"
echo " --enable-universal enable universal builds (OSX ONLY)"
echo " --enable-osx-g5 enables optimalizations for G5 (OSX ONLY)"
echo " --disable-cocoa-quartz disable the quartz window mode driver for Cocoa (OSX ONLY)"
echo " --disable-cocoa-quickdraw disable the quickdraw window mode driver for Cocoa (OSX ONLY)"
echo " --disable-unicode disable unicode support to build win9x"
echo " version (Win32 ONLY)"
echo " --disable-network disable network support"
echo " --disable-assert disable asserts (continue on errors)"
echo " --disable-strip disable any possible stripping"
echo " --enable-strip enable any possible stripping"
echo " --without-osx-sysroot disable the automatic adding of sysroot "
echo " (OSX ONLY)"
echo " --without-application-bundle disable generation of application bundle"

4
configure vendored
View File

@@ -31,13 +31,13 @@ LANG_DIR="$SRC_DIR/lang"
MEDIA_DIR="$ROOT_DIR/media"
SOURCE_LIST="$ROOT_DIR/source.list"
if [ "$1" = "--reconfig" ]; then
if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
if ! [ -f "config.cache" ]; then
echo "can't reconfigure, because never configured before"
exit 1
fi
# Make sure we don't lock config.cache
cat config.cache > cache.tmp
cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
sh cache.tmp
rm -f cache.tmp
exit $?

View File

@@ -6,11 +6,11 @@ PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!!
SUPPORTED MSVC COMPILERS
------------------------
OpenTTD includes projects for MSVC 2003.NET and MSVC 2005.NET. Both will
OpenTTD includes projects for MSVC 2005.NET and MSVC 2008.NET. Both will
compile out of the box, providing you have the required libraries/headers;
which ones, see below. There is no support for VS6, you are therefore
strongly encouraged to either upgrade to MSVC 2005 Express (free) or use GCC.
MSVC 2002 probably works as well, but it has not been tested.
which ones, see below. There is no support for VS6 or MSVC 2002, or
MSVC 2003.NET. You are therefore strongly encouraged to either upgrade to
MSVC 2005 Express (free) or use GCC.
1) REQUIRED FILES
@@ -74,20 +74,6 @@ NOTE: make sure that the directory for the DirectX SDK is the first one in the
list, above all others, otherwise compilation will most likely fail!!
2.3) DEBUGGING - WORKING DIRECTORY (MSVC 2003 ONLY!)
----------------------------------------------------
The very first time you check out and compile OpenTTD with Visual Studio 2003, running
the binary will complain about missing files. You need to go into and change a setting
OpenTTD > Project > Properties > Configuration (All Configurations) > ...
Configuration Properties > Debugging >
* Working Directory: ..\bin
VS 2005 works out of the box because Microsoft allowed a user to supply a humanly-
readable defaults file (openttd_vs80.vcproj.user), whereas 2003 is braindead.
3) TTD GRAPHICS FILES
---------------------
Copy the following files from Transport Tycoon Deluxe to the bin/data folder
@@ -102,12 +88,12 @@ Copy the following files from Transport Tycoon Deluxe to the bin/data folder
4) COMPILING
------------
Open trunk/openttd[_vs80].sln
Open trunk/openttd_vs[89]0.sln
Set the build mode to 'Release' in
Build > Configuration manager > Active solution configuration > select "Release"
Compile...
If everything works well the binary should be in trunk/objs/[Win32]/Release/openttd.exe
If everything works well the binary should be in trunk/objs/Win[32|64]/Release/openttd.exe
5) EDITING, CHANGING SOURCE CODE
@@ -126,4 +112,4 @@ to ask about reasons; or just wait. The problem will most likely solve itself
within a few days as the problem is noticed and fixed.
An up-to-date version of this README can be found on the wiki:
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -11,21 +11,24 @@ by the number below on http://bugs.openttd.org.
If the bug report is closed, it has been fixed, which then can be verified
in the latest SVN version of /trunk.
Bugs for 0.6.0-beta1
Bugs for 0.6.0
------------------------------------------------------------------------
URL: http://bugs.openttd.org
- 1519 Full screen issues in windows
- 1495 Long vehicles block multistop station
- 1487 Ending_year is never written to
- 1891 Go to depot for servicing is forgotten
- 1890 Airplanes copy helipcopters goto heliport order
- 1885 Almost all unserved industries die in big maps
- 1868 In depot, cannot move wagon from another line before first wagon in a wagon-only line
- 1858 Industry legend in small map overwrites buttons
- 1852 Minor tram reversing glitches
- 1802 Path with space in configure fails
- 1793 Inconsistent travel time for fast trains
- 1762 Strange Autoreplace behaviour
- 1752 User input is not checked
- 1693 Removing road does not reset owner
- 1473 Train not going to available platform
- 1404 Spinner widget interprets one click as many
- 1386 Mac OS X fails to compile out of the box on 10.5
- 1264 Autoreplace for multiple NewGRF DMU sets fails
- 1200 Illegal names skip comparisons for uniquity
- 1141 [OSX] Not smooth moving map with touchpad
- 1109 [OSX] Choppy mouse cursor movement in fullscreen mode
- 1074 Large slowdown when building tracks
- 1140 [OSX] Not smooth moving map with touchpad
- 1072 Text overflows in several windows
- 716 Train crash in depot with long long tracks
- 119 Clipping problems with vehicles on slopes

View File

@@ -1,8 +1,32 @@
openttd (0.6~svn) unstable; urgency=low
openttd (0.6.0) unstable; urgency=low
* Unreleased SVN version. Versioned to allow normal upgrades to released versions.
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 26 Feb 2007 21:07:05 +0100
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 01 Apr 2008 13:33:37 +0100
openttd (0.6.0~RC1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 26 Mar 2008 15:51:40 +0100
openttd (0.6.0~beta5-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 04 Mar 2008 18:06:31 +0100
openttd (0.6.0~beta4-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 18 Feb 2008 20:09:29 +0100
openttd (0.6.0~beta3-1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 16 Jan 2008 21:40:07 +0100
openttd (0.6.0~beta2-1) unstable; urgency=low

View File

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

View File

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

View File

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

75
os/rpm/openttd.spec Normal file
View File

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

Binary file not shown.

View File

@@ -1,9 +1,9 @@
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "0.6.0" ; Define application version
!define INSTALLERVERSION 40 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define INSTALLERVERSION 45 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define APPURLLINK "http://www.openttd.org"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}-beta1"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
!define MUI_ICON "..\..\..\media\openttd.ico"
@@ -97,8 +97,6 @@ Section "!OpenTTD" Section1
; Overwrite files by default, but don't complain on failure
SetOverwrite try
; Make savegame folder
SetOutPath "$INSTDIR\save"
; Define root variable relative to installer
!define PATH_ROOT "..\..\..\"

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

@@ -53,6 +53,43 @@ Sub UpdateFiles(version)
UpdateFile revision, version, cur_date, "../src/ottdres.rc"
End Sub
Function ReadRegistryKey(shive, subkey, valuename, architecture)
Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
' First, get the Registry Provider for the requested architecture
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objReg = objServices.Get("StdRegProv")
' Check the hive and give it the right value
Select Case shive
Case "HKCR", "HKEY_CLASSES_ROOT"
hiveKey = &h80000000
Case "HKCU", "HKEY_CURRENT_USER"
hiveKey = &H80000001
Case "HKLM", "HKEY_LOCAL_MACHINE"
hiveKey = &h80000002
Case "HKU", "HKEY_USERS"
hiveKey = &h80000003
Case "HKCC", "HKEY_CURRENT_CONFIG"
hiveKey = &h80000005
Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
hiveKey = &h80000006
Case Else
MsgBox "Hive not valid (ReadRegistryKey)"
End Select
Set Inparams = objReg.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = hiveKey
Inparams.Ssubkeyname = subkey
Inparams.Svaluename = valuename
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
ReadRegistryKey = Outparams.SValue
End Function
Function DetermineSVNVersion()
Dim WshShell, version, url, oExec, line
Set WshShell = CreateObject("WScript.Shell")
@@ -61,27 +98,35 @@ Function DetermineSVNVersion()
' Try TortoiseSVN
' Get the directory where TortoiseSVN (should) reside(s)
Dim sTortoise
sTortoise = WshShell.RegRead("HKLM\SOFTWARE\TortoiseSVN\Directory")
' First, try with 32-bit architecture
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 32)
If sTortoise = Nothing Then
' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 64)
End If
Dim file
' Write some "magic" to a temporary file so we can acquire the svn revision/state
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
file.WriteLine "r$WCREV$$WCMODS?M:$"
file.WriteLine "$WCURL$"
file.Close
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
' Wait till the application is finished ...
Do
OExec.StdOut.ReadLine()
Loop While Not OExec.StdOut.atEndOfStream
' If TortoiseSVN is installed, try to get the revision number
If sTortoise <> Nothing Then
Dim file
' Write some "magic" to a temporary file so we can acquire the svn revision/state
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
file.WriteLine "r$WCREV$$WCMODS?M:$"
file.WriteLine "$WCURL$"
file.Close
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
' Wait till the application is finished ...
Do
OExec.StdOut.ReadLine()
Loop While Not OExec.StdOut.atEndOfStream
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
version = file.ReadLine
url = file.ReadLine
file.Close
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
version = file.ReadLine
url = file.ReadLine
file.Close
Set file = FSO.GetFile("tsvn_tmp")
file.Delete
Set file = FSO.GetFile("tsvn_tmp")
file.Delete
End If
' Looks like there is no TortoiseSVN installed either. Then we don't know it.
If InStr(version, "$") Then
@@ -194,7 +239,7 @@ Function IsCachedVersion(version)
End Function
Dim version
version = DetermineSVNVersion
version = "0.6.0"
If Not (IsCachedVersion(version) And FSO.FileExists("../src/rev.cpp") And FSO.FileExists("../src/ottdres.rc")) Then
UpdateFiles version
End If

View File

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

183
projects/generate.vbs Executable file
View File

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

View File

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

View File

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

View File

@@ -61,21 +61,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\american.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating american language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\american.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\brazilian_portuguese.txt"
>
@@ -196,6 +181,21 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\english_US.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating english_US language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\english_US.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\esperanto.txt"
>

View File

@@ -62,21 +62,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\american.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating american language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\american.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\brazilian_portuguese.txt"
>
@@ -197,6 +182,21 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\english_US.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating english_US language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs="..\bin\lang\english_US.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\esperanto.txt"
>

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -455,6 +455,10 @@
RelativePath=".\..\src\airport.cpp"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.cpp"
>
@@ -467,6 +471,10 @@
RelativePath=".\..\src\aystar.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\bmp.cpp"
>
@@ -495,14 +503,6 @@
RelativePath=".\..\src\console_cmds.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\currency.cpp"
>
@@ -527,6 +527,10 @@
RelativePath=".\..\src\driver.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\economy.cpp"
>
@@ -667,6 +671,10 @@
RelativePath=".\..\src\rail.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\rev.cpp"
>
@@ -691,6 +699,10 @@
RelativePath=".\..\src\settings.cpp"
>
</File>
<File
RelativePath=".\..\src\signal.cpp"
>
</File>
<File
RelativePath=".\..\src\signs.cpp"
>
@@ -728,7 +740,7 @@
>
</File>
<File
RelativePath=".\..\src\tile.cpp"
RelativePath=".\..\src\tile_map.cpp"
>
</File>
<File
@@ -771,10 +783,30 @@
RelativePath=".\..\src\airport_movement.h"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_base.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_func.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_gui.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_type.h"
>
</File>
<File
RelativePath=".\..\src\autoslope.h"
>
@@ -783,10 +815,26 @@
RelativePath=".\..\src\aystar.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\bmp.h"
>
</File>
<File
RelativePath=".\..\src\bridge.h"
>
</File>
<File
RelativePath=".\..\src\callback_table.h"
>
</File>
<File
RelativePath=".\..\src\cargo_type.h"
>
</File>
<File
RelativePath=".\..\src\cargopacket.h"
>
@@ -796,31 +844,31 @@
>
</File>
<File
RelativePath=".\..\src\command.h"
RelativePath=".\..\src\cmd_helper.h"
>
</File>
<File
RelativePath=".\..\src\command_func.h"
>
</File>
<File
RelativePath=".\..\src\command_type.h"
>
</File>
<File
RelativePath=".\..\src\console.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\currency.h"
>
</File>
<File
RelativePath=".\..\src\date.h"
RelativePath=".\..\src\date_func.h"
>
</File>
<File
RelativePath=".\..\src\date_type.h"
>
</File>
<File
@@ -836,7 +884,11 @@
>
</File>
<File
RelativePath=".\..\src\direction.h"
RelativePath=".\..\src\direction_func.h"
>
</File>
<File
RelativePath=".\..\src\direction_type.h"
>
</File>
<File
@@ -848,13 +900,33 @@
>
</File>
<File
RelativePath=".\..\src\economy.h"
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\economy_func.h"
>
</File>
<File
RelativePath=".\..\src\economy_type.h"
>
</File>
<File
RelativePath=".\..\src\core\endian_func.hpp"
>
</File>
<File
RelativePath=".\..\src\engine.h"
>
</File>
<File
RelativePath=".\..\src\core\enum_type.hpp"
>
</File>
<File
RelativePath=".\..\src\fileio.h"
>
@@ -876,7 +948,15 @@
>
</File>
<File
RelativePath=".\..\src\gfx.h"
RelativePath=".\..\src\core\geometry_type.hpp"
>
</File>
<File
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
>
</File>
<File
@@ -887,6 +967,10 @@
RelativePath=".\..\src\group.h"
>
</File>
<File
RelativePath=".\..\src\group_gui.h"
>
</File>
<File
RelativePath=".\..\src\gui.h"
>
@@ -896,11 +980,11 @@
>
</File>
<File
RelativePath=".\..\src\helpers.hpp"
RelativePath=".\..\src\industry.h"
>
</File>
<File
RelativePath=".\..\src\industry.h"
RelativePath=".\..\src\industry_type.h"
>
</File>
<File
@@ -912,11 +996,7 @@
>
</File>
<File
RelativePath=".\..\src\macros.h"
>
</File>
<File
RelativePath=".\..\src\map.h"
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
@@ -951,6 +1031,10 @@
RelativePath=".\..\src\network\network_gui.h"
>
</File>
<File
RelativePath=".\..\src\network\network_internal.h"
>
</File>
<File
RelativePath=".\..\src\network\network_server.h"
>
@@ -987,6 +1071,10 @@
RelativePath=".\..\src\newgrf_engine.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.h"
>
@@ -1055,18 +1143,38 @@
RelativePath=".\..\src\openttd.h"
>
</File>
<File
RelativePath=".\..\src\order.h"
>
</File>
<File
RelativePath=".\..\src\core\overflowsafe_type.hpp"
>
</File>
<File
RelativePath=".\..\src\pathfind.h"
>
</File>
<File
RelativePath=".\..\src\player.h"
RelativePath=".\..\src\player_base.h"
>
</File>
<File
RelativePath=".\..\src\player_face.h"
>
</File>
<File
RelativePath=".\..\src\player_func.h"
>
</File>
<File
RelativePath=".\..\src\player_gui.h"
>
</File>
<File
RelativePath=".\..\src\player_type.h"
>
</File>
<File
RelativePath=".\..\src\queue.h"
>
@@ -1075,10 +1183,42 @@
RelativePath=".\..\src\rail.h"
>
</File>
<File
RelativePath=".\..\src\rail_gui.h"
>
</File>
<File
RelativePath=".\..\src\rail_type.h"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\road_cmd.h"
>
</File>
<File
RelativePath=".\..\src\road_func.h"
>
</File>
<File
RelativePath=".\..\src\road_gui.h"
>
</File>
<File
RelativePath=".\..\src\road_internal.h"
>
</File>
<File
RelativePath=".\..\src\road_type.h"
>
</File>
<File
RelativePath=".\..\src\roadveh.h"
>
</File>
<File
RelativePath=".\..\src\saveload.h"
>
@@ -1096,7 +1236,23 @@
>
</File>
<File
RelativePath=".\..\src\settings.h"
RelativePath=".\..\src\settings_func.h"
>
</File>
<File
RelativePath=".\..\src\settings_internal.h"
>
</File>
<File
RelativePath=".\..\src\settings_type.h"
>
</File>
<File
RelativePath=".\..\src\ship.h"
>
</File>
<File
RelativePath=".\..\src\signal_func.h"
>
</File>
<File
@@ -1104,11 +1260,19 @@
>
</File>
<File
RelativePath=".\..\src\slope.h"
RelativePath=".\..\src\slope_func.h"
>
</File>
<File
RelativePath=".\..\src\sound.h"
RelativePath=".\..\src\slope_type.h"
>
</File>
<File
RelativePath=".\..\src\sound_func.h"
>
</File>
<File
RelativePath=".\..\src\sound_type.h"
>
</File>
<File
@@ -1132,7 +1296,27 @@
>
</File>
<File
RelativePath=".\..\src\string.h"
RelativePath=".\..\src\string_func.h"
>
</File>
<File
RelativePath=".\..\src\string_type.h"
>
</File>
<File
RelativePath=".\..\src\strings_func.h"
>
</File>
<File
RelativePath=".\..\src\strings_type.h"
>
</File>
<File
RelativePath=".\..\src\terraform_gui.h"
>
</File>
<File
RelativePath=".\..\src\textbuf_gui.h"
>
</File>
<File
@@ -1148,7 +1332,11 @@
>
</File>
<File
RelativePath=".\..\src\tile.h"
RelativePath=".\..\src\tile_cmd.h"
>
</File>
<File
RelativePath=".\..\src\tile_type.h"
>
</File>
<File
@@ -1159,6 +1347,18 @@
RelativePath=".\..\src\town.h"
>
</File>
<File
RelativePath=".\..\src\town_type.h"
>
</File>
<File
RelativePath=".\..\src\track_func.h"
>
</File>
<File
RelativePath=".\..\src\track_type.h"
>
</File>
<File
RelativePath=".\..\src\train.h"
>
@@ -1171,12 +1371,24 @@
RelativePath=".\..\src\transparency_gui.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge.h"
>
</File>
<File
RelativePath=".\..\src\unmovable.h"
>
</File>
<File
RelativePath=".\..\src\variables.h"
>
</File>
<File
RelativePath=".\..\src\vehicle.h"
RelativePath=".\..\src\vehicle_base.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_func.h"
>
</File>
<File
@@ -1184,7 +1396,7 @@
>
</File>
<File
RelativePath=".\..\src\viewport.h"
RelativePath=".\..\src\vehicle_type.h"
>
</File>
<File
@@ -1204,11 +1416,23 @@
>
</File>
<File
RelativePath=".\..\src\window.h"
RelativePath=".\..\src\window_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom.hpp"
RelativePath=".\..\src\window_gui.h"
>
</File>
<File
RelativePath=".\..\src\window_type.h"
>
</File>
<File
RelativePath=".\..\src\zoom_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom_type.h"
>
</File>
</Filter>
@@ -1415,6 +1639,10 @@
RelativePath=".\..\src\station_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\terraform_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\timetable_cmd.cpp"
>
@@ -1504,7 +1732,7 @@
>
</File>
<File
RelativePath=".\..\src\table\roadveh.h"
RelativePath=".\..\src\table\roadveh_movement.h"
>
</File>
<File
@@ -1723,6 +1951,10 @@
RelativePath=".\..\src\newgrf_engine.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.cpp"
>
@@ -1799,6 +2031,10 @@
RelativePath=".\..\src\station_map.h"
>
</File>
<File
RelativePath=".\..\src\tile_map.h"
>
</File>
<File
RelativePath=".\..\src\town_map.h"
>
@@ -1815,6 +2051,10 @@
RelativePath=".\..\src\tunnel_map.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge_map.h"
>
</File>
<File
RelativePath=".\..\src\unmovable_map.h"
>
@@ -1935,10 +2175,6 @@
<Filter
Name="YAPF"
>
<File
RelativePath=".\..\src\yapf\follow_track.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\follow_track.hpp"
>
@@ -1963,10 +2199,6 @@
RelativePath=".\..\src\yapf\yapf_base.hpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.hpp"
>

View File

@@ -452,6 +452,10 @@
RelativePath=".\..\src\airport.cpp"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.cpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.cpp"
>
@@ -464,6 +468,10 @@
RelativePath=".\..\src\aystar.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\bmp.cpp"
>
@@ -492,14 +500,6 @@
RelativePath=".\..\src\console_cmds.cpp"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\currency.cpp"
>
@@ -524,6 +524,10 @@
RelativePath=".\..\src\driver.cpp"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown.cpp"
>
</File>
<File
RelativePath=".\..\src\economy.cpp"
>
@@ -664,6 +668,10 @@
RelativePath=".\..\src\rail.cpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.cpp"
>
</File>
<File
RelativePath=".\..\src\rev.cpp"
>
@@ -688,6 +696,10 @@
RelativePath=".\..\src\settings.cpp"
>
</File>
<File
RelativePath=".\..\src\signal.cpp"
>
</File>
<File
RelativePath=".\..\src\signs.cpp"
>
@@ -725,7 +737,7 @@
>
</File>
<File
RelativePath=".\..\src\tile.cpp"
RelativePath=".\..\src\tile_map.cpp"
>
</File>
<File
@@ -768,10 +780,30 @@
RelativePath=".\..\src\airport_movement.h"
>
</File>
<File
RelativePath=".\..\src\core\alloc_func.hpp"
>
</File>
<File
RelativePath=".\..\src\articulated_vehicles.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_base.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_func.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_gui.h"
>
</File>
<File
RelativePath=".\..\src\autoreplace_type.h"
>
</File>
<File
RelativePath=".\..\src\autoslope.h"
>
@@ -780,10 +812,26 @@
RelativePath=".\..\src\aystar.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\bmp.h"
>
</File>
<File
RelativePath=".\..\src\bridge.h"
>
</File>
<File
RelativePath=".\..\src\callback_table.h"
>
</File>
<File
RelativePath=".\..\src\cargo_type.h"
>
</File>
<File
RelativePath=".\..\src\cargopacket.h"
>
@@ -793,31 +841,31 @@
>
</File>
<File
RelativePath=".\..\src\command.h"
RelativePath=".\..\src\cmd_helper.h"
>
</File>
<File
RelativePath=".\..\src\command_func.h"
>
</File>
<File
RelativePath=".\..\src\command_type.h"
>
</File>
<File
RelativePath=".\..\src\console.h"
>
</File>
<File
RelativePath=".\..\src\core\bitmath_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\currency.h"
>
</File>
<File
RelativePath=".\..\src\date.h"
RelativePath=".\..\src\date_func.h"
>
</File>
<File
RelativePath=".\..\src\date_type.h"
>
</File>
<File
@@ -833,7 +881,11 @@
>
</File>
<File
RelativePath=".\..\src\direction.h"
RelativePath=".\..\src\direction_func.h"
>
</File>
<File
RelativePath=".\..\src\direction_type.h"
>
</File>
<File
@@ -845,13 +897,33 @@
>
</File>
<File
RelativePath=".\..\src\economy.h"
RelativePath=".\..\src\widgets\dropdown_func.h"
>
</File>
<File
RelativePath=".\..\src\widgets\dropdown_type.h"
>
</File>
<File
RelativePath=".\..\src\economy_func.h"
>
</File>
<File
RelativePath=".\..\src\economy_type.h"
>
</File>
<File
RelativePath=".\..\src\core\endian_func.hpp"
>
</File>
<File
RelativePath=".\..\src\engine.h"
>
</File>
<File
RelativePath=".\..\src\core\enum_type.hpp"
>
</File>
<File
RelativePath=".\..\src\fileio.h"
>
@@ -873,7 +945,15 @@
>
</File>
<File
RelativePath=".\..\src\gfx.h"
RelativePath=".\..\src\core\geometry_type.hpp"
>
</File>
<File
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
>
</File>
<File
@@ -884,6 +964,10 @@
RelativePath=".\..\src\group.h"
>
</File>
<File
RelativePath=".\..\src\group_gui.h"
>
</File>
<File
RelativePath=".\..\src\gui.h"
>
@@ -893,11 +977,11 @@
>
</File>
<File
RelativePath=".\..\src\helpers.hpp"
RelativePath=".\..\src\industry.h"
>
</File>
<File
RelativePath=".\..\src\industry.h"
RelativePath=".\..\src\industry_type.h"
>
</File>
<File
@@ -909,11 +993,7 @@
>
</File>
<File
RelativePath=".\..\src\macros.h"
>
</File>
<File
RelativePath=".\..\src\map.h"
RelativePath=".\..\src\core\math_func.hpp"
>
</File>
<File
@@ -948,6 +1028,10 @@
RelativePath=".\..\src\network\network_gui.h"
>
</File>
<File
RelativePath=".\..\src\network\network_internal.h"
>
</File>
<File
RelativePath=".\..\src\network\network_server.h"
>
@@ -984,6 +1068,10 @@
RelativePath=".\..\src\newgrf_engine.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.h"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.h"
>
@@ -1052,18 +1140,38 @@
RelativePath=".\..\src\openttd.h"
>
</File>
<File
RelativePath=".\..\src\order.h"
>
</File>
<File
RelativePath=".\..\src\core\overflowsafe_type.hpp"
>
</File>
<File
RelativePath=".\..\src\pathfind.h"
>
</File>
<File
RelativePath=".\..\src\player.h"
RelativePath=".\..\src\player_base.h"
>
</File>
<File
RelativePath=".\..\src\player_face.h"
>
</File>
<File
RelativePath=".\..\src\player_func.h"
>
</File>
<File
RelativePath=".\..\src\player_gui.h"
>
</File>
<File
RelativePath=".\..\src\player_type.h"
>
</File>
<File
RelativePath=".\..\src\queue.h"
>
@@ -1072,10 +1180,42 @@
RelativePath=".\..\src\rail.h"
>
</File>
<File
RelativePath=".\..\src\rail_gui.h"
>
</File>
<File
RelativePath=".\..\src\rail_type.h"
>
</File>
<File
RelativePath=".\..\src\core\random_func.hpp"
>
</File>
<File
RelativePath=".\..\src\road_cmd.h"
>
</File>
<File
RelativePath=".\..\src\road_func.h"
>
</File>
<File
RelativePath=".\..\src\road_gui.h"
>
</File>
<File
RelativePath=".\..\src\road_internal.h"
>
</File>
<File
RelativePath=".\..\src\road_type.h"
>
</File>
<File
RelativePath=".\..\src\roadveh.h"
>
</File>
<File
RelativePath=".\..\src\saveload.h"
>
@@ -1093,7 +1233,23 @@
>
</File>
<File
RelativePath=".\..\src\settings.h"
RelativePath=".\..\src\settings_func.h"
>
</File>
<File
RelativePath=".\..\src\settings_internal.h"
>
</File>
<File
RelativePath=".\..\src\settings_type.h"
>
</File>
<File
RelativePath=".\..\src\ship.h"
>
</File>
<File
RelativePath=".\..\src\signal_func.h"
>
</File>
<File
@@ -1101,11 +1257,19 @@
>
</File>
<File
RelativePath=".\..\src\slope.h"
RelativePath=".\..\src\slope_func.h"
>
</File>
<File
RelativePath=".\..\src\sound.h"
RelativePath=".\..\src\slope_type.h"
>
</File>
<File
RelativePath=".\..\src\sound_func.h"
>
</File>
<File
RelativePath=".\..\src\sound_type.h"
>
</File>
<File
@@ -1129,7 +1293,27 @@
>
</File>
<File
RelativePath=".\..\src\string.h"
RelativePath=".\..\src\string_func.h"
>
</File>
<File
RelativePath=".\..\src\string_type.h"
>
</File>
<File
RelativePath=".\..\src\strings_func.h"
>
</File>
<File
RelativePath=".\..\src\strings_type.h"
>
</File>
<File
RelativePath=".\..\src\terraform_gui.h"
>
</File>
<File
RelativePath=".\..\src\textbuf_gui.h"
>
</File>
<File
@@ -1145,7 +1329,11 @@
>
</File>
<File
RelativePath=".\..\src\tile.h"
RelativePath=".\..\src\tile_cmd.h"
>
</File>
<File
RelativePath=".\..\src\tile_type.h"
>
</File>
<File
@@ -1156,6 +1344,18 @@
RelativePath=".\..\src\town.h"
>
</File>
<File
RelativePath=".\..\src\town_type.h"
>
</File>
<File
RelativePath=".\..\src\track_func.h"
>
</File>
<File
RelativePath=".\..\src\track_type.h"
>
</File>
<File
RelativePath=".\..\src\train.h"
>
@@ -1168,12 +1368,24 @@
RelativePath=".\..\src\transparency_gui.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge.h"
>
</File>
<File
RelativePath=".\..\src\unmovable.h"
>
</File>
<File
RelativePath=".\..\src\variables.h"
>
</File>
<File
RelativePath=".\..\src\vehicle.h"
RelativePath=".\..\src\vehicle_base.h"
>
</File>
<File
RelativePath=".\..\src\vehicle_func.h"
>
</File>
<File
@@ -1181,7 +1393,7 @@
>
</File>
<File
RelativePath=".\..\src\viewport.h"
RelativePath=".\..\src\vehicle_type.h"
>
</File>
<File
@@ -1201,11 +1413,23 @@
>
</File>
<File
RelativePath=".\..\src\window.h"
RelativePath=".\..\src\window_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom.hpp"
RelativePath=".\..\src\window_gui.h"
>
</File>
<File
RelativePath=".\..\src\window_type.h"
>
</File>
<File
RelativePath=".\..\src\zoom_func.h"
>
</File>
<File
RelativePath=".\..\src\zoom_type.h"
>
</File>
</Filter>
@@ -1412,6 +1636,10 @@
RelativePath=".\..\src\station_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\terraform_cmd.cpp"
>
</File>
<File
RelativePath=".\..\src\timetable_cmd.cpp"
>
@@ -1501,7 +1729,7 @@
>
</File>
<File
RelativePath=".\..\src\table\roadveh.h"
RelativePath=".\..\src\table\roadveh_movement.h"
>
</File>
<File
@@ -1720,6 +1948,10 @@
RelativePath=".\..\src\newgrf_engine.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_generic.cpp"
>
</File>
<File
RelativePath=".\..\src\newgrf_house.cpp"
>
@@ -1796,6 +2028,10 @@
RelativePath=".\..\src\station_map.h"
>
</File>
<File
RelativePath=".\..\src\tile_map.h"
>
</File>
<File
RelativePath=".\..\src\town_map.h"
>
@@ -1812,6 +2048,10 @@
RelativePath=".\..\src\tunnel_map.h"
>
</File>
<File
RelativePath=".\..\src\tunnelbridge_map.h"
>
</File>
<File
RelativePath=".\..\src\unmovable_map.h"
>
@@ -1932,10 +2172,6 @@
<Filter
Name="YAPF"
>
<File
RelativePath=".\..\src\yapf\follow_track.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\follow_track.hpp"
>
@@ -1960,10 +2196,6 @@
RelativePath=".\..\src\yapf\yapf_base.hpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.cpp"
>
</File>
<File
RelativePath=".\..\src\yapf\yapf_common.hpp"
>

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
OpenTTD README
Last updated: 2007-12-09
Release version: 0.6.0-beta2
Last updated: 2008-04-01
Release version: 0.6.0
------------------------------------------------------------------------
@@ -11,6 +11,9 @@ Table of Contents:
* 2.1 Reporting Bugs
3.0) Supported Platforms
4.0) Installing and running OpenTTD
* 4.1 (Required) 3rd party files
* 4.2 OpenTTD directories
* 4.3 Portable Installations (External Media)
5.0) OpenTTD features
6.0) Configuration File
7.0) Compiling
@@ -88,25 +91,100 @@ archive which you have to extract to a directory where you want OpenTTD to
be installed, or you have downloaded an installer, which will automatically
extract OpenTTD in the given directory.
Before you run OpenTTD, you need to put the game's datafiles into the data/
subdirectory. You need the following files from the original version
of TTD as OpenTTD makes use of the original TTD artwork. The Windows
installer optionally can copy these files from your Transport Tycoon Deluxe
CD-ROM.
OpenTTD looks in multiple locations to find the required data files (described
in section 4.2). Installing any 3rd party files into a "shared" location has
the advantage that you only need to do this step once, rather than copying the
data files into all OpenTTD versions you have.
Savegames, screenshots, etc are saved relative to the config file (openttd.cfg)
currently being used. This means that if you use a config file in one of the
shared directories, savegames will reside in the save/ directory next to the
openttd.cfg file there.
If you want savegames and screenshots in the directory where the OpenTTD binary
resides, simply have your config file in that location. But if you remove this
config file, savegames will still be in this directory (see notes in section 4.2)
4.1) (Required) 3rd party files:
---- ---------------------------
Before you run OpenTTD, you need to put the game's datafiles into a data/
directory which can be located in various places addressed in the following
section.
As OpenTTD makes use of the original TTD artwork you will need the files listed
below, which you can find on a Transport Tycoon Deluxe CD-ROM.
The Windows installer optionally can copy these files from that CD-ROM.
List of the required files:
sample.cat
trg1r.grf
trgcr.grf
trghr.grf
trgir.grf
trgtr.grf
- sample.cat
- trg1r.grf
- trgcr.grf
- trghr.grf
- trgir.grf
- trgtr.grf
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF,
TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF.
Alternatively you can use the TTD GRF files from the DOS version:
- TRG1.GRF
- TRGC.GRF
- TRGH.GRF
- TRGI.GRF
- TRGT.GRF
If you want music you need to copy the gm/ folder from Windows TTD into your
OpenTTD folder, not your data folder.
If you want the TTD music, copy the gm/ folder from the Windows version
of TTD to your OpenTTD folder (not your data folder - also explained in
the following sections).
Do NOT copy files included with OpenTTD into "shared" directories (explained in
the following sections) as sooner or later you will run into graphical glitches
when using other versions of the game.
4.2) OpenTTD directories
---- -------------------------------
The TTD artwork files listed in the section 4.1 "(Required) 3rd party files"
can be placed in a few different locations:
1. The current working directory (from where you started OpenTTD)
2. Your personal directory
Windows: C:\Documents and Settings\<username>\My Documents\OpenTTD
Mac OSX: ~/Documents/OpenTTD
Linux: ~/.openttd
3. The shared directory
Windows: C:\Documents and Settings\All Users\Documents\OpenTTD
Mac OSX: /Library/Application Support/OpenTTD
Linux: not available
4. The binary directory (where the OpenTTD executable is)
Windows: C:\Program Files\OpenTTD
Linux: /usr/games
5. The installation directory (Linux only)
Linux: /usr/share/games/openttd
6. The application bundle (Mac OSX only)
It includes the OTTD files (grf+lng) and it will work as long as they aren't touched
Notes:
- Linux in the previous list means .deb, but most paths should be similar for others.
- The previous search order is also used for newgrfs and openttd.cfg.
- If openttd.cfg is not found, then it will be created using the 2, 4, 1, 3, 5 order.
- Savegames will be relative to the config file only if there is no save/
directory in paths with higher priority than the config file path, but
autosaves and screenshots will always be relative to the config file.
The prefered setup:
Place 3rd party files in shared directory (or in personal directory if you don't
have write access on shared directory) and have your openttd.cfg config file in
personal directory (where the game will then also place savegames and screenshots).
4.3) Portable Installations (External Media):
---- ----------------------------------------
You can install OpenTTD on external media so you can take it with you, i.e.
using a USB key, or a USB HDD, etc.
Create a directory where you shall store the game in (i.e. OpenTTD/).
Copy the binary (OpenTTD.exe, OpenTTD.app, openttd, etc), data/ and your
openttd.cfg to this directory.
You can copy binaries for any operating system into this directory, which will
allow you to play the game on nearly any computer you can attach the external
media to.
As always - additional grf files are stored in the data/ dir (for details,
again, see section 4.1).
5.0) OpenTTD features:
@@ -281,30 +359,36 @@ put them in the data/ folder and you're set to go.
X.X) Credits:
---- --------
The OpenTTD team (in alphabetical order):
Jean-Francois Claeys (Belugas) - In training, not yet specialized
Bjarni Corfitzen (Bjarni) - Mac OS X port, coder
Matthijs Kooijman (blathijs) - Pathfinder-guru
Victor Fischer (Celestar) - Programming everywhere you need him to
Tamás Faragó (Darkvater) - Lead programmer
Loïc Guilloux (glx) - In training, not yet specialized
Jean-Francois Claeys (Belugas) - GUI, newindustries and more
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles
Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework
Loïc Guilloux (glx) - General coding
Christoph Elsenhans (frosch) - General coding
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
Kerekes Miham (MiHaMiX) - Maintainer of translator service, and host of nightlies
Owen Rudge (orudge) - Contributor, forum host, OS/2 port
Peter Nelson (peter1138) - Spiritual descendant from newgrf gods
Remko Bijker (Rubidium) - THE desync hunter
Jonathan Coome (Maedhros) - High priest of the newGRF Temple
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
Inactive Developers:
Victor Fischer (Celestar) - Programming everywhere you need him to
Tamás Faragó (Darkvater) - Ex-Lead coder
Christoph Mallon (Tron) - Programmer, code correctness police
Retired Developers:
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6)
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.6)
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)
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.6)
Thanks to:
Josef Drexler - For his great work on TTDPatch.
Marcin Grzegorczyk - For his TTDPatch work and documentation of TTD internals and graphics (signals and track foundations)
Petr Baudis (pasky) - Many patches, newgrf support, etc.
Simon Sasburg (HackyKid) - For the many bugfixes he has blessed us with (and future PBS)
Simon Sasburg (HackyKid) - For the many bugfixes he has blessed us with
Stefan Meißner (sign_de) - For his work on the console
Mike Ragsdale - OpenTTD installer
Cian Duffy (MYOB) - BeOS port / manual writing
@@ -313,6 +397,7 @@ Thanks to:
Michael Blunck - For revolutionizing TTD with awesome graphics
George - Canal graphics
David Dallaston (Pikka) - Tram tracks
Zephyris - Trams
All Translators - For their support to make OpenTTD a truly international game
Bug Reporters - Thanks for all bug reports
Chris Sawyer - For an amazing game!

View File

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

View File

@@ -3,11 +3,17 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "../variables.h"
#include "../command.h"
#include "../command_func.h"
#include "../network/network.h"
#include "../helpers.hpp"
#include "../core/alloc_func.hpp"
#include "../player_func.h"
#include "../player_base.h"
#include "ai.h"
#include "default/default.h"
#include "../signal_func.h"
AIStruct _ai;
AIPlayer _ai_player[MAX_PLAYERS];
/**
* Dequeues commands put in the queue via AI_PutCommandInQueue.
@@ -45,7 +51,7 @@ static void AI_DequeueCommands(PlayerID player)
* Needed for SP; we need to delay DoCommand with 1 tick, because else events
* will make infinite loops (AIScript).
*/
static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCallback* callback)
static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint32 procc, CommandCallback* callback)
{
AICommand *com;
@@ -81,7 +87,7 @@ static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uin
/**
* Executes a raw DoCommand for the AI.
*/
CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback)
CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc, CommandCallback* callback)
{
PlayerID old_lp;
CommandCost res;
@@ -104,10 +110,6 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
/* Restore _cmd_text */
_cmd_text = tmp_cmdtext;
/* If we did a DC_EXEC, and the command did not return an error, execute it
* over the network */
if (flags & DC_NO_WATER) procc |= CMD_NO_WATER;
/* NetworkSend_Command needs _local_player to be set correctly, so
* adjust it, and put it back right after the function */
old_lp = _local_player;
@@ -134,7 +136,7 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
}
CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
{
return AI_DoCommandCc(tile, p1, p2, flags, procc, NULL);
}
@@ -158,6 +160,9 @@ static void AI_RunTick(PlayerID player)
AiDoGameLoop(p);
_is_old_ai_player = false;
}
/* AI could change some track, so update signals */
UpdateSignalsInBuffer();
}

View File

@@ -1,10 +1,12 @@
/* $Id$ */
#ifndef AI_H
#define AI_H
#include "../functions.h"
#include "../network/network.h"
#include "../player.h"
#include "../command.h"
#include "../command_type.h"
#include "../core/random_func.hpp"
#include "../settings_type.h"
/* How DoCommands look like for an AI */
struct AICommand {
@@ -12,7 +14,7 @@ struct AICommand {
uint32 p1;
uint32 p2;
uint32 procc;
CommandCallback* callback;
CommandCallback *callback;
char *text;
uint uid;
@@ -34,8 +36,8 @@ struct AIStruct {
uint tick; ///< The current tick (something like _frame_counter, only for AIs)
};
VARDEF AIStruct _ai;
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
extern AIStruct _ai;
extern AIPlayer _ai_player[MAX_PLAYERS];
// ai.c
void AI_StartNewAI(PlayerID player);

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,66 @@
#ifndef DEFAULT_H
#define DEFAULT_H
#include "../../direction_type.h"
#include "../../vehicle_type.h"
#include "../../rail_type.h"
void AiDoGameLoop(Player*);
void SaveLoad_AI(PlayerID id);
struct AiBuildRec {
TileIndex spec_tile;
TileIndex use_tile;
byte rand_rng;
byte cur_building_rule;
byte unk6;
byte unk7;
byte buildcmd_a;
byte buildcmd_b;
byte direction;
CargoID cargo;
};
struct PlayerAI {
byte state;
byte tick; ///< Used to determine how often to move
uint32 state_counter; ///< Can hold tile index!
uint16 timeout_counter;
byte state_mode;
byte banned_tile_count;
RailTypeByte railtype_to_use;
CargoID cargo_type;
byte num_wagons;
byte build_kind;
byte num_build_rec;
byte num_loco_to_build;
byte num_want_fullload;
byte route_type_mask;
TileIndex start_tile_a;
TileIndex cur_tile_a;
DiagDirectionByte cur_dir_a;
DiagDirectionByte start_dir_a;
TileIndex start_tile_b;
TileIndex cur_tile_b;
DiagDirectionByte cur_dir_b;
DiagDirectionByte start_dir_b;
Vehicle *cur_veh; ///< only used by some states
AiBuildRec src, dst, mid1, mid2;
VehicleID wagon_list[9];
byte order_list_blocks[20];
TileIndex banned_tiles[16];
byte banned_val[16];
};
extern PlayerAI _players_ai[MAX_PLAYERS];
#endif

View File

@@ -3,18 +3,20 @@
#include "../../stdafx.h"
#include "../../openttd.h"
#include "../../debug.h"
#include "../../functions.h"
#include "../../map.h"
#include "../../road_map.h"
#include "../../tile.h"
#include "../../vehicle.h"
#include "../../command.h"
#include "../../command_func.h"
#include "trolly.h"
#include "../../engine.h"
#include "../../station.h"
#include "../../variables.h"
#include "../../bridge.h"
#include "../../vehicle_func.h"
#include "../../vehicle_base.h"
#include "../../player_base.h"
#include "../../player_func.h"
#include "../ai.h"
#include "../../tunnelbridge.h"
// Build HQ
// Params:
@@ -58,7 +60,7 @@ CommandCost AiNew_Build_Bridge(Player *p, TileIndex tile_a, TileIndex tile_b, by
int bridge_type, bridge_len, type, type2;
// Find a good bridgetype (the best money can buy)
bridge_len = GetBridgeLength(tile_a, tile_b);
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
type = type2 = 0;
for (bridge_type = MAX_BRIDGES-1; bridge_type >= 0; bridge_type--) {
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
@@ -72,7 +74,7 @@ CommandCost AiNew_Build_Bridge(Player *p, TileIndex tile_a, TileIndex tile_b, by
if (type2 == 0 && type != 0) type2 = type;
// Now, simply, build the bridge!
if (p->ainew.tbt == AI_TRAIN) {
if (_players_ainew[p->index].tbt == AI_TRAIN) {
return AI_DoCommand(tile_a, tile_b, (0x00 << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
} else {
return AI_DoCommand(tile_a, tile_b, ((0x80 | ROADTYPES_ROAD) << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
@@ -146,7 +148,7 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
res = AI_DoCommand(route[part], 0, dir, flag, CMD_BUILD_SINGLE_RAIL);
if (CmdFailed(res)) {
// Problem.. let's just abort it all!
p->ainew.state = AI_STATE_NOTHING;
_players_ainew[p->index].state = AI_STATE_NOTHING;
return CommandCost();
}
cost.AddCost(res);
@@ -202,7 +204,7 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_ROAD) && !EnsureNoVehicleOnGround(route[part])) {
// Problem.. let's just abort it all!
DEBUG(ai, 0, "[BuidPath] route building failed at tile 0x%X, aborting", route[part]);
p->ainew.state = AI_STATE_NOTHING;
_players_ainew[p->index].state = AI_STATE_NOTHING;
return CommandCost();
}
@@ -228,36 +230,35 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
// It returns INVALID_ENGINE if not suitable engine is found
EngineID AiNew_PickVehicle(Player *p)
{
if (p->ainew.tbt == AI_TRAIN) {
if (_players_ainew[p->index].tbt == AI_TRAIN) {
// Not supported yet
return INVALID_ENGINE;
} else {
EngineID best_veh_index = INVALID_ENGINE;
int32 best_veh_rating = 0;
EngineID start = ROAD_ENGINES_INDEX;
EngineID end = ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES;
EngineID i;
/* Loop through all road vehicles */
for (i = start; i != end; i++) {
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_ROAD) {
const RoadVehicleInfo *rvi = RoadVehInfo(i);
const Engine* e = GetEngine(i);
int32 rating;
CommandCost ret;
/* Skip vehicles which can't take our cargo type */
if (rvi->cargo_type != p->ainew.cargo && !CanRefitTo(i, p->ainew.cargo)) continue;
if (rvi->cargo_type != _players_ainew[p->index].cargo && !CanRefitTo(i, _players_ainew[p->index].cargo)) continue;
/* Skip trams */
if (HasBit(EngInfo(i)->misc_flags, EF_ROAD_TRAM)) continue;
// Is it availiable?
// Also, check if the reliability of the vehicle is above the AI_VEHICLE_MIN_RELIABILTY
if (!HasBit(e->player_avail, _current_player) || e->reliability * 100 < AI_VEHICLE_MIN_RELIABILTY << 16) continue;
/* Rate and compare the engine by speed & capacity */
rating = rvi->max_speed * rvi->capacity;
int rating = rvi->max_speed * rvi->capacity;
if (rating <= best_veh_rating) continue;
// Can we build it?
ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
CommandCost ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
if (CmdFailed(ret)) continue;
best_veh_rating = rating;
@@ -274,20 +275,20 @@ void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2)
Player* p = GetPlayer(_current_player);
if (success) {
p->ainew.state = AI_STATE_GIVE_ORDERS;
p->ainew.veh_id = _new_vehicle_id;
_players_ainew[p->index].state = AI_STATE_GIVE_ORDERS;
_players_ainew[p->index].veh_id = _new_vehicle_id;
if (GetVehicle(p->ainew.veh_id)->cargo_type != p->ainew.cargo) {
if (GetVehicle(_players_ainew[p->index].veh_id)->cargo_type != _players_ainew[p->index].cargo) {
/* Cargo type doesn't match, so refit it */
if (CmdFailed(DoCommand(tile, p->ainew.veh_id, p->ainew.cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
if (CmdFailed(DoCommand(tile, _players_ainew[p->index].veh_id, _players_ainew[p->index].cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
/* Refit failed, so sell the vehicle */
DoCommand(tile, p->ainew.veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
p->ainew.state = AI_STATE_NOTHING;
DoCommand(tile, _players_ainew[p->index].veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
_players_ainew[p->index].state = AI_STATE_NOTHING;
}
}
} else {
/* XXX this should be handled more gracefully */
p->ainew.state = AI_STATE_NOTHING;
_players_ainew[p->index].state = AI_STATE_NOTHING;
}
}
@@ -298,7 +299,7 @@ CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag)
EngineID i = AiNew_PickVehicle(p);
if (i == INVALID_ENGINE) return CMD_ERROR;
if (p->ainew.tbt == AI_TRAIN) return CMD_ERROR;
if (_players_ainew[p->index].tbt == AI_TRAIN) return CMD_ERROR;
if (flag & DC_EXEC) {
return AI_DoCommandCc(tile, i, 0, flag, CMD_BUILD_ROAD_VEH, CcAI);
@@ -310,7 +311,7 @@ CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag)
CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag)
{
CommandCost ret, ret2;
if (p->ainew.tbt == AI_TRAIN) {
if (_players_ainew[p->index].tbt == AI_TRAIN) {
return AI_DoCommand(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT);
} else {
ret = AI_DoCommand(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT);

View File

@@ -4,15 +4,18 @@
#include "../../openttd.h"
#include "../../bridge_map.h"
#include "../../debug.h"
#include "../../functions.h"
#include "../../map.h"
#include "../../tile.h"
#include "../../command.h"
#include "../../command_func.h"
#include "trolly.h"
#include "../../depot.h"
#include "../../tunnel_map.h"
#include "../../bridge.h"
#include "../../tunnelbridge_map.h"
#include "../ai.h"
#include "../../variables.h"
#include "../../player_base.h"
#include "../../player_func.h"
#include "../../tunnelbridge.h"
#define TEST_STATION_NO_DIR 0xFF
@@ -27,14 +30,14 @@ static bool TestCanBuildStationHere(TileIndex tile, byte dir)
// TODO: currently we only allow spots that can be access from al 4 directions...
// should be fixed!!!
for (dir = 0; dir < 4; dir++) {
ret = AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST);
ret = AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST);
if (CmdSucceeded(ret)) return true;
}
return false;
}
// return true if command succeeded, so the inverse of CmdFailed()
return CmdSucceeded(AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST));
return CmdSucceeded(AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST));
}
@@ -43,10 +46,7 @@ static bool IsRoad(TileIndex tile)
return
// MP_ROAD, but not a road depot?
(IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
(IsTileType(tile, MP_TUNNELBRIDGE) && (
(IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) ||
(IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD)
));
(IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD);
}
@@ -234,11 +234,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// If the next step is a bridge, we have to enter it the right way
if (!PathFinderInfo->rail_or_road && IsRoad(atile)) {
if (IsTileType(atile, MP_TUNNELBRIDGE)) {
if (IsTunnel(atile)) {
if (GetTunnelDirection(atile) != i) continue;
} else {
if (GetBridgeRampDirection(atile) != i) continue;
}
if (GetTunnelBridgeDirection(atile) != i) continue;
}
}
@@ -325,7 +321,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
new_tile += TileOffsByDiagDir(dir);
// Precheck, is the length allowed?
if (!CheckBridge_Stuff(0, GetBridgeLength(tile, new_tile))) break;
if (!CheckBridge_Stuff(0, GetTunnelBridgeLength(tile, new_tile))) break;
// Check if we hit the station-tile.. we don't like that!
if (TILES_BETWEEN(new_tile, PathFinderInfo->end_tile_tl, PathFinderInfo->end_tile_br)) break;
@@ -345,14 +341,11 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// Next, check for tunnels!
// Tunnels can only be built on slopes corresponding to the direction
// For now, we check both sides for this tile.. terraforming gives fuzzy result
if ((dir == DIAGDIR_NE && tileh == SLOPE_NE) ||
(dir == DIAGDIR_SE && tileh == SLOPE_SE) ||
(dir == DIAGDIR_SW && tileh == SLOPE_SW) ||
(dir == DIAGDIR_NW && tileh == SLOPE_NW)) {
if (tileh == InclinedSlope(dir)) {
// Now simply check if a tunnel can be build
ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
tileh = GetTileSlope(_build_tunnel_endtile, NULL);
if (CmdSucceeded(ret) && (tileh == SLOPE_SW || tileh == SLOPE_SE || tileh == SLOPE_NW || tileh == SLOPE_NE)) {
if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
aystar->neighbours[aystar->num_neighbours].user_data[0] = AI_PATHFINDER_FLAG_TUNNEL + (dir << 8);
aystar->neighbours[aystar->num_neighbours++].direction = 0;
@@ -364,10 +357,6 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
extern Foundation GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
extern Foundation GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
extern Foundation GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
enum BridgeFoundation {
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
};
// The most important function: it calculates the g-value
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
@@ -410,8 +399,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
if (parent->path.node.user_data[0] == 0 && current->user_data[0] == 0) {
if (PathFinderInfo->rail_or_road) {
Foundation f = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)));
// Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information..
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
} else {
res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -419,7 +407,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
} else {
if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) {
Foundation f = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile));
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
} else {
res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -434,29 +422,19 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
int r;
// Tunnels are very expensive when build on long routes..
// Ironicly, we are using BridgeCode here ;)
r = AI_PATHFINDER_TUNNEL_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
r = AI_PATHFINDER_TUNNEL_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
res += r + (r >> 8);
}
// Are we part of a bridge?
if ((AI_PATHFINDER_FLAG_BRIDGE & current->user_data[0]) != 0) {
// That means for every length a penalty
res += AI_PATHFINDER_BRIDGE_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
res += AI_PATHFINDER_BRIDGE_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
// Check if we are going up or down, first for the starting point
// In user_data[0] is at the 8th bit the direction
if (!HasBit(BRIDGE_NO_FOUNDATION, parent_tileh)) {
if (IsLeveledFoundation(GetBridgeFoundation(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
}
if (!HasBridgeFlatRamp(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
// Second for the end point
if (!HasBit(BRIDGE_NO_FOUNDATION, tileh)) {
if (IsLeveledFoundation(GetBridgeFoundation(tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
}
if (parent_tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
if (tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
if (!HasBridgeFlatRamp(tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
}
// To prevent the AI from taking the fastest way in tiles, but not the fastest way

View File

@@ -3,9 +3,10 @@
#include "../../stdafx.h"
#include "../../openttd.h"
#include "../../debug.h"
#include "../../map.h"
#include "../../map_func.h"
#include "../../vehicle_base.h"
#include "../../player_base.h"
#include "trolly.h"
#include "../../vehicle.h"
int AiNew_GetRailDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c)
{
@@ -80,8 +81,8 @@ uint AiNew_GetSpecialVehicleFlag(Player* p, Vehicle* v)
uint i;
for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
if (p->ainew.special_vehicles[i].veh_id == v->index) {
return p->ainew.special_vehicles[i].flag;
if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
return _players_ainew[p->index].special_vehicles[i].flag;
}
}
@@ -96,13 +97,13 @@ bool AiNew_SetSpecialVehicleFlag(Player* p, Vehicle* v, uint flag)
uint i;
for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
if (p->ainew.special_vehicles[i].veh_id == v->index) {
p->ainew.special_vehicles[i].flag |= flag;
if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
_players_ainew[p->index].special_vehicles[i].flag |= flag;
return true;
}
if (new_id == -1 &&
p->ainew.special_vehicles[i].veh_id == 0 &&
p->ainew.special_vehicles[i].flag == 0) {
_players_ainew[p->index].special_vehicles[i].veh_id == 0 &&
_players_ainew[p->index].special_vehicles[i].flag == 0) {
new_id = i;
}
}
@@ -112,7 +113,7 @@ bool AiNew_SetSpecialVehicleFlag(Player* p, Vehicle* v, uint flag)
DEBUG(ai, 1, "special_vehicles list is too small");
return false;
}
p->ainew.special_vehicles[new_id].veh_id = v->index;
p->ainew.special_vehicles[new_id].flag = flag;
_players_ainew[p->index].special_vehicles[new_id].veh_id = v->index;
_players_ainew[p->index].special_vehicles[new_id].flag = flag;
return true;
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,9 @@
#define AI_TROLLY_H
#include "../../aystar.h"
#include "../../player.h"
#include "../../player_type.h"
#include "../../vehicle_type.h"
#include "../../date_type.h"
/*
* These defines can be altered to change the behavoir of the AI
@@ -239,6 +241,22 @@ typedef void AiNew_StateFunction(Player *p);
// ai_new.c
void AiNewDoGameLoop(Player *p);
struct Ai_PathFinderInfo {
TileIndex start_tile_tl; ///< tl = top-left
TileIndex start_tile_br; ///< br = bottom-right
TileIndex end_tile_tl; ///< tl = top-left
TileIndex end_tile_br; ///< br = bottom-right
DiagDirection start_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
DiagDirection end_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
TileIndex route[500];
byte route_extra[500]; ///< Some extra information about the route like bridge/tunnel
int route_length;
int position; ///< Current position in the build-path, needed to build the path
bool rail_or_road; ///< true = rail, false = road
};
// ai_pathfinder.c
AyStar *new_AyStar_AiPathFinder(int max_tiles_around, Ai_PathFinderInfo *PathFinderInfo);
void clean_AyStar_AiPathFinder(AyStar *aystar, Ai_PathFinderInfo *PathFinderInfo);
@@ -259,4 +277,64 @@ EngineID AiNew_PickVehicle(Player *p);
CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag);
CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag);
/* The amount of memory reserved for the AI-special-vehicles */
#define AI_MAX_SPECIAL_VEHICLES 100
struct Ai_SpecialVehicle {
VehicleID veh_id;
uint32 flag;
};
struct PlayerAiNew {
uint8 state;
uint tick;
uint idle;
int temp; ///< A value used in more than one function, but it just temporary
///< The use is pretty simple: with this we can 'think' about stuff
///< in more than one tick, and more than one AI. A static will not
///< do, because they are not saved. This way, the AI is almost human ;)
int counter; ///< For the same reason as temp, we have counter. It can count how
///< long we are trying something, and just abort if it takes too long
/* Pathfinder stuff */
Ai_PathFinderInfo path_info;
AyStar *pathfinder;
/* Route stuff */
CargoID cargo;
byte tbt; ///< train/bus/truck 0/1/2 AI_TRAIN/AI_BUS/AI_TRUCK
Money new_cost;
byte action;
int last_id; ///< here is stored the last id of the searched city/industry
Date last_vehiclecheck_date; // Used in CheckVehicle
Ai_SpecialVehicle special_vehicles[AI_MAX_SPECIAL_VEHICLES]; ///< Some vehicles have some special flags
TileIndex from_tile;
TileIndex to_tile;
DiagDirectionByte from_direction;
DiagDirectionByte to_direction;
bool from_deliver; ///< True if this is the station that GIVES cargo
bool to_deliver;
TileIndex depot_tile;
DiagDirectionByte depot_direction;
byte amount_veh; ///< How many vehicles we are going to build in this route
byte cur_veh; ///< How many vehicles did we bought?
VehicleID veh_id; ///< Used when bought a vehicle
VehicleID veh_main_id; ///< The ID of the first vehicle, for shared copy
int from_ic; ///< ic = industry/city. This is the ID of them
byte from_type; ///< AI_NO_TYPE/AI_CITY/AI_INDUSTRY
int to_ic;
byte to_type;
};
extern PlayerAiNew _players_ainew[MAX_PLAYERS];
#endif /* AI_TROLLY_H */

View File

@@ -6,9 +6,8 @@
#define AIRCRAFT_H
#include "station_map.h"
#include "vehicle.h"
#include "vehicle_base.h"
#include "engine.h"
#include "variables.h"
/** An aircraft can be one ot those types */
enum AircraftSubType {
@@ -125,6 +124,7 @@ struct Aircraft : public Vehicle {
Money GetRunningCost() const { return AircraftVehInfo(this->engine_type)->running_cost * _price.aircraft_running; }
bool IsInDepot() const { return (this->vehstatus & VS_HIDDEN) != 0 && IsHangarTile(this->tile); }
void Tick();
void OnNewDay();
};
#endif /* AIRCRAFT_H */

View File

@@ -7,33 +7,38 @@
#include "openttd.h"
#include "aircraft.h"
#include "debug.h"
#include "functions.h"
#include "landscape.h"
#include "station_map.h"
#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
#include "vehicle.h"
#include "timetable.h"
#include "depot.h"
#include "engine.h"
#include "command.h"
#include "station.h"
#include "news.h"
#include "sound.h"
#include "player.h"
#include "aircraft.h"
#include "airport.h"
#include "vehicle_gui.h"
#include "table/sprites.h"
#include "newgrf_engine.h"
#include "newgrf_callbacks.h"
#include "newgrf_text.h"
#include "newgrf_sound.h"
#include "date.h"
#include "spritecache.h"
#include "cargotype.h"
#include "strings_func.h"
#include "command_func.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
#include "functions.h"
#include "variables.h"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
#include "gfx_func.h"
#include "player_func.h"
#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
void Aircraft::UpdateDeltaXY(Direction direction)
{
@@ -162,7 +167,7 @@ int Aircraft::GetImage(Direction direction) const
int sprite = GetCustomVehicleSprite(this, direction);
if (sprite != 0) return sprite;
spritenum = orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
spritenum = _orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
}
return direction + _aircraft_sprite[spritenum];
}
@@ -190,7 +195,7 @@ void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal)
if (is_custom_sprite(spritenum)) {
sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite == 0) {
spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
sprite = (6 + _aircraft_sprite[spritenum]);
}
}
@@ -218,7 +223,7 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
if (is_custom_sprite(spritenum)) {
sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite == 0) {
spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
sprite = (6 + _aircraft_sprite[spritenum]);
}
}
@@ -231,7 +236,7 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
static CommandCost EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi)
{
return CommandCost(GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
return CommandCost(EXPENSES_NEW_VEHICLES, GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
}
@@ -279,8 +284,6 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!IsHangarTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
/* Prevent building aircraft types at places which can't handle them */
if (!CanAircraftUseStation(p1, tile)) return CMD_ERROR;
@@ -318,6 +321,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
u->z_pos = GetSlopeZ(x, y);
v->z_pos = u->z_pos + 1;
v->running_ticks = 0;
// u->delta_x = u->delta_y = 0;
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
@@ -334,7 +339,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->cargo_subtype = 0;
v->string_id = STR_SV_AIRCRAFT_NAME;
v->name = NULL;
// v->next_order_param = v->next_order = 0;
// v->load_unload_time_rem = 0;
@@ -489,9 +494,7 @@ CommandCost CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
CommandCost ret(-v->value);
CommandCost ret(EXPENSES_NEW_VEHICLES, -v->value);
if (flags & DC_EXEC) {
// Invalidate depot
@@ -536,7 +539,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
v->vehstatus ^= VS_STOPPED;
v->cur_speed = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
@@ -568,24 +571,24 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner) || v->IsInDepot()) return CMD_ERROR;
if (v->current_order.type == OT_GOTO_DEPOT && !(p2 & DEPOT_LOCATE_HANGAR)) {
if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
/* We called with a different DEPOT_SERVICE setting.
* Now we change the setting to apply the new one and let the vehicle head for the same hangar.
* Note: the if is (true for requesting service == true for ordered to stop in hangar) */
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
if (p2 & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of hangar orders
if (flags & DC_EXEC) {
if (v->current_order.flags & OF_UNLOAD) v->cur_order_index++;
if (v->current_order.flags & OFB_UNLOAD) v->cur_order_index++;
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
} else {
bool next_airport_has_hangar = true;
@@ -605,11 +608,11 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (v->current_order.type == OT_LOADING) v->LeaveStation();
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
v->current_order.flags = OFB_NON_STOP;
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
v->current_order.refit_cargo = CT_INVALID;
v->current_order.dest = next_airport_index;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
if (v->u.air.state == FLYING && !next_airport_has_hangar) {
/* The aircraft is now heading for a different hangar than the next in the orders */
AircraftNextAirportPos_and_Order(v);
@@ -641,13 +644,12 @@ CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
/* Check cargo */
CargoID new_cid = GB(p2, 0, 8);
if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
/* Check the refit capacity callback */
uint16 callback = CALLBACK_FAILED;
if (HasBit(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_REFIT_CAPACITY)) {
@@ -714,37 +716,37 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
// printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
// v->u.air.targetairport = st->index;
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
v->current_order.flags = OFB_NON_STOP;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
} else if (v->current_order.type == OT_GOTO_DEPOT) {
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
void OnNewDay_Aircraft(Vehicle *v)
void Aircraft::OnNewDay()
{
if (!IsNormalAircraft(v)) return;
if (!IsNormalAircraft(this)) return;
if ((++v->day_counter & 7) == 0) DecreaseVehicleValue(v);
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);
CheckOrders(v);
CheckOrders(this);
CheckVehicleBreakdown(v);
AgeVehicle(v);
CheckIfAircraftNeedsService(v);
CheckVehicleBreakdown(this);
AgeVehicle(this);
CheckIfAircraftNeedsService(this);
if (v->vehstatus & VS_STOPPED) return;
if (this->running_ticks == 0) return;
CommandCost cost = CommandCost(GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
CommandCost cost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running * this->running_ticks / (364 * DAY_TICKS));
v->profit_this_year -= cost.GetCost() >> 8;
this->profit_this_year -= cost.GetCost();
this->running_ticks = 0;
SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
SubtractMoneyFromPlayerFract(v->owner, cost);
SubtractMoneyFromPlayerFract(this->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
@@ -922,6 +924,10 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
uint spd = v->acceleration * 16;
byte t;
/* Adjust speed limits by plane speed factor to prevent taxiing
* and take-off speeds being too low. */
speed_limit *= _patches.plane_speed;
if (v->u.air.cached_max_speed < speed_limit) {
if (v->cur_speed < speed_limit) hard_limit = false;
speed_limit = v->u.air.cached_max_speed;
@@ -931,7 +937,15 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
v->subspeed = (t=v->subspeed) + (byte)spd;
if (!hard_limit && v->cur_speed > speed_limit) speed_limit = v->cur_speed - (v->cur_speed / 48);
/* Aircraft's current speed is used twice so that very fast planes are
* forced to slow down rapidly in the short distance needed. The magic
* value 16384 was determined to give similar results to the old speed/48
* method at slower speeds. This also results in less reduction at slow
* speeds to that aircraft do not get to taxi speed straight after
* touchdown. */
if (!hard_limit && v->cur_speed > speed_limit) {
speed_limit = v->cur_speed - max(1, ((v->cur_speed * v->cur_speed) / 16384) / _patches.plane_speed);
}
spd = min(v->cur_speed + (spd >> 8) + (v->subspeed < t), speed_limit);
@@ -942,9 +956,12 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_patches.vehicle_speed)
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
/* Adjust distance moved by plane speed setting */
if (_patches.plane_speed > 1) spd /= _patches.plane_speed;
if (!(v->direction & 1)) spd = spd * 3 / 4;
spd += v->progress;
@@ -1088,34 +1105,36 @@ static bool AircraftController(Vehicle *v)
/* Helicopter landing. */
if (amd->flag & AMED_HELI_LOWER) {
count = UpdateAircraftSpeed(v);
if (count > 0) {
if (st->airport_tile == 0) {
/* FIXME - AircraftController -> if station no longer exists, do not land
* helicopter will circle until sign disappears, then go to next order
* what to do when it is the only order left, right now it just stays in 1 place */
v->u.air.state = FLYING;
UpdateAircraftCache(v);
AircraftNextAirportPos_and_Order(v);
return false;
}
if (st->airport_tile == 0) {
/* FIXME - AircraftController -> if station no longer exists, do not land
* helicopter will circle until sign disappears, then go to next order
* what to do when it is the only order left, right now it just stays in 1 place */
v->u.air.state = FLYING;
UpdateAircraftCache(v);
AircraftNextAirportPos_and_Order(v);
return false;
}
/* Vehicle is now at the airport. */
v->tile = st->airport_tile;
/* Vehicle is now at the airport. */
v->tile = st->airport_tile;
/* Find altitude of landing position. */
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
/* Find altitude of landing position. */
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
if (z == v->z_pos) {
Vehicle *u = v->Next()->Next();
if (z == v->z_pos) {
Vehicle *u = v->Next()->Next();
/* Increase speed of rotors. When speed is 80, we've landed. */
if (u->cur_speed >= 80) return true;
u->cur_speed += 4;
} else if (v->z_pos > z) {
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
} else {
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
/* Increase speed of rotors. When speed is 80, we've landed. */
if (u->cur_speed >= 80) return true;
u->cur_speed += 4;
} else {
count = UpdateAircraftSpeed(v);
if (count > 0) {
if (v->z_pos > z) {
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
} else {
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
}
}
}
return false;
@@ -1195,7 +1214,7 @@ static bool AircraftController(Vehicle *v)
v->tile = gp.new_tile;
/* If vehicle is in the air, use tile coordinate 0. */
// if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
/* Adjust Z for land or takeoff? */
uint z = v->z_pos;
@@ -1289,8 +1308,7 @@ static void HandleCrashedAircraft(Vehicle *v)
CLRBITS(st->airport_flags, RUNWAY_IN_OUT_block); // commuter airport
CLRBITS(st->airport_flags, RUNWAY_IN2_block); // intercontinental
BeginVehicleMove(v);
EndVehicleMove(v);
MarkSingleVehicleDirty(v);
DoDeleteAircraft(v);
}
@@ -1348,8 +1366,8 @@ static void ProcessAircraftOrder(Vehicle *v)
{
switch (v->current_order.type) {
case OT_GOTO_DEPOT:
if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
!VehicleNeedsService(v)) {
UpdateVehicleTimetable(v, true);
v->cur_order_index++;
@@ -1418,7 +1436,7 @@ void Aircraft::MarkDirty()
{
this->cur_image = this->GetImage(this->direction);
if (this->subtype == AIR_HELICOPTER) this->Next()->Next()->cur_image = GetRotorImage(this);
MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
MarkSingleVehicleDirty(this);
}
static void CrashAirplane(Vehicle *v)
@@ -1550,6 +1568,45 @@ static void AircraftLeaveHangar(Vehicle *v)
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
/** Checks if an aircraft should head towards a hangar because it needs replacement
* @param *v the vehicle to test
* @return true if the aircraft should head towards a hangar
*/
static inline bool CheckSendAircraftToHangarForReplacement(const Vehicle *v)
{
EngineID new_engine;
Player *p = GetPlayer(v->owner);
if (VehicleHasDepotOrders(v)) return false; // The aircraft will end up in the hangar eventually on it's own
new_engine = EngineReplacementForPlayer(p, v->engine_type, v->group_id);
if (new_engine == INVALID_ENGINE) {
/* There is no autoreplace assigned to this EngineID so we will set it to renew to the same type if needed */
new_engine = v->engine_type;
if (!v->NeedsAutorenewing(p)) {
/* No need to replace the aircraft */
return false;
}
}
if (!HasBit(GetEngine(new_engine)->player_avail, v->owner)) {
/* Engine is not buildable anymore */
return false;
}
if (p->player_money < (p->engine_renew_money + (2 * DoCommand(0, new_engine, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT).GetCost()))) {
/* We lack enough money to request the replacement right away.
* We want 2*(the price of the new vehicle) and not looking at the value of the vehicle we are going to sell.
* The reason is that we don't want to send a whole lot of vehicles to the hangars when we only have enough money to replace a single one.
* Remember this happens in the background so the user can't stop this. */
return false;
}
/* We found no reason NOT to send the aircraft to a hangar so we will send it there at once */
return true;
}
////////////////////////////////////////////////////////////////////////////////
/////////////////// AIRCRAFT MOVEMENT SCHEME ////////////////////////////////
@@ -1678,22 +1735,16 @@ static void AircraftEventHandler_EndTakeOff(Vehicle *v, const AirportFTAClass *a
static void AircraftEventHandler_HeliTakeOff(Vehicle *v, const AirportFTAClass *apc)
{
const Player* p = GetPlayer(v->owner);
v->u.air.state = FLYING;
v->UpdateDeltaXY(INVALID_DIR);
/* get the next position to go to, differs per airport */
AircraftNextAirportPos_and_Order(v);
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
* unless it is due for renewal but the engine is no longer available */
if (v->owner == _local_player && (
EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
((p->engine_renew && v->age - v->max_age > p->engine_renew_months * 30) &&
HasBit(GetEngine(v->engine_type)->player_avail, _local_player))
)) {
_current_player = _local_player;
DoCommandP(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
/* Send the helicopter to a hangar if needed for replacement */
if (CheckSendAircraftToHangarForReplacement(v)) {
_current_player = v->owner;
DoCommand(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
_current_player = OWNER_NONE;
}
}
@@ -1743,16 +1794,10 @@ static void AircraftEventHandler_Landing(Vehicle *v, const AirportFTAClass *apc)
AircraftLandAirplane(v); // maybe crash airplane
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */
if (v->current_order.type != OT_GOTO_DEPOT && v->owner == _local_player) {
/* only the vehicle owner needs to calculate the rest (locally) */
const Player* p = GetPlayer(v->owner);
if (EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
(p->engine_renew && v->age - v->max_age > (p->engine_renew_months * 30))) {
/* send the aircraft to the hangar at next airport */
_current_player = _local_player;
DoCommandP(v->tile, v->index, DEPOT_SERVICE, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
_current_player = OWNER_NONE;
}
if (CheckSendAircraftToHangarForReplacement(v)) {
_current_player = v->owner;
DoCommand(v->tile, v->index, DEPOT_SERVICE, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
_current_player = OWNER_NONE;
}
}
@@ -2090,7 +2135,6 @@ static bool AirportFindFreeHelipad(Vehicle *v, const AirportFTAClass *apc)
static void AircraftEventHandler(Vehicle *v, int loop)
{
v->tick_counter++;
v->current_order_time++;
if (v->vehstatus & VS_CRASHED) {
HandleCrashedAircraft(v);
@@ -2121,10 +2165,14 @@ void Aircraft::Tick()
{
if (!IsNormalAircraft(this)) return;
if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++;
if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this);
AgeAircraftCargo(this);
this->current_order_time++;
for (uint i = 0; i != 2; i++) {
AircraftEventHandler(this, i);
if (this->type != VEH_AIRCRAFT) // In case it was deleted

View File

@@ -6,22 +6,17 @@
#include "openttd.h"
#include "aircraft.h"
#include "debug.h"
#include "functions.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "vehicle.h"
#include "gfx.h"
#include "command.h"
#include "engine.h"
#include "viewport.h"
#include "player.h"
#include "depot.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
#include "gfx_func.h"
#include "table/sprites.h"
#include "table/strings.h"
/**
* Draw the details for the given vehicle at the position (x,y)

View File

@@ -5,13 +5,12 @@
#include "stdafx.h"
#include "openttd.h"
#include "debug.h"
#include "map.h"
#include "airport.h"
#include "macros.h"
#include "variables.h"
#include "airport_movement.h"
#include "date.h"
#include "helpers.hpp"
#include "core/bitmath_func.hpp"
#include "core/alloc_func.hpp"
#include "date_func.h"
#include "settings_type.h"
/* Uncomment this to print out a full report of the airport-structure
* You should either use

View File

@@ -5,7 +5,8 @@
#ifndef AIRPORT_H
#define AIRPORT_H
#include "direction.h"
#include "direction_type.h"
#include "map_type.h"
enum {MAX_TERMINALS = 10};
enum {MAX_HELIPADS = 4};

View File

@@ -4,20 +4,23 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "functions.h"
#include "map.h"
#include "window.h"
#include "window_gui.h"
#include "gui.h"
#include "viewport.h"
#include "gfx.h"
#include "sound.h"
#include "command.h"
#include "vehicle.h"
#include "station_gui.h"
#include "terraform_gui.h"
#include "command_func.h"
#include "station.h"
#include "airport.h"
#include "depot.h"
#include "sound_func.h"
#include "window_func.h"
#include "settings_type.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "player_func.h"
#include "table/sprites.h"
#include "table/strings.h"
static byte _selected_airport_type;
@@ -176,14 +179,19 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
airport = GetAirport(_selected_airport_type);
SetTileSelectSize(airport->size_x, airport->size_y);
int rad = _patches.modified_catchment ? airport->catchment : 4;
int rad = _patches.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
DrawWindowWidgets(w);
// strings such as 'Size' and 'Coverage Area'
// 'Coverage Area'
DrawStationCoverageAreaText(2, 206, SCT_ALL, rad);
int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad) + 4;
if (text_end > w->widget[6].bottom) {
SetWindowDirty(w);
ResizeWindowForWidget(w, 6, 0, text_end - w->widget[6].bottom);
SetWindowDirty(w);
}
break;
}

View File

@@ -4,15 +4,13 @@
#include "stdafx.h"
#include "openttd.h"
#include "functions.h"
#include "command.h"
#include "vehicle.h"
#include "articulated_vehicles.h"
#include "engine.h"
#include "train.h"
#include "roadveh.h"
#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "vehicle_func.h"
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
@@ -36,6 +34,42 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
return i - 1;
}
uint16 *GetCapacityOfArticulatedParts(EngineID engine, VehicleType type)
{
static uint16 capacity[NUM_CARGO];
memset(capacity, 0, sizeof(capacity));
if (type == VEH_TRAIN) {
const RailVehicleInfo *rvi = RailVehInfo(engine);
capacity[rvi->cargo_type] = rvi->capacity;
if (rvi->railveh_type == RAILVEH_MULTIHEAD) capacity[rvi->cargo_type] += rvi->capacity;
} else if (type == VEH_ROAD) {
const RoadVehicleInfo *rvi = RoadVehInfo(engine);
capacity[rvi->cargo_type] = rvi->capacity;
}
if (!HasBit(EngInfo(engine)->callbackmask, CBM_VEHICLE_ARTIC_ENGINE)) return capacity;
for (uint i = 1; i < MAX_UVALUE(EngineID); i++) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, engine, NULL);
if (callback == CALLBACK_FAILED || callback == 0xFF) break;
EngineID artic_engine = GetFirstEngineOfType(type) + GB(callback, 0, 7);
if (type == VEH_TRAIN) {
const RailVehicleInfo *rvi = RailVehInfo(artic_engine);
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x14, rvi->capacity);
} else if (type == VEH_ROAD) {
const RoadVehicleInfo *rvi = RoadVehInfo(artic_engine);
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x0F, rvi->capacity);
}
}
return capacity;
}
void AddArticulatedParts(Vehicle **vl, VehicleType type)
{
const Vehicle *v = vl[0];

View File

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

38
src/autoreplace_base.h Normal file
View File

@@ -0,0 +1,38 @@
/* $Id$ */
/** @file autoreplace_base.h Base class for autoreplaces/autorenews. */
#ifndef AUTOREPLACE_BASE_H
#define AUTOREPLACE_BASE_H
#include "oldpool.h"
#include "autoreplace_type.h"
/**
* Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
* placed here so the only exception to this rule, the saveload code, can use
* it.
*/
DECLARE_OLD_POOL(EngineRenew, EngineRenew, 3, 8000)
/**
* Struct to store engine replacements. DO NOT USE outside of engine.c. Is
* placed here so the only exception to this rule, the saveload code, can use
* it.
*/
struct EngineRenew : PoolItem<EngineRenew, EngineRenewID, &_EngineRenew_pool> {
EngineID from;
EngineID to;
EngineRenew *next;
GroupID group_id;
EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to), next(NULL) {}
~EngineRenew() { this->from = INVALID_ENGINE; }
inline bool IsValid() const { return this->from != INVALID_ENGINE; }
};
#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1U < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1U) : NULL) if (er->IsValid())
#define FOR_ALL_ENGINE_RENEWS(er) FOR_ALL_ENGINE_RENEWS_FROM(er, 0)
#endif /* AUTOREPLACE_BASE_H */

View File

@@ -4,11 +4,8 @@
#include "openttd.h"
#include "roadveh.h"
#include "ship.h"
#include "table/strings.h"
#include "functions.h"
#include "news.h"
#include "command.h"
#include "player.h"
#include "player_func.h"
#include "engine.h"
#include "debug.h"
#include "vehicle_gui.h"
@@ -17,7 +14,16 @@
#include "aircraft.h"
#include "cargotype.h"
#include "group.h"
#include "strings.h"
#include "order.h"
#include "strings_func.h"
#include "command_func.h"
#include "vehicle_func.h"
#include "functions.h"
#include "variables.h"
#include "autoreplace_func.h"
#include "articulated_vehicles.h"
#include "table/strings.h"
/*
@@ -89,7 +95,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
if (v->cargo_cap != 0 && (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type))) {
if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
} else {
@@ -131,21 +137,12 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
const UnitID cached_unitnumber = old_v->unitnumber;
bool new_front = false;
Vehicle *new_v = NULL;
char vehicle_name[32];
char *vehicle_name = NULL;
CargoID replacement_cargo_type;
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
* If not, chek if an global auto replacement is defined */
new_engine_type = (IsValidGroupID(old_v->group_id) && GetGroup(old_v->group_id)->replace_protection) ?
INVALID_ENGINE :
EngineReplacementForPlayer(p, old_v->engine_type, ALL_GROUP);
/* If we don't set new_egnine_type previously, we try to check if an autoreplacement was defined
* for the group and the engine_type of the vehicle */
if (new_engine_type == INVALID_ENGINE && !IsAllGroupID(old_v->group_id)) {
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
}
/* Check if there is a autoreplacement set for the vehicle */
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
/* if not, just renew to the same type */
if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
@@ -158,12 +155,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
/* We give the player a loan of the same amount as the sell value.
* This is needed in case he needs the income from the sale to build the new vehicle.
* We take it back if building fails or when we really sell the old engine */
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
SubtractMoneyFromPlayer(sell_value);
cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
if (CmdFailed(cost)) {
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
/* Take back the money we just gave the player */
sell_value.MultiplyCost(-1);
SubtractMoneyFromPlayer(sell_value);
@@ -173,7 +168,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
if (replacement_cargo_type != CT_NO_REFIT) {
/* add refit cost */
CommandCost refit_cost = GetRefitCost(new_engine_type);
if (old_v->type == VEH_TRAIN && IsMultiheaded(old_v)) refit_cost.AddCost(refit_cost); // pay for both ends
if (old_v->type == VEH_TRAIN && RailVehInfo(new_engine_type)->railveh_type == RAILVEH_MULTIHEAD) {
/* Since it's a dualheaded engine we have to pay once more because the rear end is being refitted too. */
refit_cost.AddCost(refit_cost);
}
cost.AddCost(refit_cost);
}
@@ -209,7 +207,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
DoCommand(0, (front->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
} else {
// copy/clone the orders
DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
DoCommand(0, (old_v->index << 16) | new_v->index, old_v->IsOrderListShared() ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
new_v->cur_order_index = old_v->cur_order_index;
ChangeVehicleViewWindow(old_v, new_v);
new_v->profit_this_year = old_v->profit_this_year;
@@ -239,12 +237,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
MoveVehicleCargo(new_v->type == VEH_TRAIN ? new_v->First() : new_v, old_v);
// Get the name of the old vehicle if it has a custom name.
if (!IsCustomName(old_v->string_id)) {
vehicle_name[0] = '\0';
} else {
SetDParam(0, old_v->index);
GetString(vehicle_name, STR_VEHICLE_NAME, lastof(vehicle_name));
}
if (old_v->name != NULL) vehicle_name = strdup(old_v->name);
} else { // flags & DC_EXEC not set
CommandCost tmp_move;
@@ -263,7 +256,6 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
/* Ensure that the player will not end up having negative money while autoreplacing
* This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
if (CmdFailed(tmp_move) || p->player_money < (cost.GetCost() + total_cost)) {
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
/* Pay back the loan */
sell_value.MultiplyCost(-1);
SubtractMoneyFromPlayer(sell_value);
@@ -273,7 +265,6 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
/* Take back the money we just gave the player just before building the vehicle
* The player will get the same amount now that the sale actually takes place */
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
sell_value.MultiplyCost(-1);
SubtractMoneyFromPlayer(sell_value);
@@ -286,9 +277,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
}
/* Transfer the name of the old vehicle */
if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
if ((flags & DC_EXEC) && vehicle_name != NULL) {
_cmd_text = vehicle_name;
DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
free(vehicle_name);
}
return cost;
@@ -333,7 +325,7 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
v->leave_depot_instantly = false;
for (;;) {
cost = CommandCost();
cost = CommandCost(EXPENSES_NEW_VEHICLES);
w = v;
do {
if (w->type == VEH_TRAIN && IsRearDualheaded(w)) {
@@ -342,25 +334,9 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
}
// check if the vehicle should be replaced
if (!p->engine_renew ||
w->age - w->max_age < (p->engine_renew_months * 30) || // replace if engine is too old
if (!w->NeedsAutorenewing(p) || // replace if engine is too old
w->max_age == 0) { // rail cars got a max age of 0
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
If not, chek if an global auto remplacement is defined */
if (IsValidGroupID(w->group_id)) {
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id) && (
GetGroup(w->group_id)->replace_protection ||
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP))) {
continue;
}
} else if (IsDefaultGroupID(w->group_id)) {
if (!EngineHasReplacementForPlayer(p, w->engine_type, DEFAULT_GROUP) &&
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
continue;
}
} else if (!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
continue;
}
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id)) continue;
}
/* Now replace the vehicle */

103
src/autoreplace_func.h Normal file
View File

@@ -0,0 +1,103 @@
/* $Id$ */
/** @file autoreplace_func.h Functions related to autoreplacing. */
#ifndef AUTOREPLACE_FUNC_H
#define AUTOREPLACE_FUNC_H
#include "autoreplace_type.h"
#include "player_base.h"
/**
* Remove all engine replacement settings for the player.
* @param erl The renewlist for a given player.
* @return The new renewlist for the player.
*/
void RemoveAllEngineReplacement(EngineRenewList *erl);
/**
* Retrieve the engine replacement in a given renewlist for an original engine type.
* @param erl The renewlist to search in.
* @param engine Engine type to be replaced.
* @return The engine type to replace with, or INVALID_ENGINE if no
* replacement is in the list.
*/
EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
/**
* Add an engine replacement to the given renewlist.
* @param erl The renewlist to add to.
* @param old_engine The original engine type.
* @param new_engine The replacement engine type.
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
/**
* Remove an engine replacement from a given renewlist.
* @param erl The renewlist from which to remove the replacement
* @param engine The original engine type.
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags);
/**
* Remove all engine replacement settings for the given player.
* @param p Player.
*/
static inline void RemoveAllEngineReplacementForPlayer(Player *p)
{
RemoveAllEngineReplacement(&p->engine_renew_list);
}
/**
* Retrieve the engine replacement for the given player and original engine type.
* @param p Player.
* @param engine Engine type.
* @return The engine type to replace with, or INVALID_ENGINE if no
* replacement is in the list.
*/
static inline EngineID EngineReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
{
return EngineReplacement(p->engine_renew_list, engine, group);
}
/**
* Check if a player has a replacement set up for the given engine.
* @param p Player.
* @param engine Engine type to be replaced.
* @return true if a replacement was set up, false otherwise.
*/
static inline bool EngineHasReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
{
return EngineReplacementForPlayer(p, engine, group) != INVALID_ENGINE;
}
/**
* Add an engine replacement for the player.
* @param p Player.
* @param old_engine The original engine type.
* @param new_engine The replacement engine type.
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
static inline CommandCost AddEngineReplacementForPlayer(Player *p, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags)
{
return AddEngineReplacement(&p->engine_renew_list, old_engine, new_engine, group, flags);
}
/**
* Remove an engine replacement for the player.
* @param p Player.
* @param engine The original engine type.
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
static inline CommandCost RemoveEngineReplacementForPlayer(Player *p, EngineID engine, GroupID group, uint32 flags)
{
return RemoveEngineReplacement(&p->engine_renew_list, engine, group, flags);
}
#endif /* AUTOREPLACE_FUNC_H */

View File

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

18
src/autoreplace_gui.h Normal file
View File

@@ -0,0 +1,18 @@
/* $Id$ */
/** @file autoreplace_gui.h Functions related to the autoreplace GUIs*/
#ifndef AUTOREPLACE_GUI_H
#define AUTOREPLACE_GUI_H
#include "vehicle_type.h"
/**
* When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
* @param type The type of engine
*/
void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
#endif /* AUTOREPLACE_GUI_H */

15
src/autoreplace_type.h Normal file
View File

@@ -0,0 +1,15 @@
/* $Id$ */
/** @file autoreplace_type.h Types related to autoreplacing. */
#ifndef AUTOREPLACE_TYPE_H
#define AUTOREPLACE_TYPE_H
struct EngineRenew;
/**
* A list to group EngineRenew directives together (such as per-player).
*/
typedef EngineRenew* EngineRenewList;
#endif /* AUTOREPLACE_TYPE_H */

View File

@@ -6,6 +6,8 @@
#define AUTOSLOPE_H
#include "depot.h"
#include "settings_type.h"
#include "player_func.h"
/**
* Autoslope check for tiles with an entrance on an edge.

View File

@@ -21,7 +21,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "aystar.h"
#include "helpers.hpp"
#include "core/alloc_func.hpp"
int _aystar_stats_open_size;
int _aystar_stats_closed_size;

View File

@@ -12,6 +12,7 @@
#define AYSTAR_H
#include "queue.h"
#include "tile_type.h"
//#define AYSTAR_DEBUG
enum {

View File

@@ -1,16 +1,20 @@
/* $Id$ */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../core/alloc_func.hpp"
#include "../gfx_func.h"
#include "../zoom_func.h"
#include "../debug.h"
#include "../table/sprites.h"
#include "../video/video_driver.hpp"
#include "32bpp_anim.hpp"
#include "../table/sprites.h"
static FBlitter_32bppAnim iFBlitter_32bppAnim;
void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
{
if (bp->dst < _screen.dst_ptr || bp->dst > (uint32 *)_screen.dst_ptr + _screen.width * _screen.height) {
if (_screen_disable_anim) {
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent Draw() */
Blitter_32bppOptimized::Draw(bp, mode, zoom);
return;
@@ -95,6 +99,12 @@ void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL
void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, int pal)
{
if (_screen_disable_anim) {
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColorMappingRect() */
Blitter_32bppOptimized::DrawColorMappingRect(dst, width, height, pal);
return;
}
uint32 *udst = (uint32 *)dst;
uint8 *anim;
@@ -133,7 +143,9 @@ void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, i
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 color)
{
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
/* Set the color in the anim-buffer too */
/* Set the color in the anim-buffer too, if we are rendering to the screen */
if (_screen_disable_anim) return;
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
}
@@ -142,13 +154,20 @@ void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
if (*dst == 0) {
*dst = LookupColourInPalette(color);
/* Set the color in the anim-buffer too */
/* Set the color in the anim-buffer too, if we are rendering to the screen */
if (_screen_disable_anim) return;
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
}
}
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color)
{
if (_screen_disable_anim) {
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawRect() */
Blitter_32bppOptimized::DrawRect(video, width, height, color);
return;
}
uint32 color32 = LookupColourInPalette(color);
uint8 *anim_line;
@@ -172,6 +191,7 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color
void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, int height)
{
assert(!_screen_disable_anim);
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
uint32 *dst = (uint32 *)video;
uint32 *usrc = (uint32 *)src;
@@ -195,6 +215,7 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width,
void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, int height)
{
assert(!_screen_disable_anim);
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
uint32 *udst = (uint32 *)dst;
uint32 *src = (uint32 *)video;
@@ -217,6 +238,8 @@ void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, in
void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
{
assert(!_screen_disable_anim);
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
uint8 *dst, *src;
/* We need to scroll the anim-buffer too */
@@ -265,6 +288,7 @@ int Blitter_32bppAnim::BufferSize(int width, int height)
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
{
assert(!_screen_disable_anim);
uint8 *anim = this->anim_buf;
/* Never repaint the transparency pixel */

View File

@@ -1,5 +1,7 @@
/* $Id$ */
#include "../stdafx.h"
#include "../gfx.h"
#include "../gfx_func.h"
#include "32bpp_base.hpp"
void *Blitter_32bppBase::MoveTo(const void *video, int x, int y)

View File

@@ -6,6 +6,7 @@
#define BLITTER_32BPP_BASE_HPP
#include "base.hpp"
#include "../core/bitmath_func.hpp"
class Blitter_32bppBase : public Blitter {
public:

View File

@@ -1,8 +1,9 @@
/* $Id$ */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../zoom_func.h"
#include "../gfx_func.h"
#include "../debug.h"
#include "../table/sprites.h"
#include "32bpp_optimized.hpp"
static FBlitter_32bppOptimized iFBlitter_32bppOptimized;

View File

@@ -1,10 +1,13 @@
/* $Id$ */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../gfx_func.h"
#include "../zoom_func.h"
#include "../debug.h"
#include "../table/sprites.h"
#include "32bpp_simple.hpp"
#include "../table/sprites.h"
static FBlitter_32bppSimple iFBlitter_32bppSimple;
void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)

View File

@@ -1,5 +1,7 @@
/* $Id$ */
#include "../stdafx.h"
#include "../gfx.h"
#include "../gfx_func.h"
#include "8bpp_base.hpp"
void Blitter_8bppBase::DrawColorMappingRect(void *dst, int width, int height, int pal)

View File

@@ -3,9 +3,8 @@
/** @file 8bpp_debug.cpp */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../functions.h"
#include "../zoom_func.h"
#include "../core/random_func.hpp"
#include "8bpp_debug.hpp"
static FBlitter_8bppDebug iFBlitter_8bppDebug;

View File

@@ -3,9 +3,9 @@
/** @file 8bpp_optimized.cpp */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../zoom_func.h"
#include "../debug.h"
#include "../core/alloc_func.hpp"
#include "8bpp_optimized.hpp"
static FBlitter_8bppOptimized iFBlitter_8bppOptimized;
@@ -17,7 +17,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
uint offset = 0;
/* Find the offset of this zoom-level */
offset = ((const uint8 *)bp->sprite)[(int)zoom * 2] | ((const byte *)bp->sprite)[(int)zoom * 2 + 1] << 8;
offset = ((const uint8 *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2] | ((const byte *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2 + 1] << 8;
/* Find where to start reading in the source sprite */
src = (const uint8 *)bp->sprite + offset;
@@ -110,9 +110,9 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
uint index = 0;
/* Make memory for all zoom-levels */
memory += (int)ZOOM_LVL_END * sizeof(uint16);
for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
memory += UnScaleByZoom(sprite->height, (ZoomLevel)i) * UnScaleByZoom(sprite->width, (ZoomLevel)i);
memory += (int)(ZOOM_LVL_END - ZOOM_LVL_BEGIN) * sizeof(uint16);
for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
memory += UnScaleByZoom(sprite->height, i) * UnScaleByZoom(sprite->width, i);
index += 2;
}
@@ -121,7 +121,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
temp_dst = MallocT<byte>(memory);
/* Make the sprites per zoom-level */
for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
/* Store the scaled image */
const SpriteLoader::CommonPixel *src;
@@ -131,19 +131,19 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
byte *dst = &temp_dst[index];
for (int y = 0; y < UnScaleByZoom(sprite->height, (ZoomLevel)i); y++) {
for (int y = 0; y < UnScaleByZoom(sprite->height, i); y++) {
uint trans = 0;
uint pixels = 0;
uint last_color = 0;
uint count_index = 0;
uint rx = 0;
src = &sprite->data[ScaleByZoom(y, (ZoomLevel)i) * sprite->width];
src = &sprite->data[ScaleByZoom(y, i) * sprite->width];
for (int x = 0; x < UnScaleByZoom(sprite->width, (ZoomLevel)i); x++) {
for (int x = 0; x < UnScaleByZoom(sprite->width, i); x++) {
uint color = 0;
/* Get the color keeping in mind the zoom-level */
for (int j = 0; j < ScaleByZoom(1, (ZoomLevel)i); j++) {
for (int j = 0; j < ScaleByZoom(1, i); j++) {
if (src->m != 0) color = src->m;
src++;
rx++;

View File

@@ -3,8 +3,7 @@
/** @file 8bpp_simple.cpp */
#include "../stdafx.h"
#include "../zoom.hpp"
#include "../gfx.h"
#include "../zoom_func.h"
#include "8bpp_simple.hpp"
static FBlitter_8bppSimple iFBlitter_8bppSimple;

View File

@@ -5,6 +5,7 @@
#include "../spritecache.h"
#include "../spriteloader/spriteloader.hpp"
#include "../zoom_type.h"
enum BlitterMode {
BM_NORMAL,

View File

@@ -4,8 +4,8 @@
#define BLITTER_FACTORY_HPP
#include "base.hpp"
#include "../string.h"
#include "../debug.h"
#include "../string_func.h"
#include <string>
#include <map>
@@ -130,4 +130,6 @@ public:
const char *GetName();
};
extern char _ini_blitter[32];
#endif /* BLITTER_FACTORY_HPP */

View File

@@ -1,5 +1,8 @@
/* $Id$ */
/** @file null.cpp A blitter that doesn't blit. */
#include "../stdafx.h"
#include "../variables.h"
#include "null.hpp"
static FBlitter_Null iFBlitter_Null;

View File

@@ -3,11 +3,9 @@
/** @file bmp.cpp */
#include "stdafx.h"
#include "openttd.h"
#include "gfx.h"
#include "bmp.h"
#include "macros.h"
#include "helpers.hpp"
#include "core/bitmath_func.hpp"
#include "core/alloc_func.hpp"
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
{

View File

@@ -5,6 +5,8 @@
#ifndef BMP_H
#define BMP_H
#include "gfx_type.h"
struct BmpInfo {
uint32 offset; ///< offset of bitmap data from .bmp file begining
uint32 width; ///< bitmap width

View File

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

View File

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

View File

@@ -8,6 +8,7 @@
#include "bridge.h"
#include "variables.h"
#include "landscape.h"
#include "tunnelbridge_map.h"
TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
@@ -17,7 +18,7 @@ TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
dir = ReverseDiagDir(dir);
do {
tile += delta;
} while (!IsBridgeTile(tile) || GetBridgeRampDirection(tile) != dir);
} while (!IsBridgeTile(tile) || GetTunnelBridgeDirection(tile) != dir);
return tile;
}
@@ -38,14 +39,14 @@ TileIndex GetSouthernBridgeEnd(TileIndex t)
TileIndex GetOtherBridgeEnd(TileIndex tile)
{
assert(IsBridgeTile(tile));
return GetBridgeEnd(tile, GetBridgeRampDirection(tile));
return GetBridgeEnd(tile, GetTunnelBridgeDirection(tile));
}
uint GetBridgeHeight(TileIndex t)
{
uint h;
Slope tileh = GetTileSlope(t, &h);
Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t)));
/* one height level extra for the ramp */
return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh);

View File

@@ -5,12 +5,10 @@
#ifndef BRIDGE_MAP_H
#define BRIDGE_MAP_H
#include "direction.h"
#include "macros.h"
#include "map.h"
#include "rail.h"
#include "direction_func.h"
#include "rail_type.h"
#include "road_map.h"
#include "tile.h"
#include "bridge.h"
/**
@@ -64,33 +62,18 @@ static inline bool IsBridgeAbove(TileIndex t)
return GB(_m[t].m6, 6, 2) != 0;
}
/**
* Determines the type of bridge on a tile
* @param t The tile to analyze
* @pre IsBridgeTile(t)
* @return The bridge type
*/
static inline uint GetBridgeType(TileIndex t)
static inline BridgeType GetBridgeType(TileIndex t)
{
assert(IsBridgeTile(t));
return GB(_m[t].m2, 4, 4);
}
/**
* Get the direction pointing onto the bridge
* @param t The tile to analyze
* @pre IsBridgeTile(t)
* @return the above mentionned direction
*/
static inline DiagDirection GetBridgeRampDirection(TileIndex t)
{
assert(IsBridgeTile(t));
return (DiagDirection)GB(_m[t].m5, 0, 2);
}
/**
* Get the axis of the bridge that goes over the tile. Not the axis or the ramp.
* @param t The tile to analyze
@@ -103,45 +86,6 @@ static inline Axis GetBridgeAxis(TileIndex t)
return (Axis)(GB(_m[t].m6, 6, 2) - 1);
}
/**
* Get the transport type of the bridge's ramp.
* @param t The ramp tile to analyze
* @pre IsBridgeTile(t)
* @return the transport type of the bridge
*/
static inline TransportType GetBridgeTransportType(TileIndex t)
{
assert(IsBridgeTile(t));
return (TransportType)GB(_m[t].m5, 2, 2);
}
/**
* Does the bridge ramp lie in a snow or desert area?
* @param t The ramp tile to analyze
* @pre IsBridgeTile(t)
* @return true if and only if in a snow or desert area
*/
static inline bool HasBridgeSnowOrDesert(TileIndex t)
{
assert(IsBridgeTile(t));
return HasBit(_m[t].m4, 7);
}
/**
* Sets whether the bridge ramp lies in a snow or desert area.
* @param t The ramp tile to set (un)make a snow/desert area
* @param snow_or_desert Make (true) or unmake the tile a snow/desert area
* @pre IsBridgeTile(t)
*/
static inline void SetBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
{
assert(IsBridgeTile(t));
SB(_m[t].m4, 7, 1, snow_or_desert);
}
/**
* Finds the end of a bridge in the specified direction starting at a middle tile
* @param t the bridge tile to find the bridge ramp for
@@ -187,7 +131,6 @@ static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
ClrBit(_m[t].m6, 6 + a);
}
/**
* Removes bridges from the given, that is bridges along the X and Y axis.
* @param t the tile to remove the bridge from
@@ -221,7 +164,7 @@ static inline void SetBridgeMiddle(TileIndex t, Axis a)
* @param rt the road or rail type
* @note this function should not be called directly.
*/
static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt, uint rt)
static inline void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt, uint rt)
{
SetTileType(t, MP_TUNNELBRIDGE);
SetTileOwner(t, o);
@@ -239,7 +182,7 @@ static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDir
* @param d the direction this ramp must be facing
* @param r the road type of the bridge
*/
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RoadTypes r)
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RoadTypes r)
{
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD, r);
}
@@ -252,7 +195,7 @@ static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, Dia
* @param d the direction this ramp must be facing
* @param r the rail type of the bridge
*/
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RailType r)
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RailType r)
{
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL, r);
}

View File

@@ -9,34 +9,52 @@
#include "ship.h"
#include "aircraft.h"
#include "debug.h"
#include "functions.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "window.h"
#include "gui.h"
#include "vehicle.h"
#include "articulated_vehicles.h"
#include "gfx.h"
#include "textbuf_gui.h"
#include "station.h"
#include "command.h"
#include "command_func.h"
#include "engine.h"
#include "player.h"
#include "player_func.h"
#include "depot.h"
#include "airport.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "date.h"
#include "strings.h"
#include "cargotype.h"
#include "group.h"
#include "road_map.h"
#include "strings_func.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "settings_type.h"
#include "gfx_func.h"
#include "widgets/dropdown_func.h"
#include "table/sprites.h"
#include "table/strings.h"
struct buildvehicle_d {
VehicleType vehicle_type;
union {
RailTypeByte railtype;
AirportFTAClass::Flags flags;
RoadTypes roadtypes;
} filter;
byte sel_index; ///< deprecated value, used for 'unified' ship and road
bool descending_sort_order;
byte sort_criteria;
bool regenerate_list;
EngineID sel_engine;
EngineID rename_engine;
EngineList eng_list;
};
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d));
enum BuildVehicleWidgets {
BUILD_VEHICLE_WIDGET_CLOSEBOX = 0,
BUILD_VEHICLE_WIDGET_CAPTION,
BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING,
BUILD_VEHICLE_WIDGET_SORT_TEXT,
BUILD_VEHICLE_WIDGET_SORT_DROPDOWN,
BUILD_VEHICLE_WIDGET_LIST,
BUILD_VEHICLE_WIDGET_SCROLLBAR,
@@ -51,8 +69,7 @@ static const Widget _build_vehicle_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 239, 0, 13, 0x0, STR_018C_WINDOW_TITLE_DRAG_THIS },
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, RESIZE_RIGHT, 14, 81, 227, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_TEXTBTN, RESIZE_LR, 14, 228, 239, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_DROPDOWN, RESIZE_RIGHT, 14, 81, 239, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_MATRIX, RESIZE_RB, 14, 0, 227, 26, 39, 0x101, STR_NULL },
{ WWT_SCROLLBAR, RESIZE_LRB, 14, 228, 239, 26, 39, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST },
{ WWT_PANEL, RESIZE_RTB, 14, 0, 239, 40, 161, 0x0, STR_NULL },
@@ -64,9 +81,11 @@ static const Widget _build_vehicle_widgets[] = {
};
/* Setup widget strings to fit the different types of vehicles */
static void SetupWindowStrings(Window *w, byte type)
static void SetupWindowStrings(Window *w, VehicleType type)
{
switch (type) {
default: NOT_REACHED();
case VEH_TRAIN:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_JUST_STRING;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_8843_TRAIN_VEHICLE_SELECTION;
@@ -75,6 +94,7 @@ static void SetupWindowStrings(Window *w, byte type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_8820_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_8845_RENAME_TRAIN_VEHICLE_TYPE;
break;
case VEH_ROAD:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9006_NEW_ROAD_VEHICLES;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9026_ROAD_VEHICLE_SELECTION;
@@ -83,6 +103,7 @@ static void SetupWindowStrings(Window *w, byte type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9034_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9035_RENAME_ROAD_VEHICLE_TYPE;
break;
case VEH_SHIP:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9808_NEW_SHIPS;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9825_SHIP_SELECTION_LIST_CLICK;
@@ -91,6 +112,7 @@ static void SetupWindowStrings(Window *w, byte type)
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9836_RENAME;
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9837_RENAME_SHIP_TYPE;
break;
case VEH_AIRCRAFT:
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_A005_NEW_AIRCRAFT;
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_A025_AIRCRAFT_SELECTION_LIST;
@@ -208,8 +230,8 @@ static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
Money va = rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class] * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
Money vb = rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class] * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class) * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class) * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
int r = ClampToI32(va - vb);
return _internal_sort_order ? -r : r;
@@ -226,8 +248,8 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void *
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
* Another thing is that both power and running costs should be doubled for multiheaded engines.
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
Money va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max(1U, (uint)rvi_a->power);
Money vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max(1U, (uint)rvi_b->power);
Money va = (rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class)) / max(1U, (uint)rvi_a->power);
Money vb = (rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class)) / max(1U, (uint)rvi_b->power);
int r = ClampToI32(vb - va);
return _internal_sort_order ? -r : r;
@@ -269,6 +291,41 @@ static int CDECL TrainEnginesThenWagonsSorter(const void *a, const void *b)
return _internal_sort_order ? -r : r;
}
/* Road vehicle sorting functions */
static int CDECL RoadVehEngineCostSorter(const void *a, const void *b)
{
int va = RoadVehInfo(*(const EngineID*)a)->base_cost;
int vb = RoadVehInfo(*(const EngineID*)b)->base_cost;
int r = va - vb;
return _internal_sort_order ? -r : r;
}
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)
{
const RoadVehicleInfo *rvi_a = RoadVehInfo(*(const EngineID*)a);
const RoadVehicleInfo *rvi_b = RoadVehInfo(*(const EngineID*)b);
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class);
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class);
int r = ClampToI32(va - vb);
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;
@@ -282,6 +339,38 @@ static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *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)->base_cost;
int vb = ShipVehInfo(*(const EngineID*)b)->base_cost;
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 = ShipVehInfo(*(const EngineID*)a)->running_cost;
const int vb = ShipVehInfo(*(const EngineID*)b)->running_cost;
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;
@@ -367,15 +456,21 @@ static EngList_SortTypeFunction * const _sorter[][10] = {{
}, {
/* Road vehicles */
&EngineNumberSorter,
&RoadVehEngineCostSorter,
&RoadVehEngineSpeedSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&RoadVehEngineRunningCostSorter,
&EngineReliabilitySorter,
&RoadVehEngineCapacitySorter,
}, {
/* Ships */
&EngineNumberSorter,
&ShipEngineCostSorter,
&ShipEngineSpeedSorter,
&EngineIntroDateSorter,
&EngineNameSorter,
&ShipEngineRunningCostSorter,
&EngineReliabilitySorter,
&ShipEngineCapacitySorter,
}, {
@@ -406,16 +501,22 @@ static const StringID _sort_listing[][11] = {{
}, {
/* Road vehicles */
STR_ENGINE_SORT_ENGINE_ID,
STR_ENGINE_SORT_COST,
STR_SORT_BY_MAX_SPEED,
STR_ENGINE_SORT_INTRO_DATE,
STR_SORT_BY_DROPDOWN_NAME,
STR_ENGINE_SORT_RUNNING_COST,
STR_SORT_BY_RELIABILITY,
STR_ENGINE_SORT_CARGO_CAPACITY,
INVALID_STRING_ID
}, {
/* Ships */
STR_ENGINE_SORT_ENGINE_ID,
STR_ENGINE_SORT_COST,
STR_SORT_BY_MAX_SPEED,
STR_ENGINE_SORT_INTRO_DATE,
STR_SORT_BY_DROPDOWN_NAME,
STR_ENGINE_SORT_RUNNING_COST,
STR_SORT_BY_RELIABILITY,
STR_ENGINE_SORT_CARGO_CAPACITY,
INVALID_STRING_ID
@@ -432,6 +533,26 @@ static const StringID _sort_listing[][11] = {{
INVALID_STRING_ID
}};
static int DrawCargoCapacityInfo(int x, int y, EngineID engine, VehicleType type, bool refittable)
{
uint16 *cap = GetCapacityOfArticulatedParts(engine, type);
for (uint c = 0; c < NUM_CARGO; c++) {
if (cap[c] == 0) continue;
SetDParam(0, c);
SetDParam(1, cap[c]);
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
/* Only show as refittable once */
refittable = false;
}
return y;
}
/* Draw rail wagon specific details */
static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const RailVehicleInfo *rvi)
{
@@ -456,6 +577,14 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const
y += 10;
}
}
/* Running cost */
if (rvi->running_cost_class != 0xFF) {
SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
}
return y;
}
@@ -485,9 +614,11 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
}
/* Running cost */
SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost_base) * _price.running_rail[rvi->running_cost_class] >> 8) << multihead);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
if (rvi->running_cost_class != 0xFF) {
SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8) << multihead);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
}
/* Powered wagons power - Powered wagons extra weight */
if (rvi->pow_wag_power != 0) {
@@ -512,18 +643,12 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R
y += 10;
/* Running cost */
SetDParam(0, rvi->running_cost * _price.roadveh_running >> 8);
SetDParam(0, rvi->running_cost * GetPriceByIndex(rvi->running_cost_class) >> 8);
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
y += 10;
/* Cargo type + capacity */
SetDParam(0, rvi->cargo_type);
SetDParam(1, GetEngineProperty(engine_number, 0x0F, rvi->capacity));
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
return y;
return DrawCargoCapacityInfo(x, y, engine_number, VEH_ROAD, refittable);
}
/* Draw ship specific details */
@@ -614,20 +739,18 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
}
/* Cargo type + capacity, or N/A */
if (rvi->capacity == 0) {
int new_y = DrawCargoCapacityInfo(x, y, engine_number, VEH_TRAIN, refitable);
if (new_y == y) {
SetDParam(0, CT_INVALID);
SetDParam(2, STR_EMPTY);
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
} else {
int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
SetDParam(0, rvi->cargo_type);
SetDParam(1, (capacity * (CountArticulatedParts(engine_number, true) + 1)) << multihead);
SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
y = new_y;
}
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
y += 10;
}
break;
}
case VEH_ROAD:
y = DrawRoadVehPurchaseInfo(x, y, engine_number, RoadVehInfo(engine_number));
refitable = true;
@@ -667,7 +790,7 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
/* Figure out what train EngineIDs to put in the list */
static void GenerateBuildTrainList(Window *w)
{
EngineID eid, sel_id;
EngineID sel_id = INVALID_ENGINE;
int num_engines = 0;
int num_wagons = 0;
buildvehicle_d *bv = &WP(w, buildvehicle_d);
@@ -680,7 +803,8 @@ static void GenerateBuildTrainList(Window *w)
* Also check to see if the previously selected engine is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when engines become obsolete and are removed */
for (sel_id = INVALID_ENGINE, eid = 0; eid < NUM_TRAIN_ENGINES; eid++) {
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_TRAIN) {
const RailVehicleInfo *rvi = RailVehInfo(eid);
if (bv->filter.railtype != RAILTYPE_END && !HasPowerOnRail(rvi->railtype, bv->filter.railtype)) continue;
@@ -713,14 +837,13 @@ static void GenerateBuildTrainList(Window *w)
/* Figure out what road vehicle EngineIDs to put in the list */
static void GenerateBuildRoadVehList(Window *w)
{
EngineID eid, sel_id;
EngineID sel_id = INVALID_ENGINE;
buildvehicle_d *bv = &WP(w, buildvehicle_d);
EngList_RemoveAll(&bv->eng_list);
sel_id = INVALID_ENGINE;
for (eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_ROAD) {
if (!IsEngineBuildable(eid, VEH_ROAD, _local_player)) continue;
if (!HasBit(bv->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue;
EngList_Add(&bv->eng_list, eid);
@@ -733,14 +856,13 @@ static void GenerateBuildRoadVehList(Window *w)
/* Figure out what ship EngineIDs to put in the list */
static void GenerateBuildShipList(Window *w)
{
EngineID eid, sel_id;
EngineID sel_id = INVALID_ENGINE;
buildvehicle_d *bv = &WP(w, buildvehicle_d);
EngList_RemoveAll(&bv->eng_list);
sel_id = INVALID_ENGINE;
for (eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_SHIP) {
if (!IsEngineBuildable(eid, VEH_SHIP, _local_player)) continue;
EngList_Add(&bv->eng_list, eid);
@@ -752,7 +874,7 @@ static void GenerateBuildShipList(Window *w)
/* Figure out what aircraft EngineIDs to put in the list */
static void GenerateBuildAircraftList(Window *w)
{
EngineID eid, sel_id;
EngineID sel_id = INVALID_ENGINE;
buildvehicle_d *bv = &WP(w, buildvehicle_d);
EngList_RemoveAll(&bv->eng_list);
@@ -761,8 +883,8 @@ static void GenerateBuildAircraftList(Window *w)
* Also check to see if the previously selected plane is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when planes become obsolete and are removed */
sel_id = INVALID_ENGINE;
for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
EngineID eid;
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_AIRCRAFT) {
if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_player)) continue;
/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
if (w->window_number > VEH_END && !CanAircraftUseStation(eid, w->window_number)) continue;
@@ -798,7 +920,7 @@ static void GenerateBuildList(Window *w)
EngList_Sort(&bv->eng_list, _sorter[bv->vehicle_type][bv->sort_criteria]);
}
static void DrawVehicleEngine(byte type, int x, int y, EngineID engine, SpriteID pal)
static void DrawVehicleEngine(VehicleType type, int x, int y, EngineID engine, SpriteID pal)
{
switch (type) {
case VEH_TRAIN: DrawTrainEngine( x, y, engine, pal); break;
@@ -866,23 +988,6 @@ void DrawEngineList(VehicleType type, int x, int y, const EngineList eng_list, u
}
}
static void ExpandPurchaseInfoWidget(Window *w, int expand_by)
{
Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
SetWindowDirty(w);
wi->bottom += expand_by;
for (uint i = BUILD_VEHICLE_WIDGET_BUILD; i < BUILD_VEHICLE_WIDGET_END; i++) {
wi = &w->widget[i];
wi->top += expand_by;
wi->bottom += expand_by;
}
w->height += expand_by;
SetWindowDirty(w);
}
static void DrawBuildVehicleWindow(Window *w)
{
const buildvehicle_d *bv = &WP(w, buildvehicle_d);
@@ -892,19 +997,26 @@ static void DrawBuildVehicleWindow(Window *w)
SetVScrollCount(w, EngList_Count(&bv->eng_list));
SetDParam(0, bv->filter.railtype + STR_881C_NEW_RAIL_VEHICLES); // This should only affect rail vehicles
/* Set text of sort by dropdown */
w->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[bv->vehicle_type][bv->sort_criteria];
DrawWindowWidgets(w);
DrawEngineList(bv->vehicle_type, 2, 27, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
DrawEngineList(bv->vehicle_type, w->widget[BUILD_VEHICLE_WIDGET_LIST].left + 2, w->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
if (bv->sel_engine != INVALID_ENGINE) {
const Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
int text_end = DrawVehiclePurchaseInfo(2, wi->top + 1, wi->right - wi->left - 2, bv->sel_engine);
if (text_end > wi->bottom) ExpandPurchaseInfoWidget(w, text_end - wi->bottom);
if (text_end > wi->bottom) {
SetWindowDirty(w);
ResizeWindowForWidget(w, BUILD_VEHICLE_WIDGET_PANEL, 0, text_end - wi->bottom);
SetWindowDirty(w);
}
}
DrawString(85, 15, _sort_listing[bv->vehicle_type][bv->sort_criteria], TC_BLACK);
DoDrawString(bv->descending_sort_order ? DOWNARROW : UPARROW, 69, 15, TC_BLACK);
DrawSortButtonState(w, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, bv->descending_sort_order ? SBS_DOWN : SBS_UP);
}
static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
@@ -920,14 +1032,14 @@ static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
break;
case BUILD_VEHICLE_WIDGET_LIST: {
uint i = (e->we.click.pt.y - 26) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint num_items = EngList_Count(&bv->eng_list);
bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
SetWindowDirty(w);
break;
}
case BUILD_VEHICLE_WIDGET_SORT_TEXT: case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
ShowDropDownMenu(w, _sort_listing[bv->vehicle_type], bv->sort_criteria, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN, 0, 0);
break;

View File

@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "callback_table.h"
#include "functions.h"
/* If you add a callback for DoCommandP, also add the callback in here
* see below for the full list!

View File

@@ -5,7 +5,7 @@
#ifndef CALLBACK_TABLE_H
#define CALLBACK_TABLE_H
#include "command.h"
#include "command_type.h"
extern CommandCallback *_callback_table[];
extern const int _callback_table_count;

59
src/cargo_type.h Normal file
View File

@@ -0,0 +1,59 @@
/* $Id$ */
/** @file cargo_type.h Types related to cargos... */
#ifndef CARGO_TYPE_H
#define CARGO_TYPE_H
typedef byte CargoID;
enum {
// Temperate
CT_PASSENGERS = 0,
CT_COAL = 1,
CT_MAIL = 2,
CT_OIL = 3,
CT_LIVESTOCK = 4,
CT_GOODS = 5,
CT_GRAIN = 6,
CT_WOOD = 7,
CT_IRON_ORE = 8,
CT_STEEL = 9,
CT_VALUABLES = 10,
// Arctic
CT_WHEAT = 6,
CT_HILLY_UNUSED = 8,
CT_PAPER = 9,
CT_GOLD = 10,
CT_FOOD = 11,
// Tropic
CT_RUBBER = 1,
CT_FRUIT = 4,
CT_MAIZE = 6,
CT_COPPER_ORE = 8,
CT_WATER = 9,
CT_DIAMONDS = 10,
// Toyland
CT_SUGAR = 1,
CT_TOYS = 3,
CT_BATTERIES = 4,
CT_CANDY = 5,
CT_TOFFEE = 6,
CT_COLA = 7,
CT_COTTON_CANDY = 8,
CT_BUBBLES = 9,
CT_PLASTIC = 10,
CT_FIZZY_DRINKS = 11,
NUM_CARGO = 32,
CT_NO_REFIT = 0xFE,
CT_INVALID = 0xFF
};
typedef uint AcceptedCargo[NUM_CARGO];
#endif /* OPENTTD_H */

View File

@@ -37,7 +37,7 @@ CargoPacket::~CargoPacket()
this->count = 0;
}
bool CargoPacket::SameSource(CargoPacket *cp)
bool CargoPacket::SameSource(const CargoPacket *cp) const
{
return this->source_xy == cp->source_xy && this->days_in_transit == cp->days_in_transit && this->paid_for == cp->paid_for;
}

View File

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

View File

@@ -4,12 +4,12 @@
#include "stdafx.h"
#include "openttd.h"
#include "macros.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "newgrf_cargo.h"
#include "cargotype.h"
#include "core/bitmath_func.hpp"
#include "table/sprites.h"
#include "table/strings.h"
#include "table/cargo_const.h"
CargoSpec _cargo[NUM_CARGO];
@@ -37,7 +37,7 @@ void SetupCargoForClimate(LandscapeID l)
if (cl < lengthof(_default_cargo)) {
/* Copy the indexed cargo */
_cargo[i] = _default_cargo[cl];
SetBit(_cargo_mask, i);
if (_cargo[i].bitnum != INVALID_CARGO) SetBit(_cargo_mask, i);
continue;
}

View File

@@ -5,6 +5,9 @@
#ifndef CARGOTYPE_H
#define CARGOTYPE_H
#include "cargo_type.h"
#include "gfx_type.h"
#include "newgrf_string_type.h"
typedef uint32 CargoLabel;
@@ -33,11 +36,11 @@ struct CargoSpec {
uint16 multipliertowngrowth;
uint8 callback_mask;
StringID name;
StringID name_single;
StringID units_volume;
StringID quantifier;
StringID abbrev;
GRFMappedStringID name;
GRFMappedStringID name_single;
GRFMappedStringID units_volume;
GRFMappedStringID quantifier;
GRFMappedStringID abbrev;
SpriteID sprite;

View File

@@ -5,442 +5,23 @@
#include "stdafx.h"
#include "openttd.h"
#include "clear_map.h"
#include "rail_map.h"
#include "table/strings.h"
#include "functions.h"
#include "map.h"
#include "player.h"
#include "tile.h"
#include "viewport.h"
#include "command.h"
#include "tunnel_map.h"
#include "bridge_map.h"
#include "command_func.h"
#include "bridge.h"
#include "landscape.h"
#include "variables.h"
#include "table/sprites.h"
#include "unmovable_map.h"
#include "genworld.h"
#include "industry.h"
#include "water_map.h"
/*
* In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
* The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
* This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
* Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i = 2 * h_max * (h_max + 1).
*/
static const int TERRAFORMER_MODHEIGHT_SIZE = 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 1);
/*
* The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similiar to
* 1 + 4 * \sum_{i=1}^{h_max} (i+1) = 1 + 2 * h_max + (h_max + 3).
*/
static const int TERRAFORMER_TILE_TABLE_SIZE = 1 + 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 3);
struct TerraformerHeightMod {
TileIndex tile; ///< Referenced tile.
byte height; ///< New TileHeight (height of north corner) of the tile.
};
struct TerraformerState {
int modheight_count; ///< amount of entries in "modheight".
int tile_table_count; ///< amount of entries in "tile_table".
/**
* Dirty tiles, i.e.\ at least one corner changed.
*
* This array contains the tiles which are or will be marked as dirty.
*
* @ingroup dirty
*/
TileIndex tile_table[TERRAFORMER_TILE_TABLE_SIZE];
TerraformerHeightMod modheight[TERRAFORMER_MODHEIGHT_SIZE]; ///< Height modifications.
};
/**
* Gets the TileHeight (height of north corner) of a tile as of current terraforming progress.
*
* @param ts TerraformerState.
* @param tile Tile.
* @return TileHeight.
*/
static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile)
{
TerraformerHeightMod *mod = ts->modheight;
int count;
for (count = ts->modheight_count; count != 0; count--, mod++) {
if (mod->tile == tile) return mod->height;
}
/* TileHeight unchanged so far, read value from map. */
return TileHeight(tile);
}
/**
* Stores the TileHeight (height of north corner) of a tile in a TerraformerState.
*
* @param ts TerraformerState.
* @param tile Tile.
* @param height New TileHeight.
*/
static void TerraformSetHeightOfTile(TerraformerState *ts, TileIndex tile, int height)
{
/* Find tile in the "modheight" table.
* Note: In a normal user-terraform command the tile will not be found in the "modheight" table.
* But during house- or industry-construction multiple corners can be terraformed at once. */
TerraformerHeightMod *mod = ts->modheight;
int count = ts->modheight_count;
while ((count > 0) && (mod->tile != tile)) {
mod++;
count--;
}
/* New entry? */
if (count == 0) {
assert(ts->modheight_count < TERRAFORMER_MODHEIGHT_SIZE);
ts->modheight_count++;
}
/* Finally store the new value */
mod->tile = tile;
mod->height = (byte)height;
}
/**
* Adds a tile to the "tile_table" in a TerraformerState.
*
* @param ts TerraformerState.
* @param tile Tile.
* @ingroup dirty
*/
static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile)
{
int count;
TileIndex *t;
count = ts->tile_table_count;
for (t = ts->tile_table; count != 0; count--, t++) {
if (*t == tile) return;
}
assert(ts->tile_table_count < TERRAFORMER_TILE_TABLE_SIZE);
ts->tile_table[ts->tile_table_count++] = tile;
}
/**
* Adds all tiles that incident with the north corner of a specific tile to the "tile_table" in a TerraformerState.
*
* @param ts TerraformerState.
* @param tile Tile.
* @ingroup dirty
*/
static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
{
TerraformAddDirtyTile(ts, tile + TileDiffXY( 0, -1));
TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, -1));
TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, 0));
TerraformAddDirtyTile(ts, tile);
}
/**
* Terraform the north corner of a tile to a specific height.
*
* @param ts TerraformerState.
* @param tile Tile.
* @param height Aimed height.
* @param return Error code or cost.
*/
static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height)
{
CommandCost total_cost = CommandCost();
assert(tile < MapSize());
/* Check range of destination height */
if (height < 0) return_cmd_error(STR_1003_ALREADY_AT_SEA_LEVEL);
if (height > MAX_TILE_HEIGHT) return_cmd_error(STR_1004_TOO_HIGH);
/*
* Check if the terraforming has any effect.
* This can only be true, if multiple corners of the start-tile are terraformed (i.e. the terraforming is done by towns/industries etc.).
* In this case the terraforming should fail. (Don't know why.)
*/
if (height == TerraformGetHeightOfTile(ts, tile)) return CMD_ERROR;
/* Check "too close to edge of map" */
uint x = TileX(tile);
uint y = TileY(tile);
if ((x <= 1) || (y <= 1) || (x >= MapMaxX() - 1) || (y >= MapMaxY() - 1)) {
/*
* Determine a sensible error tile
* Note: If x and y are both zero this will disable the error tile. (Tile 0 cannot be highlighted :( )
*/
if ((x == 1) && (y != 0)) x = 0;
if ((y == 1) && (x != 0)) y = 0;
_terraform_err_tile = TileXY(x, y);
return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
}
/* Mark incident tiles, that are involved in the terraforming */
TerraformAddDirtyTileAround(ts, tile);
/* Store the height modification */
TerraformSetHeightOfTile(ts, tile, height);
/* Increment cost */
total_cost.AddCost(_price.terraform);
/* Recurse to neighboured corners if height difference is larger than 1 */
{
const TileIndexDiffC *ttm;
static const TileIndexDiffC _terraform_tilepos[] = {
{ 1, 0}, // move to tile in SE
{-2, 0}, // undo last move, and move to tile in NW
{ 1, 1}, // undo last move, and move to tile in SW
{ 0, -2} // undo last move, and move to tile in NE
};
for (ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) {
tile += ToTileIndexDiff(*ttm);
/* Get TileHeight of neighboured tile as of current terraform progress */
int r = TerraformGetHeightOfTile(ts, tile);
int height_diff = height - r;
/* Is the height difference to the neighboured corner greater than 1? */
if (abs(height_diff) > 1) {
/* Terraform the neighboured corner. The resulting height difference should be 1. */
height_diff += (height_diff < 0 ? 1 : -1);
CommandCost cost = TerraformTileHeight(ts, tile, r + height_diff);
if (CmdFailed(cost)) return cost;
total_cost.AddCost(cost);
}
}
}
return total_cost;
}
/** Terraform land
* @param tile tile to terraform
* @param flags for this command type
* @param p1 corners to terraform (SLOPE_xxx)
* @param p2 direction; eg up (non-zero) or down (zero)
* @return error or cost of terraforming
*/
CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
TerraformerState ts;
CommandCost total_cost = CommandCost();
int direction = (p2 != 0 ? 1 : -1);
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
_terraform_err_tile = 0;
ts.modheight_count = ts.tile_table_count = 0;
/* Make an extra check for map-bounds cause we add tiles to the originating tile */
if (tile + TileDiffXY(1, 1) >= MapSize()) return CMD_ERROR;
/* Compute the costs and the terraforming result in a model of the landscape */
if ((p1 & SLOPE_W) != 0) {
TileIndex t = tile + TileDiffXY(1, 0);
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
if (CmdFailed(cost)) return cost;
total_cost.AddCost(cost);
}
if ((p1 & SLOPE_S) != 0) {
TileIndex t = tile + TileDiffXY(1, 1);
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
if (CmdFailed(cost)) return cost;
total_cost.AddCost(cost);
}
if ((p1 & SLOPE_E) != 0) {
TileIndex t = tile + TileDiffXY(0, 1);
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
if (CmdFailed(cost)) return cost;
total_cost.AddCost(cost);
}
if ((p1 & SLOPE_N) != 0) {
TileIndex t = tile + TileDiffXY(0, 0);
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
if (CmdFailed(cost)) return cost;
total_cost.AddCost(cost);
}
/* Check if the terraforming is valid wrt. tunnels, bridges and objects on the surface */
{
int count;
TileIndex *ti = ts.tile_table;
for (count = ts.tile_table_count; count != 0; count--, ti++) {
TileIndex tile = *ti;
/* Find new heights of tile corners */
uint z_N = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 0));
uint z_W = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 0));
uint z_S = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 1));
uint z_E = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 1));
/* Find min and max height of tile */
uint z_min = min(min(z_N, z_W), min(z_S, z_E));
uint z_max = max(max(z_N, z_W), max(z_S, z_E));
/* Compute tile slope */
uint tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT);
if (z_W > z_min) tileh += SLOPE_W;
if (z_S > z_min) tileh += SLOPE_S;
if (z_E > z_min) tileh += SLOPE_E;
if (z_N > z_min) tileh += SLOPE_N;
/* Check if bridge would take damage */
if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) &&
GetBridgeHeight(GetSouthernBridgeEnd(tile)) <= z_max * TILE_HEIGHT) {
_terraform_err_tile = tile; // highlight the tile under the bridge
return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
}
/* Check if tunnel would take damage */
if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
_terraform_err_tile = tile; // highlight the tile above the tunnel
return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
}
/* Check tiletype-specific things, and add extra-cost */
CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh);
if (CmdFailed(cost)) {
_terraform_err_tile = tile;
return cost;
}
total_cost.AddCost(cost);
}
}
if (flags & DC_EXEC) {
/* change the height */
{
int count;
TerraformerHeightMod *mod;
mod = ts.modheight;
for (count = ts.modheight_count; count != 0; count--, mod++) {
TileIndex til = mod->tile;
SetTileHeight(til, mod->height);
}
}
/* finally mark the dirty tiles dirty */
{
int count;
TileIndex *ti = ts.tile_table;
for (count = ts.tile_table_count; count != 0; count--, ti++) {
MarkTileDirtyByTile(*ti);
}
}
}
return total_cost;
}
/** Levels a selected (rectangle) area of land
* @param tile end tile of area-drag
* @param flags for this command type
* @param p1 start tile of area drag
* @param p2 unused
* @return error or cost of terraforming
*/
CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
int size_x, size_y;
int ex;
int ey;
int sx, sy;
uint h, curh;
CommandCost money;
CommandCost ret;
CommandCost cost;
if (p1 >= MapSize()) return CMD_ERROR;
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
/* remember level height */
h = TileHeight(p1);
/* make sure sx,sy are smaller than ex,ey */
ex = TileX(tile);
ey = TileY(tile);
sx = TileX(p1);
sy = TileY(p1);
if (ex < sx) Swap(ex, sx);
if (ey < sy) Swap(ey, sy);
tile = TileXY(sx, sy);
size_x = ex - sx + 1;
size_y = ey - sy + 1;
money.AddCost(GetAvailableMoneyForCommand());
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
curh = TileHeight(tile2);
while (curh != h) {
ret = DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
if (CmdFailed(ret)) break;
if (flags & DC_EXEC) {
money.AddCost(-ret.GetCost());
if (money.GetCost() < 0) {
_additional_cash_required = ret.GetCost();
return cost;
}
DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
}
cost.AddCost(ret);
curh += (curh > h) ? -1 : 1;
}
} END_TILE_LOOP(tile2, size_x, size_y, tile)
return (cost.GetCost() == 0) ? CMD_ERROR : cost;
}
/** Purchase a land area. Actually you only purchase one tile, so
* the name is a bit confusing ;p
* @param tile the tile the player is purchasing
* @param flags for this command type
* @param p1 unused
* @param p2 unused
* @return error of cost of operation
*/
CommandCost CmdPurchaseLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
CommandCost cost;
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
if (IsOwnedLandTile(tile) && IsTileOwner(tile, _current_player)) {
return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT);
}
cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(cost)) return CMD_ERROR;
if (flags & DC_EXEC) {
MakeOwnedLand(tile, _current_player);
MarkTileDirtyByTile(tile);
}
return cost.AddCost(_price.clear_roughland * 10);
}
#include "tile_cmd.h"
#include "functions.h"
#include "economy_func.h"
#include "viewport_func.h"
#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "table/clear_land.h"
static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
{
@@ -452,7 +33,7 @@ static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
&_price.clear_roughland,
&_price.clear_roughland,
};
CommandCost price;
CommandCost price(EXPENSES_CONSTRUCTION);
if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) {
price.AddCost(*clear_price_table[GetClearGround(tile)]);
@@ -463,33 +44,6 @@ static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
return price;
}
/** Sell a land area. Actually you only sell one tile, so
* the name is a bit confusing ;p
* @param tile the tile the player is selling
* @param flags for this command type
* @param p1 unused
* @param p2 unused
* @return error or cost of operation
*/
CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
if (!IsOwnedLandTile(tile)) return CMD_ERROR;
if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) return CMD_ERROR;
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
if (flags & DC_EXEC) DoClearSquare(tile);
return CommandCost(- _price.clear_roughland * 2);
}
#include "table/clear_land.h"
void DrawClearLandTile(const TileInfo *ti, byte set)
{
DrawGroundSprite(SPR_FLAT_BARE_LAND + _tileh_to_sprite[ti->tileh] + set * 19, PAL_NONE);
@@ -761,7 +315,7 @@ static void ClickTile_Clear(TileIndex tile)
/* not used */
}
static uint32 GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode)
static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
{
return 0;
}

View File

@@ -5,9 +5,8 @@
#ifndef CLEAR_MAP_H
#define CLEAR_MAP_H
#include "macros.h"
#include "tile.h"
#include "bridge_map.h"
#include "industry_type.h"
/**
* Ground types. Valid densities in comments after the enum.

View File

@@ -3,13 +3,12 @@
#ifndef CMD_HELPER_H
#define CMD_HELPER_H
#include "direction.h"
#include "macros.h"
#include "road.h"
#include "direction_type.h"
#include "road_type.h"
template<uint N> static inline void ExtractValid();
template<> static inline void ExtractValid<1>() {}
template<> inline void ExtractValid<1>() {}
template<typename T> struct ExtractBits;

View File

@@ -4,20 +4,28 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
#include "strings.h"
#include "functions.h"
#include "landscape.h"
#include "map.h"
#include "tile_map.h"
#include "gui.h"
#include "command.h"
#include "player.h"
#include "command_func.h"
#include "network/network.h"
#include "variables.h"
#include "genworld.h"
#include "newgrf_storage.h"
#include "strings_func.h"
#include "gfx_func.h"
#include "functions.h"
#include "town.h"
#include "date_func.h"
#include "debug.h"
#include "player_func.h"
#include "player_base.h"
#include "signal_func.h"
#include "table/strings.h"
const char *_cmd_text = NULL;
StringID _error_message;
/**
* Helper macro to define the header of all command handler macros.
@@ -201,160 +209,145 @@ DEF_COMMAND(CmdAutofillTimetable);
* as the value from the CMD_* enums.
*/
static const Command _command_proc_table[] = {
{CmdBuildRailroadTrack, CMD_AUTO}, /* 0, CMD_BUILD_RAILROAD_TRACK */
{CmdRemoveRailroadTrack, CMD_AUTO}, /* 1, CMD_REMOVE_RAILROAD_TRACK */
{CmdBuildSingleRail, CMD_AUTO}, /* 2, CMD_BUILD_SINGLE_RAIL */
{CmdRemoveSingleRail, CMD_AUTO}, /* 3, CMD_REMOVE_SINGLE_RAIL */
{CmdLandscapeClear, 0}, /* 4, CMD_LANDSCAPE_CLEAR */
{CmdBuildBridge, CMD_AUTO}, /* 5, CMD_BUILD_BRIDGE */
{CmdBuildRailroadStation, CMD_AUTO}, /* 6, CMD_BUILD_RAILROAD_STATION */
{CmdBuildTrainDepot, CMD_AUTO}, /* 7, CMD_BUILD_TRAIN_DEPOT */
{CmdBuildSingleSignal, CMD_AUTO}, /* 8, CMD_BUILD_SIGNALS */
{CmdRemoveSingleSignal, CMD_AUTO}, /* 9, CMD_REMOVE_SIGNALS */
{CmdTerraformLand, CMD_AUTO}, /* 10, CMD_TERRAFORM_LAND */
{CmdPurchaseLandArea, CMD_AUTO}, /* 11, CMD_PURCHASE_LAND_AREA */
{CmdSellLandArea, 0}, /* 12, CMD_SELL_LAND_AREA */
{CmdBuildTunnel, CMD_AUTO}, /* 13, CMD_BUILD_TUNNEL */
{CmdRemoveFromRailroadStation, 0}, /* 14, CMD_REMOVE_FROM_RAILROAD_STATION */
{CmdConvertRail, 0}, /* 15, CMD_CONVERT_RAILD */
{CmdBuildTrainWaypoint, 0}, /* 16, CMD_BUILD_TRAIN_WAYPOINT */
{CmdRenameWaypoint, 0}, /* 17, CMD_RENAME_WAYPOINT */
{CmdRemoveTrainWaypoint, 0}, /* 18, CMD_REMOVE_TRAIN_WAYPOINT */
{NULL, 0}, /* 19, unused */
{NULL, 0}, /* 20, unused */
{CmdBuildRoadStop, CMD_AUTO}, /* 21, CMD_BUILD_ROAD_STOP */
{CmdRemoveRoadStop, 0}, /* 22, CMD_REMOVE_ROAD_STOP */
{CmdBuildLongRoad, CMD_AUTO}, /* 23, CMD_BUILD_LONG_ROAD */
{CmdRemoveLongRoad, CMD_AUTO}, /* 24, CMD_REMOVE_LONG_ROAD */
{CmdBuildRoad, 0}, /* 25, CMD_BUILD_ROAD */
{CmdRemoveRoad, 0}, /* 26, CMD_REMOVE_ROAD */
{CmdBuildRoadDepot, CMD_AUTO}, /* 27, CMD_BUILD_ROAD_DEPOT */
{NULL, 0}, /* 28, unused */
{CmdBuildAirport, CMD_AUTO}, /* 29, CMD_BUILD_AIRPORT */
{CmdBuildDock, CMD_AUTO}, /* 30, CMD_BUILD_DOCK */
{CmdBuildShipDepot, CMD_AUTO}, /* 31, CMD_BUILD_SHIP_DEPOT */
{CmdBuildBuoy, CMD_AUTO}, /* 32, CMD_BUILD_BUOY */
{CmdPlantTree, CMD_AUTO}, /* 33, CMD_PLANT_TREE */
{CmdBuildRailVehicle, 0}, /* 34, CMD_BUILD_RAIL_VEHICLE */
{CmdMoveRailVehicle, 0}, /* 35, CMD_MOVE_RAIL_VEHICLE */
{CmdStartStopTrain, 0}, /* 36, CMD_START_STOP_TRAIN */
{NULL, 0}, /* 37, unused */
{CmdSellRailWagon, 0}, /* 38, CMD_SELL_RAIL_WAGON */
{CmdSendTrainToDepot, 0}, /* 39, CMD_SEND_TRAIN_TO_DEPOT */
{CmdForceTrainProceed, 0}, /* 40, CMD_FORCE_TRAIN_PROCEED */
{CmdReverseTrainDirection, 0}, /* 41, CMD_REVERSE_TRAIN_DIRECTION */
{CmdBuildRailroadTrack, CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
{CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
{CmdBuildSingleRail, CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
{CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
{CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
{CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
{CmdBuildRailroadStation, CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
{CmdBuildTrainDepot, CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
{CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
{CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
{CmdTerraformLand, CMD_AUTO}, /* CMD_TERRAFORM_LAND */
{CmdPurchaseLandArea, CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
{CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
{CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
{CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
{CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
{CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
{CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
{CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
{CmdModifyOrder, 0}, /* 42, CMD_MODIFY_ORDER */
{CmdSkipToOrder, 0}, /* 43, CMD_SKIP_TO_ORDER */
{CmdDeleteOrder, 0}, /* 44, CMD_DELETE_ORDER */
{CmdInsertOrder, 0}, /* 45, CMD_INSERT_ORDER */
{CmdBuildRoadStop, CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
{CmdRemoveRoadStop, 0}, /* CMD_REMOVE_ROAD_STOP */
{CmdBuildLongRoad, CMD_AUTO}, /* CMD_BUILD_LONG_ROAD */
{CmdRemoveLongRoad, CMD_AUTO}, /* CMD_REMOVE_LONG_ROAD */
{CmdBuildRoad, 0}, /* CMD_BUILD_ROAD */
{CmdRemoveRoad, 0}, /* CMD_REMOVE_ROAD */
{CmdBuildRoadDepot, CMD_AUTO}, /* CMD_BUILD_ROAD_DEPOT */
{CmdChangeServiceInt, 0}, /* 46, CMD_CHANGE_SERVICE_INT */
{CmdBuildAirport, CMD_AUTO}, /* CMD_BUILD_AIRPORT */
{CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
{CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
{CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
{CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
{CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
{CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
{CmdStartStopTrain, 0}, /* CMD_START_STOP_TRAIN */
{CmdBuildIndustry, 0}, /* 47, CMD_BUILD_INDUSTRY */
{CmdBuildCompanyHQ, CMD_AUTO}, /* 48, CMD_BUILD_COMPANY_HQ */
{CmdSetPlayerFace, 0}, /* 49, CMD_SET_PLAYER_FACE */
{CmdSetPlayerColor, 0}, /* 50, CMD_SET_PLAYER_COLOR */
{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 */
{CmdIncreaseLoan, 0}, /* 51, CMD_INCREASE_LOAN */
{CmdDecreaseLoan, 0}, /* 52, CMD_DECREASE_LOAN */
{CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
{CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
{CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
{CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
{CmdWantEnginePreview, 0}, /* 53, CMD_WANT_ENGINE_PREVIEW */
{CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
{CmdNameVehicle, 0}, /* 54, CMD_NAME_VEHICLE */
{CmdRenameEngine, 0}, /* 55, CMD_RENAME_ENGINE */
{CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
{CmdBuildCompanyHQ, CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
{CmdSetPlayerFace, 0}, /* CMD_SET_PLAYER_FACE */
{CmdSetPlayerColor, 0}, /* CMD_SET_PLAYER_COLOR */
{CmdChangeCompanyName, 0}, /* 56, CMD_CHANGE_COMPANY_NAME */
{CmdChangePresidentName, 0}, /* 57, CMD_CHANGE_PRESIDENT_NAME */
{CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
{CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
{CmdRenameStation, 0}, /* 58, CMD_RENAME_STATION */
{CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
{CmdSellAircraft, 0}, /* 59, CMD_SELL_AIRCRAFT */
{CmdStartStopAircraft, 0}, /* 60, CMD_START_STOP_AIRCRAFT */
{CmdNameVehicle, 0}, /* CMD_NAME_VEHICLE */
{CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
{CmdBuildAircraft, 0}, /* 61, CMD_BUILD_AIRCRAFT */
{CmdSendAircraftToHangar, 0}, /* 62, CMD_SEND_AIRCRAFT_TO_HANGAR */
{NULL, 0}, /* 63, unused */
{CmdRefitAircraft, 0}, /* 64, CMD_REFIT_AIRCRAFT */
{CmdChangeCompanyName, 0}, /* CMD_CHANGE_COMPANY_NAME */
{CmdChangePresidentName, 0}, /* CMD_CHANGE_PRESIDENT_NAME */
{CmdPlaceSign, 0}, /* 65, CMD_PLACE_SIGN */
{CmdRenameSign, 0}, /* 66, CMD_RENAME_SIGN */
{CmdRenameStation, 0}, /* CMD_RENAME_STATION */
{CmdBuildRoadVeh, 0}, /* 67, CMD_BUILD_ROAD_VEH */
{CmdStartStopRoadVeh, 0}, /* 68, CMD_START_STOP_ROADVEH */
{CmdSellRoadVeh, 0}, /* 69, CMD_SELL_ROAD_VEH */
{CmdSendRoadVehToDepot, 0}, /* 70, CMD_SEND_ROADVEH_TO_DEPOT */
{CmdTurnRoadVeh, 0}, /* 71, CMD_TURN_ROADVEH */
{CmdRefitRoadVeh, 0}, /* 72, CMD_REFIT_ROAD_VEH */
{CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
{CmdStartStopAircraft, 0}, /* CMD_START_STOP_AIRCRAFT */
{CmdPause, CMD_SERVER}, /* 73, CMD_PAUSE */
{CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
{CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
{CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
{CmdBuyShareInCompany, 0}, /* 74, CMD_BUY_SHARE_IN_COMPANY */
{CmdSellShareInCompany, 0}, /* 75, CMD_SELL_SHARE_IN_COMPANY */
{CmdBuyCompany, 0}, /* 76, CMD_BUY_COMANY */
{CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
{CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
{CmdBuildTown, CMD_OFFLINE}, /* 77, CMD_BUILD_TOWN */
{NULL, 0}, /* 78, unused */
{NULL, 0}, /* 79, unused */
{CmdRenameTown, CMD_SERVER}, /* 80, CMD_RENAME_TOWN */
{CmdDoTownAction, 0}, /* 81, CMD_DO_TOWN_ACTION */
{CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
{CmdStartStopRoadVeh, 0}, /* CMD_START_STOP_ROADVEH */
{CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
{CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
{CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
{CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
{CmdSetRoadDriveSide, CMD_SERVER}, /* 82, CMD_SET_ROAD_DRIVE_SIDE */
{NULL, 0}, /* 83, unused */
{NULL, 0}, /* 84, unused */
{CmdChangeDifficultyLevel, CMD_SERVER}, /* 85, CMD_CHANGE_DIFFICULTY_LEVEL */
{CmdPause, CMD_SERVER}, /* CMD_PAUSE */
{CmdStartStopShip, 0}, /* 86, CMD_START_STOP_SHIP */
{CmdSellShip, 0}, /* 87, CMD_SELL_SHIP */
{CmdBuildShip, 0}, /* 88, CMD_BUILD_SHIP */
{CmdSendShipToDepot, 0}, /* 89, CMD_SEND_SHIP_TO_DEPOT */
{NULL, 0}, /* 90, unused */
{CmdRefitShip, 0}, /* 91, CMD_REFIT_SHIP */
{CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
{CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
{CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
{NULL, 0}, /* 92, unused */
{NULL, 0}, /* 93, unused */
{NULL, 0}, /* 94, unused */
{NULL, 0}, /* 95, unused */
{NULL, 0}, /* 96, unused */
{NULL, 0}, /* 97, unused */
{CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
{CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
{CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
{CmdOrderRefit, 0}, /* 98, CMD_ORDER_REFIT */
{CmdCloneOrder, 0}, /* 99, CMD_CLONE_ORDER */
{CmdSetRoadDriveSide, CMD_SERVER}, /* CMD_SET_ROAD_DRIVE_SIDE */
{CmdChangeDifficultyLevel, CMD_SERVER}, /* CMD_CHANGE_DIFFICULTY_LEVEL */
{CmdClearArea, 0}, /* 100, CMD_CLEAR_AREA */
{NULL, 0}, /* 101, unused */
{CmdStartStopShip, 0}, /* CMD_START_STOP_SHIP */
{CmdSellShip, 0}, /* CMD_SELL_SHIP */
{CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
{CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
{CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
{CmdMoneyCheat, CMD_OFFLINE}, /* 102, CMD_MONEY_CHEAT */
{CmdBuildCanal, CMD_AUTO}, /* 103, CMD_BUILD_CANAL */
{CmdPlayerCtrl, 0}, /* 104, CMD_PLAYER_CTRL */
{CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
{CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
{CmdLevelLand, CMD_AUTO}, /* 105, CMD_LEVEL_LAND */
{CmdClearArea, 0}, /* CMD_CLEAR_AREA */
{CmdRefitRailVehicle, 0}, /* 106, CMD_REFIT_RAIL_VEHICLE */
{CmdRestoreOrderIndex, 0}, /* 107, CMD_RESTORE_ORDER_INDEX */
{CmdBuildLock, CMD_AUTO}, /* 108, CMD_BUILD_LOCK */
{NULL, 0}, /* 109, unused */
{CmdBuildSignalTrack, CMD_AUTO}, /* 110, CMD_BUILD_SIGNAL_TRACK */
{CmdRemoveSignalTrack, CMD_AUTO}, /* 111, CMD_REMOVE_SIGNAL_TRACK */
{NULL, 0}, /* 112, unused */
{CmdGiveMoney, 0}, /* 113, CMD_GIVE_MONEY */
{CmdChangePatchSetting, CMD_SERVER}, /* 114, CMD_CHANGE_PATCH_SETTING */
{CmdSetAutoReplace, 0}, /* 115, CMD_SET_AUTOREPLACE */
{CmdCloneVehicle, 0}, /* 116, CMD_CLONE_VEHICLE */
{CmdMassStartStopVehicle, 0}, /* 117, CMD_MASS_START_STOP */
{CmdDepotSellAllVehicles, 0}, /* 118, CMD_DEPOT_SELL_ALL_VEHICLES */
{CmdDepotMassAutoReplace, 0}, /* 119, CMD_DEPOT_MASS_AUTOREPLACE */
{CmdCreateGroup, 0}, /* 120, CMD_CREATE_GROUP */
{CmdDeleteGroup, 0}, /* 121, CMD_DELETE_GROUP */
{CmdRenameGroup, 0}, /* 122, CMD_RENAME_GROUP */
{CmdAddVehicleGroup, 0}, /* 123, CMD_ADD_VEHICLE_GROUP */
{CmdAddSharedVehicleGroup, 0}, /* 124, CMD_ADD_SHARE_VEHICLE_GROUP */
{CmdRemoveAllVehiclesGroup, 0}, /* 125, CMD_REMOVE_ALL_VEHICLES_GROUP */
{CmdSetGroupReplaceProtection, 0}, /* 126, CMD_SET_GROUP_REPLACE_PROTECTION */
{CmdMoveOrder, 0}, /* 127, CMD_MOVE_ORDER */
{CmdChangeTimetable, 0}, /* 128, CMD_CHANGE_TIMETABLE */
{CmdSetVehicleOnTime, 0}, /* 129, CMD_SET_VEHICLE_ON_TIME */
{CmdAutofillTimetable, 0}, /* 130, CMD_AUTOFILL_TIMETABLE */
{CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
{CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
{CmdPlayerCtrl, 0}, /* CMD_PLAYER_CTRL */
{CmdLevelLand, CMD_AUTO}, /* CMD_LEVEL_LAND */
{CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
{CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
{CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
{CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
{CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
{CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
{CmdChangePatchSetting, CMD_SERVER}, /* CMD_CHANGE_PATCH_SETTING */
{CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
{CmdCloneVehicle, 0}, /* CMD_CLONE_VEHICLE */
{CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
{CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
{CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
{CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
{CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
{CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
{CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
{CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
{CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
{CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
{CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
{CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
{CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
{CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
};
/*!
@@ -387,7 +380,7 @@ byte GetCommandFlags(uint cmd)
return _command_proc_table[cmd & 0xFF].flags;
}
static int _docommand_recursive;
static int _docommand_recursive = 0;
/*!
* This function executes a given command with the parameters from the #CommandProc parameter list.
@@ -400,13 +393,13 @@ static int _docommand_recursive;
* @param procc The command-id to execute (a value of the CMD_* enums)
* @see CommandProc
*/
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
{
CommandCost res;
CommandProc *proc;
/* Do not even think about executing out-of-bounds tile-commands */
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
if (!IsValidTile(tile)) {
_cmd_text = NULL;
return CMD_ERROR;
}
@@ -418,8 +411,10 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
_docommand_recursive++;
/* only execute the test call if it's toplevel, or we're not execing. */
if (_docommand_recursive == 1 || !(flags & DC_EXEC) || (flags & DC_FORCETEST) ) {
if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) {
SetTownRatingTestMode(true);
res = proc(tile, flags & ~DC_EXEC, p1, p2);
SetTownRatingTestMode(false);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
goto error;
@@ -427,6 +422,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
if (_docommand_recursive == 1 &&
!(flags & DC_QUERY_COST) &&
!(flags & DC_BANKRUPT) &&
res.GetCost() != 0 &&
!CheckPlayerHasMoney(res)) {
goto error;
@@ -440,7 +436,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
}
/* Execute the command here. All cost-relevant functions set the expenses type
* themselves with "SET_EXPENSES_TYPE(...);" at the beginning of the function */
* themselves to the cost object at some point */
res = proc(tile, flags, p1, p2);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
@@ -451,7 +447,7 @@ error:
}
/* if toplevel, subtract the money. */
if (--_docommand_recursive == 0) {
if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
SubtractMoneyFromPlayer(res);
/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
if (tile != 0 && IsValidPlayer(_current_player)) {
@@ -503,7 +499,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
int y = TileY(tile) * TILE_SIZE;
/* Do not even think about executing out-of-bounds tile-commands */
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
if (!IsValidTile(tile)) {
_cmd_text = NULL;
return false;
}
@@ -539,7 +535,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
* e.g.: if you demolish a whole town, the dryrun would say okay.
* but by really destroying, your rating drops and at a certain point
* it will fail. so res and res2 are different
* CMD_REMOVE_ROAD: This command has special local authority
* CMD_REMOVE_LONG_ROAD: This command has special local authority
* restrictions which may cause the test run to fail (the previous
* road fragments still stay there and the town won't let you
* disconnect the road system), but the exec will succeed and this
@@ -549,9 +545,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
* estimate the cost of cloning a vehicle. */
notest =
(cmd & 0xFF) == CMD_CLEAR_AREA ||
(cmd & 0xFF) == CMD_CONVERT_RAIL ||
(cmd & 0xFF) == CMD_LEVEL_LAND ||
(cmd & 0xFF) == CMD_REMOVE_ROAD ||
(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
(cmd & 0xFF) == CMD_CLONE_VEHICLE;
@@ -564,7 +558,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
!(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR)) &&
(cmd & 0xFF) != CMD_PAUSE) {
/* estimate the cost. */
SetTownRatingTestMode(true);
res = proc(tile, flags, p1, p2);
SetTownRatingTestMode(false);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
ShowErrorMessage(_error_message, error_part1, x, y);
@@ -581,7 +577,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
if (!((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) {
/* first test if the command can be executed. */
SetTownRatingTestMode(true);
res = proc(tile, flags, p1, p2);
SetTownRatingTestMode(false);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
goto show_error;
@@ -609,9 +607,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
return true;
}
#endif /* ENABLE_NETWORK */
#ifdef DEBUG_DUMP_COMMANDS
debug_dump_commands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)_current_player, tile, p1, p2, cmd, _cmd_text);
#endif /* DUMP_COMMANDS */
DebugDumpCommands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)_current_player, tile, p1, p2, cmd, _cmd_text);
/* update last build coordinate of player. */
if (tile != 0 && IsValidPlayer(_current_player)) {
@@ -620,7 +616,6 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
/* Actually try and execute the command. If no cost-type is given
* use the construction one */
_yearly_expenses_type = EXPENSES_CONSTRUCTION;
res2 = proc(tile, flags | DC_EXEC, p1, p2);
/* If notest is on, it means the result of the test can be different than
@@ -636,6 +631,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
SubtractMoneyFromPlayer(res2);
/* update signals if needed */
UpdateSignalsInBuffer();
if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
if (res2.GetCost() != 0 && tile != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
if (_additional_cash_required != 0) {
@@ -695,6 +693,11 @@ Money CommandCost::GetCost() const
return this->cost;
}
ExpensesType CommandCost::GetExpensesType() const
{
return this->expense_type;
}
void CommandCost::SetGlobalErrorMessage() const
{
extern StringID _error_message;

View File

@@ -1,350 +0,0 @@
/* $Id$ */
/** @file command.h */
#ifndef COMMAND_H
#define COMMAND_H
/**
* List of commands.
*
* This enum defines all possible commands which can be executed to the game
* engine. Observing the game like the query-tool or checking the profit of a
* vehicle don't result in a command which should be executed in the engine
* nor send to the server in a network game.
*
* @see _command_proc_table
*/
enum {
CMD_BUILD_RAILROAD_TRACK = 0, ///< build a rail track
CMD_REMOVE_RAILROAD_TRACK = 1, ///< remove a rail track
CMD_BUILD_SINGLE_RAIL = 2, ///< build a single rail track
CMD_REMOVE_SINGLE_RAIL = 3, ///< remove a single rail track
CMD_LANDSCAPE_CLEAR = 4, ///< demolish a tile
CMD_BUILD_BRIDGE = 5, ///< build a bridge
CMD_BUILD_RAILROAD_STATION = 6, ///< build a railroad station
CMD_BUILD_TRAIN_DEPOT = 7, ///< build a train depot
CMD_BUILD_SIGNALS = 8, ///< build a signal
CMD_REMOVE_SIGNALS = 9, ///< remove a signal
CMD_TERRAFORM_LAND = 10, ///< terraform a tile
CMD_PURCHASE_LAND_AREA = 11, ///< purchase a tile
CMD_SELL_LAND_AREA = 12, ///< sell a bought tile before
CMD_BUILD_TUNNEL = 13, ///< build a tunnel
CMD_REMOVE_FROM_RAILROAD_STATION = 14, ///< remove a tile station
CMD_CONVERT_RAIL = 15, ///< convert a rail type
CMD_BUILD_TRAIN_WAYPOINT = 16, ///< build a waypoint
CMD_RENAME_WAYPOINT = 17, ///< rename a waypoint
CMD_REMOVE_TRAIN_WAYPOINT = 18, ///< remove a waypoint
CMD_BUILD_ROAD_STOP = 21, ///< build a road stop
CMD_REMOVE_ROAD_STOP = 22, ///< remove a road stop
CMD_BUILD_LONG_ROAD = 23, ///< build a complete road (not a "half" one)
CMD_REMOVE_LONG_ROAD = 24, ///< remove a complete road (not a "half" one)
CMD_BUILD_ROAD = 25, ///< build a "half" road
CMD_REMOVE_ROAD = 26, ///< remove a "half" road
CMD_BUILD_ROAD_DEPOT = 27, ///< build a road depot
CMD_BUILD_AIRPORT = 29, ///< build an airport
CMD_BUILD_DOCK = 30, ///< build a dock
CMD_BUILD_SHIP_DEPOT = 31, ///< build a ship depot
CMD_BUILD_BUOY = 32, ///< build a buoy
CMD_PLANT_TREE = 33, ///< plant a tree
CMD_BUILD_RAIL_VEHICLE = 34, ///< build a rail vehicle
CMD_MOVE_RAIL_VEHICLE = 35, ///< move a rail vehicle (in the depot)
CMD_START_STOP_TRAIN = 36, ///< start or stop a train
CMD_SELL_RAIL_WAGON = 38, ///< sell a rail wagon
CMD_SEND_TRAIN_TO_DEPOT = 39, ///< send a train to a depot
CMD_FORCE_TRAIN_PROCEED = 40, ///< proceed a train to pass a red signal
CMD_REVERSE_TRAIN_DIRECTION = 41, ///< turn a train around
CMD_MODIFY_ORDER = 42, ///< modify an order (like set full-load)
CMD_SKIP_TO_ORDER = 43, ///< skip an order to the next of specific one
CMD_DELETE_ORDER = 44, ///< delete an order
CMD_INSERT_ORDER = 45, ///< insert a new order
CMD_CHANGE_SERVICE_INT = 46, ///< change the server interval of a vehicle
CMD_BUILD_INDUSTRY = 47, ///< build a new industry
CMD_BUILD_COMPANY_HQ = 48, ///< build the company headquarter
CMD_SET_PLAYER_FACE = 49, ///< set the face of the player/company
CMD_SET_PLAYER_COLOR = 50, ///< set the color of the player/company
CMD_INCREASE_LOAN = 51, ///< increase the loan from the bank
CMD_DECREASE_LOAN = 52, ///< decrease the loan from the bank
CMD_WANT_ENGINE_PREVIEW = 53, ///< confirm the preview of an engine
CMD_NAME_VEHICLE = 54, ///< rename a whole vehicle
CMD_RENAME_ENGINE = 55, ///< rename a engine (in the engine list)
CMD_CHANGE_COMPANY_NAME = 56, ///< change the company name
CMD_CHANGE_PRESIDENT_NAME = 57, ///< change the president name
CMD_RENAME_STATION = 58, ///< rename a station
CMD_SELL_AIRCRAFT = 59, ///< sell an aircraft
CMD_START_STOP_AIRCRAFT = 60, ///< start/stop an aircraft
CMD_BUILD_AIRCRAFT = 61, ///< build an aircraft
CMD_SEND_AIRCRAFT_TO_HANGAR = 62, ///< send an aircraft to a hanger
CMD_REFIT_AIRCRAFT = 64, ///< refit the cargo space of an aircraft
CMD_PLACE_SIGN = 65, ///< place a sign
CMD_RENAME_SIGN = 66, ///< rename a sign
CMD_BUILD_ROAD_VEH = 67, ///< build a road vehicle
CMD_START_STOP_ROADVEH = 68, ///< start/stop a road vehicle
CMD_SELL_ROAD_VEH = 69, ///< sell a road vehicle
CMD_SEND_ROADVEH_TO_DEPOT = 70, ///< send a road vehicle to the depot
CMD_TURN_ROADVEH = 71, ///< turn a road vehicle around
CMD_REFIT_ROAD_VEH = 72, ///< refit the cargo space of a road vehicle
CMD_PAUSE = 73, ///< pause the game
CMD_BUY_SHARE_IN_COMPANY = 74, ///< buy a share from a company
CMD_SELL_SHARE_IN_COMPANY = 75, ///< sell a share from a company
CMD_BUY_COMPANY = 76, ///< buy a company which is bankrupt
CMD_BUILD_TOWN = 77, ///< build a town
CMD_RENAME_TOWN = 80, ///< rename a town
CMD_DO_TOWN_ACTION = 81, ///< do a action from the town detail window (like advertises or bribe)
CMD_SET_ROAD_DRIVE_SIDE = 82, ///< set the side where the road vehicles drive
CMD_CHANGE_DIFFICULTY_LEVEL = 85, ///< change the difficult of a game (each setting for it own)
CMD_START_STOP_SHIP = 86, ///< start/stop a ship
CMD_SELL_SHIP = 87, ///< sell a ship
CMD_BUILD_SHIP = 88, ///< build a new ship
CMD_SEND_SHIP_TO_DEPOT = 89, ///< send a ship to a depot
CMD_REFIT_SHIP = 91, ///< refit the cargo space of a ship
CMD_ORDER_REFIT = 98, ///< change the refit informaction of an order (for "goto depot" )
CMD_CLONE_ORDER = 99, ///< clone (and share) an order
CMD_CLEAR_AREA = 100, ///< clear an area
CMD_MONEY_CHEAT = 102, ///< do the money cheat
CMD_BUILD_CANAL = 103, ///< build a canal
CMD_PLAYER_CTRL = 104, ///< used in multiplayer to create a new player etc.
CMD_LEVEL_LAND = 105, ///< level land
CMD_REFIT_RAIL_VEHICLE = 106, ///< refit the cargo space of a train
CMD_RESTORE_ORDER_INDEX = 107, ///< restore vehicle order-index and service interval
CMD_BUILD_LOCK = 108, ///< build a lock
CMD_BUILD_SIGNAL_TRACK = 110, ///< add signals along a track (by dragging)
CMD_REMOVE_SIGNAL_TRACK = 111, ///< remove signals along a track (by dragging)
CMD_GIVE_MONEY = 113, ///< give money to an other player
CMD_CHANGE_PATCH_SETTING = 114, ///< change a patch setting
CMD_SET_AUTOREPLACE = 115, ///< set an autoreplace entry
CMD_CLONE_VEHICLE = 116, ///< clone a vehicle
CMD_MASS_START_STOP = 117, ///< start/stop all vehicles (in a depot)
CMD_DEPOT_SELL_ALL_VEHICLES = 118, ///< sell all vehicles which are in a given depot
CMD_DEPOT_MASS_AUTOREPLACE = 119, ///< force the autoreplace to take action in a given depot
CMD_CREATE_GROUP = 120, ///< create a new group
CMD_DELETE_GROUP = 121, ///< delete a group
CMD_RENAME_GROUP = 122, ///< rename a group
CMD_ADD_VEHICLE_GROUP = 123, ///< add a vehicle to a group
CMD_ADD_SHARED_VEHICLE_GROUP = 124, ///< add all other shared vehicles to a group which are missing
CMD_REMOVE_ALL_VEHICLES_GROUP = 125, ///< remove all vehicles from a group
CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
CMD_MOVE_ORDER = 127, ///< move an order
CMD_CHANGE_TIMETABLE = 128, ///< change the timetable for a vehicle
CMD_SET_VEHICLE_ON_TIME = 129, ///< set the vehicle on time feature (timetable)
CMD_AUTOFILL_TIMETABLE = 130, ///< autofill the timetable
};
/**
* List of flags for a command.
*
* This enums defines some flags which can be used for the commands.
*/
enum {
DC_EXEC = 0x01, ///< execute the given command
DC_AUTO = 0x02, ///< don't allow building on structures
DC_QUERY_COST = 0x04, ///< query cost only, don't build.
DC_NO_WATER = 0x08, ///< don't allow building on water
DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
DC_AI_BUILDING = 0x20, ///< special building rules for AI
DC_NO_TOWN_RATING = 0x40, ///< town rating does not disallow you from building
DC_FORCETEST = 0x80, ///< force test too.
};
/**
* Used to combine a StringID with the command.
*
* This macro can be used to add a StringID (the error message to show) on a command-id
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
* this macro.
*
* @param x The StringID to combine with a command-id
*/
#define CMD_MSG(x) ((x) << 16)
/**
* Defines some flags.
*
* This enumeration defines some flags which are binary-or'ed on a command.
*/
enum {
CMD_NO_WATER = 0x0400, ///< dont build on water
CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message
};
/**
* Command flags for the command table _command_proc_table.
*
* This enumeration defines flags for the _command_proc_table.
*/
enum {
CMD_SERVER = 0x1, ///< the command can only be initiated by the server
CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command
};
/**
* Defines the callback type for all command handler functions.
*
* This type defines the function header for all functions which handles a CMD_* command.
* A command handler use the parameters to act according to the meaning of the command.
* The tile parameter defines the tile to perform an action on.
* The flag parameter is filled with flags from the DC_* enumeration. The parameters
* p1 and p2 are filled with parameters for the command like "which road type", "which
* order" or "direction". Each function should mentioned in there doxygen comments
* the usage of these parameters.
*
* @param tile The tile to apply a command on
* @param flags Flags for the command, from the DC_* enumeration
* @param p1 Additional data for the command
* @param p2 Additional data for the command
* @return The CommandCost of the command, which can be succeeded or failed.
*/
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
/**
* Define a command with the flags which belongs to it.
*
* This struct connect a command handler function with the flags created with
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
*/
struct Command {
CommandProc *proc;
byte flags;
};
/**
* Checks if a command failes.
*
* As you see the parameter is not a command but the return value of a command,
* the CommandCost class. This function checks if the command executed by
* the CommandProc function failed and returns true if it does.
*
* @param cost The return value of a CommandProc call
* @return true if the command failes
* @see CmdSucceded
*/
static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
/**
* Checks if a command succeeded.
*
* As #CmdFailed this function checks if a command succeeded
*
* @param cost The return value of a CommandProc call
* @return true if the command succeeded
* @see CmdSucceeded
*/
static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
/**
* Define a default return value for a failed command.
*
* This variable contains a CommandCost object with is declared as "failed".
* Other functions just need to return this error if there is an error,
* which doesn't need to specific by a StringID.
*/
static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
/**
* Returns from a function with a specific StringID as error.
*
* This macro is used to return from a function. The parameter contains the
* StringID which will be returned.
*
* @param errcode The StringID to return
*/
#define return_cmd_error(errcode) return CommandCost(errcode);
/* command.cpp */
/**
* Define a callback function for the client, after the command is finished.
*
* Functions of this type are called after the command is finished. The parameters
* are from the #CommandProc callback type. The boolean parameter indicates if the
* command succeeded or failed.
*
* @param success If the command succeeded or not.
* @param tile The tile of the command action
* @param p1 Additional data of the command
* @param p1 Additional data of the command
* @see CommandProc
*/
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
/**
* Execute a command
*/
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
/**
* Execute a network safe DoCommand function
*/
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
#ifdef ENABLE_NETWORK
/**
* Send a command over the network
*/
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
#endif /* ENABLE_NETWORK */
/**
* Text, which gets sent with a command
*
* This variable contains a string (be specific a pointer of the first
* char of this string) which will be send with a command. This is
* used for user input data like names or chat messages.
*/
extern const char *_cmd_text;
/**
* Checks if a integer value belongs to a command.
*/
bool IsValidCommand(uint cmd);
/**
* Returns the flags from a given command.
*/
byte GetCommandFlags(uint cmd);
/**
* Returns the current money available which can be used for a command.
*/
Money GetAvailableMoneyForCommand();
#endif /* COMMAND_H */

95
src/command_func.h Normal file
View File

@@ -0,0 +1,95 @@
/* $Id$ */
/** @file command_func.h Functions related to commands. */
#ifndef COMMAND_FUNC_H
#define COMMAND_FUNC_H
#include "command_type.h"
/**
* Checks if a command failes.
*
* As you see the parameter is not a command but the return value of a command,
* the CommandCost class. This function checks if the command executed by
* the CommandProc function failed and returns true if it does.
*
* @param cost The return value of a CommandProc call
* @return true if the command failes
* @see CmdSucceded
*/
static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
/**
* Checks if a command succeeded.
*
* As #CmdFailed this function checks if a command succeeded
*
* @param cost The return value of a CommandProc call
* @return true if the command succeeded
* @see CmdSucceeded
*/
static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
/**
* Define a default return value for a failed command.
*
* This variable contains a CommandCost object with is declared as "failed".
* Other functions just need to return this error if there is an error,
* which doesn't need to specific by a StringID.
*/
static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
/**
* Returns from a function with a specific StringID as error.
*
* This macro is used to return from a function. The parameter contains the
* StringID which will be returned.
*
* @param errcode The StringID to return
*/
#define return_cmd_error(errcode) return CommandCost(errcode);
/**
* Execute a command
*/
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc);
/**
* Execute a network safe DoCommand function
*/
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
#ifdef ENABLE_NETWORK
/**
* Send a command over the network
*/
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
#endif /* ENABLE_NETWORK */
/**
* Text, which gets sent with a command
*
* This variable contains a string (be specific a pointer of the first
* char of this string) which will be send with a command. This is
* used for user input data like names or chat messages.
*/
extern const char *_cmd_text;
extern Money _additional_cash_required;
extern StringID _error_message;
/**
* Checks if a integer value belongs to a command.
*/
bool IsValidCommand(uint32 cmd);
/**
* Returns the flags from a given command.
*/
byte GetCommandFlags(uint32 cmd);
/**
* Returns the current money available which can be used for a command.
*/
Money GetAvailableMoneyForCommand();
#endif /* COMMAND_FUNC_H */

356
src/command_type.h Normal file
View File

@@ -0,0 +1,356 @@
/* $Id$ */
/** @file command_type.h Types related to commands. */
#ifndef COMMAND_TYPE_H
#define COMMAND_TYPE_H
#include "economy_type.h"
#include "strings_type.h"
#include "tile_type.h"
/**
* Common return value for all commands. Wraps the cost and
* a possible error message/state together.
*/
class CommandCost {
ExpensesType expense_type; ///< the type of expence as shown on the finances view
Money cost; ///< The cost of this action
StringID message; ///< Warning message for when success is unset
bool success; ///< Whether the comment went fine up to this moment
public:
/**
* Creates a command cost return with no cost and no error
*/
CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {}
/**
* Creates a command return value the is failed with the given message
*/
CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {}
/**
* Creates a command cost with given expense type and start cost of 0
* @param ex_t the expense type
*/
CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {}
/**
* Creates a command return value with the given start cost and expense type
* @param ex_t the expense type
* @param cst the initial cost of this command
*/
CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
/**
* Adds the cost of the given command return value to this cost.
* Also takes a possible error message when it is set.
* @param ret the command to add the cost of.
* @return this class.
*/
CommandCost AddCost(CommandCost ret);
/**
* Adds the given cost to the cost of the command.
* @param cost the cost to add
* @return this class.
*/
CommandCost AddCost(Money cost);
/**
* Multiplies the cost of the command by the given factor.
* @param cost factor to multiply the costs with
* @return this class
*/
CommandCost MultiplyCost(int factor);
/**
* The costs as made up to this moment
* @return the costs
*/
Money GetCost() const;
/**
* The expense type of the cost
* @return the expense type
*/
ExpensesType GetExpensesType() const;
/**
* Sets the global error message *if* this class has one.
*/
void SetGlobalErrorMessage() const;
/**
* Did this command succeed?
* @return true if and only if it succeeded
*/
bool Succeeded() const;
/**
* Did this command fail?
* @return true if and only if it failed
*/
bool Failed() const;
};
/**
* List of commands.
*
* This enum defines all possible commands which can be executed to the game
* engine. Observing the game like the query-tool or checking the profit of a
* vehicle don't result in a command which should be executed in the engine
* nor send to the server in a network game.
*
* @see _command_proc_table
*/
enum {
CMD_BUILD_RAILROAD_TRACK, ///< build a rail track
CMD_REMOVE_RAILROAD_TRACK, ///< remove a rail track
CMD_BUILD_SINGLE_RAIL, ///< build a single rail track
CMD_REMOVE_SINGLE_RAIL, ///< remove a single rail track
CMD_LANDSCAPE_CLEAR, ///< demolish a tile
CMD_BUILD_BRIDGE, ///< build a bridge
CMD_BUILD_RAILROAD_STATION, ///< build a railroad station
CMD_BUILD_TRAIN_DEPOT, ///< build a train depot
CMD_BUILD_SIGNALS, ///< build a signal
CMD_REMOVE_SIGNALS, ///< remove a signal
CMD_TERRAFORM_LAND, ///< terraform a tile
CMD_PURCHASE_LAND_AREA, ///< purchase a tile
CMD_SELL_LAND_AREA, ///< sell a bought tile before
CMD_BUILD_TUNNEL, ///< build a tunnel
CMD_REMOVE_FROM_RAILROAD_STATION, ///< remove a tile station
CMD_CONVERT_RAIL, ///< convert a rail type
CMD_BUILD_TRAIN_WAYPOINT, ///< build a waypoint
CMD_RENAME_WAYPOINT, ///< rename a waypoint
CMD_REMOVE_TRAIN_WAYPOINT, ///< remove a waypoint
CMD_BUILD_ROAD_STOP, ///< build a road stop
CMD_REMOVE_ROAD_STOP, ///< remove a road stop
CMD_BUILD_LONG_ROAD, ///< build a complete road (not a "half" one)
CMD_REMOVE_LONG_ROAD, ///< remove a complete road (not a "half" one)
CMD_BUILD_ROAD, ///< build a "half" road
CMD_REMOVE_ROAD, ///< remove a "half" road
CMD_BUILD_ROAD_DEPOT, ///< build a road depot
CMD_BUILD_AIRPORT, ///< build an airport
CMD_BUILD_DOCK, ///< build a dock
CMD_BUILD_SHIP_DEPOT, ///< build a ship depot
CMD_BUILD_BUOY, ///< build a buoy
CMD_PLANT_TREE, ///< plant a tree
CMD_BUILD_RAIL_VEHICLE, ///< build a rail vehicle
CMD_MOVE_RAIL_VEHICLE, ///< move a rail vehicle (in the depot)
CMD_START_STOP_TRAIN, ///< start or stop a train
CMD_SELL_RAIL_WAGON, ///< sell a rail wagon
CMD_SEND_TRAIN_TO_DEPOT, ///< send a train to a depot
CMD_FORCE_TRAIN_PROCEED, ///< proceed a train to pass a red signal
CMD_REVERSE_TRAIN_DIRECTION, ///< turn a train around
CMD_MODIFY_ORDER, ///< modify an order (like set full-load)
CMD_SKIP_TO_ORDER, ///< skip an order to the next of specific one
CMD_DELETE_ORDER, ///< delete an order
CMD_INSERT_ORDER, ///< insert a new order
CMD_CHANGE_SERVICE_INT, ///< change the server interval of a vehicle
CMD_BUILD_INDUSTRY, ///< build a new industry
CMD_BUILD_COMPANY_HQ, ///< build the company headquarter
CMD_SET_PLAYER_FACE, ///< set the face of the player/company
CMD_SET_PLAYER_COLOR, ///< set the color of the player/company
CMD_INCREASE_LOAN, ///< increase the loan from the bank
CMD_DECREASE_LOAN, ///< decrease the loan from the bank
CMD_WANT_ENGINE_PREVIEW, ///< confirm the preview of an engine
CMD_NAME_VEHICLE, ///< rename a whole vehicle
CMD_RENAME_ENGINE, ///< rename a engine (in the engine list)
CMD_CHANGE_COMPANY_NAME, ///< change the company name
CMD_CHANGE_PRESIDENT_NAME, ///< change the president name
CMD_RENAME_STATION, ///< rename a station
CMD_SELL_AIRCRAFT, ///< sell an aircraft
CMD_START_STOP_AIRCRAFT, ///< start/stop an aircraft
CMD_BUILD_AIRCRAFT, ///< build an aircraft
CMD_SEND_AIRCRAFT_TO_HANGAR, ///< send an aircraft to a hanger
CMD_REFIT_AIRCRAFT, ///< refit the cargo space of an aircraft
CMD_PLACE_SIGN, ///< place a sign
CMD_RENAME_SIGN, ///< rename a sign
CMD_BUILD_ROAD_VEH, ///< build a road vehicle
CMD_START_STOP_ROADVEH, ///< start/stop a road vehicle
CMD_SELL_ROAD_VEH, ///< sell a road vehicle
CMD_SEND_ROADVEH_TO_DEPOT, ///< send a road vehicle to the depot
CMD_TURN_ROADVEH, ///< turn a road vehicle around
CMD_REFIT_ROAD_VEH, ///< refit the cargo space of a road vehicle
CMD_PAUSE, ///< pause the game
CMD_BUY_SHARE_IN_COMPANY, ///< buy a share from a company
CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company
CMD_BUY_COMPANY, ///< buy a company which is bankrupt
CMD_BUILD_TOWN, ///< build a town
CMD_RENAME_TOWN, ///< rename a town
CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe)
CMD_SET_ROAD_DRIVE_SIDE, ///< set the side where the road vehicles drive
CMD_CHANGE_DIFFICULTY_LEVEL, ///< change the difficult of a game (each setting for it own)
CMD_START_STOP_SHIP, ///< start/stop a ship
CMD_SELL_SHIP, ///< sell a ship
CMD_BUILD_SHIP, ///< build a new ship
CMD_SEND_SHIP_TO_DEPOT, ///< send a ship to a depot
CMD_REFIT_SHIP, ///< refit the cargo space of a ship
CMD_ORDER_REFIT, ///< change the refit informaction of an order (for "goto depot" )
CMD_CLONE_ORDER, ///< clone (and share) an order
CMD_CLEAR_AREA, ///< clear an area
CMD_MONEY_CHEAT, ///< do the money cheat
CMD_BUILD_CANAL, ///< build a canal
CMD_PLAYER_CTRL, ///< used in multiplayer to create a new player etc.
CMD_LEVEL_LAND, ///< level land
CMD_REFIT_RAIL_VEHICLE, ///< refit the cargo space of a train
CMD_RESTORE_ORDER_INDEX, ///< restore vehicle order-index and service interval
CMD_BUILD_LOCK, ///< build a lock
CMD_BUILD_SIGNAL_TRACK, ///< add signals along a track (by dragging)
CMD_REMOVE_SIGNAL_TRACK, ///< remove signals along a track (by dragging)
CMD_GIVE_MONEY, ///< give money to an other player
CMD_CHANGE_PATCH_SETTING, ///< change a patch setting
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry
CMD_CLONE_VEHICLE, ///< clone a vehicle
CMD_MASS_START_STOP, ///< start/stop all vehicles (in a depot)
CMD_DEPOT_SELL_ALL_VEHICLES, ///< sell all vehicles which are in a given depot
CMD_DEPOT_MASS_AUTOREPLACE, ///< force the autoreplace to take action in a given depot
CMD_CREATE_GROUP, ///< create a new group
CMD_DELETE_GROUP, ///< delete a group
CMD_RENAME_GROUP, ///< rename a group
CMD_ADD_VEHICLE_GROUP, ///< add a vehicle to a group
CMD_ADD_SHARED_VEHICLE_GROUP, ///< add all other shared vehicles to a group which are missing
CMD_REMOVE_ALL_VEHICLES_GROUP, ///< remove all vehicles from a group
CMD_SET_GROUP_REPLACE_PROTECTION, ///< set the autoreplace-protection for a group
CMD_MOVE_ORDER, ///< move an order
CMD_CHANGE_TIMETABLE, ///< change the timetable for a vehicle
CMD_SET_VEHICLE_ON_TIME, ///< set the vehicle on time feature (timetable)
CMD_AUTOFILL_TIMETABLE, ///< autofill the timetable
};
/**
* List of flags for a command.
*
* This enums defines some flags which can be used for the commands.
*/
enum {
DC_EXEC = 0x01, ///< execute the given command
DC_AUTO = 0x02, ///< don't allow building on structures
DC_QUERY_COST = 0x04, ///< query cost only, don't build.
DC_NO_WATER = 0x08, ///< don't allow building on water
DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
DC_AI_BUILDING = 0x20, ///< special building rules for AI
DC_NO_TOWN_RATING = 0x40, ///< town rating does not disallow you from building
DC_BANKRUPT = 0x80, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
};
/**
* Used to combine a StringID with the command.
*
* This macro can be used to add a StringID (the error message to show) on a command-id
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
* this macro.
*
* @param x The StringID to combine with a command-id
*/
#define CMD_MSG(x) ((x) << 16)
/**
* Defines some flags.
*
* This enumeration defines some flags which are binary-or'ed on a command.
*/
enum {
CMD_NO_WATER = 0x0400, ///< dont build on water
CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message
};
/**
* Command flags for the command table _command_proc_table.
*
* This enumeration defines flags for the _command_proc_table.
*/
enum {
CMD_SERVER = 0x1, ///< the command can only be initiated by the server
CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command
};
/**
* Defines the callback type for all command handler functions.
*
* This type defines the function header for all functions which handles a CMD_* command.
* A command handler use the parameters to act according to the meaning of the command.
* The tile parameter defines the tile to perform an action on.
* The flag parameter is filled with flags from the DC_* enumeration. The parameters
* p1 and p2 are filled with parameters for the command like "which road type", "which
* order" or "direction". Each function should mentioned in there doxygen comments
* the usage of these parameters.
*
* @param tile The tile to apply a command on
* @param flags Flags for the command, from the DC_* enumeration
* @param p1 Additional data for the command
* @param p2 Additional data for the command
* @return The CommandCost of the command, which can be succeeded or failed.
*/
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
/**
* Define a command with the flags which belongs to it.
*
* This struct connect a command handler function with the flags created with
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
*/
struct Command {
CommandProc *proc;
byte flags;
};
/**
* Define a callback function for the client, after the command is finished.
*
* Functions of this type are called after the command is finished. The parameters
* are from the #CommandProc callback type. The boolean parameter indicates if the
* command succeeded or failed.
*
* @param success If the command succeeded or not.
* @param tile The tile of the command action
* @param p1 Additional data of the command
* @param p1 Additional data of the command
* @see CommandProc
*/
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
#endif /* COMMAND_TYPE_H */

View File

@@ -4,21 +4,22 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
#include "functions.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"
#include "player.h"
#include "textbuf_gui.h"
#include "window_gui.h"
#include "variables.h"
#include "string.h"
#include <stdarg.h>
#include <string.h>
#include "console.h"
#include "helpers.hpp"
#include "network/network.h"
#include "network/network_data.h"
#include "network/network_server.h"
#include "core/alloc_func.hpp"
#include "window_func.h"
#include "string_func.h"
#include "gfx_func.h"
#include "table/strings.h"
#define ICON_BUFFER 79
#define ICON_HISTORY_SIZE 20
@@ -28,6 +29,19 @@
#define ICON_MAX_ALIAS_LINES 40
#define ICON_TOKEN_COUNT 20
/* console parser */
IConsoleCmd *_iconsole_cmds; ///< list of registred commands
IConsoleVar *_iconsole_vars; ///< list of registred vars
IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
/* console colors/modes */
byte _icolour_def;
byte _icolour_err;
byte _icolour_warn;
byte _icolour_dbg;
byte _icolour_cmd;
IConsoleModes _iconsole_mode;
/* ** main console ** */
static char *_iconsole_buffer[ICON_BUFFER + 1];
static uint16 _iconsole_cbuffer[ICON_BUFFER + 1];

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