1876 TextureBuffer[3].X:= shift + ((LongInt((RealTicks * waterSpeed) shr 6) * Dir + dX) mod spriteWidth) / (spriteWidth - 1); |
1876 TextureBuffer[3].X:= shift + ((LongInt((RealTicks * waterSpeed) shr 6) * Dir + dX) mod spriteWidth) / (spriteWidth - 1); |
1877 TextureBuffer[3].Y:= frame * realHeight; |
1877 TextureBuffer[3].Y:= frame * realHeight; |
1878 TextureBuffer[5].X:= TextureBuffer[3].X + nWaves; |
1878 TextureBuffer[5].X:= TextureBuffer[3].X + nWaves; |
1879 TextureBuffer[5].Y:= frame * realHeight; |
1879 TextureBuffer[5].Y:= frame * realHeight; |
1880 TextureBuffer[4].X:= TextureBuffer[5].X; |
1880 TextureBuffer[4].X:= TextureBuffer[5].X; |
1881 TextureBuffer[4].Y:= SpritesData[sprite].Texture^.ry / waterFrames + frame * realHeight; |
1881 TextureBuffer[4].Y:= (frame+1) * realHeight; |
1882 TextureBuffer[2].X:= TextureBuffer[3].X; |
1882 TextureBuffer[2].X:= TextureBuffer[3].X; |
1883 TextureBuffer[2].Y:= SpritesData[sprite].Texture^.ry / waterFrames + frame * realHeight; |
1883 TextureBuffer[2].Y:= (frame+1) * realHeight; |
1884 |
1884 |
1885 if (WorldEdge = weSea) then |
1885 if (WorldEdge = weSea) then |
1886 begin |
1886 begin |
1887 nWaves:= (topy - ViewTopY) / spriteWidth; |
1887 nWaves:= (topy - ViewTopY) / spriteWidth; |
1888 |
1888 |
1889 // left side |
1889 // left side |
1890 TextureBuffer[1].X:= TextureBuffer[3].X - nWaves; |
1890 TextureBuffer[1].X:= TextureBuffer[3].X - nWaves; |
1891 TextureBuffer[1].Y:= 0; |
1891 TextureBuffer[1].Y:= frame * realHeight; |
1892 TextureBuffer[0].X:= TextureBuffer[1].X; |
1892 TextureBuffer[0].X:= TextureBuffer[1].X; |
1893 TextureBuffer[0].Y:= SpritesData[sprite].Texture^.ry; |
1893 TextureBuffer[0].Y:= (frame+1) * realHeight; |
1894 |
1894 |
1895 // right side |
1895 // right side |
1896 TextureBuffer[7].X:= TextureBuffer[5].X + nWaves; |
1896 TextureBuffer[7].X:= TextureBuffer[5].X + nWaves; |
1897 TextureBuffer[7].Y:= 0; |
1897 TextureBuffer[7].Y:= frame * realHeight; |
1898 TextureBuffer[6].X:= TextureBuffer[7].X; |
1898 TextureBuffer[6].X:= TextureBuffer[7].X; |
1899 TextureBuffer[6].Y:= SpritesData[sprite].Texture^.ry; |
1899 TextureBuffer[6].Y:= (frame+1) * realHeight; |
1900 end; |
1900 end; |
1901 |
1901 |
1902 glBindTexture(GL_TEXTURE_2D, SpritesData[sprite].Texture^.id); |
1902 glBindTexture(GL_TEXTURE_2D, SpritesData[sprite].Texture^.id); |
1903 |
1903 |
1904 SetVertexPointer(@VertexBuffer[0], 8); |
1904 SetVertexPointer(@VertexBuffer[0], 8); |