display: fix ABI compat with GraphicsStateGuardian flash texture

This commit is contained in:
rdb 2019-10-06 11:54:31 +02:00
parent ec6638314c
commit 1eeea718c5
2 changed files with 15 additions and 11 deletions

View File

@ -461,7 +461,6 @@ traverse_prepared_textures(GraphicsStateGuardian::TextureCallback *func,
} }
} }
#ifndef NDEBUG
/** /**
* Sets the "flash texture". This is a debug feature; when enabled, the * 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 * 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:: void GraphicsStateGuardian::
set_flash_texture(Texture *tex) { set_flash_texture(Texture *tex) {
_flash_texture = tex;
}
#endif // NDEBUG
#ifndef NDEBUG #ifndef NDEBUG
_flash_texture = tex;
#endif
}
/** /**
* Resets the "flash texture", so that no textures will flash. See * Resets the "flash texture", so that no textures will flash. See
* set_flash_texture(). * set_flash_texture().
*/ */
void GraphicsStateGuardian:: void GraphicsStateGuardian::
clear_flash_texture() { clear_flash_texture() {
_flash_texture = nullptr;
}
#endif // NDEBUG
#ifndef NDEBUG #ifndef NDEBUG
_flash_texture = nullptr;
#endif
}
/** /**
* Returns the current "flash texture", if any, or NULL if none. See * Returns the current "flash texture", if any, or NULL if none. See
* set_flash_texture(). * set_flash_texture().
*/ */
Texture *GraphicsStateGuardian:: Texture *GraphicsStateGuardian::
get_flash_texture() const { get_flash_texture() const {
#ifndef NDEBUG
return _flash_texture; return _flash_texture;
#else
return nullptr;
#endif
} }
#endif // NDEBUG
/** /**
* Sets the SceneSetup object that indicates the initial camera position, etc. * Sets the SceneSetup object that indicates the initial camera position, etc.

View File

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