Commit Graph

25 Commits (f2fd789cc635f6bdce0d52803676ed74db866616)

Author SHA1 Message Date
truelight a241ec82c9 (svn r6156) -Codechange: DeleteIndustry removes an industry from the pool
-Codechange: DestroyIndustry is called by DeleteIndustry to remove all things where a industry depends on.
  Last 2 changes to prepare for new pool system. Not pretty now, will be soon.
18 years ago
truelight 42a0c0b3fe (svn r6058) -Fix: Get(Industry|Town)ArraySize could never return 0
Note: _total_towns and _total_industries willb e removed soon, so this 'hack' is okay, for now ;)
18 years ago
truelight a21b2750bd (svn r6057) -Codechange: made a function GetRandomXXX, that _always_ returns a valid XXX, unless there are none to pick from. Then NULL is returned. 18 years ago
truelight 15aff22c96 (svn r6055) -Codechange: added GetXXXArraySize, which returns HighestID + 1 (or, will do that).
It isn't the best name, but we couldn't find any better.
  This unifies the pool-system even more.
18 years ago
truelight 505566da5c (svn r6047) -Codechange: FOR_ALL now _only_ loops valid items, and skips invalid ones
-Codechange: use IsValidXXX where ever possible
  Note: both changes to prepare for new pool system, which needs those changes.
  For every pool there are 2 ugly lines, which will be removed when done
  implementing new pool system.
  Based on FS#13 by blathijs, partly implemented.
18 years ago
rubidium 908d3bcfe6 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 18 years ago
rubidium 43af0ced5f (svn r6005) -Cleanup: introduce IndustryID and use it
-Cleanup: use TownID and StationID for two instances of uint16
18 years ago
truelight 0c760998b3 (svn r6001) -Feature: when removing a farm, his farmland is removed too (over time) (based on peter1138's patch, FS#82)
To make this to work, in older games farmland is removed on load, and replanted
18 years ago
rubidium 6fb092aa7a (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
The game date subsystem now allows someone to start in the year 0 and continue
up to the year 5 000 000. However, you currently cannot build anything before 
1920 as there is no newgrf support for dates before 1920 or after 2090 yet.
18 years ago
tron 5cf43b9f3c (svn r5907) Remove more indirection by using pointers instead of IDs. Also fix some bogus warnings on MSVC by using (void*) casts 18 years ago
belugas 910825b1d5 (svn r4614) CodeChange : Cleanup of industry_cmd (Step-4).
Removing the _industry_type_costs in favor of IndustrySpec.cost_multiplier;
In order to let industry_gui use the GetIndustrySpec accessor,
some structs had to be moved in industry.h
18 years ago
belugas ddd96570ca (svn r4350) CodeChange : Add and use accessors [G|S]etIndustrype. Define and use IndustryGfx type instead of uint 18 years ago
belugas f555554cf8 (svn r4347) CodeChange : Renamed IndustryType to IndustryLifeType. Cleanup step toward bringing accessors [G|S]etIndustrype 18 years ago
tron 649b0a207e (svn r4134) Revert part of r4133: Replacing a byte which gets written to savegames by an enum is a very bad idea 19 years ago
Darkvater 2e0505d689 (svn r4133) - Some miscellaneous changes (unconverted TownID in function definition, Owner instead of byte, remove obsolete member and compare waypoint index with 0 not STR_NULL) 19 years ago
Darkvater e91fa54a15 (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type. 19 years ago
tron 81e5b16d71 (svn r3172) static, const 19 years ago
Darkvater 4a58250cb9 (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
19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
matthijs cc0966405b (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
- Add: asserts to find the v->u.rail.track == 0 problem.
- Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation()
- Add: GetTileOwner(), IsTileOwner()
- Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType().
- Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type.
- Codechange: Replaced a few uint by TileIndex.
20 years ago
truelight 3df76452cd (svn r1771) -Add: Industries are now dynamic (up to 64k industries). Generating
1kx1k maps should now be much faster, and give more than just oil-stuff ;)
20 years ago
tron dae4b50e1c (svn r1724) Set maximum number of industries and towns to 250 each 20 years ago
truelight b450603437 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
(in prepare of dynamic arrays):
  - DEREF_XXX is changed into GetXXX
  - All direct call are directed via GetXXX
  - struct Industry has now an index-field
  - ENUM'd some stuff
  - Replaced home built loops with FOR_ALL_XXX
  - Added _stations_size, _vehicles_size, ... which gives the length of the
    array (which will be dynamic in the near future)
  - Changed lengtof(XXX) to _XXX_size (e.g. _stations_size)
  - Removed all endof(XXX) (because mostly it was part of a FOR_ALL_XXX)
  - Made the sort-functions of all 4 dynamic
  - Made all 4 Initialize functions more of the same
  - Some minor tab-fixing and stuff
  (tnx to Tron for proof-reading my 100kb patch ;))

  Note for all: please do NOT directly call _stations, _vehicles, _towns and
  _industries, but use the right wrapper to access them. Thank you.
  Ps: please also do not use 'v++', where v is of type Vehicle *.
20 years ago
truelight fe657e9ee3 (svn r1301) -Codechange: _industries finally has FOR_ALL_INDUSTRIES too 20 years ago
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 20 years ago