minor adjustments

This commit is contained in:
David Rose 2005-09-15 22:09:15 +00:00
parent 632bc8adef
commit b9f5dfd75d
2 changed files with 36 additions and 35 deletions

View File

@ -73,7 +73,7 @@ Texture(const string &name) :
////////////////////////////////////////////////////////////////////
// Function: Texture::Destructor
// Access: Published
// Access: Published, Virtual
// Description:
////////////////////////////////////////////////////////////////////
Texture::
@ -1271,6 +1271,36 @@ string_filter_type(const string &string) {
}
}
////////////////////////////////////////////////////////////////////
// Function: Texture::up_to_power_2
// Access: Protected, Static
// Description: Returns the smallest power of 2 greater than or equal
// to value.
////////////////////////////////////////////////////////////////////
int Texture::
up_to_power_2(int value) {
int x = 1;
while (x < value) {
x = (x << 1);
}
return x;
}
////////////////////////////////////////////////////////////////////
// Function: Texture::down_to_power_2
// Access: Protected, Static
// Description: Returns the largest power of 2 less than or equal
// to value.
////////////////////////////////////////////////////////////////////
int Texture::
down_to_power_2(int value) {
int x = 1;
while ((x << 1) <= value) {
x = (x << 1);
}
return x;
}
////////////////////////////////////////////////////////////////////
// Function: Texture::clear_prepared
// Access: Private
@ -1293,36 +1323,6 @@ clear_prepared(PreparedGraphicsObjects *prepared_objects) {
}
}
////////////////////////////////////////////////////////////////////
// Function: Texture::up_to_power_2
// Access: Private, Static
// Description: Returns the smallest power of 2 greater than or equal
// to value.
////////////////////////////////////////////////////////////////////
int Texture::
up_to_power_2(int value) {
int x = 1;
while (x < value) {
x = (x << 1);
}
return x;
}
////////////////////////////////////////////////////////////////////
// Function: Texture::down_to_power_2
// Access: Private, Static
// Description: Returns the largest power of 2 less than or equal
// to value.
////////////////////////////////////////////////////////////////////
int Texture::
down_to_power_2(int value) {
int x = 1;
while ((x << 1) <= value) {
x = (x << 1);
}
return x;
}
////////////////////////////////////////////////////////////////////
// Function: Texture::consider_rescale
// Access: Private

View File

@ -133,7 +133,7 @@ PUBLISHED:
PUBLISHED:
Texture(const string &name = string());
~Texture();
virtual ~Texture();
void setup_texture(TextureType texture_type,
int x_size, int y_size, int z_size,
@ -266,11 +266,12 @@ public:
static WrapMode string_wrap_mode(const string &string);
static FilterType string_filter_type(const string &string);
private:
void clear_prepared(PreparedGraphicsObjects *prepared_objects);
protected:
static int up_to_power_2(int value);
static int down_to_power_2(int value);
private:
void clear_prepared(PreparedGraphicsObjects *prepared_objects);
void consider_rescale(PNMImage &pnmimage);
void consider_downgrade(PNMImage &pnmimage, int num_channels);