Bit of cleanup

More cleanup and updates to llcommon
Removed legacy code and files
This commit is contained in:
Drake Arconis
2012-08-02 23:19:07 -04:00
parent af2a49afa7
commit dc5bfc1c41
18 changed files with 179 additions and 428 deletions

View File

@@ -148,7 +148,7 @@ const char *LLAssetType::lookup(LLAssetType::EType asset_type)
}
// static
LLAssetType::EType LLAssetType::lookup( const char* name )
LLAssetType::EType LLAssetType::lookup(const char* name)
{
return lookup(ll_safe_string(name));
}
@@ -186,7 +186,7 @@ const char *LLAssetType::lookupHumanReadable(LLAssetType::EType asset_type)
}
// static
LLAssetType::EType LLAssetType::lookupHumanReadable( const char* name )
LLAssetType::EType LLAssetType::lookupHumanReadable(const char* name)
{
return lookupHumanReadable(ll_safe_string(name));
}
@@ -208,12 +208,9 @@ LLAssetType::EType LLAssetType::lookupHumanReadable(const std::string& readable_
return AT_NONE;
}
//NOTE: LLAssetType::lookupDragAndDropType & LLAssetType::generateDescriptionFor moved to newview/llviewerassettype.h
// static
bool LLAssetType::lookupCanLink(EType asset_type)
{
//Check that enabling all these other types as linkable doesn't break things.
const LLAssetDictionary *dict = LLAssetDictionary::getInstance();
const AssetEntry *entry = dict->lookup(asset_type);
if (entry)
@@ -221,9 +218,6 @@ bool LLAssetType::lookupCanLink(EType asset_type)
return entry->mCanLink;
}
return false;
/*return (asset_type == AT_CLOTHING || asset_type == AT_OBJECT || asset_type == AT_CATEGORY ||
asset_type == AT_BODYPART || asset_type == AT_GESTURE);*/
}
// static
@@ -268,4 +262,3 @@ bool LLAssetType::lookupIsAssetIDKnowable(EType asset_type)
}
return false;
}

View File

@@ -35,7 +35,7 @@
#include <boost/shared_ptr.hpp>
#include "llerror.h"
#include "lltypeinfolookup.h"
#include "llstl.h"
namespace LLInitParam
{
@@ -212,14 +212,6 @@ namespace LLInitParam
public:
struct CompareTypeID
{
bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
{
return lhs->before(*rhs);
}
};
typedef std::vector<std::pair<std::string, bool> > name_stack_t;
typedef std::pair<name_stack_t::iterator, name_stack_t::iterator> name_stack_range_t;
typedef std::vector<std::string> possible_values_t;
@@ -228,9 +220,9 @@ namespace LLInitParam
typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&);
typedef boost::function<void (name_stack_t&, S32, S32, const possible_values_t*)> parser_inspect_func_t;
typedef LLTypeInfoLookup<parser_read_func_t> parser_read_func_map_t;
typedef LLTypeInfoLookup<parser_write_func_t> parser_write_func_map_t;
typedef LLTypeInfoLookup<parser_inspect_func_t> parser_inspect_func_map_t;
typedef std::map<const std::type_info*, parser_read_func_t> parser_read_func_map_t;
typedef std::map<const std::type_info*, parser_write_func_t> parser_write_func_map_t;
typedef std::map<const std::type_info*, parser_inspect_func_t> parser_inspect_func_map_t;
Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
: mParseSilently(false),

View File

@@ -174,6 +174,7 @@ public:
F64 averageCount = curr.count + prevCount * (1.0 - timeInCurrent);
return averageCount;
}
// call each time the key wants use
State noteAction(const T& id, S32 weight = 1)
{

View File

@@ -376,24 +376,24 @@ private:
// uses the MSVC compiler intrinsics __cpuid() and __rdtsc().
// Delays for the specified amount of milliseconds
static void _Delay(unsigned int ms)
static void _Delay(unsigned int ms)
{
LARGE_INTEGER freq, c1, c2;
__int64 x;
LARGE_INTEGER freq, c1, c2;
__int64 x;
// Get High-Res Timer frequency
// Get High-Res Timer frequency
if (!QueryPerformanceFrequency(&freq))
return;
// Convert ms to High-Res Timer value
x = freq.QuadPart/1000*ms;
// Get first snapshot of High-Res Timer value
// Get first snapshot of High-Res Timer value
QueryPerformanceCounter(&c1);
do
{
// Get second snapshot
QueryPerformanceCounter(&c2);
// Get second snapshot
QueryPerformanceCounter(&c2);
}while(c2.QuadPart-c1.QuadPart < x);
// Loop while (second-first < x)
}

View File

@@ -52,5 +52,4 @@ private:
LLProcessorInfoImpl* mImpl;
};
#endif
#endif // LLPROCESSOR_H

