hedgewars/uLandTexture.pas
branchtransitional_engine
changeset 15900 128ace913837
parent 11532 bf86c6cb9341
child 15901 f39f0f614dbf
equal deleted inserted replaced
15899:73cdc306888f 15900:128ace913837
    28 procedure DrawLand(dX, dY: LongInt);
    28 procedure DrawLand(dX, dY: LongInt);
    29 procedure ResetLand;
    29 procedure ResetLand;
    30 procedure SetLandTexture;
    30 procedure SetLandTexture;
    31 
    31 
    32 implementation
    32 implementation
    33 uses uConsts, GLunit, uTypes, uVariables, uTextures, uDebug, uRender, uUtils;
    33 uses uConsts, GLunit, uTypes, uVariables, uTextures, uDebug, uRender, uUtils, uLandUtils;
    34 
    34 
    35 const TEXSIZE = 128;
    35 const TEXSIZE = 128;
    36       // in avoid tile borders stretch the blurry texture by 1 pixel more
    36       // in avoid tile borders stretch the blurry texture by 1 pixel more
    37       BLURRYLANDOVERLAP: real = 1 / TEXSIZE / 2.0; // 1 pixel divided by texsize and blurry land scale factor
    37       BLURRYLANDOVERLAP: real = 1 / TEXSIZE / 2.0; // 1 pixel divided by texsize and blurry land scale factor
    38 
    38 
    58 function Pixels2(x, y: Longword): Pointer;
    58 function Pixels2(x, y: Longword): Pointer;
    59 var tx, ty: Longword;
    59 var tx, ty: Longword;
    60 begin
    60 begin
    61 for ty:= 0 to TEXSIZE - 1 do
    61 for ty:= 0 to TEXSIZE - 1 do
    62     for tx:= 0 to TEXSIZE - 1 do
    62     for tx:= 0 to TEXSIZE - 1 do
    63         tmpPixels[ty, tx]:= Land[y * TEXSIZE + ty, x * TEXSIZE + tx] or AMask;
    63         tmpPixels[ty, tx]:= LandGet(y * TEXSIZE + ty, x * TEXSIZE + tx) or AMask;
    64 
    64 
    65 Pixels2:= @tmpPixels
    65 Pixels2:= @tmpPixels
    66 end;
    66 end;
    67 
    67 
    68 procedure UpdateLandTexture(X, Width, Y, Height: LongInt; landAdded: boolean);
    68 procedure UpdateLandTexture(X, Width, Y, Height: LongInt; landAdded: boolean);