Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/tools/atlas/GameInterface/View.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | void AtlasViewActor::Update(float realFrameLength) | ||||
m_ActorViewer->Update(realFrameLength * m_SpeedMultiplier, realFrameLength); | m_ActorViewer->Update(realFrameLength * m_SpeedMultiplier, realFrameLength); | ||||
} | } | ||||
void AtlasViewActor::Render() | void AtlasViewActor::Render() | ||||
{ | { | ||||
SViewPort vp = { 0, 0, g_xres, g_yres }; | SViewPort vp = { 0, 0, g_xres, g_yres }; | ||||
CCamera& camera = GetCamera(); | CCamera& camera = GetCamera(); | ||||
camera.SetViewPort(vp); | camera.SetViewPort(vp); | ||||
camera.SetProjection(2.f, 512.f, DEGTORAD(20.f)); | camera.SetPerspectiveProjection(2.f, 512.f, DEGTORAD(20.f)); | ||||
camera.UpdateFrustum(); | camera.UpdateFrustum(); | ||||
m_ActorViewer->Render(); | m_ActorViewer->Render(); | ||||
Atlas_GLSwapBuffers((void*)g_AtlasGameLoop->glCanvas); | Atlas_GLSwapBuffers((void*)g_AtlasGameLoop->glCanvas); | ||||
} | } | ||||
CCamera& AtlasViewActor::GetCamera() | CCamera& AtlasViewActor::GetCamera() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | void AtlasViewGame::Update(float realFrameLength) | ||||
g_Game->GetView()->GetCinema()->Update(realFrameLength); | g_Game->GetView()->GetCinema()->Update(realFrameLength); | ||||
} | } | ||||
void AtlasViewGame::Render() | void AtlasViewGame::Render() | ||||
{ | { | ||||
SViewPort vp = { 0, 0, g_xres, g_yres }; | SViewPort vp = { 0, 0, g_xres, g_yres }; | ||||
CCamera& camera = GetCamera(); | CCamera& camera = GetCamera(); | ||||
camera.SetViewPort(vp); | camera.SetViewPort(vp); | ||||
camera.SetProjection(g_Game->GetView()->GetNear(), g_Game->GetView()->GetFar(), g_Game->GetView()->GetFOV()); | CGameView* gameView = g_Game->GetView(); | ||||
camera.SetPerspectiveProjection(gameView->GetNear(), gameView->GetFar(), gameView->GetFOV()); | |||||
camera.UpdateFrustum(); | camera.UpdateFrustum(); | ||||
::Render(); | ::Render(); | ||||
Atlas_GLSwapBuffers((void*)g_AtlasGameLoop->glCanvas); | Atlas_GLSwapBuffers((void*)g_AtlasGameLoop->glCanvas); | ||||
} | } | ||||
void AtlasViewGame::DrawCinemaPathTool() | void AtlasViewGame::DrawCinemaPathTool() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator