本文整理汇总了C++中GfxView::getWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ GfxView::getWidth方法的具体用法?C++ GfxView::getWidth怎么用?C++ GfxView::getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GfxView
的用法示例。
在下文中一共展示了GfxView::getWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: celRect
// 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) {
GfxView *view = _cache->getView(viewId);
Common::Rect celRect(50, 50, 50, 50);
Common::Rect translatedRect;
celRect.bottom += view->getHeight(loopNo, celNo);
celRect.right += view->getWidth(loopNo, celNo);
view->draw(celRect, celRect, celRect, loopNo, celNo, 255, 0, false);
_screen->copyRectToScreen(celRect);
}
示例2:
// 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) {
GfxView *view = _cache->getView(viewId);
Common::Rect celRect, curPortRect, clipRect, clipRectTranslated;
Common::Point curPortPos;
bool upscaledHiresHack = false;
if (view) {
if ((leftPos == 0) && (topPos == 0)) {
// HACK: in kq6, we get leftPos&topPos == 0 SOMETIMES, that's why we
// need to get coordinates from upscaledHiresHandle. I'm not sure if
// this is what we are supposed to do or if there is some other bug
// that actually makes coordinates to be 0 in the first place.
byte *memoryPtr = NULL;
memoryPtr = _segMan->getHunkPointer(upscaledHiresHandle);
if (memoryPtr) {
Common::Rect upscaledHiresRect;
_screen->bitsGetRect(memoryPtr, &upscaledHiresRect);
leftPos = upscaledHiresRect.left;
topPos = upscaledHiresRect.top;
upscaledHiresHack = true;
}
}
celRect.left = leftPos;
celRect.top = topPos;
celRect.right = celRect.left + view->getWidth(loopNo, celNo);
celRect.bottom = celRect.top + view->getHeight(loopNo, celNo);
// adjust curPort to upscaled hires
clipRect = celRect;
curPortRect = _ports->_curPort->rect;
_screen->adjustToUpscaledCoordinates(curPortRect.top, curPortRect.left);
_screen->adjustToUpscaledCoordinates(curPortRect.bottom, curPortRect.right);
curPortRect.bottom++;
curPortRect.right++;
clipRect.clip(curPortRect);
if (clipRect.isEmpty()) // nothing to draw
return;
clipRectTranslated = clipRect;
if (!upscaledHiresHack) {
curPortPos.x = _ports->_curPort->left; curPortPos.y = _ports->_curPort->top;
_screen->adjustToUpscaledCoordinates(curPortPos.y, curPortPos.x);
clipRectTranslated.top += curPortPos.y; clipRectTranslated.bottom += curPortPos.y;
clipRectTranslated.left += curPortPos.x; clipRectTranslated.right += curPortPos.x;
}
view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, true);
if (!_screen->_picNotValidSci11) {
_screen->copyDisplayRectToScreen(clipRectTranslated);
}
}
}