SDL port for Android SDK/NDK 1.6

Quickly share your Android Code Snippets here...

Re: SDL port for Android SDK/NDK 1.6

Postby Dark_Neo » Mon Aug 23, 2010 4:56 pm

pelya wrote:You can use 32-bit surfaces in SW mode, however you should then use screen resolution not more than 320x240, otherwise your FPS will be awful. If you want it to render fast use RGB565 format + HWSURFACE fllag to SDL_SetVideoMode() + all surfaces that are blitted to video surface should also have HWSURFACE flag (you may use RGB4444 for per-pixel transparency).
That depends on a game - with some games it's enough to change "32" to "16" and it will work, with other games that do lot of pixel access operations it's almost impossible.
Edit: I've browsed through the code, and it seems to me that TwinEngine draws everything to 320x200x8 internal buffer, then resizes and renders it to 640x480x32 video surface. So just change constants across the code, it should work. With 320x200 SW video surface it renders with okay speed (both OpenTyrian and UQM render that way, only Alien Blaster is truly HW accelerated)


Thanks for your response. Would a lot of changes be needed to render it with a HW surface to get the hardware acceleration? I'll try building it with 8 bit SW surface either today or tomorrow and see what the performance is like on my Dell Streak.
Dark_Neo
Freshman
Freshman
 
Posts: 3
Joined: Mon Aug 23, 2010 12:59 pm

Top

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Mon Aug 23, 2010 6:51 pm

Fyi, a great game to port that is open source is Aquaria (www.bit-blot.com). :) Next project? *beg* lol
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Tue Aug 24, 2010 3:34 am

Image
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Tue Aug 24, 2010 8:33 am

DangerMouse wrote:Fyi, a great game to port that is open source is Aquaria (http://www.bit-blot.com). :) Next project? *beg* lol

Hey, it's not open-source, I cannot find where to dl the code (and all the fun ends here, I can't compile it lol).
The next game I'll port will be TeeWorlds, I'm giving preference to fully free games over the games where only shareware version of game data is available for free. But you may still convince me if the game is good.
Might also try to port ScummVM and bundle it with several old point-and-click games that were donated to the community (there is one ScummVM port around, it's unfinished though and doesn't work on Android 2.1).
DangerMouse wrote:Image

Looks nice, now give me individual images :)
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby rookie1 » Tue Aug 24, 2010 8:37 am

Hi pelya, this is a great port! I've managed to use your work to port NAEV (http://code.google.com/p/naev/) to Android. It's still in early stages but I'm able to start the game in Android emulator. Just a quick question regarding on-screen keyboard. At the beginning of the game, I need to enter the pilot name and ship name. This requires a full qwerty keyboard. Is it possible to somehow popup the Android on-screen keyboard and let user enter the text there, and send the text as SDL key events to the game afterwards? Is this doable or I'm just dreaming?
rookie1
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Aug 24, 2010 8:27 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Tue Aug 24, 2010 9:27 am

rookie1 wrote:Hi pelya, this is a great port! I've managed to use your work to port NAEV (http://code.google.com/p/naev/) to Android. It's still in early stages but I'm able to start the game in Android emulator. Just a quick question regarding on-screen keyboard. At the beginning of the game, I need to enter the pilot name and ship name. This requires a full qwerty keyboard. Is it possible to somehow popup the Android on-screen keyboard and let user enter the text there, and send the text as SDL key events to the game afterwards? Is this doable or I'm just dreaming?

Currently it's not doable, sorry. In the future I'm planning to extend my on-screen keyboard to full QWERTY, it's still just in planning though.
I'll see what I can do about quick solution, maybe creating from Java the TextInput inside PopupWindow that overlays game screen will work.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Top

Re: SDL port for Android SDK/NDK 1.6

Postby Dark_Neo » Tue Aug 24, 2010 10:12 am

pelya wrote:Hey, it's not open-source, I cannot find where to dl the code (and all the fun ends here, I can't compile it lol).


I thought that at first, then I found this: http://blog.wolfire.com/2010/06/Aquaria-goes-open-source

The game content is not free however, so anyone wanting to attempt a port will have to buy a copy of the game.
Dark_Neo
Freshman
Freshman
 
Posts: 3
Joined: Mon Aug 23, 2010 12:59 pm

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Tue Aug 24, 2010 10:30 am

