index a2ceab034c4c9739583be4a580241e1eeb6566ac..8345e785c504fa6b621aeb77bb7c979dc19f2bb7 100644 (file)
+{$MODE DELPHI}
unit g_playermodel;
interface
uses
- g_textures, g_basic, e_graphics, WADEDITOR,
- WADSTRUCT, g_weapons;
+ g_textures, g_basic, g_weapons, e_graphics, wadreader;
const
A_STAND = 0;
function g_PlayerModel_Load(FileName: string): Boolean;
var
ID: DWORD;
- a, b, len, aa, bb, f: Integer;
+ a, b, len, lenpd, lenpd2, aa, bb, f: Integer;
cc: TDirection;
config: TConfig;
pData, pData2: Pointer;
- WAD: TWADEditor_1;
+ WAD: TWADFile;
s: string;
prefix: string;
ok: Boolean;
Result := False;
- WAD := TWADEditor_1.Create;
+ WAD := TWADFile.Create;
WAD.ReadFile(FileName);
- if WAD.GetLastError <> DFWAD_NOERROR then
+ if {WAD.GetLastError <> DFWAD_NOERROR} not WAD.isOpen then
begin
WAD.Free();
Exit;
SetLength(Gibs, ReadInt('Gibs', 'count', 0));
if (Gibs <> nil) and
- (WAD.GetResource('TEXTURES', config.ReadStr('Gibs', 'resource', 'GIBS'), pData, len)) and
- (WAD.GetResource('TEXTURES', config.ReadStr('Gibs', 'mask', 'GIBSMASK'), pData2, len)) then
+ (WAD.GetResource('TEXTURES', config.ReadStr('Gibs', 'resource', 'GIBS'), pData, lenpd)) and
+ (WAD.GetResource('TEXTURES', config.ReadStr('Gibs', 'mask', 'GIBSMASK'), pData2, lenpd2)) then
begin
for a := 0 to High(Gibs) do
- if e_CreateTextureMemEx(pData, Gibs[a].ID, a*32, 0, 32, 32) and
- e_CreateTextureMemEx(pData2, Gibs[a].MaskID, a*32, 0, 32, 32) then
+ if e_CreateTextureMemEx(pData, lenpd, Gibs[a].ID, a*32, 0, 32, 32) and
+ e_CreateTextureMemEx(pData2, lenpd2, Gibs[a].MaskID, a*32, 0, 32, 32) then
begin
Gibs[a].Rect := e_GetTextureSize2(Gibs[a].ID);
with Gibs[a].Rect do