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
This commit is contained in:
Jonathan G Rennison
2019-03-27 18:12:04 +00:00
422 changed files with 4697 additions and 6619 deletions

View File

@@ -69,15 +69,15 @@ static const NIVariable _niv_vehicles[] = {
};
class NIHVehicle : public NIHelper {
bool IsInspectable(uint index) const { return true; }
bool ShowExtraInfoOnly(uint index) const { return Vehicle::Get(index)->GetGRF() == NULL; }
uint GetParent(uint index) const { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
const void *GetInstance(uint index)const { return Vehicle::Get(index); }
const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); }
bool IsInspectable(uint index) const override { return true; }
bool ShowExtraInfoOnly(uint index) const override { return Vehicle::Get(index)->GetGRF() == NULL; }
uint GetParent(uint index) const override { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
const void *GetInstance(uint index)const override { return Vehicle::Get(index); }
const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Vehicle *v = Vehicle::Get(index);
VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
@@ -146,14 +146,14 @@ static const NIVariable _niv_stations[] = {
};
class NIHStation : public NIHelper {
bool IsInspectable(uint index) const { return GetStationSpec(index) != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return GetStationSpec(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return GetStationSpec(index) != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return GetStationSpec(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index, INVALID_RAILTYPE);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -211,14 +211,14 @@ static const NIVariable _niv_house[] = {
};
class NIHHouse : public NIHelper {
bool IsInspectable(uint index) const { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -261,14 +261,14 @@ static const NIVariable _niv_industrytiles[] = {
};
class NIHIndustryTile : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -360,23 +360,23 @@ static const NIVariable _niv_industries[] = {
};
class NIHIndustry : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const { return Industry::Get(index); }
const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const override { return Industry::Get(index); }
const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Industry *i = Industry::Get(index);
IndustriesResolverObject ro(i->location.tile, i, i->type);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
const Industry *i = (const Industry *)this->GetInstance(index);
if (i->psa == NULL) return NULL;
@@ -425,14 +425,14 @@ static const NIVariable _niv_objects[] = {
};
class NIHObject : public NIHelper {
bool IsInspectable(uint index) const { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return Object::GetByTile(index); }
const void *GetSpec(uint index) const { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -459,14 +459,14 @@ static const NIVariable _niv_railtypes[] = {
};
class NIHRailType : public NIHelper {
bool IsInspectable(uint index) const { return true; }
uint GetParent(uint index) const { return UINT32_MAX; }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return 0; }
bool IsInspectable(uint index) const override { return true; }
uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const override { return 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
@@ -495,14 +495,14 @@ static const NICallback _nic_airporttiles[] = {
};
class NIHAirportTile : public NIHelper {
bool IsInspectable(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -533,22 +533,22 @@ static const NIVariable _niv_towns[] = {
};
class NIHTown : public NIHelper {
bool IsInspectable(uint index) const { return Town::IsValidID(index); }
uint GetParent(uint index) const { return UINT32_MAX; }
const void *GetInstance(uint index)const { return Town::Get(index); }
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const { return 0; }
bool PSAWithParameter() const { return true; }
uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const override { return Town::Get(index); }
const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const override { return 0; }
bool PSAWithParameter() const override { return true; }
uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
TownResolverObject ro(NULL, Town::Get(index), true);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
Town *t = Town::Get(index);