summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
AgeCommit message (Collapse)Author
2021-07-17Feature: Persistant rotation of numbered auto/netsave after restart (#9397)Loïc Guilloux
It was always starting from 0 on openttd restart. Now the most recent auto/netsave number will be used as a base to generate the next filename.
2021-07-16Fix 433f74e: GetString() requires a language packglx22
2021-07-09Add #9188: netsave now keeps multiple version around, similar to autosave ↵Stephan
(#9395)
2021-06-13Codechange: convert printf DEBUG statements to fmt Debug statementsrubidium42
2021-06-13Codechange: add std::string accepting SetDParamStr to ErrorMessageDatarubidium42
2021-06-10Add: '-X' option to ignore global folders in the search path (#9341)Patric Stout
This is extreme useful for automated testing. Without this, OpenTTD will always look in your personal-dir (like ~/.local/share/openttd or %USER%\Documents\OpenTTD). For most users this is exactly what we want, that there is a shared place for all their files. However, for automated testing this is rather annoying, as your local development files influence the automated test. As such, '-X' counters this, and only gives the local folders. This is especially useful in combination with '-x' and '-c'.
2021-05-29Codechange: Rename window related DeleteXXX to match new behaviourglx22
2021-05-15Change: Use gender-neutral pronounsrubidium42
2021-05-14Codechange: [Network] Pass passwords as std::string to the network coderubidium42
2021-05-13Codechange: move passwords in settings to std::stringrubidium42
2021-05-13Codechange: Replace TILE_AREA_LOOP with range-based for loopsglx22
2021-05-12Change: reworked the debug levels for network facility (#9251)Patric Stout
It now follows very simple rules: 0 - Fatal, user should know about this 1 - Error, but we are recovering 2 - Warning, wrong but okay if you don't know 3 - Info, information you might care about 4 - 5 - Debug #1 - High level debug messages 6 - Debug #2 - Low level debug messages 7 - Trace information
2021-05-08Cleanup: remove the old FIO slot functionsRubidium
2021-05-08Change: Use gender-neutral pronouns in console command messages (and ↵William Davis
comments) (#9203)
2021-05-06Codechange: [Network] Move connection string parsing away from C-stringsrubidium42
2021-05-05Change: [Network] Update server's NetworkServerGameInfo only when neededrubidium42
Split the updating in a "static" version that only needs to be called when a new map is loaded or some settings are changed, and a "dynamic" version that updates everything that changes regularly such as the current game date or the number of spectators.
2021-05-01Fix #6598: Prevent invalid memory accesses when abandoning a join from ↵rubidium42
within a network game One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list. Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
2021-04-29Change: [Network] Encapsulate logic about the connection string to the ↵rubidium42
network code (#23)
2021-04-29Codechange: use NetworkAddress instead of two host/port variables where possiblePatric Stout
This also means we no longer need last_host/last_port, but can just use a single last_joined setting.
2021-04-27Codechange: [Network] Do not leak os_abstraction.h via network_funcrubidium42
2021-04-20Codechange: split ParseConnectionString into two functionsPatric Stout
One also looks for a company, the other doesn't. There were more uses of the latter than the first, leaving very weird code all over the place.
2021-04-20Remove: "map_name" from server announcements / listingPatric Stout
The idea back in the days was nice, but it never resulted in anything useful. Most servers either read "(loaded game)" or "Random Map", neither being useful. It was meant for heightmaps, so you could find a server that was using a specific one .. but there are many things wrong with that idea. Mostly, servers tend to save and load savegames from time to time, after which the original heightmap used was lost. All in all, removing map_name all together is just better.
2021-04-12Fix #8874: show a warning when a NewGRF scan is requested multiple times ↵rubidium42
from the console (#9022)
2021-04-11Fix #9008: Validate starting year given on the command line. (#9014)rubidium42
An invalid starting year causes all sorts of weird behaviour and crashes in map generation. Now just set the appropriate setting via IConsoleSetSetting so the validation and, if needed, clamping is performed on the starting year value.
2021-03-10Fix: abort GRFFileScanner on exiting the game as soon as possiblePatric Stout
This prevents the window from "freezing" when you close it during the scanning of NewGRFs, as it first would continue the action.
2021-03-10Fix: don't update framerates when a modal window is openPatric Stout
Otherwise the numbers are all over the place when a modal window just closed.
2021-03-10Add: make modal windows update more smoothPatric Stout
Basically, modal windows had their own thread-locking for what drawing was possible. This is a bit nonsense now we have a game-thread. And it makes much more sense to do things like NewGRFScan and GenerateWorld in the game-thread, and not in a thread next to the game-thread. This commit changes that: it removes the threads for NewGRFScan and GenerateWorld, and just runs the code in the game-thread. On regular intervals it allows the draw-thread to do a tick, which gives a much smoother look and feel. It does slow down NewGRFScan and GenerateWorld ever so slightly as it spends more time on drawing. But the slowdown is not measureable on my machines (with 700+ NewGRFs / 4kx4k map and a Debug build). Running without a game-thread means NewGRFScan and GenerateWorld are now blocking.
2021-03-09Codechange: only run InteractiveRandom() from the draw-thread (#8831)Patric Stout
Otherwise both the draw-thread and game-thread can do it both at the same time, which gives rather unwanted side-effects. Calling it from the draw-thread alone is sufficient, as we just want to create some unpredictable randomness for the player. The draw-thread is a lot more active (normally) than the game-thread, so it is the best place of the two to do this. Additionally, InteractiveRandom() mostly has to do with visuals that are client-side-only, so more related to drawing than to game.
2021-02-19Add: draw the screen at a steady pace, also during fast-forwardPatric Stout
During fast-forward, the game was drawing as fast as it could. This means that the fast-forward was limited also by how fast we could draw, something that people in general don't expect. To give an extreme case, if you are fully zoomed out on a busy map, fast-forward would be mostly limited because of the time it takes to draw the screen. By decoupling the draw-tick and game-tick, we can keep the pace of the draw-tick the same while speeding up the game-tick. To use the extreme case as example again, if you are fully zoomed out now, the screen only redraws 33.33 times per second, fast-forwarding or not. This means fast-forward is much more likely to go at the same speed, no matter what you are looking at.
2021-02-14Feature: Automatic UI and font zoom levels when supported by the OS.Michael Lutz
2021-01-22Change: Apply some consistency to singleplayer related commentsglx22
2021-01-14Feature: Choose a sensible window size on a fresh OTTD config file. (#8536)Michael Lutz
2021-01-11Change: change console command "restart" and add "reload"Patric Stout
The current "restart" command is now called "reload", as that is what it does. The old "restart" command is now called "restart", as that is what it did. As this has not been in any official release yet, this shouldn't harm any kitten.
2021-01-11Fix 8f3d1ec: "restart" did not always restart your current gamePatric Stout
In the sequence: - Load a game - Start a newgame (via console) - Restart a game (via console) Gave you the loaded game back, not the new game.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2020-12-27Codechange: Use std::string in file scanners.Michael Lutz
2020-12-27Codechange: Even more std::string usage in file IO.Michael Lutz
2020-12-27Codechange: Convert some more FIO functions to take std::string.Michael Lutz
2020-12-27Codechange: Stringify config file paths.Michael Lutz
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-27Codechange: Add support for verbose assertsJonathan G Rennison
2020-12-22Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)Jonathan G Rennison
Check if the job is still running two date fract ticks before it is due to join, and if so pause the game until its done. When loading a game, check if the game would block immediately due to a job which is scheduled to be joined within two date fract ticks, and if so pause the game until its done. This avoids the main thread being blocked on a thread join, which appears to the user as if the game is unresponsive, as the UI does not repaint and cannot be interacted with. Show if pause is due to link graph job in status bar, update network messages. This does not apply for network clients.
2020-12-15Add: support for emscripten (play-OpenTTD-in-the-browser)Patric Stout
Emscripten compiles to WASM, which can be loaded via HTML / JavaScript. This allows you to play OpenTTD inside a browser. Co-authored-by: milek7 <me@milek7.pl>
2020-12-13Fix 8bef06a2: don't use "extern" when you want to implement a global (#8373)Patric Stout
2020-12-13Add: save openttd.cfg immediately on changing a setting (#8358)Patric Stout
Formally it was only done on exit. This means that if it crashes changes in settings were not stored. This is often rather frustrating. Additionally, targets (like emscripten) where people are unlike to use "Exit Game", will never see their configuration stored. The drawback is that on every setting change there is some minor I/O of writing the ini file to disk again.
2020-12-08Fix: useless warning with -snull and no BaseSounds available (#8361)Patric Stout
If I explicitly tell the system I do not want sound, I still get presented a nice message I do not have any BaseSounds available on my system, and that I should download one to enjoy sound. Well, let me tell you, with "-snull" that is really really not going to help. So please, be quiet, and let me enjoy the game without "boooooo" and "DING DING DING". Thank you.
2020-09-24Feature: Improve restart commandBerbe
When the restart command is issued, a normal map is always spawned. This improvement takes into account the current state of _file_to_saveload to check if a savegame/scenario/heightmap was previously loaded, and loads the same resource again.
2020-05-21Codechange: Store info about the dedicated server log file in globals with ↵Michael Lutz
automatic destruction to simplify control flow in openttd_main.
2020-05-21Codechange: Use std::string in the driver and blitter selection code.Michael Lutz
2020-05-21Codechange: Store base set related texts in std::strings.Michael Lutz