Changeset 319 for trunk/LocalPlayer/Wonders.pas
- Timestamp:
- Mar 19, 2021, 3:31:53 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Wonders.pas
r245 r319 100 100 ax: Integer; 101 101 R: Integer; 102 I: Integer;103 102 C: Integer; 104 103 Ch: Integer; … … 223 222 PaintBackgroundShape; 224 223 225 for I := 0 to 20 do 226 if Imp[I].Preq <> preNA then 227 begin 224 // Draw all bitmaps first 225 HaveWonder := False; 226 for I := 0 to 20 do begin 227 if Imp[I].Preq <> preNA then begin 228 228 case MyRO.Wonder[I].CityID of 229 - 1: // not built yet 230 begin 231 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 232 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 233 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 234 (hMaintexture - ClientHeight) div 2); 235 DarkIcon(I); 236 end; 237 -2: // destroyed 238 begin 239 Glow(I, $000000); 240 end; 241 else 242 begin 243 if MyRO.Wonder[I].EffectiveOwner >= 0 then 244 Glow(I, Tribe[MyRO.Wonder[I].EffectiveOwner].Color) 245 else 246 Glow(I, $000000); 247 end; 248 end; 249 end; 250 251 HaveWonder := False; 252 for I := 0 to 20 do 253 if Imp[I].Preq <> preNA then 254 begin 255 case MyRO.Wonder[I].CityID of 256 -1: // not built yet 257 begin 258 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 259 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 260 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 261 (hMaintexture - ClientHeight) div 2); 262 DarkIcon(I); 263 end; 264 -2: // destroyed 265 begin 266 HaveWonder := True; 267 BitBltCanvas(Offscreen.Canvas, 268 Center.X - xSizeBig div 2 + RingPosition[I].X, 269 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, 270 ySizeBig, BigImp.Canvas, 0, (SystemIconLines + 3) * 271 ySizeBig); 272 end; 273 else 274 begin 229 WonderNotBuiltYet: begin 230 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 231 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 232 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 233 (hMaintexture - ClientHeight) div 2); 234 end; 235 WonderDestroyed: begin 236 HaveWonder := True; 237 BitBltCanvas(Offscreen.Canvas, 238 Center.X - xSizeBig div 2 + RingPosition[I].X, 239 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, 240 ySizeBig, BigImp.Canvas, 0, (SystemIconLines + 3) * 241 ySizeBig); 242 end; 243 else begin 275 244 HaveWonder := True; 276 245 BitBltCanvas(Offscreen.Canvas, … … 282 251 end; 283 252 end; 253 end; 254 255 // Do direct pixel postprocessing separately to avoid bitmap copying in memory 256 Offscreen.Canvas.FillRect(0, 0, 0, 0); 257 Offscreen.BeginUpdate; 258 for I := 0 to 20 do begin 259 if Imp[I].Preq <> preNA then begin 260 case MyRO.Wonder[I].CityID of 261 WonderNotBuiltYet: DarkIcon(I); 262 WonderDestroyed: Glow(I, $000000); 263 else begin 264 if MyRO.Wonder[I].EffectiveOwner >= 0 then 265 Glow(I, Tribe[MyRO.Wonder[I].EffectiveOwner].Color) 266 else Glow(I, $000000); 267 end; 268 end; 269 end; 270 end; 271 Offscreen.EndUpdate; 284 272 285 273 if not HaveWonder then … … 323 311 if Selection >= 0 then 324 312 begin 325 if MyRO.Wonder[Selection].CityID = -1then313 if MyRO.Wonder[Selection].CityID = WonderNotBuiltYet then 326 314 begin // not built yet 327 315 { S:=Phrases.Lookup('IMPROVEMENTS',Selection); … … 338 326 begin 339 327 S := Phrases.Lookup('IMPROVEMENTS', Selection); 340 if MyRO.Wonder[Selection].CityID <> -2then328 if MyRO.Wonder[Selection].CityID <> WonderDestroyed then 341 329 S := Format(Phrases.Lookup('WONDEROF'), 342 330 [S, CityName(MyRO.Wonder[Selection].CityID)]); … … 344 332 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 345 333 ClientHeight - 3 - 36 - 10, S); 346 if MyRO.Wonder[Selection].CityID = -2then334 if MyRO.Wonder[Selection].CityID = WonderDestroyed then 347 335 S := Phrases.Lookup('DESTROYED') 348 336 else if MyRO.Wonder[Selection].EffectiveOwner < 0 then
Note:
See TracChangeset
for help on using the changeset viewer.