Fix recently introduced compilation error in wxUSE_PALETTE==0 build.
Add missing "#if wxUSE_PALETTE" tests. Closes #16083. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -271,7 +271,9 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxScopedPtr<wxPalette> palette; // entries for quantized images
|
||||
#endif // wxUSE_PALETTE
|
||||
wxScopedArray<wxUint8> rgbquad; // for the RGBQUAD bytes for the colormap
|
||||
wxScopedPtr<wxImage> q_image; // destination for quantized image
|
||||
|
||||
@@ -287,10 +289,15 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
||||
// I get a delete error using Quantize when desired colors > 236
|
||||
int quantize = ((palette_size > 236) ? 236 : palette_size);
|
||||
// fill the destination too, it gives much nicer 4bpp images
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette* paletteTmp;
|
||||
wxQuantize::Quantize( *image, *q_image, &paletteTmp, quantize, 0,
|
||||
wxQUANTIZE_FILL_DESTINATION_IMAGE );
|
||||
palette.reset(paletteTmp);
|
||||
#else // !wxUSE_PALETTE
|
||||
wxQuantize::Quantize( *image, *q_image, NULL, quantize, 0,
|
||||
wxQUANTIZE_FILL_DESTINATION_IMAGE );
|
||||
#endif // wxUSE_PALETTE/!wxUSE_PALETTE
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user