Changeset - r14712:9d62e352cb76
[Not reviewed]
master
0 4 0
peter1138 - 14 years ago 2010-03-03 19:07:34
peter1138@openttd.org
(svn r19307) -Add: Let railtypes specify their own smallmap colour. No legend support yet.
4 files changed with 30 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -2583,6 +2583,10 @@ static ChangeInfoResult RailTypeChangeIn
 
				rti->acceleration_type = Clamp(buf->ReadByte(), 0, 2);
 
				break;
 

	
 
			case 0x16: // Map colour
 
				rti->map_colour = MapDOSColour(buf->ReadByte());
 
				break;
 

	
 
			default:
 
				ret = CIR_UNKNOWN;
 
				break;
 
@@ -2637,6 +2641,7 @@ static ChangeInfoResult RailTypeReserveI
 
			case 0x11: // Curve speed advantage
 
			case 0x12: // Station graphic
 
			case 0x15: // Acceleration model
 
			case 0x16: // Map colour
 
				buf->ReadByte();
 
				break;
 

	
src/rail.h
Show inline comments
 
@@ -204,6 +204,11 @@ struct RailtypeInfo {
 
	RailTypeLabel label;
 

	
 
	/**
 
	 * Colour on mini-map
 
	 */
 
	byte map_colour;
 

	
 
	/**
 
	 * Sprite groups for resolving sprites
 
	 */
 
	const SpriteGroup *group[RTSG_END];
src/smallmap_gui.cpp
Show inline comments
 
@@ -419,6 +419,14 @@ static inline uint32 GetSmallMapRoutesPi
 
			case STATION_DOCK:    return MKCOLOUR(0x98989898);
 
			default:              return MKCOLOUR(0xFFFFFFFF);
 
		}
 
	} else if (t == MP_RAILWAY) {
 
		AndOr andor = {
 
			GetRailTypeInfo(GetRailType(tile))->map_colour * MKCOLOUR(0x00010100),
 
			_smallmap_contours_andor[t].mand
 
		};
 

	
 
		const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
 
		return ApplyMask(cs->default_colour, &andor);
 
	}
 

	
 
	/* Ground colour */
src/table/railtypes.h
Show inline comments
 
@@ -90,6 +90,9 @@ static const RailtypeInfo _original_rail
 
		/* rail type label */
 
		'RAIL',
 

	
 
		/* map colour */
 
		0x0A,
 

	
 
		{ NULL },
 
	},
 

	
 
@@ -170,6 +173,9 @@ static const RailtypeInfo _original_rail
 
		/* rail type label */
 
		'ELRL',
 

	
 
		/* map colour */
 
		0x0A,
 

	
 
		{ NULL },
 
	},
 

	
 
@@ -246,6 +252,9 @@ static const RailtypeInfo _original_rail
 
		/* rail type label */
 
		'MONO',
 

	
 
		/* map colour */
 
		0x0A,
 

	
 
		{ NULL },
 
	},
 

	
 
@@ -322,6 +331,9 @@ static const RailtypeInfo _original_rail
 
		/* rail type label */
 
		'MGLV',
 

	
 
		/* map colour */
 
		0x0A,
 

	
 
		{ NULL },
 
	},
 
};
0 comments (0 inline, 0 general)