bytecoder,
It would be a couple dozen pages of code to show you all the places where it gets read...
btw.. I started working with the VC debugger... (Its easier then I thought). I found the error occured on this region
if (bytPlayers == 1) { /* Get the UpperLeft Tile Coordinates */ intX = (unsigned short int)((intP1CameraX - 160)/16); intY = (unsigned short int)((intP1CameraY - 160)/16); bytOffSetX = (intP1CameraX - 160) - (intX * 16); bytOffSetY = (intP1CameraY - 160) - (intY * 16); /* BitBlt the Tiles */ for(bytTileX = 0; bytTileX < 21; bytTileX++) { for(bytTileY = 0; bytTileY < 14; bytTileY++) { /* Generate correct tile coordinates from the map array. */ fltPart1X = (float)arrMap[bytTileX + intX][bytTileY + intY]/13; intInterY = fltPart1X; fltPart1X = (float)(fltPart1X - intInterY); intInterX = fltPart1X * 13 +0.2f; /* Draw the Map */ BitBlt(hdcGame, (bytTileX * 16) - bytOffSetX, (bytTileY * 16) - bytOffSetY, 16, 16, hdcTiles, (intInterX * 16), (intInterY * 16), SRCCOPY); RedrawWindow(hwnd, 0, 0, 1); } } }
What the debugger set was...
intP1CameraY is equal to 144 (Not so good.)
intX is equal to 14 (Which is good)
intY is equal to 65535 (Uhm.. HOW?! Its not even UNSIGNED)
(intY - 160) = Negative Value (This shouldn't EVER happen).
There is a problem with my intP1CameraY initiate code it would appear, but why does presetting the devision value fix it.
[Edited by - Frequist on July 7, 2004 4:24:13 PM]