Commit Graph

88 Commits

Author SHA1 Message Date
peter1138 90aff7a026 (svn r3396) - Autoreplace changes:
- Change fixed array per player to a single pool. This avoids future problems
    with vehicle numbers and decreases savegame size. Engine replacements from
    previous savegames will be lost.
  - Move engine replacement code from players.c to engine.c.
                                      (thanks to blathijs for rewriting this)
2006-01-12 15:52:18 +00:00
tron 5ac1a89f92 (svn r3366) Make an unnecessarily global variable local 2006-01-05 16:51:10 +00:00
peter1138 eeeebf9f6d (svn r3359) - Autoreplace GUI: When starting or stopping a replacement, redraw the replace window after the command has completed, rather than after calling the command. 2006-01-02 19:55:09 +00:00
tron 246c126d25 (svn r3353) Simplify the automatic length adjustment algorithm for replacing trains: Use the length of the train before the replacement as reference length 2005-12-29 12:42:59 +00:00
tron bf98086de8 (svn r3298) Remove unused and write-only variables 2005-12-14 06:28:48 +00:00
peter1138 560a4a9c4a (svn r3292) - Autoreplace: Disallow replacing to an engine type that already has a replacement set up; this stops loops being set up. 2005-12-13 12:31:48 +00:00
peter1138 04f39ef749 (svn r3291) - Codechange, Autoreplace: Replace int with EngineID and -1 with INVALID_ENGINE, as appropriate. 2005-12-13 09:57:07 +00:00
peter1138 1c57091230 (svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect their actual use, and add "Close Window" tooltip where missing. 2005-12-07 15:48:52 +00:00
peter1138 87f54ebf92 (svn r3239) - Codechange: Introduce and use helper functions for engine replacement code. 2005-11-26 16:41:14 +00:00
bjarni 22a4679837 (svn r3218) -Feature: Multiheaded train engines will now stay in the same train
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
	This fixes the assert when moving multiheaded engines (introduced in r3144)
	Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs

-Codechange: train subtype is now a bitmask
	This allows fast access to info like if it is a wagon or engine and if it is in front and so on
	Note: savegame version bump
2005-11-18 23:41:03 +00:00
tron f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
tron ee15e3de13 (svn r3172) static, const 2005-11-13 13:43:55 +00:00
bjarni 5481dcd191 (svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too long trains
-Trains will now remember the length of stations it visits and sell cars
        when being autoreplaced if they became too long
        -If it needs to remove cars, then it starts from the front and sells
        all it can find until the train is short enough
        -This only works for trains, that knows the station length of the route
        so a full uninterrupted run is needed
        -a train needs 1-2 runs to detect if the shortest station is expanded
        -This feature can be turned on and off in the train replace window
        and each company can have it's own setting
        -NOTE: minor savegame version bump
2005-11-07 23:20:47 +00:00
peter1138 bc25cd89bf (svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes. 2005-11-06 13:42:26 +00:00
peter1138 328158395b (svn r3106) -Autoreplace feature: Continue to show old vehicles in replace window after all player's vehicles of that type have been replaced. This allows the replacement to be removed. These vehicles are shown in grey instead of the player's colour. 2005-10-30 21:35:48 +00:00
peter1138 b97473e874 (svn r3089) Fix possible issue with out-of-bounds array access in replace vehicle gui, and add brief commenting. 2005-10-25 19:52:25 +00:00
bjarni 7cace07e01 (svn r3082) made ChangeVehicleViewWindow() more readable (added in last commit) 2005-10-24 20:12:39 +00:00
bjarni bf467bd99c (svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
this is a complete rewrite, that makes use of existing commands like build and sell
        this means that multiheaded train engines are replaced correctly
2005-10-24 19:40:48 +00:00
tron 47137cefb7 (svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
2005-10-23 13:04:44 +00:00
tron f3de172560 (svn r3059) Use bitfields to encode railtype and climates of engines instead of manual shifting/anding 2005-10-18 11:23:58 +00:00
tron 66bf4f863d (svn r3049) Replace byte/int/uint by RailType where appropriate 2005-10-16 09:13:04 +00:00
tron ab657338ec (svn r3048) Replace 0/1/2 by RAILTYPE_RAIL/MONO/MAGLEV where appropriate 2005-10-16 07:58:15 +00:00
tron 0cc45ecd8e (svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts) 2005-10-01 12:43:34 +00:00
tron ff30404170 (svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int and -1 2005-09-27 18:51:04 +00:00
tron c76f01b6ff (svn r2988) static where static is due 2005-09-26 13:38:12 +00:00
peter1138 9c2700b14c (svn r2974) -Fix: Drag and drop selection on drop down boxes didn't select correct item when some items were hidden.
-Separate disabled and hidden masks in drop downs to support both hidden and disabled items.
2005-09-23 07:44:03 +00:00
Darkvater 8e6a911700 (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
2005-09-18 20:56:44 +00:00
Darkvater 74f0c8b55a (svn r2901) Refix 'replace window' with wrong string-etc. coordinates. Also clean up, and make window-title a bit more meaningful (specify vehicle type replaced) 2005-08-29 22:27:22 +00:00
Darkvater 7a184a0ea3 (svn r2880) Fix graphical glitch in replace window (text at wrong coordinates) 2005-08-20 21:16:46 +00:00
bjarni ed8e2bac04 (svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
-This means that one company can only have one setting for renew and replacing
    more clients will not fight due to different settings anymore
  -This is a needed step in the line to fix autoreplacing dualheaded locomotives
  NOTE: savegame revision bump (peter1138 + me in coop)
2005-08-06 16:07:22 +00:00
tron 747a0f6a55 (svn r2812) Move variables, which only vehicle_gui.c needs to know about, there 2005-08-05 20:22:06 +00:00
bjarni 6f74bbaeec (svn r2724) -Fix: [Autoreplace] made the pulldown menu read GetPlayer(_local_player)->avail_railtypes - this removes the need for updating this code if we add more railtypes and it also allows the menu to show maglev when monorail is not available 2005-07-27 10:11:45 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron 0762aa9ec9 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
tron e53c4db866 (svn r2664) Remove depedency on player.h from variables.h 2005-07-21 19:36:43 +00:00
tron fa8f46c0b7 (svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[] 2005-06-07 18:13:49 +00:00
hackykid 0d926eee37 (svn r2429) - Fix: Oops, forgot to increase the size of the autoreplace window to fit the extra info from powered wagons. 2005-06-07 01:21:56 +00:00
hackykid 09aadafda1 (svn r2413) - Codechange: Rewrite the displaying of purchase details a bit, make it easyer to add lines later.
- Add: In the purchase details for trains display "(refittable)" after the capacity if the vehicle is refittable.
2005-06-05 23:01:10 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
hackykid d90948abb7 (svn r2365) - Change: [refitting] Make refitting capacities for trains newgrf compatible. Train vehicles can now carry twice as much mail/goods as other cargo, and four times as much passengers.
- Fix: [refitting] The refit window now shows the correct refit options for the entire consist. Only if at least one of the vehicles in the train can be refitted to a certain cargo, it is shown in the list.
 - Fix: [refitting] When refitting to a cargo which is already carried by some vehicles in the consist, the capacities of those vehicles are taken into account when calculating the new capacity of the train in the refit window.
2005-05-26 16:31:32 +00:00
Darkvater 5174d3adfe (svn r2306) - CodeChange: Check the last commands; refits. This needed an extensive rewrite and global/local-cargo ID juggling and bitmasking. However with this done it looks better as well and is compatible with newgrf handling. Big thanks to HackyKid for doing most of the work. This also closes patch "[ 1199277 ] Command checks" 2005-05-14 12:36:16 +00:00
matthijs c85f049f52 (svn r2267) - Codechange: Reverted the typedeffing of VehicleType (r2256), since that interfered with the saveload code. 2005-05-04 22:13:07 +00:00
matthijs 6eb094c726 (svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
- Add: GetVehicleTrackdir() helper function.
- Codechange: Moved SortStruct from vehicle_gui.h to ttd.h, so the dependency from vehicle.h on vehicle_gui.h could be removed.
- Codechange: Typedeffed the VehicleTypes struct so it can be used as the type for Vehicle.type instead of "byte".
- Codechange: Removed prototype for VehicleSorter(), which had no implementation anymore and was never called.
2005-05-02 23:59:11 +00:00
Darkvater febae668fe (svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
- I also changed an order of strings from On, Off to Off, On, so this can be used ingame with the WWT_4 widget type.
- Since the newssettings now take 2 bits per setting (off/summary/on) _news_display_opt is widened to 32 bits and the settings code changed slightly to accomodate for a maximum of 16 message-types.
2005-04-13 23:03:31 +00:00
Darkvater a571f31c95 (svn r1969) - GUI: Replace vehicle dropdown menu now looks a bit more comform the ones used throughout the game. 2005-03-08 23:20:47 +00:00
Darkvater 83d3f85636 (svn r1966) - Fix: [ 1110437 ] Replace Vehicles GUI gets random clicks. Breaks people! Don't forget the breaks in switch() statements!! 2005-03-08 21:47:22 +00:00
tron 204d08140a (svn r1867) Include tables/sprites.h only in files which need it 2005-02-13 11:18:02 +00:00
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 2005-02-06 08:18:00 +00:00
tron f0f85a7ef3 (svn r1803) Move debugging stuff into files of it's own 2005-02-05 15:58:59 +00:00