diff --git a/ptap/ptapui.cpp b/ptap/ptapui.cpp index a7f7e26..135f012 100644 --- a/ptap/ptapui.cpp +++ b/ptap/ptapui.cpp @@ -56,7 +56,7 @@ void PTapUI::InitWidgets() scale = 1.0f; widget = new Container(); - widget->back = true; + widget->back = 1; widget->colour = Colour(1, 1, 1, 1); widget->w = this->width * scale; widget->h = this->height * scale; diff --git a/pui/container.cpp b/pui/container.cpp index 0943d6b..fff02da 100644 --- a/pui/container.cpp +++ b/pui/container.cpp @@ -12,11 +12,12 @@ Container::~Container() void Container::OnPaint(const PUi *pui) const { if (this->back) { - float tw = (float)w / pui->w[TEX_BACKTILE]; - float th = (float)h / pui->h[TEX_BACKTILE]; + int t = this->back == 1 ? TEX_BACKTILE : TEX_BACKTILE2; + float tw = (float)w / pui->w[t]; + float th = (float)h / pui->h[t]; glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, pui->tex[TEX_BACKTILE]); + glBindTexture(GL_TEXTURE_2D, pui->tex[t]); glBegin(GL_QUADS); glColor4f(colour.r, colour.g, colour.b, colour.a); glTexCoord2f(.0, .0); diff --git a/pui/container.h b/pui/container.h index 0b69cfc..2f4cab1 100644 --- a/pui/container.h +++ b/pui/container.h @@ -10,7 +10,7 @@ protected: public: Colour colour; Colour frame; - bool back; + int back; int padding; ~Container();