|
|
@ -46,6 +46,10 @@ bool process_textures(const world_t* world, std::vector<ps1bsp_texture_t>& outTe |
|
|
// Shrink the larger textures, but keep smaller ones at their original size
|
|
|
// Shrink the larger textures, but keep smaller ones at their original size
|
|
|
int ps1mip = miptex->width > 64 || miptex->height > 64 ? 1 : 0; |
|
|
int ps1mip = miptex->width > 64 || miptex->height > 64 ? 1 : 0; |
|
|
|
|
|
|
|
|
|
|
|
// Make an exception for the difficulty selection teleporters
|
|
|
|
|
|
if (!strncmp(miptex->name, "skill", 5) || !strcmp(miptex->name, "quake")) |
|
|
|
|
|
ps1mip = 0; |
|
|
|
|
|
|
|
|
if (strcmp(miptex->name, "clip") && strcmp(miptex->name, "trigger")) |
|
|
if (strcmp(miptex->name, "clip") && strcmp(miptex->name, "trigger")) |
|
|
rectangles.emplace_back(rectpack2D::rect_xywh(0, 0, miptex->width >> ps1mip, miptex->height >> ps1mip)); |
|
|
rectangles.emplace_back(rectpack2D::rect_xywh(0, 0, miptex->width >> ps1mip, miptex->height >> ps1mip)); |
|
|
else |
|
|
else |
|
|
@ -62,7 +66,7 @@ bool process_textures(const world_t* world, std::vector<ps1bsp_texture_t>& outTe |
|
|
report_unsuccessful, |
|
|
report_unsuccessful, |
|
|
rectpack2D::flipping_option::DISABLED |
|
|
rectpack2D::flipping_option::DISABLED |
|
|
) |
|
|
) |
|
|
); |
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
printf("%d textures. Packed texture atlas size: %d x %d\n", world->mipheader.numtex, result_size.w, result_size.h); |
|
|
printf("%d textures. Packed texture atlas size: %d x %d\n", world->mipheader.numtex, result_size.w, result_size.h); |
|
|
unsigned char* atlas = (unsigned char*)malloc(result_size.w * result_size.h * sizeof(unsigned char)); |
|
|
unsigned char* atlas = (unsigned char*)malloc(result_size.w * result_size.h * sizeof(unsigned char)); |
|
|
|