SteveDunn/Gleed2D — Issue #8: Error Initializing Texture - File Doesn't Exist
Author: tylerrrr07
Created: 2012-01-28 19:38:35+00:00
State: open

I encountered an issue on load where textures would not properly initialize. It seems that after the error messages all go away (once for every single texture in the level) the textures seem to load ok but its very annoying. This issue also crops up upon placing textures within the level.

From what I can tell via debugging and the error provided is that this is an issue of the texture item's relative path also containing the parent folder.

For Example:

Content Root Folder: C:\Project\Content
Content Root Folder contains a sub folder called "Sprites" and as such texture item's relative path should be: Sprites/file.ext
Error message states it can't find the file: C:\Project\Content\Content\Spites\file.ext (notice the duplicate entry for file)

In debugging I was able to find that within the initialiseTexture method of the TextureItemEditor.cs file, the parameter textureFileName was "Content\Sprites\file.ext" - I traced this up a few steps and found it came from some properties collections and got nervous about changing anything much further and decided to post my findings here.