diff --git a/library/include/modules/Graphic.h b/library/include/modules/Graphic.h index 8ee9c33b0..9103ce2be 100644 --- a/library/include/modules/Graphic.h +++ b/library/include/modules/Graphic.h @@ -33,6 +33,7 @@ distribution. #include #include "Export.h" #include "Module.h" +#include namespace DFHack { @@ -71,8 +72,6 @@ namespace DFHack class DFHACK_EXPORT Graphic : public Module { public: - Graphic(); - ~Graphic(); bool Finish() { return true; @@ -82,8 +81,7 @@ namespace DFHack DFTileSurface* Call(int x, int y); private: - struct Private; - Private *d; + std::vector funcs; }; } diff --git a/library/modules/Graphic.cpp b/library/modules/Graphic.cpp index 1d84926e3..a12ddb37c 100644 --- a/library/modules/Graphic.cpp +++ b/library/modules/Graphic.cpp @@ -47,40 +47,22 @@ std::unique_ptr DFHack::createGraphic() return dts::make_unique(); } -struct Graphic::Private -{ - bool Started; - vector funcs; -}; - -Graphic::Graphic() -{ - d = new Private; - - d->Started = true; -} - -Graphic::~Graphic() -{ - delete d; -} - bool Graphic::Register(DFTileSurface* (*func)(int,int)) { - d->funcs.push_back(func); + funcs.push_back(func); return true; } bool Graphic::Unregister(DFTileSurface* (*func)(int,int)) { - if ( d->funcs.empty() ) return false; + if ( funcs.empty() ) return false; - vector::iterator it = d->funcs.begin(); - while ( it != d->funcs.end() ) + vector::iterator it = funcs.begin(); + while ( it != funcs.end() ) { if ( *it == func ) { - d->funcs.erase(it); + funcs.erase(it); return true; } it++; @@ -92,12 +74,12 @@ bool Graphic::Unregister(DFTileSurface* (*func)(int,int)) // This will return first DFTileSurface it can get (or NULL if theres none) DFTileSurface* Graphic::Call(int x, int y) { - if ( d->funcs.empty() ) return NULL; + if ( funcs.empty() ) return NULL; DFTileSurface* temp = NULL; - vector::iterator it = d->funcs.begin(); - while ( it != d->funcs.end() ) + vector::iterator it = funcs.begin(); + while ( it != funcs.end() ) { temp = (*it)(x,y); if ( temp != NULL ) diff --git a/library/xml b/library/xml index 8038cc692..b3016446e 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 8038cc692370471aa1151f81cdc621ac310f30e2 +Subproject commit b3016446e60f69d43a9f41e7b2ba4331df14b5e6