Results 1 to 4 of 4

Thread: Pixel Collide (My program crash) :(

  1. #1

    Pixel Collide (My program crash) :(

    Hi

    I was estudying the SDL tutorial of the Lazy Foo and I translated one from c++ to delphi. But I modified the collision function. I used the SDL_CollidePixel function from lib SDL_Collide.
    My program crash when the dot move in position X=20 and y=140. I dont know why? Some one help me please.

    The code is here: http://rapidshare.com/files/1806994/...llide.zip.html

    The crash is here:
    Code:
    ...
          4:
          begin
    [color=red]=>        PixelColor := PUint32( bits )^;  (Line 244)[/color]
          end;
    ...

    Sorry, my english is bad.

  2. #2

    Pixel Collide (My program crash) :(

    There's a Pixel collision function in Jedi-SDL I believe, (I don't think I wrote the one I use from scratch.. although it was a long time ago)..

    I think you'd be better off looking into that than reinventing the wheel

    imho

    Welcome to the site BTW

  3. #3

    Pixel Collide (My program crash) :(

    I've just looked,

    [pascal]function SDL_PixelTest( SrcSurface1 : PSDL_Surface; SrcRect1 : PSDL_Rect; SrcSurface2 :
    PSDL_Surface; SrcRect2 : PSDL_Rect; Left1, Top1, Left2, Top2 : integer ) : boolean;[/pascal]

    In sdlutils.pas

    Which can be located at http://sourceforge.net/projects/jedi-sdl

    There's actually a lot of new/cool stuff in there which may be helpful.

  4. #4

    Pixel Collide (My program crash) :(

    I've moved this thread to the JEDI-SDL category.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •