Why the heck

Started by
0 comments, last by Ephiney 23 years, 3 months ago
This is my code to copy iso tiles to the screen and one sprite. My problem is I cant see my sprite 99% of the time. This started to happen when I blt to the entire screen. Before I only blt to about half the screen, with the rest of the screen flicking with a bright blue and my sprite also flickering. My tiles come in perfect. Anybody have any idea why this is happening? GridX := (WorldPositionX shr 6) - 2; GridY := (WorldPositionY shr 5) - 2; offsetX := (WorldPositionX and 63) + 64; offsetY := (WorldPositionY and 31) + 32; for indexY := 0 to 41 do for indexX := 0 to 16 do begin bltX := (indexX shl 6) + ((indexY and 1) shl 5) - offsetX; bltY := (indexY shl 4) - offsetY; case map[indexX + GridX, indexY + gridY] of 0: bltRect := TileRect; 1: begin bltRect := BlockRect; dec(bltY, 23) end; end; if ((bltX < -63) or (bltX > 799) or (bltY < -31) or (bltY > 599)) then continue; if bltX < 0 then begin inc(bltrect.Left, -bltX); bltX := 0 end; if bltX > 735 then dec(bltrect.right, (bltX - 737)); if bltY < 0 then begin inc(bltrect.top, -bltY); bltY := 0 end; if bltY > 567 then dec(bltRect.bottom, (bltY - 570)); DXCheck(FPrimary.BltFast(bltX,bltY,FBackGround,bltRect,DDBLTFAST_SRCCOLORKEY or DDBLTFAST_WAIT)); end; SrcRect := rect(0,0,19,34); DXCheck(FPrimary.BltFast(50,50,FBitmap,SrcRect,DDBLTFAST_WAIT or DDBLTFAST_SRCCOLORKEY)); // FlipSurfaces;
Advertisement
Im a dork, I was blitting to the primary surface and not the backbuffer. It works just fine now, sorry about the post

This topic is closed to new replies.

Advertisement