hedgewars/uLandGraphics.pas
changeset 4640 bc30434ae156
parent 4635 62d0873459e5
child 4659 ce5897f53072
equal deleted inserted replaced
4639:6de386a42fae 4640:bc30434ae156
   196            if (cReducedQuality and rqBlurryLand) = 0 then
   196            if (cReducedQuality and rqBlurryLand) = 0 then
   197                LandPixels[t, i]:= LandBackPixel(i, t)
   197                LandPixels[t, i]:= LandBackPixel(i, t)
   198            else
   198            else
   199                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   199                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   200            end
   200            end
   201        else if not isMap then
   201        else if not isMap or ((Land[t, i] and lfObject) <> 0) then
   202            begin
   202            begin
   203            if (cReducedQuality and rqBlurryLand) = 0 then
   203            if (cReducedQuality and rqBlurryLand) = 0 then
   204                LandPixels[t, i]:= 0
   204                LandPixels[t, i]:= 0
   205            else
   205            else
   206                LandPixels[t div 2, i div 2]:= 0
   206                LandPixels[t div 2, i div 2]:= 0
   215            if (cReducedQuality and rqBlurryLand) = 0 then
   215            if (cReducedQuality and rqBlurryLand) = 0 then
   216                LandPixels[t, i]:= LandBackPixel(i, t)
   216                LandPixels[t, i]:= LandBackPixel(i, t)
   217            else
   217            else
   218                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   218                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   219            end
   219            end
   220        else if not isMap then
   220        else if not isMap or ((Land[t, i] and lfObject) <> 0) then
   221            begin
   221            begin
   222            if (cReducedQuality and rqBlurryLand) = 0 then
   222            if (cReducedQuality and rqBlurryLand) = 0 then
   223                LandPixels[t, i]:= 0
   223                LandPixels[t, i]:= 0
   224            else
   224            else
   225                LandPixels[t div 2, i div 2]:= 0
   225                LandPixels[t div 2, i div 2]:= 0
   234            if (cReducedQuality and rqBlurryLand) = 0 then
   234            if (cReducedQuality and rqBlurryLand) = 0 then
   235                LandPixels[t, i]:= LandBackPixel(i, t)
   235                LandPixels[t, i]:= LandBackPixel(i, t)
   236            else
   236            else
   237                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   237                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   238            end
   238            end
   239        else if not isMap then
   239        else if not isMap or ((Land[t, i] and lfObject) <> 0) then
   240             begin
   240             begin
   241             if (cReducedQuality and rqBlurryLand) = 0 then
   241             if (cReducedQuality and rqBlurryLand) = 0 then
   242           	LandPixels[t, i]:= 0
   242           	    LandPixels[t, i]:= 0
   243             else
   243             else
   244            	LandPixels[t div 2, i div 2]:= 0
   244            	    LandPixels[t div 2, i div 2]:= 0
   245             end;
   245             end;
   246 
   246 
   247 t:= y - dx;
   247 t:= y - dx;
   248 if (t and LAND_HEIGHT_MASK) = 0 then
   248 if (t and LAND_HEIGHT_MASK) = 0 then
   249    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   249    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   253            if (cReducedQuality and rqBlurryLand) = 0 then
   253            if (cReducedQuality and rqBlurryLand) = 0 then
   254                LandPixels[t, i]:= LandBackPixel(i, t)
   254                LandPixels[t, i]:= LandBackPixel(i, t)
   255            else
   255            else
   256                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   256                LandPixels[t div 2, i div 2]:= LandBackPixel(i, t)
   257            end
   257            end
   258        else if not isMap then
   258        else if not isMap or ((Land[t, i] and lfObject) <> 0) then
   259            begin
   259            begin
   260            if (cReducedQuality and rqBlurryLand) = 0 then
   260            if (cReducedQuality and rqBlurryLand) = 0 then
   261                LandPixels[t, i]:= 0
   261                LandPixels[t, i]:= 0
   262            else
   262            else
   263                LandPixels[t div 2, i div 2]:= 0
   263                LandPixels[t div 2, i div 2]:= 0
   505     if ((ty and LAND_HEIGHT_MASK) = 0) and
   505     if ((ty and LAND_HEIGHT_MASK) = 0) and
   506        ((tx and LAND_WIDTH_MASK) = 0) and
   506        ((tx and LAND_WIDTH_MASK) = 0) and
   507        ((Land[ty, tx] and (lfBasic or lfObject)) <> 0) then
   507        ((Land[ty, tx] and (lfBasic or lfObject)) <> 0) then
   508         begin
   508         begin
   509         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   509         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
   510         if (cReducedQuality and rqBlurryLand) = 0 then
   510         if (cReducedQuality and rqBlurryLand) = 0 then 
   511 	    LandPixels[ty, tx]:= cExplosionBorderColor
   511             LandPixels[ty, tx]:= cExplosionBorderColor
   512 	else
   512 	    else
   513             LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
   513             LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
   514 
       
   515         end
   514         end
   516     end;
   515     end;
   517     X:= nx;
   516     X:= nx;
   518     Y:= ny;
   517     Y:= ny;
   519     for t:= 0 to ticks do
   518     for t:= 0 to ticks do
   527             if (Land[ty, tx] and lfBasic) <> 0 then
   526             if (Land[ty, tx] and lfBasic) <> 0 then
   528                 if (cReducedQuality and rqBlurryLand) = 0 then
   527                 if (cReducedQuality and rqBlurryLand) = 0 then
   529                     LandPixels[ty, tx]:= LandBackPixel(tx, ty)
   528                     LandPixels[ty, tx]:= LandBackPixel(tx, ty)
   530                 else
   529                 else
   531                     LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty)
   530                     LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty)
   532             else if not isMap then
   531             else if not isMap or ((Land[ty, tx] and lfObject) <> 0) then
   533                 begin
   532                 begin
   534 		if (cReducedQuality and rqBlurryLand) = 0 then
   533                 if (cReducedQuality and rqBlurryLand) = 0 then
   535                      LandPixels[ty, tx]:= 0
   534                      LandPixels[ty, tx]:= 0
   536                 else
   535                 else
   537                      LandPixels[ty div 2, tx div 2]:= 0
   536                      LandPixels[ty div 2, tx div 2]:= 0
   538                 end;
   537                 end;
   539 
   538 
   691         begin
   690         begin
   692         if (cReducedQuality and rqBlurryLand) = 0 then
   691         if (cReducedQuality and rqBlurryLand) = 0 then
   693             begin
   692             begin
   694             if (Land[Y, X] and lfBasic) <> 0 then
   693             if (Land[Y, X] and lfBasic) <> 0 then
   695                 LandPixels[Y, X]:= LandBackPixel(X, Y)
   694                 LandPixels[Y, X]:= LandBackPixel(X, Y)
   696             else if not isMap then
   695             else if not isMap or ((Land[Y, X] and lfObject) <> 0) then
   697                 LandPixels[Y, X]:= 0
   696                 LandPixels[Y, X]:= 0
   698             end
   697             end
   699         else
   698         else
   700             if (Land[Y, X] and lfBasic) <> 0 then
   699             if (Land[Y, X] and lfBasic) <> 0 then
   701                 LandPixels[Y div 2, X div 2]:= LandBackPixel(X, Y)
   700                 LandPixels[Y div 2, X div 2]:= LandBackPixel(X, Y)
   702             else if not isMap then
   701             else if not isMap or ((Land[Y, X] and lfObject) <> 0) then
   703                 LandPixels[Y div 2, X div 2]:= 0;
   702                 LandPixels[Y div 2, X div 2]:= 0;
   704 
   703 
   705         Land[Y, X]:= 0;
   704         Land[Y, X]:= 0;
   706         exit(true);
   705         exit(true);
   707         end;
   706         end;