Commit Graph

19 Commits

Author SHA1 Message Date
ThorTuwy
e6242613c9 library: Fix 32x64 sprite size definition 2025-02-09 12:48:26 +01:00
Antonio Niño Díaz
aef2292857 library: Share most code that loads file from the filesystem
Instead of repeating the same code whenever a file needs to be loaded,
move it to a function.
2023-05-30 22:50:22 +01:00
Antonio Niño Díaz
e15a8402b5 library: Cleanup memory allocation
Only call calloc() if the buffer actually needs to be zeroed. For
buffers that are going to be filled right away, malloc() is faster.
2023-05-30 01:47:45 +01:00
Antonio Niño Díaz
039eda9343 library: Replace some shifts by multiplications and divisions 2023-05-30 01:37:01 +01:00
Antonio Niño Díaz
470c39d031 library: Add copyright notice 2023-05-29 23:25:36 +01:00
Antonio Niño Díaz
0428b7a1ea library: Translate file headers 2023-05-25 22:11:19 +01:00
Antonio Niño Díaz
2f13ecd7b8 library: Cleanup and translate 256 color sprite module 2023-05-24 02:53:36 +01:00
Antonio Niño Díaz
c34dbb2912 library: Remove version number from source files
This is misleading unless it's updated every single time there is a
commit, which isn't realistic.
2023-05-11 23:49:33 +01:00
Antonio Niño Díaz
0394efbf77 Small cleanup of loop variables 2023-05-03 01:48:58 +01:00
Antonio Niño Díaz
e0296e0856 Remove superfluous comments 2023-05-03 01:48:58 +01:00
Antonio Niño Díaz
54d5435650 Reorganize includes
libc includes go first, then libraries like libnds and dswifi, then
NFLib includes.
2023-05-03 01:48:58 +01:00
Antonio Niño Díaz
fe33d66d91 Remove trailing whitespace 2023-05-03 01:21:56 +01:00
Antonio Niño Díaz
0c0a9e743e Enable -Wextra
- Fix most new warnings (silence a few of them, though).

- Replace all sprintf() by the safer snprintf().
2023-04-22 01:48:47 +01:00
lifehackerhansol
ef23e0418a
Do not force libfilesystem or libfat dependency
This removes dependency from the (frankly awful) libfilesystem, as well
as libfat.

fatInitDefault() or nitroFSInit() should be initialized outside of
NFlib, if one requires it. Within NFLib, we will only check whether
NitroFS is accessible, and fail otherwise.

This allows a user to still use libfat, libfilesystem or any other
NitroFS / FAT implementation, should one wish to use it, as long as the
implementation of NitroFS mounts to `nitro:/`, or the storage medium is
mounted to `sd:/` or `fat:/`.

This is a breaking change: users will need to update their code to
handle NitroFS and/or FAT inits on their own.

This also removes unnecessary filesystem.h and fat.h includes from all
other files.
2023-04-13 11:30:37 -07:00
Antonio Niño Díaz
61fde2b572 Use UTF-8 across all codebase
This has been done with:

    for f in `ls`; do
        iconv -f ISO-8859-1 -t UTF-8//TRANSLIT "$f" -o "$f".2;
        mv "$f".2 "$f"
    done
2023-04-13 18:51:09 +01:00
Antonio Niño Díaz
151db13cc0 license: Fix licenses
- Creative Commons (except for CC0) shouldn't be used for code:

   https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software

   MIT has the same spirit as the CC-BY license.

- CC-BY has been retained for the assets included in the repository.

- Also, the years were wrong, this library was started in 2009.

- Make all examples use the CC0 license.
2023-04-01 19:56:45 +01:00
Antonio Niño Díaz
4711a6512f license: Change to CC BY 4.0
The previous license was CC BY-NC 4.0, which doesn't allow commercial
use of the library. Nowadays this exception isn't really helpful, and
it may discourage people that are thinking about using the library (and
may be thinking about maybe selling the ROM in websites like itch.io).
2023-04-01 12:25:33 +01:00
Antonio Niño Díaz
9aee0b0461 docs: Cleanup license text 2023-03-31 18:54:21 +01:00
Antonio Niño Díaz
daee0a3334 build: Reorganize directories
- Bring the source and include directories in nflib to the root of the
  repository to match the organization of other libraries.

- Expect users to install NFlib in the devkitPro folder.

- Update all Makefiles for modern devkitPro.

- Remove all redundant copies of NFlib in all examples. The only
  remaining copy of the library is in the extras/wifi example, but
  that one includes more files, so I have left it untouched for now.
2023-03-31 18:27:29 +01:00