View File

@@ -39,7 +39,7 @@
#include <vector>
#include <set>
#include <deque>
#include "stdtypes.h" // llcommon/stdtypes.h, needed for S32 and U32.
#include <typeinfo>
// Use to compare the first element only of a pair
// e.g. typedef std::set<std::pair<int, Data*>, compare_pair<int, Data*> > some_pair_set_t;
@@ -477,4 +477,54 @@ llbind2nd(const _Operation& __oper, const _Tp& __x)
return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
}
/**
* Compare std::type_info* pointers a la std::less. We break this out as a
* separate function for use in two different std::less specializations.
*/
inline
bool before(const std::type_info* lhs, const std::type_info* rhs)
{
#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
// If we're building on Linux with gcc, and it's either gcc 3.x or
// 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on
// Mac too, and some people build with gcc on Windows (cygwin or mingw).
// On Linux, different load modules may produce different type_info*
// pointers for the same type. Have to compare name strings to get good
// results.
return strcmp(lhs->name(), rhs->name()) < 0;
#else // not Linux, or gcc 4.4+
// Just use before(), as we normally would
return lhs->before(*rhs);
#endif
}
/**
* Specialize std::less<std::type_info*> to use std::type_info::before().
* See MAINT-1175. It is NEVER a good idea to directly compare std::type_info*
* because, on Linux, you might get different std::type_info* pointers for the
* same type (from different load modules)!
*/
namespace std
{
template <>
struct less<const std::type_info*>:
public std::binary_function<const std::type_info*, const std::type_info*, bool>
{
bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
{
return before(lhs, rhs);
}
};
template <>
struct less<std::type_info*>:
public std::binary_function<std::type_info*, std::type_info*, bool>
{
bool operator()(std::type_info* lhs, std::type_info* rhs) const
{
return before(lhs, rhs);
}
};
} // std
#endif // LL_LLSTL_H

View File

