1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00
OpenMW/game/main.cpp
2010-05-17 20:59:15 +02:00

57 lines
983 B
C++

#include <iostream>
#include "bsa/bsa_archive.h"
#include "esm_store.hpp"
#include "Ogre.h"
using namespace std;
// Absolute minimal OGRE setup
void ogre_setup()
{
using namespace Ogre;
// Disable Ogre logging
new LogManager;
Log *log = LogManager::getSingleton().createLog("");
log->setDebugOutputEnabled(false);
// Set up Root.
new Root();
}
void maintest()
{
const char* bsaFile = "data/Morrowind.bsa";
const char* esmFile = "data/Morrowind.esm";
cout << "Hello, fellow traveler!\n";
cout << "Initializing OGRE\n";
ogre_setup();
cout << "Adding " << bsaFile << endl;
addBSA(bsaFile);
cout << "Loading ESM " << esmFile << "\n";
ESM::ESMReader esm;
esm.open(esmFile);
ESMS::ESMStore store;
store.load(esm);
esm.close();
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;
}