Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/GameView.cpp
Show All 19 Lines | |||||
#include "GameView.h" | #include "GameView.h" | ||||
#include "graphics/CameraController.h" | #include "graphics/CameraController.h" | ||||
#include "graphics/CinemaManager.h" | #include "graphics/CinemaManager.h" | ||||
#include "graphics/ColladaManager.h" | #include "graphics/ColladaManager.h" | ||||
#include "graphics/HFTracer.h" | #include "graphics/HFTracer.h" | ||||
#include "graphics/LOSTexture.h" | #include "graphics/LOSTexture.h" | ||||
#include "graphics/LightEnv.h" | #include "graphics/LightEnv.h" | ||||
#include "graphics/MiniMapTexture.h" | |||||
#include "graphics/Model.h" | #include "graphics/Model.h" | ||||
#include "graphics/ObjectManager.h" | #include "graphics/ObjectManager.h" | ||||
#include "graphics/Patch.h" | #include "graphics/Patch.h" | ||||
#include "graphics/SkeletonAnimManager.h" | #include "graphics/SkeletonAnimManager.h" | ||||
#include "graphics/SmoothedValue.h" | #include "graphics/SmoothedValue.h" | ||||
#include "graphics/Terrain.h" | #include "graphics/Terrain.h" | ||||
#include "graphics/TerrainTextureManager.h" | #include "graphics/TerrainTextureManager.h" | ||||
#include "graphics/TerritoryTexture.h" | #include "graphics/TerritoryTexture.h" | ||||
Show All 30 Lines | class CGameViewImpl | ||||
NONCOPYABLE(CGameViewImpl); | NONCOPYABLE(CGameViewImpl); | ||||
public: | public: | ||||
CGameViewImpl(CGame* game) | CGameViewImpl(CGame* game) | ||||
: Game(game), | : Game(game), | ||||
ColladaManager(g_VFS), MeshManager(ColladaManager), SkeletonAnimManager(ColladaManager), | ColladaManager(g_VFS), MeshManager(ColladaManager), SkeletonAnimManager(ColladaManager), | ||||
ObjectManager(MeshManager, SkeletonAnimManager, *game->GetSimulation2()), | ObjectManager(MeshManager, SkeletonAnimManager, *game->GetSimulation2()), | ||||
LOSTexture(*game->GetSimulation2()), | LOSTexture(*game->GetSimulation2()), | ||||
TerritoryTexture(*game->GetSimulation2()), | TerritoryTexture(*game->GetSimulation2()), | ||||
MiniMapTexture(*game->GetSimulation2()), | |||||
ViewCamera(), | ViewCamera(), | ||||
CullCamera(), | CullCamera(), | ||||
LockCullCamera(false), | LockCullCamera(false), | ||||
Culling(true), | Culling(true), | ||||
CameraController(new CCameraController(ViewCamera)) | CameraController(new CCameraController(ViewCamera)) | ||||
{ | { | ||||
} | } | ||||
CGame* Game; | CGame* Game; | ||||
CColladaManager ColladaManager; | CColladaManager ColladaManager; | ||||
CMeshManager MeshManager; | CMeshManager MeshManager; | ||||
CSkeletonAnimManager SkeletonAnimManager; | CSkeletonAnimManager SkeletonAnimManager; | ||||
CObjectManager ObjectManager; | CObjectManager ObjectManager; | ||||
CLOSTexture LOSTexture; | CLOSTexture LOSTexture; | ||||
CTerritoryTexture TerritoryTexture; | CTerritoryTexture TerritoryTexture; | ||||
CMiniMapTexture MiniMapTexture; | |||||
/** | /** | ||||
* this camera controls the eye position when rendering | * this camera controls the eye position when rendering | ||||
*/ | */ | ||||
CCamera ViewCamera; | CCamera ViewCamera; | ||||
/** | /** | ||||
* this camera controls the frustum that is used for culling | * this camera controls the frustum that is used for culling | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
CCamera* CGameView::GetCamera() | CCamera* CGameView::GetCamera() | ||||
{ | { | ||||
return &m->ViewCamera; | return &m->ViewCamera; | ||||
} | } | ||||
CCinemaManager* CGameView::GetCinema() | CCinemaManager* CGameView::GetCinema() | ||||
{ | { | ||||
return &m->CinemaManager; | return &m->CinemaManager; | ||||
}; | } | ||||
CLOSTexture& CGameView::GetLOSTexture() | CLOSTexture& CGameView::GetLOSTexture() | ||||
{ | { | ||||
return m->LOSTexture; | return m->LOSTexture; | ||||
} | } | ||||
CTerritoryTexture& CGameView::GetTerritoryTexture() | CTerritoryTexture& CGameView::GetTerritoryTexture() | ||||
{ | { | ||||
return m->TerritoryTexture; | return m->TerritoryTexture; | ||||
} | } | ||||
CMiniMapTexture& CGameView::GetMiniMapTexture() | |||||
{ | |||||
return m->MiniMapTexture; | |||||
} | |||||
int CGameView::Initialize() | int CGameView::Initialize() | ||||
{ | { | ||||
m->CameraController->LoadConfig(); | m->CameraController->LoadConfig(); | ||||
return 0; | return 0; | ||||
} | } | ||||
void CGameView::RegisterInit() | void CGameView::RegisterInit() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
g_TexMan.UnloadTerrainTextures(); | g_TexMan.UnloadTerrainTextures(); | ||||
g_Renderer.UnloadAlphaMaps(); | g_Renderer.UnloadAlphaMaps(); | ||||
g_Renderer.GetWaterManager()->UnloadWaterTextures(); | g_Renderer.GetWaterManager()->UnloadWaterTextures(); | ||||
} | } | ||||
void CGameView::Update(const float deltaRealTime) | void CGameView::Update(const float deltaRealTime) | ||||
{ | { | ||||
m->MiniMapTexture.Update(deltaRealTime); | |||||
// If camera movement is being handled by the touch-input system, | // If camera movement is being handled by the touch-input system, | ||||
// then we should stop to avoid conflicting with it | // then we should stop to avoid conflicting with it | ||||
if (g_TouchInput.IsEnabled()) | if (g_TouchInput.IsEnabled()) | ||||
return; | return; | ||||
if (!g_app_has_focus) | if (!g_app_has_focus) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator