diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 39a6692f2b228df76f4274e25abc139397a58b8a..722bd9bb1cdc2a8cf6625a9399795176a29979ea 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
if g_Game_IsClient then Exit;
if (gGameSettings.GameType = GT_SINGLE)
if g_Game_IsClient then Exit;
if (gGameSettings.GameType = GT_SINGLE)
- or LongBool(gGameSettings.Options and GAME_OPTION_MONSTERS) then
+ or (TGameOption.MONSTERS in gGameSettings.Options) then
begin
mon := g_Monsters_Create(monster.MonsterType, monster.X, monster.Y, TDirection(monster.Direction));
begin
mon := g_Monsters_Create(monster.MonsterType, monster.X, monster.Y, TDirection(monster.Direction));
cnt := -1;
for rec in mapTextureList do
begin
cnt := -1;
for rec in mapTextureList do
begin
- Inc(cnt);
+ cnt += 1;
if not usedTextures.has(toLowerCase1251(rec.Resource)) then
begin
rec.tagInt := -1; // just in case
if not usedTextures.has(toLowerCase1251(rec.Resource)) then
begin
rec.tagInt := -1; // just in case
e_LogWritefln(' Loading texture #%d: %s', [cnt, rec.Resource]);
{$ENDIF}
//if g_Map_IsSpecialTexture(s) then e_WriteLog(' SPECIAL!', MSG_NOTIFY);
e_LogWritefln(' Loading texture #%d: %s', [cnt, rec.Resource]);
{$ENDIF}
//if g_Map_IsSpecialTexture(s) then e_WriteLog(' SPECIAL!', MSG_NOTIFY);
+ // TODO: Unify the texture reader - static textures are a special case of dynamic ones, just with only one frame.
if rec.Anim then
begin
// Àíèìèðîâàííàÿ òåêñòóðà
ntn := CreateAnimTexture(rec.Resource, FileName, True);
if rec.Anim then
begin
// Àíèìèðîâàííàÿ òåêñòóðà
ntn := CreateAnimTexture(rec.Resource, FileName, True);
- if (ntn < 0) then g_SimpleError(Format(_lc[I_GAME_ERROR_TEXTURE_ANIM], [rec.Resource]));
+ if (ntn < 0) then
+ begin
+ // FIXME: I think, CreateAnimTexture() will load static textures too, just as animated ones with one frame.
+ ntn := CreateTexture(rec.Resource, FileName, False);
+ if (ntn < 0) then
+ g_SimpleError(Format(_lc[I_GAME_ERROR_TEXTURE_ANIM], [rec.Resource]))
+ else
+ begin
+ rec.user['animated'] := False;
+ e_LogWritefln(' wrong (outdated?) anim flag hint - texture #%d is actually static: %s', [cnt, rec.Resource]);
+ end;
+ end;
end
else
begin
// Îáû÷íàÿ òåêñòóðà
ntn := CreateTexture(rec.Resource, FileName, True);
end
else
begin
// Îáû÷íàÿ òåêñòóðà
ntn := CreateTexture(rec.Resource, FileName, True);
- if (ntn < 0) then g_SimpleError(Format(_lc[I_GAME_ERROR_TEXTURE_SIMPLE], [rec.Resource]));
+ if (ntn < 0) then
+ begin
+ ntn := CreateAnimTexture(rec.Resource, FileName, False);
+ if (ntn < 0) then
+ g_SimpleError(Format(_lc[I_GAME_ERROR_TEXTURE_SIMPLE], [rec.Resource]))
+ else
+ begin
+ rec.user['animated'] := True;
+ e_LogWritefln(' wrong (outdated?) anim flag hint - texture #%d is actually animated: %s', [cnt, rec.Resource]);
+ end;
+ end;
end;
if (ntn < 0) then ntn := CreateNullTexture(rec.Resource);
end;
if (ntn < 0) then ntn := CreateNullTexture(rec.Resource);
procedure g_Map_DrawFlags();
var
i, dx: Integer;
procedure g_Map_DrawFlags();
var
i, dx: Integer;
+ tx, ty: Integer;
Mirror: TMirrorType;
begin
if gGameSettings.GameMode <> GM_CTF then
Mirror: TMirrorType;
begin
if gGameSettings.GameMode <> GM_CTF then
if State = FLAG_STATE_NONE then
continue;
if State = FLAG_STATE_NONE then
continue;
+ Obj.lerp(gLerpFactor, tx, ty);
+
if Direction = TDirection.D_LEFT then
begin
Mirror := TMirrorType.Horizontal;
if Direction = TDirection.D_LEFT then
begin
Mirror := TMirrorType.Horizontal;
dx := 1;
end;
dx := 1;
end;
- Animation.Draw(Obj.X+dx, Obj.Y+1, Mirror);
+ Animation.Draw(tx+dx, ty+1, Mirror);
if g_debug_Frames then
begin
if g_debug_Frames then
begin
if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
begin
// Î÷êè Êðàñíîé êîìàíäû
if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
begin
// Î÷êè Êðàñíîé êîìàíäû
- utils.writeInt(st, SmallInt(gTeamStat[TEAM_RED].Goals));
+ utils.writeInt(st, SmallInt(gTeamStat[TEAM_RED].Score));
// Î÷êè Ñèíåé êîìàíäû
// Î÷êè Ñèíåé êîìàíäû
- utils.writeInt(st, SmallInt(gTeamStat[TEAM_BLUE].Goals));
+ utils.writeInt(st, SmallInt(gTeamStat[TEAM_BLUE].Score));
end;
///// /////
end;
end;
///// /////
end;
if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
begin
// Î÷êè Êðàñíîé êîìàíäû
if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
begin
// Î÷êè Êðàñíîé êîìàíäû
- gTeamStat[TEAM_RED].Goals := utils.readSmallInt(st);
+ gTeamStat[TEAM_RED].Score := utils.readSmallInt(st);
// Î÷êè Ñèíåé êîìàíäû
// Î÷êè Ñèíåé êîìàíäû
- gTeamStat[TEAM_BLUE].Goals := utils.readSmallInt(st);
+ gTeamStat[TEAM_BLUE].Score := utils.readSmallInt(st);
end;
///// /////
end;
end;
///// /////
end;