chore: replace typedefs with using alias
This commit is contained in:
@@ -17,21 +17,22 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace gfx {
|
||||
|
||||
typedef struct {
|
||||
struct snes_color {
|
||||
uchar red;
|
||||
uchar blue;
|
||||
uchar green;
|
||||
} snes_color;
|
||||
};
|
||||
using snes_color = struct snes_color;
|
||||
|
||||
typedef struct {
|
||||
struct snes_palette {
|
||||
uint id;
|
||||
uint size;
|
||||
snes_color* colors;
|
||||
} snes_palette;
|
||||
};
|
||||
using snes_palette = struct snes_palette;
|
||||
|
||||
ushort ConvertRGBtoSNES(const snes_color color);
|
||||
snes_color ConvertSNEStoRGB(const ushort snes_color);
|
||||
|
||||
snes_palette* Extract(const char* data, const unsigned int offset,
|
||||
const unsigned int palette_size);
|
||||
char* Convert(const snes_palette pal);
|
||||
|
||||
@@ -10,11 +10,12 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace gfx {
|
||||
|
||||
typedef struct {
|
||||
struct tile8 {
|
||||
unsigned int id;
|
||||
char data[64];
|
||||
unsigned int palette_id;
|
||||
} tile8;
|
||||
};
|
||||
using tile8 = struct tile8;
|
||||
|
||||
// vhopppcc cccccccc
|
||||
// [0, 1]
|
||||
@@ -67,22 +68,21 @@ class Tile16 {
|
||||
|
||||
class OAMTile {
|
||||
public:
|
||||
int x, y, mx, my, pal;
|
||||
ushort tile;
|
||||
OAMTile() {}
|
||||
int x_;
|
||||
int y_;
|
||||
int mx_;
|
||||
int my_;
|
||||
int pal_;
|
||||
ushort tile_;
|
||||
OAMTile() = default;
|
||||
OAMTile(int x, int y, ushort tile, int pal, bool upper = false, int mx = 0,
|
||||
int my = 0) {
|
||||
x = x;
|
||||
y = y;
|
||||
int my = 0)
|
||||
: x_(x), y_(y), mx_(mx), my_(my), pal_(pal) {
|
||||
if (upper) {
|
||||
tile = (ushort)(tile + 512);
|
||||
tile_ = (ushort)(tile + 512);
|
||||
} else {
|
||||
tile = (ushort)(tile + 256 + 512);
|
||||
tile_ = (ushort)(tile + 256 + 512);
|
||||
}
|
||||
|
||||
pal = pal;
|
||||
mx = mx;
|
||||
my = my;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user