Display sprites with palettes

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Your userlib sounds good. :)

By 2-bit i mean 4 colour (colours 0, 1, 2, 3) with the ability to set the draw palette (it not converted to a 24-bit sprite on loading, but on drawing).

By 4 bit i mean 16 colours (colours 0 thru 15), again with the same palette abilities as 2 bit.

By 8 bit i mean 256 colours (colours 0 thru 255), again with the same palette abilities as 2 and 4 bit.

The ability to set the palette at draw time is very useful i doing rpg top-down or scrolling games.

-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

:-) as i said, the release of my planed userlib with such a feature can take a lot time! (need help in some other parts first ;)

yes, i fully understand what you are planing! ;)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

va!n wrote: i dont need 2 or 4 bit sprites! maybe you mean 16/24/32 bit sprites with colors like a 4bit image (also 16 colors?) !! You can still save your image as 4 bit BMP and load it with PB (PB supports loading 4 bit sprites!) :-)
It's exactly the opposite. I know PB loads 4bit sprites, but they become 16/24/32 bit on other screen modes. A 4bit sprite has only 16 colors, but they are selected from a 32bit palette. If you didn't notice yet, most games on consoles use this kind of sprite, as they are faster, use less memory and permit real time remapping. :wink:

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

Sorry for my last post, I didn't see the "page 2" on the bottom of the screen. Anyway, the fastest way I know for doing this would be to create an array with the colors and poke each pixel one by one. But PB doesn't load 8/4/2bit sprites without changing their depth. It would be possible to simmulate that sprite with allocatememory, but I doubt it would be possible to draw it in real time as fast as normal sprites. But I only know the "purebasic way" for doing this things.

@va!n : Do you think its possible to achieve this effect fast enough? I mean, I saw it on a psx for example, but I don't know if it can be done the same way on a pc.

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

yes, the way i would use for doing this, should be very fast! :-)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

OMG! I'm so happy!!! At least, it's possible! :D

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
Post Reply