Texture: Cardinal; // Textures[Texture]
case Anim: Boolean of
False: ();
- True: (AnTex: TAnimationState);
+ True: (AnTex: TAnimState);
end;
PPanel = ^TPanel;
FTextureIDs[i].Anim := Textures[AddTextures[i].Texture].FramesCount > 0;
if FTextureIDs[i].Anim then
begin // Àíèìèðîâàííàÿ òåêñòóðà
- FTextureIDs[i].AnTex := TAnimationState.Create(True, Textures[AddTextures[i].Texture].Speed, Textures[AddTextures[i].Texture].FramesCount);
+ FTextureIDs[i].AnTex := TAnimState.Create(True, Textures[AddTextures[i].Texture].Speed, Textures[AddTextures[i].Texture].FramesCount);
end
end;
begin
for i := 0 to High(FTextureIDs) do
if FTextureIDs[i].Anim then
- FTextureIDs[i].AnTex.Free();
+ FTextureIDs[i].AnTex.Invalidate;
SetLength(FTextureIDs, 0);
Inherited;
if (FCurTexture >= 0) and
(FTextureIDs[FCurTexture].Anim) and
- (FTextureIDs[FCurTexture].AnTex <> nil) and
+ (FTextureIDs[FCurTexture].AnTex.IsValid()) and
(FAlpha < 255) then
begin
FTextureIDs[FCurTexture].AnTex.Update();
begin
if Enabled and (FCurTexture >= 0) and
(FTextureIDs[FCurTexture].Anim) and
- (FTextureIDs[FCurTexture].AnTex <> nil) and
+ (FTextureIDs[FCurTexture].AnTex.IsValid()) and
(Width > 0) and (Height > 0) and (FAlpha < 255) then
begin
FCurFrame := ClampInt(Frame, 0, FTextureIDs[FCurTexture].AnTex.TotalFrames - 1);
// Ïåðåêëþ÷èëèñü íà âèäèìóþ àíèì. òåêñòóðó:
if (FCurTexture >= 0) and FTextureIDs[FCurTexture].Anim then
begin
- if (FTextureIDs[FCurTexture].AnTex = nil) then
+ if (FTextureIDs[FCurTexture].AnTex.IsInvalid()) then
begin
g_FatalError(_lc[I_GAME_ERROR_SWITCH_TEXTURE]);
Exit;
// Ïåðåêëþ÷èëèñü íà âèäèìóþ àíèì. òåêñòóðó:
if (FCurTexture >= 0) and FTextureIDs[FCurTexture].Anim then
begin
- if (FTextureIDs[FCurTexture].AnTex = nil) then
+ if (FTextureIDs[FCurTexture].AnTex.IsInvalid()) then
begin
g_FatalError(_lc[I_GAME_ERROR_SWITCH_TEXTURE]);
Exit;
Result := Length(FTextureIDs);
if Enabled and (FCurTexture >= 0) then
if (FTextureIDs[FCurTexture].Anim) and
- (FTextureIDs[FCurTexture].AnTex <> nil) and
+ (FTextureIDs[FCurTexture].AnTex.IsValid()) and
(Width > 0) and (Height > 0) and (FAlpha < 255) then
Result := Result + 100;
end;
// Àíèìèðîâàíà ëè òåêóùàÿ òåêñòóðà
if (FCurTexture >= 0) and (FTextureIDs[FCurTexture].Anim) then
begin
- assert(FTextureIDs[FCurTexture].AnTex <> nil, 'TPanel.SaveState: No animation object');
+ assert(FTextureIDs[FCurTexture].AnTex.IsValid(), 'TPanel.SaveState: No animation object');
anim := true;
end
else
// Åñëè äà - çàãðóæàåì àíèìàöèþ
Assert((FCurTexture >= 0) and
(FTextureIDs[FCurTexture].Anim) and
- (FTextureIDs[FCurTexture].AnTex <> nil),
+ (FTextureIDs[FCurTexture].AnTex.IsValid()),
'TPanel.LoadState: No animation object');
FTextureIDs[FCurTexture].AnTex.LoadState(st, FAlpha, FBlending);
end;
IsAnim := RenTextures[Texture].Anim;
if IsAnim then
begin
- if p.TextureIDs[p.FCurTexture].AnTex <> nil then
+ if p.TextureIDs[p.FCurTexture].AnTex.IsValid() then
begin
FramesID := RenTextures[Texture].ID;
w := RenTextures[Texture].Width;
h := RenTextures[Texture].Height;
for xx := 0 to tw div w - 1 do
for yy := 0 to th div h - 1 do
- r_AnimationState_Draw(FramesID, p.TextureIDs[p.FCurTexture].AnTex, tx + xx * w, ty + yy * h, p.Alpha, TMirrorType.None, p.Blending);
+ r_AnimState_Draw(FramesID, p.TextureIDs[p.FCurTexture].AnTex, tx + xx * w, ty + yy * h, p.Alpha, TMirrorType.None, p.Blending);
end
end
else