mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
better asserts
This commit is contained in:
parent
064955a02b
commit
53fee65d08
@ -192,6 +192,7 @@ is_valid() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void PNMImage::
|
||||
set_num_channels(int num_channels) {
|
||||
nassertv(num_channels >= 1 && num_channels <= 4);
|
||||
set_color_type((ColorType)num_channels);
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ void PNMImage::
|
||||
clear(int x_size, int y_size, int num_channels,
|
||||
xelval maxval, PNMFileType *type) {
|
||||
clear();
|
||||
nassertv(num_channels >= 1 && num_channels <= 4);
|
||||
|
||||
_x_size = x_size;
|
||||
_y_size = y_size;
|
||||
@ -273,6 +274,7 @@ write(PNMWriter *writer) const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PNMImage::
|
||||
set_color_type(PNMImage::ColorType color_type) {
|
||||
nassertv((int)color_type >= 1 && (int)color_type <= 4);
|
||||
if (color_type == get_color_type()) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user