aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-04 22:17:58 +0000
committerMartin Kiewitz2010-02-04 22:17:58 +0000
commitcabd18da9e6a973e34bd841e4c30069ddd2a4808 (patch)
tree70c9bc813d7d53fa3a3cb799807371c325b9866d /engines/sci
parentc336204a3f324d1bb78287967e5c1d36f6473f7c (diff)
downloadscummvm-rg350-cabd18da9e6a973e34bd841e4c30069ddd2a4808.tar.gz
scummvm-rg350-cabd18da9e6a973e34bd841e4c30069ddd2a4808.tar.bz2
scummvm-rg350-cabd18da9e6a973e34bd841e4c30069ddd2a4808.zip
SCI: renaming class View to GfxView
svn-id: r47891
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/animate.cpp6
-rw-r--r--engines/sci/graphics/cache.cpp4
-rw-r--r--engines/sci/graphics/cache.h6
-rw-r--r--engines/sci/graphics/compare.cpp2
-rw-r--r--engines/sci/graphics/cursor.cpp4
-rw-r--r--engines/sci/graphics/cursor.h6
-rw-r--r--engines/sci/graphics/frameout.cpp2
-rw-r--r--engines/sci/graphics/gui.cpp4
-rw-r--r--engines/sci/graphics/gui32.cpp4
-rw-r--r--engines/sci/graphics/paint16.cpp6
-rw-r--r--engines/sci/graphics/paint16.h2
-rw-r--r--engines/sci/graphics/paint32.cpp2
-rw-r--r--engines/sci/graphics/view.cpp34
-rw-r--r--engines/sci/graphics/view.h10
14 files changed, 46 insertions, 46 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 7fe725f5cd..9762966755 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -204,7 +204,7 @@ void GfxAnimate::fill(byte &old_picNotValid) {
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::reAnimate(Common::Rect rect) {
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::addToPicDrawCels() {
}
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
diff --git a/engines/sci/graphics/cache.cpp b/engines/sci/graphics/cache.cpp
index 778a0c2ed2..c3c0c034ab 100644
--- a/engines/sci/graphics/cache.cpp
+++ b/engines/sci/graphics/cache.cpp
@@ -73,12 +73,12 @@ Font *GfxCache::getFont(GuiResourceId fontId) {
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];
}
diff --git a/engines/sci/graphics/cache.h b/engines/sci/graphics/cache.h
index d15d5b25c3..c444b69c3c 100644
--- a/engines/sci/graphics/cache.h
+++ b/engines/sci/graphics/cache.h
@@ -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 @@ public:
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);
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index a80309ab81..194dc7f374 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -104,7 +104,7 @@ bool GfxCompare::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRec
}
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));
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index 31b09d92a3..62c9d146c5 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -138,9 +138,9 @@ void Cursor::setView(GuiResourceId viewNum, int loopNum, int celNum, Common::Poi
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;
diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h
index c89caacd82..281dc93dea 100644
--- a/engines/sci/graphics/cursor.h
+++ b/engines/sci/graphics/cursor.h
@@ -35,10 +35,10 @@ namespace Sci {
#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:
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 01d089aaad..b9051b5afb 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -202,7 +202,7 @@ void GfxFrameout::kernelFrameout() {
}
}
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);
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 5dcca89b88..0eb01befa0 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -358,7 +358,7 @@ bool SciGui::canBeHere(reg_t curObject, reg_t listReference) {
}
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 @@ void SciGui::baseSetter(reg_t object) {
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);
diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp
index 132ae67a85..79f4c98198 100644
--- a/engines/sci/graphics/gui32.cpp
+++ b/engines/sci/graphics/gui32.cpp
@@ -141,7 +141,7 @@ bool SciGui32::canBeHere(reg_t curObject, reg_t listReference) {
}
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 @@ void SciGui32::baseSetter(reg_t object) {
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);
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index eaaea6ad10..34fa344158 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -74,7 +74,7 @@ void GfxPaint16::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mi
// 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 @@ void GfxPaint16::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common
}
// 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 @@ void GfxPaint16::drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect cel
// 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;
diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index 25ddc2e246..a537f47cac 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -52,7 +52,7 @@ public:
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);
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 55b88ecb4b..aad7a95e40 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -65,7 +65,7 @@ void GfxPaint32::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, b
// 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);
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 90f708e5c5..716f886634 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -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 @@ static const byte EGAmappingStraight[SCI_VIEW_EGAMAPPING_SIZE] = {
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 @@ void View::initData(GuiResourceId resourceId) {
}
}
-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::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Comm
}
}
-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::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z
}
}
-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 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCount)
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 @@ byte *View::getBitmap(int16 loopNo, int16 celNo) {
// 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::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte clear
}
}
-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 @@ void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectT
// 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 @@ void View::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect cli
}
}
-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;
}
diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h
index 4f84d6a2ef..beb3242804 100644
--- a/engines/sci/graphics/view.h
+++ b/engines/sci/graphics/view.h
@@ -48,13 +48,13 @@ struct LoopInfo {
#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);