Skip to main content
Topic: P****enger destinations in map (Read 3726 times) previous topic - next topic

P****enger destinations in map

With this patch pax_ziele_neu/alt is saved as sp**** array and you can display it in the map.

There is one problem remaining: Since the array is saved as sp****, everytime stadt_info_t::zeichnen is called, simutrans have to recalculate the color of the minimap. Maybe one should calc this colors and save it (as static?) is stadt_info_t (and update it every new month)? Any other suggestions?

Re: P****enger destinations in map

Reply #1
Maybe you can use a the static instance

reliefkarte_t * reliefkarte_t::get_karte()

to obtain the colors of the pixels that are not stored in the sp**** matrix?
Parsley, sage, rosemary, and maggikraut.

Re: P****enger destinations in map

Reply #2
But then you have to extract a 128x128 submatrix every time zeichnen() is called. Maybe saving this submatrix will be better?

Todo (just for me): Add access to the non-zero elements.

Re: P****enger destinations in map

Reply #3
Well the dialoge can cache the map view and update only, when the sp**** matrix has changed.

Re: P****enger destinations in map

Reply #4
So call an update of the dialogue, whenever stadt_t::merke_p****agier_ziel is called? This sounds reasonable.

Re: P****enger destinations in map

Reply #5
Rather the dialoge will update its map whenever the sp**** matrix has changed. SInce the old one never changes, this means already half work only ... Maybe even a flag resetted by the dialogue.

Re: P****enger destinations in map

Reply #6
Then I would use a flag in the dialogue, which is set by merke_p****agier_ziel. In my opinion, the matrix isn't the right place to save it.

Re: P****enger destinations in map

Reply #7
New version. Now, the minimap in the city info will be recalculated only when a new month starts. In the map convois aren't draw in the p****enger destinations mode, otherwise it is too confusing.

Also access to the nonzero elements is supported in the sp**** template.