diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92d28fd..7734298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,9 +17,6 @@ jobs: build-win32: name: "Build for Windows 32-bit" runs-on: ubuntu-latest - env: - ARCH: i686 - BITS: 32 permissions: contents: write @@ -29,21 +26,5 @@ jobs: uses: actions/checkout@v4 - name: Install packages run: sudo apt-get install mingw-w64 - - name: Get my CMake files - run: git clone https://github.com/nishiowo/cmake cmake-files --depth=1 - - name: Get and extract ODE - run: wget https://sourceforge.net/projects/opende/files/ODE/0.13/ode-0.13.tar.gz/download -O - | tar xvzf - - - name: Build ODE - run: cd ode-0.13 && ./configure --host=${{env.ARCH}}-w64-mingw32 --prefix=/ --disable-demos --without-drawstuff --enable-shared && make -j4 - - name: Install ODE - run: make -C ode-0.13 install DESTDIR=`pwd`/deps - - name: Get Pawn - run: git clone https://github.com/nishiowo/pawn --depth=1 - - name: Build Pawn - run: cd pawn && mkdir build && cd build && cmake -DDEBIAN=ON -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/windows.cmake -DARCH=${{env.ARCH}} .. -DCMAKE_INSTALL_PREFIX=/ && make -j4 - - name: Install Pawn - run: make -C pawn/build install DESTDIR=`pwd`/deps - - name: Build NishBox - run: make PLATFORM=win${{env.BITS}} - - name: Copy DLL - run: cp `make PLATFORM=win${{env.BITS}} print-deps` ./ + - name: Run build script + run: env ARCH=i686 BITS=32 MAKE=make ./build-windows.sh diff --git a/.gitignore b/.gitignore index 740829a..49c87e0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.a *.core *.dll +/deps +/contrib /src/nishbox diff --git a/build-windows.sh b/build-windows.sh new file mode 100755 index 0000000..41a8d1c --- /dev/null +++ b/build-windows.sh @@ -0,0 +1,62 @@ +#!/bin/sh +ODE_VERSION=0.13 + +BASE=`pwd` + +mkdir -p contrib +cd contrib + +if [ -d cmake-files ]; then + cd cmake-files + git pull + cd .. +else + git clone https://github.com/nishiowo/cmake cmake-files --depth=1 +fi + +if [ ! -d ode-${ODE_VERSION} ]; then + wget https://sourceforge.net/projects/opende/files/ODE/${ODE_VERSION}/ode-${ODE_VERSION}.tar.gz/download -O - | tar xvzf - +fi +cd ode-${ODE_VERSION} +if [ ! -f .configured ]; then + ./configure --host=${ARCH}-w64-mingw32 --prefix=/ --disable-demos --without-drawstuff --enable-shared || exit 1 + touch .configured +fi +if [ ! -f .made ]; then + ${MAKE} -j4 || exit 1 + touch .made +fi +if [ ! -f .installed ]; then + ${MAKE} install DESTDIR=${BASE}/deps + touch .installed +fi +cd .. + +if [ -d pawn ]; then + cd pawn + git pull + cd build +else + git clone https://github.com/nishiowo/pawn --depth=1 + cd pawn + mkdir build + cd build +fi +if [ ! -f ../.configured ]; then + cmake -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/windows.cmake -DARCH=${ARCH} .. -DCMAKE_INSTALL_PREFIX=/ || exit 1 + touch ../.configured +fi +if [ ! -f ../.made ]; then + ${MAKE} -j4 || exit 1 + touch ../.made +fi +if [ ! -f ../.installed ]; then + ${MAKE} install DESTDIR=${BASE}/deps + touch ../.installed +fi +cd ../.. + +cd .. + +${MAKE} PLATFORM=win${BITS} +cp `${MAKE} PLATFORM=win${BITS} print-deps` ./ diff --git a/engine/draw.c b/engine/draw.c index d58d362..601e196 100644 --- a/engine/draw.c +++ b/engine/draw.c @@ -55,6 +55,7 @@ void nb_draw_init_opengl(nb_draw_t* draw) { free(font); } glBindTexture(GL_TEXTURE_2D, 0); + nb_function_log("Registered %d glyphs", sizeof(nb_font) / sizeof(nb_font[0])); } void nb_draw_begin_2d(nb_draw_t* draw) {