mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r27607) [1.6] -Backport from trunk:
- Fix: Compilation and optimisation issues with GCC6 (r27606, r27605, r27595) - Fix: Compilation with --disable-network [FS#6481] (r27602) - Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo (r27600) - Fix: Company 0 could accept engine previews before they were offered (r27598)
This commit is contained in:
parent
4b508ccbe8
commit
c271eb89d8
|
@ -1380,7 +1380,7 @@ make_compiler_cflags() {
|
|||
flags="$flags -Wnon-virtual-dtor"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 43 ]; then
|
||||
if [ $cc_version -ge 43 ] && [ $cc_version -lt 60 ]; then
|
||||
# Use gnu++0x mode so static_assert() is available.
|
||||
# Don't use c++0x, it breaks mingw (with gcc 4.4.0).
|
||||
cxxflags="$cxxflags -std=gnu++0x"
|
||||
|
@ -1401,6 +1401,12 @@ make_compiler_cflags() {
|
|||
flags="$flags -Wno-free-nonheap-object"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 60 ]; then
|
||||
# -flifetime-dse=2 (default since GCC 6) doesn't play
|
||||
# well with our custom pool item allocator
|
||||
cxxflags="$cxxflags -flifetime-dse=1 -std=gnu++14"
|
||||
fi
|
||||
|
||||
if [ "$enable_lto" != "0" ]; then
|
||||
# GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}'
|
||||
has_lto=`$1 -dumpspecs | grep '\%{flto'`
|
||||
|
|
|
@ -798,7 +798,8 @@ SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx)
|
|||
switch(type) {
|
||||
case OT_TABLE:
|
||||
if(type(mt) == OT_TABLE) {
|
||||
if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle"); v->Pop();}
|
||||
if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle");
|
||||
v->Pop();}
|
||||
else if(type(mt)==OT_NULL) {
|
||||
_table(self)->SetDelegate(NULL); v->Pop(); }
|
||||
else return sq_aux_invalidtype(v,type);
|
||||
|
|
|
@ -85,6 +85,7 @@ Engine::Engine(VehicleType type, EngineID base)
|
|||
this->type = type;
|
||||
this->grf_prop.local_id = base;
|
||||
this->list_position = base;
|
||||
this->preview_company = INVALID_COMPANY;
|
||||
|
||||
/* Check if this base engine is within the original engine data range */
|
||||
if (base >= _engine_counts[type]) {
|
||||
|
@ -902,7 +903,7 @@ CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32
|
|||
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
{
|
||||
Engine *e = Engine::GetIfValid(p1);
|
||||
if (e == NULL || e->preview_company != _current_company) return CMD_ERROR;
|
||||
if (e == NULL || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company);
|
||||
|
||||
|
|
|
@ -204,8 +204,8 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver
|
|||
if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val;
|
||||
|
||||
switch (adjust->type) {
|
||||
case DSGA_TYPE_DIV: value /= (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_MOD: value %= (U)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_DIV: value = (S)value / (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_MOD: value = (S)value % (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_NONE: break;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
#include "window_func.h"
|
||||
#include "debug.h"
|
||||
#include "game/game_text.hpp"
|
||||
#include "network/network_content_gui.h"
|
||||
#ifdef ENABLE_NETWORK
|
||||
# include "network/network_content_gui.h"
|
||||
#endif /* ENABLE_NETWORK */
|
||||
#include <stack>
|
||||
|
||||
#include "table/strings.h"
|
||||
|
@ -1815,7 +1817,9 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
|||
SortIndustryTypes();
|
||||
BuildIndustriesLegend();
|
||||
SortNetworkLanguages();
|
||||
#ifdef ENABLE_NETWORK
|
||||
BuildContentTypeStringList();
|
||||
#endif /* ENABLE_NETWORK */
|
||||
InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window.
|
||||
InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window.
|
||||
InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.
|
||||
|
|
Loading…
Reference in New Issue