Commit Graph

26 Commits

Author SHA1 Message Date
tron 1864d28cb8 (svn r8894) -Fix
Slightly simplify the control flow of TrainController()
2007-02-25 09:47:46 +00:00
tron e949a956bd (svn r8893) -Fix
variable scope, const, misc.
2007-02-25 09:27:03 +00:00
tron 12b1804d4e (svn r8884) -Fix
Replace SetSpeedLimitOnBridge() by something simpler
2007-02-24 18:44:30 +00:00
tron caa129958d (svn r8878) -Fix
-Fix: Do a better job when checking the parameters of CmdMoveRailVehicle()
NOTE: 0.5 candidate
2007-02-24 14:36:14 +00:00
peter1138 89613b6cc4 (svn r8850) -Codechange: Use the cargo type's is_freight flag instead of checking the cargo type to determine if the cargo type is freight cargo type cargo type. 2007-02-22 22:53:49 +00:00
peter1138 ef2daa5060 (svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels. 2007-02-20 22:09:21 +00:00
celestar d9385f2798 (svn r8709) -Fix/Codechange: Rename the function GetStationPlatforms into GetPlatformLength because that is what it really does. Overload it because there is already a GetPlatformLength (one gives the length of the whole platform, the other gives the remaining length in a given direction). Turned both functions into methods of Station. While messing around with it, fix a problem where loading times for overhanging trains are miscomputed. 2007-02-13 16:36:38 +00:00
rubidium d1d1d170f3 (svn r8703) -Codechange/cleanup: some magic numbers -> enums and other small coding style changes to the ShipController and TrainController. 2007-02-13 11:29:20 +00:00
rubidium 4ec7eb2201 (svn r8701) -Codechange: replace magic numbers with enums for u.rail.track. 2007-02-13 10:46:45 +00:00
rubidium af3001b988 (svn r8700) -Fix (8698): replaced a magic number with the wrong enum :( 2007-02-13 10:43:50 +00:00
rubidium a419f4aeda (svn r8698) -Codechange: enumify the returns of VehicleEnterTile 2007-02-13 10:26:53 +00:00
bjarni 80125fd934 (svn r8610) -Codechange/Feature: rewrote the list handling in the autoreplace window
-The user will notice the following changes:
      All vehicle types behaves in the same way
      Adding/removing an engine (new design and so on) can no longer result in the window selecting a new engine
      All valid replacements will be displayed since it looks at refitting options as well (this solves the missing ships with the newships GRF)
      Since you can't replace an engine into itself, the engine selected in the left list will no longer appear in the right list

   -The code changes:
      Instead of looping all engines all the time, each list generates a list like the build windows
        This ensures consistent list generation since only one function can loop all engines
      Unified code for all vehicle types
      It now use the lists to call the drawing code in the build vehicle window
      Works on selected EngineIDs instead of selected index in the list
2007-02-06 11:11:12 +00:00
tron c326ff3795 (svn r8550) -Fix
Building a vehicle does not involve allocating orders, so do not check whether orders could be allocated
2007-02-03 09:05:43 +00:00
belugas 0c45071bb0 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
-Codechange: Add and use RAILVEH_SINGLEHEAD when railveh_type is set to 0, which was implicit before.
-Cleanup: Remove some extraneous parenthesis.
2007-01-30 11:53:35 +00:00
peter1138 60ddc05925 (svn r8434) -Fix (r8430): Missing braces caused compilation failure for some (most?) compilers... 2007-01-27 22:28:28 +00:00
tron 430e64c848 (svn r8430) -Fix
Replace the rather obscure control flow for handling aircraft/ship/train orders by something remotly comprehensible (see r3584)
2007-01-27 16:45:16 +00:00
tron 18effde565 (svn r8393) -Fix
-Codechange: CheckCompatibleRail() is only called for tiles which are known to contain a piece of rail. Simplify the function accordingly by eliminating unnecessary checks.
-Fix (?): Also fix an inconsistency in deciding what a compatible rail type is between level crossings and other rail tiles. It is unknown if this caused any problems.
2007-01-24 18:03:36 +00:00
tron 0996de79df (svn r8385) -Fix
-Regression (r8314): I only did half the necessary changes to move railtype from Engine to RailVehicleInfo. Now do the rest.
2007-01-24 07:14:09 +00:00
tron fb8b0557f9 (svn r8320) -Fix
Simplify TrainPowerChanged() somewhat by eleminating code duplication
2007-01-21 18:46:19 +00:00
tron b2def96248 (svn r8276) -Fix
Change the signature of Swap() to be less error prone, i.e. pass the variables to be swapped by reference instead of passing pointers to the variables.
Just do Swap(x, y) instead of Swap(&x, &y). This prevents accidents when the variables are pointers.
2007-01-19 11:47:48 +00:00
peter1138 92d418b031 (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
This lets us increase the sprite width from 14 to up to 29 bits, 
effectively nulling the old sprite limit. Table changes in next commit.
2007-01-14 19:57:49 +00:00
KUDr 9bfb3f08d9 (svn r8110) -Codechange: direct Vehicle::current_order.type changes (to OT_LOADING and OT_LEAVESTATION) replaced by v->BeginLoading() and v->LeaveStation() calls. This should allow easy hooking of those state transitions in order to maintain vehicle loading queue. 2007-01-13 18:55:54 +00:00
celestar 1691b2da61 (svn r8056) -Codechange: Remove swap_byte, swap_byte, and siblings (some were not used anyway) and replace them by our SwapT implementation 2007-01-11 12:32:10 +00:00
celestar 2ac0410767 (svn r8055) -Codechange: Replace the different max, dmax, maxu whatever macros by a simple template function max(), that requires two arguments of the same type. While I'm at it change a variable called "max" to "maxval" in a function that calls max(). 2007-01-11 11:05:01 +00:00
rubidium f35ed4bbc2 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 2007-01-10 18:56:51 +00:00
KUDr e373ea7096 (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 2007-01-10 18:12:09 +00:00
Renamed from src/train_cmd.c (Browse further)