- adds the new gui renderer also a new implementation for the classic gui
- adds a ImageMan and ImageDec class for loading and managing image files - adds a loader for zip files which is used by the new theme and the image manager - changes the widgets to use the new gui code - changes the scumm dialogs to use the new gui code - fixes a #include problem in the sky debugger with the new gui code To use the new gui copy gui/themes/default-theme.zip to your extrapath. If the theme zip can not be found the gui will fallback to the classic theme. If you want to change the gui styles use "gui_theme=classic" for the classic theme and "gui_theme=default-theme" for the new theme. Thanks to eriktorbjorn for testing and help with the new theme and to sev for reviewing this patch. svn-id: r20227
This commit is contained in:
parent
901645cb0f
commit
5051b080a2
32 changed files with 3868 additions and 627 deletions
|
@ -179,73 +179,22 @@ void ScrollBarWidget::recalc() {
|
|||
}
|
||||
|
||||
void ScrollBarWidget::drawWidget(bool hilite) {
|
||||
NewGui *gui = &g_gui;
|
||||
int bottomY = _y + _h - UP_DOWN_BOX_HEIGHT;
|
||||
bool isSinglePage = (_numEntries <= _entriesPerPage);
|
||||
OverlayColor color;
|
||||
Graphics::Surface &surf = g_gui.getScreen();
|
||||
const int B = 3;
|
||||
Common::Point p0, p1, p2;
|
||||
|
||||
gui->frameRect(_x, _y, _w, _h, gui->_shadowcolor);
|
||||
|
||||
if (_draggingPart != kNoPart)
|
||||
_part = _draggingPart;
|
||||
|
||||
const int arrowSize = (_w / 2 - B + 1);
|
||||
|
||||
//
|
||||
// Up arrow
|
||||
//
|
||||
color = isSinglePage ? gui->_color :
|
||||
(hilite && _part == kUpArrowPart) ? gui->_textcolorhi : gui->_textcolor;
|
||||
gui->frameRect(_x, _y, _w, UP_DOWN_BOX_HEIGHT, gui->_color);
|
||||
p0 = Common::Point(_x + _w / 2, _y + (UP_DOWN_BOX_HEIGHT - arrowSize - 1) / 2);
|
||||
p1 = Common::Point(p0.x - arrowSize, p0.y + arrowSize);
|
||||
p2 = Common::Point(p0.x + arrowSize, p0.y + arrowSize);
|
||||
#if 0
|
||||
surf.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
surf.drawLine(p0.x, p0.y, p2.x, p2.y, color);
|
||||
// surf.drawLine(p1.x, p1.y, p2.x, p2.y, color);
|
||||
#else
|
||||
// Evil HACK to draw filled triangle
|
||||
for (; p1.x <= p2.x; ++p1.x)
|
||||
surf.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Down arrow
|
||||
//
|
||||
color = isSinglePage ? gui->_color :
|
||||
(hilite && _part == kDownArrowPart) ? gui->_textcolorhi : gui->_textcolor;
|
||||
gui->frameRect(_x, bottomY, _w, UP_DOWN_BOX_HEIGHT, gui->_color);
|
||||
p0 = Common::Point(_x + _w / 2, bottomY + (UP_DOWN_BOX_HEIGHT + arrowSize + 1) / 2);
|
||||
p1 = Common::Point(p0.x - arrowSize, p0.y - arrowSize);
|
||||
p2 = Common::Point(p0.x + arrowSize, p0.y - arrowSize);
|
||||
|
||||
#if 0
|
||||
surf.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
surf.drawLine(p0.x, p0.y, p2.x, p2.y, color);
|
||||
// surf.drawLine(p1.x, p1.y, p2.x, p2.y, color);
|
||||
#else
|
||||
// Evil HACK to draw filled triangle
|
||||
for (; p1.x <= p2.x; ++p1.x)
|
||||
surf.drawLine(p0.x, p0.y, p1.x, p1.y, color);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Slider
|
||||
//
|
||||
if (!isSinglePage) {
|
||||
gui->fillRect(_x, _y + _sliderPos, _w, _sliderHeight,
|
||||
(hilite && _part == kSliderPart) ? gui->_textcolorhi : gui->_textcolor);
|
||||
gui->frameRect(_x, _y + _sliderPos, _w, _sliderHeight, gui->_color);
|
||||
int y = _y + _sliderPos + _sliderHeight / 2;
|
||||
color = (hilite && _part == kSliderPart) ? gui->_color : gui->_shadowcolor;
|
||||
gui->hLine(_x + 2, y - 2, _x + _w - 3, color);
|
||||
gui->hLine(_x + 2, y, _x + _w - 3, color);
|
||||
gui->hLine(_x + 2, y + 2, _x + _w-3, color);
|
||||
Theme::kScrollbarState state = Theme::kScrollbarStateNo;
|
||||
if (_numEntries <= _entriesPerPage) {
|
||||
state = Theme::kScrollbarStateSinglePage;
|
||||
} else if (_part == kUpArrowPart) {
|
||||
state = Theme::kScrollbarStateUp;
|
||||
} else if (_part == kDownArrowPart) {
|
||||
state = Theme::kScrollbarStateDown;
|
||||
} else if (_part == kSliderPart) {
|
||||
state = Theme::kScrollbarStateSlider;
|
||||
}
|
||||
|
||||
g_gui.theme()->drawScrollbar(Common::Rect(_x, _y, _x+_w, _y+_h), _sliderPos, _sliderHeight, state,
|
||||
isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled);
|
||||
}
|
||||
|
||||
} // End of namespace GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue