add base snes_color for clib
This commit is contained in:
@@ -1,25 +1,16 @@
|
||||
#ifndef YAZE_APP_GFX_SNES_COLOR_H_
|
||||
#define YAZE_APP_GFX_SNES_COLOR_H_
|
||||
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include "base/snes_color.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace gfx {
|
||||
|
||||
/**
|
||||
* @brief Primitive of 16-bit RGB SNES color.
|
||||
*/
|
||||
struct snes_color {
|
||||
uint16_t red; /**< Red component of the color. */
|
||||
uint16_t blue; /**< Blue component of the color. */
|
||||
uint16_t green; /**< Green component of the color. */
|
||||
};
|
||||
typedef struct snes_color snes_color;
|
||||
|
||||
snes_color ConvertSNEStoRGB(uint16_t snes_color);
|
||||
uint16_t ConvertRGBtoSNES(const snes_color& color);
|
||||
uint16_t ConvertRGBtoSNES(const ImVec4& color);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "snes_palette.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
@@ -15,6 +14,7 @@
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/snes_color.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
@@ -307,7 +307,7 @@ SnesPalette ReadPaletteFromRom(int offset, int num_colors, const uchar* rom) {
|
||||
|
||||
while (color_offset < num_colors) {
|
||||
short color = (ushort)((rom[offset + 1]) << 8) | rom[offset];
|
||||
gfx::snes_color new_color;
|
||||
snes_color new_color;
|
||||
new_color.red = (color & 0x1F) * 8;
|
||||
new_color.green = ((color >> 5) & 0x1F) * 8;
|
||||
new_color.blue = ((color >> 10) & 0x1F) * 8;
|
||||
|
||||
Reference in New Issue
Block a user