Archived

This topic is now archived and is closed to further replies.

cannot convert from 'class cTexture *' to 'class cTextrue *'

This topic is 5624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

d:\program files\devstudio\myprojects\mygame\rendering.h(70) : error C2440: ''='' : cannot convert from ''class cTexture *'' to ''class cTextrue *'' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast This is bloody preposterous.. now what does it mean and how to fix it
  

typedef class cTexture
{
	public:
	LPDIRECT3DTEXTURE8 tex;
	int stage;
	int tex_id;

} Texture;

typedef class cIndexArray
{
	public:
	DITriangle * is; // Indices

	int IndexCount;
	Material * mat;
	class cTextrue * tex;
	int sort_id; // when sorting group them and give each group the same this value:)

	VertexArray ** NeedsThese;
	
	cIndexArray(DITriangle * Inds, int IndCount, Material *material, Texture * texture)
	{
		IndexCount=IndCount;
		is=new DITriangle[IndCount];
		for(int i=0;i<IndCount;i++)
			is[i]=Inds[i];
		mat=material;
		tex=texture; // this gives one instance of the error

		sort_id=-1;
	}

	cIndexArray(int IndCount, Material *material, Texture * texture)
	{
		IndexCount=IndCount;
		is=new DITriangle[IndCount];
		mat=material;
		tex=texture; // <--this gives another

		sort_id=-1;
	}

	cIndexArray() { sort_id=-1 };
} IndexArray;

  

Share this post


Link to post
Share on other sites
You misspelled your definition of tex in cIndexArray.
class cTextrue *tex should be class cTexture *tex. Since you don''t actually have a class cTextrue you can''t cast to it...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
get rid of those typedefs. They have absolutely no purpose whatsoever.

Share this post


Link to post
Share on other sites

  
class Texture {
};
class Other {
Texture tex;
};


remove the typedefs, and change the ''class SomeType obj;'' to ''SomeType obj;''. if you make a typo, it states that it does not know ''SomeTyep obj;'', SomeTyep is undeclared. that is much more a readable error (and you have less to type)

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites