Compare commits

..

8 commits

Author SHA1 Message Date
Crayon2000
507186821c Add comments 2024-08-15 22:13:56 -04:00
Crayon2000
3bb5817f33 Add comments 2024-08-15 22:13:55 -04:00
Crayon2000
7d08f7eed5 Allow different texture format 2024-08-15 22:13:55 -04:00
Crayon2000
6795c0b1ce Remove useless loop 2024-08-15 22:13:54 -04:00
Crayon2000
d65a16765b Add id parameter to GRRLIB_LoadTextureTPL 2024-08-15 22:13:54 -04:00
Crayon2000
d67e646e67 Use less memory allocation 2024-08-15 22:13:53 -04:00
Crayon2000
fee01d1f4c Align TPL code with GRRLIB 2024-08-15 22:13:53 -04:00
Crayon2000
efdbfedb30 First limited TPL implementation 2024-08-15 22:13:52 -04:00
5 changed files with 22 additions and 96 deletions

View file

@ -17,9 +17,9 @@ jobs:
- name: Build library and examples
run: |
make -C GRRLIB clean all install
make -C GRRLIB/GRRLIB PLATFORM=cube clean all install
make -C examples
(cd GRRLIB && make clean all install)
(cd GRRLIB/GRRLIB && make PLATFORM=cube clean all install)
(cd examples && make)
- uses: actions/upload-artifact@master
with:

View file

@ -18,7 +18,7 @@ jobs:
- name: Install doxygen
run: |
wget https://www.doxygen.nl/files/doxygen-1.12.0.linux.bin.tar.gz -O - | tar -xzv --directory=/tmp/
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz -O - | tar -xzv --directory=/tmp/
cd /tmp/doxygen-*
sudo make install
sudo apt-get update

View file

@ -4,7 +4,6 @@ All notable changes to this project will be documented in this file.
## [Unreleased][]
- Allow compilation and installation with cmake.
- Added `GRRLIB_CreateEmptyTextureFmt()` to create an empty texture with a given format.
## [4.5.1][] - 2024-03-02

View file

@ -1,66 +0,0 @@
cmake_minimum_required(VERSION 3.18)
project(grrlib)
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PNG REQUIRED libpng)
pkg_check_modules(FREETYPE REQUIRED freetype2)
pkg_check_modules(JPEG REQUIRED libjpeg)
add_library(pngu STATIC)
target_sources(pngu
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/lib/pngu/pngu.c"
)
target_include_directories(pngu
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/lib/pngu>"
PRIVATE
${PNG_INCLUDE_DIRS}
)
target_link_libraries(pngu PUBLIC
${PNG_LIBRARIES}
)
add_library(grrlib STATIC)
target_compile_options(grrlib
PRIVATE
-Wall
-Wshadow
-Wunused
)
file(GLOB_RECURSE GRRLIB_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/*.c")
target_sources(grrlib
PRIVATE
"${GRRLIB_SRC_FILES}"
)
target_include_directories(grrlib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB>"
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/grrlib>"
${FREETYPE_INCLUDE_DIRS}
${JPEG_INCLUDE_DIRS}
)
target_link_libraries(grrlib PUBLIC
pngu
)
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(TARGETS pngu grrlib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

View file

@ -82,31 +82,14 @@ libjpeg is supplied via devkitPro pacman (ppc-libjpeg-turbo)
libfat is supplied via devkitPro pacman (libfat-ogc)
```
First, you need to make sure that all required library dependencies are installed.
Install them with a single command:
```bash
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
```
Go to the directory where the code was downloaded:
The easy way is to install GRRLIB and all the required libraries with a few
commands:
```bash
c:
cd \grr
```
To install GRRLIB with Make in a single command:
```bash
make -C GRRLIB clean all install
```
If you prefer to use CMake, it can also be installed with a few commands:
```bash
/opt/devkitpro/portlibs/wii/bin/powerpc-eabi-cmake -B build
cmake --build build --target install
cd \grr\GRRLIB
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
make clean all install
```
This process may take some time depending on the speed of your PC.
@ -114,26 +97,36 @@ This process may take some time depending on the speed of your PC.
If you used the method above the following steps are not required, GRRLIB is
installed and you are ready to start developing Wii homebrew games.
If you want, you could install the libfat, libpng,
libfreetype and libjpeg with there dependencies in a single command:
```bash
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
```
Each library could also be installed individually:
To install libpngu:
```bash
cd GRRLIB\lib\pngu
c:
cd \grr\GRRLIB\lib\pngu
make clean all install
```
To install libgrrlib for Wii:
```bash
cd GRRLIB\GRRLIB
c:
cd \grr\GRRLIB\GRRLIB
make clean all install
```
To install libgrrlib for GameCube:
```bash
cd GRRLIB\GRRLIB
c:
cd \grr\GRRLIB\GRRLIB
make PLATFORM=cube clean all install
```