From 2b040fc5e37549ab8203056c07f6b3ceda3750ff Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Aug 2009 15:04:09 +0200 Subject: [PATCH] - Disabled use of normals (weren't really in use anyway) - Added updating of the last shortcut in TScreenBuffer --- Client/ULandscape.pas | 8 ++++++-- Client/UfrmMain.pas | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index ae4709a..87eb0b1 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -1269,7 +1269,9 @@ begin if (FShortCuts[0] = nil) or (CompareWorldItems(AItem, FShortCuts[0]) < 0) then begin - //TODO : update last element if necessary + if FShortCuts[0] = nil then + FShortCuts[-1] := Result; //Update last item + Result^.Next := FShortCuts[0]; FShortCuts[0] := Result; end else @@ -1289,7 +1291,9 @@ begin begin current := current^.Next; end; - //TODO : update last element if necessary + + if FShortCuts[-1] = current^.Next then + FShortCuts[-1] := Result; //Update last item Result^.Next := current^.Next; current^.Next := Result; diff --git a/Client/UfrmMain.pas b/Client/UfrmMain.pas index 6f514b9..418a9f3 100644 --- a/Client/UfrmMain.pas +++ b/Client/UfrmMain.pas @@ -1721,8 +1721,9 @@ begin if ABlockInfo^.HighRes <> nil then begin - New(ABlockInfo^.Normals); - FLandscape.GetNormals(item.X, item.Y, ABlockInfo^.Normals^); + {if ABlockInfo^.Normals = nil then + New(ABlockInfo^.Normals); + FLandscape.GetNormals(item.X, item.Y, ABlockInfo^.Normals^);} //Unused so far ABlockInfo^.DrawQuad[0][0] := drawX; ABlockInfo^.DrawQuad[0][1] := drawY - z * 4; ABlockInfo^.DrawQuad[1][0] := drawX + 22; @@ -1837,16 +1838,23 @@ begin if blockInfo^.HighRes <> nil then begin glBindTexture(GL_TEXTURE_2D, blockInfo^.HighRes.Texture); + + if not highlight then + glEnable(GL_LIGHTING); + glBegin(GL_QUADS); - glNormal3fv(@blockInfo^.Normals^[0]); + //glNormal3fv(@blockInfo^.Normals^[0]); glTexCoord2f(0, 0); glVertex2fv(@blockInfo^.DrawQuad[0]); - glNormal3fv(@blockInfo^.Normals^[3]); + //glNormal3fv(@blockInfo^.Normals^[3]); glTexCoord2f(0, 1); glVertex2fv(@blockInfo^.DrawQuad[3]); - glNormal3fv(@blockInfo^.Normals^[2]); + //glNormal3fv(@blockInfo^.Normals^[2]); glTexCoord2f(1, 1); glVertex2fv(@blockInfo^.DrawQuad[2]); - glNormal3fv(@blockInfo^.Normals^[1]); + //glNormal3fv(@blockInfo^.Normals^[1]); glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]); glEnd; + + if not highlight then + glDisable(GL_LIGHTING); end else begin glBindTexture(GL_TEXTURE_2D, blockInfo^.LowRes.Texture);