mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-12 20:12:21 -06:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93ba470ce9 | |||
| 129aed0ffb | |||
| e062ada301 |
@@ -1,8 +1,9 @@
|
|||||||
[target.wasm32-unknown-emscripten]
|
[target.wasm32-unknown-emscripten]
|
||||||
|
# TODO: Document what the fuck this is.
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-O", "-C", "link-args=-O2 --profiling",
|
"-O", "-C", "link-args=-O2 --profiling",
|
||||||
#"-C", "link-args=-O3 --closure 1",
|
#"-C", "link-args=-O3 --closure 1",
|
||||||
"-C", "link-args=-sASYNCIFY -sALLOW_MEMORY_GROWTH=1",
|
"-C", "link-args=-sASYNCIFY -sALLOW_MEMORY_GROWTH=1",
|
||||||
"-C", "link-args=-sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS=['png']",
|
"-C", "link-args=-sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sSDL_EMSCRIPTEN_KEYBOARD_ELEMENT -sSDL2_IMAGE_FORMATS=['png']",
|
||||||
"-C", "link-args=--preload-file assets/ -lidbfs.js",
|
"-C", "link-args=--preload-file assets/ -lidbfs.js",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
& cargo build --target=wasm32-unknown-emscripten --release
|
|
||||||
|
|
||||||
mkdir -p dist -Force
|
|
||||||
|
|
||||||
cp ./target/wasm32-unknown-emscripten/release/Pac_Man.wasm ./dist
|
|
||||||
cp ./target/wasm32-unknown-emscripten/release/Pac-Man.js ./dist
|
|
||||||
cp index.html dist
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eux
|
set -eu
|
||||||
|
|
||||||
echo "Building WASM with Emscripten"
|
echo "Building WASM with Emscripten"
|
||||||
cargo build --target=wasm32-unknown-emscripten --release
|
cargo build --target=wasm32-unknown-emscripten --release
|
||||||
|
|||||||
28
scripts/build-windows.sh
Executable file
28
scripts/build-windows.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
SDL_VERSION="2.28.3"
|
||||||
|
SDL_IMAGE_VERSION="2.6.3"
|
||||||
|
SDL_MIXER_VERSION="2.6.3"
|
||||||
|
SDL_TTF_VERSION="2.20.2"
|
||||||
|
|
||||||
|
SDL="https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/SDL2-devel-${SDL_VERSION}-mingw.tar.gz"
|
||||||
|
SLD_IMAGE="https://github.com/libsdl-org/SDL_image/releases/download/release-${SDL_IMAGE_VERSION}/SDL2_image-devel-${SDL_IMAGE_VERSION}-mingw.tar.gz"
|
||||||
|
SDL_MIXER="https://github.com/libsdl-org/SDL_mixer/releases/download/release-${SDL_MIXER_VERSION}/SDL2_mixer-devel-${SDL_MIXER_VERSION}-mingw.tar.gz"
|
||||||
|
SDL_TTF="https://github.com/libsdl-org/SDL_ttf/releases/download/release-${SDL_TTF_VERSION}/SDL_ttf-devel-${SDL_TTF_VERSION}-mingw.tar.gz"
|
||||||
|
|
||||||
|
# Verify that toolchain is installed
|
||||||
|
|
||||||
|
|
||||||
|
# EXTRACT_DIR="~/.rustup/"
|
||||||
|
EXTRACT_DIR="~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/"
|
||||||
|
# if [ ! -d "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/" ]; then
|
||||||
|
# ls $EXTRACT_DIR
|
||||||
|
# echo "Toolchain not installed. Run rustup target add x86_64-pc-windows-gnu. This may not work on environments besides Linux GNU."
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
echo "Downloading..."
|
||||||
|
curl -L -o ./sdl2.tar.gz $SDL
|
||||||
|
curl -L -o ./sdl2_image.tar.gz $SLD_IMAGE
|
||||||
|
echo "Done."
|
||||||
@@ -92,6 +92,7 @@ impl<'a> AnimatedTexture<'a> {
|
|||||||
direction: Direction,
|
direction: Direction,
|
||||||
frame: u32,
|
frame: u32,
|
||||||
) {
|
) {
|
||||||
|
// TODO: If the frame we're targeting is in the opposite direction (due to self.reverse), we should pre-emptively reverse.
|
||||||
let current = self.current_frame();
|
let current = self.current_frame();
|
||||||
self.render_static(canvas, position, direction, Some(current));
|
self.render_static(canvas, position, direction, Some(current));
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use sdl2::keyboard::Keycode;
|
|||||||
use sdl2::render::{Texture, TextureCreator};
|
use sdl2::render::{Texture, TextureCreator};
|
||||||
use sdl2::video::WindowContext;
|
use sdl2::video::WindowContext;
|
||||||
use sdl2::{pixels::Color, render::Canvas, video::Window};
|
use sdl2::{pixels::Color, render::Canvas, video::Window};
|
||||||
use tracing::event;
|
|
||||||
|
|
||||||
use crate::constants::{MapTile, BOARD_HEIGHT, BOARD_WIDTH, RAW_BOARD};
|
use crate::constants::{MapTile, BOARD_HEIGHT, BOARD_WIDTH, RAW_BOARD};
|
||||||
use crate::direction::Direction;
|
use crate::direction::Direction;
|
||||||
|
|||||||
Reference in New Issue
Block a user