Results 1 to 10 of 10

Thread: Dropping Lazarus/Delphi code into MIDletPascal

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

    Dropping Lazarus/Delphi code into MIDletPascal

    I'm currious as to what kind of porting issues MIDletPascal would have with 'safe' Object Pascal code. Or at last the kind that is Delphi/Lazarus/FPC safe...

    I'm planning on making an attempt at porting a game I am currently making using Lazarus with JEDI-SDL using (Delphi Compatable)Object Pascal code.

    What sort of issues am I looking at having here?

    First obvious one is SDL. Is there a port for the kinds of portable devices that I want to run this game on?

    Other than that; code restrictions, data files, or anything else that I may need to realize right away.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Dropping Lazarus/Delphi code into MIDletPascal

    First one - its Pascal - not Object Pascal. MidletPascal has no support for Objects.

    Second - Look up the Game Library stuff from Pilgrim - this is the closest you'll get to a gameing graphics library. But if all you are doing is image drawing then the standard code is sufficient. Dont expect alpha blending or even sprite style transparency.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

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

    Dropping Lazarus/Delphi code into MIDletPascal

    Well there goes that idea. Unless someone actually wants to port my Object Pascal code to plain Pascal, this ain't gonna happen.

    When you say "sprite style transparency", you actually mean that it doesn't support simple colorkey teransparency? ie. one color set to be transparent and No alpha blending or channels involved...

    If thats true... whew... it as a looong way to go.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Dropping Lazarus/Delphi code into MIDletPascal

    If thats true... whew... it as a looong way to go.
    I disagree. MidletPascal is dependant on the J2ME specification. So unless J2ME changes MidletPascal must conform to these restrictions.

    J2ME uses PNG files with an alpha channel for transparency. But if you cut up an image you lose the transparency.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

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

    Dropping Lazarus/Delphi code into MIDletPascal

    Quote Originally Posted by cairnswm
    J2ME uses PNG files with an alpha channel for transparency. But if you cut up an image you lose the transparency.
    Well using the alpha channel makes sense. And PNG is a good standard.

    What do you mean by 'cut up' though?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Dropping Lazarus/Delphi code into MIDletPascal

    If you have a single image with lots of small pics on it. Midlet Pascal has an ImageFromImage funtion to extract a portion of the image. This process does not support transparency.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  7. #7

    Dropping Lazarus/Delphi code into MIDletPascal

    Quote Originally Posted by WILL
    When you say "sprite style transparency", you actually mean that it doesn't support simple colorkey teransparency? ie. one color set to be transparent and No alpha blending or channels involved...
    Just to clarify it does support colour key transparency, but not alpha blended/channels transparency as far as I am aware.

    Quote Originally Posted by cairnswm
    Midlet Pascal has an ImageFromImage funtion to extract a portion of the image. This process does not support transparency.
    This is partially incorrect. I was told that ImageFromImage transparency works if your Midlet is v2.0 but not if it is v1.0. It definately does not work for v1.0 MIDlet, but I have not tested it for v2.0.
    In v1.0 if you want colour key transparency save each image individually as a png file, ensuring that you set the transparency value when the png is saved. Then with v1.0 you can use LoadImage() and the transparency will be respected when drawn.

    Basically the rule I have stuck with is that for v1.0 MIDlets, use separate images if transparency is an issue. I hope to use pilgrim's GameAPI wrapper ( for v2.0 Midlets ) for a future project which should give a lot more flexibility and not have the same restrictions as the vanilla v1.0 API.
    <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 =-

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

    Dropping Lazarus/Delphi code into MIDletPascal

    Wow my little idea has already gone way past the limitations of MIDletPascal. :?

    Pascal library/headers or no Pascal library/headers, is there not a SDL port for J2ME? That would leave the possibility to port JEDI-SDL games over to MIDletPascal.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9

    Dropping Lazarus/Delphi code into MIDletPascal

    Apparently SDL is available for SymbianOS. So if FPC works on Symbian you could be onto a winner.
    <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 =-

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

    Dropping Lazarus/Delphi code into MIDletPascal

    SymbianOS? It seems to have me at a disadvantage. I have not heard very much about it. Any hints where I can look this up?
    Jason McMillen
    Pascal Game Development
    Co-Founder





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
  •