Hello community, here is the log from the commit of package kmahjongg for openSUSE:Factory checked in at 2015-05-11 19:07:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kmahjongg (Old) and /work/SRC/openSUSE:Factory/.kmahjongg.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kmahjongg" Changes: -------- --- /work/SRC/openSUSE:Factory/kmahjongg/kmahjongg.changes 2015-03-11 09:50:01.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kmahjongg.new/kmahjongg.changes 2015-05-11 19:07:29.000000000 +0200 @@ -1,0 +2,22 @@ +Sat Apr 11 13:17:41 UTC 2015 - [email protected] + +- Update to KDE Applications 15.04.0 + * KDE Applications 15.04.0 + * https://www.kde.org/announcements/announce-applications-15.04.0.php + + +------------------------------------------------------------------- +Sat Mar 21 18:11:41 UTC 2015 - [email protected] + +- Update to KDE Applications 15.03.95 + * KDE Applications 15.04 RC + + +------------------------------------------------------------------- +Sun Mar 8 12:46:24 UTC 2015 - [email protected] + +- Update to KDE Applications 15.03.80 + * KDE Applications 15.04 Beta + + +------------------------------------------------------------------- Old: ---- kmahjongg-14.12.3.tar.xz New: ---- kmahjongg-15.04.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kmahjongg.spec ++++++ --- /var/tmp/diff_new_pack.54Yf0g/_old 2015-05-11 19:07:30.000000000 +0200 +++ /var/tmp/diff_new_pack.54Yf0g/_new 2015-05-11 19:07:30.000000000 +0200 @@ -17,14 +17,15 @@ Name: kmahjongg -BuildRequires: libkdegames-devel -BuildRequires: libkmahjongg-devel +BuildRequires: libkdegames4-devel +BuildRequires: libkmahjongg4-devel +BuildRequires: libkde4-devel BuildRequires: xz Summary: Mahjongg game License: GPL-2.0+ Group: Amusements/Games/Board/Puzzle Url: http://www.kde.org -Version: 14.12.3 +Version: 15.04.0 Release: 0 Source0: kmahjongg-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ kmahjongg-14.12.3.tar.xz -> kmahjongg-15.04.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmahjongg-14.12.3/boardwidget.cpp new/kmahjongg-15.04.0/boardwidget.cpp --- old/kmahjongg-14.12.3/boardwidget.cpp 2015-01-18 08:15:58.000000000 +0100 +++ new/kmahjongg-15.04.0/boardwidget.cpp 2015-01-18 05:07:00.000000000 +0100 @@ -207,52 +207,9 @@ void BoardWidget::updateSpriteMap() { - // initial offset on the screen of tile 0,0 - // think of it as what is left if you add all tilefaces (qwidth/heigh*2) plus one - // (wholetile - shadow(3dindent) - tileface), and divide by 2 - int xOffset = (width() - (Game->m_width * (theTiles.qWidth())) - (theTiles.width() - - (theTiles.qWidth() * 2))) / 2; - int yOffset = (height() - (Game->m_height * (theTiles.qHeight())) - (theTiles.height() - - (theTiles.qHeight() * 2))) / 2; - - // we iterate over the depth stacking order. Each successive level is - // drawn one indent up and to the right. The indent is the width - // of the 3d relief on the tile left (tile shadow width) switch (m_angle) { case NW: - //remove shadow from margin calculation - xOffset += theTiles.levelOffsetX() / 2; - yOffset += theTiles.levelOffsetY() / 2; - - //Position - for (int z = 0; z < Game->m_depth; z++) { - // we draw down the board so the tile below over rights our border - for (int y = 0; y < Game->m_height; y++) { - // drawing right to left to prevent border overwrite - for (int x=Game->m_width - 1; x >= 0; x--) { - int sx = x * (theTiles.qWidth()) + xOffset; - int sy = y * (theTiles.qHeight()) + yOffset; - - // skip if no tile to display - if (!Game->tilePresent(z, y, x)) { - continue; - } - - TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); - - if (thissprite) { - thissprite->moveTo(sx, sy); - } - - if (thissprite && !gamePaused) { - thissprite->show(); - } - } - } - - xOffset += theTiles.levelOffsetX(); - yOffset -= theTiles.levelOffsetY(); - } + updateSpritePositions(theTiles.levelOffsetX(), -theTiles.levelOffsetY()); //Layer for (int z = 0; z < Game->m_depth; z++) { @@ -260,19 +217,9 @@ //actually starting outside of it, in the bottom right corner, so our first diagonal ends // at the actual top right corner of the board for (int x = Game->m_width * 2; x >= 0; x--) { - // reset the offset int offset = 0; - for (int y = Game->m_height - 1; y >= 0; y--) { - if (Game->tilePresent(z, y, x - offset)) { - TileSprite *thissprite = spriteMap.value(TileCoord(x - offset, y, z)); - - if (thissprite) { - thissprite->raise(); - } - } - - //at each pass, move one place to the left + raiseTileSprite(x - offset, y, z); offset++; } } @@ -281,38 +228,7 @@ break; case NE: - xOffset -= theTiles.levelOffsetX() / 2; - yOffset += theTiles.levelOffsetY() / 2; - - //Position - for (int z = 0; z < Game->m_depth; z++) { - // we draw down the board so the tile below over rights our border - for (int y = 0; y < Game->m_height; y++) { - // drawing right to left to prevent border overwrite - for (int x = 0; x <= Game->m_width - 1; x++) { - int sx = x * (theTiles.qWidth()) + xOffset; - int sy = y * (theTiles.qHeight()) + yOffset; - - // skip if no tile to display - if (!Game->tilePresent(z, y, x)) { - continue; - } - - TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); - - if (thissprite) { - thissprite->moveTo(sx, sy); - } - - if (thissprite && !gamePaused) { - thissprite->show(); - } - } - } - - xOffset -= theTiles.levelOffsetX(); - yOffset -= theTiles.levelOffsetY(); - } + updateSpritePositions(-theTiles.levelOffsetX(), -theTiles.levelOffsetY()); //Layer for (int z = 0; z < Game->m_depth; z++) { @@ -320,19 +236,9 @@ //actually starting outside of it, in the bottom right corner, so our first diagonal ends // at the actual top right corner of the board for (int x =- (Game->m_width); x <= Game->m_width - 1; x++) { - // reset the offset int offset = 0; - for (int y = Game->m_height - 1; y >= 0; y--) { - if (Game->tilePresent(z, y, x + offset)) { - TileSprite *thissprite = spriteMap.value(TileCoord(x + offset, y, z)); - - if (thissprite) { - thissprite->raise(); - } - } - - //at each pass, move one place to the right + raiseTileSprite(x + offset, y, z); offset++; } } @@ -341,49 +247,14 @@ break; case SE: - xOffset -= theTiles.levelOffsetX() / 2; - yOffset -= theTiles.levelOffsetY() / 2; - - //Position - for (int z = 0; z < Game->m_depth; z++) { - for (int y = Game->m_height - 1; y >= 0; y--) { - for (int x = 0; x <= Game->m_width - 1; x++) { - int sx = x * (theTiles.qWidth()) + xOffset; - int sy = y * (theTiles.qHeight()) + yOffset; - - if (!Game->tilePresent(z, y, x)) { - continue; - } - - TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); - - if (thissprite) { - thissprite->moveTo(sx, sy); - } - - if (thissprite && !gamePaused) { - thissprite->show(); - } - } - } - - xOffset -= theTiles.levelOffsetX(); - yOffset += theTiles.levelOffsetY(); - } + updateSpritePositions(-theTiles.levelOffsetX(), theTiles.levelOffsetY()); //Layer for (int z = 0; z < Game->m_depth; z++) { for (int x =- (Game->m_width); x <= Game->m_width - 1; x++) { int offset = 0; - for (int y = 0; y < Game->m_height; y++) { - if (Game->tilePresent(z, y, x + offset)) { - TileSprite *thissprite = spriteMap.value(TileCoord(x + offset, y, z)); - if (thissprite) { - thissprite->raise(); - } - } - + raiseTileSprite(x + offset, y, z); offset++; } } @@ -392,50 +263,14 @@ break; case SW: - xOffset += theTiles.levelOffsetX() / 2; - yOffset -= theTiles.levelOffsetY() / 2; - - //Position - for (int z = 0; z < Game->m_depth; z++) { - for (int y = Game->m_height - 1; y >= 0; y--) { - for (int x = Game->m_width - 1; x >= 0; x--) { - int sx = x * (theTiles.qWidth()) + xOffset; - int sy = y * (theTiles.qHeight()) + yOffset; - - if (!Game->tilePresent(z, y, x)) { - continue; - } - - TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); - - if (thissprite) { - thissprite->moveTo(sx, sy); - } - - if (thissprite && !gamePaused) { - thissprite->show(); - } - } - } - - xOffset += theTiles.levelOffsetX(); - yOffset += theTiles.levelOffsetY(); - } + updateSpritePositions(theTiles.levelOffsetX(), theTiles.levelOffsetY()); //Layer for (int z = 0; z < Game->m_depth; z++) { for (int x = Game->m_width * 2; x >= 0; x--) { int offset = 0; - for (int y = 0; y < Game->m_height; y++) { - if (Game->tilePresent(z, y, x - offset)) { - TileSprite *thissprite = spriteMap.value(TileCoord(x - offset, y, z)); - - if (thissprite) { - thissprite->raise(); - } - } - + raiseTileSprite(x - offset,y,z); offset++; } } @@ -445,6 +280,57 @@ } } +void BoardWidget::updateSpritePositions(int xOffset, int yOffset) +{ + // initial offset on the screen of tile 0,0 + // think of it as what is left if you add all tilefaces (qwidth/heigh*2) plus one + // (wholetile - shadow(3dindent) - tileface), and divide by 2 + int xStart = (width() - (Game->m_width * (theTiles.qWidth())) - (theTiles.width() + - (theTiles.qWidth() * 2))) / 2; + int yStart = (height() - (Game->m_height * (theTiles.qHeight())) - (theTiles.height() + - (theTiles.qHeight() * 2))) / 2; + + //remove shadow from margin calculation + xStart += xOffset / 2; + yStart -= yOffset / 2; + + for (int z = 0; z < Game->m_depth; z++) { + for (int y = 0; y < Game->m_height; y++) { + for (int x = 0; x < Game->m_width; x++) { + const int sx = (x * theTiles.qWidth()) + (z * xOffset) + xStart; + const int sy = (y * theTiles.qHeight()) + (z * yOffset) + yStart; + moveTileSprite(x, y, z, sx, sy); + } + } + } +} + +void BoardWidget::moveTileSprite(int x, int y, int z, int sx, int sy) +{ + + if (Game->tilePresent(z, y, x)) { + TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); + + if (thissprite) { + thissprite->moveTo(sx, sy); + if (!gamePaused) { + thissprite->show(); + } + } + } +} + +void BoardWidget::raiseTileSprite(int x, int y, int z) +{ + if (Game->tilePresent(z, y, x)) { + TileSprite *thissprite = spriteMap.value(TileCoord(x, y, z)); + + if (thissprite) { + thissprite->raise(); + } + } +} + void BoardWidget::pause() { gamePaused = !gamePaused; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmahjongg-14.12.3/boardwidget.h new/kmahjongg-15.04.0/boardwidget.h --- old/kmahjongg-14.12.3/boardwidget.h 2015-01-18 08:15:58.000000000 +0100 +++ new/kmahjongg-15.04.0/boardwidget.h 2015-01-18 05:07:00.000000000 +0100 @@ -377,6 +377,9 @@ private: QString getRandomLayoutName() const; + void updateSpritePositions(int xOffset, int yOffset); + void moveTileSprite(int x, int y, int z, int sx, int sy); + void raiseTileSprite(int x, int y, int z); };
