2010-02-28 13:51:17 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2010-05-20 16:59:36 +00:00
|
|
|
#include "cell_store.hpp"
|
2010-06-03 18:44:55 +00:00
|
|
|
#include "render/cell.hpp"
|
2010-06-05 18:37:01 +00:00
|
|
|
#include "render/mwscene.hpp"
|
2010-06-03 18:44:55 +00:00
|
|
|
#include "bsa/bsa_archive.hpp"
|
2010-06-03 19:51:59 +00:00
|
|
|
#include "ogre/renderer.hpp"
|
|
|
|
#include "tools/fileops.hpp"
|
2010-06-05 18:37:01 +00:00
|
|
|
#include "input/oismanager.hpp"
|
2010-02-28 13:51:17 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2010-06-03 19:51:59 +00:00
|
|
|
void maintest()
|
2010-06-03 18:44:55 +00:00
|
|
|
{
|
2010-06-03 19:51:59 +00:00
|
|
|
const char* esmFile = "data/Morrowind.esm";
|
|
|
|
const char* bsaFile = "data/Morrowind.bsa";
|
2010-06-03 18:44:55 +00:00
|
|
|
|
2010-06-03 19:51:59 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
const char* plugCfg = "plugins.cfg.win32";
|
|
|
|
#else
|
|
|
|
const char* plugCfg = "plugins.cfg.linux";
|
|
|
|
#endif
|
2010-06-03 18:44:55 +00:00
|
|
|
|
|
|
|
cout << "Hello, fellow traveler!\n";
|
|
|
|
|
|
|
|
cout << "Initializing OGRE\n";
|
2010-06-03 19:51:59 +00:00
|
|
|
Render::OgreRenderer ogre;
|
|
|
|
ogre.configure(!isFile("ogre.cfg"), plugCfg, false);
|
2010-06-03 18:44:55 +00:00
|
|
|
|
|
|
|
cout << "Adding " << bsaFile << endl;
|
|
|
|
addBSA(bsaFile);
|
2010-02-28 13:51:17 +00:00
|
|
|
|
2010-05-17 15:35:42 +00:00
|
|
|
cout << "Loading ESM " << esmFile << "\n";
|
2010-02-28 13:51:17 +00:00
|
|
|
ESM::ESMReader esm;
|
2010-05-17 18:59:15 +00:00
|
|
|
ESMS::ESMStore store;
|
2010-05-20 16:59:36 +00:00
|
|
|
ESMS::CellStore cell;
|
2010-06-03 18:44:55 +00:00
|
|
|
Render::CellRender rend(cell);
|
2010-05-20 16:59:36 +00:00
|
|
|
|
|
|
|
esm.open(esmFile);
|
2010-05-17 18:59:15 +00:00
|
|
|
store.load(esm);
|
2010-05-20 16:59:36 +00:00
|
|
|
cell.loadInt("Beshara", store, esm);
|
2010-02-28 13:51:17 +00:00
|
|
|
|
2010-06-03 19:51:59 +00:00
|
|
|
ogre.createWindow("OpenMW");
|
|
|
|
|
2010-06-05 18:37:01 +00:00
|
|
|
Render::MWScene scene;
|
|
|
|
scene.setup(&ogre);
|
|
|
|
|
|
|
|
Input::OISManager input;
|
|
|
|
input.setup(&ogre);
|
|
|
|
|
|
|
|
// Add the frame listener
|
|
|
|
//root->addFrameListener(&mFrameListener);
|
|
|
|
|
2010-02-28 13:51:17 +00:00
|
|
|
cout << "\nThat's all for now!\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(/*int argc, char**argv*/)
|
|
|
|
{
|
|
|
|
try { maintest(); }
|
|
|
|
catch(exception &e)
|
|
|
|
{
|
|
|
|
cout << "\nERROR: " << e.what() << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|