summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b9f9f49)
raw | patch | inline | side by side (parent: b9f9f49)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 21 Sep 2017 10:52:18 +0000 (13:52 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 21 Sep 2017 10:53:30 +0000 (13:53 +0300) |
src/game/g_map.pas | patch | blob | history | |
src/game/g_panel.pas | patch | blob | history |
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index cf60d78b958b52376470cb7450ee71bd66b16283..46db3faae77a9079d5a1fd43b3af92f77f9e90e1 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
if TextNameHash.get(RecName, result) then
begin
// i found her!
- //e_LogWritefln('texture ''%s'' already loaded', [RecName]);
+ //e_LogWritefln('texture ''%s'' already loaded (%s)', [RecName, result]);
exit;
end;
SetLength(Textures, Length(Textures)+1);
if not e_CreateTextureMem(TextureData, ResLength, Textures[High(Textures)].TextureID) then
begin
+ e_WriteLog(Format('Error loading texture %s', [RecName]), TMsgType.Warning);
SetLength(Textures, Length(Textures)-1);
+ result := -1;
Exit;
end;
e_GetTextureSize(Textures[High(Textures)].TextureID, @Textures[High(Textures)].Width, @Textures[High(Textures)].Height);
if TextNameHash.get(RecName, result) then
begin
// i found her!
- //e_LogWritefln('animated texture ''%s'' already loaded', [RecName]);
+ //e_LogWritefln('animated texture ''%s'' already loaded (%s)', [RecName, result]);
exit;
end;
//e_LogWritefln('PANADD: pannum=%s', [pannum]);
// Ñîçäàåì ïàíåëü è çàïîìèíàåì åå GUID
+ //e_LogWritefln('new panel; tcount=%s; curtex=%s', [Length(AddTextures), CurTex]);
PanelID := CreatePanel(rec, AddTextures, CurTex);
//e_LogWritefln('panel #%s of type %s got guid #%s', [pannum, rec.PanelType, PanelID]);
rec.userPanelId := PanelID; // remember game panel id, we'll fix triggers later
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index f5a6bddcc70c0b38640f1e1153679eb815ca3519..226515a5dc6a6381ba1d080f0e1f3bf3ac58e775 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
var Textures: TLevelTextureArray; aguid: Integer);
var
i: Integer;
+ tnum: Integer;
begin
X := PanelRec.X;
Y := PanelRec.Y;
// Òåêñòóð íåñêîëüêî - íóæíî ñîõðàíÿòü òåêóùóþ:
//if Length(FTextureIDs) > 1 then SaveIt := True;
+ if (PanelRec.TextureRec = nil) then tnum := -1 else tnum := PanelRec.tagInt;
+ if (tnum < 0) then tnum := Length(Textures);
+
// Åñëè íå ñïåöòåêñòóðà, òî çàäàåì ðàçìåðû:
- if PanelRec.TextureNum > High(Textures) then
+ if ({PanelRec.TextureNum}tnum > High(Textures)) then
begin
- e_WriteLog(Format('WTF?! PanelRec.TextureNum is out of limits! (%d : %d)', [PanelRec.TextureNum, High(Textures)]), TMsgType.Fatal);
+ 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].TextureName) then
+ else if not g_Map_IsSpecialTexture(Textures[{PanelRec.TextureNum}tnum].TextureName) then
begin
- FTextureWidth := Textures[PanelRec.TextureNum].Width;
- FTextureHeight := Textures[PanelRec.TextureNum].Height;
+ FTextureWidth := Textures[{PanelRec.TextureNum}tnum].Width;
+ FTextureHeight := Textures[{PanelRec.TextureNum}tnum].Height;
FAlpha := PanelRec.Alpha;
FBlending := ByteBool(PanelRec.Flags and PANEL_FLAG_BLENDING);
end;