rename yaze_c Rom to rom to fit convention of other primitives
This commit is contained in:
10
src/yaze.cc
10
src/yaze.cc
@@ -8,12 +8,12 @@ void yaze_initialize(void) {}
|
|||||||
// TODO: Implement yaze_cleanup
|
// TODO: Implement yaze_cleanup
|
||||||
void yaze_cleanup(void) {}
|
void yaze_cleanup(void) {}
|
||||||
|
|
||||||
Rom load_rom(const char* filename) {
|
rom load_rom(const char* filename) {
|
||||||
yaze::app::Rom* internal_rom;
|
yaze::app::Rom* internal_rom;
|
||||||
internal_rom = new yaze::app::Rom();
|
internal_rom = new yaze::app::Rom();
|
||||||
if (!internal_rom->LoadFromFile(filename).ok()) {
|
if (!internal_rom->LoadFromFile(filename).ok()) {
|
||||||
delete internal_rom;
|
delete internal_rom;
|
||||||
Rom rom;
|
rom rom;
|
||||||
rom.impl = nullptr;
|
rom.impl = nullptr;
|
||||||
rom.filename = filename;
|
rom.filename = filename;
|
||||||
rom.data = nullptr;
|
rom.data = nullptr;
|
||||||
@@ -21,7 +21,7 @@ Rom load_rom(const char* filename) {
|
|||||||
return rom;
|
return rom;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rom rom;
|
rom rom;
|
||||||
rom.impl = internal_rom;
|
rom.impl = internal_rom;
|
||||||
rom.filename = filename;
|
rom.filename = filename;
|
||||||
rom.data = internal_rom->data();
|
rom.data = internal_rom->data();
|
||||||
@@ -29,13 +29,13 @@ Rom load_rom(const char* filename) {
|
|||||||
return rom;
|
return rom;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unload_rom(Rom rom) {
|
void unload_rom(rom rom) {
|
||||||
if (rom.impl) {
|
if (rom.impl) {
|
||||||
delete static_cast<yaze::app::Rom*>(rom.impl);
|
delete static_cast<yaze::app::Rom*>(rom.impl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
snes_color get_color_from_paletteset(const Rom* rom, int palette_set,
|
snes_color get_color_from_paletteset(const rom* rom, int palette_set,
|
||||||
int palette, int color) {
|
int palette, int color) {
|
||||||
snes_color color_struct;
|
snes_color color_struct;
|
||||||
color_struct.red = 0;
|
color_struct.red = 0;
|
||||||
|
|||||||
10
src/yaze.h
10
src/yaze.h
@@ -15,19 +15,19 @@ void yaze_initialize(void);
|
|||||||
|
|
||||||
void yaze_cleanup(void);
|
void yaze_cleanup(void);
|
||||||
|
|
||||||
typedef struct Rom Rom;
|
typedef struct rom rom;
|
||||||
|
|
||||||
struct Rom {
|
struct rom {
|
||||||
const char* filename;
|
const char* filename;
|
||||||
const uint8_t* data;
|
const uint8_t* data;
|
||||||
size_t size;
|
size_t size;
|
||||||
void* impl; // yaze::app::Rom*
|
void* impl; // yaze::app::Rom*
|
||||||
};
|
};
|
||||||
|
|
||||||
Rom load_rom(const char* filename);
|
rom load_rom(const char* filename);
|
||||||
void unload_rom(Rom rom);
|
void unload_rom(rom rom);
|
||||||
|
|
||||||
snes_color get_color_from_paletteset(const Rom* rom, int palette_set,
|
snes_color get_color_from_paletteset(const rom* rom, int palette_set,
|
||||||
int palette, int color);
|
int palette, int color);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Reference in New Issue
Block a user