mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
ION re-structuring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <kandinsky/referential.h>
|
||||
#include "config.h"
|
||||
#include <kandinsky/config.h>
|
||||
|
||||
static KDPoint sOrigin = {.x = 0, .y = 0};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user