summaryrefslogtreecommitdiff
path: root/applications/goldman/source/renderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'applications/goldman/source/renderer.cpp')
-rw-r--r--applications/goldman/source/renderer.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/applications/goldman/source/renderer.cpp b/applications/goldman/source/renderer.cpp
index 7a5e6b5..4d9beda 100644
--- a/applications/goldman/source/renderer.cpp
+++ b/applications/goldman/source/renderer.cpp
@@ -49,14 +49,15 @@ void renderer::do_render() {
double_buffer.copy_from(background, 0, 0);
- for (auto it = windows.begin(); it != windows.end(); ++it)
-
+ for (auto it = windows.begin(); it != windows.end(); ++it) {
+ int tx = (*it)->x, ty = (*it)->y, fx = 0, fy = 0;
+ int w = (*it)->contents_with_decorations.width;
+ int h = (*it)->contents_with_decorations.height;
+ daguerre::make_safe(tx, fx, w, 0, double_buffer.width);
+ daguerre::make_safe(ty, fy, h, 0, double_buffer.height);
double_buffer.copy_from(
- (*it)->contents_with_decorations, (*it)->x, (*it)->y, 0, 0,
- std::min((*it)->contents_with_decorations.width,
- double_buffer.width - (*it)->x),
- std::min((*it)->contents_with_decorations.height,
- double_buffer.height - (*it)->y));
+ (*it)->contents_with_decorations, tx, ty, fx, fy, w, h);
+ }
double_buffer.convert_from(
cursor_background, cursor, cursor_x, cursor_y, 0, 0,
@@ -79,6 +80,11 @@ void renderer::do_render() {
}
}
+void renderer::get_cursor(int &x_out, int &y_out) {
+ x_out = cursor_x;
+ y_out = cursor_y;
+}
+
void renderer::bump_cursor(int x_offset, int y_offset) {
cursor_x += x_offset;
@@ -95,6 +101,15 @@ void renderer::bump_cursor(int x_offset, int y_offset) {
}
+void renderer::move_window_to_front(std::list<window *>::iterator w) {
+ window *wp = *w;
+ windows.erase(w);
+ if (windows.size() != 0)
+ windows.back()->draw_decorations(false);
+ windows.push_back(wp);
+ wp->draw_decorations(true);
+}
+
void renderer::add_window(window *w) {
if (windows.size() != 0)
windows.back()->draw_decorations(false);