Merge remote-tracking branch 'shyotl/V2TextureSystem'

This commit is contained in:
Siana Gearz
2011-04-26 00:28:58 +02:00
229 changed files with 8451 additions and 4682 deletions

View File

@@ -105,7 +105,7 @@ LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::
mList->setCommitOnKeyboardMovement(FALSE);
addChild(mList);
mArrowImage = LLUI::sImageProvider->getUIImage("combobox_arrow.tga");
mArrowImage = LLUI::getUIImage("combobox_arrow.tga");
mButton->setImageOverlay("combobox_arrow.tga", LLFontGL::RIGHT);
updateLayout();
@@ -248,6 +248,8 @@ void LLComboBox::onCommit()
mTextEntry->setValue(getSimple());
mTextEntry->setTentative(FALSE);
}
setControlValue(getValue());
LLUICtrl::onCommit();
}

View File

@@ -89,7 +89,7 @@ void LLIconCtrl::setImage(const std::string& image_name)
else
{
mImageName = image_name;
mImagep = LLUI::sImageProvider->getUIImage(image_name);
mImagep = LLUI::getUIImage(image_name);
mImageID.setNull();
}
}
@@ -97,7 +97,7 @@ void LLIconCtrl::setImage(const std::string& image_name)
void LLIconCtrl::setImage(const LLUUID& image_id)
{
mImageName.clear();
mImagep = LLUI::sImageProvider->getUIImageByID(image_id);
mImagep = LLUI::getUIImageByID(image_id);
mImageID = image_id;
}

View File

@@ -439,7 +439,7 @@ void LLMultiSlider::draw()
F32 opacity = getEnabled() ? 1.f : 0.3f;
// Track
LLUIImagePtr thumb_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga");
LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga");
S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2;
LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset );

View File

@@ -98,12 +98,12 @@ void LLProgressBar::setPercent(const F32 percent)
void LLProgressBar::setImageBar( const std::string &bar_name )
{
mImageBar = LLUI::sImageProvider->getUIImage(bar_name)->getImage();
mImageBar = LLUI::getUIImage(bar_name)->getImage();
}
void LLProgressBar::setImageShadow(const std::string &shadow_name)
{
mImageShadow = LLUI::sImageProvider->getUIImage(shadow_name)->getImage();
mImageShadow = LLUI::getUIImage(shadow_name)->getImage();
}
void LLProgressBar::setColorBar(const LLColor4 &c)

View File

@@ -61,13 +61,13 @@ public:
protected:
F32 mPercentDone;
LLPointer<LLImageGL> mImageBar;
LLPointer<LLTexture> mImageBar;
//LLUUID mImageBarID;
//LLString mImageBarName;
LLColor4 mColorBar;
LLColor4 mColorBar2;
LLPointer<LLImageGL> mImageShadow;
LLPointer<LLTexture> mImageShadow;
//LLUUID mImageShadowID;
//LLString mImageShadowName;
LLColor4 mColorShadow;

View File

