From c25ed8957228cfd580216383c3391ccc7e512bb5 Mon Sep 17 00:00:00 2001 From: Ľubomír Remák Date: Wed, 11 Apr 2018 21:15:01 +0200 Subject: MUTATIONOFJB: Refactor inventory UI into separate widget, add button widgets. --- engines/mutationofjb/widgets/widget.cpp | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 engines/mutationofjb/widgets/widget.cpp (limited to 'engines/mutationofjb/widgets/widget.cpp') diff --git a/engines/mutationofjb/widgets/widget.cpp b/engines/mutationofjb/widgets/widget.cpp new file mode 100644 index 0000000000..fea7f6fbe0 --- /dev/null +++ b/engines/mutationofjb/widgets/widget.cpp @@ -0,0 +1,50 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "mutationofjb/widgets/widget.h" + +namespace MutationOfJB { + +int Widget::getId() const { + return _id; +} + +void Widget::setId(int id) { + _id = id; +} + +void Widget::markDirty() { + _dirty = true; +} + +bool Widget::isDirty() const { + return _dirty; +} + +void Widget::update(Graphics::ManagedSurface &surface) { + if (_dirty) { + _draw(surface); + _dirty = false; + } +} + +} -- cgit v1.2.3