Commit 3a3c1b0d authored by Ansgar Burchardt's avatar Ansgar Burchardt

Imported Upstream version 102.0

parent b5ff82d1
......@@ -245,7 +245,9 @@ SOURCES += gui/help_frame.cc
SOURCES += gui/jump_frame.cc
SOURCES += gui/karte.cc
SOURCES += gui/kennfarbe.cc
SOURCES += gui/label_frame.cc
SOURCES += gui/label_info.cc
SOURCES += gui/labellist_frame_t.cc
SOURCES += gui/labellist_stats_t.cc
SOURCES += gui/line_management_gui.cc
SOURCES += gui/load_relief_frame.cc
SOURCES += gui/loadsave_frame.cc
......@@ -264,6 +266,7 @@ SOURCES += gui/schedule_list.cc
SOURCES += gui/sound_frame.cc
SOURCES += gui/sprachen.cc
SOURCES += gui/stadt_info.cc
SOURCES += gui/station_building_select.cc
SOURCES += gui/thing_info.cc
SOURCES += gui/welt.cc
SOURCES += gui/werkzeug_waehler.cc
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ public:
static bool laden_erfolgreich();
static const bruecke_besch_t *gib_besch(const char *name);
static const bruecke_besch_t *get_besch(const char *name);
// the main construction routine
static const char *baue( karte_t *welt, spieler_t *sp, koord pos, const bruecke_besch_t *besch);
......
This diff is collapsed.
......@@ -82,13 +82,13 @@ public:
* Gives a factory description for a factory type
* @author Hj.Malthaner
*/
static const fabrik_besch_t * gib_fabesch(const char *fabtype);
static const fabrik_besch_t * get_fabesch(const char *fabtype);
/**
* Gives the factory description table
* @author Hj.Malthaner
*/
static const stringhashtable_tpl<const fabrik_besch_t*>& gib_fabesch() { return table; }
static const stringhashtable_tpl<const fabrik_besch_t*>& get_fabesch() { return table; }
/* returns a random consumer
* @author prissi
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ public:
/* finds a station building, which enables pas/mail/goods for the AI
* for time==0 the timeline will be ignored
*/
static const haus_besch_t* gib_random_station(const haus_besch_t::utyp utype, const waytype_t wt, const uint16 time, const uint8 enables);
static const haus_besch_t* get_random_station(const haus_besch_t::utyp utype, const waytype_t wt, const uint16 time, const uint8 enables);
static const haus_tile_besch_t* find_tile(const char* name, int idx);
......@@ -76,21 +76,21 @@ public:
* eindeutig aufsteigend.
* @author V. Meyer
*/
static const haus_besch_t* gib_gewerbe(int level, uint16 time, climate cl);
static const haus_besch_t* get_gewerbe(int level, uint16 time, climate cl);
/**
* Industriegebude passend zum Level liefern. Zur Zeit sind die Eintrge
* eindeutig aufsteigend.
* @author V. Meyer
*/
static const haus_besch_t* gib_industrie(int level, uint16 time, climate cl);
static const haus_besch_t* get_industrie(int level, uint16 time, climate cl);
/**
* Wohnhaus passend zum Level liefern. Zur Zeit sind die Eintrge
* eindeutig aufsteigend.
* @author V. Meyer
*/
static const haus_besch_t* gib_wohnhaus(int level, uint16 time, climate cl);
static const haus_besch_t* get_wohnhaus(int level, uint16 time, climate cl);
/**
* Liefert per Zufall die Beschreibung eines Sehenswuerdigkeit,
......@@ -118,6 +118,12 @@ public:
*/
static void neue_karte();
/**
* True, if this is still valid ...
* @author V. Meyer
*/
static bool is_valid_denkmal(const haus_besch_t* besch) { return ungebaute_denkmaeler.is_contained(besch); }
/**
* Dem Hausbauer Bescheid sagen, dass ein bestimmtes Denkmal gebaut wurde.
* @author V. Meyer
......@@ -127,7 +133,7 @@ public:
/* called for an attraction or a townhall with a certain number of inhabitants (bev)
* bev==-1 will search for an attraction outside of cities.
*/
static const haus_besch_t* gib_special(int bev, haus_besch_t::utyp utype, uint16 time, bool ignore_retire, climate cl);
static const haus_besch_t* get_special(int bev, haus_besch_t::utyp utype, uint16 time, bool ignore_retire, climate cl);
/* use this to remove an arbitary building
* it will also take care of factories and foundations
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ public:
static void register_besch(tunnel_besch_t *besch);
static bool laden_erfolgreich();
static const tunnel_besch_t *gib_besch(const char *);
static const tunnel_besch_t *get_besch(const char *);
static const tunnel_besch_t *find_tunnel(const waytype_t wtyp, const uint32 min_speed,const uint16 time);
......
This diff is collapsed.
......@@ -40,8 +40,8 @@ public:
static vehikel_t* baue(koord3d k, spieler_t* sp, convoi_t* cnv, const vehikel_besch_t* vb );
static const vehikel_besch_t * gib_info(const char *name);
static slist_tpl<const vehikel_besch_t*>* gib_info(waytype_t typ);
static const vehikel_besch_t * get_info(const char *name);
static slist_tpl<const vehikel_besch_t*>* get_info(waytype_t typ);
/* extended sreach for vehicles for KI
* @author prissi
......
......@@ -18,7 +18,6 @@ stringhashtable_tpl<const ware_besch_t *> warenbauer_t::besch_names;
vector_tpl<ware_besch_t *> warenbauer_t::waren;
uint8 warenbauer_t::max_catg_index = 0;
uint8 warenbauer_t::max_special_catg_index = 0;
const ware_besch_t *warenbauer_t::passagiere = NULL;
const ware_besch_t *warenbauer_t::post = NULL;
......@@ -60,20 +59,20 @@ warenbauer_t::alles_geladen()
max_catg_index = 0;
// first assign special freight (which always needs an own category)
for( unsigned i=0; i<waren.get_count(); i++ ) {
if(waren[i]->gib_catg()==0) {
if(waren[i]->get_catg()==0) {
waren[i]->catg_index = max_catg_index++;
}
}
max_special_catg_index = max_catg_index-1;
// now assign all unused waren.
for( unsigned i=0; i<waren.get_count(); i++ ) {
// now search, if we already have a matching category
if(waren[i]->gib_catg()>0) {
waren[i]->catg_index = waren[i]->catg+max_special_catg_index;
if(waren[i]->gib_catg_index()>=max_catg_index) {
// find the higest catg used ...
max_catg_index = waren[i]->gib_catg_index()+1;
// mapping of waren_t::catg to catg_index, map[catg] = catg_index
uint8 map[255] = {0};
for( uint8 i=0; i<waren.get_count(); i++ ) {
const uint8 catg = waren[i]->get_catg();
if( catg > 0 ) {
if( map[catg] == 0 ) { // We didn't found this category yet -> just create new index.
map[catg] = max_catg_index++;
}
waren[i]->catg_index = map[catg];
}
}
......@@ -85,7 +84,7 @@ warenbauer_t::alles_geladen()
ware_t::index_to_besch[i] = NULL;
}
else {
assert(waren[i]->gib_index()==i);
assert(waren[i]->get_index()==i);
ware_t::index_to_besch[i] = waren[i];
if(waren[i]->color==255) {
waren[i]->color = 16+4+((i-2)*8)%207;
......@@ -113,7 +112,7 @@ bool warenbauer_t::register_besch(ware_besch_t *besch)
{
besch->value = besch->base_value;
::register_besch(spezial_objekte, besch);
besch_names.put(besch->gib_name(), besch);
besch_names.put(besch->get_name(), besch);
if(besch==passagiere) {
besch->ware_index = 0;
......@@ -123,7 +122,7 @@ bool warenbauer_t::register_besch(ware_besch_t *besch)
load_post = besch;
} else if(besch != nichts) {
besch->ware_index = waren.get_count()+3;
waren.push_back(besch);
waren.append(besch);
}
else {
load_nichts = besch;
......@@ -136,11 +135,11 @@ bool warenbauer_t::register_besch(ware_besch_t *besch)
const ware_besch_t *
warenbauer_t::gib_info(const char* name)
warenbauer_t::get_info(const char* name)
{
const ware_besch_t* t = besch_names.get(name);
if(t == NULL) {
dbg->fatal("warenbauer_t::gib_info()", "No info for good '%s' available", name);
dbg->fatal("warenbauer_t::get_info()", "No info for good '%s' available", name);
}
return t;
}
......@@ -148,26 +147,26 @@ warenbauer_t::gib_info(const char* name)
const ware_besch_t *
warenbauer_t::gib_info_catg(const uint8 catg)
warenbauer_t::get_info_catg(const uint8 catg)
{
if(catg>0) {
for(unsigned i=0; i<gib_waren_anzahl(); i++ ) {
for(unsigned i=0; i<get_waren_anzahl(); i++ ) {
if(waren[i]->catg==catg) {
return waren[i];
}
}
}
dbg->warning("warenbauer_t::gib_info()", "No info for good catg %d available, set to passengers", catg);
dbg->warning("warenbauer_t::get_info()", "No info for good catg %d available, set to passengers", catg);
return waren[0];
}
const ware_besch_t *
warenbauer_t::gib_info_catg_index(const uint8 catg_index)
warenbauer_t::get_info_catg_index(const uint8 catg_index)
{
for(unsigned i=0; i<gib_waren_anzahl(); i++ ) {
if(waren[i]->gib_catg_index()==catg_index) {
for(unsigned i=0; i<get_waren_anzahl(); i++ ) {
if(waren[i]->get_catg_index()==catg_index) {
return waren[i];
}
}
......@@ -182,7 +181,7 @@ void
warenbauer_t::set_multiplier(sint32 multiplier)
{
//DBG_MESSAGE("warenbauer_t::set_multiplier()","new factor %i",multiplier);
for(unsigned i=0; i<gib_waren_anzahl(); i++ ) {
for(unsigned i=0; i<get_waren_anzahl(); i++ ) {
sint32 long_base_value = waren[i]->base_value;
waren[i]->value = (uint16)((long_base_value*multiplier)/1000l);
}
......
......@@ -32,8 +32,6 @@ private:
// number of different good classes;
static uint8 max_catg_index;
// up to this are special freight indexes
static uint8 max_special_catg_index;
public:
enum { INDEX_PAS=0, INDEX_MAIL=1, INDEX_NONE=2 };
......@@ -45,7 +43,7 @@ public:
static bool alles_geladen();
static bool register_besch(ware_besch_t *besch);
static uint8 gib_max_catg_index() { return max_catg_index; }
static uint8 get_max_catg_index() { return max_catg_index; }
/**
* Sucht information zur ware 'name' und gibt die
......@@ -55,17 +53,17 @@ public:
* @param name der nicht-bersetzte Warenname
* @author Hj. Malthaner/V. Meyer
*/
static const ware_besch_t *gib_info(const char* name);
static const ware_besch_t *get_info(const char* name);
static const ware_besch_t *gib_info(uint16 idx) { return waren[idx]; }
static const ware_besch_t *get_info(uint16 idx) { return waren[idx]; }
static unsigned int gib_waren_anzahl() { return waren.get_count(); }
static uint16 get_waren_anzahl() { return waren.get_count(); }
// ware by catg
static const ware_besch_t *gib_info_catg(const uint8 catg);
static const ware_besch_t *get_info_catg(const uint8 catg);
// ware by catg_index
static const ware_besch_t *gib_info_catg_index(const uint8 catg_index);
static const ware_besch_t *get_info_catg_index(const uint8 catg_index);
/*
* allow to multiply all prices, 1000=1.0
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ public:
*/
static const weg_besch_t * weg_search(const waytype_t wtyp,const uint32 speed_limit,const uint16 time, const weg_t::system_type system_type);
static const weg_besch_t * gib_besch(const char *way_name,const uint16 time=0);
static const weg_besch_t * get_besch(const char *way_name,const uint16 time=0);
/**
* Fill menu with icons of given waytype
......@@ -64,6 +64,7 @@ public:
luft=air_wt,
narrowgauge=narrowgauge_wt,
leitung=powerline_wt,
river=127,
bautyp_mask=255,
bot_flag=0x100, // do not connect to other ways
elevated_flag=0x200, // elevated structure
......@@ -163,11 +164,12 @@ private:
void baue_strasse();
void baue_schiene();
void baue_leitung();
void baue_fluss();
public:
koord3d gib_route_bei(int i) const { return route[i]; }
koord3d get_route_bei(int i) const { return route[i]; }
int n, max_n;
sint32 n, max_n;
/**
* If a way is built on top of another way, should the type
......
......@@ -37,27 +37,27 @@ class baum_besch_t : public obj_besch_std_name_t {
uint8 number_of_seasons;
public:
uint16 gib_distribution_weight() const { return distribution_weight; }
uint16 get_distribution_weight() const { return distribution_weight; }
bool is_allowed_climate( climate cl ) const { return ((1<<cl)&allowed_climates)!=0; }
climate_bits get_allowed_climate_bits() const { return allowed_climates; }
image_id gib_bild_nr(int season, int i) const
image_id get_bild_nr(int season, int i) const
{
if(number_of_seasons==0) {
// comapility mode
i += season*5;
season = 0;
}
return static_cast<const bildliste2d_besch_t *>(gib_kind(2))->gib_bild(i, season)->gib_nummer();
return static_cast<const bildliste2d_besch_t *>(get_child(2))->get_bild(i, season)->get_nummer();
}
// old style trees and new style tree support ...
int gib_seasons() const
int get_seasons() const
{
if(number_of_seasons==0) {
return static_cast<const bildliste2d_besch_t *>(gib_kind(2))->gib_anzahl()/5;
return static_cast<const bildliste2d_besch_t *>(get_child(2))->get_anzahl()/5;
}
return number_of_seasons;
}
......
......@@ -31,8 +31,8 @@ bild_besch_t::copy_rotate(const sint16 angle) const
// now you should understand below arithmetics ...
const sint16 x_y = pic.w;
const PIXVAL *src=(const PIXVAL *)gib_daten();
PIXVAL *target = (PIXVAL *)target_besch->gib_daten();
const PIXVAL *src=(const PIXVAL *)get_daten();
PIXVAL *target = (PIXVAL *)target_besch->get_daten();
switch(angle) {
case 90:
......
......@@ -35,8 +35,8 @@ struct bild_t {
class bild_besch_t : public obj_besch_t {
public:
const bild_t* get_pic() const { return &pic; }
const void* gib_daten() const { return pic.data; }
image_id gib_nummer() const { return pic.bild_nr; }
const void* get_daten() const { return pic.data; }
image_id get_nummer() const { return pic.bild_nr; }
/* rotate_image_data - produces a (rotated) bild_besch
* only rotates by 90 degrees or multiples thereof, and assumes a square image
......
......@@ -28,13 +28,13 @@ class bildliste2d_besch_t : public obj_besch_t {
uint16 anzahl;
public:
bildliste2d_besch_t() : anzahl(0) {}
bildliste2d_besch_t() : anzahl(0) {}
uint16 gib_anzahl() const { return anzahl; }
uint16 get_anzahl() const { return anzahl; }
const bildliste_besch_t *gib_liste(uint16 i) const { return (i < anzahl) ? static_cast<const bildliste_besch_t *>(gib_kind(i)) : 0; }
const bildliste_besch_t *get_liste(uint16 i) const { return (i < anzahl) ? static_cast<const bildliste_besch_t *>(get_child(i)) : 0; }
const bild_besch_t *gib_bild(uint16 i, uint16 j) const { return (i < anzahl) ? static_cast<const bildliste_besch_t *>(gib_kind(i))->gib_bild(j) : 0; }
const bild_besch_t *get_bild(uint16 i, uint16 j) const { return (i < anzahl) ? static_cast<const bildliste_besch_t *>(get_child(i))->get_bild(j) : 0; }
};
#endif
......@@ -30,13 +30,13 @@ class bildliste_besch_t : public obj_besch_t {
public:
bildliste_besch_t() : anzahl(0) {}
uint16 gib_anzahl() const { return anzahl; }
uint16 get_anzahl() const { return anzahl; }
const bild_besch_t *gib_bild(uint16 i) const { return (i < anzahl) ? static_cast<const bild_besch_t *>(gib_kind(i)) : NULL; }
const bild_besch_t *get_bild(uint16 i) const { return (i < anzahl) ? static_cast<const bild_besch_t *>(get_child(i)) : NULL; }
image_id gib_bild_nr(uint16 i) const {
const bild_besch_t *bild = gib_bild(i);
return bild != NULL ? bild->gib_nummer() : IMG_LEER;
image_id get_bild_nr(uint16 i) const {
const bild_besch_t *bild = get_bild(i);
return bild != NULL ? bild->get_nummer() : IMG_LEER;
}
};
......
......@@ -10,14 +10,14 @@
* Beschreibung:
* Richtigen Index fr einfaches Brckenstck bestimmen
*/
bruecke_besch_t::img_t bruecke_besch_t::gib_simple(ribi_t::ribi ribi)
bruecke_besch_t::img_t bruecke_besch_t::get_simple(ribi_t::ribi ribi)
{
return (ribi & ribi_t::nordsued) ? NS_Segment : OW_Segment;
}
// dito for pillars
bruecke_besch_t::img_t bruecke_besch_t::gib_pillar(ribi_t::ribi ribi)
bruecke_besch_t::img_t bruecke_besch_t::get_pillar(ribi_t::ribi ribi)
{
return (ribi & ribi_t::nordsued) ? NS_Pillar : OW_Pillar;
}
......@@ -30,7 +30,7 @@ bruecke_besch_t::img_t bruecke_besch_t::gib_pillar(ribi_t::ribi ribi)
* Beschreibung:
* Richtigen Index fr klassischen Hangstart ck bestimmen
*/
bruecke_besch_t::img_t bruecke_besch_t::gib_start(ribi_t::ribi ribi)
bruecke_besch_t::img_t bruecke_besch_t::get_start(ribi_t::ribi ribi)
{
switch(ribi) {
case ribi_t::nord: return N_Start;
......@@ -49,7 +49,7 @@ bruecke_besch_t::img_t bruecke_besch_t::gib_start(ribi_t::ribi ribi)
* Beschreibung:
* Richtigen Index fr Rampenstart ck bestimmen
*/
bruecke_besch_t::img_t bruecke_besch_t::gib_rampe(ribi_t::ribi ribi)