Commit Graph

65 Commits

Author SHA1 Message Date
ludde 3ce9fb6bbd (svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier. 2005-07-17 12:49:00 +00:00
ludde f12b3a0c18 (svn r2588) Codechange: Remove PLAYER_SEED_RANDOM 2005-07-16 12:30:03 +00:00
Darkvater 95463428c8 (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca) 2005-07-15 21:28:26 +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
ludde 6013b327f7 (svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile.
Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though)
Changed some frequently used map macros to not compute the values each time.
Silence some warnings on MSVC.
2005-07-13 19:51:31 +00:00
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 2005-06-24 12:38:35 +00:00
celestar 9b8cb17831 (svn r2441) -Feature: You can now give transfer order to set up feeder systems 2005-06-15 16:58:15 +00:00
Darkvater 5fed47964e (svn r2420) - Codechange: magic number elminitation of cursorsprites. 2005-06-06 13:47:06 +00:00
Darkvater a51cfd58b8 (svn r2391) - Feature: saving games happen in a seperate thread so you no longer will have to wait such a long time (especially handy on bigger maps and multiplayer games). The mouse also changes into the 'ZZZ' state :P. The thread on windows is currently given a little-bit-less-than-normal priority so it should not interfere that much with the gameplay; it will take a bit longer though. Upon the exit of the game any pending saves are waited upon.
- Fix: fixed GetSavegameFormat() so that it takes the best compressor (highest), or a forced one added with the parameter
- Open issues: 
1. Don't attempt to load a game while saving is in progress, it will kick you back to the intro-screen with only the vast ocean to look at.
2. The server is disabled from threaded-saving, but might be enabled in the future.
3. Current implementation only allows 1 additional running thread.
4. Stupid global variables.....grrr
Big thanks for TrueLight and the amazing memorypool :D
2005-06-01 23:08:33 +00:00
Darkvater 6f06930ee3 (svn r2316) - Fix: [ 1154454 ] Fix BeOS build on Trunk (myob) 2005-05-14 23:48:39 +00:00
Darkvater 033995ec6e (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
2005-05-12 23:46:01 +00:00
Darkvater c626555f68 (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
- CodeChange: renamed CmdTrainGotoDepot() to CmdSendTrainToDepot() to be consistent with other depot commands.
- CodeChange: 'newgame' console command now calls the unabused GenRandomNewGame(). For the server it still creates a new game, a client quits the game and continues in SP.
- CodeChange: in the game-difficulty window, setup the disabled buttons on window creation, not every redraw.
2005-05-12 00:18:30 +00:00
Darkvater febae668fe (svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
- I also changed an order of strings from On, Off to Off, On, so this can be used ingame with the WWT_4 widget type.
- Since the newssettings now take 2 bits per setting (off/summary/on) _news_display_opt is widened to 32 bits and the settings code changed slightly to accomodate for a maximum of 16 message-types.
2005-04-13 23:03:31 +00:00
tron 9e53b86dca (svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once 2005-03-27 18:15:27 +00:00
truelight 83637d164e (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
2005-03-24 17:03:37 +00:00
truelight 9b1e6e6d3e (svn r2043) -Fix: committed too many files in the last commit 2005-03-24 14:33:05 +00:00
truelight fbb11ea366 (svn r2042) -Fix: forgot to remove a printf ;) 2005-03-24 14:31:27 +00:00
tron 6f184a0471 (svn r1924) Use same type names in declaration and implementation 2005-03-04 10:34:44 +00:00
celestar fe6f9e9a65 (svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit 2005-02-17 10:56:19 +00:00
tron f8d97a5f61 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters 2005-02-07 10:41:45 +00:00
tron eed181245d (svn r1833) byte -> char transition: the rest 2005-02-06 22:25:27 +00:00
tron 27dc506a03 (svn r1832) Next byte -> char iteration: custom names 2005-02-06 20:53:31 +00:00
tron b2ae5b197e (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics 2005-02-06 13:41:02 +00:00
tron ff3bc3cc94 (svn r1814) Let ReadFileToMem() return void* (instead of byte*) because we don't know what the caller wants to do with the data 2005-02-06 08:38:09 +00:00
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 2005-02-06 08:18:00 +00:00
matthijs a2dec6c32a (svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships.
	- Uses A* pathfinding (same codebase as the new ai).
	- Currently unlimited search depth, so might perform badly on large maps/networks (especially ships).
	- Will always find a route if there is one.
	- Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values).
	- With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again.
- Feature: Disabling 90 degree turns for trains and ships.
	- Requires NPF to be enabled.
	- Ships and trains can no longer make weird 90 degree turns on tile borders.
- Codechange: Removed table/directions.h.
	- table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location?
- Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault.
- Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64.
- Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED.
- Codechange: Moved TileAddWrap() to map.[ch] 
- Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). 
- Codechange: Moved IsTrainStationTile() to station.h
- Add: IsRoadStationTile() and GetRoadStationDir().
2005-01-31 11:23:10 +00:00
tron 7bbcf5875c (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 2005-01-31 07:23:15 +00:00
celestar 752b3f0dd6 (svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
a single station.
Thanks to: Truelight for the saveload code, Darkvater and Hackykid for
network testing and Tron for proof-reading 1500 lines of diff.
2005-01-29 19:41:44 +00:00
tron f08d102ac2 (svn r1715) Move [GS]etMapExtraBits to tile.[ch] 2005-01-29 13:33:48 +00:00
truelight 8edff76765 (svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch 2005-01-23 19:02:53 +00:00
tron 53d1c3f117 (svn r1616) Introduce ttd_strlcat() and use it to de-uglify some piece of code in misc_cmd.
While here rename the len parameter of ttd_strlcpy() to size, because it is a buffer size and not a string length.
Also add -Wwrite-strings to the Makefile, because the above mentioned piece of code was the only part which triggered this warning.
2005-01-23 15:16:47 +00:00
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 2005-01-22 20:23:18 +00:00
darkvater 0a944dc950 (svn r1583) -Fix: You should no longer be able to delete bridges on any type of underground when there is a vehicle on it 2005-01-21 19:52:32 +00:00
tron 4136f395bf (svn r1508) Remove duplicate declarations and include proper headers where necessary 2005-01-14 19:41:24 +00:00
darkvater 61cae70fe5 (svn r1497) -Fix: [1101179] Crash if generating land while industry window is open. This also happened for towns and the land information window
-Added DeleteWindowByClass() function that deletes all windows of a given class
2005-01-13 16:50:20 +00:00
darkvater 06cc62f40d (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
-Fix: fixed some compiler warnings
-Added PF_NETWORK_ONLY flag to settings. Such a setting can only be modified in a network game.
2005-01-13 16:28:47 +00:00
truelight a243285af4 (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
dynamic arrays
2005-01-12 11:21:28 +00:00
darkvater 5fac6142e8 (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
-Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while
-These values are saved in hs.dat; added read/write functions for it
-Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game.
2005-01-11 00:54:06 +00:00
tron d922ca68e7 (svn r1354) Use WindowClass/WindowNumber to store/pass window class/number, not some arbitrary data types 2005-01-03 21:29:59 +00:00
truelight a9bb5be49d (svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
Works fine, beside some minor stuff:
  - Network is not working yet
  - Keyboard is not working
  - No MIDI support
  - 'A few file selector bugs involving drives'
2004-12-23 14:46:16 +00:00
dominik 7cfaa8a418 (svn r1194) Feature: You can now add and remove servers from the server list. Those will be remembered until you delete them by pressing the Delete key. 2004-12-20 22:14:39 +00:00
truelight f80094deb7 (svn r1045) -Fix: OpenTTD compiles again under VC6 (sign_de) 2004-12-13 11:17:59 +00:00
truelight b8f6d41418 (svn r942) -Merged branch/network back into the trunk 2004-12-04 17:54:56 +00:00
tron c00258237e (svn r907) Sprinkle holy ANSI water:
- "inline" must before the return type (and after "static")
- Initialise all struct members, not just some of them
- Remove (one) spurious semicolon
2004-12-03 07:43:00 +00:00
tron 57adc97733 (svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food.
Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them.
Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided.
This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
2004-11-21 10:49:40 +00:00
tron 450c669eb2 (svn r631) Merge r440, r444, r485, r630 to trunk:
r440
Move screenshot function declarations to new file screenshot.h
Clean up screenshot.c a bit, mostly whitespace, alloca() -> malloc() and checking return values
r485
Remove unused field from struct ScreenshotFormat
2004-11-15 19:25:59 +00:00
dominik fb64b4e499 (svn r612) [newgrf] Fix: custom waypoints on monorail/maglev are displayed correctly 2004-11-14 22:10:08 +00:00
darkvater 397cc50f61 (svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky). 2004-11-14 13:07:07 +00:00
darkvater 989289fadd (svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky. 2004-11-14 11:04:59 +00:00
tron 37cbae0370 (svn r579) Remove now unused function memswap() 2004-11-14 08:11:57 +00:00