Commit Graph

181 Commits (ed1457dca335a68b74603b619584eff9f7231ef4)

Author SHA1 Message Date
Niels Martin Hansen 0dce7bf85d Add: Commandline option to skip NewGRF scanning 2 years ago
rubidium42 09a7825d1e Remove: the concept of UnknownGRFs
These were filled with "<Unknown>" (before 8a2da49) and later their name would get filled via UDP requests to the server. These UDP packets do not exist anymore, so they will always remain "<Unknown>".
Remove that logic and just use the generic translated error GRF UNKNOWN string instead.
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
rubidium42 08308d808c Codechange: use separate pre and post callbacks for int settings 3 years ago
Rubidium 10e35ca8e4 Codechange: let NewGRF make use of SpriteFile instead of most of the FIO slot functions 3 years ago
Loïc Guilloux 605bd24674
Cleanup: Leftover static const variable from a3b356e (#9194) 3 years ago
rubidium42 84985c1223 Codechange: [Network] Do not leak os_abstraction.h via fios.h 3 years ago
Patric Stout 5426cb3baf Fix: abort GRFFileScanner on exiting the game as soon as possible
This prevents the window from "freezing" when you close it during
the scanning of NewGRFs, as it first would continue the action.
3 years ago
Patric Stout 970fedd78c Add: make modal windows update more smooth
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.
3 years ago
Patric Stout 8bf8c0f251 Fix d437445c: also use std::chrono for the GRFFileScanner modal window
For some reason I only converted one of the two modal windows we
have, and completely forgot the other.

While at it, synchronize the way those two modal windows work
in terms of "next_update".
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 3 years ago
Michael Lutz 9c2e47d03c Codechange: Use std::string for storing GRF error messages. 4 years ago
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 4 years ago
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
glx 9388fa2aa1 Codechange: use std::vector to sort _all_grfs linked list 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
5 years ago
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson aa7ca7fe64 Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + n 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
5 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
5 years ago
frosch 7b553d255e (svn r27732) -Change: Turn the message about 'missing baseset sprites' from a popup into a static message that only shows in non-release versions, just like the 'missing translations' message. 7 years ago
frosch a3b356e057 (svn r27725) -Codechange: Remove IsOpenTTDBaseGRF and test for GCF_CONFIG instead, which does the same in all use-cases. 8 years ago
frosch b363a639aa (svn r27723) -Codechange: Simplify tests by using GCF_SYSTEM. 8 years ago
frosch b6b02108f7 (svn r27721) -Fix: Testing GRFs for static-safety (when reloading the config) invalidated file slot 62, which may be in use by an active GRF. 8 years ago
frosch 31f046bd9b (svn r27670) -Add: [FS#6471] Assign descriptive names to (GNU pthread) threads. (JGR) 8 years ago
frosch 861b9bc85e (svn r27063) -Fix [FS#6172]: Some lists did not use natural string sorting. 10 years ago
rubidium 771dcf3b7b (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 10 years ago
alberth 3c9d3f5ecd (svn r26612) -Add: Method to copy newgrf parameters. 10 years ago
rubidium b476086c39 (svn r26538) -Codechange: remove double accounting of the drivers 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 1b9e32664f (svn r26070) -Fix: prevent extremely huge size for data (1+GiB) 11 years ago
rubidium 78a316d349 (svn r26061) -Fix: negative result of ftell wasn't handled correctly in some cases 11 years ago
rubidium 0e9c992104 (svn r26058) -Fix: handle the return value of a number of functions better 11 years ago
rubidium b3e93d6520 (svn r26057) -Fix: a number of possibly uninitialised variables 11 years ago
frosch c3ca57c42b (svn r24318) -Feature: Add dropdowns to NewGRF configurations, if all values have labels. 12 years ago
rubidium 58269b7ad2 (svn r23935) -Codechange: generalise GetTextfile 12 years ago
michi_cc 6db39410a1 (svn r23887) -Feature: [NewGRF] Support for container version 2. 13 years ago
frosch 92700c1262 (svn r23807) -Codechange: GRFError::num_params is not needed, remove it. 13 years ago
truebrain 561b25d031 (svn r23601) -Fix: fix the conflict in window number 13 years ago
yexo 7a7d9a7b6b (svn r23494) -Feature: [NewGRF] action14 node INFO->URL_ to add an url 13 years ago
frosch 0d901d599f (svn r23249) -Feature: Also allow viewing of the other two textfiles supplied by BaNaNaS tars, i.e. changelog and license. 13 years ago
frosch b725913f3b (svn r23248) -Codechange: Rename everything related to the NewGRF 'readme' to 'textfile', so it is more generic. 13 years ago