Changeset - r358:2c5052ff031d
[Not reviewed]
master
0 3 0
darkvater - 20 years ago 2004-11-12 17:16:13
darkvater@openttd.org
(svn r546) -newgrf: Use GetCustomVehicleIcon() for fetching sprites for vehicle selection dialogs. (Idea by octo, done by pasky).
3 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
engine.h
Show inline comments
 
@@ -91,7 +91,9 @@ int GetCustomEngineSprite(byte engine, u
 
	GetCustomEngineSprite(v->engine_type, v->type == VEH_Train ? v->u.rail.first_engine : -1, \
 
	                      _global_cargo_id[_opt.landscape][v->cargo_type], \
 
	                      ((v->cargo_count + 1) * 100) / (v->cargo_cap + 1), \
 
	                      !!v->cur_speed, direction);
 
	                      !!v->cur_speed, direction)
 
#define GetCustomVehicleIcon(v, direction) \
 
	GetCustomEngineSprite(v, -1, CID_PURCHASE, 0, 0, direction)
 

	
 
void SetCustomEngineName(int engine, char *name);
 
StringID GetCustomEngineName(int engine);
ship_cmd.c
Show inline comments
 
@@ -24,7 +24,7 @@ void DrawShipEngine(int x, int y, int en
 
	int spritenum = ship_vehicle_info(engine).image_index;
 

	
 
	if (is_custom_sprite(spritenum)) {
 
		int sprite = GetCustomEngineSprite(engine, 0xffff, CID_PURCHASE, 0, 0, 6);
 
		int sprite = GetCustomVehicleIcon(engine, 6);
 

	
 
		if (sprite) {
 
			DrawSprite(sprite | image_ormod, x, y);
train_cmd.c
Show inline comments
 
@@ -174,7 +174,7 @@ void DrawTrainEngine(int x, int y, int e
 
	uint32 image = 0;
 

	
 
	if (is_custom_sprite(img)) {
 
		image = GetCustomEngineSprite(engine, -1, CID_PURCHASE, 0, 0, 6);
 
		image = GetCustomVehicleIcon(engine, 6);
 
		if (!image) img = _engine_original_sprites[engine];
 
	}
 
	if (!image) {
 
@@ -186,7 +186,7 @@ void DrawTrainEngine(int x, int y, int e
 
		x += 15;
 
		image = 0;
 
		if (is_custom_sprite(img)) {
 
			image = GetCustomEngineSprite(engine, -1, CID_PURCHASE, 0, 0, 2);
 
			image = GetCustomVehicleIcon(engine, 2);
 
			if (!image) img = _engine_original_sprites[engine];
 
		}
 
		if (!image) {
0 comments (0 inline, 0 general)