Commit Graph

271 Commits (jgrpp)

Author SHA1 Message Date
Rubidium d31a535c87 Cleanup: remove some unneeded c_str() calls 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
glx22 ffd30cf91b Codechange: Replace FOR_ALL_TARS with range-based for loops
(cherry picked from commit 34215f7faa)
3 years ago
glx22 34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 3 years ago
Jonathan G Rennison 5e14b54a0c Merge branch 'master' into jgrpp 3 years ago
Patric Stout 9bfa7198fd
Change: Heading for 1.12 now (#8862) 3 years ago
Jonathan G Rennison 6c3e5642f8 Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/crashlog.cpp
#	src/fileio.cpp
#	src/fileio_func.h
#	src/fios_gui.cpp
#	src/ini_load.cpp
#	src/ini_type.h
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/network/network_client.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/os/windows/win32.cpp
#	src/road_cmd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/settings.ini
#	src/tree_cmd.cpp
#	src/tree_gui.cpp
#	src/vehicle_base.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/cocoa/event.mm
#	src/video/cocoa/wnd_quartz.mm
#	src/viewport.cpp
#	src/widgets/tree_widget.h
3 years ago
Jonathan G Rennison 39df1c49a1 Merge branch 'master' into jgrpp
# Conflicts:
#	src/fileio.cpp
#	src/group_gui.cpp
#	src/industry.h
#	src/lang/korean.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/linkgraphjob.h
#	src/linkgraph/linkgraphschedule.cpp
#	src/linkgraph/linkgraphschedule.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/town_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
3 years ago
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 3 years ago
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 3 years ago
Patric Stout f66baa444f
Codechange: use C++11 constructs for for-each loops (#8432) 3 years ago
Patric Stout 4319d31036 Fix #6468: don't store version of AIs-started-via-console in name
You can do: "startai myai.3", which starts version 3 of "myai".
This is very useful for testing save/load code between different
versions of your AI.

However, when using this syntax, the AI got saved as "myai.3" as
name of the AI, instead of "myai". This caused several problems,
like indicating to the user the AI could not be found, but still
load the AI. But in all cases, the AI never got the chance to
load the saved data, making the whole reason this exists pointless.

By splitting the name and version already in the console command,
the code becomes simpler and AIs started this way now follow the
normal flow after initialization.
3 years ago
Jonathan G Rennison bbbda0739b Add third DoCommand parameter p3 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
glx 4079c47b6c Change: rewrote squirrel_export in CMake 4 years ago
TechGeekNZ cf8ea74733 Update: Merge branch 'jgrpp_master_cmake' into jgrpp_cmake 4 years ago
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
4 years ago
Jonathan G Rennison 677940cfc6 Merge branch 'master' into jgrpp 4 years ago
Michael Lutz 1c0ba07c3c Add: [Script] Native priority queue; useful e.g. for pathfinders. 4 years ago
Jonathan G Rennison 14e7d43c62 Merge branch 'master' into jgrpp 4 years ago
Niels Martin Hansen 800ade7702
Feature: Push-buttons on storybook pages (#7896)
Allow more direct player-initiated interaction for Game Scripts, by letting the GS put push-buttons on storybook pages. These buttons can either trigger an immediate event, or require the player to first select a tile on the map, or a vehicle.

Additionally this reworks how the storybook pages are layouted and rendered, to allow for slightly more complex layouts, and maybe speeding drawing up a bit.
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 9b6f5e3bb8 Codechange: Store GS lang texts in std::strings. 4 years ago
Jonathan G Rennison b96e7f78fb Merge branch 'master' into jgrpp 4 years ago
glx 47790b09a4 Codechange: Simplify CheckAPIVersion() 4 years ago
Jonathan G Rennison babe98cdb1 Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/network_server.h
#	src/pathfinder/yapf/yapf_road.cpp
#	src/viewport.cpp
4 years ago
glx 2f264f2c92 Change: Heading for 1.11 now 4 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 158f063a38 Avoid redundant re-scans for AI and game script files 5 years ago
glx22 b3fd787959 Fix #7188: check the validity of command callback for scripts (#7701) 5 years ago
Michael Lutz b73622a01c Fix #7600: Don't read uninitialised memory when parsing GS language files. 5 years ago
peter1138 3293f08e0b Add: New RoadType API functions. 5 years ago
glx22 76788a1eb3
Fix 2bb80d2: really increase the maximum number of GameScript texts to 64k (#7555) 5 years ago
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Michael Lutz d3e113eb5f Codechange: Use std::vector instead of AutoDeleteSmallVector in GS text handling. 5 years ago
Michael Lutz d95c7083ea Fix: Don't crash if reading a GS string file from disk produces an error.
The raw_strings vector may not include NULLs as no consumer can deal with it.
5 years ago
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 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 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 a67ee02529
Change: Heading for 1.10 now (#7319) 5 years ago
Niels Martin Hansen 7e1e2756d4 Add: Show performance of AI and GS in framerate window 5 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
gdinit 34b63930f5 Fix: Typo in game.hpp
Just a typo fix in a code comment line.
6 years ago
Pavel Stupnikov 6ff81b908e Feature #6459: API for querying network clients from GS (#6736) 6 years ago
frosch 09d4735679 (svn r27993) -Change: Heading for 1.9 now 6 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch afcef7faa6 (svn r27780) -Update: Numbers 7 years ago
frosch a56e2bccd0 (svn r27756) -Codechange: Add StringTab enum 7 years ago
frosch 0c7c0ada78 (svn r27518) -Update: Numbers 8 years ago
frosch 6477356dd2 (svn r27192) -Change: heading for 1.6 now 9 years ago
fonsinchen 2128f1e929 (svn r26893) -Feature: ScriptStationList_Cargo for sorting cargo by from and via 10 years ago
rubidium 33ab505567 (svn r26774) -Cleanup [Squirrel]: remove _SC macro 10 years ago
rubidium 7c4e9dd71d (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD 10 years ago
rubidium 5e90054f20 (svn r26511) -Codechange: use strecpy in game_text 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium e61fe21237 (svn r26506) -Codechange: replace most of vsnprintf with vseprintf 10 years ago
frosch fad2d3c709 (svn r26505) -Fix (r23634, r26493): Incorrect usage of strecpy/strecat 10 years ago
frosch d71cc434e4 (svn r26504) -Fix (r26499): Obiwan and his gang. 10 years ago
rubidium 8960939b22 (svn r26499) -Codechange: replace strndup with stredup 10 years ago
rubidium a5274117bd (svn r26487) -Codechange: use lastof instead of lengthof/sizeof for script names 10 years ago
rubidium 5b82822c12 (svn r26486) -Codechange: replace a number of snprintfs with seprintf 10 years ago
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 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
frosch db96a109ff (svn r26406) -Change: heading for 1.5 now 10 years ago
zuu 57a88c9de2 (svn r26305) -Add: [nogo] ScriptStoryPageElementList() - a list of all story page elements for a given page 10 years ago
zuu 5165be2698 (svn r26303) -Add: [nogo] ScriptStoryPageList() - a list of all story pages 10 years ago
rubidium c54a70cce8 (svn r26090) -Fix: leaking of file descriptor when reading strings for game texts 11 years ago
frosch bf0f5345ea (svn r25818) -Fix [FS#5750]: [GS] Language file scanner considered filenames starting with '.' as valid translations, resulting in languages with empty name, which causes trouble. 11 years ago
rubidium 81ce9ad189 (svn r25592) -Fix [FS#5644]: Changing the script difficulty level in-game would also change the settings using the default even though they were not allowed to change in-game 11 years ago
zuu 9aa1bf0264 (svn r25342) -Add: StoryPage data structures and GS API 11 years ago
zuu a23b84fdfc (svn r25332) -Fix (25331): Committed too much 11 years ago
zuu 059eee93fc (svn r25331) -Fix (r25263): Update ScriptWindow with link graph widgets 11 years ago
frosch 5046922f61 (svn r25117) -Fix [FS#5511]: Silence warning. 11 years ago
frosch 9eab26a1a1 (svn r25114) -Fix [FS#5509]: GS lang files did not work, when inside a tar. 11 years ago
rubidium 7ff6598cd2 (svn r25001) -Change: heading for 1.4 now 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
zuu f3f4c562ff (svn r24537) -Feature: Scripts can be suspended even if the game is still progressing, thus break-on-log now works also for Game Scripts. 12 years ago
frosch 16760cff8b (svn r24516) -Add: [GS] Support ##plural pragma in GS lang files. 12 years ago
frosch 2ec6136113 (svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes. 12 years ago
yexo fe31aa28c4 (svn r24487) -Codechange [FS#5236]: make several DoesContentExist return the path instead of a boolean (LordAro) 12 years ago
yexo 54aa43c81b (svn r24468) -Add [FS#5219]: API compatibility scripts for Goal Scripts (Hirundo) 12 years ago
alberth eb56e5c0b1 (svn r24406) -Feature: Allow game scripts to monitor cargo pickups and deliveries done by companies. 12 years ago
frosch 95d3d6fdef (svn r24291) -Add: [Script] ScriptEventRoadReconstruction. 12 years ago
frosch 8dc553a039 (svn r24290) -Add: [Script] ScriptEventExclusiveTransportRights. 12 years ago
frosch 66a37e28a6 (svn r24289) -Add: [Script] Base class for script events involving a company and a town. 12 years ago
frosch d7d89bc806 (svn r24108) -Fix [FS#5142]: When starting GS or AI, always use the settings of the game, not the new-game settings. 12 years ago
rubidium a5cb454e94 (svn r23969) -Codechange: trunk heads to 1.3 now 12 years ago
rubidium 60678d9757 (svn r23837) -Feature [FS#4994]: [NoGo] Allow querying orders of vehicles 13 years ago
truebrain 3c355da531 (svn r23747) -Fix (r23746): forgot one more case 13 years ago
truebrain 251687f795 (svn r23746) -Fix: also set 'info' to NULL if 'instance' dies (for both AI and GS); avoids invalid memory reads 13 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 13 years ago
truebrain 34d90da509 (svn r23731) -Add: add GSGoal::Question(), to ask a question to a(ll) company(ies). It can contain random text, and at most 3 buttons from a collection of 17 13 years ago
rubidium d2f776ef3e (svn r23720) -Fix/Feature [FS#4935]: show the script debug window also when the game script crashes 13 years ago
rubidium 37b136576d (svn r23718) -Fix [FS#4936]: rescanai caused crash when the AI settings of an AI was opened 13 years ago
truebrain b0ac529a6f (svn r23635) -Add: introduce GSText, to allow translating GameScript text, even over network 13 years ago
truebrain 2ae87e7213 (svn r23634) -Add: support language files for GameScript (Rubidium) 13 years ago
truebrain cc3f42794d (svn r23632) -Add: GSCompanyMode, to change company in GameScripts 13 years ago
truebrain 403cd3acdb (svn r23631) -Add: ScriptWindow, to manipulate windows on the client (GameScript only) 13 years ago
truebrain 3ada3b9cc5 (svn r23630) -Add: a Goal GUI to show your current goals 13 years ago
truebrain e0ffe4faf2 (svn r23627) -Add: ScriptNews::Create, to create custom news messages (GameScript only) 13 years ago
truebrain 894216083d (svn r23625) -Add: ScriptViewport::ScrollTo, for SinglePlayer only (GameScript only) 13 years ago
truebrain 3a535690d4 (svn r23623) -Add: allow bi-directional communication with the AdminPort and GameScript 13 years ago
truebrain 77b7366c29 (svn r23622) -Add: a set of events to trigger in a GameScript 13 years ago
truebrain e7cd301d3c (svn r23621) -Add: allow manipulation of signs via GameScripts 13 years ago
truebrain 55de5d336c (svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only) 13 years ago
truebrain 9359c6fc47 (svn r23615) -Add: more API functions exposed to NoGo (part 2) 13 years ago
truebrain 436cf09923 (svn r23614) -Add: more API functions exposed to NoGo (part 1) 13 years ago
truebrain 1616961ea2 (svn r23613) -Add: allow IsDeveloperOnly in info.nut, to indicate if you can select this GS via the GUI (optional, defaults to false) 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 f239a61406 (svn r23609) -Add: save/load all GameScript related material 13 years ago
truebrain 5718c2e2e3 (svn r23607) -Add: wire GameScript in all the GUIs 13 years ago
truebrain c99950c215 (svn r23606) -Add: GameScanner, to auto-detect game scripts, and wire it in the console 13 years ago
truebrain 12aa5b6a58 (svn r23604) -Add: initial support for GameScripts 13 years ago