simutrans r1943 GDI
I repoted this before and made a patch.
But this problem is NOT solved yet.
I don't know why you don't like my patches in spite of working well.
Index: gui/welt.cc
===================================================================
--- gui/welt.cc (r1943)
+++ gui/welt.cc (copy)
@@ -322,7 +322,7 @@
uint16 B = (uint8)fgetc(file);
while(karte_x<=rest_x && karte_x<preview_size) {
- karte[(karte_y*preview_size)+karte_x] = reliefkarte_t::calc_hoehe_farbe( (((R*2+G*3+B)/4 - 224+16)/16)*Z_TILE_STEP, sets->gib_grundw****er() );
+ karte[(karte_y*preview_size)+karte_x] = reliefkarte_t::calc_hoehe_farbe( (((R*2+G*3+B)/4 - 224+16)>>4)*Z_TILE_STEP, sets->gib_grundw****er() );
karte_x ++;
}
rest_x += skip_x;
This is a compiler error then. It works fine on my compiler. Furthermore for an unsigned number >> 4 and /16 are identical. Hmm. Ok, can change it, although I do not like hidden divisions in not speed critical sections.
It works even for the main routine ... maybe should be same in both places.
AFAIK, both vc++ and gcc are same at this point.
-5/2 = -2
-5 >> 1 = -3
And my first report is for v100.0 which you made it.
My code is the old simutrans code before you changed it. I dig it.
I apologize. Since the numbers are unsigned, I was ****uming that the compiler would make an unsigned shift. And even more, I was so used to /16 equal >>4 that I overlooked your point. (Strangley division by 16 is still used in the main code though).