Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -21,6 +21,7 @@ set(aistatemachine_SOURCE_FILES
|
||||
aistatemachine.cpp
|
||||
aistatemachinethread.cpp
|
||||
aitimer.cpp
|
||||
aicondition.cpp
|
||||
)
|
||||
|
||||
set(aistatemachine_HEADER_FILES
|
||||
@@ -29,6 +30,7 @@ set(aistatemachine_HEADER_FILES
|
||||
aistatemachine.h
|
||||
aistatemachinethread.h
|
||||
aitimer.h
|
||||
aicondition.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${aistatemachine_HEADER_FILES}
|
||||
|
||||
89
indra/aistatemachine/aicondition.cpp
Normal file
89
indra/aistatemachine/aicondition.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* @file aicondition.cpp
|
||||
* @brief Implementation of AICondition
|
||||
*
|
||||
* Copyright (c) 2013, Aleric Inglewood.
|
||||
*
|
||||
* 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 2 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/>.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||
*
|
||||
* CHANGELOG
|
||||
* and additional copyright holders.
|
||||
*
|
||||
* 14/10/2013
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
#include "sys.h"
|
||||
#include "aicondition.h"
|
||||
#include "aistatemachine.h"
|
||||
|
||||
void AIConditionBase::wait(AIStateMachine* state_machine)
|
||||
{
|
||||
// The condition must be locked before calling AIStateMachine::wait().
|
||||
llassert(mutex().isSelfLocked());
|
||||
// Add the new state machine at the end.
|
||||
mWaitingStateMachines.push_back(state_machine);
|
||||
}
|
||||
|
||||
void AIConditionBase::remove(AIStateMachine* state_machine)
|
||||
{
|
||||
mutex().lock();
|
||||
// Remove all occurances of state_machine from the queue.
|
||||
queue_t::iterator const end = mWaitingStateMachines.end();
|
||||
queue_t::iterator last = end;
|
||||
for (queue_t::iterator iter = mWaitingStateMachines.begin(); iter != last; ++iter)
|
||||
{
|
||||
if (iter->get() == state_machine)
|
||||
{
|
||||
if (--last == iter)
|
||||
{
|
||||
break;
|
||||
}
|
||||
queue_t::value_type::swap(*iter, *last);
|
||||
}
|
||||
}
|
||||
// This invalidates all iterators involved, including end, but not any iterators to the remaining elements.
|
||||
mWaitingStateMachines.erase(last, end);
|
||||
mutex().unlock();
|
||||
}
|
||||
|
||||
void AIConditionBase::signal(int n)
|
||||
{
|
||||
// The condition must be locked before calling AICondition::signal or AICondition::broadcast.
|
||||
llassert(mutex().isSelfLocked());
|
||||
// Signal n state machines.
|
||||
while (n > 0 && !mWaitingStateMachines.empty())
|
||||
{
|
||||
LLPointer<AIStateMachine> state_machine = mWaitingStateMachines.front();
|
||||
bool success = state_machine->signalled();
|
||||
// Only state machines that are actually still blocked should be in the queue:
|
||||
// they are removed from the queue by calling AICondition::remove whenever
|
||||
// they are unblocked for whatever reason...
|
||||
llassert(success);
|
||||
if (success)
|
||||
{
|
||||
++n;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We never get here...
|
||||
remove(state_machine.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
110
indra/aistatemachine/aicondition.h
Normal file
110
indra/aistatemachine/aicondition.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* @file aicondition.h
|
||||
* @brief Condition variable for statemachines.
|
||||
*
|
||||
* Copyright (c) 2013, Aleric Inglewood.
|
||||
*
|
||||
* 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 2 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/>.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||
*
|
||||
* CHANGELOG
|
||||
* and additional copyright holders.
|
||||
*
|
||||
* 14/10/2013
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
#ifndef AICONDITION_H
|
||||
#define AICONDITION_H
|
||||
|
||||
#include <deque>
|
||||
#include <llpointer.h>
|
||||
#include "aithreadsafe.h"
|
||||
|
||||
class AIStateMachine;
|
||||
class LLMutex;
|
||||
|
||||
// class AICondition
|
||||
//
|
||||
// Call AIStateMachine::wait(AICondition&) in the multiplex_impl of a state machine to
|
||||
// make the state machine go idle until some thread calls AICondition::signal().
|
||||
//
|
||||
// If the state machine is no longer running or wasn't waiting anymore because
|
||||
// something else woke it up, then AICondition::signal() will wake up another
|
||||
// state machine (if any).
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// struct Foo { bool met(); }; // Returns true when the condition is met.
|
||||
// AICondition<Foo> Condition_t;
|
||||
// AIAccess<Foo> Condition_wat;
|
||||
//
|
||||
// // Some thread-safe condition variable.
|
||||
// Condition_t condition;
|
||||
//
|
||||
// // Inside the state machine:
|
||||
// {
|
||||
// ...
|
||||
// state WAIT_FOR_CONDITION:
|
||||
// {
|
||||
// // Lock condition and check it. Wait if condition is not met yet.
|
||||
// {
|
||||
// Condition_wat condition_w(condition);
|
||||
// if (!condition_w->met())
|
||||
// {
|
||||
// wait(condition);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// set_state(CONDITION_MET);
|
||||
// break;
|
||||
// }
|
||||
// CONDITION_MET:
|
||||
// {
|
||||
//
|
||||
|
||||
class AIConditionBase
|
||||
{
|
||||
public:
|
||||
virtual ~AIConditionBase() { }
|
||||
|
||||
void signal(int n = 1); // Call this when the condition was met to release n state machines.
|
||||
void broadcast(void) { signal(mWaitingStateMachines.size()); } // Release all blocked state machines.
|
||||
|
||||
private:
|
||||
// These functions are called by AIStateMachine.
|
||||
friend class AIStateMachine;
|
||||
void wait(AIStateMachine* state_machine);
|
||||
void remove(AIStateMachine* state_machine);
|
||||
|
||||
protected:
|
||||
virtual LLMutex& mutex(void) = 0;
|
||||
|
||||
protected:
|
||||
typedef std::deque<LLPointer<AIStateMachine> > queue_t;
|
||||
queue_t mWaitingStateMachines;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class AICondition : public AIThreadSafeSimpleDC<T>, public AIConditionBase
|
||||
{
|
||||
protected:
|
||||
/*virtual*/ LLMutex& mutex(void) { return this->mMutex; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "aistatemachine.h"
|
||||
#include "aicondition.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
//==================================================================
|
||||
@@ -283,7 +284,7 @@ char const* HelloWorld::state_str_impl(state_type run_state) const
|
||||
|
||||
void AIEngine::add(AIStateMachine* state_machine)
|
||||
{
|
||||
Dout(dc::statemachine, "Adding state machine [" << (void*)state_machine << "] to " << mName);
|
||||
Dout(dc::statemachine(state_machine->mSMDebug), "Adding state machine [" << (void*)state_machine << "] to " << mName);
|
||||
engine_state_type_wat engine_state_w(mEngineState);
|
||||
engine_state_w->list.push_back(QueueElement(state_machine));
|
||||
if (engine_state_w->waiting)
|
||||
@@ -330,7 +331,7 @@ void AIEngine::mainloop(void)
|
||||
engine_state_type_wat engine_state_w(mEngineState);
|
||||
if (!active)
|
||||
{
|
||||
Dout(dc::statemachine, "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||
Dout(dc::statemachine(state_machine.mSMDebug), "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||
engine_state_w->list.erase(queued_element++);
|
||||
}
|
||||
else
|
||||
@@ -392,7 +393,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
// If this fails then you are using a pointer to a state machine instead of an LLPointer.
|
||||
llassert(event == initial_run || getNumRefs() > 0);
|
||||
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::multiplex(" << event_str(event) << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::multiplex(" << event_str(event) << ") [" << (void*)this << "]");
|
||||
|
||||
base_state_type state;
|
||||
state_type run_state;
|
||||
@@ -407,7 +408,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
|
||||
if (!mMultiplexMutex.tryLock())
|
||||
{
|
||||
Dout(dc::statemachine, "Leaving because it is already being run [" << (void*)this << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Leaving because it is already being run [" << (void*)this << "]");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -421,7 +422,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
// we should indeed run, again.
|
||||
if (event == schedule_run && !sub_state_type_rat(mSubState)->need_run)
|
||||
{
|
||||
Dout(dc::statemachine, "Leaving because it was already being run [" << (void*)this << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Leaving because it was already being run [" << (void*)this << "]");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -440,9 +441,9 @@ void AIStateMachine::multiplex(event_type event)
|
||||
{
|
||||
#ifdef CWDEBUG
|
||||
if (state == bs_multiplex)
|
||||
Dout(dc::statemachine, "Running state bs_multiplex / " << state_str_impl(run_state) << " [" << (void*)this << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Running state bs_multiplex / " << state_str_impl(run_state) << " [" << (void*)this << "]");
|
||||
else
|
||||
Dout(dc::statemachine, "Running state " << state_str(state) << " [" << (void*)this << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Running state " << state_str(state) << " [" << (void*)this << "]");
|
||||
#endif
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
@@ -503,7 +504,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
// run of bs_reset is not a problem because it happens to be a NoOp.
|
||||
state = (state == bs_initialize) ? bs_reset : bs_abort;
|
||||
#ifdef CWDEBUG
|
||||
Dout(dc::statemachine, "Late abort detected! Running state " << state_str(state) << " instead [" << (void*)this << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Late abort detected! Running state " << state_str(state) << " instead [" << (void*)this << "]");
|
||||
#endif
|
||||
}
|
||||
#ifdef SHOW_ASSERT
|
||||
@@ -665,7 +666,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
|
||||
#ifdef CWDEBUG
|
||||
if (state != state_w->base_state)
|
||||
Dout(dc::statemachine, "Base state changed from " << state_str(state) << " to " << state_str(state_w->base_state) <<
|
||||
Dout(dc::statemachine(mSMDebug), "Base state changed from " << state_str(state) << " to " << state_str(state_w->base_state) <<
|
||||
"; need_new_run = " << (need_new_run ? "true" : "false") << " [" << (void*)this << "]");
|
||||
#endif
|
||||
}
|
||||
@@ -699,11 +700,15 @@ void AIStateMachine::multiplex(event_type event)
|
||||
// Mark that we're added to this engine, and at the same time, that we're not added to the previous one.
|
||||
state_w->current_engine = engine;
|
||||
}
|
||||
#ifdef SHOW_ASSERT
|
||||
// We are leaving the loop, but we're not idle. The statemachine should re-enter the loop again.
|
||||
mDebugShouldRun = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove this state machine from any engine.
|
||||
// Cause the engine to remove us.
|
||||
// Remove this state machine from any engine,
|
||||
// causing the engine to remove us.
|
||||
state_w->current_engine = NULL;
|
||||
}
|
||||
|
||||
@@ -749,7 +754,7 @@ void AIStateMachine::multiplex(event_type event)
|
||||
|
||||
AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
||||
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// Honor a subsequent call to idle() (only necessary in bs_multiplex, but it doesn't hurt to reset this flag in other states too).
|
||||
@@ -759,7 +764,7 @@ AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state
|
||||
// Honor previous calls to advance_state() (once run_state is initialized).
|
||||
if (base_state == bs_multiplex && sub_state_w->advance_state > sub_state_w->run_state)
|
||||
{
|
||||
Dout(dc::statemachine, "Copying advance_state to run_state, because it is larger [" << state_str_impl(sub_state_w->advance_state) << " > " << state_str_impl(sub_state_w->run_state) << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Copying advance_state to run_state, because it is larger [" << state_str_impl(sub_state_w->advance_state) << " > " << state_str_impl(sub_state_w->run_state) << "]");
|
||||
sub_state_w->run_state = sub_state_w->advance_state;
|
||||
}
|
||||
#ifdef SHOW_ASSERT
|
||||
@@ -789,7 +794,7 @@ AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state
|
||||
|
||||
void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent, bool on_abort_signal_parent, AIEngine* default_engine)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::run(" <<
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::run(" <<
|
||||
(void*)parent << ", " <<
|
||||
(parent ? parent->state_str_impl(new_parent_state) : "NA") <<
|
||||
", abort_parent = " << (abort_parent ? "true" : "false") <<
|
||||
@@ -839,7 +844,7 @@ void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bo
|
||||
|
||||
void AIStateMachine::run(callback_type::signal_type::slot_type const& slot, AIEngine* default_engine)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::run(<slot>, default_engine = " << default_engine->name() << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::run(<slot>, default_engine = " << default_engine->name() << ") [" << (void*)this << "]");
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
@@ -874,7 +879,7 @@ void AIStateMachine::run(callback_type::signal_type::slot_type const& slot, AIEn
|
||||
|
||||
void AIStateMachine::callback(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::callback() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::callback() [" << (void*)this << "]");
|
||||
|
||||
bool aborted = sub_state_type_rat(mSubState)->aborted;
|
||||
if (mParent)
|
||||
@@ -920,7 +925,7 @@ void AIStateMachine::force_killed(void)
|
||||
|
||||
void AIStateMachine::kill(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::kill() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::kill() [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
@@ -937,7 +942,7 @@ void AIStateMachine::kill(void)
|
||||
|
||||
void AIStateMachine::reset()
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::reset() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::reset() [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
mDebugAborted = false;
|
||||
mDebugContPending = false;
|
||||
@@ -960,6 +965,8 @@ void AIStateMachine::reset()
|
||||
sub_state_w->reset = true;
|
||||
// Start running.
|
||||
sub_state_w->idle = false;
|
||||
// We're not waiting for a condition.
|
||||
sub_state_w->blocked = NULL;
|
||||
// Keep running till we reach at least bs_multiplex.
|
||||
sub_state_w->need_run = true;
|
||||
}
|
||||
@@ -972,7 +979,7 @@ void AIStateMachine::reset()
|
||||
|
||||
void AIStateMachine::set_state(state_type new_state)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::set_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::set_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
@@ -983,6 +990,8 @@ void AIStateMachine::set_state(state_type new_state)
|
||||
}
|
||||
#endif
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// It should never happen that set_state() is called while we're blocked.
|
||||
llassert(!sub_state_w->blocked);
|
||||
// Force current state to the requested state.
|
||||
sub_state_w->run_state = new_state;
|
||||
// Void last call to advance_state.
|
||||
@@ -999,13 +1008,13 @@ void AIStateMachine::set_state(state_type new_state)
|
||||
|
||||
void AIStateMachine::advance_state(state_type new_state)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::advance_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::advance_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||
{
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// Ignore call to advance_state when the currently queued state is already greater or equal to the requested state.
|
||||
if (sub_state_w->advance_state >= new_state)
|
||||
{
|
||||
Dout(dc::statemachine, "Ignored, because " << state_str_impl(sub_state_w->advance_state) << " >= " << state_str_impl(new_state) << ".");
|
||||
Dout(dc::statemachine(mSMDebug), "Ignored, because " << state_str_impl(sub_state_w->advance_state) << " >= " << state_str_impl(new_state) << ".");
|
||||
return;
|
||||
}
|
||||
// Ignore call to advance_state when the current state is greater than the requested state: the new state would be
|
||||
@@ -1014,7 +1023,7 @@ void AIStateMachine::advance_state(state_type new_state)
|
||||
// the state change is and should be being ignored: the statemachine would start running it's current state (again).
|
||||
if (sub_state_w->run_state > new_state)
|
||||
{
|
||||
Dout(dc::statemachine, "Ignored, because " << state_str_impl(sub_state_w->run_state) << " > " << state_str_impl(new_state) << " (current state).");
|
||||
Dout(dc::statemachine(mSMDebug), "Ignored, because " << state_str_impl(sub_state_w->run_state) << " > " << state_str_impl(new_state) << " (current state).");
|
||||
return;
|
||||
}
|
||||
// Increment state.
|
||||
@@ -1023,6 +1032,13 @@ void AIStateMachine::advance_state(state_type new_state)
|
||||
sub_state_w->idle = false;
|
||||
// Ignore a call to idle if it occurs before we leave multiplex_impl().
|
||||
sub_state_w->skip_idle = true;
|
||||
// No longer say we woke up when signalled() is called.
|
||||
if (sub_state_w->blocked)
|
||||
{
|
||||
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||
sub_state_w->blocked->remove(this);
|
||||
sub_state_w->blocked = NULL;
|
||||
}
|
||||
// Mark that a re-entry of multiplex() is necessary.
|
||||
sub_state_w->need_run = true;
|
||||
#ifdef SHOW_ASSERT
|
||||
@@ -1048,7 +1064,7 @@ void AIStateMachine::advance_state(state_type new_state)
|
||||
|
||||
void AIStateMachine::idle(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::idle() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::idle() [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
@@ -1066,7 +1082,7 @@ void AIStateMachine::idle(void)
|
||||
// Ignore call to idle() when advance_state() was called since last call to set_state().
|
||||
if (sub_state_w->skip_idle)
|
||||
{
|
||||
Dout(dc::statemachine, "Ignored, because skip_idle is true (advance_state() was called last).");
|
||||
Dout(dc::statemachine(mSMDebug), "Ignored, because skip_idle is true (advance_state() was called last).");
|
||||
return;
|
||||
}
|
||||
// Mark that we are idle.
|
||||
@@ -1075,13 +1091,54 @@ void AIStateMachine::idle(void)
|
||||
mSleep = 0;
|
||||
}
|
||||
|
||||
// This function is very much like idle().
|
||||
void AIStateMachine::wait(AIConditionBase& condition)
|
||||
{
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::wait(" << (void*)&condition << ") [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
// wait() may only be called multiplex_impl().
|
||||
llassert(state_r->base_state == bs_multiplex);
|
||||
// May only be called by the thread that is holding mMultiplexMutex.
|
||||
llassert(mThreadId.equals_current_thread());
|
||||
}
|
||||
// wait() following set_state() cancels the reason to run because of the call to set_state.
|
||||
mDebugSetStatePending = false;
|
||||
#endif
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// As wait() may only be called from within the state machine, it should never happen that the state machine is already idle.
|
||||
llassert(!sub_state_w->idle);
|
||||
// Ignore call to wait() when advance_state() was called since last call to set_state().
|
||||
if (sub_state_w->skip_idle)
|
||||
{
|
||||
Dout(dc::statemachine(mSMDebug), "Ignored, because skip_idle is true (advance_state() was called last).");
|
||||
return;
|
||||
}
|
||||
// Register ourselves with the condition object.
|
||||
condition.wait(this);
|
||||
// Mark that we are idle.
|
||||
sub_state_w->idle = true;
|
||||
// Mark that we are waiting for a condition.
|
||||
sub_state_w->blocked = &condition;
|
||||
// Not sleeping (anymore).
|
||||
mSleep = 0;
|
||||
}
|
||||
|
||||
void AIStateMachine::cont(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::cont() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::cont() [" << (void*)this << "]");
|
||||
{
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// Void last call to idle(), if any.
|
||||
sub_state_w->idle = false;
|
||||
// No longer say we woke up when signalled() is called.
|
||||
if (sub_state_w->blocked)
|
||||
{
|
||||
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||
sub_state_w->blocked->remove(this);
|
||||
sub_state_w->blocked = NULL;
|
||||
}
|
||||
// Mark that a re-entry of multiplex() is necessary.
|
||||
sub_state_w->need_run = true;
|
||||
#ifdef SHOW_ASSERT
|
||||
@@ -1095,15 +1152,56 @@ void AIStateMachine::cont(void)
|
||||
}
|
||||
}
|
||||
|
||||
// This function is very much like cont(), except that it has no effect when we are not in a blocked state.
|
||||
// Returns true if the state machine was unblocked, false if it was already unblocked.
|
||||
bool AIStateMachine::signalled(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::signalled() [" << (void*)this << "]");
|
||||
{
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// Test if we are blocked or not.
|
||||
if (sub_state_w->blocked)
|
||||
{
|
||||
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||
sub_state_w->blocked->remove(this);
|
||||
sub_state_w->blocked = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Void last call to wait().
|
||||
sub_state_w->idle = false;
|
||||
// Mark that a re-entry of multiplex() is necessary.
|
||||
sub_state_w->need_run = true;
|
||||
#ifdef SHOW_ASSERT
|
||||
// From this moment.
|
||||
mDebugContPending = true;
|
||||
#endif
|
||||
}
|
||||
if (!mMultiplexMutex.isSelfLocked())
|
||||
{
|
||||
multiplex(schedule_run);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AIStateMachine::abort(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::abort() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::abort() [" << (void*)this << "]");
|
||||
bool is_waiting = false;
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
sub_state_type_wat sub_state_w(mSubState);
|
||||
// Mark that we are aborted, iff we didn't already finish.
|
||||
sub_state_w->aborted = !sub_state_w->finished;
|
||||
// No longer say we woke up when signalled() is called.
|
||||
if (sub_state_w->blocked)
|
||||
{
|
||||
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||
sub_state_w->blocked->remove(this);
|
||||
sub_state_w->blocked = NULL;
|
||||
}
|
||||
// Mark that a re-entry of multiplex() is necessary.
|
||||
sub_state_w->need_run = true;
|
||||
// Schedule a new run when this state machine is waiting.
|
||||
@@ -1128,7 +1226,7 @@ void AIStateMachine::abort(void)
|
||||
|
||||
void AIStateMachine::finish(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::finish() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::finish() [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
@@ -1147,7 +1245,7 @@ void AIStateMachine::finish(void)
|
||||
|
||||
void AIStateMachine::yield(void)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::yield() [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield() [" << (void*)this << "]");
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
// yield() may only be called from multiplex_impl().
|
||||
llassert(state_r->base_state == bs_multiplex);
|
||||
@@ -1160,7 +1258,7 @@ void AIStateMachine::yield(void)
|
||||
void AIStateMachine::yield(AIEngine* engine)
|
||||
{
|
||||
llassert(engine);
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::yield(" << engine->name() << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield(" << engine->name() << ") [" << (void*)this << "]");
|
||||
#ifdef SHOW_ASSERT
|
||||
{
|
||||
multiplex_state_type_rat state_r(mState);
|
||||
@@ -1173,9 +1271,19 @@ void AIStateMachine::yield(AIEngine* engine)
|
||||
mYieldEngine = engine;
|
||||
}
|
||||
|
||||
bool AIStateMachine::yield_if_not(AIEngine* engine)
|
||||
{
|
||||
if (engine && multiplex_state_type_rat(mState)->current_engine != engine)
|
||||
{
|
||||
yield(engine);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AIStateMachine::yield_frame(unsigned int frames)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::yield_frame(" << frames << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield_frame(" << frames << ") [" << (void*)this << "]");
|
||||
mSleep = -(S64)frames;
|
||||
// Sleeping is always done from the main thread.
|
||||
yield(&gMainThreadEngine);
|
||||
@@ -1183,7 +1291,7 @@ void AIStateMachine::yield_frame(unsigned int frames)
|
||||
|
||||
void AIStateMachine::yield_ms(unsigned int ms)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::yield_ms(" << ms << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield_ms(" << ms << ") [" << (void*)this << "]");
|
||||
mSleep = get_clock_count() + calc_clock_frequency() * ms / 1000;
|
||||
// Sleeping is always done from the main thread.
|
||||
yield(&gMainThreadEngine);
|
||||
@@ -1233,7 +1341,7 @@ void AIEngine::threadloop(void)
|
||||
engine_state_type_wat engine_state_w(mEngineState);
|
||||
if (!active)
|
||||
{
|
||||
Dout(dc::statemachine, "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||
Dout(dc::statemachine(state_machine.mSMDebug), "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||
engine_state_w->list.erase(queued_element++);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <list>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
class AIConditionBase;
|
||||
class AIStateMachine;
|
||||
|
||||
class AIEngine
|
||||
@@ -132,6 +133,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
||||
struct sub_state_type {
|
||||
state_type run_state;
|
||||
state_type advance_state;
|
||||
AIConditionBase* blocked;
|
||||
bool reset;
|
||||
bool need_run;
|
||||
bool idle;
|
||||
@@ -195,20 +197,36 @@ class AIStateMachine : public LLThreadSafeRefCount
|
||||
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
|
||||
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
|
||||
#endif
|
||||
#ifdef CWDEBUG
|
||||
protected:
|
||||
bool mSMDebug; // Print debug output only when true.
|
||||
#endif
|
||||
private:
|
||||
U64 mRuntime; // Total time spent running in the main thread (in clocks).
|
||||
|
||||
public:
|
||||
AIStateMachine(void) : mCallback(NULL), mDefaultEngine(NULL), mYieldEngine(NULL),
|
||||
AIStateMachine(CWD_ONLY(bool debug)) : mCallback(NULL), mDefaultEngine(NULL), mYieldEngine(NULL),
|
||||
#ifdef SHOW_ASSERT
|
||||
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
|
||||
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
|
||||
#endif
|
||||
#ifdef CWDEBUG
|
||||
mSMDebug(debug),
|
||||
#endif
|
||||
mRuntime(0)
|
||||
{ }
|
||||
|
||||
protected:
|
||||
// The user should call finish() (or abort(), or kill() from the call back when finish_impl() calls run()), not delete a class derived from AIStateMachine directly.
|
||||
virtual ~AIStateMachine() { llassert(multiplex_state_type_rat(mState)->base_state == bs_killed); }
|
||||
// The user should call finish() (or abort(), or kill() from the call back when finish_impl() calls run()),
|
||||
// not delete a class derived from AIStateMachine directly. Deleting it directly before calling run() is
|
||||
// ok however.
|
||||
virtual ~AIStateMachine()
|
||||
{
|
||||
#ifdef SHOW_ASSERT
|
||||
base_state_type state = multiplex_state_type_rat(mState)->base_state;
|
||||
llassert(state == bs_killed || state == bs_reset);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
// These functions may be called directly after creation, or from within finish_impl(), or from the call back function.
|
||||
@@ -224,11 +242,13 @@ class AIStateMachine : public LLThreadSafeRefCount
|
||||
void set_state(state_type new_state); // Run this state the NEXT loop.
|
||||
// These functions can only be called from within multiplex_impl().
|
||||
void idle(void); // Go idle unless cont() or advance_state() were called since the start of the current loop, or until they are called.
|
||||
void wait(AIConditionBase& condition); // The same as idle(), but wake up when AICondition<T>::signal() is called.
|
||||
void finish(void); // Mark that the state machine finished and schedule the call back.
|
||||
void yield(void); // Yield to give CPU to other state machines, but do not go idle.
|
||||
void yield(AIEngine* engine); // Yield to give CPU to other state machines, but do not go idle. Continue running from engine 'engine'.
|
||||
void yield_frame(unsigned int frames); // Run from the main-thread engine after at least 'frames' frames have passed.
|
||||
void yield_ms(unsigned int ms); // Run from the main-thread engine after roughly 'ms' miliseconds have passed.
|
||||
bool yield_if_not(AIEngine* engine); // Do not really yield, unless the current engine is not 'engine'. Returns true if it switched engine.
|
||||
|
||||
public:
|
||||
// This function can be called from multiplex_imp(), but also by a child state machine and
|
||||
@@ -236,11 +256,12 @@ class AIStateMachine : public LLThreadSafeRefCount
|
||||
// to access this state machine.
|
||||
void abort(void); // Abort the state machine (unsuccessful finish).
|
||||
|
||||
// These are the only two functions that can be called by any thread at any moment.
|
||||
// These are the only three functions that can be called by any thread at any moment.
|
||||
// Those threads should use an LLPointer<AIStateMachine> to access this state machine.
|
||||
void cont(void); // Guarantee at least one full run of multiplex() after this function is called. Cancels the last call to idle().
|
||||
void advance_state(state_type new_state); // Guarantee at least one full run of multiplex() after this function is called
|
||||
// iff new_state is larger than the last state that was processed.
|
||||
bool signalled(void); // Call cont() iff this state machine is still blocked after a call to wait(). Returns false if it already unblocked.
|
||||
|
||||
public:
|
||||
// Accessors.
|
||||
|
||||
@@ -181,7 +181,11 @@ class AIStateMachineThreadBase : public AIStateMachine {
|
||||
static state_type const max_state = wait_stopped + 1;
|
||||
|
||||
protected:
|
||||
AIStateMachineThreadBase(void) { }
|
||||
AIStateMachineThreadBase(CWD_ONLY(bool debug))
|
||||
#ifdef CWDEBUG
|
||||
: AIStateMachine(debug)
|
||||
#endif
|
||||
{ }
|
||||
|
||||
private:
|
||||
// Handle initializing the object.
|
||||
@@ -217,7 +221,10 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
||||
|
||||
public:
|
||||
// Constructor.
|
||||
AIStateMachineThread(void)
|
||||
AIStateMachineThread(CWD_ONLY(bool debug))
|
||||
#ifdef CWDEBUG
|
||||
: AIStateMachineThreadBase(debug)
|
||||
#endif
|
||||
{
|
||||
*AIThreadImpl::StateMachineThread_wat(mThreadImpl.mStateMachineThread) = this;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,11 @@ class AITimer : public AIStateMachine {
|
||||
F64 mInterval; //!< Input variable: interval after which the event will be generated, in seconds.
|
||||
|
||||
public:
|
||||
AITimer(void) : mInterval(0) { DoutEntering(dc::statemachine, "AITimer(void) [" << (void*)this << "]"); }
|
||||
AITimer(CWD_ONLY(bool debug = false)) :
|
||||
#ifdef CWDEBUG
|
||||
AIStateMachine(debug),
|
||||
#endif
|
||||
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }
|
||||
|
||||
/**
|
||||
* @brief Set the interval after which the timer should expire.
|
||||
@@ -96,7 +100,7 @@ class AITimer : public AIStateMachine {
|
||||
|
||||
protected:
|
||||
// Call finish() (or abort()), not delete.
|
||||
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine, "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
||||
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine(mSMDebug), "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
||||
|
||||
// Handle initializing the object.
|
||||
/*virtual*/ void initialize_impl(void);
|
||||
|
||||
@@ -46,6 +46,10 @@ if (WINDOWS)
|
||||
set(MSVC_DIR 10.0)
|
||||
set(MSVC_SUFFIX 100)
|
||||
endif (MSVC10)
|
||||
if (MSVC11)
|
||||
set(MSVC_DIR 11.0)
|
||||
set(MSVC_SUFFIX 110)
|
||||
endif (MSVC11)
|
||||
|
||||
# Remove default /Zm1000 flag that cmake inserts
|
||||
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
@@ -78,11 +82,17 @@ if (WINDOWS)
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/Zc:wchar_t-
|
||||
/Zc:wchar_t-
|
||||
/nologo
|
||||
/Oy-
|
||||
/arch:SSE2
|
||||
)
|
||||
|
||||
# SSE2 is implied on win64
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
add_definitions(/arch:SSE2)
|
||||
else(WORD_SIZE EQUAL 32)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
|
||||
# configure win32 API for windows XP+ compatibility
|
||||
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
|
||||
include(CMakeCopyIfDifferent)
|
||||
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
||||
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
||||
else(WORD_SIZE EQUAL 32)
|
||||
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/debug")
|
||||
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/release")
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
|
||||
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
|
||||
set(vivox_files
|
||||
SLVoice.exe
|
||||
@@ -23,7 +31,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
|
||||
set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
||||
set(debug_src_dir "${debug_libs_dir}")
|
||||
set(debug_files
|
||||
libhunspell.dll
|
||||
libapr-1.dll
|
||||
@@ -44,7 +52,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Debug config runtime files required for the plugin test mule
|
||||
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
||||
set(plugintest_debug_src_dir "${debug_libs_dir}")
|
||||
set(plugintest_debug_files
|
||||
libeay32.dll
|
||||
qtcored4.dll
|
||||
@@ -63,7 +71,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
||||
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/imageformats")
|
||||
set(plugintest_debug_src_dir "${debug_libs_dir}/imageformats")
|
||||
set(plugintest_debug_files
|
||||
qgifd4.dll
|
||||
qicod4.dll
|
||||
@@ -89,7 +97,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule
|
||||
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
||||
set(plugintest_release_src_dir "${release_libs_dir}")
|
||||
set(plugintest_release_files
|
||||
libeay32.dll
|
||||
qtcore4.dll
|
||||
@@ -116,7 +124,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
||||
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/imageformats")
|
||||
set(plugintest_release_src_dir "${release_libs_dir}/imageformats")
|
||||
set(plugintest_release_files
|
||||
qgif4.dll
|
||||
qico4.dll
|
||||
@@ -158,7 +166,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Debug config runtime files required for the plugins
|
||||
set(plugins_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
||||
set(plugins_debug_src_dir "${debug_libs_dir}")
|
||||
set(plugins_debug_files
|
||||
libeay32.dll
|
||||
qtcored4.dll
|
||||
@@ -177,7 +185,7 @@ copy_if_different(
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Release & ReleaseDebInfo config runtime files required for the plugins
|
||||
set(plugins_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
||||
set(plugins_release_src_dir "${release_libs_dir}")
|
||||
set(plugins_release_files
|
||||
libeay32.dll
|
||||
qtcore4.dll
|
||||
@@ -203,9 +211,9 @@ copy_if_different(
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
||||
|
||||
set(release_src_dir "${release_libs_dir}")
|
||||
set(release_files
|
||||
libtcmalloc_minimal.dll
|
||||
libhunspell.dll
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
@@ -216,8 +224,21 @@ set(release_files
|
||||
glod.dll
|
||||
)
|
||||
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
set(release_files ${release_files}
|
||||
libtcmalloc_minimal.dll
|
||||
)
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
|
||||
|
||||
if(FMODEX)
|
||||
find_path(FMODEX_BINARY_DIR fmodex.dll
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(fmodex_dll_file "fmodex.dll")
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
set(fmodex_dll_file "fmodex64.dll")
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
find_path(FMODEX_BINARY_DIR "${fmodex_dll_file}"
|
||||
"${release_src_dir}"
|
||||
"${FMODEX_SDK_DIR}/api"
|
||||
"${FMODEX_SDK_DIR}"
|
||||
@@ -225,11 +246,11 @@ if(FMODEX)
|
||||
)
|
||||
|
||||
if(FMODEX_BINARY_DIR)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets "${fmodex_dll_file}")
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets "${fmodex_dll_file}")
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmodex.dll)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets "${fmodex_dll_file}")
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
endif(FMODEX_BINARY_DIR)
|
||||
endif(FMODEX)
|
||||
@@ -285,105 +306,6 @@ copy_if_different(
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
# Copy MS C runtime dlls, required for packaging.
|
||||
# *TODO - Adapt this to support VC9
|
||||
if (MSVC80)
|
||||
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(EXISTS ${debug_msvc8_redist_path})
|
||||
set(debug_msvc8_files
|
||||
msvcr80d.dll
|
||||
msvcp80d.dll
|
||||
Microsoft.VC80.DebugCRT.manifest
|
||||
)
|
||||
|
||||
copy_if_different(
|
||||
${debug_msvc8_redist_path}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
|
||||
out_targets
|
||||
${debug_msvc8_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
set(debug_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Debug/${VIEWER_BINARY_NAME}.exe.config)
|
||||
add_custom_command(
|
||||
OUTPUT ${debug_appconfig_file}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLifeDebug.exe.config
|
||||
${debug_appconfig_file}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
|
||||
COMMENT "Creating debug app config file"
|
||||
)
|
||||
|
||||
endif (EXISTS ${debug_msvc8_redist_path})
|
||||
|
||||
FIND_PATH(release_msvc8_redist_path msvcr80.dll
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(EXISTS ${release_msvc8_redist_path})
|
||||
set(release_msvc8_files
|
||||
msvcr80.dll
|
||||
msvcp80.dll
|
||||
Microsoft.VC80.CRT.manifest
|
||||
)
|
||||
|
||||
copy_if_different(
|
||||
${release_msvc8_redist_path}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Release"
|
||||
out_targets
|
||||
${release_msvc8_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
copy_if_different(
|
||||
${release_msvc8_redist_path}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
||||
out_targets
|
||||
${release_msvc8_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
|
||||
set(release_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Release/${VIEWER_BINARY_NAME}.exe.config)
|
||||
add_custom_command(
|
||||
OUTPUT ${release_appconfig_file}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
|
||||
${release_appconfig_file}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
|
||||
COMMENT "Creating release app config file"
|
||||
)
|
||||
|
||||
set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${VIEWER_BINARY_NAME}.exe.config)
|
||||
add_custom_command(
|
||||
OUTPUT ${relwithdebinfo_appconfig_file}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
|
||||
${relwithdebinfo_appconfig_file}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
|
||||
COMMENT "Creating relwithdebinfo app config file"
|
||||
)
|
||||
|
||||
endif (EXISTS ${release_msvc8_redist_path})
|
||||
endif (MSVC80)
|
||||
|
||||
add_custom_target(copy_win_libs ALL
|
||||
DEPENDS
|
||||
${all_targets}
|
||||
|
||||
@@ -16,7 +16,7 @@ if (NOT FMODEX_LIBRARY)
|
||||
)
|
||||
elseif(WORD_SIZE EQUAL 64)
|
||||
find_library(FMODEX_LIBRARY
|
||||
fmodex64 fmodexL64
|
||||
fmodex64_vc fmodexL64_vc fmodex64 fmodexL64
|
||||
PATHS
|
||||
"${FMODEX_SDK_DIR}/api/lib"
|
||||
"${FMODEX_SDK_DIR}/api"
|
||||
@@ -25,21 +25,31 @@ if (NOT FMODEX_LIBRARY)
|
||||
)
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
endif(FMODEX_SDK_DIR)
|
||||
if(WINDOWS AND NOT FMODEX_LIBRARY)
|
||||
set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows")
|
||||
find_library(FMODEX_LIBRARY
|
||||
fmodex_vc fmodexL_vc
|
||||
PATHS
|
||||
"${FMODEX_PROG_DIR}/api/lib"
|
||||
"${FMODEX_PROG_DIR}/api"
|
||||
"${FMODEX_PROG_DIR}"
|
||||
)
|
||||
if(WINDOWS AND NOT FMODEX_SDK_DIR)
|
||||
GET_FILENAME_COMPONENT(FMODEX_PROG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE CACHE)
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
find_library(FMODEX_LIBRARY
|
||||
fmodex_vc fmodexL_vc
|
||||
PATHS
|
||||
"${FMODEX_PROG_DIR}/api/lib"
|
||||
"${FMODEX_PROG_DIR}/api"
|
||||
"${FMODEX_PROG_DIR}"
|
||||
)
|
||||
else(WORD_SIZE EQUAL 32)
|
||||
find_library(FMODEX_LIBRARY
|
||||
fmodex64_vc fmodexL64_vc
|
||||
PATHS
|
||||
"${FMODEX_PROG_DIR}/api/lib"
|
||||
"${FMODEX_PROG_DIR}/api"
|
||||
"${FMODEX_PROG_DIR}"
|
||||
)
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
if(FMODEX_LIBRARY)
|
||||
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
|
||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}")
|
||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
||||
endif(FMODEX_LIBRARY)
|
||||
endif(WINDOWS AND NOT FMODEX_LIBRARY)
|
||||
endif(WINDOWS AND NOT FMODEX_SDK_DIR)
|
||||
endif (NOT FMODEX_LIBRARY)
|
||||
|
||||
find_path(FMODEX_INCLUDE_DIR fmod.hpp
|
||||
|
||||
@@ -37,10 +37,15 @@ set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set(WINDOWS ON BOOL FORCE)
|
||||
set(ARCH i686)
|
||||
set(LL_ARCH ${ARCH}_win32)
|
||||
set(LL_ARCH_DIR ${ARCH}-win32)
|
||||
set(WORD_SIZE 32)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(ARCH i686)
|
||||
set(LL_ARCH ${ARCH}_win32)
|
||||
set(LL_ARCH_DIR ${ARCH}-win32)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(ARCH x86_64)
|
||||
set(LL_ARCH ${ARCH}_win)
|
||||
set(LL_ARCH_DIR ${ARCH}-win)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
@@ -119,15 +124,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(LL_ARCH_DIR universal-darwin)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
if (WINDOWS)
|
||||
if (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
set(PREBUILT_TYPE windows)
|
||||
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
|
||||
set(PREBUILT_TYPE windows64)
|
||||
elseif(DARWIN)
|
||||
set(PREBUILT_TYPE darwin)
|
||||
elseif(LINUX AND WORD_SIZE EQUAL 32)
|
||||
set(PREBUILT_TYPE linux)
|
||||
elseif(LINUX AND WORD_SIZE EQUAL 64)
|
||||
set(PREBUILT_TYPE linux64)
|
||||
endif(WINDOWS)
|
||||
endif(WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
|
||||
# Default deploy grid
|
||||
set(GRID agni CACHE STRING "Target Grid")
|
||||
|
||||
@@ -144,6 +144,7 @@ extern LL_COMMON_API fake_channel const snapshot;
|
||||
#define CWDEBUG_MARKER 0
|
||||
|
||||
#define BACKTRACE do { } while(0)
|
||||
#define CWD_ONLY(...)
|
||||
|
||||
#endif // !DOXYGEN
|
||||
|
||||
@@ -180,6 +181,7 @@ extern LL_COMMON_API fake_channel const snapshot;
|
||||
#include <set>
|
||||
|
||||
#define CWD_API __attribute__ ((visibility("default")))
|
||||
#define CWD_ONLY(...) __VA_ARGS__
|
||||
|
||||
//! Debug specific code.
|
||||
namespace debug {
|
||||
|
||||
@@ -443,9 +443,15 @@ class WindowsSetup(PlatformSetup):
|
||||
'vc100' : {
|
||||
'gen' : r'Visual Studio 10',
|
||||
'ver' : r'10.0'
|
||||
},
|
||||
'vc110' : {
|
||||
'gen' : r'Visual Studio 11',
|
||||
'ver' : r'11.0'
|
||||
}
|
||||
}
|
||||
|
||||
gens['vs2010'] = gens['vc100']
|
||||
gens['vs2012'] = gens['vc110']
|
||||
|
||||
search_path = r'C:\windows'
|
||||
exe_suffixes = ('.exe', '.bat', '.com')
|
||||
@@ -503,6 +509,9 @@ class WindowsSetup(PlatformSetup):
|
||||
project_name=self.project_name,
|
||||
word_size=self.word_size,
|
||||
)
|
||||
if self.word_size == 64:
|
||||
args["generator"] += r' Win64'
|
||||
|
||||
#if simple:
|
||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||
return ('cmake -G "%(generator)s" '
|
||||
|
||||
@@ -192,6 +192,8 @@ def usage(srctree=""):
|
||||
arg['description'] % nd)
|
||||
|
||||
def main():
|
||||
print "cwd:", os.getcwd()
|
||||
print " ".join(sys.argv)
|
||||
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
|
||||
option_names.append('help')
|
||||
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
|
||||
@@ -266,7 +268,7 @@ class LLManifest(object):
|
||||
__metaclass__ = LLManifestRegistry
|
||||
manifests = {}
|
||||
def for_platform(self, platform, arch = None):
|
||||
if arch:
|
||||
if arch and platform != "windows":
|
||||
platform = platform + '_' + arch
|
||||
return self.manifests[platform.lower()]
|
||||
for_platform = classmethod(for_platform)
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700
|
||||
#include <functional>
|
||||
#endif
|
||||
namespace HACD
|
||||
{
|
||||
const double sc_pi = 3.14159265;
|
||||
|
||||
@@ -611,8 +611,10 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
|
||||
mCurrentDecodep->flushBadFile();
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
if(adp)
|
||||
{
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||
}
|
||||
mCurrentDecodep = NULL;
|
||||
done = TRUE;
|
||||
}
|
||||
@@ -634,10 +636,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
}
|
||||
else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
|
||||
{
|
||||
adp->setHasCompletedDecode(true);
|
||||
adp->setHasDecodedData(true);
|
||||
adp->setHasValidData(true);
|
||||
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_READY);
|
||||
// At this point, we could see if anyone needs this sound immediately, but
|
||||
// I'm not sure that there's a reason to - we need to poll all of the playing
|
||||
// sounds anyway.
|
||||
@@ -645,7 +644,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
}
|
||||
else
|
||||
{
|
||||
adp->setHasCompletedDecode(true);
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||
llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl;
|
||||
}
|
||||
mCurrentDecodep = NULL;
|
||||
@@ -688,8 +687,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
if(adp)
|
||||
{
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||
}
|
||||
mCurrentDecodep = NULL;
|
||||
}
|
||||
@@ -715,23 +713,13 @@ void LLAudioDecodeMgr::processQueue(const F32 num_secs)
|
||||
mImpl->processQueue(num_secs);
|
||||
}
|
||||
|
||||
BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||
bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||
{
|
||||
if (gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
//llinfos << "addDecodeRequest for " << uuid << " has decoded file already" << llendl;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
{
|
||||
// Just put it on the decode queue.
|
||||
//llinfos << "addDecodeRequest for " << uuid << " has local asset file already" << llendl;
|
||||
mImpl->mDecodeQueue.push(uuid);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//llinfos << "addDecodeRequest for " << uuid << " no file available" << llendl;
|
||||
return FALSE;
|
||||
if(!uuid.notNull())
|
||||
return false;
|
||||
else if (!gAssetStorage || !gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
return false;
|
||||
|
||||
mImpl->mDecodeQueue.push(uuid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
~LLAudioDecodeMgr();
|
||||
|
||||
void processQueue(const F32 num_secs = 0.005);
|
||||
BOOL addDecodeRequest(const LLUUID &uuid);
|
||||
bool addDecodeRequest(const LLUUID &uuid);
|
||||
void addAudioRequest(const LLUUID &uuid);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -113,6 +113,8 @@ void LLAudioEngine::setDefaults()
|
||||
for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++)
|
||||
mSecondaryGain[i] = 1.0f;
|
||||
|
||||
mCurrentTransfer = NULL;
|
||||
|
||||
mAllowLargeSounds = false;
|
||||
}
|
||||
|
||||
@@ -354,6 +356,11 @@ void LLAudioEngine::idle(F32 max_decode_time)
|
||||
// Increment iter here (it is not used anymore), so we can use continue below to move on to the next source.
|
||||
++iter;
|
||||
|
||||
if(!sourcep->isLoop() && sourcep->mPlayedOnce && (!sourcep->mChannelp || !sourcep->mChannelp->isPlaying()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
LLAudioData *adp = sourcep->getCurrentData();
|
||||
//If there is no current data at all, or if it hasn't loaded, we must skip this source.
|
||||
if (!adp || !adp->getBuffer())
|
||||
@@ -509,9 +516,8 @@ void LLAudioEngine::idle(F32 max_decode_time)
|
||||
// Decode audio files
|
||||
gAudioDecodeMgrp->processQueue(max_decode_time);
|
||||
|
||||
// Call this every frame, just in case we somehow
|
||||
// missed picking it up in all the places that can add
|
||||
// or request new data.
|
||||
// Just call here every frame. It makes little sense to call elsewhere,
|
||||
// as it's throttled to one active preloading loading sound at a time anyhow
|
||||
startNextTransfer();
|
||||
|
||||
updateInternetStream();
|
||||
@@ -660,10 +666,7 @@ bool LLAudioEngine::preloadSound(const LLUUID &uuid)
|
||||
if(uuid.isNull())
|
||||
return false;
|
||||
|
||||
gAudiop->getAudioData(uuid); // We don't care about the return value, this is just to make sure
|
||||
// that we have an entry, which will mean that the audio engine knows about this
|
||||
|
||||
if (gAudioDecodeMgrp->addDecodeRequest(uuid))
|
||||
if(getAudioData(uuid)->getLoadState() >= LLAudioData::STATE_LOAD_DECODING)
|
||||
{
|
||||
// This means that we do have a local copy, and we're working on decoding it.
|
||||
return true;
|
||||
@@ -1064,29 +1067,39 @@ bool LLAudioEngine::hasDecodedFile(const LLUUID &uuid)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLAudioEngine::hasLocalFile(const LLUUID &uuid)
|
||||
{
|
||||
// See if it's in the VFS.
|
||||
return gVFS->getExists(uuid, LLAssetType::AT_SOUND);
|
||||
}
|
||||
|
||||
|
||||
void LLAudioEngine::startNextTransfer()
|
||||
{
|
||||
//LL_INFOS("AudioEngine") << "LLAudioEngine::startNextTransfer()" << LL_ENDL;
|
||||
if (!gAssetStorage->isUpstreamOK() || mCurrentTransfer.notNull() || getMuted())
|
||||
if (getMuted())
|
||||
{
|
||||
//LL_INFOS("AudioEngine") << "Transfer in progress, aborting" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
else if(mCurrentTransferTimer.getElapsedTimeF32() <= .1f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if(mCurrentTransfer && mCurrentTransfer->isInPreload())
|
||||
{
|
||||
//Keep updating until it either errors out or completes.
|
||||
mCurrentTransfer->updateLoadState();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentTransfer = NULL;
|
||||
}
|
||||
|
||||
//Technically, mCurrentTransfer could end up pointing to an audiodata object that's already
|
||||
//being transmitted/decoded if such was spawned via needing it for playback immediately.
|
||||
//This will effectively block us from choosing a lower priority audiodata object until the
|
||||
//immediate ones are done, but it's not a real problem.
|
||||
|
||||
// Get the ID for the next asset that we want to transfer.
|
||||
// Pick one in the following order:
|
||||
LLUUID asset_id;
|
||||
S32 i;
|
||||
LLAudioSource *asp = NULL;
|
||||
LLAudioData *adp = NULL;
|
||||
LLAudioData *cur_adp = NULL;
|
||||
data_map::iterator data_iter;
|
||||
|
||||
// Check all channels for currently playing sounds.
|
||||
@@ -1119,15 +1132,15 @@ void LLAudioEngine::startNextTransfer()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
}
|
||||
}
|
||||
|
||||
// Check all channels for currently queued sounds.
|
||||
if (asset_id.isNull())
|
||||
if (!cur_adp)
|
||||
{
|
||||
max_pri = -1.f;
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
@@ -1155,16 +1168,16 @@ void LLAudioEngine::startNextTransfer()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check all live channels for other sounds (preloads).
|
||||
if (asset_id.isNull())
|
||||
if (!cur_adp)
|
||||
{
|
||||
max_pri = -1.f;
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
@@ -1195,17 +1208,17 @@ void LLAudioEngine::startNextTransfer()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check all sources
|
||||
if (asset_id.isNull())
|
||||
if (!cur_adp)
|
||||
{
|
||||
max_pri = -1.f;
|
||||
source_map::iterator source_iter;
|
||||
@@ -1223,18 +1236,18 @@ void LLAudioEngine::startNextTransfer()
|
||||
}
|
||||
|
||||
adp = asp->getCurrentData();
|
||||
if (adp && !adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp && adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
continue;
|
||||
}
|
||||
|
||||
adp = asp->getQueuedData();
|
||||
if (adp && !adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp && adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1246,35 +1259,41 @@ void LLAudioEngine::startNextTransfer()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!adp->hasLocalData() && adp->hasValidData())
|
||||
if (adp->isInPreload())
|
||||
{
|
||||
asset_id = adp->getID();
|
||||
max_pri = asp->getPriority();
|
||||
cur_adp = adp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (asset_id.isNull() && !mPreloadSystemList.empty())
|
||||
if (!cur_adp)
|
||||
{
|
||||
asset_id = mPreloadSystemList.front();
|
||||
mPreloadSystemList.pop_front();
|
||||
while(!mPreloadSystemList.empty())
|
||||
{
|
||||
adp = getAudioData(mPreloadSystemList.front());
|
||||
mPreloadSystemList.pop_front();
|
||||
if(adp->isInPreload())
|
||||
{
|
||||
cur_adp = adp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(asset_id.notNull())
|
||||
else if(cur_adp)
|
||||
{
|
||||
std::list<LLUUID>::iterator it = std::find(mPreloadSystemList.begin(),mPreloadSystemList.end(),asset_id);
|
||||
std::list<LLUUID>::iterator it = std::find(mPreloadSystemList.begin(),mPreloadSystemList.end(),cur_adp->getID());
|
||||
if(it != mPreloadSystemList.end())
|
||||
mPreloadSystemList.erase(it);
|
||||
}
|
||||
|
||||
if (asset_id.notNull())
|
||||
if (cur_adp)
|
||||
{
|
||||
LL_DEBUGS("AudioEngine") << "Getting asset data for: " << asset_id << LL_ENDL;
|
||||
gAudiop->mCurrentTransfer = asset_id;
|
||||
gAudiop->mCurrentTransferTimer.reset();
|
||||
gAssetStorage->getAssetData(asset_id, LLAssetType::AT_SOUND,
|
||||
assetCallback, NULL);
|
||||
mCurrentTransfer = cur_adp;
|
||||
mCurrentTransferTimer.reset();
|
||||
mCurrentTransfer->updateLoadState();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1289,22 +1308,20 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
||||
if(!gAudiop)
|
||||
return;
|
||||
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
|
||||
if (result_code)
|
||||
{
|
||||
LL_INFOS("AudioEngine") << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
|
||||
// Need to mark data as bad to avoid constant rerequests.
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
|
||||
if (adp)
|
||||
{ // Make sure everything is cleared
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasLocalData(false);
|
||||
adp->setHasDecodedData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
{
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
if (!adp)
|
||||
{
|
||||
// Should never happen
|
||||
@@ -1313,13 +1330,11 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
||||
else
|
||||
{
|
||||
// LL_INFOS("AudioEngine") << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
|
||||
adp->setHasValidData(true);
|
||||
adp->setHasLocalData(true);
|
||||
gAudioDecodeMgrp->addDecodeRequest(uuid);
|
||||
adp->setLoadState(LLAudioData::STATE_LOAD_REQ_DECODE);
|
||||
//Immediate decode.
|
||||
adp->updateLoadState();
|
||||
}
|
||||
}
|
||||
gAudiop->mCurrentTransfer = LLUUID::null;
|
||||
gAudiop->startNextTransfer();
|
||||
}
|
||||
|
||||
|
||||
@@ -1411,32 +1426,29 @@ void LLAudioSource::update()
|
||||
//Make sure this source looks like its brand new again to prevent removal.
|
||||
mPlayedOnce = false;
|
||||
mAgeTimer.reset();
|
||||
|
||||
gAudiop->startNextTransfer();
|
||||
}
|
||||
|
||||
LLAudioData *adp = getCurrentData();
|
||||
if (adp && !adp->getBuffer())
|
||||
{
|
||||
// Update the audio buffer first - load a sound if we have it.
|
||||
// Note that this could potentially cause us to waste time updating buffers
|
||||
// for sounds that actually aren't playing, although this should be mitigated
|
||||
// by the fact that we limit the number of buffers, and we flush buffers based
|
||||
// on priority.
|
||||
if (adp->hasDecodedData())
|
||||
if(adp->getLoadState() == LLAudioData::STATE_LOAD_ERROR)
|
||||
{
|
||||
if(!adp->load() && adp->hasCompletedDecode())
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
|
||||
mCorrupted = true ;
|
||||
}
|
||||
LL_WARNS("AudioEngine") << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
|
||||
mCorrupted = true ;
|
||||
}
|
||||
else if (adp->hasLocalData() && adp->hasValidData())
|
||||
else if(adp->getLoadState() == LLAudioData::STATE_LOAD_READY)
|
||||
{
|
||||
if (adp->getID().notNull())
|
||||
{
|
||||
gAudioDecodeMgrp->addDecodeRequest(adp->getID());
|
||||
}
|
||||
// Update the audio buffer first - load a sound if we have it.
|
||||
// Note that this could potentially cause us to waste time updating buffers
|
||||
// for sounds that actually aren't playing, although this should be mitigated
|
||||
// by the fact that we limit the number of buffers, and we flush buffers based
|
||||
// on priority.
|
||||
adp->load(); //If it fails, just try again next update.
|
||||
}
|
||||
else
|
||||
{
|
||||
//The sound wasn't preloaded yet... so we must kick off the process.
|
||||
adp->updateLoadState();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1524,9 +1536,6 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
|
||||
|
||||
mCurrentDatap = adp;
|
||||
|
||||
// Make sure the audio engine knows that we want to request this sound.
|
||||
gAudiop->startNextTransfer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1536,7 +1545,6 @@ bool LLAudioSource::isDone() const
|
||||
static const F32 MAX_AGE = 60.f;
|
||||
static const F32 MAX_UNPLAYED_AGE = 15.f;
|
||||
static const F32 MAX_MUTED_AGE = 11.f;
|
||||
|
||||
if(mCorrupted)
|
||||
{
|
||||
// If we decode bad data then just kill this source entirely.
|
||||
@@ -1570,7 +1578,7 @@ bool LLAudioSource::isDone() const
|
||||
LLAudioData* adp = mCurrentDatap;
|
||||
|
||||
//Still decoding.
|
||||
if(adp && !adp->hasDecodedData() && adp->hasValidData())
|
||||
if(adp && adp->isInPreload())
|
||||
return false;
|
||||
|
||||
// We don't have a channel assigned, and it's been
|
||||
@@ -1599,7 +1607,6 @@ void LLAudioSource::preload(const LLUUID &audio_id)
|
||||
{
|
||||
// Add it to the preload list.
|
||||
mPreloadMap[audio_id] = gAudiop->getAudioData(audio_id);
|
||||
gAudiop->startNextTransfer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1617,7 +1624,7 @@ bool LLAudioSource::hasPendingPreloads() const
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!adp->hasDecodedData() && adp->hasValidData())
|
||||
if (adp->isInPreload())
|
||||
{
|
||||
// This source is still waiting for a preload
|
||||
return true;
|
||||
@@ -1734,27 +1741,42 @@ bool LLAudioChannel::updateBuffer()
|
||||
LLAudioData::LLAudioData(const LLUUID &uuid) :
|
||||
mID(uuid),
|
||||
mBufferp(NULL),
|
||||
mHasLocalData(false),
|
||||
mHasDecodedData(false),
|
||||
mHasCompletedDecode(false),
|
||||
mHasValidData(true)
|
||||
mLoadState(STATE_LOAD_ERROR)
|
||||
{
|
||||
if (uuid.isNull())
|
||||
{
|
||||
// This is a null sound.
|
||||
return;
|
||||
}
|
||||
|
||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||
|
||||
if(gAudiop->hasDecodedFile(getID()))
|
||||
mLoadState = STATE_LOAD_READY;
|
||||
else if(gAssetStorage && gAssetStorage->hasLocalAsset(getID(), LLAssetType::AT_SOUND))
|
||||
mLoadState = STATE_LOAD_REQ_DECODE;
|
||||
else
|
||||
mLoadState = STATE_LOAD_REQ_FETCH;
|
||||
}
|
||||
|
||||
void LLAudioData::updateLoadState()
|
||||
{
|
||||
if(mLoadState == STATE_LOAD_REQ_DECODE && gAudioDecodeMgrp)
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
setHasLocalData(true);
|
||||
setHasDecodedData(true);
|
||||
setHasCompletedDecode(true);
|
||||
if( gAudioDecodeMgrp->addDecodeRequest(getID()) )
|
||||
{
|
||||
setLoadState(STATE_LOAD_DECODING);
|
||||
LL_INFOS("AudioEngine") << "Decoding asset data for: " << getID() << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
setLoadState(STATE_LOAD_ERROR);
|
||||
}
|
||||
}
|
||||
else if (gAssetStorage && gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
else if(mLoadState == STATE_LOAD_REQ_FETCH && gAssetStorage && gAssetStorage->isUpstreamOK())
|
||||
{
|
||||
setHasLocalData(true);
|
||||
LL_INFOS("AudioEngine") << "Fetching asset data for: " << getID() << LL_ENDL;
|
||||
setLoadState(STATE_LOAD_FETCHING);
|
||||
|
||||
gAssetStorage->getAssetData(getID(), LLAssetType::AT_SOUND, LLAudioEngine::assetCallback, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,6 @@ public:
|
||||
void cleanupBuffer(LLAudioBuffer *bufferp);
|
||||
|
||||
bool hasDecodedFile(const LLUUID &uuid);
|
||||
bool hasLocalFile(const LLUUID &uuid);
|
||||
|
||||
void setAllowLargeSounds(bool allow) { mAllowLargeSounds = allow ;}
|
||||
bool getAllowLargeSounds() const {return mAllowLargeSounds;}
|
||||
@@ -227,7 +226,7 @@ protected:
|
||||
S32 mNumChannels;
|
||||
bool mEnableWind;
|
||||
|
||||
LLUUID mCurrentTransfer; // Audio file currently being transferred by the system
|
||||
LLAudioData* mCurrentTransfer; // Audio file currently being transferred by the system
|
||||
LLFrameTimer mCurrentTransferTimer;
|
||||
|
||||
// A list of all audio sources that are known to the viewer at this time.
|
||||
@@ -400,25 +399,27 @@ public:
|
||||
LLUUID getID() const { return mID; }
|
||||
LLAudioBuffer *getBuffer() const { return mBufferp; }
|
||||
|
||||
bool hasLocalData() const { return mHasLocalData; }
|
||||
bool hasDecodedData() const { return mHasDecodedData; }
|
||||
bool hasCompletedDecode() const { return mHasCompletedDecode; }
|
||||
bool hasValidData() const { return mHasValidData; }
|
||||
enum ELoadState
|
||||
{
|
||||
STATE_LOAD_ERROR,
|
||||
STATE_LOAD_REQ_FETCH,
|
||||
STATE_LOAD_FETCHING,
|
||||
STATE_LOAD_REQ_DECODE,
|
||||
STATE_LOAD_DECODING,
|
||||
STATE_LOAD_READY
|
||||
};
|
||||
ELoadState getLoadState() const { return mLoadState; }
|
||||
ELoadState setLoadState(ELoadState state) { return mLoadState = state; }
|
||||
bool isInPreload() const { return mLoadState > STATE_LOAD_ERROR && mLoadState < STATE_LOAD_READY; }
|
||||
|
||||
void setHasLocalData(const bool hld) { mHasLocalData = hld; }
|
||||
void setHasDecodedData(const bool hdd) { mHasDecodedData = hdd; }
|
||||
void setHasCompletedDecode(const bool hcd) { mHasCompletedDecode = hcd; }
|
||||
void setHasValidData(const bool hvd) { mHasValidData = hvd; }
|
||||
void updateLoadState();
|
||||
|
||||
friend class LLAudioEngine; // Severe laziness, bad.
|
||||
|
||||
protected:
|
||||
LLUUID mID;
|
||||
LLAudioBuffer *mBufferp; // If this data is being used by the audio system, a pointer to the buffer will be set here.
|
||||
bool mHasLocalData; // Set true if the sound asset file is available locally
|
||||
bool mHasDecodedData; // Set true if the sound file has been decoded
|
||||
bool mHasCompletedDecode; // Set true when the sound is decoded
|
||||
bool mHasValidData; // Set false if decoding failed, meaning the sound asset is bad
|
||||
ELoadState mLoadState;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -59,8 +59,13 @@ bool attemptDelayLoad()
|
||||
{
|
||||
__try
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
if( FAILED( __HrLoadAllImportsForDll( "fmodex64.dll" ) ) )
|
||||
return false;
|
||||
#else
|
||||
if( FAILED( __HrLoadAllImportsForDll( "fmodex.dll" ) ) )
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
__except( EXCEPTION_EXECUTE_HANDLER )
|
||||
{
|
||||
|
||||
@@ -231,6 +231,7 @@ set(llcommon_HEADER_FILES
|
||||
llstrider.h
|
||||
llstring.h
|
||||
llstringtable.h
|
||||
llstaticstringtable.h
|
||||
llsys.h
|
||||
llthread.h
|
||||
llthreadsafequeue.h
|
||||
|
||||
@@ -41,7 +41,11 @@ public:
|
||||
~LLAlignedArray();
|
||||
|
||||
void push_back(const T& elem);
|
||||
U32 size() const { return mElementCount; }
|
||||
void pop_back() { if(!!mElementCount) --mElementCount; }
|
||||
bool empty() const { return !mElementCount; }
|
||||
T& front() { return operator[](0); }
|
||||
T& back() { return operator[](mElementCount-1); }
|
||||
U32 size() const { return mElementCount; }
|
||||
void resize(U32 size);
|
||||
T* append(S32 N);
|
||||
T& operator[](int idx);
|
||||
|
||||
@@ -184,7 +184,7 @@ LLMutex* LLFastTimer::sLogLock = NULL;
|
||||
std::queue<LLSD> LLFastTimer::sLogQueue;
|
||||
const int LLFastTimer::NamedTimer::HISTORY_NUM = 300;
|
||||
|
||||
#if LL_WINDOWS
|
||||
#if defined(LL_WINDOWS) && !defined(_WIN64)
|
||||
#define USE_RDTSC 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -663,14 +663,6 @@ void LLPrivateMemoryPoolTester::operator delete[](void* addr)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment);
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast<uintptr_t>(ptr),((U32)alignment))
|
||||
#else
|
||||
#define ll_assert_aligned(ptr,alignment)
|
||||
#endif
|
||||
|
||||
//EVENTUALLY REMOVE THESE:
|
||||
#include "llpointer.h"
|
||||
#include "llsingleton.h"
|
||||
|
||||
@@ -416,7 +416,7 @@ static F64 calculate_cpu_frequency(U32 measure_msecs)
|
||||
unsigned long dwCurPriorityClass = GetPriorityClass(hProcess);
|
||||
int iCurThreadPriority = GetThreadPriority(hThread);
|
||||
unsigned long dwProcessMask, dwSystemMask, dwNewMask = 1;
|
||||
GetProcessAffinityMask(hProcess, &dwProcessMask, &dwSystemMask);
|
||||
GetProcessAffinityMask(hProcess, (PDWORD_PTR)&dwProcessMask, (PDWORD_PTR)&dwSystemMask);
|
||||
|
||||
SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS);
|
||||
SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
|
||||
|
||||
82
indra/llcommon/llstaticstringtable.h
Normal file
82
indra/llcommon/llstaticstringtable.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* @file llstringtable.h
|
||||
* @brief The LLStringTable class provides a _fast_ method for finding
|
||||
* unique copies of strings.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_STATIC_STRING_TABLE_H
|
||||
#define LL_STATIC_STRING_TABLE_H
|
||||
|
||||
#include "lldefs.h"
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include "llstl.h"
|
||||
|
||||
class LLStaticHashedString
|
||||
{
|
||||
public:
|
||||
|
||||
LLStaticHashedString(const std::string& s)
|
||||
{
|
||||
string_hash = makehash(s);
|
||||
string = s;
|
||||
}
|
||||
|
||||
const std::string& String() const { return string; }
|
||||
size_t Hash() const { return string_hash; }
|
||||
|
||||
bool operator==(const LLStaticHashedString& b) const { return String() == b.String(); }
|
||||
|
||||
protected:
|
||||
|
||||
size_t makehash(const std::string& s)
|
||||
{
|
||||
size_t len = s.size();
|
||||
const char* c = s.c_str();
|
||||
size_t hashval = 0;
|
||||
for (size_t i=0; i<len; i++)
|
||||
{
|
||||
hashval = ((hashval<<5) + hashval) + *c++;
|
||||
}
|
||||
return hashval;
|
||||
}
|
||||
|
||||
std::string string;
|
||||
size_t string_hash;
|
||||
};
|
||||
|
||||
struct LLStaticStringHasher
|
||||
{
|
||||
enum { bucket_size = 8 };
|
||||
size_t operator()(const LLStaticHashedString& key_value) const { return key_value.Hash(); }
|
||||
bool operator()(const LLStaticHashedString& left, const LLStaticHashedString& right) const { return left.Hash() < right.Hash(); }
|
||||
};
|
||||
|
||||
template< typename MappedObject >
|
||||
class LLStaticStringTable
|
||||
: public boost::unordered_map< LLStaticHashedString, MappedObject, LLStaticStringHasher >
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -299,10 +299,15 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
|
||||
++sRawImageCount;
|
||||
}
|
||||
|
||||
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
|
||||
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy)
|
||||
: LLImageBase(), mCacheEntries(0)
|
||||
{
|
||||
if(allocateDataSize(width, height, components) && data)
|
||||
|
||||
if(no_copy)
|
||||
{
|
||||
setDataAndSize(data, width, height, components);
|
||||
}
|
||||
else if(allocateDataSize(width, height, components) && data)
|
||||
{
|
||||
memcpy(getData(), data, width*height*components);
|
||||
}
|
||||
@@ -762,8 +767,17 @@ void LLImageRaw::fill( const LLColor4U& color )
|
||||
}
|
||||
}
|
||||
|
||||
LLPointer<LLImageRaw> LLImageRaw::duplicate()
|
||||
{
|
||||
if(getNumRefs() < 2)
|
||||
{
|
||||
return this; //nobody else refences to this image, no need to duplicate.
|
||||
}
|
||||
|
||||
|
||||
//make a duplicate
|
||||
LLPointer<LLImageRaw> dup = new LLImageRaw(getData(), getWidth(), getHeight(), getComponents());
|
||||
return dup;
|
||||
}
|
||||
|
||||
// Src and dst can be any size. Src and dst can each have 3 or 4 components.
|
||||
void LLImageRaw::copy(LLImageRaw* src)
|
||||
|
||||
@@ -173,7 +173,7 @@ protected:
|
||||
public:
|
||||
LLImageRaw();
|
||||
LLImageRaw(U16 width, U16 height, S8 components);
|
||||
LLImageRaw(U8 *data, U16 width, U16 height, S8 components);
|
||||
LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy = false);
|
||||
LLImageRaw(LLImageRaw const* src, U16 width, U16 height, U16 crop_offset, bool crop_vertically);
|
||||
// Construct using createFromFile (used by tools)
|
||||
//LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
@@ -204,6 +204,9 @@ public:
|
||||
|
||||
// Copy operations
|
||||
|
||||
//duplicate this raw image if refCount > 1.
|
||||
LLPointer<LLImageRaw> duplicate();
|
||||
|
||||
// Src and dst can be any size. Src and dst can each have 3 or 4 components.
|
||||
void copy( LLImageRaw* src );
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ inline F64 llabs(const F64 a)
|
||||
|
||||
inline S32 lltrunc( F32 f )
|
||||
{
|
||||
#if LL_WINDOWS && !defined( __INTEL_COMPILER )
|
||||
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(_WIN64)
|
||||
// Avoids changing the floating point control word.
|
||||
// Add or subtract 0.5 - epsilon and then round
|
||||
const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF };
|
||||
@@ -166,7 +166,7 @@ inline S32 lltrunc( F64 f )
|
||||
|
||||
inline S32 llfloor( F32 f )
|
||||
{
|
||||
#if LL_WINDOWS && !defined( __INTEL_COMPILER )
|
||||
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(_WIN64)
|
||||
// Avoids changing the floating point control word.
|
||||
// Accurate (unlike Stereopsis version) for all values between S32_MIN and S32_MAX and slightly faster than Stereopsis version.
|
||||
// Add -(0.5 - epsilon) and then round
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#error "Please include llmath.h before this file."
|
||||
#endif
|
||||
|
||||
#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) )
|
||||
#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) && !defined(_WIN64) )
|
||||
#error SSE2 not enabled. LLVector4a and related class will not compile.
|
||||
#endif
|
||||
|
||||
|
||||
@@ -250,10 +250,13 @@ void AICurlEasyRequestStateMachine::finish_impl(void)
|
||||
}
|
||||
}
|
||||
|
||||
AICurlEasyRequestStateMachine::AICurlEasyRequestStateMachine(void) :
|
||||
AICurlEasyRequestStateMachine::AICurlEasyRequestStateMachine(CWD_ONLY(bool debug)) :
|
||||
#ifdef CWDEBUG
|
||||
AIStateMachine(debug),
|
||||
#endif
|
||||
mTotalDelayTimeout(AIHTTPTimeoutPolicy::getDebugSettingsCurlTimeout().getTotalDelay())
|
||||
{
|
||||
Dout(dc::statemachine, "Calling AICurlEasyRequestStateMachine(void) [" << (void*)this << "] [" << (void*)mCurlEasyRequest.get() << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Calling AICurlEasyRequestStateMachine(void) [" << (void*)this << "] [" << (void*)mCurlEasyRequest.get() << "]");
|
||||
AICurlInterface::Stats::AICurlEasyRequestStateMachine_count++;
|
||||
}
|
||||
|
||||
@@ -264,7 +267,7 @@ void AICurlEasyRequestStateMachine::setTotalDelayTimeout(F32 totalDelayTimeout)
|
||||
|
||||
AICurlEasyRequestStateMachine::~AICurlEasyRequestStateMachine()
|
||||
{
|
||||
Dout(dc::statemachine, "Calling ~AICurlEasyRequestStateMachine() [" << (void*)this << "] [" << (void*)mCurlEasyRequest.get() << "]");
|
||||
Dout(dc::statemachine(mSMDebug), "Calling ~AICurlEasyRequestStateMachine() [" << (void*)this << "] [" << (void*)mCurlEasyRequest.get() << "]");
|
||||
--AICurlInterface::Stats::AICurlEasyRequestStateMachine_count;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
// Construction of a AICurlEasyRequestStateMachine might throw AICurlNoEasyHandle.
|
||||
class AICurlEasyRequestStateMachine : public AIStateMachine, public AICurlEasyHandleEvents {
|
||||
public:
|
||||
AICurlEasyRequestStateMachine(void);
|
||||
AICurlEasyRequestStateMachine(CWD_ONLY(bool debug = false));
|
||||
|
||||
// Transparent access.
|
||||
AICurlEasyRequest mCurlEasyRequest;
|
||||
|
||||
@@ -49,7 +49,7 @@ set_source_files_properties(${llplugin_HEADER_FILES}
|
||||
|
||||
if(NOT WORD_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
add_definitions(/FIXED:NO)
|
||||
# add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(WINDOWS)
|
||||
|
||||
@@ -727,7 +727,8 @@ bool LLGLManager::initGL()
|
||||
}
|
||||
|
||||
stop_glerror();
|
||||
|
||||
|
||||
//Singu Note: Multisampled texture stuff in v3 is dead, however we DO use multisampled FBOs.
|
||||
if (mHasFramebufferMultisample)
|
||||
{
|
||||
glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples);
|
||||
|
||||
@@ -91,11 +91,22 @@ LLShaderFeatures::LLShaderFeatures()
|
||||
// LLGLSL Shader implementation
|
||||
//===============================
|
||||
LLGLSLShader::LLGLSLShader(S32 shader_class)
|
||||
: mProgramObject(0), mShaderClass(shader_class), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE)
|
||||
: mProgramObject(0),
|
||||
mShaderClass(shader_class),
|
||||
mAttributeMask(0),
|
||||
mTotalUniformSize(0),
|
||||
mActiveTextureChannels(0),
|
||||
mShaderLevel(0),
|
||||
mShaderGroup(SG_DEFAULT),
|
||||
mUniformsDirty(FALSE)
|
||||
{
|
||||
LLShaderMgr::getGlobalShaderList().push_back(this);
|
||||
}
|
||||
|
||||
LLGLSLShader::~LLGLSLShader()
|
||||
{
|
||||
|
||||
}
|
||||
void LLGLSLShader::unload()
|
||||
{
|
||||
stop_glerror();
|
||||
@@ -103,6 +114,7 @@ void LLGLSLShader::unload()
|
||||
mTexture.clear();
|
||||
mUniform.clear();
|
||||
mShaderFiles.clear();
|
||||
mDefines.clear();
|
||||
|
||||
if (mProgramObject)
|
||||
{
|
||||
@@ -127,8 +139,8 @@ void LLGLSLShader::unload()
|
||||
stop_glerror();
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
vector<string> * uniforms,
|
||||
BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
|
||||
std::vector<LLStaticHashedString> * uniforms,
|
||||
U32 varying_count,
|
||||
const char** varyings)
|
||||
{
|
||||
@@ -151,7 +163,7 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
|
||||
for ( ; fileIter != mShaderFiles.end(); fileIter++ )
|
||||
{
|
||||
GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, mFeatures.mIndexedTextureChannels);
|
||||
GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels);
|
||||
LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL;
|
||||
if (shaderhandle > 0)
|
||||
{
|
||||
@@ -217,7 +229,8 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
|
||||
for (S32 i = 0; i < channel_count; i++)
|
||||
{
|
||||
uniform1i(llformat("tex%d", i), i);
|
||||
LLStaticHashedString uniName(llformat("tex%d", i));
|
||||
uniform1i(uniName, i);
|
||||
}
|
||||
|
||||
S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten
|
||||
@@ -290,7 +303,7 @@ void LLGLSLShader::attachObjects(GLhandleARB* objects, S32 count)
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
|
||||
BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attributes)
|
||||
{
|
||||
//before linking, make sure reserved attributes always have consistent locations
|
||||
for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
|
||||
@@ -309,6 +322,8 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
|
||||
if (res)
|
||||
{ //read back channel locations
|
||||
|
||||
mAttributeMask = 0;
|
||||
|
||||
//read back reserved channels first
|
||||
for (U32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedAttribs.size(); i++)
|
||||
{
|
||||
@@ -317,6 +332,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
|
||||
if (index != -1)
|
||||
{
|
||||
mAttribute[i] = index;
|
||||
mAttributeMask |= 1 << i;
|
||||
LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
|
||||
}
|
||||
}
|
||||
@@ -324,7 +340,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
|
||||
{
|
||||
for (U32 i = 0; i < numAttributes; i++)
|
||||
{
|
||||
const char* name = (*attributes)[i].c_str();
|
||||
const char* name = (*attributes)[i].String().c_str();
|
||||
S32 index = glGetAttribLocationARB(mProgramObject, name);
|
||||
if (index != -1)
|
||||
{
|
||||
@@ -340,7 +356,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
|
||||
void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> * uniforms)
|
||||
{
|
||||
if (index == -1)
|
||||
{
|
||||
@@ -349,11 +365,55 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
|
||||
|
||||
GLenum type;
|
||||
GLsizei length;
|
||||
GLint size;
|
||||
GLint size = -1;
|
||||
char name[1024]; /* Flawfinder: ignore */
|
||||
name[0] = 0;
|
||||
|
||||
glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name);
|
||||
#if !LL_DARWIN
|
||||
if (size > 0)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case GL_FLOAT_VEC2: size *= 2; break;
|
||||
case GL_FLOAT_VEC3: size *= 3; break;
|
||||
case GL_FLOAT_VEC4: size *= 4; break;
|
||||
case GL_DOUBLE: size *= 2; break;
|
||||
case GL_DOUBLE_VEC2: size *= 2; break;
|
||||
case GL_DOUBLE_VEC3: size *= 6; break;
|
||||
case GL_DOUBLE_VEC4: size *= 8; break;
|
||||
case GL_INT_VEC2: size *= 2; break;
|
||||
case GL_INT_VEC3: size *= 3; break;
|
||||
case GL_INT_VEC4: size *= 4; break;
|
||||
case GL_UNSIGNED_INT_VEC2: size *= 2; break;
|
||||
case GL_UNSIGNED_INT_VEC3: size *= 3; break;
|
||||
case GL_UNSIGNED_INT_VEC4: size *= 4; break;
|
||||
case GL_BOOL_VEC2: size *= 2; break;
|
||||
case GL_BOOL_VEC3: size *= 3; break;
|
||||
case GL_BOOL_VEC4: size *= 4; break;
|
||||
case GL_FLOAT_MAT2: size *= 4; break;
|
||||
case GL_FLOAT_MAT3: size *= 9; break;
|
||||
case GL_FLOAT_MAT4: size *= 16; break;
|
||||
case GL_FLOAT_MAT2x3: size *= 6; break;
|
||||
case GL_FLOAT_MAT2x4: size *= 8; break;
|
||||
case GL_FLOAT_MAT3x2: size *= 6; break;
|
||||
case GL_FLOAT_MAT3x4: size *= 12; break;
|
||||
case GL_FLOAT_MAT4x2: size *= 8; break;
|
||||
case GL_FLOAT_MAT4x3: size *= 12; break;
|
||||
case GL_DOUBLE_MAT2: size *= 8; break;
|
||||
case GL_DOUBLE_MAT3: size *= 18; break;
|
||||
case GL_DOUBLE_MAT4: size *= 32; break;
|
||||
case GL_DOUBLE_MAT2x3: size *= 12; break;
|
||||
case GL_DOUBLE_MAT2x4: size *= 16; break;
|
||||
case GL_DOUBLE_MAT3x2: size *= 12; break;
|
||||
case GL_DOUBLE_MAT3x4: size *= 24; break;
|
||||
case GL_DOUBLE_MAT4x2: size *= 16; break;
|
||||
case GL_DOUBLE_MAT4x3: size *= 24; break;
|
||||
}
|
||||
mTotalUniformSize += size;
|
||||
}
|
||||
#endif
|
||||
|
||||
S32 location = glGetUniformLocationARB(mProgramObject, name);
|
||||
if (location != -1)
|
||||
{
|
||||
@@ -365,7 +425,10 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
|
||||
is_array[0] = 0;
|
||||
}
|
||||
|
||||
mUniformMap[name] = location;
|
||||
LLStaticHashedString hashedName(name);
|
||||
mUniformNameMap[location] = name;
|
||||
mUniformMap[hashedName] = location;
|
||||
|
||||
LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
|
||||
|
||||
//find the index of this uniform
|
||||
@@ -386,7 +449,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
|
||||
for (U32 i = 0; i < uniforms->size(); i++)
|
||||
{
|
||||
if ( (mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] == -1)
|
||||
&& ((*uniforms)[i] == name))
|
||||
&& ((*uniforms)[i].String() == name))
|
||||
{
|
||||
//found it
|
||||
mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] = location;
|
||||
@@ -396,7 +459,17 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::addPermutation(std::string name, std::string value)
|
||||
{
|
||||
mDefines[name] = value;
|
||||
}
|
||||
|
||||
void LLGLSLShader::removePermutation(std::string name)
|
||||
{
|
||||
mDefines[name].erase();
|
||||
}
|
||||
|
||||
GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
|
||||
{
|
||||
@@ -410,13 +483,15 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
|
||||
return -1;
|
||||
}
|
||||
|
||||
BOOL LLGLSLShader::mapUniforms(const vector<string> * uniforms)
|
||||
BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
|
||||
{
|
||||
BOOL res = TRUE;
|
||||
|
||||
mTotalUniformSize = 0;
|
||||
mActiveTextureChannels = 0;
|
||||
mUniform.clear();
|
||||
mUniformMap.clear();
|
||||
mUniformNameMap.clear();
|
||||
mTexture.clear();
|
||||
mValue.clear();
|
||||
//initialize arrays
|
||||
@@ -437,6 +512,7 @@ BOOL LLGLSLShader::mapUniforms(const vector<string> * uniforms)
|
||||
|
||||
unbind();
|
||||
|
||||
LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << llendl;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -495,6 +571,58 @@ void LLGLSLShader::bindNoShader(void)
|
||||
}
|
||||
}
|
||||
|
||||
S32 LLGLSLShader::bindTexture(const std::string &uniform, LLTexture *texture, LLTexUnit::eTextureType mode)
|
||||
{
|
||||
S32 channel = 0;
|
||||
channel = getUniformLocation(uniform);
|
||||
|
||||
return bindTexture(channel, texture, mode);
|
||||
}
|
||||
|
||||
S32 LLGLSLShader::bindTexture(S32 uniform, LLTexture *texture, LLTexUnit::eTextureType mode)
|
||||
{
|
||||
if (uniform < 0 || uniform >= (S32)mTexture.size())
|
||||
{
|
||||
UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
uniform = mTexture[uniform];
|
||||
|
||||
if (uniform > -1)
|
||||
{
|
||||
gGL.getTexUnit(uniform)->bind(texture, mode);
|
||||
}
|
||||
|
||||
return uniform;
|
||||
}
|
||||
|
||||
S32 LLGLSLShader::unbindTexture(const std::string &uniform, LLTexUnit::eTextureType mode)
|
||||
{
|
||||
S32 channel = 0;
|
||||
channel = getUniformLocation(uniform);
|
||||
|
||||
return unbindTexture(channel);
|
||||
}
|
||||
|
||||
S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode)
|
||||
{
|
||||
if (uniform < 0 || uniform >= (S32)mTexture.size())
|
||||
{
|
||||
UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
uniform = mTexture[uniform];
|
||||
|
||||
if (uniform > -1)
|
||||
{
|
||||
gGL.getTexUnit(uniform)->unbind(mode);
|
||||
}
|
||||
|
||||
return uniform;
|
||||
}
|
||||
|
||||
S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode)
|
||||
{
|
||||
if (uniform < 0 || uniform >= (S32)mTexture.size())
|
||||
@@ -817,18 +945,18 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
|
||||
}
|
||||
}
|
||||
|
||||
GLint LLGLSLShader::getUniformLocation(const string& uniform)
|
||||
GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
|
||||
{
|
||||
GLint ret = -1;
|
||||
if (mProgramObject > 0)
|
||||
{
|
||||
std::map<string, GLint>::iterator iter = mUniformMap.find(uniform);
|
||||
LLStaticStringTable<GLint>::iterator iter = mUniformMap.find(uniform);
|
||||
if (iter != mUniformMap.end())
|
||||
{
|
||||
if (gDebugGL)
|
||||
{
|
||||
stop_glerror();
|
||||
if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.c_str()))
|
||||
if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str()))
|
||||
{
|
||||
llerrs << "Uniform does not match." << llendl;
|
||||
}
|
||||
@@ -865,7 +993,7 @@ GLint LLGLSLShader::getAttribLocation(U32 attrib)
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform1i(const string& uniform, GLint v)
|
||||
void LLGLSLShader::uniform1i(const LLStaticHashedString& uniform, GLint v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -881,7 +1009,24 @@ void LLGLSLShader::uniform1i(const string& uniform, GLint v)
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform1f(const string& uniform, GLfloat v)
|
||||
void LLGLSLShader::uniform2i(const LLStaticHashedString& uniform, GLint i, GLint j)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
if (location >= 0)
|
||||
{
|
||||
std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
|
||||
LLVector4 vec(i,j,0.f,0.f);
|
||||
if (iter == mValue.end() || shouldChange(iter->second,vec))
|
||||
{
|
||||
glUniform2iARB(location, i, j);
|
||||
mValue[location] = vec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLGLSLShader::uniform1f(const LLStaticHashedString& uniform, GLfloat v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -897,7 +1042,7 @@ void LLGLSLShader::uniform1f(const string& uniform, GLfloat v)
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform2f(const string& uniform, GLfloat x, GLfloat y)
|
||||
void LLGLSLShader::uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -914,7 +1059,7 @@ void LLGLSLShader::uniform2f(const string& uniform, GLfloat x, GLfloat y)
|
||||
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform3f(const string& uniform, GLfloat x, GLfloat y, GLfloat z)
|
||||
void LLGLSLShader::uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -930,23 +1075,7 @@ void LLGLSLShader::uniform3f(const string& uniform, GLfloat x, GLfloat y, GLfloa
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform4f(const string& uniform, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
if (location >= 0)
|
||||
{
|
||||
std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
|
||||
LLVector4 vec(x,y,z,w);
|
||||
if (iter == mValue.end() || shouldChange(iter->second,vec))
|
||||
{
|
||||
glUniform4fARB(location, x,y,z,w);
|
||||
mValue[location] = vec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform1fv(const string& uniform, U32 count, const GLfloat* v)
|
||||
void LLGLSLShader::uniform1fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -962,7 +1091,7 @@ void LLGLSLShader::uniform1fv(const string& uniform, U32 count, const GLfloat* v
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform2fv(const string& uniform, U32 count, const GLfloat* v)
|
||||
void LLGLSLShader::uniform2fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -978,7 +1107,7 @@ void LLGLSLShader::uniform2fv(const string& uniform, U32 count, const GLfloat* v
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform3fv(const string& uniform, U32 count, const GLfloat* v)
|
||||
void LLGLSLShader::uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -994,7 +1123,7 @@ void LLGLSLShader::uniform3fv(const string& uniform, U32 count, const GLfloat* v
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform4fv(const string& uniform, U32 count, const GLfloat* v)
|
||||
void LLGLSLShader::uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
@@ -1012,27 +1141,7 @@ void LLGLSLShader::uniform4fv(const string& uniform, U32 count, const GLfloat* v
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniformMatrix2fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
if (location >= 0)
|
||||
{
|
||||
glUniformMatrix2fvARB(location, count, transpose, v);
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniformMatrix3fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
if (location >= 0)
|
||||
{
|
||||
glUniformMatrix3fvARB(location, count, transpose, v);
|
||||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniformMatrix4fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v)
|
||||
void LLGLSLShader::uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat* v)
|
||||
{
|
||||
GLint location = getUniformLocation(uniform);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "llgl.h"
|
||||
#include "llrender.h"
|
||||
#include "llstaticstringtable.h"
|
||||
|
||||
class LLShaderFeatures
|
||||
{
|
||||
@@ -68,6 +69,7 @@ public:
|
||||
};
|
||||
|
||||
LLGLSLShader(S32 shader_class);
|
||||
~LLGLSLShader();
|
||||
|
||||
static GLhandleARB sCurBoundShader;
|
||||
static LLGLSLShader* sCurBoundShaderPtr;
|
||||
@@ -75,16 +77,16 @@ public:
|
||||
static bool sNoFixedFunction;
|
||||
|
||||
void unload();
|
||||
BOOL createShader(std::vector<std::string> * attributes,
|
||||
std::vector<std::string> * uniforms,
|
||||
BOOL createShader(std::vector<LLStaticHashedString> * attributes,
|
||||
std::vector<LLStaticHashedString> * uniforms,
|
||||
U32 varying_count = 0,
|
||||
const char** varyings = NULL);
|
||||
BOOL attachObject(std::string object);
|
||||
void attachObject(GLhandleARB object);
|
||||
void attachObjects(GLhandleARB* objects = NULL, S32 count = 0);
|
||||
BOOL mapAttributes(const std::vector<std::string> * attributes);
|
||||
BOOL mapUniforms(const std::vector<std::string> * uniforms);
|
||||
void mapUniform(GLint index, const std::vector<std::string> * uniforms);
|
||||
BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes);
|
||||
BOOL mapUniforms(const std::vector<LLStaticHashedString> *);
|
||||
void mapUniform(GLint index, const std::vector<LLStaticHashedString> *);
|
||||
void uniform1i(U32 index, GLint i);
|
||||
void uniform1f(U32 index, GLfloat v);
|
||||
void uniform2f(U32 index, GLfloat x, GLfloat y);
|
||||
@@ -95,34 +97,35 @@ public:
|
||||
void uniform2fv(U32 index, U32 count, const GLfloat* v);
|
||||
void uniform3fv(U32 index, U32 count, const GLfloat* v);
|
||||
void uniform4fv(U32 index, U32 count, const GLfloat* v);
|
||||
void uniform1i(const std::string& uniform, GLint i);
|
||||
void uniform1f(const std::string& uniform, GLfloat v);
|
||||
void uniform2f(const std::string& uniform, GLfloat x, GLfloat y);
|
||||
void uniform3f(const std::string& uniform, GLfloat x, GLfloat y, GLfloat z);
|
||||
void uniform4f(const std::string& uniform, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void uniform1iv(const std::string& uniform, U32 count, const GLint* i);
|
||||
void uniform1fv(const std::string& uniform, U32 count, const GLfloat* v);
|
||||
void uniform2fv(const std::string& uniform, U32 count, const GLfloat* v);
|
||||
void uniform3fv(const std::string& uniform, U32 count, const GLfloat* v);
|
||||
void uniform4fv(const std::string& uniform, U32 count, const GLfloat* v);
|
||||
void uniform2i(const LLStaticHashedString& uniform, GLint i, GLint j);
|
||||
void uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniformMatrix2fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniformMatrix3fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniformMatrix4fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniform1i(const LLStaticHashedString& uniform, GLint i);
|
||||
void uniform1f(const LLStaticHashedString& uniform, GLfloat v);
|
||||
void uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y);
|
||||
void uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z);
|
||||
void uniform1fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniform2fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
|
||||
void setMinimumAlpha(F32 minimum);
|
||||
|
||||
void vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void vertexAttrib4fv(U32 index, GLfloat* v);
|
||||
|
||||
GLint getUniformLocation(const std::string& uniform);
|
||||
//GLint getUniformLocation(const std::string& uniform);
|
||||
GLint getUniformLocation(const LLStaticHashedString& uniform);
|
||||
GLint getUniformLocation(U32 index);
|
||||
|
||||
GLint getAttribLocation(U32 attrib);
|
||||
GLint mapUniformTextureChannel(GLint location, GLenum type);
|
||||
|
||||
void addPermutation(std::string name, std::string value);
|
||||
void removePermutation(std::string name);
|
||||
|
||||
//enable/disable texture channel for specified uniform
|
||||
//if given texture uniform is active in the shader,
|
||||
//the corresponding channel will be active upon return
|
||||
@@ -130,6 +133,13 @@ public:
|
||||
S32 enableTexture(S32 uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
S32 disableTexture(S32 uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
|
||||
// bindTexture returns the texture unit we've bound the texture to.
|
||||
// You can reuse the return value to unbind a texture when required.
|
||||
S32 bindTexture(const std::string& uniform, LLTexture *texture, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
S32 bindTexture(S32 uniform, LLTexture *texture, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
S32 unbindTexture(const std::string& uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
S32 unbindTexture(S32 uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE);
|
||||
|
||||
BOOL link(BOOL suppress_errors = FALSE);
|
||||
void bind();
|
||||
void unbind();
|
||||
@@ -142,10 +152,13 @@ public:
|
||||
|
||||
GLhandleARB mProgramObject;
|
||||
std::vector<GLint> mAttribute; //lookup table of attribute enum to attribute channel
|
||||
U32 mAttributeMask; //mask of which reserved attributes are set (lines up with LLVertexBuffer::getTypeMask())
|
||||
std::vector<GLint> mUniform; //lookup table of uniform enum to uniform location
|
||||
std::map<std::string, GLint> mUniformMap; //lookup map of uniform name to uniform location
|
||||
LLStaticStringTable<GLint> mUniformMap; //lookup map of uniform name to uniform location
|
||||
std::map<GLint, std::string> mUniformNameMap; //lookup map of uniform location to uniform name
|
||||
std::map<GLint, LLVector4> mValue; //lookup map of uniform location to last known value
|
||||
std::vector<GLint> mTexture;
|
||||
S32 mTotalUniformSize;
|
||||
S32 mActiveTextureChannels;
|
||||
S32 mShaderClass;
|
||||
S32 mShaderLevel;
|
||||
@@ -154,6 +167,7 @@ public:
|
||||
LLShaderFeatures mFeatures;
|
||||
std::vector< std::pair< std::string, GLenum > > mShaderFiles;
|
||||
std::string mName;
|
||||
std::map<std::string, std::string> mDefines;
|
||||
};
|
||||
|
||||
//UI shader (declared here so llui_libtest will link properly)
|
||||
|
||||
@@ -1099,6 +1099,26 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
|
||||
intformat = GL_RGBA8;
|
||||
}
|
||||
|
||||
if (pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE)
|
||||
{ //GL_LUMINANCE is deprecated, convert to GL_RGBA
|
||||
use_scratch = true;
|
||||
scratch = new U32[width*height];
|
||||
|
||||
U32 pixel_count = (U32) (width*height);
|
||||
for (U32 i = 0; i < pixel_count; i++)
|
||||
{
|
||||
U8 lum = ((U8*) pixels)[i];
|
||||
|
||||
U8* pix = (U8*) &scratch[i];
|
||||
pix[0] = pix[1] = pix[2] = lum;
|
||||
pix[3] = 1.f;
|
||||
}
|
||||
|
||||
pixformat = GL_RGBA;
|
||||
intformat = GL_RGBA8;
|
||||
}
|
||||
|
||||
|
||||
if (pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE)
|
||||
{ //GL_LUMINANCE_ALPHA is deprecated, convert to RGBA
|
||||
use_scratch = true;
|
||||
|
||||
@@ -51,6 +51,28 @@ extern LLGLSLShader gPostPosterizeProgram;
|
||||
extern LLGLSLShader gPostMotionBlurProgram;
|
||||
extern LLGLSLShader gPostVignetteProgram;
|
||||
|
||||
static LLStaticHashedString sGamma("gamma");
|
||||
static LLStaticHashedString sBrightness("brightness");
|
||||
static LLStaticHashedString sContrast("contrast");
|
||||
static LLStaticHashedString sContrastBase("contrastBase");
|
||||
static LLStaticHashedString sSaturation("saturation");
|
||||
static LLStaticHashedString sBrightMult("brightMult");
|
||||
static LLStaticHashedString sNoiseStrength("noiseStrength");
|
||||
static LLStaticHashedString sLayerCount("layerCount");
|
||||
|
||||
static LLStaticHashedString sVignetteStrength("vignette_strength");
|
||||
static LLStaticHashedString sVignettRadius("vignette_radius");
|
||||
static LLStaticHashedString sVignetteDarkness("vignette_darkness");
|
||||
static LLStaticHashedString sVignetteDesaturation("vignette_desaturation");
|
||||
static LLStaticHashedString sVignetteChromaticAberration("vignette_chromatic_aberration");
|
||||
static LLStaticHashedString sScreenRes("screen_res");
|
||||
|
||||
static LLStaticHashedString sHorizontalPass("horizontalPass");
|
||||
|
||||
static LLStaticHashedString sPrevProj("prev_proj");
|
||||
static LLStaticHashedString sInvProj("inv_proj");
|
||||
static LLStaticHashedString sBlurStrength("blur_strength");
|
||||
|
||||
static const unsigned int NOISE_SIZE = 512;
|
||||
|
||||
static const char * const XML_FILENAME = "postprocesseffects.xml";
|
||||
@@ -155,16 +177,16 @@ public:
|
||||
|
||||
/*virtual*/ QuadType preDraw()
|
||||
{
|
||||
getShader().uniform1f("gamma", mGamma);
|
||||
getShader().uniform1f("brightness", mBrightness);
|
||||
getShader().uniform1f("contrast", mContrast);
|
||||
getShader().uniform1f(sGamma, mGamma);
|
||||
getShader().uniform1f(sBrightness, mBrightness);
|
||||
getShader().uniform1f(sContrast, mContrast);
|
||||
float baseI = (mContrastBase.get()[VX] + mContrastBase.get()[VY] + mContrastBase.get()[VZ]) / 3.0f;
|
||||
baseI = mContrastBase.get()[VW] / llmax(baseI,0.001f);
|
||||
float baseR = mContrastBase.get()[VX] * baseI;
|
||||
float baseG = mContrastBase.get()[VY] * baseI;
|
||||
float baseB = mContrastBase.get()[VZ] * baseI;
|
||||
getShader().uniform3fv("contrastBase", 1, LLVector3(baseR, baseG, baseB).mV);
|
||||
getShader().uniform1f("saturation", mSaturation);
|
||||
getShader().uniform3fv(sContrastBase, 1, LLVector3(baseR, baseG, baseB).mV);
|
||||
getShader().uniform1f(sSaturation, mSaturation);
|
||||
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
@@ -187,8 +209,8 @@ public:
|
||||
{
|
||||
LLPostProcess::getInstance()->bindNoise(1);
|
||||
|
||||
getShader().uniform1f("brightMult", mBrightnessMult);
|
||||
getShader().uniform1f("noiseStrength", mNoiseStrength);
|
||||
getShader().uniform1f(sBrightMult, mBrightnessMult);
|
||||
getShader().uniform1f(sNoiseStrength, mNoiseStrength);
|
||||
|
||||
return QUAD_NOISE;
|
||||
}
|
||||
@@ -206,7 +228,7 @@ public:
|
||||
}
|
||||
/*virtual*/ QuadType preDraw()
|
||||
{
|
||||
getShader().uniform1i("layerCount", mNumLayers);
|
||||
getShader().uniform1i(sLayerCount, mNumLayers);
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
};
|
||||
@@ -232,12 +254,13 @@ public:
|
||||
/*virtual*/ QuadType preDraw()
|
||||
{
|
||||
LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions();
|
||||
getShader().uniform1f("vignette_strength", mStrength);
|
||||
getShader().uniform1f("vignette_radius", mRadius);
|
||||
getShader().uniform1f("vignette_darkness", mDarkness);
|
||||
getShader().uniform1f("vignette_desaturation", mDesaturation);
|
||||
getShader().uniform1f("vignette_chromatic_aberration", mChromaticAberration);
|
||||
getShader().uniform2fv("screen_res", 1, screen_rect.mV);
|
||||
|
||||
getShader().uniform1f(sVignetteStrength, mStrength);
|
||||
getShader().uniform1f(sVignettRadius, mRadius);
|
||||
getShader().uniform1f(sVignetteDarkness, mDarkness);
|
||||
getShader().uniform1f(sVignetteDesaturation, mDesaturation);
|
||||
getShader().uniform1f(sVignetteChromaticAberration, mChromaticAberration);
|
||||
getShader().uniform2fv(sScreenRes, 1, screen_rect.mV);
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
};
|
||||
@@ -259,7 +282,7 @@ public:
|
||||
/*virtual*/ S32 getDepthChannel() const { return -1; }
|
||||
/*virtual*/ QuadType preDraw()
|
||||
{
|
||||
mPassLoc = getShader().getUniformLocation("horizontalPass");
|
||||
mPassLoc = getShader().getUniformLocation(sHorizontalPass);
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
/*virtual*/ bool draw(U32 pass)
|
||||
@@ -295,10 +318,10 @@ public:
|
||||
|
||||
LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions();
|
||||
|
||||
getShader().uniformMatrix4fv("prev_proj", 1, GL_FALSE, prev_proj.m);
|
||||
getShader().uniformMatrix4fv("inv_proj", 1, GL_FALSE, inv_proj.m);
|
||||
getShader().uniform2fv("screen_res", 1, screen_rect.mV);
|
||||
getShader().uniform1i("blur_strength", mStrength);
|
||||
getShader().uniformMatrix4fv(sPrevProj, 1, GL_FALSE, prev_proj.m);
|
||||
getShader().uniformMatrix4fv(sInvProj, 1, GL_FALSE, inv_proj.m);
|
||||
getShader().uniform2fv(sScreenRes, 1, screen_rect.mV);
|
||||
getShader().uniform1i(sBlurStrength, mStrength);
|
||||
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
@@ -312,7 +335,7 @@ public:
|
||||
LLPostProcess::LLPostProcess(void) :
|
||||
mVBO(NULL),
|
||||
mDepthTexture(0),
|
||||
mNoiseTexture(NULL),
|
||||
mNoiseTexture(0),
|
||||
mScreenWidth(0),
|
||||
mScreenHeight(0),
|
||||
mNoiseTextureScale(0.f),
|
||||
@@ -407,7 +430,10 @@ void LLPostProcess::createScreenTextures()
|
||||
stop_glerror();
|
||||
|
||||
if(mDepthTexture)
|
||||
{
|
||||
LLImageGL::deleteTextures(1, &mDepthTexture);
|
||||
mDepthTexture = 0;
|
||||
}
|
||||
|
||||
for(std::list<LLPointer<LLPostProcessShader> >::iterator it=mShaders.begin();it!=mShaders.end();++it)
|
||||
{
|
||||
@@ -434,16 +460,25 @@ void LLPostProcess::createNoiseTexture()
|
||||
}
|
||||
}
|
||||
|
||||
mNoiseTexture = new LLImageGL(FALSE) ;
|
||||
if(mNoiseTexture->createGLTexture())
|
||||
if(mNoiseTexture)
|
||||
{
|
||||
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseTexture->getTexName());
|
||||
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RED, NOISE_SIZE, NOISE_SIZE, GL_RED, GL_UNSIGNED_BYTE, &buffer[0]);
|
||||
stop_glerror();
|
||||
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
|
||||
stop_glerror();
|
||||
LLImageGL::deleteTextures(1, &mNoiseTexture);
|
||||
mNoiseTexture = 0;
|
||||
}
|
||||
|
||||
LLImageGL::generateTextures(1, &mNoiseTexture);
|
||||
stop_glerror();
|
||||
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseTexture);
|
||||
stop_glerror();
|
||||
|
||||
if(gGLManager.mGLVersion >= 4.f)
|
||||
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_R8, NOISE_SIZE, NOISE_SIZE, GL_RED, GL_UNSIGNED_BYTE, &buffer[0], false);
|
||||
else
|
||||
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_LUMINANCE8, NOISE_SIZE, NOISE_SIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0], false);
|
||||
stop_glerror();
|
||||
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
|
||||
stop_glerror();
|
||||
}
|
||||
|
||||
void LLPostProcess::destroyGL()
|
||||
@@ -453,7 +488,9 @@ void LLPostProcess::destroyGL()
|
||||
if(mDepthTexture)
|
||||
LLImageGL::deleteTextures(1, &mDepthTexture);
|
||||
mDepthTexture=0;
|
||||
mNoiseTexture = NULL ;
|
||||
if(mNoiseTexture)
|
||||
LLImageGL::deleteTextures(1, &mNoiseTexture);
|
||||
mNoiseTexture=0 ;
|
||||
mVBO = NULL ;
|
||||
}
|
||||
|
||||
@@ -467,6 +504,7 @@ void LLPostProcess::copyFrameBuffer()
|
||||
{
|
||||
mRenderTarget[!!mRenderTarget[0].getFBO()].bindTexture(0,0);
|
||||
glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB,0,0,0,0,0,mScreenWidth, mScreenHeight);
|
||||
stop_glerror();
|
||||
|
||||
if(mDepthTexture)
|
||||
{
|
||||
@@ -476,6 +514,7 @@ void LLPostProcess::copyFrameBuffer()
|
||||
{
|
||||
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, mDepthTexture);
|
||||
glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB,0,0,0,0,0,mScreenWidth, mScreenHeight);
|
||||
stop_glerror();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -485,7 +524,7 @@ void LLPostProcess::copyFrameBuffer()
|
||||
|
||||
void LLPostProcess::bindNoise(U32 channel)
|
||||
{
|
||||
gGL.getTexUnit(channel)->bind(mNoiseTexture);
|
||||
gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE,mNoiseTexture);
|
||||
}
|
||||
|
||||
void LLPostProcess::renderEffects(unsigned int width, unsigned int height)
|
||||
@@ -508,8 +547,7 @@ void LLPostProcess::doEffects(void)
|
||||
{
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
mNoiseTextureScale = 0.001f + ((100.f - mSelectedEffectInfo["noise_size"].asFloat()) / 100.f);
|
||||
mNoiseTextureScale *= (mScreenHeight / NOISE_SIZE);
|
||||
mNoiseTextureScale = (1.f - (mSelectedEffectInfo["noise_size"].asFloat() - 1.f) *(9.f/990.f)) / (float)NOISE_SIZE;
|
||||
|
||||
/// Copy the screen buffer to the render texture
|
||||
copyFrameBuffer();
|
||||
@@ -562,13 +600,19 @@ void LLPostProcess::applyShaders(void)
|
||||
QuadType quad = (*it)->preDraw();
|
||||
while((*it)->draw(pass++))
|
||||
{
|
||||
mRenderTarget[!primary_rendertarget].bindTarget();
|
||||
LLRenderTarget& write_target = mRenderTarget[!primary_rendertarget];
|
||||
LLRenderTarget& read_target = mRenderTarget[mRenderTarget[0].getFBO() ? primary_rendertarget : !primary_rendertarget];
|
||||
write_target.bindTarget();
|
||||
|
||||
if(color_channel >= 0)
|
||||
mRenderTarget[mRenderTarget[0].getFBO() ? primary_rendertarget : !primary_rendertarget].bindTexture(0,color_channel);
|
||||
read_target.bindTexture(0,color_channel);
|
||||
|
||||
drawOrthoQuad(quad);
|
||||
mRenderTarget[!primary_rendertarget].flush();
|
||||
|
||||
if(color_channel >= 0 && !mRenderTarget[0].getFBO())
|
||||
gGL.getTexUnit(color_channel)->unbind(read_target.getUsage());
|
||||
|
||||
write_target.flush();
|
||||
if(mRenderTarget[0].getFBO())
|
||||
primary_rendertarget = !primary_rendertarget;
|
||||
}
|
||||
@@ -593,8 +637,13 @@ void LLPostProcess::drawOrthoQuad(QuadType type)
|
||||
LLStrider<LLVector2> uv2;
|
||||
mVBO->getTexCoord1Strider(uv2);
|
||||
|
||||
float offs[2] = {(float) rand() / (float) RAND_MAX, (float) rand() / (float) RAND_MAX};
|
||||
float scale[2] = {mScreenWidth * mNoiseTextureScale / mScreenHeight, mNoiseTextureScale};
|
||||
float offs[2] = {
|
||||
llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE),
|
||||
llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE) };
|
||||
float scale[2] = {
|
||||
(float)mScreenWidth * mNoiseTextureScale,
|
||||
(float)mScreenHeight * mNoiseTextureScale };
|
||||
|
||||
uv2[0] = LLVector2(offs[0],offs[1]);
|
||||
uv2[1] = LLVector2(offs[0],offs[1]+scale[1]);
|
||||
uv2[2] = LLVector2(offs[0]+scale[0],offs[1]);
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
// However this is ONLY the case if fbos are actually supported, else swapping isn't needed.
|
||||
LLRenderTarget mRenderTarget[2];
|
||||
U32 mDepthTexture;
|
||||
LLPointer<LLImageGL> mNoiseTexture ;
|
||||
U32 mNoiseTexture ;
|
||||
|
||||
U32 mScreenWidth;
|
||||
U32 mScreenHeight;
|
||||
|
||||
@@ -1496,7 +1496,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z)
|
||||
}
|
||||
|
||||
LLVector4a add(x,y,z);
|
||||
mUIOffset.back()->add(add);
|
||||
mUIOffset.back().add(add);
|
||||
}
|
||||
|
||||
void LLRender::scaleUI(F32 x, F32 y, F32 z)
|
||||
@@ -1507,33 +1507,27 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z)
|
||||
}
|
||||
|
||||
LLVector4a scale(x,y,z);
|
||||
mUIScale.back()->mul(scale);
|
||||
mUIScale.back().mul(scale);
|
||||
}
|
||||
|
||||
void LLRender::pushUIMatrix()
|
||||
{
|
||||
if (mUIOffset.empty())
|
||||
{
|
||||
mUIOffset.push_back(static_cast<LLVector4a*>(ll_aligned_malloc_16(sizeof(LLVector4a))));
|
||||
mUIOffset.back()->splat(0.f);
|
||||
mUIOffset.push_back(LLVector4a(0.f));
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLVector4a* last_entry = mUIOffset.back();
|
||||
mUIOffset.push_back(static_cast<LLVector4a*>(ll_aligned_malloc_16(sizeof(LLVector4a))));
|
||||
*mUIOffset.back() = *last_entry;
|
||||
mUIOffset.push_back(mUIOffset.back());
|
||||
}
|
||||
|
||||
if (mUIScale.empty())
|
||||
{
|
||||
mUIScale.push_back(static_cast<LLVector4a*>(ll_aligned_malloc_16(sizeof(LLVector4a))));
|
||||
mUIScale.back()->splat(1.f);
|
||||
mUIScale.push_back(LLVector4a(1.f));
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLVector4a* last_entry = mUIScale.back();
|
||||
mUIScale.push_back(static_cast<LLVector4a*>(ll_aligned_malloc_16(sizeof(LLVector4a))));
|
||||
*mUIScale.back() = *last_entry;
|
||||
mUIScale.push_back(mUIScale.back());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1543,9 +1537,7 @@ void LLRender::popUIMatrix()
|
||||
{
|
||||
llerrs << "UI offset stack blown." << llendl;
|
||||
}
|
||||
ll_aligned_free_16(mUIOffset.back());
|
||||
mUIOffset.pop_back();
|
||||
ll_aligned_free_16(mUIScale.back());
|
||||
mUIScale.pop_back();
|
||||
}
|
||||
|
||||
@@ -1555,7 +1547,7 @@ LLVector3 LLRender::getUITranslation()
|
||||
{
|
||||
return LLVector3(0,0,0);
|
||||
}
|
||||
return LLVector3(mUIOffset.back()->getF32ptr());
|
||||
return LLVector3(mUIOffset.back().getF32ptr());
|
||||
}
|
||||
|
||||
LLVector3 LLRender::getUIScale()
|
||||
@@ -1564,7 +1556,7 @@ LLVector3 LLRender::getUIScale()
|
||||
{
|
||||
return LLVector3(1,1,1);
|
||||
}
|
||||
return LLVector3(mUIScale.back()->getF32ptr());
|
||||
return LLVector3(mUIScale.back().getF32ptr());
|
||||
}
|
||||
|
||||
|
||||
@@ -1574,8 +1566,8 @@ void LLRender::loadUIIdentity()
|
||||
{
|
||||
llerrs << "Need to push UI translation frame before clearing offset." << llendl;
|
||||
}
|
||||
mUIOffset.back()->splat(0.f);
|
||||
mUIScale.back()->splat(1.f);
|
||||
mUIOffset.back().splat(0.f);
|
||||
mUIScale.back().splat(1.f);
|
||||
}
|
||||
|
||||
void LLRender::setColorMask(bool writeColor, bool writeAlpha)
|
||||
@@ -1977,8 +1969,8 @@ void LLRender::vertex4a(const LLVector4a& vertex)
|
||||
else
|
||||
{
|
||||
//LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.back()).scaledVec(mUIScale.back());
|
||||
mVerticesp[mCount].setAdd(vertex,*mUIOffset.back());
|
||||
mVerticesp[mCount].mul(*mUIScale.back());
|
||||
mVerticesp[mCount].setAdd(vertex,mUIOffset.back());
|
||||
mVerticesp[mCount].mul(mUIScale.back());
|
||||
}
|
||||
|
||||
if (mMode == LLRender::QUADS && LLRender::sGLCoreProfile)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "v3math.h"
|
||||
#include "v4coloru.h"
|
||||
#include "v4math.h"
|
||||
#include "llalignedarray.h"
|
||||
#include "llstrider.h"
|
||||
#include "llpointer.h"
|
||||
#include "llglheaders.h"
|
||||
@@ -466,9 +467,8 @@ private:
|
||||
|
||||
F32 mMaxAnisotropy;
|
||||
|
||||
std::vector<LLVector4a*> mUIOffset;
|
||||
std::vector<LLVector4a*> mUIScale;
|
||||
|
||||
LLAlignedArray<LLVector4a, 64> mUIOffset;
|
||||
LLAlignedArray<LLVector4a, 64> mUIScale;
|
||||
};
|
||||
|
||||
extern F32 gGLModelView[16];
|
||||
|
||||
@@ -72,7 +72,7 @@ LLRenderTarget::~LLRenderTarget()
|
||||
release();
|
||||
}
|
||||
|
||||
void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt)
|
||||
void LLRenderTarget::resize(U32 resx, U32 resy)
|
||||
{
|
||||
//for accounting, get the number of pixels added/subtracted
|
||||
S32 pix_diff = (resx*resy)-(mResX*mResY);
|
||||
@@ -80,10 +80,12 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt)
|
||||
mResX = resx;
|
||||
mResY = resy;
|
||||
|
||||
llassert(mInternalFormat.size() == mTex.size());
|
||||
|
||||
for (U32 i = 0; i < mTex.size(); ++i)
|
||||
{ //resize color attachments
|
||||
gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]);
|
||||
LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
|
||||
LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
|
||||
sBytesAllocated += pix_diff*4;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
// CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined
|
||||
// DO NOT use for screen space buffers or for scratch space for an image that might be uploaded
|
||||
// DO use for render targets that resize often and aren't likely to ruin someone's day if they break
|
||||
void resize(U32 resx, U32 resy, U32 color_fmt);
|
||||
void resize(U32 resx, U32 resy);
|
||||
|
||||
//provide this render target with a multisample resource.
|
||||
void setSampleBuffer(LLMultisampleBuffer* buffer);
|
||||
|
||||
@@ -528,7 +528,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns)
|
||||
}
|
||||
}
|
||||
|
||||
GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels)
|
||||
GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::map<std::string, std::string>* defines, S32 texture_index_channels)
|
||||
{
|
||||
std::pair<std::multimap<std::string, CachedObjectInfo >::iterator, std::multimap<std::string, CachedObjectInfo>::iterator> range;
|
||||
range = mShaderObjects.equal_range(filename);
|
||||
@@ -683,12 +683,14 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
if(SHPackDeferredNormals)
|
||||
text[count++] = strdup("#define PACK_NORMALS\n");
|
||||
|
||||
//copy preprocessor definitions into buffer
|
||||
for (std::map<std::string,std::string>::iterator iter = mDefinitions.begin(); iter != mDefinitions.end(); ++iter)
|
||||
if(defines)
|
||||
{
|
||||
for (std::map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)
|
||||
{
|
||||
std::string define = "#define " + iter->first + " " + iter->second + "\n";
|
||||
text[count++] = (GLcharARB *) strdup(define.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB)
|
||||
{
|
||||
@@ -938,7 +940,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
if (shader_level > 1)
|
||||
{
|
||||
shader_level--;
|
||||
return loadShaderFile(filename,shader_level,type,texture_index_channels);
|
||||
return loadShaderFile(filename,shader_level,type, defines, texture_index_channels);
|
||||
}
|
||||
LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL;
|
||||
}
|
||||
@@ -1058,7 +1060,9 @@ void LLShaderMgr::initAttribsAndUniforms()
|
||||
mReservedUniforms.push_back("texture_matrix1");
|
||||
mReservedUniforms.push_back("texture_matrix2");
|
||||
mReservedUniforms.push_back("texture_matrix3");
|
||||
llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_MATRIX3+1);
|
||||
mReservedUniforms.push_back("object_plane_s");
|
||||
mReservedUniforms.push_back("object_plane_t");
|
||||
llassert(mReservedUniforms.size() == LLShaderMgr::OBJECT_PLANE_T+1);
|
||||
|
||||
mReservedUniforms.push_back("viewport");
|
||||
|
||||
@@ -1199,7 +1203,47 @@ void LLShaderMgr::initAttribsAndUniforms()
|
||||
mReservedUniforms.push_back("lightMap");
|
||||
mReservedUniforms.push_back("bloomMap");
|
||||
mReservedUniforms.push_back("projectionMap");
|
||||
mReservedUniforms.push_back("norm_mat");
|
||||
|
||||
mReservedUniforms.push_back("matrixPalette");
|
||||
|
||||
mReservedUniforms.push_back("screenTex");
|
||||
mReservedUniforms.push_back("screenDepth");
|
||||
mReservedUniforms.push_back("refTex");
|
||||
mReservedUniforms.push_back("eyeVec");
|
||||
mReservedUniforms.push_back("time");
|
||||
mReservedUniforms.push_back("d1");
|
||||
mReservedUniforms.push_back("d2");
|
||||
mReservedUniforms.push_back("lightDir");
|
||||
mReservedUniforms.push_back("specular");
|
||||
mReservedUniforms.push_back("lightExp");
|
||||
mReservedUniforms.push_back("waterFogColor");
|
||||
mReservedUniforms.push_back("waterFogDensity");
|
||||
mReservedUniforms.push_back("waterFogKS");
|
||||
mReservedUniforms.push_back("refScale");
|
||||
mReservedUniforms.push_back("waterHeight");
|
||||
mReservedUniforms.push_back("waterPlane");
|
||||
mReservedUniforms.push_back("normScale");
|
||||
mReservedUniforms.push_back("fresnelScale");
|
||||
mReservedUniforms.push_back("fresnelOffset");
|
||||
mReservedUniforms.push_back("blurMultiplier");
|
||||
mReservedUniforms.push_back("sunAngle");
|
||||
mReservedUniforms.push_back("scaledAngle");
|
||||
mReservedUniforms.push_back("sunAngle2");
|
||||
|
||||
mReservedUniforms.push_back("camPosLocal");
|
||||
|
||||
mReservedUniforms.push_back("gWindDir");
|
||||
mReservedUniforms.push_back("gSinWaveParams");
|
||||
mReservedUniforms.push_back("gGravity");
|
||||
|
||||
mReservedUniforms.push_back("detail_0");
|
||||
mReservedUniforms.push_back("detail_1");
|
||||
mReservedUniforms.push_back("detail_2");
|
||||
mReservedUniforms.push_back("detail_3");
|
||||
mReservedUniforms.push_back("alpha_ramp");
|
||||
|
||||
mReservedUniforms.push_back("origin");
|
||||
llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
|
||||
|
||||
std::set<std::string> dupe_check;
|
||||
|
||||
@@ -47,6 +47,8 @@ public:
|
||||
TEXTURE_MATRIX1,
|
||||
TEXTURE_MATRIX2,
|
||||
TEXTURE_MATRIX3,
|
||||
OBJECT_PLANE_S,
|
||||
OBJECT_PLANE_T,
|
||||
VIEWPORT,
|
||||
LIGHT_POSITION,
|
||||
LIGHT_DIRECTION,
|
||||
@@ -164,6 +166,45 @@ public:
|
||||
DEFERRED_LIGHT,
|
||||
DEFERRED_BLOOM,
|
||||
DEFERRED_PROJECTION,
|
||||
DEFERRED_NORM_MATRIX,
|
||||
|
||||
AVATAR_MATRIX,
|
||||
WATER_SCREENTEX,
|
||||
WATER_SCREENDEPTH,
|
||||
WATER_REFTEX,
|
||||
WATER_EYEVEC,
|
||||
WATER_TIME,
|
||||
WATER_WAVE_DIR1,
|
||||
WATER_WAVE_DIR2,
|
||||
WATER_LIGHT_DIR,
|
||||
WATER_SPECULAR,
|
||||
WATER_SPECULAR_EXP,
|
||||
WATER_FOGCOLOR,
|
||||
WATER_FOGDENSITY,
|
||||
WATER_FOGKS,
|
||||
WATER_REFSCALE,
|
||||
WATER_WATERHEIGHT,
|
||||
WATER_WATERPLANE,
|
||||
WATER_NORM_SCALE,
|
||||
WATER_FRESNEL_SCALE,
|
||||
WATER_FRESNEL_OFFSET,
|
||||
WATER_BLUR_MULTIPLIER,
|
||||
WATER_SUN_ANGLE,
|
||||
WATER_SCALED_ANGLE,
|
||||
WATER_SUN_ANGLE2,
|
||||
|
||||
WL_CAMPOSLOCAL,
|
||||
|
||||
AVATAR_WIND,
|
||||
AVATAR_SINWAVE,
|
||||
AVATAR_GRAVITY,
|
||||
|
||||
TERRAIN_DETAIL0,
|
||||
TERRAIN_DETAIL1,
|
||||
TERRAIN_DETAIL2,
|
||||
TERRAIN_DETAIL3,
|
||||
TERRAIN_ALPHARAMP,
|
||||
SHINY_ORIGIN,
|
||||
END_RESERVED_UNIFORMS
|
||||
} eGLSLReservedUniforms;
|
||||
|
||||
@@ -176,7 +217,7 @@ public:
|
||||
void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE);
|
||||
BOOL linkProgramObject(GLhandleARB obj, BOOL suppress_errors = FALSE);
|
||||
BOOL validateProgramObject(GLhandleARB obj);
|
||||
GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels = -1);
|
||||
GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);
|
||||
|
||||
// Implemented in the application to actually point to the shader directory.
|
||||
virtual std::string getShaderDirPrefix(void) = 0; // Pure Virtual
|
||||
|
||||
@@ -207,9 +207,6 @@ public:
|
||||
void setImageFlash(LLPointer<LLUIImage> image);
|
||||
void setImagePressed(LLPointer<LLUIImage> image);
|
||||
|
||||
void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; }
|
||||
BOOL getCommitOnReturn() const { return mCommitOnReturn; }
|
||||
|
||||
static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
|
||||
void setHelpURLCallback(const std::string &help_url);
|
||||
const std::string& getHelpURL() const { return mHelpURL; }
|
||||
|
||||
@@ -366,6 +366,20 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f
|
||||
}
|
||||
}
|
||||
|
||||
bool LLFocusMgr::keyboardFocusHasAccelerators() const
|
||||
{
|
||||
LLView* focus_view = dynamic_cast<LLView*>(mKeyboardFocus);
|
||||
while(focus_view)
|
||||
{
|
||||
if (focus_view->hasAccelerators())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
focus_view = focus_view->getParent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor )
|
||||
{
|
||||
|
||||
@@ -121,6 +121,7 @@ public:
|
||||
void unlockFocus();
|
||||
BOOL focusLocked() const { return mLockedView != NULL; }
|
||||
|
||||
bool keyboardFocusHasAccelerators() const;
|
||||
|
||||
struct Impl;
|
||||
|
||||
|
||||
@@ -626,12 +626,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
// the menu items are in the child list in bottom up order
|
||||
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
||||
return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||
return (prev_menu_item && prev_menu_item->getVisible() && prev_menu_item->getEnabled()) ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
||||
return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;
|
||||
return (next_menu_item && next_menu_item->getVisible() && next_menu_item->getEnabled()) ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,12 +641,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
if (y > getRect().getHeight() / 2)
|
||||
{
|
||||
LLView* prev_menu_item = parent_menu->findNextSibling(this);
|
||||
return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||
return (prev_menu_item && prev_menu_item->getVisible() && prev_menu_item->getEnabled()) ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLView* next_menu_item = parent_menu->findPrevSibling(this);
|
||||
return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;
|
||||
return (next_menu_item && next_menu_item->getVisible() && next_menu_item->getEnabled()) ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4630,10 +4630,13 @@ BOOL LLMenuHolderGL::handleKey(KEY key, MASK mask, BOOL called_from_parent)
|
||||
}
|
||||
else
|
||||
{
|
||||
//highlight first enabled one
|
||||
if(pMenu->highlightNextItem(NULL))
|
||||
if (key == KEY_UP || key == KEY_DOWN) // Singu Note: Only highlight if the user actually meant to navigate through the menu
|
||||
{
|
||||
handled = true;
|
||||
//highlight first enabled one
|
||||
if (pMenu->highlightNextItem(NULL))
|
||||
{
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,8 @@ BOOL LLMultiFloater::closeAllFloaters()
|
||||
//Tab did not actually close, possibly due to a pending Save Confirmation dialog..
|
||||
//so try and close the next one in the list...
|
||||
tabToClose++;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
//Tab closed ok.
|
||||
lastTabCount = mTabContainer->getTabCount();
|
||||
@@ -252,7 +253,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
|
||||
else if (floaterp->getHost())
|
||||
{
|
||||
// floaterp is hosted by somebody else and
|
||||
// this is adding it, so remove it from it's old host
|
||||
// this is adding it, so remove it from its old host
|
||||
floaterp->getHost()->removeFloater(floaterp);
|
||||
}
|
||||
else if (floaterp->getParent() == gFloaterView)
|
||||
@@ -302,8 +303,21 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
|
||||
{
|
||||
floaterp->setVisible(FALSE);
|
||||
}
|
||||
|
||||
// Tabs sometimes overlap resize handle
|
||||
moveResizeHandlesToFront();
|
||||
}
|
||||
|
||||
void LLMultiFloater::updateFloaterTitle(LLFloater* floaterp)
|
||||
{
|
||||
S32 index = mTabContainer->getIndexForPanel(floaterp);
|
||||
if (index != -1)
|
||||
{
|
||||
mTabContainer->setPanelTitle(index, floaterp->getShortTitle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
BOOL selectFloater(LLFloater* floaterp)
|
||||
|
||||
@@ -329,8 +343,9 @@ void LLMultiFloater::selectPrevFloater()
|
||||
mTabContainer->selectPrevTab();
|
||||
}
|
||||
|
||||
void LLMultiFloater::showFloater(LLFloater* floaterp)
|
||||
void LLMultiFloater::showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point)
|
||||
{
|
||||
if(!floaterp) return;
|
||||
// we won't select a panel that already is selected
|
||||
// it is hard to do this internally to tab container
|
||||
// as tab selection is handled via index and the tab at a given
|
||||
@@ -338,7 +353,7 @@ void LLMultiFloater::showFloater(LLFloater* floaterp)
|
||||
if (floaterp != mTabContainer->getCurrentPanel() &&
|
||||
!mTabContainer->selectTabPanel(floaterp))
|
||||
{
|
||||
addFloater(floaterp, TRUE);
|
||||
addFloater(floaterp, TRUE, insertion_point);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,6 +432,13 @@ BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask)
|
||||
if (floater && floater->canClose() && floater->isCloseable())
|
||||
{
|
||||
floater->close();
|
||||
|
||||
// EXT-5695 (Tabbed IM window loses focus if close any tabs by Ctrl+W)
|
||||
// bring back focus on tab container if there are any tab left
|
||||
if(mTabContainer->getTabCount() > 0)
|
||||
{
|
||||
mTabContainer->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -468,12 +490,17 @@ void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, BOOL flashing)
|
||||
|
||||
void LLMultiFloater::onTabSelected()
|
||||
{
|
||||
tabOpen((LLFloater*)mTabContainer->getCurrentPanel());
|
||||
LLFloater* floaterp = dynamic_cast<LLFloater*>(mTabContainer->getCurrentPanel());
|
||||
if (floaterp)
|
||||
{
|
||||
tabOpen(floaterp);
|
||||
}
|
||||
}
|
||||
|
||||
void LLMultiFloater::setCanResize(BOOL can_resize)
|
||||
{
|
||||
LLFloater::setCanResize(can_resize);
|
||||
if (!mTabContainer) return;
|
||||
if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM)
|
||||
{
|
||||
mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH);
|
||||
@@ -510,16 +537,9 @@ void LLMultiFloater::updateResizeLimits()
|
||||
// initialize minimum size constraint to the original xml values.
|
||||
S32 new_min_width = mOrigMinWidth;
|
||||
S32 new_min_height = mOrigMinHeight;
|
||||
// possibly increase minimum size constraint due to children's minimums.
|
||||
for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
|
||||
{
|
||||
LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
|
||||
if (floaterp)
|
||||
{
|
||||
new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2);
|
||||
new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
computeResizeLimits(new_min_width, new_min_height);
|
||||
|
||||
setResizeLimits(new_min_width, new_min_height);
|
||||
|
||||
S32 cur_height = getRect().getHeight();
|
||||
@@ -545,3 +565,17 @@ void LLMultiFloater::updateResizeLimits()
|
||||
gFloaterView->adjustToFitScreen(this, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLMultiFloater::computeResizeLimits(S32& new_min_width, S32& new_min_height)
|
||||
{
|
||||
// possibly increase minimum size constraint due to children's minimums.
|
||||
for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
|
||||
{
|
||||
LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
|
||||
if (floaterp)
|
||||
{
|
||||
new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2);
|
||||
new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
virtual void growToFit(S32 content_width, S32 content_height);
|
||||
virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
||||
|
||||
virtual void showFloater(LLFloater* floaterp);
|
||||
virtual void showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
||||
virtual void removeFloater(LLFloater* floaterp);
|
||||
|
||||
virtual void tabOpen(LLFloater* opened_floater);
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
void onTabSelected();
|
||||
|
||||
virtual void updateResizeLimits();
|
||||
virtual void updateFloaterTitle(LLFloater* floaterp);
|
||||
|
||||
protected:
|
||||
struct LLFloaterData
|
||||
@@ -94,6 +95,9 @@ protected:
|
||||
LLTabContainer::TabPosition mTabPos;
|
||||
BOOL mAutoResize;
|
||||
S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late
|
||||
|
||||
private:
|
||||
virtual void computeResizeLimits(S32& new_min_width, S32& new_min_height);
|
||||
};
|
||||
|
||||
#endif // LL_MULTI_FLOATER_H
|
||||
|
||||
@@ -159,8 +159,12 @@ void LLPanel::addBorder(LLViewBorder::EBevel border_bevel,
|
||||
|
||||
void LLPanel::removeBorder()
|
||||
{
|
||||
delete mBorder;
|
||||
mBorder = NULL;
|
||||
if (mBorder)
|
||||
{
|
||||
removeChild(mBorder);
|
||||
delete mBorder;
|
||||
mBorder = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +281,7 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
|
||||
// handle user hitting ESC to defocus
|
||||
if (key == KEY_ESCAPE && mask == MASK_NONE)
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus(NULL);
|
||||
setFocus(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
else if( (mask == MASK_SHIFT) && (KEY_TAB == key))
|
||||
@@ -304,29 +308,25 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a default button, click it when
|
||||
// return is pressed, unless current focus is a return-capturing button
|
||||
// in which case *that* button will handle the return key
|
||||
LLButton* focused_button = dynamic_cast<LLButton*>(cur_focus);
|
||||
if (cur_focus && !(focused_button && focused_button->getCommitOnReturn()))
|
||||
|
||||
// If RETURN was pressed and something has focus, call onCommit()
|
||||
if (!handled && cur_focus && key == KEY_RETURN && mask == MASK_NONE)
|
||||
{
|
||||
// RETURN key means hit default button in this case
|
||||
if (key == KEY_RETURN && mask == MASK_NONE
|
||||
&& mDefaultBtn != NULL
|
||||
&& mDefaultBtn->getVisible()
|
||||
&& mDefaultBtn->getEnabled())
|
||||
if (cur_focus->getCommitOnReturn())
|
||||
{
|
||||
// current focus is a return-capturing element,
|
||||
// let *that* element handle the return key
|
||||
handled = FALSE;
|
||||
}
|
||||
else if (mDefaultBtn && mDefaultBtn->getVisible() && mDefaultBtn->getEnabled())
|
||||
{
|
||||
// If we have a default button, click it when return is pressed
|
||||
mDefaultBtn->onCommit();
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (key == KEY_RETURN && mask == MASK_NONE)
|
||||
{
|
||||
// set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl
|
||||
if (cur_focus && cur_focus->acceptsTextInput())
|
||||
else if (cur_focus->acceptsTextInput())
|
||||
{
|
||||
// call onCommit for text input handling control
|
||||
cur_focus->onCommit();
|
||||
handled = TRUE;
|
||||
}
|
||||
@@ -363,34 +363,16 @@ void LLPanel::handleVisibilityChange ( BOOL new_visibility )
|
||||
|
||||
void LLPanel::setFocus(BOOL b)
|
||||
{
|
||||
if( b )
|
||||
if( b && !hasFocus())
|
||||
{
|
||||
if (!gFocusMgr.childHasKeyboardFocus(this))
|
||||
{
|
||||
//refresh();
|
||||
if (!focusFirstItem())
|
||||
{
|
||||
LLUICtrl::setFocus(TRUE);
|
||||
}
|
||||
onFocusReceived();
|
||||
}
|
||||
// give ourselves focus preemptively, to avoid infinite loop
|
||||
LLUICtrl::setFocus(TRUE);
|
||||
// then try to pass to first valid child
|
||||
focusFirstItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( this == gFocusMgr.getKeyboardFocus() )
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus( NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
//RN: why is this here?
|
||||
LLView::ctrl_list_t ctrls = getCtrlList();
|
||||
for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
|
||||
{
|
||||
LLUICtrl* ctrl = *ctrl_it;
|
||||
ctrl->setFocus( FALSE );
|
||||
}
|
||||
}
|
||||
LLUICtrl::setFocus(b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ LLUICtrl::LLUICtrl() :
|
||||
mDoubleClickSignal(NULL),
|
||||
mTentative(FALSE),
|
||||
mTabStop(TRUE),
|
||||
mIsChrome(FALSE)
|
||||
mIsChrome(FALSE),
|
||||
mCommitOnReturn(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -78,7 +79,8 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect rect, BOOL mouse_opaque
|
||||
mDoubleClickSignal(NULL),
|
||||
mTentative( FALSE ),
|
||||
mTabStop( TRUE ),
|
||||
mIsChrome(FALSE)
|
||||
mIsChrome(FALSE),
|
||||
mCommitOnReturn(FALSE)
|
||||
{
|
||||
if(commit_callback)
|
||||
setCommitCallback(commit_callback);
|
||||
@@ -178,6 +180,13 @@ BOOL LLUICtrl::handleDoubleClick(S32 x, S32 y, MASK mask)
|
||||
return handled;
|
||||
}
|
||||
|
||||
// can't tab to children of a non-tab-stop widget
|
||||
BOOL LLUICtrl::canFocusChildren() const
|
||||
{
|
||||
return TRUE;//hasTabStop();
|
||||
}
|
||||
|
||||
|
||||
void LLUICtrl::onCommit()
|
||||
{
|
||||
if (mCommitSignal)
|
||||
@@ -528,7 +537,8 @@ BOOL LLUICtrl::focusNextItem(BOOL text_fields_only)
|
||||
{
|
||||
// this assumes that this method is called on the focus root.
|
||||
LLCtrlQuery query = getTabOrderQuery();
|
||||
if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly"))
|
||||
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
|
||||
if(text_fields_only || tab_to_text_fields_only)
|
||||
{
|
||||
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
|
||||
}
|
||||
@@ -540,7 +550,8 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only)
|
||||
{
|
||||
// this assumes that this method is called on the focus root.
|
||||
LLCtrlQuery query = getTabOrderQuery();
|
||||
if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly"))
|
||||
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
|
||||
if(text_fields_only || tab_to_text_fields_only)
|
||||
{
|
||||
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
|
||||
}
|
||||
@@ -552,7 +563,7 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot()
|
||||
{
|
||||
LLUICtrl* focus_root = NULL;
|
||||
LLUICtrl* next_view = this;
|
||||
while(next_view)
|
||||
while(next_view/* && next_view->hasTabStop()*/)
|
||||
{
|
||||
if (next_view->isFocusRoot())
|
||||
{
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
/*virtual*/ BOOL isCtrl() const;
|
||||
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL canFocusChildren() const;
|
||||
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
|
||||
@@ -132,6 +133,9 @@ public:
|
||||
|
||||
LLUICtrl* getParentUICtrl() const;
|
||||
|
||||
void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; }
|
||||
BOOL getCommitOnReturn() const { return mCommitOnReturn; }
|
||||
|
||||
//Start using these!
|
||||
boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb );
|
||||
boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb );
|
||||
@@ -198,6 +202,8 @@ private:
|
||||
BOOL mIsChrome;
|
||||
BOOL mTentative;
|
||||
|
||||
bool mCommitOnReturn;
|
||||
|
||||
class DefaultTabGroupFirstSorter;
|
||||
};
|
||||
|
||||
|
||||
@@ -1377,7 +1377,10 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
|
||||
S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
|
||||
viewp->translate( delta_x, delta_y );
|
||||
viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
|
||||
if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
|
||||
{
|
||||
viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -357,6 +357,11 @@ public:
|
||||
BOOL focusNextRoot();
|
||||
BOOL focusPrevRoot();
|
||||
|
||||
// Normally we want the app menus to get priority on accelerated keys
|
||||
// However, sometimes we want to give specific views a first chance
|
||||
// at handling them. (eg. the script editor)
|
||||
virtual bool hasAccelerators() const { return false; }
|
||||
|
||||
virtual void deleteAllChildren();
|
||||
|
||||
virtual void setTentative(BOOL b);
|
||||
|
||||
@@ -363,7 +363,11 @@ std::string LLDir::buildSLOSCacheDir() const
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
res = add(getOSCacheDir(), "SingularityViewer64");
|
||||
#else
|
||||
res = add(getOSCacheDir(), "SingularityViewer");
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ void LLWindowWin32::close()
|
||||
LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL;
|
||||
|
||||
// Don't process events in our mainWindowProc any longer.
|
||||
SetWindowLong(mWindowHandle, GWL_USERDATA, NULL);
|
||||
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL);
|
||||
|
||||
// Make sure we don't leave a blank toolbar button.
|
||||
ShowWindow(mWindowHandle, SW_HIDE);
|
||||
@@ -1660,7 +1660,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
||||
LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL;
|
||||
}
|
||||
|
||||
SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this);
|
||||
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this);
|
||||
|
||||
// register this window as handling drag/drop events from the OS
|
||||
DragAcceptFiles( mWindowHandle, TRUE );
|
||||
@@ -1983,7 +1983,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
|
||||
static bool sHandleLeftMouseUp = true;
|
||||
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA);
|
||||
|
||||
|
||||
if (NULL != window_imp)
|
||||
|
||||
@@ -47,6 +47,8 @@ include(LLAppearance)
|
||||
|
||||
if (WINDOWS)
|
||||
include(CopyWinLibs)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
endif (WINDOWS)
|
||||
|
||||
include_directories(
|
||||
@@ -1437,11 +1439,7 @@ set(PACKAGE ${PACKAGE_DEFAULT} CACHE BOOL
|
||||
"Add a package target that builds an installer package.")
|
||||
|
||||
if (WINDOWS)
|
||||
if(MSVC10)
|
||||
set(release_flags "/MAPRelease/${VIEWER_BINARY_NAME}.map")
|
||||
else(MSVC10)
|
||||
set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map")
|
||||
endif(MSVC10)
|
||||
set(release_flags "/MAPRelease/${VIEWER_BINARY_NAME}.map")
|
||||
|
||||
if (FMOD)
|
||||
if(MANIFEST_LIBRARIES)
|
||||
@@ -1451,12 +1449,18 @@ if (WINDOWS)
|
||||
endif(MANIFEST_LIBRARIES)
|
||||
endif (FMOD)
|
||||
if (FMODEX)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(fmodex_dll_file "fmodex.dll")
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
set(fmodex_dll_file "fmodex64.dll")
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
if(MANIFEST_LIBRARIES)
|
||||
set(MANIFEST_LIBRARIES "${MANIFEST_LIBRARIES}|${FMODEX_BINARY_DIR}/fmodex.dll")
|
||||
set(MANIFEST_LIBRARIES "${MANIFEST_LIBRARIES}|${FMODEX_BINARY_DIR}/${fmodex_dll_file}")
|
||||
else(MANIFEST_LIBRARIES)
|
||||
set(MANIFEST_LIBRARIES "--extra_libraries=${FMODEX_BINARY_DIR}/fmodex.dll")
|
||||
set(MANIFEST_LIBRARIES "--extra_libraries=${FMODEX_BINARY_DIR}/${fmodex_dll_file}")
|
||||
endif(MANIFEST_LIBRARIES)
|
||||
set(EXTRA_LINKER_FLAGS "/DELAYLOAD:fmodex.dll")
|
||||
set(EXTRA_LINKER_FLAGS "/DELAYLOAD:${fmodex_dll_file}")
|
||||
endif (FMODEX)
|
||||
|
||||
set_target_properties(${VIEWER_BINARY_NAME}
|
||||
@@ -1514,6 +1518,7 @@ if (WINDOWS)
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
--arch=${ARCH}
|
||||
--artwork=${ARTWORK_DIR}
|
||||
--branding_id=${VIEWER_BRANDING_ID}
|
||||
--build=${CMAKE_CURRENT_BINARY_DIR}
|
||||
@@ -1535,6 +1540,7 @@ if (WINDOWS)
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
--arch=${ARCH}
|
||||
--artwork=${ARTWORK_DIR}
|
||||
--actions=copy
|
||||
--branding_id=${VIEWER_BRANDING_ID}
|
||||
@@ -1855,6 +1861,21 @@ endif (LL_TESTS)
|
||||
# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py
|
||||
if (WINDOWS)
|
||||
|
||||
IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
|
||||
FOREACH(RUNTIME_LIB ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
add_custom_command(
|
||||
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS
|
||||
-E
|
||||
copy_if_different
|
||||
${RUNTIME_LIB}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Copying ${RUNTIME_LIB} to the runtime folder."
|
||||
)
|
||||
ENDFOREACH(RUNTIME_LIB ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
|
||||
|
||||
get_target_property(BUILT_LLCOMMON llcommon LOCATION)
|
||||
|
||||
set_target_properties(llcommon
|
||||
@@ -1910,7 +1931,7 @@ if (WINDOWS)
|
||||
COMMENT "Copying Quicktime Plugin to the runtime folder."
|
||||
)
|
||||
|
||||
get_target_property(BUILT_FILEPICKER_PLUGIN basic_plugin_filepicker LOCATION)
|
||||
get_target_property(BUILT_FILEPICKER_PLUGIN basic_plugin_filepicker LOCATION)
|
||||
add_custom_command(
|
||||
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@@ -1922,7 +1943,9 @@ if (WINDOWS)
|
||||
COMMENT "Copying filepicker Plugin to the runtime folder."
|
||||
)
|
||||
|
||||
get_target_property(BUILT_WINMM_SHIM_PLUGIN winmm_shim LOCATION)
|
||||
# winmm doesn't build on windows 64
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
get_target_property(BUILT_WINMM_SHIM_PLUGIN winmm_shim LOCATION)
|
||||
add_custom_command(
|
||||
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@@ -1933,6 +1956,8 @@ if (WINDOWS)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
|
||||
COMMENT "Copying winmm.dll to the runtime folder."
|
||||
)
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
|
||||
# Copying the mime_types.xml file to app_settings
|
||||
set(mime_types_source "${CMAKE_SOURCE_DIR}/newview/skins/default/xui/en-us")
|
||||
set(mime_types_dest "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings")
|
||||
|
||||
@@ -210,17 +210,6 @@
|
||||
<integer>100</integer>
|
||||
</map>
|
||||
|
||||
<key>zmm_deffov</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default field of viewer for right click mouse zoom.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1.0</real>
|
||||
</map>
|
||||
<key>zmm_mlfov</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -232,28 +221,6 @@
|
||||
<key>Value</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>zmm_isinml</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>mouselook</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>zmm_rightmousedown</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>insert rude comment here</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>AllowLargeSounds</key>
|
||||
<map>
|
||||
@@ -786,6 +753,17 @@
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LiruMouselookMenu</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls if holding Alt and right clicking in mouselook will bring up a menu</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>LiruNewARCLimit</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -48,6 +48,7 @@ void main()
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
color.a = .0;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @file debugF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform sampler2D depthMap;
|
||||
|
||||
uniform float delta;
|
||||
|
||||
VARYING vec2 tc0;
|
||||
VARYING vec2 tc1;
|
||||
VARYING vec2 tc2;
|
||||
VARYING vec2 tc3;
|
||||
VARYING vec2 tc4;
|
||||
VARYING vec2 tc5;
|
||||
VARYING vec2 tc6;
|
||||
VARYING vec2 tc7;
|
||||
VARYING vec2 tc8;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 depth1 =
|
||||
vec4(texture2D(depthMap, tc0).r,
|
||||
texture2D(depthMap, tc1).r,
|
||||
texture2D(depthMap, tc2).r,
|
||||
texture2D(depthMap, tc3).r);
|
||||
|
||||
vec4 depth2 =
|
||||
vec4(texture2D(depthMap, tc4).r,
|
||||
texture2D(depthMap, tc5).r,
|
||||
texture2D(depthMap, tc6).r,
|
||||
texture2D(depthMap, tc7).r);
|
||||
|
||||
depth1 = min(depth1, depth2);
|
||||
float depth = min(depth1.x, depth1.y);
|
||||
depth = min(depth, depth1.z);
|
||||
depth = min(depth, depth1.w);
|
||||
depth = min(depth, texture2D(depthMap, tc8).r);
|
||||
|
||||
gl_FragDepth = depth;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @file debugF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform sampler2DRect depthMap;
|
||||
|
||||
uniform float delta;
|
||||
|
||||
VARYING vec2 tc0;
|
||||
VARYING vec2 tc1;
|
||||
VARYING vec2 tc2;
|
||||
VARYING vec2 tc3;
|
||||
VARYING vec2 tc4;
|
||||
VARYING vec2 tc5;
|
||||
VARYING vec2 tc6;
|
||||
VARYING vec2 tc7;
|
||||
VARYING vec2 tc8;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 depth1 =
|
||||
vec4(texture2DRect(depthMap, tc0).r,
|
||||
texture2DRect(depthMap, tc1).r,
|
||||
texture2DRect(depthMap, tc2).r,
|
||||
texture2DRect(depthMap, tc3).r);
|
||||
|
||||
vec4 depth2 =
|
||||
vec4(texture2DRect(depthMap, tc4).r,
|
||||
texture2DRect(depthMap, tc5).r,
|
||||
texture2DRect(depthMap, tc6).r,
|
||||
texture2DRect(depthMap, tc7).r);
|
||||
|
||||
depth1 = min(depth1, depth2);
|
||||
float depth = min(depth1.x, depth1.y);
|
||||
depth = min(depth, depth1.z);
|
||||
depth = min(depth, depth1.w);
|
||||
depth = min(depth, texture2DRect(depthMap, tc8).r);
|
||||
|
||||
gl_FragDepth = depth;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @file debugV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
|
||||
uniform vec2 screen_res;
|
||||
|
||||
uniform vec2 delta;
|
||||
|
||||
VARYING vec2 tc0;
|
||||
VARYING vec2 tc1;
|
||||
VARYING vec2 tc2;
|
||||
VARYING vec2 tc3;
|
||||
VARYING vec2 tc4;
|
||||
VARYING vec2 tc5;
|
||||
VARYING vec2 tc6;
|
||||
VARYING vec2 tc7;
|
||||
VARYING vec2 tc8;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(position, 1.0);
|
||||
|
||||
vec2 tc = (position.xy*0.5+0.5)*screen_res;
|
||||
tc0 = tc+vec2(-delta.x,-delta.y);
|
||||
tc1 = tc+vec2(0,-delta.y);
|
||||
tc2 = tc+vec2(delta.x,-delta.y);
|
||||
tc3 = tc+vec2(-delta.x,0);
|
||||
tc4 = tc+vec2(0,0);
|
||||
tc5 = tc+vec2(delta.x,0);
|
||||
tc6 = tc+vec2(-delta.x,delta.y);
|
||||
tc7 = tc+vec2(0,delta.y);
|
||||
tc8 = tc+vec2(delta.x,delta.y);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void fullbright_shiny_lighting()
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 0.0;
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void fullbright_shiny_lighting()
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 0.0;
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void fullbright_shiny_lighting_water()
|
||||
|
||||
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 1.0;
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void fullbright_shiny_lighting_water()
|
||||
|
||||
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 0.0;
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ out vec4 frag_color;
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
vec4 diffuseLookup(vec2 texcoord);
|
||||
/* vec4 diffuseLookup(vec2 texcoord); */
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec4 applyWaterFog(vec4 color);
|
||||
|
||||
@@ -50,7 +50,7 @@ void shiny_lighting()
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 1.0;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ void shiny_lighting()
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 1.0;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void shiny_lighting_water()
|
||||
color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
|
||||
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 1.0;
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ void shiny_lighting_water()
|
||||
color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
|
||||
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
color.a = max(color.a, vertex_color.a);
|
||||
color.a = 1.0;
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,9 @@ void main()
|
||||
mat = modelview_matrix * mat;
|
||||
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
|
||||
|
||||
vertex_color = emissive;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
vertex_color = emissive;
|
||||
|
||||
gl_Position = projection_matrix*vec4(pos, 1.0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -297,6 +297,7 @@ void LLPrefsAscentChat::refreshValues()
|
||||
mOneLineConfButt = gSavedSettings.getBOOL("UseConciseConferenceButtons");
|
||||
mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut");
|
||||
mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions");
|
||||
mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch");
|
||||
mLegacySpeakerNames = gSavedSettings.getBOOL("LiruLegacySpeakerNames");
|
||||
|
||||
//Autoresponse ------------------------------------------------------------------------
|
||||
@@ -535,6 +536,7 @@ void LLPrefsAscentChat::cancel()
|
||||
gSavedSettings.setBOOL("UseConciseConferenceButtons", mOneLineConfButt);
|
||||
gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm);
|
||||
gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions);
|
||||
gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch);
|
||||
gSavedSettings.setBOOL("LiruLegacySpeakerNames", mLegacySpeakerNames);
|
||||
|
||||
//Autoresponse ------------------------------------------------------------------------
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
class LLPrefsAscentChat : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPrefsAscentChat();
|
||||
~LLPrefsAscentChat();
|
||||
LLPrefsAscentChat();
|
||||
~LLPrefsAscentChat();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
|
||||
protected:
|
||||
void onSpellAdd();
|
||||
@@ -56,26 +56,27 @@ protected:
|
||||
void onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value);
|
||||
void onCommitKeywords(LLUICtrl* ctrl);
|
||||
|
||||
//Chat/IM -----------------------------------------------------------------------------
|
||||
BOOL mIMAnnounceIncoming;
|
||||
BOOL mHideTypingNotification;
|
||||
bool mInstantMessagesFriendsOnly;
|
||||
BOOL mShowGroupNameInChatIM;
|
||||
bool mShowDisplayNameChanges;
|
||||
bool mUseTypingBubbles;
|
||||
BOOL mPlayTypingSound;
|
||||
BOOL mHideNotificationsInChat;
|
||||
BOOL mEnableMUPose;
|
||||
BOOL mEnableOOCAutoClose;
|
||||
U32 mLinksForChattingObjects;
|
||||
U32 mTimeFormat;
|
||||
U32 mDateFormat;
|
||||
U32 tempTimeFormat;
|
||||
U32 tempDateFormat;
|
||||
BOOL mSecondsInChatAndIMs;
|
||||
BOOL mSecondsInLog;
|
||||
private:
|
||||
//Chat/IM -----------------------------------------------------------------------------
|
||||
bool mIMAnnounceIncoming;
|
||||
bool mHideTypingNotification;
|
||||
bool mInstantMessagesFriendsOnly;
|
||||
bool mShowGroupNameInChatIM;
|
||||
bool mShowDisplayNameChanges;
|
||||
bool mUseTypingBubbles;
|
||||
bool mPlayTypingSound;
|
||||
bool mHideNotificationsInChat;
|
||||
bool mEnableMUPose;
|
||||
bool mEnableOOCAutoClose;
|
||||
U32 mLinksForChattingObjects;
|
||||
U32 mTimeFormat;
|
||||
U32 mDateFormat;
|
||||
U32 tempTimeFormat;
|
||||
U32 tempDateFormat;
|
||||
bool mSecondsInChatAndIMs;
|
||||
bool mSecondsInLog;
|
||||
|
||||
//Chat UI -----------------------------------------------------------------------------
|
||||
//Chat UI -----------------------------------------------------------------------------
|
||||
bool mWoLfVerticalIMTabs;
|
||||
bool mOtherChatsTornOff;
|
||||
bool mIMAnnounceStealFocus;
|
||||
@@ -87,6 +88,7 @@ protected:
|
||||
bool mOnlyComm;
|
||||
bool mItalicizeActions;
|
||||
bool mLegacySpeakerNames;
|
||||
bool mLegacyLogLaunch;
|
||||
|
||||
//Autoresponse ------------------------------------------------------------------------
|
||||
std::string mIMResponseAnyoneItemID;
|
||||
@@ -94,39 +96,39 @@ protected:
|
||||
std::string mIMResponseMutedItemID;
|
||||
std::string mIMResponseBusyItemID;
|
||||
|
||||
//Spam --------------------------------------------------------------------------------
|
||||
BOOL mEnableAS;
|
||||
BOOL mGlobalQueue;
|
||||
U32 mChatSpamCount;
|
||||
U32 mChatSpamTime;
|
||||
BOOL mBlockDialogSpam;
|
||||
BOOL mBlockAlertSpam;
|
||||
BOOL mBlockFriendSpam;
|
||||
BOOL mBlockGroupNoticeSpam;
|
||||
BOOL mBlockGroupInviteSpam;
|
||||
BOOL mBlockGroupFeeInviteSpam;
|
||||
BOOL mBlockItemOfferSpam;
|
||||
//Spam --------------------------------------------------------------------------------
|
||||
bool mEnableAS;
|
||||
bool mGlobalQueue;
|
||||
U32 mChatSpamCount;
|
||||
U32 mChatSpamTime;
|
||||
bool mBlockDialogSpam;
|
||||
bool mBlockAlertSpam;
|
||||
bool mBlockFriendSpam;
|
||||
bool mBlockGroupNoticeSpam;
|
||||
bool mBlockGroupInviteSpam;
|
||||
bool mBlockGroupFeeInviteSpam;
|
||||
bool mBlockItemOfferSpam;
|
||||
bool mBlockNotMineSpam;
|
||||
bool mBlockNotFriendSpam;
|
||||
BOOL mBlockScriptSpam;
|
||||
BOOL mBlockTeleportSpam;
|
||||
bool mBlockScriptSpam;
|
||||
bool mBlockTeleportSpam;
|
||||
bool mBlockTeleportRequestSpam;
|
||||
BOOL mNotifyOnSpam;
|
||||
BOOL mSoundMulti;
|
||||
U32 mNewLines;
|
||||
U32 mPreloadMulti;
|
||||
bool mNotifyOnSpam;
|
||||
bool mSoundMulti;
|
||||
U32 mNewLines;
|
||||
U32 mPreloadMulti;
|
||||
bool mEnableGestureSounds;
|
||||
|
||||
//Text Options ------------------------------------------------------------------------
|
||||
BOOL mSpellDisplay;
|
||||
BOOL mKeywordsOn;
|
||||
std::string mKeywordsList;
|
||||
BOOL mKeywordsInChat;
|
||||
BOOL mKeywordsInIM;
|
||||
BOOL mKeywordsChangeColor;
|
||||
LLColor4 mKeywordsColor;
|
||||
BOOL mKeywordsPlaySound;
|
||||
LLUUID mKeywordsSound;
|
||||
//Text Options ------------------------------------------------------------------------
|
||||
bool mSpellDisplay;
|
||||
bool mKeywordsOn;
|
||||
std::string mKeywordsList;
|
||||
bool mKeywordsInChat;
|
||||
bool mKeywordsInIM;
|
||||
bool mKeywordsChangeColor;
|
||||
LLColor4 mKeywordsColor;
|
||||
bool mKeywordsPlaySound;
|
||||
LLUUID mKeywordsSound;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
class LLPrefsAscentSys : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPrefsAscentSys();
|
||||
~LLPrefsAscentSys();
|
||||
LLPrefsAscentSys();
|
||||
~LLPrefsAscentSys();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
|
||||
protected:
|
||||
void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
|
||||
@@ -52,61 +52,62 @@ protected:
|
||||
void onCommitComboBox(LLUICtrl* ctrl, const LLSD& value);
|
||||
void onCommitTexturePicker(LLUICtrl* ctrl);
|
||||
|
||||
//General -----------------------------------------------------------------------------
|
||||
BOOL mDoubleClickTeleport;
|
||||
BOOL mResetCameraAfterTP;
|
||||
BOOL mOffsetTPByUserHeight;
|
||||
bool mClearBeaconAfterTeleport;
|
||||
bool mLiruFlyAfterTeleport;
|
||||
bool mLiruContinueFlying;
|
||||
BOOL mPreviewAnimInWorld;
|
||||
BOOL mSaveScriptsAsMono;
|
||||
BOOL mAlwaysRezInGroup;
|
||||
BOOL mBuildAlwaysEnabled;
|
||||
BOOL mAlwaysShowFly;
|
||||
BOOL mDisableMinZoom;
|
||||
BOOL mPowerUser;
|
||||
BOOL mFetchInventoryOnLogin;
|
||||
BOOL mEnableLLWind;
|
||||
BOOL mEnableClouds;
|
||||
BOOL mEnableClassicClouds;
|
||||
BOOL mSpeedRez;
|
||||
U32 mSpeedRezInterval;
|
||||
private:
|
||||
//General -----------------------------------------------------------------------------
|
||||
bool mDoubleClickTeleport;
|
||||
bool mResetCameraAfterTP;
|
||||
bool mOffsetTPByUserHeight;
|
||||
bool mClearBeaconAfterTeleport;
|
||||
bool mLiruFlyAfterTeleport;
|
||||
bool mLiruContinueFlying;
|
||||
bool mPreviewAnimInWorld;
|
||||
bool mSaveScriptsAsMono;
|
||||
bool mAlwaysRezInGroup;
|
||||
bool mBuildAlwaysEnabled;
|
||||
bool mAlwaysShowFly;
|
||||
bool mDisableMinZoom;
|
||||
bool mPowerUser;
|
||||
bool mFetchInventoryOnLogin;
|
||||
bool mEnableLLWind;
|
||||
bool mEnableClouds;
|
||||
bool mEnableClassicClouds;
|
||||
bool mSpeedRez;
|
||||
U32 mSpeedRezInterval;
|
||||
bool mUseWebProfiles;
|
||||
bool mUseWebSearch;
|
||||
|
||||
//Command Line ------------------------------------------------------------------------
|
||||
BOOL mCmdLine;
|
||||
std::string mCmdLinePos;
|
||||
std::string mCmdLineGround;
|
||||
std::string mCmdLineHeight;
|
||||
std::string mCmdLineTeleportHome;
|
||||
std::string mCmdLineRezPlatform;
|
||||
F32 mCmdPlatformSize;
|
||||
std::string mCmdLineCalc;
|
||||
std::string mCmdLineClearChat;
|
||||
std::string mCmdLineDrawDistance;
|
||||
std::string mCmdTeleportToCam;
|
||||
std::string mCmdLineKeyToName;
|
||||
std::string mCmdLineOfferTp;
|
||||
std::string mCmdLineMapTo;
|
||||
BOOL mCmdMapToKeepPos;
|
||||
std::string mCmdLineTP2;
|
||||
std::string mCmdLineAway;
|
||||
//Command Line ------------------------------------------------------------------------
|
||||
bool mCmdLine;
|
||||
std::string mCmdLinePos;
|
||||
std::string mCmdLineGround;
|
||||
std::string mCmdLineHeight;
|
||||
std::string mCmdLineTeleportHome;
|
||||
std::string mCmdLineRezPlatform;
|
||||
F32 mCmdPlatformSize;
|
||||
std::string mCmdLineCalc;
|
||||
std::string mCmdLineClearChat;
|
||||
std::string mCmdLineDrawDistance;
|
||||
std::string mCmdTeleportToCam;
|
||||
std::string mCmdLineKeyToName;
|
||||
std::string mCmdLineOfferTp;
|
||||
std::string mCmdLineMapTo;
|
||||
bool mCmdMapToKeepPos;
|
||||
std::string mCmdLineTP2;
|
||||
std::string mCmdLineAway;
|
||||
std::string mCmdLineURL;
|
||||
|
||||
//Security ----------------------------------------------------------------------------
|
||||
BOOL mBroadcastViewerEffects;
|
||||
BOOL mDisablePointAtAndBeam;
|
||||
BOOL mPrivateLookAt;
|
||||
BOOL mShowLookAt;
|
||||
BOOL mQuietSnapshotsToDisk;
|
||||
BOOL mDetachBridge;
|
||||
BOOL mRevokePermsOnStandUp;
|
||||
BOOL mDisableClickSit;
|
||||
//Security ----------------------------------------------------------------------------
|
||||
bool mBroadcastViewerEffects;
|
||||
bool mDisablePointAtAndBeam;
|
||||
bool mPrivateLookAt;
|
||||
bool mShowLookAt;
|
||||
bool mQuietSnapshotsToDisk;
|
||||
bool mDetachBridge;
|
||||
bool mRevokePermsOnStandUp;
|
||||
bool mDisableClickSit;
|
||||
bool mDisableClickSitOtherOwner;
|
||||
BOOL mDisplayScriptJumps;
|
||||
F32 mNumScriptDiff;
|
||||
bool mDisplayScriptJumps;
|
||||
F32 mNumScriptDiff;
|
||||
|
||||
//Build -------------------------------------------------------------------------------
|
||||
F32 mAlpha;
|
||||
@@ -115,14 +116,14 @@ protected:
|
||||
F32 mGlow;
|
||||
std::string mItem;
|
||||
std::string mMaterial;
|
||||
BOOL mNextCopy;
|
||||
BOOL mNextMod;
|
||||
BOOL mNextTrans;
|
||||
bool mNextCopy;
|
||||
bool mNextMod;
|
||||
bool mNextTrans;
|
||||
std::string mShiny;
|
||||
BOOL mTemporary;
|
||||
bool mTemporary;
|
||||
std::string mTexture;
|
||||
BOOL mPhantom;
|
||||
BOOL mPhysical;
|
||||
bool mPhantom;
|
||||
bool mPhysical;
|
||||
F32 mXsize;
|
||||
F32 mYsize;
|
||||
F32 mZsize;
|
||||
|
||||
@@ -38,24 +38,26 @@
|
||||
class LLPrefsAscentVan : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPrefsAscentVan();
|
||||
~LLPrefsAscentVan();
|
||||
LLPrefsAscentVan();
|
||||
~LLPrefsAscentVan();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
void apply();
|
||||
void cancel();
|
||||
void refresh();
|
||||
void refreshValues();
|
||||
|
||||
protected:
|
||||
void onCommitClientTag(LLUICtrl* ctrl);
|
||||
void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
|
||||
void onCommitTextModified(LLUICtrl* ctrl, const LLSD& value);
|
||||
static void onManualClientUpdate();
|
||||
//Main
|
||||
BOOL mUseAccountSettings;
|
||||
BOOL mShowTPScreen;
|
||||
BOOL mPlayTPSound;
|
||||
BOOL mShowLogScreens;
|
||||
|
||||
private:
|
||||
//Main
|
||||
bool mUseAccountSettings;
|
||||
bool mShowTPScreen;
|
||||
bool mPlayTPSound;
|
||||
bool mShowLogScreens;
|
||||
bool mDisableChatAnimation;
|
||||
bool mAddNotReplace;
|
||||
bool mTurnAround;
|
||||
@@ -64,41 +66,38 @@ protected:
|
||||
bool mUnfocusedFloatersOpaque;
|
||||
bool mCompleteNameProfiles;
|
||||
bool mScriptErrorsStealFocus;
|
||||
//Tags\Colors
|
||||
BOOL mAscentBroadcastTag;
|
||||
std::string mReportClientUUID;
|
||||
U32 mSelectedClient;
|
||||
BOOL mShowSelfClientTag;
|
||||
BOOL mShowSelfClientTagColor;
|
||||
BOOL mShowFriendsTag;
|
||||
BOOL mDisplayClientTagOnNewLine;
|
||||
BOOL mCustomTagOn;
|
||||
std::string mCustomTagLabel;
|
||||
LLColor4 mCustomTagColor;
|
||||
BOOL mShowOthersTag;
|
||||
BOOL mShowOthersTagColor;
|
||||
BOOL mShowIdleTime;
|
||||
BOOL mUseStatusColors;
|
||||
BOOL mUpdateTagsOnLoad;
|
||||
LLColor4 mEffectColor;
|
||||
LLColor4 mFriendColor;
|
||||
LLColor4 mEstateOwnerColor;
|
||||
LLColor4 mLindenColor;
|
||||
LLColor4 mMutedColor;
|
||||
//Tags\Colors
|
||||
bool mAscentBroadcastTag;
|
||||
std::string mReportClientUUID;
|
||||
U32 mSelectedClient;
|
||||
bool mShowSelfClientTag;
|
||||
bool mShowSelfClientTagColor;
|
||||
bool mShowFriendsTag;
|
||||
bool mDisplayClientTagOnNewLine;
|
||||
bool mCustomTagOn;
|
||||
std::string mCustomTagLabel;
|
||||
LLColor4 mCustomTagColor;
|
||||
bool mShowOthersTag;
|
||||
bool mShowOthersTagColor;
|
||||
bool mShowIdleTime;
|
||||
bool mUseStatusColors;
|
||||
bool mUpdateTagsOnLoad;
|
||||
LLColor4 mEffectColor;
|
||||
LLColor4 mFriendColor;
|
||||
LLColor4 mEstateOwnerColor;
|
||||
LLColor4 mLindenColor;
|
||||
LLColor4 mMutedColor;
|
||||
LLColor4 mMapAvatarColor;
|
||||
LLColor4 mCustomColor;
|
||||
bool mColorFriendChat;
|
||||
bool mColorEOChat;
|
||||
bool mColorLindenChat;
|
||||
bool mColorMutedChat;
|
||||
// bool mColorCustomChat;
|
||||
|
||||
F32 mAvatarXModifier;
|
||||
F32 mAvatarYModifier;
|
||||
F32 mAvatarZModifier;
|
||||
|
||||
private:
|
||||
// bool mColorCustomChat;
|
||||
|
||||
F32 mAvatarXModifier;
|
||||
F32 mAvatarYModifier;
|
||||
F32 mAvatarZModifier;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,14 @@ RequestExecutionLevel admin ; on Vista we must be admin because we write to Prog
|
||||
|
||||
%%GRID_VARS%%
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Alows us to determine if we're running on 64 bit OS; ${If} macros
|
||||
!include "x64.nsh"
|
||||
!include "LogicLib.nsh"
|
||||
|
||||
;; are 64 bit binaries packaged in this installer
|
||||
%%WIN64_BIN_BUILD%%
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; - language files - one for each language (or flavor thereof)
|
||||
;; (these files are in the same place as the nsi template but the python script generates a new nsi file in the
|
||||
@@ -63,7 +71,7 @@ LangString LanguageCode ${LANG_DUTCH} "nl"
|
||||
LangString LanguageCode ${LANG_PORTUGUESEBR} "pt"
|
||||
LangString LanguageCode ${LANG_SIMPCHINESE} "zh"
|
||||
|
||||
Name ${VIEWERNAME}
|
||||
Name "${VIEWERNAME}"
|
||||
|
||||
SubCaption 0 $(LicenseSubTitleSetup) ; override "license agreement" text
|
||||
|
||||
@@ -71,7 +79,7 @@ BrandingText "Prepare to Implode!" ; bottom of window text
|
||||
Icon %%SOURCE%%\installers\windows\install_icon_singularity.ico
|
||||
UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon_singularity.ico
|
||||
WindowIcon off ; show our icon in left corner
|
||||
BGGradient 9090b0 000000 notext
|
||||
# BGGradient 9090b0 000000 notext
|
||||
CRCCheck on ; make sure CRC is OK
|
||||
#InstProgressFlags smooth colored ; new colored smooth look
|
||||
InstProgressFlags
|
||||
@@ -80,7 +88,7 @@ ShowInstDetails show ; no details, no "show" button
|
||||
SetOverwrite on ; stomp files by default
|
||||
AutoCloseWindow true ; after all files install, close window
|
||||
|
||||
InstallDir "$PROGRAMFILES\${INSTNAME}"
|
||||
InstallDir "%%INSTALLDIR%%"
|
||||
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
|
||||
DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
|
||||
|
||||
@@ -664,6 +672,12 @@ FunctionEnd
|
||||
;; entry to the language ID selector below
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
Function .onInit
|
||||
!ifdef WIN64_BIN_BUILD
|
||||
${IfNot} ${RunningX64}
|
||||
MessageBox MB_OK|MB_ICONSTOP "This version requires 64 bit operating sytem."
|
||||
Quit
|
||||
${EndIf}
|
||||
!endif
|
||||
Push $0
|
||||
${GetParameters} $COMMANDLINE ; get our command line
|
||||
${GetOptions} $COMMANDLINE "/LANGID=" $0 ; /LANGID=1033 implies US English
|
||||
|
||||
@@ -2022,6 +2022,14 @@ LLVector3 LLAgentCamera::getCameraOffsetInitial()
|
||||
return convert_from_llsd<LLVector3>(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, "");
|
||||
}
|
||||
|
||||
// Adds change to vector CachedControl, vec, at idx
|
||||
template <typename T, typename Vec>
|
||||
void change_vec(const T& change, LLCachedControl<Vec>& vec, const U32& idx = VZ)
|
||||
{
|
||||
Vec changed(vec);
|
||||
changed[idx] += change;
|
||||
vec = changed;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// handleScrollWheel()
|
||||
@@ -2057,6 +2065,24 @@ void LLAgentCamera::handleScrollWheel(S32 clicks)
|
||||
}
|
||||
else if (mFocusOnAvatar && (mCameraMode == CAMERA_MODE_THIRD_PERSON))
|
||||
{
|
||||
if (MASK mask = gKeyboard->currentMask(true)) // Singu Note: Conveniently set view offsets while modifier keys are held during scroll
|
||||
{
|
||||
if (mask & MASK_CONTROL|MASK_SHIFT)
|
||||
{
|
||||
const F32 change(static_cast<F32>(clicks) * 0.1f);
|
||||
if (mask & MASK_SHIFT)
|
||||
{
|
||||
static LLCachedControl<LLVector3d> focus_offset("FocusOffsetRearView");
|
||||
change_vec(change, focus_offset);
|
||||
}
|
||||
if (mask & MASK_CONTROL)
|
||||
{
|
||||
static LLCachedControl<LLVector3> camera_offset("CameraOffsetRearView");
|
||||
change_vec(change, camera_offset);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
F32 camera_offset_initial_mag = getCameraOffsetInitial().magVec();
|
||||
|
||||
static const LLCachedControl<F32> camera_offset_scale("CameraOffsetScale");
|
||||
|
||||
@@ -4332,9 +4332,10 @@ public:
|
||||
<< llendl;
|
||||
//dec_busy_count();
|
||||
gInventory.removeObserver(this);
|
||||
doOnIdleOneTime(mCallable);
|
||||
|
||||
// lets notify observers that loading is finished.
|
||||
gAgentWearables.notifyLoadingFinished();
|
||||
//gAgentWearables.notifyLoadingFinished();
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1509,7 +1509,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
|
||||
|
||||
stop_glerror();
|
||||
|
||||
LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette",
|
||||
LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv(LLViewerShaderMgr::AVATAR_MATRIX,
|
||||
maxJoints,
|
||||
FALSE,
|
||||
(GLfloat*) mat[0].mMatrix);
|
||||
|
||||
@@ -570,6 +570,7 @@ void LLDrawPoolBump::renderFullbrightShiny()
|
||||
{
|
||||
LLGLEnable blend_enable(GL_BLEND);
|
||||
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
if (mVertexShaderLevel > 1)
|
||||
{
|
||||
LLRenderPass::pushBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
|
||||
@@ -578,6 +579,7 @@ void LLDrawPoolBump::renderFullbrightShiny()
|
||||
{
|
||||
LLRenderPass::renderTexture(LLRenderPass::PASS_FULLBRIGHT_SHINY, sVertexMask);
|
||||
}
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,7 +898,9 @@ void LLDrawPoolBump::renderPostDeferred(S32 pass)
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
gGL.setColorMask(true, true);
|
||||
renderFullbrightShiny();
|
||||
gGL.setColorMask(true, false);
|
||||
break;
|
||||
case 1:
|
||||
renderBump(LLRenderPass::PASS_POST_BUMP);
|
||||
@@ -1370,9 +1374,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
|
||||
LLGLDisable blend(GL_BLEND);
|
||||
gGL.setColorMask(TRUE, TRUE);
|
||||
gNormalMapGenProgram.bind();
|
||||
gNormalMapGenProgram.uniform1f("norm_scale", gSavedSettings.getF32("RenderNormalMapScale"));
|
||||
gNormalMapGenProgram.uniform1f("stepX", 1.f/bump->getWidth());
|
||||
gNormalMapGenProgram.uniform1f("stepY", 1.f/bump->getHeight());
|
||||
|
||||
static LLStaticHashedString sNormScale("norm_scale");
|
||||
static LLStaticHashedString sStepX("stepX");
|
||||
static LLStaticHashedString sStepY("stepY");
|
||||
|
||||
gNormalMapGenProgram.uniform1f(sNormScale, gSavedSettings.getF32("RenderNormalMapScale"));
|
||||
gNormalMapGenProgram.uniform1f(sStepX, 1.f/bump->getWidth());
|
||||
gNormalMapGenProgram.uniform1f(sStepX, 1.f/bump->getHeight());
|
||||
|
||||
LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(),
|
||||
(F32) bump->getHeight()/gPipeline.mScreen.getHeight());
|
||||
|
||||
@@ -362,8 +362,8 @@ void LLDrawPoolTerrain::renderFullShader()
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(shader);
|
||||
|
||||
shader->uniform4fv("object_plane_s", 1, tp0.mV);
|
||||
shader->uniform4fv("object_plane_t", 1, tp1.mV);
|
||||
shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
|
||||
shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
|
||||
|
||||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadIdentity();
|
||||
@@ -873,8 +873,8 @@ void LLDrawPoolTerrain::renderSimple()
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
sShader->uniform4fv("object_plane_s", 1, tp0.mV);
|
||||
sShader->uniform4fv("object_plane_t", 1, tp1.mV);
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -449,8 +449,8 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
|
||||
}
|
||||
else
|
||||
{
|
||||
shader->uniform4fv("object_plane_s", 1, tp0);
|
||||
shader->uniform4fv("object_plane_t", 1, tp1);
|
||||
shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0);
|
||||
shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1);
|
||||
}
|
||||
|
||||
gGL.diffuseColor3f(1.f, 1.f, 1.f);
|
||||
@@ -624,12 +624,12 @@ void LLDrawPoolWater::shade()
|
||||
mWaterNormp->setFilteringOption(LLTexUnit::TFO_POINT);
|
||||
}
|
||||
|
||||
S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
|
||||
S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX);
|
||||
|
||||
if (screentex > -1)
|
||||
{
|
||||
shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_FOGDENSITY,
|
||||
shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
|
||||
shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY,
|
||||
param_mgr->getFogDensity());
|
||||
gPipeline.mWaterDis.bindTexture(0, screentex);
|
||||
}
|
||||
@@ -641,7 +641,7 @@ void LLDrawPoolWater::shade()
|
||||
if (mVertexShaderLevel == 1)
|
||||
{
|
||||
sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue;
|
||||
shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
|
||||
shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
|
||||
}
|
||||
|
||||
F32 screenRes[] =
|
||||
@@ -649,10 +649,10 @@ void LLDrawPoolWater::shade()
|
||||
1.f/gGLViewport[2],
|
||||
1.f/gGLViewport[3]
|
||||
};
|
||||
shader->uniform2fv("screenRes", 1, screenRes);
|
||||
shader->uniform2fv(LLShaderMgr::DEFERRED_SCREEN_RES, 1, screenRes);
|
||||
stop_glerror();
|
||||
|
||||
S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP);
|
||||
stop_glerror();
|
||||
|
||||
light_dir.normVec();
|
||||
@@ -661,26 +661,26 @@ void LLDrawPoolWater::shade()
|
||||
light_diffuse *= 6.f;
|
||||
|
||||
//shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix);
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_WATERHEIGHT, eyedepth);
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_TIME, sTime);
|
||||
shader->uniform3fv(LLViewerShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV);
|
||||
shader->uniform3fv(LLViewerShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV);
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_SPECULAR_EXP, light_exp);
|
||||
shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV);
|
||||
shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV);
|
||||
shader->uniform3fv(LLViewerShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV);
|
||||
shader->uniform1f(LLShaderMgr::WATER_WATERHEIGHT, eyedepth);
|
||||
shader->uniform1f(LLShaderMgr::WATER_TIME, sTime);
|
||||
shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV);
|
||||
shader->uniform3fv(LLShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV);
|
||||
shader->uniform1f(LLShaderMgr::WATER_SPECULAR_EXP, light_exp);
|
||||
shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV);
|
||||
shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV);
|
||||
shader->uniform3fv(LLShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV);
|
||||
|
||||
shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV);
|
||||
shader->uniform1f("fresnelScale", param_mgr->getFresnelScale());
|
||||
shader->uniform1f("fresnelOffset", param_mgr->getFresnelOffset());
|
||||
shader->uniform1f("blurMultiplier", param_mgr->getBlurMultiplier());
|
||||
shader->uniform3fv(LLShaderMgr::WATER_NORM_SCALE, 1, param_mgr->getNormalScale().mV);
|
||||
shader->uniform1f(LLShaderMgr::WATER_FRESNEL_SCALE, param_mgr->getFresnelScale());
|
||||
shader->uniform1f(LLShaderMgr::WATER_FRESNEL_OFFSET, param_mgr->getFresnelOffset());
|
||||
shader->uniform1f(LLShaderMgr::WATER_BLUR_MULTIPLIER, param_mgr->getBlurMultiplier());
|
||||
|
||||
F32 sunAngle = llmax(0.f, light_dir.mV[2]);
|
||||
F32 scaledAngle = 1.f - sunAngle;
|
||||
|
||||
shader->uniform1f("sunAngle", sunAngle);
|
||||
shader->uniform1f("scaledAngle", scaledAngle);
|
||||
shader->uniform1f("sunAngle2", 0.1f + 0.2f*sunAngle);
|
||||
shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE, sunAngle);
|
||||
shader->uniform1f(LLShaderMgr::WATER_SCALED_ANGLE, scaledAngle);
|
||||
shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE2, 0.1f + 0.2f*sunAngle);
|
||||
|
||||
LLColor4 water_color;
|
||||
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
|
||||
@@ -688,12 +688,12 @@ void LLDrawPoolWater::shade()
|
||||
if (LLViewerCamera::getInstance()->cameraUnderWater())
|
||||
{
|
||||
water_color.setVec(1.f, 1.f, 1.f, 0.4f);
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow());
|
||||
shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow());
|
||||
}
|
||||
else
|
||||
{
|
||||
water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot));
|
||||
shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove());
|
||||
shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove());
|
||||
}
|
||||
|
||||
if (water_color.mV[3] > 0.9f)
|
||||
@@ -739,12 +739,12 @@ void LLDrawPoolWater::shade()
|
||||
}
|
||||
}
|
||||
|
||||
shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
shader->disableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
|
||||
shader->disableTexture(LLViewerShaderMgr::BUMP_MAP);
|
||||
shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
shader->disableTexture(LLViewerShaderMgr::WATER_REFTEX);
|
||||
shader->disableTexture(LLViewerShaderMgr::WATER_SCREENDEPTH);
|
||||
shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
shader->disableTexture(LLShaderMgr::WATER_SCREENTEX);
|
||||
shader->disableTexture(LLShaderMgr::BUMP_MAP);
|
||||
shader->disableTexture(LLShaderMgr::DIFFUSE_MAP);
|
||||
shader->disableTexture(LLShaderMgr::WATER_REFTEX);
|
||||
shader->disableTexture(LLShaderMgr::WATER_SCREENDEPTH);
|
||||
|
||||
if (deferred_render)
|
||||
{
|
||||
|
||||
@@ -161,7 +161,8 @@ void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) cons
|
||||
gGL.translatef(0.f,-camHeightLocal, 0.f);
|
||||
|
||||
// Draw WL Sky
|
||||
shader->uniform3f("camPosLocal", 0.f, camHeightLocal, 0.f);
|
||||
static LLStaticHashedString sCamPosLocal("camPosLocal");
|
||||
shader->uniform3f(sCamPosLocal, 0.f, camHeightLocal, 0.f);
|
||||
|
||||
gSky.mVOWLSkyp->drawDome();
|
||||
|
||||
@@ -219,7 +220,8 @@ void LLDrawPoolWLSky::renderStars(void) const
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
{
|
||||
star_shader->uniform1f("custom_alpha", star_alpha.mV[3]);
|
||||
static LLStaticHashedString sCustomAlpha("custom_alpha");
|
||||
star_shader->uniform1f(sCustomAlpha, star_alpha.mV[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -294,7 +296,8 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
{
|
||||
// Okay, so the moon isn't a star, but it's close enough.
|
||||
star_shader->uniform1f("custom_alpha", color.mV[VW]);
|
||||
static LLStaticHashedString sCustomAlpha("custom_alpha");
|
||||
star_shader->uniform1f(sCustomAlpha, color.mV[VW]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
|
||||
llassert(mFullHeight <= 512);
|
||||
llassert(mFullWidth <= 512);
|
||||
|
||||
if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete())
|
||||
if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI)
|
||||
{ //using offscreen render target, just use the bottom left corner
|
||||
mOrigin.set(0, 0);
|
||||
}
|
||||
@@ -218,13 +218,12 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if 0 //THIS CAUSES MAINT-1092
|
||||
bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete();
|
||||
bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI;
|
||||
|
||||
if (use_fbo)
|
||||
{
|
||||
gPipeline.mWaterDis.bindTarget();
|
||||
}
|
||||
#endif
|
||||
|
||||
LLGLSLShader::bindNoShader();
|
||||
LLVertexBuffer::unbind();
|
||||
@@ -259,12 +258,10 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
|
||||
}
|
||||
}
|
||||
|
||||
#if 0 //THIS CAUSES MAINT-1092
|
||||
if (use_fbo)
|
||||
{
|
||||
gPipeline.mWaterDis.flush();
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
|
||||
#define LL_MAX_INDICES_COUNT 1000000
|
||||
|
||||
static LLStaticHashedString sTextureIndexIn("texture_index_in");
|
||||
static LLStaticHashedString sColorIn("color_in");
|
||||
|
||||
BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE
|
||||
|
||||
#define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2])
|
||||
@@ -1186,6 +1189,21 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
}
|
||||
|
||||
|
||||
// <FS:ND> The volume face vf can have more indices/vertices than this face. All striders below are aquired with a size of this face, but then written with num_verices/num_indices values,
|
||||
// thus overflowing the buffer when vf holds more data.
|
||||
// We can either clamp num_* down like here, or aquire all striders not using the face size, but the size if vf (that is swapping out mGeomCount with num_vertices and mIndicesCout with num_indices
|
||||
// in all calls to nVertbuffer->get*Strider(...). Final solution is to just return FALSE and be done with it.
|
||||
//
|
||||
// The correct poison of choice is debatable, either copying not all data of vf (clamping) or writing more data than this face claims to have (aquiring bigger striders). Returning will not display this face at all.
|
||||
//
|
||||
// clamping it is for now.
|
||||
|
||||
num_vertices = llclamp( num_vertices, (S32)0, (S32)mGeomCount );
|
||||
num_indices = llclamp( num_indices, (S32)0, (S32)mIndicesCount );
|
||||
|
||||
// </FS:ND>
|
||||
|
||||
|
||||
//don't use map range (generates many redundant unmap calls)
|
||||
bool map_range = false; //gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange;
|
||||
|
||||
@@ -1414,7 +1432,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
vp[2] = 0;
|
||||
vp[3] = 0;
|
||||
|
||||
gTransformPositionProgram.uniform1i("texture_index_in", val);
|
||||
gTransformPositionProgram.uniform1i(sTextureIndexIn, val);
|
||||
glBeginTransformFeedback(GL_POINTS);
|
||||
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
|
||||
|
||||
@@ -1432,7 +1450,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
|
||||
S32 val = *((S32*) color.mV);
|
||||
|
||||
gTransformColorProgram.uniform1i("color_in", val);
|
||||
gTransformColorProgram.uniform1i(sColorIn, val);
|
||||
glBeginTransformFeedback(GL_POINTS);
|
||||
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
|
||||
push_for_transform(buff, vf.mNumVertices, mGeomCount);
|
||||
@@ -1453,7 +1471,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
(glow << 16) |
|
||||
(glow << 24);
|
||||
|
||||
gTransformColorProgram.uniform1i("color_in", glow32);
|
||||
gTransformColorProgram.uniform1i(sColorIn, glow32);
|
||||
glBeginTransformFeedback(GL_POINTS);
|
||||
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
|
||||
push_for_transform(buff, vf.mNumVertices, mGeomCount);
|
||||
@@ -1641,7 +1659,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
if (!do_xform)
|
||||
{
|
||||
LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
|
||||
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
|
||||
|
||||
// <FS:ND> Don't round up, or there's high risk to write past buffer
|
||||
|
||||
// S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
|
||||
S32 tc_size = (num_vertices*2*sizeof(F32));
|
||||
|
||||
// </FS:ND>
|
||||
|
||||
LLVector4a::memcpyNonAliased16((F32*) tex_coords0.get(), (F32*) vf.mTexCoords, tc_size);
|
||||
}
|
||||
else
|
||||
@@ -1860,15 +1885,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
|
||||
LLVector4a texIdx;
|
||||
|
||||
U8 index = mTextureIndex < 255 ? mTextureIndex : 0;
|
||||
S32 index = mTextureIndex < 255 ? mTextureIndex : 0;
|
||||
|
||||
F32 val = 0.f;
|
||||
U8* vp = (U8*) &val;
|
||||
vp[0] = index;
|
||||
vp[1] = 0;
|
||||
vp[2] = 0;
|
||||
vp[3] = 0;
|
||||
|
||||
S32* vp = (S32*) &val;
|
||||
*vp = index;
|
||||
|
||||
llassert(index <= LLGLSLShader::sIndexedTextureChannels-1);
|
||||
|
||||
LLVector4Logical mask;
|
||||
|
||||
@@ -136,6 +136,9 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
|
||||
// Version string
|
||||
std::string version = std::string(LLAppViewer::instance()->getSecondLifeTitle()
|
||||
#if defined(_WIN64) || defined(__x86_64__)
|
||||
+ " (64 bit)"
|
||||
#endif
|
||||
+ llformat(" %d.%d.%d (%d) %s %s (%s)\n",
|
||||
gVersionMajor, gVersionMinor, gVersionPatch, LL_VIEWER_BUILD,
|
||||
__DATE__, __TIME__,
|
||||
|
||||
@@ -189,7 +189,17 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
|
||||
using namespace boost::gregorian;
|
||||
int year, month, day;
|
||||
sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d",&month,&day,&year);
|
||||
mAge = (day_clock::local_day() - date(year, month, day)).days();
|
||||
try
|
||||
{
|
||||
mAge = (day_clock::local_day() - date(year, month, day)).days();
|
||||
}
|
||||
catch(const std::exception&)
|
||||
{
|
||||
llwarns << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << pAvatarData->born_on << "\". Requesting properties again." << llendl;
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(mID, this);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(mID);
|
||||
return;
|
||||
}
|
||||
if (!mStats[STAT_TYPE_AGE] && mAge >= 0) //Only announce age once per entry.
|
||||
{
|
||||
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
|
||||
|
||||
@@ -89,7 +89,6 @@ LLFloaterInspect::~LLFloaterInspect(void)
|
||||
{
|
||||
gFloaterTools->setFocus(TRUE);
|
||||
}
|
||||
//sInstance = NULL;
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -199,15 +198,6 @@ LLUUID LLFloaterInspect::getSelectedUUID()
|
||||
return LLUUID::null;
|
||||
}
|
||||
|
||||
void LLFloaterInspect::onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr)
|
||||
{
|
||||
if (FloaterPtr)
|
||||
{
|
||||
LLFloaterInspect* floater = (LLFloaterInspect*)FloaterPtr;
|
||||
floater->dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterInspect::refresh()
|
||||
{
|
||||
LLUUID creator_id;
|
||||
@@ -234,15 +224,14 @@ void LLFloaterInspect::refresh()
|
||||
{
|
||||
LLSelectNode* obj = *iter;
|
||||
LLSD row;
|
||||
std::string owner_name, creator_name, time, last_owner_name;
|
||||
std::string owner_name, creator_name, last_owner_name;
|
||||
|
||||
if (obj->mCreationDate == 0)
|
||||
{ // Don't have valid information from the server, so skip this one
|
||||
continue;
|
||||
}
|
||||
|
||||
time_t timestamp = (time_t) (obj->mCreationDate/1000000);
|
||||
timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), time);
|
||||
// Singu Note: Diverge from LL and handle datetime column in a sortable manner later on
|
||||
|
||||
const LLUUID& idOwner = obj->mPermissions->getOwner();
|
||||
const LLUUID& idCreator = obj->mPermissions->getCreator();
|
||||
@@ -266,7 +255,7 @@ void LLFloaterInspect::refresh()
|
||||
else
|
||||
{
|
||||
owner_name = LLTrans::getString("RetrievingData");
|
||||
LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this));
|
||||
LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::dirty, this));
|
||||
}
|
||||
|
||||
if (LLAvatarNameCache::get(idCreator, &av_name))
|
||||
@@ -283,7 +272,7 @@ void LLFloaterInspect::refresh()
|
||||
else
|
||||
{
|
||||
creator_name = LLTrans::getString("RetrievingData");
|
||||
LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this));
|
||||
LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::dirty, this));
|
||||
}
|
||||
|
||||
// <edit>
|
||||
@@ -300,7 +289,7 @@ void LLFloaterInspect::refresh()
|
||||
else
|
||||
{
|
||||
last_owner_name = LLTrans::getString("RetrievingData");
|
||||
LLAvatarNameCache::get(idLastOwner, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this));
|
||||
LLAvatarNameCache::get(idLastOwner, boost::bind(&LLFloaterInspect::dirty, this));
|
||||
}
|
||||
// </edit>
|
||||
|
||||
@@ -363,8 +352,10 @@ void LLFloaterInspect::refresh()
|
||||
row["columns"][7]["value"] = llformat("%d",total_inv);
|
||||
// </edit>
|
||||
row["columns"][8]["column"] = "creation_date";
|
||||
row["columns"][8]["type"] = "text";
|
||||
row["columns"][8]["value"] = time;
|
||||
row["columns"][8]["type"] = "date";
|
||||
row["columns"][8]["value"] = LLDate(obj->mCreationDate/1000000);
|
||||
static const LLCachedControl<std::string> format("TimestampFormat");
|
||||
row["columns"][8]["format"] = format;
|
||||
mObjectList->addElement(row, ADD_TOP);
|
||||
}
|
||||
if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)
|
||||
|
||||
@@ -63,8 +63,6 @@ public:
|
||||
void onClickOwnerProfile();
|
||||
void onSelectObject();
|
||||
|
||||
static void onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr);
|
||||
|
||||
LLScrollListCtrl* mObjectList;
|
||||
protected:
|
||||
// protected members
|
||||
@@ -77,8 +75,6 @@ protected:
|
||||
private:
|
||||
LLFloaterInspect();
|
||||
virtual ~LLFloaterInspect(void);
|
||||
// static data
|
||||
// static LLFloaterInspect* sInstance;
|
||||
|
||||
LLSafeHandle<LLObjectSelection> mObjectSelection;
|
||||
// <edit>
|
||||
|
||||
@@ -397,10 +397,9 @@ void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjec
|
||||
}
|
||||
|
||||
LLScrollListItem *scrollListItem = mObjectsScrollList->addElement(rowParams);
|
||||
|
||||
if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName())
|
||||
{
|
||||
mMissingNameObjectsScrollListItems.insert(std::make_pair<std::string, LLScrollListItem *>(pObjectPtr->getUUID().asString(), scrollListItem));
|
||||
mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem));
|
||||
pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ void LLFloaterTools::refresh()
|
||||
{
|
||||
F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
|
||||
LLStringUtil::format_map_t prim_equiv_args;
|
||||
prim_equiv_args["SEL_WEIGHT"] = llformat("%.1d", (S32)link_cost);
|
||||
prim_equiv_args["SEL_WEIGHT"] = llformat("%.0f", link_cost);
|
||||
selection_args["PE_STRING"] = getString("status_selectprimequiv", prim_equiv_args);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1696,7 +1696,8 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
|
||||
gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane);
|
||||
|
||||
gClipProgram.uniform4fv("clip_plane", 1, plane.v);
|
||||
static LLStaticHashedString sClipPlane("clip_plane");
|
||||
gClipProgram.uniform4fv(sClipPlane, 1, plane.v);
|
||||
|
||||
BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
|
||||
#if ENABLE_CLASSIC_CLOUDS
|
||||
|
||||
@@ -1414,7 +1414,10 @@ void LLMeshUploadThread::preStart()
|
||||
|
||||
AIMeshUpload::AIMeshUpload(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, std::string const& upload_url, bool do_upload,
|
||||
LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer) :
|
||||
mMeshUpload(new AIStateMachineThread<LLMeshUploadThread>), mWholeModelUploadURL(upload_url)
|
||||
#ifdef CWDEBUG
|
||||
AIStateMachine(false),
|
||||
#endif
|
||||
mMeshUpload(new AIStateMachineThread<LLMeshUploadThread>(CWD_ONLY(false))), mWholeModelUploadURL(upload_url)
|
||||
{
|
||||
mMeshUpload->thread_impl().init(data, scale, upload_textures, upload_skin, upload_joints, do_upload, fee_observer, upload_observer);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
|
||||
// llview
|
||||
virtual void draw();
|
||||
virtual bool hasAccelerators() const { return true; }
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual void setEnabled( BOOL enabled );
|
||||
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
|
||||
@@ -128,6 +128,8 @@ public:
|
||||
static BOOL enableSelectAllMenu(void* userdata);
|
||||
static BOOL enableDeselectMenu(void* userdata);
|
||||
|
||||
virtual bool hasAccelerators() const { return true; }
|
||||
|
||||
private:
|
||||
static bool onHelpWebDialog(const LLSD& notification, const LLSD& response);
|
||||
static void onBtnHelp(void* userdata);
|
||||
|
||||
@@ -214,7 +214,6 @@ LLSelectMgr::LLSelectMgr()
|
||||
|
||||
mGridMode = GRID_MODE_WORLD;
|
||||
gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD);
|
||||
mGridValid = FALSE;
|
||||
|
||||
mSelectedObjects = new LLObjectSelection();
|
||||
mHoverObjects = new LLObjectSelection();
|
||||
@@ -1202,7 +1201,6 @@ void LLSelectMgr::setGridMode(EGridMode mode)
|
||||
mGridMode = mode;
|
||||
gSavedSettings.setS32("GridMode", mode);
|
||||
updateSelectionCenter();
|
||||
mGridValid = FALSE;
|
||||
}
|
||||
|
||||
void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale)
|
||||
@@ -1303,7 +1301,6 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
|
||||
origin = mGridOrigin;
|
||||
rotation = mGridRotation;
|
||||
scale = mGridScale;
|
||||
mGridValid = TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -3410,13 +3407,13 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
|
||||
case 0:
|
||||
{
|
||||
// TODO: Make sure you have delete permissions on all of them.
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
// attempt to derez into the trash.
|
||||
LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id);
|
||||
LLDeRezInfo info(DRD_TRASH, trash_id);
|
||||
LLSelectMgr::getInstance()->sendListToRegions("DeRezObject",
|
||||
packDeRezHeader,
|
||||
packObjectLocalID,
|
||||
(void*)info,
|
||||
(void*) &info,
|
||||
SEND_ONLY_ROOTS);
|
||||
// VEFFECT: Delete Object - one effect for all deletes
|
||||
if(!gSavedSettings.getBOOL("DisablePointAtAndBeam"))
|
||||
@@ -4164,13 +4161,15 @@ void LLSelectMgr::deselectAllIfTooFar()
|
||||
|
||||
void LLSelectMgr::selectionSetObjectName(const std::string& name)
|
||||
{
|
||||
std::string name_copy(name);
|
||||
|
||||
// we only work correctly if 1 object is selected.
|
||||
if(mSelectedObjects->getRootObjectCount() == 1)
|
||||
{
|
||||
sendListToRegions("ObjectName",
|
||||
packAgentAndSessionID,
|
||||
packObjectName,
|
||||
(void*)(new std::string(name)),
|
||||
(void*)(&name_copy),
|
||||
SEND_ONLY_ROOTS);
|
||||
}
|
||||
else if(mSelectedObjects->getObjectCount() == 1)
|
||||
@@ -4178,20 +4177,22 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
|
||||
sendListToRegions("ObjectName",
|
||||
packAgentAndSessionID,
|
||||
packObjectName,
|
||||
(void*)(new std::string(name)),
|
||||
(void*)(&name_copy),
|
||||
SEND_INDIVIDUALS);
|
||||
}
|
||||
}
|
||||
|
||||
void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
|
||||
{
|
||||
std::string desc_copy(desc);
|
||||
|
||||
// we only work correctly if 1 object is selected.
|
||||
if(mSelectedObjects->getRootObjectCount() == 1)
|
||||
{
|
||||
sendListToRegions("ObjectDescription",
|
||||
packAgentAndSessionID,
|
||||
packObjectDescription,
|
||||
(void*)(new std::string(desc)),
|
||||
(void*)(&desc_copy),
|
||||
SEND_ONLY_ROOTS);
|
||||
}
|
||||
else if(mSelectedObjects->getObjectCount() == 1)
|
||||
@@ -4199,7 +4200,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
|
||||
sendListToRegions("ObjectDescription",
|
||||
packAgentAndSessionID,
|
||||
packObjectDescription,
|
||||
(void*)(new std::string(desc)),
|
||||
(void*)(&desc_copy),
|
||||
SEND_INDIVIDUALS);
|
||||
}
|
||||
}
|
||||
@@ -4726,7 +4727,6 @@ void LLSelectMgr::packObjectName(LLSelectNode* node, void* user_data)
|
||||
gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID());
|
||||
gMessageSystem->addStringFast(_PREHASH_Name, *name);
|
||||
}
|
||||
delete name;
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -758,7 +758,6 @@ private:
|
||||
LLVector3 mGridOrigin;
|
||||
LLVector3 mGridScale;
|
||||
EGridMode mGridMode;
|
||||
BOOL mGridValid;
|
||||
|
||||
|
||||
BOOL mTEMode; // render te
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user