[Scummvm-cvs-logs] SF.net SVN: scummvm:[44766] scummvm/trunk/engines/sci/gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Oct 8 00:53:32 CEST 2009


Revision: 44766
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44766&view=rev
Author:   fingolfin
Date:     2009-10-07 22:53:32 +0000 (Wed, 07 Oct 2009)

Log Message:
-----------
SCI: Get rid of SciGuiScreen::initScreen, also known as 'calloc' elsewhere ;)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_screen.cpp
    scummvm/trunk/engines/sci/gui/gui_screen.h

Modified: scummvm/trunk/engines/sci/gui/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-07 22:50:11 UTC (rev 44765)
+++ scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-07 22:53:32 UTC (rev 44766)
@@ -46,10 +46,10 @@
 	_displayHeight = _height * scaleFactor;
 	_displayPixels = _displayWidth * _displayHeight;
 
-	_visualScreen = initScreen(_pixels);
-	_priorityScreen = initScreen(_pixels);
-	_controlScreen = initScreen(_pixels);
-	_displayScreen = initScreen(_displayPixels);
+	_visualScreen = (byte *)calloc(_pixels, 1);
+	_priorityScreen = (byte *)calloc(_pixels, 1);
+	_controlScreen = (byte *)calloc(_pixels, 1);
+	_displayScreen = (byte *)calloc(_displayPixels, 1);
 
 	// Sets display screen to be actually displayed
 	_activeScreen = _displayScreen;
@@ -70,12 +70,6 @@
 	free(_displayScreen);
 }
 
-byte *SciGuiScreen::initScreen(uint16 pixelCount) {
-	byte *screen = (byte *)malloc(pixelCount);
-	memset(screen, 0, pixelCount);
-	return screen;
-}
-
 void SciGuiScreen::copyToScreen() {
 	g_system->copyRectToScreen(_activeScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight);
 }

Modified: scummvm/trunk/engines/sci/gui/gui_screen.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.h	2009-10-07 22:50:11 UTC (rev 44765)
+++ scummvm/trunk/engines/sci/gui/gui_screen.h	2009-10-07 22:53:32 UTC (rev 44766)
@@ -44,8 +44,6 @@
 	SciGuiScreen(int16 width = 320, int16 height = 200, int16 scaleFactor = 1);
 	~SciGuiScreen();
 
-	byte *initScreen(uint16 pixelCount);
-
 	void copyToScreen();
 
 	byte getDrawingMask(byte color, byte prio, byte control);


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