Ver código fonte

fix not fitting block textures

Kolja Strohm 2 anos atrás
pai
commit
126283898e

+ 6 - 6
FactoryCraft/CraftingGrid.cpp

@@ -127,8 +127,8 @@ void CraftingGridView::api(char* message)
 			info.itemCount = *(int*)(message += 4);
 			if (info.itemCount > 0)
 			{
-				info.damage = *(float*)(message += 4);
-				info.maxDamage = *(float*)(message += 4);
+				info.hp = *(float*)(message += 4);
+				info.maxHp = *(float*)(message += 4);
 				info.durability = *(float*)(message += 4);
 				info.maxDurability = *(float*)(message += 4);
 				info.zItem = itemIcons->z(*(int*)(message += 4));
@@ -180,8 +180,8 @@ void CraftingGridView::api(char* message)
 			{
 				SlotInfo info = slots->get(i);
 				info.itemCount = *(int*)(message + 5);
-				info.damage = *(float*)(message + 9);
-				info.maxDamage = *(float*)(message + 13);
+				info.hp = *(float*)(message + 9);
+				info.maxHp = *(float*)(message + 13);
 				info.durability = *(float*)(message + 17);
 				info.maxDurability = *(float*)(message + 21);
 				info.zItem = itemIcons->z(*(int*)(message + 25));
@@ -202,8 +202,8 @@ void CraftingGridView::api(char* message)
 			info.itemCount = *(int*)(message += 4);
 			if (info.itemCount > 0)
 			{
-				info.damage = *(float*)(message += 4);
-				info.maxDamage = *(float*)(message += 4);
+				info.hp = *(float*)(message += 4);
+				info.maxHp = *(float*)(message += 4);
 				info.durability = *(float*)(message += 4);
 				info.maxDurability = *(float*)(message += 4);
 				info.zItem = itemIcons->z(*(int*)(message += 4));

+ 1 - 1
FactoryCraft/Dimension.cpp

@@ -146,11 +146,11 @@ void Dimension::setChunk(Chunk* chunk, Punkt center)
 	else if (chunk)
 		chunkList.add(chunk);
 	chunks->set(addr, 8, chunk);
+	cs.unlock();
 	if (chunk)
 	{
 		currentGame->setVisibility(chunk, 1);
 	}
-	cs.unlock();
 }
 
 bool Dimension::hasChunck(int x, int y) const

+ 6 - 6
FactoryCraft/InventoryView.cpp

@@ -57,10 +57,10 @@ void SlotInfo::render(int x, int y, Framework::Bild& rObj, bool selected, bool l
 	if (itemCount > 0)
 	{
 		rObj.alphaBild(x + 1, y + 1, 50, 50, *zItem);
-		if (damage < maxDamage)
+		if (hp < maxHp)
 		{
 			rObj.fillRegion(x + 1, y + 47, 50, 2, 0xFF000000);
-			rObj.fillRegion(x + 1, y + 47, (int)((damage / maxDamage) * 50), 2, 0xFFFF0000);
+			rObj.fillRegion(x + 1, y + 47, (int)((hp / maxHp) * 50), 2, 0xFFFFFF00);
 		}
 		if (durability < maxDurability)
 		{
@@ -130,8 +130,8 @@ void InventoryView::api(char* message)
 			info.itemCount = *(int*)(message += 4);
 			if (info.itemCount > 0)
 			{
-				info.damage = *(float*)(message += 4);
-				info.maxDamage = *(float*)(message += 4);
+				info.hp = *(float*)(message += 4);
+				info.maxHp = *(float*)(message += 4);
 				info.durability = *(float*)(message += 4);
 				info.maxDurability = *(float*)(message += 4);
 				info.zItem = itemIcons->z(*(int*)(message += 4));
@@ -183,8 +183,8 @@ void InventoryView::api(char* message)
 			{
 				SlotInfo info = slots->get(i);
 				info.itemCount = *(int*)(message + 5);
-				info.damage = *(float*)(message + 9);
-				info.maxDamage = *(float*)(message + 13);
+				info.hp = *(float*)(message + 9);
+				info.maxHp = *(float*)(message + 13);
 				info.durability = *(float*)(message + 17);
 				info.maxDurability = *(float*)(message + 21);
 				info.zItem = itemIcons->z(*(int*)(message + 25));

+ 2 - 2
FactoryCraft/InventoryView.h

@@ -22,8 +22,8 @@ struct SlotInfo
 {
 	int id;
 	int itemCount;
-	float damage;
-	float maxDamage;
+	float hp;
+	float maxHp;
 	float durability;
 	float maxDurability;
 	Framework::Bild* zItem;

+ 4 - 4
FactoryCraft/ItemBar.cpp

@@ -77,8 +77,8 @@ void ItemBarView::api(char* message)
 			info.itemCount = *(int*)(message += 4);
 			if (info.itemCount > 0)
 			{
-				info.damage = *(float*)(message += 4);
-				info.maxDamage = *(float*)(message += 4);
+				info.hp = *(float*)(message += 4);
+				info.maxHp = *(float*)(message += 4);
 				info.durability = *(float*)(message += 4);
 				info.maxDurability = *(float*)(message += 4);
 				info.zItem = itemIcons->z(*(int*)(message += 4));
@@ -118,8 +118,8 @@ void ItemBarView::api(char* message)
 			{
 				SlotInfo info = slots->get(i);
 				info.itemCount = *(int*)(message + 5);
-				info.damage = *(float*)(message + 9);
-				info.maxDamage = *(float*)(message + 13);
+				info.hp = *(float*)(message + 9);
+				info.maxHp = *(float*)(message + 13);
 				info.durability = *(float*)(message + 17);
 				info.maxDurability = *(float*)(message + 21);
 				info.zItem = itemIcons->z(*(int*)(message + 25));

+ 163 - 155
FactoryCraft/Load.cpp

@@ -21,7 +21,7 @@ void createDefaultCube(Bildschirm* zScreen)
 	float size = 1;
 	float left, right, top, bottom;
 	// Calculate the screen coordinates of the left side of the bitmap.
-	left = (float)((size / 2.0) * -1);
+	left = (float)((-size / 2.0));
 	// Calculate the screen coordinates of the right side of the bitmap.
 	right = left + (float)size;
 	// Calculate the screen coordinates of the top of the bitmap.
@@ -34,124 +34,128 @@ void createDefaultCube(Bildschirm* zScreen)
 	Vertex3D* vertecies = new Vertex3D[24];
 	for (int i = 0; i < 24; i++)
 		vertecies[i].knochenId = 0;
-	vertecies[0].pos = Vec3<float >(left, top, front);
+	// front side
+	vertecies[0].pos = Vec3<float >(left, front, top);
 	vertecies[0].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[1].pos = Vec3<float >(right, top, front);
+	vertecies[1].pos = Vec3<float >(right, front, top);
 	vertecies[1].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[2].pos = Vec3<float >(left, bottom, front);
+	vertecies[2].pos = Vec3<float >(left, front, bottom);
 	vertecies[2].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[3].pos = Vec3<float >(right, bottom, front);
+	vertecies[3].pos = Vec3<float >(right, front, bottom);
 	vertecies[3].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[4].pos = Vec3<float >(left, top, back);
+	// back side
+	vertecies[4].pos = Vec3<float >(right, back, top);
 	vertecies[4].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[5].pos = Vec3<float >(right, top, back);
+	vertecies[5].pos = Vec3<float >(left, back, top);
 	vertecies[5].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[6].pos = Vec3<float >(left, bottom, back);
+	vertecies[6].pos = Vec3<float >(right, back, bottom);
 	vertecies[6].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[7].pos = Vec3<float >(right, bottom, back);
+	vertecies[7].pos = Vec3<float >(left, back, bottom);
 	vertecies[7].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[8].pos = Vec3<float >(left, top, front);
-	vertecies[8].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[9].pos = Vec3<float >(right, top, front);
-	vertecies[9].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[10].pos = Vec3<float >(left, bottom, front);
-	vertecies[10].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[11].pos = Vec3<float >(right, bottom, front);
-	vertecies[11].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[12].pos = Vec3<float >(left, top, back);
+	// left side
+	vertecies[8].pos = Vec3<float >(left, back, top);
+	vertecies[8].tPos = Vec2< float >(0.f, 0.f);
+	vertecies[9].pos = Vec3<float >(left, front, top);
+	vertecies[9].tPos = Vec2< float >(1.f, 0.f);
+	vertecies[10].pos = Vec3<float >(left, back, bottom);
+	vertecies[10].tPos = Vec2< float >(0.f, 1.f);
+	vertecies[11].pos = Vec3<float >(left, front, bottom);
+	vertecies[11].tPos = Vec2< float >(1.f, 1.f);
+	// right side
+	vertecies[12].pos = Vec3<float >(right, front, top);
 	vertecies[12].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[13].pos = Vec3<float >(right, top, back);
+	vertecies[13].pos = Vec3<float >(right, back, top);
 	vertecies[13].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[14].pos = Vec3<float >(left, bottom, back);
+	vertecies[14].pos = Vec3<float >(right, front, bottom);
 	vertecies[14].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[15].pos = Vec3<float >(right, bottom, back);
+	vertecies[15].pos = Vec3<float >(right, back, bottom);
 	vertecies[15].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[16].pos = Vec3<float >(left, top, front);
-	vertecies[16].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[17].pos = Vec3<float >(right, top, front);
-	vertecies[17].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[18].pos = Vec3<float >(left, bottom, front);
-	vertecies[18].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[19].pos = Vec3<float >(right, bottom, front);
-	vertecies[19].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[20].pos = Vec3<float >(left, top, back);
+	// top side
+	vertecies[16].pos = Vec3<float >(left, back, top);
+	vertecies[16].tPos = Vec2< float >(0.f, 0.f);
+	vertecies[17].pos = Vec3<float >(right, back, top);
+	vertecies[17].tPos = Vec2< float >(1.f, 0.f);
+	vertecies[18].pos = Vec3<float >(left, front, top);
+	vertecies[18].tPos = Vec2< float >(0.f, 1.f);
+	vertecies[19].pos = Vec3<float >(right, front, top);
+	vertecies[19].tPos = Vec2< float >(1.f, 1.f);
+	// botom side
+	vertecies[20].pos = Vec3<float >(left, front, bottom);
 	vertecies[20].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[21].pos = Vec3<float >(right, top, back);
+	vertecies[21].pos = Vec3<float >(right, front, bottom);
 	vertecies[21].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[22].pos = Vec3<float >(left, bottom, back);
+	vertecies[22].pos = Vec3<float >(left, back, bottom);
 	vertecies[22].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[23].pos = Vec3<float >(right, bottom, back);
+	vertecies[23].pos = Vec3<float >(right, back, bottom);
 	vertecies[23].tPos = Vec2< float >(1.0f, 1.0f);
 
 	data->setVertecies(vertecies, 24);
-	// the order of the polygons has to be NORTH, EAST, SOUTH, WEST, TOP, BOTTOM according to the Area definition
-	// down side
+	// the order of the polygons has to be NORTH (front), EAST (left), SOUTH (back), WEST (right), TOP, BOTTOM according to the Area definition
+	// front side
 	Polygon3D* p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 6 + 16;
-	p->indexList[1] = 2 + 16;
-	p->indexList[2] = 3 + 16;
-	p->indexList[3] = 6 + 16;
-	p->indexList[4] = 3 + 16;
-	p->indexList[5] = 7 + 16;
+	p->indexList[0] = 0;
+	p->indexList[1] = 2;
+	p->indexList[2] = 1;
+	p->indexList[3] = 1;
+	p->indexList[4] = 2;
+	p->indexList[5] = 3;
 	data->addPolygon(p);
-	// right side
+	// left side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 1 + 8;
-	p->indexList[1] = 7 + 8;
-	p->indexList[2] = 3 + 8;
+	p->indexList[0] = 0 + 8;
+	p->indexList[1] = 2 + 8;
+	p->indexList[2] = 1 + 8;
 	p->indexList[3] = 1 + 8;
-	p->indexList[4] = 5 + 8;
-	p->indexList[5] = 7 + 8;
+	p->indexList[4] = 2 + 8;
+	p->indexList[5] = 3 + 8;
 	data->addPolygon(p);
-	// top side
+	// back side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4 + 16;
-	p->indexList[1] = 1 + 16;
-	p->indexList[2] = 0 + 16;
-	p->indexList[3] = 4 + 16;
-	p->indexList[4] = 5 + 16;
-	p->indexList[5] = 1 + 16;
+	p->indexList[0] = 0 + 4;
+	p->indexList[1] = 2 + 4;
+	p->indexList[2] = 1 + 4;
+	p->indexList[3] = 1 + 4;
+	p->indexList[4] = 2 + 4;
+	p->indexList[5] = 3 + 4;
 	data->addPolygon(p);
-	// left side
+	// right side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 8;
-	p->indexList[1] = 2 + 8;
-	p->indexList[2] = 6 + 8;
-	p->indexList[3] = 0 + 8;
-	p->indexList[4] = 6 + 8;
-	p->indexList[5] = 4 + 8;
+	p->indexList[0] = 0 + 12;
+	p->indexList[1] = 2 + 12;
+	p->indexList[2] = 1 + 12;
+	p->indexList[3] = 1 + 12;
+	p->indexList[4] = 2 + 12;
+	p->indexList[5] = 3 + 12;
 	data->addPolygon(p);
-	// back side
+	// top side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4;
-	p->indexList[1] = 6;
-	p->indexList[2] = 7;
-	p->indexList[3] = 4;
-	p->indexList[4] = 7;
-	p->indexList[5] = 5;
+	p->indexList[0] = 0 + 16;
+	p->indexList[1] = 2 + 16;
+	p->indexList[2] = 1 + 16;
+	p->indexList[3] = 1 + 16;
+	p->indexList[4] = 2 + 16;
+	p->indexList[5] = 3 + 16;
 	data->addPolygon(p);
-	// front side
+	// botom side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0;
-	p->indexList[1] = 3;
-	p->indexList[2] = 2;
-	p->indexList[3] = 0;
-	p->indexList[4] = 1;
-	p->indexList[5] = 3;
+	p->indexList[0] = 0 + 20;
+	p->indexList[1] = 2 + 20;
+	p->indexList[2] = 1 + 20;
+	p->indexList[3] = 1 + 20;
+	p->indexList[4] = 2 + 20;
+	p->indexList[5] = 3 + 20;
 	data->addPolygon(p);
 	data->calculateNormals();
 	data->release();
@@ -163,10 +167,10 @@ void createCubeItem(Bildschirm* zScreen)
 	data->setAmbientFactor(0.8f);
 	data->setDiffusFactor(0.1f);
 	data->setSpecularFactor(0.1f);
-	float size = 0.2f;
+	float size = 0.2;
 	float left, right, top, bottom;
 	// Calculate the screen coordinates of the left side of the bitmap.
-	left = (float)((size / 2.0) * -1);
+	left = (float)((-size / 2.0));
 	// Calculate the screen coordinates of the right side of the bitmap.
 	right = left + (float)size;
 	// Calculate the screen coordinates of the top of the bitmap.
@@ -179,124 +183,128 @@ void createCubeItem(Bildschirm* zScreen)
 	Vertex3D* vertecies = new Vertex3D[24];
 	for (int i = 0; i < 24; i++)
 		vertecies[i].knochenId = 0;
-	vertecies[0].pos = Vec3<float >(left, top, front);
+	// front side
+	vertecies[0].pos = Vec3<float >(left, front, top);
 	vertecies[0].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[1].pos = Vec3<float >(right, top, front);
+	vertecies[1].pos = Vec3<float >(right, front, top);
 	vertecies[1].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[2].pos = Vec3<float >(left, bottom, front);
+	vertecies[2].pos = Vec3<float >(left, front, bottom);
 	vertecies[2].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[3].pos = Vec3<float >(right, bottom, front);
+	vertecies[3].pos = Vec3<float >(right, front, bottom);
 	vertecies[3].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[4].pos = Vec3<float >(left, top, back);
+	// back side
+	vertecies[4].pos = Vec3<float >(right, back, top);
 	vertecies[4].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[5].pos = Vec3<float >(right, top, back);
+	vertecies[5].pos = Vec3<float >(left, back, top);
 	vertecies[5].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[6].pos = Vec3<float >(left, bottom, back);
+	vertecies[6].pos = Vec3<float >(right, back, bottom);
 	vertecies[6].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[7].pos = Vec3<float >(right, bottom, back);
+	vertecies[7].pos = Vec3<float >(left, back, bottom);
 	vertecies[7].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[8].pos = Vec3<float >(left, top, front);
-	vertecies[8].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[9].pos = Vec3<float >(right, top, front);
-	vertecies[9].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[10].pos = Vec3<float >(left, bottom, front);
-	vertecies[10].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[11].pos = Vec3<float >(right, bottom, front);
-	vertecies[11].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[12].pos = Vec3<float >(left, top, back);
+	// left side
+	vertecies[8].pos = Vec3<float >(left, back, top);
+	vertecies[8].tPos = Vec2< float >(0.f, 0.f);
+	vertecies[9].pos = Vec3<float >(left, front, top);
+	vertecies[9].tPos = Vec2< float >(1.f, 0.f);
+	vertecies[10].pos = Vec3<float >(left, back, bottom);
+	vertecies[10].tPos = Vec2< float >(0.f, 1.f);
+	vertecies[11].pos = Vec3<float >(left, front, bottom);
+	vertecies[11].tPos = Vec2< float >(1.f, 1.f);
+	// right side
+	vertecies[12].pos = Vec3<float >(right, front, top);
 	vertecies[12].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[13].pos = Vec3<float >(right, top, back);
+	vertecies[13].pos = Vec3<float >(right, back, top);
 	vertecies[13].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[14].pos = Vec3<float >(left, bottom, back);
+	vertecies[14].pos = Vec3<float >(right, front, bottom);
 	vertecies[14].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[15].pos = Vec3<float >(right, bottom, back);
+	vertecies[15].pos = Vec3<float >(right, back, bottom);
 	vertecies[15].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[16].pos = Vec3<float >(left, top, front);
-	vertecies[16].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[17].pos = Vec3<float >(right, top, front);
-	vertecies[17].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[18].pos = Vec3<float >(left, bottom, front);
-	vertecies[18].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[19].pos = Vec3<float >(right, bottom, front);
-	vertecies[19].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[20].pos = Vec3<float >(left, top, back);
+	// top side
+	vertecies[16].pos = Vec3<float >(left, back, top);
+	vertecies[16].tPos = Vec2< float >(0.f, 0.f);
+	vertecies[17].pos = Vec3<float >(right, back, top);
+	vertecies[17].tPos = Vec2< float >(1.f, 0.f);
+	vertecies[18].pos = Vec3<float >(left, front, top);
+	vertecies[18].tPos = Vec2< float >(0.f, 1.f);
+	vertecies[19].pos = Vec3<float >(right, front, top);
+	vertecies[19].tPos = Vec2< float >(1.f, 1.f);
+	// botom side
+	vertecies[20].pos = Vec3<float >(left, front, bottom);
 	vertecies[20].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[21].pos = Vec3<float >(right, top, back);
+	vertecies[21].pos = Vec3<float >(right, front, bottom);
 	vertecies[21].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[22].pos = Vec3<float >(left, bottom, back);
+	vertecies[22].pos = Vec3<float >(left, back, bottom);
 	vertecies[22].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[23].pos = Vec3<float >(right, bottom, back);
+	vertecies[23].pos = Vec3<float >(right, back, bottom);
 	vertecies[23].tPos = Vec2< float >(1.0f, 1.0f);
 
 	data->setVertecies(vertecies, 24);
-	// the order of the polygons has to be NORTH, EAST, SOUTH, WEST, TOP, BOTTOM according to the Area definition
-	// down side
+	// the order of the polygons has to be NORTH (front), EAST (left), SOUTH (back), WEST (right), TOP, BOTTOM according to the Area definition
+	// front side
 	Polygon3D* p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 6 + 16;
-	p->indexList[1] = 2 + 16;
-	p->indexList[2] = 3 + 16;
-	p->indexList[3] = 6 + 16;
-	p->indexList[4] = 3 + 16;
-	p->indexList[5] = 7 + 16;
+	p->indexList[0] = 0;
+	p->indexList[1] = 2;
+	p->indexList[2] = 1;
+	p->indexList[3] = 1;
+	p->indexList[4] = 2;
+	p->indexList[5] = 3;
 	data->addPolygon(p);
-	// right side
+	// left side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 1 + 8;
-	p->indexList[1] = 7 + 8;
-	p->indexList[2] = 3 + 8;
+	p->indexList[0] = 0 + 8;
+	p->indexList[1] = 2 + 8;
+	p->indexList[2] = 1 + 8;
 	p->indexList[3] = 1 + 8;
-	p->indexList[4] = 5 + 8;
-	p->indexList[5] = 7 + 8;
+	p->indexList[4] = 2 + 8;
+	p->indexList[5] = 3 + 8;
 	data->addPolygon(p);
-	// top side
+	// back side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4 + 16;
-	p->indexList[1] = 1 + 16;
-	p->indexList[2] = 0 + 16;
-	p->indexList[3] = 4 + 16;
-	p->indexList[4] = 5 + 16;
-	p->indexList[5] = 1 + 16;
+	p->indexList[0] = 0 + 4;
+	p->indexList[1] = 2 + 4;
+	p->indexList[2] = 1 + 4;
+	p->indexList[3] = 1 + 4;
+	p->indexList[4] = 2 + 4;
+	p->indexList[5] = 3 + 4;
 	data->addPolygon(p);
-	// left side
+	// right side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 8;
-	p->indexList[1] = 2 + 8;
-	p->indexList[2] = 6 + 8;
-	p->indexList[3] = 0 + 8;
-	p->indexList[4] = 6 + 8;
-	p->indexList[5] = 4 + 8;
+	p->indexList[0] = 0 + 12;
+	p->indexList[1] = 2 + 12;
+	p->indexList[2] = 1 + 12;
+	p->indexList[3] = 1 + 12;
+	p->indexList[4] = 2 + 12;
+	p->indexList[5] = 3 + 12;
 	data->addPolygon(p);
-	// back side
+	// top side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4;
-	p->indexList[1] = 6;
-	p->indexList[2] = 7;
-	p->indexList[3] = 4;
-	p->indexList[4] = 7;
-	p->indexList[5] = 5;
+	p->indexList[0] = 0 + 16;
+	p->indexList[1] = 2 + 16;
+	p->indexList[2] = 1 + 16;
+	p->indexList[3] = 1 + 16;
+	p->indexList[4] = 2 + 16;
+	p->indexList[5] = 3 + 16;
 	data->addPolygon(p);
-	// front side
+	// botom side
 	p = new Polygon3D();
 	p->indexAnz = 6;
 	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0;
-	p->indexList[1] = 3;
-	p->indexList[2] = 2;
-	p->indexList[3] = 0;
-	p->indexList[4] = 1;
-	p->indexList[5] = 3;
+	p->indexList[0] = 0 + 20;
+	p->indexList[1] = 2 + 20;
+	p->indexList[2] = 1 + 20;
+	p->indexList[3] = 1 + 20;
+	p->indexList[4] = 2 + 20;
+	p->indexList[5] = 3 + 20;
 	data->addPolygon(p);
 	data->calculateNormals();
 	data->release();