[Scummvm-cvs-logs] scummvm master -> 57a53420c366d327581cee72181bd6bed8d8e7c7

csnover csnover at users.noreply.github.com
Sun Jul 3 05:29:49 CEST 2016


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

Summary:
07b72c9fec SCI32: Document ScreenItem::_insetRect
77991b7eac SCI32: Add const to getCurrentBuffer
a4c059b864 SCI32: Improve accuracy of frameout throttler
da48b1bbea SCI32: Document _remapOccurred flag
57a53420c3 SCI32: Expose graphics throttling code


Commit: 07b72c9fec70312786b0ed1784b946bf21859e80
    https://github.com/scummvm/scummvm/commit/07b72c9fec70312786b0ed1784b946bf21859e80
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-07-02T22:28:37-05:00

Commit Message:
SCI32: Document ScreenItem::_insetRect

Changed paths:
    engines/sci/graphics/screen_item32.h



diff --git a/engines/sci/graphics/screen_item32.h b/engines/sci/graphics/screen_item32.h
index 2e44e41..caa7a9d 100644
--- a/engines/sci/graphics/screen_item32.h
+++ b/engines/sci/graphics/screen_item32.h
@@ -88,15 +88,23 @@ private:
 	Common::Rect _screenItemRect;
 
 	/**
-	 * TODO: Document
+	 * If true, the `_insetRect` rectangle will be used
+	 * when calculating the dimensions of the screen item
+	 * instead of the cel's intrinsic width and height.
+	 *
+	 * In other words, using an inset rect means that
+	 * the cel is cropped to the dimensions given in
+	 * `_insetRect`.
 	 */
 	bool _useInsetRect;
 
 	/**
-	 * TODO: Documentation
-	 * The insetRect is also used to describe the fill
-	 * rectangle of a screen item that is drawn using
-	 * CelObjColor.
+	 * The cropping rectangle used when `_useInsetRect`
+	 * is true.
+	 *
+	 * `_insetRect` is also used to describe the fill
+	 * rectangle of a screen item with a CelObjColor
+	 * cel.
 	 */
 	Common::Rect _insetRect;
 


Commit: 77991b7eac85051978bf1c09dd4d0710ac3929ef
    https://github.com/scummvm/scummvm/commit/77991b7eac85051978bf1c09dd4d0710ac3929ef
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-07-02T22:28:41-05:00

Commit Message:
SCI32: Add const to getCurrentBuffer

Changed paths:
    engines/sci/event.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 34f1618..4ad2a0c 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -166,7 +166,7 @@ SciEvent EventManager::getScummVMEvent() {
 
 #if ENABLE_SCI32
 	if (getSciVersion() >= SCI_VERSION_2) {
-		Buffer &screen = g_sci->_gfxFrameout->getCurrentBuffer();
+		const Buffer &screen = g_sci->_gfxFrameout->getCurrentBuffer();
 
 		Common::Point mousePosSci = mousePos;
 		mulru(mousePosSci, Ratio(screen.scriptWidth, screen.screenWidth), Ratio(screen.scriptHeight, screen.screenHeight));
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index e736872..4a44410 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -423,7 +423,7 @@ public:
 	 */
 	bool _palMorphIsOn;
 
-	inline Buffer &getCurrentBuffer() {
+	inline const Buffer &getCurrentBuffer() const {
 		return _currentBuffer;
 	}
 


Commit: a4c059b8641e8fe170ac1f829e56a4d0e98fa455
    https://github.com/scummvm/scummvm/commit/a4c059b8641e8fe170ac1f829e56a4d0e98fa455
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-07-02T22:28:47-05:00

Commit Message:
SCI32: Improve accuracy of frameout throttler

Changed paths:
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 140c27a..50f2647 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -76,6 +76,7 @@ GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAd
 	_benchmarkingFinished(false),
 	_throttleFrameOut(true),
 	_showStyles(nullptr),
+	_throttleState(0),
 	// TODO: Stop using _gfxScreen
 	_currentBuffer(screen->getDisplayWidth(), screen->getDisplayHeight(), nullptr),
 	_remapOccurred(false),
@@ -1567,7 +1568,16 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) {
 	}
 
 	if (_throttleFrameOut) {
-		g_sci->getEngineState()->speedThrottler(16);
+		uint8 throttleTime;
+		if (_throttleState == 2) {
+			throttleTime = 17;
+			_throttleState = 0;
+		} else {
+			throttleTime = 16;
+			++_throttleState;
+		}
+
+		g_sci->getEngineState()->speedThrottler(throttleTime);
 		g_sci->getEngineState()->_throttleTrigger = true;
 	}
 }
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 4a44410..d349bbe 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -304,6 +304,12 @@ public:
 #pragma mark Rendering
 private:
 	/**
+	 * State tracker to provide more accurate 60fps
+	 * video throttling.
+	 */
+	uint8 _throttleState;
+
+	/**
 	 * TODO: Documentation
 	 */
 	int8 _styleRanges[256];


Commit: da48b1bbea94e8ae83b51125c998ff27a4358ddd
    https://github.com/scummvm/scummvm/commit/da48b1bbea94e8ae83b51125c998ff27a4358ddd
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-07-02T22:28:53-05:00

Commit Message:
SCI32: Document _remapOccurred flag

Changed paths:
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index d349bbe..05c48c3 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -324,7 +324,9 @@ private:
 	Buffer _currentBuffer;
 
 	/**
-	 * TODO: Documentation
+	 * When true, a change to the remap zone in the palette
+	 * has occurred and screen items with remap data need to
+	 * be redrawn.
 	 */
 	bool _remapOccurred;
 


Commit: 57a53420c366d327581cee72181bd6bed8d8e7c7
    https://github.com/scummvm/scummvm/commit/57a53420c366d327581cee72181bd6bed8d8e7c7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-07-02T22:29:28-05:00

Commit Message:
SCI32: Expose graphics throttling code

Controls that manage their own event loops and call frameOut
directly generally need to sleep in order to avoid 100% CPU,
just like the main VM event loop.

Changed paths:
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index 6aad636..4cbb454 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -310,8 +310,7 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
 
 		g_sci->_gfxFrameout->frameOut(true);
 		g_sci->getSciDebugger()->onFrame();
-		g_sci->getEngineState()->speedThrottler(16);
-		g_sci->getEngineState()->_throttleTrigger = true;
+		g_sci->_gfxFrameout->throttle();
 	}
 
 	g_sci->_gfxFrameout->deletePlane(*plane);
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 50f2647..c0feea8 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1567,6 +1567,10 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) {
 		frameOut(shouldShowBits);
 	}
 
+	throttle();
+}
+
+void GfxFrameout::throttle() {
 	if (_throttleFrameOut) {
 		uint8 throttleTime;
 		if (_throttleState == 2) {
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 05c48c3..cc62c61 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -185,7 +185,7 @@ private:
 
 	/**
 	 * Whether or not calls to kFrameOut should be framerate
-	 * limited to ~60fps.
+	 * limited to 60fps.
 	 */
 	bool _throttleFrameOut;
 
@@ -438,6 +438,12 @@ public:
 	void kernelFrameOut(const bool showBits);
 
 	/**
+	 * Throttles the engine as necessary to maintain
+	 * 60fps output.
+	 */
+	void throttle();
+
+	/**
 	 * Updates the internal screen buffer for the next
 	 * frame. If `shouldShowBits` is true, also sends the
 	 * buffer to hardware. If `eraseRect` is non-empty,






More information about the Scummvm-git-logs mailing list