From f20d9ae7a623acc66f9361160a3550b2721922f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Mon, 24 Oct 2022 07:16:54 +0100 Subject: [PATCH] refactor: method re-order --- examples/web/index.ts | 28 ++++++++++++++-------------- examples/web/react/app.tsx | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/web/index.ts b/examples/web/index.ts index 0ba10610..f1e48f98 100644 --- a/examples/web/index.ts +++ b/examples/web/index.ts @@ -951,6 +951,20 @@ class GameboyEmulator implements Emulator { return "https://gitlab.stage.hive.pt/joamag/boytacean/-/blob/master/CHANGELOG.md"; } + getPixelFormat(): PixelFormat { + return PixelFormat.RGB; + } + + /** + * Returns the array buffer that contains the complete set of + * pixel data that is going to be drawn. + * + * @returns The current pixel data for the emulator display. + */ + getImageBuffer(): Uint8Array { + return this.gameBoy!.frame_buffer_eager(); + } + toggleRunning() { if (this.paused) { this.resume(); @@ -988,20 +1002,6 @@ class GameboyEmulator implements Emulator { this.start({ engine: null }); } - /** - * Returns the array buffer that contains the complete set of - * pixel data that is going to be drawn. - * - * @returns The current pixel data for the emulator display. - */ - getImageBuffer(): Uint8Array { - return this.gameBoy!.frame_buffer_eager(); - } - - getPixelFormat(): PixelFormat { - return PixelFormat.RGB; - } - toggleWindow() { this.maximize(); } diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx index 0a2a8f26..84739a7b 100644 --- a/examples/web/react/app.tsx +++ b/examples/web/react/app.tsx @@ -31,12 +31,12 @@ export interface Emulator { getName(): string; getVersion(): string; getVersionUrl(): string; + getPixelFormat(): PixelFormat; + getImageBuffer(): Uint8Array; toggleRunning(): void; pause(): void; resume(): void; reset(): void; - getImageBuffer(): Uint8Array; - getPixelFormat(): PixelFormat; } /** -- GitLab