News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

r2455- Minor cursor problem

Started by z9999, May 11, 2009, 03:03:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

r2455 GDI

Very minor problem.
When I start simutrans and mouseover on city buildings, city buildings were highlighted.
If I change to underground mode and back to normal mode, this problem will be solved.

Dwachs

this patch fixes this:
Index: simmain.cc
===================================================================
--- simmain.cc (revision 2456)
+++ simmain.cc (working copy)
@@ -772,6 +772,7 @@
welt->step_month(5);
welt->step();
welt->step();
+ welt->update_map();
umgebung_t::autosave = old_autosave;
}
else {

but I have no idea why this error occurs at all (the grounds below houses have no image set). It happens only if simutrans generates a new map to start with.
Parsley, sage, rosemary, and maggikraut.

z9999

#2
Thank you. But unfortunately this patch doesn't solve the problem.
After starting a new game, it suddenly happned again.

How to reproduce;
1. Start a new game
2. Click fast-forward button
3. Wait some month
4. Mouseover on cityhall or factory or attraction

[EDIT]
It also happened with station building and city building.
But it didn't happen with all buildings, but with limited buildings.

In the case of my pak96.comic game, only 2 kind of buildings were highlited.

Dwachs

Now I found the reason for this bug: this happens to all buildings that do not need ground tiles (ie buildings that cover the whole tile) after change of seasons. Then the ground has no image to reduce overhead for the drawing stuff.
New try to patch this:
Index: simview.cc
===================================================================
--- simview.cc  (revision 2456)
+++ simview.cc  (working copy)
@@ -186,9 +186,12 @@
                if(gr && gr->is_visible()) {
                        const PLAYER_COLOR_VAL transparent = TRANSPARENT25_FLAG|OUTLINE_FLAG| umgebung_t::cursor_overlay_color;
                        if(  gr->get_bild()==IMG_LEER  ) {
-                               if(  gr->obj_bei(0)  ) {
+                               if(  gr->hat_wege()  ) {
                                        display_img_blend( gr->obj_bei(0)->get_bild(), x, y, transparent, 0, true );
                                }
+                               else {
+                                       display_img_blend( grund_besch_t::get_ground_tile(0,gr->get_hoehe()), x, y, transparent, 0, true );
+                               }
                        }
                        else {
                                display_img_blend( gr->get_bild(), x, y, transparent, 0, true );

Parsley, sage, rosemary, and maggikraut.

Dwachs

Parsley, sage, rosemary, and maggikraut.