diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 17543ac7a6be39a425846608fc94187934c2801f..b9c94caeac62c0e6a10a5de10a51fb627f0ab6ec 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
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;