forked from 0ad/0ad
olsner
09f47d6820
- g_Terrain and g_Camera totally eradicated as globals, is now m_Terrain of CWorld and m_Camera of CGameView - terrainMain.cpp is almost completely empty with functionality moved into the relevant core classes - Miscellaneous global functions moved into Core Classes (mostly GameView) This was SVN commit r865.
30 lines
666 B
C++
Executable File
30 lines
666 B
C++
Executable File
#include "precompiled.h"
|
|
|
|
#include "CStr.h"
|
|
#include "CLogger.h"
|
|
#include "Errors.h"
|
|
|
|
#include "World.h"
|
|
#include "MapReader.h"
|
|
#include "Game.h"
|
|
#include "Terrain.h"
|
|
#include "LightEnv.h"
|
|
#include "BaseEntityCollection.h"
|
|
|
|
extern CLightEnv g_LightEnv;
|
|
|
|
void CWorld::Initialize(CGameAttributes *pAttribs)
|
|
{
|
|
g_EntityTemplateCollection.loadTemplates();
|
|
|
|
CStr mapfilename("mods/official/maps/scenarios/");
|
|
mapfilename+=pAttribs->m_MapFile;
|
|
try {
|
|
CMapReader reader;
|
|
reader.LoadMap(mapfilename, &m_Terrain, &m_UnitManager, &g_LightEnv);
|
|
} catch (...) {
|
|
LOG(ERROR, "Failed to load map %s", mapfilename.c_str());
|
|
throw PSERROR_Game_World_MapLoadFailed();
|
|
}
|
|
}
|