Compare commits

..

3 Commits

3 changed files with 23 additions and 27 deletions

View File

@@ -77,14 +77,6 @@ jobs:
- name: Build
run: cargo build --release
- name: Assemble Archive
run: |
mkdir /tmp/example/
cp ./target/release/pacman /tmp/example/
chmod a+x /tmp/example/pacman
mkdir /tmp/example/assets
cp ./assets/TerminalVector.ttf ./assets/fruit.png /tmp/example/assets
- name: Install Cargo Binstall
uses: cargo-bins/cargo-binstall@main
@@ -98,7 +90,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
path: /tmp/example/
path: ./target/release/pacman
retention-days: 7
if-no-files-found: error
@@ -128,13 +120,6 @@ jobs:
- name: Build
run: cargo build --release
- name: Assemble Archive
run: |
mkdir /tmp/example/
cp ./target/release/pacman /tmp/example/
mkdir /tmp/example/assets
cp ./assets/TerminalVector.ttf ./assets/fruit.png /tmp/example/assets
- name: Install Cargo Binstall
uses: cargo-bins/cargo-binstall@main
@@ -148,7 +133,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
path: /tmp/example/
path: ./target/release/pacman
retention-days: 7
if-no-files-found: error
@@ -183,14 +168,6 @@ jobs:
- name: Build
run: cargo build --release
- name: Prepare Archive
run: |
New-Item -Type Directory ./release/
Move-Item -Path ./target/release/pacman.exe -Destination ./release/
Move-Item -Path ./SDL2.dll, ./SDL2_image.dll, ./SDL2_ttf.dll, ./SDL2_mixer.dll, ./SDL2_gfx.dll -Destination ./release/
New-Item -Type Directory ./release/assets/
Move-Item -Path ./assets/TerminalVector.ttf, ./assets/fruit.png -Destination ./release/assets/
- name: Install Cargo Binstall
uses: cargo-bins/cargo-binstall@main
@@ -204,6 +181,6 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
path: ./release/
path: ./target/release/pacman.exe
retention-days: 7
if-no-files-found: error

View File

@@ -35,7 +35,7 @@ default-features = false
features = ["ttf","image","gfx","mixer","static-link","use-vcpkg"]
[package.metadata.vcpkg]
dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
dependencies = ["sdl2", "sdl2-image", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
git = "https://github.com/microsoft/vcpkg"
rev = "2024.05.24" # release 2024.05.24 # to check for a new one, check https://github.com/microsoft/vcpkg/releases

View File

@@ -31,6 +31,25 @@ pub enum Asset {
// Add more as needed
}
impl Asset {
pub fn path(&self) -> &str {
use Asset::*;
match self {
Wav1 => "wav/1.ogg",
Wav2 => "wav/2.ogg",
Wav3 => "wav/3.ogg",
Wav4 => "wav/4.ogg",
Pacman => "32/pacman.png",
Pellet => "24/pellet.png",
Energizer => "24/energizer.png",
Map => "map.png",
FontKonami => "font/konami.ttf",
GhostBody => "32/ghost_body.png",
GhostEyes => "32/ghost_eyes.png",
}
}
}
#[cfg(not(target_os = "emscripten"))]
mod imp {
use super::*;