135 InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0); |
135 InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0); |
136 } |
136 } |
137 |
137 |
138 static void IndustryDrawSugarMine(const TileInfo *ti) |
138 static void IndustryDrawSugarMine(const TileInfo *ti) |
139 { |
139 { |
140 const DrawIndustrySpec1Struct *d; |
140 const DrawIndustryAnimationStruct *d; |
141 uint32 image; |
|
142 |
141 |
143 if (!IsIndustryCompleted(ti->tile)) return; |
142 if (!IsIndustryCompleted(ti->tile)) return; |
144 |
143 |
145 d = &_draw_industry_spec1[GetIndustryAnimationState(ti->tile)]; |
144 d = &_draw_industry_spec1[GetIndustryAnimationState(ti->tile)]; |
146 |
145 |
147 AddChildSpriteScreen(SPR_IT_SUGAR_MINE_SIEVE + d->image_1, PAL_NONE, d->x, 0); |
146 AddChildSpriteScreen(SPR_IT_SUGAR_MINE_SIEVE + d->image_1, PAL_NONE, d->x, 0); |
148 |
147 |
149 image = d->image_2; |
148 if (d->image_2 != 0) { |
150 if (image != 0) AddChildSpriteScreen(SPR_IT_SUGAR_MINE_CLOUDS + image - 1, PAL_NONE, 8, 41); |
149 AddChildSpriteScreen(SPR_IT_SUGAR_MINE_CLOUDS + d->image_2 - 1, PAL_NONE, 8, 41); |
151 |
150 } |
152 image = d->image_3; |
151 |
153 if (image != 0) { |
152 if (d->image_3 != 0) { |
154 AddChildSpriteScreen(SPR_IT_SUGAR_MINE_PILE + image - 1, PAL_NONE, |
153 AddChildSpriteScreen(SPR_IT_SUGAR_MINE_PILE + d->image_3 - 1, PAL_NONE, |
155 _drawtile_proc1_x[image - 1], _drawtile_proc1_y[image - 1]); |
154 _drawtile_proc1[d->image_3 - 1].x, _drawtile_proc1[d->image_3 - 1].y); |
156 } |
155 } |
157 } |
156 } |
158 |
157 |
159 static void IndustryDrawToffeeQuarry(const TileInfo *ti) |
158 static void IndustryDrawToffeeQuarry(const TileInfo *ti) |
160 { |
159 { |
161 int x = 0; |
160 uint8 x = 0; |
162 |
161 |
163 if (IsIndustryCompleted(ti->tile)) { |
162 if (IsIndustryCompleted(ti->tile)) { |
164 x = _industry_anim_offs[GetIndustryAnimationState(ti->tile)]; |
163 x = _industry_anim_offs_toffee[GetIndustryAnimationState(ti->tile)]; |
165 if ( (byte)x == 0xFF) |
164 if (x == 0xFF) |
166 x = 0; |
165 x = 0; |
167 } |
166 } |
168 |
167 |
169 AddChildSpriteScreen(SPR_IT_TOFFEE_QUARRY_SHOVEL, PAL_NONE, 22 - x, 24 + x); |
168 AddChildSpriteScreen(SPR_IT_TOFFEE_QUARRY_SHOVEL, PAL_NONE, 22 - x, 24 + x); |
170 AddChildSpriteScreen(SPR_IT_TOFFEE_QUARRY_TOFFEE, PAL_NONE, 6, 14); |
169 AddChildSpriteScreen(SPR_IT_TOFFEE_QUARRY_TOFFEE, PAL_NONE, 6, 14); |
171 } |
170 } |
172 |
171 |
173 static void IndustryDrawBubbleGenerator( const TileInfo *ti) |
172 static void IndustryDrawBubbleGenerator( const TileInfo *ti) |
174 { |
173 { |
175 if (IsIndustryCompleted(ti->tile)) { |
174 if (IsIndustryCompleted(ti->tile)) { |
176 AddChildSpriteScreen(SPR_IT_BUBBLE_GENERATOR_BUBBLE, PAL_NONE, 5, _industry_anim_offs_2[GetIndustryAnimationState(ti->tile)]); |
175 AddChildSpriteScreen(SPR_IT_BUBBLE_GENERATOR_BUBBLE, PAL_NONE, 5, _industry_anim_offs_bubbles[GetIndustryAnimationState(ti->tile)]); |
177 } else { |
176 } else { |
178 AddChildSpriteScreen(SPR_IT_BUBBLE_GENERATOR_SPRING, PAL_NONE, 3, 67); |
177 AddChildSpriteScreen(SPR_IT_BUBBLE_GENERATOR_SPRING, PAL_NONE, 3, 67); |
179 } |
178 } |
180 } |
179 } |
181 |
180 |
182 static void IndustryDrawToyFactory(const TileInfo *ti) |
181 static void IndustryDrawToyFactory(const TileInfo *ti) |
183 { |
182 { |
184 const DrawIndustrySpec4Struct *d; |
183 const DrawIndustryAnimationStruct *d; |
185 |
184 |
186 d = &_industry_anim_offs_3[GetIndustryAnimationState(ti->tile)]; |
185 d = &_industry_anim_offs_toys[GetIndustryAnimationState(ti->tile)]; |
187 |
186 |
188 if (d->image_1 != 0xFF) { |
187 if (d->image_1 != 0xFF) { |
189 AddChildSpriteScreen(SPR_IT_TOY_FACTORY_CLAY, PAL_NONE, 50 - d->image_1 * 2, 96 + d->image_1); |
188 AddChildSpriteScreen(SPR_IT_TOY_FACTORY_CLAY, PAL_NONE, d->x, 96 + d->image_1); |
190 } |
189 } |
191 |
190 |
192 if (d->image_2 != 0xFF) { |
191 if (d->image_2 != 0xFF) { |
193 AddChildSpriteScreen(SPR_IT_TOY_FACTORY_ROBOT, PAL_NONE, 16 - d->image_2 * 2, 100 + d->image_2); |
192 AddChildSpriteScreen(SPR_IT_TOY_FACTORY_ROBOT, PAL_NONE, 16 - d->image_2 * 2, 100 + d->image_2); |
194 } |
193 } |