hedgewars/uLandGraphics.pas
branchicegun
changeset 8579 d18bc19d780a
parent 7509 76e3a3fc17cd
child 8583 f2edd6d5f958
equal deleted inserted replaced
8578:d2bfe0683b9a 8579:d18bc19d780a
   348             if (cReducedQuality and rqBlurryLand) = 0 then
   348             if (cReducedQuality and rqBlurryLand) = 0 then
   349                 LandPixels[t, i]:= ExplosionBorderColor
   349                 LandPixels[t, i]:= ExplosionBorderColor
   350             else
   350             else
   351                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   351                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   352 
   352 
   353             Land[t, i]:= Land[t, i] or lfDamaged;
   353             Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce;
   354             //Despeckle(i, t);
   354             //Despeckle(i, t);
   355             LandDirty[t div 32, i div 32]:= 1;
   355             LandDirty[t div 32, i div 32]:= 1;
   356             end;
   356             end;
   357 
   357 
   358 t:= y - dy;
   358 t:= y - dy;
   362             begin
   362             begin
   363             if (cReducedQuality and rqBlurryLand) = 0 then
   363             if (cReducedQuality and rqBlurryLand) = 0 then
   364                 LandPixels[t, i]:= ExplosionBorderColor
   364                 LandPixels[t, i]:= ExplosionBorderColor
   365             else
   365             else
   366                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   366                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   367             Land[t, i]:= Land[t, i] or lfDamaged;
   367             Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce;
   368             //Despeckle(i, t);
   368             //Despeckle(i, t);
   369             LandDirty[t div 32, i div 32]:= 1;
   369             LandDirty[t div 32, i div 32]:= 1;
   370             end;
   370             end;
   371 
   371 
   372 t:= y + dx;
   372 t:= y + dx;
   377             if (cReducedQuality and rqBlurryLand) = 0 then
   377             if (cReducedQuality and rqBlurryLand) = 0 then
   378                 LandPixels[t, i]:= ExplosionBorderColor
   378                 LandPixels[t, i]:= ExplosionBorderColor
   379             else
   379             else
   380                LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   380                LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   381 
   381 
   382             Land[t, i]:= Land[t, i] or lfDamaged;
   382             Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce;
   383             //Despeckle(i, t);
   383             //Despeckle(i, t);
   384             LandDirty[t div 32, i div 32]:= 1;
   384             LandDirty[t div 32, i div 32]:= 1;
   385             end;
   385             end;
   386 
   386 
   387 t:= y - dx;
   387 t:= y - dx;
   392             if (cReducedQuality and rqBlurryLand) = 0 then
   392             if (cReducedQuality and rqBlurryLand) = 0 then
   393                 LandPixels[t, i]:= ExplosionBorderColor
   393                 LandPixels[t, i]:= ExplosionBorderColor
   394             else
   394             else
   395                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   395                 LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
   396 
   396 
   397             Land[t, i]:= Land[t, i] or lfDamaged;
   397             Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce;
   398             //Despeckle(i, y - dy);
   398             //Despeckle(i, y - dy);
   399             LandDirty[t div 32, i div 32]:= 1;
   399             LandDirty[t div 32, i div 32]:= 1;
   400             end;
   400             end;
   401 end;
   401 end;
   402 
   402 
   523                  if (cReducedQuality and rqBlurryLand) = 0 then
   523                  if (cReducedQuality and rqBlurryLand) = 0 then
   524                     LandPixels[ty, tx]:= ExplosionBorderColor
   524                     LandPixels[ty, tx]:= ExplosionBorderColor
   525                 else
   525                 else
   526                     LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor;
   526                     LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor;
   527 
   527 
   528                 Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   528                 Land[ty, tx]:= (Land[ty, tx] or lfDamaged) and not lfIce;
   529                 LandDirty[ty div 32, tx div 32]:= 1;
   529                 LandDirty[ty div 32, tx div 32]:= 1;
   530                 end;
   530                 end;
   531     inc(y, dY)
   531     inc(y, dY)
   532     end;
   532     end;
   533 
   533 
   565     ty:= hwRound(Y);
   565     ty:= hwRound(Y);
   566     if ((ty and LAND_HEIGHT_MASK) = 0)
   566     if ((ty and LAND_HEIGHT_MASK) = 0)
   567     and ((tx and LAND_WIDTH_MASK) = 0)
   567     and ((tx and LAND_WIDTH_MASK) = 0)
   568     and (((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0)) then
   568     and (((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0)) then
   569         begin
   569         begin
       
   570         Land[ty, tx]:= Land[ty, tx] and not lfIce;
   570         if despeckle then
   571         if despeckle then
   571             begin
   572             begin
   572             Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   573             Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   573             LandDirty[ty div 32, tx div 32]:= 1
   574             LandDirty[ty div 32, tx div 32]:= 1
   574             end;
   575             end;
   593         tx:= hwRound(X);
   594         tx:= hwRound(X);
   594         ty:= hwRound(Y);
   595         ty:= hwRound(Y);
   595         if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   596         if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   596         or ((Land[ty, tx] and lfObject) <> 0)) then
   597         or ((Land[ty, tx] and lfObject) <> 0)) then
   597             begin
   598             begin
   598             Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   599             Land[ty, tx]:= (Land[ty, tx] or lfDamaged) and not lfIce;
   599             if despeckle then
   600             if despeckle then
   600                 LandDirty[ty div 32, tx div 32]:= 1;
   601                 LandDirty[ty div 32, tx div 32]:= 1;
   601             if (cReducedQuality and rqBlurryLand) = 0 then
   602             if (cReducedQuality and rqBlurryLand) = 0 then
   602                 LandPixels[ty, tx]:= ExplosionBorderColor
   603                 LandPixels[ty, tx]:= ExplosionBorderColor
   603             else
   604             else
   636     tx:= hwRound(X);
   637     tx:= hwRound(X);
   637     ty:= hwRound(Y);
   638     ty:= hwRound(Y);
   638     if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   639     if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   639     or ((Land[ty, tx] and lfObject) <> 0)) then
   640     or ((Land[ty, tx] and lfObject) <> 0)) then
   640         begin
   641         begin
   641         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   642         Land[ty, tx]:=( Land[ty, tx] or lfDamaged) and not lfIce;
   642         if despeckle then
   643         if despeckle then
   643             LandDirty[ty div 32, tx div 32]:= 1;
   644             LandDirty[ty div 32, tx div 32]:= 1;
   644         if (cReducedQuality and rqBlurryLand) = 0 then
   645         if (cReducedQuality and rqBlurryLand) = 0 then
   645             LandPixels[ty, tx]:= ExplosionBorderColor
   646             LandPixels[ty, tx]:= ExplosionBorderColor
   646         else
   647         else
   662     tx:= hwRound(X);
   663     tx:= hwRound(X);
   663     ty:= hwRound(Y);
   664     ty:= hwRound(Y);
   664     if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   665     if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
   665     or ((Land[ty, tx] and lfObject) <> 0)) then
   666     or ((Land[ty, tx] and lfObject) <> 0)) then
   666         begin
   667         begin
   667         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   668         Land[ty, tx]:= (Land[ty, tx] or lfDamaged) and not lfIce;
   668         if despeckle then
   669         if despeckle then
   669             LandDirty[ty div 32, tx div 32]:= 1;
   670             LandDirty[ty div 32, tx div 32]:= 1;
   670         if (cReducedQuality and rqBlurryLand) = 0 then
   671         if (cReducedQuality and rqBlurryLand) = 0 then
   671             LandPixels[ty, tx]:= ExplosionBorderColor
   672             LandPixels[ty, tx]:= ExplosionBorderColor
   672         else
   673         else