Jump to content
  • Advertisement


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


Pointers giving me a funny problem....

This topic is 5801 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

Hey there. First of, the code...


				texNameNum = SendDlgItemMessage(hWnd, IDC_TEXTURELIST, LB_GETCURSEL, 0, 0);
				SendDlgItemMessage(hWnd, IDC_TEXTURELIST, LB_GETTEXT, texNameNum, (LPARAM)name);

				vector<CTexture*>::iterator iter;

				Game.LogFile.Output("Selected Filename = %s %i", name, texNameNum);

				for(iter=TextureManager.TextureList.begin(); iter != TextureManager.TextureList.end(); ++iter) {

					if(strcmp(name, (*iter)->m_name.c_str()) == 0) {
						Game.LogFile.Output("Texture list number = %i", texNameNum);
						Game.Terrain.m_currentTexture = TextureManager.TextureList[(*iter)->m_ID];
						Game.LogFile.Output("New Current texture name = %s", Game.Terrain.m_currentTexture->m_name.c_str());




Ok, whats happening here is you load a texture whose name then appears in a list box. You highlight that texture name click assign, and it textures the terrain with that texture. The problem is this. It only works for every other texture. I have a texture pointer in my terrain class call m_currentTexture. That is what is being bound as the texture for the terrain. I simply change the pointer when the assign button is clicked to the currently loaded one. The odd thing is the every other texture thing that its doing. If you have any idea what could be up, or if you would like more code, please respond

"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan
Name: TheBlackJester Team: Wildfire Studios
Projects O A.D. The Last Alliance

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!