diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index ae04c1500..4507e4156 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -294,19 +294,19 @@ const Transform4x4f& GuiComponent::getTransform() if (mScale != 1.0) mTransform.scale(mScale); if (mRotation != 0.0) { - // Calculate offset as difference between origin and rotation origin + // Calculate offset as difference between origin and rotation origin. Vector2f rotationSize = getRotationSize(); float xOff = (mOrigin.x() - mRotationOrigin.x()) * rotationSize.x(); float yOff = (mOrigin.y() - mRotationOrigin.y()) * rotationSize.y(); - // Transform to offset point + // Transform to offset point. if (xOff != 0.0 || yOff != 0.0) mTransform.translate(Vector3f(xOff * -1, yOff * -1, 0.0f)); - // Apply rotation transform + // Apply rotation transform. mTransform.rotateZ(mRotation); - // Tranform back to original point + // Transform back to original point. if (xOff != 0.0 || yOff != 0.0) mTransform.translate(Vector3f(xOff, yOff, 0.0f)); } @@ -373,12 +373,12 @@ bool GuiComponent::finishAnimation(unsigned char slot) { assert(slot < MAX_ANIMATIONS); if (mAnimationMap[slot]) { - // Skip to animation's end + // Skip to animation's end. const bool done = mAnimationMap[slot]->update(mAnimationMap[slot]-> getAnimation()->getDuration() - mAnimationMap[slot]->getTime()); assert(done); - delete mAnimationMap[slot]; // Will also call finishedCallback + delete mAnimationMap[slot]; // Will also call finishedCallback. mAnimationMap[slot] = nullptr; return true; } diff --git a/es-core/src/ImageIO.cpp b/es-core/src/ImageIO.cpp index 8e5742899..b4ce3bfbf 100644 --- a/es-core/src/ImageIO.cpp +++ b/es-core/src/ImageIO.cpp @@ -10,7 +10,7 @@ #include #include -std::vector ImageIO::loadFromMemoryRGBA32(const unsigned char * data, +std::vector ImageIO::loadFromMemoryRGBA32(const unsigned char* data, const size_t size, size_t & width, size_t & height) { std::vector rawData; diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index 9c527a3aa..77dda1e99 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -169,12 +169,12 @@ void ImageComponent::setImage(std::string path, bool tile) resize(); } -void ImageComponent::setImage(const char* path, size_t length, bool tile) +void ImageComponent::setImage(const char* data, size_t length, bool tile) { mTexture.reset(); mTexture = TextureResource::get("", tile); - mTexture->initFromMemory(path, length); + mTexture->initFromMemory(data, length); resize(); } diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index 6eebc67f5..1d3b7d65c 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -26,7 +26,7 @@ public: // as tiling, creates vertices accordingly). void setImage(std::string path, bool tile = false); // Loads an image from memory. - void setImage(const char* image, size_t length, bool tile = false); + void setImage(const char* data, size_t length, bool tile = false); // Use an already existing texture. void setImage(const std::shared_ptr& texture); diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index 23f446e39..80f29ee7f 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -25,7 +25,7 @@ public: static std::shared_ptr get(const std::string& path, bool tile = false, bool forceLoad = false, bool dynamic = true); void initFromPixels(const unsigned char* dataRGBA, size_t width, size_t height); - virtual void initFromMemory(const char* file, size_t length); + virtual void initFromMemory(const char* data, size_t length); // For scalable source images in textures we want to set the resolution to rasterize at. void rasterizeAt(size_t width, size_t height); diff --git a/resources/graphics/scroll_gradient.png b/resources/graphics/scroll_gradient.png index f7c3bfc8d..6bcdfebd2 100644 Binary files a/resources/graphics/scroll_gradient.png and b/resources/graphics/scroll_gradient.png differ