I own Aquaria and have messaged directly with the developer Alec about the possibility of an android port and he is all for it much as he is all for the port for the psp that is being made. Anyone that does own it will be able to have the complete content for the game. The source is free (open-source) and the permission is there to do with it what you please, the content however is not. But there are tons of people that would really look forward to a release. I can talk more with Alec Holowka if you like on the subject. He has started a company called Infinite Ammo (www.infiniteammo.ca) and probably can be reached there easier than anywhere else, but he does VERY frequent his bit-blot.com site for the Aquaria forums.

I'll give you the individual images via a dropbox shared folder. As soon as it's all ready and set. I want to have the highlighted buttons done and ready tonight. Any other buttons you want for the menu at the top?? perhaps you could make a pull down window much like the android interface pull down menu... up to you. :) Is that enough buttons or do you want more?
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Tue Aug 24, 2010 11:36 am

Completed Set:
http://db.tt/GQWHDjZ

*Note: You must click on each of the images that you want to download.. otherwise you'll end up downloading crappy thumbnails. All the images you need in .png format to maintain transparencies. And original Finalized .PSD (Adobe Format) images included.

I give ONLY YOU the rights to using these images. Anyone else must ask for my permission.
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Tue Aug 24, 2010 12:26 pm

DangerMouse wrote:I own Aquaria and have messaged directly with the developer Alec about the possibility of an android port and he is all for it much as he is all for the port for the psp that is being made

I think it worth contacting them, so they will release Aquaria gamedata on Android market for a price, so basically I will release binary and they will sell the data for it. I read somewhere that it's possible to bundle two apps together, or make one app to use content of another one, but I haven't tried that. Also I think they won't do that until my port stops crashing when you press Home key.

DangerMouse wrote:I'll give you the individual images via a dropbox shared folder. As soon as it's all ready and set. I want to have the highlighted buttons done and ready tonight. Any other buttons you want for the menu at the top?? perhaps you could make a pull down window much like the android interface pull down menu... up to you. :) Is that enough buttons or do you want more?

No rush, I won't integrate them anyway till Friday (and I can't promise for sure it will be ready in Friday).
The amount of buttons is enough, I think I'll assign some action to that Android button like show/hide on-screen keyboard or resize it or toggle QWERTY mode when it will be done.

I give ONLY YOU the rights to using these images. Anyone else must ask for my permission.

Heh, you have drawn them faster than I was answering :)
Also note that if I'll include them into my libSDL repository they will be available not just for Ur-quan Masters, but also for my other games (OpenTyrian and Alien Blaster, and to TeeWorlds in the future), and if someone will take my repo and port an own game (even commercial one) your buttons will be there too.
I can include an statement in the readme file and first forum page stating that your artwork may not be modified, and be used only for a free games for example. You may choose one of the Creative Commons licenses to release your work under.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby Jug6ernaut » Wed Aug 25, 2010 3:11 am

any progress on keeping sdl from crashing on Home Button press? or proper screen off(standby) handling?
Jug6ernaut
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Jun 17, 2010 7:00 pm

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Wed Aug 25, 2010 7:43 am

That is fine to have them available for all libSDL, as far as their use for anything else, including modification, I'd like to be credited for my work. That's all I ask. if you'd be so kind to include my name, it's Sean Stieber. Other than that, feel free to use them for whatever you like.
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Wed Aug 25, 2010 10:04 am

Jug6ernaut wrote:any progress on keeping sdl from crashing on Home Button press? or proper screen off(standby) handling?

Still no progress. I think I'll address this bug next week, after I'll get proper on-screen joystick.
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby pelya » Thu Aug 26, 2010 5:22 pm

The new keyboard theme Ultimate Droid by Sean Stieber was added, well it looks not as good on device screen as on monitor.
Auto-fire was desperately disabled for that theme (still present in my Ugly Arrows), because there's no auto-fire button state images and I cannot think of any animation to toggle it.
The transparency setting will be added soon.
Also, what do you think about buttons layout?
pelya
Master Developer
Master Developer
 
Posts: 323
Joined: Mon Nov 23, 2009 11:31 am

Re: SDL port for Android SDK/NDK 1.6

Postby DangerMouse » Thu Aug 26, 2010 8:25 pm

I left you a message on the urquan masters forums since I am using my phone and it was the easiest site to find via google search. Anyway updated the urquan masters and opentyrian and opentyrian works with my buttons. However the urquan masters now crashes upon loading giving me the option to force close or report on my droid x running froyo. It worked perfectly fine before the uptdate to v1.0.03.
just wanted to give you the heads up.
DangerMouse
Developer
Developer
 
Posts: 25
Joined: Mon Aug 23, 2010 2:11 am

Top
PreviousNext

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 5 guests