#97 simplify MultiScreen

This commit is contained in:
Autumn Lamonte 2022-01-29 21:22:59 -06:00
parent 3ac3c2bd9d
commit 72088134c3
3 changed files with 64 additions and 928 deletions

View file

@ -706,7 +706,7 @@ public class LogicalScreen implements Screen {
*
* @param width new screen width
*/
public final synchronized void setWidth(final int width) {
public synchronized void setWidth(final int width) {
reallocate(width, this.height);
}
@ -716,7 +716,7 @@ public class LogicalScreen implements Screen {
*
* @param height new screen height
*/
public final synchronized void setHeight(final int height) {
public synchronized void setHeight(final int height) {
reallocate(this.width, height);
}
@ -727,7 +727,7 @@ public class LogicalScreen implements Screen {
* @param width new screen width
* @param height new screen height
*/
public final void setDimensions(final int width, final int height) {
public void setDimensions(final int width, final int height) {
reallocate(width, height);
resizeToScreen();
}
@ -1035,7 +1035,7 @@ public class LogicalScreen implements Screen {
/**
* Clear the physical screen.
*/
public synchronized final void clearPhysical() {
public synchronized void clearPhysical() {
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
physical[col][row].unset();

View file

@ -111,7 +111,10 @@ public class MultiBackend implements Backend {
* screen to the physical device.
*/
public void flushScreen() {
for (Backend backend: backends) {
multiScreen.flushPhysical();
int n = backends.size();
for (int i = 0; i < n; i++) {
Backend backend = backends.get(Math.min(i, backends.size()));
backend.flushScreen();
}
}

File diff suppressed because it is too large Load diff