summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f80b377)
raw | patch | inline | side by side (parent: f80b377)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 30 Jul 2017 21:07:18 +0000 (00:07 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 30 Jul 2017 22:37:05 +0000 (01:37 +0300) |
src/engine/e_input.pas | patch | blob | history | |
src/shared/BinEditor.pas | patch | blob | history | |
src/shared/MAPREADER.pas | patch | blob | history |
diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas
index 2a2f435de2c5d5c8ce606e87d9788292995dd766..269a1d17c85c81e277f6ffeaaca4f20a3cba179f 100644 (file)
--- a/src/engine/e_input.pas
+++ b/src/engine/e_input.pas
var
Keys: PByte;
NKeys: Integer;
- i: NativeInt;
+ i: NativeUInt;
begin
Result := False;
Keys := SDL_GetKeyboardState(@NKeys);
if (Keys = nil) or (NKeys < 1) then
Exit;
for i := 0 to NKeys do
- KeyBuffer[i] := ((PByte(NativeInt(Keys) + i)^) <> 0);
+ KeyBuffer[i] := ((PByte(NativeUInt(Keys) + i)^) <> 0);
for i := NKeys to High(KeyBuffer) do
KeyBuffer[i] := False;
end;
index cd0eb068ebdb7d0785b5d149b7aa02573b5e6621..9e77d0e761a80deb27de588e6886cd591710c330 100644 (file)
--- a/src/shared/BinEditor.pas
+++ b/src/shared/BinEditor.pas
if (FPosition + varSize) > FSize then
ExtendMemory(varSize);
- CopyMemory(Pointer(NativeInt(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@x, varSize);
FPosition := FPosition + varSize;
end;
ExtendMemory(SizeOf(Byte) + len);
// Äëèíà ñòðîêè:
- CopyMemory(Pointer(NativeInt(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@len, SizeOf(Byte));
FPosition := FPosition + SizeOf(Byte);
// Ñòðîêà:
if len > 0 then
begin
- CopyMemory(Pointer(NativeInt(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@x[1], len);
FPosition := FPosition + len;
end;
ExtendMemory(SizeOf(Cardinal) + memSize);
// Äëèíà áëîêà ïàìÿòè:
- CopyMemory(Pointer(NativeInt(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@memSize, SizeOf(Cardinal));
FPosition := FPosition + SizeOf(Cardinal);
// Áëîê ïàìÿòè:
if memSize > 0 then
begin
- CopyMemory(Pointer(NativeInt(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
x, memSize);
FPosition := FPosition + memSize;
end;
if aLen > 0 then
begin
- FillMemory(Pointer(NativeInt(FData) + FPosition),
+ FillMemory(Pointer(NativeUInt(FData) + FPosition),
aLen, aFillSym);
FPosition := FPosition + aLen;
end;
if (FPosition + varSize) <= FSize then
begin
CopyMemory(@x,
- Pointer(NativeInt(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
varSize);
FPosition := FPosition + varSize;
end
begin
// Äëèíà ñòðîêè:
CopyMemory(@len,
- Pointer(NativeInt(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
SizeOf(Byte));
if (FPosition + SizeOf(Byte) + len) <= FSize then
if len > 0 then
begin
CopyMemory(@x[1],
- Pointer(NativeInt(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
len);
FPosition := FPosition + len;
end
begin
GetMem(x, memSize);
CopyMemory(x,
- Pointer(NativeInt(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
memSize);
FPosition := FPosition + memSize;
end
index a122bee5cb0b13d6f47ba5679edf30d3cdc0c31f..93de6b08a86c090249a64a2029ba5c1471c434a1 100644 (file)
--- a/src/shared/MAPREADER.pas
+++ b/src/shared/MAPREADER.pas
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: NativeInt;
+ b, Size: NativeUInt;
begin
Result := nil;
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TAreaRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TAreaRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: NativeInt;
+ b, Size: NativeUInt;
begin
Result := nil;
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TItemRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TItemRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: NativeInt;
+ b, Size: NativeUInt;
begin
Result := nil;
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TMonsterRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TMonsterRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: NativeInt;
+ b, Size: NativeUInt;
begin
Result := nil;
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TPanelRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TPanelRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: NativeInt;
+ b, Size: NativeUInt;
begin
Result := nil;
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TTextureRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TTextureRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b: NativeInt;
+ b: NativeUInt;
Size: LongWord;
trdata: TTriggerData;
begin
begin
SetLength(Result, Length(Result)+1);
//CopyMemory(@Result[High(Result)], Pointer(LongWord(TempDataBlocks[a].Data)+b*size), size);
- mb_Read_TTriggerRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TTriggerRec_1(Result[High(Result)], Pointer(NativeUInt(TempDataBlocks[a].Data)+b*size)^, size);
if (Result[High(Result)].TriggerType <> 0) then
begin
// preprocess trigger data
function TMapReader.LoadMap(Data: Pointer): Boolean;
var
- adr: NativeInt;
+ adr: NativeUInt;
_id: Integer;
Sign: array[0..2] of Char;
Ver: Byte;
end;
adr := 3;
- CopyMemory(@Ver, Pointer(NativeInt(Data)+adr), 1);
+ CopyMemory(@Ver, Pointer(NativeUInt(Data)+adr), 1);
FVersion := Ver;
if Ver > HandledVersion() then
begin
SetLength(FDataBlocks, Length(FDataBlocks)+1);
_id := High(FDataBlocks);
- CopyMemory(@FDataBlocks[_id].Block, Pointer(NativeInt(Data)+adr), SizeOf(TBlock));
+ CopyMemory(@FDataBlocks[_id].Block, Pointer(NativeUInt(Data)+adr), SizeOf(TBlock));
adr := adr+SizeOf(TBlock);
FDataBlocks[_id].Data := GetMemory(FDataBlocks[_id].Block.BlockSize);
- CopyMemory(FDataBlocks[_id].Data, Pointer(NativeInt(Data)+adr), FDataBlocks[_id].Block.BlockSize);
+ CopyMemory(FDataBlocks[_id].Data, Pointer(NativeUInt(Data)+adr), FDataBlocks[_id].Block.BlockSize);
adr := adr+FDataBlocks[_id].Block.BlockSize;
until FDataBlocks[_id].Block.BlockType = BLOCK_NONE;