index 1be9bbc1632a075034c504a8105d791278d31def..0f508d70a58a71ec51239be52a162bf7477d30a1 100644 (file)
uses
{$INCLUDE ../nogl/noGLuses.inc}
uses
{$INCLUDE ../nogl/noGLuses.inc}
- SysUtils, Classes, Math, utils,
- e_log, wadreader, CONFIG,
+ SysUtils, Classes, Math, e_log, wadreader, CONFIG, utils,
r_graphics, r_animations, r_textures,
g_base, g_basic, g_game, g_options,
g_map
r_graphics, r_animations, r_textures,
g_base, g_basic, g_game, g_options,
g_map
RenTextures: array of record
ID: DWORD;
Width, Height: WORD;
RenTextures: array of record
ID: DWORD;
Width, Height: WORD;
+ Anim: Boolean;
end;
procedure r_Map_LoadTextures;
end;
procedure r_Map_LoadTextures;
SetLength(RenTextures, n);
for i := 0 to n - 1 do
begin
SetLength(RenTextures, n);
for i := 0 to n - 1 do
begin
+ // e_LogWritefln('r_Map_LoadTextures: -> [%s] :: [%s]', [Textures[i].FullName, Textures[i].TextureName]);
RenTextures[i].ID := LongWord(TEXTURE_NONE);
RenTextures[i].Width := 0;
RenTextures[i].Height := 0;
RenTextures[i].ID := LongWord(TEXTURE_NONE);
RenTextures[i].Width := 0;
RenTextures[i].Height := 0;
+ RenTextures[i].Anim := False;
case Textures[i].TextureName of
TEXTURE_NAME_WATER: RenTextures[i].ID := LongWord(TEXTURE_SPECIAL_WATER);
TEXTURE_NAME_ACID1: RenTextures[i].ID := LongWord(TEXTURE_SPECIAL_ACID1);
case Textures[i].TextureName of
TEXTURE_NAME_WATER: RenTextures[i].ID := LongWord(TEXTURE_SPECIAL_WATER);
TEXTURE_NAME_ACID1: RenTextures[i].ID := LongWord(TEXTURE_SPECIAL_ACID1);
begin
if WAD.GetResource(ResName, ResData, ResLen, log) then
begin
begin
if WAD.GetResource(ResName, ResData, ResLen, log) then
begin
- if Textures[i].Anim then
+ if IsWadData(ResData, ResLen) then
begin
WADz := TWADFile.Create();
if WADz.ReadMemory(ResData, ResLen) then
begin
WADz := TWADFile.Create();
if WADz.ReadMemory(ResData, ResLen) then
begin
if WADz.GetResource('TEXTURES/' + TextureResource, ReszData, ReszLen) then
begin
begin
if WADz.GetResource('TEXTURES/' + TextureResource, ReszData, ReszLen) then
begin
- if not g_Frames_CreateMemory(@RenTextures[i].ID, '', ReszData, ReszLen, Width, Height, FramesCount, BackAnim) then
+ if g_Frames_CreateMemory(@RenTextures[i].ID, '', ReszData, ReszLen, Width, Height, FramesCount, BackAnim) then
+ RenTextures[i].Anim := True
+ else
e_LogWritefln('r_Map_LoadTextures: failed to create frames object (%s)', [Textures[i].FullName]);
FreeMem(ReszData)
end
e_LogWritefln('r_Map_LoadTextures: failed to create frames object (%s)', [Textures[i].FullName]);
FreeMem(ReszData)
end
begin
Panel_Lerp(p, gLerpFactor, tx, ty, tw, th);
Texture := p.TextureIDs[p.FCurTexture].Texture;
begin
Panel_Lerp(p, gLerpFactor, tx, ty, tw, th);
Texture := p.TextureIDs[p.FCurTexture].Texture;
- IsAnim := p.TextureIDs[p.FCurTexture].Anim;
+ IsAnim := RenTextures[Texture].Anim;
if IsAnim then
begin
if p.TextureIDs[p.FCurTexture].AnTex <> nil then
if IsAnim then
begin
if p.TextureIDs[p.FCurTexture].AnTex <> nil then
if p.Enabled and (p.FCurTexture >= 0) and (p.Width > 0) and (p.Height > 0) and (p.Alpha < 255) {and g_Collide(X, Y, tw, th, sX, sY, sWidth, sHeight)} then
begin
Panel_Lerp(p, gLerpFactor, tx, ty, tw, th);
if p.Enabled and (p.FCurTexture >= 0) and (p.Width > 0) and (p.Height > 0) and (p.Alpha < 255) {and g_Collide(X, Y, tw, th, sX, sY, sWidth, sHeight)} then
begin
Panel_Lerp(p, gLerpFactor, tx, ty, tw, th);
- if not p.TextureIDs[p.FCurTexture].Anim then
+ Texture := p.TextureIDs[p.FCurTexture].Texture;
+ if not RenTextures[Texture].Anim then
begin
begin
- Texture := p.TextureIDs[p.FCurTexture].Texture;
case RenTextures[Texture].ID of
LongWord(TEXTURE_SPECIAL_WATER): exit;
LongWord(TEXTURE_SPECIAL_ACID1): exit;
case RenTextures[Texture].ID of
LongWord(TEXTURE_SPECIAL_WATER): exit;
LongWord(TEXTURE_SPECIAL_ACID1): exit;