mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
89beecad8c
24 changed files with 72 additions and 126 deletions
|
@ -221,6 +221,9 @@ IF(BOOST_STATIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OGRE REQUIRED)
|
find_package(OGRE REQUIRED)
|
||||||
|
if (${OGRE_VERSION} VERSION_LESS "1.9")
|
||||||
|
message(FATAL_ERROR "OpenMW requires Ogre 1.9 or later, please install the latest stable version from http://ogre3d.org")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(MyGUI REQUIRED)
|
find_package(MyGUI REQUIRED)
|
||||||
if (${MYGUI_VERSION} VERSION_LESS "3.2.1")
|
if (${MYGUI_VERSION} VERSION_LESS "3.2.1")
|
||||||
|
|
|
@ -335,6 +335,8 @@ namespace MWClass
|
||||||
data->mNpcStats.setLevel(ref->mBase->mNpdt52.mLevel);
|
data->mNpcStats.setLevel(ref->mBase->mNpdt52.mLevel);
|
||||||
data->mNpcStats.setBaseDisposition(ref->mBase->mNpdt52.mDisposition);
|
data->mNpcStats.setBaseDisposition(ref->mBase->mNpdt52.mDisposition);
|
||||||
data->mNpcStats.setReputation(ref->mBase->mNpdt52.mReputation);
|
data->mNpcStats.setReputation(ref->mBase->mNpdt52.mReputation);
|
||||||
|
|
||||||
|
data->mNpcStats.setNeedRecalcDynamicStats(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -349,6 +351,8 @@ namespace MWClass
|
||||||
|
|
||||||
autoCalculateAttributes(ref->mBase, data->mNpcStats);
|
autoCalculateAttributes(ref->mBase, data->mNpcStats);
|
||||||
autoCalculateSkills(ref->mBase, data->mNpcStats, ptr);
|
autoCalculateSkills(ref->mBase, data->mNpcStats, ptr);
|
||||||
|
|
||||||
|
data->mNpcStats.setNeedRecalcDynamicStats(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// race powers
|
// race powers
|
||||||
|
@ -388,8 +392,6 @@ namespace MWClass
|
||||||
|
|
||||||
data->mNpcStats.setGoldPool(gold);
|
data->mNpcStats.setGoldPool(gold);
|
||||||
|
|
||||||
data->mNpcStats.setNeedRecalcDynamicStats(false);
|
|
||||||
|
|
||||||
// store
|
// store
|
||||||
ptr.getRefData().setCustomData (data.release());
|
ptr.getRefData().setCustomData (data.release());
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,6 @@ namespace MWGui
|
||||||
GenerateClassResultDialog::GenerateClassResultDialog()
|
GenerateClassResultDialog::GenerateClassResultDialog()
|
||||||
: WindowModal("openmw_chargen_generate_class_result.layout")
|
: WindowModal("openmw_chargen_generate_class_result.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
|
||||||
center();
|
|
||||||
|
|
||||||
setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", ""));
|
setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", ""));
|
||||||
|
|
||||||
getWidget(mClassImage, "ClassImage");
|
getWidget(mClassImage, "ClassImage");
|
||||||
|
@ -34,6 +31,8 @@ namespace MWGui
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->setCaptionWithReplacing("#{sMessageQuestionAnswer2}");
|
okButton->setCaptionWithReplacing("#{sMessageQuestionAnswer2}");
|
||||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
||||||
|
|
||||||
|
center();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GenerateClassResultDialog::getClassId() const
|
std::string GenerateClassResultDialog::getClassId() const
|
||||||
|
@ -46,6 +45,8 @@ namespace MWGui
|
||||||
mCurrentClassId = classId;
|
mCurrentClassId = classId;
|
||||||
mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds");
|
mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds");
|
||||||
mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mCurrentClassId)->mName);
|
mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mCurrentClassId)->mName);
|
||||||
|
|
||||||
|
center();
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
|
|
@ -66,11 +66,8 @@ namespace MWGui
|
||||||
|
|
||||||
// Temporarily turn off VSync, we want to do actual loading rather than waiting for the screen to sync.
|
// Temporarily turn off VSync, we want to do actual loading rather than waiting for the screen to sync.
|
||||||
// Threaded loading would be even better, of course - especially because some drivers force VSync to on and we can't change it.
|
// Threaded loading would be even better, of course - especially because some drivers force VSync to on and we can't change it.
|
||||||
// In Ogre 1.8, the swapBuffers argument is useless and setVSyncEnabled is bugged with GLX, nothing we can do :/
|
|
||||||
mVSyncWasEnabled = mWindow->isVSyncEnabled();
|
mVSyncWasEnabled = mWindow->isVSyncEnabled();
|
||||||
#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0)
|
|
||||||
mWindow->setVSyncEnabled(false);
|
mWindow->setVSyncEnabled(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool showWallpaper = (MWBase::Environment::get().getStateManager()->getState()
|
bool showWallpaper = (MWBase::Environment::get().getStateManager()->getState()
|
||||||
== MWBase::StateManager::State_NoGame);
|
== MWBase::StateManager::State_NoGame);
|
||||||
|
@ -113,10 +110,7 @@ namespace MWGui
|
||||||
void LoadingScreen::loadingOff()
|
void LoadingScreen::loadingOff()
|
||||||
{
|
{
|
||||||
// Re-enable vsync now.
|
// Re-enable vsync now.
|
||||||
// In Ogre 1.8, the swapBuffers argument is useless and setVSyncEnabled is bugged with GLX, nothing we can do :/
|
|
||||||
#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0)
|
|
||||||
mWindow->setVSyncEnabled(mVSyncWasEnabled);
|
mWindow->setVSyncEnabled(mVSyncWasEnabled);
|
||||||
#endif
|
|
||||||
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,7 @@ namespace MWGui
|
||||||
float min,max;
|
float min,max;
|
||||||
getSettingMinMax(scroll, min, max);
|
getSettingMinMax(scroll, min, max);
|
||||||
float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current));
|
float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current));
|
||||||
|
value = std::max(min, std::min(value, max));
|
||||||
value = (value-min)/(max-min);
|
value = (value-min)/(max-min);
|
||||||
|
|
||||||
scroll->setScrollPosition( value * (scroll->getScrollRange()-1));
|
scroll->setScrollPosition( value * (scroll->getScrollRange()-1));
|
||||||
|
@ -293,15 +294,6 @@ namespace MWGui
|
||||||
newState = true;
|
newState = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sender == mVSyncButton)
|
|
||||||
{
|
|
||||||
// Ogre::Window::setVSyncEnabled is bugged in 1.8
|
|
||||||
#if OGRE_VERSION < (1 << 16 | 9 << 8 | 0)
|
|
||||||
MWBase::Environment::get().getWindowManager()->
|
|
||||||
messageBox("VSync will be applied after a restart", std::vector<std::string>());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_sender == mShadersButton)
|
if (_sender == mShadersButton)
|
||||||
{
|
{
|
||||||
if (newState == false)
|
if (newState == false)
|
||||||
|
|
|
@ -1116,6 +1116,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
|
int hostilesCount = 0; // need to know this to play Battle music
|
||||||
|
|
||||||
// AI and magic effects update
|
// AI and magic effects update
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
@ -1125,6 +1127,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
// AI processing is only done within distance of 7168 units to the player. Note the "AI distance" slider doesn't affect this
|
// AI processing is only done within distance of 7168 units to the player. Note the "AI distance" slider doesn't affect this
|
||||||
// (it only does some throttling for targets beyond the "AI distance", so doesn't give any guarantees as to whether AI will be enabled or not)
|
// (it only does some throttling for targets beyond the "AI distance", so doesn't give any guarantees as to whether AI will be enabled or not)
|
||||||
|
// This distance could be made configurable later, but the setting must be marked with a big warning:
|
||||||
|
// using higher values will make a quest in Bloodmoon harder or impossible to complete (bug #1876)
|
||||||
if (MWBase::Environment::get().getMechanicsManager()->isAIActive() &&
|
if (MWBase::Environment::get().getMechanicsManager()->isAIActive() &&
|
||||||
Ogre::Vector3(player.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(iter->first.getRefData().getPosition().pos))
|
Ogre::Vector3(player.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(iter->first.getRefData().getPosition().pos))
|
||||||
<= 7168*7168)
|
<= 7168*7168)
|
||||||
|
@ -1147,6 +1151,12 @@ namespace MWMechanics
|
||||||
|
|
||||||
if (iter->first != player)
|
if (iter->first != player)
|
||||||
iter->first.getClass().getCreatureStats(iter->first).getAiSequence().execute(iter->first, duration);
|
iter->first.getClass().getCreatureStats(iter->first).getAiSequence().execute(iter->first, duration);
|
||||||
|
|
||||||
|
CreatureStats &stats = iter->first.getClass().getCreatureStats(iter->first);
|
||||||
|
if(!stats.isDead())
|
||||||
|
{
|
||||||
|
if (stats.getAiSequence().isInCombat()) hostilesCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
||||||
|
@ -1192,19 +1202,6 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int hostilesCount = 0; // need to know this to play Battle music
|
|
||||||
|
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
|
||||||
{
|
|
||||||
const MWWorld::Class &cls = iter->first.getClass();
|
|
||||||
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
|
||||||
|
|
||||||
if(!stats.isDead())
|
|
||||||
{
|
|
||||||
if (stats.getAiSequence().isInCombat()) hostilesCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
killDeadActors();
|
killDeadActors();
|
||||||
|
|
||||||
// check if we still have any player enemies to switch music
|
// check if we still have any player enemies to switch music
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
blockerStats.setBlock(true);
|
blockerStats.setBlock(true);
|
||||||
|
|
||||||
if (blocker.getClass().isNpc())
|
if (blocker.getCellRef().getRefId() == "player")
|
||||||
blocker.getClass().skillUsageSucceeded(blocker, ESM::Skill::Block, 0);
|
blocker.getClass().skillUsageSucceeded(blocker, ESM::Skill::Block, 0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -113,13 +113,7 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b
|
||||||
|
|
||||||
mFactory->loadAllFiles();
|
mFactory->loadAllFiles();
|
||||||
|
|
||||||
// Compressed textures with 0 mip maps are bugged in 1.8, so disable mipmap generator in that case
|
|
||||||
// ( https://ogre3d.atlassian.net/browse/OGRE-259 )
|
|
||||||
#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0)
|
|
||||||
TextureManager::getSingleton().setDefaultNumMipmaps(Settings::Manager::getInt("num mipmaps", "General"));
|
TextureManager::getSingleton().setDefaultNumMipmaps(Settings::Manager::getInt("num mipmaps", "General"));
|
||||||
#else
|
|
||||||
TextureManager::getSingleton().setDefaultNumMipmaps(0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set default texture filtering options
|
// Set default texture filtering options
|
||||||
TextureFilterOptions tfo;
|
TextureFilterOptions tfo;
|
||||||
|
@ -772,13 +766,6 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
||||||
|| it->second == "resolution y"
|
|| it->second == "resolution y"
|
||||||
|| it->second == "fullscreen"))
|
|| it->second == "fullscreen"))
|
||||||
changeRes = true;
|
changeRes = true;
|
||||||
else if (it->first == "Video" && it->second == "vsync")
|
|
||||||
{
|
|
||||||
// setVSyncEnabled is bugged in 1.8
|
|
||||||
#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0)
|
|
||||||
mRendering.getWindow()->setVSyncEnabled(Settings::Manager::getBool("vsync", "Video"));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else if (it->second == "field of view" && it->first == "General")
|
else if (it->second == "field of view" && it->first == "General")
|
||||||
mRendering.setFov(Settings::Manager::getFloat("field of view", "General"));
|
mRendering.setFov(Settings::Manager::getFloat("field of view", "General"));
|
||||||
else if ((it->second == "texture filtering" && it->first == "General")
|
else if ((it->second == "texture filtering" && it->first == "General")
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace ESM
|
||||||
|
|
||||||
void AIPackageList::load(ESMReader &esm)
|
void AIPackageList::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mList.clear();
|
||||||
while (esm.hasMoreSubs()) {
|
while (esm.hasMoreSubs()) {
|
||||||
// initialize every iteration
|
// initialize every iteration
|
||||||
AIPackage pack;
|
AIPackage pack;
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace ESM {
|
||||||
|
|
||||||
void EffectList::load(ESMReader &esm)
|
void EffectList::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mList.clear();
|
||||||
ENAMstruct s;
|
ENAMstruct s;
|
||||||
while (esm.isNextSub("ENAM")) {
|
while (esm.isNextSub("ENAM")) {
|
||||||
esm.getHT(s, 24);
|
esm.getHT(s, 24);
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace ESM
|
||||||
|
|
||||||
void PartReferenceList::load(ESMReader &esm)
|
void PartReferenceList::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mParts.clear();
|
||||||
while (esm.isNextSub("INDX"))
|
while (esm.isNextSub("INDX"))
|
||||||
{
|
{
|
||||||
PartReference pr;
|
PartReference pr;
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace ESM
|
||||||
|
|
||||||
void InventoryList::load(ESMReader &esm)
|
void InventoryList::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mList.clear();
|
||||||
ContItem ci;
|
ContItem ci;
|
||||||
while (esm.isNextSub("NPCO"))
|
while (esm.isNextSub("NPCO"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ void NPC::load(ESMReader &esm)
|
||||||
else
|
else
|
||||||
mHasAI = false;
|
mHasAI = false;
|
||||||
|
|
||||||
|
mTransport.clear();
|
||||||
while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) {
|
while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) {
|
||||||
if (esm.retSubName() == 0x54444f44) { // DODT struct
|
if (esm.retSubName() == 0x54444f44) { // DODT struct
|
||||||
Dest dodt;
|
Dest dodt;
|
||||||
|
|
|
@ -27,6 +27,9 @@ void Pathgrid::load(ESMReader &esm)
|
||||||
esm.getHNT(mData, "DATA", 12);
|
esm.getHNT(mData, "DATA", 12);
|
||||||
mCell = esm.getHNString("NAME");
|
mCell = esm.getHNString("NAME");
|
||||||
|
|
||||||
|
mPoints.clear();
|
||||||
|
mEdges.clear();
|
||||||
|
|
||||||
// keep track of total connections so we can reserve edge vector size
|
// keep track of total connections so we can reserve edge vector size
|
||||||
int edgeCount = 0;
|
int edgeCount = 0;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ void Region::load(ESMReader &esm)
|
||||||
|
|
||||||
esm.getHNT(mMapColor, "CNAM");
|
esm.getHNT(mMapColor, "CNAM");
|
||||||
|
|
||||||
|
mSoundList.clear();
|
||||||
while (esm.hasMoreSubs())
|
while (esm.hasMoreSubs())
|
||||||
{
|
{
|
||||||
SoundRef sr;
|
SoundRef sr;
|
||||||
|
|
|
@ -22,6 +22,8 @@ void Script::load(ESMReader &esm)
|
||||||
mData = data.mData;
|
mData = data.mData;
|
||||||
mId = data.mName.toString();
|
mId = data.mName.toString();
|
||||||
|
|
||||||
|
mVarNames.clear();
|
||||||
|
|
||||||
// List of local variables
|
// List of local variables
|
||||||
if (esm.isNextSub("SCVR"))
|
if (esm.isNextSub("SCVR"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace ESM {
|
||||||
|
|
||||||
void SpellList::load(ESMReader &esm)
|
void SpellList::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mList.clear();
|
||||||
while (esm.isNextSub("NPCS")) {
|
while (esm.isNextSub("NPCS")) {
|
||||||
mList.push_back(esm.getHString());
|
mList.push_back(esm.getHString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1063,11 +1063,11 @@ class NIFObjectLoader
|
||||||
|
|
||||||
static void createObjects(const Nif::NIFFilePtr& nif, const std::string &name, const std::string &group,
|
static void createObjects(const Nif::NIFFilePtr& nif, const std::string &name, const std::string &group,
|
||||||
Ogre::SceneNode *sceneNode, const Nif::Node *node,
|
Ogre::SceneNode *sceneNode, const Nif::Node *node,
|
||||||
ObjectScenePtr scene, int flags, int animflags, int partflags)
|
ObjectScenePtr scene, int flags, int animflags, int partflags, bool isRootCollisionNode=false)
|
||||||
{
|
{
|
||||||
// Do not create objects for the collision shape (includes all children)
|
// Do not create objects for the collision shape (includes all children)
|
||||||
if(node->recType == Nif::RC_RootCollisionNode)
|
if(node->recType == Nif::RC_RootCollisionNode)
|
||||||
return;
|
isRootCollisionNode = true;
|
||||||
|
|
||||||
// Marker objects: just skip the entire node branch
|
// Marker objects: just skip the entire node branch
|
||||||
/// \todo don't do this in the editor
|
/// \todo don't do this in the editor
|
||||||
|
@ -1120,20 +1120,23 @@ class NIFObjectLoader
|
||||||
if(!node->controller.empty())
|
if(!node->controller.empty())
|
||||||
createNodeControllers(nif, name, node->controller, scene, animflags);
|
createNodeControllers(nif, name, node->controller, scene, animflags);
|
||||||
|
|
||||||
if(node->recType == Nif::RC_NiCamera)
|
if (!isRootCollisionNode)
|
||||||
{
|
{
|
||||||
/* Ignored */
|
if(node->recType == Nif::RC_NiCamera)
|
||||||
}
|
{
|
||||||
|
/* Ignored */
|
||||||
|
}
|
||||||
|
|
||||||
if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000))
|
if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000))
|
||||||
{
|
{
|
||||||
createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags);
|
createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((node->recType == Nif::RC_NiAutoNormalParticles ||
|
if((node->recType == Nif::RC_NiAutoNormalParticles ||
|
||||||
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
|
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
|
||||||
{
|
{
|
||||||
createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags);
|
createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
|
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
|
||||||
|
@ -1143,7 +1146,7 @@ class NIFObjectLoader
|
||||||
for(size_t i = 0;i < children.length();i++)
|
for(size_t i = 0;i < children.length();i++)
|
||||||
{
|
{
|
||||||
if(!children[i].empty())
|
if(!children[i].empty())
|
||||||
createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags);
|
createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags, isRootCollisionNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,8 @@ namespace OgreInit
|
||||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_GL3Plus", *mRoot);
|
Files::loadOgrePlugin(pluginDir, "RenderSystem_GL3Plus", *mRoot);
|
||||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mRoot);
|
Files::loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mRoot);
|
||||||
Files::loadOgrePlugin(pluginDir, "Plugin_CgProgramManager", *mRoot);
|
Files::loadOgrePlugin(pluginDir, "Plugin_CgProgramManager", *mRoot);
|
||||||
Files::loadOgrePlugin(pluginDir, "Plugin_ParticleFX", *mRoot);
|
if (!Files::loadOgrePlugin(pluginDir, "Plugin_ParticleFX", *mRoot))
|
||||||
|
throw std::runtime_error("Required Plugin_ParticleFX for Ogre not found!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OgreInit::loadParticleFactories()
|
void OgreInit::loadParticleFactories()
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<MyGUI type="Layout">
|
<MyGUI type="Layout">
|
||||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 289 256" name="_Main">
|
<Widget type="VBox" skin="MW_Dialog" layer="Windows" position="0 0 289 256" name="_Main">
|
||||||
|
<Property key="AutoResize" value="true"/>
|
||||||
|
<Property key="Padding" value="12"/>
|
||||||
|
<Property key="Spacing" value="8"/>
|
||||||
|
|
||||||
<!-- Class image -->
|
<!-- Class image -->
|
||||||
<Widget type="Widget" skin="MW_Box" position="8 8 265 138" align="Left Top">
|
<Widget type="Widget" skin="MW_Box" position="8 8 265 138" align="Left Top">
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/>
|
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- Class text -->
|
<!-- Class text -->
|
||||||
<Widget type="EditBox" skin="SandText" position="8 152 265 40" name="ReflectT" align="Left Top">
|
<Widget type="AutoSizedEditBox" skin="SandText" position="8 152 265 40" name="ReflectT" align="Left Top">
|
||||||
<Property key="TextAlign" value="Top HCenter"/>
|
<Property key="TextAlign" value="Top HCenter"/>
|
||||||
<Property key="MultiLine" value="true"/>
|
<Property key="MultiLine" value="true"/>
|
||||||
<Property key="WordWrap" value="true"/>
|
<Property key="WordWrap" value="true"/>
|
||||||
<Property key="Static" value="true"/>
|
<Property key="Static" value="true"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="TextBox" skin="SandText" position="8 183 265 23" name="ClassName" align="Left Top">
|
<Widget type="AutoSizedTextBox" skin="SandText" position="8 183 265 23" name="ClassName" align="Left Top">
|
||||||
<Property key="Caption" value="[Class]"/>
|
<Property key="Caption" value="[Class]"/>
|
||||||
<Property key="TextAlign" value="Top HCenter"/>
|
<Property key="TextAlign" value="Top HCenter"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- Dialog buttons -->
|
<!-- Dialog buttons -->
|
||||||
<Widget type="HBox" position="0 216 273 24">
|
<Widget type="HBox" position="0 216 273 24">
|
||||||
<Widget type="Widget">
|
|
||||||
<UserString key="HStretch" value="true"/>
|
|
||||||
</Widget>
|
|
||||||
<Widget type="AutoSizedButton" skin="MW_Button" name="BackButton">
|
<Widget type="AutoSizedButton" skin="MW_Button" name="BackButton">
|
||||||
<Property key="Caption" value="#{sBack}"/>
|
<Property key="Caption" value="#{sBack}"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
|
@ -2,18 +2,19 @@
|
||||||
|
|
||||||
<MyGUI type="Layout">
|
<MyGUI type="Layout">
|
||||||
<Widget type="VBox" skin="MW_Dialog" layer="Windows" position="0 0 600 400" name="_Main">
|
<Widget type="VBox" skin="MW_Dialog" layer="Windows" position="0 0 600 400" name="_Main">
|
||||||
<Property key="Padding" value="8"/>
|
<Property key="Padding" value="12"/>
|
||||||
<Property key="Spacing" value="6"/>
|
<Property key="Spacing" value="8"/>
|
||||||
|
|
||||||
<Widget type="HBox" skin="">
|
<Widget type="HBox" skin="">
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
<UserString key="VStretch" value="true"/>
|
<UserString key="VStretch" value="true"/>
|
||||||
|
<Property key="Spacing" value="8"/>
|
||||||
|
|
||||||
<Widget type="VBox" skin="">
|
<Widget type="VBox" skin="">
|
||||||
|
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
<UserString key="VStretch" value="true"/>
|
<UserString key="VStretch" value="true"/>
|
||||||
|
<Property key="Spacing" value="8"/>
|
||||||
|
|
||||||
<Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" name="SelectCharacter">
|
<Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" name="SelectCharacter">
|
||||||
<Property key="Caption" value="Select Character"/>
|
<Property key="Caption" value="Select Character"/>
|
||||||
|
@ -31,9 +32,9 @@
|
||||||
<Widget type="VBox" skin="">
|
<Widget type="VBox" skin="">
|
||||||
<UserString key="HStretch" value="false"/>
|
<UserString key="HStretch" value="false"/>
|
||||||
<UserString key="VStretch" value="true"/>
|
<UserString key="VStretch" value="true"/>
|
||||||
<Property key="Spacing" value="4"/>
|
<Property key="Spacing" value="8"/>
|
||||||
|
|
||||||
<Widget type="AutoSizedButton" skin="" name="Spacer">
|
<Widget type="Widget" skin="" position="0 0 200 24" name="Spacer">
|
||||||
<Property key="Visible" value="false"/>
|
<Property key="Visible" value="false"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
|
@ -52,6 +53,8 @@
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<Widget type="HBox" skin="">
|
<Widget type="HBox" skin="">
|
||||||
|
<Property key="Spacing" value="4"/>
|
||||||
|
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
<Widget type="AutoSizedButton" skin="MW_Button" name="DeleteButton">
|
<Widget type="AutoSizedButton" skin="MW_Button" name="DeleteButton">
|
||||||
<Property key="Caption" value="#{sDeleteGame}"/>
|
<Property key="Caption" value="#{sDeleteGame}"/>
|
||||||
|
|
|
@ -105,7 +105,6 @@ BulletShapeManager::~BulletShapeManager()
|
||||||
sThis = 0;
|
sThis = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (OGRE_VERSION >= ((1 << 16) | (9 << 8) | 0))
|
|
||||||
BulletShapePtr BulletShapeManager::getByName(const Ogre::String& name, const Ogre::String& groupName)
|
BulletShapePtr BulletShapeManager::getByName(const Ogre::String& name, const Ogre::String& groupName)
|
||||||
{
|
{
|
||||||
return getResourceByName(name, groupName).staticCast<BulletShape>();
|
return getResourceByName(name, groupName).staticCast<BulletShape>();
|
||||||
|
@ -117,7 +116,6 @@ BulletShapePtr BulletShapeManager::create (const Ogre::String& name, const Ogre:
|
||||||
{
|
{
|
||||||
return createResource(name,group,isManual,loader,createParams).staticCast<BulletShape>();
|
return createResource(name,group,isManual,loader,createParams).staticCast<BulletShape>();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
BulletShapePtr BulletShapeManager::load(const Ogre::String &name, const Ogre::String &group)
|
BulletShapePtr BulletShapeManager::load(const Ogre::String &name, const Ogre::String &group)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,53 +55,7 @@ public:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
|
|
||||||
class BulletShapePtr : public Ogre::SharedPtr<BulletShape>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BulletShapePtr() : Ogre::SharedPtr<BulletShape>() {}
|
|
||||||
explicit BulletShapePtr(BulletShape *rep) : Ogre::SharedPtr<BulletShape>(rep) {}
|
|
||||||
BulletShapePtr(const BulletShapePtr &r) : Ogre::SharedPtr<BulletShape>(r) {}
|
|
||||||
BulletShapePtr(const Ogre::ResourcePtr &r) : Ogre::SharedPtr<BulletShape>()
|
|
||||||
{
|
|
||||||
if( r.isNull() )
|
|
||||||
return;
|
|
||||||
// lock & copy other mutex pointer
|
|
||||||
OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
|
|
||||||
OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
|
|
||||||
pRep = static_cast<BulletShape*>(r.getPointer());
|
|
||||||
pUseCount = r.useCountPointer();
|
|
||||||
useFreeMethod = r.freeMethod();
|
|
||||||
if (pUseCount)
|
|
||||||
{
|
|
||||||
++(*pUseCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Operator used to convert a ResourcePtr to a BulletShapePtr
|
|
||||||
BulletShapePtr& operator=(const Ogre::ResourcePtr& r)
|
|
||||||
{
|
|
||||||
if(pRep == static_cast<BulletShape*>(r.getPointer()))
|
|
||||||
return *this;
|
|
||||||
release();
|
|
||||||
if( r.isNull() )
|
|
||||||
return *this; // resource ptr is null, so the call to release above has done all we need to do.
|
|
||||||
// lock & copy other mutex pointer
|
|
||||||
OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
|
|
||||||
OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
|
|
||||||
pRep = static_cast<BulletShape*>(r.getPointer());
|
|
||||||
pUseCount = r.useCountPointer();
|
|
||||||
useFreeMethod = r.freeMethod();
|
|
||||||
if (pUseCount)
|
|
||||||
{
|
|
||||||
++(*pUseCount);
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
typedef Ogre::SharedPtr<BulletShape> BulletShapePtr;
|
typedef Ogre::SharedPtr<BulletShape> BulletShapePtr;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Hold any BulletShape that was created by the ManualBulletShapeLoader.
|
*Hold any BulletShape that was created by the ManualBulletShapeLoader.
|
||||||
|
@ -146,7 +100,6 @@ public:
|
||||||
virtual ~BulletShapeManager();
|
virtual ~BulletShapeManager();
|
||||||
|
|
||||||
|
|
||||||
#if (OGRE_VERSION >= ((1 << 16) | (9 << 8) | 0))
|
|
||||||
/// Get a resource by name
|
/// Get a resource by name
|
||||||
/// @see ResourceManager::getByName
|
/// @see ResourceManager::getByName
|
||||||
BulletShapePtr getByName(const Ogre::String& name, const Ogre::String& groupName = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
BulletShapePtr getByName(const Ogre::String& name, const Ogre::String& groupName = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
||||||
|
@ -156,7 +109,6 @@ public:
|
||||||
BulletShapePtr create (const Ogre::String& name, const Ogre::String& group,
|
BulletShapePtr create (const Ogre::String& name, const Ogre::String& group,
|
||||||
bool isManual = false, Ogre::ManualResourceLoader* loader = 0,
|
bool isManual = false, Ogre::ManualResourceLoader* loader = 0,
|
||||||
const Ogre::NameValuePairList* createParams = 0);
|
const Ogre::NameValuePairList* createParams = 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual BulletShapePtr load(const Ogre::String &name, const Ogre::String &group);
|
virtual BulletShapePtr load(const Ogre::String &name, const Ogre::String &group);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue