Pointers giving me a funny problem....

Started by
-1 comments, last by TheBlackJester 21 years, 2 months ago
Hey there. First of, the code...
  

			case IDC_ASSIGNTEXTURE:


				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());
						break;

					}

				}

				break;

  
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

"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: [email=darkswordtbj@hotmail.com]TheBlackJester[/email]Team: Wildfire Games
Projects O A.D.The Last Alliance

This topic is closed to new replies.

Advertisement