It all looks right, I can't find the reason
this is the SImage
struct SImage{ int x, y, w, h; int ColorKey; IDirect3DTexture8* texture; char TexFileName[20];};
this is the buttons.dat text file that I load in
2
0 0 220 35 font1/ButtonLight.bmp 0xff000000
0 0 220 35 font1/ButtonDark.bmp 0xff000000
This is the code that loads in the file
for (i = 0; i < m_NumButtons; i++) { SKIP_WHITESPACE; fin >> m_Buttons.x; fin >> m_Buttons.y; fin >> m_Buttons.w; fin >> m_Buttons.h; fin >> m_Buttons.TexFileName; fin >> temp; m_Buttons.ColorKey = strtoul(temp, NULL, 0); m_Buttons.texture = NULL; hr = D3DXCreateTextureFromFileEx(m_d3dDevice, m_Buttons.TexFileName, 0, 0, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE, m_Buttons.ColorKey, NULL, NULL, &m_Buttons.texture); if (hr) { fout << m_Buttons.TexFileName; fout.close(); m_Buttons.texture = NULL; m_NumButtons = i; Shutdown(); return false; } }//The whitespace stuff is:#define SKIP_WHITESPACE while (fin.peek() == '/' || fin.peek() == '\n' || fin.peek() == ' ' || fin.peek() == '\t') fin.getline(temp, size);
There's another SImage pointer array in the same class (UI class) that has the same code, could this be causing the problem?