[Scummvm-git-logs] scummvm master -> 379168ade469aa44813b327ef96fbc5d3259ca4d

whiterandrek whiterandrek at gmail.com
Wed May 20 19:06:54 UTC 2020


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
65c60178d9 PETKA: removed unused function
0d0ca6961d PETKA: reimplemented shaking
379168ade4 COMMON: added note about using shake in PETKA engine


Commit: 65c60178d9906cd4ea34ff52c7d63053196bf290
    https://github.com/scummvm/scummvm/commit/65c60178d9906cd4ea34ff52c7d63053196bf290
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-20T21:50:42+03:00

Commit Message:
PETKA: removed unused function

Changed paths:
    engines/petka/video.cpp


diff --git a/engines/petka/video.cpp b/engines/petka/video.cpp
index 0cb046ca0d..71b11e0923 100644
--- a/engines/petka/video.cpp
+++ b/engines/petka/video.cpp
@@ -39,10 +39,6 @@ VideoSystem::VideoSystem() :
 	_time = g_system->getMillis();
 }
 
-static bool objCmp(QVisibleObject *&l, QVisibleObject *&r) {
-	return l->_z < r->_z;
-}
-
 void VideoSystem::update() {
 	Interface *interface = g_vm->getQSystem()->_currInterface;
 	int time = g_system->getMillis();


Commit: 0d0ca6961db5889116f84a1b918f8f5a2555b336
    https://github.com/scummvm/scummvm/commit/0d0ca6961db5889116f84a1b918f8f5a2555b336
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-20T21:58:51+03:00

Commit Message:
PETKA: reimplemented shaking

Changed paths:
    engines/petka/video.cpp
    engines/petka/video.h


diff --git a/engines/petka/video.cpp b/engines/petka/video.cpp
index 71b11e0923..276dc7f7ae 100644
--- a/engines/petka/video.cpp
+++ b/engines/petka/video.cpp
@@ -33,6 +33,9 @@
 
 namespace Petka {
 
+const uint kShakeTime = 30;
+const int kShakeOffset = 3;
+
 VideoSystem::VideoSystem() :
 	_shake(false), _shift(false), _shakeTime(0), _time(0) {
 	makeAllDirty();
@@ -41,7 +44,7 @@ VideoSystem::VideoSystem() :
 
 void VideoSystem::update() {
 	Interface *interface = g_vm->getQSystem()->_currInterface;
-	int time = g_system->getMillis();
+	uint32 time = g_system->getMillis();
 	if (interface) {
 		for (uint i = 0; i < interface->_objs.size(); ++i) {
 			interface->_objs[i]->update(time - _time);
@@ -57,32 +60,19 @@ void VideoSystem::update() {
 			interface->_objs[i]->draw();
 		}
 	}
+
 	_time = time;
 	_rects.clear();
 
 	if (_shake) {
-		int width = _screen.w;
-		int x =  0;
-
-		if (_shift) {
-			Graphics::Surface s;
-			s.create(3, 480, g_system->getScreenFormat());
-			g_system->copyRectToScreen(s.getPixels(), s.pitch, 0, 0, s.w, s.h);
-			width -= 3;
-			x = 3;
-		}
-
-		g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, x, 0, width, _screen.h);
-		g_system->updateScreen();
-
+		g_system->setShakePos(_shift ? kShakeOffset : 0, 0);
 		time = g_system->getMillis();
-		if (time - _shakeTime > 30) {
+		if (time - _shakeTime > kShakeTime) {
 			_shift = !_shift;
 			_shakeTime = time;
 		}
-	} else {
-		_screen.update();
 	}
+	_screen.update();
 }
 
 void VideoSystem::addDirtyRect(const Common::Rect &rect) {
@@ -122,6 +112,7 @@ void VideoSystem::updateTime() {
 
 void VideoSystem::setShake(bool shake) {
 	_shake = shake;
+	g_system->setShakePos(0, 0);
 }
 
 void VideoSystem::sort() {
diff --git a/engines/petka/video.h b/engines/petka/video.h
index 4117a37671..385c7410a8 100644
--- a/engines/petka/video.h
+++ b/engines/petka/video.h
@@ -50,7 +50,7 @@ private:
 	Graphics::Screen _screen;
 	Common::List<Common::Rect> _rects;
 	uint32 _shakeTime;
-	int _time;
+	uint32 _time;
 	bool _shake;
 	bool _shift;
 };


Commit: 379168ade469aa44813b327ef96fbc5d3259ca4d
    https://github.com/scummvm/scummvm/commit/379168ade469aa44813b327ef96fbc5d3259ca4d
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-20T22:05:31+03:00

Commit Message:
COMMON: added note about using shake in PETKA engine

Changed paths:
    common/system.h


diff --git a/common/system.h b/common/system.h
index bf96f8bb07..44414becbe 100644
--- a/common/system.h
+++ b/common/system.h
@@ -938,7 +938,7 @@ public:
 	 * @param shakeYOffset	the shake y offset
 	 *
 	 * @note This is currently used in the SCUMM, QUEEN, KYRA, SCI, DREAMWEB,
-	 * SUPERNOVA, TEENAGENT, and TOLTECS engines.
+	 * SUPERNOVA, TEENAGENT, TOLTECS and PETKA engines.
 	 */
 	virtual void setShakePos(int shakeXOffset, int shakeYOffset) = 0;
 




More information about the Scummvm-git-logs mailing list