Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy-archive/alchemy
  • Liru/alchemy
  • TesticularSlingshot/alchemy
3 results
Show changes
Showing
with 60 additions and 49 deletions
......@@ -49,23 +49,23 @@ class LLStreamingAudio_FMODSTUDIO final : public LLStreamingAudioInterface
LLStreamingAudio_FMODSTUDIO(FMOD::System *system);
/*virtual*/ ~LLStreamingAudio_FMODSTUDIO();
/*virtual*/ void start(const std::string& url) final override;
/*virtual*/ void stop() final override;
/*virtual*/ void pause(S32 pause) final override;
/*virtual*/ void update() final override;
/*virtual*/ S32 isPlaying() final override;
/*virtual*/ void setGain(F32 vol) final override;
/*virtual*/ F32 getGain() final override;
/*virtual*/ std::string getURL() final override;
/*virtual*/ void start(const std::string& url) override;
/*virtual*/ void stop() override;
/*virtual*/ void pause(S32 pause) override;
/*virtual*/ void update() override;
/*virtual*/ S32 isPlaying() override;
/*virtual*/ void setGain(F32 vol) override;
/*virtual*/ F32 getGain() override;
/*virtual*/ std::string getURL() override;
/*virtual*/ bool supportsAdjustableBufferSizes() final override {return true;}
/*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime) final override;
/*virtual*/ bool supportsAdjustableBufferSizes() override {return true;}
/*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime) override;
/*virtual*/ bool supportsMetaData() final override {return true;}
/*virtual*/ const LLSD *getMetaData() final override { return mMetaData; } //return NULL if not playing.
/*virtual*/ bool hasNewMetaData() final override;
/*virtual*/ bool supportsWaveData() final override {return true;}
/*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1) final override;
/*virtual*/ bool supportsMetaData() override {return true;}
/*virtual*/ const LLSD *getMetaData() override { return mMetaData; } //return NULL if not playing.
/*virtual*/ bool hasNewMetaData() override;
/*virtual*/ bool supportsWaveData() override {return true;}
/*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1) override;
private:
bool releaseDeadStreams();
void cleanupWaveData();
......
......@@ -505,8 +505,8 @@ ELoadStatus LLBVHLoader::loadAliases(const char * filename)
{
if ( LLSDSerialize::fromXML(aliases_sd, input_stream) )
{
for(LLSD::map_iterator alias_iter = aliases_sd.beginMap();
alias_iter != aliases_sd.endMap();
for(LLSD::map_iterator alias_iter = aliases_sd.beginMap(), alias_end = aliases_sd.endMap();
alias_iter != alias_end;
++alias_iter)
{
LLSD::String alias_name = alias_iter->first;
......
......@@ -182,7 +182,7 @@ public:
virtual LLJoint* findCollisionVolume(S32 volume_id) { return nullptr; }
virtual S32 getCollisionVolumeID(std::string &name) { return -1; }
virtual S32 getCollisionVolumeID(const std::string &name) { return -1; }
void setAnimationData(const std::string& name, void *data);
......
......@@ -71,6 +71,9 @@ LLEditingMotion::LLEditingMotion( const LLUUID &id) : LLMotion(id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
// save character for future use
mCharacter = character;
......
......@@ -80,6 +80,9 @@ LLHandMotion::LLHandMotion(const LLUUID &id) : LLMotion(id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLHandMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
return STATUS_SUCCESS;
......
......@@ -89,6 +89,7 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
mPelvisJoint = character->getJoint("mPelvis");
......@@ -289,6 +290,9 @@ LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
mHeadJoint = character->getJoint("mHead");
......
......@@ -46,7 +46,6 @@
LLKeyframeFallMotion::LLKeyframeFallMotion(const LLUUID &id) : LLKeyframeMotion(id)
{
mVelocityZ = 0.f;
mCharacter = nullptr;
}
//-----------------------------------------------------------------------------
......@@ -54,11 +53,12 @@ LLKeyframeFallMotion::LLKeyframeFallMotion(const LLUUID &id) : LLKeyframeMotion(
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *character)
{
// save character pointer for later use
mCharacter = character;
// load keyframe data, setup pose and joint states
LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character);
if (result == STATUS_FAILURE)
{
return result;
}
for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++)
{
......
......@@ -68,7 +68,6 @@ protected:
//-------------------------------------------------------------------------
// Member Data
//-------------------------------------------------------------------------
LLCharacter* mCharacter;
F32 mVelocityZ;
LLPointer<LLJointState> mPelvisState;
LLQuaternion mRotationToGroundNormal;
......
......@@ -430,6 +430,9 @@ LLJoint* LLKeyframeMotion::getJoint(U32 index)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
LLUUID* character_id;
......
......@@ -48,7 +48,6 @@ const F32 POSITION_THRESHOLD = 0.1f;
LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id)
{
mFlipFeet = FALSE;
mCharacter = nullptr;
// create kinematic hierarchy
mPelvisJoint.addChild( &mHipLeftJoint );
......@@ -78,9 +77,6 @@ LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotio
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *character)
{
// save character pointer for later use
mCharacter = character;
mFlipFeet = FALSE;
// load keyframe data, setup pose and joint states
......
......@@ -69,8 +69,6 @@ public:
//-------------------------------------------------------------------------
// Member Data
//-------------------------------------------------------------------------
LLCharacter *mCharacter;
BOOL mFlipFeet;
LLPointer<LLJointState> mPelvisState;
......
......@@ -54,7 +54,6 @@ const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustm
//-----------------------------------------------------------------------------
LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id)
: LLKeyframeMotion(id),
mCharacter(nullptr),
mCyclePhase(0.0f),
mRealTimeLast(0.0f),
mAdjTimeLast(0.0f),
......@@ -66,8 +65,6 @@ LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLKeyframeWalkMotion::onInitialize(LLCharacter *character)
{
mCharacter = character;
return LLKeyframeMotion::onInitialize(character);
}
......@@ -148,6 +145,9 @@ LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) :
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
mLeftAnkleJoint = mCharacter->getJoint("mAnkleLeft");
mRightAnkleJoint = mCharacter->getJoint("mAnkleRight");
......@@ -338,6 +338,9 @@ LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
mCharacter = character;
LLJoint* pelvisJoint = mCharacter->getJoint("mPelvis");
......
......@@ -73,7 +73,6 @@ public:
//-------------------------------------------------------------------------
// Member Data
//-------------------------------------------------------------------------
LLCharacter *mCharacter;
F32 mCyclePhase;
F32 mRealTimeLast;
F32 mAdjTimeLast;
......
......@@ -767,8 +767,8 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
void LLMotionController::updateLoadingMotions()
{
// query pending motions for completion
for (auto iter = mLoadingMotions.begin();
iter != mLoadingMotions.end(); )
for (auto iter = mLoadingMotions.begin(), end = mLoadingMotions.end();
iter != end; )
{
auto curiter = iter++;
LLMotion* motionp = *curiter;
......
......@@ -36,6 +36,7 @@
#include "llframetimer.h"
#include "llstring.h"
#include "absl/container/node_hash_map.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
......@@ -72,7 +73,7 @@ public:
protected:
typedef absl::flat_hash_map<LLUUID, LLMotionConstructor> motion_map_t;
typedef absl::node_hash_map<LLUUID, LLMotionConstructor> motion_map_t;
motion_map_t mMotionTable;
};
......
......@@ -61,6 +61,9 @@ LLTargetingMotion::LLTargetingMotion(const LLUUID &id)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *character)
{
if (!character)
return STATUS_FAILURE;
// save character for future use
mCharacter = character;
......
......@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
* Alchemy Viewer Source Code
* Copyright (C) 2019, Alchemy Viewer Project, Inc.
* Copyright (C) 2019, Alchemy Development Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......
......@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
* Alchemy Viewer Source Code
* Copyright (C) 2019, Alchemy Viewer Project, Inc.
* Copyright (C) 2019, Alchemy Development Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......
......@@ -45,8 +45,8 @@ class LLCurrencyWrapper final : public LLSingleton<LLCurrencyWrapper>
public:
void setCurrency(const std::string& currency);
void setHomeCurrency(const std::string& currency);
std::string getCurrency() const { return mCurrency; }
std::string getHomeCurrency() const { return mHomeCurrency; }
const std::string& getCurrency() const { return mCurrency; }
const std::string& getHomeCurrency() const { return mHomeCurrency; }
std::string wrapCurrency(const std::string& to_substitute) const;
void wrapCurrency(std::string& to_substitute) const;
......
......@@ -429,7 +429,7 @@ namespace
}
typedef std::map<std::string, LLError::ELevel> LevelMap;
typedef absl::flat_hash_map<std::string, LLError::ELevel> LevelMap;
typedef std::vector<LLError::RecorderPtr> Recorders;
typedef std::vector<LLError::CallSite*> CallSiteVector;
......@@ -492,7 +492,7 @@ namespace LLError
LevelMap mClassLevelMap;
LevelMap mFileLevelMap;
LevelMap mTagLevelMap;
std::map<std::string, unsigned int> mUniqueLogMessages;
absl::flat_hash_map<std::string, unsigned int> mUniqueLogMessages;
LLError::FatalFunction mCrashFunction;
LLError::TimeFunction mTimeFunction;
......@@ -856,7 +856,7 @@ namespace {
LLSD::array_const_iterator i, end;
for (i = list.beginArray(), end = list.endArray(); i != end; ++i)
{
map[*i] = level;
map[(*i).asString()] = level;
}
}
}
......@@ -1368,7 +1368,7 @@ namespace LLError
{
std::ostringstream message_stream;
std::map<std::string, unsigned int>::iterator messageIter = s->mUniqueLogMessages.find(message);
const auto messageIter = s->mUniqueLogMessages.find(message);
if (messageIter != s->mUniqueLogMessages.end())
{
messageIter->second++;
......@@ -1464,15 +1464,14 @@ namespace LLError
}
#if LL_WINDOWS
// VC80 was optimizing the error away.
// #pragma optimize("", off)
// MSVC is optimizing the error away.
#pragma optimize("", off)
#endif
void crashAndLoop(const std::string& message)
{
// Now, we go kaboom!
int* make_me_crash = nullptr;
*make_me_crash = 0;
*make_me_crash = 0xDEADBEEF;
while(true)
{
......@@ -1488,7 +1487,7 @@ namespace LLError
#endif
}
#if LL_WINDOWS
// #pragma optimize("", on)
#pragma optimize("", on)
#endif
std::string utcTime()
......