Commit Graph

40 Commits (08a494f184c20725f5cec8546c65854a8a667476)

Author SHA1 Message Date
rubidium fba426dc06 (svn r7452) -Fix: GetRandom(Industry|Town) must return a valid industry/town and should not need to loop over the pool for a second time. 18 years ago
rubidium af5c73c12e (svn r7451) -Fix (7372): GetNum(Towns|Industries) should return the actual number of towns and industries.
-Fix (6055): GetMax(Town|Industry)Index should not return the number of towns or industries - 1, but the size of the pool - 1.
18 years ago
matthijs e6ade36de1 (svn r7372) - CodeChange: Rename all GetXXXArraySize() functions to GetNumXXX() and add GetMaxXXXIndex() functions. This prepares for the new pool interface. 18 years ago
matthijs f3358b9813 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
- Codechange: Rename pool.[ch] to oldpool.[ch].
18 years ago
tron 7a984c44cc (svn r6986) Use the pool macros for the Town pool 18 years ago
truelight 3f4873ca76 (svn r6149) -Codechange: DeleteTown removes a town from the pool
-Codechange: DestroyTown is called by DeleteTown to remove all things where a town 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 213c71be3f (svn r6053) -Codechange: renamed all IsXXXIndex to IsValidXXXID
-Codechange: IsValidXXXID now also checks if XXX is really valid, not if the number is within range
  Both changes again in preperation of the new mem-pool system, which requires this.
  IsValidXXXID is not a bit less pretty, but that will be cleaned up after the new mem-pool system
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
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
celestar 99fdc0b6ef (svn r4591) -Fix (FS#122) Game no longer errors out when "Many random towns" is selected in the scenario editor.
-Side effects:
	- Removed one global variable from variables.h
	- Remove an ugly hack for the "many random towns" function
18 years ago
belugas 84a5c861c8 (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too 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 0df4339941 (svn r4130) - CodeChange: Add proper semantics for TownID for such variables instead of using the general uint16-type. We probably need to change GetTown() and IsTownIndex() as well to use TownID. 19 years ago
tron 17ec6ed70d (svn r3520) Remove unused parameters from some functions 19 years ago
tron 318fe153eb (svn r3365) Staticise 36 functions 19 years ago
tron 8980891b09 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants 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
tron a733fede9b (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 19 years ago
Darkvater 6d349b6284 (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
- CodeChange: changed the airport gui airport-type checking. Added function GetValidAirports() that returns bitmasked availibility, is also used for checking.
- CodeChange: to check tree-planting, 2 const arrays have been moved to table/tree_land.h (type and count)
- CodeChange: added IsTownIndex() in following of IsStationIndex(), etc.
- Fix (regression): road tunnels did not work anymore, forgot that their type was 0x200 (documented now)
19 years ago
celestar 2eda5228d1 (svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit 20 years ago
celestar 563eac90ca (svn r1866) -Fix: Intercepted generated maps with 0 towns on it. Currently just an
error() is called, some more graceful handling should be implemented
later.
20 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 59ac6e8c4b (svn r1764) -Add: dynamic towns, you can now have up to 64k towns (let me know when
you have that amount of towns in a map ;))
20 years ago
tron dae4b50e1c (svn r1724) Set maximum number of industries and towns to 250 each 20 years ago
tron 94d5aeabb2 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
celestar 07a10a51a7 (svn r1581) Added a display for the total map population to the town display (Jango) 20 years ago
tron dd6db73069 (svn r1520) Trim 134 (!) lines with trailing whitespace ): 20 years ago
celestar 957635121c (svn r1504) enummed town ratings (Jango) 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 c748f6db57 (svn r1312) -Add: Patch which is on by default: population in label of the town
-Fix: Expand town is a bit more agressive
-Fix: Fixed a bug in growing algorithm
20 years ago
truelight 3e1a12299c (svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
after savegame bump)
20 years ago
truelight eb49a19460 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way! 20 years ago
dominik 770f86bbbe (svn r122) Change: exclusive transport rights are now stored per town instead of per station
Exclusive rights from old savegames will be reset.
20 years ago
darkvater a32d8553e7 (svn r5) -Fix: townname generation of TTDLX savegames. All work
except for German Townnames (also fix one typo on 
English town-names)
-CodeChange: *act_paper to *act_water in Town to 
more resemble its use
-Fix: AI players now retain AI status. Since TTDLX 
savegame status is not fully documented, some holes 
exist (AI state is set to one without a vehicle, otherwise 
it crashes)
20 years ago
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 20 years ago