From d1903c50f52c915dfde7e9152ec5a4e83ec52328 Mon Sep 17 00:00:00 2001 From: Justin Scofield <47263509+scawful@users.noreply.github.com> Date: Mon, 18 Jul 2022 21:59:42 -0400 Subject: [PATCH] Remove ExtractPalette from ROM class --- src/app/rom.cc | 8 -------- src/app/rom.h | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/app/rom.cc b/src/app/rom.cc index 17b06f5a..1ab5da76 100644 --- a/src/app/rom.cc +++ b/src/app/rom.cc @@ -271,13 +271,5 @@ SDL_Texture *ROM::DrawGraphicsSheet(int offset) { return sheet_texture; } -gfx::SNESPalette ROM::ExtractPalette(uint addr, int bpp) { - uint filePos = addr; - uint palette_size = pow(2, bpp); - auto palette_data = (char *)SDL_malloc(sizeof(char) * (palette_size * 2)); - memcpy(palette_data, current_rom_ + filePos, palette_size * 2); - return gfx::SNESPalette(palette_data); -} - } // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/app/rom.h b/src/app/rom.h index 37dc8e0a..9e2ab3f2 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APP_UTILS_ROM_H -#define YAZE_APP_UTILS_ROM_H +#ifndef YAZE_APP_ROM_H +#define YAZE_APP_ROM_H #include #include @@ -51,8 +51,6 @@ class ROM { uint GetGraphicsAddress(uint8_t id) const; SDL_Texture* DrawGraphicsSheet(int offset); - gfx::SNESPalette ExtractPalette(uint addr, int bpp); - uchar* data() { return current_rom_; } const uchar* getTitle() const { return title; } long getSize() const { return size_; }