forked from mirror/openmw-tes3mp
Added very early CMakeLists.txt, builds main executable from game/main.cpp
This commit is contained in:
parent
db56985828
commit
320fb3f8b8
4 changed files with 77 additions and 2 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,4 +1,8 @@
|
|||
*.o
|
||||
*~
|
||||
data
|
||||
mw-scripts
|
||||
CMakeFiles
|
||||
CMakeCache.txt
|
||||
Makefile
|
||||
cmake*.cmake
|
||||
openmw
|
||||
|
|
17
CMakeLists.txt
Normal file
17
CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
# We probably support older versions than this.
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
# Local files
|
||||
set(BSA bsa/bsa_archive.cpp bsa/bsa_file.cpp)
|
||||
set(NIF nif/nif_file.cpp nifogre/ogre_nif_loader.cpp)
|
||||
set(TOOLS tools/stringops.cpp)
|
||||
set(MANGLE_VFS mangle/vfs/servers/ogre_vfs.cpp)
|
||||
set(GAME game/main.cpp)
|
||||
|
||||
# Dependencies
|
||||
# Not exactly platform independent, FIXME!
|
||||
add_definitions(-I/usr/local/include/OGRE)
|
||||
|
||||
# Main executable
|
||||
add_executable(openmw ${BSA} ${TOOLS} ${GAME})
|
||||
target_link_libraries(openmw OgreMain)
|
53
game/main.cpp
Normal file
53
game/main.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "../bsa/bsa_archive.h"
|
||||
#include "../esm/records.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 << " (header only)\n";
|
||||
ESM::ESMReader esm;
|
||||
esm.open(esmFile);
|
||||
|
||||
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;
|
||||
}
|
|
@ -40,7 +40,8 @@
|
|||
Afterwards, you can use the mesh name "somemesh.nif" normally to
|
||||
create entities and so on. The mesh isn't loaded from disk until
|
||||
OGRE needs it for rendering. Thus the above load() command is not
|
||||
very resource intensive.
|
||||
very resource intensive, and can safely be done for a large number
|
||||
of meshes at load time.
|
||||
*/
|
||||
struct NIFLoader : Ogre::ManualResourceLoader
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue