mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 13:47:04 -04:00
* Updated libpng and zlib
* Added SPR# parsing to the iff library * iff2html now displays BMP_/FBMP, PALT, and SPR# chunks
This commit is contained in:
parent
78f1ca1d6f
commit
1f7061d98a
10 changed files with 219 additions and 41 deletions
|
@ -16,17 +16,58 @@
|
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("Usage: hitld [-f] [-hsm infile.hsm] [-hot infile.hot]\n"
|
||||
" outfile.hit INFILES\n"
|
||||
"Link object files produced by hitasm into a HIT binary, and\n"
|
||||
"relink the game's HSM and HOT files.\n"
|
||||
"Use -f to force overwriting without confirmation.\n"
|
||||
"\n"
|
||||
"Report bugs to <X-Fi6@phppoll.org>.\n"
|
||||
"hitutils is maintained by the Niotso project.\n"
|
||||
"Home page: <http://www.niotso.org/>\n");
|
||||
int main(int argc, char *argv[]){
|
||||
unsigned objectcount;
|
||||
int arg;
|
||||
|
||||
/****
|
||||
** Parameter extraction
|
||||
*/
|
||||
|
||||
if(argc < 3 || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")){
|
||||
printf("Usage: hitld [-f] [-hsm infile.hsm] [-hot infile.hot]\n"
|
||||
" outfile.hit INFILES\n"
|
||||
"Link object files produced by hitasm into a HIT binary, and\n"
|
||||
"relink the game's HSM and HOT files.\n"
|
||||
"Use -f to force overwriting without confirmation.\n"
|
||||
"\n"
|
||||
"Report bugs to <X-Fi6@phppoll.org>.\n"
|
||||
"hitutils is maintained by the Niotso project.\n"
|
||||
"Home page: <http://www.niotso.org/>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char * hitfile;
|
||||
char * hsmfile = NULL, * hotfile = NULL;
|
||||
bool force = false;
|
||||
|
||||
for(arg=1; arg<argc-2; arg++){
|
||||
if(!strcmp(argv[arg], "-f")) force = true;
|
||||
else if(arg<argc-3 && !strcmp(argv[arg], "-hsm")) hsmfile = argv[++arg];
|
||||
else if(arg<argc-3 && !strcmp(argv[arg], "-hot")) hotfile = argv[++arg];
|
||||
else break;
|
||||
}
|
||||
|
||||
hitfile = argv[arg++];
|
||||
objectcount = argc-arg; //Guaranteed to be >=1
|
||||
|
||||
for(int i=0, length = strlen(hitfile); i<2; i++){
|
||||
char *& string = (i==0) ? hsmfile : hotfile;
|
||||
if(!string){
|
||||
string = (char*) malloc(length+1);
|
||||
strcpy(string, hitfile);
|
||||
for(int j=1; j<=3 && j<=length; j++){
|
||||
const char * ext = "hsmhot";
|
||||
string[length-j] = ext[3*i + 3-j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Force: %s\nHSM file: %s\nHOT file: %s\nHIT file: %s\nObject count: %u",
|
||||
force ? "yes" : "no", hsmfile, hotfile, hitfile, objectcount);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue