Changeset - r7291:131e3ddd5976
[Not reviewed]
master
0 2 0
belugas - 17 years ago 2007-07-20 17:14:03
belugas@openttd.org
(svn r10639) -Codechange: Give meaninfull name to a magic number
2 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/industry.h
Show inline comments
 
@@ -17,12 +17,13 @@ enum {
 
	NUM_INDUSTRYTYPES      = 37,                         ///< total number of industries, new and old
 
	INDUSTRYTILE_NOANIM    = 0xFF,                       ///< flag to mark industry tiles as having no animation
 
	NEW_INDUSTRYTILEOFFSET = 175,                        ///< original number of tiles
 
	INVALID_INDUSTRYTYPE   = NUM_INDUSTRYTYPES,          ///< one above amount is considered invalid
 
	NUM_INDUSTRYTILES      = NEW_INDUSTRYTILEOFFSET,     ///< total number of industry tiles, new and old
 
	INVALID_INDUSTRYTILE   = NUM_INDUSTRYTILES,          ///< one above amount is considered invalid
 
	INDUSTRY_COMPLETED     = 3,                          ///< final stage of industry construction.
 
};
 

	
 
enum {
 
	CLEAN_RANDOMSOUNDS,    ///< Free the dynamically allocated sounds table
 
	CLEAN_TILELSAYOUT,     ///< Free the dynamically allocated tile layout structure
 
};
src/industry_cmd.cpp
Show inline comments
 
@@ -273,13 +273,13 @@ static void DrawTile_Industry(TileInfo *
 
			/* And point the industrytile spec accordingly */
 
			indts = GetIndustryTileSpec(indts->grf_prop.subst_id);
 
		}
 
	}
 

	
 
	dits = &_industry_draw_tile_data[gfx << 2 | (indts->anim_state ?
 
			GetIndustryAnimationState(ti->tile) & 3 :
 
			GetIndustryAnimationState(ti->tile) & INDUSTRY_COMPLETED :
 
			GetIndustryConstructionStage(ti->tile))];
 

	
 
	image = dits->ground.sprite;
 
	if (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->ground.pal == PAL_NONE) {
 
		pal = GENERAL_SPRITE_COLOR(ind->random_color);
 
	} else {
 
@@ -639,15 +639,13 @@ static void MakeIndustryTileBigger(TileI
 
	}
 

	
 
	stage = GetIndustryConstructionStage(tile) + 1;
 
	SetIndustryConstructionCounter(tile, 0);
 
	SetIndustryConstructionStage(tile, stage);
 
	StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE);
 
	if (stage == 3) {
 
		SetIndustryCompleted(tile, true);
 
	}
 
	if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile, true);
 

	
 
	MarkTileDirtyByTile(tile);
 

	
 
	if (!IsIndustryCompleted(tile)) return;
 

	
 
	IndustryGfx gfx = GetIndustryGfx(tile);
0 comments (0 inline, 0 general)