@@ -12,9 +12,49 @@
#if ! defined(LL_LLTYPEINFOLOOKUP_H)
#define LL_LLTYPEINFOLOOKUP_H
#include "llsortedvector.h"
#include <boost/unordered_map.hpp>
#include <boost/functional/hash.hpp>
#include <boost/optional.hpp>
#include <functional> // std::binary_function
#include <typeinfo>
/**
* The following helper classes are based on the Boost.Unordered documentation:
* http://www.boost.org/doc/libs/1_45_0/doc/html/unordered/hash_equality.html
*/
/**
* Compute hash for a string passed as const char*
*/
struct const_char_star_hash: public std::unary_function<const char*, std::size_t>
{
std::size_t operator()(const char* str) const
{
std::size_t seed = 0;
for ( ; *str; ++str)
{
boost::hash_combine(seed, *str);
}
return seed;
}
};
/**
* Compute equality for strings passed as const char*
*
* I (nat) suspect that this is where the default behavior breaks for the
* const char* values returned from std::type_info::name(). If you compare the
* two const char* pointer values, as a naive, unspecialized implementation
* will surely do, they'll compare unequal.
*/
struct const_char_star_equal: public std::binary_function<const char*, const char*, bool>
{
bool operator()(const char* lhs, const char* rhs) const
{
return strcmp(lhs, rhs) == 0;
}
};
/**
* LLTypeInfoLookup is specifically designed for use cases for which you might
* consider std::map<std::type_info*, VALUE>. We have several such data
@@ -23,88 +63,55 @@
* different load modules will produce different std::type_info*.
* LLTypeInfoLookup contains a workaround to address this issue.
*
* Specifically, when we don't find the passed std::type_info*,
* LLTypeInfoLookup performs a linear search over registered entries to
* compare name() strings. Presuming that this succeeds, we cache the new
* (previously unrecognized) std::type_info* to speed future lookups.
*
* This worst-case fallback search (linear search with string comparison)
* should only happen the first time we look up a given type from a particular
* load module other than the one from which we initially registered types.
* (However, a lookup which wouldn't succeed anyway will always have
* worst-case performance.) This class is probably best used with less than a
* few dozen different types.
* The API deliberately diverges from std::map in several respects:
* * It avoids iterators, not only begin()/end() but also as return values
* from insert() and find(). This bypasses transform_iterator overhead.
* * Since we literally use compile-time types as keys, the essential insert()
* and find() methods accept the key type as a @em template parameter,
* accepting and returning value_type as a normal runtime value. This is to
* permit future optimization (e.g. compile-time type hashing) without
* changing the API.
*/
template <typename VALUE>
class LLTypeInfoLookup
{
// Use this for our underlying implementation: lookup by
// std::type_info::name() string. This is one of the rare cases in which I
// dare use const char* directly, rather than std::string, because I'm
// sure that every value returned by std::type_info::name() is static.
// HOWEVER, specify our own hash + equality functors: naively comparing
// distinct const char* values won't work.
typedef boost::unordered_map<const char*, VALUE,
const_char_star_hash, const_char_star_equal> impl_map_type;
public:
typedef LLTypeInfoLookup<VALUE> self;
typedef LLSortedVector<const std::type_info*, VALUE> vector_type;
typedef typename vector_type::key_type key_type;
typedef typename vector_type::mapped_type mapped_type;
typedef typename vector_type::value_type value_type;
typedef typename vector_type::iterator iterator;
typedef typename vector_type::const_iterator const_iterator;
typedef VALUE value_type;
LLTypeInfoLookup() {}
iterator begin() { return mVector.begin(); }
iterator end() { return mVector.end(); }
const_iterator begin() const { return mVector.begin(); }
const_iterator end() const { return mVector.end(); }
bool empty() const { return mVector.empty(); }
std::size_t size() const { return mVector.size(); }
bool empty() const { return mMap.empty(); }
std::size_t size() const { return mMap.size(); }
std::pair<iterator, bool> insert(const std::type_info* key, const VALUE& value)
template <typename KEY>
bool insert(const value_type& value)
{
return insert(value_type(key, value));
// Obtain and store the std::type_info::name() string as the key.
// Return just the bool from std::map::insert()'s return pair.
return mMap.insert(typename impl_map_type::value_type(typeid(KEY).name(), value)).second;
}
std::pair<iterator, bool> insert(const value_type& pair)
template <typename KEY>
boost::optional<value_type> find() const
{
return mVector.insert(pair);
}
// const find() forwards to non-const find(): this can alter mVector!
const_iterator find(const std::type_info* key) const
{
return const_cast<self*>(this)->find(key);
}
// non-const find() caches previously-unknown type_info* to speed future
// lookups.
iterator find(const std::type_info* key)
{
iterator found = mVector.find(key);
if (found != mVector.end())
{
// If LLSortedVector::find() found, great, we're done.
return found;
}
// Here we didn't find the passed type_info*. On Linux, though, even
// for the same type, typeid(sametype) produces a different type_info*
// when used in different load modules. So the fact that we didn't
// find the type_info* we seek doesn't mean this type isn't
// registered. Scan for matching name() string.
for (typename vector_type::iterator ti(mVector.begin()), tend(mVector.end());
ti != tend; ++ti)
{
if (std::string(ti->first->name()) == key->name())
{
// This unrecognized 'key' is for the same type as ti->first.
// To speed future lookups, insert a new entry that lets us
// look up ti->second using this same 'key'.
return insert(key, ti->second).first;
}
}
// We simply have never seen a type with this type_info* from any load
// module.
return mVector.end();
// Use the std::type_info::name() string as the key.
typename impl_map_type::const_iterator found = mMap.find(typeid(KEY).name());
if (found == mMap.end())
return boost::optional<value_type>();
return found->second;
}
private:
vector_type mVector;
impl_map_type mMap;
};
#endif /* ! defined(LL_LLTYPEINFOLOOKUP_H) */

View File

