mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-04 02:23:10 +00:00
Made screen.h use correct resolution instead of assuming
This commit is contained in:
+4
-4
@@ -18,9 +18,9 @@
|
||||
#define rgb(r,g,b) ( ((r) << 16 | (g) << 8 | (b)) & 0x00ffffff )
|
||||
|
||||
void drawPixel(int32_t x, int32_t y, uint32_t color) {
|
||||
uint32_t* vidmem = *(uint32_t**)(MODE_INFO_BLOCK + 40);
|
||||
uint32_t* vidmem = (uint32_t*)gfxMode->physicalBasePtr;
|
||||
|
||||
uint32_t offset = (y * WIDTH) + x;
|
||||
uint32_t offset = (y * gfxMode->xRes) + x;
|
||||
vidmem[offset] = color;
|
||||
}
|
||||
|
||||
@@ -96,9 +96,9 @@ void drawCircle(int32_t x, int32_t y, uint16_t radius, uint32_t color) {
|
||||
|
||||
// Recursive (may need large stack)
|
||||
void boundaryFill(int32_t x, int32_t y, uint32_t fillColor, uint32_t boundaryColor) {
|
||||
uint32_t* vidmem = *(uint32_t**)(MODE_INFO_BLOCK + 40);
|
||||
uint32_t* vidmem = (uint32_t*)gfxMode->physicalBasePtr;
|
||||
|
||||
uint32_t offset = y * WIDTH + x;
|
||||
uint32_t offset = y * gfxMode->xRes + x;
|
||||
|
||||
if (vidmem[offset] != fillColor && vidmem[offset] != boundaryColor) {
|
||||
vidmem[offset] = fillColor;
|
||||
|
||||
Reference in New Issue
Block a user