converter now takes the Level to convert as input

This commit is contained in:
Steffen Fündgens 2014-11-24 13:21:52 +01:00
parent 088ae1d494
commit 91099d91a0
2 changed files with 45 additions and 53 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

View File

@ -4,15 +4,9 @@
#include <vector>
#include <iostream>
//global variable level:
unsigned int level;
int main( int argc, char *argv[] ){
//TODO: always update this:
unsigned int numLevels=1;
unsigned int level=atoi(argv[1]);
Converter conv;
//iterate over all Levels
for (level=1; level<=numLevels; level++){
bool idFound[256][256];
for (int i=0; i<256; i++){
for (int j=0; j<256; j++){
@ -23,8 +17,7 @@ int main( int argc, char *argv[] ){
char levelChar[2];
sprintf (levelChar,"%i", level);
std::string levelString = levelChar;
std::string filePath = "../Levels/setupLvl" + levelString + ".png";
//printf("%s", filePath);
std::string filePath = "../Levels/ObjectSetups/Lvl" + levelString + ".png";
std::vector<unsigned char> image; //the raw pixels
unsigned int width, height;
unsigned error = lodepng::decode(image, width, height, filePath);
@ -65,5 +58,4 @@ int main( int argc, char *argv[] ){
}
}
}
}