@@ -33,9 +33,9 @@
// We can't use WIN32_LEAN_AND_MEAN here, needs lots of includes.
#if LL_WINDOWS
# undef WIN32_LEAN_AND_MEAN
# include <winsock2.h>
# include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#endif
#include "lldefs.h"
@@ -452,7 +452,8 @@ static void get_random_bytes(void *buf, int nbytes)
return;
}
#if LL_WINDOWS
#if LL_WINDOWS
typedef struct _ASTAT_
{
ADAPTER_STATUS adapt;
@@ -460,58 +461,44 @@ typedef struct _ASTAT_
}ASTAT, * PASTAT;
// static
S32 LLUUID::getNodeID(unsigned char *node_id)
S32 LLUUID::getNodeID(unsigned char *node_id)
{
ASTAT Adapter;
NCB Ncb;
UCHAR uRetCode;
LANA_ENUM lenum;
int i;
int retval = 0;
ASTAT Adapter;
NCB Ncb;
UCHAR uRetCode;
LANA_ENUM lenum;
int i;
int retval = 0;
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBENUM;
Ncb.ncb_buffer = (UCHAR *)&lenum;
Ncb.ncb_length = sizeof(lenum);
uRetCode = Netbios( &Ncb );
// printf( "The NCBENUM return code is: 0x%x \n", uRetCode );
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBENUM;
Ncb.ncb_buffer = (UCHAR *)&lenum;
Ncb.ncb_length = sizeof(lenum);
uRetCode = Netbios( &Ncb );
for(i=0; i < lenum.length ;i++)
{
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBRESET;
Ncb.ncb_lana_num = lenum.lana[i];
for(i=0; i < lenum.length ;i++)
{
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBRESET;
Ncb.ncb_lana_num = lenum.lana[i];
uRetCode = Netbios( &Ncb );
// printf( "The NCBRESET on LANA %d return code is: 0x%x \n",
// lenum.lana[i], uRetCode );
uRetCode = Netbios( &Ncb );
memset( &Ncb, 0, sizeof (Ncb) );
Ncb.ncb_command = NCBASTAT;
Ncb.ncb_lana_num = lenum.lana[i];
memset( &Ncb, 0, sizeof (Ncb) );
Ncb.ncb_command = NCBASTAT;
Ncb.ncb_lana_num = lenum.lana[i];
strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */
Ncb.ncb_buffer = (unsigned char *)&Adapter;
Ncb.ncb_length = sizeof(Adapter);
strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */
Ncb.ncb_buffer = (unsigned char *)&Adapter;
Ncb.ncb_length = sizeof(Adapter);
uRetCode = Netbios( &Ncb );
// printf( "The NCBASTAT on LANA %d return code is: 0x%x \n",
// lenum.lana[i], uRetCode );
if ( uRetCode == 0 )
{
// printf( "The Ethernet Number on LANA %d is: %02x%02x%02x%02x%02x%02x\n",
// lenum.lana[i],
// Adapter.adapt.adapter_address[0],
// Adapter.adapt.adapter_address[1],
// Adapter.adapt.adapter_address[2],
// Adapter.adapt.adapter_address[3],
// Adapter.adapt.adapter_address[4],
// Adapter.adapt.adapter_address[5] );
uRetCode = Netbios( &Ncb );
if ( uRetCode == 0 )
{
memcpy(node_id,Adapter.adapt.adapter_address,6); /* Flawfinder: ignore */
retval = 1;
}
}
}
}
return retval;
}

View File

@@ -132,6 +132,7 @@ public:
U8 mData[UUID_BYTES];
};
typedef std::vector<LLUUID> uuid_vec_t;
// Construct

View File

