Converting unsigned ints to regular ints again, undid that while merging.

This commit is contained in:
Steffen Fündgens 2014-12-08 14:24:26 +01:00
parent 68202bdef2
commit cf4cbd92fa
3 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ Converter::Converter(){
Converter::~Converter(){
}
std::vector<unsigned int> Converter::newComposition(int type, float posX, float posZ){
std::vector<int> Converter::newComposition(int type, float posX, float posZ){
XMLElement* newComposition = doc->NewElement("composition");
doc->InsertFirstChild(newComposition);
@ -102,7 +102,7 @@ std::vector<unsigned int> Converter::newComposition(int type, float posX, float
newComposition->InsertFirstChild(xRot);
newComposition->InsertFirstChild(scale);
std::vector<unsigned int> ret = nextID;
std::vector<int> ret = nextID;
nextID[1] += 1;
if (nextID[1] == 255){
nextID[1] = 0;
@ -158,7 +158,7 @@ void Converter::save(){
doc->SaveFile(charXmlFile);
}
std::vector<unsigned int> Converter::getNextID(){
std::vector<int> Converter::getNextID(){
return nextID;
}

View File

@ -12,14 +12,14 @@ class Converter {
Converter();
~Converter();
void updateComposition(int idG, int idB, float posX, float posZ); //updates the position of a composition
std::vector<unsigned int> newComposition(int type, float posX, float posZ);//creates a new composition and returns its ID
std::vector<int> newComposition(int type, float posX, float posZ);//creates a new composition and returns its ID
void deleteComposition(int idG, int idB);
void save(); //writes the xml to file
std::vector<unsigned int> getNextID(); //returns the next unused ID
std::vector<int> getNextID(); //returns the next unused ID
private:
std::vector<unsigned int> nextID;
std::vector<int> nextID;
void errorCheck(XMLError error);
std::string xmlFile;
XMLDocument* doc = new XMLDocument();

View File

@ -34,7 +34,7 @@ int main( int argc, char *argv[] ){
//if there is a composition here, adjust the xml and image
if(image[pixel]!=0 && image[pixel]!=255){
if((image[pixel+1]==0 && image[pixel+2]==0) || (image[pixel+1]==255 && image[pixel+2]==255)){
std::vector<unsigned int> temp;
std::vector<int> temp;
temp = conv.newComposition(image[pixel], 0.5+rowNum-0.5*height, 0.5+columnNum-0.5*width);
idFound[temp[0]][temp[1]] = true;
image[pixel+1] = temp[0];