hedgewars/uLandTexture.pas
changeset 2376 ece7b87f1334
parent 2248 26e11cb27c61
child 2587 0dfa56a8513c
equal deleted inserted replaced
2375:99f05a01a6a3 2376:ece7b87f1334
    23 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    23 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    24 procedure DrawLand(dX, dY: LongInt);
    24 procedure DrawLand(dX, dY: LongInt);
    25 procedure FreeLand;
    25 procedure FreeLand;
    26 
    26 
    27 implementation
    27 implementation
    28 uses uMisc, uLand, uStore, 
    28 uses uMisc, uLand, uStore,
    29 {$IFDEF GLES11}
    29 {$IFDEF GLES11}
    30 	gles11,
    30 	gles11,
    31 {$ELSE}
    31 {$ELSE}
    32 	GL,
    32 	GL,
    33 {$ENDIF}
    33 {$ENDIF}
    49 function Pixels(x, y: Longword): Pointer;
    49 function Pixels(x, y: Longword): Pointer;
    50 var ty: Longword;
    50 var ty: Longword;
    51 begin
    51 begin
    52 for ty:= 0 to TEXSIZE - 1 do
    52 for ty:= 0 to TEXSIZE - 1 do
    53 	Move(LandPixels[y * TEXSIZE + ty, x * TEXSIZE], tmpPixels[ty, 0], sizeof(Longword) * TEXSIZE);
    53 	Move(LandPixels[y * TEXSIZE + ty, x * TEXSIZE], tmpPixels[ty, 0], sizeof(Longword) * TEXSIZE);
    54 	
    54 
    55 Pixels:= @tmpPixels
    55 Pixels:= @tmpPixels
    56 end;
    56 end;
    57 
    57 
    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 $FF000000;
    63 		tmpPixels[ty, tx]:= Land[y * TEXSIZE + ty, x * TEXSIZE + tx] or $FF000000;
    64 	
    64 
    65 Pixels2:= @tmpPixels
    65 Pixels2:= @tmpPixels
    66 end;
    66 end;
    67 
    67 
    68 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    68 procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
    69 var tx, ty: Longword;
    69 var tx, ty: Longword;