Remove experimental callback mechanism.
This commit is contained in:
parent
27f84c5caa
commit
77bfabca3b
@ -26,22 +26,6 @@
|
||||
using namespace nvtt;
|
||||
|
||||
|
||||
static void defaultBeginImageCallback(int size, int width, int height, int depth, int face, int miplevel, void * userData) {
|
||||
nvtt::OutputHandler * outputHandler = (nvtt::OutputHandler *)userData;
|
||||
if (outputHandler != NULL) outputHandler->beginImage(size, width, height, depth, face, miplevel);
|
||||
}
|
||||
|
||||
static bool defaultOutputCallback(const void * data, int size, void * userData) {
|
||||
nvtt::OutputHandler * outputHandler = (nvtt::OutputHandler *)userData;
|
||||
if (outputHandler != NULL) return outputHandler->writeData(data, size);
|
||||
}
|
||||
|
||||
static void defaultErrorCallback(Error e, void * userData) {
|
||||
nvtt::ErrorHandler * errorHandler = (nvtt::ErrorHandler *)userData;
|
||||
if (errorHandler != NULL) errorHandler->error(e);
|
||||
}
|
||||
|
||||
|
||||
OutputOptions::OutputOptions() : m(*new OutputOptions::Private())
|
||||
{
|
||||
reset();
|
||||
@ -63,10 +47,6 @@ void OutputOptions::reset()
|
||||
m.outputHandler = NULL;
|
||||
m.errorHandler = NULL;
|
||||
|
||||
m.beginImageCallback = defaultBeginImageCallback;
|
||||
m.outputCallback = defaultOutputCallback;
|
||||
m.errorCallback = defaultErrorCallback;
|
||||
|
||||
m.outputHeader = true;
|
||||
m.container = Container_DDS;
|
||||
}
|
||||
@ -83,7 +63,6 @@ void OutputOptions::setFileName(const char * fileName)
|
||||
{
|
||||
m.outputHandler = oh;
|
||||
}
|
||||
m.outputCallback = defaultOutputCallback;
|
||||
}
|
||||
|
||||
/// Set output handler.
|
||||
@ -95,7 +74,6 @@ void OutputOptions::setOutputHandler(OutputHandler * outputHandler)
|
||||
m.fileName.reset();
|
||||
}
|
||||
m.outputHandler = outputHandler;
|
||||
m.outputCallback = defaultOutputCallback;
|
||||
}
|
||||
|
||||
/// Set error handler.
|
||||
@ -129,15 +107,15 @@ bool OutputOptions::Private::hasValidOutputHandler() const
|
||||
|
||||
void OutputOptions::Private::beginImage(int size, int width, int height, int depth, int face, int miplevel) const
|
||||
{
|
||||
beginImageCallback(size, width, height, depth, face, miplevel, outputHandler);
|
||||
if (outputHandler != NULL) outputHandler->beginImage(size, width, height, depth, face, miplevel);
|
||||
}
|
||||
|
||||
bool OutputOptions::Private::writeData(const void * data, int size) const
|
||||
{
|
||||
return outputCallback(data, size, outputHandler);
|
||||
if (outputHandler != NULL) return outputHandler->writeData(data, size);
|
||||
}
|
||||
|
||||
void OutputOptions::Private::error(Error e) const
|
||||
{
|
||||
errorCallback(e, errorHandler);
|
||||
if (errorHandler != NULL) errorHandler->error(e);
|
||||
}
|
||||
|
@ -64,10 +64,6 @@ namespace nvtt
|
||||
OutputHandler * outputHandler;
|
||||
ErrorHandler * errorHandler;
|
||||
|
||||
BeginImageCallback * beginImageCallback;
|
||||
OutputCallback * outputCallback;
|
||||
ErrorCallback * errorCallback;
|
||||
|
||||
bool outputHeader;
|
||||
Container container;
|
||||
|
||||
|
@ -316,10 +316,6 @@ namespace nvtt
|
||||
virtual void error(Error e) = 0;
|
||||
};
|
||||
|
||||
typedef void (BeginImageCallback)(int size, int width, int height, int depth, int face, int miplevel, void *);
|
||||
typedef bool (OutputCallback)(const void * data, int size, void *);
|
||||
typedef void (ErrorCallback)(Error e, void *);
|
||||
|
||||
/// Container.
|
||||
enum Container
|
||||
{
|
||||
@ -346,10 +342,6 @@ namespace nvtt
|
||||
NVTT_API void setOutputHandler(OutputHandler * outputHandler);
|
||||
NVTT_API void setErrorHandler(ErrorHandler * errorHandler);
|
||||
|
||||
NVTT_API void setBeginImageCallback(BeginImageCallback * beginImageCallback);
|
||||
NVTT_API void setOutputCallback(OutputCallback * outputCallback);
|
||||
NVTT_API void setErrorCallback(ErrorCallback * errorCallback);
|
||||
|
||||
NVTT_API void setOutputHeader(bool outputHeader);
|
||||
NVTT_API void setContainer(Container container);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user