hedgewars/uLandTexture.pas
changeset 7080 dbf43c07a507
parent 6700 e04da46ee43c
child 7186 013deb83086b
equal deleted inserted replaced
7079:939f53515489 7080:dbf43c07a507
    89     for x:= 0 to LANDTEXARW -1 do
    89     for x:= 0 to LANDTEXARW -1 do
    90         for y:= 0 to LANDTEXARH - 1 do
    90         for y:= 0 to LANDTEXARH - 1 do
    91             with LandTextures[x, y] do
    91             with LandTextures[x, y] do
    92                 begin
    92                 begin
    93                 tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
    93                 tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
    94                 glBindTexture(GL_TEXTURE_2D, tex^.id);
    94                 glBindTexture(GL_TEXTURE_2D, tex^.atlas^.id);
    95                 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, tpHigh);
    95                 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, tpHigh);
    96                 end
    96                 end
    97 else
    97 else
    98     for x:= 0 to LANDTEXARW -1 do
    98     for x:= 0 to LANDTEXARW -1 do
    99         for y:= 0 to LANDTEXARH - 1 do
    99         for y:= 0 to LANDTEXARH - 1 do
   100             with LandTextures[x, y] do
   100             with LandTextures[x, y] do
   101                 if shouldUpdate then
   101                 if shouldUpdate then
   102                     begin
   102                     begin
   103                     shouldUpdate:= false;
   103                     shouldUpdate:= false;
   104                     glBindTexture(GL_TEXTURE_2D, tex^.id);
   104                     glBindTexture(GL_TEXTURE_2D, tex^.atlas^.id);
   105                     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE, TEXSIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, Pixels(x,y));
   105                     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE, TEXSIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, Pixels(x,y));
   106                     end
   106                     end
   107 end;
   107 end;
   108 
   108 
   109 procedure DrawLand(dX, dY: LongInt);
   109 procedure DrawLand(dX, dY: LongInt);