NEW il y a 5 ans
Please, what is the default color palette in C++ syntax?
const Color PALETTE[] = {
(Color)0xffff, // color 0x0
... ?
Steph
il y a 5 ans
Image Transcoder gives you the details when you select the indexed mode....
const Color PALETTE[] = { (Color)0xffff, // color 0x0 (Color)0xacd0, // color 0x1 (Color)0x5268, // color 0x2 (Color)0x0000, // color 0x3 (Color)0x9008, // color 0x4 (Color)0xca30, // color 0x5 (Color)0xd8e4, // color 0x6 (Color)0xfd42, // color 0x7 (Color)0xcc68, // color 0x8 (Color)0xfeb2, // color 0x9 (Color)0xf720, // color 0xa (Color)0x8668, // color 0xb (Color)0x044a, // color 0xc (Color)0x0210, // color 0xd (Color)0x4439, // color 0xe (Color)0x7ddf // color 0xf };
NEW il y a 5 ans
Image Transcoder gives you the details when you select the indexed mode....
const Color PALETTE[] = { (Color)0xffff, // color 0x0 (Color)0xacd0, // color 0x1 (Color)0x5268, // color 0x2 (Color)0x0000, // color 0x3 (Color)0x9008, // color 0x4 (Color)0xca30, // color 0x5 (Color)0xd8e4, // color 0x6 (Color)0xfd42, // color 0x7 (Color)0xcc68, // color 0x8 (Color)0xfeb2, // color 0x9 (Color)0xf720, // color 0xa (Color)0x8668, // color 0xb (Color)0x044a, // color 0xc (Color)0x0210, // color 0xd (Color)0x4439, // color 0xe (Color)0x7ddf // color 0xf };
NEW il y a 5 ans
Sure? If i use this, all colors are changed. Not the same as without setPalette ...
(I use DISPLAY_MODE_INDEX_HALFRES)
NEW il y a 5 ans
tikkel
il y a 5 ans
... but which index have the COLORS?
For example, when i don't manipulate the palette and use index 0x0 in an Image. Then the pixel is 0x0000. But the array from the API (and yours) has on index 0x0 0xffff!
I think, the default color palette in "image translator" is not the Gamebuino default palette!?
Or where is my mistake? :o)
NEW il y a 5 ans
... but which index have the COLORS?
For example, when i don't manipulate the palette and use index 0x0 in an Image. Then the pixel is 0x0000. But the array from the API (and yours) has on index 0x0 0xffff!
I think, the default color palette in "image translator" is not the Gamebuino default palette!?
Or where is my mistake? :o)
Steph
il y a 5 ans
Sorry, I don't understand what you mean. Can you post your image?
The default Gamebuino palette is the one defined in the official doc. And Image Transcoder uses this palette by default!
What tool do you mean when you say Image Translator?
Steph
il y a 5 ans
Here is a simple example drawn with the default palette:
Image Transcoder generates the following code (scroll down to see the whole code):
const Color PALETTE[] = { (Color)0xffff, // color 0x0 (Color)0xacd0, // color 0x1 (Color)0x5268, // color 0x2 (Color)0x0000, // color 0x3 (Color)0x9008, // color 0x4 (Color)0xca30, // color 0x5 (Color)0xd8e4, // color 0x6 (Color)0xfd42, // color 0x7 (Color)0xcc68, // color 0x8 (Color)0xfeb2, // color 0x9 (Color)0xf720, // color 0xa (Color)0x8668, // color 0xb (Color)0x044a, // color 0xc (Color)0x0210, // color 0xd (Color)0x4439, // color 0xe (Color)0x7ddf // color 0xf }; const uint8_t IMAGE_DATA[] = { 16, // frame width 16, // frame height 0x01, // number of frames (lower byte) 0x00, // number of frames (higher byte) 0, // animation speed 0x0, // transparent color 1, // indexed color mode // frame 1/1 0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00, 0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 0x03, 0xaa, 0x3a, 0xaa, 0xaa, 0xa3, 0xaa, 0x30, 0x03, 0xaa, 0xa3, 0x33, 0x33, 0x3a, 0xaa, 0x30, 0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00 };
Of course, it should not be forgotten to specify that the transparency color chosen here is white, so #ffffff = 0xffff
(which is actually the color with index 0x0
in the palette)!
I don't see what the problem is?
NEW il y a 5 ans
Sorry, I don't understand what you mean. Can you post your image?
The default Gamebuino palette is the one defined in the official doc. And Image Transcoder uses this palette by default!
What tool do you mean when you say Image Translator?
NEW il y a 5 ans
Here is a simple example drawn with the default palette:
Image Transcoder generates the following code (scroll down to see the whole code):
const Color PALETTE[] = { (Color)0xffff, // color 0x0 (Color)0xacd0, // color 0x1 (Color)0x5268, // color 0x2 (Color)0x0000, // color 0x3 (Color)0x9008, // color 0x4 (Color)0xca30, // color 0x5 (Color)0xd8e4, // color 0x6 (Color)0xfd42, // color 0x7 (Color)0xcc68, // color 0x8 (Color)0xfeb2, // color 0x9 (Color)0xf720, // color 0xa (Color)0x8668, // color 0xb (Color)0x044a, // color 0xc (Color)0x0210, // color 0xd (Color)0x4439, // color 0xe (Color)0x7ddf // color 0xf }; const uint8_t IMAGE_DATA[] = { 16, // frame width 16, // frame height 0x01, // number of frames (lower byte) 0x00, // number of frames (higher byte) 0, // animation speed 0x0, // transparent color 1, // indexed color mode // frame 1/1 0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00, 0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 0x03, 0xaa, 0x3a, 0xaa, 0xaa, 0xa3, 0xaa, 0x30, 0x03, 0xaa, 0xa3, 0x33, 0x33, 0x3a, 0xaa, 0x30, 0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00 };
Of course, it should not be forgotten to specify that the transparency color chosen here is white, so #ffffff = 0xffff
(which is actually the color with index 0x0
in the palette)!
I don't see what the problem is?
NEW il y a 5 ans
I think, it's a bug?
If i compile/upload DiggerMETA without setPalette (left) and if i compile/upload DiggerMETA with default setPalette (right), it looks:
If i take a screenshot from the second, it looks like the first (left).
I'm confused ...
Steph
il y a 5 ans
I really have a hard time understanding what's bothering you... can you send me the image you're looking to transcode, please?
If you want to compile Digger META, you don't have to do anything, since the image is already encoded in the source code.
In order to be able to help you, I need you to clearly express to me what you are trying to do, what you are doing, and what are the difficulties you are facing...
NEW il y a 5 ans
I really have a hard time understanding what's bothering you... can you send me the image you're looking to transcode, please?
If you want to compile Digger META, you don't have to do anything, since the image is already encoded in the source code.
In order to be able to help you, I need you to clearly express to me what you are trying to do, what you are doing, and what are the difficulties you are facing...
tikkel
il y a 5 ans
I have foreked the orig. DiggerMETA with a bit changes, so its a little bit more playable for me.
If i load the default palette, it looks like inverted...
... try it self.
https://github.com/tikkel/Digger
I want the rocks a bit more violate - like the original...
NEW il y a 5 ans
Also, if I remember correctly, the built-in screenshot recorder don't work with custom palettes.
NEW il y a 5 ans
I have foreked the orig. DiggerMETA with a bit changes, so its a little bit more playable for me.
If i load the default palette, it looks like inverted...
... try it self.
https://github.com/tikkel/Digger
I want the rocks a bit more violate - like the original...
Steph
il y a 5 ans
Okay... now I understand what your problem is:-)
Indeed... it just looks like the sprites were drawn with the default palette... but not in the right order!
So I wonder if, at the time Digger-Meta was developed, the official palette was not defined in a different order? You'd have to ask Sorunome about it.
I relied on the palette that is defined in the reference documentation.
NEW il y a 5 ans
Okay... now I understand what your problem is:-)
Indeed... it just looks like the sprites were drawn with the default palette... but not in the right order!
So I wonder if, at the time Digger-Meta was developed, the official palette was not defined in a different order? You'd have to ask Sorunome about it.
I relied on the palette that is defined in the reference documentation.
NEW il y a 5 ans
I guess, since i'm using indexed half res, the color numbers are from the enum ColorIndex in https://github.com/Gamebuino/Gamebuino-META/blob/master/src/utility/Graphics/Graphics.h , not "Color".
No tool was used for converting the colors from original bitmap to sprite. Just pen and paper ;)
@tikkel: love your diamond animation :)
Steph
il y a 5 ans
Well, that's it! It was a problem of order!
But why did they define different orders between the different display modes?...
It doesn't make sense!...
Well, it complicates things especially!
tikkel
il y a 5 ans
... It looks a bit like the original:
At the beginning of this thread, I hoped that this effect would be possible on the META as well. But I have learned that you have to paint everything.
In the original KC85, a specific foreground color is switched on / off via an interrupt. You can read a technical blog about this ingenious trick: https://floooh.github.io/2017/01/14/yakc-diamond-scroll.html
NEW il y a 5 ans
Well, that's it! It was a problem of order!
But why did they define different orders between the different display modes?...
It doesn't make sense!...
Well, it complicates things especially!
NEW il y a 5 ans
... It looks a bit like the original:
At the beginning of this thread, I hoped that this effect would be possible on the META as well. But I have learned that you have to paint everything.
In the original KC85, a specific foreground color is switched on / off via an interrupt. You can read a technical blog about this ingenious trick: https://floooh.github.io/2017/01/14/yakc-diamond-scroll.html