mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 09:23:53 +00:00
Merge branch 'master' into graphics
This commit is contained in:
commit
8f2c8bbea4
26 changed files with 308 additions and 156 deletions
|
@ -176,4 +176,17 @@ namespace MWClass
|
|||
|
||||
return info;
|
||||
}
|
||||
|
||||
float Container::getCapactiy (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->weight;
|
||||
}
|
||||
|
||||
float Container::getEncumbrance (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
return getContainerStore (ptr).getWeight();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,14 @@ namespace MWClass
|
|||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual float getCapactiy (const MWWorld::Ptr& ptr) const;
|
||||
///< Return total weight that fits into the object. Throws an exception, if the object can't
|
||||
/// hold other objects.
|
||||
|
||||
virtual float getEncumbrance (const MWWorld::Ptr& ptr) const;
|
||||
///< Returns total weight of objects inside this object (including modifications from magic
|
||||
/// effects). Throws an exception, if the object can't hold other objects.
|
||||
|
||||
static void registerSelf();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||
#include "../mwmechanics/magiceffects.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
||||
|
@ -56,8 +57,6 @@ namespace MWClass
|
|||
|
||||
data->mCreatureStats.mLevel = ref->base->data.level;
|
||||
|
||||
// \todo add initial container content
|
||||
|
||||
// store
|
||||
ptr.getRefData().setCustomData (data.release());
|
||||
}
|
||||
|
@ -166,4 +165,26 @@ namespace MWClass
|
|||
|
||||
return info;
|
||||
}
|
||||
|
||||
float Creature::getCapactiy (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
const MWMechanics::CreatureStats& stats = getCreatureStats (ptr);
|
||||
return stats.mAttributes[0].getModified()*5;
|
||||
}
|
||||
|
||||
float Creature::getEncumbrance (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
float weight = getContainerStore (ptr).getWeight();
|
||||
|
||||
const MWMechanics::CreatureStats& stats = getCreatureStats (ptr);
|
||||
|
||||
weight -= stats.mMagicEffects.get (MWMechanics::EffectKey (8)).mMagnitude; // feather
|
||||
|
||||
weight += stats.mMagicEffects.get (MWMechanics::EffectKey (7)).mMagnitude; // burden
|
||||
|
||||
if (weight<0)
|
||||
weight = 0;
|
||||
|
||||
return weight;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,14 @@ namespace MWClass
|
|||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual float getCapactiy (const MWWorld::Ptr& ptr) const;
|
||||
///< Return total weight that fits into the object. Throws an exception, if the object can't
|
||||
/// hold other objects.
|
||||
|
||||
virtual float getEncumbrance (const MWWorld::Ptr& ptr) const;
|
||||
///< Returns total weight of objects inside this object (including modifications from magic
|
||||
/// effects). Throws an exception, if the object can't hold other objects.
|
||||
|
||||
static void registerSelf();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -88,11 +88,9 @@ namespace MWClass
|
|||
}
|
||||
else
|
||||
{
|
||||
//TODO: do something with npdt12 maybe:p
|
||||
/// \todo do something with npdt12 maybe:p
|
||||
}
|
||||
|
||||
// \todo add initial container content
|
||||
|
||||
// store
|
||||
ptr.getRefData().setCustomData (data.release());
|
||||
}
|
||||
|
@ -325,4 +323,26 @@ namespace MWClass
|
|||
|
||||
return info;
|
||||
}
|
||||
|
||||
float Npc::getCapactiy (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
const MWMechanics::CreatureStats& stats = getCreatureStats (ptr);
|
||||
return stats.mAttributes[0].getModified()*5;
|
||||
}
|
||||
|
||||
float Npc::getEncumbrance (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
float weight = getContainerStore (ptr).getWeight();
|
||||
|
||||
const MWMechanics::CreatureStats& stats = getCreatureStats (ptr);
|
||||
|
||||
weight -= stats.mMagicEffects.get (MWMechanics::EffectKey (8)).mMagnitude; // feather
|
||||
|
||||
weight += stats.mMagicEffects.get (MWMechanics::EffectKey (7)).mMagnitude; // burden
|
||||
|
||||
if (weight<0)
|
||||
weight = 0;
|
||||
|
||||
return weight;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,6 +74,14 @@ namespace MWClass
|
|||
///< Return desired movement vector (determined based on movement settings,
|
||||
/// stance and stats).
|
||||
|
||||
virtual float getCapactiy (const MWWorld::Ptr& ptr) const;
|
||||
///< Return total weight that fits into the object. Throws an exception, if the object can't
|
||||
/// hold other objects.
|
||||
|
||||
virtual float getEncumbrance (const MWWorld::Ptr& ptr) const;
|
||||
///< Returns total weight of objects inside this object (including modifications from magic
|
||||
/// effects). Throws an exception, if the object can't hold other objects.
|
||||
|
||||
static void registerSelf();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -60,6 +60,10 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager)
|
|||
getWidget(skillAreaWidget, "Skills");
|
||||
getWidget(skillClientWidget, "SkillClient");
|
||||
getWidget(skillScrollerWidget, "SkillScroller");
|
||||
getWidget(mLeftPane, "LeftPane");
|
||||
getWidget(mRightPane, "RightPane");
|
||||
|
||||
skillClientWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition);
|
||||
updateScroller();
|
||||
|
@ -91,8 +95,22 @@ void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
|
|||
}
|
||||
}
|
||||
|
||||
void StatsWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||
{
|
||||
if (skillScrollerWidget->getScrollPosition() - _rel*0.3 < 0)
|
||||
skillScrollerWidget->setScrollPosition(0);
|
||||
else if (skillScrollerWidget->getScrollPosition() - _rel*0.3 > skillScrollerWidget->getScrollRange()-1)
|
||||
skillScrollerWidget->setScrollPosition(skillScrollerWidget->getScrollRange()-1);
|
||||
else
|
||||
skillScrollerWidget->setScrollPosition(skillScrollerWidget->getScrollPosition() - _rel*0.3);
|
||||
|
||||
onScrollChangePosition(skillScrollerWidget, skillScrollerWidget->getScrollPosition());
|
||||
}
|
||||
|
||||
void StatsWindow::onWindowResize(MyGUI::Window* window)
|
||||
{
|
||||
mLeftPane->setCoord( MyGUI::IntCoord(0, 0, 0.44*window->getSize().width, window->getSize().height) );
|
||||
mRightPane->setCoord( MyGUI::IntCoord(0.44*window->getSize().width, 0, 0.56*window->getSize().width, window->getSize().height) );
|
||||
updateScroller();
|
||||
}
|
||||
|
||||
|
@ -233,6 +251,7 @@ void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
|||
MyGUI::ImageBox* separator = skillClientWidget->createWidget<MyGUI::ImageBox>("MW_HLine",
|
||||
MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18),
|
||||
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||
separator->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
skillWidgets.push_back(separator);
|
||||
|
||||
coord1.top += separator->getHeight();
|
||||
|
@ -245,6 +264,7 @@ void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, My
|
|||
MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height),
|
||||
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||
groupWidget->setCaption(label);
|
||||
groupWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
skillWidgets.push_back(groupWidget);
|
||||
|
||||
coord1.top += lineHeight;
|
||||
|
@ -259,12 +279,14 @@ MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::st
|
|||
skillNameWidget->setCaption(text);
|
||||
skillNameWidget->setUserString("ToolTipType", "Text");
|
||||
skillNameWidget->setUserString("ToolTipText", tooltip);
|
||||
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top);
|
||||
skillValueWidget->setUserString("ToolTipType", "Text");
|
||||
skillValueWidget->setUserString("ToolTipText", tooltip);
|
||||
skillValueWidget->setCaption(value);
|
||||
skillValueWidget->_setWidgetState(state);
|
||||
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
skillWidgets.push_back(skillNameWidget);
|
||||
skillWidgets.push_back(skillValueWidget);
|
||||
|
@ -281,6 +303,7 @@ void StatsWindow::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI
|
|||
|
||||
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
||||
skillNameWidget->setCaption(text);
|
||||
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
skillWidgets.push_back(skillNameWidget);
|
||||
|
||||
|
@ -366,7 +389,7 @@ void StatsWindow::updateSkillArea()
|
|||
if (!skillWidgets.empty())
|
||||
addSeparator(coord1, coord2);
|
||||
|
||||
addGroup(mWindowManager.getGameSettingString("sSign", "Sign"), coord1, coord2);
|
||||
addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
|
||||
const ESM::BirthSign *sign = store.birthSigns.find(birthSignId);
|
||||
addItem(sign->name, coord1, coord2);
|
||||
}
|
||||
|
@ -390,6 +413,8 @@ void StatsWindow::updateScroller()
|
|||
{
|
||||
skillScrollerWidget->setScrollRange(std::max(clientHeight - skillClientWidget->getHeight(), 0));
|
||||
skillScrollerWidget->setScrollPage(std::max(skillClientWidget->getHeight() - lineHeight, 0));
|
||||
if (clientHeight != 0)
|
||||
skillScrollerWidget->setTrackSize( (skillAreaWidget->getHeight() / float(clientHeight)) * skillScrollerWidget->getLineSize() );
|
||||
}
|
||||
|
||||
void StatsWindow::onPinToggled()
|
||||
|
|
|
@ -54,9 +54,13 @@ namespace MWGui
|
|||
|
||||
void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
|
||||
void onWindowResize(MyGUI::Window* window);
|
||||
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
||||
|
||||
static const int lineHeight;
|
||||
|
||||
MyGUI::Widget* mLeftPane;
|
||||
MyGUI::Widget* mRightPane;
|
||||
|
||||
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
||||
MyGUI::ScrollBar* skillScrollerWidget;
|
||||
int lastPos, clientHeight;
|
||||
|
|
|
@ -447,7 +447,10 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
|
|||
else
|
||||
{
|
||||
const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->cell->region);
|
||||
if (region)
|
||||
name = region->name;
|
||||
else
|
||||
name = getGameSettingString("sDefaultCellname", "Wilderness");
|
||||
}
|
||||
|
||||
map->setCellName( name );
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone
|
||||
#include "../mwworld/ptr.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include <components/esm/loadstat.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
|
@ -233,7 +234,10 @@ void RenderingManager::update (float duration){
|
|||
mWater->update();
|
||||
}
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
||||
if(store->cell->data.flags & store->cell->HasWater){
|
||||
if(store->cell->data.flags & store->cell->HasWater
|
||||
|| ((!(store->cell->data.flags & ESM::Cell::Interior))
|
||||
&& !MWBase::Environment::get().getWorld()->getStore().lands.search(store->cell->data.gridX,store->cell->data.gridY) )) // always use water, if the cell does not have land.
|
||||
{
|
||||
if(mWater == 0)
|
||||
mWater = new MWRender::Water(mRendering.getCamera(), this, store->cell);
|
||||
else
|
||||
|
@ -242,7 +246,6 @@ void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
|||
}
|
||||
else
|
||||
removeWater();
|
||||
|
||||
}
|
||||
|
||||
void RenderingManager::setWaterHeight(const float height)
|
||||
|
|
|
@ -110,13 +110,13 @@ namespace MWRender
|
|||
const int cellY = store->cell->getGridY();
|
||||
|
||||
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY);
|
||||
if ( land != NULL )
|
||||
{
|
||||
if (land == NULL) // no land data means we're not going to create any terrain.
|
||||
return;
|
||||
|
||||
if (!land->dataLoaded)
|
||||
{
|
||||
land->loadData();
|
||||
}
|
||||
}
|
||||
|
||||
//split the cell terrain into four segments
|
||||
const int numTextures = ESM::Land::LAND_TEXTURE_SIZE/2;
|
||||
|
@ -138,8 +138,6 @@ namespace MWRender
|
|||
mLandSize*mLandSize,
|
||||
MEMCATEGORY_GEOMETRY);
|
||||
|
||||
if ( land != NULL )
|
||||
{
|
||||
//copy the height data row by row
|
||||
for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ )
|
||||
{
|
||||
|
@ -153,11 +151,6 @@ namespace MWRender
|
|||
&land->landData->heights[yOffset + xOffset],
|
||||
mLandSize*sizeof(float));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(terrainData.inputFloat, 0, mLandSize*mLandSize*sizeof(float));
|
||||
}
|
||||
|
||||
std::map<uint16_t, int> indexes;
|
||||
initTerrainTextures(&terrainData, cellX, cellY,
|
||||
|
@ -179,7 +172,7 @@ namespace MWRender
|
|||
terrain->setVisibilityFlags(RV_Terrain);
|
||||
terrain->setRenderQueueGroup(RQG_Main);
|
||||
|
||||
if ( land && land->landData->usingColours )
|
||||
if ( land->landData->usingColours )
|
||||
{
|
||||
// disable or enable global colour map (depends on available vertex colours)
|
||||
mActiveProfile->setGlobalColourMapEnabled(true);
|
||||
|
@ -196,10 +189,6 @@ namespace MWRender
|
|||
//mat = terrain->_getCompositeMapMaterial();
|
||||
//mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( vertex->getName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
mActiveProfile->setGlobalColourMapEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,8 +204,10 @@ namespace MWRender
|
|||
{
|
||||
for ( int y = 0; y < 2; y++ )
|
||||
{
|
||||
mTerrainGroup.unloadTerrain(store->cell->getGridX() * 2 + x,
|
||||
store->cell->getGridY() * 2 + y);
|
||||
int terrainX = store->cell->getGridX() * 2 + x;
|
||||
int terrainY = store->cell->getGridY() * 2 + y;
|
||||
if (mTerrainGroup.getTerrain(terrainX, terrainY) != NULL)
|
||||
mTerrainGroup.unloadTerrain(terrainX, terrainY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -433,7 +433,10 @@ namespace MWSound
|
|||
total = 0;
|
||||
}
|
||||
|
||||
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.find(regionName);
|
||||
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.search(regionName);
|
||||
if (regn == NULL)
|
||||
return;
|
||||
|
||||
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
|
||||
if(total == 0)
|
||||
{
|
||||
|
|
|
@ -142,6 +142,16 @@ namespace MWWorld
|
|||
throw std::logic_error ("value not supported by this class");
|
||||
}
|
||||
|
||||
float Class::getCapactiy (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("capacity not supported by this class");
|
||||
}
|
||||
|
||||
float Class::getEncumbrance (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("encumbrance not supported by class");
|
||||
}
|
||||
|
||||
const Class& Class::get (const std::string& key)
|
||||
{
|
||||
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);
|
||||
|
|
|
@ -164,6 +164,16 @@ namespace MWWorld
|
|||
///< Return trade value of the object. Throws an exception, if the object can't be traded.
|
||||
/// (default implementation: throws an exception)
|
||||
|
||||
virtual float getCapactiy (const MWWorld::Ptr& ptr) const;
|
||||
///< Return total weight that fits into the object. Throws an exception, if the object can't
|
||||
/// hold other objects.
|
||||
/// (default implementation: throws an exception)
|
||||
|
||||
virtual float getEncumbrance (const MWWorld::Ptr& ptr) const;
|
||||
///< Returns total weight of objects inside this object (including modifications from magic
|
||||
/// effects). Throws an exception, if the object can't hold other objects.
|
||||
/// (default implementation: throws an exception)
|
||||
|
||||
static const Class& get (const std::string& key);
|
||||
///< If there is no class for this \a key, an exception is thrown.
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
|
|||
return ContainerStoreIterator (this);
|
||||
}
|
||||
|
||||
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
|
||||
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
||||
{
|
||||
/// \todo add current weapon/armor health, remaining lockpick/repair uses, current enchantment charge here as soon as they are implemented
|
||||
if ( ptr1.mCellRef->refID == ptr2.mCellRef->refID
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace MWWorld
|
|||
void addImpl (const Ptr& ptr);
|
||||
///< Add the item to this container (no stacking)
|
||||
|
||||
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const;
|
||||
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2);
|
||||
///< @return true if the two specified objects can stack with each other
|
||||
/// @note ptr1 is the item that is already in this container
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats)
|
|||
}
|
||||
}
|
||||
|
||||
bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
|
||||
bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
||||
{
|
||||
bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2);
|
||||
if (!canStack)
|
||||
|
@ -211,7 +211,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
|
|||
for (TSlots::const_iterator iter (mSlots.begin());
|
||||
iter!=mSlots.end(); ++iter)
|
||||
{
|
||||
if (ptr1 == **iter)
|
||||
if (*iter != end() && ptr1 == **iter)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace MWWorld
|
|||
|
||||
protected:
|
||||
|
||||
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const;
|
||||
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2);
|
||||
///< @return true if the two specified objects can stack with each other
|
||||
/// @note ptr1 is the item that is already in this container
|
||||
|
||||
|
|
|
@ -82,7 +82,11 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
if (!((*iter)->cell->data.flags & ESM::Cell::Interior))
|
||||
{
|
||||
ESM::Land* land = mWorld->getStore().lands.search((*iter)->cell->data.gridX,(*iter)->cell->data.gridY);
|
||||
if (land)
|
||||
mPhysics->removeHeightField( (*iter)->cell->data.gridX, (*iter)->cell->data.gridY );
|
||||
}
|
||||
}
|
||||
|
||||
mRendering.removeCell(*iter);
|
||||
|
@ -118,6 +122,7 @@ namespace MWWorld
|
|||
if (!(cell->cell->data.flags & ESM::Cell::Interior))
|
||||
{
|
||||
ESM::Land* land = mWorld->getStore().lands.search(cell->cell->data.gridX,cell->cell->data.gridY);
|
||||
if (land)
|
||||
mPhysics->addHeightField (land->landData->heights,
|
||||
cell->cell->data.gridX, cell->cell->data.gridY,
|
||||
0, ( worldsize/(verts-1) ), verts);
|
||||
|
@ -251,6 +256,9 @@ namespace MWWorld
|
|||
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
||||
{
|
||||
std::cout << "Changing to interior\n";
|
||||
|
||||
Ptr::CellStore *cell = mWorld->getInterior(cellName);
|
||||
|
||||
// remove active
|
||||
CellStoreCollection::iterator active = mActiveCells.begin();
|
||||
|
||||
|
@ -261,11 +269,9 @@ namespace MWWorld
|
|||
|
||||
// Load cell.
|
||||
std::cout << "cellName:" << cellName << std::endl;
|
||||
Ptr::CellStore *cell = mWorld->getInterior(cellName);
|
||||
|
||||
loadCell (cell);
|
||||
|
||||
|
||||
// adjust player
|
||||
mCurrentCell = cell;
|
||||
playerCellChange (cell, position);
|
||||
|
|
|
@ -499,15 +499,17 @@ void WeatherManager::update(float duration)
|
|||
mCurrentRegion = regionstr;
|
||||
mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*3600;
|
||||
|
||||
std::string weather;
|
||||
std::string weather = "clear";
|
||||
|
||||
if (mRegionOverrides.find(regionstr) != mRegionOverrides.end())
|
||||
weather = mRegionOverrides[regionstr];
|
||||
else
|
||||
{
|
||||
// get weather probabilities for the current region
|
||||
const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.find (regionstr);
|
||||
const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.search (regionstr);
|
||||
|
||||
if (region != 0)
|
||||
{
|
||||
float clear = region->data.clear/255.f;
|
||||
float cloudy = region->data.cloudy/255.f;
|
||||
float foggy = region->data.foggy/255.f;
|
||||
|
@ -545,6 +547,7 @@ void WeatherManager::update(float duration)
|
|||
else
|
||||
weather = "clear";
|
||||
}
|
||||
}
|
||||
|
||||
setWeather(weather, false);
|
||||
}
|
||||
|
|
|
@ -139,6 +139,8 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
|
|||
handleNode(node,0,Ogre::Matrix3::IDENTITY,Ogre::Vector3::ZERO,1,hasCollisionNode,false,true);
|
||||
}
|
||||
|
||||
cShape->collide = hasCollisionNode&&cShape->collide;
|
||||
|
||||
struct TriangleMeshShape : public btBvhTriangleMeshShape
|
||||
{
|
||||
TriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<Widget type="ImageBox" skin="ImageBox" position_real="0 0 1 1" align="Top|Right" name="BookImage">
|
||||
<Property key="ImageTexture" value="textures\tx_menubook.dds"/>
|
||||
|
||||
<Widget type="Button" skin="ButtonImage" position="251 220 96 24" name="NextPageBTN">
|
||||
<Widget type="Button" skin="ButtonImage" position="251 220 57 24" name="NextPageBTN">
|
||||
<Property key="ImageResource" value="MenuBook_Next"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="ButtonImage" position="165 220 96 24" name="PrevPageBTN">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<Widget type="ImageBox" skin="ImageBox" position_real="0 0 1 1" align="Top|Right" name="JImage">
|
||||
<Property key="ImageTexture" value="textures\tx_menubook.dds"/>
|
||||
|
||||
<Widget type="Button" skin="ButtonImage" position="370 220 96 24" name="NextPageBTN">
|
||||
<Widget type="Button" skin="ButtonImage" position="370 220 57 24" name="NextPageBTN">
|
||||
<Property key="ImageResource" value="MenuBook_Next"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="ButtonImage" position="80 220 96 24" name="PrevPageBTN">
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</Resource>
|
||||
|
||||
<Resource type="ResourceImageSet" name="MenuBook_Next">
|
||||
<Group name="States" texture="mwgui1" size="96 24">
|
||||
<Group name="States" texture="mwgui1" size="57 24">
|
||||
<Index name="disabled">
|
||||
<Frame point="256 32"/>
|
||||
</Index>
|
||||
|
|
|
@ -3,59 +3,68 @@
|
|||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 500 342" name="_Main">
|
||||
|
||||
<Widget type="Widget" skin="" name="LeftPane" position="0 0 220 342">
|
||||
|
||||
<!-- Player health stats -->
|
||||
<Widget type="Widget" skin="MW_Box" position="8 8 212 62">
|
||||
<Widget type="TextBox" skin="NormalText" position="4 4 70 18" name="Health_str"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 22 70 18" name="Magicka_str"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 40 70 18" name="Fatigue_str"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Red" position="78 4 130 18" name="HBar"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Blue" position="78 22 130 18" name="MBar"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Green" position="78 40 130 18" name="FBar"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 4 130 18" align="Center" name="HBarT"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 22 130 18" align="Center" name="MBarT"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 40 130 18" align="Center" name="FBarT"/>
|
||||
<Widget type="Widget" skin="MW_Box" position="8 8 212 62" align="Left Top HStretch">
|
||||
<Widget type="TextBox" skin="NormalText" position="4 4 70 18" name="Health_str" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 22 70 18" name="Magicka_str" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 40 70 18" name="Fatigue_str" align="Left Top HStretch"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Red" position="78 4 130 18" name="HBar" align="Right Top"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Blue" position="78 22 130 18" name="MBar" align="Right Top"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Green" position="78 40 130 18" name="FBar" align="Right Top"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 4 130 18" name="HBarT" align="Right Top"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 22 130 18" name="MBarT" align="Right Top"/>
|
||||
<Widget type="TextBox" skin="ProgressText" position="78 40 130 18" name="FBarT" align="Right Top"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Player level, race and class -->
|
||||
<Widget type="Widget" skin="MW_Box" position="8 78 212 62">
|
||||
<Widget type="TextBox" skin="NormalText" position="4 4 100 18" name="Level_str"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 22 100 18" name="Race_str"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 40 100 18" name="Class_str"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 4 104 18" name="LevelText"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 22 104 18" name="RaceText"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 40 104 18" name="ClassText"/>
|
||||
<Widget type="Widget" skin="MW_Box" position="8 78 212 62" align="Left Top HStretch">
|
||||
<Widget type="TextBox" skin="NormalText" position="4 4 100 18" name="Level_str" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 22 100 18" name="Race_str" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="NormalText" position="4 40 100 18" name="Class_str" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 4 104 18" name="LevelText" align="Right Top"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 22 104 18" name="RaceText" align="Right Top"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 40 104 18" name="ClassText" align="Right Top"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="Widget" skin="MW_Box" position="8 148 212 152" align="ALIGN_LEFT ALIGN_TOP ALIGN_VSTRETCH">
|
||||
<Widget type="TextBox" skin="SandText" position="4 4 160 18" name="Attrib1"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 4 44 18" name="AttribVal1"/>
|
||||
<Widget type="Widget" skin="MW_Box" position="8 148 212 152" align="Left Top Stretch">
|
||||
<Widget type="TextBox" skin="SandText" position="4 4 160 18" name="Attrib1" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 4 44 18" name="AttribVal1" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 22 160 18" name="Attrib2"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 22 44 18" name="AttribVal2"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 22 160 18" name="Attrib2" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 22 44 18" name="AttribVal2" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 40 160 18" name="Attrib3"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 40 44 18" name="AttribVal3"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 40 160 18" name="Attrib3" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 40 44 18" name="AttribVal3" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 58 160 18" name="Attrib4"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 58 44 18" name="AttribVal4"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 58 160 18" name="Attrib4" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 58 44 18" name="AttribVal4" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 76 160 18" name="Attrib5"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 76 44 18" name="AttribVal5"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 76 160 18" name="Attrib5" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 76 44 18" name="AttribVal5" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 94 160 18" name="Attrib6"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 94 44 18" name="AttribVal6"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 94 160 18" name="Attrib6" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 94 44 18" name="AttribVal6" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 112 160 18" name="Attrib7"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 112 44 18" name="AttribVal7"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 112 160 18" name="Attrib7" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 112 44 18" name="AttribVal7" align="Right Top"/>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="4 130 160 18" name="Attrib8"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 130 44 18" name="AttribVal8"/>
|
||||
<Widget type="TextBox" skin="SandText" position="4 130 160 18" name="Attrib8" align="Left Top HStretch"/>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="164 130 44 18" name="AttribVal8" align="Right Top"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
<Widget type="Widget" skin="" name="RightPane" position="220 0 280 342">
|
||||
|
||||
<!-- Player skills, factions, birthsign and reputation -->
|
||||
<Widget type="Widget" skin="MW_Box" position="228 8 248 292" align="ALIGN_LEFT ALIGN_STRETCH" name="Skills">
|
||||
<Widget type="Widget" skin="" position="4 4 222 284" align="ALIGN_STRETCH" name="SkillClient" />
|
||||
<Widget type="Widget" skin="MW_Box" position="8 8 248 292" align="ALIGN_LEFT ALIGN_STRETCH" name="Skills">
|
||||
<Widget type="Widget" skin="" position="4 4 222 284" align="ALIGN_LEFT ALIGN_TOP ALIGN_STRETCH" name="SkillClient" />
|
||||
<Widget type="ScrollBar" skin="MW_VScroll" position="230 4 14 284" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="SkillScroller" />
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
||||
|
|
|
@ -22,7 +22,8 @@ namespace Physic
|
|||
COL_NOTHING = 0, //<Collide with nothing
|
||||
COL_WORLD = BIT(0), //<Collide with world objects
|
||||
COL_ACTOR_INTERNAL = BIT(1), //<Collide internal capsule
|
||||
COL_ACTOR_EXTERNAL = BIT(2) //<collide with external capsule
|
||||
COL_ACTOR_EXTERNAL = BIT(2), //<collide with external capsule
|
||||
COL_RAYCASTING = BIT(3)
|
||||
};
|
||||
|
||||
PhysicActor::PhysicActor(std::string name)
|
||||
|
@ -328,9 +329,12 @@ namespace Physic
|
|||
RigidBody* body = new RigidBody(CI,name);
|
||||
body->collide = shape->collide;
|
||||
return body;
|
||||
|
||||
}
|
||||
|
||||
void PhysicEngine::addRigidBody(RigidBody* body)
|
||||
{
|
||||
if(body)
|
||||
{
|
||||
if(body->collide)
|
||||
{
|
||||
|
@ -338,7 +342,7 @@ namespace Physic
|
|||
}
|
||||
else
|
||||
{
|
||||
dynamicsWorld->addRigidBody(body,COL_WORLD,COL_NOTHING);
|
||||
dynamicsWorld->addRigidBody(body,COL_RAYCASTING,COL_RAYCASTING|COL_WORLD);
|
||||
}
|
||||
body->setActivationState(DISABLE_DEACTIVATION);
|
||||
RigidBody* oldBody = RigidBodyMap[body->mName];
|
||||
|
@ -350,6 +354,7 @@ namespace Physic
|
|||
|
||||
RigidBodyMap[body->mName] = body;
|
||||
}
|
||||
}
|
||||
|
||||
void PhysicEngine::removeRigidBody(std::string name)
|
||||
{
|
||||
|
@ -460,7 +465,7 @@ namespace Physic
|
|||
|
||||
float d1 = 10000.;
|
||||
btCollisionWorld::ClosestRayResultCallback resultCallback1(from, to);
|
||||
resultCallback1.m_collisionFilterMask = COL_WORLD;
|
||||
resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING;
|
||||
dynamicsWorld->rayTest(from, to, resultCallback1);
|
||||
if (resultCallback1.hasHit())
|
||||
{
|
||||
|
@ -489,7 +494,7 @@ namespace Physic
|
|||
std::vector< std::pair<float, std::string> > PhysicEngine::rayTest2(btVector3& from, btVector3& to)
|
||||
{
|
||||
MyRayResultCallback resultCallback1;
|
||||
resultCallback1.m_collisionFilterMask = COL_WORLD;
|
||||
resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING;
|
||||
dynamicsWorld->rayTest(from, to, resultCallback1);
|
||||
std::vector< std::pair<float, btCollisionObject*> > results = resultCallback1.results;
|
||||
|
||||
|
|
Loading…
Reference in a new issue