Commit Graph

163 Commits

Author SHA1 Message Date
tron 5ab592667f (svn r5173) Use map manipulation functions instead of SB() 2006-06-08 19:27:20 +00:00
tron 7c1f1d823f (svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town 2006-06-08 18:31:54 +00:00
tron be88e269b9 (svn r5155) - Remove the bridge branch merge (revision r5070) 2006-06-07 19:35:21 +00:00
celestar 25a63ec7af (svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above:
	Any railway track combination (excluding depots and waypoints)
	Any road combination (excluding depots)
	Clear tiles (duh), including fields
	Tunnel entrances
	Bridge heads

Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing

There are still a number of visual problems remaining, especially when electric railways are on or under the bridge.
DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
2006-06-02 13:05:41 +00:00
KUDr 5e73dce0e7 (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing. 2006-05-27 16:12:16 +00:00
Darkvater bbfb399c29 (svn r4947) - Fix [FS#145]: Starting scenarios did not adhere to local difficulty settings 2006-05-22 16:44:16 +00:00
rubidium ba6ea3d359 (svn r4945) Fix (r3726): make -t command line option (set starting date/year) work again 2006-05-22 10:08:23 +00:00
peter1138 10992deeb3 (svn r4757) - Newstations: add saveload support for custom station speclists 2006-05-06 21:46:26 +00:00
glx 02d07a056f (svn r4595) - Fix (FS#63) Music volume is now restored to the value saved in openttd.cfg 2006-04-27 21:05:32 +00:00
belugas 187013b6a3 (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
This is following the same scheme as for IndustrySpec
2006-04-27 18:28:56 +00:00
tron 288f4eed65 (svn r4571) Change the rail type update for electrified rails so it doesn't use bit magic 2006-04-25 07:29:02 +00:00
celestar e75e4e8f74 (svn r4466) -Fix: (FS#71) Game no longer crashes when the last vehicle serving a station has been deleted.
-Negative side effect: upon loading old games, stations whose last vehicle was a station have (temporarily) lower ratings.
   -Positive side effect: station.h no longer includes vehicle.h (breaks the station.h->vehicle.h->rail.h chain)
2006-04-18 08:50:17 +00:00
tron be4293098a (svn r4432) Make use of map access functions 2006-04-15 18:57:58 +00:00
celestar 5931b34aff (svn r4259) -[multistop] Fix/Feature/Codechange:
1) Improved the road vehicle allocation (aka slotting) for multistop. Stops can now accept unlimited, er... 256, vehicles.
2) Removed the "wait for stop" feature, because it did not work in practise.
3) Slotting now ignores unreachable stations. Uses NPF at the moment because the old pathfinder cannot do it (yet)
4) Now matter how many vehicles approach a station, they will always be distributed evenly over existing stops.
5) Hopefully the last fundamental change to multistop
2006-04-03 14:25:32 +00:00
tron d9e705ae52 (svn r4164) Use acessor functions 2006-03-30 09:08:43 +00:00
celestar a7d8ad0004 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas. 2006-03-29 16:30:26 +00:00
Darkvater ea1adebe31 (svn r4075) - Feature: Undraw the mouse when it leaves the window and Draw it again when it enters. Added both for WIN32 and SDL. Since Win95 has troubles with TrackMouseEvent(), this function was just simply rewritten which was the easiest. Based on a patch by DmitryKo. 2006-03-24 00:42:35 +00:00
tron 75a9419f04 (svn r3986) Add [GS]etCrossingRoadOwner 2006-03-19 19:33:19 +00:00
tron cc4f5b4e6f (svn r3763) Adapt to the new 'map accessors go in foo_map.h'-scheme 2006-03-05 10:19:33 +00:00
Darkvater 42dec88a29 (svn r3726) - [6/6] Finalize conversion, finally save the patches struct.
- Remove the temporary synchronisation in during the map-transfer as this is no longer needed
- The saved patches work just like the saved gameoptions. You have a _patches and a _patches_newgame struct. The _patches_newgame struct contains the values from the configuration file and thus the defaults for new games. When a new game is started or an older game is loaded, the default values are copied over to _patches to be used. When you load a game that has PATS saved, the default values are also loaded, but immediately overwritten by the values from the savegame. This ensures that player-based values are always taken from your personal preferences.
- The current implementation also changes the default values if you change player-based settings in the game. For example changing window_snap_radius in a certain game will also change it for all next OpenTTD sessions.
- The savegame version has been increased to 22.
- The last 6 orso patches close the following reports:
  [ 1366446 ] different names for patches: all patch settings have the same name as in the configuration file and are reachable from the console.
  [ 1288024 ] Strange string on OTTD initial screen: configuration (and this includes patches) inputs are validated and clamped to their minimum/maximum values.
  [ 1423198 ] Make "Signals on Drive side" player, not server, based: this is only visual so current setting is to save it with the savegame but not synchronise in multiplayer.
  [ 1208070 ] Patches and New GRF options saved: apart from newgrf this is done
2006-03-02 02:22:15 +00:00
tron f369dcef51 (svn r3664) Add a function to turn a tile into a void tile 2006-02-24 19:52:26 +00:00
Darkvater e3f2007da9 (svn r3648) - Fix typo in r3647, don't ask me how it got there s/_/./ 2006-02-21 17:48:40 +00:00
Darkvater 35ce486704 (svn r3647) Some style-changes to the parameter parser 2006-02-21 17:29:53 +00:00
tron 49c7eb934b (svn r3613) Some more const, indentation, whitespace and similar stuff 2006-02-18 14:41:24 +00:00
tron a2acfb51ed (svn r3604) Remove two unnecessary local variables 2006-02-14 07:32:45 +00:00
tron 453b30e387 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
2006-02-06 09:18:04 +00:00
Darkvater 94dfa09424 (svn r3534) - Codechange: remove unused savedump patch-settings. 2006-02-04 15:28:30 +00:00
tron 22dc05faf2 (svn r3510) Fiddle with whitespace and parentheses 2006-02-01 06:32:03 +00:00
tron 8cdd3261fc (svn r3509) Now -p is really gone (fix r3508) 2006-02-01 06:12:02 +00:00
tron 6c1db94a7d (svn r3508) Completly remove the deprecated -p parameter (is superseded by -n) 2006-02-01 06:09:37 +00:00
Darkvater f2448ebfd4 (svn r3500) - Workaround the inaccurate count of spectators/companies that can happen in certain border-cases. For now just dynamically get this value when requested so it is always right. To do properly all player/client creation/destruction needs a hook for networking. 2006-01-31 22:16:15 +00:00
Darkvater 61a7b45dd9 (svn r3485) - [Post-PBS]: when reverting PBS and removing station-tile reservations a station can of course not be a crossing as well. Thanks glx. 2006-01-30 14:03:34 +00:00
bjarni 8c7e594b08 (svn r3484) -fix: fixed issue in last commit where loading savegame versions 18 and 19 didn't init the multiheaded engine pointers 2006-01-29 23:04:51 +00:00
Darkvater 4e09974975 (svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
2006-01-29 18:57:26 +00:00
Darkvater b3a2f09ae9 (svn r3454) - Fix: company-count was not updated correctly when loading a saved game with already existing companies for multiplayer. 2006-01-28 01:33:57 +00:00
peter1138 70efa805cb (svn r3421) - Revert r3412 as it didn't work.
- Fix station builder issue by checking the tile is in bounds.
2006-01-23 19:12:35 +00:00
peter1138 935ab76f0f (svn r3412) - Fix: When changing game mode, reset the tile highlight data, as it may now be out of bounds. This fixes (at least) an assertion when opening the station builder window. 2006-01-21 19:39:26 +00:00
bjarni e35a131153 (svn r3403) -Codechange: [multiheaded engines] the references between the front and rear engines are no longer saved
instead the pointers are generated on load
2006-01-18 15:05:01 +00:00
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
truelight e373bd02ba (svn r3380) -Fix: removed 'size' from r3379, because it was pretty silly
-Note: no longer showhelp publish -p, as it is deprecated
2006-01-07 10:15:46 +00:00
truelight 835cd6ea28 (svn r3379) -Fix: protect showhelp against any possible overflow
-Add: [ FS#15 ] Added revision / version at top of help (./openttd -h)
2006-01-06 22:52:31 +00:00
truelight efd3d42107 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
-Fix: [ FS#30 ] don't reset date in SE when pressing RandomLand (rewrote patch of MeusH, but Peter warned me I should put his name in, so... oh well)
2006-01-06 21:57:37 +00:00
tron 5ac1a89f92 (svn r3366) Make an unnecessarily global variable local 2006-01-05 16:51:10 +00:00
tron e272b03fee (svn r3365) Staticise 36 functions 2006-01-05 12:40:50 +00:00
peter1138 4b464093e7 (svn r3362) Fix issue with loading old (TTD) savegames:
- move call to convert from old to new train subtypes.
 - ensure AI is started for AI players.
2006-01-04 20:18:39 +00:00
peter1138 2a94a64711 (svn r3356) - Remove unused parameter of AfterLoadGame().
- Initialize _sl_version after loading an old savegame.
2005-12-29 22:28:19 +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
peter1138 3532b91eef (svn r3316) - NewGRF: Unload engine names before loading grf files. This fixes names in climates where the engines don't get loaded. Renamed function to reflect its purpose. 2005-12-18 14:03:28 +00:00
tron b06b3e2ca2 (svn r3313) Remove GPMI related changes from trunk
Revisions in detail: 2542, 3226 (partial), 3229, 3231, 3232, 3238, 3242-3245, 3251, 3253, 3260, 3263, 3265, 3266, 3269, 3277, 3278, 3279, 3283 (partial), 3304, 3305, 3306
2005-12-18 12:10:46 +00:00
tron 560e92aa4a (svn r3301) One more static 2005-12-14 06:51:19 +00:00
tron 4634243110 (svn r3299) Remove the unimplemented -l option, which should select the language 2005-12-14 06:32:06 +00:00
Darkvater 56998926e7 (svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
- Fix: savegames only give back one message, show this by ignoring the first argument. Perhaps make the message more verbose in the future by adding STR_ equivalents next to the already existing debug messages.
2005-12-13 21:21:57 +00:00
truelight c963c59b67 (svn r3245) -Add: allow OpenTTD to give his GPMI-params to the GPMI modules 2005-11-29 15:53:15 +00:00
peter1138 87f54ebf92 (svn r3239) - Codechange: Introduce and use helper functions for engine replacement code. 2005-11-26 16:41:14 +00:00
Darkvater a090886073 (svn r3235) - Fix: fix two crashes, one with making a screenshot in the main menu without any game loaded, another when failing to load a scenario in 'New Game' 2005-11-26 12:45:53 +00:00
truelight b8f8f3869d (svn r3231) Fix: update the GPMI implementation to the latest GPMI-API version 2005-11-23 13:45:12 +00:00
truelight 4927236912 (svn r3229) -Add: add more GPMI support. Now GPMI-based AIs can be loaded (doesn't change a thing if you didn't enable GPMI) 2005-11-22 22:32:42 +00:00
truelight 4845ff063b (svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version. 2005-11-22 19:33:29 +00:00
truelight 6a4ba84320 (svn r3226) -Fix: GPMI implementation had minor glitches
-Fix: the AI speed control is done by the AI-core, individual AIs don't have to do it (so, AIs were delayed twice ;)
-Add: Support for AI-network-clients (an AI, connecting to a remote server)
-Fix: minor AI-core problems
2005-11-22 15:55:38 +00:00
bjarni eba1f68439 (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
max_autosave_num in the config files sets the number of autosaves to keep (default 16)
	MAX_NUM_AUTOSAVES in Makefile.config sets the default value. 16 is used if no value is given
	this behaviour can still be overwritten by keep_all_autosave (openttd.config setting)
	Note: this is a requested behaviour for PDA ports, since they got limited storage space
2005-11-17 19:43:37 +00:00
peter1138 754d26407e (svn r3212) - Waypoints/Depots: Store waypoint index in m2 for waypoints. This moves the ground type bits from m2 to m4 for waypoints and depots (leaving room for depot index in m2 in future), and moves the custom graphics ID to the waypoint struct.
- Waypoints: Until now stat_id was saved but never assigned to. Instead we now save the GRFID/local index of the custom graphics so that GRF file changes can leave graphics intact.
2005-11-16 22:20:15 +00:00
tron 1d109214bc (svn r3191) Move declaration and definition of _dbg_screen_rect to a place where it somewhat makes sense and wrap them in #ifdef _DEBUG 2005-11-16 08:35:26 +00:00
tron 9f8c5d8fd2 (svn r3186) Unnecessary casts and truncation 2005-11-15 09:05:16 +00:00
tron b9729fb72e (svn r3185) const 2005-11-15 09:00:02 +00:00
tron 8658560229 (svn r3183) Remove an unused declaration and properly declare CheckExternalFiles() in a header 2005-11-15 08:40:45 +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 357aba7475 (svn r3176) Use proper types, not some variants of int 2005-11-13 21:16:34 +00:00
tron 4a14a586e2 (svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
2005-11-13 14:54:09 +00:00
peter1138 7d888a5715 (svn r3158) - PBS: [ 1252192 ] Fix an assertion failure due to possible junk data in pre-PBS savegames. This will not correct pre-PBS savegames loaded and saved since PBS was introduced. (thanks glx) 2005-11-09 09:16:08 +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 7298b0b31b (svn r3109) Replace two occurrences of '256' with TOTAL_NUM_ENGINES 2005-10-31 11:22:52 +00:00
tron 2cc2154ad2 (svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
nothing spectacular, just some stuff, which piled up
2005-10-22 06:39:32 +00:00
tron 23ecc82ad3 (svn r3055) Give the savegame/scenarion sort order flags symbolic names 2005-10-17 19:57:00 +00:00
tron 3397e202c8 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants 2005-10-07 07:35:15 +00:00
tron ce1c72cf6e (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate 2005-09-28 19:35:36 +00:00
peter1138 3d197e0861 (svn r2963) Fix: calculate proportions of non-square giant screenshot correctly. 2005-09-19 16:03:47 +00:00
truelight 991d5c6234 (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
-Fix: removed the ability for the oldAI to cheat (this will criple him somewhat)
-Add: base-code for many improvements to come in the AI-system
-Add: added base-code for multiplayer AIs (DOES NOT WORK YET!)
2005-09-07 15:10:11 +00:00
Darkvater 828e7ed3e7 (svn r2909) Game would hang where the autosave_on_exit was activated.
- Updated VS.NET and VS6 project files changed AI files
2005-09-03 11:33:55 +00:00
Darkvater a181446829 (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop. 2005-09-02 16:05:59 +00:00
tron b45aeb5c36 (svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing. 2005-08-23 18:47:04 +00:00
tron 19f5036c46 (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
This doesn't ease the global variable mess, but makes the distinction between sprite heap and gfx loading routines easier.
2005-08-14 18:10:18 +00:00
bjarni 042f079b8d (svn r2848) -Fix: [ 1256044 ] fixed crash when loading a map made before rev 2817 in scenario editor. This was introduced in 2817 2005-08-10 21:16:38 +00:00
tron 5d5a7c48ee (svn r2821) Remove a write-only variable 2005-08-06 20:24:32 +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
truelight 4f15ada6cd (svn r2814) -Fix: made MorphOS to compile again 2005-08-06 14:58:06 +00:00
tron 4696ef802a (svn r2809) Implement more generic threading functions, which allow more than one thread 2005-08-05 09:15:41 +00:00
tron 3a162799fd (svn r2754) Move str_fmt into string.[ch] 2005-07-29 21:52:20 +00:00
tron f359d1a394 (svn r2748) Remove unused cruft from the main loop 2005-07-29 16:40:29 +00:00
tron af9f55c977 (svn r2720) Remove unused declarations and definitions 2005-07-26 19:34:03 +00:00
tron 44691cde0f (svn r2714) Remove unnecessary includes 2005-07-26 18:24:18 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 07a6e612ec (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
This results in shorter and hopefully easier to maintain files.
Note: I had to change paths in #include statements of some unrelated files, because I added the ottd base directory to the include path (-I.)
2005-07-23 15:16:57 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron 18d79cc30f (svn r2672) Move saving/loading related declarations to saveload.h 2005-07-22 06:31:31 +00:00
celestar 18a93cca3d (svn r2657) -Codechange: The available railtypes per player are now a bitmask, so
that railtypes do not be in ascending order of appearance. Allows easier
implementation or more railtypes
2005-07-20 22:02:58 +00:00
Darkvater 3e49626aec (svn r2610) - Feature: set server map name to the loaded name of the game/scenario. Also truncate where neccessary
- Feature: truncate the path of the saveload window
2005-07-17 16:01:26 +00:00
truelight a09342c1fc (svn r2606) -Codechange: renamed ai.c to ai_old.c, and ai.h to ai_new.h to make room
for a global AI-handler
2005-07-17 15:34:10 +00:00
truelight 658f9cb03f (svn r2602) -Codechange: removed unused variable (disable_computer)
-Fix: Changed some stuff to make server-side AIs possible in the far future
2005-07-17 13:34:19 +00:00
ludde f12b3a0c18 (svn r2588) Codechange: Remove PLAYER_SEED_RANDOM 2005-07-16 12:30:03 +00:00
ludde 71f9078bdd (svn r2583) Move OS specific code out of misc.c
Added support for Mersenne Twister random number generator (not implemented in network yet)
Wrap player randoms around #ifdef
2005-07-15 20:29:06 +00:00