mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
error-check parameters to setup_texture()
This commit is contained in:
parent
c57cd2fa14
commit
eccc5cfdf9
@ -3761,7 +3761,19 @@ void Texture::
|
||||
do_setup_texture(Texture::TextureType texture_type, int x_size, int y_size,
|
||||
int z_size, Texture::ComponentType component_type,
|
||||
Texture::Format format) {
|
||||
if (texture_type == TT_cube_map) {
|
||||
switch (texture_type) {
|
||||
case TT_1d_texture:
|
||||
nassertv(y_size == 1 && z_size == 1);
|
||||
break;
|
||||
|
||||
case TT_2d_texture:
|
||||
nassertv(z_size == 1);
|
||||
break;
|
||||
|
||||
case TT_3d_texture:
|
||||
break;
|
||||
|
||||
case TT_cube_map:
|
||||
// Cube maps must always consist of six square images.
|
||||
nassertv(x_size == y_size && z_size == 6);
|
||||
|
||||
@ -3771,7 +3783,9 @@ do_setup_texture(Texture::TextureType texture_type, int x_size, int y_size,
|
||||
_wrap_u = WM_clamp;
|
||||
_wrap_v = WM_clamp;
|
||||
_wrap_w = WM_clamp;
|
||||
break;
|
||||
}
|
||||
|
||||
if (texture_type != TT_2d_texture) {
|
||||
do_clear_simple_ram_image();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user