Skip to content

Commit

Permalink
Pack assets in mpq (#27)
Browse files Browse the repository at this point in the history
* put all the assets in the devilutionx mpq build

* Update README.md

delete the copying assets part in readme, as they are now packed with mpq

* fix target include directories and change project name to middleearthmod. Change mpq name to devilutionx-me.mpq

* fix linux build, maybe

* update workflow files, scripts and CMakeLists for non-Windows targets

* fix appimage script. fix .dmg name

* fix cpack package name for win32

* fix linux release packaging build script
  • Loading branch information
DakkJaniels authored Feb 26, 2023
1 parent 6e8525a commit 0f8759b
Show file tree
Hide file tree
Showing 67 changed files with 95 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx-debug.apk
name: middleearthmod-debug.apk
path: android-project/app/build/outputs/apk/debug/app-debug.apk
8 changes: 4 additions & 4 deletions .github/workflows/Linux_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx_linux_x86.tar.xz
path: devilutionx.tar.xz
name: middleearthmod_linux_x86.tar.xz
path: middleearthmod.tar.xz

- name: Upload-AppImage
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx_linux_x86.appimage
path: devilutionx.appimage
name: middleearthmod_linux_x86.appimage
path: middleearthmod.appimage
4 changes: 2 additions & 2 deletions .github/workflows/Linux_x86_64_SDL1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx_linux_x86_64_SDL1.tar.xz
path: devilutionx.tar.xz
name: middleearthmod_linux_x86_64_SDL1.tar.xz
path: middleearthmod.tar.xz
4 changes: 2 additions & 2 deletions .github/workflows/MacOSX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx.dmg
path: ${{github.workspace}}/build/devilutionx.dmg
name: middleearthmod.dmg
path: ${{github.workspace}}/build/middleearthmod.dmg
4 changes: 2 additions & 2 deletions .github/workflows/Windows_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx_ME_x64.zip
path: build/devilutionx-me.zip
name: middleearthmod_x64.zip
path: build/middleearthmod.zip
4 changes: 2 additions & 2 deletions .github/workflows/Windows_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx_x86.zip
path: build/devilutionx.zip
name: middleearthmod_x86.zip
path: build/middleearthmod.zip
10 changes: 5 additions & 5 deletions .github/workflows/iOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
run: >
cmake --build build -j $(sysctl -n hw.physicalcpu) --config Release &&
cd build &&
rm -rf Payload devilutionx.ipa &&
rm -rf Payload middleearthmod.ipa &&
mkdir Payload &&
mv devilutionx.app Payload &&
zip -r devilutionx.ipa Payload
mv middleearthmod.app Payload &&
zip -r middleearthmod.ipa Payload
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: devilutionx.ipa
path: build/devilutionx.ipa
name: middleearthmod.ipa
path: build/middleearthmod.ipa
59 changes: 56 additions & 3 deletions CMake/Assets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ set(devilutionx_assets
data/stashnavbtns.pcx
data/talkbutton.pcx
data/xpbar.pcx
data/inv/objcurs.cel
fonts/12-00.bin
fonts/12-00.pcx
fonts/12-01.bin
Expand Down Expand Up @@ -157,10 +158,62 @@ set(devilutionx_assets
gendata/cutportlw.pcx
gendata/cutportrw.pcx
gendata/cutstartw.pcx
monsters/balrog/megaa1.wav
monsters/balrog/megaa2.wav
monsters/balrog/megad1.wav
monsters/balrog/megad2.wav
monsters/balrog/megah1.wav
monsters/balrog/megah2.wav
monsters/balrog/megas1.wav
monsters/balrog/megas2.wav
monsters/byclps/biclopa1.wav
monsters/byclps/biclopa2.wav
monsters/byclps/biclopd1.wav
monsters/byclps/biclopd2.wav
monsters/byclps/bicloph1.wav
monsters/byclps/bicloph2.wav
monsters/byclps/byclpsa.cl2
monsters/byclps/byclpsd.cl2
monsters/byclps/byclpsh.cl2
monsters/byclps/byclpsn.cl2
monsters/byclps/byclpsw.cl2
monsters/gargoyle/gargoa1.wav
monsters/gargoyle/gargoa2.wav
monsters/spider/spidera.cl2
monsters/spider/spiderd.cl2
monsters/spider/spiderh.cl2
monsters/spider/spidern.cl2
monsters/spider/spiderw.cl2
monsters/wolf/wolfa1.wav
monsters/wolf/wolfa2.wav
monsters/wolf/wolfd1.wav
monsters/wolf/wolfd2.wav
monsters/wolf/wolfh1.wav
monsters/wolf/wolfh2.wav
objects/barrelex.cel
objects/sarc.cel
objects/urn.cel
sfx/items/barlfire.wav
sfx/items/barrel.wav
sfx/items/chest.wav
sfx/items/flipaxe.wav
sfx/items/fliplarm.wav
sfx/items/flipswor.wav
sfx/items/invaxe.wav
sfx/items/invlarm.wav
sfx/items/invsword.wav
ui_art/creditsw.pcx
ui_art/hf_titlew.pcx
ui_art/mainmenuw.pcx
ui_art/supportw.pcx)
ui_art/supportw.pcx
ui_art/credits.pcx
ui_art/mainmenu.pcx
ui_art/selconn.pcx
ui_art/selgame.pcx
ui_art/selhero.pcx
ui_art/title.pcx

)

if(NOT USE_SDL1 AND NOT VITA)
list(APPEND devilutionx_assets
Expand Down Expand Up @@ -203,9 +256,9 @@ else()
endif()

if(BUILD_ASSETS_MPQ)
set(DEVILUTIONX_MPQ "${CMAKE_CURRENT_BINARY_DIR}/devilutionx.mpq")
set(DEVILUTIONX_MPQ "${CMAKE_CURRENT_BINARY_DIR}/devilutionx-me.mpq")
add_custom_command(
COMMENT "Building devilutionx.mpq"
COMMENT "Building devilutionx-me.mpq"
OUTPUT "${DEVILUTIONX_MPQ}"
COMMAND ${CMAKE_COMMAND} -E remove -f "${DEVILUTIONX_MPQ}"
COMMAND ${SMPQ} -M 1 -C PKWARE -c "${DEVILUTIONX_MPQ}" ${DEVILUTIONX_MPQ_FILES}
Expand Down
2 changes: 1 addition & 1 deletion CMake/functions/devilutionx_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include(functions/set_relative_file_macro)
function(add_devilutionx_library NAME)
add_library(${NAME} ${ARGN})

target_include_directories(${NAME} PUBLIC ${DevilutionX_SOURCE_DIR}/Source)
target_include_directories(${NAME} PUBLIC ${PROJECT_SOURCE_DIR}/Source)

target_compile_definitions(${NAME} PUBLIC ${DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS})
target_compile_options(${NAME} PUBLIC ${DEVILUTIONX_PLATFORM_COMPILE_OPTIONS})
Expand Down
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ if(NOT VERSION_SUFFIX)
set(VERSION_SUFFIX "debug")
endif()
if(VERSION_NUM MATCHES untagged)
project(DevilutionX LANGUAGES C CXX)
project(middleearthmod LANGUAGES C CXX)
else()
project(DevilutionX
project(middleearthmod
VERSION ${VERSION_NUM}
LANGUAGES C CXX)
endif()
Expand Down Expand Up @@ -204,7 +204,7 @@ include(Dependencies)

add_subdirectory(Source)

set(BIN_TARGET devilutionx)
set(BIN_TARGET middleearthmod)
if(NINTENDO_3DS)
set(BIN_TARGET ${BIN_TARGET}.elf)
endif()
Expand Down Expand Up @@ -254,8 +254,8 @@ if(APPLE)
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionxme)
set(MACOSX_BUNDLE_COPYRIGHT Unlicense)
set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx_me)
set(MACOSX_BUNDLE_DISPLAY_NAME DevilutionX_ME)
set(MACOSX_BUNDLE_BUNDLE_NAME ${BIN_TARGET})
set(MACOSX_BUNDLE_DISPLAY_NAME ${BIN_TARGET})
set(MACOSX_BUNDLE_INFO_STRING ${PROJECT_VERSION})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
Expand Down Expand Up @@ -333,7 +333,7 @@ if(VITA)
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE Packaging/vita/sce_sys sce_sys
FILE ${DEVILUTIONX_MPQ} devilutionx.mpq
FILE ${DEVILUTIONX_MPQ} devilutionx-me.mpq
)
else()
vita_create_vpk(devilutionx-me.vpk ${VITA_TITLEID} devilutionx.self
Expand Down Expand Up @@ -420,8 +420,8 @@ if(CPACK AND (APPLE OR BUILD_ASSETS_MPQ OR SRC_DIST))
"${SDL2_WIN32_LICENSES_DIR}/LICENSE*.txt"
"${SDL2_WIN32_LICENSES_DIR}/README*.txt")

set(CPACK_PACKAGE_FILE_NAME "devilutionx-me")
set(CPACK_PACKAGE_NAME ${project_name})
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_GENERATOR "ZIP")
set(CPACK_STRIP_FILES TRUE)
install(TARGETS ${BIN_TARGET} DESTINATION .)
Expand Down Expand Up @@ -511,7 +511,7 @@ if(CPACK AND (APPLE OR BUILD_ASSETS_MPQ OR SRC_DIST))
endif()

