- Fixing DDS reader so it doesn't require the source pitch/linear size field to be divisible by 4

- Fixing DDS writer so it writes a non-zero pitch/linearsize field (a few DDS readers in the wild require this field to be set)
- Fixing example2.cpp and example3.cpp so they write non-zero pitch/linearsize fields.
- Misc merges from the ddsexport branch
- Adding -usesourceformat command line option, useful when reprocessing a lot of existing DDS files.
This commit is contained in:
richgel99@gmail.com
2012-04-16 00:58:38 +00:00
parent d96d9807b1
commit 45901c935c
9 changed files with 179 additions and 16 deletions
+9 -5
View File
@@ -295,6 +295,9 @@ namespace crnlib
static pixel_format choose_pixel_format(convert_params& params, const crn_comp_params &comp_params, const dds_texture& src_tex, texture_type tex_type)
{
if (params.m_use_source_format)
return src_tex.get_format();
const bool is_normal_map = (tex_type == cTextureTypeNormalMap);
if (params.m_dst_file_type == texture_file_types::cFormatCRN)
@@ -409,11 +412,12 @@ namespace crnlib
m_pInput_texture->get_num_levels(),
pixel_format_helpers::get_pixel_format_string(m_pInput_texture->get_format()));
console::debug(L" texture_type: %s", get_texture_type_desc(m_texture_type));
console::debug(L" dst_filename: %s", m_dst_filename.get_ptr());
console::debug(L"dst_file_type: %s", texture_file_types::get_extension(m_dst_file_type));
console::debug(L" dst_format: %s", pixel_format_helpers::get_pixel_format_string(m_dst_format));
console::debug(L" quick: %u", m_quick);
console::debug(L" texture_type: %s", get_texture_type_desc(m_texture_type));
console::debug(L" dst_filename: %s", m_dst_filename.get_ptr());
console::debug(L" dst_file_type: %s", texture_file_types::get_extension(m_dst_file_type));
console::debug(L" dst_format: %s", pixel_format_helpers::get_pixel_format_string(m_dst_format));
console::debug(L" quick: %u", m_quick);
console::debug(L" use_source_format: %u", m_use_source_format);
}
static bool write_compressed_texture(