[Scummvm-git-logs] scummvm master -> 24d3fa785f3a0e275d68f9c68999b68b8c270e66

mgerhardy martin.gerhardy at gmail.com
Thu Jun 3 19:09:43 UTC 2021


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

Summary:
6abaaef306 TWINE: reduced updateScreen calls
4765e1968e TWINE: merged ScopedFPS and FrameMarker
e5591b8115 TWINE: this already happens in fadeIn
14a467093e TWINE: const for palette pointer
a4efeea59b TWINE: handle the screen buffer in the render methods
24d3fa785f TWINE: already set in centerOnActor


Commit: 6abaaef306b469f3867a58cf1ca94deca03a90d3
    https://github.com/scummvm/scummvm/commit/6abaaef306b469f3867a58cf1ca94deca03a90d3
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T18:33:41+02:00

Commit Message:
TWINE: reduced updateScreen calls

Changed paths:
    engines/twine/twine.cpp


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 56e10a040f..4f7a5520e7 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -1066,7 +1066,6 @@ void TwinEEngine::setPalette(uint startColor, uint numColors, const byte *palett
 
 void TwinEEngine::flip() {
 	g_system->copyRectToScreen(frontVideoBuffer.getPixels(), frontVideoBuffer.pitch, 0, 0, frontVideoBuffer.w, frontVideoBuffer.h);
-	g_system->updateScreen();
 }
 
 void TwinEEngine::copyBlockPhys(const Common::Rect &rect, bool updateScreen) {


Commit: 4765e1968ed72ebf90dfc48af95d364660342439
    https://github.com/scummvm/scummvm/commit/4765e1968ed72ebf90dfc48af95d364660342439
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T18:40:19+02:00

Commit Message:
TWINE: merged ScopedFPS and FrameMarker

Changed paths:
    engines/twine/debugger/debug.cpp
    engines/twine/flamovies.cpp
    engines/twine/holomap.cpp
    engines/twine/menu/menu.cpp
    engines/twine/menu/menuoptions.cpp
    engines/twine/renderer/screens.cpp
    engines/twine/scene/gamestate.cpp
    engines/twine/text.cpp
    engines/twine/twine.cpp
    engines/twine/twine.h


diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index 3c48688218..542abcd92d 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -430,8 +430,7 @@ void Debug::debugProcessWindow() {
 	debugDrawWindows();
 
 	for (;;) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(25);
+		FrameMarker frame(_engine, 25);
 		_engine->readKeys();
 		if (_engine->shouldQuit()) {
 			break;
diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index 75454b28c9..2f05a80faf 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -389,8 +389,7 @@ void FlaMovies::playFlaMovie(const char *flaName) {
 
 		_flaPaletteVar = true;
 		do {
-			FrameMarker frame;
-			ScopedFPS scopedFps(_flaHeaderData.speed);
+			FrameMarker frame(_engine, _flaHeaderData.speed);
 			_engine->readKeys();
 			if (_engine->shouldQuit()) {
 				break;
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 68709e1dbc..4a570c29ca 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -306,7 +306,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 	bool fadeInPalette = true;
 	_engine->_input->enableKeyMap(holomapKeyMapId);
 	for (;;) {
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		_engine->readKeys();
 		if (_engine->shouldQuit() || _engine->_input->toggleAbortAction()) {
 			break;
@@ -494,8 +494,7 @@ void Holomap::processHolomap() {
 	bool fadeInPalette = true;
 	_engine->_input->enableKeyMap(holomapKeyMapId);
 	for (;;) {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		_engine->_input->readKeys();
 		if (_engine->shouldQuit() || _engine->_input->toggleAbortAction()) {
 			break;
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 76bcaaaea3..5a31184e96 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -419,8 +419,7 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 	}
 	uint32 startMillis = _engine->_system->getMillis();
 	do {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		const uint32 loopMillis = _engine->_system->getMillis();
 		_engine->readKeys();
 
@@ -762,8 +761,7 @@ bool Menu::init() {
 }
 
 EngineState Menu::run() {
-	FrameMarker frame;
-	ScopedFPS scopedFps;
+	FrameMarker frame(_engine);
 	_engine->_text->initTextBank(TextBankId::Options_and_menus);
 
 	_engine->_music->playTrackMusic(9); // LBA's Theme
@@ -814,8 +812,7 @@ int32 Menu::giveupMenu() {
 
 	int32 menuId;
 	do {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		_engine->_text->initTextBank(TextBankId::Options_and_menus);
 		menuId = processMenu(localMenu);
 		switch (menuId) {
@@ -1073,8 +1070,7 @@ void Menu::processBehaviourMenu() {
 #endif
 	ScopedKeyMap scopedKeyMap(_engine, uiKeyMapId);
 	while (_engine->_input->isActionActive(TwinEActionType::BehaviourMenu) || _engine->_input->isQuickBehaviourActionActive()) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		_engine->readKeys();
 
 #if 0
@@ -1210,8 +1206,7 @@ void Menu::processInventoryMenu() {
 	//ScopedCursor scopedCursor(_engine);
 	ScopedKeyMap scopedKeyMap(_engine, uiKeyMapId);
 	for (;;) {
-		FrameMarker frame;
-		ScopedFPS fps(66);
+		FrameMarker frame(_engine, 66);
 		_engine->readKeys();
 		int32 prevSelectedItem = inventorySelectedItem;
 
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index f2746c7f52..00c0e897b3 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -263,8 +263,7 @@ bool MenuOptions::enterText(TextId textIdx, char *textTargetBuf, size_t bufSize)
 	Common::fill(&_onScreenKeyboardDirty[0], &_onScreenKeyboardDirty[ARRAYSIZE(_onScreenKeyboardDirty)], 1);
 	ScopedFeatureState scopedVirtualKeyboard(OSystem::kFeatureVirtualKeyboard, true);
 	for (;;) {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		Common::Event event;
 		while (g_system->getEventManager()->pollEvent(event)) {
 			switch (event.type) {
diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index d66a7e72af..65a1ee2b41 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -162,8 +162,7 @@ void Screens::adjustCrossPalette(const uint32 *pal1, const uint32 *pal2) {
 	const uint8 *pal2p = (const uint8 *)pal2;
 	uint8 *paletteOut = (uint8 *)pal;
 	do {
-		FrameMarker frame;
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		counter = 0;
 
 		uint8 *newR = &paletteOut[counter];
@@ -197,7 +196,7 @@ void Screens::fadeToBlack(const uint32 *pal) {
 	}
 
 	for (int32 i = 100; i >= 0; i -= 3) {
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		adjustPalette(0, 0, 0, pal, i);
 		_engine->flip();
 	}
@@ -207,8 +206,7 @@ void Screens::fadeToBlack(const uint32 *pal) {
 
 void Screens::fadeToPal(const uint32 *pal) {
 	for (int32 i = 0; i <= 100; i += 3) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		adjustPalette(0, 0, 0, pal, i);
 		_engine->flip();
 	}
@@ -242,8 +240,7 @@ void Screens::setBackPal() {
 
 void Screens::fadePalRed(const uint32 *pal) {
 	for (int32 i = 100; i >= 0; i -= 2) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		adjustPalette(0xFF, 0, 0, pal, i);
 		_engine->flip();
 	}
@@ -251,8 +248,7 @@ void Screens::fadePalRed(const uint32 *pal) {
 
 void Screens::fadeRedPal(const uint32 *pal) {
 	for (int32 i = 0; i <= 100; i += 2) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(50);
+		FrameMarker frame(_engine, 50);
 		adjustPalette(0xFF, 0, 0, pal, i);
 		_engine->flip();
 	}
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 15ea608f1f..6b0c659418 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -370,8 +370,7 @@ void GameState::processFoundItem(InventoryItems item) {
 
 	ScopedKeyMap uiKeyMap(_engine, uiKeyMapId);
 	for (;;) {
-		FrameMarker frame;
-		ScopedFPS fps(66);
+		FrameMarker frame(_engine, 66);
 		_engine->_interface->resetClip();
 		_engine->_redraw->currNumOfRedrawBox = 0;
 		_engine->_redraw->blitBackgroundAreas();
@@ -431,8 +430,7 @@ void GameState::processFoundItem(InventoryItems item) {
 	}
 
 	while (_engine->_text->playVoxSimple(_engine->_text->currDialTextEntry)) {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		_engine->readKeys();
 		if (_engine->shouldQuit() || _engine->_input->toggleAbortAction()) {
 			break;
@@ -466,8 +464,7 @@ void GameState::processGameChoices(TextId choiceIdx) {
 	// get right VOX entry index
 	if (_engine->_text->initVoxToPlayTextId(choiceAnswer)) {
 		while (_engine->_text->playVoxSimple(_engine->_text->currDialTextEntry)) {
-			FrameMarker frame;
-			ScopedFPS scopedFps;
+			FrameMarker frame(_engine);
 			if (_engine->shouldQuit()) {
 				break;
 			}
@@ -505,8 +502,7 @@ void GameState::processGameoverAnimation() {
 	_engine->_interface->setClip(rect);
 
 	while (!_engine->_input->toggleAbortAction() && (_engine->lbaTime - startLbaTime) <= 500) {
-		FrameMarker frame;
-		ScopedFPS scopedFps(66);
+		FrameMarker frame(_engine, 66);
 		_engine->readKeys();
 		if (_engine->shouldQuit()) {
 			return;
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index cefb524945..2e06d7a517 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -597,8 +597,7 @@ bool Text::displayText(TextId index, bool showText, bool playVox, bool loop) {
 		ScopedKeyMap uiKeyMap(_engine, uiKeyMapId);
 		ProgressiveTextState textState = ProgressiveTextState::ContinueRunning;
 		for (;;) {
-			FrameMarker frame;
-			ScopedFPS scopedFps(66);
+			FrameMarker frame(_engine, 66);
 			_engine->readKeys();
 			if (textState == ProgressiveTextState::ContinueRunning) {
 				textState = updateProgressiveText();
@@ -637,8 +636,7 @@ bool Text::displayText(TextId index, bool showText, bool playVox, bool loop) {
 		}
 	}
 	while (playVox && playVoxSimple(currDialTextEntry)) {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(_engine);
 		_engine->readKeys();
 		if (_engine->shouldQuit() || _engine->_input->toggleAbortAction()) {
 			stopVox(currDialTextEntry);
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 4f7a5520e7..d3fa6a3cbb 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -93,25 +93,26 @@ ScopedCursor::~ScopedCursor() {
 	_engine->popMouseCursorVisible();
 }
 
-ScopedFPS::ScopedFPS(uint32 fps) : _fps(fps) {
+FrameMarker::FrameMarker(TwinEEngine *engine, uint32 fps) : _engine(engine), _fps(fps) {
 	_start = g_system->getMillis();
 }
 
-ScopedFPS::~ScopedFPS() {
+FrameMarker::~FrameMarker() {
+	g_system->updateScreen();
+	if (_fps == 0) {
+		return;
+	}
 	const uint32 end = g_system->getMillis();
 	const uint32 frameTime = end - _start;
 	const uint32 maxDelay = 1000 / _fps;
 	if (frameTime > maxDelay) {
+		debug("Frame took longer than the max allowed time: %u (max is %u)", frameTime, maxDelay);
 		return;
 	}
 	const uint32 waitMillis = maxDelay - frameTime;
 	g_system->delayMillis(waitMillis);
 }
 
-FrameMarker::~FrameMarker() {
-	g_system->updateScreen();
-}
-
 TwinEEngine::TwinEEngine(OSystem *system, Common::Language language, uint32 flags, TwineGameType gameType)
 	: Engine(system), _gameType(gameType), _gameLang(language), _gameFlags(flags), _rnd("twine") {
 	// Add default file directories
@@ -691,7 +692,7 @@ void TwinEEngine::processOptionsMenu() {
 }
 
 int32 TwinEEngine::runGameEngine() { // mainLoopInteration
-	FrameMarker frame;
+	FrameMarker frame(this, 0);
 	_input->enableKeyMap(mainKeyMapId);
 
 	readKeys();
@@ -826,8 +827,7 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
 				copyBlockPhys(5, bottom, 5 + width, bottom + _text->lineHeight);
 			}
 			do {
-				FrameMarker frameWait;
-				ScopedFPS scopedFps;
+				FrameMarker frameWait(this);
 				readKeys();
 				if (shouldQuit()) {
 					break;
@@ -1031,8 +1031,7 @@ bool TwinEEngine::delaySkip(uint32 time) {
 	uint32 startTicks = _system->getMillis();
 	uint32 stopTicks = 0;
 	do {
-		FrameMarker frame;
-		ScopedFPS scopedFps;
+		FrameMarker frame(this);
 		readKeys();
 		if (_input->toggleAbortAction()) {
 			return true;
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 0b2989a385..0390a03e3c 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -166,17 +166,13 @@ struct ScopedCursor {
 	~ScopedCursor();
 };
 
-class ScopedFPS {
+class FrameMarker {
 private:
+	TwinEEngine *_engine;
 	uint32 _fps;
 	uint32 _start;
 public:
-	ScopedFPS(uint32 fps = DEFAULT_FRAMES_PER_SECOND);
-	~ScopedFPS();
-};
-
-class FrameMarker {
-public:
+	FrameMarker(TwinEEngine *engine, uint32 fps = DEFAULT_FRAMES_PER_SECOND);
 	~FrameMarker();
 };
 


Commit: e5591b811588d91faf6306db2ca79b5c58a209c2
    https://github.com/scummvm/scummvm/commit/e5591b811588d91faf6306db2ca79b5c58a209c2
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T19:01:14+02:00

Commit Message:
TWINE: this already happens in fadeIn

Changed paths:
    engines/twine/renderer/redraw.cpp


diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 97498308ac..36f258fdfb 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -691,8 +691,6 @@ void Redraw::redrawEngineActions(bool bgRedraw) {
 
 		if (_engine->_scene->needChangeScene != -1 && _engine->_scene->needChangeScene != -2) {
 			_engine->_screens->fadeIn(_engine->_screens->paletteRGBA);
-			_engine->setPalette(_engine->_screens->paletteRGBA);
-			_engine->flip();
 		}
 	} else {
 		blitBackgroundAreas();


Commit: 14a467093e6d3f73813bf3ab636289cc3ea3633f
    https://github.com/scummvm/scummvm/commit/14a467093e6d3f73813bf3ab636289cc3ea3633f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T19:01:14+02:00

Commit Message:
TWINE: const for palette pointer

Changed paths:
    engines/twine/renderer/screens.cpp
    engines/twine/renderer/screens.h


diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index 65a1ee2b41..f60af68508 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -95,7 +95,7 @@ bool Screens::loadImageDelay(int32 index, int32 paletteIndex, int32 seconds) {
 	return false;
 }
 
-void Screens::fadeIn(uint32 *pal) {
+void Screens::fadeIn(const uint32 *pal) {
 	if (_engine->cfgfile.CrossFade) {
 		_engine->crossFade(_engine->frontVideoBuffer, pal);
 	} else {
@@ -106,7 +106,7 @@ void Screens::fadeIn(uint32 *pal) {
 	_engine->flip();
 }
 
-void Screens::fadeOut(uint32 *pal) {
+void Screens::fadeOut(const uint32 *pal) {
 	/*if(cfgfile.CrossFade)
 		crossFade(frontVideoBuffer, pal);
 	else
diff --git a/engines/twine/renderer/screens.h b/engines/twine/renderer/screens.h
index 13dad5a10e..a9730b875d 100644
--- a/engines/twine/renderer/screens.h
+++ b/engines/twine/renderer/screens.h
@@ -106,13 +106,13 @@ public:
 	 * Fade image in
 	 * @param palette current palette to fade in
 	 */
-	void fadeIn(uint32 *palette);
+	void fadeIn(const uint32 *palette);
 
 	/**
 	 * Fade image out
 	 * @param palette current palette to fade out
 	 */
-	void fadeOut(uint32 *palette);
+	void fadeOut(const uint32 *palette);
 
 	/**
 	 * Calculate a new color component according with an intensity


Commit: a4efeea59bccfe014bf69b1a95ed2173c518a2af
    https://github.com/scummvm/scummvm/commit/a4efeea59bccfe014bf69b1a95ed2173c518a2af
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T19:01:14+02:00

Commit Message:
TWINE: handle the screen buffer in the render methods

will get useful once they manage their dirty areas

Changed paths:
    engines/twine/renderer/renderer.cpp
    engines/twine/renderer/renderer.h


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 893ba1bcb2..ad37fcdc4e 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -488,7 +488,8 @@ void Renderer::computePolygons(int16 polyRenderType, const Vertex *vertices, int
 	}
 }
 
-void Renderer::renderPolygonsCopper(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsCopper(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int screenWidth = _engine->width();
 	const int screenHeight = _engine->height();
@@ -529,7 +530,8 @@ void Renderer::renderPolygonsCopper(uint8 *out, int vtop, int32 vsize, uint8 col
 	}
 }
 
-void Renderer::renderPolygonsBopper(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsBopper(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int screenWidth = _engine->width();
 	const int screenHeight = _engine->height();
@@ -560,7 +562,8 @@ void Renderer::renderPolygonsBopper(uint8 *out, int vtop, int32 vsize, uint8 col
 	}
 }
 
-void Renderer::renderPolygonsFlat(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsFlat(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int screenWidth = _engine->width();
 	const int screenHeight = _engine->height();
@@ -589,7 +592,8 @@ void Renderer::renderPolygonsFlat(uint8 *out, int vtop, int32 vsize, uint8 color
 	}
 }
 
-void Renderer::renderPolygonsTele(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsTele(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	int bx = (uint16)color << 16;
 	const int screenWidth = _engine->width();
@@ -666,7 +670,8 @@ void Renderer::renderPolygonsTele(uint8 *out, int vtop, int32 vsize, uint8 color
 }
 
 // FIXME: buggy
-void Renderer::renderPolygonsTras(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsTras(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int screenWidth = _engine->width();
 	const int screenHeight = _engine->height();
@@ -702,7 +707,8 @@ void Renderer::renderPolygonsTras(uint8 *out, int vtop, int32 vsize, uint8 color
 }
 
 // FIXME: buggy
-void Renderer::renderPolygonsTrame(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsTrame(int vtop, int32 vsize, uint8 color) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	unsigned char bh = 0;
 	const int screenWidth = _engine->width();
@@ -746,7 +752,8 @@ void Renderer::renderPolygonsTrame(uint8 *out, int vtop, int32 vsize, uint8 colo
 	}
 }
 
-void Renderer::renderPolygonsGouraud(uint8 *out, int vtop, int32 vsize) const {
+void Renderer::renderPolygonsGouraud(int vtop, int32 vsize) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int16 *ptr2 = &_polyTab2[vtop];
 	const int screenWidth = _engine->width();
@@ -845,7 +852,8 @@ void Renderer::renderPolygonsGouraud(uint8 *out, int vtop, int32 vsize) const {
 	}
 }
 
-void Renderer::renderPolygonsDither(uint8 *out, int vtop, int32 vsize) const {
+void Renderer::renderPolygonsDither(int vtop, int32 vsize) const {
+	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int16 *ptr1 = &_polyTab[vtop];
 	const int16 *ptr2 = &_polyTab2[vtop];
 	const int screenWidth = _engine->width();
@@ -977,42 +985,41 @@ void Renderer::renderPolygonsDither(uint8 *out, int vtop, int32 vsize) const {
 	}
 }
 
-void Renderer::renderPolygonsMarble(uint8 *out, int vtop, int32 vsize, uint8 color) const {
+void Renderer::renderPolygonsMarble(int vtop, int32 vsize, uint8 color) const {
 }
 
 void Renderer::renderPolygons(const CmdRenderPolygon &polygon, Vertex *vertices, int vtop, int vbottom) {
 	computePolygons(polygon.renderType, vertices, polygon.numVertices);
 
-	uint8 *out = (uint8 *)_engine->frontVideoBuffer.getBasePtr(0, vtop);
 	const int32 vsize = vbottom - vtop + 1;
 
 	switch (polygon.renderType) {
 	case POLYGONTYPE_FLAT:
-		renderPolygonsFlat(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsFlat(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_COPPER:
-		renderPolygonsCopper(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsCopper(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_BOPPER:
-		renderPolygonsBopper(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsBopper(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_TELE:
-		renderPolygonsTele(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsTele(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_TRAS:
-		renderPolygonsTras(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsTras(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_TRAME:
-		renderPolygonsTrame(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsTrame(vtop, vsize, polygon.colorIndex);
 		break;
 	case POLYGONTYPE_GOURAUD:
-		renderPolygonsGouraud(out, vtop, vsize);
+		renderPolygonsGouraud(vtop, vsize);
 		break;
 	case POLYGONTYPE_DITHER:
-		renderPolygonsDither(out, vtop, vsize);
+		renderPolygonsDither(vtop, vsize);
 		break;
 	case POLYGONTYPE_MARBLE:
-		renderPolygonsMarble(out, vtop, vsize, polygon.colorIndex);
+		renderPolygonsMarble(vtop, vsize, polygon.colorIndex);
 		break;
 	default:
 		warning("RENDER WARNING: Unsupported render type %d", polygon.renderType);
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 346c5b7b4d..abee470d0b 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -178,15 +178,15 @@ private:
 
 	bool _isUsingOrthoProjection = false;
 
-	void renderPolygonsCopper(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsBopper(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsFlat(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsTele(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsTras(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsTrame(uint8 *out, int vtop, int32 vsize, uint8 color) const;
-	void renderPolygonsGouraud(uint8 *out, int vtop, int32 vsize) const;
-	void renderPolygonsDither(uint8 *out, int vtop, int32 vsize) const;
-	void renderPolygonsMarble(uint8 *out, int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsCopper(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsBopper(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsFlat(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsTele(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsTras(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsTrame(int vtop, int32 vsize, uint8 color) const;
+	void renderPolygonsGouraud(int vtop, int32 vsize) const;
+	void renderPolygonsDither(int vtop, int32 vsize) const;
+	void renderPolygonsMarble(int vtop, int32 vsize, uint8 color) const;
 
 	void computePolygons(int16 polyRenderType, const Vertex *vertices, int32 numVertices);
 


Commit: 24d3fa785f3a0e275d68f9c68999b68b8c270e66
    https://github.com/scummvm/scummvm/commit/24d3fa785f3a0e275d68f9c68999b68b8c270e66
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-06-03T21:07:29+02:00

Commit Message:
TWINE: already set in centerOnActor

Changed paths:
    engines/twine/scene/scene.cpp


diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index d9970c8dfc..d22747f51c 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -558,7 +558,6 @@ void Scene::changeScene() {
 	_engine->_movements->heroMoved = true;
 	_engine->_grid->useCellingGrid = -1;
 	_engine->_grid->cellingGridIdx = -1;
-	_engine->_redraw->reqBgRedraw = true;
 	_engine->_screens->lockPalette = false;
 
 	needChangeScene = -1;




More information about the Scummvm-git-logs mailing list