diff --git bauer/tunnelbauer.cc bauer/tunnelbauer.cc index fc6be342e..f3b6bf26e 100644 --- bauer/tunnelbauer.cc +++ bauer/tunnelbauer.cc @@ -284,7 +284,7 @@ koord3d tunnel_builder_t::find_end_pos(player_t *player, koord3d pos, koord zv, } if( !ribi ) { // End of the slope - Missing end rail or has no ribis - // we still consider if we interfere with a way (original: prüfen noch, ob uns dort ein anderer Weg stört) + // we still consider if we interfere with a way if(wegtyp != powerline_wt) { if( !gr->hat_wege() || gr->hat_weg(wegtyp) ) { return pos; @@ -646,8 +646,7 @@ const char *tunnel_builder_t::remove(player_t *player, koord3d start, waytype_t slist_tpl tmp_list; koord3d pos = start; - // Erstmal das ganze Außmaß des Tunnels bestimmen und sehen, - // ob uns was im Weg ist. + // First check if all tunnel parts can be removed tmp_list.insert(pos); grund_t *from = welt->lookup(pos); marker.mark(from); @@ -669,7 +668,7 @@ const char *tunnel_builder_t::remove(player_t *player, koord3d start, waytype_t else { part_list.insert(pos); } - // Alle Tunnelteile auf Entfernbarkeit prüfen! + if( from->kann_alle_obj_entfernen(player) ) { return "Der Tunnel ist nicht frei!\n"; } @@ -700,7 +699,7 @@ const char *tunnel_builder_t::remove(player_t *player, koord3d start, waytype_t } } while (!tmp_list.empty()); - // Jetzt geht es ans löschen der Tunnel + // Now we can delete the tunnel grounds while (!part_list.empty()) { pos = part_list.remove_first(); grund_t *gr = welt->lookup(pos); @@ -718,7 +717,7 @@ const char *tunnel_builder_t::remove(player_t *player, koord3d start, waytype_t minimap_t::get_instance()->calc_map_pixel( pos.get_2d() ); } - // Und die Tunnelenden am Schluß + // And now we can delete the tunnel ends while (!end_list.empty()) { pos = end_list.remove_first(); diff --git boden/grund.h boden/grund.h index 4fbc20e80..4cef68e54 100644 --- boden/grund.h +++ boden/grund.h @@ -93,18 +93,18 @@ class grund_t { public: /** - * Flag-Werte für das neuzeichnen geänderter Untergründe + * Flag values for different ground properties */ enum flag_values { - keine_flags=0, - dirty=1, // was changed => redraw full - is_kartenboden=2, - has_text=4, - marked = 8, // will have a frame - draw_as_obj = 16, // is a slope etc => draw as one - is_halt_flag = 32, // is a part of a halt - has_way1 = 64, - has_way2 = 128 + keine_flags = 0, + dirty = (1<<0), ///< was changed => redraw full + is_kartenboden = (1<<1), + has_text = (1<<2), + marked = (1<<3), ///< will have a frame + draw_as_obj = (1<<4), ///< is a slope etc => draw as one + is_halt_flag = (1<<5), ///< is a part of a halt + has_way1 = (1<<6), + has_way2 = (1<<7) }; /** @@ -414,14 +414,9 @@ public: void set_grund_hang(slope_t::type sl) { slope = sl; } /** - * Manche Böden können zu Haltestellen gehören. + * some ground tiles may be part of halts. */ void set_halt(halthandle_t halt); - - /** - * Ermittelt, ob dieser Boden zu einer Haltestelle gehört. - * @return NULL wenn keine Haltestelle, sonst Zeiger auf Haltestelle - */ halthandle_t get_halt() const; bool is_halt() const { return flags & is_halt_flag; } @@ -677,11 +672,9 @@ public: virtual ribi_t::ribi get_weg_ribi(waytype_t typ) const; /** - * Ermittelt die Richtungsbits furr den weg vom Typ 'typ' unmaskiert. - * Dies wird beim Bauen ben÷tigt. Furr die Routenfindung werden die - * maskierten ribis benutzt. - * - */ + * @returns the ribis (unmasked) for waytype @p typ. + * These are required e.g. for building. For pathfinding masked ribis are used. + */ virtual ribi_t::ribi get_weg_ribi_unmasked(waytype_t typ) const; /** @@ -695,9 +688,8 @@ public: */ virtual sint8 get_weg_yoff() const { return 0; } - /** - * Hat der Boden mindestens ein weg_t-Objekt? Liefert false für Water! - */ + + /// @returns true if there is at least one way on this ground. inline bool hat_wege() const { return (flags&(has_way1|has_way2))!=0;} /** diff --git boden/wege/weg.cc boden/wege/weg.cc index a13ee35d4..e77576dc3 100644 --- boden/wege/weg.cc +++ boden/wege/weg.cc @@ -111,10 +111,6 @@ const char *weg_t::waytype_to_string(waytype_t wt) } -/** - * Setzt neue Description. Ersetzt alte Höchstgeschwindigkeit - * mit wert aus Description. - */ void weg_t::set_desc(const way_desc_t *b) { desc = b; @@ -209,9 +205,6 @@ void weg_t::rdwr(loadsave_t *file) } -/** - * Info-text für diesen Weg - */ void weg_t::info(cbuffer_t & buf) const { obj_t::info(buf); diff --git boden/wege/weg.h boden/wege/weg.h index a4b0b0894..d6dc9b028 100644 --- boden/wege/weg.h +++ boden/wege/weg.h @@ -32,16 +32,12 @@ enum way_statistics { /** - *

Der Weg ist die Basisklasse fuer alle Verkehrswege in Simutrans. - * Wege "gehören" immer zu einem Grund. Sie besitzen Richtungsbits sowie - * eine Maske fuer Richtungsbits.

+ * Ways is the base class for all traffic routes. (roads, track, runway etc.) + * Ways always "belong" to a ground. They have direction bits (ribis) as well as + * a mask for ribis. * - *

Ein Weg gehört immer zu genau einer Wegsorte

- * - *

Kreuzungen werden dadurch unterstützt, daß ein Grund zwei Wege - * enthalten kann (prinzipiell auch mehrere möglich.

- * - *

Wegtyp -1 ist reserviert und kann nicht für Wege benutzt werden

+ * A way always is of a single type (waytype_t). + * Crossings are supported by the fact that a ground can have more than one way. */ class weg_t : public obj_no_info_t { @@ -76,8 +72,8 @@ private: const way_desc_t * desc; /** - * Richtungsbits für den Weg. Norden ist oben rechts auf dem Monitor. - * 1=Nord, 2=Ost, 4=Sued, 8=West + * Direction bits (ribis) for the way. North is in the upper right corner of the monitor. + * 1=North, 2=East, 4=South, 8=West */ uint8 ribi:4; @@ -141,20 +137,10 @@ public: */ bool check_season(const bool calc_only_season_change) OVERRIDE; - /** - * Setzt die erlaubte Höchstgeschwindigkeit - */ void set_max_speed(sint32 s) { max_speed = s; } - - /** - * Ermittelt die erlaubte Höchstgeschwindigkeit - */ sint32 get_max_speed() const { return max_speed; } - /** - * Setzt neue Description. Ersetzt alte Höchstgeschwindigkeit - * mit wert aus Description. - */ + /// @note Replaces max speed of the way by the max speed property of the descriptor. void set_desc(const way_desc_t *b); const way_desc_t *get_desc() const { return desc; } @@ -176,15 +162,9 @@ public: */ const char *is_deletable(const player_t *player) OVERRIDE; - /** - * Wegtyp zurückliefern - */ waytype_t get_waytype() const OVERRIDE = 0; - /** - * 'Jedes Ding braucht einen Typ.' - * @return Gibt den typ des Objekts zurück. - */ + /// @copydoc obj_t::get_typ typ get_typ() const OVERRIDE { return obj_t::way; } /** @@ -195,30 +175,24 @@ public: /** * Add direction bits (ribi) for a way. * - * Nachdem die ribis geändert werden, ist das weg_image des - * zugehörigen Grundes falsch (Ein Aufruf von grund_t::calc_image() - * zur Reparatur muß folgen). - * @param ribi Richtungsbits + * @note After changing of ribi the image of the way is wrong. To correct this, + * grund_t::calc_image needs to be called. This is not done here (Too expensive). */ void ribi_add(ribi_t::ribi ribi) { this->ribi |= (uint8)ribi;} /** - * Remove direction bits (ribi) on a way. + * Remove direction bits (ribi) for a way. * - * Nachdem die ribis geändert werden, ist das weg_image des - * zugehörigen Grundes falsch (Ein Aufruf von grund_t::calc_image() - * zur Reparatur muß folgen). - * @param ribi Richtungsbits + * @note After changing of ribi the image of the way is wrong. To correct this, + * grund_t::calc_image needs to be called. This is not done here (Too expensive). */ void ribi_rem(ribi_t::ribi ribi) { this->ribi &= (uint8)~ribi;} /** * Set direction bits (ribi) for the way. * - * Nachdem die ribis geändert werden, ist das weg_image des - * zugehörigen Grundes falsch (Ein Aufruf von grund_t::calc_image() - * zur Reparatur muß folgen). - * @param ribi Richtungsbits + * @note After changing of ribi the image of the way is wrong. To correct this, + * grund_t::calc_image needs to be called. This is not done here (Too expensive). */ void set_ribi(ribi_t::ribi ribi) { this->ribi = (uint8)ribi;} @@ -233,9 +207,8 @@ public: ribi_t::ribi get_ribi() const { return (ribi_t::ribi)(ribi & ~ribi_maske); } /** - * für Signale ist es notwendig, bestimmte Richtungsbits auszumaskieren - * damit Fahrzeuge nicht "von hinten" über Ampeln fahren können. - * @param ribi Richtungsbits + * For signals it is necessary to mask out certain ribi to prevent vehicles + * from driving the wrong way (e.g. oneway roads) */ void set_ribi_maske(ribi_t::ribi ribi) { ribi_maske = (uint8)ribi; } ribi_t::ribi get_ribi_maske() const { return (ribi_t::ribi)ribi_maske; } diff --git dataobj/route.cc dataobj/route.cc index 0ad0bff11..b096c1215 100644 --- dataobj/route.cc +++ dataobj/route.cc @@ -223,7 +223,7 @@ bool route_t::find_route(karte_t *welt, const koord3d start, test_driver_t *tdri if(tmp->dir!=current_dir) { k->g += 3; if(tmp->parent->dir!=tmp->dir && tmp->parent->parent!=NULL) { - // discourage 90° turns + // discourage 90 degree turns k->g += 10; } else if(ribi_t::is_perpendicular(tmp->dir,current_dir)) { @@ -430,7 +430,7 @@ bool route_t::intern_calc_route(karte_t *welt, const koord3d ziel, const koord3d if(tmp->dir!=current_dir) { new_g += 3; if(tmp->parent->dir!=tmp->dir && tmp->parent->parent!=NULL) { - // discourage 90° turns + // discourage 90 degree turns new_g += 10; } else if(ribi_t::is_perpendicular(tmp->dir,current_dir)) { diff --git dataobj/translator.cc dataobj/translator.cc index 1662a96bd..0a2349de3 100644 --- dataobj/translator.cc +++ dataobj/translator.cc @@ -89,7 +89,8 @@ static void dump_hashtable(stringhashtable_tpl* tbl) /* first two file functions needed in connection with utf */ -/* checks, if we need a unicode translation (during load only done for identifying strings like "Auflösen") +/** + * checks, if we need a unicode translation */ static bool is_unicode_file(FILE* f) { diff --git gui/halt_list_frame.cc gui/halt_list_frame.cc index f9ec52f57..7e0ed9a1f 100644 --- gui/halt_list_frame.cc +++ gui/halt_list_frame.cc @@ -192,9 +192,9 @@ static bool passes_filter_out(haltestelle_t const& s) } else if (ware == goods_manager_t::mail) { if (s.get_mail_enabled()) return true; } else if (ware != goods_manager_t::none) { - // Oh Mann - eine doppelte Schleife und das noch pro Haltestelle - // Zum Glück ist die Anzahl der Fabriken und die ihrer Ausgänge - // begrenzt (Normal 1-2 Fabriken mit je 0-1 Ausgang) + // Sigh - a doubly nested loop per halt + // Fortunately the number of factories and their number of outputs + // is limited (usually 1-2 factories and 0-1 outputs per factory) FOR(slist_tpl, const f, s.get_fab_list()) { FOR(array_tpl, const& j, f->get_output()) { if (j.get_typ() == ware) return true; @@ -227,9 +227,9 @@ static bool passes_filter_in(haltestelle_t const& s) if (s.get_mail_enabled()) return true; } else if (ware != goods_manager_t::none) { - // Oh Mann - eine doppelte Schleife und das noch pro Haltestelle - // Zum Glück ist die Anzahl der Fabriken und die ihrer Ausgänge - // begrenzt (Normal 1-2 Fabriken mit je 0-1 Ausgang) + // Sigh - a doubly nested loop per halt + // Fortunately the number of factories and their number of outputs + // is limited (usually 1-2 factories and 0-1 outputs per factory) FOR(slist_tpl, const f, s.get_fab_list()) { FOR(array_tpl, const& j, f->get_input()) { if (j.get_typ() == ware) return true; diff --git gui/map_frame.cc gui/map_frame.cc index d27976f5a..a7cb63cf4 100644 --- gui/map_frame.cc +++ gui/map_frame.cc @@ -218,7 +218,7 @@ map_frame_t::map_frame_t() : zoom_buttons[1].add_listener( this ); add_component( zoom_buttons+1 ); - // rotate map 45° (isometric view) + // rotate map 45 degrees (isometric view) b_rotate45.init( button_t::square_state, "isometric map"); b_rotate45.set_tooltip("Similar view as the main window"); b_rotate45.add_listener(this); diff --git gui/simwin.cc gui/simwin.cc index 5e73304ed..d6caa50a3 100644 --- gui/simwin.cc +++ gui/simwin.cc @@ -162,7 +162,7 @@ static int display_gadget_box(sint8 code, // If we have a skin, get gadget image data const image_t *img = NULL; if( skinverwaltung_t::gadget ) { - // "x", "?", "=", "«", "»" + // "x", "?", "=", "<<", ">>" img = skinverwaltung_t::gadget->get_image(code); } diff --git obj/baum.cc obj/baum.cc index e462cb075..7b005dd8d 100644 --- obj/baum.cc +++ obj/baum.cc @@ -242,8 +242,7 @@ DBG_MESSAGE("verteile_baeume()","distributing single trees"); static bool compare_tree_desc(const tree_desc_t* a, const tree_desc_t* b) { - /* Gleiches Level - wir führen eine künstliche, aber eindeutige Sortierung - * über den Namen herbei. */ + // same level - we do an artificial but unique sorting by (untranslated) name return strcmp(a->get_name(), b->get_name())<0; } @@ -583,9 +582,6 @@ void baum_t::finish_rd() } -/** - * Öffnet ein neues Beobachtungsfenster für das Objekt. - */ void baum_t::show_info() { if(env_t::tree_info) { @@ -594,10 +590,6 @@ void baum_t::show_info() } -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void baum_t::info(cbuffer_t & buf) const { obj_t::info(buf); diff --git obj/crossing.cc obj/crossing.cc index 6726d8222..32255f795 100644 --- obj/crossing.cc +++ obj/crossing.cc @@ -159,10 +159,6 @@ void crossing_t::rdwr(loadsave_t *file) } -/** - * Wird nach dem Laden der Welt aufgerufen - üblicherweise benutzt - * um das Aussehen des Dings an Boden und Umgebung anzupassen - */ void crossing_t::finish_rd() { grund_t *gr=welt->lookup(get_pos()); diff --git obj/field.cc obj/field.cc index c77c3dae8..507901d63 100644 --- obj/field.cc +++ obj/field.cc @@ -78,11 +78,6 @@ image_id field_t::get_image() const } - -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void field_t::show_info() { // show the info of the corresponding factory diff --git obj/field.h obj/field.h index b00211749..cc5859067 100644 --- obj/field.h +++ obj/field.h @@ -27,10 +27,7 @@ public: image_id get_image() const OVERRIDE; - /** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ + /// @copydoc obj_t::show_info void show_info() OVERRIDE; /** diff --git obj/gebaeude.cc obj/gebaeude.cc index f598c855b..99df5579b 100644 --- obj/gebaeude.cc +++ obj/gebaeude.cc @@ -888,10 +888,6 @@ void gebaeude_t::rdwr(loadsave_t *file) } -/** - * Wird nach dem Laden der Welt aufgerufen - üblicherweise benutzt - * um das Aussehen des Dings an Boden und Umgebung anzupassen - */ void gebaeude_t::finish_rd() { player_t::add_maintenance(get_owner(), tile->get_desc()->get_maintenance(welt), tile->get_desc()->get_finance_waytype()); diff --git obj/gebaeude.h obj/gebaeude.h index c02cd61b5..6538b9189 100644 --- obj/gebaeude.h +++ obj/gebaeude.h @@ -83,11 +83,6 @@ public: void set_fab(fabrik_t *fd); void set_stadt(stadt_t *s); - /** - * Ein Gebaeude kann zu einer Fabrik gehören. - * @return Einen Zeiger auf die Fabrik zu der das Objekt gehört oder NULL, - * wenn das Objekt zu keiner Fabrik gehört. - */ fabrik_t* get_fabrik() const { return is_factory ? ptr.fab : NULL; } stadt_t* get_stadt() const { return is_factory ? NULL : ptr.stadt; } @@ -128,10 +123,7 @@ public: bool is_city_building() const; - /** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ + /// @copydoc obj_t::info void info(cbuffer_t & buf) const OVERRIDE; void rdwr(loadsave_t *file) OVERRIDE; @@ -157,6 +149,7 @@ public: void cleanup(player_t *player) OVERRIDE; + /// @copydoc obj_t::finish_rd void finish_rd() OVERRIDE; // currently animated diff --git obj/groundobj.cc obj/groundobj.cc index c571a3d4d..237a69fa2 100644 --- obj/groundobj.cc +++ obj/groundobj.cc @@ -198,9 +198,6 @@ void groundobj_t::rdwr(loadsave_t *file) } -/** - * Öffnet ein neues Beobachtungsfenster für das Objekt. - */ void groundobj_t::show_info() { if(env_t::tree_info) { @@ -209,10 +206,6 @@ void groundobj_t::show_info() } -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void groundobj_t::info(cbuffer_t & buf) const { obj_t::info(buf); diff --git obj/leitung2.cc obj/leitung2.cc index e4cbf556b..0c330f6b0 100644 --- obj/leitung2.cc +++ obj/leitung2.cc @@ -323,10 +323,6 @@ void leitung_t::calc_neighbourhood() } -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void leitung_t::info(cbuffer_t & buf) const { obj_t::info(buf); @@ -344,26 +340,21 @@ void leitung_t::info(cbuffer_t & buf) const buf.printf(translator::translate("Usage: %.0f %%"), (double)((100 * net->get_normal_demand()) >> powernet_t::FRACTION_PRECISION)); } -/** - * Wird nach dem Laden der Welt aufgerufen - üblicherweise benutzt - * um das Aussehen des Dings an Boden und Umgebung anzupassen - */ + void leitung_t::finish_rd() { #ifdef MULTI_THREAD pthread_mutex_lock( &verbinde_mutex ); -#endif verbinde(); -#ifdef MULTI_THREAD pthread_mutex_unlock( &verbinde_mutex ); -#endif -#ifdef MULTI_THREAD pthread_mutex_lock( &calc_image_mutex ); -#endif calc_neighbourhood(); -#ifdef MULTI_THREAD pthread_mutex_unlock( &calc_image_mutex ); +#else + verbinde(); + calc_neighbourhood(); #endif + grund_t *gr = welt->lookup(get_pos()); assert(gr); (void)gr; diff --git obj/leitung2.h obj/leitung2.h index bdf9ac0e5..c2ddfb528 100644 --- obj/leitung2.h +++ obj/leitung2.h @@ -90,10 +90,7 @@ public: */ waytype_t get_waytype() const OVERRIDE { return powerline_wt; } - /** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ + /// @copydoc obj_t::info void info(cbuffer_t & buf) const OVERRIDE; ribi_t::ribi get_ribi() const { return ribi; } diff --git obj/roadsign.cc obj/roadsign.cc index 8d3688c75..91b80e910 100644 --- obj/roadsign.cc +++ obj/roadsign.cc @@ -172,10 +172,6 @@ void roadsign_t::show_info() } -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void roadsign_t::info(cbuffer_t & buf) const { obj_t::info( buf ); @@ -596,10 +592,6 @@ void roadsign_t::cleanup(player_t *player) } -/** - * Wird nach dem Laden der Welt aufgerufen - üblicherweise benutzt - * um das Aussehen des Dings an Boden und Umgebung anzupassen - */ void roadsign_t::finish_rd() { grund_t *gr=welt->lookup(get_pos()); diff --git obj/roadsign.h obj/roadsign.h index bca5a24fe..673e992ad 100644 --- obj/roadsign.h +++ obj/roadsign.h @@ -82,10 +82,7 @@ public: // since traffic lights need their own window void show_info() OVERRIDE; - /** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ + /// @copydoc obj_t::info void info(cbuffer_t & buf) const OVERRIDE; /** diff --git obj/signal.cc obj/signal.cc index abd79ec64..427eba0f4 100644 --- obj/signal.cc +++ obj/signal.cc @@ -30,10 +30,6 @@ signal_t::signal_t(loadsave_t *file) : } -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void signal_t::info(cbuffer_t & buf) const { // well, needs to be done diff --git obj/signal.h obj/signal.h index f9a6419c4..be8c3f571 100644 --- obj/signal.h +++ obj/signal.h @@ -23,10 +23,7 @@ public: signal_t(loadsave_t *file); signal_t(player_t *player, koord3d pos, ribi_t::ribi dir,const roadsign_desc_t *desc, bool preview = false) : roadsign_t(player,pos,dir,desc,preview) { state = rot;} - /** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ + /// @copydoc obj_t::info void info(cbuffer_t & buf) const OVERRIDE; typ get_typ() const OVERRIDE { return obj_t::signal; } diff --git simcity.cc simcity.cc index 3f5724395..1bd7d61d1 100644 --- simcity.cc +++ simcity.cc @@ -2131,9 +2131,6 @@ void stadt_t::step_passagiere() } -/** - * returns a random and uniformly distributed point within city borders - */ koord stadt_t::get_zufallspunkt() const { if(!buildings.empty()) { diff --git simcity.h simcity.h index f1edc27c3..a69cb03aa 100644 --- simcity.h +++ simcity.h @@ -394,9 +394,7 @@ private: void pruefe_grenzen(koord pos); public: - /** - * sucht arbeitsplätze für die Einwohner - */ + /// Connects factories to this city. void verbinde_fabriken(); /** @@ -441,30 +439,16 @@ public: sint32 get_unemployed() const { return bev - arb; } sint32 get_homeless() const { return bev - won; } - /** - * Return the city name. - */ const char *get_name() const { return name; } - - /** - * Ermöglicht Zugriff auf Namesnarray - */ void set_name( const char *name ); - /** - * gibt einen zufällingen gleichverteilten Punkt innerhalb der - * Citygrenzen zurück - */ + /// @returns a random point within city borders. koord get_zufallspunkt() const; - /** - * gibt das pax-statistik-array für letzten monat zurück - */ + /// @returns passenger destination statistics for the last month const sparse_tpl* get_pax_destinations_old() const { return &pax_destinations_old; } - /** - * gibt das pax-statistik-array für den aktuellen monat zurück - */ + /// @returns passenger destination statistics for the current month const sparse_tpl* get_pax_destinations_new() const { return &pax_destinations_new; } /* this counter will increment by one for every change diff --git simfab.cc simfab.cc index 427295fe6..764222713 100644 --- simfab.cc +++ simfab.cc @@ -2493,7 +2493,6 @@ void fabrik_t::verteile_waren(const uint32 product) continue; } - // Über alle Ziele iterieren for( uint32 n=0; n lieferziele; uint32 lieferziele_active_last_month; @@ -309,9 +305,7 @@ private: array_tpl input; ///< array for input/consumed goods array_tpl output; ///< array for output/produced goods - /** - * Zeitakkumulator für Produktion - */ + /// Accumulated time since last production sint32 delta_sum; uint32 delta_menge; @@ -542,9 +536,6 @@ public: void clear_target_cities(); const vector_tpl& get_target_cities() const { return target_cities; } - /** - * Fügt ein neues Lieferziel hinzu - */ void add_lieferziel(koord ziel); void rem_lieferziel(koord pos); @@ -618,16 +609,12 @@ public: */ void get_tile_list( vector_tpl &tile_list ) const; - /** - * gibt eine NULL-Terminierte Liste von Fabrikpointern zurück - */ + /// @returns a vector of factories within a rectangle static vector_tpl & sind_da_welche(koord min, koord max); // hier die methoden zum parametrisieren der Fabrik - /** - * Baut die Gebäude für die Fabrik - */ + /// Builds buildings (gebaeude_t) for the factory. void build(sint32 rotate, bool build_fields, bool force_initial_prodbase); sint16 get_rotate() const { return rotate; } diff --git simhalt.cc simhalt.cc index 517281e6c..5b7bef6e3 100644 --- simhalt.cc +++ simhalt.cc @@ -2223,10 +2223,6 @@ uint32 haltestelle_t::starte_mit_route(ware_t ware) } - -/* Receives ware and tries to route it further on - * if no route is found, it will be removed - */ uint32 haltestelle_t::liefere_an(ware_t ware) { // no valid next stops? diff --git simhalt.h simhalt.h index 653f593a5..639dc63b1 100644 --- simhalt.h +++ simhalt.h @@ -70,10 +70,7 @@ public: enum stationtyp {invalid=0, loadingbay=1, railstation = 2, dock = 4, busstop = 8, airstop = 16, monorailstop = 32, tramstop = 64, maglevstop=128, narrowgaugestop=256 }; //could be combined with or! private: - /** - * Manche Methoden müssen auf alle Haltestellen angewandt werden - * deshalb verwaltet die Klasse eine Liste aller Haltestellen - */ + /// List of all halts in the game. static vector_tpl alle_haltestellen; /** @@ -185,7 +182,7 @@ public: static void destroy_all(); /** - * Liste aller felder (Grund-Objekte) die zu dieser Haltestelle gehören + * List of all tiles (grund_t) that belong to this halt. */ struct tile_t { @@ -569,9 +566,7 @@ public: /// true, if this station is overcrowded for this ware bool is_overcrowded( const uint8 idx ) const { return (overcrowded[idx/8] & (1<<(idx%8)))!=0; } - /** - * gibt Gesamtmenge derware vom typ typ zurück - */ + /// @returns total amount of the good waiting at this halt. uint32 get_ware_summe(const goods_desc_t *warentyp) const; /** @@ -603,16 +598,19 @@ public: */ void fetch_goods( slist_tpl &load, const goods_desc_t *good_category, uint32 requested_amount, const vector_tpl& destination_halts); - /* liefert ware an. Falls die Ware zu wartender Ware dazugenommen - * werden kann, kann ware_t gelöscht werden! D.h. man darf ware nach - * aufruf dieser Methode nicht mehr referenzieren! - * - * The second version is like the first, but will not recalculate the route - * This is used for inital passenger, since they already know a route - * - * @return angenommene menge + /** + * Delivers goods (ware_t) to this halt. + * if no route is found, the good will be removed. + * @returns amount of goods */ uint32 liefere_an(ware_t ware); + + /** + * Delivers goods (ware_t) to this halt. + * Will not recalculate the route + * This is used for inital passenger, since they already know a route + * @returns amount of goods + */ uint32 starte_mit_route(ware_t ware); const grund_t *find_matching_position(waytype_t wt) const; diff --git simplan.h simplan.h index a9953efe5..27e41bcb4 100644 --- simplan.h +++ simplan.h @@ -19,8 +19,8 @@ void swap(planquadrat_t& a, planquadrat_t& b); /** - * Die Karte ist aus Planquadraten zusammengesetzt. - * Planquadrate speichern Untergründe (Böden) der Karte. + * The map (karte_t) consists of map squares (planquadrat_t). + * planquadrat_t objects consist of zero or more ground objects (grund_t). */ class planquadrat_t { @@ -58,19 +58,13 @@ public: */ void kartenboden_setzen(grund_t *bd, bool startup = false); - /** - * Ersetzt Boden alt durch neu, löscht Boden alt. - */ - void boden_ersetzen(grund_t *alt, grund_t *neu); + /// Replaces old ground by new ground, deletes old ground. + void boden_ersetzen(grund_t *old_ground, grund_t *new_ground); - /** - * Setzen einen Brücken- oder Tunnelbodens - */ + /// Adds a bridge, tunnel or monorail ground to this map square. void boden_hinzufuegen(grund_t *bd); - /** - * Löschen eines Brücken- oder Tunnelbodens - */ + /// Removes a bridge, tunnel or monorail ground from this map square. bool boden_entfernen(grund_t *bd); /** @@ -115,9 +109,7 @@ public: */ inline grund_t *get_boden_bei(const unsigned idx) const { return (ground_size<=1 ? data.one : data.some[idx]); } - /** - * @return Anzahl der Böden dieses Planquadrats - */ + /// @returns number of grounds on this map square. unsigned int get_boden_count() const { return ground_size; } /** diff --git simsound.cc simsound.cc index ca30e74ad..764a5f4ce 100644 --- simsound.cc +++ simsound.cc @@ -28,10 +28,6 @@ static int max_midi = -1; // number of MIDI files static int current_midi = -1; // init with error condition, reset during loading - -/** - * setzt lautstärke für alle effekte - */ void sound_set_global_volume(int volume) { env_t::global_volume = volume; @@ -44,9 +40,6 @@ void sound_set_specific_volume( int volume, sound_type_t t) } -/** - * ermittelt lautstaärke für alle effekte - */ int sound_get_global_volume() { return env_t::global_volume; @@ -64,6 +57,7 @@ void sound_set_mute(bool f) env_t::global_mute_sound = f; } + bool sound_get_mute() { return ( env_t::global_mute_sound ); @@ -79,24 +73,18 @@ void sound_play(uint16 const idx, uint8 const v, sound_type_t t) } - - bool sound_get_shuffle_midi() { return env_t::shuffle_midi; } + void sound_set_shuffle_midi( bool shuffle ) { env_t::shuffle_midi = shuffle; } - -/** - * setzt Lautstärke für MIDI playback - * @param volume volume in range 0..255 - */ void sound_set_midi_volume(int volume) { if( !env_t::mute_midi && max_midi > -1 ) { @@ -107,10 +95,6 @@ void sound_set_midi_volume(int volume) -/** - * ermittelt Lautstärke für MIDI playback - * @return volume in range 0..255 - */ int sound_get_midi_volume() { return env_t::midi_volume; diff --git simsound.h simsound.h index ded222a5d..894c0b21b 100644 --- simsound.h +++ simsound.h @@ -8,56 +8,43 @@ #include "simtypes.h" -// sound can be selectively muted (but volume is not touched) +/// sound can be selectively muted (but volume is not touched) void sound_set_mute(bool new_flag); bool sound_get_mute(); -/** - * setzt Lautstärke für alle effekte - */ +/// @param volume in range 0..255 void sound_set_global_volume(int volume); - -/** - * ermittelt Lautstärke für alle effekte - */ +/// @returns volume in range 0..255 int sound_get_global_volume(); -/// and settign volume for specific sopunds +/// Sets volume for a specific type of sound. +/// @param volume in range 0..255 void sound_set_specific_volume( int volume, sound_type_t t ); + +/// @returns volume in range 0..255 int sound_get_specific_volume( sound_type_t t ); /** * Play a sound. * * @param idx Index of the sound - * @param volume Volume of the sound, 0 = silence, 255 = max + * @param volume in range 0..255 */ void sound_play(uint16 idx, uint8 volume, sound_type_t t ); -// shuffle enable/disable for midis +/// shuffle enable/disable for midis bool sound_get_shuffle_midi(); void sound_set_shuffle_midi( bool shuffle ); - -/** - * setzt Lautstärke für MIDI playback - * @param volume volume in range 0..255 - */ +/// @param volume in range 0..255 void sound_set_midi_volume(int volume); - -/** - * ermittelt Lautstärke für MIDI playback - * @return volume in range 0..255 - */ +/// @returns volume in range 0..255 int sound_get_midi_volume(); - -/** - * gets midi title - */ +/// gets midi title const char *sound_get_midi_title(int index); diff --git simsys_w32_png.cc simsys_w32_png.cc index 0c0a1a85d..ecb3cf50e 100644 --- simsys_w32_png.cc +++ simsys_w32_png.cc @@ -165,7 +165,7 @@ bool dr_screenshot_png(char const* filename, int w, int h, int maxwidth, unsigne free( newdata ); } - // Passenden Encoder für jpegs suchen: + // Get suitable encoder for png files: // Genausogut kann man auch image/png benutzen um png's zu speichern ;D // ...oder image/gif um gif's zu speichern, ... bool ok = false; diff --git simware.h simware.h index 392b6cad3..991583576 100644 --- simware.h +++ simware.h @@ -77,9 +77,7 @@ public: ware_t(const goods_desc_t *typ); ware_t(loadsave_t *file); - /** - * gibt den nicht-uebersetzten warennamen zurück - */ + /// @returns the non-translated name of the ware. const char *get_name() const { return get_desc()->get_name(); } const char *get_mass() const { return get_desc()->get_mass(); } uint8 get_catg() const { return get_desc()->get_catg(); } diff --git vehicle/movingobj.cc vehicle/movingobj.cc index ab7ef4057..e6dda94ff 100644 --- vehicle/movingobj.cc +++ vehicle/movingobj.cc @@ -235,10 +235,6 @@ void movingobj_t::rdwr(loadsave_t *file) } - -/** - * Open a new observation window for the object. - */ void movingobj_t::show_info() { if(env_t::tree_info) { @@ -247,11 +243,6 @@ void movingobj_t::show_info() } - -/** - * @return Einen Beschreibungsstring für das Objekt, der z.B. in einem - * Beobachtungsfenster angezeigt wird. - */ void movingobj_t::info(cbuffer_t & buf) const { obj_t::info(buf); @@ -269,7 +260,6 @@ void movingobj_t::info(cbuffer_t & buf) const } - void movingobj_t::cleanup(player_t *player) { player_t::book_construction_costs(player, -get_desc()->get_price(), get_pos().get_2d(), ignore_wt); @@ -277,8 +267,6 @@ void movingobj_t::cleanup(player_t *player) } - - sync_result movingobj_t::sync_step(uint32 delta_t) { weg_next += get_desc()->get_speed() * delta_t; @@ -287,7 +275,6 @@ sync_result movingobj_t::sync_step(uint32 delta_t) } - /* essential to find out about next step * returns true, if we can go here * (identical to fahrer) diff --git vehicle/simroadtraffic.cc vehicle/simroadtraffic.cc index 17e13f477..d3bf6bfd0 100644 --- vehicle/simroadtraffic.cc +++ vehicle/simroadtraffic.cc @@ -511,11 +511,11 @@ bool private_car_t::ist_weg_frei(grund_t *gr) // this fails with two crossings together; however, I see no easy way out here ... } else { - // not a crossing => skip 90° check! + // not a crossing => skip 90 degrees check! frei = true; // Overtaking vehicles shouldn't have anything blocking them if( !is_overtaking() ) { - // not a crossing => skip 90° check! + // not a crossing => skip 90 degrees check! vehicle_base_t *dt = no_cars_blocking( gr, NULL, this_direction, next_direction, next_direction ); if( dt ) { if(dt->is_stuck()) {