Core: Merge color_t definitions in
Jeffrey Pfau jeffrey@endrift.com
Sun, 31 Jan 2016 20:22:18 -0800
4 files changed,
12 insertions(+),
14 deletions(-)
M
src/core/core.h
→
src/core/core.h
@@ -11,6 +11,14 @@
struct VFile; struct mRTCSource; +#ifdef COLOR_16_BIT +typedef uint16_t color_t; +#define BYTES_PER_PIXEL 2 +#else +typedef uint32_t color_t; +#define BYTES_PER_PIXEL 4 +#endif + struct mCore { void* cpu; void* board;@@ -19,7 +27,7 @@ bool (*init)(struct mCore*);
void (*deinit)(struct mCore*); void (*desiredVideoDimensions)(struct mCore*, unsigned* width, unsigned* height); - void (*setVideoBuffer)(struct mCore*, void* buffer, size_t stride); + void (*setVideoBuffer)(struct mCore*, color_t* buffer, size_t stride); bool (*isROM)(struct mCore*, struct VFile* vf); bool (*loadROM)(struct mCore*, struct VFile* vf, struct VFile* save, const char* fname);
M
src/gb/core.c
→
src/gb/core.c
@@ -54,7 +54,7 @@ *width = GB_VIDEO_HORIZONTAL_PIXELS;
*height = GB_VIDEO_VERTICAL_PIXELS; } -static void _GBCoreSetVideoBuffer(struct mCore* core, void* buffer, size_t stride) { +static void _GBCoreSetVideoBuffer(struct mCore* core, color_t* buffer, size_t stride) { struct GBCore* gbcore = (struct GBCore*) core; gbcore->renderer.outputBuffer = buffer; gbcore->renderer.outputBufferStride = stride;
M
src/gb/renderers/software.h
→
src/gb/renderers/software.h
@@ -8,13 +8,8 @@ #define GB_RENDERER_SOFTWARE_H
#include "util/common.h" +#include "core/core.h" #include "gb/video.h" - -#ifdef COLOR_16_BIT -typedef uint16_t color_t; -#else -typedef uint32_t color_t; -#endif struct GBVideoSoftwareRenderer { struct GBVideoRenderer d;
M
src/gba/renderers/video-software.h
→
src/gba/renderers/video-software.h
@@ -8,13 +8,8 @@ #define VIDEO_SOFTWARE_H
#include "util/common.h" +#include "core/core.h" #include "gba/video.h" - -#ifdef COLOR_16_BIT -typedef uint16_t color_t; -#else -typedef uint32_t color_t; -#endif struct GBAVideoSoftwareSprite { struct GBAObj obj;