Nitro Engine doesn't work with the current libraries of devkitARM. It's
better to remove the makefiles and to stop pretending that devkitARM is
supported. Updating the makefiles wouldn't be enough, though, it's likely
that the library will require code changes, as well as the examples.
This texture format sets bit 15 manually to 1. This is slow, and it's
better if the developer converts graphics in a way that the bit is already
set to 1.
Until now the main makefiles of Nitro Engine have been the ones of
devkitPro, forcing users to go through extra steps to build everything
under BlocksDS.
Now, the easy makefiles are the BlocksDS ones, and additional notes have
been added to warn about the limitations of devkitPro:
- No GRF support in libnds.
- NitroFS doesn't work in melonDS.
Using global variables is generally discouraged. Now that NE_ProcessArg()
and NE_ProcessDualArg() exist, it's better to show how to use them instead
of NE_Process() and NE_ProcessDual() while using global variables.
Also, switch from "int main(void)" to "int main(int argc, char *argv[])".
This change is a bit pedantic, but it makes the ROMs run better in
DeSmuMe.
Some examples (particularly the dual 3D examples) used to flicker during
one or two seconds right after starting. In dual 3D examples the top and
bottom screen would start swapped, and they would eventually swap and
stop flickering. This would never happen in melonDS or real hardware.
I suspect this is because of the interaction between GFX_FLUSH and
swiWaitForVBlank(), where there would be some timing difference to reach
the first swiWaitForVBlank() or GFX_FLUSH, and that caused the desync.
This commit moves swiWaitForVBlank() to the beginning of the game loop.
This means that, even in the first iteration of the game loop, all
emulators and hardware will be synchronized. This doesn't actually
matter in any other situation, it just makes the first iteration
consistent.
Until now, a mesh was always owned by one single model. This made it
very difficult to clone models, because the mesh was always owned by one
of them. Whenever you deleted that model, the mesh was also deleted, and
all the cloned models would be unusable.
With the new system, there is a list of meshes with counters of how many
models use them. This way no matter how many models use the mesh, the
mesh will only be deleted when the last model is deleted.
In addition, in a similar way as before, a mesh has a flag that signals
if free() has to be called on the mesh data when the mesh is deleted.
This is useful when the mesh is loaded from a filesystem and stored in a
buffer allocated with malloc(), which is what Nitro Engine does.
Note that this code should be considered experimental for the time
being, until some tests are added.
This is done to make it easier to implement compressed texture loading.
The main change is to stop allowing widths that aren't a power of two:
- Supporting them complicates the loading code a lot.
- Compressed textures can't really be expanded because they are composed
by many 4x4 sub-images.
- They don't save space in VRAM.
- They save space in the final ROM, but you can achieve the same effect
compressing them with LZSS compression, for example.
The example incomplete_texture has been updated to reflect the new
limitations.
- Provide the original assets for everything used in the examples. Add
scripts to convert the original assets into the formats used by the DS
instead of only providing the pre-converted files. The pre-converted
assets are still provided for convenience.
- Move away from BMP files in the examples: They aren't a realistic way
to use Nitro Engine to load textures. Use pre-converted PNG files
instead.