This version of grit lets the user export binary file without ".bin"
after ".img", ".pal" or ".map", so the conversion scripts can be simplified
a lot.
All the converted files have been regenerated.
The main reason is that BlocksDS doesn't have any bug with NitroFS, and
NitroFS is strictly required to use NFlib. With devkitPro, melonDS won't be
able to run any program made with NFlib due to a bug with NitroFS.
Using g++ to link object files automatically links the STD of C++. It looks
like this library is linked outside of the start/end-group commands with
the other libraries, which causes undefined reference errors when linking
C++ projects that use standard library functions that interface with the
OS, like `fopen()`.
Thanks to @lifehackerhansol for the report and testing the fix.
Currently it is needed to rename the extension of the collision maps
from .img and .map to .dat and .cmp for NFlib to find the files. This
patch makes it also try to load the original extensions so that the
renaming isn't required.
Currently it is needed to rename the extension of the font to .fnt from
.img for NFlib to find the files. This patch makes it also try to load a
.img file so that the renaming isn't required.
When a 3D sprite is created on top of a previously created 3D sprite, it
is needed to delete the previous one. If not, the sprite count will be
incorrect.
This doesn't happen with other subsystems of the library.
Only initialize the structure when a new sprite is created. The "inuse"
field of the struct is enough to disable it completely, and the state
is set to the default values when it is created again.
Types like u8 and u16 aren't always a good idea. For example:
void function(u8 x, u8 y)
{
u32 value = (x << 16) | y;
}
The left shift of x will overflow because x is 8 bits wide. It is better
to make both arguments 32 bit wide.
It may also cause the compiler to introduce bit masking operations at
the caller side because the caller doesn't know how the function
behaves internally.
In order to prevent this kind of issues, it's better to use 32 bit
variables unless there is a very good reason to use smaller types (like
in structs, to save RAM).