mirror of https://github.com/OpenMW/openmw.git
- Added some non-working code (for later use)
- Removed CMakeLists for now. It's enough work to keep the existing build alternatives updated. We can add it back later when things stabilize. git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@56 ea6a568a-9f4f-0410-981a-c910a81bb256pull/7/head
parent
08ba0278a1
commit
6ba4040f08
@ -1,205 +0,0 @@
|
||||
# CMake build file list for OpenMW
|
||||
|
||||
cmake_minimum_required(VERSION 2.4)
|
||||
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
|
||||
include(CheckLibraryExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFileCXX)
|
||||
include(FindPkgConfig)
|
||||
include(UsePkgConfig)
|
||||
|
||||
project(OpenMW D C CXX)
|
||||
|
||||
include_directories("${OpenMW_SOURCE_DIR}")
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||
|
||||
pkg_check_modules(Ogre OGRE)
|
||||
if(NOT Ogre_FOUND)
|
||||
check_include_file_cxx(Ogre.h HAVE_OGRE_H)
|
||||
if(NOT HAVE_OGRE_H)
|
||||
message(FATAL_ERROR "Ogre.h not found!")
|
||||
endif()
|
||||
set(Ogre_LIBRARIES OgreMain)
|
||||
else()
|
||||
include_directories(${Ogre_INCLUDE_DIRS})
|
||||
link_directories(${Ogre_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_check_modules(OIS OIS)
|
||||
if(NOT OIS_FOUND)
|
||||
check_include_file_cxx(OIS/OIS.h HAVE_OIS_OIS_H)
|
||||
if(NOT HAVE_OIS_OIS_H)
|
||||
message(FATAL_ERROR "OIS/OIS.h not found!")
|
||||
endif()
|
||||
set(OIS_LIBRARIES OIS)
|
||||
else()
|
||||
include_directories(${OIS_INCLUDE_DIRS})
|
||||
link_directories(${OIS_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_check_modules(FFmpeg libavcodec libavformat)
|
||||
if(NOT FFmpeg_FOUND)
|
||||
check_include_file(ffmpeg/avcodec.h HAVE_FFMPEG_AVCODEC_H)
|
||||
check_include_file(ffmpeg/avformat.h HAVE_FFMPEG_AVFORMAT_H)
|
||||
if(NOT HAVE_FFMPEG_AVCODEC_H AND NOT HAVE_FFMPEG_AVFORMAT_H)
|
||||
message(FATAL_ERROR "FFmpeg not found!")
|
||||
endif()
|
||||
set(FFmpeg_LIBRARIES avformat avcodec)
|
||||
else()
|
||||
include_directories(${FFmpeg_INCLUDE_DIRS})
|
||||
link_directories(${FFmpeg_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_check_modules(OpenAL openal)
|
||||
if(NOT OpenAL_FOUND)
|
||||
if(WIN32)
|
||||
set(OpenAL_LIBRARIES OpenAL32)
|
||||
else()
|
||||
set(OpenAL_LIBRARIES openal)
|
||||
endif()
|
||||
else()
|
||||
include_directories(${OpenAL_INCLUDE_DIRS})
|
||||
link_directories(${OpenAL_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
|
||||
SET(OMWBASE_CXX_OBJS ogre/cpp_ogre.cpp
|
||||
sound/cpp_avcodec.cpp
|
||||
)
|
||||
|
||||
set(OMWBASE_OBJS
|
||||
util/reglist.d
|
||||
util/regions.d
|
||||
util/uniquename.d
|
||||
util/random.d
|
||||
core/inifile.d
|
||||
core/resource.d
|
||||
core/config.d
|
||||
core/filefinder.d
|
||||
core/memory.d
|
||||
sound/sfx.d
|
||||
sound/audio.d
|
||||
sound/music.d
|
||||
scene/soundlist.d
|
||||
scene/player.d
|
||||
scene/celldata.d
|
||||
ogre/ogre.d
|
||||
ogre/bindings.d
|
||||
ogre/meshloader.d
|
||||
bsa/bsafile.d
|
||||
input/events.d
|
||||
input/ois.d
|
||||
input/keys.d
|
||||
esm/loadrace.d
|
||||
esm/loadappa.d
|
||||
esm/loadbsgn.d
|
||||
esm/loaddoor.d
|
||||
esm/loadnpcc.d
|
||||
esm/loadlocks.d
|
||||
esm/loadacti.d
|
||||
esm/loadgmst.d
|
||||
esm/records.d
|
||||
esm/loadscpt.d
|
||||
esm/loadinfo.d
|
||||
esm/loadcrea.d
|
||||
esm/loadbody.d
|
||||
esm/filereader.d
|
||||
esm/loadcont.d
|
||||
esm/loadfact.d
|
||||
esm/loadregn.d
|
||||
esm/loadltex.d
|
||||
esm/loadalch.d
|
||||
esm/loadarmo.d
|
||||
esm/loadstat.d
|
||||
esm/loadsoun.d
|
||||
esm/loadspel.d
|
||||
esm/loadskil.d
|
||||
esm/loadingr.d
|
||||
esm/loadclas.d
|
||||
esm/loadnpc.d
|
||||
esm/esmmain.d
|
||||
esm/loadclot.d
|
||||
esm/loadsscr.d
|
||||
esm/loadlevlist.d
|
||||
esm/loadbook.d
|
||||
esm/listkeeper.d
|
||||
esm/defs.d
|
||||
esm/loadglob.d
|
||||
esm/loadsndg.d
|
||||
esm/loadligh.d
|
||||
esm/imports.d
|
||||
esm/loaddial.d
|
||||
esm/loadmisc.d
|
||||
esm/loadweap.d
|
||||
esm/loadmgef.d
|
||||
esm/loadcell.d
|
||||
esm/loadcrec.d
|
||||
esm/loadench.d
|
||||
nif/property.d
|
||||
nif/data.d
|
||||
nif/controller.d
|
||||
nif/nif.d
|
||||
nif/base.d
|
||||
nif/record.d
|
||||
nif/controlled.d
|
||||
nif/misc.d
|
||||
nif/effect.d
|
||||
nif/node.d
|
||||
nif/extra.d
|
||||
nif/niffile.d
|
||||
monster/util/freelist.d
|
||||
monster/util/aa.d
|
||||
monster/util/list.d
|
||||
monster/util/growarray.d
|
||||
monster/util/string.d
|
||||
)
|
||||
|
||||
ADD_LIBRARY(omwbase STATIC ${OMWBASE_CXX_OBJS} ${OMWBASE_OBJS})
|
||||
|
||||
ADD_EXECUTABLE(openmw openmw.d)
|
||||
TARGET_LINK_LIBRARIES(openmw omwbase ${Ogre_LIBRARIES} ${OIS_LIBRARIES} ${OpenAL_LIBRARIES} ${FFmpeg_LIBRARIES})
|
||||
|
||||
ADD_EXECUTABLE(esmtool esmtool.d)
|
||||
TARGET_LINK_LIBRARIES(esmtool omwbase ${Ogre_LIBRARIES} ${OIS_LIBRARIES} ${OpenAL_LIBRARIES} ${FFmpeg_LIBRARIES})
|
||||
|
||||
|
||||
set(NIFTOOL_OBJS
|
||||
nif/property.d
|
||||
nif/data.d
|
||||
nif/controller.d
|
||||
nif/nif.d
|
||||
nif/base.d
|
||||
nif/record.d
|
||||
nif/controlled.d
|
||||
nif/misc.d
|
||||
nif/effect.d
|
||||
nif/node.d
|
||||
nif/extra.d
|
||||
nif/niffile.d
|
||||
util/reglist.d
|
||||
util/regions.d
|
||||
util/uniquename.d
|
||||
util/random.d
|
||||
core/memory.d
|
||||
monster/util/freelist.d
|
||||
monster/util/aa.d
|
||||
monster/util/list.d
|
||||
monster/util/growarray.d
|
||||
monster/util/string.d
|
||||
)
|
||||
|
||||
ADD_LIBRARY(nifbase STATIC ${NIFTOOL_OBJS})
|
||||
|
||||
ADD_EXECUTABLE(niftool niftool.d)
|
||||
TARGET_LINK_LIBRARIES(niftool nifbase)
|
||||
|
||||
ADD_EXECUTABLE(bsatool bsa/bsafile.d bsatool.d)
|
||||
TARGET_LINK_LIBRARIES(bsatool nifbase)
|
||||
|
||||
ADD_EXECUTABLE(bored bored.d)
|
@ -0,0 +1,98 @@
|
||||
/*
|
||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
||||
Copyright (C) 2008 Nicolay Korslund
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (cpp_scale.cpp) is part of the OpenMW package.
|
||||
|
||||
OpenMW is distributed as free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License
|
||||
version 3, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
version 3 along with this program. If not, see
|
||||
http://www.gnu.org/licenses/ .
|
||||
|
||||
*/
|
||||
|
||||
// WARNING: This file does NOT work, and it is not used yet.
|
||||
|
||||
class ScaleCallback : public btTriangleCallback
|
||||
{
|
||||
btTriangleCallback *call;
|
||||
float factor;
|
||||
|
||||
public:
|
||||
ScaleCallback(btTriangleCallback *c, float f)
|
||||
{ call = c; factor = f; }
|
||||
|
||||
void processTriangle(btVector3 *tri, int partid, int triindex)
|
||||
{
|
||||
btVector3 vecs[3];
|
||||
vecs[0] = tri[0]*factor;
|
||||
vecs[1] = tri[1]*factor;
|
||||
vecs[2] = tri[2]*factor;
|
||||
|
||||
call->processTriangle(vecs, partid, triindex);
|
||||
}
|
||||
};
|
||||
|
||||
// This class is used to uniformly scale a triangle mesh by a
|
||||
// factor. It wraps around an existing shape and does not copy the
|
||||
// data.
|
||||
class ScaleShape : public btConcaveShape
|
||||
{
|
||||
btConcaveShape* child;
|
||||
float factor, fact3, facthalf;
|
||||
|
||||
public:
|
||||
|
||||
ScaleShape(btConcaveShape* ch, float ft)
|
||||
{
|
||||
child = ch;
|
||||
factor = ft;
|
||||
fact3 = factor*factor*factor;
|
||||
facthalf = factor*0.5;
|
||||
}
|
||||
|
||||
void calculateLocalInertia(btScalar mass,btVector3& inertia) const
|
||||
{
|
||||
btVector3 tmpInertia;
|
||||
child->calculateLocalInertia(mass,tmpInertia);
|
||||
inertia = tmpInertia * fact3;
|
||||
}
|
||||
|
||||
const char* getName()const { return "ScaleShape"; }
|
||||
|
||||
void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
|
||||
{
|
||||
child->getAabb(t,aabbMin,aabbMax);
|
||||
btVector3 aabbCenter = (aabbMax+aabbMin)*0.5;
|
||||
btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*facthalf;
|
||||
|
||||
aabbMin = aabbCenter - scaledAabbHalfExtends;
|
||||
aabbMax = aabbCenter + scaledAabbHalfExtends;
|
||||
}
|
||||
|
||||
void processAllTriangles(btTriangleCallback *callback,const btVector3& aabbMin,const btVector3& aabbMax) const
|
||||
{
|
||||
ScaleCallback scb(callback, factor);
|
||||
|
||||
child->processAllTriangles(&scb, aabbMin, aabbMax);
|
||||
}
|
||||
|
||||
void setLocalScaling(const btVector3& scaling)
|
||||
{ child->setLocalScaling(scaling); }
|
||||
|
||||
const btVector3& getLocalScaling() const
|
||||
{ return child->getLocalScaling(); }
|
||||
|
||||
int getShapeType() const
|
||||
{ return TRIANGLE_MESH_SHAPE_PROXYTYPE; }
|
||||
};
|
Loading…
Reference in New Issue