Skip to content

Commit

Permalink
fixed repacking of textures
Browse files Browse the repository at this point in the history
  • Loading branch information
horkrux committed Jan 7, 2019
1 parent 2faaff6 commit 939ae1f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions S3DatPacker/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ int repack(char* path, char* extract_folder, char* file_name) {

filelist = fopen(file_name, "r");

if (!filelist) printf("Oops\n");

int worked = determine_dat_type(&type, filelist); //lol

if (gather_contents(filelist, extract_folder)) printf("Something went wrong\n");
if (!filelist) {
printf("Couldn't load filelist\n");
}
else {

int worked = determine_dat_type(&type, filelist); //lol

if (gather_contents(filelist, extract_folder)) printf("Something went wrong\n");

fclose(filelist);
fclose(filelist);
}
fclose(test);

return 0;
Expand Down Expand Up @@ -629,13 +631,12 @@ static int write_section_texture(const char* extract_folder, const int object_co
fwrite(&temp_y, 2, 1, test);
fwrite(&offsets_x[i], 1, 1, test);
fwrite(&offsets_y[i], 1, 1, test);

if (ftell(test) % 2 == 0) {
/*if (ftell(test) % 2 == 0) {
fwrite(&padding, 1, 2, test);
}
else {
fwrite(&padding, 1, 1, test);
}
}*/
fwrite(temp_result, temp_result_size, 1, test);
file_pos = ftell(test);

Expand Down

0 comments on commit 939ae1f

Please sign in to comment.