GP32 Smc Bmp To Sdl Image


esoteric

Still Fresh
Joined
Mar 5, 2004
Messages
8
So, I'm working on a 2D platformer (think Super Mario Bros) and obviously I'm going to need graphics.

I don't want to have to convert the graphics into a C text format (ala SDLTest), because I'm going to need to dynamically load and free them.

I can't get SDL_LoadBMP (or whatever it is) to work. Nothing shows up...

My basic approach is that I'd like to load up a bitmap of tiles that I've created in TileStudio and then blit each tile section needed when I'm drawing the map to the screen. My big problem is succesfully getting the bitmap data into an SDL image so that I can blit from there to the screen framebuffer.

Any help? :)

Thanks!
 
I don't know SDL... but maybe you can provide some info about a sdl image. Also what kind of bmps do you want to open ? 8bit ?
 
If you don't know anything about SDL, the peculiarities of Chui's port, and particular SDL functions... it's probably not worth your time. :)

Thanks anyways though..
 
Hey,
I found this a long time ago and it seems to work.

Humm.. Wasnt there a member called _esoteric a long time ago? Are you that person? If so, long time no see :p
 
Hey,
I found this a long time ago and it seems to work.

Humm.. Wasnt there a member called _esoteric a long time ago? Are you that person? If so, long time no see :p

<click> Downloading... thanks!

Well, I got my GP32 way back in the spring of 2002. I can't believe it's been so long that the GP32 has been out. So advanced for its time...

Anyways. Yeah, I've been esoteric for a while. Not sure if that was me that you remember or not, but your name sounds familiar. Hello again then ;)

Gonna go test this...
 
Last edited by a moderator:
Work! Shit! Well, my tiles loaded with the wrong colors, but I can work on that. Hopefully I can report back with success.... thanks for at least a start!
 
Oh yeah, I forgot about the palette problem. I think you have to make sure that your pictures are not in 8 bit mode. Use 24bit.
Well, thats what I did to dodge the problem although the filesizes of your pictures will be much larger, but meh... B)
 
Oh yeah, I forgot about the palette problem. I think you have to make sure that your pictures are not in 8 bit mode. Use 24bit.
Well, thats what I did to dodge the problem although the filesizes of your pictures will be much larger, but meh... B)

Well, I haven't had a chance to play more yet.. but the bmp is indeed 24-bit and my screen mode is 16-bit. So, I'm puzzled.. but I'll see what I can do once I get a chance to play around more.

Thanks again!
 
Last edited by a moderator:
Yoykes! I imported some Super Mario World tiles into TileStudio and exported them and the map data and wrote a quick routine to take up a full screen.

Brilliant! It looks perfect.

Now... scrolling.... :p (Oh, plus artwork, music, sprite code, enemy code, level design :) :) :))
 
Yeah, I got a mod playing in 2 minutes following the tutorial that's out there on the web!

Well, as a test for scrolling, I made a large surface and filled it with a map and a smaller surface (the unmoving background) with a map. Then i blit the background, then the foreground (whichever part is showing) together onto another suface and flip that to the screen. By moving the SDL_Rect around the larger surface it'll scroll around. My intent was to have a surface that is 1 tile bigger on each side and then draw the map in there and scroll the SDL_Rect around it to save on memory, but also to save on tile drawing.

I was excited when the tiles showed up onscreen. Really excited. But now that it's "scrolling around" I'm less than enthused. It's really 'jerky' and there seems to be some tearing going on, which I don't understand.

Hmmmm....

But seeing tiles and hearing music is pretty damn awesome.
 
Back
Top