diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index 865175d232..bc2c5f1c2a 100755 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -74,7 +74,7 @@ CGameView::~CGameView() } -void CGameView::Initialize(CGameAttributes *pAttribs) +int CGameView::Initialize(CGameAttributes *pAttribs) { CConfigValue* cfg; @@ -92,11 +92,12 @@ void CGameView::Initialize(CGameAttributes *pAttribs) getViewParameter( "view.zoom.wheel.speed", m_ViewZoomSensitivityWheel ); getViewParameter( "view.zoom.smoothness", m_ViewZoomSmoothness ); getViewParameter( "view.snap.smoothness", m_ViewSnapSmoothness ); - +#undef getViewParameter + if( ( m_ViewZoomSmoothness < 0.0f ) || ( m_ViewZoomSmoothness > 1.0f ) ) m_ViewZoomSmoothness = 0.02f; if( ( m_ViewSnapSmoothness < 0.0f ) || ( m_ViewSnapSmoothness > 1.0f ) ) m_ViewSnapSmoothness = 0.02f; -#undef getViewParameter + return 0; } @@ -112,9 +113,9 @@ void CGameView::RegisterInit(CGameAttributes *pAttribs) RegMemFun1(this, &CGameView::Initialize, pAttribs, L"CGameView init", 1); // previously done by CGameView::InitResources - RegMemFun(g_TexMan.GetSingletonPtr(), &CTextureManager::LoadTerrainTextures, L"LoadTerrainTextures", 17); - RegMemFun(g_ObjMan.GetSingletonPtr(), &CObjectManager::LoadObjects, L"LoadObjects", 1063); - RegMemFun(g_Renderer.GetSingletonPtr(), &CRenderer::LoadAlphaMaps, L"LoadAlphaMaps", 36); + RegMemFun(g_TexMan.GetSingletonPtr(), &CTextureManager::LoadTerrainTextures, L"LoadTerrainTextures", 80); + RegMemFun(g_ObjMan.GetSingletonPtr(), &CObjectManager::LoadObjects, L"LoadObjects", 1); + RegMemFun(g_Renderer.GetSingletonPtr(), &CRenderer::LoadAlphaMaps, L"LoadAlphaMaps", 40); } diff --git a/source/graphics/GameView.h b/source/graphics/GameView.h index 4b9dd61bfb..b926765422 100755 --- a/source/graphics/GameView.h +++ b/source/graphics/GameView.h @@ -61,7 +61,7 @@ public: ~CGameView(); void RegisterInit(CGameAttributes *pAttribs); - void Initialize(CGameAttributes *pGameAttributes); + int Initialize(CGameAttributes *pGameAttributes); // Update: Update all the view information (i.e. rotate camera, scroll, // whatever). This will *not* change any World information - only the diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp index 2d332a824d..13c00fae41 100755 --- a/source/graphics/ObjectManager.cpp +++ b/source/graphics/ObjectManager.cpp @@ -169,9 +169,10 @@ void CObjectManager::DeleteObject(CObjectEntry* entry) } -void CObjectManager::LoadObjects() +int CObjectManager::LoadObjects() { AddObjectType(""); + return 0; } diff --git a/source/graphics/ObjectManager.h b/source/graphics/ObjectManager.h index 91f413d178..c289376d09 100755 --- a/source/graphics/ObjectManager.h +++ b/source/graphics/ObjectManager.h @@ -57,7 +57,7 @@ public: CObjectManager(); ~CObjectManager(); - void LoadObjects(); + int LoadObjects(); void AddObjectType(const char* name); diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index 4b2f4b10a0..53f844b676 100755 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -97,7 +97,7 @@ void CTextureManager::DeleteTexture(CTextureEntry* entry) delete entry; } -void CTextureManager::LoadTerrainTextures(int terraintype,const char* fileext_filter) +void CTextureManager::LoadTerrainTexturesImpl(int terraintype,const char* fileext_filter) { CStr pathname("art/textures/terrain/types/"); pathname+=m_TerrainTextures[terraintype].m_Name; @@ -135,7 +135,7 @@ void CTextureManager::BuildTerrainTypes() } -void CTextureManager::LoadTerrainTextures() +int CTextureManager::LoadTerrainTextures() { // find all the terrain types by directory name BuildTerrainTypes(); @@ -143,7 +143,9 @@ void CTextureManager::LoadTerrainTextures() // now iterate through terrain types loading all textures of that type for (uint i=0;i m_TerrainTextures; private: - void LoadTerrainTextures(int terraintype,const char* fileext); + void LoadTerrainTexturesImpl(int terraintype,const char* fileext); void BuildTerrainTypes(); }; diff --git a/source/ps/World.cpp b/source/ps/World.cpp index 99b1c31004..18bef89379 100755 --- a/source/ps/World.cpp +++ b/source/ps/World.cpp @@ -22,7 +22,7 @@ CLightEnv g_LightEnv; void CWorld::Initialize(CGameAttributes *pAttribs) { // TODO: Find a better way of handling these global things - ONCE(RegMemFun(CBaseEntityCollection::GetSingletonPtr(), &CBaseEntityCollection::loadTemplates, L"LoadTemplates", 960)); + ONCE(RegMemFun(CBaseEntityCollection::GetSingletonPtr(), &CBaseEntityCollection::loadTemplates, L"LoadTemplates", 30)); // Load the map, if one was specified if (pAttribs->m_MapFile.Length()) diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 84ce21e2d4..922c9468df 100755 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -1153,7 +1153,7 @@ inline void CopyTriple(unsigned char* dst,const unsigned char* src) // LoadAlphaMaps: load the 14 default alpha maps, pack them into one composite texture and // calculate the coordinate of each alphamap within this packed texture .. need to add // validation that all maps are the same size -void CRenderer::LoadAlphaMaps() +int CRenderer::LoadAlphaMaps() { Handle textures[NumAlphaMaps]; @@ -1251,6 +1251,8 @@ void CRenderer::LoadAlphaMaps() glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE); delete[] data; + + return 0; } /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/renderer/Renderer.h b/source/renderer/Renderer.h index 3554b99117..b0db8e4956 100755 --- a/source/renderer/Renderer.h +++ b/source/renderer/Renderer.h @@ -207,7 +207,7 @@ public: bool IsTextureTransparent(CTexture* texture); // load the default set of alphamaps; return false if any alphamap fails to load, true otherwise - void LoadAlphaMaps(); + int LoadAlphaMaps(); void UnloadAlphaMaps(); diff --git a/source/simulation/BaseEntityCollection.cpp b/source/simulation/BaseEntityCollection.cpp index 6d2c5a7201..52f42d3889 100755 --- a/source/simulation/BaseEntityCollection.cpp +++ b/source/simulation/BaseEntityCollection.cpp @@ -27,10 +27,11 @@ static void LoadFileThunk( const char* path, const vfsDirEnt* ent, void* context this_->LoadFile(path); } -void CBaseEntityCollection::loadTemplates() +int CBaseEntityCollection::loadTemplates() { // Load all files in entities/ and its subdirectories. THROW_ERR( VFSUtil::EnumDirEnts( "entities/", "*.xml", true, LoadFileThunk, this ) ); + return 0; } CBaseEntity* CBaseEntityCollection::getTemplate( CStrW name ) diff --git a/source/simulation/BaseEntityCollection.h b/source/simulation/BaseEntityCollection.h index 82e8ca59ed..69272883b5 100755 --- a/source/simulation/BaseEntityCollection.h +++ b/source/simulation/BaseEntityCollection.h @@ -35,7 +35,7 @@ class CBaseEntityCollection : public Singleton public: ~CBaseEntityCollection(); CBaseEntity* getTemplate( CStrW entityType ); - void loadTemplates(); + int loadTemplates(); void LoadFile( const char* path ); // Create a list of the names of all base entities, excluding template_*, diff --git a/source/simulation/Simulation.cpp b/source/simulation/Simulation.cpp index 54b0827464..b67bbeb547 100755 --- a/source/simulation/Simulation.cpp +++ b/source/simulation/Simulation.cpp @@ -33,11 +33,12 @@ CSimulation::~CSimulation() g_SinglePlayerTurnManager=NULL; } -void CSimulation::Initialize(CGameAttributes *pAttribs) +int CSimulation::Initialize(CGameAttributes *pAttribs) { m_pTurnManager->Initialize(m_pGame->GetNumPlayers()); g_EntityManager.InitializeAll(); + return 0; } diff --git a/source/simulation/Simulation.h b/source/simulation/Simulation.h index 9f53d62a9e..9c08031080 100755 --- a/source/simulation/Simulation.h +++ b/source/simulation/Simulation.h @@ -34,7 +34,7 @@ public: { return m_pTurnManager; } void RegisterInit(CGameAttributes *pGameAttributes); - void Initialize(CGameAttributes *pGameAttributes); + int Initialize(CGameAttributes *pGameAttributes); // Perform all CSimulation updates for the specified elapsed time. void Update(double frameTime);