Преглед на файлове

display: fix ABI compat with GraphicsStateGuardian flash texture

rdb преди 6 години
родител
ревизия
1eeea718c5
променени са 2 файла, в които са добавени 11 реда и са изтрити 7 реда
  1. 8 6
      panda/src/display/graphicsStateGuardian.cxx
  2. 3 1
      panda/src/display/graphicsStateGuardian.h

+ 8 - 6
panda/src/display/graphicsStateGuardian.cxx

@@ -461,7 +461,6 @@ traverse_prepared_textures(GraphicsStateGuardian::TextureCallback *func,
   }
 }
 
-#ifndef NDEBUG
 /**
  * Sets the "flash texture".  This is a debug feature; when enabled, the
  * specified texture will begin flashing in the scene, helping you to find it
@@ -481,31 +480,34 @@ traverse_prepared_textures(GraphicsStateGuardian::TextureCallback *func,
  */
 void GraphicsStateGuardian::
 set_flash_texture(Texture *tex) {
+#ifndef NDEBUG
   _flash_texture = tex;
+#endif
 }
-#endif  // NDEBUG
 
-#ifndef NDEBUG
 /**
  * Resets the "flash texture", so that no textures will flash.  See
  * set_flash_texture().
  */
 void GraphicsStateGuardian::
 clear_flash_texture() {
+#ifndef NDEBUG
   _flash_texture = nullptr;
+#endif
 }
-#endif  // NDEBUG
 
-#ifndef NDEBUG
 /**
  * Returns the current "flash texture", if any, or NULL if none.  See
  * set_flash_texture().
  */
 Texture *GraphicsStateGuardian::
 get_flash_texture() const {
+#ifndef NDEBUG
   return _flash_texture;
+#else
+  return nullptr;
+#endif
 }
-#endif  // NDEBUG
 
 /**
  * Sets the SceneSetup object that indicates the initial camera position, etc.

+ 3 - 1
panda/src/display/graphicsStateGuardian.h

@@ -259,7 +259,7 @@ PUBLISHED:
   typedef bool TextureCallback(TextureContext *tc, void *callback_arg);
   void traverse_prepared_textures(TextureCallback *func, void *callback_arg);
 
-#ifndef NDEBUG
+#if !defined(NDEBUG) || !defined(CPPPARSER)
   void set_flash_texture(Texture *tex);
   void clear_flash_texture();
   Texture *get_flash_texture() const;
@@ -651,6 +651,8 @@ protected:
 
 #ifndef NDEBUG
   PT(Texture) _flash_texture;
+#else
+  PT(Texture) _flash_texture_unused;
 #endif
 
 public: