投稿者 トピック: [r2418以降] ミニマップで都市の旅客の行き先が正しく描画されない  (参照数 2964 回)

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381
ミニマップで都市の旅客の行き先が正しく描画されない。
正しく表示されるのは、表示位置の左端が(0,0)で、ズームを使用せず、45°回転を使用しないときのみ。
それ以外の場合、リアルタイムに旅客の行き先が描画されない。


[Since r2418] Passenger destination of town is not drawn correctly.

- It doesn't work with cur_pos != koord(0,0).
- It doesn't work with zoom-in/zoom-out.
- It doesn't work with isometric (rotate45).

Note:
The last one (isometric) may be intended. But if so, no need to calculate, because it doesn't draw correctly anyway.

コード: (gui/karte.cc: void reliefkarte_t::zeichnen(koord pos)) [選択]
for(  uint16 i = 0;  i < pax_dests->get_data_count();  i++  ) {
pax_dests->get_nonzero( i, pos, color );
min = koord((pos.x*welt->get_groesse_x())/PAX_DESTINATIONS_SIZE,
            (pos.y*welt->get_groesse_y())/PAX_DESTINATIONS_SIZE);
max = koord(((pos.x+1)*welt->get_groesse_x())/PAX_DESTINATIONS_SIZE,
            ((pos.y+1)*welt->get_groesse_y())/PAX_DESTINATIONS_SIZE);
if(  max.x >= cur_off.x  &&  max.y>=cur_off.y  &&  min.x<cur_size.x  &&  min.y<cur_size.y  ) {
for( pos.x = min.x;  pos.x < max.x;  pos.x++  ) {
for( pos.y = min.y;  pos.y < max.y;  pos.y++  ) {
set_relief_farbe(pos, color);
}
}
}
}

dwachs

  • 各駅停車
  • *
  • 投稿: 9
I do not understand, what is not drawn correctly. I cannot see anything false with the map  ???

Do you have screenshots?

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381

dwachs

  • 各駅停車
  • *
  • 投稿: 9
I cannot reproduce it. How did you achieve that?

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381
修正パッチ

コード: [選択]
Index: gui/karte.cc
===================================================================
--- gui/karte.cc (リビジョン 4753)
+++ gui/karte.cc (作業コピー)
@@ -836,11 +836,9 @@
              (pos.y*welt->get_groesse_y())/PAX_DESTINATIONS_SIZE);
  max = koord(((pos.x+1)*welt->get_groesse_x())/PAX_DESTINATIONS_SIZE,
              ((pos.y+1)*welt->get_groesse_y())/PAX_DESTINATIONS_SIZE);
- if(  max.x >= cur_off.x  &&  max.y>=cur_off.y  &&  min.x<cur_size.x  &&  min.y<cur_size.y  ) {
- for( pos.x = min.x;  pos.x < max.x;  pos.x++  ) {
- for( pos.y = min.y;  pos.y < max.y;  pos.y++  ) {
- set_relief_farbe(pos, color);
- }
+ for( pos.x = min.x;  pos.x < max.x;  pos.x++  ) {
+ for( pos.y = min.y;  pos.y < max.y;  pos.y++  ) {
+ set_relief_farbe(pos, color);
  }
  }
  }