summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: acb0517)
raw | patch | inline | side by side (parent: acb0517)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 30 Jul 2017 17:53:14 +0000 (20:53 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 30 Jul 2017 22:36:52 +0000 (01:36 +0300) |
src/engine/e_input.pas | patch | blob | history | |
src/shared/BinEditor.pas | patch | blob | history | |
src/shared/MAPREADER.pas | patch | blob | history | |
src/sheditor/WADEDITOR_full.pas | patch | blob | history |
diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas
index d4081ee5615075eaa89c26fb80962c47e82e1dda..2a2f435de2c5d5c8ce606e87d9788292995dd766 100644 (file)
--- a/src/engine/e_input.pas
+++ b/src/engine/e_input.pas
var
Keys: PByte;
NKeys: Integer;
- i: Cardinal;
+ i: NativeInt;
begin
Result := False;
Keys := SDL_GetKeyboardState(@NKeys);
if (Keys = nil) or (NKeys < 1) then
Exit;
for i := 0 to NKeys do
- KeyBuffer[i] := ((PByte(Cardinal(Keys) + i)^) <> 0);
+ KeyBuffer[i] := ((PByte(NativeInt(Keys) + i)^) <> 0);
for i := NKeys to High(KeyBuffer) do
KeyBuffer[i] := False;
end;
index 251f07573646492e99edf75eb1669e3cb581dbe9..cd0eb068ebdb7d0785b5d149b7aa02573b5e6621 100644 (file)
--- a/src/shared/BinEditor.pas
+++ b/src/shared/BinEditor.pas
if (FPosition + varSize) > FSize then
ExtendMemory(varSize);
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeInt(FData) + FPosition),
@x, varSize);
FPosition := FPosition + varSize;
end;
ExtendMemory(SizeOf(Byte) + len);
// Äëèíà ñòðîêè:
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeInt(FData) + FPosition),
@len, SizeOf(Byte));
FPosition := FPosition + SizeOf(Byte);
// Ñòðîêà:
if len > 0 then
begin
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeInt(FData) + FPosition),
@x[1], len);
FPosition := FPosition + len;
end;
ExtendMemory(SizeOf(Cardinal) + memSize);
// Äëèíà áëîêà ïàìÿòè:
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeInt(FData) + FPosition),
@memSize, SizeOf(Cardinal));
FPosition := FPosition + SizeOf(Cardinal);
// Áëîê ïàìÿòè:
if memSize > 0 then
begin
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeInt(FData) + FPosition),
x, memSize);
FPosition := FPosition + memSize;
end;
if aLen > 0 then
begin
- FillMemory(Pointer(Cardinal(FData) + FPosition),
+ FillMemory(Pointer(NativeInt(FData) + FPosition),
aLen, aFillSym);
FPosition := FPosition + aLen;
end;
if (FPosition + varSize) <= FSize then
begin
CopyMemory(@x,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeInt(FData) + FPosition),
varSize);
FPosition := FPosition + varSize;
end
begin
// Äëèíà ñòðîêè:
CopyMemory(@len,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeInt(FData) + FPosition),
SizeOf(Byte));
if (FPosition + SizeOf(Byte) + len) <= FSize then
if len > 0 then
begin
CopyMemory(@x[1],
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeInt(FData) + FPosition),
len);
FPosition := FPosition + len;
end
begin
// Äëèíà áëîêà ïàìÿòè:
CopyMemory(@memSize,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer((FData) + FPosition),
SizeOf(Cardinal));
if (FPosition + SizeOf(Cardinal) + memSize) <= FSize then
begin
GetMem(x, memSize);
CopyMemory(x,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeInt(FData) + FPosition),
memSize);
FPosition := FPosition + memSize;
end
index 6c9e86326551d7b0d24ba7e8151aed028e565c01..a122bee5cb0b13d6f47ba5679edf30d3cdc0c31f 100644 (file)
--- a/src/shared/MAPREADER.pas
+++ b/src/shared/MAPREADER.pas
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b, Size: NativeInt;
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TAreaRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b, Size: NativeInt;
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TItemRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b, Size: NativeInt;
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TMonsterRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b, Size: NativeInt;
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TPanelRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b, Size: NativeInt;
begin
Result := nil;
for b := 0 to (TempDataBlocks[a].Block.BlockSize div size)-1 do
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ //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);
end;
TempDataBlocks := nil;
var
TempDataBlocks: TDataBlocksArray;
a: Integer;
- b, Size: LongWord;
+ b: NativeInt;
+ Size: LongWord;
trdata: TTriggerData;
begin
Result := nil;
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(LongWord(TempDataBlocks[a].Data)+b*size)^, size);
+ mb_Read_TTriggerRec_1(Result[High(Result)], Pointer(NativeInt(TempDataBlocks[a].Data)+b*size)^, size);
if (Result[High(Result)].TriggerType <> 0) then
begin
// preprocess trigger data
if FDataBlocks[a].Block.BlockType = BlocksType then
begin
SetLength(Result, Length(Result)+1);
- Result[High(Result)] := FDataBlocks[a];
+ Result[High(Result)] := FDataBlocks[a];
end;
end;
function TMapReader.LoadMap(Data: Pointer): Boolean;
var
- adr: LongWord;
+ adr: NativeInt;
_id: Integer;
Sign: array[0..2] of Char;
Ver: Byte;
end;
adr := 3;
- CopyMemory(@Ver, Pointer(LongWord(Data)+adr), 1);
+ CopyMemory(@Ver, Pointer(NativeInt(Data)+adr), 1);
FVersion := Ver;
if Ver > HandledVersion() then
begin
SetLength(FDataBlocks, Length(FDataBlocks)+1);
_id := High(FDataBlocks);
- CopyMemory(@FDataBlocks[_id].Block, Pointer(LongWord(Data)+adr), SizeOf(TBlock));
+ CopyMemory(@FDataBlocks[_id].Block, Pointer(NativeInt(Data)+adr), SizeOf(TBlock));
adr := adr+SizeOf(TBlock);
FDataBlocks[_id].Data := GetMemory(FDataBlocks[_id].Block.BlockSize);
- CopyMemory(FDataBlocks[_id].Data, Pointer(LongWord(Data)+adr), FDataBlocks[_id].Block.BlockSize);
+ CopyMemory(FDataBlocks[_id].Data, Pointer(NativeInt(Data)+adr), FDataBlocks[_id].Block.BlockSize);
adr := adr+FDataBlocks[_id].Block.BlockSize;
until FDataBlocks[_id].Block.BlockType = BLOCK_NONE;
index f58c4850b0fd3b14ab7401c585a7f6228ddc56e6..4c61f454d8c1c021d51f7a147959cbc666b22c70 100644 (file)
else
begin
TempData := GetMemory(FResTable[i].Length);
- CopyMemory(TempData, Pointer(LongWord(FResData)+FResTable[i].Address+6+
+ CopyMemory(TempData, Pointer(NativeUInt(FResData)+FResTable[i].Address+6+
LongWord(SizeOf(TWADHeaderRec_1)+SizeOf(TResourceTableRec_1)*Length(FResTable))),
FResTable[i].Length);
DecompressBuf(TempData, FResTable[i].Length, 0, pData, OutBytes);
Exit;
end;
- CopyMemory(@FVersion, Pointer(LongWord(Data)+5), 1);
+ CopyMemory(@FVersion, Pointer(NativeUInt(Data)+5), 1);
if FVersion <> DFWAD_VERSION then
begin
FLastError := DFWAD_ERROR_WRONGVERSION;
Exit;
end;
- CopyMemory(@FHeader, Pointer(LongWord(Data)+6), SizeOf(TWADHeaderRec_1));
+ CopyMemory(@FHeader, Pointer(NativeUInt(Data)+6), SizeOf(TWADHeaderRec_1));
SetLength(FResTable, FHeader.RecordsCount);
if FResTable <> nil then
begin
- CopyMemory(@FResTable[0], Pointer(LongWord(Data)+6+SizeOf(TWADHeaderRec_1)),
+ CopyMemory(@FResTable[0], Pointer(NativeUInt(Data)+6+SizeOf(TWADHeaderRec_1)),
SizeOf(TResourceTableRec_1)*FHeader.RecordsCount);
for a := 0 to High(FResTable) do