Pack repeatable textures first, followed by other textures in the remaining space. This is actually producing more efficient textures atlases. The hell.
constautomax_bin=rectpack2D::rect_wh(1024,256);// 8-bit textures take up half the horizontal space so this is 512x256 in practice, or a quarter of the PS1's VRAM allocation.
automax_bin=rectpack2D::rect_wh(1024,256);// 8-bit textures take up half the horizontal space so this is 512x256 in practice, or a quarter of the PS1's VRAM allocation.
printf("Finding best texture packing...\n");
printf("Finding best texture packing...\n");
std::map<int,miptex_t*>textures;
std::vector<rect_type>rectangles;
std::map<int,miptex_t*>textures,repeatables;
// Try some texture packing and see if we fit inside the PS1's VRAM
// Try some texture packing and see if we fit inside the PS1's VRAM
tex.ps1tex.twin=getTexWindow(tex.uoffs,tex.voffs,tex.w,tex.h);// TODO: figure out the right offsets that are multiples of w and h
tex.ps1tex.twin=getTexWindow(tex.uoffs,tex.voffs,tex.w,tex.h);// TODO: figure out the right offsets that are multiples of w and h; NOTE: if uoffs has to >> 1, then w probably has to as well