diff --git a/main/main.cpp b/main/main.cpp index a9fd2e1..449f2ee 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2,6 +2,7 @@ #include "internal.hpp" #include "vkvm.hpp" #include +#include int cursorPosX = 0; int cursorPosY = 0; diff --git a/res/font4.bmp b/res/font4.bmp new file mode 100644 index 0000000..8b34cda Binary files /dev/null and b/res/font4.bmp differ diff --git a/res/font4.toml b/res/font4.toml new file mode 100644 index 0000000..fb1adf0 --- /dev/null +++ b/res/font4.toml @@ -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 diff --git a/src/Bitmap.cpp b/src/Bitmap.cpp index 4efc188..252a969 100644 --- a/src/Bitmap.cpp +++ b/src/Bitmap.cpp @@ -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(&pixel)+i; *value = ptr[i]; } - if(pixel != 0){ - return pixel; - } return pixel; }