Merged pull request #1912

pull/1820/head
Marc Zinnschlag 6 years ago
commit 6100e34051

@ -526,7 +526,10 @@ public:
class ConvertGAME : public Converter
{
public:
ConvertGAME() : mHasGame(false) {}
ConvertGAME()
: mHasGame(false)
{
}
virtual void read(ESM::ESMReader &esm)
{

@ -14,13 +14,13 @@ namespace ESSImport
{
struct GMDT
{
char mCellName[64];
int mFogColour;
float mFogDensity;
int mCurrentWeather, mNextWeather;
int mWeatherTransition; // 0-100 transition between weathers, top 3 bytes may be garbage
float mTimeOfNextTransition; // weather changes when gamehour == timeOfNextTransition
int mMasserPhase, mSecundaPhase; // top 3 bytes may be garbage
char mCellName[64] {};
int mFogColour {0};
float mFogDensity {0.f};
int mCurrentWeather {0}, mNextWeather {0};
int mWeatherTransition {0}; // 0-100 transition between weathers, top 3 bytes may be garbage
float mTimeOfNextTransition {0.f}; // weather changes when gamehour == timeOfNextTransition
int mMasserPhase {0}, mSecundaPhase {0}; // top 3 bytes may be garbage
};
GMDT mGMDT;

@ -6,6 +6,8 @@
#include <MyGUI_Gui.h>
#include <MyGUI_Window.h>
#include <components/debug/debuglog.hpp>
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp"
@ -49,7 +51,14 @@ KeyboardNavigation::KeyboardNavigation()
KeyboardNavigation::~KeyboardNavigation()
{
try
{
MyGUI::WidgetManager::getInstance().unregisterUnlinker(this);
}
catch(const MyGUI::Exception& e)
{
Log(Debug::Error) << "Error in the destructor: " << e.what();
}
}
void KeyboardNavigation::saveFocus(int mode)

@ -5,6 +5,8 @@
#include <MyGUI_WidgetDefines.h>
#include <MyGUI_Widget.h>
#include <components/debug/debuglog.hpp>
namespace MWGui
{
/** The Layout class is an utility class used to load MyGUI layouts
@ -16,7 +18,17 @@ namespace MWGui
Layout(const std::string & _layout, MyGUI::Widget* _parent = nullptr)
: mMainWidget(nullptr)
{ initialise(_layout, _parent); }
virtual ~Layout() { shutdown(); }
virtual ~Layout()
{
try
{
shutdown();
}
catch(const MyGUI::Exception& e)
{
Log(Debug::Error) << "Error in the destructor: " << e.what();
}
}
MyGUI::Widget* getWidget(const std::string& _name);

@ -98,9 +98,16 @@ namespace MWGui
}
ScreenFader::~ScreenFader()
{
try
{
MyGUI::Gui::getInstance().eventFrameStart -= MyGUI::newDelegate(this, &ScreenFader::onFrameStart);
}
catch(const MyGUI::Exception& e)
{
Log(Debug::Error) << "Error in the destructor: " << e.what();
}
}
void ScreenFader::onFrameStart(float dt)
{

@ -517,6 +517,8 @@ namespace MWGui
}
WindowManager::~WindowManager()
{
try
{
mKeyboardNavigation.reset();
@ -548,6 +550,11 @@ namespace MWGui
mGuiPlatform->shutdown();
delete mGuiPlatform;
}
catch(const MyGUI::Exception& e)
{
Log(Debug::Error) << "Error in the destructor: " << e.what();
}
}
void WindowManager::setStore(const MWWorld::ESMStore &store)
{

@ -2145,10 +2145,12 @@ void CharacterController::update(float duration)
if (isTurning())
{
// Adjust animation speed from 1.0 to 1.5 multiplier
float turnSpeed = std::min(1.5f, std::abs(rot.z()) / duration / static_cast<float>(osg::PI));
if (duration > 0)
{
float turnSpeed = std::min(1.5f, std::abs(rot.z()) / duration / static_cast<float>(osg::PI));
mAnimation->adjustSpeedMult(mCurrentMovement, std::max(turnSpeed, 1.0f));
}
}
else if (mMovementState != CharState_None && mAdjustMovementAnimSpeed)
{
float speedmult = speed / mMovementAnimSpeed;

@ -219,6 +219,7 @@ namespace
RemoveFinishedCallbackVisitor(int effectId)
: RemoveVisitor()
, mHasMagicEffects(false)
, mEffectId(effectId)
{
}

@ -1483,7 +1483,8 @@ void OpenAL_Output::resumeSounds(int types)
OpenAL_Output::OpenAL_Output(SoundManager &mgr)
: Sound_Output(mgr), mDevice(0), mContext(0)
: Sound_Output(mgr)
, mDevice(0), mContext(0)
, mListenerPos(0.0f, 0.0f, 0.0f), mListenerEnv(Env_Normal)
, mWaterFilter(0), mWaterEffect(0), mDefaultEffect(0), mEffectSlot(0)
, mStreamThread(new StreamThread)

@ -26,10 +26,10 @@ namespace MWSound
struct {
bool EXT_EFX : 1;
bool SOFT_HRTF : 1;
} ALC;
} ALC = {false, false};
struct {
bool SOFT_source_spatialize : 1;
} AL;
} AL = {false};
typedef std::deque<ALuint> IDDq;
IDDq mFreeSources;

@ -1159,11 +1159,17 @@ namespace MWWorld
osg::Vec3f vec(x, y, z);
CellStore *currCell = ptr.isInCell() ? ptr.getCell() : NULL; // currCell == NULL should only happen for player, during initial startup
CellStore *currCell = ptr.isInCell() ? ptr.getCell() : nullptr; // currCell == nullptr should only happen for player, during initial startup
bool isPlayer = ptr == mPlayer->getPlayer();
bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell));
MWWorld::Ptr newPtr = ptr;
if (!isPlayer && !currCell)
throw std::runtime_error("Can not move actor \"" + ptr.getCellRef().getRefId() + "\" to another cell: current cell is nullptr");
if (!newCell)
throw std::runtime_error("Can not move actor \"" + ptr.getCellRef().getRefId() + "\" to another cell: new cell is nullptr");
if (currCell != newCell)
{
removeContainerScripts(ptr);
@ -1185,10 +1191,10 @@ namespace MWWorld
addContainerScripts (getPlayerPtr(), newCell);
newPtr = getPlayerPtr();
}
else if (currCell)
else
{
bool currCellActive = mWorldScene->isCellActive(*currCell);
bool newCellActive = newCell && mWorldScene->isCellActive(*newCell);
bool newCellActive = mWorldScene->isCellActive(*newCell);
if (!currCellActive && newCellActive)
{
newPtr = currCell->moveTo(ptr, newCell);

@ -175,17 +175,18 @@ static void gdb_info(pid_t pid)
fflush(stdout);
/* Clean up */
remove(respfile);
if (remove(respfile) != 0)
Log(Debug::Warning) << "Warning: can not remove file '" << respfile << "': " << std::strerror(errno);
}
else
{
/* Error creating temp file */
if(fd >= 0)
{
if (close(fd) == 0)
remove(respfile);
else
Log(Debug::Warning) << "Warning: can not close and remove file '" << respfile << "': " << std::strerror(errno);
if (close(fd) != 0)
Log(Debug::Warning) << "Warning: can not close file '" << respfile << "': " << std::strerror(errno);
else if (remove(respfile) != 0)
Log(Debug::Warning) << "Warning: can not remove file '" << respfile << "': " << std::strerror(errno);
}
printf("!!! Could not create gdb command file\n");
}

@ -41,8 +41,6 @@ namespace Debug
{
return size;
}
char mDebugLevel;
};
#if defined(_WIN32) && defined(_DEBUG)

@ -78,14 +78,14 @@ struct Cell
struct DATAstruct
{
int mFlags;
int mX, mY;
int mFlags {0};
int mX {0}, mY {0};
};
struct AMBIstruct
{
Color mAmbient, mSunlight, mFog;
float mFogDensity;
Color mAmbient {0}, mSunlight {0}, mFog {0};
float mFogDensity {0.f};
};
Cell() : mName(""),

@ -103,21 +103,16 @@ namespace Files
};
ConstrainedFileStream::ConstrainedFileStream(const char *filename, size_t start, size_t length)
: std::istream(new ConstrainedFileStreamBuf(filename, start, length))
ConstrainedFileStream::ConstrainedFileStream(std::unique_ptr<std::streambuf> buf)
: std::istream(buf.get())
, mBuf(std::move(buf))
{
}
ConstrainedFileStream::~ConstrainedFileStream()
{
delete rdbuf();
}
IStreamPtr openConstrainedFileStream(const char *filename,
size_t start, size_t length)
{
return IStreamPtr(new ConstrainedFileStream(filename, start, length));
auto buf = std::unique_ptr<std::streambuf>(new ConstrainedFileStreamBuf(filename, start, length));
return IStreamPtr(new ConstrainedFileStream(std::move(buf)));
}
}

@ -11,9 +11,11 @@ namespace Files
class ConstrainedFileStream : public std::istream
{
public:
ConstrainedFileStream(const char *filename,
size_t start=0, size_t length=0xFFFFFFFF);
virtual ~ConstrainedFileStream();
ConstrainedFileStream(std::unique_ptr<std::streambuf> buf);
virtual ~ConstrainedFileStream() {};
private:
std::unique_ptr<std::streambuf> mBuf;
};
typedef std::shared_ptr<std::istream> IStreamPtr;

@ -161,7 +161,17 @@ namespace Gui
mTextures.clear();
for (std::vector<MyGUI::ResourceManualFont*>::iterator it = mFonts.begin(); it != mFonts.end(); ++it)
{
try
{
MyGUI::ResourceManager::getInstance().removeByName((*it)->getResourceName());
}
catch(const MyGUI::Exception& e)
{
Log(Debug::Error) << "Error in the destructor: " << e.what();
}
}
mFonts.clear();
}

Loading…
Cancel
Save