From 1e33823b12c455aefe31e3395134faa8dd3cc569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Tue, 6 Feb 2018 06:10:40 +0100 Subject: [PATCH] ABI: Restore InputOptions::setTextureLayout(TextureType, int, int, int) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although adding a method argument with default argument keeps API compatibility, it changes the function type. Use function overloading instead and implement the old one as a wrapper to the extended one, supplying the default argument. Fixes part of https://github.com/castano/nvidia-texture-tools/issues/259 Signed-off-by: Stefan BrĂ¼ns --- src/nvtt/InputOptions.cpp | 9 ++++++++- src/nvtt/nvtt.h | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nvtt/InputOptions.cpp b/src/nvtt/InputOptions.cpp index 8179799..ba3934e 100644 --- a/src/nvtt/InputOptions.cpp +++ b/src/nvtt/InputOptions.cpp @@ -124,7 +124,14 @@ void InputOptions::reset() // Setup the input image. -void InputOptions::setTextureLayout(TextureType type, int width, int height, int depth /*= 1*/, int arraySize /*= 1*/) +// Overload for ABI compatibility +void InputOptions::setTextureLayout(TextureType type, int width, int height, int depth /*= 1*/) +{ + setTextureLayout(type, width, height, depth, 1); +} + +// Setup the input image. +void InputOptions::setTextureLayout(TextureType type, int width, int height, int depth, int arraySize) { // Validate arguments. nvCheck(width >= 0); diff --git a/src/nvtt/nvtt.h b/src/nvtt/nvtt.h index d86a503..6a5a8a3 100644 --- a/src/nvtt/nvtt.h +++ b/src/nvtt/nvtt.h @@ -290,7 +290,9 @@ namespace nvtt NVTT_API void reset(); // Setup input layout. - NVTT_API void setTextureLayout(TextureType type, int w, int h, int d = 1, int arraySize = 1); + // Overload for ABI compatibility + NVTT_API void setTextureLayout(TextureType type, int w, int h, int d = 1 /*, arraysize = 1 */); + NVTT_API void setTextureLayout(TextureType type, int w, int h, int d, int arraySize); NVTT_API void resetTextureLayout(); // Set mipmap data. Copies the data.