diff options
| author | Max Horn | 2011-05-09 14:41:49 +0200 | 
|---|---|---|
| committer | Max Horn | 2011-05-09 14:41:49 +0200 | 
| commit | 76cf7bc907f7d8dafaddd01a42c843c6a06cd5f2 (patch) | |
| tree | f2a99063ec926451c47b8e0433ca45db70ccb806 | |
| parent | b4058a696ab507991b6b8c8cf6c0bdd9cb5c714f (diff) | |
| download | scummvm-rg350-76cf7bc907f7d8dafaddd01a42c843c6a06cd5f2.tar.gz scummvm-rg350-76cf7bc907f7d8dafaddd01a42c843c6a06cd5f2.tar.bz2 scummvm-rg350-76cf7bc907f7d8dafaddd01a42c843c6a06cd5f2.zip | |
SCI: Slight cleanup to undithering code
| -rw-r--r-- | engines/sci/console.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/graphics/picture.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/graphics/screen.cpp | 10 | ||||
| -rw-r--r-- | engines/sci/graphics/screen.h | 39 | ||||
| -rw-r--r-- | engines/sci/sci.cpp | 2 | 
5 files changed, 32 insertions, 23 deletions
| diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 60bd129efc..419f5e1415 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1532,7 +1532,7 @@ bool Console::cmdUndither(int argc, const char **argv) {  	}  	bool flag = atoi(argv[1]) ? true : false; -	_engine->_gfxScreen->debugUnditherSetState(flag); +	_engine->_gfxScreen->enableUndithering(flag);  	if (flag)  		DebugPrintf("undithering ENABLED\n");  	else diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 82aae5399f..7209084446 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -512,7 +512,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {  			// WORKAROUND: we remove certain visual&priority lines in underwater rooms of iceman, when not dithering the  			//              picture. Normally those lines aren't shown, because they share the same color as the dithered  			//              fill color combination. When not dithering, those lines would appear and get distracting. -			if ((_screen->getUnditherState()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61))) +			if ((_screen->isUnditheringEnabled()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61)))  				icemanDrawFix = true;  		}  		if (g_sci->getGameId() == GID_KQ5) { diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index f619780c7c..aa4ee0b638 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -111,7 +111,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {  	_picNotValid = 0;  	_picNotValidSci11 = 0; -	_unditherState = true; +	_unditheringEnabled = true;  	_fontIsUpscaled = false;  	if (_resMan->getViewType() != kViewEga) { @@ -560,7 +560,7 @@ void GfxScreen::dither(bool addToFlag) {  	byte *visualPtr = _visualScreen;  	byte *displayPtr = _displayScreen; -	if (!_unditherState) { +	if (!_unditheringEnabled) {  		// Do dithering on visual and display-screen  		for (y = 0; y < _height; y++) {  			for (x = 0; x < _width; x++) { @@ -624,12 +624,12 @@ void GfxScreen::ditherForceDitheredColor(byte color) {  	_ditheredPicColors[color] = 256;  } -void GfxScreen::debugUnditherSetState(bool flag) { -	_unditherState = flag; +void GfxScreen::enableUndithering(bool flag) { +	_unditheringEnabled = flag;  }  int16 *GfxScreen::unditherGetDitheredBgColors() { -	if (_unditherState) +	if (_unditheringEnabled)  		return (int16 *)&_ditheredPicColors;  	else  		return NULL; diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 89ad52e0ac..bfe0a50b81 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -95,9 +95,10 @@ public:  		return _upscaledHires;  	} -	bool getUnditherState() const { -		return _unditherState; +	bool isUnditheringEnabled() const { +		return _unditheringEnabled;  	} +	void enableUndithering(bool flag);  	void putKanjiChar(Graphics::FontSJIS *commonFont, int16 x, int16 y, uint16 chr, byte color);  	byte getVisual(int x, int y); @@ -119,7 +120,6 @@ public:  	// Force a color combination as a dithered color  	void ditherForceDitheredColor(byte color); -	void debugUnditherSetState(bool flag);  	int16 *unditherGetDitheredBgColors();  	void debugShowMap(int mapNo); @@ -151,7 +151,10 @@ private:  	void setVerticalShakePos(uint16 shakePos); -	bool _unditherState; +	/** +	 * If this flag is true, undithering is enabled, otherwise disabled. +	 */ +	bool _unditheringEnabled;  	int16 _ditheredPicColors[DITHERED_BG_COLORS_SIZE];  	// These screens have the real resolution of the game engine (320x200 for @@ -161,13 +164,13 @@ private:  	byte *_priorityScreen;  	byte *_controlScreen; -	// This screen is the one that is actually displayed to the user. It may be -	// 640x400 for japanese SCI1 games. SCI0 games may be undithered in here. -	// Only read from this buffer for Save/ShowBits usage. +	/** +	 * This screen is the one that is actually displayed to the user. It may be +	 * 640x400 for japanese SCI1 games. SCI0 games may be undithered in here. +	 * Only read from this buffer for Save/ShowBits usage. +	 */  	byte *_displayScreen; -	Common::Rect getScaledRect(Common::Rect rect); -  	ResourceManager *_resMan;  	/** @@ -176,16 +179,22 @@ private:  	 */  	byte *_activeScreen; -	// This variable defines, if upscaled hires is active and what upscaled mode -	// is used. +	/** +	 * This variable defines, if upscaled hires is active and what upscaled mode +	 * is used. +	 */  	GfxScreenUpscaledMode _upscaledHires; -	// This here holds a translation for vertical coordinates between native -	// (visual) and actual (display) screen. +	/** +	 * This here holds a translation for vertical coordinates between native +	 * (visual) and actual (display) screen. +	 */  	int _upscaledMapping[SCI_SCREEN_UPSCALEDMAXHEIGHT + 1]; -	// This defines whether or not the font we're drawing is already scaled -	// to the screen size (and we therefore should not upscale it ourselves). +	/** +	 * This defines whether or not the font we're drawing is already scaled +	 * to the screen size (and we therefore should not upscale it ourselves). +	 */  	bool _fontIsUpscaled;  	uint16 getLowResScreenHeight(); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 85c2eced19..8a81ea7240 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -218,7 +218,7 @@ Common::Error SciEngine::run() {  	// Initialize the game screen  	_gfxScreen = new GfxScreen(_resMan); -	_gfxScreen->debugUnditherSetState(ConfMan.getBool("disable_dithering")); +	_gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering"));  	// Create debugger console. It requires GFX to be initialized  	_console = new Console(this); | 
