Results 1 to 7 of 7

Thread: JEDI-SDL in Lazarus throwing a compile error in SDL_AddPixel

  1. #1

    Question JEDI-SDL in Lazarus throwing a compile error in SDL_AddPixel

    Hi Chaps, It's been a while since I was last here.. about 4 years (OMG Where has the time gone?)

    I thought I'd try to recompile some of my old Delphi stuff in Lazarus - so I went about setting up the Jedi-SDL library and tried to compile and I'm getting an error..

    I'm using the 64bit version of Lazarus - so I don't know if that's making a difference.
    The JEDI-SDL library is the latest, unmodified, downloaded last night.

    the error code is as follows:
    C:\WINXP-C\CBCO\JEDI-SDLv1.0\SDL\Pas\sdlutils.pas(466,11) Error: Typecast has different size (4 -> 8 ) in assignment
    C:\WINXP-C\CBCO\JEDI-SDLv1.0\SDL\Pas\sdlutils.pas(470,52) Hint: Converting the operands to "DWord" before doing the add could prevent overflow errors.
    C:\WINXP-C\CBCO\JEDI-SDLv1.0\SDL\Pas\sdlutils.pas(471,52) Hint: Converting the operands to "DWord" before doing the add could prevent overflow errors.
    C:\WINXP-C\CBCO\JEDI-SDLv1.0\SDL\Pas\sdlutils.pas(472,52) Hint: Converting the operands to "DWord" before doing the add could prevent overflow errors.
    C:\WINXP-C\CBCO\JEDI-SDLv1.0\SDL\Pas\sdlutils.pas(479,11) Warning: Conversion between ordinals and pointers is not portable


    Any ideas?
    My Compiler options are set up as follows:
    -MDelphi -Scgi -O1 -g -gl -vewnhi -l -Fi..\..\..\..\CBCO\JEDI-SDLv1.0\ -Fi..\..\..\..\CBCO\JEDI-SDLv1.0\SDL\Pas\ -Fu..\..\..\..\CBCO\CBCFoundation\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_Gfx\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_Image\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_Mixer\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_Net\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_Sound\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDL_ttf\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SDLFilter\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\SFont\Pas\ -Fu..\..\..\..\CBCO\JEDI-SDLv1.0\smpeg\Pas\ -Fu..\..\..\..\..\lazarus\lcl\units\x86_64-win64\ -Fu..\..\..\..\..\lazarus\lcl\units\x86_64-win64\win32\ -Fu..\..\..\..\..\lazarus\packager\units\x86_64-win64\ -Fu. -oAnomalous.exe -dLCL -dLCLwin32

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Hey welcome back Jason.

    This is on Windows, yes? Dom has made some tiny revisions to allow do better Mac support since, but I'm unsure if it'll effect sdlutils or not. I'll PM you a copy of the unofficial (newer) copy he gave me. Maybe it'll help, but I'm unsure...

    If that doesn't solve the issue, then I'd suggest just changing the function your using to work properly. It sounds like a typecasting issue and the unit it mentions is not actually an official SDL unit so you'd only be breaking the JEDI-SDL portion of the code's continuity, not the SDL portion.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3
    The problem is this line:
    Code:
    PUInt8( Addr )^ := R or G or B;
    Addr is declared as:
    Code:
    Addr         : cardinal;
    And cardinal is a 32bit, which isn't going to work on a 64bit OS

    Overall looking sdlutils.pas reveals some pretty bad code(bad in the sense it shouldn't be used for crossplatform use). Cardinal is used all over for pointer arithmetic. Unless it's given a large overhaul it won't work on anything but 32bit platforms
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  4. #4
    Thanks Guys.
    There's totally some bad code in sdlutils, I wrote some of it LOL.

    Yes it's Windows. The Mac is lovely, but all of my dev work is on Windows these days.

    Unfortunately, My CBCFoundation engine uses it extensively (for better or for worse).

    I'll download the 32bit version of Lazarus to see if that helps.

    I should probably dump the CBCFoundation anyway in favour of an OpenGL based one - I'm too old to be writing Engines these days.

    Thanks again.

  5. #5
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Yes it's Windows
    Sorry, but I have to post a quick OUCH. I read you were using OpenGl, I'd watch some of it. Depending on the age of the setup you may find MS prefers D3D over OGL and it does show...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Quote Originally Posted by code_glitch View Post
    Sorry, but I have to post a quick OUCH. I read you were using OpenGl, I'd watch some of it. Depending on the age of the setup you may find MS prefers D3D over OGL and it does show...
    Easy doom-sayer. That would only be if they were using crappy drivers.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #7
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    But seriously, although I may not have had a total fail I cannot help noticing a 10fps speed difference on windows nonetheless so there is some truth to it in just about all instances unfortunately.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Tags for this Thread

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
  •