From eeff5a45dc263d3098c242c57852d4752fe5bad1 Mon Sep 17 00:00:00 2001 From: Julian Hinxlage Date: Tue, 19 Nov 2019 12:49:04 +0100 Subject: [PATCH] added toml --- src/Config.cpp | 4 ++-- src/DritteFont.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index adfbc26..98dc0ec 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -53,7 +53,7 @@ int Config::readInteger(std::string line) { return value; } -Color Config::readColor(std::string line) { +vkvm::Color Config::readColor(std::string line) { int red, green, blue; std::istringstream iss(line); @@ -61,6 +61,6 @@ Color Config::readColor(std::string line) { std::cout << "failed when read color from config" << std::endl; } - Color color(red, green, blue); + vkvm::Color color(red, green, blue); return color; } diff --git a/src/DritteFont.cpp b/src/DritteFont.cpp index 5b2466b..db6e8e6 100644 --- a/src/DritteFont.cpp +++ b/src/DritteFont.cpp @@ -46,7 +46,7 @@ void DritteFont::readFont() { for(i = 0; i < characterHeight; i++) { for(j = 0; j < characterWidth; j++) { characters[row * config.column + column][i][j] = - data[offset + (i * width + j) * PIXEL_SIZE] != (char)config.background_color.red; + data[offset + (i * width + j) * PIXEL_SIZE] != (char)config.background_color.getRed(); } } offset = findNextStartOffset(data, offset, config); @@ -59,7 +59,7 @@ void DritteFont::readFont() { for(i = 0; i < characterHeight; i++) { for(j = 0; j < characterWidth; j++) { characters[config.row * config.column + column][i][j] = - data[offset + (i * width + j) * PIXEL_SIZE] != (char)config.background_color.red; + data[offset + (i * width + j) * PIXEL_SIZE] != (char)config.background_color.getRed(); } } offset = findNextStartOffset(data, offset, config); @@ -113,17 +113,17 @@ int DritteFont::getCharacterSize(std::vector data, Config config, int widt // the method must be modified for(; offset < data.size(); offset++) { - if(((unsigned int)data[offset] & 0xff) == config.border_color.red) // only use red value because the red, green and blue values are equal. + if(((unsigned int)data[offset] & 0xff) == config.border_color.getRed()) // only use red value because the red, green and blue values are equal. counter++; - if(((unsigned int)data[offset] & 0xff) != config.border_color.red) { + if(((unsigned int)data[offset] & 0xff) != config.border_color.getRed()) { if(counter > 0 && counter < config.border_width * 3 + DEVIATION_NUMBER) { // mal 3 because color has 3 values, red, green and blue values. tempOffset = offset; - while (((unsigned int)data[tempOffset++] & 0xff) != config.border_color.red) { + while (((unsigned int)data[tempOffset++] & 0xff) != config.border_color.getRed()) { characterWidth++; } tempOffset = offset; - while (((unsigned int)data[tempOffset] & 0xff) != config.border_color.red) { + while (((unsigned int)data[tempOffset] & 0xff) != config.border_color.getRed()) { characterHeight++; tempOffset += width * PIXEL_SIZE; } @@ -146,10 +146,10 @@ int DritteFont::findNextStartOffset(std::vector data, int offset, Config c for(; offset < data.size(); offset += PIXEL_SIZE) { - if(((unsigned int)data[offset] & 0xff) == config.border_color.red) // only use red value because the red, green and blue values are equal. + if(((unsigned int)data[offset] & 0xff) == config.border_color.getRed()) // only use red value because the red, green and blue values are equal. counter++; - if(((unsigned int)data[offset] & 0xff) != config.border_color.red) { + if(((unsigned int)data[offset] & 0xff) != config.border_color.getRed()) { if(counter > 0 && counter < config.border_width + DEVIATION_NUMBER) { // mal 3 because color has 3 values, red, green and blue values. return offset; }