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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Feb 4 23:18:00 CET 2010


Revision: 47891
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47891&view=rev
Author:   m_kiewitz
Date:     2010-02-04 22:17:58 +0000 (Thu, 04 Feb 2010)

Log Message:
-----------
SCI: renaming class View to GfxView

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/cache.cpp
    scummvm/trunk/engines/sci/graphics/cache.h
    scummvm/trunk/engines/sci/graphics/compare.cpp
    scummvm/trunk/engines/sci/graphics/cursor.cpp
    scummvm/trunk/engines/sci/graphics/cursor.h
    scummvm/trunk/engines/sci/graphics/frameout.cpp
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui32.cpp
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/paint16.h
    scummvm/trunk/engines/sci/graphics/paint32.cpp
    scummvm/trunk/engines/sci/graphics/view.cpp
    scummvm/trunk/engines/sci/graphics/view.h

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -204,7 +204,7 @@
 	reg_t curObject;
 	AnimateEntry *listEntry;
 	uint16 signal;
-	View *view = NULL;
+	GfxView *view = NULL;
 	AnimateList::iterator listIterator;
 	AnimateList::iterator listEnd = _list.end();
 
@@ -546,7 +546,7 @@
 void GfxAnimate::addToPicDrawCels() {
 	reg_t curObject;
 	AnimateEntry *listEntry;
-	View *view = NULL;
+	GfxView *view = NULL;
 	AnimateList::iterator listIterator;
 	AnimateList::iterator listEnd = _list.end();
 
@@ -576,7 +576,7 @@
 }
 
 void GfxAnimate::addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
-	View *view = _cache->getView(viewId);
+	GfxView *view = _cache->getView(viewId);
 	Common::Rect celRect;
 
 	// Create rect according to coordinates and given cel

Modified: scummvm/trunk/engines/sci/graphics/cache.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/cache.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -73,12 +73,12 @@
 	return _cachedFonts[fontId];
 }
 
