Commit Graph

181 Commits (f9f6b5f341b8b296e58fa33a719bfd1ede5ebd05)

Author SHA1 Message Date
tron 318fe153eb (svn r3365) Staticise 36 functions 19 years ago
Darkvater 756f84e3bd (svn r3323) - Fix: automatically enable new AI when turning on the AI in multiplayer feature (it only works that way and we all know users don't read). 19 years ago
tron d5aa95b87e (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
19 years ago
tron 7dc1e23845 (svn r3311) Remove the unnecessary global variable _grffile_count: It's just the scroll count of a list and furthermore only used in one file 19 years ago
Darkvater 573ce05eb8 (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.
19 years ago
peter1138 5f3dc36983 (svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect their actual use, and add "Close Window" tooltip where missing. 19 years ago
truelight 29a0f76ac9 (svn r3238) -Fix: always save if you want GPMI-based AIs, this on request by
Darkvater, so we can, in the future, save patch options in savegames 
without any problems.
19 years ago
truelight d9e13cef71 (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) 19 years ago
truelight af6fe3949b (svn r3224) -Add: Allow the NewAI to work in Multiplayer Games (switchable via patch
settings, off by defaut). An other step to AIScripts.
      WARNING: this is still highly experimental and has known bugs!
19 years ago
tron 99a918aaac (svn r3222) -Feature: Right-Click-Scrolling optionally moves in the opposite direction (Requested by manx) 19 years ago
tron 7289cc7c07 (svn r3190) Turn some loops into canonical for loop form 19 years ago
tron 8a3587fa28 (svn r3185) const 19 years ago
tron 9d0e7b6458 (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
19 years ago
tron 53f00c8f9d (svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
19 years ago
peter1138 7ba8da9dc7 (svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars. 19 years ago
tron 181d586a7c (svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
19 years ago
tron 0b936c3222 (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
19 years ago
tron f0e3072b6c (svn r2994) Another small hack regarding currencies: add a #define to emulate a variable, that holds the current currency; again this should increase readability 19 years ago
peter1138 5dcb1e34fd (svn r2982) Newgrf: Added patch option for wagon speed limits. This is enabled by default. 19 years ago
Darkvater 985bcc6af7 (svn r2980) - Add some comments to some setting enums, and fix a 'const' warning.
- Add settings.h to VS.NET project.
19 years ago
tron 78524dd216 (svn r2831) Fix some potential and real buffer overflows 19 years ago
tron 3f162fc49a (svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define 19 years ago
bjarni 9952ff0b59 (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)
19 years ago
tron b62887b973 (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files 19 years ago
celestar a74063be09 (svn r2751) -Fix: Disabled buttons in the patches and difficulty windows are now rendered properly again 19 years ago
tron c043670cf8 (svn r2717) Move _userstring to strings.[ch] 19 years ago
celestar a3739aecdf (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
tron 54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
tron 71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 19 years ago
tron f09638ad3d (svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read 19 years ago
ludde 08725cd6df (svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
- Benchmark shows that NTP is now around 10x faster than NPF.
  - Made IsTunnelTile macro to determine if a tile is a tunnel.
  - Added some useful debugging functions for making tiles red / getting accurate timestamps.
  - Remove old depot finding algorithm.
  - Disable warning for signed/unsigned comparisons.
19 years ago
ludde 6246619185 (svn r2573) Codechange: Removed WDF_RESTORE_DPARAM, it's not needed with the new string system.
Also fixed a bug introduced in r2564, forgot to remove 4 global variables in network_gui.c.
19 years ago
ludde 8086017097 (svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
Added a way to bind a C-string to an openttd string which doesn't modify the game state.
19 years ago
ludde 7bcce65053 (svn r2553) - Fix: [pathfinding] Remove old-old train pathfinder. Enhanced old pathfinder.
- Penalties for red signals and for slopes. 
  - Increased the search depth to work better with large train networks.
19 years ago
hackykid ab9c6f126d (svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
- Feature: [pbs] Implement autoplacement of pbs blocks, when a block has an entry and an exit pbs signal, covert the entire block to pbs. Can be turned off in the patch settings.
 - Feature: [pbs] Allow showing of reserved status by making the tracks darker, when the pbs debug level is at least 1.
19 years ago
hackykid 90900802b9 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_) 19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater a77a211ef7 (svn r2310) - Fix: Game would crash if you full-screened with the 'fullscreen' button than chose a resolution from the dropdown box that was no longer valid. Big thanks to DaleStan for track down the crashing bug.
- Fix: There would be duplicate entries in the resolutions dropdown box. Copy SDL method or removing duplicates and sort the list.
- Feature: in the settings menu, you don't have to click on the arrows anymore, clicking on the dropdown box itself has the same effect. Consistent with other dropdowns in the game
19 years ago
Darkvater 56bc64a3a1 (svn r2309) - CodeChange: Change all _iconsole_color_whatever into _icolour_wtv (abbreviated). Besides the changed into proper english, yes this commit is pretty useless ;) 19 years ago
Darkvater e4eb0c672a (svn r2307) - Fix (regression): it was not possible to change the drive-side in the intro-game.
- CodeChange: remove unused "CANT_DO_THIS" double-string.
19 years ago
Darkvater ddd4958164 (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()
19 years ago
Darkvater eb4233e8e9 (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.
19 years ago
Darkvater da1a7587af (svn r2285) - Codechange: Fix up some of the missing things from server-checking; namely bridge-type, bridge-length, dragged end-tile (bridge/station), station_spread
- Fix: [ 1197256 ] max station spread patch < 7 does not work. Station spread was not taking into account when not using drag&drop. Fix this up, and add a callback to the settings window to immediately reflect the changes.
19 years ago
Darkvater dc4e959b48 (svn r2263) - Fix: If the seperator string is empty for custom currencies, everything after that is cut off. Fix it by replacing nothing with ' '. Thanks for noticing peter1138 19 years ago
Darkvater d082989dc9 (svn r2260) - Fix (regression): custom currency input works again ingame 19 years ago
Darkvater 6e56a30c07 (svn r2245) - CodeChange: simplify the clamping of values for patch-settings by using clamp() 19 years ago
Darkvater 22a375ba73 (svn r2243) -Fix: Rework of console. Use 'help command|variable' to get help about it. You can assign variables with =, ++, --, or just new value. Console parser is now lenient towards typed spaces, and more robust in general (at least readable). Removed the 'set' command, instead implemented all such variables as 'variables'.
- Some variables are really special and cannot be assigned normally, use their callback procedure for assignment/querying. This commit also obsoletes "[1172804] Console set command cleanup"
19 years ago
Darkvater 106b78927e (svn r2005) - Fix: fix previous commit. Using 'New Game (scenario)' will use YOUR difficulty settings but ingame options (eg townnames, currency). Also settings are correctly saved when closing the difficulty window now. 20 years ago
Darkvater ef1325cd36 (svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
- Fix: [ 1153926 ] All my settings in vain... IGNORED!
- Change: I hope I got it all right. Pressing 'New Game' (either choosing random or a preset scenario) and 'Create Scenario' will start a new game with the settings and difficulty in the intro menu. Using 'Load Game' and 'Play Scenario' will take the values from the savegame/scenario itself.
20 years ago
tron ca3ccff729 (svn r1981) Typedef some structs and enums 20 years ago
celestar 5e86b2ff9b (svn r1889) -Fix: [ 1108637 ] 'Play scenario' now loads game options and difficulty, 'Load game' starts game with user-selected values. 20 years ago
tron 830565514c (svn r1867) Include tables/sprites.h only in files which need it 20 years ago
tron c644e6b742 (svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers 20 years ago
tron 59fa465dce (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics 20 years ago
tron d3f84347ac (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) 20 years ago
truelight 99f3fe4c07 (svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
trains in one game (instead of the 240 which was the current value). 
Default max allowed vehicles per type is changed:
  Trains:  500 (old 80)
  Road:    500 (old 80)
  Ships:   200 (old 40)
  Aicraft: 300 (old 50)
(Tnx to Celestar and Darkvater for checking the patch)
20 years ago
darkvater b6dbc9196a (svn r1753) - Fix: [ 1113037 ] crash when accessing hi-scores in editor, it is now disabled. 20 years ago
matthijs eb78cdb2d4 (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().
20 years ago
tron 001aa8e453 (svn r1722) -Feature: Bigger maps - anyone? 20 years ago
dominik 95960c19a7 (svn r1614) Fix: Signals were not updated correctly when the vehicle drive side was changed 20 years ago
tron 97f893ae2f (svn r1596) Add some more statics 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
darkvater 0fc9b656e2 (svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none (jaguar7) 20 years ago
darkvater 07d9bc45dd (svn r1532) -Fix: [1103078] default service period patch options are now cast to 0 with right variable size. 20 years ago
darkvater 0961c6af96 (svn r1515) -Removed the 'close ALL windows' from the toolbar since shift+del does this. 20 years ago
darkvater 84adfdf8c8 (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.
20 years ago
darkvater 199a77d1ea (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.
20 years ago
darkvater 2d023f9c0b (svn r1478) -Fix: [1099195] mouse-wheel in train replace window. Scrollbar1 and Scrollbar2 now work independently. You can only scroll on list and scrollbar itself; scrollbar must be next widget of the list.
-Fix: updated the few gui's that didn't have the scrollbar right after the listbox.
20 years ago
darkvater 781648ada3 (svn r1465) -Fix: [1099101] starting year patch goes out of range. Clamped year between 1920-2090 as wel as adding defines for it. 20 years ago
tron 4450ff105c (svn r1451) Fix some of the signed/unsigned comparison warnings 20 years ago
celestar e0a8b21404 (svn r1441) Fixed a couple of warnings, and removed a pointless assert 20 years ago
darkvater c2b59b2089 (svn r1418) -Feature: [1098254] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid) 20 years ago
tron 2eb7aedf69 (svn r1402) Trim trailing whitespace 20 years ago
darkvater d63144e8c0 (svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me! 20 years ago
darkvater 1a29d7956c (svn r1352) -Fix: [1093200] Drive side in new games. Setting the driver side is possible during the game until someone buys road vehicles. In networked games only the server can change it. 20 years ago
truelight 3b7d2a8b67 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
how the system works. All useful windows are already made resizable. Enjoy :)
-Fix: fixed some GUI-glitches and flaws along the way
20 years ago
bjarni 5da75918c0 (svn r1323) Adding autoreplace feature
This feature works much like autorenew, but it will get you a new engine type instead of a new one of the same type. Once 
ordered, it will automatically replace the engines while they visits a depot. The GUI for setting this up have been added on the 
vehicle overview windows
Note: autorenew is now autoreplace, but to the same engine type
Nice new features, that was added to make this possible
- windows can now have two independant vertical scrollbars
- CMD_SHOW_NO_ERROR have been added as a flag for DoCommandP. It will make it do the action instead of showing the red box with 
estimated costs even if shift is pressed
- fixed problem where enginetypes where not initialized when loading a game. It's now done in InitializeGame()
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 d32bfd8adb (svn r1307) -Fix/feature: rewrote the townname generation code. Code is much more
readable now. 'American' is replaces by 'Additional English' (Jango)
20 years ago
truelight c0eeb710c7 (svn r1283) -Add: AutoRenew is now a client-side patch instead of a game-side patch
Note: this is the first commit that breaks compatibility with 0.3.5!
-Fix: Bufferoverflow with autorenew_money. It is now a 32-bit integer.
20 years ago
dominik 1fa1a391dc (svn r1255) Renamed "postfix" to "suffix", for strings and variable names 20 years ago
darkvater cdcb96305f (svn r1242) -Fix: fix some morhpos warnings (tokai) 20 years ago
dominik 38b8b7848f (svn r1215) Feature: You can now make a custom currency by chosing "Custom..." 20 years ago
dominik a733a469b5 (svn r1088) Strings cleanup. Renamed some strings to reflect their content. 20 years ago
dominik 8322b4b18f (svn r1072) Fixed a few warnings that made trouble in VS .NET 2003 20 years ago
truelight 56779d8611 (svn r1062) -Fix: [Console] Compile warnigs in Get/SetPatchSettings 20 years ago
truelight 83bdec9b91 (svn r1059) -Fix: [Console] Renamed 'set port' to 'set server_port'
-Add: [Network] Add ip-bind ('set server_bind_ip <ip>' in console or use 
scripts/pre_dedicated.scr)
20 years ago
truelight f89cf61691 (svn r1055) -Add: [Console] Special for dedicated servers:
- You can change patch settings via 'set patch <patch_name> [<value>]'
20 years ago
dominik b747cd2fcd (svn r999) New icons for the network interface, newgrf gui and the tiny euro 20 years ago
Celestar 945ceb06fc (svn r979) Allow more realistically sized catchment areas 20 years ago
tron e34d0f683b (svn r946) Remove double patch option which crept in during merge 20 years ago
truelight d15e7e307e (svn r945) -Fix: [Network] Terraform callback went wrong in merge
-Fix: Some settings went wrong in merge
20 years ago
truelight d6a1f3e412 (svn r942) -Merged branch/network back into the trunk 20 years ago
tron ecf1c35849 (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
20 years ago
tron 265ac67183 (svn r901) Small step in the process to clean up the DPARAM mess:
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
20 years ago
tron d701668f50 (svn r853) -Feature: Implement improved vehicle loading algorithm
It's not FIFO loading, but does the right thing in the common case:
If a vehicle is empty and another vehicle is already loading the same cargo at this station then the vehicle waits.

This is an reworked version of [ 1072211 ] submitted by Hackykid, thanks!
20 years ago
tron acbd1801c7 (svn r815) Include strings.h only in the files which need it.
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
20 years ago
dominik 372340b731 (svn r801) - re-enabled background highlighting in Newgrf GUI
- minor Newgrf GUI fixes and adjustments
20 years ago
pasky bf587e9aac (svn r768) In the NewGRF manager, show GRF ids as 8-digit hex numbers (that's how they are supposed to look). 20 years ago