diff --git a/language.version b/language.version index c1b875702..d7da57c44 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r392 \cu(Wed 31 Aug 10:58:25 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r392 \cu(2022-08-31 10:58:25)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r393 \cu(Wed 31 Aug 11:43:51 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r393 \cu(2022-08-31 11:43:51)\c-"; diff --git a/tools/build.sh b/tools/build.sh index fcea83ecc..d3da398aa 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -1,3 +1,2 @@ #!/bin/sh -gcc -std=c11 -march=native -Os -Wall -Wextra -Werror -pedantic -o mkstartup mkstartup.c gcc -std=c11 -march=native -Os -Wall -Wextra -Werror -pedantic -o mklang mklang.c diff --git a/tools/mkstartup.c b/tools/mkstartup.c deleted file mode 100644 index e2a897e11..000000000 --- a/tools/mkstartup.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - mkstartup.c : Makes a Hexen startup screen from provided images. - Requires all the files to be in the same folder it's executed in. - I didn't bother adding any checks so if this thing catches on fire it's - your own damn fault. Add them yourself if you want, this tool was made - for personal use anyway. - - Copyright (c) 2020-2022 Marisa the Magician, UnSX Team - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ -#include -#include - -int main( void ) -{ - // we expect everything to be exported straight from gimp in raw image - // data format, indexed, no alpha, all graphics must share the same - // 16-color palette and have the exact dimensions shown here: - // STARTUP.data : 640x480, I8 (307200 bytes) - // STARTUP.data.pal : 16 colors, RGB8 (48 bytes) - // NOTCH.data : 16x23, I8 (368 bytes) - // NETNOTCH.data : 4x16, I8 (64 bytes) - // the NOTCH and NETNOTCH files are optional and their processing will - // be skipped if not found - uint8_t pal[48] = {0}; - uint8_t startup[4][38400] = {{0}}; - uint8_t notch[184] = {0}; - uint8_t netnotch[32] = {0}; - uint8_t blk[8] = {0}; - FILE *fout = fopen("STARTUP.dat","wb"); - FILE *fin = fopen("STARTUP.data.pal","rb"); - fread(&pal,1,48,fin); - // reduce 8BPC palette to 6BPC - for ( int i=0; i<48; i++ ) - pal[i] = (pal[i]>>2)&0x3f; - fwrite(&pal,1,48,fout); - fclose(fin); - fin = fopen("STARTUP.data","rb"); - // compose 4-bit planar startup image - for ( int i=0; i<38400; i++ ) - { - fread(&blk,1,8,fin); - for ( int j=0; j<8; j++ ) - { - startup[0][i] |= !!(blk[j]&1)<<(7-j); - startup[1][i] |= !!(blk[j]&2)<<(7-j); - startup[2][i] |= !!(blk[j]&4)<<(7-j); - startup[3][i] |= !!(blk[j]&8)<<(7-j); - } - } - fclose(fin); - fwrite(&startup,1,153600,fout); - fclose(fout); - fin = fopen("NOTCH.data","rb"); - if ( !fin ) goto nnotch; - fout = fopen("NOTCH.dat","wb"); - // compose 4-bit linear notch image - for ( int i=0; i<184; i++ ) - { - fread(&blk,1,2,fin); - notch[i] |= (blk[0]<<4)&0xF0; - notch[i] |= blk[1]&0x0F; - } - fclose(fin); - fwrite(¬ch,1,184,fout); - fclose(fout); -nnotch: - fin = fopen("NETNOTCH.data","rb"); - if ( !fin ) return 0; - fout = fopen("NETNOTCH.dat","wb"); - // compose 4-bit linear netnotch image - for ( int i=0; i<32; i++ ) - { - fread(&blk,1,2,fin); - netnotch[i] |= (blk[0]<<4)&0xF0; - netnotch[i] |= blk[1]&0x0F; - } - fclose(fin); - fwrite(&netnotch,1,32,fout); - fclose(fout); - return 0; -}