[Scummvm-cvs-logs] SF.net SVN: scummvm:[38304] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Feb 15 22:20:21 CET 2009


Revision: 38304
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38304&view=rev
Author:   lordhoto
Date:     2009-02-15 21:20:21 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
- Replace OSystem::clearScreen with OSystem::fillScreen as discussed on -devel.
- Update BaseBackend and DC port to properly implement OSystem::fillScreen (now only PalmOS has to be updated).
- Update all client code which relied on OSystem::clearScreen so far.

Modified Paths:
--------------
    scummvm/trunk/backends/base-backend.cpp
    scummvm/trunk/backends/base-backend.h
    scummvm/trunk/backends/platform/dc/dc.h
    scummvm/trunk/backends/platform/dc/display.cpp
    scummvm/trunk/base/main.cpp
    scummvm/trunk/common/system.h
    scummvm/trunk/engines/agos/draw.cpp
    scummvm/trunk/engines/drascula/rooms.cpp
    scummvm/trunk/engines/gob/video.cpp
    scummvm/trunk/engines/groovie/script.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/sword1/screen.cpp
    scummvm/trunk/engines/tinsel/graphics.cpp
    scummvm/trunk/engines/tucker/sequences.cpp
    scummvm/trunk/graphics/video/video_player.cpp
    scummvm/trunk/sound/softsynth/mt32.cpp

Modified: scummvm/trunk/backends/base-backend.cpp
===================================================================
--- scummvm/trunk/backends/base-backend.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/backends/base-backend.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -45,10 +45,10 @@
 	return s_eventManager;
 }
 
-void BaseBackend::clearScreen() {
+void BaseBackend::fillScreen(uint32 col) {
 	Graphics::Surface *screen = lockScreen();
 	if (screen && screen->pixels)
-		memset(screen->pixels, 0, screen->h * screen->pitch);
+		memset(screen->pixels, col, screen->h * screen->pitch);
 	unlockScreen();
 }
 

Modified: scummvm/trunk/backends/base-backend.h
===================================================================
--- scummvm/trunk/backends/base-backend.h	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/backends/base-backend.h	2009-02-15 21:20:21 UTC (rev 38304)
@@ -33,7 +33,7 @@
 public:
 	virtual Common::EventManager *getEventManager();
 	virtual void displayMessageOnOSD(const char *msg);
-	virtual void clearScreen();
+	virtual void fillScreen(uint32 col);
 
 	virtual Common::SeekableReadStream *createConfigReadStream();
 	virtual Common::WriteStream *createConfigWriteStream();

Modified: scummvm/trunk/backends/platform/dc/dc.h
===================================================================
--- scummvm/trunk/backends/platform/dc/dc.h	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/backends/platform/dc/dc.h	2009-02-15 21:20:21 UTC (rev 38304)
@@ -88,8 +88,8 @@
 	virtual Graphics::Surface *lockScreen();
 	virtual void unlockScreen();
 
-  // Clear the screen to black.
-  void clearScreen();
+  // Fill the screen with a given color
+  void fillScreen(uint32 col);
 
   // Update the dirty areas of the screen
   void updateScreen();

Modified: scummvm/trunk/backends/platform/dc/display.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/display.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/backends/platform/dc/display.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -626,9 +626,9 @@
   _screen_dirty = true;
 }
 
-void OSystem_Dreamcast::clearScreen()
+void OSystem_Dreamcast::fillScreen(uint32 col)
 {
-  memset(screen, 0, SCREEN_W*SCREEN_H);
+  memset(screen, col, SCREEN_W*SCREEN_H);
   _screen_dirty = true;
 }
 

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/base/main.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -239,7 +239,7 @@
 	system.setWindowCaption(gScummVMFullVersion);
 
 	// Clear the main screen
-	system.clearScreen();
+	system.fillScreen(0);
 }
 
 

Modified: scummvm/trunk/common/system.h
===================================================================
--- scummvm/trunk/common/system.h	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/common/system.h	2009-02-15 21:20:21 UTC (rev 38304)
@@ -512,9 +512,13 @@
 	virtual void unlockScreen() = 0;
 
 	/**
-	 * Clear the screen to black.
+	 * Fills the screen with a given color value.
+	 *
+	 * @note We are using uint32 here even though currently
+	 * we only support 8bpp indexed mode. Thus the value should
+	 * be always inside [0, 255] for now.
 	 */
