- Disabled use of normals (weren't really in use anyway)
- Added updating of the last shortcut in TScreenBuffer
This commit is contained in:
parent
28969d94f7
commit
2b040fc5e3
|
@ -1269,7 +1269,9 @@ begin
|
||||||
|
|
||||||
if (FShortCuts[0] = nil) or (CompareWorldItems(AItem, FShortCuts[0]) < 0) then
|
if (FShortCuts[0] = nil) or (CompareWorldItems(AItem, FShortCuts[0]) < 0) then
|
||||||
begin
|
begin
|
||||||
//TODO : update last element if necessary
|
if FShortCuts[0] = nil then
|
||||||
|
FShortCuts[-1] := Result; //Update last item
|
||||||
|
|
||||||
Result^.Next := FShortCuts[0];
|
Result^.Next := FShortCuts[0];
|
||||||
FShortCuts[0] := Result;
|
FShortCuts[0] := Result;
|
||||||
end else
|
end else
|
||||||
|
@ -1289,7 +1291,9 @@ begin
|
||||||
begin
|
begin
|
||||||
current := current^.Next;
|
current := current^.Next;
|
||||||
end;
|
end;
|
||||||
//TODO : update last element if necessary
|
|
||||||
|
if FShortCuts[-1] = current^.Next then
|
||||||
|
FShortCuts[-1] := Result; //Update last item
|
||||||
|
|
||||||
Result^.Next := current^.Next;
|
Result^.Next := current^.Next;
|
||||||
current^.Next := Result;
|
current^.Next := Result;
|
||||||
|
|
|
@ -1721,8 +1721,9 @@ begin
|
||||||
|
|
||||||
if ABlockInfo^.HighRes <> nil then
|
if ABlockInfo^.HighRes <> nil then
|
||||||
begin
|
begin
|
||||||
|
{if ABlockInfo^.Normals = nil then
|
||||||
New(ABlockInfo^.Normals);
|
New(ABlockInfo^.Normals);
|
||||||
FLandscape.GetNormals(item.X, item.Y, ABlockInfo^.Normals^);
|
FLandscape.GetNormals(item.X, item.Y, ABlockInfo^.Normals^);} //Unused so far
|
||||||
ABlockInfo^.DrawQuad[0][0] := drawX;
|
ABlockInfo^.DrawQuad[0][0] := drawX;
|
||||||
ABlockInfo^.DrawQuad[0][1] := drawY - z * 4;
|
ABlockInfo^.DrawQuad[0][1] := drawY - z * 4;
|
||||||
ABlockInfo^.DrawQuad[1][0] := drawX + 22;
|
ABlockInfo^.DrawQuad[1][0] := drawX + 22;
|
||||||
|
@ -1837,16 +1838,23 @@ begin
|
||||||
if blockInfo^.HighRes <> nil then
|
if blockInfo^.HighRes <> nil then
|
||||||
begin
|
begin
|
||||||
glBindTexture(GL_TEXTURE_2D, blockInfo^.HighRes.Texture);
|
glBindTexture(GL_TEXTURE_2D, blockInfo^.HighRes.Texture);
|
||||||
|
|
||||||
|
if not highlight then
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glNormal3fv(@blockInfo^.Normals^[0]);
|
//glNormal3fv(@blockInfo^.Normals^[0]);
|
||||||
glTexCoord2f(0, 0); glVertex2fv(@blockInfo^.DrawQuad[0]);
|
glTexCoord2f(0, 0); glVertex2fv(@blockInfo^.DrawQuad[0]);
|
||||||
glNormal3fv(@blockInfo^.Normals^[3]);
|
//glNormal3fv(@blockInfo^.Normals^[3]);
|
||||||
glTexCoord2f(0, 1); glVertex2fv(@blockInfo^.DrawQuad[3]);
|
glTexCoord2f(0, 1); glVertex2fv(@blockInfo^.DrawQuad[3]);
|
||||||
glNormal3fv(@blockInfo^.Normals^[2]);
|
//glNormal3fv(@blockInfo^.Normals^[2]);
|
||||||
glTexCoord2f(1, 1); glVertex2fv(@blockInfo^.DrawQuad[2]);
|
glTexCoord2f(1, 1); glVertex2fv(@blockInfo^.DrawQuad[2]);
|
||||||
glNormal3fv(@blockInfo^.Normals^[1]);
|
//glNormal3fv(@blockInfo^.Normals^[1]);
|
||||||
glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]);
|
glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]);
|
||||||
glEnd;
|
glEnd;
|
||||||
|
|
||||||
|
if not highlight then
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
glBindTexture(GL_TEXTURE_2D, blockInfo^.LowRes.Texture);
|
glBindTexture(GL_TEXTURE_2D, blockInfo^.LowRes.Texture);
|
||||||
|
|
Loading…
Reference in New Issue