Update LightsDriver_SextetStream.cpp
Changes to SextetStream were necessary, as the define and class name caused name colissions.
This commit is contained in:
@@ -16,21 +16,21 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class Impl
|
class SextetImpl
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::uint8_t lastOutput[FULL_SEXTET_COUNT];
|
std::uint8_t lastOutput[FULL_SEXTET_COUNT];
|
||||||
RageFile * out;
|
RageFile * out;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Impl(RageFile * file) {
|
SextetImpl(RageFile * file) {
|
||||||
out = file;
|
out = file;
|
||||||
|
|
||||||
// Ensure a non-match the first time
|
// Ensure a non-match the first time
|
||||||
lastOutput[0] = 0;
|
lastOutput[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Impl() {
|
virtual ~SextetImpl() {
|
||||||
if(out != nullptr)
|
if(out != nullptr)
|
||||||
{
|
{
|
||||||
out->Flush();
|
out->Flush();
|
||||||
@@ -61,12 +61,8 @@ namespace
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LightsDriver_SextetStream interface
|
// LightsDriver_SextetStream interface
|
||||||
// (Wrapper for Impl)
|
// (Wrapper for SextetImpl)
|
||||||
|
|
||||||
#define IMPL ((Impl*)_impl)
|
|
||||||
|
|
||||||
LightsDriver_SextetStream::LightsDriver_SextetStream()
|
LightsDriver_SextetStream::LightsDriver_SextetStream()
|
||||||
{
|
{
|
||||||
_impl = nullptr;
|
_impl = nullptr;
|
||||||
@@ -74,21 +70,20 @@ LightsDriver_SextetStream::LightsDriver_SextetStream()
|
|||||||
|
|
||||||
LightsDriver_SextetStream::~LightsDriver_SextetStream()
|
LightsDriver_SextetStream::~LightsDriver_SextetStream()
|
||||||
{
|
{
|
||||||
if(IMPL != nullptr)
|
if(static_cast<SextetImpl*>(_impl) != nullptr)
|
||||||
{
|
{
|
||||||
delete IMPL;
|
delete static_cast<SextetImpl*>(_impl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightsDriver_SextetStream::Set(const LightsState *ls)
|
void LightsDriver_SextetStream::Set(const LightsState *ls)
|
||||||
{
|
{
|
||||||
if(IMPL != nullptr)
|
if(static_cast<SextetImpl*>(_impl) != nullptr)
|
||||||
{
|
{
|
||||||
IMPL->Set(ls);
|
static_cast<SextetImpl*>(_impl)->Set(ls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LightsDriver_SextetStreamToFile implementation
|
// LightsDriver_SextetStreamToFile implementation
|
||||||
|
|
||||||
REGISTER_LIGHTS_DRIVER_CLASS(SextetStreamToFile);
|
REGISTER_LIGHTS_DRIVER_CLASS(SextetStreamToFile);
|
||||||
@@ -116,17 +111,17 @@ inline RageFile * openOutputStream(const RString& filename)
|
|||||||
|
|
||||||
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile(RageFile * file)
|
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile(RageFile * file)
|
||||||
{
|
{
|
||||||
_impl = new Impl(file);
|
_impl = new SextetImpl(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile(const RString& filename)
|
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile(const RString& filename)
|
||||||
{
|
{
|
||||||
_impl = new Impl(openOutputStream(filename));
|
_impl = new SextetImpl(openOutputStream(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile()
|
LightsDriver_SextetStreamToFile::LightsDriver_SextetStreamToFile()
|
||||||
{
|
{
|
||||||
_impl = new Impl(openOutputStream(g_sSextetStreamOutputFilename));
|
_impl = new SextetImpl(openOutputStream(g_sSextetStreamOutputFilename));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user