Skip to content

Commit

Permalink
Client|Widgets: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 28, 2013
1 parent 3105b80 commit 62b4476
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
14 changes: 3 additions & 11 deletions doomsday/client/src/ui/widgets/lineeditwidget.cpp
Expand Up @@ -52,7 +52,6 @@ DENG2_OBSERVES(Atlas, Reposition)
Drawable drawable;
GLUniform uMvpMatrix;
GLUniform uColor;
GLUniform uTex;

Instance(Public *i)
: Base(i),
Expand All @@ -61,8 +60,7 @@ DENG2_OBSERVES(Atlas, Reposition)
margin(0),
needGeometry(false),
uMvpMatrix("uMvpMatrix", GLUniform::Mat4),
uColor ("uColor", GLUniform::Vec4),
uTex ("uTex", GLUniform::Sampler2D)
uColor ("uColor", GLUniform::Vec4)
{
height = new ScalarRule(0);

Expand Down Expand Up @@ -116,9 +114,6 @@ DENG2_OBSERVES(Atlas, Reposition)
composer.setAtlas(atlas());
composer.setText(self.text());

// We'll be using the shared atlas.
uTex = atlas();

// Temporary background texture for development...
bgTex = atlas().alloc(Image::solidColor(Image::Color(255, 255, 255, 255), Image::Size(1, 1)));

Expand All @@ -127,8 +122,7 @@ DENG2_OBSERVES(Atlas, Reposition)

self.root().shaders().build(drawable.program(), "generic.textured.color")
<< uMvpMatrix
//<< uColor
<< uTex;
<< self.root().uAtlas();

self.root().shaders().build(drawable.program("cursor"), "generic.color_ucolor")
<< uMvpMatrix
Expand Down Expand Up @@ -165,9 +159,7 @@ DENG2_OBSERVES(Atlas, Reposition)

// Text lines.
Rectanglei const contentRect = pos.shrunk(margin);
composer.makeVertices(verts, contentRect,
GLTextComposer::AlignLeft,
GLTextComposer::AlignLeft);
composer.makeVertices(verts, contentRect, AlignLeft, AlignLeft);

// Underline the possible suggested completion.
if(self.isSuggestingCompletion())
Expand Down
13 changes: 5 additions & 8 deletions doomsday/client/src/ui/widgets/logwidget.cpp
Expand Up @@ -113,7 +113,7 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
{
DENG2_GUARD(this);
composer.update();
composer.makeVertices(verts, Vector2i(0, y), GLTextComposer::AlignLeft);
composer.makeVertices(verts, Vector2i(0, y), AlignLeft);
}

void clear()
Expand Down Expand Up @@ -329,7 +329,6 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
GLUniform uShadowColor;
GLUniform uColor;
GLUniform uBgMvpMatrix;
GLUniform uBgTex;
Matrix4f projMatrix;
Matrix4f viewMatrix;
Id bgTex;
Expand All @@ -353,8 +352,7 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
uTex ("uTex", GLUniform::Sampler2D),
uShadowColor("uColor", GLUniform::Vec4),
uColor ("uColor", GLUniform::Vec4),
uBgMvpMatrix("uMvpMatrix", GLUniform::Mat4),
uBgTex ("uTex", GLUniform::Sampler2D)
uBgMvpMatrix("uMvpMatrix", GLUniform::Mat4)
{
updateStyle();
}
Expand Down Expand Up @@ -493,7 +491,6 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
Image solidWhitePixel = Image::solidColor(Image::Color(255, 255, 255, 255),
Image::Size(1, 1));
bgTex = self.root().atlas().alloc(solidWhitePixel);
uBgTex = self.root().atlas();

scrollTex = entryAtlas->alloc(solidWhitePixel);

Expand All @@ -503,7 +500,7 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
background.addBuffer(bgBuf = new VertexBuf);
self.root().shaders().build(background.program(), "generic.textured.color")
<< uBgMvpMatrix
<< uBgTex;
<< self.root().uAtlas();

// Vertex buffer for the log entries.
contents.addBuffer(buf = new VertexBuf);
Expand Down Expand Up @@ -752,8 +749,8 @@ DENG2_PIMPL(LogWidget), public Font::RichFormat::IStyle
// Update the background quad.
bgBuf->setVertices(gl::TriangleStrip,
VertexBuf::Builder().makeQuad(pos,
self.style().colors().colorf("background"),
self.root().atlas().imageRectf(bgTex).middle()),
self.style().colors().colorf("background"),
self.root().atlas().imageRectf(bgTex).middle()),
gl::Static);
}

Expand Down

0 comments on commit 62b4476

Please sign in to comment.