diff --git a/oxygine/src/oxygine/res/ResAtlasPrebuilt.cpp b/oxygine/src/oxygine/res/ResAtlasPrebuilt.cpp index 412008603..f6571243c 100644 --- a/oxygine/src/oxygine/res/ResAtlasPrebuilt.cpp +++ b/oxygine/src/oxygine/res/ResAtlasPrebuilt.cpp @@ -121,13 +121,13 @@ namespace oxygine if (columns) { + bool hpc = child_node.attribute("hpc").as_bool(HPC_DEFAULT); animationFrames frames; int frames_count = rows * columns; frames.reserve(frames_count); ResAnim* ra = new ResAnim(this); - OX_ASSERT(meta_frames); @@ -160,6 +160,7 @@ namespace oxygine float ih = 1.0f / texture->getHeight(); RectF srcRect(x * iw, y * ih, bbox_w * iw, bbox_h * ih); + if (hpc) srcRect.expand2(Vector2(-0.5f*iw, -0.5f*ih)); float fs = frame_scale; RectF destRect( diff --git a/oxygine/src/oxygine/res/ResAtlasPrebuilt.h b/oxygine/src/oxygine/res/ResAtlasPrebuilt.h index d23a3708b..8bd3d0b48 100644 --- a/oxygine/src/oxygine/res/ResAtlasPrebuilt.h +++ b/oxygine/src/oxygine/res/ResAtlasPrebuilt.h @@ -1,5 +1,10 @@ #pragma once #include "ResAtlas.h" +#ifdef FORCE_HPC +#define HPC_DEFAULT true +#else +#define HPC_DEFAULT false +#endif namespace oxygine {