From 66487b9264a791df057975695339448eb3d7ba2f Mon Sep 17 00:00:00 2001 From: binarymaster Date: Tue, 26 Sep 2017 18:19:51 +0300 Subject: [PATCH] Cleanup: Eliminate warnings and hints --- src/editor/f_addresource_sky.pas | 2 +- src/editor/f_addresource_texture.pas | 6 +----- src/editor/f_main.pas | 1 - src/editor/g_map.pas | 9 +++++++++ src/engine/e_textures.pas | 8 -------- src/shared/WADEDITOR.pas | 2 +- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/editor/f_addresource_sky.pas b/src/editor/f_addresource_sky.pas index 9211205..9eea718 100644 --- a/src/editor/f_addresource_sky.pas +++ b/src/editor/f_addresource_sky.pas @@ -44,7 +44,7 @@ var Height: Integer; ColorDepth: Integer; ImageSize: Integer; - I, x, y: Integer; + x, y: Integer; BitMap: TBitMap; TextureData: Pointer; diff --git a/src/editor/f_addresource_texture.pas b/src/editor/f_addresource_texture.pas index 1402b13..f3b3fad 100644 --- a/src/editor/f_addresource_texture.pas +++ b/src/editor/f_addresource_texture.pas @@ -240,9 +240,7 @@ var ii: PByte; Width, Height: Integer; - ColorDepth: Integer; - ImageSize: Integer; - i, x, y: Integer; + x, y: Integer; BitMap: TBitMap; begin @@ -254,8 +252,6 @@ begin Width := img.width; Height := img.height; - ColorDepth := 24; - ImageSize := Width*Height*(ColorDepth div 8); BitMap := TBitMap.Create(); BitMap.PixelFormat := pf24bit; diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index ab72ebe..2216151 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -6248,7 +6248,6 @@ var cmd, mapWAD, mapToRun: String; opt: LongWord; time: Integer; - lpMsgBuf: PChar; begin // Сохраняем временную карту: time := 0; diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas index 237c247..0a97da7 100644 --- a/src/editor/g_map.pas +++ b/src/editor/g_map.pas @@ -701,6 +701,7 @@ var begin Result := False; + PanelID := DWORD(-1); case ObjectType of OBJECT_PANEL: @@ -1065,6 +1066,14 @@ var begin WAD := nil; + textures := nil; + panels := nil; + items := nil; + areas := nil; + monsters := nil; + triggers := nil; + PanelTable := nil; + MonsterTable := nil; // Открываем WAD, если надо: if Res <> '' then diff --git a/src/engine/e_textures.pas b/src/engine/e_textures.pas index 52a1e92..6055678 100644 --- a/src/engine/e_textures.pas +++ b/src/engine/e_textures.pas @@ -76,8 +76,6 @@ function CreateTexture (var tex: GLTexture; Width, Height, aFormat: Word; pData: var Texture: GLuint; fmt: GLenum; - buf: PByte; - f, c: Integer; begin tex.width := Width; tex.height := Height; @@ -216,12 +214,7 @@ end; function LoadTextureMem (pData: Pointer; dataSize: LongInt; var Texture: GLTexture; var pWidth, pHeight: Word; Fmt: PWord=nil): Boolean; var - image, ii: PByte; - width, height: Integer; - imageSize: Integer; img: TImageData; - x, y: Integer; - clr: TColor32Rec; begin result := false; pWidth := 0; @@ -245,7 +238,6 @@ end; function LoadTextureMemEx (pData: Pointer; dataSize: LongInt; var Texture: GLTexture; fX, fY, fWidth, fHeight: Word; Fmt: PWord=nil): Boolean; var image, ii: PByte; - width, height: Integer; imageSize: Integer; img: TImageData; x, y: Integer; diff --git a/src/shared/WADEDITOR.pas b/src/shared/WADEDITOR.pas index e68fd21..d218355 100644 --- a/src/shared/WADEDITOR.pas +++ b/src/shared/WADEDITOR.pas @@ -143,7 +143,7 @@ begin P := OutBuf; Inc(OutBytes, 256); ReallocMem(OutBuf, OutBytes); - strm.next_out := PByteF(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P))); + strm.next_out := PByteF(PtrUInt(OutBuf + (strm.next_out - P))); strm.avail_out := 256; end; finally -- 2.29.2