Allow fractional cycle times for internal AO

master
Ansariel 2025-02-17 13:07:27 +01:00
parent 58b606676a
commit f2244decff
3 changed files with 6 additions and 9 deletions

View File

@ -1629,7 +1629,7 @@ void AOEngine::update()
}
else if (state_params[num].substr(0, 2) == "CT")
{
LLStringUtil::convertToS32(state_params[num].substr(2, state_params[num].size() - 2), state->mCycleTime);
LLStringUtil::convertToF32(state_params[num].substr(2, state_params[num].size() - 2), state->mCycleTime);
LL_DEBUGS("AOEngine") << "Cycle Time specified:" << state->mCycleTime << LL_ENDL;
}
else
@ -1828,12 +1828,9 @@ bool AOEngine::renameSet(AOSet* set, const std::string& name)
void AOEngine::saveState(const AOSet::AOState* state)
{
std::string stateParams = state->mName;
F32 time = (F32)state->mCycleTime;
if (time > 0.0f)
if (state->mCycleTime > 0.0f)
{
std::ostringstream timeStr;
timeStr << ":CT" << state->mCycleTime;
stateParams += timeStr.str();
stateParams += llformat(":CT%.2f", state->mCycleTime);
}
if (state->mCycle)
{
@ -2041,7 +2038,7 @@ void AOEngine::setRandomize(AOSet::AOState* state, bool randomize)
void AOEngine::setCycleTime(AOSet::AOState* state, F32 time)
{
state->mCycleTime = (S32)time;
state->mCycleTime = time;
state->mDirty = true;
}

View File

@ -85,7 +85,7 @@ class AOSet
LLUUID mRemapID;
bool mCycle;
bool mRandom;
S32 mCycleTime;
F32 mCycleTime;
std::vector<AOAnimation> mAnimations;
U32 mCurrentAnimation;
LLUUID mCurrentAnimationID;

View File

@ -221,7 +221,7 @@
left_pad="8"
height="16"
right="-1"
decimal_digits="0"
decimal_digits="2"
initial_value="0"
min_val="0"
max_val="999"