# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
#include "precompiled.h"
|
|
|
|
|
|
|
|
#include "View.h"
|
|
|
|
|
|
|
|
#include "ActorViewer.h"
|
|
|
|
#include "GameLoop.h"
|
2006-09-26 03:44:20 +02:00
|
|
|
#include "Messages.h"
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
|
2006-09-30 17:46:40 +02:00
|
|
|
#include "graphics/GameView.h"
|
2006-09-26 03:44:20 +02:00
|
|
|
#include "graphics/SColor.h"
|
2006-09-27 18:54:23 +02:00
|
|
|
#include "graphics/UnitManager.h"
|
2006-09-26 03:44:20 +02:00
|
|
|
#include "renderer/Renderer.h"
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
#include "ps/Game.h"
|
|
|
|
#include "ps/GameSetup/GameSetup.h"
|
|
|
|
#include "simulation/EntityManager.h"
|
|
|
|
#include "simulation/Simulation.h"
|
|
|
|
|
|
|
|
extern void (*Atlas_GLSwapBuffers)(void* context);
|
|
|
|
|
|
|
|
extern int g_xres, g_yres;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-26 03:44:20 +02:00
|
|
|
void View::SetParam(const std::wstring& UNUSED(name), bool UNUSED(value))
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
{
|
2006-09-26 03:44:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void View::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Colour& UNUSED(value))
|
|
|
|
{
|
|
|
|
}
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
ViewActor::ViewActor()
|
|
|
|
: m_SpeedMultiplier(1.f), m_ActorViewer(new ActorViewer())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewActor::~ViewActor()
|
|
|
|
{
|
|
|
|
delete m_ActorViewer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewActor::Update(float frameLength)
|
|
|
|
{
|
|
|
|
m_ActorViewer->Update(frameLength * m_SpeedMultiplier);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewActor::Render()
|
|
|
|
{
|
|
|
|
SViewPort vp = { 0, 0, g_xres, g_yres };
|
|
|
|
CCamera& camera = GetCamera();
|
|
|
|
camera.SetViewPort(&vp);
|
|
|
|
camera.SetProjection(CGameView::defaultNear, CGameView::defaultFar, CGameView::defaultFOV);
|
|
|
|
camera.UpdateFrustum();
|
|
|
|
|
|
|
|
m_ActorViewer->Render();
|
|
|
|
Atlas_GLSwapBuffers((void*)g_GameLoop->glContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCamera& ViewActor::GetCamera()
|
|
|
|
{
|
|
|
|
return m_Camera;
|
|
|
|
}
|
|
|
|
|
2006-09-27 18:54:23 +02:00
|
|
|
CUnit* ViewActor::GetUnit(AtlasMessage::ObjectID UNUSED(id))
|
|
|
|
{
|
|
|
|
return m_ActorViewer->GetUnit();
|
|
|
|
}
|
|
|
|
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
bool ViewActor::WantsHighFramerate()
|
|
|
|
{
|
2006-09-26 03:44:20 +02:00
|
|
|
if (m_SpeedMultiplier != 0.f && m_ActorViewer->HasAnimation())
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewActor::SetSpeedMultiplier(float speed)
|
|
|
|
{
|
|
|
|
m_SpeedMultiplier = speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
ActorViewer& ViewActor::GetActorViewer()
|
|
|
|
{
|
|
|
|
return *m_ActorViewer;
|
|
|
|
}
|
|
|
|
|
2006-09-26 03:44:20 +02:00
|
|
|
void ViewActor::SetParam(const std::wstring& name, bool value)
|
|
|
|
{
|
|
|
|
if (name == L"wireframe")
|
|
|
|
g_Renderer.SetModelRenderMode(value ? WIREFRAME : SOLID);
|
|
|
|
else if (name == L"walk")
|
|
|
|
m_ActorViewer->SetWalkEnabled(value);
|
2006-09-28 22:41:12 +02:00
|
|
|
else if (name == L"ground")
|
|
|
|
m_ActorViewer->SetGroundEnabled(value);
|
|
|
|
else if (name == L"shadows")
|
|
|
|
m_ActorViewer->SetShadowsEnabled(value);
|
|
|
|
else if (name == L"stats")
|
|
|
|
m_ActorViewer->SetStatsEnabled(value);
|
2006-09-26 03:44:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ViewActor::SetParam(const std::wstring& name, const AtlasMessage::Colour& value)
|
|
|
|
{
|
|
|
|
if (name == L"background")
|
|
|
|
{
|
|
|
|
m_ActorViewer->SetBackgroundColour(SColor4ub(value.r, value.g, value.b, 255));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
namespace AtlasMessage
|
|
|
|
{
|
|
|
|
extern void AtlasRenderSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewGame::ViewGame()
|
|
|
|
{
|
|
|
|
debug_assert(g_Game);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewGame::Update(float frameLength)
|
|
|
|
{
|
|
|
|
g_EntityManager.updateAll(0);
|
|
|
|
g_Game->GetSimulation()->Update(0.0);
|
|
|
|
|
|
|
|
if (g_Game->GetView()->GetCinema()->IsPlaying())
|
|
|
|
g_Game->GetView()->GetCinema()->Update(frameLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewGame::Render()
|
|
|
|
{
|
|
|
|
SViewPort vp = { 0, 0, g_xres, g_yres };
|
|
|
|
CCamera& camera = GetCamera();
|
|
|
|
camera.SetViewPort(&vp);
|
|
|
|
camera.SetProjection(CGameView::defaultNear, CGameView::defaultFar, CGameView::defaultFOV);
|
|
|
|
camera.UpdateFrustum();
|
|
|
|
|
|
|
|
::Render();
|
|
|
|
AtlasMessage::AtlasRenderSelection();
|
|
|
|
Atlas_GLSwapBuffers((void*)g_GameLoop->glContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCamera& ViewGame::GetCamera()
|
|
|
|
{
|
|
|
|
return *g_Game->GetView()->GetCamera();
|
|
|
|
}
|
|
|
|
|
2006-09-27 18:54:23 +02:00
|
|
|
CUnit* ViewGame::GetUnit(AtlasMessage::ObjectID id)
|
|
|
|
{
|
|
|
|
return g_UnitMan.FindByID(id);
|
|
|
|
}
|
|
|
|
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
bool ViewGame::WantsHighFramerate()
|
|
|
|
{
|
|
|
|
if (g_Game->GetView()->GetCinema()->IsPlaying())
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
ViewNone* view_None = NULL;
|
|
|
|
ViewGame* view_Game = NULL;
|
|
|
|
ViewActor* view_Actor = NULL;
|
|
|
|
|
|
|
|
View::~View()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-09-26 03:44:20 +02:00
|
|
|
View* View::GetView(int /*eRenderView*/ view)
|
|
|
|
{
|
|
|
|
if (view == AtlasMessage::eRenderView::NONE) return View::GetView_None();
|
|
|
|
else if (view == AtlasMessage::eRenderView::GAME) return View::GetView_Game();
|
|
|
|
else if (view == AtlasMessage::eRenderView::ACTOR) return View::GetView_Actor();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
debug_warn("Invalid view type");
|
|
|
|
return View::GetView_None();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
# Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.
This was SVN commit r4261.
2006-08-28 19:36:42 +02:00
|
|
|
View* View::GetView_None()
|
|
|
|
{
|
|
|
|
if (! view_None)
|
|
|
|
view_None = new ViewNone();
|
|
|
|
return view_None;
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewGame* View::GetView_Game()
|
|
|
|
{
|
|
|
|
if (! view_Game)
|
|
|
|
view_Game = new ViewGame();
|
|
|
|
return view_Game;
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewActor* View::GetView_Actor()
|
|
|
|
{
|
|
|
|
if (! view_Actor)
|
|
|
|
view_Actor = new ViewActor();
|
|
|
|
return view_Actor;
|
|
|
|
}
|
|
|
|
|
|
|
|
void View::DestroyViews()
|
|
|
|
{
|
|
|
|
delete view_None; view_None = NULL;
|
|
|
|
delete view_Game; view_Game = NULL;
|
|
|
|
delete view_Actor; view_Actor = NULL;
|
|
|
|
}
|