Skip to content
Snippets Groups Projects
Commit e0a62d89 authored by David Parks's avatar David Parks
Browse files

SH-2768 Put transparency checkerboard back in texture preview

parent 17b21fc1
Branches
No related tags found
No related merge requests found
...@@ -971,6 +971,8 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor ...@@ -971,6 +971,8 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor
// Draw gray and white checkerboard with black border // Draw gray and white checkerboard with black border
void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
{
if (!LLGLSLShader::sNoFixedFunction)
{ {
// Initialize the first time this is called. // Initialize the first time this is called.
const S32 PIXELS = 32; const S32 PIXELS = 32;
...@@ -998,17 +1000,25 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) ...@@ -998,17 +1000,25 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
gGL.color4f( .7f, .7f, .7f, alpha ); gGL.color4f( .7f, .7f, .7f, alpha );
gGL.flush(); gGL.flush();
if (!LLGLSLShader::sNoFixedFunction)
{ //polygon stipple is deprecated
glPolygonStipple( checkerboard ); glPolygonStipple( checkerboard );
LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE); LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
gl_rect_2d(rect); gl_rect_2d(rect);
} }
else else
{ { //polygon stipple is deprecated, use "Checker" texture
gl_rect_2d(rect); LLPointer<LLUIImage> img = LLUI::getUIImage("Checker");
gGL.getTexUnit(0)->bind(img->getImage());
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
LLColor4 color(1.f, 1.f, 1.f, alpha);
LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f);
gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(),
img->getImage(), color, uv_rect);
} }
gGL.flush(); gGL.flush();
} }
......
indra/newview/skins/default/textures/checker.png

130 B

...@@ -122,6 +122,8 @@ with the same filename but different name ...@@ -122,6 +122,8 @@ with the same filename but different name
<texture name="Checkbox_Press" file_name="widgets/Checkbox_Press.png" preload="true" /> <texture name="Checkbox_Press" file_name="widgets/Checkbox_Press.png" preload="true" />
<texture name="Check_Mark" file_name="icons/check_mark.png" preload="true" /> <texture name="Check_Mark" file_name="icons/check_mark.png" preload="true" />
<texture name="Checker" file_name="checker.png" preload="false" />
<texture name="Command_AboutLand_Icon" file_name="toolbar_icons/land.png" preload="true" /> <texture name="Command_AboutLand_Icon" file_name="toolbar_icons/land.png" preload="true" />
<texture name="Command_Appearance_Icon" file_name="toolbar_icons/appearance.png" preload="true" /> <texture name="Command_Appearance_Icon" file_name="toolbar_icons/appearance.png" preload="true" />
<texture name="Command_Avatar_Icon" file_name="toolbar_icons/avatars.png" preload="true" /> <texture name="Command_Avatar_Icon" file_name="toolbar_icons/avatars.png" preload="true" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment