Merge branch 'master' of git://github.com/zinnschlag/openmw into graphics

Conflicts:
	apps/openmw/mwgui/windowmanagerimp.cpp
	apps/openmw/mwrender/npcanimation.cpp
	files/mygui/openmw_settings_window.layout
actorid
scrawl 12 years ago
commit 0f6fd80294

@ -74,7 +74,6 @@ set(LIBDIR ${CMAKE_SOURCE_DIR}/libs)
set(OENGINE_OGRE
${LIBDIR}/openengine/ogre/renderer.cpp
${LIBDIR}/openengine/ogre/fader.cpp
${LIBDIR}/openengine/ogre/imagerotate.cpp
${LIBDIR}/openengine/ogre/selectionbuffer.cpp
)
set(OENGINE_GUI
@ -378,7 +377,7 @@ if(WIN32)
"${OpenMW_SOURCE_DIR}/readme.txt"
"${OpenMW_SOURCE_DIR}/GPL3.txt"
"${OpenMW_SOURCE_DIR}/OFL.txt"
"${OpenMW_SOURCE_DIR}/Bitstream Vera License.txt"
"${OpenMW_SOURCE_DIR}/DejaVu Font License.txt"
"${OpenMW_SOURCE_DIR}/Daedric Font License.txt"
"${OpenMW_BINARY_DIR}/launcher.qss"
"${OpenMW_BINARY_DIR}/settings-default.cfg"
@ -389,7 +388,7 @@ if(WIN32)
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION ".")
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_PACKAGE_NAME "OpenMW ${OPENMW_VERSION}")
SET(CPACK_PACKAGE_NAME "OpenMW")
SET(CPACK_PACKAGE_VENDOR "OpenMW.org")
SET(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
@ -404,7 +403,7 @@ if(WIN32)
SET(CPACK_RESOURCE_FILE_README "${OpenMW_SOURCE_DIR}/readme.txt")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/readme.txt")
SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
SET(CPACK_NSIS_DISPLAY_NAME "OpenMW")
SET(CPACK_NSIS_DISPLAY_NAME "OpenMW ${OPENMW_VERSION}")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "omwlauncher.exe")
@ -657,10 +656,18 @@ if (NOT WIN32 AND NOT DPKG_PROGRAM AND NOT APPLE)
# Install binaries
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw" DESTINATION "${BINDIR}" )
IF(BUILD_LAUNCHER)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/omwlauncher" DESTINATION "${BINDIR}" )
ENDIF(BUILD_LAUNCHER)
IF(BUILD_ESMTOOL)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/esmtool" DESTINATION "${BINDIR}" )
ENDIF(BUILD_ESMTOOL)
IF(BUILD_MWINIIMPORTER)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/mwiniimport" DESTINATION "${BINDIR}" )
ENDIF(BUILD_MWINIIMPORTER)
IF(BUILD_OPENCS)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/opencs" DESTINATION "${BINDIR}" )
ENDIF(BUILD_OPENCS)
# Install icon and .desktop
INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "${ICONDIR}")
@ -674,5 +681,7 @@ if (NOT WIN32 AND NOT DPKG_PROGRAM AND NOT APPLE)
# Install resources
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${DATADIR}" )
IF(BUILD_LAUNCHER)
INSTALL(FILES "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION "${DATADIR}/resources" )
ENDIF(BUILD_LAUNCHER)
endif(NOT WIN32 AND NOT DPKG_PROGRAM AND NOT APPLE)

@ -26,11 +26,11 @@ add_openmw_dir (mwinput
add_openmw_dir (mwgui
text_input widgets race class birth review windowmanagerimp console dialogue
dialogue_history window_base stats_window messagebox journalwindow charactercreation
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
map_window window_pinnable_base tooltips scrollwindow bookwindow list
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
enchantingdialog trainingwindow travelwindow imagebutton exposedwindow
enchantingdialog trainingwindow travelwindow imagebutton exposedwindow cursor
)
add_openmw_dir (mwdialogue

@ -18,7 +18,6 @@
#include "mwinput/inputmanagerimp.hpp"
#include "mwgui/windowmanagerimp.hpp"
#include "mwgui/cursorreplace.hpp"
#include "mwscript/scriptmanagerimp.hpp"
#include "mwscript/extensions.hpp"
@ -332,9 +331,6 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
loadBSA();
// cursor replacer (converts the cursor from the bsa so they can be used by mygui)
MWGui::CursorReplace replacer;
// Create the world
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mMaster, mPlugins,
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,

@ -2,6 +2,7 @@
#include "dialoguemanagerimp.hpp"
#include <cctype>
#include <cstdlib>
#include <algorithm>
#include <iterator>
@ -251,8 +252,12 @@ namespace MWDialogue
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
if (const ESM::DialInfo *info = filter.search (dialogue, true))
std::vector<const ESM::DialInfo *> infos = filter.list (dialogue, true, true);
if (!infos.empty())
{
const ESM::DialInfo* info = infos[std::rand() % infos.size()];
parseText (info->mResponse);
if (dialogue.mType==ESM::Dialogue::Persuasion)

@ -289,7 +289,7 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
case SelectWrapper::Function_PcGender:
return player.get<ESM::NPC>()->mBase->mFlags & ESM::NPC::Female ? 0 : 1;
return player.get<ESM::NPC>()->mBase->isMale() ? 0 : 1;
case SelectWrapper::Function_PcClothingModifier:
{
@ -559,8 +559,21 @@ MWDialogue::Filter::Filter (const MWWorld::Ptr& actor, int choice, bool talkedTo
: mActor (actor), mChoice (choice), mTalkedToPlayer (talkedToPlayer)
{}
const ESM::DialInfo *MWDialogue::Filter::search (const ESM::Dialogue& dialogue, const bool fallbackToInfoRefusal) const
const ESM::DialInfo* MWDialogue::Filter::search (const ESM::Dialogue& dialogue, const bool fallbackToInfoRefusal) const
{
std::vector<const ESM::DialInfo *> suitableInfos = list (dialogue, fallbackToInfoRefusal, false);
if (suitableInfos.empty())
return NULL;
else
return suitableInfos[0];
}
std::vector<const ESM::DialInfo *> MWDialogue::Filter::list (const ESM::Dialogue& dialogue,
bool fallbackToInfoRefusal, bool searchAll) const
{
std::vector<const ESM::DialInfo *> infos;
bool infoRefusal = false;
// Iterate over topic responses to find a matching one
@ -569,14 +582,17 @@ const ESM::DialInfo *MWDialogue::Filter::search (const ESM::Dialogue& dialogue,
{
if (testActor (*iter) && testPlayer (*iter) && testSelectStructs (*iter))
{
if (testDisposition (*iter))
return &*iter;
if (testDisposition (*iter)) {
infos.push_back(&*iter);
if (!searchAll)
break;
}
else
infoRefusal = true;
}
}
if (infoRefusal && fallbackToInfoRefusal)
if (infos.empty() && infoRefusal && fallbackToInfoRefusal)
{
// No response is valid because of low NPC disposition,
// search a response in the topic "Info Refusal"
@ -588,11 +604,14 @@ const ESM::DialInfo *MWDialogue::Filter::search (const ESM::Dialogue& dialogue,
for (std::vector<ESM::DialInfo>::const_iterator iter = infoRefusalDialogue.mInfo.begin();
iter!=infoRefusalDialogue.mInfo.end(); ++iter)
if (testActor (*iter) && testPlayer (*iter) && testSelectStructs (*iter) && testDisposition(*iter))
return &*iter;
if (testActor (*iter) && testPlayer (*iter) && testSelectStructs (*iter) && testDisposition(*iter)) {
infos.push_back(&*iter);
if (!searchAll)
break;
}
}
return 0;
return infos;
}
bool MWDialogue::Filter::responseAvailable (const ESM::Dialogue& dialogue) const

@ -1,6 +1,8 @@
#ifndef GAME_MWDIALOGUE_FILTER_H
#define GAME_MWDIALOGUE_FILTER_H
#include <vector>
#include "../mwworld/ptr.hpp"
namespace ESM
@ -51,7 +53,10 @@ namespace MWDialogue
Filter (const MWWorld::Ptr& actor, int choice, bool talkedToPlayer);
const ESM::DialInfo *search (const ESM::Dialogue& dialogue, const bool fallbackToInfoRefusal) const;
std::vector<const ESM::DialInfo *> list (const ESM::Dialogue& dialogue,
bool fallbackToInfoRefusal, bool searchAll) const;
const ESM::DialInfo* search (const ESM::Dialogue& dialogue, const bool fallbackToInfoRefusal) const;
///< Get a matching response for the requested dialogue.
/// Redirect to "Info Refusal" topic if a response fulfills all conditions but disposition.

@ -0,0 +1,130 @@
#include "cursor.hpp"
#include <MyGUI_PointerManager.h>
#include <MyGUI_InputManager.h>
#include <MyGUI_RenderManager.h>
#include <MyGUI_RotatingSkin.h>
#include <MyGUI_Gui.h>
#include <OgreMath.h>
namespace MWGui
{
ResourceImageSetPointerFix::ResourceImageSetPointerFix() :
mImageSet(nullptr)
{
}
ResourceImageSetPointerFix::~ResourceImageSetPointerFix()
{
}
void ResourceImageSetPointerFix::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
{
Base::deserialization(_node, _version);
MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
while (info.next("Property"))
{
const std::string& key = info->findAttribute("key");
const std::string& value = info->findAttribute("value");
if (key == "Point")
mPoint = MyGUI::IntPoint::parse(value);
else if (key == "Size")
mSize = MyGUI::IntSize::parse(value);
else if (key == "Rotation")
mRotation = MyGUI::utility::parseInt(value);
else if (key == "Resource")
mImageSet = MyGUI::ResourceManager::getInstance().getByName(value)->castType<MyGUI::ResourceImageSet>();
}
}
int ResourceImageSetPointerFix::getRotation()
{
return mRotation;
}
void ResourceImageSetPointerFix::setImage(MyGUI::ImageBox* _image)
{
if (mImageSet != nullptr)
_image->setItemResourceInfo(mImageSet->getIndexInfo(0, 0));
}
void ResourceImageSetPointerFix::setPosition(MyGUI::ImageBox* _image, const MyGUI::IntPoint& _point)
{
_image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
}
MyGUI::ResourceImageSetPtr ResourceImageSetPointerFix:: getImageSet()
{
return mImageSet;
}
MyGUI::IntPoint ResourceImageSetPointerFix::getHotSpot()
{
return mPoint;
}
MyGUI::IntSize ResourceImageSetPointerFix::getSize()
{
return mSize;
}
// ----------------------------------------------------------------------------------------
Cursor::Cursor()
{
// hide mygui's pointer since we're rendering it ourselves (because mygui's pointer doesn't support rotation)
MyGUI::PointerManager::getInstance().setVisible(false);
MyGUI::PointerManager::getInstance().eventChangeMousePointer += MyGUI::newDelegate(this, &Cursor::onCursorChange);
mWidget = MyGUI::Gui::getInstance().createWidget<MyGUI::ImageBox>("RotatingSkin",0,0,0,0,MyGUI::Align::Default,"Pointer","");
onCursorChange(MyGUI::PointerManager::getInstance().getDefaultPointer());
}
Cursor::~Cursor()
{
}
void Cursor::onCursorChange(const std::string &name)
{
ResourceImageSetPointerFix* imgSetPtr = dynamic_cast<ResourceImageSetPointerFix*>(
MyGUI::PointerManager::getInstance().getByName(name));
assert(imgSetPtr != NULL);
MyGUI::ResourceImageSet* imgSet = imgSetPtr->getImageSet();
std::string texture = imgSet->getIndexInfo(0,0).texture;
mSize = imgSetPtr->getSize();
mHotSpot = imgSetPtr->getHotSpot();
int rotation = imgSetPtr->getRotation();
mWidget->setImageTexture(texture);
MyGUI::ISubWidget* main = mWidget->getSubWidgetMain();
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
rotatingSubskin->setCenter(MyGUI::IntPoint(mSize.width/2,mSize.height/2));
rotatingSubskin->setAngle(Ogre::Degree(rotation).valueRadians());
}
void Cursor::update()
{
MyGUI::IntPoint position = MyGUI::InputManager::getInstance().getMousePosition();
mWidget->setPosition(position - mHotSpot);
mWidget->setSize(mSize);
}
void Cursor::setVisible(bool visible)
{
mWidget->setVisible(visible);
}
}

@ -0,0 +1,62 @@
#ifndef MWGUI_CURSOR_H
#define MWGUI_CURSOR_H
#include <MyGUI_IPointer.h>
#include <MyGUI_ResourceImageSet.h>
#include <MyGUI_RTTI.h>
namespace MWGui
{
/// \brief Allows us to get the members of
/// ResourceImageSetPointer that we need.
/// \example MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
/// MyGUI::ResourceManager::getInstance().load("core.xml");
class ResourceImageSetPointerFix :
public MyGUI::IPointer
{
MYGUI_RTTI_DERIVED( ResourceImageSetPointerFix )
public:
ResourceImageSetPointerFix();
virtual ~ResourceImageSetPointerFix();
virtual void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version);
virtual void setImage(MyGUI::ImageBox* _image);
virtual void setPosition(MyGUI::ImageBox* _image, const MyGUI::IntPoint& _point);
//and now for the whole point of this class, allow us to get
//the hot spot, the image and the size of the cursor.
virtual MyGUI::ResourceImageSetPtr getImageSet();
virtual MyGUI::IntPoint getHotSpot();
virtual MyGUI::IntSize getSize();
virtual int getRotation();
private:
MyGUI::IntPoint mPoint;
MyGUI::IntSize mSize;
MyGUI::ResourceImageSetPtr mImageSet;
int mRotation; // rotation in degrees
};
class Cursor
{
public:
Cursor();
~Cursor();
void update ();
void setVisible (bool visible);
void onCursorChange (const std::string& name);
private:
MyGUI::ImageBox* mWidget;
MyGUI::IntSize mSize;
MyGUI::IntPoint mHotSpot;
};
}
#endif

@ -1,16 +0,0 @@
#include "cursorreplace.hpp"
#include <boost/filesystem.hpp>
#include <openengine/ogre/imagerotate.hpp>
#include <OgreResourceGroupManager.h>
#include <OgreRoot.h>
using namespace MWGui;
CursorReplace::CursorReplace()
{
OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_vresize.png", 90);
OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_dresize1.png", -45);
OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_dresize2.png", 45);
}

@ -1,16 +0,0 @@
#ifndef GAME_CURSORREPLACE_H
#define GAME_CURSORREPLACE_H
#include <string>
namespace MWGui
{
/// \brief MyGUI does not support rotating cursors, so we have to do it manually
class CursorReplace
{
public:
CursorReplace();
};
}
#endif

@ -106,7 +106,7 @@ namespace MWGui
float progress = (float(mCurrentCellLoading)+refProgress) / float(mTotalCellsLoading);
assert(progress <= 1 && progress >= 0);
mLoadingText->setCaption(stage + "... ");
mLoadingText->setCaption(stage);
mProgressBar->setProgressPosition (static_cast<size_t>(progress * 1000));
static float loadingScreenFps = 30.f;

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/soundmanager.hpp"
namespace MWGui
{
@ -65,6 +66,7 @@ namespace MWGui
void MainMenu::onButtonClicked(MyGUI::Widget *sender)
{
MWBase::Environment::get().getSoundManager()->playSound("Menu Click", 1.f, 1.f);
if (sender == mButtons["return"])
MWBase::Environment::get().getWindowManager ()->removeGuiMode (GM_MainMenu);
else if (sender == mButtons["options"])

@ -6,6 +6,8 @@
#include <OgreTextureManager.h>
#include <OgreSceneNode.h>
#include <MyGUI_Gui.h>
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
@ -13,6 +15,8 @@
#include "../mwrender/globalmap.hpp"
#include "widgets.hpp"
using namespace MWGui;
LocalMapBase::LocalMapBase()
@ -96,6 +100,7 @@ void LocalMapBase::applyFogOfWar()
: "");
}
}
notifyMapChanged ();
}
void LocalMapBase::onMarkerFocused (MyGUI::Widget* w1, MyGUI::Widget* w2)
@ -425,3 +430,17 @@ void MapWindow::notifyPlayerUpdate ()
{
globalMapUpdatePlayer ();
}
void MapWindow::notifyMapChanged ()
{
// workaround to prevent the map from drawing on top of the button
MyGUI::IntCoord oldCoord = mButton->getCoord ();
MyGUI::Gui::getInstance().destroyWidget (mButton);
mButton = mMainWidget->createWidget<MWGui::Widgets::AutoSizedButton>("MW_Button",
oldCoord, MyGUI::Align::Bottom | MyGUI::Align::Right);
mButton->setProperty ("ExpandDirection", "Left");
mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &MapWindow::onWorldButtonClicked);
mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" :
"#{sWorld}");
}

@ -50,6 +50,7 @@ namespace MWGui
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
virtual void notifyPlayerUpdate() {}
virtual void notifyMapChanged() {}
OEngine::GUI::Layout* mLayout;
@ -99,6 +100,8 @@ namespace MWGui
virtual void onPinToggled();
virtual void notifyPlayerUpdate();
virtual void notifyMapChanged();
};
}
#endif

@ -95,31 +95,46 @@ namespace MWGui
// http://www.uesp.net/wiki/Lore:Calendar
std::string month;
int m = MWBase::Environment::get().getWorld ()->getMonth ();
if (m == 0)
switch (m) {
case 0:
month = "#{sMonthMorningstar}";
else if (m == 1)
break;
case 1:
month = "#{sMonthSunsdawn}";
else if (m == 2)
break;
case 2:
month = "#{sMonthFirstseed}";
else if (m == 3)
break;
case 3:
month = "#{sMonthRainshand}";
else if (m == 4)
break;
case 4:
month = "#{sMonthSecondseed}";
else if (m == 5)
break;
case 5:
month = "#{sMonthMidyear}";
else if (m == 6)
break;
case 6:
month = "#{sMonthSunsheight}";
else if (m == 7)
break;
case 7:
month = "#{sMonthLastseed}";
else if (m == 8)
break;
case 8:
month = "#{sMonthHeartfire}";
else if (m == 9)
break;
case 9:
month = "#{sMonthFrostfall}";
else if (m == 10)
break;
case 10:
month = "#{sMonthSunsdusk}";
else if (m == 11)
break;
case 11:
month = "#{sMonthEveningstar}";
break;
default:
break;
}
int hour = MWBase::Environment::get().getWorld ()->getTimeStamp ().getHour ();
bool pm = hour >= 12;
if (hour >= 13) hour -= 12;

@ -53,6 +53,7 @@
#include "trainingwindow.hpp"
#include "imagebutton.hpp"
#include "exposedwindow.hpp"
#include "cursor.hpp"
using namespace MWGui;
@ -131,6 +132,9 @@ WindowManager::WindowManager(
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ImageButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ExposedWindow>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
MyGUI::ResourceManager::getInstance().load("core.xml");
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &WindowManager::onRetrieveTag);
// Get size info from the Gui object
@ -179,6 +183,8 @@ WindowManager::WindowManager(
mInputBlocker = mGui->createWidget<MyGUI::Widget>("",0,0,w,h,MyGUI::Align::Default,"Windows","");
mCursor = new Cursor();
mHud->setVisible(mHudEnabled);
mCharGen = new CharacterCreation(this);
@ -236,6 +242,7 @@ WindowManager::~WindowManager()
delete mTrainingWindow;
delete mCountDialog;
delete mQuickKeysMenu;
delete mCursor;
cleanupGarbage();
@ -262,6 +269,8 @@ void WindowManager::update()
mHud->setFPS(mFPS);
mHud->setTriangleCount(mTriangleCount);
mHud->setBatchCount(mBatchCount);
mCursor->update();
}
void WindowManager::updateVisible()
@ -290,10 +299,10 @@ void WindowManager::updateVisible()
mEnchantingDialog->setVisible(false);
mTrainingWindow->setVisible(false);
mHud->setVisible(true);
mHud->setVisible(mHudEnabled);
// Mouse is visible whenever we're not in game mode
MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
mCursor->setVisible(isGuiMode());
bool gameMode = !isGuiMode();
@ -421,13 +430,19 @@ void WindowManager::updateVisible()
break;
case GM_LoadingWallpaper:
mHud->setVisible(false);
MyGUI::PointerManager::getInstance().setVisible(false);
mCursor->setVisible(false);
break;
case GM_Loading:
MyGUI::PointerManager::getInstance().setVisible(false);
// Show the pinned windows
mMap->setVisible(mMap->pinned());
mStatsWindow->setVisible(mStatsWindow->pinned());
mInventoryWindow->setVisible(mInventoryWindow->pinned());
mSpellWindow->setVisible(mSpellWindow->pinned());
mCursor->setVisible(false);
break;
case GM_Video:
MyGUI::PointerManager::getInstance().setVisible(false);
mCursor->setVisible(false);
mHud->setVisible(false);
break;
default:
@ -749,7 +764,7 @@ void WindowManager::setSpellVisibility(bool visible)
void WindowManager::setMouseVisible(bool visible)
{
MyGUI::PointerManager::getInstance().setVisible(visible);
mCursor->setVisible(visible);
}
void WindowManager::setDragDrop(bool dragDrop)

@ -72,6 +72,7 @@ namespace MWGui
class SpellCreationDialog;
class EnchantingDialog;
class TrainingWindow;
class Cursor;
class WindowManager : public MWBase::WindowManager
{
@ -261,6 +262,7 @@ namespace MWGui
EnchantingDialog* mEnchantingDialog;
TrainingWindow* mTrainingWindow;
Translation::Storage& mTranslationDataStorage;
Cursor* mCursor;
CharacterCreation* mCharGen;

@ -283,13 +283,11 @@ namespace MWInput
if (actionIsActive(A_MoveLeft))
{
triedToMove = true;
mPlayer.setAutoMove (false);
mPlayer.setLeftRight (-1);
}
else if (actionIsActive(A_MoveRight))
{
triedToMove = true;
mPlayer.setAutoMove (false);
mPlayer.setLeftRight (1);
}
else

@ -31,20 +31,18 @@ ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
Ogre::Entity *ent = mEntityList.mEntities[i];
bool transparent = false;
for (unsigned int j=0;j < ent->getNumSubEntities() && !transparent; ++j)
for(unsigned int j=0;!transparent && j < ent->getNumSubEntities(); ++j)
{
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements() && !transparent)
while(!transparent && techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements() && !transparent)
while(!transparent && passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
transparent = pass->isTransparent();
}
}
}

@ -53,8 +53,6 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
if(!mEntityList.mSkelBase)
return;
Ogre::SkeletonManager &skelMgr = Ogre::SkeletonManager::getSingleton();
mCurrentAnim = NULL;
mCurrentKeys = NULL;
mAnimVelocity = 0.0f;
@ -62,20 +60,15 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
mNonAccumRoot = NULL;
mSkeletonSources.clear();
std::vector<std::string>::const_iterator nameiter = names.begin();
std::vector<std::string>::const_iterator nameiter;
for(nameiter = names.begin();nameiter != names.end();nameiter++)
{
Ogre::SkeletonPtr skel = skelMgr.getByName(*nameiter);
if(skel.isNull())
{
NifOgre::Loader::createSkeleton(*nameiter);
skel = skelMgr.getByName(*nameiter);
Ogre::SkeletonPtr skel = NifOgre::Loader::getSkeleton(*nameiter);
if(skel.isNull())
{
std::cerr<< "Failed to get skeleton source "<<*nameiter <<std::endl;
continue;
}
}
skel->touch();
Ogre::Skeleton::BoneIterator boneiter = skel->getBoneIterator();

@ -32,20 +32,18 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr)
ent->setVisibilityFlags(RV_Actors);
bool transparent = false;
for (unsigned int j=0;j < ent->getNumSubEntities() && !transparent; ++j)
for(unsigned int j=0;!transparent && j < ent->getNumSubEntities(); ++j)
{
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements() && !transparent)
while(!transparent && techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements() && !transparent)
while(!transparent && passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
transparent = pass->isTransparent();
}
}
}

@ -124,6 +124,10 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell)
void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell,
AxisAlignedBox bounds)
{
// if we're in an empty cell, don't bother rendering anything
if (bounds.isNull ())
return;
mInterior = true;
mBounds = bounds;
@ -135,7 +139,7 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell,
mAngle = angle.valueRadians();
mCellCamera->setOrientation(Quaternion::IDENTITY);
mCameraRotNode->setOrientation(Quaternion(Math::Cos(angle/2.f), 0, 0, -Math::Sin(angle/2.f)));
mCameraRotNode->setOrientation(Quaternion(Math::Cos(mAngle/2.f), 0, 0, -Math::Sin(mAngle/2.f)));
// rotate the cell and merge the rotated corners to the bounding box
Vector2 _center(bounds.getCenter().x, bounds.getCenter().y);
@ -157,6 +161,9 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell,
mBounds.merge(Vector3(c3.x, c3.y, 0));
mBounds.merge(Vector3(c4.x, c4.y, 0));
// apply a little padding
mBounds.scale ((mBounds.getSize ()+Ogre::Vector3(1000,1000,0)) / mBounds.getSize ());
Vector2 center(mBounds.getCenter().x, mBounds.getCenter().y);
Vector2 min(mBounds.getMinimum().x, mBounds.getMinimum().y);

@ -108,19 +108,18 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
base->setVisibilityFlags(mVisibilityFlags);
bool transparent = false;
for(unsigned int j=0;j < base->getNumSubEntities();++j)
for(unsigned int j=0;!transparent && j < base->getNumSubEntities();++j)
{
Ogre::MaterialPtr mat = base->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements())
while(!transparent && techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements())
while(!transparent && passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
transparent = pass->isTransparent();
}
}
}
@ -323,9 +322,27 @@ NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, int
std::vector<Ogre::Entity*> &parts = entities.mEntities;
for(size_t i = 0;i < parts.size();i++)
{
parts[i]->getUserObjectBindings().setUserAny(Ogre::Any(group));
if (mVisibilityFlags != 0)
parts[i]->setVisibilityFlags(mVisibilityFlags);
parts[i]->getUserObjectBindings ().setUserAny (Ogre::Any(group));
bool transparent = false;
for(unsigned int j=0;!transparent && j < parts[i]->getNumSubEntities();++j)
{
Ogre::MaterialPtr mat = parts[i]->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while(!transparent && techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while(!transparent && passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
transparent = pass->isTransparent();
}
}
}
parts[i]->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
}
if(entities.mSkelBase)
{

@ -113,12 +113,8 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
Ogre::AxisAlignedBox bounds = Ogre::AxisAlignedBox::BOX_NULL;
NifOgre::EntityList entities = NifOgre::Loader::createEntities(insert, mesh);
for(size_t i = 0;i < entities.mEntities.size();i++)
{
const Ogre::AxisAlignedBox &tmp = entities.mEntities[i]->getBoundingBox();
bounds.merge(Ogre::AxisAlignedBox(insert->_getDerivedPosition() + tmp.getMinimum(),
insert->_getDerivedPosition() + tmp.getMaximum())
);
}
bounds.merge(entities.mEntities[i]->getWorldBoundingBox(true));
Ogre::Vector3 extents = bounds.getSize();
extents *= insert->getScale();
float size = std::max(std::max(extents.x, extents.y), extents.z);
@ -134,23 +130,21 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
mBounds[ptr.getCell()].merge(bounds);
bool transparent = false;
for(size_t i = 0;i < entities.mEntities.size();i++)
for(size_t i = 0;!transparent && i < entities.mEntities.size();i++)
{
Ogre::Entity *ent = entities.mEntities[i];
for (unsigned int i=0; i<ent->getNumSubEntities(); ++i)
for(unsigned int i=0;!transparent && i < ent->getNumSubEntities(); ++i)
{
Ogre::MaterialPtr mat = ent->getSubEntity(i)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements())
while(!transparent && techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements())
while(!transparent && passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
transparent = pass->isTransparent();
}
}
}

@ -20,7 +20,7 @@ enum RenderQueueGroups
RQG_UnderWater = Ogre::RENDER_QUEUE_4,
RQG_Water = Ogre::RENDER_QUEUE_7+1,
RQG_Water = RQG_Alpha,
// Sky late (sun & sun flare)
RQG_SkiesLate = Ogre::RENDER_QUEUE_SKIES_LATE

@ -27,13 +27,10 @@ namespace
{
const MWWorld::Class& class_ =
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell));
size_t numRefs = cellRefList.mList.size();
int current = 0;
for (typename T::List::iterator it = cellRefList.mList.begin();
it != cellRefList.mList.end(); it++)
{
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 1, current, numRefs);
++current;
if (it->mData.getCount() || it->mData.isEnabled())
@ -55,10 +52,6 @@ namespace
}
}
}
else
{
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 1, 0, 1);
}
}
}
@ -176,12 +169,18 @@ namespace MWWorld
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
{
Nif::NIFFile::CacheLock cachelock;
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
mRendering.preCellChange(mCurrentCell);
// remove active
MWBase::Environment::get().getMechanicsManager()->remove(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
std::string loadingExteriorText;
loadingExteriorText = gmst.find ("sLoadingMessage3")->getString();
CellStoreCollection::iterator active = mActiveCells.begin();
// get the number of cells to unload
@ -216,8 +215,6 @@ namespace MWWorld
continue;
}
}
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Unloading cells", 0, current, numUnload);
unloadCell (active++);
++current;
}
@ -266,7 +263,9 @@ namespace MWWorld
{
CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 0, current, numLoad);
//Loading Exterior loading text
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingExteriorText, 0, current, numLoad);
loadCell (cell);
++current;
}
@ -325,6 +324,13 @@ namespace MWWorld
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
{
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
std::string loadingInteriorText;
loadingInteriorText = gmst.find ("sLoadingMessage2")->getString();
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
bool loadcell = (mCurrentCell == NULL);
if(!loadcell)
@ -360,8 +366,6 @@ namespace MWWorld
active = mActiveCells.begin();
while (active!=mActiveCells.end())
{
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Unloading cells", 0, current, numUnload);
unloadCell (active++);
++current;
}
@ -369,7 +373,9 @@ namespace MWWorld
// Load cell.
std::cout << "cellName: " << cell->mCell->mName << std::endl;
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 0, 0, 1);
//Loading Interior loading text
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingInteriorText, 0, 0, 1);
loadCell (cell);
mCurrentCell = cell;

@ -2,7 +2,7 @@
macro (add_openmw_dir dir)
set (files)
foreach (u ${ARGN})
file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp")
file (GLOB ALL "${dir}/${u}.[ch]pp")
foreach (f ${ALL})
list (APPEND files "${f}")
list (APPEND OPENMW_FILES "${f}")
@ -14,7 +14,7 @@ endmacro (add_openmw_dir)
macro (add_component_dir dir)
set (files)
foreach (u ${ARGN})
file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp")
file (GLOB ALL "${dir}/${u}.[ch]pp")
foreach (f ${ALL})
list (APPEND files "${f}")
list (APPEND COMPONENT_FILES "${f}")
@ -26,12 +26,12 @@ endmacro (add_component_dir)
macro (add_component_qt_dir dir)
set (files)
foreach (u ${ARGN})
file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp")
file (GLOB ALL "${dir}/${u}.[ch]pp")
foreach (f ${ALL})
list (APPEND files "${f}")
list (APPEND COMPONENT_FILES "${f}")
endforeach (f)
file (GLOB MOC_H ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.hpp")
file (GLOB MOC_H "${dir}/${u}.hpp")
foreach (fi ${MOC_H})
list (APPEND COMPONENT_MOC_FILES "${fi}")
endforeach (fi)

@ -77,8 +77,7 @@ void ESMReader::open(Ogre::DataStreamPtr _esm, const std::string &name)
// Get the header
getHNT(mCtx.header, "HEDR", 300);
if (mCtx.header.version != VER_12 && mCtx.header.version != VER_13)
fail("Unsupported file format version");
// Some mods abuse the header.version field for the version of the mod instead of the version of the file format, so we can only ignore it.
while (isNextSub("MAST"))
{

@ -37,14 +37,14 @@ public:
*************************************************************************/
int getVer() const { return mCtx.header.version; }
float getFVer() { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
int getSpecial() { return mSpf; }
int getType() { return mCtx.header.type; }
const std::string getAuthor() { return mCtx.header.author.toString(); }
const std::string getDesc() { return mCtx.header.desc.toString(); }
float getFVer() const { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
int getSpecial() const { return mSpf; }
int getType() const { return mCtx.header.type; }
const std::string getAuthor() const { return mCtx.header.author.toString(); }
const std::string getDesc() const { return mCtx.header.desc.toString(); }
const SaveData &getSaveData() const { return mSaveData; }
const MasterList &getMasters() { return mMasters; }
const NAME &retSubName() { return mCtx.subName; }
const MasterList &getMasters() const { return mMasters; }
const NAME &retSubName() const { return mCtx.subName; }
uint32_t getSubSize() const { return mCtx.leftSub; }
/*************************************************************************

@ -7,12 +7,27 @@ namespace ESM
{
void Apparatus::load(ESMReader &esm)
{
mModel = esm.getHNString("MODL");
mName = esm.getHNString("FNAM");
esm.getHNT(mData, "AADT", 16);
mScript = esm.getHNOString("SCRI");
mIcon = esm.getHNString("ITEX");
// we will not treat duplicated subrecords as errors here
while (esm.hasMoreSubs())
{
esm.getSubName();
NAME subName = esm.retSubName();
if (subName == "MODL")
mModel = esm.getHString();
else if (subName == "FNAM")
mName = esm.getHString();
else if (subName == "AADT")
esm.getHT(mData);
else if (subName == "SCRI")
mScript = esm.getHString();
else if (subName == "ITEX")
mIcon = esm.getHString();
else
esm.fail("wrong subrecord type " + subName.toString() + " for APPA record");
}
}
void Apparatus::save(ESMWriter &esm)
{
esm.writeHNCString("MODL", mModel);

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/fixedpath.hpp */
#ifndef COMPONENTS_FILES_FIXEDPATH_HPP
#define COMPONENTS_FILES_FIXEDPATH_HPP

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/linuxpath.cpp */
#include "linuxpath.hpp"
#if defined(__linux__) || defined(__FreeBSD__)

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/linuxpath.hpp */
#ifndef COMPONENTS_FILES_LINUXPATH_H
#define COMPONENTS_FILES_LINUXPATH_H

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/macospath.cpp */
#include "macospath.hpp"
#if defined(macintosh) || defined(Macintosh) || defined(__APPLE__) || defined(__MACH__)

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/macospath.hpp */
#ifndef COMPONENTS_FILES_MACOSPATH_H
#define COMPONENTS_FILES_MACOSPATH_H

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/ogreplugin.hpp */
#ifndef COMPONENTS_FILES_OGREPLUGIN_H
#define COMPONENTS_FILES_OGREPLUGIN_H

@ -1,25 +1,3 @@
/**
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
* engine implementation.
*
* Copyright (C) 2011 Open Morrowind Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file components/files/windowspath.hpp */
#ifndef COMPONENTS_FILES_WINDOWSPATH_HPP
#define COMPONENTS_FILES_WINDOWSPATH_HPP

@ -142,20 +142,18 @@ public:
{
ShapeData::read(nif);
int tris = nif->getUShort();
if(tris)
{
/*int tris =*/ nif->getUShort();
// We have three times as many vertices as triangles, so this
// is always equal to tris*3.
int cnt = nif->getInt();
nif->getShorts(triangles, cnt);
}
// Read the match list, which lists the vertices that are equal to
// vertices. We don't actually need need this for anything, so
// just skip it.
int verts = nif->getUShort();
for(int i=0;i<verts;i++)
for(int i=0;i < verts;i++)
{
// Number of vertices matching vertex 'i'
int num = nif->getUShort();

@ -220,11 +220,10 @@ void NIFFile::parse()
for(size_t i = 0;i < recNum;i++)
{
std::string rec = getString();
//cout << i << ": " << rec.toString() << endl;
Record *r = NULL;
std::string rec = getString();
/* These are all the record types we know how to read.
This can be heavily optimized later if needed. For example, a
@ -256,6 +255,7 @@ void NIFFile::parse()
else if(rec == "NiDitherProperty") { r = new NiDitherProperty; r->recType = RC_NiDitherProperty; }
else if(rec == "NiWireframeProperty") { r = new NiWireframeProperty; r->recType = RC_NiWireframeProperty; }
else if(rec == "NiSpecularProperty") { r = new NiSpecularProperty; r->recType = RC_NiSpecularProperty; }
else if(rec == "NiStencilProperty") { r = new NiStencilProperty; r->recType = RC_NiStencilProperty; }
// Controllers
else if(rec == "NiVisController") { r = new NiVisController; r->recType = RC_NiVisController; }

@ -158,6 +158,7 @@ public:
short getShort() { return read_le16(); }
unsigned short getUShort() { return read_le16(); }
int getInt() { return read_le32(); }
unsigned int getUInt() { return read_le32(); }
float getFloat() { return read_le32f(); }
Ogre::Vector2 getVector2()
{

@ -257,9 +257,66 @@ struct S_AlphaProperty
}
};
/*
Docs taken from:
http://niftools.sourceforge.net/doc/nif/NiStencilProperty.html
*/
struct S_StencilProperty
{
// Is stencil test enabled?
unsigned char enabled;
/*
0 TEST_NEVER
1 TEST_LESS
2 TEST_EQUAL
3 TEST_LESS_EQUAL
4 TEST_GREATER
5 TEST_NOT_EQUAL
6 TEST_GREATER_EQUAL
7 TEST_ALWAYS
*/
int compareFunc;
unsigned stencilRef;
unsigned stencilMask;
/*
Stencil test fail action, depth test fail action and depth test pass action:
0 ACTION_KEEP
1 ACTION_ZERO
2 ACTION_REPLACE
3 ACTION_INCREMENT
4 ACTION_DECREMENT
5 ACTION_INVERT
*/
int failAction;
int zFailAction;
int zPassAction;
/*
Face draw mode:
0 DRAW_CCW_OR_BOTH
1 DRAW_CCW [default]
2 DRAW_CW
3 DRAW_BOTH
*/
int drawMode;
void read(NIFFile *nif)
{
enabled = nif->getChar();
compareFunc = nif->getInt();
stencilRef = nif->getUInt();
stencilMask = nif->getUInt();
failAction = nif->getInt();
zFailAction = nif->getInt();
zPassAction = nif->getInt();
drawMode = nif->getInt();
}
};
typedef StructPropT<S_AlphaProperty> NiAlphaProperty;
typedef StructPropT<S_MaterialProperty> NiMaterialProperty;
typedef StructPropT<S_VertexColorProperty> NiVertexColorProperty;
typedef StructPropT<S_StencilProperty> NiStencilProperty;
} // Namespace
#endif

@ -48,6 +48,7 @@ enum RecordType
RC_NiDitherProperty,
RC_NiWireframeProperty,
RC_NiSpecularProperty,
RC_NiStencilProperty,
RC_NiVisController,
RC_NiGeomMorpherController,
RC_NiKeyframeController,

@ -452,7 +452,8 @@ void loadResource(Ogre::Resource *resource)
}
}
bool createSkeleton(const std::string &name, const std::string &group, const Nif::Node *node)
static Ogre::SkeletonPtr createSkeleton(const std::string &name, const std::string &group, const Nif::Node *node)
{
/* We need to be a little aggressive here, since some NIFs have a crap-ton
* of nodes and Ogre only supports 256 bones. We will skip a skeleton if:
@ -463,7 +464,7 @@ bool createSkeleton(const std::string &name, const std::string &group, const Nif
if(!node->boneTrafo)
{
if(node->recType == Nif::RC_NiTriShape)
return false;
return Ogre::SkeletonPtr();
if(node->controller.empty() && node->name != "AttachLight")
{
if(node->recType == Nif::RC_NiNode || node->recType == Nif::RC_RootCollisionNode)
@ -474,18 +475,18 @@ bool createSkeleton(const std::string &name, const std::string &group, const Nif
{
if(!children[i].empty())
{
if(createSkeleton(name, group, children[i].getPtr()))
return true;
Ogre::SkeletonPtr skel = createSkeleton(name, group, children[i].getPtr());
if(!skel.isNull())
return skel;
}
}
return false;
return Ogre::SkeletonPtr();
}
}
}
Ogre::SkeletonManager &skelMgr = Ogre::SkeletonManager::getSingleton();
skelMgr.create(name, group, true, &sLoaders[name]);
return true;
return skelMgr.create(name, group, true, &sLoaders[name]);
}
};
@ -586,6 +587,8 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
m = static_cast<const Nif::NiMaterialProperty*>(pr);
else if (pr->recType == Nif::RC_NiAlphaProperty)
a = static_cast<const Nif::NiAlphaProperty*>(pr);
else if (pr->recType == Nif::RC_NiStencilProperty)
/* unused */;
else
warn("Skipped property type: "+pr->recName);
}
@ -602,7 +605,12 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
*/
static const char path[] = "textures\\";
texName = path + st->filename;
texName = st->filename;
Misc::StringUtils::toLower(texName);
if(texName.compare(0, sizeof(path)-1, path) != 0)
texName = path + texName;
Ogre::String::size_type pos = texName.rfind('.');
if(pos != Ogre::String::npos && texName.compare(pos, texName.length() - pos, ".dds") != 0)
{
@ -613,17 +621,11 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
// if it turns out that the above wasn't true in all cases (not for vanilla, but maybe mods)
// verify, and revert if false (this call succeeds quickly, but fails slowly)
if(!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
texName = path + st->filename;
}
else if (!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
{
// workaround for Better Heads addon
size_t lastSlash = st->filename.rfind('\\');
if (lastSlash != std::string::npos && lastSlash + 1 != st->filename.size()) {
texName = path + st->filename.substr(lastSlash + 1);
// workaround for Better Bodies addon
if (!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
texName = st->filename;
Misc::StringUtils::toLower(texName);
if(texName.compare(0, sizeof(path)-1, path) != 0)
texName = path + texName;
}
}
}
@ -721,8 +723,6 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
blend_mode += getBlendFactor((alphaFlags>>1)&0xf);
blend_mode += " ";
blend_mode += getBlendFactor((alphaFlags>>5)&0xf);
instance->setProperty("depth_write", sh::makeProperty(new sh::StringValue("off")));
instance->setProperty("scene_blend", sh::makeProperty(new sh::StringValue(blend_mode)));
}
else
@ -740,6 +740,7 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
instance->setProperty("transparent_sorting", sh::makeProperty(new sh::StringValue(((alphaFlags>>13)&1) ?
"off" : "on")));
sh::Factory::getInstance()._ensureMaterial(matname, "Default");
return matname;
}
@ -849,9 +850,12 @@ class NIFMeshLoader : Ogre::ManualResourceLoader
// Set the bounding box first
BoundsFinder bounds;
bounds.add(&srcVerts[0][0], srcVerts.size());
// No idea why this offset is needed. It works fine without it if the
// vertices weren't transformed first, but otherwise it fails later on
// when the object is being inserted into the scene.
if(!bounds.isValid())
{
float v[3] = { 0.0f, 0.0f, 0.0f };
bounds.add(&v[0], 1);
}
mesh->_setBounds(Ogre::AxisAlignedBox(bounds.minX()-0.5f, bounds.minY()-0.5f, bounds.minZ()-0.5f,
bounds.maxX()+0.5f, bounds.maxY()+0.5f, bounds.maxZ()+0.5f));
mesh->_setBoundingSphereRadius(bounds.getRadius());
@ -1148,10 +1152,7 @@ MeshInfoList Loader::load(const std::string &name, const std::string &group)
bool hasSkel = Ogre::SkeletonManager::getSingleton().resourceExists(name);
if(!hasSkel)
{
NIFSkeletonLoader skelldr;
hasSkel = skelldr.createSkeleton(name, group, node);
}
hasSkel = !NIFSkeletonLoader::createSkeleton(name, group, node).isNull();
NIFMeshLoader meshldr(name, group);
if(hasSkel)
@ -1214,14 +1215,20 @@ EntityList Loader::createEntities(Ogre::Entity *parent, const std::string &bonen
if(meshes.size() == 0)
return entitylist;
bool isskinned = false;
Ogre::SceneManager *sceneMgr = parentNode->getCreator();
std::string filter = "@shape=tri "+bonename;
Misc::StringUtils::toLower(filter);
for(size_t i = 0;i < meshes.size();i++)
{
Ogre::Entity *ent = sceneMgr->createEntity(meshes[i].mMeshName);
if(!entitylist.mSkelBase && ent->hasSkeleton())
if(!entitylist.mSkelBase)
{
if(ent->hasSkeleton())
entitylist.mSkelBase = ent;
}
else if(!isskinned && ent->hasSkeleton())
isskinned = true;
entitylist.mEntities.push_back(ent);
}
@ -1229,7 +1236,7 @@ EntityList Loader::createEntities(Ogre::Entity *parent, const std::string &bonen
if(bonename.find("Left") != std::string::npos)
scale.x *= -1.0f;
if(entitylist.mSkelBase)
if(isskinned)
{
for(size_t i = 0;i < entitylist.mEntities.size();i++)
{
@ -1261,30 +1268,35 @@ EntityList Loader::createEntities(Ogre::Entity *parent, const std::string &bonen
}
bool Loader::createSkeleton(const std::string &name, const std::string &group)
Ogre::SkeletonPtr Loader::getSkeleton(std::string name, const std::string &group)
{
Nif::NIFFile::ptr pnif = Nif::NIFFile::create(name);
Nif::NIFFile &nif = *pnif.get();
if(nif.numRecords() < 1)
Ogre::SkeletonPtr skel;
Misc::StringUtils::toLower(name);
skel = Ogre::SkeletonManager::getSingleton().getByName(name);
if(!skel.isNull())
return skel;
Nif::NIFFile::ptr nif = Nif::NIFFile::create(name);
if(nif->numRecords() < 1)
{
nif.warn("Found no NIF records in "+name+".");
return false;
nif->warn("Found no NIF records in "+name+".");
return skel;
}
// The first record is assumed to be the root node
Nif::Record const *r = nif.getRecord(0);
const Nif::Record *r = nif->getRecord(0);
assert(r != NULL);
Nif::Node const *node = dynamic_cast<Nif::Node const *>(r);
const Nif::Node *node = dynamic_cast<const Nif::Node*>(r);
if(node == NULL)
{
nif.warn("First record in "+name+" was not a node, but a "+
nif->warn("First record in "+name+" was not a node, but a "+
r->recName+".");
return false;
return skel;
}
NIFSkeletonLoader skelldr;
return skelldr.createSkeleton(name, group, node);
return NIFSkeletonLoader::createSkeleton(name, group, node);
}

@ -74,7 +74,7 @@ public:
std::string name,
const std::string &group="General");
static bool createSkeleton(const std::string &name, const std::string &group="General");
static Ogre::SkeletonPtr getSkeleton(std::string name, const std::string &group="General");
};
}

@ -9,7 +9,6 @@ set(MYGUI_FILES
core.skin
core.xml
EBGaramond-Regular.ttf
mwgui.png
Obliviontt.zip
openmw_alchemy_window.layout
openmw_book.layout

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

@ -4,6 +4,9 @@
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 249 249" name="_Main">
<!-- Edit box -->
<Widget type="Widget" skin="MW_Box" position="14 14 220 192" align="Stretch" name = "Client"/>
<Widget type="EditBox" skin="MW_TextBoxEdit" position="14 14 220 192" name="TextEdit" align="ALIGN_LEFT ALIGN_TOP STRETCH">
<Property key="MultiLine" value="1" />
<Property key="VisibleVScroll" value="1" />

@ -8,33 +8,52 @@
<Property key="Caption" value="Appearance"/>
<Property key="TextAlign" value="ALIGN_LEFT ALIGN_TOP"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="8 39 241 230">
<Widget type="Widget" skin="MW_Box" position="8 39 241 220">
<Widget type="ImageBox" skin="ImageBox" position_real="0 0 1 1" align="Stretch" name="PreviewImage"/>
</Widget>
<!-- Sliders -->
<!-- Rotation of head -->
<Widget type="ScrollBar" skin="MW_HScroll" position="8 276 241 14" name="HeadRotate"/>
<Widget type="ScrollBar" skin="MW_HScroll" position="8 270 241 14" name="HeadRotate"/>
<!-- Gender choice -->
<Widget type="Button" skin="MW_ScrollLeft" position="8 298 14 14" name="PrevGenderButton"/>
<Widget type="TextBox" skin="HeaderText" position="14 298 227 14" name="GenderChoiceT">
<Widget type="Widget" skin="MW_Box" position="8 298 15 14">
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="ALIGN_LEFT ALIGN_VSTRETCH" name="PrevGenderButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="14 298 227 14" name="GenderChoiceT" />
<Widget type="Widget" skin="MW_Box" position="234 298 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="NextGenderButton"/>
</Widget>
<Widget type="Button" skin="MW_ScrollRight" position="235 298 14 14" name="NextGenderButton"/>
<!-- Face choice -->
<Widget type="Button" skin="MW_ScrollLeft" position="8 320 14 14" name="PrevFaceButton"/>
<Widget type="TextBox" skin="HeaderText" position="14 320 227 14" name="FaceChoiceT">
<Widget type="Widget" skin="MW_Box" position="8 320 15 14">
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="ALIGN_LEFT ALIGN_VSTRETCH" name="PrevFaceButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="14 320 227 14" name="FaceChoiceT" />
<Widget type="Widget" skin="MW_Box" position="234 320 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="NextFaceButton"/>
</Widget>
<Widget type="Button" skin="MW_ScrollRight" position="235 320 14 14" name="NextFaceButton"/>
<!-- Hair choice -->
<Widget type="Button" skin="MW_ScrollLeft" position="8 342 14 14" name="PrevHairButton"/>
<Widget type="TextBox" skin="HeaderText" position="14 342 227 14" name="HairChoiceT">
<Widget type="Widget" skin="MW_Box" position="8 342 15 14">
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="ALIGN_LEFT ALIGN_VSTRETCH" name="PrevHairButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="14 342 227 14" name="HairChoiceT" />
<Widget type="Widget" skin="MW_Box" position="234 342 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="NextHairButton"/>
</Widget>
<Widget type="Button" skin="MW_ScrollRight" position="235 342 14 14" name="NextHairButton"/>
<!-- Race -->
<Widget type="TextBox" skin="HeaderText" position="261 16 132 18" name="RaceT" align="ALIGN_LEFT ALIGN_TOP">
<Property key="TextAlign" value="ALIGN_LEFT ALIGN_TOP"/>
</Widget>
@ -42,11 +61,11 @@
</Widget>
<!-- Spell powers -->
<Widget type="TextBox" skin="HeaderText" position="261 200 132 18" name="SpellPowerT" align="ALIGN_LEFT ALIGN_TOP">
<Widget type="TextBox" skin="HeaderText" position="261 210 132 18" name="SpellPowerT" align="ALIGN_LEFT ALIGN_TOP">
<Property key="TextAlign" value="ALIGN_LEFT ALIGN_TOP"/>
</Widget>
<!-- Spell power sub-widgets will be placed here, no skin to make it invisible -->
<Widget type="Widget" skin="" position="261 220 250 140" name="SpellPowerList" />
<Widget type="Widget" skin="" position="261 230 250 140" name="SpellPowerList" />
<!-- Skill bonus -->
<Widget type="TextBox" skin="HeaderText" position="403 39 159 18" name="SkillsT" align="ALIGN_LEFT ALIGN_TOP">

@ -3,13 +3,15 @@
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 588 433" name="_Main">
<Widget type="Widget" skin="MW_Box" position="8 8 415 381" align="Stretch" name = "Client"/>
<!-- The Dialogue history -->
<Widget type="DialogueHistory" skin="MW_TextBoxEdit" position="8 8 415 381" name="History" align="ALIGN_LEFT ALIGN_TOP ALIGN_STRETCH">
<Widget type="DialogueHistory" skin="MW_TextBoxEdit" position="13 13 405 371" name="History" align="ALIGN_LEFT ALIGN_TOP ALIGN_STRETCH">
<Property key="Static" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="MultiLine" value="1" />
<Property key="VisibleVScroll" value="1" />
<!-- invisible box for receiving mouse events -->
<!-- box for receiving mouse events -->
<Widget type="Widget" skin="" position="0 0 400 375" name="EventBox" align="ALIGN_LEFT ALIGN_TOP ALIGN_STRETCH"/>
</Widget>

@ -1,55 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<!-- Text edit widget -->
<Skin name = "MW_TextEditClient" size = "10 10">
<BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/>
</Skin>
<Skin name = "MW_TextBoxEditClient" size = "10 10">
<BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/>
</Skin>
<Skin name="MW_TextEdit" size="512 20" texture="mwgui.png">
<Skin name="MW_TextEdit" size="512 20">
<!-- Input -->
<Property key="FontName" value = "Default"/>
<Property key="TextAlign" value = "ALIGN_LEFT ALIGN_VCENTER" />
<Property key="TextColour" value = "0.75 0.6 0.35" />
<BasisSkin type="SubSkin" offset = "0 0 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "2 2 512 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "2 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "510 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "512 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 512 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "2 20 512 2"/>
</BasisSkin>
<Property key="TextColour" value = "0.75 0.6 0.35" />
<Child type="TextBox" skin="MW_TextEditClient" offset = "2 2 508 18" align = "Stretch" name = "Client"/>
<!-- Borders -->
<Child type="Widget" skin="MW_Box" offset="0 0 512 20" align="ALIGN_STRETCH" name="Client"/>
</Skin>
<Skin name="MW_TextBoxEdit" size="512 20" texture="mwgui.png">
<Skin name="MW_TextBoxEdit" size="512 20">
<Property key="FontName" value = "Default"/>
<Property key="TextAlign" value = "ALIGN_LEFT ALIGN_TOP" />
<Property key="TextColour" value = "0.75 0.6 0.35" />
<BasisSkin type="SubSkin" offset = "0 0 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "2 2 512 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "2 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "510 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "512 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 512 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "2 20 512 2"/>
</BasisSkin>
<Property key="TextColour" value = "0.75 0.6 0.35" />
<Child type="TextBox" skin="MW_TextBoxEditClient" offset = "2 2 490 18" align = "Stretch" name = "Client"/>
<Child type="ScrollBar" skin="MW_VScroll" offset = "494 3 14 14" align = "Right VStretch" name = "VScroll"/>
</Skin>
</MyGUI>

@ -31,7 +31,7 @@
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="MagnitudeMinSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="122 20 210 13" name="MagnitudeMinSlider">
<Property key="Range" value="100"/>
</Widget>
@ -39,7 +39,7 @@
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="122 52 210 13" name="MagnitudeMaxSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="122 52 210 13" name="MagnitudeMaxSlider">
<Property key="Range" value="100"/>
</Widget>
</Widget>
@ -56,7 +56,7 @@
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="DurationSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="122 20 210 13" name="DurationSlider">
<Property key="Range" value="1440"/>
</Widget>
</Widget>
@ -72,7 +72,7 @@
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="AreaSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="122 20 210 13" name="AreaSlider">
<Property key="Range" value="51"/>
</Widget>
</Widget>

@ -1,80 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<!-- The 'box' frame that surrounds various HUD items and other elements -->
<Skin name="HUD_Box" size="40 40" texture="mwgui.png">
<BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="4 2 38 2">
<Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<!-- The 'box' frame that surrounds various HUD items and other elements -->
<BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 26 2 36">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<Skin name="HUD_Box" size="40 40">
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="16 26 2 38">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<!-- Borders -->
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset="4 20 40 2">
<Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<Child type="Widget" skin="MW_Box" offset="0 0 40 40" align="ALIGN_LEFT Stretch" name="Client"/>
<!-- The interior of the box -->
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
</Skin>
<Skin name="HUD_Box_NoTransp" size="40 40" texture="mwgui.png">
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
<BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="4 2 38 2">
<Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 26 2 36">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<Skin name="HUD_Box_NoTransp" size="40 40">
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="16 26 2 38">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<!-- Borders -->
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset="4 20 40 2">
<Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<Child type="Widget" skin="MW_Box" offset="0 0 40 40" align="ALIGN_LEFT Stretch" name="Client"/>
<!-- The interior of the box -->
<Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
</Skin>
</MyGUI>

@ -1,228 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<!-- scroll tracker -->
<Skin name = "MW_ScrollTrack" size = "16 20" texture="mwgui.png">
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "38 24 16 2"/>
</BasisSkin>
<BasisSkin type="TileRect" offset="0 2 16 16" align="ALIGN_STRETCH">
<State name="normal" offset="38 26 16 16">
<Property key="TileSize" value="16 16"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "38 42 16 2"/>
</BasisSkin>
</Skin>
<Skin name = "MW_ScrollTrackH" size = "12 20" texture="mwgui.png">
<BasisSkin type="SubSkin" offset = "0 0 12 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "38 24 12 2"/>
</BasisSkin>
<BasisSkin type="TileRect" offset="0 2 12 16" align="ALIGN_STRETCH">
<State name="normal" offset="40 26 12 16">
<Property key="TileSize" value="12 16"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 12 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "38 42 12 2"/>
</BasisSkin>
</Skin>
<Skin name = "MW_ScrollUp" size = "16 20" texture="mwgui.png">
<!-- border -->
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "20 24 16 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "20 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "14 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "34 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "20 42 16 2"/>
</BasisSkin>
<!-- arrow -->
<BasisSkin type="SubSkin" offset = "2 2 12 16" align = "ALIGN_STRETCH">
<State name="normal" offset = "56 24 8 8"/>
</BasisSkin>
</Skin>
<!-- Horizontal Scrollbar -->
<Skin name = "MW_ScrollDown" size = "16 20" texture="mwgui.png">
<!-- border -->
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "20 24 16 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "20 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "14 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "34 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "20 42 16 2"/>
</BasisSkin>
<!-- arrow -->
<BasisSkin type="SubSkin" offset = "2 2 12 16" align = "ALIGN_STRETCH">
<State name="normal" offset = "56 44 8 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_HScroll" size="90 14">
<Property key="TrackRangeMargins" value="14 14" />
<Property key="MinTrackSize" value="14" />
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="true"/>
<Skin name = "MW_ScrollLeft" size = "16 20" texture="mwgui.png">
<!-- border -->
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "20 24 16 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "20 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "14 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "34 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "20 42 16 2"/>
</BasisSkin>
<!-- arrow -->
<BasisSkin type="SubSkin" offset = "2 2 12 16" align = "ALIGN_STRETCH">
<State name="normal" offset = "56 54 8 8"/>
</BasisSkin>
</Skin>
<!-- Tracker must be last to be on top and receive mouse events -->
<Skin name = "MW_ScrollRight" size = "16 20" texture="mwgui.png">
<!-- border -->
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "20 24 16 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "20 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "14 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "34 26 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "20 42 16 2"/>
</BasisSkin>
<!-- arrow -->
<BasisSkin type="SubSkin" offset = "2 2 12 16" align = "ALIGN_STRETCH">
<State name="normal" offset = "56 34 8 8"/>
</BasisSkin>
</Skin>
<Child type="Button" skin="MW_Box" offset="18 0 54 14" align="ALIGN_STRETCH" name="Background"/>
<Skin name = "MW_HScrollBackground" size = "512 20" texture="mwgui.png">
<BasisSkin type="SubSkin" offset = "0 0 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "2 2 512 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "2 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "510 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "512 4 2 16"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 18 512 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "2 20 512 2"/>
</BasisSkin>
<!-- Arrows -->
<Child type="Widget" skin="MW_Box" offset="0 0 15 14" align="ALIGN_LEFT ALIGN_VSTRETCH"/>
<Child type="Button" skin="MW_ArrowLeft" offset="3 2 10 10" align="ALIGN_LEFT ALIGN_VSTRETCH" name="Start"/>
<Child type="Widget" skin="MW_Box" offset="75 0 15 14" align="ALIGN_RIGHT ALIGN_VSTRETCH"/>
<Child type="Button" skin="MW_ArrowRight" offset="76 2 10 10" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="End"/>
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset="14 0 24 14" align="ALIGN_TOP ALIGN_HSTRETCH" name="FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset="52 0 24 14" align="ALIGN_TOP ALIGN_HSTRETCH" name="SecondPart"/>
<Child type="Button" skin="MW_ScrollTrackH" offset="38 2 30 9" align="ALIGN_LEFT ALIGN_VSTRETCH" name="Track"/>
</Skin>
<Skin name = "MW_VScrollBackground" size = "16 512" texture="mwgui.png">
<BasisSkin type="SubSkin" offset = "0 0 16 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "2 24 16 2"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 2 2 512" align = "ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset = "2 26 2 512"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "14 2 2 512" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset = "16 26 2 512"/>
</BasisSkin>
<BasisSkin type="SubSkin" offset = "0 512 16 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset = "2 538 16 2"/>
<Skin name="MW_ScrollTrackH" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<BasisSkin type="TileRect" offset="6 0 3 16" align="Stretch">
<State name="normal" offset="70 22 16 16">
<Property key="TileSize" value="16 16"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name = "MW_ScrollEmptyPart" size = "16 16" >
</Skin>
<!-- Vertical Scrollbar -->
<!-- Morrowind has a 1 pixel gap between the left arrow and the inner bar, this skin does not replicate that -->
<Skin name = "MW_HScroll" size = "90 14">
<Property key="TrackRangeMargins" value = "14 14" />
<Property key="MinTrackSize" value = "14" />
<Property key="VerticalAlignment" value="false"/>
<Skin name="MW_VScroll" size="14 90">
<Property key="TrackRangeMargins" value="14 14" />
<Property key="MinTrackSize" value="14" />
<Property key="MoveToClick" value="true"/>
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
<Child type="Button" skin="MW_HScrollBackground" offset = "14 0 62 14" align = "ALIGN_STRETCH" name = "Background"/>
<Child type="Button" skin="MW_ScrollLeft" offset = "0 0 14 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "Start"/>
<Child type="Button" skin="MW_ScrollRight" offset = "76 0 14 14" align = "ALIGN_RIGHT ALIGN_VSTRETCH" name = "End"/>
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "14 0 24 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "52 0 24 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "SecondPart"/>
<Child type="Button" skin="MW_Box" offset="0 18 14 55" align="ALIGN_STRETCH" name="Background"/>
<!-- Tracker must be last to be on top and receive mouse events -->
<Child type="Button" skin="MW_ScrollTrackH" offset = "38 0 14 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "Track"/>
</Skin>
<!-- Arrows -->
<!-- Morrowind has a 1 pixel gap between the left arrow and the inner bar, this skin does not replicate that -->
<Skin name = "MW_HSlider" size = "90 14">
<Property key="TrackRangeMargins" value = "14 14" />
<Property key="MinTrackSize" value = "14" />
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="true"/>
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
<Child type="Button" skin="MW_HScrollBackground" offset = "14 0 62 14" align = "ALIGN_STRETCH" name = "Background"/>
<Child type="Widget" skin="MW_Box" offset="0 0 14 15" align="ALIGN_TOP ALIGN_HSTRETCH"/>
<Child type="Button" skin="MW_ArrowUp" offset="2 3 10 10" align="ALIGN_TOP ALIGN_HSTRETCH" name="Start"/>
<Child type="Button" skin="MW_ScrollLeft" offset = "0 0 14 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "Start"/>
<Child type="Button" skin="MW_ScrollRight" offset = "76 0 14 14" align = "ALIGN_RIGHT ALIGN_VSTRETCH" name = "End"/>
<Child type="Widget" skin="MW_Box" offset="0 76 14 15" align="ALIGN_BOTTOM ALIGN_HSTRETCH"/>
<Child type="Button" skin="MW_ArrowDown" offset="2 77 10 10" align="ALIGN_BOTTOM ALIGN_HSTRETCH" name="End"/>
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "14 0 24 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "52 0 24 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "SecondPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset="0 14 24 14" align="ALIGN_LEFT ALIGN_VSTRETCH" name="FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset="0 52 24 14" align="ALIGN_LEFT ALIGN_VSTRETCH" name="SecondPart"/>
<!-- Tracker must be last to be on top and receive mouse events -->
<Child type="Button" skin="MW_ScrollTrackH" offset = "38 0 14 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "Track"/>
</Skin>
<!-- Morrowind has a 1 pixel gap between the top arrow and the inner bar, this skin does not replicate that -->
<Skin name = "MW_VScroll" size = "14 90">
<Property key="TrackRangeMargins" value = "14 14" />
<Property key="MinTrackSize" value = "14" />
<Property key="MoveToClick" value="true"/>
<Child type="Button" skin="MW_ScrollTrackV" offset="2 40 9 30" align="ALIGN_TOP ALIGN_HSTRETCH" name="Track"/>
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
<Child type="Button" skin="MW_VScrollBackground" offset = "0 14 14 62" align = "ALIGN_STRETCH" name = "Background"/>
<Child type="Button" skin="MW_ScrollUp" offset = "0 0 14 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "Start"/>
<Child type="Button" skin="MW_ScrollDown" offset = "0 76 14 14" align = "ALIGN_BOTTOM ALIGN_HSTRETCH" name = "End"/>
</Skin>
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "0 14 24 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset = "0 52 24 14" align = "ALIGN_LEFT ALIGN_VSTRETCH" name = "SecondPart"/>
<Skin name="MW_ScrollTrackV" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<BasisSkin type="TileRect" offset="0 7 16 3" align="Stretch">
<State name="normal" offset="68 19 16 16">
<Property key="TileSize" value="16 16"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<!-- Tracker must be last to be on top and receive mouse events -->
<Child type="Button" skin="MW_ScrollTrack" offset = "0 38 14 14" align = "ALIGN_TOP ALIGN_HSTRETCH" name = "Track"/>
<!-- Empty space in scrollbar -->
<Skin name="MW_ScrollEmptyPart" size="16 16" >
</Skin>
<Skin name = "HeaderText" size = "16 16">
<Property key="FontName" value = "Default"/>
<Property key="TextAlign" value = "ALIGN_CENTER" />
<Property key="TextColour" value = "0.82 0.74 0.58" />
<!-- Header text -->
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
<Skin name="HeaderText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="ALIGN_CENTER" />
<Property key="TextColour" value="0.82 0.74 0.58" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="ALIGN_STRETCH"/>
</Skin>
<!-- list and multilist skins -->
<Skin name = "MW_ListLine" size = "5 5" texture="mwgui.png">
<Property key="FontName" value = "Default" />
<Property key="TextAlign" value = "ALIGN_LEFT ALIGN_VCENTER" />
<BasisSkin type="SimpleText" offset = "2 0 1 5" align = "ALIGN_STRETCH">
<Skin name="MW_ListLine" size="5 5">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="ALIGN_LEFT ALIGN_VCENTER" />
<BasisSkin type="SimpleText" offset="2 0 1 5" align="ALIGN_STRETCH">
<State name="disabled" colour="0.70 0.57 0.33" shift="0"/>
<State name="normal" colour="0.70 0.57 0.33" shift="0"/>
<State name="highlighted" colour="0.85 0.76 0.60" shift="0"/>
@ -234,81 +113,85 @@
</BasisSkin>
</Skin>
<Skin name = "MW_List" size = "516 516" align = "ALIGN_LEFT ALIGN_TOP" texture="mwgui.png">
<Property key="NeedKey" value = "true" />
<Property key="SkinLine" value = "MW_ListLine" />
<Property key="HeightLine" value = "20" />
<Child type="ScrollBar" skin="MW_VScroll" offset = "498 3 14 509" align = "ALIGN_RIGHT ALIGN_VSTRETCH" name = "VScroll">
</Child>
<Child type="Widget" skin="" offset = "3 3 493 509" align = "ALIGN_STRETCH" name = "Client">
</Child>
<Child type="Widget" skin="IB_T" offset="2 0 512 2" align="ALIGN_TOP ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_B" offset="2 514 512 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_L" offset="0 2 2 512" align="ALIGN_LEFT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_R" offset="514 2 2 512" align="ALIGN_RIGHT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_TL" offset="0 0 2 2" align="ALIGN_TOP ALIGN_LEFT"/>
<Child type="Widget" skin="IB_TR" offset="514 0 2 2" align="ALIGN_TOP ALIGN_RIGHT"/>
<Child type="Widget" skin="IB_BL" offset="0 514 2 2" align="ALIGN_BOTTOM ALIGN_LEFT"/>
<Child type="Widget" skin="IB_BR" offset="514 514 2 2" align="ALIGN_BOTTOM ALIGN_RIGHT"/>
<Skin name="MW_List" size="516 516" align="ALIGN_LEFT ALIGN_TOP">
<Property key="NeedKey" value="true" />
<Property key="SkinLine" value="MW_ListLine" />
<Property key="HeightLine" value="20" />
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="ALIGN_STRETCH"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="VScroll"/>
<Child type="Widget" skin="" offset="3 3 493 509" align="ALIGN_STRETCH" name="Client"/>
</Skin>
<Skin name = "MW_SimpleList" size = "516 516" align = "ALIGN_LEFT ALIGN_TOP" texture="mwgui.png">
<Child type="Widget" skin="" offset = "3 3 510 510" align = "ALIGN_STRETCH" name = "Client">
</Child>
<Child type="Widget" skin="IB_T" offset="2 0 512 2" align="ALIGN_TOP ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_B" offset="2 514 512 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_L" offset="0 2 2 512" align="ALIGN_LEFT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_R" offset="514 2 2 512" align="ALIGN_RIGHT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_TL" offset="0 0 2 2" align="ALIGN_TOP ALIGN_LEFT"/>
<Child type="Widget" skin="IB_TR" offset="514 0 2 2" align="ALIGN_TOP ALIGN_RIGHT"/>
<Child type="Widget" skin="IB_BL" offset="0 514 2 2" align="ALIGN_BOTTOM ALIGN_LEFT"/>
<Child type="Widget" skin="IB_BR" offset="514 514 2 2" align="ALIGN_BOTTOM ALIGN_RIGHT"/>
<Skin name="MW_SimpleList" size="516 516" align="ALIGN_LEFT ALIGN_TOP">
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="ALIGN_STRETCH"/>
<Child type="Widget" skin="" offset="3 3 510 510" align="Top Left ALIGN_STRETCH" name="Client"/>
</Skin>
<Skin name = "MW_MultiSubList" size = "516 516" align = "ALIGN_LEFT ALIGN_TOP">
<Property key="NeedKey" value = "true" />
<Property key="SkinLine" value = "MW_ListLine" />
<Property key="HeightLine" value = "20" />
<Skin name="MW_MultiSubList" size="516 516" align="ALIGN_LEFT ALIGN_TOP">
<Property key="NeedKey" value="true" />
<Property key="SkinLine" value="MW_ListLine" />
<Property key="HeightLine" value="20" />
<Child type="ScrollBar" skin="VScroll" offset = "498 3 14 509" align = "ALIGN_RIGHT ALIGN_VSTRETCH" name = "VScroll">
</Child>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="ALIGN_STRETCH"/>
<Child type="Widget" skin="Default" offset = "3 3 493 509" align = "ALIGN_STRETCH" name = "Client">
</Child>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="VScroll"/>
<BasisSkin type="MainSkin" offset = "0 0 0 0" align = "ALIGN_LEFT ALIGN_TOP"/>
<Child type="Widget" skin="Default" offset="3 3 493 509" align="ALIGN_STRETCH" name="Client"/>
</Skin>
<Skin name = "MW_MultiList" size = "516 516" align = "ALIGN_LEFT ALIGN_TOP">
<Property key="NeedKey" value = "true" />
<Property key="SkinButton" value = "ButtonSmall" />
<Property key="_SkinButtonEmpty" value = "EditBox" />
<Property key="HeightButton" value = "20" />
<Property key="SkinList" value = "MW_MultiSubList" />
<Child type="Widget" skin="" offset = "3 3 516 516" align = "ALIGN_STRETCH" name = "Client">
</Child>
<Child type="Widget" skin="IB_T" offset="2 0 512 2" align="ALIGN_TOP ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_B" offset="2 514 512 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH"/>
<Child type="Widget" skin="IB_L" offset="0 2 2 512" align="ALIGN_LEFT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_R" offset="514 2 2 512" align="ALIGN_RIGHT ALIGN_VSTRETCH"/>
<Child type="Widget" skin="IB_TL" offset="0 0 2 2" align="ALIGN_TOP ALIGN_LEFT"/>
<Child type="Widget" skin="IB_TR" offset="514 0 2 2" align="ALIGN_TOP ALIGN_RIGHT"/>
<Child type="Widget" skin="IB_BL" offset="0 514 2 2" align="ALIGN_BOTTOM ALIGN_LEFT"/>
<Child type="Widget" skin="IB_BR" offset="514 514 2 2" align="ALIGN_BOTTOM ALIGN_RIGHT"/>
<Skin name="MW_MultiList" size="516 516" align="ALIGN_LEFT ALIGN_TOP">
<Property key="NeedKey" value="true" />
<Property key="SkinButton" value="ButtonSmall" />
<Property key="_SkinButtonEmpty" value="EditBox" />
<Property key="HeightButton" value="20" />
<Property key="SkinList" value="MW_MultiSubList" />
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="ALIGN_STRETCH"/>
<Child type="Widget" skin="" offset="3 3 516 516" align="ALIGN_STRETCH" name="Client"/>
</Skin>
<!-- textures/menu_thin_border_top.dds -->
<Skin name = "MW_HLine" size = "512 18" texture="mwgui.png">
<BasisSkin type="SubSkin" offset = "0 8 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset = "20 106 512 2"/>
<!-- Horizontal line -->
<Skin name="MW_HLine" size="512 10" texture="textures\menu_thin_border_top.dds">
<BasisSkin type="SubSkin" offset="0 0 512 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset="0 0 512 2"/>
</BasisSkin>
</Skin>
<!-- Arrows -->
<Skin name="MW_ArrowLeft" size="20 20" texture="textures\menu_scroll_left.dds">
<BasisSkin type="SubSkin" offset="0 0 19 20" align="Stretch">
<State name="normal" offset="0 0 19 20"/>
</BasisSkin>
</Skin>
<Skin name="MW_ArrowRight" size="20 20" texture="textures\menu_scroll_right.dds">
<BasisSkin type="SubSkin" offset="1 0 19 20" align="Stretch">
<State name="normal" offset="1 0 19 20"/>
</BasisSkin>
</Skin>
<Skin name="MW_ArrowUp" size="20 20" texture="textures\menu_scroll_up.dds">
<BasisSkin type="SubSkin" offset="0 0 20 19" align="Stretch">
<State name="normal" offset="0 0 20 19"/>
</BasisSkin>
</Skin>
<Skin name="MW_ArrowDown" size="20 20" texture="textures\menu_scroll_down.dds">
<BasisSkin type="SubSkin" offset="0 1 20 20" align="Stretch">
<State name="normal" offset="0 1 20 20"/>
</BasisSkin>
</Skin>
</MyGUI>

@ -8,7 +8,8 @@
<Widget type="Widget" skin="HUD_Box" position="0 200 300 60" align="Bottom HCenter">
<Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText">
<Widget type="TextBox" skin="SandText" position="20 12 260 20" name="LoadingText">
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<Skin name="MW_MapView" size="516 516" texture="mwgui.png">
<Skin name="MW_MapView" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<!-- invisible scroll bars, needed for setting the view offset -->

@ -5,26 +5,31 @@
<Property key="Point" value="7 0"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="ArrowPointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="hresize">
<Property key="Point" value="16 14"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="vresize">
<Property key="Point" value="17 16"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="VResizePointerImage"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="90"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize">
<Property key="Point" value="17 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="DResizePointerImage"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize2">
<Property key="Point" value="15 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="DResize2PointerImage"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="-45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="drop_ground">
<Property key="Point" value="0 24"/>

@ -17,27 +17,6 @@
</Index>
</Group>
</Resource>
<Resource type="ResourceImageSet" name="VResizePointerImage">
<Group name="Pointer" texture="mwpointer_vresize.png" size="32 32">
<Index name="Pointer" >
<Frame point="0 0"/>
</Index>
</Group>
</Resource>
<Resource type="ResourceImageSet" name="DResizePointerImage">
<Group name="Pointer" texture="mwpointer_dresize1.png" size="32 32">
<Index name="Pointer" >
<Frame point="o o"/>
</Index>
</Group>
</Resource>
<Resource type="ResourceImageSet" name="DResize2PointerImage">
<Group name="Pointer" texture="mwpointer_dresize2.png" size="32 32">
<Index name="Pointer" >
<Frame point="0 0"/>
</Index>
</Group>
</Resource>
<Resource type="ResourceImageSet" name="DropGroundPointerImage">
<Group name="Pointer" texture="textures\cursor_drop_ground.dds" size="32 32">
<Index name="Pointer" >

@ -2,12 +2,12 @@
<MyGUI type="Skin">
<Skin name="MW_ScrollView" size="516 516" texture="mwgui.png">
<Skin name="MW_ScrollView" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="VScroll"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="ALIGN_RIGHT ALIGN_TOP ALIGN_VSTRETCH" name="VScroll"/>
</Skin>
<Skin name="MW_ScrollViewH" size="516 516" texture="mwgui.png">
<Skin name="MW_ScrollViewH" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<Child type="ScrollBar" skin="MW_HScroll" offset="3 498 509 14" align="ALIGN_LEFT ALIGN_BOTTOM ALIGN_HSTRETCH" name="HScroll"/>
</Skin>

@ -15,7 +15,7 @@
<Widget type="TextBox" skin="NormalText" position="4 4 352 18" align="Left Top">
<Property key="Caption" value="#{sTransparency_Menu}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 28 352 18" align="Left Top" name="MenuTransparencySlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MenuTransparencySlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 52 352 18" align="Left Top">
@ -30,7 +30,7 @@
<Widget type="TextBox" skin="NormalText" position="4 78 352 18" align="Left Top">
<Property key="Caption" value="#{sMenu_Help_Delay}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 102 352 18" align="Left Top" name="ToolTipDelaySlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 102 352 18" align="Left Top" name="ToolTipDelaySlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 126 352 18" align="Left Top">
@ -64,35 +64,35 @@
<Widget type="TextBox" skin="NormalText" position="4 4 352 18" align="Left Top">
<Property key="Caption" value="#{sMaster}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 28 352 18" align="Left Top" name="MasterVolume">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MasterVolume">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="4 54 352 18" align="Left Top">
<Property key="Caption" value="#{sVoice}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 78 352 18" align="Left Top" name="VoiceVolume">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 78 352 18" align="Left Top" name="VoiceVolume">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="4 104 352 18" align="Left Top">
<Property key="Caption" value="#{sEffects}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 128 352 18" align="Left Top" name="EffectsVolume">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 128 352 18" align="Left Top" name="EffectsVolume">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="4 154 352 18" align="Left Top">
<Property key="Caption" value="#{sFootsteps}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 178 352 18" align="Left Top" name="FootstepsVolume">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 178 352 18" align="Left Top" name="FootstepsVolume">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="4 204 352 18" align="Left Top">
<Property key="Caption" value="#{sMusic}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 228 352 18" align="Left Top" name="MusicVolume">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 228 352 18" align="Left Top" name="MusicVolume">
<Property key="Range" value="1000000"/>
</Widget>
</Widget>
@ -117,7 +117,7 @@
<Widget type="TextBox" skin="NormalText" position="4 228 160 18" align="Left Top">
<Property key="Caption" value="UI cursor sensitivity"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 252 160 18" align="Left Top" name="UISensitivitySlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 252 160 18" align="Left Top" name="UISensitivitySlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 276 160 18" align="Left Top">
@ -133,7 +133,7 @@
<Widget type="TextBox" skin="NormalText" position="180 228 160 18" align="Left Top">
<Property key="Caption" value="Camera sensitivity"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="180 252 160 18" align="Left Top" name="CameraSensitivitySlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="180 252 160 18" align="Left Top" name="CameraSensitivitySlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="180 276 160 18" align="Left Top">
@ -198,7 +198,7 @@
<Widget type="TextBox" skin="NormalText" position="4 198 329 18" align="Left Top" name="FovText">
<Property key="Caption" value="Field of View"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 222 329 18" align="Left Top" name="FOVSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 222 329 18" align="Left Top" name="FOVSlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 246 329 18" align="Left Top">
@ -223,7 +223,7 @@
<Widget type="TextBox" skin="SandText" position="0 0 300 24" align="Left Top" name="AnisotropyLabel">
<Property key="Caption" value="Anisotropy"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="0 28 150 18" align="Left Top" name="AnisotropySlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="0 28 150 18" align="Left Top" name="AnisotropySlider">
<Property key="Range" value="1000000"/>
</Widget>
</Widget>
@ -231,7 +231,7 @@
<Widget type="TextBox" skin="NormalText" position="4 130 322 18" align="Left Top">
<Property key="Caption" value="#{sRender_Distance}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="4 154 322 18" align="Left Top" name="ViewDistanceSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="4 154 322 18" align="Left Top" name="ViewDistanceSlider">
<Property key="Range" value="1000000"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 178 332 18" align="Left Top">

@ -53,7 +53,7 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
// Create GUI
mGui = new Gui();
mGui->initialise("core.xml");
mGui->initialise("");
}
void MyGUIManager::updateWindow (Ogre::RenderWindow *wnd)

@ -1,88 +0,0 @@
#include "imagerotate.hpp"
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreImage.h>
#include <OgreTexture.h>
#include <OgreRenderTarget.h>
#include <OgreCamera.h>
#include <OgreTextureUnitState.h>
#include <OgreHardwarePixelBuffer.h>
using namespace Ogre;
using namespace OEngine::Render;
void ImageRotate::rotate(const std::string& sourceImage, const std::string& destImage, const float angle)
{
Root* root = Ogre::Root::getSingletonPtr();
std::string destImageRot = std::string(destImage) + std::string("_rot");
SceneManager* sceneMgr = root->createSceneManager(ST_GENERIC);
Camera* camera = sceneMgr->createCamera("ImageRotateCamera");
MaterialPtr material = MaterialManager::getSingleton().create("ImageRotateMaterial", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
TextureUnitState* tus = material->getTechnique(0)->getPass(0)->createTextureUnitState(sourceImage);
Degree deg(angle);
tus->setTextureRotate(Radian(deg.valueRadians()));
tus->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
tus->setTextureBorderColour(ColourValue(0, 0, 0, 0));
Rectangle2D* rect = new Rectangle2D(true);
rect->setCorners(-1.0, 1.0, 1.0, -1.0);
rect->setMaterial("ImageRotateMaterial");
// Render the background before everything else
rect->setRenderQueueGroup(RENDER_QUEUE_BACKGROUND);
// Use infinite AAB to always stay visible
AxisAlignedBox aabInf;
aabInf.setInfinite();
rect->setBoundingBox(aabInf);
// Attach background to the scene
SceneNode* node = sceneMgr->getRootSceneNode()->createChildSceneNode();
node->attachObject(rect);
// retrieve image width and height
TexturePtr sourceTexture = TextureManager::getSingleton().getByName(sourceImage);
unsigned int width = sourceTexture->getWidth();
unsigned int height = sourceTexture->getHeight();
TexturePtr destTextureRot = TextureManager::getSingleton().createManual(
destImageRot,
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
TEX_TYPE_2D,
width, height,
0,
PF_FLOAT16_RGBA,
TU_RENDERTARGET);
RenderTarget* rtt = destTextureRot->getBuffer()->getRenderTarget();
rtt->setAutoUpdated(false);
Viewport* vp = rtt->addViewport(camera);
vp->setOverlaysEnabled(false);
vp->setShadowsEnabled(false);
vp->setBackgroundColour(ColourValue(0,0,0,0));
rtt->update();
//copy the rotated image to a static texture
TexturePtr destTexture = TextureManager::getSingleton().createManual(
destImage,
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
TEX_TYPE_2D,
width, height,
0,
PF_FLOAT16_RGBA,
Ogre::TU_STATIC);
destTexture->getBuffer()->blit(destTextureRot->getBuffer());
// remove all the junk we've created
TextureManager::getSingleton().remove(destImageRot);
MaterialManager::getSingleton().remove("ImageRotateMaterial");
root->destroySceneManager(sceneMgr);
delete rect;
}

@ -1,27 +0,0 @@
#ifndef OENGINE_OGRE_IMAGEROTATE_HPP
#define OENGINE_OGRE_IMAGEROTATE_HPP
#include <string>
namespace OEngine
{
namespace Render
{
/// Rotate an image by certain degrees and save as file, uses the GPU
/// Make sure Ogre Root is initialised before calling
class ImageRotate
{
public:
/**
* @param source image (file name - has to exist in an resource group)
* @param name of the destination texture to save to (in memory)
* @param angle in degrees to turn
*/
static void rotate(const std::string& sourceImage, const std::string& destImage, const float angle);
};
}
}
#endif
Loading…
Cancel
Save