Skip to content

Commit

Permalink
Disable unpacked MPQs
Browse files Browse the repository at this point in the history
to make it easier for users to generate a .cdi with diabdat.mpq
  • Loading branch information
azihassan committed Oct 6, 2024
1 parent 5f7e715 commit 6cb0513
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 39 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/dreamcast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,20 @@ jobs:
with:
fetch-depth: 0

- name: Build unpack_and_minify_mpq
run: |
git clone https://github.com/diasurgical/devilutionx-mpq-tools/ && \
cd devilutionx-mpq-tools && \
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build-rel && \
cmake --install build-rel
- name: Download and unpack spawn.mpq
- name: Download spawn.mpq
run: |
curl -LO https://raw.githubusercontent.com/d07RiV/diabloweb/3a5a51e84d5dab3cfd4fef661c46977b091aaa9c/spawn.mpq
unpack_and_minify_mpq spawn.mpq --output-dir data
rm spawn.mpq
- name: Download and unpack fonts.mpq
- name: Download fonts.mpq
run: |
curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq && \
unpack_and_minify_mpq fonts.mpq --output-dir data/fonts && \
rm fonts.mpq
curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq
- name: Configure CMake
run: |
source /opt/toolchains/dc/kos/environ.sh && \
#uncomment when using packed save files
#uncomment when using packed mpq or save files
#without this, cmake can't find the kos-ports bzip2 & zlib libraries
#export CMAKE_PREFIX_PATH=/opt/toolchains/dc/kos-ports/libbz2/inst/:/opt/toolchains/dc/kos-ports/zlib/inst/ && \
export CMAKE_PREFIX_PATH=/opt/toolchains/dc/kos-ports/libbz2/inst/:/opt/toolchains/dc/kos-ports/zlib/inst/ && \
kos-cmake \
-S . \
-B build
Expand All @@ -71,8 +59,8 @@ jobs:
- name: Generate .cdi
run: |
source /opt/toolchains/dc/kos/environ.sh && \
cp -R data/spawn build/data/spawn && \
cp -R data/fonts/fonts/fonts/ build/data/fonts/ && \
mv spawn.mpq build/data/ && \
mv fonts.mpq build/data/fonts/ && \
mkdcdisc -e build/devilutionx.elf -o build/devilutionx.cdi --name 'Diablo 1' -d build/data/
- name: Upload .elf Package
Expand Down
2 changes: 1 addition & 1 deletion CMake/platforms/dreamcast.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(DEVILUTIONX_GAMEPAD_TYPE Nintendo)

set(NOSOUND ON)
set(DEVILUTIONX_STATIC_ZLIB ON)
set(UNPACKED_MPQS ON)
#set(UNPACKED_MPQS ON)
set(UNPACKED_SAVES ON)
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
set(DEVILUTIONX_STATIC_LUA ON)
Expand Down
27 changes: 8 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
FROM alpine-kallistios:no-gdb

RUN echo "Building unpack_and_minify_mpq..."
RUN git clone https://github.com/diasurgical/devilutionx-mpq-tools/ && \
cd devilutionx-mpq-tools && \
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build-rel && \
cmake --install build-rel

RUN echo "Cloning project..."
WORKDIR /opt/toolchains/dc/kos/
RUN git clone -b dreamcast https://github.com/azihassan/devilutionX.git

WORKDIR /opt/toolchains/dc/kos/devilutionX
RUN echo "Download and unpack spawn.mpq..."
RUN curl -LO https://raw.githubusercontent.com/d07RiV/diabloweb/3a5a51e84d5dab3cfd4fef661c46977b091aaa9c/spawn.mpq && \
unpack_and_minify_mpq spawn.mpq --output-dir data && \
rm spawn.mpq
RUN echo "Downloading spawn.mpq..."
RUN curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/spawn.mpq

RUN echo "Download and unpack fonts.mpq..."
RUN curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq && \
unpack_and_minify_mpq fonts.mpq --output-dir data/fonts && \
rm fonts.mpq
RUN echo "Downloading fonts.mpq..."
RUN curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq

RUN echo "Configuring CMake..."
RUN source /opt/toolchains/dc/kos/environ.sh && \
#uncomment when using packed save files
#without this, cmake can't find the kos-ports bzip2 & zlib libraries
#export CMAKE_PREFIX_PATH=/opt/toolchains/dc/kos-ports/libbz2/inst/:/opt/toolchains/dc/kos-ports/zlib/inst/ && \
export CMAKE_PREFIX_PATH=/opt/toolchains/dc/kos-ports/libbz2/inst/:/opt/toolchains/dc/kos-ports/zlib/inst/ && \
kos-cmake -S. -Bbuild

RUN echo "Patching fmt to support long double..."
Expand All @@ -35,10 +24,10 @@ RUN patch build/_deps/libfmt-src/include/fmt/format.h -l -p0 < libfmt-long-doubl
RUN echo "Compiling..."
RUN source /opt/toolchains/dc/kos/environ.sh && cd build && kos-make

RUN echo "Generate CDI"
RUN echo "Generating CDI"
RUN source /opt/toolchains/dc/kos/environ.sh && \
cp -R data/spawn build/data/spawn && \
cp -R data/fonts build/data/fonts && \
mv spawn.mpq build/data/ && \
mv fonts.mpq build/data/fonts && \
mkdcdisc -e build/devilutionx.elf -o build/devilutionx.cdi --name 'Diablo 1' -d build/data/

ENTRYPOINT ["sh", "-c", "source /opt/toolchains/dc/kos/environ.sh && \"$@\"", "-s"]

0 comments on commit 6cb0513

Please sign in to comment.