Comments (14)
With the "bpp_mode" field you can override default BPP mode for all graphic asset types (sprites one was missing, I have just added support for it).
from butano.
I'm not sure to understand. I have a bg with "bpp_mode": "bpp_8" with a palette > 16 colors but using only < 16 colors in that palette, and, once imported, its palette is 16 colors (without using "palette_item" option, because, if you do that, it's ok).
Edit: Maybe, it is because in my palette, many colors are the same. I have to check.
from butano.
graphics.zip
Just tried with those files.
bn::regular_bg_ptr bg = bn::regular_bg_items::test_256c_all_diff.create_bg(0, 0);
bn::bg_palette_ptr palette=bg.palette();
bn::span<const bn::color> colors_const = palette.colors();
BN_LOG("test_256c_all_diff palette size: ", colors_const.size());
bg = bn::regular_bg_items::test_18c_all_same.create_bg(0, 0);
palette=bg.palette();
colors_const = palette.colors();
BN_LOG("test_18c_all_same palette size: ", colors_const.size());
I got:
[WARN] GBA Debug: test_256c_all_diff palette size: 16
[WARN] GBA Debug: test_18c_all_same palette size: 16
256c_all_diff and 18c_all_same refers to the number of colors in palettes, in the images, only one color is use anyway.
from butano.
I have updated the graphics tool to allow to specify colors count for almost all graphic asset types.
from butano.
I tried but I still have the same behaviour with the files I provided. Am I missing something?
from butano.
Have you updated butano?
If it still doesn't work after updating (and specifying colors count in the json of the bmp you want to import), please upload a minimal reproducible example of the issue.
from butano.
I took the zip file of the project (In the main page, Code->Download ZIP).
I tried with the files and code I provided.
This is a full project.
I saw a difference, bpp is now BPP_8 but the color count is still not correct.
test_256c_all_diff : 256 colors in the palette, all the pixel use the same color "slot" (pure blue). Result in the log: [WARN] GBA Debug: test_256c_all_diff palette size: 16, bpp:1
test_18c_all_same: 18 colors in the palette, all the same (pure red), all the pixel use the same color "slot". Result in the log: [WARN] GBA Debug: test_18c_all_same palette size: 16, bpp:1
And to try to find how it works, I built test_256c_all_diff_gradient (which in fact has 255 colors in the palette) and use only few colors of it but more than 16 colors and I got:
[WARN] GBA Debug: test_256c_all_diff_gradient palette size: 240, bpp:1
I don't understand why there is 240 colors, I imagine some of the colors (15 of them??) in the palette are the same once converted to 15bit...
Hope this helps
from butano.
You have not specified "colors_count" field in the json of the affected bmp files.
from butano.
As I said, please make sure to update Butano and specify colors count in the json of the bmp you want to import.
from butano.
Just tried and it seams to work. Sorry for the "colors_count" but it was not specified in the "Importing assets" doc page in the bg or sprite part (but indeed, it was in the palettes part). When you said "(and specifying colors count in the json of the bmp you want to import)", I thought you were talking about the bpp field...
I still have to see if it still merging colors which are the same in the image. I'll try tomorrow.
Thanks a lot. Your project is really great :)
from butano.
"colors_count" field shows in the sprites section, at least for me: https://gvaliente.github.io/butano/import.html#import_sprite
By the way, can I close this issue?
from butano.
You're right, clearing the browser's caching, the text appears in the others sections 😕, sorry.
Can you wait I test if the identical colors in the image are still merged to use the same "palette slot" before closing it ? I don't think I would be able to do that today but I'll try tomorrow.
from butano.
I'll close this issue now.
If you have issues with palettes merging, since it is unrelated to this issue, please feel free to create a new one.
Here's a bit of extra info about color palettes, by the way: https://gvaliente.github.io/butano/faq.html#faq_color
from butano.
Ok, finally, I had time to test. It's working, it's great. Thanks.
Here is the result of what I was trying to achieve (WIP).
Thanks again
Edit: It's WIP, fade time is too short I guess. Not that obvious on mGBA...
from butano.
Related Issues (20)
- can't open file `C:\\devkitPro\\msys2\\tools\\butano_assets_tool.py`: [Errno 2] No such file or directory
- Is possible to use 16x16 tiles in Regular backgrounds? HOT 2
- [Request] Add hash support for `bn::type_id_t` HOT 1
- [Docs] Same derived class appears 6 times in `bn::igeneric_pool_base` HOT 3
- `bn_best_fit_allocator.h` doesn't include dependent headers HOT 1
- `bn::utf8_character::size()` returns `0` for ASCII characters HOT 1
- Undefined reference to `__assert_func` on `-O0` after newlib was removed HOT 2
- Can't return static local variable, after newlib was removed HOT 4
- [Feature Request] Ability to run user-defined code upon failed BN_ASSERT or BN_ERROR? HOT 7
- std::shared_ptr fails during linking HOT 2
- DMG music master volume is 25% (too quiet) HOT 6
- "VgmIntrVblank failed" when pausing VGM music at the end of the song HOT 2
- Setting palette ID erroneously adjusting adjacent cell's tile_index HOT 2
- [Request] Configurable precision for fixed_point. HOT 2
- Butano CMake Toolchain? HOT 1
- Makefile error message about missing DEVKITARM/WONDERFUL_TOOLCHAIN is not displayed correctly HOT 2
- Support for GSM player? HOT 2
- I can't create gba file using make on Debian HOT 4
- [Request] Support wireless adapter for `bn::link` API HOT 6
- `random.get_int(int limit)` can bias towards small numbers HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from butano.