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

whiterandrek whiterandrek at gmail.com
Fri Jun 5 17:37:09 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:
cbaffbb500 PETKA: added vm field to BigDialogue


Commit: cbaffbb5007aec083cdd47dce13297f149e8199e
    https://github.com/scummvm/scummvm/commit/cbaffbb5007aec083cdd47dce13297f149e8199e
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-06-05T20:36:51+03:00

Commit Message:
PETKA: added vm field to BigDialogue

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


diff --git a/engines/petka/big_dialogue.cpp b/engines/petka/big_dialogue.cpp
index 27e39d2358..9c35c73835 100644
--- a/engines/petka/big_dialogue.cpp
+++ b/engines/petka/big_dialogue.cpp
@@ -35,11 +35,12 @@ namespace Petka {
 
 const uint16 kFallback = 0xFFFE;
 
-BigDialogue::BigDialogue() {
+BigDialogue::BigDialogue(PetkaEngine &vm)
+	: _vm(vm) {
 	_currOp = nullptr;
 	_startOpIndex = 0;
 
-	Common::ScopedPtr<Common::SeekableReadStream> file(g_vm->openFile("dialogue.fix", true));
+	Common::ScopedPtr<Common::SeekableReadStream> file(vm.openFile("dialogue.fix", true));
 	if (!file)
 		return;
 
@@ -72,7 +73,7 @@ void BigDialogue::loadSpeechesInfo() {
 	if (!_speeches.empty())
 		return;
 
-	Common::ScopedPtr<Common::SeekableReadStream> file(g_vm->openFile("dialogue.lod", true));
+	Common::ScopedPtr<Common::SeekableReadStream> file(_vm.openFile("dialogue.lod", true));
 	if (!file)
 		return;
 
@@ -379,7 +380,7 @@ void BigDialogue::next(int choice) {
 			if (processed)
 				_currOp += 1;
 			else {
-				g_vm->getQSystem()->_mainInterface->_dialog.startUserMsg(_currOp->userMsg.arg);
+				_vm.getQSystem()->_mainInterface->_dialog.startUserMsg(_currOp->userMsg.arg);
 			}
 			return;
 		default:
diff --git a/engines/petka/big_dialogue.h b/engines/petka/big_dialogue.h
index 199b1f6cdd..83e1970861 100644
--- a/engines/petka/big_dialogue.h
+++ b/engines/petka/big_dialogue.h
@@ -28,6 +28,8 @@
 
 namespace Petka {
 
+class PetkaEngine;
+
 enum {
 	kOpcodePlay = 1,
 	kOpcodeMenu,
@@ -104,7 +106,7 @@ struct SpeechInfo {
 
 class BigDialogue {
 public:
-	BigDialogue();
+	BigDialogue(PetkaEngine &vm);
 
 	uint opcode();
 
@@ -128,6 +130,8 @@ private:
 	void circleMoveTo(byte index);
 
 private:
+	PetkaEngine &_vm;
+
 	Operation *_currOp;
 	Common::Array<Operation> _ops;
 	uint _startOpIndex;




More information about the Scummvm-git-logs mailing list