src/bridge_gui.cpp
changeset 8491 97fcf662c3c3
parent 8398 1e181e2e4e15
child 8532 ebe68d6899b6
equal deleted inserted replaced
8490:c4db66ce864d 8491:97fcf662c3c3
    77 		case WE_PAINT: {
    77 		case WE_PAINT: {
    78 			DrawWindowWidgets(w);
    78 			DrawWindowWidgets(w);
    79 
    79 
    80 			uint y = 15;
    80 			uint y = 15;
    81 			for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
    81 			for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
    82 				const Bridge *b = &_bridge[_bridgedata.indexes[i + w->vscroll.pos]];
    82 				const Bridge *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
    83 
    83 
    84 				SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
    84 				SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
    85 				SetDParam(1, b->speed * 10 / 16);
    85 				SetDParam(1, b->speed * 10 / 16);
    86 				SetDParam(0, b->material);
    86 				SetDParam(0, b->material);
    87 
    87 
   189 
   189 
   190 		/* loop for all bridgetypes */
   190 		/* loop for all bridgetypes */
   191 		for (bridge_type = 0; bridge_type != MAX_BRIDGES; bridge_type++) {
   191 		for (bridge_type = 0; bridge_type != MAX_BRIDGES; bridge_type++) {
   192 			if (CheckBridge_Stuff(bridge_type, bridge_len)) {
   192 			if (CheckBridge_Stuff(bridge_type, bridge_len)) {
   193 				/* bridge is accepted, add to list */
   193 				/* bridge is accepted, add to list */
   194 				const Bridge *b = &_bridge[bridge_type];
   194 				const Bridge *b = GetBridgeSpec(bridge_type);
   195 				/* Add to terraforming & bulldozing costs the cost of the
   195 				/* Add to terraforming & bulldozing costs the cost of the
   196 				 * bridge itself (not computed with DC_QUERY_COST) */
   196 				 * bridge itself (not computed with DC_QUERY_COST) */
   197 				_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);
   197 				_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);
   198 				_bridgedata.indexes[j] = bridge_type;
   198 				_bridgedata.indexes[j] = bridge_type;
   199 				j++;
   199 				j++;