aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds/sprite.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-11-03 19:14:15 +0100
committerBastien Bouclet2019-11-03 19:14:15 +0100
commit036d61cbd62dc7907f4eeb36764bef9f794588f4 (patch)
tree37379e8b4a8e1c3a52029e8e606ba2b925da4df6 /backends/platform/3ds/sprite.cpp
parent2d11974c28b50c5c0a65be71caa4c93be24ab468 (diff)
downloadscummvm-rg350-036d61cbd62dc7907f4eeb36764bef9f794588f4.tar.gz
scummvm-rg350-036d61cbd62dc7907f4eeb36764bef9f794588f4.tar.bz2
scummvm-rg350-036d61cbd62dc7907f4eeb36764bef9f794588f4.zip
3DS: Implement cloud sync support
Diffstat (limited to 'backends/platform/3ds/sprite.cpp')
-rw-r--r--backends/platform/3ds/sprite.cpp18
1 files changed, 11 insertions, 7 deletions
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() {