PDA

View Full Version : Dropping Lazarus/Delphi code into MIDletPascal



WILL
01-05-2006, 12:09 AM
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.

cairnswm
01-05-2006, 03:09 PM
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.

WILL
01-05-2006, 11:13 PM
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. :)

cairnswm
02-05-2006, 05:39 AM
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.

WILL
02-05-2006, 07:16 AM
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?

cairnswm
02-05-2006, 08:15 AM
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.

savage
02-05-2006, 08:46 AM
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.


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.

WILL
02-05-2006, 10:58 PM
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.

savage
03-05-2006, 08:50 AM
Apparently SDL is available for SymbianOS. So if FPC works on Symbian you could be onto a winner.

WILL
04-05-2006, 01:09 AM
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?