Hello, I'm loading a 1024x1024 tilemap that is divided into 16x16 tiles. Each tile is drawn with the sf::Sprite using a subrect of the tilemap. All tiles are being retrieved correctly, but the quality of the tiles are very low. Here is the difference between the sfml (left) and c# gdi+ (right) versions:
It looks like maybe the tiles are being stretched or it could be something with my window settings.
tile->sprite.SetImage(tileMap->GetTexture());
sf::IntRect rect;
/* Set position */
tile->sprite.SetPosition((float)(tile->column * tileWidth), (float)(tile->row * tileHeight));
/* Grab the tile definition from the tilemap */
int tileRow = tile->index / tilesPerRow;
int tileColumn = tile->index % tilesPerRow;
rect.Left = tileColumn * tileWidth;
rect.Right = (tileColumn * tileWidth) + tileWidth;
rect.Top = tileRow * tileHeight;
rect.Bottom = (tileRow * tileHeight) + tileHeight;
tile->sprite.SetSubRect(rect);
/* Initialize window */
sf::WindowSettings settings;
settings.DepthBits = 24; // Request a 24 bits depth buffer
settings.StencilBits = 16; // Request a 8 bits stencil buffer
settings.AntialiasingLevel = 2; // Request 2 levels of antialiasing
window = new RenderWindow(
VideoMode(Globals::ScreenWidth,
Globals::ScreenHeight, 32), "Game Window",
sf::Style::Close, settings);
I'd appreciate any help on this.
Thanks