From dacf6e0625d10ff47d2aad0ca8d705f90f030119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 22 Jul 2020 22:52:51 -0300 Subject: Update architecture --- src/server/client.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/server') diff --git a/src/server/client.cpp b/src/server/client.cpp index d862b13..75c1c38 100644 --- a/src/server/client.cpp +++ b/src/server/client.cpp @@ -57,12 +57,17 @@ struct Client { void show(size_t window_w, size_t window_h) { char *view = new char[window_w * window_h]; + int *line_ends = new int[window_h]; + for (int i = 0; i < window_h; i++) { + line_ends[i] = window_w; + } Point window_end(window_start); for (int i = 0; i < window_h; i++) { for (int j = 0; j < window_w; j++) { view[pos(j, i)] = window_end.element(); if (window_end.element() == '\n') { + line_ends[i] = j; for (int k = j + 1; k < window_w; k++) { view[pos(k, i)] = 0; } @@ -78,7 +83,9 @@ struct Client { } io.send(view, window_w * window_h); + io.send(line_ends, window_h); delete[] view; + delete[] line_ends; } void move(int64_t target) { -- cgit v1.2.3