|
-
Dec 8th, 2002, 02:04 PM
#1
Thread Starter
New Member
Screen depth & GetLockedArray !?
i am using IntersectRect for my collision detection to do the pixel perfect detection i am going thorugh the pixels with .Lock, .GetLockedArray.
i am having a problem with screen depth though. when i render in 8 bits then the funtion works ok.
but when i use higher depths i start having problems.
for test purpose i wrote the contents of the arrays holding the image data.. in 8 bits, for one of the rectangels i get
0 40 40 40 40 40 40 40 40 0 0 0 0 0
0 40 40 40 40 40 40 40 40 0 0 0 0 0
0 40 40 40 40 40 40 40 40 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
. . . . . . (which is how it should come out)
but in 16 bits i get extra "0"'s between color data
0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 0 0 0 0 0 0 0 0 0
0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 0 0 0 0 0 0 0 0 0
0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 40 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
and in 32 bits i get one coloumn more of extra 0's
0 40 0 0 40 0 0 40 0 0 40 0 0 40 0 0 0 0 0 0 0 0 0
0 40 0 0 40 0 0 40 0 0 40 0 0 40 0 0 0 0 0 0 0 0 0
0 40 0 0 40 0 0 40 0 0 40 0 0 40 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
and when this happens the cheking for pixel perfect collison doesnt work ...
so when the surface is locked and the sprite data grabbed into the array, the extra data needs to be cleared - so how do i go about correcting this problem ??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|