As most everyone knows by now, I am creating a new engine using XNA.
I am getting a very strange bug that I cannot figure out to save my life, and it is really starting to irritate me. As I mentioned in the Shoutbox a few days ago, I was having problems loading very large tilesets. As it turned out, XNA has some a maximum texture size of 2048x2048 using the Reach profile, and a maximum texture size of 4096x4096 on HiDef profile.
I changed the profile to HiDef (goodbye Windows Phone compatibility!), which vastly increased the size of the textures I can use. As far as RMXP is concerned, the largest images that are going to be used are going to be tilesets. Some of these tilesets have a height larger than 4096 pixels obviously, so in order for them to be used, I have to modify the image internally when it loads to fit within the 4096x4096 bounds. For testing purposes, I have been using Inquisitor's Medieval Exterior tileset, since it is one that I know off the top of my head to be one of the largest.
All these images are fairly large, so be warned.
Now, here it is loaded internally. Basically the width just gets expanded and overflow greater than 4096 pixels gets moved to columns. This is the actual texture as it is loaded and used to draw a tilemap.
Pretty straightforward conversion, and easy to work with, just have to do a quick calculation to adjust coordinates for over-sized source images.
This works perfectly with the exception of a bug that I cannot find or understand. For some stupid reason, a white border is being placed around some of the tiles, specifically the bottom of the last column (where actual image data is contained, not the extreme bottom), and the right side of some tiles in the next to last column, where beside it is blank data.
Example 1The damn tents along the right side of the next to last column.
As you can see, there are no white pixels there to be copied. I checked the coordinates, they are correct, its just adding white there. I have tried clearing the GraphicsDevice with all sorts of colors, no change. I have tried changing the blend color, and all I get is white with a tint of whatever color I choose, not just the color, so it's reading that portion of the texture as white.
Example 2Basically the same thing, just a different area of the tileset, this time at the very bottom. I added the "signature" section of the tileset to a map, and here is how it comes out.
I am at a loss for this one, and thus far, it seems to ONLY do it with them specific areas, the rest of the map looks perfect.
Any ideas?