Expand all graphics retrieval with bitmap and vram

This commit is contained in:
Justin Scofield
2022-07-17 18:09:12 -04:00
parent 5a62497110
commit 67e1e7ea0c
12 changed files with 165 additions and 115 deletions

View File

@@ -1,4 +1,4 @@
#include "psuedo_vram.h"
#include "pseudo_vram.h"
namespace yaze {
namespace app {

View File

@@ -1,5 +1,5 @@
#ifndef YAZE_APP_GFX_PSUEDO_VRAM_H
#define YAZE_APP_GFX_PSUEDO_VRAM_H
#ifndef YAZE_APP_GFX_PSEUDO_VRAM_H
#define YAZE_APP_GFX_PSEUDO_VRAM_H
#include <SDL2/SDL.h>
@@ -21,22 +21,24 @@ namespace gfx {
// Palette: 256 entries; 15-Bit color (BGR555) for a total of 32,768 colors.
// Resolution: between 256x224 and 512x448.
class psuedo_vram {
class pseudo_vram {
public:
void ChangeGraphicsSet(const std::vector<Bitmap>& graphics_set);
void ChangeGraphicsTileset(const std::vector<Bitmap>& graphics_set);
void ChangeGraphicsPalette(const SNESPalette& graphics_pal);
void ChangeSpriteSet(const std::vector<Bitmap>& sprite_set);
void ChangeSpriteTileset(const std::vector<Bitmap>& sprite_set);
void ChangeSpritePalette(const SNESPalette& sprite_pal);
auto GetTileset(int index) const { return m_vram.at(index); }
private:
std::unordered_map<uint32_t, Bitmap> m_vram;
std::unordered_map<int, Bitmap> m_vram;
static const uint32_t REAL_VRAM_SIZE = 0x8000;
};
std::vector<Bitmap> CreateGraphicsSet(
int id, const std::unordered_map<uint32_t, Bitmap>& all_graphics);
int id, const std::unordered_map<int, Bitmap>& all_graphics);
std::vector<Bitmap> CreateSpriteSet(
int id, const std::unordered_map<uint32_t, Bitmap>& all_graphics);
int id, const std::unordered_map<int, Bitmap>& all_graphics);
} // namespace gfx
} // namespace app