mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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,
|
do_setup_texture(Texture::TextureType texture_type, int x_size, int y_size,
|
||||||
int z_size, Texture::ComponentType component_type,
|
int z_size, Texture::ComponentType component_type,
|
||||||
Texture::Format format) {
|
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.
|
// Cube maps must always consist of six square images.
|
||||||
nassertv(x_size == y_size && z_size == 6);
|
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_u = WM_clamp;
|
||||||
_wrap_v = WM_clamp;
|
_wrap_v = WM_clamp;
|
||||||
_wrap_w = WM_clamp;
|
_wrap_w = WM_clamp;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_type != TT_2d_texture) {
|
if (texture_type != TT_2d_texture) {
|
||||||
do_clear_simple_ram_image();
|
do_clear_simple_ram_image();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user