@@ -860,7 +860,6 @@ set(viewer_HEADER_FILES
llpanellandmedia.h
llpanellandobjects.h
llpanellandoptions.h
llpanelLCD.h
llpanellogin.h
llpanelmaininventory.h
llpanelmorph.h

View File

@@ -216,11 +216,6 @@
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
//
#if LL_WINDOWS && LL_LCD_COMPILE
#include "lllcd.h"
#endif
//----------------------------------------------------------------------------
// viewer.cpp - these are only used in viewer, should be easily moved.
@@ -810,13 +805,6 @@ bool LLAppViewer::init()
// call all self-registered classes
LLInitClassList::instance().fireCallbacks();
#if LL_LCD_COMPILE
// start up an LCD window on a logitech keyboard, if there is one
HINSTANCE hInstance = GetModuleHandle(NULL);
gLcdScreen = new LLLCD(hInstance);
CreateLCDDebugWindows();
#endif
LLFolderViewItem::initClass(); // SJB: Needs to happen after initWindow(), not sure why but related to fonts
gGLManager.getGLInfo(gDebugInfo);
@@ -1198,11 +1186,6 @@ bool LLAppViewer::mainLoop()
pingMainloopTimeout("Main:Snapshot");
LLFloaterSnapshot::update(); // take snapshots
gGLActive = FALSE;
#if LL_LCD_COMPILE
// update LCD Screen
pingMainloopTimeout("Main:LCD");
gLcdScreen->UpdateDisplay();
#endif
}
}
@@ -1570,12 +1553,6 @@ bool LLAppViewer::cleanup()
// gDXHardware.cleanup();
//#endif // LL_WINDOWS
#if LL_LCD_COMPILE
// shut down the LCD window on a logitech keyboard, if there is one
delete gLcdScreen;
gLcdScreen = NULL;
#endif
LLVolumeMgr* volume_manager = LLPrimitive::getVolumeManager();
if (!volume_manager->cleanup())
{

View File

@@ -452,20 +452,6 @@ void LLFloaterChat::addChat(const LLChat& chat,
}
// [/RLVa:KB]
#if LL_LCD_COMPILE
// add into LCD displays
if (!invisible_script_debug_chat)
{
if (!from_instant_message)
{
AddNewChatToLCD(chat.mText);
}
else
{
AddNewIMToLCD(chat.mText);
}
}
#endif
if (!invisible_script_debug_chat
&& !chat.mMuted
&& gConsole

View File

@@ -58,7 +58,6 @@
#include "llpanelgeneral.h"
#include "llpanelinput.h"
#include "llpanellogin.h"
#include "llpanelLCD.h"
#include "llpanelmsgs.h"
#include "llpanelweb.h"
#include "llpanelskins.h"
@@ -179,20 +178,6 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
mTabContainer->addTabPanel(mPrefsIM->getPanel(), mPrefsIM->getPanel()->getLabel());
mPrefsIM->getPanel()->setDefaultBtn(default_btn);
#if LL_LCD_COMPILE
// only add this option if we actually have a logitech keyboard / speaker set
if (gLcdScreen->Enabled())
{
mLCDPanel = new LLPanelLCD();
mTabContainer->addTabPanel(mLCDPanel, mLCDPanel->getLabel());
mLCDPanel->setDefaultBtn(default_btn);
}
#else
mLCDPanel = NULL;
#endif
mMsgPanel = new LLPanelMsgs();
mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel());
mMsgPanel->setDefaultBtn(default_btn);
@@ -322,14 +307,6 @@ void LLPreferenceCore::apply()
LLFloaterHardwareSettings::instance()->apply();
mWebPanel->apply();
#if LL_LCD_COMPILE
// only add this option if we actually have a logitech keyboard / speaker set
if (gLcdScreen->Enabled())
{
mLCDPanel->apply();
}
#endif
// mWebPanel->apply();
}
@@ -354,14 +331,6 @@ void LLPreferenceCore::cancel()
LLFloaterHardwareSettings::instance()->cancel();
mWebPanel->cancel();
#if LL_LCD_COMPILE
// only add this option if we actually have a logitech keyboard / speaker set
if (gLcdScreen->Enabled())
{
mLCDPanel->cancel();
}
#endif
// mWebPanel->cancel();
}
// static

View File

