Original Post
Hello,
i have read the book "Isometric Game Programming with DirectX 7.0" and in the last Chapter TRANSTAAFL told me how to do a Tile Selection in ISO3D, but i don''t understand this.
I make a Surface for the MouseMap, and each Row have a Color.
So, when i click on the Mouse, i read the MouseMap-Surface Pixel at the Mouse-Coordinate.
And, then????
How i can transform the WORD Color into the Map-Location???
Have somebody a Code for this stupid Problem???
My Code
By Mouse-Click)
POINT Convert_Color_Tile(POINT ptMousePos)
{
POINT ptTemp;
DDSURFACEDESC2 ddsd;
memset(&ddsd,0,sizeof(DDSURFACEDESC2));
ddsd.dwSize=sizeof(DDSURFACEDESC2);
lpddsMouseMap->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
LONG lPitch = ddsd.lPitch/sizeof(WORD);
WORD* pSurface = (WORD*)ddsd.lpSurface;
WORD dwColor = pSurface[ptMousePos.x+ptMousePos.y*lPitch];
lpddsMouseMap->Unlock(NULL);
// Here is the Problem...what must i do with the Color?
return ptTemp;
}
I hope somebody have read the book too, and can help me. I relly don''t know how to do this!
Cya
MC Agni