P****enger destinations in map March 01, 2009, 04:39:22 pm 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? Quote Selected
Re: P****enger destinations in map Reply #1 – March 01, 2009, 07:31:11 pm 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? Quote Selected
Re: P****enger destinations in map Reply #2 – March 02, 2009, 08:08:12 am 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. Quote Selected
Re: P****enger destinations in map Reply #3 – March 02, 2009, 09:56:37 am Well the dialoge can cache the map view and update only, when the sp**** matrix has changed. Quote Selected
Re: P****enger destinations in map Reply #4 – March 02, 2009, 10:20:08 am So call an update of the dialogue, whenever stadt_t::merke_p****agier_ziel is called? This sounds reasonable. Quote Selected
Re: P****enger destinations in map Reply #5 – March 02, 2009, 11:03:03 am 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. Quote Selected
Re: P****enger destinations in map Reply #6 – March 02, 2009, 04:21:58 pm 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. Quote Selected
Re: P****enger destinations in map Reply #7 – March 02, 2009, 09:43:34 pm 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. Quote Selected