@@ -1,132 +0,0 @@
/**
* @file llpanellcd.cpp
* @brief lcd options panel
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* 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, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelLCD.h"
// linden library includes
#include "llerror.h"
#include "llrect.h"
#include "llfontgl.h"
#include "message.h"
#include "lluictrlfactory.h"
// project includes
#include "llviewerwindow.h"
#include "llcheckboxctrl.h"
#include "llradiogroup.h"
#include "llresmgr.h"
#include "lltextbox.h"
#include "llui.h"
#include "llviewercontrol.h"
//Ventrella
#include "llagent.h"
//end Ventrella
// for Logitech LCD keyboards / speakers
#ifndef LL_LCD_H
#include "lllcd.h"
#endif
//
// Globals
//
//
// Static functions
//
LLPanelLCD::LLPanelLCD()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_lcd.xml");
}
BOOL LLPanelLCD::postBuild()
{
requires<LLRadioGroup>("LCDDestination");
requires<LLCheckBoxCtrl>("DisplayLinden");
requires<LLCheckBoxCtrl>("DisplayDebug");
requires<LLCheckBoxCtrl>("DisplayDebugConsole");
requires<LLCheckBoxCtrl>("DisplayRegion");
requires<LLCheckBoxCtrl>("DisplayChat");
requires<LLCheckBoxCtrl>("DisplayIM");
if (!checkRequirements())
{
return FALSE;
}
refresh();
return TRUE;
}
LLPanelLCD::~LLPanelLCD()
{
// Children all cleaned up by default view destructor.
}
void LLPanelLCD::refresh()
{
mLCDDestination = gSavedSettings.getS32("LCDDestination");
mDisplayChat = gSavedSettings.getBOOL("DisplayChat");
mDisplayIM = gSavedSettings.getBOOL("DisplayIM");
mDisplayRegion = gSavedSettings.getBOOL("DisplayRegion");
mDisplayDebug = gSavedSettings.getBOOL("DisplayDebug");
mDisplayDebugConsole = gSavedSettings.getBOOL("DisplayDebugConsole");
mDisplayLinden = gSavedSettings.getBOOL("DisplayLinden");
LLPanel::refresh();
}
void LLPanelLCD::apply()
{
// nothing really to do here.
}
void LLPanelLCD::cancel()
{
// doing this to restore situation when we entered this function
gSavedSettings.setS32("LCDDestination", mLCDDestination);
gSavedSettings.setBOOL("DisplayChat", mDisplayChat);
gSavedSettings.setBOOL("DisplayIM", mDisplayIM);
gSavedSettings.setBOOL("DisplayRegion", mDisplayRegion);
gSavedSettings.setBOOL("DisplayDebug", mDisplayDebug);
gSavedSettings.setBOOL("DisplayDebugConsole", mDisplayDebugConsole);
gSavedSettings.setBOOL("DisplayLinden", mDisplayLinden);
}

View File

@@ -1,63 +0,0 @@
/**
* @file llpanelLCD.h
* @brief lcd options panel
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* 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, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_PANEL_LCD_H
#define LL_PANEL_LCD_H
#include "llpanel.h"
class LLCheckBoxCtrl;
class LLPanelLCD : public LLPanel
{
public:
LLPanelLCD();
virtual ~LLPanelLCD();
virtual BOOL postBuild();
virtual void refresh();
void apply();
void cancel();
protected:
S32 mLCDDestination;
BOOL mDisplayChat;
BOOL mDisplayRegion;
BOOL mDisplayDebug;
BOOL mDisplayDebugConsole;
BOOL mDisplayLinden;
BOOL mDisplayIM;
};
#endif

View File

@@ -62,9 +62,6 @@
#include "llviewernetwork.h"
#include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived
#include "sgmemstat.h"
#if LL_LCD_COMPILE
#include "lllcd.h"
#endif
class StatAttributes
@@ -201,10 +198,7 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] =
// ST_TEX_BAKES
StatAttributes("Texture Bakes", FALSE, FALSE),
// ST_TEX_REBAKES
StatAttributes("Texture Rebakes", FALSE, FALSE),
// ST_LOGITECH_KEYBOARD
StatAttributes("Logitech LCD", FALSE, FALSE)
StatAttributes("Texture Rebakes", FALSE, FALSE)
};
@@ -699,14 +693,6 @@ void update_statistics(U32 frame_count)
mem_stats_timer.reset();
}
}
#if LL_LCD_COMPILE
bool LCDenabled = gLcdScreen->Enabled();
LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled);
#else
LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, false);
#endif
}
class ViewerStatsResponder : public LLHTTPClient::Responder

View File

@@ -181,9 +181,8 @@ public:
ST_WINDOW_HEIGHT = 55,
ST_TEX_BAKES = 56,
ST_TEX_REBAKES = 57,
ST_LOGITECH_LCD = 58,
ST_COUNT = 59
ST_COUNT = 58
};
@@ -282,7 +281,7 @@ public:
};
StatsAccumulator mAgentPositionSnaps;
private:
F64 mStats[ST_COUNT];