Commit Graph

417 Commits (3549d5be201e66efbb883d41bf631895fe7c4513)

Author SHA1 Message Date
Michael Lutz 5575cb9133 Remove: Remnants of PSP support.
No active target is that limited in concurrent file descriptors.
4 years ago
Patric Stout b7851e51ad Fix: set SP_WORKING_DIR earlier with '-c'
On Windows, relative folders don't work so well. So we need to
lookup the full path. This is best done in DetermineBasePaths()
and as a bonus that only sets SP_WORKING_DIR once.
4 years ago
Patric Stout da7c74ba7e Fix: change the working-dir searchpath when using '-c'
Basically, with '-c' you now create a sandbox. It will still use
your personal-dir and global-dir to find files you installed there,
but all new files are stored with a base folder identical to the
folder the configuration is in.

This is a bit of an old bug, that we many have tried to solve in
various of different ways. The code has grown sufficiently complex
that it is hard to see what consequences of actions are. This is
in my opinion the most harmless solution, while increasing the
usefulness of the '-c' flag.

In essence, the problem was that empty folders were always created
in the directory where the configuration was, but as that directory
wasn't added to any searchpath, files weren't stored there, unless
by accident it was a folder already on the searchpath. For example,
if you do './openttd -c local.cfg', it did work as expected. But
in the more generic variant, it did not.

With this patch, you can run './openttd -c /new/folder/local.cfg',
and it will create and prepare that folder to receive new files.

'content_download' is also stored in the directory the
configuration is in; this was already the case. Important to
note that there is only one search-path for 'content_download'.
In other words, when using '-c', it will not look in '~/.openttd'
inside the 'content_download' folder.
4 years ago
Patric Stout 4e12aac9c0 Codechange: to create or not to create a folder, that is the question
This was just weird. With XDG _personal_dir was created already,
but later on it was checked if it was different from config_dir,
and the creation was skipped. All this checking and validation
makes my head spin .. let's make it a bit more simple.
4 years ago
Jonathan G Rennison 5b78090a61 Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	src/saveload/town_sl.cpp
#	src/screenshot.h
#	src/script/api/ai/ai_date.hpp.sq
#	src/script/api/ai/ai_marine.hpp.sq
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_date.hpp.sq
#	src/script/api/game/game_marine.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/game/game_window.hpp.sq
#	src/script/api/script_window.hpp
#	src/script/api/template/template_window.hpp.sq
#	src/signal.cpp
#	src/statusbar_gui.cpp
#	src/toolbar_gui.cpp
#	src/viewport.cpp
#	src/viewport_func.h
4 years ago
Niels Martin Hansen 84efde8ee3 Change: Log when rejecting a TAR archive for extraction
Based on report in <https://www.tt-forums.net/viewtopic.php?f=31&t=87374>
4 years ago
TechGeekNZ cf8ea74733 Update: Merge branch 'jgrpp_master_cmake' into jgrpp_cmake 4 years ago
glx22 87a069c887
Fix #8230: Resolve ".." when opening files in .tar (#8231) 4 years ago
Jonathan G Rennison f8d6e781ba Merge branch 'master' into jgrpp
# Conflicts:
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj.filters
#	src/base_consist.h
#	src/company_base.h
#	src/newgrf_config.cpp
#	src/newgrf_config.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/station_sl.cpp
#	src/settings.cpp
#	src/signs_base.h
#	src/string.cpp
#	src/string_func.h
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_cmd.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/null_v.cpp
4 years ago
Michael Lutz c972a63c8c Codechange: Store info about the dedicated server log file in globals with automatic destruction to simplify control flow in openttd_main. 4 years ago
Jonathan G Rennison b96e7f78fb Merge branch 'master' into jgrpp 5 years ago
Charles Pigott 4bc78835e8 Fix #6399: Create parent directories if they don't already exist 5 years ago
Jonathan G Rennison 6ada7c3c7f Logging: Log full file names of opened GRFs 5 years ago
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison 13138bd97b Bump FIO buffer size 5 years ago
Jonathan G Rennison 6562937899 Merge branch 'master' into jgrpp-nrt
# Conflicts:
#	src/console_cmds.cpp
#	src/script/api/script_order.cpp
#	src/station_cmd.cpp
#	src/statusbar_gui.cpp
#	src/town_gui.cpp
5 years ago
Alberth 5981ed248a Codechange: Remove unused FioTarFirstDir and FioTarAddLink functions 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 6 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 6 years ago
Jonathan G Rennison ba34ec7ade Merge branch 'master' into jgrpp
Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
6 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.
6 years ago
Patric Stout 72c5f2b3ee Remove: DOS support
In 10 years there was no active development on DOS. Although it
turned out to still work, the FPS was very bad. There is little
interest in the current community to look into this.

