From 036d61cbd62dc7907f4eeb36764bef9f794588f4 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 3 Nov 2019 19:14:15 +0100 Subject: 3DS: Implement cloud sync support --- backends/platform/3ds/sprite.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'backends/platform/3ds/sprite.cpp') diff --git a/backends/platform/3ds/sprite.cpp b/backends/platform/3ds/sprite.cpp index b2785e2c2d..1f2c72e2d3 100644 --- a/backends/platform/3ds/sprite.cpp +++ b/backends/platform/3ds/sprite.cpp @@ -101,7 +101,7 @@ void Sprite::convertToInPlace(const Graphics::PixelFormat &dstFormat, const byte } void Sprite::transfer() { - if (dirtyPixels) { + if (pixels && dirtyPixels) { dirtyPixels = false; GSPGPU_FlushDataCache(pixels, w * h * format.bytesPerPixel); C3D_SyncDisplayTransfer((u32*)pixels, GX_BUFFER_DIM(w, h), (u32*)texture.data, GX_BUFFER_DIM(w, h), TEXTURE_TRANSFER_FLAGS); @@ -123,15 +123,19 @@ void Sprite::clear(uint32 color) { } void Sprite::setScale (float x, float y) { - scaleX = x; - scaleY = y; - dirtyMatrix = true; + if (x != scaleX || y != scaleY) { + scaleX = x; + scaleY = y; + dirtyMatrix = true; + } } void Sprite::setPosition(int x, int y) { - posX = x; - posY = y; - dirtyMatrix = true; + if (x != posX || y != posY) { + posX = x; + posY = y; + dirtyMatrix = true; + } } C3D_Mtx* Sprite::getMatrix() { -- cgit v1.2.3