added Unifont
This commit is contained in:
parent
ecdbb30d3e
commit
9b593ce231
@ -2,6 +2,7 @@
|
||||
#include "internal.hpp"
|
||||
#include "vkvm.hpp"
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
|
||||
int cursorPosX = 0;
|
||||
int cursorPosY = 0;
|
||||
|
BIN
res/font4.bmp
Normal file
BIN
res/font4.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 MiB |
12
res/font4.toml
Normal file
12
res/font4.toml
Normal file
@ -0,0 +1,12 @@
|
||||
xOffset = 6
|
||||
yOffset = 2
|
||||
xSize = 10
|
||||
ySize = 14
|
||||
xCount = 255
|
||||
yCount = 255
|
||||
xStart = 33
|
||||
yStart = 65
|
||||
fillValue = 0
|
||||
firstChar = 0
|
||||
pixelSize = 1
|
||||
invertedColors = 0
|
@ -51,13 +51,18 @@ int Bitmap::getBitsPerPixel() {
|
||||
|
||||
unsigned int Bitmap::getPixel(int x, int y) {
|
||||
unsigned int pixel = 0;
|
||||
|
||||
if(bpp == 1){
|
||||
int index = (getHeight() - 1 - y) * getWidth() + x;
|
||||
char *ptr = getData() + (index / 8);
|
||||
bool value = (ptr[0] >> (7 - (index % 8))) & 1u;
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
char *ptr = getData() + ((getHeight() - 1 - y) * getWidth() + x) * (getBitsPerPixel() / 8);
|
||||
for(int i = 0; i < getBitsPerPixel() / 8;i++){
|
||||
auto value = reinterpret_cast<char*>(&pixel)+i;
|
||||
*value = ptr[i];
|
||||
}
|
||||
if(pixel != 0){
|
||||
return pixel;
|
||||
}
|
||||
return pixel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user