elseif(APPLE)
set(CPACK_PACKAGE_FILE_NAME "devilutionx-me")
set(CPACK_PACKAGE_FILE_NAME ${BIN_TARGET})
set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK "ON")
set(CPACK_STRIP_FILES TRUE)
set(CPACK_GENERATOR "DragNDrop")
Expand Down
6 changes: 3 additions & 3 deletions Packaging/nix/AppImage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
make install -Cbuild DESTDIR=AppDir
mv build/AppDir/usr/share/diasurgical/devilutionx/devilutionx.mpq build/AppDir/usr/bin/devilutionx.mpq
mv build/AppDir/usr/share/diasurgical/devilutionx/devilutionx-me.mpq build/AppDir/usr/bin/devilutionx-me.mpq
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -N
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir=build/AppDir --custom-apprun=Packaging/nix/AppRun -d Packaging/nix/devilutionx.desktop -o appimage
mv DevilutionX*.AppImage devilutionx.appimage
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir=build/AppDir --custom-apprun=Packaging/nix/AppRun -d Packaging/nix/middleearthmod.desktop -o appimage
mv DevilutionX*.AppImage middleearthmod.appimage
12 changes: 6 additions & 6 deletions Packaging/nix/LinuxReleasePackaging.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mkdir ./build/package
find build/_CPack_Packages/Linux/7Z/ -name 'devilutionx' -exec cp "{}" ./build/devilutionx \;
cp ./build/devilutionx ./build/package/devilutionx
cp ./Packaging/resources/devilutionx.mpq ./build/package/devilutionx.mpq
cp ./build/devilutionx*.deb ./build/package/devilutionx.deb
cp ./build/devilutionx*.rpm ./build/package/devilutionx.rpm
find build/_CPack_Packages/Linux/7Z/ -name 'middleearthmod' -exec cp "{}" ./build/middleearthmod \;
cp ./build/middleearthmod ./build/package/middleearthmod
cp ./Packaging/resources/middleearthmod.mpq ./build/package/middleearthmod.mpq
cp ./build/middleearthmod*.deb ./build/package/middleearthmod.deb
cp ./build/middleearthmod*.rpm ./build/package/middleearthmod.rpm
cp ./Packaging/nix/README.txt ./build/package/README.txt
cp ./Packaging/resources/LICENSE.CC-BY.txt ./build/package/LICENSE.CC-BY.txt
cp ./Packaging/resources/LICENSE.OFL.txt ./build/package/LICENSE.OFL.txt
cd ./build/package/ && tar -cavf ../../devilutionx.tar.xz * && cd ../../
cd ./build/package/ && tar -cavf ../../middleearthmod.tar.xz * && cd ../../
File renamed without changes.
File renamed without changes.
Binary file added Packaging/resources/assets/data/inv/objcurs.cel
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Packaging/resources/assets/objects/barrelex.cel
Binary file not shown.
Binary file added Packaging/resources/assets/objects/sarc.cel
Binary file not shown.
Binary file added Packaging/resources/assets/objects/urn.cel
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/barlfire.wav
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/barrel.wav
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/chest.wav
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/flipaxe.wav
Binary file not shown.
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/flipswor.wav
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/invaxe.wav
Binary file not shown.
Binary file not shown.
Binary file added Packaging/resources/assets/sfx/items/invsword.wav
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/credits.pcx
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/mainmenu.pcx
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/selconn.pcx
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/selgame.pcx
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/selhero.pcx
Binary file not shown.
Binary file added Packaging/resources/assets/ui_art/title.pcx
Binary file not shown.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ To play the mod:
1. Compile the source as described in the readme OR use the latest [Release](https://github.com/DakkJaniels/DevilutionX-MiddleEarthMod/releases/latest) if one is available for your system:
![image](https://user-images.githubusercontent.com/6080734/221417208-85ef1a2b-97aa-4dcc-a179-36aa8f08abd0.png)

2. Run the devilutionx.exe and then quit the game (this makes the folder to be used in the next step):
![image](https://user-images.githubusercontent.com/6080734/221417229-8c6d7997-7d85-4be7-889c-dbbb06110a4e.png)

3. Copy the folders in the `ME.Mod.assets.zip` [file](https://github.com/DakkJaniels/DevilutionX-MiddleEarthMod/releases/download/1.4.1/ME.Mod.assets.zip) (also found in the Release) to wherever the diablo.ini file is located - %appdata%\Diablo\MiddleEarth for Windows Systems):
![image](https://user-images.githubusercontent.com/6080734/221416873-fec77ef4-0cb7-4810-93e5-15cc438f72c5.png)
4. If you have the GoG.com release installed on your machine, you should be all set, otherwise copy your `DIABDAT.MPQ` file to the location of the executable (the location from step 2).
2. If you have the GoG.com release installed on your machine, you should be all set, otherwise copy your `DIABDAT.MPQ` file to the location of the executable (the location from step 2).



Expand Down
2 changes: 1 addition & 1 deletion Source/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void LoadCoreArchives()

#if !defined(__ANDROID__) && !defined(__APPLE__)
// Load devilutionx.mpq first to get the font file for error messages
devilutionx_mpq = LoadMPQ(paths, "devilutionx.mpq");
devilutionx_mpq = LoadMPQ(paths, "devilutionx-me.mpq");
#endif
font_mpq = LoadMPQ(paths, "fonts.mpq"); // Extra fonts
}
Expand Down

0 comments on commit 0f8759b

Please sign in to comment.