Further more, we like to switch to c++11 functions for threads,
which are not implemented by DJGPP, the only current compiler
for DOS.

Additionally, DOS is the only platform which does not support
networking. It is the reason we have tons of #ifdefs to support
disabling networking.

By removing DOS support, we can both use c++11 functions for threads,
and remove all the code related to disabling network. Sadly, this
means we have to see DOS go.

Of course, if you feel up for the task, simply revert this commit,
and implement stub c++11 functions for threads and stub functions
for networking. We are more than happy to accept such Pull Request.
6 years ago
Jonathan G Rennison 5e6d283463 Merge branch 'master' into jgrpp
Remove the viewport sign cache as this is now superseded by the kd tree
implementation

# Conflicts:
#	src/crashlog.cpp
#	src/lang/english.txt
#	src/misc.cpp
#	src/pathfinder/follow_track.hpp
#	src/pbs.cpp
#	src/rail_cmd.cpp
#	src/saveload/vehicle_sl.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/ship_cmd.cpp
#	src/station.cpp
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/settings.ini
#	src/thread/thread_morphos.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/viewport.cpp
#	src/waypoint.cpp
6 years ago
Patric Stout 45fbaa64c2 Codechange: check if a define is set directly, instead of indirectly
config.lib happens to set GLOBAL_DATA_DIR in case it is not DOS
and not OS2, but this kind of deduction is annoying to maintain.
It is better to just check if the define you want to use is set,
and leave it to config.lib to set it or not depending on the OS.
6 years ago
Patric Stout 1f57150d80 Codechange: "basedir.h" is a system include, not a local 6 years ago
Patric Stout 7784d77713 Remove: MorphOS / AmigaOS support
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.

