Oh Lord! Thank God for you guys. I tried your texture size thing and the sizes come up in the millions and then some are 0. I checked the validity of the sprite, but it didn't occur to me to check the texture.
I just don't see when I went wrong with the loading of the texture. I can't get my minimal to reproduce the problem. It keeps working. XD
// Load the tileset into memory
sf::Image* tileset_image = new sf::Image;
tileset_image->loadFromFile(tileset->GetImage()->GetSource());
// Create a temporary image to manipulate
sf::Image *tile_image = new sf::Image;
tile_image->create((int)tile_dimensions.x, (int)tile_dimensions.y);
// Copy the tile image into the sf::Image
tile_image->copy(*tileset_image, 0, 0,
sf::IntRect(tileset->GetMargin() + (col - 1) * tileset->GetSpacing() + (col - 1) * tileset->GetTileWidth(),
tileset->GetMargin() + (row - 1) * tileset->GetSpacing() + (row - 1) * tileset->GetTileHeight(),
tileset->GetMargin() + col * tileset->GetSpacing() + col * tileset->GetTileWidth(),
tileset->GetMargin() + row * tileset->GetSpacing() + row * tileset->GetTileHeight()));
// Create a temporary texture to prepare for loading
sf::Texture *tile_texture = new sf::Texture;
// Load image into texture
tile_texture->loadFromImage(*tile_image); delete tile_image;
// Add texture into the texture
tiles.back()->AddTexture(tile_texture); delete tile_texture;
delete tileset_image;
This is a small portion of the code for loading textures from the sprite sheet. The original that presents problems.