Commit Graph

223 Commits (c02ef3e4564b7b54d49f0827d2d7625cbc38f335)

Author SHA1 Message Date
rubidium 1fe3ad3288 (svn r17075) -Codechange: rename ~750 strings to be more uniform with their relatives 15 years ago
rubidium 4b2592dbc0 (svn r17062) -Change: unify the naming of some 125 strings 15 years ago
frosch 20c1e42be1 (svn r16929) -Change: There is no point in not randomising engine introduction-date before 1922. Instead disable the randomisation for the first two years after game-start, so you do not have to wait for the first engine. 15 years ago
rubidium 9980af2898 (svn r16921) -Codechange: make it more clear what strings are related to road vehicles; only ROAD isn't always enough. Also unify the way of writing it. 15 years ago
smatz b6960e4e17 (svn r16814) -Codechange: make IsNormalAircraft() member of Aircraft 15 years ago
smatz 868c21cbcc (svn r16813) -Codechange: make IsEngineCountable() member of Vehicle 15 years ago
yexo 44c15e4196 (svn r16647) -Codechange: remove newgrf.h include from newgrf_engine.h to prevent unnecessary inclusion newgrf.h anyway 15 years ago
rubidium 35aabc1d4c (svn r16586) -Codechange: don't store lifelength in the savegame; it can easily be calculated, it isn't used often and now changing extend_vehicle_life in game has some effect. 15 years ago
rubidium 512b021e26 (svn r16581) -Codechange: unify the access to Engine::lifelength. 15 years ago
rubidium 4b05617c42 (svn r16580) -Codechange: rename Engine::image_index to original_image_index to not confuse it with image_index from *VehInfo. 15 years ago
alberth bab70a823d (svn r16491) -Codechange: Added parentheses around bitwise operators for code style. 15 years ago
frosch a4557c7da4 (svn r16416) -Fix [FS#2912]: Rework deleting of news when referenced vehicles/stations/industries are deleted. 15 years ago
smatz 62a7948af0 (svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved 15 years ago
smatz 70aab8bf04 (svn r16354) -Codechange: use 'new' pool accessors and methods for Engine too 15 years ago
smatz ed1e54bd84 (svn r16326) -Codechange: replace GetPoolItemPoolSize() by PoolItem::GetPoolSize() 15 years ago
smatz 6221d74644 (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 15 years ago
rubidium 59d45a04d6 (svn r16118) -Change/cleanup: remove the hexadecimal 'in TTD the string had this ID' from 'some' strings and replace the string name with something more sensible. 15 years ago
frosch 6dd04a9a78 (svn r15763) -Codechange/Fix: Add Engine::GetDisplayDefaultCapacity() and use it everywhere, so CB 36 is also used everywhere. 15 years ago
rubidium 9d018723b7 (svn r15711) -Codechange: lots of whitespace cleanup/fixes 16 years ago
frosch 987e72f4f2 (svn r15645) -Fix (r12924)[FS#2612]: Add an EngineOverrideManager to give the term 'compatible newgrf' again some sense and to not crash because of trivial changes. 16 years ago
frosch e01106f66b (svn r15592) -Fix: Refit-info in purchase list did only check the first articulated part. 16 years ago
frosch d3850e101c (svn r15541) -Revert (r15399): 'v->cargo_type' is also used in other places, which cannot accept CT_INVALID.
-Codechange: Add Engine::GetDefaultCargoType() and Engine::CanCarryCargo() and use them.
-Fix [FS#2617]: When articulated parts have no available default cargo, use the cargo type of the first part for livery selection.
-Change: To decide whether a vehicle is refittable do not test its current capacity for being zero, but always use the 'capacity property'.
  Note: The property is used unmodifed without calling CB 15/36. By setting it to a non-zero value and returning zero in the callback vehicles can be refitted to/from zero capacity for e.g. livery effects.
  Note: It is intentional that you cannot control refittability by CB 36.
16 years ago
rubidium a5f30dd553 (svn r15521) -Codechange: add helper function to get the display tractive effort of a vehicle. 16 years ago
rubidium d846eef0b6 (svn r15434) -Codechange: bit of type safety for the DC_xxx flags. 16 years ago
peter1138 748d4d2fb9 (svn r15412) -Fix: Clearing custom engine names could cause desyncs due to be client-side only; GUI parts of save/load of custom engine names also removed as it was never implemented. 16 years ago
frosch de9a6fc90b (svn r15308) -Codechange: Deduplicate km-ish/h -> mph conversions. 16 years ago
frosch c28c4c1986 (svn r15306) -Codechange: Deduplicate code by adding Engine::GetDisplayMaxSpeed(), GetPower() and GetDisplayWeight(). (and using them) 16 years ago
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 16 years ago
glx c1cf3934fa (svn r15263) -Codechange: added Engine::GetCost() to remove some code duplication. 16 years ago
glx e8b5f49861 (svn r15261) -Add: added Engine::GetRunningCost() to remove some code duplication. Also stops AIs decrementing vehicle counter of first company 16 years ago
smatz 6dffd8ae82 (svn r15216) -Feature: native support for Transport Tycoon (Original) savegames. Based on SVXConverter's source code and documentation by Roman Vetter 16 years ago
smatz e00cf92f47 (svn r15077) -Codechange: enumify DAYS_IN_YEAR and DAYS_IN_LEAP_YEAR
-Change: when computing daily running cost, divide by 365 (instead of 364). Since r12134, the rounding errors don't need this correction anymore
16 years ago
truebrain a3dd7506d3 (svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.
NoAI is an API (a framework) to build your own AIs in. See:
   http://wiki.openttd.org/wiki/index.php/AI:Main_Page
 With many thanks to:
  - glx and Rubidium for their syncing, feedback and hard work
  - Yexo for his feedback, patches, and AIs which tested the system very deep
  - Morloth for his feedback and patches
  - TJIP for hosting a challenge which kept NoAI on track
  - All AI authors for testing our AI API, and all other people who helped in one way or another
-Remove: all old AIs and their cheats/hacks
16 years ago
smatz 0cd41d1dc6 (svn r14958) -Codechange [FS#1923]: when checking for unique names, compare only with manually set names
There are situations that aren't solvable (because of different language files), so if the user really wants to have duplicated name, allow him to do so. It solves desyncs between server and clients using different languages. It behaves the same in SP and MP, so users won't see the different behaviour as a bug (and even checking in SP could be worked around by the user).
16 years ago
peter1138 0052c85002 (svn r14926) -Feature: Automatically set last engine ageing year to the last 'introduction year plus half model life', to allow engines later than 2050 to appear. 16 years ago
smatz 7368c740a6 (svn r14828) -Codechange: move most of save/load-specific code to separate files 16 years ago
rubidium 87e5a8b52b (svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter. 16 years ago
rubidium d1bb5e5f36 (svn r14735) -Codechange: remove a bit of bit-waste in the map array (without changing the map array) and make the CompanyIDs contiguous.
-Note: 15 should be enough for now... making it any more means adding more bytes to the map array and thus wasting more bits instead of reducing the bit waste.
16 years ago
rubidium c3746a55bb (svn r14732) -Codechange: replace some magic number with less magic constants and use the proper type for a few variables. 16 years ago
rubidium c7c65cf5bc (svn r14683) -Change: only say a engine/vehicle is refittable when it can be refitted to at least two cargo type or when it has subcargos.
NOTE: it is still possible that a vehicle is marked refittable when there is nothing to refit to, e.g. when only one subcargo is available but that cannot be determined without a vehicle chain.
16 years ago
frosch a87af0d7e5 (svn r14680) -Feature(ette) [FS#2434]: Use property 4 (model life) also for wagons.
Setting property 4 to 0xFF will protect the vehicle (engine or wagon) from expireing. (Necessary since early introduction dates)
Savegames will only be affected after 'resetengines'.
16 years ago
rubidium b650a86e58 (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames. 16 years ago
rubidium 3b798599b6 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with. 16 years ago
smatz 1266b1a73f (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies) 16 years ago
frosch 856157b6da (svn r14313) -Codechange: Move functions dealing with the EngineRenew pool to their own file. 16 years ago
peter1138 80c9ecedcd (svn r14182) -Fix: After applying NewGRF settings, all rail and road types were available as the engine availability check was performed too early. 16 years ago
rubidium 2d94337e1a (svn r14064) -Fix [FS#1752]: check for the length of strings (in bytes) in the command. Checking for the length in pixels is impossible because that differs per client. 16 years ago
peter1138 7cdd6ef33c (svn r13825) -Revert (r13821 partially): preview_player_rank wasn't a PlayerByte value in r12143, and still isn't a PlayerByte value. 16 years ago
rubidium 1a4ac3ee5c (svn r13821) -Codechange: replace some uint8/bytes with more specificly named typedefs and replace a few magic numbers. 16 years ago
rubidium 3a799389eb (svn r13731) -Codechange: make a pool of the array of players. 16 years ago
peter1138 261018fc8c (svn r13388) -Codechange: Remove "my invented flag for something that is a wagon" 16 years ago
peter1138 79d008cd2e (svn r13331) -Fix (r12924): Wrong include type for (sdt::)map 16 years ago
rubidium 923e21129c (svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games. 16 years ago
peter1138 f7a9c4f522 (svn r13287) -Codechange: move engine list gui code away from engine.cpp (and its headers) to engine_gui.cpp 16 years ago
rubidium 8c9cc415e3 (svn r13255) -Codechange: move _opt to _settings. 16 years ago
rubidium 4625695653 (svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
16 years ago
smatz 9aa69db2e6 (svn r13168) -Fix (r13072): forgot to 'fix' EngList_SortPartial() together with EngList_Sort() 16 years ago
rubidium 76b8970a33 (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls. 16 years ago
smatz 56f15b3544 (svn r13089) -Fix (r13072): MorphOS compilation was broken 16 years ago
smatz f64c4fc4fb (svn r13086) -Fix: do not crash badly after loading a newgrf with engines in-game that often 16 years ago
smatz a9cc987929 (svn r13077) -Codechange: move function that updates cached num_engines to engine.cpp, make it run only 1 loop 16 years ago
smatz ad8057ab76 (svn r13072) -Fix (r12995): possible out-of-bounds access 16 years ago
rubidium d0c79e1164 (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan. 16 years ago
smatz 3445b8054c (svn r12995) -Codechange: use std::vector for EngineList instead of C/C++ wrapper for CBlobT 16 years ago
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
peter1138 a00371c8db (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist. 16 years ago
rubidium 6939569362 (svn r12855) -Codechange: do not use autoptr's for testing whether certain objects can be build, but check it directly in the pool so we do not have to call destructors in the testing phase. Stations still use the autoptr though. 16 years ago
smatz 6af1fb2bdd (svn r12599) -Codechange: force AllocateSafeRaw() to be linked to simplify compiler's decisions about inlining 16 years ago
rubidium ef2be7d0fc (svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h. 16 years ago
rubidium eeabab4555 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h. 16 years ago
smatz 27284db36f (svn r12244) -Fix (r12150): typo resulting in no players are given the engine preview offer 17 years ago
smatz a5f99154b7 (svn r12150) -Fix (r12143): compiler warnings - possible use of uninitialised variable 17 years ago
peter1138 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. 17 years ago
frosch 2173b03144 (svn r12084) -Fix: 'Early retirement'-properties are signed. 17 years ago
peter1138 a528dc89c7 (svn r12054) -Cleanup: Use VehicleType instead of byte for vehicle types... 17 years ago
peter1138 697b07c99c (svn r11971) -Codechange: use of FOR_ALL_ENGINES/ENGINEIDS_OF_TYPE instead of for-loops 17 years ago
peter1138 9c65bcea7d (svn r11970) -Cleanup: Remove old comment 17 years ago
bjarni 77a20eae43 (svn r11872) -Fix (r9874): EngineHasReplacementForPlayer() didn't look in ALL_GROUP 17 years ago
rubidium dc87b05e8c (svn r11834) -Codechange: only include settings_type.h if needed. 17 years ago
rubidium 5c4150d304 (svn r11832) -Codechange: get rid of (quite) some VARDEFs. 17 years ago
rubidium d4e6a6bf57 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 17 years ago
peter1138 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.
17 years ago
rubidium ac528411df (svn r11818) -Codechange: split player.h into smaller pieces. 17 years ago
peter1138 a01fc4c142 (svn r11789) -Codechange: coding style for global variable names 17 years ago
rubidium b4b3190b62 (svn r11788) -Fix (11787): makedepend doesn't mark delete files as changed... 17 years ago
peter1138 ce2104ed47 (svn r11784) -Codechange: set up initial engine data in one place 17 years ago
peter1138 814f47a3cc (svn r11783) -Codechange: compare engine type with its type property, not by its index 17 years ago
rubidium a3ccdcea36 (svn r11777) -Codechange: split the string header and make do not include it when it's not necessary. 17 years ago
rubidium a8a3a7e3f2 (svn r11775) -Codechange: move all autoreplace/autorenew functions to a single location. 17 years ago
rubidium 384503e7d3 (svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes. 17 years ago
rubidium b9046c97fb (svn r11702) -Codechange: move all date related stuff to date*. 17 years ago
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' 17 years ago
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. 17 years ago
rubidium 9e9cfe6e59 (svn r11677) -Codechange: move price and command related types/functions to their respective places. 17 years ago
rubidium 433a9f3c09 (svn r11675) -Codechange: split the string types from the string functions. 17 years ago
skidd13 eeaa348f8b (svn r11484) -Codechange: Remove the doubled function SetBitT and rename the remaining to fit with the naming style 17 years ago
skidd13 71c4325c50 (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style 17 years ago
rubidium 5016f5497c (svn r10757) -Codechange: make the engine renew struct use the pool item class as super class. 17 years ago
rubidium 7aec26887c (svn r10567) -Add [FS#915]: a "group" with ungrouped vehicles. Patch by Matthias Wolf. 17 years ago
peter1138 c692d897cd (svn r10364) -Fix [FS#706]: checking for duplicate custom names was inconsistent, and tested all 'namespaces'. now only check names of the same type. 17 years ago
rubidium 49220cc6f1 (svn r10205) -Codechange: refactor returning of cost, so it can be more easily modified. 17 years ago
rubidium 966e2738b9 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate. 17 years ago
rubidium 9060ab4af1 (svn r9918) -Fix: the available roadtypes/railtypes were not updated on GRF updates. 17 years ago
rubidium 0819f3a9a0 (svn r9917) -Codechange: prepare some more areas for more road types. 17 years ago
rubidium 7d4be11516 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13. 17 years ago
peter1138 c9018d3e7c (svn r9825) -Codechange: [NewGRF] Add support for early vehicle retirement. 17 years ago
peter1138 4d0483b650 (svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window. 17 years ago
bjarni 73875647b5 (svn r9688) -Codechange: Created a function to get default cargo type for a cargo type 17 years ago
belugas 607a55f4ec (svn r9662) -Documentation: Doxygen corrections and @file omissions 17 years ago
rubidium ce919e8c71 (svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code). 18 years ago
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 18 years ago
rubidium 35fde14a52 (svn r9001) -Codechange: remove duplication of functions and strings with respect to the news of new vehicles. 18 years ago
maedhros f865f0a445 (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names. 18 years ago
belugas 6dbf9f2f41 (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
Some documentation addition, when i can easily supply them
18 years ago
tron 356e47f108 (svn r8660) -Fix
-Codechange: Remove _avail_aircraft
Its name is misleading. It is rather _avail_airports, but then only some of them, which leads to inconsistencies when using it.
Further it is unnecessary to store it in savegams.
18 years ago
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
18 years ago
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.
18 years ago
Darkvater 50ca901b40 (svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow. 18 years ago
tron c9f4c637fb (svn r8410) -Fix
-Fix: Fix an out of bounds array access when assigning the engine type in the _engine array
This usually hits the _engine_name_strings array and causes an invalid StringID, though it depends on the compiler which data structure gets placed after the _engines array.
Most probably this was exposed by removing railtype from Engine, which changed the size of this struct.
18 years ago
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.
18 years ago
tron bc523186e0 (svn r8314) -Fix
-Codechange: Move the railtype from EngineInfo to RailVehicleInfo, because having a railtype for non-rail vehicles isn't that useful
18 years ago
rubidium f35ed4bbc2 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 18 years ago
KUDr e373ea7096 (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 18 years ago