-View *GfxCache::getView(GuiResourceId viewId) {
+GfxView *GfxCache::getView(GuiResourceId viewId) {
 	if (_cachedViews.size() >= MAX_CACHED_VIEWS)
 		purgeViewCache();
 
 	if (!_cachedViews.contains(viewId))
-		_cachedViews[viewId] = new View(_resMan, _screen, _palette, viewId);
+		_cachedViews[viewId] = new GfxView(_resMan, _screen, _palette, viewId);
 
 	return _cachedViews[viewId];
 }

Modified: scummvm/trunk/engines/sci/graphics/cache.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.h	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/cache.h	2010-02-04 22:17:58 UTC (rev 47891)
@@ -33,10 +33,10 @@
 namespace Sci {
 
 class Font;
-class View;
+class GfxView;
 
 typedef Common::HashMap<int, Font *> FontCache;
-typedef Common::HashMap<int, View *> ViewCache;
+typedef Common::HashMap<int, GfxView *> ViewCache;
 
 class GfxCache {
 public:
@@ -45,7 +45,7 @@
 
 	Font *getFont(GuiResourceId fontId);
 
-	View *getView(GuiResourceId viewId);
+	GfxView *getView(GuiResourceId viewId);
 	int16 kernelViewGetCelWidth(GuiResourceId viewId, int16 loopNo, int16 celNo);
 	int16 kernelViewGetCelHeight(GuiResourceId viewId, int16 loopNo, int16 celNo);
 	int16 kernelViewGetLoopCount(GuiResourceId viewId);

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -104,7 +104,7 @@
 }
 
 void GfxCompare::SetNowSeen(reg_t objectReference) {
-	View *view = NULL;
+	GfxView *view = NULL;
 	Common::Rect celRect(0, 0);
 	GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, view);
 	int16 loopNo = sign_extend_byte((int16)GET_SEL32V(_segMan, objectReference, loop));

Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -138,9 +138,9 @@
 		purgeCache();
 
 	if (!_cachedCursors.contains(viewNum))
-		_cachedCursors[viewNum] = new View(_resMan, _screen, _palette, viewNum);
+		_cachedCursors[viewNum] = new GfxView(_resMan, _screen, _palette, viewNum);
 
-	View *cursorView = _cachedCursors[viewNum];
+	GfxView *cursorView = _cachedCursors[viewNum];
 
 	CelInfo *celInfo = cursorView->getCelInfo(loopNum, celNum);
 	int16 width = celInfo->width;

Modified: scummvm/trunk/engines/sci/graphics/cursor.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.h	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/cursor.h	2010-02-04 22:17:58 UTC (rev 47891)
@@ -35,10 +35,10 @@
 
 #define SCI_CURSOR_SCI0_TRANSPARENCYCOLOR 1
 
-class View;
-class SciPalette;
+class GfxView;
+class GfxPalette;
 
-typedef Common::HashMap<int, View *> CursorCache;
+typedef Common::HashMap<int, GfxView *> CursorCache;
 
 class Cursor {
 public:

Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -202,7 +202,7 @@
 				}
 			}
 			if (itemEntry->viewId != 0xFFFF) {
-				View *view = _cache->getView(itemEntry->viewId);
+				GfxView *view = _cache->getView(itemEntry->viewId);
 
 				if ((itemEntry->scaleX == 128) && (itemEntry->scaleY == 128)) {
 					view->getCelRect(itemEntry->loopNo, itemEntry->celNo, itemEntry->x, itemEntry->y, itemEntry->z, &itemEntry->celRect);

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -358,7 +358,7 @@
 }
 
 bool SciGui::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
-	View *tmpView = _cache->getView(viewId);
+	GfxView *tmpView = _cache->getView(viewId);
 	CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
 	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
 	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
@@ -377,7 +377,7 @@
 		int16 loopNo = GET_SEL32V(_s->_segMan, object, loop);
 		int16 celNo = GET_SEL32V(_s->_segMan, object, cel);
 
-		View *tmpView = _cache->getView(viewId);
+		GfxView *tmpView = _cache->getView(viewId);
 		Common::Rect celRect;
 
 		tmpView->getCelRect(loopNo, celNo, x, y, z, &celRect);

Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -141,7 +141,7 @@
 }
 
 bool SciGui32::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
-	View *tmpView = _cache->getView(viewId);
+	GfxView *tmpView = _cache->getView(viewId);
 	CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
 	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
 	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
@@ -161,7 +161,7 @@
 		int16 celNo = GET_SEL32V(_s->_segMan, object, cel);
 
 		if (viewId != SIGNAL_OFFSET) {
-			View *tmpView = _cache->getView(viewId);
+			GfxView *tmpView = _cache->getView(viewId);
 			Common::Rect celRect;
 
 			tmpView->getCelRect(loopNo, celNo, x, y, z, &celRect);

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -74,7 +74,7 @@
 
 // This one is the only one that updates screen!
 void GfxPaint16::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
-	View *view = _cache->getView(viewId);
+	GfxView *view = _cache->getView(viewId);
 	Common::Rect celRect;
 
 	if (view) {
@@ -102,7 +102,7 @@
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
-void GfxPaint16::drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
+void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
 	Common::Rect clipRect = celRect;
 	clipRect.clip(_ports->_curPort->rect);
 	if (clipRect.isEmpty()) // nothing to draw
@@ -120,7 +120,7 @@
 // This is used as replacement for drawCelAndShow() when hires-cels are drawn to screen
 //  Hires-cels are available only SCI 1.1+
 void GfxPaint16::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t upscaledHiresHandle, uint16 scaleX, uint16 scaleY) {
-	View *view = _cache->getView(viewId);
+	GfxView *view = _cache->getView(viewId);
 	Common::Rect celRect, curPortRect, clipRect, clipRectTranslated;
 	Common::Point curPortPos;
 	bool upscaledHiresHack = false;

Modified: scummvm/trunk/engines/sci/graphics/paint16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.h	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/paint16.h	2010-02-04 22:17:58 UTC (rev 47891)
@@ -52,7 +52,7 @@
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
 	void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
 	void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
-	void drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCel(GfxView *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
 	void drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t upscaledHiresHandle, uint16 scaleX = 128, uint16 scaleY = 128);
 
 	void clearScreen(byte color = 255);

Modified: scummvm/trunk/engines/sci/graphics/paint32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/paint32.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -65,7 +65,7 @@
 
 // This is "hacked" together, because its only used by debug command
 void GfxPaint32::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
-	View *view = _cache->getView(viewId);
+	GfxView *view = _cache->getView(viewId);
 	Common::Rect celRect(50, 50, 50, 50);
 	Common::Rect translatedRect;
 	celRect.bottom += view->getHeight(loopNo, celNo);

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-02-04 22:17:58 UTC (rev 47891)
@@ -31,13 +31,13 @@
 
 namespace Sci {
 
-View::View(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId)
+GfxView::GfxView(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId)
 	: _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) {
 	assert(resourceId != -1);
 	initData(resourceId);
 }
 
-View::~View() {
+GfxView::~GfxView() {
 	// Iterate through the loops
 	for (uint16 loopNum = 0; loopNum < _loopCount; loopNum++) {
 		// and through the cells of each loop
@@ -55,7 +55,7 @@
 	0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
 };
 
-void View::initData(GuiResourceId resourceId) {
+void GfxView::initData(GuiResourceId resourceId) {
 	_resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true);
 	if (!_resource) {
 		error("view resource %d not found", resourceId);
@@ -227,34 +227,34 @@
 	}
 }
 
-GuiResourceId View::getResourceId() {
+GuiResourceId GfxView::getResourceId() {
 	return _resourceId;
 }
 
-int16 View::getWidth(int16 loopNo, int16 celNo) {
+int16 GfxView::getWidth(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? _loop[loopNo].cel[celNo].width : 0;
 }
 
-int16 View::getHeight(int16 loopNo, int16 celNo) {
+int16 GfxView::getHeight(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? _loop[loopNo].cel[celNo].height : 0;
 }
 
-CelInfo *View::getCelInfo(int16 loopNo, int16 celNo) {
+CelInfo *GfxView::getCelInfo(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? &_loop[loopNo].cel[celNo] : NULL;
 }
 
-LoopInfo *View::getLoopInfo(int16 loopNo) {
+LoopInfo *GfxView::getLoopInfo(int16 loopNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	return _loopCount ? &_loop[loopNo] : NULL;
 }
 
-void View::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
+void GfxView::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	if (celInfo) {
 		outRect->left = x + celInfo->displaceX - (celInfo->width >> 1);
@@ -264,7 +264,7 @@
 	}
 }
 
-void View::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect *outRect) {
+void GfxView::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect *outRect) {
 	int16 scaledDisplaceX, scaledDisplaceY;
 	int16 scaledWidth, scaledHeight;
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
@@ -284,7 +284,7 @@
 	}
 }
 
-void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCount) {
+void GfxView::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCount) {
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *rlePtr;
 	byte *literalPtr;
@@ -372,7 +372,7 @@
 	error("Unable to decompress view");
 }
 
-byte *View::getBitmap(int16 loopNo, int16 celNo) {
+byte *GfxView::getBitmap(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	if (_loop[loopNo].cel[celNo].rawBitmap)
@@ -405,7 +405,7 @@
 
 // Called after unpacking an EGA cel, this will try to undither (parts) of the cel if the dithering in here
 //  matches dithering used by the current picture
-void View::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte clearKey) {
+void GfxView::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte clearKey) {
 	int16 *unditherMemorial = _screen->unditherGetMemorial();
 
 	// It makes no sense to go further, if no memorial data from current picture is available
@@ -478,7 +478,7 @@
 	}
 }
 
-void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires) {
+void GfxView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires) {
 	Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *bitmap = getBitmap(loopNo, celNo);
@@ -526,7 +526,7 @@
 
 // We don't fully follow sierra sci here, I did the scaling algo myself and it's definitely not pixel-perfect
 //  with the one sierra is using. It shouldn't matter because the scaled cel rect is definitely the same as in sierra sci
-void View::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY) {
+void GfxView::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY) {
 	Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *bitmap = getBitmap(loopNo, celNo);
@@ -603,13 +603,13 @@
 	}
 }
 
-uint16 View::getCelCount(int16 loopNo) {
+uint16 GfxView::getCelCount(int16 loopNo) {
 	if ((loopNo < 0) || (loopNo >= _loopCount))
 		return 0;
 	return _loop[loopNo].celCount;
 }
 
-Palette *View::getPalette() {
+Palette *GfxView::getPalette() {
 	return _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
 }
 

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-02-04 21:04:47 UTC (rev 47890)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-02-04 22:17:58 UTC (rev 47891)
@@ -48,13 +48,13 @@
 #define SCI_VIEW_EGAMAPPING_SIZE 16
 #define SCI_VIEW_EGAMAPPING_COUNT 8
 
-class Screen;
-class SciPalette;
+class GfxScreen;
+class GfxPalette;
 
-class View {
+class GfxView {
 public:
-	View(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId);
-	~View();
+	GfxView(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId);
+	~GfxView();
 
 	GuiResourceId getResourceId();
 	int16 getWidth(int16 loopNo, int16 celNo);


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