|
@@ -73,7 +73,7 @@ Texture(const string &name) :
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: Texture::Destructor
|
|
// Function: Texture::Destructor
|
|
|
-// Access: Published
|
|
|
|
|
|
|
+// Access: Published, Virtual
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
Texture::
|
|
Texture::
|
|
@@ -1271,31 +1271,9 @@ string_filter_type(const string &string) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-// Function: Texture::clear_prepared
|
|
|
|
|
-// Access: Private
|
|
|
|
|
-// Description: Removes the indicated PreparedGraphicsObjects table
|
|
|
|
|
-// from the Texture's table, without actually releasing
|
|
|
|
|
-// the texture. This is intended to be called only from
|
|
|
|
|
-// PreparedGraphicsObjects::release_texture(); it should
|
|
|
|
|
-// never be called by user code.
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-void Texture::
|
|
|
|
|
-clear_prepared(PreparedGraphicsObjects *prepared_objects) {
|
|
|
|
|
- Contexts::iterator ci;
|
|
|
|
|
- ci = _contexts.find(prepared_objects);
|
|
|
|
|
- if (ci != _contexts.end()) {
|
|
|
|
|
- _contexts.erase(ci);
|
|
|
|
|
- } else {
|
|
|
|
|
- // If this assertion fails, clear_prepared() was given a
|
|
|
|
|
- // prepared_objects which the texture didn't know about.
|
|
|
|
|
- nassertv(false);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: Texture::up_to_power_2
|
|
// Function: Texture::up_to_power_2
|
|
|
-// Access: Private, Static
|
|
|
|
|
|
|
+// Access: Protected, Static
|
|
|
// Description: Returns the smallest power of 2 greater than or equal
|
|
// Description: Returns the smallest power of 2 greater than or equal
|
|
|
// to value.
|
|
// to value.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -1310,7 +1288,7 @@ up_to_power_2(int value) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: Texture::down_to_power_2
|
|
// Function: Texture::down_to_power_2
|
|
|
-// Access: Private, Static
|
|
|
|
|
|
|
+// Access: Protected, Static
|
|
|
// Description: Returns the largest power of 2 less than or equal
|
|
// Description: Returns the largest power of 2 less than or equal
|
|
|
// to value.
|
|
// to value.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -1323,6 +1301,28 @@ down_to_power_2(int value) {
|
|
|
return x;
|
|
return x;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: Texture::clear_prepared
|
|
|
|
|
+// Access: Private
|
|
|
|
|
+// Description: Removes the indicated PreparedGraphicsObjects table
|
|
|
|
|
+// from the Texture's table, without actually releasing
|
|
|
|
|
+// the texture. This is intended to be called only from
|
|
|
|
|
+// PreparedGraphicsObjects::release_texture(); it should
|
|
|
|
|
+// never be called by user code.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void Texture::
|
|
|
|
|
+clear_prepared(PreparedGraphicsObjects *prepared_objects) {
|
|
|
|
|
+ Contexts::iterator ci;
|
|
|
|
|
+ ci = _contexts.find(prepared_objects);
|
|
|
|
|
+ if (ci != _contexts.end()) {
|
|
|
|
|
+ _contexts.erase(ci);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // If this assertion fails, clear_prepared() was given a
|
|
|
|
|
+ // prepared_objects which the texture didn't know about.
|
|
|
|
|
+ nassertv(false);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: Texture::consider_rescale
|
|
// Function: Texture::consider_rescale
|
|
|
// Access: Private
|
|
// Access: Private
|