From 3bb584631c896b426c489b4d6813d5cb4b68f043 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 8 Dec 2014 13:28:50 +0100 Subject: [PATCH 1/3] One exclamation mark is enough. --- converter/converter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converter/converter.cc b/converter/converter.cc index 8a62dd2..f4bee91 100644 --- a/converter/converter.cc +++ b/converter/converter.cc @@ -12,7 +12,7 @@ Converter::Converter(std::string level){ const char* charCompositions = "../Levels/ObjectSetups/Compositions.xml"; compositions->LoadFile(charCompositions); if (compositions->ErrorID()!=0){ - printf("Could not open Compositions!!!\n"); + printf("Could not open Compositions!\n"); } //Create a backup of the current Level png file, if no backup exists From 03e94f0bb03ec9ac096ba10ccbc350c2ac27b35b Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 8 Dec 2014 13:33:38 +0100 Subject: [PATCH 2/3] Converting unsinged ints to regular ints, because tinyxml cannot query for unsigned ones and thus negates the purpose of using unsigned ones. This also causes compiler errors. --- converter/converter.cc | 10 +++++----- converter/converter.hh | 10 +++++----- converter/main.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/converter/converter.cc b/converter/converter.cc index f4bee91..0194018 100644 --- a/converter/converter.cc +++ b/converter/converter.cc @@ -58,7 +58,7 @@ Converter::Converter(){ Converter::~Converter(){ } -std::vector Converter::newComposition(unsigned int type, float posX, float posZ){ +std::vector Converter::newComposition(int type, float posX, float posZ){ XMLElement* newComposition = doc->NewElement("composition"); doc->InsertFirstChild(newComposition); @@ -95,7 +95,7 @@ std::vector Converter::newComposition(unsigned int type, float pos newComposition->InsertFirstChild(xRot); newComposition->InsertFirstChild(scale); - std::vector ret = nextID; + std::vector ret = nextID; nextID[1] += 1; if (nextID[1] == 255){ nextID[1] = 0; @@ -104,7 +104,7 @@ std::vector Converter::newComposition(unsigned int type, float pos return ret; } -void Converter::updateComposition(unsigned int idG, unsigned int idB, float posX, float posZ){ +void Converter::updateComposition(int idG, int idB, float posX, float posZ){ XMLElement* thisComposition = doc->FirstChildElement("composition"); int idGreen, idBlue; for(; thisComposition; thisComposition=thisComposition->NextSiblingElement("composition")){ @@ -117,7 +117,7 @@ void Converter::updateComposition(unsigned int idG, unsigned int idB, float posX } } -void Converter::deleteComposition(unsigned int idG, unsigned int idB){ +void Converter::deleteComposition(int idG, int idB){ XMLElement* thisComposition = doc->FirstChildElement("composition"); int idGreen, idBlue; for(; thisComposition; thisComposition=thisComposition->NextSiblingElement("composition")){ @@ -134,7 +134,7 @@ void Converter::save(){ doc->SaveFile(charXmlFile); } -std::vector Converter::getNextID(){ +std::vector Converter::getNextID(){ return nextID; } diff --git a/converter/converter.hh b/converter/converter.hh index d0d2e62..aef1914 100644 --- a/converter/converter.hh +++ b/converter/converter.hh @@ -11,14 +11,14 @@ class Converter { Converter(std::string level); Converter(); ~Converter(); - void updateComposition(unsigned int idG, unsigned int idB, float posX, float posZ); //updates the position of a composition - std::vector newComposition(unsigned int type, float posX, float posZ);//creates a new composition and returns its ID - void deleteComposition(unsigned int idG, unsigned int idB); + void updateComposition(int idG, int idB, float posX, float posZ); //updates the position of a composition + std::vector 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 getNextID(); //returns the next unused ID + std::vector getNextID(); //returns the next unused ID private: - std::vector nextID; + std::vector nextID; std::string xmlFile; XMLDocument* doc = new XMLDocument(); XMLDocument* compositions = new XMLDocument(); diff --git a/converter/main.cc b/converter/main.cc index a18f867..81faafc 100644 --- a/converter/main.cc +++ b/converter/main.cc @@ -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 temp; + std::vector 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]; From 6eb52d2dab5a1aae769b3a31ad597cc0d0daae9b Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 8 Dec 2014 13:43:47 +0100 Subject: [PATCH 3/3] Reexporting column, because it had no normals. --- Levels/Geometry/column.obj | 134 +++++++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 36 deletions(-) diff --git a/Levels/Geometry/column.obj b/Levels/Geometry/column.obj index e180874..3cded80 100644 --- a/Levels/Geometry/column.obj +++ b/Levels/Geometry/column.obj @@ -1,6 +1,5 @@ # Blender v2.72 (sub 0) OBJ File: 'ruins_column.blend' # www.blender.org -mtllib ruins_column.mtl o Cylinder v 0.000000 -1.000000 -1.000000 v 0.000000 1.000000 -1.000000 @@ -198,39 +197,102 @@ vt 0.075084 0.295648 vt 0.046236 0.272471 vt 0.023571 0.245217 vt 0.007959 0.214935 -usemtl Material.001 +vn 0.000000 -0.685700 -0.727900 +vn 0.000000 0.685700 -0.727900 +vn 0.142000 0.685700 -0.713900 +vn 0.142000 -0.685700 -0.713900 +vn 0.278500 0.685700 -0.672500 +vn 0.278500 -0.685700 -0.672500 +vn 0.404400 0.685700 -0.605200 +vn 0.404400 -0.685700 -0.605200 +vn 0.514700 0.685700 -0.514700 +vn 0.514700 -0.685700 -0.514700 +vn 0.605200 0.685700 -0.404400 +vn 0.605200 -0.685700 -0.404400 +vn 0.672500 0.685700 -0.278500 +vn 0.672500 -0.685700 -0.278500 +vn 0.713900 0.685700 -0.142000 +vn 0.713900 -0.685700 -0.142000 +vn 0.727900 0.685700 0.000000 +vn 0.727900 -0.685700 0.000000 +vn 0.713900 0.685700 0.142000 +vn 0.713900 -0.685700 0.142000 +vn 0.672500 0.685700 0.278500 +vn 0.672500 -0.685700 0.278500 +vn 0.605200 0.685700 0.404400 +vn 0.605200 -0.685700 0.404400 +vn 0.514700 0.685700 0.514700 +vn 0.514700 -0.685700 0.514700 +vn 0.404400 0.685700 0.605200 +vn 0.404400 -0.685700 0.605200 +vn 0.278500 0.685700 0.672500 +vn 0.278500 -0.685700 0.672500 +vn 0.142000 0.685700 0.713900 +vn 0.142000 -0.685700 0.713900 +vn 0.000000 0.685700 0.727900 +vn 0.000000 -0.685700 0.727900 +vn -0.142000 0.685700 0.713900 +vn -0.142000 -0.685700 0.713900 +vn -0.278500 0.685700 0.672500 +vn -0.278500 -0.685700 0.672500 +vn -0.404400 0.685700 0.605200 +vn -0.404400 -0.685700 0.605200 +vn -0.514700 0.685700 0.514700 +vn -0.514700 -0.685700 0.514700 +vn -0.605200 0.685700 0.404400 +vn -0.605200 -0.685700 0.404400 +vn -0.672500 0.685700 0.278500 +vn -0.672500 -0.685700 0.278500 +vn -0.713900 0.685700 0.142000 +vn -0.713900 -0.685700 0.142000 +vn -0.727900 0.685700 0.000000 +vn -0.727900 -0.685700 0.000000 +vn -0.713900 0.685700 -0.142000 +vn -0.713900 -0.685700 -0.142000 +vn -0.672500 0.685700 -0.278500 +vn -0.672500 -0.685700 -0.278500 +vn -0.605200 0.685700 -0.404400 +vn -0.605200 -0.685700 -0.404400 +vn -0.514700 0.685700 -0.514700 +vn -0.514700 -0.685700 -0.514700 +vn -0.404400 0.685700 -0.605200 +vn -0.404400 -0.685700 -0.605200 +vn -0.278500 0.685700 -0.672500 +vn -0.278500 -0.685700 -0.672500 +vn -0.142000 0.685700 -0.713900 +vn -0.142000 -0.685700 -0.713900 s 1 -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/6 6/5 8/7 7/8 -f 7/8 8/7 10/9 9/10 -f 9/10 10/9 12/11 11/12 -f 11/13 12/14 14/15 13/16 -f 13/16 14/15 16/17 15/18 -f 15/18 16/17 18/19 17/20 -f 17/20 18/19 20/21 19/22 -f 19/22 20/21 22/23 21/24 -f 21/24 22/23 24/25 23/26 -f 23/26 24/25 26/27 25/28 -f 25/29 26/30 28/31 27/32 -f 27/32 28/31 30/33 29/34 -f 29/34 30/33 32/35 31/36 -f 31/36 32/35 34/37 33/38 -f 33/38 34/37 36/39 35/40 -f 35/40 36/39 38/41 37/42 -f 37/42 38/41 40/43 39/44 -f 39/44 40/43 42/45 41/46 -f 41/46 42/45 44/47 43/48 -f 43/48 44/47 46/49 45/50 -f 45/50 46/49 48/51 47/52 -f 47/52 48/51 50/53 49/54 -f 49/54 50/53 52/55 51/56 -f 51/56 52/55 54/57 53/58 -f 53/58 54/57 56/59 55/60 -f 55/60 56/59 58/61 57/62 -f 57/63 58/64 60/65 59/66 -f 59/66 60/65 62/67 61/68 -f 4/69 2/70 64/71 62/72 60/73 58/74 56/75 54/76 52/77 50/78 48/79 46/80 44/81 42/82 40/83 38/84 36/85 34/86 32/87 30/88 28/89 26/90 24/91 22/92 20/93 18/94 16/95 14/96 12/97 10/98 8/99 6/100 -f 63/101 64/102 2/2 1/1 -f 61/68 62/67 64/102 63/101 -f 1/103 3/104 5/105 7/106 9/107 11/108 13/109 15/110 17/111 19/112 21/113 23/114 25/115 27/116 29/117 31/118 33/119 35/120 37/121 39/122 41/123 43/124 45/125 47/126 49/85 51/84 53/127 55/128 57/129 59/130 61/131 63/132 +f 1/1/1 2/2/2 4/3/3 3/4/4 +f 3/4/4 4/3/3 6/5/5 5/6/6 +f 5/6/6 6/5/5 8/7/7 7/8/8 +f 7/8/8 8/7/7 10/9/9 9/10/10 +f 9/10/10 10/9/9 12/11/11 11/12/12 +f 11/13/12 12/14/11 14/15/13 13/16/14 +f 13/16/14 14/15/13 16/17/15 15/18/16 +f 15/18/16 16/17/15 18/19/17 17/20/18 +f 17/20/18 18/19/17 20/21/19 19/22/20 +f 19/22/20 20/21/19 22/23/21 21/24/22 +f 21/24/22 22/23/21 24/25/23 23/26/24 +f 23/26/24 24/25/23 26/27/25 25/28/26 +f 25/29/26 26/30/25 28/31/27 27/32/28 +f 27/32/28 28/31/27 30/33/29 29/34/30 +f 29/34/30 30/33/29 32/35/31 31/36/32 +f 31/36/32 32/35/31 34/37/33 33/38/34 +f 33/38/34 34/37/33 36/39/35 35/40/36 +f 35/40/36 36/39/35 38/41/37 37/42/38 +f 37/42/38 38/41/37 40/43/39 39/44/40 +f 39/44/40 40/43/39 42/45/41 41/46/42 +f 41/46/42 42/45/41 44/47/43 43/48/44 +f 43/48/44 44/47/43 46/49/45 45/50/46 +f 45/50/46 46/49/45 48/51/47 47/52/48 +f 47/52/48 48/51/47 50/53/49 49/54/50 +f 49/54/50 50/53/49 52/55/51 51/56/52 +f 51/56/52 52/55/51 54/57/53 53/58/54 +f 53/58/54 54/57/53 56/59/55 55/60/56 +f 55/60/56 56/59/55 58/61/57 57/62/58 +f 57/63/58 58/64/57 60/65/59 59/66/60 +f 59/66/60 60/65/59 62/67/61 61/68/62 +f 4/69/3 2/70/2 64/71/63 62/72/61 60/73/59 58/74/57 56/75/55 54/76/53 52/77/51 50/78/49 48/79/47 46/80/45 44/81/43 42/82/41 40/83/39 38/84/37 36/85/35 34/86/33 32/87/31 30/88/29 28/89/27 26/90/25 24/91/23 22/92/21 20/93/19 18/94/17 16/95/15 14/96/13 12/97/11 10/98/9 8/99/7 6/100/5 +f 63/101/64 64/102/63 2/2/2 1/1/1 +f 61/68/62 62/67/61 64/102/63 63/101/64 +f 1/103/1 3/104/4 5/105/6 7/106/8 9/107/10 11/108/12 13/109/14 15/110/16 17/111/18 19/112/20 21/113/22 23/114/24 25/115/26 27/116/28 29/117/30 31/118/32 33/119/34 35/120/36 37/121/38 39/122/40 41/123/42 43/124/44 45/125/46 47/126/48 49/85/50 51/84/52 53/127/54 55/128/56 57/129/58 59/130/60 61/131/62 63/132/64