hedgewars/uLandTexture.pas
changeset 1852 fa04a27005c3
parent 1808 2fc248766d57
child 1859 e071284b118e
equal deleted inserted replaced
1851:b3b07f16a70d 1852:fa04a27005c3
    50 end;
    50 end;
    51 
    51 
    52 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    52 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    53 var tx, ty: Longword;
    53 var tx, ty: Longword;
    54 begin
    54 begin
       
    55 if (Width <= 0) or (Height <= 0) then exit;
    55 TryDo((X >= 0) and (X < LAND_WIDTH), 'UpdateLandTexture: wrong X parameter', true);
    56 TryDo((X >= 0) and (X < LAND_WIDTH), 'UpdateLandTexture: wrong X parameter', true);
    56 TryDo(X + Width <= LAND_WIDTH, 'UpdateLandTexture: wrong Width parameter', true);
    57 TryDo(X + Width <= LAND_WIDTH, 'UpdateLandTexture: wrong Width parameter', true);
    57 TryDo((Y >= 0) and (Y < LAND_HEIGHT), 'UpdateLandTexture: wrong Y parameter', true);
    58 TryDo((Y >= 0) and (Y < LAND_HEIGHT), 'UpdateLandTexture: wrong Y parameter', true);
    58 TryDo(Y + Height <= LAND_HEIGHT, 'UpdateLandTexture: wrong Height parameter', true);
    59 TryDo(Y + Height <= LAND_HEIGHT, 'UpdateLandTexture: wrong Height parameter', true);
    59 
    60