diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 9d08ba32f7e97d1f3a956ca2c72bbfae161b2f60..71c653e29e8330a6924f182ceef8a485d5537ef8 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
type
TAddTextureArray = array of record
Texture: Cardinal; // Textures[Texture]
type
TAddTextureArray = array of record
Texture: Cardinal; // Textures[Texture]
- Anim: Boolean;
end;
ATextureID = array of record
end;
ATextureID = array of record
const
private
mGUID: Integer; // will be assigned in "g_map.pas"
const
private
mGUID: Integer; // will be assigned in "g_map.pas"
- FTextureWidth: Word;
- FTextureHeight: Word;
FAlpha: Byte;
FBlending: Boolean;
FTextureIDs: ATextureID;
FAlpha: Byte;
FBlending: Boolean;
FTextureIDs: ATextureID;
(* private state *)
property Alpha: Byte read FAlpha;
(* private state *)
property Alpha: Byte read FAlpha;
- property TextureWidth: Word read FTextureWidth;
- property TextureHeight: Word read FTextureHeight;
property Blending: Boolean read FBlending;
property TextureIDs: ATextureID read FTextureIDs;
property Blending: Boolean read FBlending;
property TextureIDs: ATextureID read FTextureIDs;
for i := 0 to Length(FTextureIDs)-1 do
begin
FTextureIDs[i].Texture := AddTextures[i].Texture;
for i := 0 to Length(FTextureIDs)-1 do
begin
FTextureIDs[i].Texture := AddTextures[i].Texture;
- FTextureIDs[i].Anim := AddTextures[i].Anim;
+ 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);
if FTextureIDs[i].Anim then
begin // Àíèìèðîâàííàÿ òåêñòóðà
FTextureIDs[i].AnTex := TAnimationState.Create(True, Textures[AddTextures[i].Texture].Speed, Textures[AddTextures[i].Texture].FramesCount);
if ({PanelRec.TextureNum}tnum > High(Textures)) then
begin
e_WriteLog(Format('WTF?! tnum is out of limits! (%d : %d)', [tnum, High(Textures)]), TMsgType.Warning);
if ({PanelRec.TextureNum}tnum > High(Textures)) then
begin
e_WriteLog(Format('WTF?! tnum is out of limits! (%d : %d)', [tnum, High(Textures)]), TMsgType.Warning);
- FTextureWidth := 2;
- FTextureHeight := 2;
FAlpha := 0;
FBlending := ByteBool(0);
end
else if not g_Map_IsSpecialTexture(Textures[{PanelRec.TextureNum}tnum].TextureName) then
begin
FAlpha := 0;
FBlending := ByteBool(0);
end
else if not g_Map_IsSpecialTexture(Textures[{PanelRec.TextureNum}tnum].TextureName) then
begin
- FTextureWidth := Textures[{PanelRec.TextureNum}tnum].Width;
- FTextureHeight := Textures[{PanelRec.TextureNum}tnum].Height;
FAlpha := PanelRec.Alpha;
FBlending := ByteBool(PanelRec.Flags and PANEL_FLAG_BLENDING);
end;
FAlpha := PanelRec.Alpha;
FBlending := ByteBool(PanelRec.Flags and PANEL_FLAG_BLENDING);
end;
function TPanel.GetTextureID(): DWORD;
begin
Result := LongWord(TEXTURE_NONE);
function TPanel.GetTextureID(): DWORD;
begin
Result := LongWord(TEXTURE_NONE);
- if (FCurTexture >= 0) then
- begin
- if FTextureIDs[FCurTexture].Anim then
- Result := Textures[FTextureIDs[FCurTexture].Texture].FramesID
- else
- Result := Textures[FTextureIDs[FCurTexture].Texture].TextureID
+// if (FCurTexture >= 0) then
+// begin
+// if FTextureIDs[FCurTexture].Anim then
+// Result := Textures[FTextureIDs[FCurTexture].Texture].FramesID
+// else
+// Result := Textures[FTextureIDs[FCurTexture].Texture].TextureID
{
// !!! old behavior
if FTextureIDs[FCurTexture].Anim then
{
// !!! old behavior
if FTextureIDs[FCurTexture].Anim then
else
Result := FTextureIDs[FCurTexture].Tex;
}
else
Result := FTextureIDs[FCurTexture].Tex;
}
- end
+// end
end;
function TPanel.GetTextureCount(): Integer;
end;
function TPanel.GetTextureCount(): Integer;