Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rerelease airbut1.wav f_modified #825

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Conversation

namtsui
Copy link
Contributor

@namtsui namtsui commented Sep 17, 2023

fix checksum and set lastid.

With the previous changes in #790 f_modified still reported airbut1.wav. I had two mistakes. I used the checksum of the original airbut1.wav instead of the rerelease. I also did not set lastid.

This time I was able to actually test and f_modified passes on dm2 and e1m2.

fix checksum and set lastid
@namtsui
Copy link
Contributor Author

namtsui commented Sep 17, 2023

$ sha1_quake original/sound/buttons/airbut1.wav
original/sound/buttons/airbut1.wav: {0x47d5141e, 0xc925e8eb, 0x26e5583c, 0xc8dfd021, 0x226792ef}

$ sha1_quake remastered/sound/buttons/airbut1.wav
remastered/sound/buttons/airbut1.wav: {0x81911593, 0x3e85656b, 0x7a9475d0, 0x87de29a0, 0x157d3ef9}

#!/bin/sh
# ezquake fmod.c stores SHA1 checksums in little-endian
#
# usage:
# $ for f in *.wav; do sha1_quake $f; done 
# armor1.wav: {0x44488db0, 0xef0b0a1d, 0x3acda8b4, 0x3d87b467, 0xe4dd4fcc}

little_endian() {
        echo $1 | sed 's/\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/'
}

HASH=$(sha1 $1 | awk '{ print $4 }')
NUM1=$(echo $HASH | sed 's/\(........\).*/\1/')
NUM2=$(echo $HASH | sed 's/........\(........\).*/\1/')
NUM3=$(echo $HASH | sed 's/................\(........\).*/\1/')
NUM4=$(echo $HASH | sed 's/........................\(........\).*/\1/')
NUM5=$(echo $HASH | sed 's/................................\(........\).*/\1/')
NUM1=$(little_endian $NUM1)
NUM2=$(little_endian $NUM2)
NUM3=$(little_endian $NUM3)
NUM4=$(little_endian $NUM4)
NUM5=$(little_endian $NUM5)
echo "$1: {0x$NUM1, 0x$NUM2, 0x$NUM3, 0x$NUM4, 0x$NUM5}"

@tcsabina tcsabina merged commit 1f633df into QW-Group:master Sep 18, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants