Im working on a port of SDL_Jump, and in the sdljump.h, it defines the controls like so:
#define KEY_LEFT1 SDLK_LEFT
can I leave it like that or do I have to put something like:
#define KEY_LEFT1 GP2X_BUTTON__LEFT
or something like
#define KEY_LEFT1 (2)
or maybe something completely different?
Hi!
I'm the Sdljump author and I'm very glad to see someone porting it to gp2x (I found this thread googling randomly
). Actually, I've got a friend who has a gp2x and I had in mind to port Sdljump to gp2x in the future, but I'm having less time to code than I expected and so ew releases of Sdljump are being delayed.
I have just foudn two interesting links that might help you in porting sdljump to gp2x:
http://wiki.gp2x.org/wiki/SDL_Joystick_mapping
http://wiki.gp2x.org/wiki/SDL_FAQ
Answering to your question, it is not completly different but it is quite different. Changing that part of the code would be ok (preferably use an #ifdef GP2X to make things clearer and easier). But you would also have to change a pair of functions to make things work, as the input events are SDL_JOYBUTTONUP(DOWN) insteand of SDL_KEYDOWN(UP) event. That would be easy to change actually.
However, there are still two more aspects that would make the port a little (just a little
) harder.
A. AFAIK, Gp2x does not support OpenGL so you would have to strip out the Opengl part of the code. I would not be very hard, just delete the sdl_gl2d.c/h files and delete all the calls to GL2D_* alike functions in surface.c. Delete the #includes to any opengl stuff and fix a pair of things and its done.
B. GP2x only supports 320x240. That is a problem as the screen resolution depends on the theme file (as you might have noticed, the xjump and auri themes use different sizes). You might think that designing a new sking for 320x240 would be enough, but that is not possible as the brick size is 16x16 and the grid size is 24x32. In the future, in order to solve this, I'll include variable brick size.
After 0.92 (which, sadly, will not include all the features promised at the webpage), I'll work on the port so, if you don't want to do all the work by yourself you can just wait until I have to time to do it
Bie!