- Changed terrain rendering from GL_TRIANGLES to GL_QUADS to fix coastlines and other overlapping (thanks Turley)

This commit is contained in:
Andreas Schneider 2009-06-11 14:41:30 +02:00
parent 7fdfd1ee23
commit 31d2623df9
2 changed files with 5 additions and 11 deletions

View File

@ -532,9 +532,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Top = 0 Top = 0
Width = 152 Width = 152
AutoComplete = False
ItemHeight = 0 ItemHeight = 0
ItemWidth = 0
OnChange = cbRandomPresetChange OnChange = cbRandomPresetChange
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0

View File

@ -1694,19 +1694,15 @@ 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);
glBegin(GL_TRIANGLES); glBegin(GL_QUADS);
glNormal3fv(@blockInfo^.Normals^[3]);
glTexCoord2f(0, 1); glVertex2fv(@blockInfo^.DrawQuad[3]);
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^[1]);
glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]);
glNormal3fv(@blockInfo^.Normals^[1]);
glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]);
glNormal3fv(@blockInfo^.Normals^[2]);
glTexCoord2f(1, 1); glVertex2fv(@blockInfo^.DrawQuad[2]);
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]);
glTexCoord2f(1, 1); glVertex2fv(@blockInfo^.DrawQuad[2]);
glNormal3fv(@blockInfo^.Normals^[1]);
glTexCoord2f(1, 0); glVertex2fv(@blockInfo^.DrawQuad[1]);
glEnd; glEnd;
end else end else
begin begin