-	virtual void clearScreen() = 0;
+	virtual void fillScreen(uint32 col) = 0;
 
 	/**
 	 * Flush the whole screen, that is render the current content of the screen

Modified: scummvm/trunk/engines/agos/draw.cpp
===================================================================
--- scummvm/trunk/engines/agos/draw.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/agos/draw.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -710,7 +710,7 @@
 }
 
 void AGOSEngine::clearSurfaces() {
-	_system->clearScreen();
+	_system->fillScreen(0);
 
 	if (_backBuf) {
 		memset(_backBuf, 0, _screenHeight * _screenWidth);

Modified: scummvm/trunk/engines/drascula/rooms.cpp
===================================================================
--- scummvm/trunk/engines/drascula/rooms.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/drascula/rooms.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -1867,7 +1867,7 @@
 
 void DrasculaEngine::clearRoom() {
 	memset(VGA, 0, 64000);
-	_system->clearScreen();
+	_system->fillScreen(0);
 	_system->updateScreen();
 }
 

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/gob/video.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -177,7 +177,7 @@
 }
 
 void Video::clearScreen() {
-	g_system->clearScreen();
+	g_system->fillScreen(0);
 }
 
 void Video::setSize(bool defaultTo1XScaler) {

Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/groovie/script.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -1023,7 +1023,7 @@
 	debugScript(1, true, "LOADGAME var[0x%04X] -> slot=%d (TODO)", varnum, slot);
 
 	loadgame(slot);
-	_vm->_system->clearScreen();
+	_vm->_system->fillScreen(0);
 }
 
 void Script::o_savegame() {

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -337,7 +337,7 @@
 			_backBuffer.fillRect(r, 0);
 		}
 	} else {
-		_vm->_system->clearScreen();
+		_vm->_system->fillScreen(0);
 	}
 }
 

Modified: scummvm/trunk/engines/sword1/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword1/screen.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/sword1/screen.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -70,7 +70,7 @@
 	if (_screenBuf) {
 		_fullRefresh = true;
 		memset(_screenBuf, 0, _scrnSizeX * _scrnSizeY);
-		_system->clearScreen();
+		_system->fillScreen(0);
 	}
 }
 

Modified: scummvm/trunk/engines/tinsel/graphics.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/graphics.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/tinsel/graphics.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -493,7 +493,7 @@
 void ClearScreen() {
 	void *pDest = _vm->screen().getBasePtr(0, 0);
 	memset(pDest, 0, SCREEN_WIDTH * SCREEN_HEIGHT);
-	g_system->clearScreen();
+	g_system->fillScreen(0);
 	g_system->updateScreen();
 }
 

Modified: scummvm/trunk/engines/tucker/sequences.cpp
===================================================================
--- scummvm/trunk/engines/tucker/sequences.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/engines/tucker/sequences.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -870,7 +870,7 @@
 		}
 		_system->delayMillis(1000 / 60);
 	}
-	_system->clearScreen();
+	_system->fillScreen(0);
 }
 
 void AnimationSequencePlayer::unloadAnimation() {

Modified: scummvm/trunk/graphics/video/video_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/video_player.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/graphics/video/video_player.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -187,7 +187,7 @@
 	_skipVideo = false;
 	debug(0, "Playing video");
 
-	g_system->clearScreen();
+	g_system->fillScreen(0);
 
 	int frameX = (g_system->getWidth() - _decoder->getWidth()) / 2;
 	int frameY = (g_system->getHeight() - _decoder->getHeight()) / 2;

Modified: scummvm/trunk/sound/softsynth/mt32.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32.cpp	2009-02-15 21:12:21 UTC (rev 38303)
+++ scummvm/trunk/sound/softsynth/mt32.cpp	2009-02-15 21:20:21 UTC (rev 38304)
@@ -285,7 +285,7 @@
 	if (!_synth->open(prop))
 		return MERR_DEVICE_NOT_AVAILABLE;
 	_initialising = false;
-	g_system->clearScreen();
+	g_system->fillScreen(0);
 	g_system->updateScreen();
 	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_handle, this, -1, 255, 0, false, true);
 	return 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list