@@ -60,7 +60,7 @@ LLResizeHandle::LLResizeHandle( const std::string& name, const LLRect& rect, S32
if( RIGHT_BOTTOM == mCorner)
{
mImage = LLUI::sImageProvider->getUIImage("UIImgResizeBottomRightUUID");
mImage = LLUI::getUIImage("UIImgResizeBottomRightUUID");
}
switch( mCorner )

View File

@@ -509,7 +509,7 @@ void LLScrollbar::draw()
// Draw background and thumb.
LLUIImage* rounded_rect_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga");
LLUIImage* rounded_rect_imagep = LLUI::getUIImage("rounded_square.tga");
if (!rounded_rect_imagep)
{

View File

@@ -132,7 +132,7 @@ void LLScrollListIcon::setValue(const LLSD& value)
{
// don't use default image specified by LLUUID::null, use no image in that case
LLUUID image_id = value.asUUID();
mIcon = image_id.notNull() ? LLUI::sImageProvider->getUIImageByID(image_id) : LLUIImagePtr(NULL);
mIcon = image_id.notNull() ? LLUI::getUIImageByID(image_id) : LLUIImagePtr(NULL);
}
else
{
@@ -325,7 +325,7 @@ LLScrollListText::LLScrollListText( const std::string& text, const LLFontGL* fon
// initialize rounded rect image
if (!mRoundedRectImage)
{
mRoundedRectImage = LLUI::sImageProvider->getUIImage("rounded_square.tga");
mRoundedRectImage = LLUI::getUIImage("rounded_square.tga");
}
}
//virtual

View File

@@ -73,9 +73,9 @@ LLSlider::LLSlider(
mMouseDownCallback( NULL ),
mMouseUpCallback( NULL )
{
mThumbImage = LLUI::sImageProvider->getUIImage("icn_slide-thumb_dark.tga");
mTrackImage = LLUI::sImageProvider->getUIImage("icn_slide-groove_dark.tga");
mTrackHighlightImage = LLUI::sImageProvider->getUIImage("icn_slide-highlight.tga");
mThumbImage = LLUI::getUIImage("icn_slide-thumb_dark.tga");
mTrackImage = LLUI::getUIImage("icn_slide-groove_dark.tga");
mTrackHighlightImage = LLUI::getUIImage("icn_slide-highlight.tga");
// properly handle setting the starting thumb rect
// do it this way to handle both the operating-on-settings

View File

@@ -36,7 +36,6 @@
#include "lluictrl.h"
#include "v4color.h"
class LLImageGL;
class LLSlider : public LLUICtrl
{

View File

@@ -36,7 +36,7 @@
#include "llstring.h"
#include "llui.h"
//#include "llviewerimagelist.h"
//#include "llviewertexturelist.h"
LLStyle::LLStyle()
{
@@ -166,7 +166,7 @@ LLUIImagePtr LLStyle::getImage() const
void LLStyle::setImage(const LLUUID& src)
{
mImagep = LLUI::sImageProvider->getUIImageByID(src);
mImagep = LLUI::getUIImageByID(src);
}

View File

@@ -42,7 +42,6 @@
#include "v4color.h"
#include "llrender.h"
#include "llrect.h"
#include "llimagegl.h"
#include "lldir.h"
#include "llfontgl.h"
@@ -407,7 +406,7 @@ void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max
}
void gl_draw_image( S32 x, S32 y, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect )
void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect )
{
if (NULL == image)
{
@@ -417,7 +416,7 @@ void gl_draw_image( S32 x, S32 y, LLImageGL* image, const LLColor4& color, const
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -427,7 +426,7 @@ void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image,
gl_draw_scaled_rotated_image( x, y, width, height, 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -443,7 +442,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border
gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect);
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
{
stop_glerror();
@@ -629,12 +628,12 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma
}
}
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), degrees, image, color, uv_rect );
}
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -680,7 +679,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
}
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -1559,7 +1558,8 @@ void LLUI::initClass(LLControlGroup* config,
LLImageProviderInterface* image_provider,
LLUIAudioCallback audio_callback,
const LLVector2* scale_factor,
const std::string& language)
const std::string& language
)
{
sConfigGroup = config;
sIgnoresGroup = ignores;
@@ -1764,11 +1764,24 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
glPointToScreen(gl.mRight, gl.mBottom, &screen->mRight, &screen->mBottom);
}
//static
LLUIImage* LLUI::getUIImage(const std::string& name)
//static
LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id, S32 priority)
{
if (!name.empty())
return sImageProvider->getUIImage(name);
if (sImageProvider)
{
return sImageProvider->getUIImageByID(image_id, priority);
}
else
{
return NULL;
}
}
//static
LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name, S32 priority)
{
if (!name.empty() && sImageProvider)
return sImageProvider->getUIImage(name, priority);
else
return NULL;
}
@@ -1853,7 +1866,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled)
// LLUIImage
//
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) :
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) :
mName(name),
mImage(image),
mScaleRegion(0.f, 1.f, 1.f, 0.f),

View File

@@ -42,7 +42,7 @@
//#include "llhtmlhelp.h"
#include "llgl.h" // *TODO: break this dependency
#include <stack>
//#include "llimagegl.h"
#include "lltexture.h"
#include <boost/signal.hpp>
// LLUIFactory
@@ -50,7 +50,6 @@
class LLColor4;
class LLHtmlHelp;
class LLImageGL;
class LLVector3;
class LLVector2;
class LLUUID;
@@ -91,14 +90,14 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4&
void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_draw_image(S32 x, S32 y, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
// Flip vertical, used for LLFloaterHTML
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom);
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f );
@@ -182,7 +181,8 @@ public:
static void getCursorPositionLocal(const LLView* viewp, S32 *x, S32 *y);
static void setScaleFactor(const LLVector2& scale_factor);
static void setLineWidth(F32 width);
static LLUIImage* getUIImage(const std::string& name);
static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0);
static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0);
static LLVector2 getWindowSize();
static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
@@ -416,13 +416,13 @@ public:
class LLUIImage : public LLRefCount
{
public:
LLUIImage(const std::string& name, LLPointer<LLImageGL> image);
LLUIImage(const std::string& name, LLPointer<LLTexture> image);
void setClipRegion(const LLRectf& region);
void setScaleRegion(const LLRectf& region);
LLPointer<LLImageGL> getImage() { return mImage; }
const LLPointer<LLImageGL>& getImage() const { return mImage; }
LLPointer<LLTexture> getImage() { return mImage; }
const LLPointer<LLTexture>& getImage() const { return mImage; }
void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const;
void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const;
@@ -449,7 +449,7 @@ protected:
std::string mName;
LLRectf mScaleRegion;
LLRectf mClipRegion;
LLPointer<LLImageGL> mImage;
LLPointer<LLTexture> mImage;
BOOL mUniformScaling;
BOOL mNoClip;
};
@@ -597,8 +597,8 @@ public:
LLImageProviderInterface() {};
virtual ~LLImageProviderInterface() {};
virtual LLUIImagePtr getUIImage(const std::string& name) = 0;
virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0;
virtual LLUIImagePtr getUIImage(const std::string& name, S32 priority) = 0;
virtual LLUIImagePtr getUIImageByID(const LLUUID& id, S32 priority) = 0;
virtual void cleanUp() = 0;
};

View File

@@ -69,7 +69,7 @@ void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColo
void LLViewBorder::setTexture( const LLUUID &image_id )
{
mTexture = LLUI::sImageProvider->getUIImageByID(image_id);
mTexture = LLUI::getUIImageByID(image_id);
}