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

Die4Ever noreply at scummvm.org
Mon Jan 3 05:22:12 UTC 2022


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:
ac79a09538 GROOVIE: fixing drawString redraw WIP


Commit: ac79a095386e06ae96514f8547174602716478bb
    https://github.com/scummvm/scummvm/commit/ac79a095386e06ae96514f8547174602716478bb
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2022-01-02T23:22:02-06:00

Commit Message:
GROOVIE: fixing drawString redraw WIP

Changed paths:
    engines/groovie/script.cpp
    engines/groovie/video/player.h
    engines/groovie/video/roq.cpp
    engines/groovie/video/roq.h


diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 0df5d16681c..a659a6722f2 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -468,7 +468,7 @@ void Script::readScriptString(Common::String &str) {
 		}
 		// Append the current character at the end of the string
 		str += c;
-	}
+ 	}
 
 	debugC(5, kDebugScript, "readScriptString orig: %s, ret: %s", orig.c_str(), str.c_str());
 }
@@ -637,12 +637,12 @@ void Script::printString(Graphics::Surface *surface, const char *str) {
 		message[i] = str[i];
 	}
 	Common::rtrim(message);
-
+	
 	// Draw the string
 	if (_version == kGroovieT7G) {
 		_vm->_font->drawString(surface, message, 0, 16, 640, 0xE2, Graphics::kTextAlignCenter);
 	} else {
-		_vm->_font->drawString(surface, message, 190, 190, 640, _vm->_pixelFormat.RGBToColor(0xff, 0x0A, 0x0A), Graphics::kTextAlignLeft);
+		_vm->_videoPlayer->drawString(Common::String(message), 190, 190, _vm->_pixelFormat.RGBToColor(0xff, 0x0A, 0x0A));
 	}
 }
 
@@ -2006,10 +2006,7 @@ void Script::o2_printstring() {
 	readScriptString(text);
 	debugC(1, kDebugScript, "Groovie::Script: PRINTSTRING (%d, %d): %s", posx, posy, text.c_str());
 
-	Graphics::Surface *gamescreen = _vm->_system->lockScreen();
-	_vm->_font->drawString(gamescreen, text.c_str(), posx, posy, 640, col, Graphics::kTextAlignLeft);
-	_vm->_system->unlockScreen();
-	_vm->_graphicsMan->change();	// Force Update screen after step
+	_vm->_videoPlayer->drawString(text, posx, posy, col);
 }
 
 void Script::o2_playsong() {
diff --git a/engines/groovie/video/player.h b/engines/groovie/video/player.h
index 617122a420e..d8f9fe15f74 100644
--- a/engines/groovie/video/player.h
+++ b/engines/groovie/video/player.h
@@ -44,6 +44,7 @@ public:
 	virtual void stopAudioStream() = 0;
 	void fastForward();
 	bool isFastForwarding();
+	virtual void drawString(const Common::String text, int posx, int posy, uint32 color) {}
 
 protected:
 	// To be implemented by subclasses
diff --git a/engines/groovie/video/roq.cpp b/engines/groovie/video/roq.cpp
index f4984f43177..fcf783c1664 100644
--- a/engines/groovie/video/roq.cpp
+++ b/engines/groovie/video/roq.cpp
@@ -895,6 +895,21 @@ void ROQPlayer::createAudioStream(bool stereo) {
 	g_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, _audioStream);
 }
 
+void ROQPlayer::drawString(const Common::String text, int posx, int posy, uint32 color) {
+	int screenOffset = 0;
+	if (_screen->h != 480) {
+		screenOffset = 80;
+	}
+
+	Graphics::Surface *gamescreen = _vm->_system->lockScreen();
+	// TODO fix redraw
+	//Common::Rect rect(posx, posy - screenOffset, posx + _vm->_font->getMaxCharWidth()*15, posy + _vm->_font->getFontHeight()*2 - screenOffset);
+	//gamescreen->copyRectToSurface(*_bg, posx, posy, rect);
+	_vm->_font->drawString(gamescreen, text.c_str(), posx, posy, _overBuf->w, color, Graphics::kTextAlignLeft);
+	_vm->_system->unlockScreen();
+	_vm->_graphicsMan->change(); // Force Update screen after step
+}
+
 ROQSoundPlayer::ROQSoundPlayer(GroovieEngine *vm) : ROQPlayer(vm) {
 	// HACK: we set the pixel format here to prevent a crash because this never plays any videos
 	// maybe we should just pre-create these buffers no matter what
diff --git a/engines/groovie/video/roq.h b/engines/groovie/video/roq.h
index e99b172da99..7ae6705fe6b 100644
--- a/engines/groovie/video/roq.h
+++ b/engines/groovie/video/roq.h
@@ -45,6 +45,8 @@ public:
 		return _soundHandle;
 	}
 
+	void drawString(const Common::String text, int posx, int posy, uint32 color) override;
+
 protected:
 	uint16 loadInternal() override;
 	bool playFrameInternal() override;




More information about the Scummvm-git-logs mailing list