@ -94,6 +94,14 @@ bool process_textures(const world_t* world, std::vector<ps1bsp_texture_t>& outTe
if ( ! strncmp ( miptex - > name , " skill " , 5 ) ) // || !strcmp(miptex->name, "quake"))
ps1mip = 0 ;
// Ensure we don't include any textures that are larger than the PS1 can address
// Texture pages are 64 pixels wide, effectively 128 texels in 8-bit mode, and with U offset added no U value may exceed 255
// We could solve this more elegantly by page-aligning larger textures, but I'm not sure if that's actually necessary
while ( ( miptex - > width > > ps1mip ) > 128 | | ( miptex - > height > > ps1mip ) > 256 )
ps1mip + + ;
// TODO: make an exception for the QUAKE sign that's displayed on the start map. It needs to be bold and detailed, but it's too wide for the PS1 to address at full resolution, so it'll need to be broken up.
if ( strcmp ( miptex - > name , " clip " ) & & strcmp ( miptex - > name , " trigger " ) )
rectangles . emplace_back ( rectpack2D : : rect_xywh ( 0 , 0 , miptex - > width > > ps1mip , miptex - > height > > ps1mip ) ) ;
else