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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Oct 4 13:59:30 CEST 2009


Revision: 44604
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44604&view=rev
Author:   fingolfin
Date:     2009-10-04 11:59:29 +0000 (Sun, 04 Oct 2009)

Log Message:
-----------
SCI: Fixing a bunch of warnings; change 'intencity' -> 'intensity';
properly init a sciPalette via memset

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui_font.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp
    scummvm/trunk/engines/sci/gui/gui_helpers.h
    scummvm/trunk/engines/sci/gui/gui_picture.cpp
    scummvm/trunk/engines/sci/gui/gui_view.cpp
    scummvm/trunk/engines/sci/gui32/gui32.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -424,7 +424,6 @@
 	}
 
 	// old code, may be removed later after class migration
-	GfxPort *port = s->port;
 	int redraw_port = 0;
 	rect_t area;
 	area = gfx_rect(argv[2].toSint16(), argv[1].toSint16() , argv[4].toSint16(), argv[3].toSint16());

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -327,12 +327,11 @@
 
 void SciGUI::moveCursor(int16 x, int16 y) {
 	Common::Point newPos;
-	sciPort *curPort = _gfx->GetPort();
 	
 	x += _windowMgr->_picWind->rect.left;
 	y += _windowMgr->_picWind->rect.top;
-	newPos.x = CLIP<int16> (x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
-	newPos.y = CLIP<int16> (y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
+	newPos.x = CLIP<int16>(x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
+	newPos.y = CLIP<int16>(y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
 
 	gfxop_set_pointer_position(_s->gfx_state, newPos);
 }

Modified: scummvm/trunk/engines/sci/gui/gui_font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_font.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui_font.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -83,7 +83,6 @@
 	int charWidth = MIN<int>(getCharWidth(chr), _screen->_width - left);
 	int charHeight = MIN<int>(getCharHeight(chr), 200 - top);
 	byte b = 0, mask = 0xFF;
-	int pitch = _screen->_width;
 	int y = top;
 
 	byte *pIn = getCharData(chr);

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -37,8 +37,6 @@
 
 namespace Sci {
 
-static uint32 _sysTicks;
-
 SciGUIgfx::SciGUIgfx(OSystem *system, EngineState *state, SciGUIscreen *screen)
 	: _system(system), _s(state), _screen(screen) {
 	init();
@@ -51,8 +49,6 @@
 }
 
 void SciGUIgfx::init() {
-	uint16 a = 0;
-
 	_font = NULL;
 	_textFonts = NULL; _textFontsCount = 0;
 	_textColors = NULL; _textColorsCount = 0;
@@ -81,7 +77,7 @@
 		_sysPalette.colors[i].r = 0;
 		_sysPalette.colors[i].g = 0;
 		_sysPalette.colors[i].b = 0;
-		_sysPalette.intencity[i] = 100;
+		_sysPalette.intensity[i] = 100;
 		_sysPalette.mapping[i] = i;
 	}
 	_sysPalette.colors[0].used = 1;
@@ -100,7 +96,7 @@
 	};
 
 	// Init _clrPowers used in MatchColor
-	for(int16 i = 0; i < 256; i++)
+	for(i = 0; i < 256; i++)
 	  _clrPowers[i] = i*i;
 }
 
@@ -115,7 +111,7 @@
 	((SciGUIgfx *)ref)->_sysTicks++;
 }
 
-sciPort *SciGUIgfx::mallocPort () {
+sciPort *SciGUIgfx::mallocPort() {
 	sciPort *newPort = (sciPort *)malloc(sizeof(sciPort));
 	assert(newPort);
 	memset(newPort, 0, sizeof(sciPort));
@@ -198,11 +194,6 @@
 
 bool SciGUIgfx::SetResPalette(int16 resourceNo, int16 flag) {
 	Resource *palResource = _s->resMan->findResource(ResourceId(kResourceTypePalette, resourceNo), 0);
-	int palFormat = 0;
-	int palOffset = 0;
-	int palColorStart = 0;
-	int palColorCount = 0;
-	int colorNo = 0;
 	sciPalette palette;
 
 	if (palResource) {
@@ -299,9 +290,9 @@
 	for (int16 i = 0; i < 256; i++) {
 		if (!pal->colors[i].used)
 			continue;
-		bpal[i * 4] = pal->colors[i].r * pal->intencity[i] / 100;
-		bpal[i * 4 + 1] = pal->colors[i].g * pal->intencity[i] / 100;
-		bpal[i * 4 + 2] = pal->colors[i].b * pal->intencity[i] / 100;
+		bpal[i * 4] = pal->colors[i].r * pal->intensity[i] / 100;
+		bpal[i * 4 + 1] = pal->colors[i].g * pal->intensity[i] / 100;
+		bpal[i * 4 + 2] = pal->colors[i].b * pal->intensity[i] / 100;
 		bpal[i * 4 + 3] = 100;
 	}
 	_system->setPalette(bpal, 0, 256);
@@ -418,8 +409,6 @@
 
 	int16 oldPenMode = _curPort->penMode;
 	OffsetRect(r);
-	int16 w = r.width();
-	int16 h = r.height();
 	int16 x, y;
 	byte curVisual;
 
@@ -780,7 +769,6 @@
 	int16 hline = 0;
 	sciResourceId orgFontId = GetFontId();
 	int16 orgPenColor = _curPort->penClr;
-	int16 rectWidth = rect.width();
 
 	if (fontId != -1)
 		SetFont(fontId);
@@ -827,11 +815,9 @@
 		return;
 
 	OffsetRect(rect);
-	uint16 w = rect.width();
-	uint16 h = rect.height();
 	assert((flags&0x8000) == 0);
 	_screen->UpdateWhole();
-//	_system->copyRectToScreen(GetSegment(flags) + _baseTable[rect.top] + rect.left, 320, rect.left, rect.top, w, h);
+//	_system->copyRectToScreen(GetSegment(flags) + _baseTable[rect.top] + rect.left, 320, rect.left, rect.top, rect.width(), rect.height());
 //	_system->updateScreen();
 }
 

Modified: scummvm/trunk/engines/sci/gui/gui_helpers.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_helpers.h	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui_helpers.h	2009-10-04 11:59:29 UTC (rev 44604)
@@ -95,7 +95,7 @@
 	byte mapping[256];
 	uint32 timestamp;
 	sciColor colors[256];
-	byte intencity[256];
+	byte intensity[256];
 };
 
 struct sciPalSched {

Modified: scummvm/trunk/engines/sci/gui/gui_picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_picture.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui_picture.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -159,7 +159,7 @@
 
 	y += _curPort->top;
 
-	uint16 j = 0, lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
+	uint16 lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
 	byte b, brun;
 
 	while (y < lasty && ptr < pend) {
@@ -213,7 +213,7 @@
 
 	y += _curPort->top;
 
-	uint16 j = 0, lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
+	uint16 lasty = MIN<int16>(height + y, _curPort->rect.bottom) + _curPort->top;
 	byte op, col, bytes;
 	while (y < lasty && ptr < pend) {
 		op = *ptr++;
@@ -283,7 +283,7 @@
 #define PIC_EGAPALETTE_SIZE  40
 #define PIC_EGAPALETTE_TOTALSIZE PIC_EGAPALETTE_COUNT*PIC_EGAPALETTE_SIZE
 
-const byte vector_defaultEGApalette[PIC_EGAPALETTE_SIZE] = {
+static const byte vector_defaultEGApalette[PIC_EGAPALETTE_SIZE] = {
 	0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
 	0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88,
 	0x88, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x88,
@@ -296,17 +296,18 @@
 	byte pic_color = 0, pic_priority = 0x0F, pic_control = 0x0F;
 	int16 x = 0, y = 0, oldx, oldy;
 	byte EGApalette = 0;
-	byte EGAindex = 0;
 	byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0};
 	bool EGAmapping = false;
 	int curPos = 0;
 	uint16 size;
 	byte byte;
 	int i;
-	sciPalette palette = {0};
+	sciPalette palette;
 	int16 pattern_Code = 0, pattern_Texture = 0;
 	bool sci1 = false;
 
+	memset(&palette, 0, sizeof(palette));
+
 	if (_EGApaletteNo >= PIC_EGAPALETTE_COUNT)
 		_EGApaletteNo = 0;
 

Modified: scummvm/trunk/engines/sci/gui/gui_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-04 11:59:29 UTC (rev 44604)
@@ -168,21 +168,21 @@
 
 int16 SciGUIview::getWidth(uint16 loopNo, uint16 cellNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
-	if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+	if (cellNo >= _loop[loopNo].cellCount)
 		cellNo = 0;
 	return _loopCount ? _loop[loopNo].cell[cellNo].width : 0;
 }
 
 int16 SciGUIview::getHeight(uint16 loopNo, uint16 cellNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
-	if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+	if (cellNo >= _loop[loopNo].cellCount)
 		cellNo = 0;
 	return _loopCount ? _loop[loopNo].cell[cellNo].height : 0;
 }
 
 sciViewCellInfo *SciGUIview::getCellInfo(uint16 loopNo, uint16 cellNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
-	if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+	if (cellNo >= _loop[loopNo].cellCount)
 		cellNo = 0;
 	return _loopCount ? &_loop[loopNo].cell[cellNo] : NULL;
 }
@@ -234,7 +234,7 @@
 
 byte *SciGUIview::getBitmap(uint16 loopNo, uint16 cellNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
-	if (cellNo < 0 || cellNo >= _loop[loopNo].cellCount)
+	if (cellNo >= _loop[loopNo].cellCount)
 		cellNo = 0;
 	if (_loop[loopNo].cell[cellNo].rawBitmap)
 		return _loop[loopNo].cell[cellNo].rawBitmap;

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-04 11:58:52 UTC (rev 44603)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-04 11:59:29 UTC (rev 44604)
@@ -31,7 +31,7 @@
 	~SciGUI32();
 
 	// FIXME: Don't store EngineState
-	virtual void resetEngineState(EngineState *s) { this->s = s; }
+	virtual void resetEngineState(EngineState *newState) { s = newState; }
 
 	void init(bool oldGfxFunctions);
 


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