summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 67a536d)
raw | patch | inline | side by side (parent: 67a536d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Apr 2022 18:39:02 +0000 (21:39 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:27:13 +0000 (11:27 +0300) |
src/game/g_panel.pas | patch | blob | history | |
src/game/opengl/r_map.pas | patch | blob | history |
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;
index a2f3d18e39ead7935bc9b8b8ecb23582c8089c82..0339454519237989607b5ea2e78d7254b6eb78ec 100644 (file)
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