1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 09:32:45 +00:00
This commit is contained in:
Petr Mikheev 2023-02-15 09:52:26 +01:00
parent 0ed1310417
commit 0c3237ad78
2 changed files with 14 additions and 7 deletions

View File

@ -213,7 +213,10 @@ namespace MWRender
void Camera::setMode(Mode newMode, bool force) void Camera::setMode(Mode newMode, bool force)
{ {
if (mMode == newMode) if (mMode == newMode)
{
mQueuedMode = std::nullopt;
return; return;
}
Mode oldMode = mMode; Mode oldMode = mMode;
if (!force && (newMode == Mode::FirstPerson || oldMode == Mode::FirstPerson) && mAnimation if (!force && (newMode == Mode::FirstPerson || oldMode == Mode::FirstPerson) && mAnimation
&& !mAnimation->upperBodyReady()) && !mAnimation->upperBodyReady())

View File

@ -76,6 +76,12 @@ local function updatePOV(dt)
end end
end end
camera.setMode(primaryMode) camera.setMode(primaryMode)
if camera.getMode() == MODE.Preview then
-- If Preview -> FirstPerson change is queued (because of 3rd person animation),
-- then first exit Preview by switching to ThirdPerson, and then queue the switch to FirstPerson.
camera.setMode(MODE.ThirdPerson)
camera.setMode(MODE.FirstPerson)
end
previewTimer = 0 previewTimer = 0
end end
end end
@ -186,17 +192,15 @@ local function onFrame(dt)
if core.isWorldPaused() then return end if core.isWorldPaused() then return end
updateIdleTimer(dt) updateIdleTimer(dt)
local mode = camera.getMode() local mode = camera.getMode()
if mode == MODE.FirstPerson or mode == MODE.ThirdPerson then if (mode == MODE.FirstPerson or mode == MODE.ThirdPerson) and not camera.getQueuedMode() then
primaryMode = mode primaryMode = mode
end end
if mode ~= MODE.Static then if mode ~= MODE.Static then
if not camera.getQueuedMode() or camera.getQueuedMode() == MODE.Preview then if noModeControl == 0 then
if noModeControl == 0 then updatePOV(dt)
updatePOV(dt) updateVanity(dt)
updateVanity(dt)
end
updateStandingPreview()
end end
updateStandingPreview()
updateCrosshair() updateCrosshair()
end end
applyControllerZoom(dt) applyControllerZoom(dt)