mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 13:42:02 +00:00
NANCY: Rename graphics and cursor managers
Changed the names of the pointers to GraphicsManager and CursorManager to be shorter, since they were inconsistent with the rest of the managers, and typing them out is a chore.
This commit is contained in:
parent
3a6e2562dd
commit
4d5c4fcfcc
@ -64,7 +64,7 @@ void ActionManager::handleInput(NancyInput &input) {
|
||||
if (!setHoverCursor) {
|
||||
// Hotspots may overlap, but we want the hover cursor for the first one we encounter
|
||||
// This fixes the stairs in nancy3
|
||||
g_nancy->_cursorManager->setCursorType(rec->getHoverCursor());
|
||||
g_nancy->_cursor->setCursorType(rec->getHoverCursor());
|
||||
setHoverCursor = true;
|
||||
}
|
||||
|
||||
@ -679,7 +679,7 @@ void ActionManager::debugDrawHotspots() {
|
||||
// the smallest one available in the engine.
|
||||
RenderObject &obj = NancySceneState._hotspotDebug;
|
||||
if (ConfMan.getBool("debug_hotspots", Common::ConfigManager::kTransientDomain)) {
|
||||
const Font *font = g_nancy->_graphicsManager->getFont(0);
|
||||
const Font *font = g_nancy->_graphics->getFont(0);
|
||||
assert(font);
|
||||
uint16 yOffset = NancySceneState.getViewport().getCurVerticalScroll();
|
||||
obj.setVisible(true);
|
||||
|
@ -147,23 +147,23 @@ void Autotext::execute() {
|
||||
// Guesstimate the height of the surface
|
||||
uint surfHeight = _textLines[0].size() / 144 * _surfWidth;
|
||||
surfHeight = MAX<uint>(surfHeight, _surfHeight + 20);
|
||||
Graphics::ManagedSurface &surf = g_nancy->_graphicsManager->getAutotextSurface(_surfaceID);
|
||||
Common::Rect &surfBounds = g_nancy->_graphicsManager->getAutotextSurfaceBounds(_surfaceID);
|
||||
surf.create(_surfWidth + 1, surfHeight, g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
Graphics::ManagedSurface &surf = g_nancy->_graphics->getAutotextSurface(_surfaceID);
|
||||
Common::Rect &surfBounds = g_nancy->_graphics->getAutotextSurfaceBounds(_surfaceID);
|
||||
surf.create(_surfWidth + 1, surfHeight, g_nancy->_graphics->getInputPixelFormat());
|
||||
if (_transparency) {
|
||||
surf.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
surf.clear(g_nancy->_graphics->getTransColor());
|
||||
}
|
||||
|
||||
_fullSurface.create(surf, surf.getBounds());
|
||||
if(_transparency == kPlayOverlayTransparent) {
|
||||
_fullSurface.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
_fullSurface.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
}
|
||||
|
||||
Common::Rect textBounds = surf.getBounds();
|
||||
textBounds.left += _offset.x;
|
||||
textBounds.top += _offset.y;
|
||||
|
||||
const Font *font = g_nancy->_graphicsManager->getFont(_fontID);
|
||||
const Font *font = g_nancy->_graphics->getFont(_fontID);
|
||||
assert(font);
|
||||
uint d = (font->getFontHeight() + 1) / 2 + 1;
|
||||
|
||||
|
@ -223,21 +223,21 @@ void ConversationSound::execute() {
|
||||
NancySceneState.setNoHeldItem();
|
||||
|
||||
// Move the mouse to the default position defined in CURS
|
||||
const Common::Point initialMousePos = g_nancy->_cursorManager->getPrimaryVideoInitialPos();
|
||||
const Common::Point cursorHotspot = g_nancy->_cursorManager->getCurrentCursorHotspot();
|
||||
const Common::Point initialMousePos = g_nancy->_cursor->getPrimaryVideoInitialPos();
|
||||
const Common::Point cursorHotspot = g_nancy->_cursor->getCurrentCursorHotspot();
|
||||
Common::Point adjustedMousePos = g_nancy->_input->getInput().mousePos;
|
||||
adjustedMousePos.x -= cursorHotspot.x;
|
||||
adjustedMousePos.y -= cursorHotspot.y - 1;
|
||||
if (g_nancy->_cursorManager->getPrimaryVideoInactiveZone().bottom > adjustedMousePos.y) {
|
||||
g_nancy->_cursorManager->warpCursor(Common::Point(initialMousePos.x + cursorHotspot.x, initialMousePos.y + cursorHotspot.y));
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
if (g_nancy->_cursor->getPrimaryVideoInactiveZone().bottom > adjustedMousePos.y) {
|
||||
g_nancy->_cursor->warpCursor(Common::Point(initialMousePos.x + cursorHotspot.x, initialMousePos.y + cursorHotspot.y));
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
_state = kRun;
|
||||
NancySceneState.setActiveConversation(this);
|
||||
|
||||
// Do not draw first frame since video won't be loaded yet
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
|
||||
if (g_nancy->getGameType() < kGameTypeNancy6) {
|
||||
// Do not fall through to give the execution one loop for event flag changes
|
||||
@ -744,7 +744,7 @@ bool ConversationCelLoader::loadInner() {
|
||||
ConversationCel::~ConversationCel() {
|
||||
// Make sure there isn't a single-frame gap between conversation scenes where
|
||||
// the character is invisible
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
}
|
||||
|
||||
void ConversationCel::init() {
|
||||
|
@ -59,7 +59,7 @@ void Overlay::handleInput(NancyInput &input) {
|
||||
if (g_nancy->getGameType() >= kGameTypeNancy3) {
|
||||
if (_hasHotspot) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
|
@ -163,7 +163,7 @@ void AssemblyPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -173,7 +173,7 @@ void AssemblyPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_cwCursorDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateCW);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateCW);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp && !g_nancy->_sound->isSoundPlaying(_rotateSound)) {
|
||||
g_nancy->_sound->playSound(_rotateSound);
|
||||
@ -183,7 +183,7 @@ void AssemblyPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_ccwCursorDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateCCW);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateCCW);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp && !g_nancy->_sound->isSoundPlaying(_rotateSound)) {
|
||||
g_nancy->_sound->playSound(_rotateSound);
|
||||
@ -202,7 +202,7 @@ void AssemblyPuzzle::handleInput(NancyInput &input) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
if (_pickedUpPiece != -1) {
|
||||
@ -251,7 +251,7 @@ void AssemblyPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (!otherIsPlaced && (!isWrong || (_allowWrongPieceHotspot && _layersAssembled + 1 == pickedUpPiece.layer))) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(pickedUpPiece.destRects[0]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
if (!isWrong) {
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void BBallPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -224,7 +224,7 @@ void BBallPuzzle::handleInput(NancyInput &input) {
|
||||
localMousePos -= { vpPos.left, vpPos.top };
|
||||
|
||||
if (_exitHotspot.contains(localMousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (!_pressedButton &&input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -235,7 +235,7 @@ void BBallPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < _angleSliderHotspots.size(); ++i) {
|
||||
if (_curAngle != i && _angleSliderHotspots[i].contains(localMousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_pressedButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.fillRect(_angleDest, _drawSurface.getTransparentColor());
|
||||
@ -253,7 +253,7 @@ void BBallPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_curPower > 0 && _minusButtonDest.contains(localMousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_pressedButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
--_curPower;
|
||||
@ -267,7 +267,7 @@ void BBallPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if ((int)_curPower < _powers - 1 && _plusButtonDest.contains(localMousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_pressedButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
++_curPower;
|
||||
@ -281,7 +281,7 @@ void BBallPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_shootButtonDest.contains(localMousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_pressedButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image, _shootButtonSrc, _shootButtonDest);
|
||||
|
@ -39,8 +39,8 @@ void BombPuzzle::init() {
|
||||
_screenPosition.extend(r);
|
||||
}
|
||||
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -253,7 +253,7 @@ void BombPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
if (NancySceneState.getHeldItem() == _toolID) {
|
||||
|
@ -37,8 +37,8 @@ namespace Action {
|
||||
|
||||
void BulPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -326,7 +326,7 @@ void BulPuzzle::execute() {
|
||||
|
||||
void BulPuzzle::handleInput(NancyInput &input) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -343,7 +343,7 @@ void BulPuzzle::handleInput(NancyInput &input) {
|
||||
bool canClick = _currentAction == kNone && !g_nancy->_sound->isSoundPlaying(_moveSound);
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_rollButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image, _rollButtonSrc, _rollButtonDest);
|
||||
@ -358,7 +358,7 @@ void BulPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if ((_turn % _numRolls) && NancySceneState.getViewport().convertViewportToScreen(_passButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image, _passButtonSrc, _passButtonDest);
|
||||
@ -373,7 +373,7 @@ void BulPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_resetButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image, _resetButtonSrc, _resetButtonDest);
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void CollisionPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -564,7 +564,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (_usesExitButton) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image, _exitButtonSrc, _exitButtonDest);
|
||||
@ -577,7 +577,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
} else {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -628,7 +628,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
if (left.contains(input.mousePos)) {
|
||||
checkPos = movePiece(i, kWallLeft);
|
||||
if (checkPos != _pieces[i]._gridPos) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveLeft);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveLeft);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_lastPosition = _pieces[i]._gridPos;
|
||||
@ -646,7 +646,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
if (right.contains(input.mousePos)) {
|
||||
checkPos = movePiece(i, kWallRight);
|
||||
if (checkPos != _pieces[i]._gridPos) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveRight);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveRight);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_lastPosition = _pieces[i]._gridPos;
|
||||
@ -664,7 +664,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
if (up.contains(input.mousePos)) {
|
||||
checkPos = movePiece(i, kWallUp);
|
||||
if (checkPos != _pieces[i]._gridPos) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveUp);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveUp);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_lastPosition = _pieces[i]._gridPos;
|
||||
@ -682,7 +682,7 @@ void CollisionPuzzle::handleInput(NancyInput &input) {
|
||||
if (down.contains(input.mousePos)) {
|
||||
checkPos = movePiece(i, kWallDown);
|
||||
if (checkPos != _pieces[i]._gridPos) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveDown);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveDown);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_lastPosition = _pieces[i]._gridPos;
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void CubePuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -150,7 +150,7 @@ void CubePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -160,7 +160,7 @@ void CubePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_cwCursorDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateCW);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateCW);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp && !g_nancy->_sound->isSoundPlaying(_rotateSound)) {
|
||||
g_nancy->_sound->playSound(_rotateSound);
|
||||
@ -170,7 +170,7 @@ void CubePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_pickedUpPiece == -1 && NancySceneState.getViewport().convertViewportToScreen(_ccwCursorDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateCCW);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateCCW);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp && !g_nancy->_sound->isSoundPlaying(_rotateSound)) {
|
||||
g_nancy->_sound->playSound(_rotateSound);
|
||||
@ -185,7 +185,7 @@ void CubePuzzle::handleInput(NancyInput &input) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
if (_pickedUpPiece != -1) {
|
||||
@ -239,7 +239,7 @@ void CubePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (canPlace) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_placedDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_placedPieces[_pickedUpPiece] = true;
|
||||
|
@ -48,8 +48,8 @@ static const char *morseCodeTable[] = {
|
||||
|
||||
void HamRadioPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -410,7 +410,7 @@ void HamRadioPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
// Handle exit button
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -428,7 +428,7 @@ void HamRadioPuzzle::handleInput(NancyInput &input) {
|
||||
for (uint i = 0; i < _buttonDests.size(); ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_buttonDests[i]).contains(input.mousePos)) {
|
||||
if (i >= 10 || _pressedButton == kNone) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_pressedButton = i;
|
||||
|
@ -34,8 +34,8 @@ namespace Nancy {
|
||||
namespace Action {
|
||||
|
||||
void LeverPuzzle::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -156,7 +156,7 @@ void LeverPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -166,7 +166,7 @@ void LeverPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < 3; ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_destRects[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
bool isMoving = false;
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void MazeChasePuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -268,7 +268,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -285,7 +285,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(buttonHotspot).contains(input.mousePos)) {
|
||||
if (canMove(0, kWallUp)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
--_pieces[0]._gridPos.y;
|
||||
@ -304,7 +304,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(buttonHotspot).contains(input.mousePos)) {
|
||||
if (canMove(0, kWallRight)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
++_pieces[0]._gridPos.x;
|
||||
@ -323,7 +323,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(buttonHotspot).contains(input.mousePos)) {
|
||||
if (canMove(0, kWallDown)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
++_pieces[0]._gridPos.y;
|
||||
@ -342,7 +342,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(buttonHotspot).contains(input.mousePos)) {
|
||||
if (canMove(0, kWallLeft)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
--_pieces[0]._gridPos.x;
|
||||
@ -360,7 +360,7 @@ void MazeChasePuzzle::handleInput(NancyInput &input) {
|
||||
buttonHotspot.grow(-10);
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(buttonHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
++_currentAnimFrame;
|
||||
|
@ -38,14 +38,14 @@ void MouseLightPuzzle::init() {
|
||||
Graphics::ManagedSurface baseImage;
|
||||
g_nancy->_resource->loadImage(_imageName, baseImage);
|
||||
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getTransparentPixelFormat());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getTransparentPixelFormat());
|
||||
_drawSurface.blitFrom(baseImage);
|
||||
((Graphics::Surface)_drawSurface).setAlpha(0);
|
||||
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
|
||||
_maskCircle.create(_radius * 2, _radius * 2, g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_maskCircle.create(_radius * 2, _radius * 2, g_nancy->_graphics->getInputPixelFormat());
|
||||
_maskCircle.clear();
|
||||
|
||||
if (_smoothEdges) {
|
||||
|
@ -53,7 +53,7 @@ void OrderingPuzzle::init() {
|
||||
}
|
||||
|
||||
g_nancy->_resource->loadImage(_imageName, _image);
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
if (_image.hasPalette()) {
|
||||
uint8 palette[256 * 3];
|
||||
@ -447,7 +447,7 @@ void OrderingPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -456,7 +456,7 @@ void OrderingPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_needButtonToCheckSuccess && NancySceneState.getViewport().convertViewportToScreen(_checkButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_checkButtonPressed = true;
|
||||
@ -473,11 +473,11 @@ void OrderingPuzzle::handleInput(NancyInput &input) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspots[i]).contains(input.mousePos)) {
|
||||
// Set the custom cursor for nancy8+ PianoPuzzle
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_specialCursor1Dest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType((CursorManager::CursorType)_specialCursor1Id);
|
||||
g_nancy->_cursor->setCursorType((CursorManager::CursorType)_specialCursor1Id);
|
||||
} else if (NancySceneState.getViewport().convertViewportToScreen(_specialCursor2Dest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType((CursorManager::CursorType)_specialCursor2Id);
|
||||
g_nancy->_cursor->setCursorType((CursorManager::CursorType)_specialCursor2Id);
|
||||
} else {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
}
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
|
@ -38,8 +38,8 @@ namespace Action {
|
||||
void OverrideLockPuzzle::init() {
|
||||
Common::Rect bounds = NancySceneState.getViewport().getBounds();
|
||||
|
||||
_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
@ -171,7 +171,7 @@ void OverrideLockPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
// Check the exit hotspot
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -194,7 +194,7 @@ void OverrideLockPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspots[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_buttonSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
drawButton(i, false);
|
||||
|
@ -37,8 +37,8 @@ PasswordPuzzle::~PasswordPuzzle() {
|
||||
}
|
||||
|
||||
void PasswordPuzzle::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -197,7 +197,7 @@ void PasswordPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -238,8 +238,8 @@ void PasswordPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
void PasswordPuzzle::drawText() {
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
const Graphics::Font *font = g_nancy->_graphicsManager->getFont(_fontID);
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
const Graphics::Font *font = g_nancy->_graphics->getFont(_fontID);
|
||||
|
||||
Common::Rect bounds = _nameBounds;
|
||||
bounds = NancySceneState.getViewport().convertViewportToScreen(bounds);
|
||||
|
@ -35,7 +35,7 @@ namespace Action {
|
||||
|
||||
void PeepholePuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
moveTo(screenBounds);
|
||||
|
||||
Common::Rect innerImageContentBounds;
|
||||
@ -106,7 +106,7 @@ void PeepholePuzzle::handleInput(NancyInput &input) {
|
||||
bool justReleased = false;
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -119,7 +119,7 @@ void PeepholePuzzle::handleInput(NancyInput &input) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_buttonDests[_pressedButton]).contains(input.mousePos)) {
|
||||
if (!_disabledButtons[_pressedButton]) {
|
||||
// Do not show hover cursor on disabled button
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
}
|
||||
|
||||
if (_pressStart == 0) {
|
||||
@ -136,7 +136,7 @@ void PeepholePuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
// Avoid single frame with non-highlighted cursor
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_buttonDests[_pressedButton]).contains(input.mousePos) && !_disabledButtons[_pressedButton]) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
}
|
||||
|
||||
_pressedButton = -1;
|
||||
@ -148,7 +148,7 @@ void PeepholePuzzle::handleInput(NancyInput &input) {
|
||||
for (uint i = 0; i < 4; ++i) {
|
||||
if (!_disabledButtons[i]) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_buttonDests[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonDown) {
|
||||
if (_pressedButton == -1) {
|
||||
|
@ -901,7 +901,7 @@ bool RaycastDeferredLoader::loadInner() {
|
||||
|
||||
Common::Rect viewport = viewportData->bounds;
|
||||
_owner.moveTo(viewport);
|
||||
_owner._drawSurface.create(viewport.width(), viewport.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_owner._drawSurface.create(viewport.width(), viewport.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_owner.setTransparent(true);
|
||||
|
||||
_loadState = kInitPlayerLocationRotation;
|
||||
@ -1048,7 +1048,7 @@ bool RaycastDeferredLoader::loadInner() {
|
||||
if (!shouldBreak) {
|
||||
for (auto &a : _owner._specialWallTextures) {
|
||||
for (auto &tex : a._value) {
|
||||
tex.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
tex.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1369,8 +1369,8 @@ void RaycastPuzzle::drawMap() {
|
||||
auto *bootSummary = GetEngineData(BSUM);
|
||||
assert(bootSummary);
|
||||
|
||||
_mapBaseSurface.create(_mapFullWidth, _mapFullHeight, g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_map._drawSurface.create(_mapFullWidth, _mapFullHeight, g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_mapBaseSurface.create(_mapFullWidth, _mapFullHeight, g_nancy->_graphics->getInputPixelFormat());
|
||||
_map._drawSurface.create(_mapFullWidth, _mapFullHeight, g_nancy->_graphics->getInputPixelFormat());
|
||||
Common::Rect mapPos(bootSummary->textboxScreenPosition);
|
||||
mapPos.setWidth(_mapFullWidth * 2);
|
||||
mapPos.setHeight(_mapFullHeight * 2);
|
||||
@ -1448,10 +1448,10 @@ void RaycastPuzzle::updateMap() {
|
||||
}
|
||||
|
||||
void RaycastPuzzle::createTextureLightSourcing(Common::Array<Graphics::ManagedSurface> *array, const Common::Path &textureName) {
|
||||
Graphics::PixelFormat format = g_nancy->_graphicsManager->getInputPixelFormat();
|
||||
Graphics::PixelFormat format = g_nancy->_graphics->getInputPixelFormat();
|
||||
array->resize(8);
|
||||
|
||||
uint16 transColor = g_nancy->_graphicsManager->getTransColor();
|
||||
uint16 transColor = g_nancy->_graphics->getTransColor();
|
||||
|
||||
g_nancy->_resource->loadImage(textureName, (*array)[0]);
|
||||
|
||||
|
@ -40,8 +40,8 @@ RiddlePuzzle::~RiddlePuzzle() {
|
||||
}
|
||||
|
||||
void RiddlePuzzle::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
@ -276,7 +276,7 @@ void RiddlePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -326,8 +326,8 @@ void RiddlePuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
void RiddlePuzzle::drawText() {
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
const Graphics::Font *font = g_nancy->_graphicsManager->getFont(_viewportTextFontID);
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
const Graphics::Font *font = g_nancy->_graphics->getFont(_viewportTextFontID);
|
||||
|
||||
Common::Rect bounds = getBounds();
|
||||
Common::Point destPoint(bounds.left, bounds.bottom - font->getFontHeight());
|
||||
|
@ -38,8 +38,8 @@ namespace Action {
|
||||
|
||||
void RippedLetterPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -49,7 +49,7 @@ void RippedLetterPuzzle::init() {
|
||||
if (_useCustomPickUpTile) {
|
||||
_pickedUpPiece._drawSurface.create(_image, _customPickUpTileSrc);
|
||||
} else {
|
||||
_pickedUpPiece._drawSurface.create(_destRects[0].width(), _destRects[0].height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_pickedUpPiece._drawSurface.create(_destRects[0].width(), _destRects[0].height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
}
|
||||
|
||||
_pickedUpPiece.setVisible(false);
|
||||
@ -228,7 +228,7 @@ void RippedLetterPuzzle::handleInput(NancyInput &input) {
|
||||
insideRect.translate(screenHotspot.left, screenHotspot.top);
|
||||
|
||||
if (_rotationType != kRotationNone && insideRect.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateCW);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateCW);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Player has clicked, rotate the piece
|
||||
@ -249,14 +249,14 @@ void RippedLetterPuzzle::handleInput(NancyInput &input) {
|
||||
insideRect.translate(screenHotspot.left, screenHotspot.top);
|
||||
|
||||
if (insideRect.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Player has clicked, take the piece
|
||||
|
||||
// First, copy the graphic from the full drawSurface...
|
||||
if (!_useCustomPickUpTile) {
|
||||
_pickedUpPiece._drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_pickedUpPiece._drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
_pickedUpPiece._drawSurface.blitFrom(_drawSurface, _destRects[i], Common::Point());
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ void RippedLetterPuzzle::handleInput(NancyInput &input) {
|
||||
insideRect.translate(screenHotspot.left, screenHotspot.top);
|
||||
|
||||
if (insideRect.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Player has clicked, drop the piece and pick up a new one
|
||||
@ -297,7 +297,7 @@ void RippedLetterPuzzle::handleInput(NancyInput &input) {
|
||||
} else {
|
||||
// Yes, change the picked piece graphic
|
||||
if (!_useCustomPickUpTile) {
|
||||
_pickedUpPiece._drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_pickedUpPiece._drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
_pickedUpPiece._drawSurface.blitFrom(_drawSurface, _destRects[i], Common::Point());
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ void RippedLetterPuzzle::handleInput(NancyInput &input) {
|
||||
if (_pickedUpPieceID == -1) {
|
||||
// No piece picked up, check the exit hotspot
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Player has clicked, exit
|
||||
|
@ -36,8 +36,8 @@ namespace Nancy {
|
||||
namespace Action {
|
||||
|
||||
void RotatingLockPuzzle::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -167,7 +167,7 @@ void RotatingLockPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -178,7 +178,7 @@ void RotatingLockPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < _upHotspots.size(); ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_upHotspots[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_clickSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_clickSound);
|
||||
@ -193,7 +193,7 @@ void RotatingLockPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < _downHotspots.size(); ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_downHotspots[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_clickSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_clickSound);
|
||||
|
@ -41,8 +41,8 @@ void SafeDialPuzzle::init() {
|
||||
g_nancy->_resource->loadImage(_resetImageName, _resetImage);
|
||||
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -206,7 +206,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -218,7 +218,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(_useMoveArrows ? CursorManager::kMoveLeft : CursorManager::kRotateCCW);
|
||||
g_nancy->_cursor->setCursorType(_useMoveArrows ? CursorManager::kMoveLeft : CursorManager::kRotateCCW);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_spinSound) && input.input & NancyInput::kLeftMouseButtonUp && _nextAnim < g_nancy->getTotalPlayTime() &&
|
||||
_animState != kReset && _animState != kResetAnim) {
|
||||
@ -241,7 +241,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(_useMoveArrows ? CursorManager::kMoveRight : CursorManager::kRotateCW);
|
||||
g_nancy->_cursor->setCursorType(_useMoveArrows ? CursorManager::kMoveRight : CursorManager::kRotateCW);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_spinSound) && input.input & NancyInput::kLeftMouseButtonUp && _nextAnim < g_nancy->getTotalPlayTime() &&
|
||||
_animState != kReset && _animState != kResetAnim) {
|
||||
@ -266,7 +266,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_arrowDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_selectSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_selectSound);
|
||||
@ -279,7 +279,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
return;
|
||||
} else if (NancySceneState.getViewport().convertViewportToScreen(_resetDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_resetSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_drawSurface.blitFrom(_image1, _resetSrc, _resetDest);
|
||||
|
@ -42,8 +42,8 @@ SetPlayerClock::~SetPlayerClock() {
|
||||
|
||||
void SetPlayerClock::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -186,7 +186,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
|
||||
// Cancel button is active in both time and alarm mode
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_cancelButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Cancel button pressed
|
||||
@ -203,7 +203,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
if (_alarmState == kTimeMode) {
|
||||
// Alarm button is active only in time mode
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_alarmButtonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Alarm button pressed
|
||||
@ -221,7 +221,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
} else {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_timeButtonDest).contains(input.mousePos)) {
|
||||
// Time button is active only in alarm mode
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Alarm button pressed
|
||||
@ -236,7 +236,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
}
|
||||
} else if (NancySceneState.getViewport().convertViewportToScreen(_upButtonDest).contains(input.mousePos)) {
|
||||
// Up button is active only in alarm mode
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Up button pressed
|
||||
@ -251,7 +251,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
}
|
||||
} else if (NancySceneState.getViewport().convertViewportToScreen(_downButtonDest).contains(input.mousePos)) {
|
||||
// Down button is active only in alarm mode
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Down button pressed
|
||||
@ -266,7 +266,7 @@ void SetPlayerClock::handleInput(NancyInput &input) {
|
||||
}
|
||||
} else if (NancySceneState.getViewport().convertViewportToScreen(_setButtonDest).contains(input.mousePos)) {
|
||||
// Set button is active only in alarm mode
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!_clearButton && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Down button pressed
|
||||
|
@ -35,8 +35,8 @@ namespace Nancy {
|
||||
namespace Action {
|
||||
|
||||
void SliderPuzzle::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -171,7 +171,7 @@ void SliderPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -227,7 +227,7 @@ void SliderPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (currentTileX != -1) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(_clickSound) && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_clickSound);
|
||||
@ -284,7 +284,7 @@ void SliderPuzzle::drawTile(int tileID, uint posX, uint posY) {
|
||||
void SliderPuzzle::undrawTile(uint posX, uint posY) {
|
||||
Common::Rect bounds = _destRects[posY][posX];
|
||||
bounds.translate(-_screenPosition.left, -_screenPosition.top);
|
||||
_drawSurface.fillRect(bounds, g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.fillRect(bounds, g_nancy->_graphics->getTransColor());
|
||||
|
||||
_needsRedraw = true;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
|
||||
Scrollbar::handleInput(input);
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -62,8 +62,8 @@ SoundEqualizerPuzzle::~SoundEqualizerPuzzle() {
|
||||
|
||||
void SoundEqualizerPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -226,14 +226,14 @@ void SoundEqualizerPuzzle::execute() {
|
||||
|
||||
void SoundEqualizerPuzzle::handleInput(NancyInput &input) {
|
||||
if (_state == kActionTrigger) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
return;
|
||||
} else if (_state == kBegin) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_buttonDest).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Exit button pressed
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void SpigotPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -262,7 +262,7 @@ void SpigotPuzzle::handleInput(NancyInput &input) {
|
||||
mousePos -= { vpScreenPos.left, vpScreenPos.top };
|
||||
|
||||
if (_exitHotspot.contains(mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -273,7 +273,7 @@ void SpigotPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < _numSpigots; ++i) {
|
||||
if (_spigotHotspots[i].contains(mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_spigotSound);
|
||||
@ -283,7 +283,7 @@ void SpigotPuzzle::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_numPulls[i] && _buttonDests[i].contains(mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->playSound(_buttonSound);
|
||||
|
@ -39,8 +39,8 @@ TangramPuzzle::~TangramPuzzle() {
|
||||
|
||||
void TangramPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -85,7 +85,7 @@ void TangramPuzzle::init() {
|
||||
for (int y = 0; y < curTile->_highlightedSrcImage.h; ++y) {
|
||||
uint16 *p = (uint16 *)curTile->_highlightedSrcImage.getBasePtr(0, y);
|
||||
for (int x = 0; x < curTile->_highlightedSrcImage.w; ++x) {
|
||||
if (*p != g_nancy->_graphicsManager->getTransColor()) {
|
||||
if (*p != g_nancy->_graphics->getTransColor()) {
|
||||
// I'm not sure *3/2 is the exact formula but it's close enough
|
||||
byte r, g, b;
|
||||
format.colorToRGB(*p, r, g, b);
|
||||
@ -220,7 +220,7 @@ void TangramPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
if (idUnderMouse != 0 && idUnderMouse != (byte)-1) {
|
||||
// A tile is under the cursor
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
pickUpTile(idUnderMouse);
|
||||
@ -235,7 +235,7 @@ void TangramPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
// No tile under cursor, check exit hotspot
|
||||
if (_exitHotspot.contains(mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -426,7 +426,7 @@ void TangramPuzzle::Tile::drawMask() {
|
||||
_mask = new byte[_drawSurface.w * _drawSurface.h];
|
||||
}
|
||||
|
||||
uint16 transColor = g_nancy->_graphicsManager->getTransColor();
|
||||
uint16 transColor = g_nancy->_graphics->getTransColor();
|
||||
for (int y = 0; y < _drawSurface.h; ++y) {
|
||||
uint16 *src = (uint16 *)_drawSurface.getBasePtr(0, y);
|
||||
for (int x = 0; x < _drawSurface.w; ++x) {
|
||||
|
@ -34,8 +34,8 @@ namespace Nancy {
|
||||
namespace Action {
|
||||
|
||||
void Telephone::init() {
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
setTransparent(true);
|
||||
|
||||
@ -276,7 +276,7 @@ void Telephone::handleInput(NancyInput &input) {
|
||||
// Cursor gets changed regardless of state
|
||||
for (uint i = 0; i < 12; ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_destRects[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
buttonNr = i;
|
||||
break;
|
||||
}
|
||||
@ -287,7 +287,7 @@ void Telephone::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
g_nancy->_sound->loadSound(_hangUpSound);
|
||||
@ -334,7 +334,7 @@ void Telephone::undrawButton(uint id) {
|
||||
Common::Rect bounds = _destRects[id];
|
||||
bounds.translate(-_screenPosition.left, -_screenPosition.top);
|
||||
|
||||
_drawSurface.fillRect(bounds, g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.fillRect(bounds, g_nancy->_graphics->getTransColor());
|
||||
_needsRedraw = true;
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void TowerPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -182,7 +182,7 @@ void TowerPuzzle::handleInput(NancyInput &input) {
|
||||
int hoveredPoleID = -1;
|
||||
for (uint poleID = 0; poleID < 3; ++poleID) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspots[poleID]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
hoveredPoleID = poleID;
|
||||
break;
|
||||
}
|
||||
@ -193,7 +193,7 @@ void TowerPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
// First, check the exit hotspot
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
// Player has clicked, exit
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void TurningPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -257,7 +257,7 @@ void TurningPuzzle::execute() {
|
||||
|
||||
void TurningPuzzle::handleInput(NancyInput &input) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -268,7 +268,7 @@ void TurningPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i < _hotspots.size(); ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspots[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (_objectCurrentlyTurning != -1) {
|
||||
break;
|
||||
|
@ -35,8 +35,8 @@ namespace Action {
|
||||
|
||||
void TwoDialPuzzle::init() {
|
||||
Common::Rect screenBounds = NancySceneState.getViewport().getBounds();
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.create(screenBounds.width(), screenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
setVisible(true);
|
||||
moveTo(screenBounds);
|
||||
@ -141,7 +141,7 @@ void TwoDialPuzzle::handleInput(NancyInput &input) {
|
||||
bool canClick = (_state == kRun) && !g_nancy->_sound->isSoundPlaying(_rotateSounds[0]) && !g_nancy->_sound->isSoundPlaying(_rotateSounds[1]);
|
||||
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_exitHotspot).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->_cursorManager->_puzzleExitCursor);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->_cursor->_puzzleExitCursor);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_state = kActionTrigger;
|
||||
@ -152,7 +152,7 @@ void TwoDialPuzzle::handleInput(NancyInput &input) {
|
||||
|
||||
for (uint i = 0; i <= 1; ++i) {
|
||||
if (NancySceneState.getViewport().convertViewportToScreen(_hotspots[i]).contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(_isClockwise[i] ? CursorManager::kRotateCW : CursorManager::kRotateCCW);
|
||||
g_nancy->_cursor->setCursorType(_isClockwise[i] ? CursorManager::kRotateCW : CursorManager::kRotateCCW);
|
||||
|
||||
if (canClick && input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_currentPositions[i] += _isClockwise[i] ? -1 : 1;
|
||||
|
@ -151,7 +151,7 @@ void PlaySecondaryMovie::execute() {
|
||||
_state = kRun;
|
||||
|
||||
if (Common::Rect(_decoder->getWidth(), _decoder->getHeight()) == NancySceneState.getViewport().getBounds()) {
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ void PlaySecondaryVideo::init() {
|
||||
// Every secondary video frame (in nancy1) plays exactly 12ms slower than what its metadata says.
|
||||
// I'm still not sure how/why that happens so for now I'm using this hack to fix the timings
|
||||
_decoder.addFrameTime(12);
|
||||
_drawSurface.create(_decoder.getWidth(), _decoder.getHeight(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(_decoder.getWidth(), _decoder.getHeight(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
if (!_paletteFilename.empty()) {
|
||||
GraphicsManager::loadSurfacePalette(_fullFrame, _paletteFilename);
|
||||
|
@ -112,14 +112,14 @@ void NancyConsole::postEnter() {
|
||||
const Graphics::Surface *frame = dec->decodeNextFrame();
|
||||
if (frame) {
|
||||
GraphicsManager::copyToManaged(*frame, surf, !_paletteFile.empty());
|
||||
g_nancy->_graphicsManager->debugDrawToScreen(surf);
|
||||
g_nancy->_graphics->debugDrawToScreen(surf);
|
||||
}
|
||||
}
|
||||
|
||||
g_system->delayMillis(10);
|
||||
}
|
||||
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
}
|
||||
|
||||
_videoFile.clear();
|
||||
@ -134,7 +134,7 @@ void NancyConsole::postEnter() {
|
||||
GraphicsManager::loadSurfacePalette(surf, _paletteFile);
|
||||
}
|
||||
|
||||
g_nancy->_graphicsManager->debugDrawToScreen(surf);
|
||||
g_nancy->_graphics->debugDrawToScreen(surf);
|
||||
|
||||
Common::EventManager *ev = g_system->getEventManager();
|
||||
while (!g_nancy->shouldQuit()) {
|
||||
@ -150,7 +150,7 @@ void NancyConsole::postEnter() {
|
||||
g_system->delayMillis(10);
|
||||
}
|
||||
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
} else {
|
||||
debugPrintf("Failed to load image '%s'\n", _imageFile.toString().c_str());
|
||||
}
|
||||
|
@ -279,12 +279,12 @@ void CursorManager::applyCursor() {
|
||||
surf = &_invCursorsSurface;
|
||||
|
||||
} else {
|
||||
surf = &g_nancy->_graphicsManager->_object0;
|
||||
surf = &g_nancy->_graphics->_object0;
|
||||
}
|
||||
|
||||
Graphics::ManagedSurface temp(*surf, bounds);
|
||||
|
||||
CursorMan.replaceCursor(temp, hotspot.x, hotspot.y, g_nancy->_graphicsManager->getTransColor(), false);
|
||||
CursorMan.replaceCursor(temp, hotspot.x, hotspot.y, g_nancy->_graphics->getTransColor(), false);
|
||||
if (g_nancy->getGameType() == kGameTypeVampire) {
|
||||
byte palette[3 * 256];
|
||||
surf->grabPalette(palette, 0, 256);
|
||||
|
@ -242,7 +242,7 @@ TBOX::TBOX(Common::SeekableReadStream *chunkStream) : EngineData(chunkStream) {
|
||||
tabWidth = chunkStream->readUint16LE();
|
||||
pageScrollPercent = chunkStream->readUint16LE(); // Not implemented yet
|
||||
|
||||
Graphics::PixelFormat format = g_nancy->_graphicsManager->getInputPixelFormat();
|
||||
Graphics::PixelFormat format = g_nancy->_graphics->getInputPixelFormat();
|
||||
if (g_nancy->getGameType() >= kGameTypeNancy2) {
|
||||
byte r, g, b;
|
||||
r = chunkStream->readByte();
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace Nancy {
|
||||
|
||||
void Font::read(Common::SeekableReadStream &stream) {
|
||||
_transColor = g_nancy->_graphicsManager->getTransColor();
|
||||
_transColor = g_nancy->_graphics->getTransColor();
|
||||
_maxCharWidth = 0;
|
||||
_fontHeight = 0;
|
||||
uint16 numCharacters = 78;
|
||||
@ -38,7 +38,7 @@ void Font::read(Common::SeekableReadStream &stream) {
|
||||
readFilename(stream, imageName);
|
||||
|
||||
g_nancy->_resource->loadImage(imageName, _image);
|
||||
_image.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
_image.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
|
||||
char desc[31];
|
||||
stream.read(desc, 30);
|
||||
|
@ -70,7 +70,7 @@ void GraphicsManager::draw(bool updateScreen) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->applyCursor();
|
||||
g_nancy->_cursor->applyCursor();
|
||||
|
||||
// Update graphics for all RenderObjects and determine
|
||||
// the areas of the screen that need to be redrawn
|
||||
|
@ -172,7 +172,7 @@ void NancyMetaEngine::getSavegameThumbnail(Graphics::Surface &thumb) {
|
||||
|
||||
// Make sure we always trigger a screen redraw to support second chance saves
|
||||
Graphics::ManagedSurface screenshotSurf;
|
||||
Nancy::g_nancy->_graphicsManager->screenshotScreen(screenshotSurf);
|
||||
Nancy::g_nancy->_graphics->screenshotScreen(screenshotSurf);
|
||||
if (!screenshotSurf.empty() && createThumbnail(&thumb, &screenshotSurf)) {
|
||||
return;
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
|
||||
currentLine += curToken;
|
||||
}
|
||||
|
||||
font = g_nancy->_graphicsManager->getFont(curFontID);
|
||||
highlightFont = g_nancy->_graphicsManager->getFont(highlightFontID);
|
||||
font = g_nancy->_graphics->getFont(curFontID);
|
||||
highlightFont = g_nancy->_graphics->getFont(highlightFontID);
|
||||
assert(font && highlightFont);
|
||||
|
||||
// Do word wrapping on the text, sans tokens. This assumes
|
||||
@ -277,7 +277,7 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
|
||||
switch (change.type) {
|
||||
case MetaInfo::kFont:
|
||||
curFontID = change.index;
|
||||
font = g_nancy->_graphicsManager->getFont(curFontID);
|
||||
font = g_nancy->_graphics->getFont(curFontID);
|
||||
break;
|
||||
case MetaInfo::kColor:
|
||||
colorID = change.index;
|
||||
@ -303,7 +303,7 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
|
||||
textBounds.top + _numDrawnLines * font->getFontHeight() + _imageVerticalOffset - 4);
|
||||
|
||||
// For now we do not check if we need to go to new line; neither does the original
|
||||
_fullSurface.blitFrom(g_nancy->_graphicsManager->_object0, markSrc, markDest);
|
||||
_fullSurface.blitFrom(g_nancy->_graphics->_object0, markSrc, markDest);
|
||||
|
||||
horizontalOffset += markDest.width() + 2;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ void Lightning::run() {
|
||||
break;
|
||||
}
|
||||
case kBegin:
|
||||
g_nancy->_graphicsManager->grabViewportObjects(_viewportObjs);
|
||||
g_nancy->_graphics->grabViewportObjects(_viewportObjs);
|
||||
|
||||
for (RenderObject *obj : _viewportObjs) {
|
||||
if (!obj) {
|
||||
|
@ -54,7 +54,7 @@ void SpecialEffect::init() {
|
||||
}
|
||||
}
|
||||
|
||||
_drawSurface.create(_rect.width(), _rect.height(), g_nancy->_graphicsManager->getScreenPixelFormat());
|
||||
_drawSurface.create(_rect.width(), _rect.height(), g_nancy->_graphics->getScreenPixelFormat());
|
||||
moveTo(_rect);
|
||||
setTransparent(false);
|
||||
|
||||
@ -112,7 +112,7 @@ void SpecialEffect::updateGraphics() {
|
||||
_throughBlackStarted2nd = true;
|
||||
_fadeFrom.clear();
|
||||
setVisible(false);
|
||||
g_nancy->_graphicsManager->screenshotScreen(_fadeTo);
|
||||
g_nancy->_graphics->screenshotScreen(_fadeTo);
|
||||
setVisible(true);
|
||||
_startTime = g_nancy->getTotalPlayTime();
|
||||
_currentFrame = 0;
|
||||
@ -122,7 +122,7 @@ void SpecialEffect::updateGraphics() {
|
||||
}
|
||||
|
||||
void SpecialEffect::onSceneChange() {
|
||||
g_nancy->_graphicsManager->screenshotScreen(_fadeFrom);
|
||||
g_nancy->_graphics->screenshotScreen(_fadeFrom);
|
||||
_drawSurface.rawBlitFrom(_fadeFrom, _rect, Common::Point());
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ void SpecialEffect::afterSceneChange() {
|
||||
}
|
||||
|
||||
if (_type == kCrossDissolve) {
|
||||
g_nancy->_graphicsManager->screenshotScreen(_fadeTo);
|
||||
g_nancy->_graphics->screenshotScreen(_fadeTo);
|
||||
} else {
|
||||
_fadeTo.create(640, 480, _drawSurface.format);
|
||||
_fadeTo.clear();
|
||||
@ -143,7 +143,7 @@ void SpecialEffect::afterSceneChange() {
|
||||
// the two default values transBlitFrom uses for transColor. By doing this,
|
||||
// transColor gets set to the one color guaranteed to not appear in any scene,
|
||||
// and transparency works correctly
|
||||
_fadeTo.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
_fadeTo.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
|
||||
registerGraphics();
|
||||
_nextFrameTime = g_nancy->getTotalPlayTime() + _frameTime;
|
||||
|
@ -69,8 +69,8 @@ NancyEngine::NancyEngine(OSystem *syst, const NancyGameDescription *gd) :
|
||||
|
||||
_input = new InputManager();
|
||||
_sound = new SoundManager();
|
||||
_graphicsManager = new GraphicsManager();
|
||||
_cursorManager = new CursorManager();
|
||||
_graphics = new GraphicsManager();
|
||||
_cursor = new CursorManager();
|
||||
|
||||
_resource = nullptr;
|
||||
|
||||
@ -90,8 +90,8 @@ NancyEngine::~NancyEngine() {
|
||||
|
||||
delete _randomSource;
|
||||
|
||||
delete _graphicsManager;
|
||||
delete _cursorManager;
|
||||
delete _graphics;
|
||||
delete _cursor;
|
||||
delete _input;
|
||||
delete _sound;
|
||||
|
||||
@ -245,7 +245,7 @@ void NancyEngine::setToPreviousState() {
|
||||
}
|
||||
|
||||
void NancyEngine::setMouseEnabled(bool enabled) {
|
||||
_cursorManager->showCursor(enabled); _input->setMouseInputEnabled(enabled);
|
||||
_cursor->showCursor(enabled); _input->setMouseInputEnabled(enabled);
|
||||
}
|
||||
|
||||
void NancyEngine::addDeferredLoader(Common::SharedPtr<DeferredLoader> &loaderPtr) {
|
||||
@ -279,7 +279,7 @@ Common::Error NancyEngine::run() {
|
||||
uint32 frameEndTime = _system->getMillis() + 16;
|
||||
|
||||
if (!graphicsWereSuppressed) {
|
||||
_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
State::State *s;
|
||||
@ -301,12 +301,12 @@ Common::Error NancyEngine::run() {
|
||||
s->process();
|
||||
}
|
||||
|
||||
graphicsWereSuppressed = _graphicsManager->_isSuppressed;
|
||||
graphicsWereSuppressed = _graphics->_isSuppressed;
|
||||
|
||||
_graphicsManager->draw();
|
||||
_graphics->draw();
|
||||
|
||||
if (_gameFlow.changingState) {
|
||||
_graphicsManager->clearObjects();
|
||||
_graphics->clearObjects();
|
||||
|
||||
s = getStateObject(_gameFlow.curState);
|
||||
if (s) {
|
||||
@ -463,10 +463,10 @@ void NancyEngine::bootGameEngine() {
|
||||
LOAD_BOOT_L(LOAD_v2, "LOAD")
|
||||
}
|
||||
|
||||
_cursorManager->init(iff->getChunkStream("CURS"));
|
||||
_cursor->init(iff->getChunkStream("CURS"));
|
||||
|
||||
_graphicsManager->init();
|
||||
_graphicsManager->loadFonts(iff->getChunkStream("FONT"));
|
||||
_graphics->init();
|
||||
_graphics->loadFonts(iff->getChunkStream("FONT"));
|
||||
|
||||
preloadCals();
|
||||
|
||||
|
@ -114,8 +114,8 @@ public:
|
||||
|
||||
// Managers
|
||||
ResourceManager *_resource;
|
||||
GraphicsManager *_graphicsManager;
|
||||
CursorManager *_cursorManager;
|
||||
GraphicsManager *_graphics;
|
||||
CursorManager *_cursor;
|
||||
InputManager *_input;
|
||||
SoundManager *_sound;
|
||||
|
||||
|
@ -44,11 +44,11 @@ void RenderObject::init() {
|
||||
}
|
||||
|
||||
void RenderObject::registerGraphics() {
|
||||
g_nancy->_graphicsManager->addObject(this);
|
||||
g_nancy->_graphics->addObject(this);
|
||||
}
|
||||
|
||||
RenderObject::~RenderObject() {
|
||||
g_nancy->_graphicsManager->removeObject(this);
|
||||
g_nancy->_graphics->removeObject(this);
|
||||
if (_drawSurface.getPixels()) {
|
||||
_drawSurface.free();
|
||||
}
|
||||
@ -83,7 +83,7 @@ void RenderObject::setVisible(bool visible) {
|
||||
|
||||
void RenderObject::setTransparent(bool isTransparent) {
|
||||
if (isTransparent) {
|
||||
_drawSurface.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
} else {
|
||||
_drawSurface.clearTransparentColor();
|
||||
}
|
||||
|
@ -50,12 +50,12 @@ bool ResourceManager::loadImage(const Common::Path &name, Graphics::ManagedSurfa
|
||||
}
|
||||
|
||||
if (surfID >= 0) {
|
||||
surf.copyFrom(g_nancy->_graphicsManager->getAutotextSurface(surfID));
|
||||
surf.copyFrom(g_nancy->_graphics->getAutotextSurface(surfID));
|
||||
if (outSrc) {
|
||||
// Slightly hacky, but we pass the size of the drawn text using the outSrc parameter;
|
||||
// value is only guaranteed to be valid for an active surface.
|
||||
// This is used for PeepholePuzzle scrolling.
|
||||
*outSrc = g_nancy->_graphicsManager->getAutotextSurfaceBounds(surfID);
|
||||
*outSrc = g_nancy->_graphics->getAutotextSurfaceBounds(surfID);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -169,7 +169,7 @@ bool ResourceManager::loadImage(const Common::Path &name, Graphics::ManagedSurfa
|
||||
}
|
||||
#endif
|
||||
|
||||
GraphicsManager::copyToManaged(buf, surf, info.width, info.height, g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
GraphicsManager::copyToManaged(buf, surf, info.width, info.height, g_nancy->_graphics->getInputPixelFormat());
|
||||
delete[] buf;
|
||||
return true;
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ void Credits::drawTextSurface(uint id) {
|
||||
Graphics::ManagedSurface image;
|
||||
uint surfaceHeight = _textSurface.getBounds().height();
|
||||
g_nancy->_resource->loadImage(_creditsData->textNames[id], image);
|
||||
_fullTextSurface.create(image.w, image.h + (surfaceHeight * 2), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_fullTextSurface.setTransparentColor(g_nancy->_graphicsManager->getTransColor());
|
||||
_fullTextSurface.create(image.w, image.h + (surfaceHeight * 2), g_nancy->_graphics->getInputPixelFormat());
|
||||
_fullTextSurface.setTransparentColor(g_nancy->_graphics->getTransColor());
|
||||
_fullTextSurface.clear(_fullTextSurface.getTransparentColor());
|
||||
_fullTextSurface.blitFrom(image, Common::Point(0, surfaceHeight));
|
||||
|
||||
|
@ -100,7 +100,7 @@ void Help::begin() {
|
||||
_button->registerGraphics();
|
||||
_image.setVisible(true);
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
|
||||
_state = kRun;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void LoadSaveMenu::process() {
|
||||
stop();
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
void LoadSaveMenu::onStateEnter(const NancyState::NancyState prevState) {
|
||||
@ -141,7 +141,7 @@ void LoadSaveMenu::registerGraphics() {
|
||||
_blinkingCursorOverlay.registerGraphics();
|
||||
_successOverlay.registerGraphics();
|
||||
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
}
|
||||
|
||||
void LoadSaveMenu::init() {
|
||||
@ -150,11 +150,11 @@ void LoadSaveMenu::init() {
|
||||
|
||||
_background.init(_loadSaveData->_imageName);
|
||||
|
||||
_baseFont = g_nancy->_graphicsManager->getFont(_loadSaveData->_mainFontID);
|
||||
_baseFont = g_nancy->_graphics->getFont(_loadSaveData->_mainFontID);
|
||||
|
||||
if (_loadSaveData->_highlightFontID != -1) {
|
||||
_highlightFont = g_nancy->_graphicsManager->getFont(_loadSaveData->_highlightFontID);
|
||||
_disabledFont = g_nancy->_graphicsManager->getFont(_loadSaveData->_disabledFontID);
|
||||
_highlightFont = g_nancy->_graphics->getFont(_loadSaveData->_highlightFontID);
|
||||
_disabledFont = g_nancy->_graphics->getFont(_loadSaveData->_disabledFontID);
|
||||
} else {
|
||||
_highlightFont = _disabledFont = _baseFont;
|
||||
}
|
||||
@ -167,8 +167,8 @@ void LoadSaveMenu::init() {
|
||||
RenderObject *newTb = new RenderObject(5);
|
||||
_textboxes[i] = newTb;
|
||||
const Common::Rect &bounds = _loadSaveData->_textboxBounds[i];
|
||||
newTb->_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphicsManager->getScreenPixelFormat());
|
||||
newTb->_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
newTb->_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphics->getScreenPixelFormat());
|
||||
newTb->_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
newTb->moveTo(bounds);
|
||||
newTb->setTransparent(true);
|
||||
newTb->setVisible(true);
|
||||
@ -233,12 +233,12 @@ void LoadSaveMenu::init() {
|
||||
// Load the blinking cursor graphic that appears while typing a filename
|
||||
_blinkingCursorOverlay._drawSurface.create(_loadSaveData->_blinkingCursorSrc.width(),
|
||||
_loadSaveData->_blinkingCursorSrc.height(),
|
||||
g_nancy->_graphicsManager->getScreenPixelFormat());
|
||||
g_nancy->_graphics->getScreenPixelFormat());
|
||||
_blinkingCursorOverlay.setTransparent(true);
|
||||
_blinkingCursorOverlay.setVisible(false);
|
||||
_blinkingCursorOverlay._drawSurface.clear(_blinkingCursorOverlay._drawSurface.getTransparentColor());
|
||||
_blinkingCursorOverlay._drawSurface.transBlitFrom(_highlightFont->getImageSurface(), _loadSaveData->_blinkingCursorSrc,
|
||||
Common::Point(), g_nancy->_graphicsManager->getTransColor());
|
||||
Common::Point(), g_nancy->_graphics->getTransColor());
|
||||
|
||||
// Load the "Your game has been saved" popup graphic
|
||||
if (!_loadSaveData->_gameSavedPopup.empty()) {
|
||||
@ -477,7 +477,7 @@ void LoadSaveMenu::save() {
|
||||
return;
|
||||
} else {
|
||||
// Dialog has returned
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
_destroyOnExit = true;
|
||||
uint ret = ConfMan.getInt("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
ConfMan.removeKey("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
@ -570,7 +570,7 @@ void LoadSaveMenu::load() {
|
||||
} else {
|
||||
// Dialog has returned
|
||||
_destroyOnExit = true;
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
uint ret = ConfMan.getInt("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
ConfMan.removeKey("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
switch (ret) {
|
||||
@ -624,7 +624,7 @@ void LoadSaveMenu::stop() {
|
||||
uint16 LoadSaveMenu::writeToTextbox(uint textboxID, const Common::String &text, const Font *font) {
|
||||
assert(font);
|
||||
|
||||
_textboxes[textboxID]->_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_textboxes[textboxID]->_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
Common::Point destPoint(_loadSaveData->_fontXOffset, _loadSaveData->_fontYOffset + _textboxes[textboxID]->_drawSurface.h - font->getFontHeight());
|
||||
font->drawString(&_textboxes[textboxID]->_drawSurface, text, destPoint.x, destPoint.y, _textboxes[textboxID]->_drawSurface.w, 0);
|
||||
_textboxes[textboxID]->setVisible(true);
|
||||
|
@ -74,7 +74,7 @@ void MainMenu::registerGraphics() {
|
||||
button->registerGraphics();
|
||||
}
|
||||
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
}
|
||||
|
||||
void MainMenu::clearButtonState() {
|
||||
@ -90,7 +90,7 @@ void MainMenu::init() {
|
||||
_background.init(_menuData->_imageName);
|
||||
_background.registerGraphics();
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->setMouseEnabled(true);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying("MSND")) {
|
||||
@ -163,7 +163,7 @@ void MainMenu::run() {
|
||||
}
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
void MainMenu::stop() {
|
||||
@ -212,7 +212,7 @@ void MainMenu::stop() {
|
||||
} else {
|
||||
// Dialog has returned
|
||||
_destroyOnExit = true;
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
uint ret = ConfMan.getInt("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
ConfMan.removeKey("sdlg_return", Common::ConfigManager::kTransientDomain);
|
||||
switch (ret) {
|
||||
|
@ -93,7 +93,7 @@ bool Map::onStateExit(const NancyState::NancyState nextState) {
|
||||
_viewport._decoder.pauseVideo(true);
|
||||
}
|
||||
} else {
|
||||
g_nancy->_graphicsManager->clearObjects();
|
||||
g_nancy->_graphics->clearObjects();
|
||||
_viewport.unloadVideo();
|
||||
_state = kLoad;
|
||||
}
|
||||
@ -108,7 +108,7 @@ const SoundDescription &Map::getSound() {
|
||||
void Map::load() {
|
||||
// Get a screenshot of the Scene state and set it as the background
|
||||
// to allow the labels to clear when not hovered
|
||||
const Graphics::ManagedSurface *screen = g_nancy->_graphicsManager->getScreen();
|
||||
const Graphics::ManagedSurface *screen = g_nancy->_graphics->getScreen();
|
||||
_background._drawSurface.create(screen->w, screen->h, screen->format);
|
||||
_background._drawSurface.blitFrom(*screen);
|
||||
_background.moveTo(_background._drawSurface.getBounds());
|
||||
@ -135,7 +135,7 @@ void Map::setLabel(int labelID) {
|
||||
_closedLabel.setVisible(false);
|
||||
} else {
|
||||
_label.moveTo(_locationLabelDests[labelID]);
|
||||
_label._drawSurface.create(g_nancy->_graphicsManager->_object0, _mapData->locations[labelID].labelSrc);
|
||||
_label._drawSurface.create(g_nancy->_graphics->_object0, _mapData->locations[labelID].labelSrc);
|
||||
_label.setVisible(true);
|
||||
_label.setTransparent(true);
|
||||
|
||||
@ -150,7 +150,7 @@ void Map::MapViewport::init() {
|
||||
assert(viewportData);
|
||||
|
||||
moveTo(viewportData->screenPosition);
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(_screenPosition.width(), _screenPosition.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
RenderObject::init();
|
||||
}
|
||||
@ -197,7 +197,7 @@ void TVDMap::init() {
|
||||
assert(bootSummary);
|
||||
|
||||
Common::Rect textboxScreenPosition = bootSummary->textboxScreenPosition;
|
||||
_closedLabel._drawSurface.create(g_nancy->_graphicsManager->_object0, _mapData->closedLabelSrc);
|
||||
_closedLabel._drawSurface.create(g_nancy->_graphics->_object0, _mapData->closedLabelSrc);
|
||||
|
||||
Common::Rect closedScreenRect;
|
||||
closedScreenRect.left = textboxScreenPosition.left + ((textboxScreenPosition.width() - _mapData->closedLabelSrc.width()) / 2);
|
||||
@ -242,7 +242,7 @@ void TVDMap::load() {
|
||||
|
||||
_viewport.loadVideo(_mapData->mapNames[_mapID], _mapData->mapPaletteNames[_mapID]);
|
||||
|
||||
g_nancy->_cursorManager->setCursorItemID(-1);
|
||||
g_nancy->_cursor->setCursorItemID(-1);
|
||||
|
||||
_viewport.setVisible(false);
|
||||
_globe.setOpen(true);
|
||||
@ -278,7 +278,7 @@ void TVDMap::run() {
|
||||
}
|
||||
|
||||
setLabel(-1);
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormal);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormal);
|
||||
|
||||
if (!_globe.isPlaying()) {
|
||||
NancyInput input = g_nancy->_input->getInput();
|
||||
@ -290,7 +290,7 @@ void TVDMap::run() {
|
||||
setLabel(i);
|
||||
|
||||
if (_activeLocations[i]){
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_pickedLocationID = i;
|
||||
@ -317,7 +317,7 @@ void TVDMap::MapGlobe::init() {
|
||||
_frameTime = _owner->_mapData->globeFrameTime;
|
||||
_srcRects = _owner->_mapData->globeSrcs;
|
||||
|
||||
_gargoyleEyes._drawSurface.create(g_nancy->_graphicsManager->_object0, _owner->_mapData->globeGargoyleSrc);
|
||||
_gargoyleEyes._drawSurface.create(g_nancy->_graphics->_object0, _owner->_mapData->globeGargoyleSrc);
|
||||
_gargoyleEyes.moveTo(_owner->_mapData->globeGargoyleDest);
|
||||
_gargoyleEyes.setTransparent(true);
|
||||
_gargoyleEyes.setVisible(false);
|
||||
@ -343,7 +343,7 @@ void TVDMap::MapGlobe::onTrigger() {
|
||||
_gargoyleEyes.setVisible(true);
|
||||
_owner->_viewport.setVisible(true);
|
||||
_owner->_viewport.playVideo();
|
||||
g_nancy->_cursorManager->warpCursor(_owner->_mapData->cursorPosition);
|
||||
g_nancy->_cursor->warpCursor(_owner->_mapData->cursorPosition);
|
||||
g_nancy->setMouseEnabled(true);
|
||||
} else {
|
||||
_owner->_state = kExit;
|
||||
@ -362,7 +362,7 @@ void Nancy1Map::init() {
|
||||
_label.init();
|
||||
|
||||
Common::Rect textboxScreenPosition = NancySceneState.getTextbox().getScreenPosition();
|
||||
_closedLabel._drawSurface.create(g_nancy->_graphicsManager->_object0, _mapData->closedLabelSrc);
|
||||
_closedLabel._drawSurface.create(g_nancy->_graphics->_object0, _mapData->closedLabelSrc);
|
||||
|
||||
Common::Rect closedScreenRect;
|
||||
closedScreenRect.left = textboxScreenPosition.left + ((textboxScreenPosition.width() - _mapData->closedLabelSrc.width()) / 2);
|
||||
@ -382,7 +382,7 @@ void Nancy1Map::init() {
|
||||
_locationLabelDests[i].top = _locationLabelDests[i].bottom - _mapData->locations[i].labelSrc.height() + 1;
|
||||
}
|
||||
|
||||
_button = new UI::Button(9, g_nancy->_graphicsManager->_object0, _mapData->buttonSrc, _mapData->buttonDest);
|
||||
_button = new UI::Button(9, g_nancy->_graphics->_object0, _mapData->buttonSrc, _mapData->buttonDest);
|
||||
_button->init();
|
||||
_button->setVisible(true);
|
||||
|
||||
@ -405,8 +405,8 @@ void Nancy1Map::load() {
|
||||
_viewport.loadVideo(_mapData->mapNames[_mapID]);
|
||||
|
||||
setLabel(-1);
|
||||
g_nancy->_cursorManager->setCursorItemID(-1);
|
||||
g_nancy->_cursorManager->warpCursor(_mapData->cursorPosition);
|
||||
g_nancy->_cursor->setCursorItemID(-1);
|
||||
g_nancy->_cursor->warpCursor(_mapData->cursorPosition);
|
||||
|
||||
if (!g_nancy->_sound->isSoundPlaying(getSound())) {
|
||||
g_nancy->_sound->loadSound(getSound());
|
||||
@ -438,7 +438,7 @@ void Nancy1Map::run() {
|
||||
setLabel(i);
|
||||
|
||||
if (_activeLocations[i]){
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
_pickedLocationID = i;
|
||||
|
@ -61,7 +61,7 @@ void SaveDialog::process() {
|
||||
break;
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
void SaveDialog::onStateEnter(const NancyState::NancyState prevState) {
|
||||
|
@ -181,10 +181,10 @@ void Scene::onStateEnter(const NancyState::NancyState prevState) {
|
||||
|
||||
_actionManager.onPause(false);
|
||||
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
|
||||
if (getHeldItem() != -1) {
|
||||
g_nancy->_cursorManager->setCursorItemID(getHeldItem());
|
||||
g_nancy->_cursor->setCursorItemID(getHeldItem());
|
||||
}
|
||||
|
||||
if (prevState == NancyState::kPause) {
|
||||
@ -202,7 +202,7 @@ void Scene::onStateEnter(const NancyState::NancyState prevState) {
|
||||
bool Scene::onStateExit(const NancyState::NancyState nextState) {
|
||||
if (_state == kRun) {
|
||||
// Exiting the state outside the kRun state means we've encountered an error
|
||||
g_nancy->_graphicsManager->screenshotScreen(_lastScreenshot);
|
||||
g_nancy->_graphics->screenshotScreen(_lastScreenshot);
|
||||
}
|
||||
|
||||
if (nextState != NancyState::kPause) {
|
||||
@ -354,7 +354,7 @@ void Scene::removeItemFromInventory(int16 id, bool pickUp) {
|
||||
}
|
||||
|
||||
void Scene::setHeldItem(int16 id) {
|
||||
_flags.heldItem = id; g_nancy->_cursorManager->setCursorItemID(id);
|
||||
_flags.heldItem = id; g_nancy->_cursor->setCursorItemID(id);
|
||||
}
|
||||
|
||||
void Scene::setNoHeldItem() {
|
||||
@ -662,7 +662,7 @@ void Scene::synchronize(Common::Serializer &ser) {
|
||||
|
||||
ser.syncArray(_flags.items.data(), g_nancy->getStaticData().numItems, Common::Serializer::Byte);
|
||||
ser.syncAsSint16LE(_flags.heldItem);
|
||||
g_nancy->_cursorManager->setCursorItemID(_flags.heldItem);
|
||||
g_nancy->_cursor->setCursorItemID(_flags.heldItem);
|
||||
|
||||
if (g_nancy->getGameType() >= kGameTypeNancy7) {
|
||||
ser.syncArray(_flags.disabledItems.data(), g_nancy->getStaticData().numItems, Common::Serializer::Byte);
|
||||
@ -751,7 +751,7 @@ void Scene::synchronize(Common::Serializer &ser) {
|
||||
_isRunningAd = false;
|
||||
ConfMan.removeKey("restore_after_ad", Common::ConfigManager::kTransientDomain);
|
||||
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
}
|
||||
|
||||
UI::Clock *Scene::getClock() {
|
||||
@ -823,12 +823,12 @@ void Scene::init() {
|
||||
}
|
||||
|
||||
Common::Rect vpPos = _viewport.getScreenPosition();
|
||||
_hotspotDebug._drawSurface.create(vpPos.width(), vpPos.height(), g_nancy->_graphicsManager->getScreenPixelFormat());
|
||||
_hotspotDebug._drawSurface.create(vpPos.width(), vpPos.height(), g_nancy->_graphics->getScreenPixelFormat());
|
||||
_hotspotDebug.moveTo(vpPos);
|
||||
_hotspotDebug.setTransparent(true);
|
||||
|
||||
registerGraphics();
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
}
|
||||
|
||||
void Scene::setActiveConversation(Action::ConversationSound *activeConversation) {
|
||||
@ -877,7 +877,7 @@ void Scene::load(bool fromSaveFile) {
|
||||
}
|
||||
|
||||
clearSceneData();
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
|
||||
// Scene IDs are prefixed with S inside the cif tree; e.g 100 -> S100
|
||||
Common::Path sceneName(Common::String::format("S%u", _sceneState.nextScene.sceneID));
|
||||
@ -1022,7 +1022,7 @@ void Scene::run() {
|
||||
if (_specialEffects.front().isInitialized()) {
|
||||
if (_specialEffects.front().isDone()) {
|
||||
_specialEffects.pop();
|
||||
g_nancy->_graphicsManager->redrawAll();
|
||||
g_nancy->_graphics->redrawAll();
|
||||
}
|
||||
} else {
|
||||
_specialEffects.front().afterSceneChange();
|
||||
@ -1032,7 +1032,7 @@ void Scene::run() {
|
||||
g_nancy->_sound->soundEffectMaintenance();
|
||||
|
||||
if (_state == kLoad) {
|
||||
g_nancy->_graphicsManager->suppressNextDraw();
|
||||
g_nancy->_graphics->suppressNextDraw();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1041,21 +1041,21 @@ void Scene::handleInput() {
|
||||
|
||||
// Warp the mouse below the inactive zone during dialogue scenes
|
||||
if (_activeConversation != nullptr) {
|
||||
const Common::Rect &inactiveZone = g_nancy->_cursorManager->getPrimaryVideoInactiveZone();
|
||||
const Common::Rect &inactiveZone = g_nancy->_cursor->getPrimaryVideoInactiveZone();
|
||||
|
||||
if (g_nancy->getGameType() == kGameTypeVampire) {
|
||||
const Common::Point cursorHotspot = g_nancy->_cursorManager->getCurrentCursorHotspot();
|
||||
const Common::Point cursorHotspot = g_nancy->_cursor->getCurrentCursorHotspot();
|
||||
Common::Point adjustedMousePos = input.mousePos;
|
||||
adjustedMousePos.y -= cursorHotspot.y;
|
||||
|
||||
if (inactiveZone.bottom > adjustedMousePos.y) {
|
||||
input.mousePos.y = inactiveZone.bottom + cursorHotspot.y;
|
||||
g_nancy->_cursorManager->warpCursor(input.mousePos);
|
||||
g_nancy->_cursor->warpCursor(input.mousePos);
|
||||
}
|
||||
} else {
|
||||
if (inactiveZone.bottom > input.mousePos.y) {
|
||||
input.mousePos.y = inactiveZone.bottom;
|
||||
g_nancy->_cursorManager->warpCursor(input.mousePos);
|
||||
g_nancy->_cursor->warpCursor(input.mousePos);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1076,7 +1076,7 @@ void Scene::handleInput() {
|
||||
for (uint16 id : g_nancy->getStaticData().mapAccessSceneIDs) {
|
||||
if ((int)_sceneState.currentScene.sceneID == id) {
|
||||
if (_mapHotspot.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->getGameType() == kGameTypeVampire ? CursorManager::kHotspot : CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->getGameType() == kGameTypeVampire ? CursorManager::kHotspot : CursorManager::kHotspotArrow);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
requestStateChange(NancyState::kMap);
|
||||
@ -1167,8 +1167,8 @@ void Scene::initStaticData() {
|
||||
_mapHotspot = mapData->buttonDest;
|
||||
}
|
||||
|
||||
_menuButton = new UI::Button(5, g_nancy->_graphicsManager->_object0, bootSummary->menuButtonSrc, bootSummary->menuButtonDest, bootSummary->menuButtonHighlightSrc);
|
||||
_helpButton = new UI::Button(5, g_nancy->_graphicsManager->_object0, bootSummary->helpButtonSrc, bootSummary->helpButtonDest, bootSummary->helpButtonHighlightSrc);
|
||||
_menuButton = new UI::Button(5, g_nancy->_graphics->_object0, bootSummary->menuButtonSrc, bootSummary->menuButtonDest, bootSummary->menuButtonHighlightSrc);
|
||||
_helpButton = new UI::Button(5, g_nancy->_graphics->_object0, bootSummary->helpButtonSrc, bootSummary->helpButtonDest, bootSummary->helpButtonHighlightSrc);
|
||||
g_nancy->setMouseEnabled(true);
|
||||
|
||||
// Init ornaments and clock (TVD only)
|
||||
|
@ -141,7 +141,7 @@ void SetupMenu::init() {
|
||||
|
||||
_background.registerGraphics();
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->setMouseEnabled(true);
|
||||
|
||||
g_nancy->_sound->stopSound("MSND");
|
||||
@ -242,7 +242,7 @@ void SetupMenu::run() {
|
||||
}
|
||||
}
|
||||
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormalArrow);
|
||||
}
|
||||
|
||||
void SetupMenu::stop() {
|
||||
|
@ -69,7 +69,7 @@ void AnimatedButton::updateGraphics() {
|
||||
void AnimatedButton::handleInput(NancyInput &input) {
|
||||
if (_hotspot.contains(input.mousePos)) {
|
||||
if (_alwaysHighlightCursor || _currentFrame == -1 || _currentFrame == (int)_srcRects.size()) {
|
||||
g_nancy->_cursorManager->setCursorType(g_nancy->getGameType() == kGameTypeVampire ? CursorManager::kHotspot : CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(g_nancy->getGameType() == kGameTypeVampire ? CursorManager::kHotspot : CursorManager::kHotspotArrow);
|
||||
}
|
||||
|
||||
if (isPlaying()) {
|
||||
@ -77,7 +77,7 @@ void AnimatedButton::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (!_highlightSrcRect.isEmpty() && !isVisible()) {
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _highlightSrcRect);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _highlightSrcRect);
|
||||
moveTo(_highlightDestRect);
|
||||
setVisible(true);
|
||||
}
|
||||
@ -103,7 +103,7 @@ void AnimatedButton::handleInput(NancyInput &input) {
|
||||
|
||||
void AnimatedButton::setFrame(int frame) {
|
||||
if (frame > -1 && frame < (int)_srcRects.size()) {
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _srcRects[frame]);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _srcRects[frame]);
|
||||
setTransparent(true);
|
||||
|
||||
if (_destRects.size()) {
|
||||
|
@ -51,7 +51,7 @@ void Button::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
if (_screenPosition.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
if (!_hoverSrc.isEmpty() && !_isClicked) {
|
||||
_drawSurface.create(surf, _hoverSrc);
|
||||
@ -100,7 +100,7 @@ void Toggle::handleInput(NancyInput &input) {
|
||||
_stateChanged = false;
|
||||
|
||||
if (_screenPosition.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
setState(!_toggleState);
|
||||
|
@ -41,7 +41,7 @@ Clock::Clock() : RenderObject(g_nancy->getGameType() == kGameTypeVampire ? 11 :
|
||||
_locked(false) {}
|
||||
|
||||
void Clock::init() {
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphics->_object0;
|
||||
|
||||
_clockData = (const CLOK *)g_nancy->getEngineData("CLOK");
|
||||
assert(_clockData);
|
||||
@ -58,7 +58,7 @@ void Clock::init() {
|
||||
clockSurfaceScreenBounds.extend(r);
|
||||
}
|
||||
|
||||
_drawSurface.create(clockSurfaceScreenBounds.width(), clockSurfaceScreenBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(clockSurfaceScreenBounds.width(), clockSurfaceScreenBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
moveTo(clockSurfaceScreenBounds);
|
||||
|
||||
_staticImage._drawSurface.create(object0, _clockData->staticImageSrc);
|
||||
@ -106,7 +106,7 @@ void Clock::handleInput(NancyInput &input) {
|
||||
}
|
||||
|
||||
void Clock::drawClockHands() {
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphics->_object0;
|
||||
uint hours = _playerTime.getHours();
|
||||
if (hours >= 12) {
|
||||
hours -= 12;
|
||||
@ -119,7 +119,7 @@ void Clock::drawClockHands() {
|
||||
hoursDest.translate(-_screenPosition.left, -_screenPosition.top);
|
||||
minutesDest.translate(-_screenPosition.left, -_screenPosition.top);
|
||||
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
_drawSurface.blitFrom(object0, _clockData->hoursHandSrcs[hours], hoursDest);
|
||||
_drawSurface.blitFrom(object0, _clockData->minutesHandSrcs[minutesHand], minutesDest);
|
||||
}
|
||||
@ -198,19 +198,19 @@ void Nancy5Clock::updateGraphics() {
|
||||
if (_currentDay < 3) {
|
||||
if (NancySceneState.getEventFlag(59, true) && _currentDay == 1) {
|
||||
_currentDay = 2;
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _clockData->daySrcs[2]);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _clockData->daySrcs[2]);
|
||||
moveTo(_clockData->staticImageDest);
|
||||
setVisible(true);
|
||||
setTransparent(true);
|
||||
} else if (NancySceneState.getEventFlag(58, true) && _currentDay == 0) {
|
||||
_currentDay = 1;
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _clockData->daySrcs[1]);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _clockData->daySrcs[1]);
|
||||
moveTo(_clockData->staticImageDest);
|
||||
setVisible(true);
|
||||
setTransparent(true);
|
||||
} else if (NancySceneState.getEventFlag(57, true) && _currentDay == -1) {
|
||||
_currentDay = 0;
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _clockData->daySrcs[0]);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _clockData->daySrcs[0]);
|
||||
moveTo(_clockData->staticImageDest);
|
||||
setVisible(true);
|
||||
setTransparent(true);
|
||||
@ -225,7 +225,7 @@ void Nancy5Clock::updateGraphics() {
|
||||
if (countdownFrameID != _countdownProgress) {
|
||||
_countdownProgress = countdownFrameID;
|
||||
|
||||
_drawSurface.create(g_nancy->_graphicsManager->_object0, _clockData->countdownSrcs[_countdownProgress]);
|
||||
_drawSurface.create(g_nancy->_graphics->_object0, _clockData->countdownSrcs[_countdownProgress]);
|
||||
moveTo(_clockData->staticImageDest);
|
||||
setVisible(true);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ void InventoryBox::init() {
|
||||
moveTo(bootSummary->inventoryBoxScreenPosition);
|
||||
g_nancy->_resource->loadImage(_inventoryData->inventoryBoxIconsImageName, _iconsSurface);
|
||||
|
||||
_fullInventorySurface.create(_screenPosition.width(), _screenPosition.height() * ((g_nancy->getStaticData().numItems / 4) + 1), g_nancy->_graphicsManager->getScreenPixelFormat());
|
||||
_fullInventorySurface.create(_screenPosition.width(), _screenPosition.height() * ((g_nancy->getStaticData().numItems / 4) + 1), g_nancy->_graphics->getScreenPixelFormat());
|
||||
Common::Rect sourceRect = _screenPosition;
|
||||
sourceRect.moveTo(0, 0);
|
||||
_drawSurface.create(_fullInventorySurface, sourceRect);
|
||||
@ -112,13 +112,13 @@ void InventoryBox::handleInput(NancyInput &input) {
|
||||
for (uint i = 0; i < 4; ++i) {
|
||||
if (_itemHotspots[i].hotspot.contains(input.mousePos)) {
|
||||
if (NancySceneState.getHeldItem() != -1) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
if (input.input & NancyInput::kLeftMouseButtonUp) {
|
||||
NancySceneState.addItemToInventory(NancySceneState.getHeldItem());
|
||||
g_nancy->_sound->playSound("BULS");
|
||||
}
|
||||
} else if (_itemHotspots[i].itemID != -1) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
hoveredHotspot = i;
|
||||
|
||||
@ -264,11 +264,11 @@ void InventoryBox::Curtains::init() {
|
||||
moveTo(inventoryData->curtainsScreenPosition);
|
||||
Common::Rect bounds = _screenPosition;
|
||||
bounds.moveTo(0, 0);
|
||||
_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
if (g_nancy->getGameType() == kGameTypeVampire) {
|
||||
uint8 palette[256 * 3];
|
||||
g_nancy->_graphicsManager->_object0.grabPalette(palette, 0, 256);
|
||||
g_nancy->_graphics->_object0.grabPalette(palette, 0, 256);
|
||||
_drawSurface.setPalette(palette, 0, 256);
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ void InventoryBox::Curtains::updateGraphics() {
|
||||
}
|
||||
|
||||
void InventoryBox::Curtains::setAnimationFrame(uint frame) {
|
||||
Graphics::ManagedSurface &_object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &_object0 = g_nancy->_graphics->_object0;
|
||||
Common::Rect srcRect;
|
||||
Common::Point destPoint;
|
||||
|
||||
@ -334,7 +334,7 @@ void InventoryBox::Curtains::setAnimationFrame(uint frame) {
|
||||
auto *inventoryData = GetEngineData(INV);
|
||||
assert(inventoryData);
|
||||
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
|
||||
// Draw left curtain
|
||||
srcRect = inventoryData->curtainAnimationSrcs[frame * 2];
|
||||
|
@ -35,9 +35,9 @@ void ViewportOrnaments::init() {
|
||||
Common::Rect viewportBounds = viewportData->bounds;
|
||||
moveTo(viewportData->screenPosition);
|
||||
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphics->_object0;
|
||||
|
||||
_drawSurface.create(viewportBounds.width(), viewportBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(viewportBounds.width(), viewportBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
uint8 palette[256 * 3];
|
||||
object0.grabPalette(palette, 0, 256);
|
||||
@ -53,7 +53,7 @@ void ViewportOrnaments::init() {
|
||||
{ 33, 39, 40, 59 }
|
||||
};
|
||||
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
|
||||
// Top left
|
||||
@ -83,15 +83,15 @@ void TextboxOrnaments::init() {
|
||||
Common::Rect textboxBounds = _screenPosition;
|
||||
textboxBounds.moveTo(0, 0);
|
||||
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphics->_object0;
|
||||
|
||||
_drawSurface.create(textboxBounds.width(), textboxBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(textboxBounds.width(), textboxBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
uint8 palette[256 * 3];
|
||||
object0.grabPalette(palette, 0, 256);
|
||||
_drawSurface.setPalette(palette, 0, 256);
|
||||
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
|
||||
for (uint i = 0; i < 14; ++i) {
|
||||
@ -114,15 +114,15 @@ void InventoryBoxOrnaments::init() {
|
||||
Common::Rect invBoxBounds = _screenPosition;
|
||||
invBoxBounds.moveTo(0, 0);
|
||||
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphicsManager->_object0;
|
||||
Graphics::ManagedSurface &object0 = g_nancy->_graphics->_object0;
|
||||
|
||||
_drawSurface.create(invBoxBounds.width(), invBoxBounds.height(), g_nancy->_graphicsManager->getInputPixelFormat());
|
||||
_drawSurface.create(invBoxBounds.width(), invBoxBounds.height(), g_nancy->_graphics->getInputPixelFormat());
|
||||
|
||||
uint8 palette[256 * 3];
|
||||
object0.grabPalette(palette, 0, 256);
|
||||
_drawSurface.setPalette(palette, 0, 256);
|
||||
|
||||
_drawSurface.clear(g_nancy->_graphicsManager->getTransColor());
|
||||
_drawSurface.clear(g_nancy->_graphics->getTransColor());
|
||||
setTransparent(true);
|
||||
|
||||
for (uint i = 0; i < 6; ++i) {
|
||||
|
@ -30,7 +30,7 @@ namespace Nancy {
|
||||
namespace UI {
|
||||
|
||||
Scrollbar::Scrollbar(uint16 zOrder, const Common::Rect &srcBounds, const Common::Point &topPosition, uint16 scrollDistance, bool isVertical) :
|
||||
Scrollbar(zOrder, srcBounds, g_nancy->_graphicsManager->_object0, topPosition, scrollDistance, isVertical) {}
|
||||
Scrollbar(zOrder, srcBounds, g_nancy->_graphics->_object0, topPosition, scrollDistance, isVertical) {}
|
||||
|
||||
Scrollbar::Scrollbar(uint16 zOrder, const Common::Rect &srcBounds, Graphics::ManagedSurface &srcSurf, const Common::Point &topPosition, uint16 scrollDistance, bool isVertical) :
|
||||
RenderObject(zOrder),
|
||||
@ -61,7 +61,7 @@ void Scrollbar::handleInput(NancyInput &input) {
|
||||
// the hotspot (happens if we remove the _isClicked check below). This doesn't make
|
||||
// for great UX, however, so it has been fixed.
|
||||
if (_screenPosition.contains(input.mousePos) || _isClicked) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
if (input.input & NancyInput::kLeftMouseButtonDown && !_isClicked) {
|
||||
// Begin click and hold
|
||||
|
@ -56,7 +56,7 @@ void Textbox::init() {
|
||||
|
||||
moveTo(bsum->textboxScreenPosition);
|
||||
_highlightRObj.moveTo(bsum->textboxScreenPosition);
|
||||
initSurfaces(tbox->innerBoundingBox.width(), tbox->innerBoundingBox.height(), g_nancy->_graphicsManager->getScreenPixelFormat(),
|
||||
initSurfaces(tbox->innerBoundingBox.width(), tbox->innerBoundingBox.height(), g_nancy->_graphics->getScreenPixelFormat(),
|
||||
tbox->textBackground, tbox->highlightTextBackground);
|
||||
|
||||
Common::Rect outerBoundingBox = _screenPosition;
|
||||
@ -107,7 +107,7 @@ void Textbox::handleInput(NancyInput &input) {
|
||||
hotspot.translate(0, -_drawSurface.getOffsetFromOwner().y);
|
||||
Common::Rect hotspotOnScreen = convertToScreen(hotspot).findIntersectingRect(_screenPosition);
|
||||
if (hotspotOnScreen.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kHotspotArrow);
|
||||
|
||||
// Highlight the selected response
|
||||
if (g_nancy->getGameType() >= kGameTypeNancy2) {
|
||||
@ -144,7 +144,7 @@ void Textbox::drawTextbox() {
|
||||
textBounds.left += tbox->leftOffset;
|
||||
textBounds.right -= tbox->rightOffset;
|
||||
|
||||
const Font *font = g_nancy->_graphicsManager->getFont(_fontIDOverride != -1 ? _fontIDOverride : tbox->defaultFontID);
|
||||
const Font *font = g_nancy->_graphics->getFont(_fontIDOverride != -1 ? _fontIDOverride : tbox->defaultFontID);
|
||||
textBounds.top -= font->getFontHeight();
|
||||
|
||||
HypertextParser::drawAllText( textBounds, 0, // bounds of text within full surface
|
||||
|
@ -70,21 +70,21 @@ void Viewport::handleInput(NancyInput &input) {
|
||||
if ( g_nancy->getGameType() != kGameTypeVampire &&
|
||||
input.input & (NancyInput::kLeftMouseButton | NancyInput::kRightMouseButton)
|
||||
&& _stickyCursorPos.x > -1) {
|
||||
g_nancy->_cursorManager->warpCursor(_stickyCursorPos);
|
||||
g_nancy->_cursor->warpCursor(_stickyCursorPos);
|
||||
input.mousePos = _stickyCursorPos;
|
||||
}
|
||||
|
||||
Common::Rect viewportActiveZone;
|
||||
|
||||
if (g_nancy->getGameType() == kGameTypeVampire) {
|
||||
viewportActiveZone = g_nancy->_graphicsManager->getScreen()->getBounds();
|
||||
viewportActiveZone = g_nancy->_graphics->getScreen()->getBounds();
|
||||
viewportActiveZone.bottom = _screenPosition.bottom;
|
||||
} else {
|
||||
viewportActiveZone = _screenPosition;
|
||||
}
|
||||
|
||||
if (viewportActiveZone.contains(input.mousePos)) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kNormal);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kNormal);
|
||||
|
||||
if (input.mousePos.x < _nonScrollZone.left) {
|
||||
direction |= kLeft;
|
||||
@ -133,21 +133,21 @@ void Viewport::handleInput(NancyInput &input) {
|
||||
if (direction & kLeft) {
|
||||
if (summary.fastMoveTimeDelta == kInvertedNode) {
|
||||
// Support nancy6+ inverted rotation scenes
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kInvertedRotateLeft);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kInvertedRotateLeft);
|
||||
} else {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateLeft);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateLeft);
|
||||
}
|
||||
} else if (direction & kRight) {
|
||||
if (summary.fastMoveTimeDelta == kInvertedNode) {
|
||||
// Support nancy6+ inverted rotation scenes
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kInvertedRotateRight);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kInvertedRotateRight);
|
||||
} else {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kRotateRight);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kRotateRight);
|
||||
}
|
||||
} else if (direction & kUp) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveUp);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveUp);
|
||||
} else if (direction & kDown) {
|
||||
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveDown);
|
||||
g_nancy->_cursor->setCursorType(CursorManager::kMoveDown);
|
||||
}
|
||||
|
||||
if (input.input & NancyInput::kRightMouseButton) {
|
||||
|
@ -152,7 +152,7 @@ AVFDecoder::AVFVideoTrack::AVFVideoTrack(Common::SeekableReadStream *stream, uin
|
||||
if (comp != 1 && comp != 2)
|
||||
error("Unknown compression type %d found in AVF", comp);
|
||||
|
||||
_pixelFormat = g_nancy->_graphicsManager->getInputPixelFormat();
|
||||
_pixelFormat = g_nancy->_graphics->getInputPixelFormat();
|
||||
_frameSize = _width * _height * _pixelFormat.bytesPerPixel;
|
||||
|
||||
_chunkInfo.reserve(_frameCount);
|
||||
@ -349,7 +349,7 @@ const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
|
||||
#ifdef SCUMM_BIG_ENDIAN
|
||||
// Convert from BE back to LE so the decode step below works correctly
|
||||
byte *buf = (byte *)frameInCache.getPixels();
|
||||
if (g_nancy->_graphicsManager->getInputPixelFormat().bytesPerPixel == 2) {
|
||||
if (g_nancy->_graphics->getInputPixelFormat().bytesPerPixel == 2) {
|
||||
for (int i = 0; i < frameInCache.pitch * frameInCache.h / 2; ++i) {
|
||||
((uint16 *)buf)[i] = SWAP_BYTES_16(((uint16 *)buf)[i]);
|
||||
}
|
||||
@ -368,7 +368,7 @@ const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
|
||||
|
||||
#ifdef SCUMM_BIG_ENDIAN
|
||||
byte *buf = (byte *)frameInCache.getPixels();
|
||||
if (g_nancy->_graphicsManager->getInputPixelFormat().bytesPerPixel == 2) {
|
||||
if (g_nancy->_graphics->getInputPixelFormat().bytesPerPixel == 2) {
|
||||
for (int i = 0; i < frameInCache.pitch * frameInCache.h / 2; ++i) {
|
||||
((uint16 *)buf)[i] = SWAP_BYTES_16(((uint16 *)buf)[i]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user