ION re-structuring

This commit is contained in:
Romain Goyet
2015-08-05 15:52:44 +02:00
parent 96c2ad4228
commit b32b47300a
35 changed files with 114 additions and 66 deletions

View File

@@ -2,7 +2,22 @@
#define KANDINSKY_COLOR_H
#include <stdint.h>
//FIXME: Should be configurable
#include <kandinsky/config.h>
#if KD_BITS_PER_PIXEL <= 8
#warning KD_BITS_PER_PIXEL
#warning 8 bpp
typedef uint8_t KDColor;
/*
#elif KD_BITS_PER_PIXEL <= 16
typedef uint16_t KDColor;
#elif KD_BITS_PER_PIXEL <= 32
typedef uint32_t KDColor;
#elif KD_BITS_PER_PIXEL <= 64
typedef uint64_t KDColor;
*/
#else
#error KD_BITS_PER_PIXEL is too large!
#endif
#endif

View File

@@ -13,16 +13,8 @@
#error Kandinsky expects KD_FRAMEBUFFER_WIDTH to be defined to the width of the framebuffer
#endif
// FIXME: #define this
typedef uint8_t KDColor;
/*
#include <platform/platform.h>
#define KD_FRAMEBUFFER_ADDRESS Platform.framebuffer_address
#define KD_FRAMEBUFFER_WIDTH Platform.framebuffer_width
typedef uint8_t KDColor;
*/
#ifndef KD_BITS_PER_PIXEL
#error Kandinsky expects KD_BITS_PER_PIXEL to be defined to the number of bits per pixels.
#endif
#endif

View File

@@ -7,8 +7,9 @@
void KDSetOrigin(KDPoint origin);
KDPoint KDGetOrigin();
KDColor * KDPixelAddress(KDPoint p);
void KDSetPixel(KDPoint p, KDColor c);
#define COLOR(p) *KDPixelAddress(p)
//KDColor * KDPixelAddress(KDPoint p);
//#define COLOR(p) *KDPixelAddress(p)
#endif

View File

@@ -3,6 +3,6 @@
void KDDrawLine(KDPoint p1, KDPoint p2) {
for (KDCoordinate x = p1.x; x<p2.x; x++) {
COLOR(KDPOINT(x, p1.y)) = 0xFF;
// COLOR(KDPOINT(x, p1.y)) = 0xFF;
}
}

View File

@@ -1,5 +1,5 @@
#include <kandinsky/referential.h>
#include "config.h"
#include <kandinsky/config.h>
static KDPoint sOrigin = {.x = 0, .y = 0};