Hello!
I am totally confused. The Map-Loading code of my engine seems to fail at a really stupid location. The loader loads the Object-Class-IDs, like WTexture or WMesh, and creates the right class via "new". This worked fine, before I built in a new class for textures.
Its not the problem that this class fails every time, no. It works fine, too,
but this makes the problem so stupid:
Here is what the loader does:
Load Class Num -> Mesh
Create Object from Class Num -> Obj=new WMesh;
Load Content -> OK.
--- Next object ---
Load Class Num -> Shader
Create Object from Class Num -> Obj=new WShader;
Load Content -> OK.
--- Next object ---
Load Class Num -> Texture (!!!)
Create Object from Class Num -> Obj=new WTexture; (WORKS FINE!!!!!!)
Load Content -> OK.
--- Next object ---
Load Class Num -> Mesh
Create Object from Class Num -> Obj=new WMesh;
Load Content -> OK.
--- Next object ---
Load Class Num -> Texture (!!! The second one !!!)
Create Object from Class Num -> Obj=new WTexture; (<--- Fails with std::bad_alloc Why???)
Load Content -> ---.
Here is the piece of code which creates the new object:
case WTEXTURE:
*Out=new WTexture;
return true;
Nothing special here! But why does it fail!? It's not that I don't have enougth RAM, if you think that...
help me! :(