I have some questions about the libnds sprite functions, and some documentation 'bugs'.
first the questions:
1. I always thought you needed to enable which background you want to use and if you want to use sprites when calling videoSetMode(). however, I found that it also works without enabling backgrounds and sprites. is it because it may or may not be already enabled, like powerOn(). or is it something else?
2. the oamInit() documentation says that I should use 'SpriteMapping_Bmp_1D_128 or SpriteMapping_Bmp_1D_256' if I want to mix tiled and bitmap sprites. well, I tried it, making sure that grit converted my image into bitmap form. but the sprite was completely disorted (like I kinda expected). I didn't saw a way to tell the engine that my sprite was in fact a bitmap sprite instead of a tiled sprite. how should I do it.
3. there is a oamSetMosaic() function, but it only works for the main engine. I asume there should be a oamSetMosaicSub() function, but I cant find it (its not in the documentation). could you create it if its not created yet and properly document it?
4. I've heard it is possible to alpha blend sprites, but I coudn't find a way to do it. is there a function to enable alpha blending?
5. there is 1 palette with 256 colors per main/sub sprites and backgrounds (so 4 normal palettes in total), and the only way to get more palettes is to use vram as extended palettes, right? is there a limit on how many extended palettes I can have? and which vram banks can I use best for it.
6. I know that you can rotate and scale a sprite using oamRotateScale(). but when I look at toncs page on affine transformation it says that you can also shear a sprite. is it possible to do this with the current funcions? if not, could you include a function so people could set the affine transformation themselfs. something like this:
Code: Select all
/**
* @brief allows you to directly sets the affine transformation matrix
*
* with this, you have more freedom to set the matrix, but it might be more difficult to use if
* you're not used to affine transformation matrix. this will erase the previous matrix stored at rotId.
*
* @param oam the oam engine, must be &oamMain or &oamSub
* @param rotId the id of the rotscale item you want to change, must be 0-31
* @param hdx the horizontal x value?
* @param hdy the horizontal y value?
* @param vdx the vertical x value?
* @param vdy the vertical y value?
*/
void oamAffineTransformation(OamState* oam, int rotId, int hdx, int hdy, int vdx, int vdy)
{
sassert(rotId >= 0 && rotId < 32, "oamAffineTransformation() rotId is out of bounds, must be 0-31")
oam->oamRotationMemory[rotId].hdx = hdx >>12;
oam->oamRotationMemory[rotId].hdy = hdy >>12;
oam->oamRotationMemory[rotId].vdx = vdx >>12;
oam->oamRotationMemory[rotId].vdy = vdy >>12;
}
the documentation 'bugs':
the enums POWER_ALL_2D and POWER_ALL aren't documented in system.h
the function videoSetMode() is doxygen documentated in video.h, but it doesn't apear in the documentation.
the function (or macro?) intToFixed() isn't documentated, as wel as de BIT() macro.
the documentation says that the return type of oamCountFragments() is void, while it actually is int.
the description of oamFreeGfx() is the same as oamGetGfxPtr(), which I dont think is right (probably a copy paste mistake).
the description of oamSetMosaic() says 'sets sprite mosaic', which makes you think that is't sprite specific.
could you change it so it says that the effect go's for every sprite that has mosaic turned on.
lcdMainOnBottom(), lcdMainOnTop() and lcdSwap() aren't in the documentation
and you don't need to specify the function if the function follows directly after the doxygen comment.
also, is there a place where I can download the libnds sourcecode in 1 go? I looked here, but it seems you can only download 1 file at a time, which means it would take forever to download everything.
greets
vuurrobin