From 5c1a342cdbe8ca6b2ea8a59c5c4f9eb884a0b7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Mon, 2 Feb 2015 13:37:58 +0100 Subject: [PATCH] Added status prints to the converter. --- converter/main.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/converter/main.cc b/converter/main.cc index f492d0a..6ee03b5 100644 --- a/converter/main.cc +++ b/converter/main.cc @@ -9,8 +9,10 @@ int main( int argc, char *argv[] ){ std::cout << "Converter needs the level (1,2,...) as input." << std::endl; exit(-1); } + printf("Initializing.\n"); std::string levelString = argv[1]; Converter conv = Converter(levelString); + bool idFound[256][256]; for (int i=0; i<256; i++){ for (int j=0; j<256; j++){ @@ -18,7 +20,8 @@ int main( int argc, char *argv[] ){ } } - //read the setup png + //read the setup png + printf("Loading the png.\n"); std::string filePath = "../Levels/ObjectSetups/Level" + levelString + ".png"; std::vector image; //the raw pixels unsigned int width, height; @@ -27,7 +30,7 @@ int main( int argc, char *argv[] ){ std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl; exit(-1); } - + printf("Iterating over the png.\n"); //iterate over all pixels of the image for(unsigned int rowNum = 0; rowNum < height; rowNum++){ for(unsigned int columnNum = 0; columnNum < width; columnNum++){ @@ -47,14 +50,14 @@ int main( int argc, char *argv[] ){ } } } - + printf("Writing IDs back to the png.\n"); //write ids back to the setup png error = lodepng::encode(filePath, image, width, height); if(error) { std::cout << "encoder error " << error << ": "<< lodepng_error_text(error) << std::endl; exit(-1); } - + printf("Deleting obsolete Compositions.\n"); //delete compositions that were not in the png anymore for (int i=0; i<256; i++){ for (int j=0; j<256; j++){