[Scummvm-git-logs] scummvm master -> bfeb6cda0b33029a956724101d114786dc7acab4

whiterandrek whiterandrek at gmail.com
Fri Jun 5 18:11:05 UTC 2020


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

Summary:
bfeb6cda0b PETKA: added engine field to VideoSystem


Commit: bfeb6cda0b33029a956724101d114786dc7acab4
    https://github.com/scummvm/scummvm/commit/bfeb6cda0b33029a956724101d114786dc7acab4
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-06-05T21:01:15+03:00

Commit Message:
PETKA: added engine field to VideoSystem

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


diff --git a/engines/petka/petka.cpp b/engines/petka/petka.cpp
index 44e4fd84e8..258d3f66e4 100644
--- a/engines/petka/petka.cpp
+++ b/engines/petka/petka.cpp
@@ -91,7 +91,7 @@ Common::Error PetkaEngine::run() {
 	_console.reset(new Console(this));
 	_fileMgr.reset(new FileMgr());
 	_soundMgr.reset(new SoundMgr(*this));
-	_vsys.reset(new VideoSystem());
+	_vsys.reset(new VideoSystem(*this));
 
 	loadPart(2);
 
diff --git a/engines/petka/video.cpp b/engines/petka/video.cpp
index 093e2b72b0..202b6db1fd 100644
--- a/engines/petka/video.cpp
+++ b/engines/petka/video.cpp
@@ -36,15 +36,15 @@ namespace Petka {
 const uint kShakeTime = 30;
 const int kShakeOffset = 3;
 
-VideoSystem::VideoSystem() :
-	_shake(false), _shift(false), _shakeTime(0), _time(0) {
+VideoSystem::VideoSystem(PetkaEngine &vm) :
+	_vm(vm), _shake(false), _shift(false), _shakeTime(0), _time(0) {
 	makeAllDirty();
 	_time = g_system->getMillis();
 	_allowAddingRects = true;
 }
 
 void VideoSystem::update() {
-	Interface *interface = g_vm->getQSystem()->_currInterface;
+	Interface *interface = _vm.getQSystem()->_currInterface;
 	uint32 time = g_system->getMillis();
 	if (interface) {
 		for (uint i = interface->_startIndex; i < interface->_objs.size(); ++i) {
@@ -128,7 +128,7 @@ void VideoSystem::setShake(bool shake) {
 }
 
 void VideoSystem::sort() {
-	Common::Array<QVisibleObject *> &objs = g_vm->getQSystem()->_currInterface->_objs;
+	Common::Array<QVisibleObject *> &objs = _vm.getQSystem()->_currInterface->_objs;
 	for (uint i = 0; i < objs.size() - 1; ++i) {
 		uint minIndex = i;
 		for (uint j = i + 1; j < objs.size(); ++j) {
diff --git a/engines/petka/video.h b/engines/petka/video.h
index f6370d1089..5e3b2afc8a 100644
--- a/engines/petka/video.h
+++ b/engines/petka/video.h
@@ -29,9 +29,11 @@ namespace Petka {
 
 class FlicDecoder;
 
+class PetkaEngine;
+
 class VideoSystem : public Graphics::Screen {
 public:
-	VideoSystem();
+	VideoSystem(PetkaEngine &vm);
 
 	void updateTime();
 	void update() override;
@@ -51,6 +53,7 @@ private:
 	void sort();
 
 private:
+	PetkaEngine &_vm;
 	uint32 _shakeTime;
 	uint32 _time;
 	bool _shake;




More information about the Scummvm-git-logs mailing list