If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
6 years ago
Jonathan G Rennison 4f1d54564e Merge branch 'master' into jgrpp
# Conflicts:
#	src/debug.cpp
6 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
Jonathan G Rennison e735c1a51a Merge branch 'master' into jgrpp
# Conflicts:
#	src/aircraft_cmd.cpp
#	src/autoreplace_cmd.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/script_station.hpp
#	src/track_func.h
#	src/vehicle_base.h
6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Jonathan G Rennison 8e9d68048a Merge branch 'master' into jgrpp
# Conflicts:
#	src/string.cpp
6 years ago
Niels Martin Hansen 458e441a4c Codechange: Make FioCreateDirectory public 6 years ago
Jonathan G Rennison ad1c402ad8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/debug.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/settings_type.h
#	src/town_cmd.cpp
#	src/window.cpp
7 years ago
Patric Stout aef69443e7 Remove: WinCE support 7 years ago
Jonathan G Rennison 4a0d949d83 Merge branch 'master' into jgrpp 7 years ago
frosch 2e20751c5f (svn r27954) -Cleanup [FS#6644]: Remove unused function (M3Henry) 7 years ago
frosch 6b11ab49d2 (svn r27954) -Cleanup [FS#6644]: Remove unused function (M3Henry) 7 years ago
Jonathan G Rennison f34833f111 Merge branch 'improved_breakdowns' into jgrpp
# Conflicts:
#	src/vehiclelist.cpp
7 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch a47fb85cd8 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
Jonathan G Rennison 82ec6d93dc Merge branch 'master' into jgrpp 7 years ago
frosch 4c50ecd958 (svn r27886) -Fix [FS#6575-ish]: Do not modify argv[0]. 7 years ago
frosch 2f7ac7c41f (svn r27886) -Fix [FS#6575-ish]: Do not modify argv[0]. 7 years ago
Jonathan G Rennison f89e8b76d6 Fix increased number of NewGRFs support.
Improve error handling if multiplayer limit is exceeded.
8 years ago
rubidium 9edf5eba4e (svn r26514) -Fix: rewrite link-in-tar handling so it doesn't use strncpy and it doesn't overrun its buffers anymore 11 years ago
rubidium 5ef2042819 (svn r26514) -Fix: rewrite link-in-tar handling so it doesn't use strncpy and it doesn't overrun its buffers anymore 11 years ago
rubidium 034735a54c (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 11 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 11 years ago
rubidium 699779324e (svn r26499) -Codechange: replace strndup with stredup 11 years ago
rubidium 8960939b22 (svn r26499) -Codechange: replace strndup with stredup 11 years ago
rubidium 5c7c2445d8 (svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay 11 years ago
rubidium 21f991e235 (svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay 11 years ago
frosch 24c7134bff (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 11 years ago
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 11 years ago
rubidium 2be4215f43 (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 11 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 11 years ago
rubidium bb5984a02b (svn r26114) -Fix-ish: do our best to not get bit by getenv being unsafe as hell 11 years ago
rubidium d2ffba07bb (svn r26114) -Fix-ish: do our best to not get bit by getenv being unsafe as hell 11 years ago
rubidium d9a3177862 (svn r26089) -Fix: a number of minor memory leaks 11 years ago
rubidium 0ac9ed0b6b (svn r26089) -Fix: a number of minor memory leaks 11 years ago
rubidium 86621f0ff4 (svn r26087) -Fix: file descriptor leak when finding a corrupt tar 11 years ago
rubidium 3eecd246eb (svn r26087) -Fix: file descriptor leak when finding a corrupt tar 11 years ago
rubidium e591a65ade (svn r26082) -Fix [FS#5816] (r26077): tar files with more than one file in the root directory would not be read properly (zydeco) 11 years ago
rubidium b75e60124d (svn r26082) -Fix [FS#5816] (r26077): tar files with more than one file in the root directory would not be read properly (zydeco) 11 years ago
rubidium 954a141ca8 (svn r26077) -Codechange: handle strings like strings when scanning a tar instead of merely blobs of memory 11 years ago
rubidium 5e2d22da79 (svn r26077) -Codechange: handle strings like strings when scanning a tar instead of merely blobs of memory 11 years ago
rubidium 428faaf4ad (svn r26076) -Codechange: upgrade some C-style named structs to C++-style named structs 11 years ago
rubidium 5049e938f5 (svn r26076) -Codechange: upgrade some C-style named structs to C++-style named structs 11 years ago
rubidium e4b208c069 (svn r26061) -Fix: negative result of ftell wasn't handled correctly in some cases 11 years ago
rubidium 78a316d349 (svn r26061) -Fix: negative result of ftell wasn't handled correctly in some cases 11 years ago
rubidium a6fae2c608 (svn r26058) -Fix: handle the return value of a number of functions better 11 years ago
rubidium 0e9c992104 (svn r26058) -Fix: handle the return value of a number of functions better 11 years ago
rubidium 446613e868 (svn r26008) -Fix (r25975): uninitialised warning 11 years ago
rubidium b934e528d9 (svn r26008) -Fix (r25975): uninitialised warning 11 years ago
rubidium a77aa68f16 (svn r25975) -Feature [FS#5385]: XDG base directory support 11 years ago
rubidium ee137a5ced (svn r25975) -Feature [FS#5385]: XDG base directory support 11 years ago
rubidium c4ab18c029 (svn r25974) -Codechange: make the _personal_dir global const, since once it's set it shouldn't be changed anyhow 11 years ago
rubidium def597fe31 (svn r25974) -Codechange: make the _personal_dir global const, since once it's set it shouldn't be changed anyhow 11 years ago
frosch b172ed3578 (svn r25291) -Add: WindowDesc ability to load and store information in a config file. 12 years ago
frosch 23ba42b66c (svn r25291) -Add: WindowDesc ability to load and store information in a config file. 12 years ago
planetmaker f00d9976f9 (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
rubidium b89df11932 (svn r24877) -Fix: some whitespace "errors" 12 years ago
rubidium d5d96ba683 (svn r24877) -Fix: some whitespace "errors" 12 years ago
frosch 50abcf3edc (svn r24804) -Add: Separate subdirectory for screenshots. 12 years ago
frosch edd9c0553a (svn r24804) -Add: Separate subdirectory for screenshots. 12 years ago
rubidium 6bc634efba (svn r23983) -Fix [FS#5083]: tarred heightmaps wouldn't be found 13 years ago
rubidium 27cf8de733 (svn r23983) -Fix [FS#5083]: tarred heightmaps wouldn't be found 13 years ago
truebrain ff7797c421 (svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library) 13 years ago
truebrain 963802e9a7 (svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library) 13 years ago
truebrain 14325e2391 (svn r23605) -Add: GAME_DIR and CONTENT_TYPE_GAME, and read gamescript from that directory 13 years ago
truebrain b4f832f29f (svn r23605) -Add: GAME_DIR and CONTENT_TYPE_GAME, and read gamescript from that directory 13 years ago
rubidium ffccec6d84 (svn r23234) -Fix [FS#4840]: crash when after downloading content 13 years ago
rubidium a3a2fdcfc2 (svn r23234) -Fix [FS#4840]: crash when after downloading content 13 years ago
frosch 1ab0108bb9 (svn r23228) -Fix (r23227): FileScanner::Scan() still did not scan all required directories for basesets. 13 years ago
frosch 1f6c9c6457 (svn r23228) -Fix (r23227): FileScanner::Scan() still did not scan all required directories for basesets. 13 years ago
frosch 88980e11a3 (svn r23227) -Fix (r23219): The FileScanner should also consider the old directories. 13 years ago
frosch 7b86e3e109 (svn r23227) -Fix (r23219): The FileScanner should also consider the old directories. 13 years ago
frosch 4eb0160cf6 (svn r23226) -Fix (r23219): If you find a file, also use it. 13 years ago