libctru/examples/graphics/bitmap/24bit-color
Dave Murphy cbb00e413d Automate graphics conversion
Makefile:

- Don't set DATA, we're no longer embedding files from there directly

- Add folders from GRAPHICS to VPATH. This is how make finds the source files

- Add PNGFILES variable containing all png files from GRAPHICS folders

- Add png files to OFILES with extension changed to rgb.o

- Add rule to create .rgb.o fromn .rgb using normal bin2o macro

- Add rule to create .rgb from .png using imagemagick

source/main.c

- the extension has changed to .rgb so the header is now <filename>_rgb.h and the variables end in _rgb
2014-12-15 12:35:03 +00:00
..
gfx delete generated bin file, move png to gfx folder 2014-12-15 11:59:54 +00:00
source Automate graphics conversion 2014-12-15 12:35:03 +00:00
Makefile Automate graphics conversion 2014-12-15 12:35:03 +00:00
README.md Used *.c extension and lower case dir name 2014-12-15 09:29:33 +01:00

24bit Bitmap Example

This example shows on bottom screen an upscaled version of the nds examples Drunken Coders logo that can be found in devkitPro.

If you want to try with your own image follow these steps:

  1. Download & install: http://www.imagemagick.org/ (If you get an option to add the application to the path make sure to check it!).
  2. convert fileIn.png -channel B -separate fileIn.png -channel G -separate fileIn.png -channel R -separate -channel RGB -combine -rotate 90 fileOut.rgb
  3. Rename fileOut.rgb in fileOut.bin
  4. Copy fileOut.bin in the data folder of your project
  5. Replace any reference of drunkenlogo_bin in main.cpp with fileOut_bin (or however you named it)
  6. Re-Build the project

As you can see from the previos steps the image is clockwise rotated by 90 degrees and its B and R channels are swapped. The first operation is done because the 3DS screens are actually portrait screens rotated by 90 degrees (in a counter-clockwise direction), while the second one is done because the 3DS screens' framebuffers have a BGR888 color format, by default.