diff --git a/spine-sfml/include/spine-sfml/Atlas.h b/spine-sfml/include/spine-sfml/Atlas.h index c704ac4ed..688476a10 100644 --- a/spine-sfml/include/spine-sfml/Atlas.h +++ b/spine-sfml/include/spine-sfml/Atlas.h @@ -51,7 +51,7 @@ class Atlas: public BaseAtlas { public: Atlas (std::ifstream &file); Atlas (std::istream &input); - Atlas (const std::string &text); + Atlas (const std::string &path); Atlas (const char *begin, const char *end); AtlasRegion* findRegion (const std::string &name); diff --git a/spine-sfml/src/main.cpp b/spine-sfml/src/main.cpp index ca97d8ab7..587113812 100644 --- a/spine-sfml/src/main.cpp +++ b/spine-sfml/src/main.cpp @@ -34,9 +34,7 @@ using namespace spine; int main () { try { - ifstream atlasFile("../data/spineboy.atlas"); - Atlas *atlas = new Atlas(atlasFile); - + Atlas *atlas = new Atlas("../data/spineboy.atlas"); SkeletonJson json(atlas); SkeletonData *skeletonData = json.readSkeletonDataFile("../data/spineboy-skeleton.json"); Animation *animation = json.readAnimationFile("../data/spineboy-walk.json", skeletonData); diff --git a/spine-sfml/src/spine-sfml/Atlas.cpp b/spine-sfml/src/spine-sfml/Atlas.cpp index 660594343..4ecf431fc 100644 --- a/spine-sfml/src/spine-sfml/Atlas.cpp +++ b/spine-sfml/src/spine-sfml/Atlas.cpp @@ -25,6 +25,8 @@ #include #include +#include +#include namespace spine { @@ -42,8 +44,9 @@ Atlas::Atlas (std::istream &input) { load(input); } -Atlas::Atlas (const std::string &text) { - load(text); +Atlas::Atlas (const std::string &path) { + std::ifstream file("../data/spineboy.atlas"); + load(file); } Atlas::Atlas (const char *begin, const char *end) {